earthsdk3 3.6.0 → 3.6.1

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,7 +1,7 @@
1
- (function(g,qn){typeof exports=="object"&&typeof module<"u"?qn(exports,require("js-binary-schema-parser"),require("topojson-client"),require("proj4"),require("@turf/turf"),require("zod"),require("zod-to-json-schema")):typeof define=="function"&&define.amd?define(["exports","js-binary-schema-parser","topojson-client","proj4","@turf/turf","zod","zod-to-json-schema"],qn):(g=typeof globalThis<"u"?globalThis:g||self,qn(g.EarthSDK3={},g.jsBinarySchemaParser,g.topojson,g.proj4,g.turf,g.z,g.zodToJsonSchema))})(this,function(g,qn,qo,gp,Yy,vt,Jy){"use strict";var Hb=Object.defineProperty;var qb=(g,qn,qo)=>qn in g?Hb(g,qn,{enumerable:!0,configurable:!0,writable:!0,value:qo}):g[qn]=qo;var d=(g,qn,qo)=>qb(g,typeof qn!="symbol"?qn+"":qn,qo);var si;function mp(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const $y=mp(qo),Qe=mp(Yy);function Ky(){var n;const r=((n=globalThis==null?void 0:globalThis.navigator)==null?void 0:n.userAgent)??"unknown";let e="Unknown";/Windows/.test(r)?e="Windows":/Macintosh/.test(r)?e="MacOS":/Linux/.test(r)?e="Linux":/Android/.test(r)?e="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?t="x64":/x86|i686|Win32/.test(r)?t="x86":/arm64|aarch64/.test(r)?t="arm64":/arm/.test(r)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const Zy=Date.now();function vp(r){var a;const{os:e,arch:t}=Ky(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-Zy)/1e3/60|0,date:new Date().toLocaleString(),href:((a=globalThis==null?void 0:globalThis.location)==null?void 0:a.href)??"unknown",os:e,arch:t},s={method:"GET",headers:new Headers,redirect:"follow"},o=globalThis.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(u=>u.text()).then(u=>console.log(u)).catch(u=>console.log("error",u))}g.copyright=void 0;try{const r="earthsdk3",e="3.6.0",t="2025-12-02T07:57:08.000Z",n="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="04ee2f70959c3a59f42078725bbaf6060780e4f4",a=((Date.now()-1764662228e3)/36e5).toFixed(1),u=`%c🌏 ${r}%c ${e}.${s.slice(0,8)}.${t} (距今${a}个小时)
1
+ (function(g,qn){typeof exports=="object"&&typeof module<"u"?qn(exports,require("js-binary-schema-parser"),require("topojson-client"),require("proj4"),require("@turf/turf"),require("zod"),require("zod-to-json-schema")):typeof define=="function"&&define.amd?define(["exports","js-binary-schema-parser","topojson-client","proj4","@turf/turf","zod","zod-to-json-schema"],qn):(g=typeof globalThis<"u"?globalThis:g||self,qn(g.EarthSDK3={},g.jsBinarySchemaParser,g.topojson,g.proj4,g.turf,g.z,g.zodToJsonSchema))})(this,function(g,qn,qo,gp,Jy,vt,$y){"use strict";var Hb=Object.defineProperty;var qb=(g,qn,qo)=>qn in g?Hb(g,qn,{enumerable:!0,configurable:!0,writable:!0,value:qo}):g[qn]=qo;var d=(g,qn,qo)=>qb(g,typeof qn!="symbol"?qn+"":qn,qo);var si;function mp(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const Ky=mp(qo),Qe=mp(Jy);function Zy(){var n;const r=((n=globalThis==null?void 0:globalThis.navigator)==null?void 0:n.userAgent)??"unknown";let e="Unknown";/Windows/.test(r)?e="Windows":/Macintosh/.test(r)?e="MacOS":/Linux/.test(r)?e="Linux":/Android/.test(r)?e="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?t="x64":/x86|i686|Win32/.test(r)?t="x86":/arm64|aarch64/.test(r)?t="arm64":/arm/.test(r)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const Qy=Date.now();function vp(r){var a;const{os:e,arch:t}=Zy(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-Qy)/1e3/60|0,date:new Date().toLocaleString(),href:((a=globalThis==null?void 0:globalThis.location)==null?void 0:a.href)??"unknown",os:e,arch:t},s={method:"GET",headers:new Headers,redirect:"follow"},o=globalThis.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(u=>u.text()).then(u=>console.log(u)).catch(u=>console.log("error",u))}g.copyright=void 0;try{const r="earthsdk3",e="3.6.1",t="2025-12-04T02:08:23.000Z",n="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="b951704c9cc2a53b6d53468e08f41aec0794d4c0",a=((Date.now()-1764814103e3)/36e5).toFixed(1),u=`%c🌏 ${r}%c ${e}.${s.slice(0,8)}.${t} (距今${a}个小时)
2
2
  %c${i?i+`
3
3
  `:""}当前网站正在使用${r},此软件版权归${n}所有
4
- `;g.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","04ee2f70959c3a59f42078725bbaf6060780e4f4")},get info(){return u},get date(){return"2025-12-02T07:57:08.000Z"},get author(){return"suplyang"},get version(){return"3.6.0"},get name(){return"earthsdk3"},get commitId(){return"04ee2f70959c3a59f42078725bbaf6060780e4f4"},print(){console.info(this.info,`
4
+ `;g.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","b951704c9cc2a53b6d53468e08f41aec0794d4c0")},get info(){return u},get date(){return"2025-12-04T02:08:23.000Z"},get author(){return"suplyang"},get version(){return"3.6.1"},get name(){return"earthsdk3"},get commitId(){return"b951704c9cc2a53b6d53468e08f41aec0794d4c0"},print(){console.info(this.info,`
5
5
  font-size: 18px;
6
6
  font-weight: 1000;
7
7
  line-height: 1;
@@ -18,9 +18,9 @@
18
18
  color: rgb(0, 120, 215);
19
19
  padding-bottom: 2px;
20
20
  padding-left: 35px;
21
- `)}}),globalThis.g_XE3CopyRights=globalThis.g_XE3CopyRights||{},globalThis.g_XE3CopyRights[r]=g.copyright,globalThis.g_XE3SendProductUsageInfo=globalThis.g_XE3SendProductUsageInfo||!0,globalThis.g_XE3SendProductUsageInfo&&(setTimeout(()=>vp(g.copyright),1e3*60),setInterval(()=>vp(g.copyright),24*60*60*1e3)),globalThis.g_earthsdk_copyright_print=globalThis.g_earthsdk_copyright_print??!0,globalThis.g_earthsdk_copyright_print&&g.copyright.print()}catch{console.warn("版本信息有误!")}const yp=new Set;function Xo(r,e=r){yp.has(e)||(yp.add(e),console.warn(r))}function zi(r){const e=Dl(r),t=()=>e[0][e[1]],n=s=>{try{e[0][e[1]]=s}catch(o){Xo(`setValue error, obj(${e[0].constructor.name}) prop(${e[1]}) error(${o})`)}},i=e[0][e[2]];return[t,n,i]}function Qy(){return!0}function t_(){throw new Error("throwOnDestroyed")}function _p(r){for(var e in r)typeof r[e]=="function"&&(r[e]=t_);r.isDestroyed=Qy}const Qc=class Qc{constructor(){d(this,"_memId",++Qc._lastMemId);d(this,"_disposers")}get __v_skip(){return!0}get memId(){return this._memId}get disposers(){return this._disposers||(this._disposers=[]),this._disposers}dispose(e){return this.disposers.push(e),e}d(e){return this.dispose(e)}disposeVar(e){return this.disposers.push(()=>e.destroy()),e}dv(e){return this.disposeVar(e)}tryDisposeVar(e){return this.disposers.push(()=>e.tryDestroy()),e}tdv(e){return this.tryDisposeVar(e)}autoDispose(e){return typeof e=="function"?this.dispose(e):this.disposeVar(e)}ad(e){return typeof e=="function"?this.dispose(e):this.disposeVar(e)}isDestroyed(){return!1}destroyImp(){}destroy(){if(this._toDestroyEvent&&this._toDestroyEvent.emit(),this.destroyImp(),this._disposers)try{const e=this._disposers,t=e.length;for(let n=t-1;n>=0;--n)e[n]();e.length=0,this._disposers=void 0}catch(e){console.error(`destroy get error! ${e}`)}return _p(this)}tryDestory(){if(!this.isDestroyed())return this.destroy()}};d(Qc,"_lastMemId",-1);let V=Qc,nh;function wp(r){nh=r}Object.defineProperties(V.prototype,{toDestroyEvent:{get(){if(this._toDestroyEvent===void 0){if(!nh)throw new Error("Destroyable EventCtor not registered yet!");this._toDestroyEvent=this.disposeVar(new nh)}return this._toDestroyEvent}}});class Tl{constructor(e,t,n=!1){d(this,"_freeElements");d(this,"_usedElementsCount");d(this,"_usedElements");d(this,"_nextCreateID");d(this,"_scratchObjs");this._createDefaultFunc=e,this._destroyFunc=t,this._freeElements=[],this._usedElementsCount=0,this._nextCreateID=1,this._scratchObjs=[],n&&(this._usedElements=[])}get usedElementsCount(){return this._usedElementsCount}get freeElementsCount(){return this._freeElements.length}_getCreateID(){return this._nextCreateID++}_create(){let e;return this._freeElements.length>0?e=this._freeElements.pop():e=this._createDefaultFunc&&this._createDefaultFunc()||{},e._cid=this._getCreateID(),e}create(){return this._create()}multiCreate(e){this._scratchObjs.length=0;for(let t=0;t<e;++t)this._scratchObjs.push(this._create());return this._scratchObjs}_destroy(e){this._destroyFunc&&this._destroyFunc(e),e._cid=void 0}destroy(...e){const t=e.length;for(let n=0;n<t;++n)this._destroy(e[n])}}function e_(){return{item:void 0,previous:void 0,next:void 0}}function n_(r){r.item=void 0,r.previous=void 0,r.next=void 0}const Ep=new Tl(e_,n_,!0);function rh(r,e,t){const n=Ep.create();return n.item=r,n.previous=e,n.next=t,n}function Cp(r){if(!r)throw new Error("node is undefined!");Ep.destroy(r)}function ih(r,e){e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=void 0,r.tail=e.previous):e.next?(e.next.previous=void 0,r.head=e.next):(r.head=void 0,r.tail=void 0),e.next=void 0,e.previous=void 0}class Sp{constructor(e){d(this,"head");d(this,"tail");d(this,"_length");const{needLength:t}=e||{needLength:!0};this.head=void 0,this.tail=void 0,t&&(this._length=0)}_incrementLength(){typeof this._length=="number"&&++this._length}_decrementLength(){typeof this._length=="number"&&--this._length}_setLength(e){typeof this._length=="number"&&(this._length=e)}get length(){return this._length}get empty(){return!this.head}*[Symbol.iterator](){let e=this.head;for(;e;)yield e,e=e.next}remove(e){if(!e)throw new Error("node is undefined!");ih(this,e),this._decrementLength(),Cp(e)}getNode(e){let t=this.head;for(;t!==null;){if(!t)throw new Error("current is undefined!");if(t.item===e)return t;t=t.next}}moveAfter(e,t){if(e!==t){ih(this,t);var n=e.next;e.next=t,this.tail===e?this.tail=t:n&&(n.previous=t),t.next=n,t.previous=e}}moveBefore(e,t){if(e!==t){ih(this,t);var n=e.previous;e.previous=t,this.head===e?this.head=t:n&&(n.next=t),t.previous=n,t.next=e}}insertBefore(e,t){const n=rh(t,e.previous,e);return e.previous&&(e.previous.next=n),e.previous=n,this.head===e&&(this.head=n),this._incrementLength(),n}insertAfter(e,t){const n=rh(t,e,e.next);return e.next&&(e.next.previous=n),e.next=n,this.tail===e&&(this.tail=n),this._incrementLength(),n}_setFirstNode(e){if(this.head||this.tail)throw new Error("_setFirstNode error!");const t=rh(e,void 0,void 0);if(this.head=t,this.tail=t,this._incrementLength(),this._length!==1)throw new Error("_setFirstNode error! this._length !== 1");return t}push(e){return this.tail?this.insertAfter(this.tail,e):this._setFirstNode(e)}pop(){if(!this.tail)throw new Error("DoublyLinkedList is empty!");const e=this.tail.item;return this.remove(this.tail),e}shift(){if(!this.head)throw new Error("DoublyLinkedList is empty!");const e=this.head.item;return this.remove(this.head),e}unshift(e){return this.head?this.insertBefore(this.head,e):this._setFirstNode(e)}removeAll(){let e=this.head;for(;e;){const t=e.next;Cp(e),e=t}this.head=void 0,this.tail=void 0,this._setLength(0)}}function r_(){return{func:void 0,scope:void 0,_hasRemoved:!1,_once:!1}}function i_(r){r.func=void 0,r.scope=void 0,r._hasRemoved=!1,r._once=!1}const Zs=new Tl(r_,i_,!0);class sh{constructor(){d(this,"__dll");d(this,"__currentListenerStack")}get _dll(){return this.__dll=this.__dll??new Sp({needLength:!0}),this.__dll}_pushCurrentListener(e){this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.push(e):this.__currentListenerStack=[this.__currentListenerStack,e]:this.__currentListenerStack=e}_popCurrentListener(){if(this.__currentListenerStack)Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.pop():this.__currentListenerStack=void 0;else throw new Error("cannot pop!")}_hasCurrentListener(e){return this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.indexOf(e)!==-1:this.__currentListenerStack===e:!1}do(...e){if(this.__dll&&!this._dll.empty){let t=this._dll.head;for(;t;){const n=t.item;n._hasRemoved||(this._pushCurrentListener(n),n.func.call(n.scope,...e),this._popCurrentListener());const i=t.next;n._once&&!n._hasRemoved&&(this.remove(t),t=void 0),t&&this._clearHasRemoved(t),t=i}}}get empty(){if(!this.__dll||this._dll.empty)return!0;let e=!0,t=this._dll.head;for(;t;){if(!t.item._hasRemoved){e=!1;break}t=t.next}return e}isHandlerValid(e){return!e.item._hasRemoved}nextHandler(e){if(!e.item._hasRemoved)throw new Error("handler has removed!");let t=e.next;for(;t&&t.item._hasRemoved;)t=t.next;return t}prevHandler(e){if(!e.item._hasRemoved)throw new Error("handler has removed!");let t=e.previous;for(;t&&t.item._hasRemoved;)t=t.previous;return t}moveAfter(e,t){if(e.item._hasRemoved||t.item._hasRemoved)throw new Error("handler or nextHandler has removed!");return this._dll.moveAfter(e,t)}moveBefore(e,t){if(e.item._hasRemoved||t.item._hasRemoved)throw new Error("handler or prevHandler has removed!");return this._dll.moveBefore(e,t)}insertBefore(e,t,n,i=!1){if(e.item._hasRemoved)throw new Error("handler has removed!");const s=Zs.create();return s.func=t,s.scope=n,s._once=i,this._dll.insertBefore(e,s)}insertAfter(e,t,n,i=!1){if(e.item._hasRemoved)throw new Error("handler has removed!");const s=Zs.create();return s.func=t,s.scope=n,s._once=i,this._dll.insertAfter(e,s)}_clearHasRemoved(e){e.item._hasRemoved&&!this._hasCurrentListener(e.item)&&(Zs.destroy(e.item),this._dll.remove(e))}remove(e){if(!e.item||e.item._hasRemoved)throw new Error("handler has removed!");this._hasCurrentListener(e.item)?e.item._hasRemoved=!0:(Zs.destroy(e.item),this._dll.remove(e))}removeAll(){if(this.__dll&&!this._dll.empty){let e=this._dll.head;for(;e;){const t=e.next;e.item._hasRemoved||this.remove(e),e=t}}}destroy(){if(!this.__dll)return;let e=this._dll.head;for(;e;){const t=e.next,n=e;this._hasCurrentListener(n.item)||(console.warn("Event has remove item that on current stack!"),console.warn(`${n.item.func.toString()}`)),Zs.destroy(n.item),this._dll.remove(n),e=t}this.__dll=void 0,this.__currentListenerStack=void 0}push(e,t,n=!1){const i=Zs.create();return i.func=e,i.scope=t,i._once=n,this._dll.push(i)}pop(){const e=this.tail;if(!e)throw new Error("pop error!");this.remove(e)}shift(){const e=this.head;if(!e)throw new Error("shift error!");this.remove(e)}unshift(e,t,n=!1){const i=Zs.create();return i.func=e,i.scope=t,i._once=n,this._dll.unshift(i)}get tail(){let e=this._dll.tail;for(;e&&e.item._hasRemoved;)e=e.previous;return e}get head(){let e=this._dll.head;for(;e&&e.item._hasRemoved;)e=e.previous;return e}}class Eu{constructor(){d(this,"_listenerHandler");d(this,"_cid")}_reset(e,t){this._listenerHandler=e,this._cid=t}clone(e){return e=e??new Eu,e._reset(this._listenerHandler,this._cid),e}get valid(){if(typeof this._listenerHandler<"u"&&typeof this._cid=="number"){const e=this._listenerHandler._cid;if(typeof e<"u"&&this._cid===e)return!0}return!1}}class oh extends Eu{}let O=class extends V{constructor(){super(...arguments);d(this,"__pipe");d(this,"beforeCallback");d(this,"afterCallback")}get _pipe(){return this.__pipe=this.__pipe??new sh,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}emit(...t){!this.isDestroyed()&&this.beforeCallback&&this.beforeCallback(...t),!this.isDestroyed()&&this._pipe.do(...t),!this.isDestroyed()&&this.afterCallback&&this.afterCallback(...t)}on(t,n,i=!1,s){const o=i?this._pipe.unshift(t,n,!1):this._pipe.push(t,n,!1);return s=s??new oh,s._reset(o,o._cid),s}disposableOn(t,n,i=!1,s){const o=this.on(t,n,i,s);return()=>{o.valid&&this.off(o)}}don(t,n,i=!1,s){return this.disposableOn(t,n,i,s)}disposableWeakOn(t,n,i=!1,s){const o=new V,a=()=>{!o.isDestroyed()&&o.destroy()};return o.dispose(this.disposableOn(t,n,i,s)),o.dispose(this.toDestroyEvent.disposableOn(a)),a}dwon(t,n,i=!1,s){return this.disposableWeakOn(t,n,i,s)}once(t,n,i=!1,s){const o=i?this._pipe.unshift(t,n,!0):this._pipe.push(t,n,!0);return s=s??new oh,s._reset(o,o._cid),s}disposableOnce(t,n,i=!1,s){const o=this.once(t,n,i,s);return()=>o.valid&&this.off(o)}donce(t,n,i=!1,s){const o=this.once(t,n,i,s);return()=>o.valid&&this.off(o)}off(t){if(!t.valid)throw new Error("handler is not valid!");this._pipe.remove(t._listenerHandler),t._reset()}reset(){this._pipe.removeAll()}destroyImp(){this.empty||(Xo("The event is destroying with listeners!"),this._pipe.removeAll())}};wp(O);function Yo(r,e){return e=e??new Eu,e._reset(r,r._cid),e}class s_{constructor(){d(this,"__pipe")}get _pipe(){return this.__pipe=this.__pipe??new sh,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}do(...e){return this._pipe.do(...e)}isHandlerValid(e){return e.valid?this._pipe.isHandlerValid(e._listenerHandler):!1}moveAfter(e,t){if(!e.valid||!t.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(e._listenerHandler,t._listenerHandler)}moveBefore(e,t){if(!e.valid||!t.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(e._listenerHandler,t._listenerHandler)}insertBefore(e,t,n,i=!1,s){if(!e.valid)throw new Error("handler is not valid!");const o=this._pipe.insertBefore(e._listenerHandler,t,n,i);return Yo(o,s)}insertAfter(e,t,n,i=!1,s){if(!e.valid)throw new Error("handler is not valid!");const o=this._pipe.insertAfter(e._listenerHandler,t,n,i);return Yo(o,s)}remove(e){if(!e.valid)throw new Error("handler is not valid!");return this._pipe.remove(e._listenerHandler)}removeAll(){return this._pipe.removeAll()}push(e,t,n=!1,i){const s=this._pipe.push(e,t,n);return Yo(s,i)}pop(){return this._pipe.pop()}shift(){return this._pipe.shift()}unshift(e,t,n=!1,i){const s=this._pipe.unshift(e,t,n);return Yo(s,i)}getTail(e){const t=this._pipe.tail;if(t)return Yo(t,e)}getHead(e){const t=this._pipe.head;if(t)return Yo(t,e)}}class ze extends V{constructor(t,n,i){super();d(this,"_changed");d(this,"_value");d(this,"_oldValue");d(this,"toChangeFunc");this._equalsFunc=n,this._assignFunc=i,this._value=this._assignFunc&&this._assignFunc(t,void 0)||t}get assignFunc(){return this._assignFunc}get equalsFunc(){return this._equalsFunc}equals(t){return this._equalsFunc?this._equalsFunc(this._value,t):this._value===t}set value(t){if(this._equalsFunc?!this._equalsFunc(this._value,t):this._value!==t){if(this.toChangeFunc&&!this.toChangeFunc(t,this._value))return;this._assignFunc?(this._oldValue=this._assignFunc(this._value,this._oldValue),this._value=this._assignFunc(t,this._value)):(this._oldValue=this._value,this._value=t),this._changed&&this._changed.emit(t,this._oldValue)}}get value(){return this._value}get changed(){return this._changed||(this._changed=this.disposeVar(new O)),this._changed}forceChange(){this._changed&&this._changed.emit(this._value,this._value)}}function j(r,e,t){return new ze(r,e,t)}function dt(r){return new ze(r,(e,t)=>e.length!==t.length?!1:e.every((n,i)=>n===t[i]),(e,t)=>{const n=t||new Array(e.length);return n.length=e.length,e.forEach((i,s)=>n[s]=i),n})}function re(r){return j(r,(e,t)=>e===void 0||t===void 0?e===void 0&&t===void 0:e.length!==t.length?!1:e.every((n,i)=>n===t[i]),(e,t)=>{if(!e)return;const n=t||new Array(e.length);return n.length=e.length,e.forEach((i,s)=>n[s]=i),n})}function Ol(r,e,t){return j(r,(n,i)=>n.length!==i.length?!1:n.every((s,o)=>e&&e(s,i[o])||s===i[o]),(n,i)=>{const s=i||new Array(n.length);return s.length=n.length,n.forEach((o,a)=>{s[a]=t?t(o):o}),s})}function vs(r,e,t){return j(r,(n,i)=>n===void 0||i===void 0?n===void 0&&i===void 0:n.length!==i.length?!1:n.every((s,o)=>e&&e(s,i[o])||s===i[o]),(n,i)=>{if(!n)return;const s=i||new Array(n.length);return s.length=n.length,n.forEach((o,a)=>{s[a]=t?t(o):o}),s})}function wt(r){return new ze(r,(e,t)=>e===t||e!==void 0&&t!==void 0&&JSON.stringify(e)===JSON.stringify(t),(e,t)=>{if(e!==void 0)return JSON.parse(JSON.stringify(e))})}function Qt(r){return new ze(r,(e,t)=>e===t||e!==void 0&&t!==void 0&&JSON.stringify(e)===JSON.stringify(t),(e,t)=>{if(e!==void 0)return JSON.parse(JSON.stringify(e))})}function o_(r){return new ze(r,(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;const n=Object.keys(e),i=Object.keys(t);return n.length!==i.length?!1:n.every((s,o)=>s===i[o]&&e[s]===t[s])},(e,t)=>e&&{...e})}function a_(r){return new ze(r,(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;const n=Object.keys(e),i=Object.keys(t);return n.length!==i.length?!1:n.every((s,o)=>s===i[o]&&e[s]===t[s])},(e,t)=>e&&{...e})}function u_(r){return Ol(r,(e,t)=>e.every((n,i)=>n===t[i]),e=>[...e])}function ah(r){return vs(r,(e,t)=>e.every((n,i)=>n===t[i]),e=>[...e])}function l_(r){return Ol(r,(e,t)=>JSON.stringify(e)===JSON.stringify(t),e=>JSON.parse(JSON.stringify(e)))}function c_(r){return vs(r,(e,t)=>JSON.stringify(e)===JSON.stringify(t),e=>JSON.parse(JSON.stringify(e)))}function Nl(r){return ah(r)}function bp(r){return vs(r,(e,t)=>e.length===t.length&&e.every((n,i)=>n.every((s,o)=>s===t[i][o])),e=>e.map(t=>[...t]))}function h_(r){return vs(r,(e,t)=>e.length===t.length&&e.every((n,i)=>n.every((s,o)=>s===t[i][o])),e=>e.map(t=>[...t]))}function Dl(r){const e=r instanceof ze?[r,"value","changed"]:[...r];return e[2]=e[2]||e[1]+"Changed",e}function uh(r,e,t,n=!1){e[2]=e[2]||e[1]+"Changed";const i=()=>{const s=e[0][e[1]];t?r[0][r[1]]=t(s):r[0][r[1]]=s};return i(),n?e[0][e[2]].disposableWeakOn(i):e[0][e[2]].disposableOn(i)}function d_(r,e,t,n,i=!1){const s=uh(r,e,t,i),o=uh(e,r,n,i);return()=>(s(),o())}function B(r,e,t,n=!1){const i=r instanceof ze?[r,"value","changed"]:r,s=e instanceof ze?[e,"value","changed"]:e;return uh(i,s,t,n)}function nt(r,e,t,n,i=!1){const s=Dl(r),o=Dl(e);return d_(s,o,t,n,i)}function f_(r,e,t,n=!1){const[i]=zi(e);return nt(r,e,s=>s??t,s=>{if(!(s===t&&i()===void 0))return s},n)}function Jo(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var e=Math.random()*16|0,t=r==="x"?e:e&3|8;return t.toString(16)})}function Ml(r,e){if(!globalThis||!globalThis.setTimeout||!globalThis.clearTimeout)throw new Error("目前只适合在浏览器中使用!");let t=0;function n(){t>0&&(globalThis.clearTimeout(t),t=0)}function i(...s){n(),t=globalThis.setTimeout(r,e,...s)}return[i,n]}function lh(r,e,...t){const n=setInterval(r,e,...t);return()=>clearInterval(n)}function ch(r,e,...t){const n=setTimeout(r,e,...t);return()=>clearTimeout(n)}function Rl(r,...e){let t;const n=()=>{const i=performance.now();r(i,...e),t=requestAnimationFrame(n)};return n(),()=>typeof t<"u"&&(cancelAnimationFrame(t),t=void 0)}function $o(r,...e){let t;return t=requestAnimationFrame(()=>{const i=performance.now();r(i,...e)}),()=>typeof t<"u"&&(cancelAnimationFrame(t),t=void 0)}function Cu(r,...e){let t=!1,n;return new Promise((i,s)=>{n=s,i()}).then(()=>{!t&&r(...e)}).catch(i=>{console.error(i)}),()=>(t=!0)&&n&&(n("nextMicroTask cancelled!"),n=void 0)}class Ll extends O{constructor(t,n,...i){super();d(this,"_cancellFunc");this._nextFunc=t,this.dispose(()=>{this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0)}),i.forEach(s=>this.dispose(s[n?"dwon":"don"](()=>{this.next()})))}next(){this._cancellFunc||(this._cancellFunc=this._nextFunc(()=>(this._cancellFunc=void 0,this.emit())))}flush(){this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0,this.emit())}}class hh extends Ll{constructor(...e){super(Cu,!1,...e)}}function p_(...r){return new hh(...r)}class g_ extends Ll{constructor(...e){super(Cu,!0,...e)}}function m_(...r){return new hh(...r)}class Fl extends Ll{constructor(...e){super($o,!1,...e)}}function Ie(...r){return new Fl(...r)}function v_(r,e){return new Fl(...r).don(e())}class Pp extends Ll{constructor(...e){super($o,!0,...e)}}function y_(...r){return new Pp(...r)}function Ui(r,e,t={time:"don",immediate:!1}){const n=new Fl(...Array.isArray(r)?r:[r]),i=n[t.time??"don"](e);return(t.immediate??!1)&&e(),()=>{i(),n.destroy()}}function Su(r){let e;if(typeof r.next=="function")e=r;else if(typeof r[Symbol.iterator]=="function")e=r[Symbol.iterator]();else throw new Error("iteratorOrIterable error!");return e}function dh(r,e){let t=!1;const n=Su(r);let i=-1;for(;;){const{done:s,value:o}=n.next();if(s)break;if(e(o,++i)){t=!0;break}}return t}function fh(r,e){return!dh(r,(n,i)=>!e(n,i))}function bu(r,e,t,n){const i=r;if(!i[e]){const s=n(),o=Object.fromEntries(Object.entries(s).filter(([a,u])=>{const l=Object.getPrototypeOf(t),c=a in l;if(c){const h=u instanceof ze?u.value:u;r[a]=h}return!c}).map(([a,u])=>u instanceof ze?[a,u]:[a,Array.isArray(u)?re(u):j(u)]));i[e]=o}return i[e]}function Gi(r,e){var n;const t=Symbol(`${(n=r==null?void 0:r.constructor)==null?void 0:n.name}-createDefaultProps`);r.constructor.__xbsj_dpSymbol=t,r.constructor.__xbsj_createDefaultProps=e;for(let[i,s]of Object.entries(e()))if(!Reflect.has(r,i)){const o=function(a){var c,h;if(a[t])return;const u=[];let l=Object.getPrototypeOf(a);for(;l;)u.push(l),l=Object.getPrototypeOf(l);u.reverse();for(let f of u){const p=(c=f.constructor)==null?void 0:c.__xbsj_dpSymbol;if(!p)continue;const v=(h=f.constructor)==null?void 0:h.__xbsj_createDefaultProps;v&&bu(a,p,f,v)}};Object.defineProperties(r,{[i]:{get(){return o(this),bu(this,t,r,e)[i].value},set(a){o(this);const u=bu(this,t,r,e)[i];if(!u){console.error("!propObj");debugger}u.value=a}},[`${i}Changed`]:{get(){return o(this),bu(this,t,r,e)[i].changed}},[`${i}React`]:{get(){return o(this),bu(this,t,r,e)[i]}}})}}const Pu=new WeakMap;function fi(r,e,t){Pu.has(r)||Pu.set(r,{});const n=Pu.get(r);n[e]=t}function Xn(r,e){return Pu.has(r)?Pu.get(r)[e]:void 0}function pi(r,e){const t=Su(r);let n=0;for(;;){const{done:i,value:s}=t.next();if(i)break;e(s,n++)}}function Iu(r,e,t){const n=Su(r);let i=t,s=0;for(;;){const{done:o,value:a}=n.next();if(o)break;i=e(i,a,s++)}return i}const __=r=>++r;function ph(r){return Iu(r,__,0)}function Wi(r){return Iu(r,(e,t)=>e>t?e:t,Number.NEGATIVE_INFINITY)}function ys(r){return Iu(r,(e,t)=>e<t?e:t,Number.POSITIVE_INFINITY)}function Ip(r,e){let t=r;for(let n of e)t=t[n];return t}function w_(r,e,t){if(e.length===0)throw new Error("props的数量必须大于0");const n=e.length-1,i=e[n];let s=r;for(let o=0;o<n;++o){const a=e[o];typeof s[a]>"u"&&(s[a]={}),s=s[a]}s[i]=t}function*Qs(r,e){const t=Su(r);for(;;){const{done:n,value:i}=t.next();if(n)break;yield Ip(i,e)}}class xu extends V{constructor(){super();d(this,"_innerObj");d(this,"_toChangeEvent");d(this,"_changedEvent");this._innerObj=[],this.dispose(()=>{if(this.length=0,this._innerObj.length>0)throw new Error("this._innerObj.length > 0");this._toChangeEvent&&this._toChangeEvent.reset(),this._innerObj=void 0})}get toChangeEvent(){return this._toChangeEvent||(this._toChangeEvent=new O),this._toChangeEvent}get changedEvent(){return this._changedEvent||(this._changedEvent=new O),this._changedEvent}_resetArray(t){this._toChangeEvent&&this._toChangeEvent.emit([{start:0,deleteCount:this._innerObj.length,items:t}],this);const{length:n}=t;this._innerObj.length=n;for(let i=0;i<n;++i)this._innerObj[i]=t[i];this._changedEvent&&this._changedEvent.emit(this)}splice(t,n,...i){const{length:s}=this._innerObj;t=t>this._innerObj.length?this._innerObj.length:t,t>s?t=s:t<0&&(t+=s,t<0&&(t=0));const o=this._innerObj.length-t;if(n>o?n=o:n<0&&(n=0),arguments.length===1){this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:this._innerObj.length-t,items:[]}],this);const a=this._innerObj.splice(t);return this._changedEvent&&this._changedEvent.emit(this),a}else if(arguments.length===2){this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:n,items:[]}],this);const a=this._innerObj.splice(t,n);return this._changedEvent&&this._changedEvent.emit(this),a}else{this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:n,items:i}],this);const a=this._innerObj.splice(t,n,...i);return this._changedEvent&&this._changedEvent.emit(this),a}}pop(){if(this._innerObj.length===0)return;if(this._toChangeEvent){const n=this._innerObj.length-1,i=1,s=[];this._toChangeEvent.emit([{start:n,deleteCount:i,items:s}],this)}const t=this._innerObj.pop();return this._changedEvent&&this._changedEvent.emit(this),t}push(...t){if(this._toChangeEvent){const i=this._innerObj.length;this._toChangeEvent.emit([{start:i,deleteCount:0,items:t}],this)}const n=this._innerObj.push(...t);return this._changedEvent&&this._changedEvent.emit(this),n}get length(){return this._innerObj.length}set length(t){if(t<0)throw new Error("value < 0");const{length:n}=this._innerObj;if(n!==t){if(this._toChangeEvent){let i,s,o;n>t?(i=t,s=n-t,o=[]):(i=n,s=0,o=new Array(t-n)),this._toChangeEvent.emit([{start:i,deleteCount:s,items:o}],this)}this._innerObj.length=t,this._changedEvent&&this._changedEvent.emit(this)}}get(t){return this._innerObj[t]}set(t,n){const{length:i}=this._innerObj;if(t<0||t>=i)throw new Error("index < 0 || index >= length");this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:1,items:[n]}],this),this._innerObj[t]=n,this._changedEvent&&this._changedEvent.emit(this)}indexOf(t){return this._innerObj.indexOf(t)}[Symbol.iterator](){return this._innerObj[Symbol.iterator]()}}function gh(r,e,...t){let n=r;for(let i of t){if(!n[i])if(e)n[i]={};else return;n=n[i]}return n}function E_(r,e,t){typeof t>"u"&&(e.endsWith(".gltf")?t="model/gltf+json":e.endsWith(".bin")?t="application/octet-stream":e.endsWith(".glb")?t="model/gltf-binary":e.endsWith(".jpg")||e.endsWith(".jpeg")?t="image/jpeg":e.endsWith(".png")?t="image/png":e.endsWith(".glsl")?t="text/plain":e.endsWith(".json")?t="application/json":e.endsWith(".b3dm")||e.endsWith(".i3dm")||e.endsWith("pnts")||e.endsWith("cmpt")?t="application/octet-stream":console.warn(`save ${e}: MimeType无法确定!`));const n=new Blob([r],{type:t||""});let i=URL.createObjectURL(n);var s=document.createElement("a"),o=new MouseEvent("click");s.download=e,s.href=i,s.dispatchEvent(o),URL.revokeObjectURL(i)}function C_(r,e){const t=document.createElement("a"),n=new MouseEvent("click");t.download=e||"下载",t.href=r,t.dispatchEvent(n)}function S_(){return new Promise((r,e)=>{const t=performance.now();requestAnimationFrame(n=>r(n>t))})}const Al=r=>{let e,t;return t=n=>{n=performance.now(),e=requestAnimationFrame(t),r(n)},e=requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}};function mh(r,e,t=Al){let n=Number.NEGATIVE_INFINITY,i;function s(u){u-n>e&&i&&(r(...i),i=void 0,n=u)}const o=t&&t(s)||void 0;function a(...u){i=u}return[a,o]}const xp=[];function Tp(r,e,t){if(xp.includes(r)){console.warn(`_loadJs ${r} has loaded before!`),e&&e();return}var n=document.getElementsByTagName("head")[0],i=document.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",r),i.onload=i.onreadystatechange=function(){this.readyState&&this.readyState!=="complete"||(xp.push(r),e&&e(),i.onload=i.onreadystatechange=null)},i.onerror=(s,o,a,u,l)=>{t(l)},n.appendChild(i)}function vh(r,e=!0){if(e){const t=globalThis.L;globalThis.L&&(globalThis.L=void 0);const n=globalThis.define;return globalThis.define&&(globalThis.define=void 0),new Promise((i,s)=>{Tp(r,i,s)}).then(()=>(globalThis.define=n,globalThis.L=t,Promise.resolve()))}else return new Promise((t,n)=>{Tp(r,t,n)})}async function Op(r,e=""){return new Promise((t,n)=>{var i=new Image;i.crossOrigin=e,i.src=r,i.onload=()=>t(i),i.onerror=s=>n(s)})}class b_ extends V{constructor(e){super(),this._owner=e}get owner(){return this._owner}}function P_(r,e){if(r.length%3!==0)throw new Error("positions.length % 3 !== 0");const t=r.length/3;function*n(o){for(let a=0;a<t;++a)yield r[a*3+o]}const i=(e==null?void 0:e.min)??[NaN,NaN,NaN],s=(e==null?void 0:e.max)??[NaN,NaN,NaN];return i[0]=ys(n(0))??NaN,i[1]=ys(n(1))??NaN,i[2]=ys(n(2))??NaN,s[0]=Wi(n(0))??NaN,s[1]=Wi(n(1))??NaN,s[2]=Wi(n(2))??NaN,{min:i,max:s}}async function I_(r,e=fetch){const t=await e(r);return t.ok?await t.arrayBuffer():void 0}function kl(r,...e){if(r>16)throw new Error("length > 16");const t=new Array(r);for(let n=0;n<r;++n)t[n]=e[n]??0;return t}class Vl{constructor(e,t){this._xyzw=e,this._length=t}set 0(e){this._xyzw.x=e}set 1(e){this._xyzw.y=e}set 2(e){this._xyzw.z=e}set 3(e){this._xyzw.w=e}get 0(){return this._xyzw.x??0}get 1(){return this._xyzw.y??0}get 2(){return this._xyzw.z??0}get 3(){return this._xyzw.w??0}get length(){return this._length}}function x_(r){return new Vl(r,2)}function T_(r){return new Vl(r,3)}function O_(r){return new Vl(r,4)}class N_{constructor(e,t,n,i){this._array=e,this._length=t,this._start=n,this._stride=i}get length(){return this._length}set 0(e){this._array[this._start+0*this._stride]=e}set 1(e){this._array[this._start+1*this._stride]=e}set 2(e){this._array[this._start+2*this._stride]=e}set 3(e){this._array[this._start+3*this._stride]=e}set 4(e){this._array[this._start+4*this._stride]=e}set 5(e){this._array[this._start+5*this._stride]=e}set 6(e){this._array[this._start+6*this._stride]=e}set 7(e){this._array[this._start+7*this._stride]=e}set 8(e){this._array[this._start+8*this._stride]=e}set 9(e){this._array[this._start+9*this._stride]=e}set 10(e){this._array[this._start+10*this._stride]=e}set 11(e){this._array[this._start+11*this._stride]=e}set 12(e){this._array[this._start+12*this._stride]=e}set 13(e){this._array[this._start+13*this._stride]=e}set 14(e){this._array[this._start+14*this._stride]=e}set 15(e){this._array[this._start+15*this._stride]=e}set 16(e){this._array[this._start+16*this._stride]=e}get 0(){return this._array[this._start+0*this._stride]}get 1(){return this._array[this._start+1*this._stride]}get 2(){return this._array[this._start+2*this._stride]}get 3(){return this._array[this._start+3*this._stride]}get 4(){return this._array[this._start+4*this._stride]}get 5(){return this._array[this._start+5*this._stride]}get 6(){return this._array[this._start+6*this._stride]}get 7(){return this._array[this._start+7*this._stride]}get 8(){return this._array[this._start+8*this._stride]}get 9(){return this._array[this._start+9*this._stride]}get 10(){return this._array[this._start+10*this._stride]}get 11(){return this._array[this._start+11*this._stride]}get 12(){return this._array[this._start+12*this._stride]}get 13(){return this._array[this._start+13*this._stride]}get 14(){return this._array[this._start+14*this._stride]}get 15(){return this._array[this._start+15*this._stride]}get 16(){return this._array[this._start+16*this._stride]}}function D_(r,e,t=0,n=1){return new N_(r,e,t,n)}g.Vector=void 0,(r=>{function e(z,...G){if(z=z||kl(G.length),G.length>z.length)throw new Error("args.length > target.length");return z instanceof Float64Array?z.set(G):x(G,z),z}r.set=e;function t(z,G){const ft=z.length;for(let Vt=0;Vt<ft;++Vt)if(!G(z[Vt],Vt))return!1;return!0}r.every=t;function n(z,G,ft){const Vt=z.length;let ne=ft;for(let we=0;we<Vt;++we)ne=G(ne,z[we],we);return ne}r.reduce=n;function*i(z){for(let G=0;G<z.length;++G)yield z[G]}r.itr=i;const s=(z,G)=>z+=G*G;function o(z){return n(z,s,0)}r.magnitudeSquared=o;function a(z){const G=o(z);return Math.sqrt(G)}r.magnitude=a;function u(z,G=1e-5){const ft=o(z);return Math.abs(ft-1)<G}r.isNormalized=u;let l;const c=(z,G,ft)=>z+G*l[ft];function h(z,G){return b(z,G),l=G,n(z,c,0)}r.dot=h;let f;const p=(z,G,ft)=>z+=(G-f[ft])*(G-f[ft]);function v(z,G){return b(z,G),f=G,n(z,p,0)}r.distanceSquared=v;function C(z,G){return Math.sqrt(v(z,G))}r.distance=C;let S;const P=(z,G)=>z===S[G];function y(z,G){return b(z,G),S=G,t(z,P)}r.equals=y;let _,m;const w=(z,G)=>Math.abs(z-_[G])<m;function E(z,G,ft=0){return b(z,G),_=G,m=ft,t(z,w)}r.equalsEpsilon=E;function b(z,G){if(z.length!==G.length)throw new Error("left.length !== right.length")}function I(z,G,ft){const Vt=z.length;ft=ft||kl(Vt),b(z,ft);for(let ne=0;ne<Vt;++ne)ft[ne]=G(z[ne],ne);return ft}r.op1=I;function T(z,G,ft,Vt){b(z,G),Vt&&b(z,Vt);const ne=z.length;Vt=Vt||kl(ne);for(let we=0;we<ne;++we)Vt[we]=ft(z[we],G[we]);return Vt}r.op2=T;const D=z=>z;function x(z,G){return I(z,D,G)}r.clone=x;let N=0;const L=(z,G)=>z*N;function A(z,G,ft){return N=G,I(z,L,ft)}r.multiplyByScalar=A;function J(z,G,ft=0){const Vt=o(z);if(Vt<=ft)return;const ne=Math.sqrt(Vt);return A(z,1/ne,G)}r.normalize=J;function H(z,G){return A(z,-1,G)}r.negate=H;const Z=z=>Math.abs(z);function ct(z,G){return I(z,Z,G)}r.abs=ct;const mt=z=>z-Math.floor(z);function Y(z,G){return I(z,mt,G)}r.fract=Y;const $=(z,G)=>z-G;function K(z,G,ft){return T(z,G,$,ft)}r.subtract=K;const Et=(z,G)=>z+G;function kt(z,G,ft){return T(z,G,Et,ft)}r.add=kt;const Nt=(z,G)=>z*G;function Dt(z,G,ft){return T(z,G,Nt,ft)}r.multiply=Dt;const zt=(z,G)=>z/G;function ye(z,G,ft){return T(z,G,zt,ft)}r.divide=ye;let Zt;const Sn=(z,G)=>z*(1-Zt)+G*Zt;function bn(z,G,ft,Vt){return Zt=ft,T(z,G,Sn,Vt)}r.lerp=bn})(g.Vector||(g.Vector={}));function jl(r,e=0,t=1){return r<e?e:r>t?t:r}class Bl extends V{constructor(t,n,i,s,o,a,u,l){super();d(this,"__status");d(this,"_statusChangedEvent");d(this,"_forceCancelFunc");d(this,"_startEvent");d(this,"_progressEvent");d(this,"_completeEvent");d(this,"_cancelEvent");d(this,"_cancelledEvent");d(this,"_errorEvent");d(this,"_finishedEvent");d(this,"_processingID",-1);this._startProcessingFunc=t,this.startFunc=n,this.progressFunc=i,this.completeFunc=s,this.cancelFunc=o,this.cancelledFunc=a,this.errorFunc=u,this.finishedFunc=l,this._status="Initial",this.dispose(()=>{var c;return(c=this._statusChangedEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._startEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._progressEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._completeEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._cancelEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._cancelledEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._errorEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._finishedEvent)==null?void 0:c.destroy()}),this.dispose(()=>this.reset())}get startEvent(){return this._startEvent=this._startEvent||new O,this._startEvent}get progressEvent(){return this._progressEvent=this._progressEvent||new O,this._progressEvent}get completeEvent(){return this._completeEvent=this._completeEvent||new O,this._completeEvent}get cancelEvent(){return this._cancelEvent=this._cancelEvent||new O,this._cancelEvent}get cancelledEvent(){return this._cancelledEvent=this._cancelledEvent||new O,this._cancelledEvent}get errorEvent(){return this._errorEvent=this._errorEvent||new O,this._errorEvent}get finishedEvent(){return this._finishedEvent=this._finishedEvent||new O,this._finishedEvent}_completeFunc(t,n){this.processingID===t&&this._status==="Running"&&(this._status="Completed",this.completeFunc&&this.completeFunc(n),this._completeEvent&&this._completeEvent.emit(n),this.finishedFunc&&this.finishedFunc({status:"Completed",value:n}),this._finishedEvent&&this._finishedEvent.emit({status:"Completed",value:n}))}_cancelFunc(t){this._status==="Running"&&(this._status="Cancelling",this.cancelFunc&&this.cancelFunc(t),this._cancelEvent&&this._cancelEvent.emit(t))}_cancelledFunc(t){this._status==="Cancelling"&&(this._status="Cancelled",this.cancelledFunc&&this.cancelledFunc(t),this._cancelledEvent&&this._cancelledEvent.emit(t),this.finishedFunc&&this.finishedFunc({status:"Cancelled",cancelError:t}),this._finishedEvent&&this._finishedEvent.emit({status:"Cancelled",cancelError:t}))}_errorFunc(t,n){this.processingID===t&&this._status==="Running"&&(this._status="Error",this.errorFunc&&this.errorFunc(n),this._errorEvent&&this._errorEvent.emit(n),this.finishedFunc&&this.finishedFunc({status:"Error",error:n}),this._finishedEvent&&this._finishedEvent.emit({status:"Error",error:n}))}_progressFunc(t,n){this.processingID===t&&this._status==="Running"&&(this.progressFunc&&this.progressFunc(n),this._progressEvent&&this._progressEvent.emit(n))}_startFunc(...t){if(this._status==="Initial"){this._status="Running";const n=++this._processingID,i={completeFunc:this._completeFunc.bind(this,n),errorFunc:this._errorFunc.bind(this,n),progressFunc:this._progressFunc.bind(this,n),cancelFunc:this._cancel.bind(this,n),processingID:n},s=this._startProcessingFunc(i,...t);return this._forceCancelFunc=s,this.startFunc&&this.startFunc(...t),this._startEvent&&this._startEvent.emit(...t),n}else return console.warn("this._status !== 'Initial' but start again!"),-1}set _status(t){if(this.__status!==t){const n=this.__status;this.__status=t,this._statusChangedEvent&&this._statusChangedEvent.emit(t,n)}}get _status(){return this.__status}get processingID(){return this._processingID}get statusChangedEvent(){return this._statusChangedEvent||(this._statusChangedEvent=new O),this._statusChangedEvent}reset(t){this._status==="Running"&&this.cancel(t),this._status==="Cancelled"||this._status==="Error"||this._status==="Completed"?this._status="Initial":this._status==="Cancelling"&&console.warn("Cannot reset! (this._status === 'Cancelling')")}get status(){return this._status}cancel(t,n=this.processingID){return this._cancel(n,t)}_cancel(t,n){if(this.processingID===t)if(this._status==="Running"){if(!this._forceCancelFunc)throw new Error("this._forceCancelFunc is undefined!");this._cancelFunc(n);const i=this._forceCancelFunc(n);if(this._forceCancelFunc=void 0,i&&i instanceof Promise)return i.then(()=>{this._cancelledFunc(n)});this._cancelledFunc(n)}else console.warn("this._status !== 'Running' but cancel")}start(...t){try{return this._startFunc(...t)}catch(n){console.error(`processing start error: ${n}`)}}restart(t,...n){try{return this.isRunning&&this.cancel(t),this.isFinished&&this.reset(t),this.isInitial?this._startFunc(...n):(console.warn("restart failed!"),-1)}catch(i){console.error(`processing restart error: ${i}`)}}get isCompleted(){return this._status==="Completed"}get isCancelled(){return this._status==="Cancelled"}get isCancelling(){return this._status==="Cancelling"}get isError(){return this._status==="Error"}get isInitial(){return this._status==="Initial"}get isRunning(){return this._status==="Running"}get isFinished(){return this.isCancelled||this.isCompleted||this.isError}}let yh=class extends Error{};function Np(r,e){typeof r=="function"?r(e):r.cancelFunc=e}class _h extends Bl{constructor(t=300){super(({progressFunc:n,completeFunc:i,errorFunc:s})=>{const[o,a]=Ml(()=>{if(!this._lastDebounceValue)throw new Error("!this._lastDebounceValue");n([this._lastDebounceValue,this._debouncTimes]),this._debouncTimes=0},this._delayTime);return this._d=o,()=>{a()}});d(this,"_lastDebounceValue");d(this,"_debouncTimes",0);d(this,"_d");this._delayTime=t}get delayTime(){return this._delayTime}debounce(...t){this.isRunning?(++this._debouncTimes,this._lastDebounceValue=t,this._d&&this._d()):console.warn("Debouncing is not running!")}}function Dp(r,e,...t){const n=new AbortController;let i=n.signal,[s,o]=t;if(o!=null&&o.signal)throw console.error("init?.signal"),new Error("init?.signal");o=o||{},o.signal=i;let a=!1;Np(r,()=>{a=!0,n.abort()});let u=fetch(s,o);return e&&(u=u.then(l=>{if(!l.ok)return l;if(!l.body)throw Error("ReadableStream not yet supported in this browser.");const c=l.headers.get("content-length"),h=c?parseInt(c,10):0;let f=0;return new Response(new ReadableStream({start(p){if(!l.body)throw new Error("!response.body");const v=l.body.getReader();C();function C(){v.read().then(({done:S,value:P})=>{if(S){p.close();return}if(!P)throw new Error("!value");if(!e)throw new Error("!progressFunc");f+=P.byteLength,e(f,h),p.enqueue(P),C()}).catch(S=>{p.error(S)})}}}),{status:l.status,statusText:l.statusText,headers:l.headers})}).catch(l=>{throw a?(l instanceof Error&&l.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new yh("fetching cancelled!")):(l instanceof Error&&l.code===20&&console.error("error.code === 20"),l)})),u}function Mp(...r){if(r.length>=1)if(typeof r[0]=="function"||typeof r[0]>"u"){const e={};let t=Dp(e,...r);const{cancelFunc:n}=e;if(!n)throw new Error("!cancelResult.cancelFunc");return[n,t]}else return Dp(...r);throw new Error("cancelableFetch args error!")}class M_ extends Bl{constructor(t,...n){super(({progressFunc:i,completeFunc:s,errorFunc:o},...a)=>{const u={};let l={loaded:0,total:0};const c=(p,v)=>{l.loaded=p,l.total=v,i(l)},h=this._fetchArgs||a;if(h.length===0)throw new Error("fetchArgs.length === 0");if(Mp(u,c,...h).then(t).then(s).catch(p=>{p instanceof yh||o(p)}),!u.cancelFunc)throw new Error("!cancelResult.cancelFunc");return u.cancelFunc});d(this,"_fetchArgs");n.length>0&&(this._fetchArgs=n)}get fetchArgs(){return this._fetchArgs}}function wh(r,e,t,n){const i="_"+e,s="_"+e+"Changed",o=e+"Changed";Object.defineProperties(r.prototype,{[e]:{get(){return typeof this[i]>"u"&&typeof t<"u"&&(this[i]=t),this[i]},set(a){if(typeof this[i]>"u"&&typeof t<"u"&&(this[i]=t),n?!n(this[i],a):this[i]!==a){const u=this[i];this[i]=a,this[s]&&this[s].emit(a,u)}}},[o]:{get(){return typeof this[s]>"u"&&(this[s]=new O,typeof this.dispose<"u"&&this.dispose(()=>this[s].destroy())),this[s]}}})}class Eh extends Bl{constructor(t,n=!0){super(({progressFunc:i,completeFunc:s,errorFunc:o})=>(this._intervalFunc=i,this._intervalID&&console.error("this._intervalID should be undefined!"),this.leading&&i(),this._intervalID=setInterval(i,this.intervalTime),()=>{if(!this._intervalID)throw console.error("this._intervalID should not be undefined!"),new Error("this._intervalID should not be undefined!");clearInterval(this._intervalID),this._intervalID=void 0}));d(this,"_intervalID");d(this,"_intervalFunc");this.intervalTime=t,this.leading=n,this.dispose(this.intervalTimeChanged.disposableOn(()=>{this._intervalID&&this._intervalFunc&&(clearInterval(this._intervalID),this._intervalID=setInterval(this._intervalFunc,this.intervalTime))}))}}wh(Eh,"leading",!0),wh(Eh,"intervalTime",500);function R_(r,e){let t,n;const i=new Promise((o,a)=>{n=a,t=globalThis.setTimeout(()=>{t=void 0,o()},r)}),s=o=>{t&&(clearTimeout(t),t=void 0),n&&n(o??new yh("sleep cancel error!"))};if(typeof e=="boolean"&&e)return[s,i];if(e)return Np(e,s),i}class L_{constructor(e=0,t=0,n=0,i,s){d(this,"_processData");d(this,"_lastUpdateTimeStamp",0);this.startTime=e,this.duration=t,this.delay=n,this.proccessFunc=i,this.completeFunc=s,this._processData={ratio:0,timeStamp:0,timeStampFromStart:0,timeStampFromLastUpdate:0}}update(e){const t=(e-this.startTime)/this.duration;t>=0&&(this._processData.ratio=t,this._processData.timeStamp=e,this._processData.timeStampFromStart=e-this.startTime,this._processData.timeStampFromLastUpdate=e-this._lastUpdateTimeStamp,this._lastUpdateTimeStamp=e,this.proccessFunc&&this.proccessFunc(this._processData),t>=1&&this.completeFunc&&this.completeFunc())}start(){this.startTime=performance.now()+this.delay,this._lastUpdateTimeStamp=this.startTime}}class Rp extends Bl{constructor(t=1e3,n=0,i=Al){let s;function o(){s&&s()}super(({progressFunc:u,completeFunc:l,errorFunc:c})=>{const h=this.startUpdateFunc&&this.startUpdateFunc(this._base.update.bind(this._base))||void 0;return this._base.startTime=performance.now(),this._base.duration=this.duration,this._base.delay=this.delay,this._base.proccessFunc=u,this._base.completeFunc=()=>{h&&h(),l()},this._base.start(),s=h,o});d(this,"_base");d(this,"duration");d(this,"delay");d(this,"startUpdateFunc");this._base=new L_,this.duration=t,this.delay=n,this.startUpdateFunc=i}get startTime(){return this._base.startTime}}class F_ extends V{constructor(t){super();d(this,"_target",0);d(this,"_current",0);d(this,"_start",0);d(this,"_timing",new Rp(Number.POSITIVE_INFINITY));d(this,"_currentChanged");this._duration=t,this._timing.progressFunc=({ratio:n})=>{n=n<0?0:n>1?1:n;const i=this._start*(1-n)+this._target*n;this._current=i,this._currentChanged&&this._currentChanged.emit(this._target,this._current)},this.dispose(()=>{this._timing.isRunning&&this._timing.cancel(),this._timing.destroy()})}reset(t,n=t){this._timing.isRunning&&this._timing.cancel(),this._target=t,this._current=n,this._start=t}set target(t){if(this._target!==t){this._target=t,this._timing.isRunning&&this._timing.cancel(),this._timing.reset(),this._start=this._current;const n=Math.abs(this._target-this._start);this._timing.duration=n*this._duration,this._timing.start()}}get target(){return this._target}get current(){return this._current}get currentChanged(){return this._currentChanged||(this._currentChanged=new O),this._currentChanged}}function Lp(r,e){e=e||[];const t=r.parentNode;return t?Lp(t,e.concat(t)):e}function A_(r){const e=r.composedPath&&r.composedPath()||r.path,t=r.target;if(e!=null)return e.indexOf(globalThis)<0?e.concat(globalThis):e;if(t===globalThis)return[globalThis];if(t===null)throw new Error("target === null");return[t].concat(Lp(t),globalThis)}function ln(r,e=!1){const{offsetX:t,offsetY:n}=r;let i=t,s=n;{const o=A_(r);for(let a=0;a<o.length;++a){const u=o[a];if(u!==r.currentTarget&&u instanceof HTMLElement)i+=u.clientLeft,s+=u.clientTop,i+=u.offsetLeft,s+=u.offsetTop;else break}}return e?[i*globalThis.devicePixelRatio,s*globalThis.devicePixelRatio]:[i,s]}function Ko(r,e=!1){const t=r.target,n=r.currentTarget||r.__xbsj_lastCurrentTarget__;if(!t||!n)return[r.clientX,r.clientY];const i=t.getBoundingClientRect(),s=n.getBoundingClientRect(),o=i.left+r.offsetX,a=i.top+r.offsetY,u=o-s.left,l=a-s.top;return e?[u*globalThis.devicePixelRatio,l*globalThis.devicePixelRatio]:[u,l]}class Fp extends V{constructor(t){super();d(this,"_clickEvent",new O);d(this,"_dbclickEvent",new O);d(this,"_downEvent",new O);d(this,"_upEvent",new O);d(this,"_moveEvent",new O);d(this,"_debouncing",new _h(300));this.dispose(()=>{this._clickEvent.destroy(),this._dbclickEvent.destroy(),this._downEvent.destroy(),this._upEvent.destroy(),this._moveEvent.destroy(),this._debouncing.destroy()});let n=!1,i=[0,0],s=!1;this._debouncing.progressFunc=([[c,h,f],p])=>{p===1?this._clickEvent.emit(c,h,f):p>=2?this._dbclickEvent.emit(c,h,f):console.error("point click should not be here!")},this._debouncing.start(),this.dispose(()=>{this._debouncing.isRunning&&this._debouncing.cancel(),this._debouncing.destroy()});const o=c=>{n=!0;const[h,f]=ln(c);i[0]=h,i[1]=f,this._downEvent.emit(h,f,c)},a=c=>{const[h,f]=ln(c);n&&!s&&this._debouncing.debounce(h,f,c),n=!1,s=!1,this._upEvent.emit(h,f,c)},u=c=>{const[h,f]=ln(c);if(n&&!s){const[p,v]=i;(Math.abs(h-p)>3||Math.abs(f-v)>3)&&(s=!0)}this._moveEvent.emit(h,f,c)},l=()=>{n=!1,s=!1};t.addEventListener("pointerdown",o),t.addEventListener("pointerup",a),t.addEventListener("pointermove",u),t.addEventListener("pointerout",l),this.dispose(()=>{t.removeEventListener("pointerdown",o),t.removeEventListener("pointerup",a),t.removeEventListener("pointermove",u),t.removeEventListener("pointerout",l)})}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}get downEvent(){return this._downEvent}get upEvent(){return this._upEvent}get moveEvent(){return this._moveEvent}}class Ch extends V{constructor(){super();d(this,"_pickRectEvent",this.disposeVar(new O));d(this,"_updateRectEvent",this.disposeVar(new O));d(this,"_pointerActionEvent",this.disposeVar(new O));d(this,"_active",this.disposeVar(j(!1)));d(this,"_pickRect",{left0:0,top0:0,left1:0,top1:0});let t=0,n=0,i=0,s=0;this.dispose(this._pointerActionEvent.disposableOn(({type:o,left:a,top:u})=>{o==="PointerDown"?(this._active.value=!0,t=a,n=u,i=a,s=u,this._setPickRect({left0:t,top0:n,left1:i,top1:s}),this._updateRectEvent.emit(this._pickRect)):o==="PointerMove"?this._active.value&&(i=a,s=u,this._setPickRect({left0:t,top0:n,left1:i,top1:s}),this._updateRectEvent.emit(this._pickRect)):o==="PointerUp"&&this._active.value&&(this._active.value=!1,i=a,s=u,this._setPickRect({left0:t,top0:n,left1:i,top1:s}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect))}))}_setPickRect({left0:t,left1:n,top0:i,top1:s}){this._pickRect.left0=t,this._pickRect.left1=n,this._pickRect.top0=i,this._pickRect.top1=s}pointerDown(t,n){this._pointerActionEvent.emit({type:"PointerDown",left:t,top:n})}pointerMove(t,n){this._pointerActionEvent.emit({type:"PointerMove",left:t,top:n})}pointerUp(t,n){this._pointerActionEvent.emit({type:"PointerUp",left:t,top:n})}reset(){this._setPickRect({left0:0,top0:0,left1:0,top1:0}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect)}get activeEvent(){return this._active.changed}get updateRectEvent(){return this._updateRectEvent}get pickRectEvent(){return this._pickRectEvent}static getLeftTopAndSize(t,n){n=n||{left:0,top:0,width:0,height:0,forward:!0};const{left0:i,top0:s,left1:o,top1:a}=t;return n.width=Math.abs(i-o),n.height=Math.abs(s-a),n.left=Math.min(i,o),n.top=Math.min(s,a),n.forward=o>i,n}static contains(t,n,i){const{left:s,top:o,width:a,height:u}=i;return t>s&&t<=s+a&&n>=o&&n<=o+u}}class k_ extends Ch{constructor(e){super();const t=this.disposeVar(new Fp(e));this.dispose(t.downEvent.disposableOn((o,a,u)=>u.altKey&&this.pointerDown(o,a))),this.dispose(t.moveEvent.disposableOn((o,a)=>this.pointerMove(o,a))),this.dispose(t.upEvent.disposableOn((o,a)=>this.pointerUp(o,a)));const n=document.createElement("div");n.style.backgroundColor="rgba(0, 0, 0, 0)",n.style.border="2px dashed red",n.style.position="absolute",n.style.boxSizing="border-box",n.style.pointerEvents="none",n.style.height="0px",n.style.width="0px",n.style.left="0px",n.style.top="0px",n.style.display="none",e.appendChild(n),this.dispose(()=>e.removeChild(n)),this.dispose(this.activeEvent.disposableOn(o=>{n.style.display=o?"block":"none"}));const i=()=>{this.reset()};e.addEventListener("contextmenu",i),this.dispose(()=>e.removeEventListener("contextmenu",i));const s={left:0,top:0,width:0,height:0,forward:!1};this.dispose(this.updateRectEvent.disposableOn(o=>{if(Ch.getLeftTopAndSize(o,s)){const{left:a,top:u,width:l,height:c}=s;n.style.height=`${c|0}px`,n.style.width=`${l|0}px`,n.style.left=`${a|0}px`,n.style.top=`${u|0}px`}}))}}class Fr extends Error{}function _s(r,e){Xn(r,"_promise_cancel")&&console.warn("setPromiseCancel warn: promise has cancelFunc!"),fi(r,"_promise_cancel",e)}function Zo(r){return Xn(r,"_promise_cancel")}function Qo(r){return!!Zo(r)}function Sh(r,e){const t=Zo(r);return t?(t(e),!0):!1}function bh(r){const[e,t]=r;return _s(t,e),t}function ta(r){let e;const t=new Promise((n,i)=>{e=i,r.then(n).catch(i)});return _s(t,e),t}function V_(r){let e,t;var n=new Promise((i,s)=>{t=r.disposableOn((...o)=>{t&&t(),i(o)}),e=o=>{t&&t(),s(o)}});return[e,n]}function j_(r){const e=new O,t=new O;return r.then(n=>{e.isDestroyed()||e.emit(n)}).catch(n=>{t.isDestroyed()||t.emit(n)}),[e,t]}class Ph extends V{constructor(){super();d(this,"_cancelled",!1);d(this,"_cancelError");d(this,"_promiseSet",new Set);d(this,"_disposer")}get disposer(){return this._disposer=this._disposer||new V,this._disposer}destroyImp(){this.finally()}cancel(t){var n;if(!this._cancelled){this._cancelled=!0,(n=this._disposer)==null||n.destroy(),this._cancelError=t;for(let i of this._promiseSet)Sh(i);this._promiseSet.clear()}}get cancelFuncsNum(){return Iu(this._promiseSet,t=>t+1,0)}finally(){this._disposer&&!this._disposer.isDestroyed()&&this._disposer.destroy(),this._promiseSet.clear()}check(){if(this._cancelled)throw this._cancelError??new Fr("cancel from CancelManager!")}promise(t){return this._promiseSet.add(t),t.finally(()=>(this._promiseSet.delete(t),this.check()))}promiseAny(t){const n=[],i=t.map(s=>(this._promiseSet.add(s),Qo(s)&&n.push(Zo(s)),s.finally(()=>this._promiseSet.delete(s))));return Promise.any(i).finally(()=>(n.forEach(s=>s(new Fr("cancel from promiseAny!"))),n.length=0))}promiseAll(t){const n=[],i=t.map(s=>(this._promiseSet.add(s),Qo(s)&&n.push(Zo(s)),s.finally(()=>this._promiseSet.delete(s))));return Promise.all(i).finally(()=>(n.forEach(s=>s(new Fr("cancel from promiseAll!"))),n.length=0))}promiseRace(t){const n=[],i=t.map(s=>(this._promiseSet.add(s),Qo(s)&&n.push(Zo(s)),s.finally(()=>this._promiseSet.delete(s))));return Promise.race(i).finally(()=>(n.forEach(s=>s(new Fr("cancel from promiseRace!"))),n.length=0))}}class Fe extends V{constructor(t){super();d(this,"_status","Initial");d(this,"_completeEvent");d(this,"_errorEvent");d(this,"_completeFunc");d(this,"_errorFunc");d(this,"_cancelFunc");d(this,"_runningId",-1);this._startFunc=t,this.dispose(()=>this.isRunning&&this.cancel())}get errorEvent(){return this._errorEvent||(this._errorEvent=new O),this._errorEvent}get completeEvent(){return this._completeEvent||(this._completeEvent=new O),this._completeEvent}get errorFunc(){return this._errorFunc}get completeFunc(){return this._completeFunc}set errorFunc(t){this._errorFunc!==t&&(this._errorFunc=t)}set completeFunc(t){this._completeFunc!==t&&(this._completeFunc=t)}start(...t){if(this._status!=="Initial")return;const n=++this._runningId;this._status="Running",this._cancelFunc=this._startFunc({completeFunc:i=>{var s;n===this._runningId&&this._status==="Running"&&(this._status="Completed",this._completeFunc&&this._completeFunc(i),(s=this._completeEvent)==null||s.emit(i))},errorFunc:i=>{var s;n===this._runningId&&this._status==="Running"&&(this._status="Error",this._errorFunc&&this._errorFunc(i),(s=this._errorEvent)==null||s.emit(i))},runningingID:n},...t)}cancel(t=new Fr("")){var n;if(this._status==="Running"){if(!this._cancelFunc)throw new Error("!this._cancelFunc");this._status="Error",this._errorFunc&&this._errorFunc(t),(n=this._errorEvent)==null||n.emit(t),this._cancelFunc(t),this._cancelFunc=void 0}}reset(){this._status==="Running"&&console.error("processing cannot reset while running. you can first cancel it!"),(this._status==="Completed"||this._status==="Error")&&(this._status="Initial")}get status(){return this._status}get isInitial(){return this._status==="Initial"}get isRunning(){return this._status==="Running"}get isCompleted(){return this._status==="Completed"}get isError(){return this._status==="Error"}get runningId(){return this._runningId}restart(t=new Fr(""),...n){this.isRunning&&this.cancel(t),this.reset(),this.start(...n)}restartIfNotRunning(...t){this.isRunning||(this.reset(),this.start(...t))}}function Tu(r){return(e,...t)=>{const n=new Ph,{completeFunc:i,errorFunc:s}=e,o=r(n,...t).then(i).catch(s).finally(()=>n.destroy());return _s(o,n.cancel.bind(n)),a=>Sh(o,a)}}class B_ extends Fe{constructor(){super(({errorFunc:t},n,i)=>{try{const[s,o]=Ml(n,i);return this._doFunc=s,o}catch(s){return t(s),()=>{}}});d(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class z_ extends Fe{constructor(t,n){super(({errorFunc:i})=>{try{const[s,o]=Ml(t,n);return this._doFunc=s,o}catch(s){return i(s),()=>{}}});d(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}function U_(r){return new Fe(Tu((e,...t)=>e.promise(r(...t))))}function G_(r,...e){return new Fe(Tu(t=>t.promise(r(...e))))}function zl(r){return U_((...e)=>{const t=r(...e);return Qo(t)?t:ta(t)})}function Ih(r,...e){return G_(()=>{const t=r(...e);return Qo(t)?t:ta(t)})}function W_(r){let e;const t=new Promise((n,i)=>{e=()=>{r(),i()}});return _s(t,e),t}function H_(r,...e){const t=new Ph,n=r(t,...e).finally(()=>t.destroy());return _s(n,t.cancel.bind(t)),n}function Yn(r){return new Fe(Tu(r))}function q_(r,...e){return new Fe(Tu(t=>r(t,...e)))}function Ap(r,...e){const t=new AbortController;let n=t.signal,[i,s]=e;if(s!=null&&s.signal)throw console.error("init?.signal"),new Error("init?.signal");s=s||{},s.signal&&console.warn("revocableFetch error: init.signal would be override!"),s.signal=n;let o=!1;const a=()=>{o=!0,t.abort()};let u=fetch(i,s);return r&&(u=u.then(l=>{if(!l.ok)return l;if(!l.body)throw Error("ReadableStream not yet supported in this browser.");const c=l.headers.get("content-length");c||console.warn("response.headers.get('content-length') is undefined... cannot get contentLength!");const h=c?parseInt(c,10):0;let f=0;return new Response(new ReadableStream({start(p){if(!l.body)throw new Error("!response.body");const v=l.body.getReader();C();function C(){v.read().then(({done:S,value:P})=>{if(S){p.close();return}if(!P)throw new Error("!value");if(!r)throw new Error("!progressFunc");f+=P.byteLength,r(f,h),p.enqueue(P),C()}).catch(S=>{p.error(S)})}}}),{status:l.status,statusText:l.statusText,headers:l.headers})}).catch(l=>{throw o?(l instanceof Error&&l.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new Fr(`fetching cancelled! error: ${l}`)):(l instanceof Error&&l.code===20&&console.error("error.code === 20"),l)})),_s(u,a),u}function X_(r,...e){return Ap(r,...e)}function xh(...r){return Ap(void 0,...r)}function Y_(){return zl(xh)}function J_(...r){return Ih(xh,...r)}function Th(r,...e){let t=-1;var n=new Promise((i,s)=>{r.isRunning&&r.cancel(),r.reset();const o=new V;o.dispose(r.completeEvent.disposableOn(a=>{if(i(a),o.isDestroyed()){debugger;console.error(`disposer is destroyed! ${o}`);return}o.destroy()})),o.dispose(r.errorEvent.disposableOn(a=>{if(s(a),o.isDestroyed()){debugger;console.error(`disposer is destroyed! ${o}`);return}o.destroy()})),r.start(...e),t=r.runningId});return[i=>t===r.runningId&&r.isRunning&&r.cancel(i),n]}function gi(r,e,...t){try{return e(...t)}catch(n){r(n)}}function $_(){return new Fe(({completeFunc:r,errorFunc:e},t)=>$o(()=>gi(e,()=>{t&&t(),r()})))}function K_(r){return new Fe(({completeFunc:e,errorFunc:t})=>$o(()=>gi(t,()=>{r&&r(),e()})))}function Z_(){return new Fe(({completeFunc:r,errorFunc:e},t)=>Cu(()=>{gi(e,()=>{t&&t(),r()})}))}function Q_(r){return new Fe(({completeFunc:e,errorFunc:t})=>Cu(()=>{gi(t,()=>{r&&r(),e()})}))}function kp(){return new Fe(({completeFunc:r,errorFunc:e},t,n)=>ch(()=>{gi(e,()=>{t&&t(),r()})},n??1e3))}function Vp(r,e){return new Fe(({completeFunc:t,errorFunc:n})=>ch(()=>{gi(n,()=>{r&&r(),t()})},e??1e3))}function t0(){return new Fe(({errorFunc:r},e,t=1e3)=>lh(()=>gi(r,e),t))}function e0(r,e=1e3){return new Fe(({errorFunc:t})=>lh(()=>gi(t,r),e))}function Ou(){return new Fe(({errorFunc:r},e)=>Rl(t=>gi(r,e,t)))}function ea(r){return new Fe(({errorFunc:e})=>Rl(t=>gi(e,r,t)))}function Nu(r,...e){let t,n;const i=new Promise((o,a)=>{n=a,t=globalThis.setTimeout(()=>{t=void 0,o(e)},r)});return _s(i,o=>{t&&(clearTimeout(t),t=void 0),n&&n(o??new Fr("sleep cancel error!"))}),i}function n0(){return zl(Nu)}function r0(r,...e){return Ih(Nu,r,...e)}function to(r,e,...t){return r.promise(bh(Th(Yn(async(n,...i)=>(r.disposer.dispose(()=>{n.isDestroyed()||n.cancel()}),await e(n,...i))),...t)))}function i0(r,e,...t){return r.promise(bh(Th(e,...t)))}class s0 extends Fe{constructor(){super(({errorFunc:t},n,i)=>{try{const[s,o]=mh(n,i);return this._doFunc=s,o}catch(s){return t(s),()=>{}}});d(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class o0 extends Fe{constructor(t,n){super(({errorFunc:i})=>{try{const[s,o]=mh(t,n);return this._doFunc=s,o}catch(s){return i(s),()=>{}}});d(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class Ul extends V{constructor(t=1e3,n=Al){super();d(this,"_speed");d(this,"_speedChangedEvent");d(this,"_duration");d(this,"_durationChangedEvent");d(this,"_loop");d(this,"startUpdateFunc");d(this,"_updateBindThis");d(this,"_cancelStartUpdateFunc");d(this,"_startTimeStamp");d(this,"_playingChangedEvent");d(this,"_startPlayingEvent");d(this,"_stopPlayingEvent");d(this,"_loopChangedEvent");d(this,"_currentTime",this.disposeVar(j(0)));this._speed=1,this._duration=t,this._loop=!1,this.startUpdateFunc=n,this._updateBindThis=this._update.bind(this),this.dispose(()=>{this._cancelStartUpdateFunc&&(this._cancelStartUpdateFunc(),this._cancelStartUpdateFunc=void 0)}),this._startTimeStamp=Number.NaN,this.dispose(()=>{this._startPlayingEvent&&this._startPlayingEvent.reset(),this._stopPlayingEvent&&this._stopPlayingEvent.reset()})}get startPlayingEvent(){return this._startPlayingEvent=this._startPlayingEvent||new O,this._startPlayingEvent}get stopPlayingEvent(){return this._stopPlayingEvent=this._stopPlayingEvent||new O,this._stopPlayingEvent}get currentTimeChangedEvent(){return this._currentTime.changed}get loopChangedEvent(){return this._loopChangedEvent=this._loopChangedEvent||new O,this._loopChangedEvent}set loop(t){this._loop!==t&&(this._loop=t,this._loopChangedEvent&&this._loopChangedEvent.emit(this._loop))}get loop(){return this._loop}_update(t){if(Number.isNaN(this._startTimeStamp))console.warn("Number.isNaN(this._startTimeStamp)");else{const n=(t-this._startTimeStamp)*this._speed;this._setCurrentTimeInner(n)}}get currentTime(){return this._currentTime.value}set currentTime(t){this._setCurrentTimeInner(t),this._resetStartTime()}_setCurrentTimeInner(t){this._currentTime.value!==t&&(this._duration<=0?this._currentTime.value=0:t<0?this.loop?this._currentTime.value=this._duration+t%this._duration:(this._currentTime.value=0,this.playing&&this._stopPlaying()):t>this._duration?this.loop?this._currentTime.value=t%this._duration:(this._currentTime.value=this._duration,this.playing&&this._stopPlaying()):this._currentTime.value=t)}get durationChangedEvent(){return this._durationChangedEvent||(this._durationChangedEvent=new O),this._durationChangedEvent}get duration(){return this._duration}set duration(t){var n;if(t<0)console.warn("duration sholud greater than 0!");else if(this._duration!==t){const i=this._duration;this._duration=t,this._currentTime.value>this._duration&&(this._currentTime.value=this._duration),(n=this._durationChangedEvent)==null||n.emit(this._duration,i)}}get speedChangedEvent(){return this._speedChangedEvent||(this._speedChangedEvent=new O),this._speedChangedEvent}get speed(){return this._speed}set speed(t){var n;if(this._speed!==t&&t!==0){const i=this._speed;this._speed=t,this._resetStartTime(),(n=this._speedChangedEvent)==null||n.emit(this._speed,i)}}_resetStartTime(){this._startTimeStamp=performance.now()-this._currentTime.value/this._speed}_startPlaying(){var t,n;this._resetStartTime(),this._cancelStartUpdateFunc=this.startUpdateFunc(this._updateBindThis),(t=this._startPlayingEvent)==null||t.emit(this._currentTime.value),(n=this._playingChangedEvent)==null||n.emit(!0)}_stopPlaying(){var t,n;if(!this._cancelStartUpdateFunc)throw new Error("this._cancelStartUpdateFunc is undefined!");this._cancelStartUpdateFunc(),this._cancelStartUpdateFunc=void 0,(t=this._stopPlayingEvent)==null||t.emit(this._currentTime.value),(n=this._playingChangedEvent)==null||n.emit(!1)}get playingChangedEvent(){return this._playingChangedEvent||(this._playingChangedEvent=new O),this._playingChangedEvent}get playing(){return!!this._cancelStartUpdateFunc}set playing(t){!!this._cancelStartUpdateFunc!==t&&(t?this._startPlaying():this._stopPlaying())}}class Du extends V{constructor(t){super();d(this,"_stop",this.disposeVar(j(0)));d(this,"_current",this.disposeVar(j(0)));d(this,"_start",this.disposeVar(j(0)));d(this,"_player",this.disposeVar(new Ul(200)));this.dispose(this._player.currentTimeChangedEvent.disposableOn(n=>{let i=n/this._player.duration;i=i>1?1:i<0?0:i;const s=this._start.value,o=this._stop.value;this._current.value=s+(o-s)*i})),this.duration=t}get current(){return this._current.value}get currentChanged(){return this._current.changed}get source(){return this._start.value}get sourceChanged(){return this._start.changed}get target(){return this._stop.value}get targetChanged(){return this._stop.changed}get duration(){return this._player.duration}set duration(t){this._player.duration=t}set target(t){this._start.value=this._current.value,this._stop.value=t,this._player.currentTime=0,this._player.playing=!0}reset(t){this._start.value=t,this._current.value=t,this._stop.value=t,this._player.playing=!1}}let jp=-1;class ue extends O{constructor(e,t,n,i){super(),this._domElement=e,this._type=t,this.callback=i;const s=o=>(o.__xbsj_listenerNo__=++jp,o.__xbsj_listenerTime__=Date.now(),o.__xbsj_lastCurrentTarget__=o.currentTarget,this.emit(o),this.callback&&this.callback(o));this._domElement.addEventListener(this._type,s,n),this.dispose(()=>this._domElement.removeEventListener(this._type,s,n))}static getLastLisenNo(){return jp}static getCurrentTarget(e){return e.__xbsj_lastCurrentTarget__}static getListenerNo(e){return e.__xbsj_listenerNo__}static getListenerTime(e){return e.__xbsj_listenerTime__}static on(e,t){const n=ue.getLastLisenNo();return e.disposableOn(i=>{const s=ue.getListenerNo(i);(s===void 0||s>n)&&t(i)})}get element(){return this._domElement}static create(e,t,n){return new ue(e,t,n)}}class Oh extends V{constructor(){super();d(this,"_clickEvent",this.disposeVar(new O));d(this,"_dbclickEvent",this.disposeVar(new O));d(this,"_pointerdownEvent",this.disposeVar(new O));d(this,"_pointerupEvent",this.disposeVar(new O));d(this,"_pointermoveEvent",this.disposeVar(new O));d(this,"_pointeroutEvent",this.disposeVar(new O));d(this,"dbClickDelayTime",300);d(this,"nativeClickDelayTime",500);d(this,"clickMovementTolerantPixelSize",3);d(this,"debugging",!1);d(this,"_enabled",this.disposeVar(j(!0)));const t=this.disposeVar(Yn(async i=>{do{const s=await to(i,u=>new Promise((l,c)=>{u.disposer.dispose(c),u.disposer.dispose(ue.on(this._pointerdownEvent,l))})),o=ln(s);if(this.debugging&&console.log(`鼠标按下 ${o.toString()}`),!await to(i,u=>new Promise((l,c)=>{u.disposer.dispose(c);const h=setTimeout(()=>l(!0),this.nativeClickDelayTime);u.disposer.dispose(()=>clearTimeout(h)),u.disposer.dispose(ue.on(this._pointermoveEvent,f=>{const[p,v]=ln(f),[C,S]=o;(Math.abs(p-C)>3||Math.abs(v-S)>3)&&l(!1)})),u.disposer.dispose(ue.on(this._pointeroutEvent,()=>l(!1))),u.disposer.dispose(ue.on(this._pointerupEvent,()=>l(!0)))}))){this.debugging&&console.log("取消1");continue}const a=await to(i,u=>new Promise((l,c)=>{u.disposer.dispose(c);const h=setTimeout(()=>l("timeout"),this.dbClickDelayTime);u.disposer.dispose(()=>clearTimeout(h)),u.disposer.dispose(ue.on(this._pointermoveEvent,f=>{const[p,v]=ln(f),[C,S]=o;(Math.abs(p-C)>3||Math.abs(v-S)>3)&&l("moved")})),u.disposer.dispose(ue.on(this._pointerdownEvent,l)),u.disposer.dispose(ue.on(this._pointeroutEvent,()=>l("pointouted"))),u.disposer.dispose(ue.on(this._pointerupEvent,()=>l("pointuped")))}));if(typeof a=="string"){this.debugging&&console.log(`触发单击事件!取消双击监听!error: ${a}`),this._clickEvent.emit(s);continue}if(!await to(i,u=>new Promise((l,c)=>{u.disposer.dispose(c);const h=setTimeout(()=>l(!1),this.nativeClickDelayTime);u.disposer.dispose(()=>clearTimeout(h)),u.disposer.dispose(ue.on(this._pointermoveEvent,f=>{const[p,v]=ln(f),[C,S]=o;(Math.abs(p-C)>3||Math.abs(v-S)>3)&&l(!1)})),u.disposer.dispose(ue.on(this._pointeroutEvent,()=>l(!1))),u.disposer.dispose(ue.on(this._pointerupEvent,()=>l(!0)))}))){this.debugging&&console.log("取消2");continue}this.debugging&&console.log("触发双击事件!"),this._dbclickEvent.emit(a)}while(!0)})),n=i=>{i?t.restart():t.isRunning&&t.cancel()};n(this.enabled),this.dispose(this.enabledChanged.disposableOn(n))}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}pointerDown(t){this._pointerdownEvent.emit(t)}pointerUp(t){this._pointerupEvent.emit(t)}pointerMove(t){this._pointermoveEvent.emit(t)}pointerOut(t){this._pointeroutEvent.emit(t)}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}}class a0 extends V{constructor(t,n){super();d(this,"_pointerClick",this.disposeVar(new Oh));this._div=t;const{div:i,pointerClick:s}=this,o=c=>s.pointerDown(c),a=c=>s.pointerMove(c),u=c=>s.pointerOut(c),l=c=>s.pointerUp(c);i.addEventListener("pointerdown",o,n),i.addEventListener("pointermove",a,n),i.addEventListener("pointerout",u,n),i.addEventListener("pointerup",l,n),this.dispose(()=>{i.removeEventListener("pointerdown",o,n),i.removeEventListener("pointermove",a,n),i.removeEventListener("pointerout",u,n),i.removeEventListener("pointerup",l,n)})}get div(){return this._div}get pointerClick(){return this._pointerClick}get clickEvent(){return this.pointerClick.clickEvent}get dbclickEvent(){return this.pointerClick.dbclickEvent}}class Bp extends V{constructor(){super();d(this,"_hoverEvent",this.disposeVar(new O));d(this,"_hoverOutEvent",this.disposeVar(new O));d(this,"_pointerdownEvent",this.disposeVar(new O));d(this,"_pointerupEvent",this.disposeVar(new O));d(this,"_pointermoveEvent",this.disposeVar(new O));d(this,"_pointeroutEvent",this.disposeVar(new O));d(this,"delayTime",800);const t=this.disposeVar(kp()),n=l=>{this._hoverOutEvent.emit()},i=l=>{this._hoverOutEvent.emit()};let s;const o=()=>{if(!s){console.warn("!lastPointerEvent");return}this._hoverEvent.emit(s)},a=l=>{s=l,t.restart(void 0,o,this.delayTime),this._hoverOutEvent.emit()},u=l=>{t.cancel(),this._hoverOutEvent.emit()};this.dispose(this._pointerdownEvent.disposableOn(n)),this.dispose(this._pointerupEvent.disposableOn(i)),this.dispose(this._pointermoveEvent.disposableOn(a)),this.dispose(this._pointeroutEvent.disposableOn(u))}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}pointerDown(t){this._pointerdownEvent.emit(t)}pointerUp(t){this._pointerupEvent.emit(t)}pointerMove(t){this._pointermoveEvent.emit(t)}pointerOut(t){this._pointeroutEvent.emit(t)}}class u0 extends V{constructor(t,n=1500){super();d(this,"_hoverEvent",new O);d(this,"_hoverOutEvent",new O);const i=new _h(n);this.dispose(()=>i.destroy());let s=0,o=0,a;i.progressFunc=()=>this._hoverEvent.emit(s,o,a);const u=f=>{!i.isRunning&&i.restart(),a=f,[s,o]=ln(f),i.debounce(),this._hoverOutEvent.emit()},l=f=>{!i.isRunning&&i.restart(),a=f,[s,o]=ln(a),i.debounce(),this._hoverOutEvent.emit()},c=f=>{!i.isRunning&&i.restart(),a=f,[s,o]=ln(a),i.debounce(),this._hoverOutEvent.emit()},h=f=>{i.isRunning&&i.cancel(),this._hoverOutEvent.emit()};t.addEventListener("pointerdown",u),t.addEventListener("pointerup",l),t.addEventListener("pointermove",c),t.addEventListener("pointerout",h),this.dispose(()=>{t.removeEventListener("pointerdown",u),t.removeEventListener("pointerup",l),t.removeEventListener("pointermove",c),t.removeEventListener("pointerout",h)})}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}}class zp extends V{constructor(t,n={}){super();d(this,"_needRedrawEvent");d(this,"_needPickRedrawEvent");d(this,"_id",Jo());d(this,"_clickEvent");d(this,"_clickOutEvent");d(this,"_dbclickEvent");d(this,"_dbclickOutEvent");d(this,"_actived",!1);d(this,"_activedChanged");d(this,"_hovered",!1);d(this,"_hoveredChanged");d(this,"_selected",!1);d(this,"_selectedChanged");d(this,"_opacity",1);d(this,"_opacityChanged");d(this,"_show",!0);d(this,"_showChanged");this._canvasPrimitivesContext=t;const{needRedraw:i=!0,needPickRedraw:s=!0}=n;i&&(this._needRedrawEvent=new O),s&&(this._needPickRedrawEvent=new O),this._canvasPrimitivesContext.addPoi(this),this.dispose(()=>this._canvasPrimitivesContext.removePoi(this)),this.dispose(this.showChanged.disposableOn(()=>{this.needRedraw(),this.needPickRedraw()})),this.dispose(this.opacityChanged.disposableOn(()=>this.needRedraw()))}get id(){return this._id}get context(){return this._canvasPrimitivesContext}needRedraw(){this._needRedrawEvent?this._needRedrawEvent.emit():console.warn("no needRedrawEvent!")}needPickRedraw(){this._needPickRedrawEvent?this._needPickRedrawEvent.emit():console.warn("no needPickRedrawEvent!")}hasClickEvent(){return!!this._clickEvent}get clickEvent(){return this._clickEvent=this._clickEvent||new O,this._clickEvent}hasClickOutEvent(){return!!this._clickOutEvent}get clickOutEvent(){return this._clickOutEvent=this._clickOutEvent||new O,this._clickOutEvent}hasDbclickEvent(){return!!this._dbclickEvent}get dbclickEvent(){return this._dbclickEvent=this._dbclickEvent||new O,this._dbclickEvent}hasDbclickOutEvent(){return!!this._dbclickOutEvent}get dbclickOutEvent(){return this._dbclickOutEvent=this._dbclickOutEvent||new O,this._dbclickOutEvent}set actived(t){this._actived!==t&&(this._actived=t,this._activedChanged&&this._activedChanged.emit(t,this))}get actived(){return this._actived}get activedChanged(){return this._activedChanged=this._activedChanged||new O,this._activedChanged}set hovered(t){this._hovered!==t&&(this._hovered=t,this._hoveredChanged&&this._hoveredChanged.emit(t,this))}get hovered(){return this._hovered}get hoveredChanged(){return this._hoveredChanged=this._hoveredChanged||new O,this._hoveredChanged}set selected(t){this._selected!==t&&(this._selected=t,this._selectedChanged&&this._selectedChanged.emit(t,this))}get selected(){return this._selected}get selectedChanged(){return this._selectedChanged=this._selectedChanged||new O,this._selectedChanged}set opacity(t){this._opacity!==t&&(this._opacity=t,this._opacityChanged&&this._opacityChanged.emit(t,this))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new O,this._opacityChanged}set show(t){this._show!==t&&(this._show=t,this._showChanged&&this._showChanged.emit(t,this))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new O,this._showChanged}}class Nh extends zp{constructor(t,n=[0,0],i=0){super(t);d(this,"_winPosAndDepthChanged");this._winPos=n,this._depth=i,this.dispose(this.winPosAndDepthChanged.disposableOn(()=>{this.needRedraw(),this.needPickRedraw()}))}set winPos(t){(this._winPos[0]!==t[0]||this._winPos[1]!==t[1])&&(this._winPos[0]=t[0],this._winPos[1]=t[1],this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get winPos(){return this._winPos}set depth(t){this._depth!==t&&(this._depth=t,this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get depth(){return this._depth}get winPosAndDepthChanged(){return this._winPosAndDepthChanged||(this._winPosAndDepthChanged=new O),this._winPosAndDepthChanged}}function eo(r,e,t,n){const[i,s]=r,[o,a,u,l]=n,c=e[0]*t[0],h=e[1]*t[1],f=i-(c*o+u),p=s-(h*a+l);return{left:f,top:p,right:f+c,bottom:p+h}}function no(r,e,t,n,i){r.beginPath(),r.moveTo(e,t),r.lineTo(e-n*.5,t-n*.5),r.arc(e,t-n,n*.7071067811865475,Math.PI*.75,Math.PI*.25),r.lineTo(e,t),r.fillStyle=i,r.fill()}function Up(r,e,t,n,i,s){r.beginPath(),r.moveTo(e+s,t),r.lineTo(e+n-s,t),r.arcTo(e+n,t,e+n,t+s,s),r.lineTo(e+n,t+i-s),r.arcTo(e+n,t+i,e+n-s,t+i,s),r.lineTo(e+s,t+i),r.arcTo(e,t+i,e,t+i-s,s),r.lineTo(e,t+s),r.arcTo(e,t,e+s,t,s)}function Gp(r,e,t,n,i,s){r.font=i;const o=r.measureText(n),a=o.actualBoundingBoxLeft+o.actualBoundingBoxRight,u=Number.isFinite(o.fontBoundingBoxAscent)?o.fontBoundingBoxAscent:o.actualBoundingBoxAscent,l=Number.isFinite(o.fontBoundingBoxDescent)?o.fontBoundingBoxDescent:o.actualBoundingBoxDescent;let c=u+l;r.fillStyle=s,r.fillText(n,e-a*.5,t+c*.5-l)}function Wp(r){const{width:e,height:t}=r,n=e instanceof SVGAnimatedLength?e.baseVal.SVG_LENGTHTYPE_PX:e,i=t instanceof SVGAnimatedLength?t.baseVal.SVG_LENGTHTYPE_PX:t,s=document.createElement("canvas");s.width=n,s.height=i;const o=s.getContext("2d");if(!o)throw new Error("!cavnasCtx");return o.drawImage(r,0,0,n,i),s}function Hp(r,e){const{width:t,height:n}=r,i=r.getContext("2d");if(!i)throw new Error("!cavnasCtx");const[s,o,a]=e.map(h=>h*255|0),u=i.getImageData(0,0,t,n),l=u.data;for(var c=0;c<l.length;c+=4)l[c]=s,l[c+1]=o,l[c+2]=a;i.putImageData(u,0,0)}function Dh(r,e,t,n=[.5,1,0,0],i,s="12px Arial",o=2,a="#FFF",u="#000A"){r.font=s;const l=r.measureText(i),c=l.actualBoundingBoxLeft+l.actualBoundingBoxRight,h=l.fontBoundingBoxAscent+l.fontBoundingBoxDescent,f=e,p=t,v=c+o*2,C=h+o*2,{left:S,top:P,bottom:y}=eo([f,p],[v,C],[1,1],n);r.fillStyle=u,Up(r,S,P,v,C,o),r.fill(),r.fillStyle=a,r.fillText(i,S+o,y-o-l.fontBoundingBoxDescent)}function Mu(r){return("00"+r.toString(16).toUpperCase()).substr(-2)}function Ru(r){const[e,t,n,i]=r.map(s=>s*255|0);return`#${Mu(e)}${Mu(t)}${Mu(n)}${Mu(i)}`}function Mh(r,e){const[t,n,i]=e,s=`${t}-${n}-${i}`;let o=Xn(r,s);return o||(o=Wp(r),Hp(o,e),fi(r,s,o)),o}class l0 extends Nh{constructor(t,n,i=[32,32],s=[.5,1,0,0],o="#F00F"){super(t);d(this,"_tooltip","");d(this,"_title","");d(this,"__scale",[1,1]);d(this,"_tooltipAlpha",0);d(this,"_bgColor",[.3,.3,.3,.8]);d(this,"_bgColorHexStr",Ru(this._bgColor));d(this,"_fgColor",[1,1,1,1]);d(this,"_fgColorHexStr",Ru(this._fgColor));this._image=n,this._size=i,this._originRatioAndOffset=s,this._defaultColorStr=o;const a=new Du(100),u=new Du(100);this.dispose(()=>{a.destroy(),u.destroy()});const l=()=>{if(this._clickEvent&&!this._clickEvent.empty){const c=(1+.08*u.current)*(1+.08*a.current);this._scale=[c,c],this._tooltipAlpha=a.current}};this.dispose(this.activedChanged.disposableOn(c=>{u.target=c?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(c=>{a.target=c?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(()=>{this.needRedraw()})),this.dispose(u.currentChanged.disposableOn(l)),this.dispose(a.currentChanged.disposableOn(l))}set size(t){const[n,i]=t,[s,o]=this._size;(s!==n||o!==i)&&(this._size[0]=n,this._size[1]=i,this.needRedraw(),this.needPickRedraw())}get size(){return this._size}set _scale(t){const[n,i]=t,[s,o]=this.__scale;(s!==n||o!==i)&&(this.__scale[0]=n,this.__scale[1]=i,this.needRedraw(),this.needPickRedraw())}get _scale(){return this.__scale}set fgColor(t){if(!this._fgColor.every((n,i)=>t[i]===n)){const[n,i,s,o]=t;this._fgColor.splice(0,4,n,i,s,o),this._fgColorHexStr=Ru(this._fgColor),this.needRedraw()}}get fgColor(){return this._fgColor}set bgColor(t){if(!this._bgColor.every((n,i)=>t[i]===n)){const[n,i,s,o]=t;this._bgColor.splice(0,4,n,i,s,o),this._bgColorHexStr=Ru(this._bgColor),this.needRedraw()}}get bgColor(){return this._bgColor}set originRatioAndOffset(t){const[n,i,s,o]=this._originRatioAndOffset,[a,u,l,c]=t;(n!==a||i!==u||s!==l||o!==c)&&(this._originRatioAndOffset.splice(0,4,a,u,l,c),this.needRedraw(),this.needPickRedraw())}get originRatioAndOffset(){return this._originRatioAndOffset}set image(t){this._image!==t&&(this._image=t,this.needRedraw())}get image(){return this._image}set defaultColorStr(t){this._defaultColorStr!==t&&(this._defaultColorStr=t,this.needRedraw())}get defaultColorStr(){return this._defaultColorStr}set tooltip(t){this._tooltip!==t&&(this._tooltip=t,this.needRedraw())}get tooltip(){return this._tooltip}set title(t){this._title!==t&&(this._title=t,this.needRedraw())}get title(){return this._title}draw(t){if(!this._show)return;const[n,i]=this._winPos,s=this._size[0]*this.__scale[0],o=this._size[1]*this.__scale[1],{left:a,top:u}=eo([n,i],this._size,this.__scale,this._originRatioAndOffset),l=t.globalAlpha;if(t.globalAlpha=this.opacity,this._image){if(this.selected){const c=Mh(this._image,[1,0,0]),{left:h,top:f}=eo([n,i+3],[s+6,o+6],[1,1],this._originRatioAndOffset);t.drawImage(c,h,f,s+6,o+6)}if(this.actived){const[c,h,f,p]=this._fgColor,v=Mh(this._image,[c,h,f]),{left:C,top:S}=eo([n,i+4],[s+8,o+8],[1,1],this._originRatioAndOffset);t.drawImage(v,C,S,s+8,o+8)}if(this.hovered){const[c,h,f,p]=this._bgColor,v=Mh(this._image,[c,h,f]),{left:C,top:S}=eo([n,i+2],[s+4,o+4],[1,1],this._originRatioAndOffset);t.drawImage(v,C,S,s+4,o+4)}t.drawImage(this._image,a,u,s,o)}else t.fillStyle=this._fgColorHexStr,t.fillRect(a,u,s,o);if(this._title!==""&&Dh(t,n+20,i-16,[0,.5,0,0],this._title,"14px Arial",4,this._fgColorHexStr,this._bgColorHexStr),t.globalAlpha=l,this._hovered&&this._tooltip!==""){const c=t.globalAlpha;t.globalAlpha=this._tooltipAlpha,Dh(t,n,i-42,[.5,1,0,0],this._tooltip,"12px Arial",4,this._fgColorHexStr,this._bgColorHexStr),t.globalAlpha=c}}drawForPick(t,n){if(!this._show)return;const[i,s]=this._winPos,o=n("default"),a=this._size[0]*this.__scale[0],u=this._size[1]*this.__scale[1],{left:l,top:c}=eo([i,s],this._size,this.__scale,this._originRatioAndOffset);t.fillStyle=o,t.fillRect(l,c,a,u)}}class c0 extends Nh{constructor(t){super(t);d(this,"_width",16);d(this,"_text","");d(this,"_fillStyle","#0F0");d(this,"_scale",1);d(this,"_scaleChanged");this.dispose(this.scaleChanged.disposableOn(o=>{this.needRedraw(),this.needPickRedraw()}));const n=this.disposeVar(new Du(100)),i=this.disposeVar(new Du(100)),s=()=>{this._clickEvent&&!this._clickEvent.empty&&(this.scale=(1+.1*i.current)*(1+.2*n.current))};this.dispose(i.currentChanged.disposableOn(s)),this.dispose(n.currentChanged.disposableOn(s)),this.dispose(this.activedChanged.disposableOn(o=>{i.target=o?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(o=>{n.target=o?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(o=>{this.needRedraw()}))}set scale(t){this._scale!==t&&(this._scale=t,this._scaleChanged&&this._scaleChanged.emit(t,this))}get scale(){return this._scale}get scaleChanged(){return this._scaleChanged||(this._scaleChanged=new O),this._scaleChanged}set width(t){this._width!==t&&(this._width=t,this.needRedraw(),this.needPickRedraw())}get width(){return this._width}set text(t){this._text!==t&&(this._text=t,this.needRedraw())}get text(){return this._text}set fillStyle(t){this._fillStyle!==t&&(this._fillStyle=t,this.needRedraw())}get fillStyle(){return this._fillStyle}draw(t){if(!this._show)return;const[n,i]=this._winPos,s=t.globalAlpha;t.globalAlpha=this.opacity;const o=this._width*this._scale;this.selected&&no(t,n,i+3,o+3,"#F00"),this.actived&&this._clickEvent&&!this._clickEvent.empty&&no(t,n,i+5,o+5,"#FFF"),this.hovered?no(t,n,i+3,o+3,"#000A"):no(t,n,i+1,o+1,"#000A"),no(t,n,i,o,this._fillStyle);const a=this._scale>1.2?"bold 14px Arial":"bold 10px Arial";Gp(t,n,i-o,this._text,a,"#000"),t.globalAlpha=s}drawForPick(t,n){if(!this._show)return;const[i,s]=this._winPos,o=this._width*this._scale,a=n("default");no(t,i,s,o,a)}}const qp=new ArrayBuffer(4),Xp=new Uint32Array(qp),ro=new Uint8Array(qp);function Yp(r){if(r>=16777215)throw new Error("uint32 > 0xFFFFFF");return Xp[0]=r,[ro[0],ro[1],ro[2]]}function Jp(r,e,t){return ro[0]=r,ro[1]=e,ro[2]=t,ro[3]=0,Xp[0]}class $p extends V{constructor(){super(...arguments);d(this,"_pickColors",new Array(16777215));d(this,"_pickColorIndex",0)}reset(){for(let t=0;t<this._pickColorIndex;++t){const n=this._pickColors[t];if(!n)throw console.error("this._pickColors[i] should not be undefined!"),new Error("this._pickColors[i] should not be undefined!");n.poi=null,n.tag=""}this._pickColorIndex=0}createPickColor(t,n){const i=this._pickColorIndex;++this._pickColorIndex;const s=this._pickColors[i];s?(s.poi=t,s.tag=n):this._pickColors[i]={poi:t,tag:n};const[o,a,u]=Yp(i);return[o,a,u]}getPickInfoFromColor(t,n,i){const s=Jp(t,n,i);if(s>=this._pickColorIndex){console.error("index >= this._pickColorIndex");return}const o=this._pickColors[s];if(!o){console.error("!this._pickColors[index]");return}return o}destroyImp(){this.reset()}}const Kp=(r,e)=>e.depth-r.depth;class h0 extends V{constructor(){super();d(this,"_pois",[]);d(this,"_canvasElement");d(this,"_ctx");d(this,"_offscreenCanvasElement");d(this,"_offscreenCanvasElement2");d(this,"_offscreenCtx");d(this,"_offscreenCtx2");d(this,"_size",[0,0]);d(this,"_needRedraw",!1);d(this,"_needPickRedraw",!1);d(this,"_pickColorManager",new $p);const t=document.createElement("canvas");t.style.width="100%",t.style.height="100%",this._canvasElement=t;const n=t.getContext("2d");if(n===null)throw new Error("cannot get context 2d!");this._ctx=n,this._offscreenCanvasElement=document.createElement("canvas"),this._offscreenCtx=this._offscreenCanvasElement.getContext("2d"),this._offscreenCtx.imageSmoothingEnabled=!1,this._offscreenCanvasElement2=document.createElement("canvas"),this._offscreenCtx2=this._offscreenCanvasElement2.getContext("2d"),this._offscreenCtx2.imageSmoothingEnabled=!1,this.disposeVar(ea(()=>{const[s,o]=this._size,{clientWidth:a,clientHeight:u}=this._canvasElement;(s!==a||o!==u)&&(this._size[0]=a,this._size[1]=u,this._canvasElement.width=a,this._canvasElement.height=u,this._offscreenCanvasElement.width=a,this._offscreenCanvasElement.height=u,this._offscreenCanvasElement2.width=a,this._offscreenCanvasElement2.height=u,this._dirty()),this._needRedraw&&(this._needRedraw=!1,this._draw())})).start()}get element(){return this._canvasElement}get pois(){return this._pois}_dirty(){this._needRedraw=!0,this._needPickRedraw=!0}get size(){return this._size}addPoi(t){if(typeof Xn(t,"listenHandler")<"u"){console.error("可能有poi重复加载poiManager中!");return}if(this._pois.indexOf(t)!==-1){console.error("同一个poi加了多次!");return}this._pois.push(t),this._dirty();const n=t._needRedrawEvent;if(n){const s=n.on(()=>{this._needRedraw=!0});fi(t,"needRedrawEventHandler",s)}const i=t._needPickRedrawEvent;if(i){const s=i.on(()=>{this._needPickRedraw=!0});fi(t,"needPickRedrawEventHandler",s)}}removePoi(t){const n=this._pois.indexOf(t);if(n===-1){console.error("删除一个不存在的poi!");return}this._pois.splice(n,1),this._dirty();const i=t._needRedrawEvent;if(i){const o=Xn(t,"needRedrawEventHandler");o?i.off(o):console.error("poi没有listenHandler!")}const s=t._needPickRedrawEvent;if(s){const o=Xn(t,"needPickRedrawEventHandler");o?s.off(o):console.error("poi没有listenHandler!")}}_draw(){this._pois.sort(Kp);const[t,n]=this._size;this._ctx.clearRect(0,0,t,n),this._pois.forEach(i=>i.draw(this._ctx))}pick(t,n,i,s){return this._needPickRedraw&&(this._needPickRedraw=!1,this._pickDraw()),this._getPickInfo(t,n,i,s)}_pickDraw(){this._pickColorManager.reset(),this._pois.sort(Kp);const[t,n]=this._size;this._offscreenCtx.clearRect(0,0,t,n),this._pois.forEach(i=>{const s=o=>{const[a,u,l]=this._pickColorManager.createPickColor(i,o);return`rgb(${a}, ${u}, ${l})`};i.drawForPick(this._offscreenCtx,s)})}_getPickInfo(t,n,i,s){const o=this._offscreenCtx.getImageData(t,n,i,s),a=[],u=o.data.length/4;for(let l=0;l<u;++l){const c=o.data[l*4+0],h=o.data[l*4+1],f=o.data[l*4+2];if(o.data[l*4+3]===255){const v=this._pickColorManager.getPickInfoFromColor(c,h,f);if(v&&v.poi&&!a.includes(v)){let C=!0;{const[S,P]=this._size;this._offscreenCtx2.clearRect(0,0,S,P);const y=b=>"rgb(255, 255, 255)";v.poi.drawForPick(this._offscreenCtx2,y);const _=this._offscreenCtx2.getImageData(t,n,i,s),m=_.data[l*4+0],w=_.data[l*4+1],E=_.data[l*4+2];_.data[l*4+3],m===255&&w===255&&E===255||(C=!1)}C&&a.push(v)}}}return a}}class Rh extends V{constructor(){super(...arguments);d(this,"_closeEvent");d(this,"_show",!0);d(this,"_showChanged");d(this,"_opacity",1);d(this,"_opacityChanged");d(this,"_winPos",[0,0]);d(this,"_winPosChanged")}set winPos(t){const[n,i]=t,[s,o]=this._winPos;(n!==s||i!==o)&&(this._winPos[0]=n,this._winPos[1]=i,this._winPosChanged&&this._winPosChanged.emit(this._winPos))}get winPos(){return this._winPos}get winPosChanged(){return this._winPosChanged=this._winPosChanged||new O,this._winPosChanged}set opacity(t){this._opacity!==t&&(this._opacity=t,this._opacityChanged&&this._opacityChanged.emit(this._opacity))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new O,this._opacityChanged}set show(t){this._show!==t&&(this._show=t,this._showChanged&&this._showChanged.emit(this._show))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new O,this._showChanged}get closeEvent(){return this._closeEvent||(this._closeEvent=new O),this._closeEvent}}const Lh=new WeakMap;function Fh(r){if(!Lh.has(r)){const e=new Tl(()=>new r,t=>t.reset());Lh.set(r,e)}return Lh.get(r)}class Ah extends Rh{constructor(){super();d(this,"_div");d(this,"_contentDiv");d(this,"_originOffsetX",0);d(this,"_originOffsetY",0);d(this,"_originRatioX",.5);d(this,"_originRatioY",1);d(this,"_divChanged",new O);const t=document.createElement("div");t.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible;";const n=document.createElement("div");n.style.cssText=`position: absolute; left: ${-this._originOffsetX}px; top: ${-this._originOffsetY}px; transform: translateX(-${100*this._originRatioX}%) translateY(-${100*this._originRatioY}%); margin: 0; padding: 0; pointer-events: none;`;const i=document.createElement("div");this._contentDiv=i,n.appendChild(i),t.appendChild(n),this._div=t,this.dispose(this._divChanged.disposableOn(()=>{n.style.left=`${-this._originOffsetX}px`,n.style.top=`${-this._originOffsetY}px`,n.style.transform=`translateX(-${100*this._originRatioX}%) translateY(-${100*this._originRatioY}%)`})),this.dispose(this.winPosChanged.disposableOn(([s,o])=>{this._div.style.left=`${s}px`,this._div.style.top=`${o}px`})),this.dispose(this.opacityChanged.disposableOn(s=>{this._div.style.opacity=`${s}`})),this.dispose(this.showChanged.disposableOn(s=>{this._div.style.visibility=s?"visible":"hidden"}))}get contentDiv(){return this._contentDiv}reset(){}get originOffsetX(){return this._originOffsetX}set originOffsetX(t){this._originOffsetX!==t&&(this._originOffsetX=t,this._divChanged.emit())}get originOffsetY(){return this._originOffsetY}set originOffsetY(t){this._originOffsetY!==t&&(this._originOffsetY=t,this._divChanged.emit())}get originRatioX(){return this._originRatioX}set originRatioX(t){this._originRatioX!==t&&(this._originRatioX=t,this._divChanged.emit())}get originRatioY(){return this._originRatioY}set originRatioY(t){this._originRatioY!==t&&(this._originRatioY=t,this._divChanged.emit())}get element(){return this._div}}class Zp extends V{constructor(t,n){super();d(this,"_floatDiv");d(this,"_show",!1);d(this,"_showChanged");this._customDivClass=t,this._divContainer=n,this.dispose(()=>{this.show=!1})}_updateDivPoi(){if(this._show){const{floatDiv:n}=this;n.element.parentElement||this._divContainer.appendChild(n.element)}else{const{_floatDiv:n}=this;n&&n.element.parentElement&&this._divContainer.removeChild(n.element)}}set show(t){this._show!==t&&(this._show=t,this._updateDivPoi(),this._showChanged&&this._showChanged.emit(t))}get show(){return this._show}get floatDiv(){if(!this._floatDiv){const t=Fh(this._customDivClass).create();this.dispose(()=>{Fh(this._customDivClass).destroy(t)}),this._floatDiv=t}return this._floatDiv}get showChanged(){return this._showChanged||(this._showChanged=new O),this._showChanged}}const d0=["top","bottom","left","right"];function f0(r){return Object.entries(r).map(([e,t])=>d0.includes(e)?`${e}: ${t}px; `:"").join("")}function Qp(r,e,t){const n=document.createElement("div");n.style.cssText=`position: absolute; ${f0(t)} background-color: ${r}; border-radius: ${e}px;`;const i='<svg viewBox="0 0 1024 1024" style="display: block;" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2420" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M512 128C300.8 128 128 300.8 128 512s172.8 384 384 384 384-172.8 384-384S723.2 128 512 128zM512 832c-179.2 0-320-140.8-320-320s140.8-320 320-320 320 140.8 320 320S691.2 832 512 832z" p-id="2421" fill="#ffffff"></path><path d="M672 352c-12.8-12.8-32-12.8-44.8 0L512 467.2 396.8 352C384 339.2 364.8 339.2 352 352S339.2 384 352 396.8L467.2 512 352 627.2c-12.8 12.8-12.8 32 0 44.8s32 12.8 44.8 0L512 556.8l115.2 115.2c12.8 12.8 32 12.8 44.8 0s12.8-32 0-44.8L556.8 512l115.2-115.2C684.8 384 684.8 364.8 672 352z" p-id="2422" fill="#ffffff"></path></svg>';return n.innerHTML=i,n}function tg(r,e,t="rgba(0,0,0,0.7)"){const n=document.createElement("div");n.style.cssText=`margin: 0 auto; width: ${r}px; height: ${e}px; position: relative; pointer-events: none;`;const i=document.createElement("div");return i.style.cssText=`position: absolute; left: 0px; top: 0px; width: 0; height: 0; border-left: ${r*.5}px solid transparent; border-right: ${r*.5}px solid transparent; border-top: ${e}px solid ${t};`,n.appendChild(i),[n,i]}class eg extends Ah{constructor(){super();d(this,"_borderDiv");d(this,"_closeDiv");d(this,"_innerContentDiv");d(this,"_colorStr","rgba(0, 0, 0, 0.7)");d(this,"_divColorChanged",new O);d(this,"_borderRadius",10);const t=document.createElement("div");t.style.cssText=`position: relative; background-color: ${this._colorStr}; border-radius: ${this._borderRadius}px; padding: 5px; pointer-events: all;`,this._borderDiv=t;const n=Qp(this._colorStr,10,{top:3,right:3}),[i,s]=tg(2*this._borderRadius,2*this._borderRadius,this._colorStr),o=document.createElement("div");this._innerContentDiv=o,t.appendChild(o),t.appendChild(n),this.contentDiv.appendChild(t),this.contentDiv.appendChild(i),n.style.opacity="0.1",n.onmouseenter=()=>{n.style.opacity="1.0"},n.onmouseleave=()=>{n.style.opacity="0.1"},n.onclick=()=>{this._closeEvent&&this._closeEvent.emit()},this._closeDiv=n,this.dispose(this._divColorChanged.disposableOn(()=>{s.style.borderTopColor=this._colorStr,t.style.backgroundColor=this._colorStr,i.style.width=`${this._borderRadius*2}px`,i.style.height=`${this._borderRadius*2}px`,s.style.borderLeft=`${this._borderRadius}px`,s.style.borderRight=`${this._borderRadius}px`,s.style.borderTop=`${this._borderRadius*2}px`}));const a=u=>{u.key==="Escape"&&this._closeEvent&&this._closeEvent.emit()};document.body.addEventListener("keydown",a,!0),this.dispose(()=>{document.removeEventListener("keydown",a,!0)})}get borderDiv(){return this._borderDiv}get innerContentDiv(){return this._innerContentDiv}reset(){this.show=!1,this.opacity=0,this._closeDiv.style.opacity="0.1",super.reset()}get colorStr(){return this._colorStr}set colorStr(t){this._colorStr!==t&&(this._colorStr=t,this._divColorChanged.emit())}get borderRadius(){return this._borderRadius}set borderRadius(t){this._borderRadius!==t&&(this._borderRadius=t,this._divColorChanged.emit())}}class p0 extends eg{constructor(){super();d(this,"_iframe");d(this,"_iframeMessageEvent");const t=document.createElement("iframe");t.style.cssText="width: 100%; height: 100%; border-width: 0px; border-radius: 5px; display: block;",t.src="http://www.weather.com.cn/live/index.shtml",this._iframe=t,this.innerContentDiv.appendChild(t);const n=i=>{i.source===this._iframe.contentWindow&&(this._iframeMessageEvent?this._iframeMessageEvent.emit(i):console.warn(`iframe消息接收到未处理!data: ${i.data}`))};globalThis.addEventListener("message",n),this.dispose(()=>{globalThis.removeEventListener("message",n)})}reset(){super.reset(),this.src=""}set src(t){this._iframe.src!==t&&(this._iframe.src=t)}get src(){return this._iframe.src}get iframe(){return this._iframe}get iframeMessageEvent(){return this._iframeMessageEvent=this._iframeMessageEvent||new O,this._iframeMessageEvent}}class g0 extends Rh{constructor(){super();d(this,"_div");d(this,"_contentContainer");d(this,"_text","");const t=document.createElement("div");this._div=t,t.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible; transition: opacity 0.5s;";const n=document.createElement("div");n.style.cssText="position: absolute; left: 0px; bottom: 0px; transform: translateX(-50%); margin: 0; padding: 0; pointer-events: none;";const i=document.createElement("div");i.style.cssText="position: relative; background-color: rgba(0, 0, 0, 0.7); border-radius: 5px; padding: 3px; pointer-events: all; color: white; white-space: nowrap;",i.innerText=this._text,this._div.appendChild(n),n.appendChild(i),this._contentContainer=i,this._div=t,this.dispose(this.winPosChanged.disposableOn(([s,o])=>{this._div.style.left=`${s}px`,this._div.style.top=`${o-50}px`})),this.dispose(this.opacityChanged.disposableOn(s=>{this._div.style.opacity=`${s}`})),this.dispose(this.showChanged.disposableOn(s=>{this._div.style.visibility=s?"visible":"hidden"}))}get element(){return this._div}reset(){this.opacity=1,this.show=!0}set text(t){this._text!==t&&(this._text=t,this._contentContainer.innerText=t)}get text(){return this._text}}class m0 extends Ah{constructor(){super(),this.contentDiv.style.backgroundColor="rgba(0, 0, 0, 0.8)",this.contentDiv.style.borderRadius="3px",this.contentDiv.style.color="rgb(255, 255, 255)",this.contentDiv.style.padding="1px 5px 1px 5px",this.contentDiv.style.fontSize="12px",this.contentDiv.style.whiteSpace="nowrap",this.contentDiv.innerText="未定义光标信息!",this.originRatioX=0,this.originRatioY=0,this.originOffsetX=-16}}class v0 extends V{constructor(t,n){super();d(this,"_cursorDiv");d(this,"_pointerOut",this.disposeVar(j(!1)));d(this,"_show",this.disposeVar(j(!0)));this._cursorDiv=new Zp(n,t),this.dispose(()=>this._cursorDiv.destroy());const i=o=>{const[a,u]=ln(o);this._cursorDiv.floatDiv.winPos=[a,u]};t.addEventListener("pointermove",i),this.dispose(()=>t.removeEventListener("pointermove",i));const s=()=>{this._cursorDiv.show=this.show&&this._pointerOut.value};s(),this.dispose(this.showChanged.disposableOn(s)),this.dispose(this._pointerOut.changed.disposableOn(s))}set show(t){this._show.value=t}get show(){return this._show.value}get showChanged(){return this._show.changed}reset(){this._pointerOut.value=!1}get cursorDiv(){return this._cursorDiv}set text(t){this._cursorDiv.floatDiv.contentDiv.innerText=t}get text(){return this._cursorDiv.floatDiv.contentDiv.innerText}}function Lu(r,e,t){if(!(r.tree===e.tree&&r!==e&&!r.isAncestorOf(e))||r.tree!==e.tree||!r.parent)return!1;if(!r.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");return!(e===r||r.isAncestorOf(e)||t!=="inner"&&!e.parent||t==="inner"&&!e.children)}function Gl(r,e,t){if(!r.tree||!e.tree||r.tree!==e.tree)return;if(!r.parent){console.warn("当前节点没有父节点,那么该节点无法被移动!");return}if(!r.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");if(e===r){console.warn("自身不能拖放到自身!");return}if(r.isAncestorOf(e)){console.warn("当前节点不能拖放到它自身的后代节点之上!");return}if(t!=="inner"&&!e.parent){console.warn("目标节点没有父节点,无法拖放!");return}if(t==="inner"&&!e.children){console.warn("无法移动到目标节点的子节点中,因为目标节点不是组节点!");return}r.tree._startTransaction();const n=r.parent.children.indexOf(r);if(r.parent.children.splice(n,1),t!=="inner"){const{parent:i}=e;if(!i||!i.children)throw new Error("!parent");const s=i.children.indexOf(e);t==="before"?i.children.splice(s,0,r):t==="after"&&i.children.splice(s+1,0,r)}else e.children.push(r);r.tree._stopTransaction()}function ng(r,e,t){return fh(r,n=>Lu(n,e,t))}function rg(r,e,t){for(let n of r)Lu(n,e,t)?Gl(n,e,t):console.warn(`treeItem(id: ${n.id}) cannot move...`)}const y0={checked:1,unchecked:2,indeterminate:3},_0=["checked","unchecked","indeterminate"];class ig extends V{constructor(t){super();d(this,"_collapsed",this.disposeVar(j(!1)));d(this,"_checkedStatus",this.disposeVar(j("unchecked")));d(this,"_selected",this.disposeVar(j(!1)));d(this,"_moveToPositionMode",this.disposeVar(j("none")));d(this,"_updateCheckedStatusFromChildrenEvent",this.disposeVar(new O));this._treeItem=t;const n=()=>this._treeItem.tree&&this._treeItem.tree.itemsChanged.emit([this._treeItem]);this.dispose(this._collapsed.changed.disposableOn(n)),this.dispose(this._checkedStatus.changed.disposableOn(n)),this.dispose(this._selected.changed.disposableOn(n)),this.dispose(this._moveToPositionMode.changed.disposableOn(n)),this.dispose(this._checkedStatus.changed.disposableOn(()=>this._treeItem.parent&&this._treeItem.parent.uiTreeObject.updateCheckedStatusFromChildren())),this.dispose(this._treeItem.childrenChangedEvent.disposableOn(()=>{this.updateCheckedStatusFromChildren()}));const i=this.disposeVar(Ie(this._updateCheckedStatusFromChildrenEvent));this.dispose(i.disposableOn(()=>{if(!this._treeItem.children)return;let s=0;dh(this._treeItem.children,o=>(s|=y0[o.uiTreeObject.checkedStatus],s===3)),s>0&&(this._checkedStatus.value=_0[s-1])})),this.dispose(this._treeItem.childrenResetedEvent.disposableOn(s=>{!s&&this.checkedStatus==="indeterminate"&&(this._checkedStatus.value="unchecked")}));{const s=(o,a,u=!0)=>{if(a)o.selectedItems.push(this._treeItem);else{const l=o.selectedItems.indexOf(this._treeItem);l===-1?u&&console.error("selectedItems index -1"):o.selectedItems.splice(l,1)}};this.dispose(this._selected.changed.disposableOn(o=>{const{tree:a}=this._treeItem;a&&s(a,o)})),this.dispose(()=>this.selected=!1)}}get treeItem(){return this._treeItem}get collapsed(){return this._collapsed.value}set collapsed(t){this._collapsed.value=t}get collapsedChanged(){return this._collapsed.changed}get checkedStatus(){return this._checkedStatus.value}check(t){const n=t?"checked":"unchecked";if(this._checkedStatus.value!==n&&(this._checkedStatus.value=n,this._treeItem.children))for(let i of this._treeItem.children)i.uiTreeObject.check(t)}updateCheckedStatusFromChildren(){this._updateCheckedStatusFromChildrenEvent.emit()}get checkedStatusChanged(){return this._checkedStatus.changed}get selected(){return this._selected.value}set selected(t){this._selected.value=t}get selectedChanged(){return this._selected.changed}get moveToPositionMode(){return this._moveToPositionMode.value}set moveToPositionMode(t){this._moveToPositionMode.value=t}get moveToPositionModeChanged(){return this._moveToPositionMode.changed}}const ii=class ii extends V{constructor(t,n=!1,i){super();d(this,"_children");d(this,"_childrenResetedEvent");d(this,"_childrenToChangeEvent");d(this,"_childrenChangedEvent");d(this,"_parent",this.disposeVar(j(void 0)));d(this,"_level",this.disposeVar(j(0)));d(this,"_id");d(this,"_uiTreeObject",this.disposeVar(new ig(this)));this._tree=t,this._hasChildren=n,this._id=i??Jo(),this._id!=="_ROOT"&&ii.wm.has(this._id)&&console.warn(`创建了id(${this._id})相同的树节点,会导致之前的树节点无法索引!`),ii.wm.set(this._id,this),this.dispose(()=>{if(this._id!=="_ROOT"&&!ii.wm.has(this._id)){console.warn(`树节点(${this._id})不在wm树上!`);return}ii.wm.delete(this._id)}),this.dispose(this._parent.changed.disposableOn(()=>{this._updateLevel()})),this.dispose(this._level.changed.disposableOn(()=>{if(this.children)for(let s of this.children)s._updateLevel()})),ii.allTreeItems.set(this._id,this),this.dispose(()=>{ii.allTreeItems.delete(this._id)})}static getFromId(t){return ii.wm.get(t)}get uiTreeObject(){return this._uiTreeObject}get id(){return this._id}_updateLevel(){this.parent&&(this._level.value=this.parent.level+1)}get parent(){return this._parent.value}get parentChanged(){return this._parent.changed}get children(){if(this._hasChildren){if(!this._children){const t=this.disposeVar(new xu);this._children=t,this.dispose(t.toChangeEvent.disposableOn((s,o)=>{for(let a of s){const{start:u,deleteCount:l,items:c}=a;for(let h=u;h<u+l;++h)o.get(h)._parent.value=void 0;for(let h of c){if(h.parent)throw console.error("请检查新增的treeItem是否正在使用!"),new Error("item.parent should not exist!");h._parent.value=this}}}));const n=new Set,i=new Set;this.dispose(t.toChangeEvent.disposableOn((s,o)=>{var a;if(this.tree){n.clear(),i.clear();for(let u of s){const{start:l,deleteCount:c,items:h}=u;for(let f=l;f<l+c;++f)n.add(o.get(f));for(let f of h)i.add(f)}for(let u of n)i.has(u)&&(n.delete(u),i.delete(u));(a=this.tree)==null||a.itemChildrenToChange.emit(this,s,n,i)}})),this.dispose(t.changedEvent.disposableOn(()=>{var s;(s=this.tree)==null||s.itemChildrenChanged.emit(this)})),this.dispose(t.toChangeEvent.disposableOn((...s)=>this._childrenToChangeEvent&&this._childrenToChangeEvent.emit(...s))),this.dispose(t.changedEvent.disposableOn((...s)=>this._childrenChangedEvent&&this._childrenChangedEvent.emit(...s)))}return this._children}else return}get childrenResetedEvent(){return this._childrenResetedEvent||(this._childrenResetedEvent=new O),this._childrenResetedEvent}get childrenToChangeEvent(){return this._childrenToChangeEvent||(this._childrenToChangeEvent=new O),this._childrenToChangeEvent}get childrenChangedEvent(){return this._childrenChangedEvent||(this._childrenChangedEvent=new O),this._childrenChangedEvent}resetChildren(t=!1){this._children&&(this._children.length=0),this._hasChildren=t,this._childrenResetedEvent&&this._childrenResetedEvent.emit(t)}*getDescendants(t){const n=this,i=[],s=[];for(n.children&&n.children.length>0&&(!t||t(n))&&(i.push(0),s.push(n.children));i.length>0;){const o=i[i.length-1],a=s[s.length-1],u=a.get(o);yield u,o<a.length-1?++i[i.length-1]:(s.pop(),i.pop()),u.children&&u.children.length>0&&(!t||t(u))&&(i.push(0),s.push(u.children))}}*getAncestors(t){let n=this.parent;for(;n&&(yield n,!(t&&!t(n)));)n=n.parent}isDescendantOf(t){for(let n of this.getAncestors())if(n===t)return!0;return!1}isAncestorOf(t){return t.isDescendantOf(this)}get level(){return this._level.value}get levelChanged(){return this._level.changed}get tree(){return this._tree}canMoveTo(t,n){return Lu(this,t,n)}moveTo(t,n){Gl(this,t,n)}detachFromParent(){if(!this.parent||!this.parent.children)return;const t=this.parent.children.indexOf(this);this.parent.children.splice(t,1)}insertNewTreeItem(t,n){if(n&&n.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&t.startsWith("Inner"))return n&&this.children.push(n),!0;if(t==="Inner")return!1;const i=this.parent;if(!i||!i.children)return!1;const s=i.children.indexOf(this);return t.endsWith("Before")?n&&i.children.splice(s,0,n):t.endsWith("After")&&n&&i.children.splice(s+1,0,n),!0}};d(ii,"wm",new Map),d(ii,"allTreeItems",new Map);let na=ii;class sg extends V{constructor(t){super();d(this,"_redrawEvent",this.disposeVar(new O));d(this,"_containerScrollTop",this.disposeVar(j(0)));d(this,"_containerClientHeight",this.disposeVar(j(-1)));d(this,"_container",this.disposeVar(j(void 0)));d(this,"_redrawInfo",{topFreeSpaceHeight:0,topUnvisibleItemNum:0,middleTreeItems:[],bottomFreeSpaceHeight:0,bottomUnvisibleItemNum:0});this._tree=t;const n=this._containerClientHeight,i=this._containerScrollTop,s=this._tree._forceRedrawEvent,o=this.disposeVar(Ie(this._tree.itemDivHeightChanged,this._tree.itemChildrenChanged,this._tree.itemsChanged,n.changed,i.changed,s)),{redrawInfo:a}=this,u=c=>{const h=c.uiTreeObject;return!!c.children&&(!h||!h.collapsed)};this.dispose(o.disposableOn(()=>{if(a.topFreeSpaceHeight=0,a.topUnvisibleItemNum=0,a.middleTreeItems.length=0,a.bottomFreeSpaceHeight=0,a.bottomUnvisibleItemNum=0,this._containerClientHeight.value>=0){const c=ph(this._tree.getDescendants(u)),h=this._tree.itemDivHeight,f=h*c,p=Wi([ys([Wi([f-n.value,0]),i.value]),0]),v=p/h|0,C=Math.ceil((p-v*h+n.value)/h)|0;v>0&&(a.topUnvisibleItemNum=v,a.topFreeSpaceHeight=v*this._tree.itemDivHeight);const S=v+C;let P=0;for(let _ of this._tree.getDescendants(u)){if(P>=S)break;P>=v&&a.middleTreeItems.push(_),++P}const y=c-v-C;y>0&&(a.bottomUnvisibleItemNum=y,a.bottomFreeSpaceHeight=y*this._tree.itemDivHeight)}else for(let c of this._tree.getDescendants(u))a.middleTreeItems.push(c);this._redrawEvent.emit(a)}));let l;this.dispose(()=>l&&(l.destroy(),l=void 0)),this.dispose(this.containerChanged.disposableOn(c=>{l&&(l.destroy(),l=void 0),c&&(l=Ou(),l.start(()=>{const{scrollTop:h,clientHeight:f}=c;typeof h>"u"||typeof f>"u"?Xo("createUiTreeWithContainer error: conainter has no scrollTop or clientHeight property!"):(this.containerScrollTop=h,this.containerClientHeight=f)}))}))}get container(){return this._container.value}set container(t){this._container.value=t}get containerChanged(){return this._container.changed}get redrawInfo(){return this._redrawInfo}getTreeItemPos(t){const n=o=>{const a=o.uiTreeObject;return!!o.children&&(!a||!a.collapsed)};let i=0,s=!1;for(let o of this._tree.getDescendants(n)){if(o===t){s=!0;break}++i}if(s)return[i,i*this._tree.itemDivHeight]}collapseAll(){console.log("collapseAll");for(let t of this.tree.root.getDescendants()){const n=t.uiTreeObject;n.collapsed=!0}}get tree(){return this._tree}get redrawEvent(){return this._redrawEvent}set containerScrollTop(t){this._containerScrollTop.value=t}get containerScrollTop(){return this._containerScrollTop.value}get containerScrollTopChanged(){return this._containerScrollTop.changed}set containerClientHeight(t){this._containerClientHeight.value=t}get containerClientHeight(){return this._containerClientHeight.value}get containerClientHeightChanged(){return this._containerClientHeight.changed}*getAllItems(t){for(let n of this._tree.getDescendants())(!t||t(n))&&(yield n)}getAllSelectedItems(){return this.getAllItems(t=>t.uiTreeObject.selected)}getAllCheckedLeafItems(){return this.getAllItems(t=>!t.children&&t.uiTreeObject.checkedStatus==="checked")}clearAllSelectedItems(t){for(let n of this.getAllSelectedItems())(!t||!t.includes(n))&&(n.uiTreeObject.selected=!1)}}let ra=(si=class extends V{constructor(t){super();d(this,"_root",this.disposeVar(new na(this,!0,"_ROOT")));d(this,"_itemChildrenChanged",this.disposeVar(new O));d(this,"_itemChildrenToChange",this.disposeVar(new O));d(this,"_itemsAdded",this.disposeVar(new O));d(this,"_itemsDeleted",this.disposeVar(new O));d(this,"_itemsChanged",this.disposeVar(new O));d(this,"_transactionStack",0);d(this,"_addedItems",new Set);d(this,"_deletedItems",new Set);d(this,"_selectedItems",this.disposeVar(new xu));d(this,"_itemDivHeight",this.disposeVar(j(si.defaultItemDivHeight)));d(this,"_forceRedrawEvent",this.disposeVar(new O));d(this,"_uiTree",this.disposeVar(new sg(this)));this._root._tree.value=this,this.dispose(this._itemChildrenToChange.disposableOn((n,i)=>{if(!n.children){console.error("!item.children");return}for(let s of i){const{start:o,deleteCount:a,items:u}=s;for(let l=o;l<o+a;++l){const c=n.children.get(l);this._deletedItems.has(c)?console.error(`this._deletedItems.has(currentItem(${c.id}))`):this._deletedItems.add(c)}for(let l of u)this._deletedItems.has(l)?this._deletedItems.delete(l):this._addedItems.add(l)}this._execTransaction()})),t!==void 0&&(this.itemDivHeight=t)}get selectedItems(){return this._selectedItems}get lastSelectedItem(){return this._selectedItems.length>0?this._selectedItems.get(this._selectedItems.length-1):void 0}get itemDivHeight(){return this._itemDivHeight.value}set itemDivHeight(t){this._itemDivHeight.value=t}get itemDivHeightChanged(){return this._itemDivHeight.changed}forceRedraw(){this._forceRedrawEvent.emit()}get uiTree(){return this._uiTree}get root(){return this._root}get children(){return this._root.children}getDescendants(t){return this._root.getDescendants(t)}getTreeItemFromId(t){let n;for(let i of this.getDescendants())if(i.id===t){n=i;break}return n}_startTransaction(){this._transactionStack===0&&(this._deletedItems.size>0&&(console.warn("this._deletedItems.size > 0"),this._deletedItems.clear()),this._addedItems.size>0&&(console.warn("this._addedItems.size > 0"),this._addedItems.clear())),++this._transactionStack}_stopTransaction(){--this._transactionStack,this._execTransaction()}_execTransaction(){this._transactionStack===0&&(this._deletedItems.size>0&&(this._itemsDeleted.emit([...this._deletedItems]),this._deletedItems.clear()),this._addedItems.size>0&&(this._itemsAdded.emit([...this._addedItems]),this._addedItems.clear()))}get itemChildrenChanged(){return this._itemChildrenChanged}get itemChildrenToChange(){return this._itemChildrenToChange}get itemsChanged(){return this._itemsChanged}get itemsAdded(){return this._itemsAdded}get itemsDeleted(){return this._itemsDeleted}},d(si,"defaultItemDivHeight",24),d(si,"canMoveToTreeItem",Lu),d(si,"moveToTreeItem",Gl),d(si,"canMoveToTreeItems",ng),d(si,"moveToTreeItems",rg),si);class Ee extends V{constructor(t,n,i=!0,s){super();d(this,"_obj",this.disposeVar(j(void 0)));this._resetEvent=t,this._createFunc=n;const o=this._resetEvent,a=this._createFunc,u=()=>{this._obj.value&&(this._obj.value.destroy(),this._obj.value=void 0)};this.dispose(u);const l=(...c)=>{u(),this._obj.value=a(...c)};i&&(s?this._obj.value=a(...s):this._obj.value=a()),this.dispose(o.disposableOn(l))}get obj(){return this._obj.value}get objChanged(){return this._obj.changed}}class w0 extends V{constructor(t,n=!0,i){super();d(this,"_event",this.disposeVar(new O));d(this,"_objResettingWithEvent");this._createFunc=t,this._execOnInit=n,this._initParams=i,this._objResettingWithEvent=this.disposeVar(new Ee(this._event,this._createFunc,this._execOnInit,this._initParams))}get obj(){return this._objResettingWithEvent.obj}get objChanged(){return this._objResettingWithEvent.objChanged}reset(...t){this._event.emit(...t)}}const th=class th extends V{constructor(){super();d(this,"_set",new Set);d(this,"_toChangeEvent",this.dv(new O));d(this,"_changedEvent",this.dv(new O));d(this,"main");this.dispose(()=>{this._set.size!==0&&(th.warnOnDestroying&&console.warn("this._set.size > 0"),this.clear())})}get toChange(){return this._toChangeEvent}get changed(){return this._changedEvent}add(...t){if(t.length==2&&typeof t[1]=="boolean")t[1]&&(this.main=t[0]);else for(let n of t)this._toChangeEvent.emit([],[n]),this._set.add(n),this._changedEvent.emit([],[n])}delete(...t){for(let n of t)this.main&&this.main==n&&(this.main=void 0),this._toChangeEvent.emit([n],[]),this._set.delete(n),this._changedEvent.emit([n],[])}disposableAdd(...t){return t.length==2&&typeof t[1]=="boolean"?(t[1]&&(this.main=t[0]),this.add(t[0]),()=>this.delete(t[0])):(this.add(...t),()=>this.delete(...t))}get size(){return this._set.size}clear(){const t=[...this._set];this._toChangeEvent.emit([],t),this._set.clear(),this._changedEvent.emit([],t),this.main=void 0}values(){return this._set.values()}};d(th,"warnOnDestroying",!0);let Wl=th;async function og(r){const e=[],t=[],n=r.entries();for await(const[i,s]of n){const o=s;o.kind==="file"?e.push(i):o.kind==="directory"&&t.push(i)}return{files:e,dirs:t}}async function kh(r){return await(await r.getFile()).text()}async function ag(r){const e=await kh(r);try{return JSON.parse(e)}catch{return}}async function ug(r){return await(await r.getFile()).arrayBuffer()}class lg extends V{constructor(e){super(),this._rootDirHandle=e}get rootDirHandle(){return this._rootDirHandle}async getSubFilesAndDirs(){return await og(this._rootDirHandle)}async getDir(e){let t=this._rootDirHandle;for(const n of e)if(t=await(t==null?void 0:t.getDirectoryHandle(n)),!t){console.log(`getDirectoryHandle ${n} failed`);return}return t}async getFile(e,t){const n=await this.getDir(e);if(n)try{return await n.getFileHandle(t)}catch(i){console.error(`未能获取当前文件 ${e.join("/")}/${t} error: ${i}`,i);return}}}class cg extends V{constructor(t){super();d(this,"_startRootDirId",0);d(this,"_dirMap",new Map);this._prefix=t}get prefix(){return this._prefix}async getRootDirId(t){let n;try{console.log("window.showDirectoryPicker begin"),n=await globalThis.showDirectoryPicker({id:t,mode:"read"}),console.log("window.showDirectoryPicker end",n)}catch(i){console.error(`LocalFileServer getRootDirId failed: ${i}`,i);return}if(n){const i=++this._startRootDirId,s=`${this._prefix}${i}`;return this._dirMap.set(s,new lg(n)),s}}getRootDir(t){return this._dirMap.get(t)}async getFile(t){const n=t.split("/");if(n.length<2){console.warn(`LocalFileServer getFile failed: ${t}`);return}const i=n[0],s=this._dirMap.get(i);if(!s){console.warn(`LocalFileServer getFile failed: ${t}`);return}const o=n.slice(1,n.length-1),a=n[n.length-1],u=await s.getFile(o,a);if(!u){console.warn(`LocalFileServer getFile failed: ${t}`);return}return u}async getText(t){const n=await this.getFile(t);if(n)return await kh(n)}async getArrayBuffer(t){const n=await this.getFile(t);if(n)return await ug(n)}async getJson(t){const n=await this.getFile(t);if(n)return await ag(n)}async getLocalFilePath(t,n,i){const s=await this.getRootDirId(n);if(!s){console.warn("getRootDirId error!");return}const o=this.getRootDir(s);if(!o){console.warn("getRootDir error!");return}const a=await o.getSubFilesAndDirs();if(!a.files){console.warn("getSubFilesAndDirs error! 找不到符合要求的文件!");return}const u=t?a.files.filter(l=>t.some(c=>l.endsWith(c))):a.files;if(u.length===0){console.warn("找不到符合要求的文件!");return}return`https://${s}/${u[0]}`}}const hg=new cg("xe2_local");async function E0(r,e,t){return await hg.getLocalFilePath(r,e,t)}class dg extends V{constructor(t,n){super();d(this,"_processing",this.disposeVar(Yn(async t=>{const n=this._complexImage,i=await t.promise(Op(this._imageUri,this._complexImage.crossOrigin));i&&i instanceof HTMLImageElement&&(n.size=[i.naturalWidth,i.naturalHeight],n.pixelFormat="RGBA",n.copyTexture({source:i}))})));this._complexImage=t,this._imageUri=n,this._processing.start()}get processing(){return this._processing}}const fg=["DEPTH_COMPONENT","DEPTH_STENCIL","ALPHA","RED","RG","RGB","RGBA","LUMINANCE","LUMINANCE_ALPHA","RGB_DXT1","RGBA_DXT1","RGBA_DXT3","RGBA_DXT5","RGB_PVRTC_4BPPV1","RGB_PVRTC_2BPPV1","RGBA_PVRTC_4BPPV1","RGBA_PVRTC_2BPPV1","RGBA_ASTC","RGB_ETC1","RGB8_ETC2","RGBA8_ETC2_EAC","RGBA_BC7"],pg=["img","gif","video","flv","hls"];let C0=class extends V{constructor(t,n){super();d(this,"_element");this._complexImage=t,this._videoSrc=n;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden",i.style.width="0px",i.style.height="0px";{const s=()=>{i.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{i.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{i.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}};class gg extends V{constructor(t,n){super();d(this,"_videoDom");d(this,"_update",this.disposeVar(ea(()=>this.update())));d(this,"_updateStart",this._update.start());this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new C0(this._complexImage,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:i}=this.videoElement;t.size=[n,i],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}function Vh(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function S0(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var jh={},Hi={},mg;function b0(){if(mg)return Hi;mg=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.loop=Hi.conditional=Hi.parse=void 0;var r=function n(i,s){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o;if(Array.isArray(s))s.forEach(function(l){return n(i,l,o,a)});else if(typeof s=="function")s(i,o,a,n);else{var u=Object.keys(s)[0];Array.isArray(s[u])?(a[u]={},n(i,s[u],o,a[u])):a[u]=s[u](i,o,a,n)}return o};Hi.parse=r;var e=function(i,s){return function(o,a,u,l){s(o,a,u)&&l(o,i,a,u)}};Hi.conditional=e;var t=function(i,s){return function(o,a,u,l){for(var c=[],h=o.pos;s(o,a,u);){var f={};if(l(o,i,a,f),o.pos===h)break;h=o.pos,c.push(f)}return c}};return Hi.loop=t,Hi}var Ce={},vg;function yg(){if(vg)return Ce;vg=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.readBits=Ce.readArray=Ce.readUnsigned=Ce.readString=Ce.peekBytes=Ce.readBytes=Ce.peekByte=Ce.readByte=Ce.buildStream=void 0;var r=function(h){return{data:h,pos:0}};Ce.buildStream=r;var e=function(){return function(h){return h.data[h.pos++]}};Ce.readByte=e;var t=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(f){return f.data[f.pos+h]}};Ce.peekByte=t;var n=function(h){return function(f){return f.data.subarray(f.pos,f.pos+=h)}};Ce.readBytes=n;var i=function(h){return function(f){return f.data.subarray(f.pos,f.pos+h)}};Ce.peekBytes=i;var s=function(h){return function(f){return Array.from(n(h)(f)).map(function(p){return String.fromCharCode(p)}).join("")}};Ce.readString=s;var o=function(h){return function(f){var p=n(2)(f);return h?(p[1]<<8)+p[0]:(p[0]<<8)+p[1]}};Ce.readUnsigned=o;var a=function(h,f){return function(p,v,C){for(var S=typeof f=="function"?f(p,v,C):f,P=n(h),y=new Array(S),_=0;_<S;_++)y[_]=P(p);return y}};Ce.readArray=a;var u=function(h,f,p){for(var v=0,C=0;C<p;C++)v+=h[f+C]&&Math.pow(2,p-C-1);return v},l=function(h){return function(f){for(var p=e()(f),v=new Array(8),C=0;C<8;C++)v[7-C]=!!(p&1<<C);return Object.keys(h).reduce(function(S,P){var y=h[P];return y.length?S[P]=u(v,y.index,y.length):S[P]=v[y.index],S},{})}};return Ce.readBits=l,Ce}var _g;function P0(){return _g||(_g=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var e=b0(),t=yg(),n={blocks:function(f){for(var p=0,v=[],C=f.data.length,S=0,P=(0,t.readByte)()(f);P!==p&&P;P=(0,t.readByte)()(f)){if(f.pos+P>=C){var y=C-f.pos;v.push((0,t.readBytes)(y)(f)),S+=y;break}v.push((0,t.readBytes)(P)(f)),S+=P}for(var _=new Uint8Array(S),m=0,w=0;w<v.length;w++)_.set(v[w],m),m+=v[w].length;return _}},i=(0,e.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},function(h){var f=(0,t.peekBytes)(2)(h);return f[0]===33&&f[1]===249}),s=(0,e.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,t.readArray)(3,function(h,f,p){return Math.pow(2,p.descriptor.lct.size+1)})},function(h,f,p){return p.descriptor.lct.exists}),{data:[{minCodeSize:(0,t.readByte)()},n]}]},function(h){return(0,t.peekByte)()(h)===44}),o=(0,e.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(f,p,v){return(0,t.readBytes)(v.text.blockSize)(f)}},n]},function(h){var f=(0,t.peekBytes)(2)(h);return f[0]===33&&f[1]===1}),a=(0,e.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(f,p,v){return(0,t.readString)(v.blockSize)(f)}},n]},function(h){var f=(0,t.peekBytes)(2)(h);return f[0]===33&&f[1]===255}),u=(0,e.conditional)({comment:[{codes:(0,t.readBytes)(2)},n]},function(h){var f=(0,t.peekBytes)(2)(h);return f[0]===33&&f[1]===254}),l=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,e.conditional)({gct:(0,t.readArray)(3,function(h,f){return Math.pow(2,f.lsd.gct.size+1)})},function(h,f){return f.lsd.gct.exists}),{frames:(0,e.loop)([i,a,u,s,o],function(h){var f=(0,t.peekByte)()(h);return f===33||f===44})}],c=l;r.default=c}(jh)),jh}var I0=P0();const x0=Vh(I0);var T0=yg();const O0=(r,e)=>{const t=new Array(r.length),n=r.length/e,i=function(c,h){const f=r.slice(h*e,(h+1)*e);t.splice.apply(t,[c*e,e].concat(f))},s=[0,4,2,1],o=[8,8,4,2];for(var a=0,u=0;u<4;u++)for(var l=s[u];l<n;l+=o[u])i(l,a),a++;return t},N0=(r,e,t)=>{const s=t;var o,a,u,l,c,h,f,w,p,v,m,C,E,b,T,I;const S=new Array(t),P=new Array(4096),y=new Array(4096),_=new Array(4097);for(C=r,a=1<<C,c=a+1,o=a+2,f=-1,l=C+1,u=(1<<l)-1,p=0;p<a;p++)P[p]=0,y[p]=p;var m,w,E,b,I,T;for(m=w=E=b=I=T=0,v=0;v<s;){if(b===0){if(w<l){m+=e[T]<<w,w+=8,T++;continue}if(p=m&u,m>>=l,w-=l,p>o||p==c)break;if(p==a){l=C+1,u=(1<<l)-1,o=a+2,f=-1;continue}if(f==-1){_[b++]=y[p],f=p,E=p;continue}for(h=p,p==o&&(_[b++]=E,p=f);p>a;)_[b++]=y[p],p=P[p];E=y[p]&255,_[b++]=E,o<4096&&(P[o]=f,y[o]=E,o++,(o&u)===0&&o<4096&&(l++,u+=o)),f=h}b--,S[I++]=_[b],v++}for(v=I;v<s;v++)S[v]=0;return S},D0=r=>{const e=new Uint8Array(r);return qn.parse(T0.buildStream(e),x0)},M0=r=>{const e=r.pixels.length,t=new Uint8ClampedArray(e*4);for(var n=0;n<e;n++){const i=n*4,s=r.pixels[n],o=r.colorTable[s]||[0,0,0];t[i]=o[0],t[i+1]=o[1],t[i+2]=o[2],t[i+3]=s!==r.transparentIndex?255:0}return t},R0=(r,e,t)=>{if(!r.image){console.warn("gif frame does not have associated image.");return}const{image:n}=r,i=n.descriptor.width*n.descriptor.height;var s=N0(n.data.minCodeSize,n.data.blocks,i);n.descriptor.lct.interlaced&&(s=O0(s,n.descriptor.width));const o={pixels:s,dims:{top:r.image.descriptor.top,left:r.image.descriptor.left,width:r.image.descriptor.width,height:r.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?o.colorTable=n.lct:o.colorTable=e,r.gce&&(o.delay=(r.gce.delay||10)*10,o.disposalType=r.gce.extras.disposal,r.gce.extras.transparentColorGiven&&(o.transparentIndex=r.gce.transparentColorIndex)),o.patch=M0(o),o},L0=(r,e)=>r.frames.filter(t=>t.image).map(t=>R0(t,r.gct));async function wg(r){const t=await(await fetch(r)).arrayBuffer(),n=D0(t),i=L0(n);return{gif:n,gifFrames:i,arrayBuffer:t}}function Eg(r,e,t){return r<e?e:r>t?t:r}class Cg extends Ul{constructor(t,n=!0,i){super();d(this,"_gifFrames",this.disposeVar(j(void 0)));d(this,"_gifDurations",[]);d(this,"_gifDuration",this.disposeVar(j(0)));d(this,"_gifSize",this.disposeVar(j([0,0],(t,n)=>t.every((i,s)=>i===n[s]),t=>[...t])));d(this,"_autoPlayOnLoad",this.disposeVar(j(!0)));d(this,"_gifCanvas");this._container=t,this.loop=!0;const s=document.createElement("canvas");this._gifCanvas=s,s.style.width="100%",s.style.height="100%";const o=s.getContext("2d");this._container&&this._container.appendChild(s),this.dispose(()=>this._container&&this._container.removeChild(s));let a;this.dispose(this._gifFrames.changed.disposableOn(l=>{if(!l||l.length===0){s.width=0,s.height=0;return}const{width:c,height:h}=l[0].dims;this._gifSize.value=[c,h];const f=l.length;let p=0;this._gifDurations.length=0;for(let v=0;v<f;++v)p+=l[v].delay,this._gifDurations.push(p);this._gifDuration.value=this._gifDurations[this._gifDurations.length-1],s.width=c,s.height=h,a=o.createImageData(c,h),this.currentTimeChangedEvent.emit(this.currentTime,this.currentTime),this._autoPlayOnLoad.value&&(this.currentTime=0,this.playing=!0)}));let u=-1;this.dispose(this.currentTimeChangedEvent.disposableOn(l=>{const c=Eg(l/this.duration,0,1),h=this.gifDuration*c,f=this._gifFrames.value;if(f&&f.length>0){const p=this._getFrame(h);if(p===u)return;u=p;const v=f[p];if(v.disposalType!==0&&v.disposalType!==1&&v.disposalType!==2&&Xo(`gif parsed get disposalType ${v.disposalType}... frame: ${p} size: ${JSON.stringify(v.dims)}`,`gif parsed get disposalType ${v.disposalType}...`),a&&(p===0||v.disposalType===2)&&a.data.fill(0),a){const[C,S]=this._gifSize.value,{width:P,height:y,left:_,top:m}=v.dims;if(y>S)throw new Error("height > canvasHeight");for(let w=0;w<y;++w)for(let E=0;E<P;++E){const b=w*P+E,I=m+w,T=_+E,D=I*C+T,x=a.data,N=v.patch,L=N[b*4+3]/255;x[D*4+0]=x[D*4+0]*(1-L)+N[b*4+0]*L|0,x[D*4+1]=x[D*4+1]*(1-L)+N[b*4+1]*L|0,x[D*4+2]=x[D*4+2]*(1-L)+N[b*4+2]*L|0,x[D*4+3]=Eg(x[D*4+3]+N[b*4+3],0,255)|0}o.putImageData(a,0,0)}}else Xo("gif资源未加载!无法播放!")})),this.dispose(this._gifDuration.changed.disposableOn(()=>{this.duration=this.gifDuration})),this._autoPlayOnLoad.value=n,this._gifFrames.value=i}get gifCanvas(){return this._gifCanvas}set gifFrames(t){this._gifFrames.value=t}get gifFrames(){return this._gifFrames.value}get gifFramesChanged(){return this._gifFrames.changed}get gifSize(){return this._gifSize.value}get gifSizeChanged(){return this._gifSize.changed}get gifDuration(){return this._gifDuration.value}get gifDurationChanged(){return this._gifDuration.changed}get autoPlayOnLoad(){return this._autoPlayOnLoad.value}set autoPlayOnLoad(t){this._autoPlayOnLoad.value=t}get autoPlayOnLoadChanged(){return this._autoPlayOnLoad.changed}_getFrame(t){const n=this._gifDurations.length;for(let i=0;i<n;++i)if(t<=this._gifDurations[i])return i;throw new Error("should not be here")}}class Sg extends V{constructor(t){super();d(this,"_player");d(this,"_url",this.disposeVar(j("")));d(this,"_loadGifFramesProcessing",this.disposeVar(zl(t=>ta(wg(t)))));this._player=this.disposeVar(new Cg(t)),this._player.autoPlayOnLoad=!0,this._loadGifFramesProcessing.completeFunc=({gifFrames:n})=>this._player.gifFrames=n,this.dispose(this._url.changed.disposableOn(n=>{this._player.gifFrames=void 0,this._loadGifFramesProcessing.restart(new Fr(`reload gif(${n})`),n)}))}get player(){return this._player}set url(t){this._url.value=t}get url(){return this._url.value}get loadedEvent(){return this._loadGifFramesProcessing.completeEvent}get size(){return this._player.gifSize}get sizeChanged(){return this._player.gifSizeChanged}get duration(){return this._player.gifDuration}get durationChanged(){return this._player.gifDurationChanged}}class bg extends V{constructor(t,n){super();d(this,"_gif",this.disposeVar(new Sg));d(this,"_update",this.disposeVar(ea(()=>this.update())));d(this,"_updateStart",this._update.start());this._complexImage=t,this._imageUri=n,this._gif.url=this._imageUri}get gif(){return this._gif}update(){const{player:t}=this._gif;if(!t.gifFrames)return;const n=this._complexImage,{width:i,height:s}=t.gifCanvas;n.size=[i,s],n.pixelFormat="RGBA",n.copyTexture({source:t.gifCanvas});{const o=()=>{t.autoPlayOnLoad=this._complexImage.autoplay};o(),this.dispose(this._complexImage.autoplayChanged.disposableOn(o))}{const o=()=>{t.loop=this._complexImage.loop};o(),this.dispose(this._complexImage.loopChanged.disposableOn(o))}}}function Pg(r,e){const[t,n,i]=zi(r),s=j(void 0),o=()=>{const a=t()??e;s.value=a&&rt.context.getStrFromEnv(a)};return o(),i&&s.d(i.don(o)),s.d(rt.context.environmentVariablesChanged.don(o)),s}function Ig(r){const e=/\${(.*?)\}/g;if(!e.test(r))return r;const t=r.replace(e,(n,i)=>{const s=rt.context.getEnv(i);return s===void 0?(console.warn(`环境变量(${i})不存在,无法进行转换`),"{env-error}"):s});return Ig(t)}class F0 extends V{constructor(t){super();d(this,"_sceneObjRefs",new Map);d(this,"_refs",{});d(this,"_refsChanged",this.dv(new O));const n=(i,s,o)=>{if(o){const a=this.getLastSceneObject(o),u=this._sceneObjRefs.get(o);if(!u)console.warn(`this._sceneObjRefs中不存在ref(${o}), 可能系统存在逻辑问题`);else{const c=u.indexOf(i);c===-1?console.warn(`this._sceneObjRefs中不存在当前对象(id: ${i.id} type: ${i.typeName})!可能系统存在逻辑问题`):(u.splice(c,1),u.length===0&&this._sceneObjRefs.delete(o))}const l=this.getLastSceneObject(o);this._refs[o]=l,this._refsChanged.emit(l,a)}if(s){const a=this.getLastSceneObject(s),u=this._sceneObjRefs.get(s);u?(u.push(i),u.length>0&&console.warn(`同时存在多个ref${s}相同的场景对象!
21
+ `)}}),globalThis.g_XE3CopyRights=globalThis.g_XE3CopyRights||{},globalThis.g_XE3CopyRights[r]=g.copyright,globalThis.g_XE3SendProductUsageInfo=globalThis.g_XE3SendProductUsageInfo||!0,globalThis.g_XE3SendProductUsageInfo&&(setTimeout(()=>vp(g.copyright),1e3*60),setInterval(()=>vp(g.copyright),24*60*60*1e3)),globalThis.g_earthsdk_copyright_print=globalThis.g_earthsdk_copyright_print??!0,globalThis.g_earthsdk_copyright_print&&g.copyright.print()}catch{console.warn("版本信息有误!")}const yp=new Set;function Xo(r,e=r){yp.has(e)||(yp.add(e),console.warn(r))}function zi(r){const e=Dl(r),t=()=>e[0][e[1]],n=s=>{try{e[0][e[1]]=s}catch(o){Xo(`setValue error, obj(${e[0].constructor.name}) prop(${e[1]}) error(${o})`)}},i=e[0][e[2]];return[t,n,i]}function t_(){return!0}function e_(){throw new Error("throwOnDestroyed")}function _p(r){for(var e in r)typeof r[e]=="function"&&(r[e]=e_);r.isDestroyed=t_}const Qc=class Qc{constructor(){d(this,"_memId",++Qc._lastMemId);d(this,"_disposers")}get __v_skip(){return!0}get memId(){return this._memId}get disposers(){return this._disposers||(this._disposers=[]),this._disposers}dispose(e){return this.disposers.push(e),e}d(e){return this.dispose(e)}disposeVar(e){return this.disposers.push(()=>e.destroy()),e}dv(e){return this.disposeVar(e)}tryDisposeVar(e){return this.disposers.push(()=>e.tryDestroy()),e}tdv(e){return this.tryDisposeVar(e)}autoDispose(e){return typeof e=="function"?this.dispose(e):this.disposeVar(e)}ad(e){return typeof e=="function"?this.dispose(e):this.disposeVar(e)}isDestroyed(){return!1}destroyImp(){}destroy(){if(this._toDestroyEvent&&this._toDestroyEvent.emit(),this.destroyImp(),this._disposers)try{const e=this._disposers,t=e.length;for(let n=t-1;n>=0;--n)e[n]();e.length=0,this._disposers=void 0}catch(e){console.error(`destroy get error! ${e}`)}return _p(this)}tryDestory(){if(!this.isDestroyed())return this.destroy()}};d(Qc,"_lastMemId",-1);let V=Qc,nh;function wp(r){nh=r}Object.defineProperties(V.prototype,{toDestroyEvent:{get(){if(this._toDestroyEvent===void 0){if(!nh)throw new Error("Destroyable EventCtor not registered yet!");this._toDestroyEvent=this.disposeVar(new nh)}return this._toDestroyEvent}}});class Tl{constructor(e,t,n=!1){d(this,"_freeElements");d(this,"_usedElementsCount");d(this,"_usedElements");d(this,"_nextCreateID");d(this,"_scratchObjs");this._createDefaultFunc=e,this._destroyFunc=t,this._freeElements=[],this._usedElementsCount=0,this._nextCreateID=1,this._scratchObjs=[],n&&(this._usedElements=[])}get usedElementsCount(){return this._usedElementsCount}get freeElementsCount(){return this._freeElements.length}_getCreateID(){return this._nextCreateID++}_create(){let e;return this._freeElements.length>0?e=this._freeElements.pop():e=this._createDefaultFunc&&this._createDefaultFunc()||{},e._cid=this._getCreateID(),e}create(){return this._create()}multiCreate(e){this._scratchObjs.length=0;for(let t=0;t<e;++t)this._scratchObjs.push(this._create());return this._scratchObjs}_destroy(e){this._destroyFunc&&this._destroyFunc(e),e._cid=void 0}destroy(...e){const t=e.length;for(let n=0;n<t;++n)this._destroy(e[n])}}function n_(){return{item:void 0,previous:void 0,next:void 0}}function r_(r){r.item=void 0,r.previous=void 0,r.next=void 0}const Ep=new Tl(n_,r_,!0);function rh(r,e,t){const n=Ep.create();return n.item=r,n.previous=e,n.next=t,n}function Cp(r){if(!r)throw new Error("node is undefined!");Ep.destroy(r)}function ih(r,e){e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=void 0,r.tail=e.previous):e.next?(e.next.previous=void 0,r.head=e.next):(r.head=void 0,r.tail=void 0),e.next=void 0,e.previous=void 0}class Sp{constructor(e){d(this,"head");d(this,"tail");d(this,"_length");const{needLength:t}=e||{needLength:!0};this.head=void 0,this.tail=void 0,t&&(this._length=0)}_incrementLength(){typeof this._length=="number"&&++this._length}_decrementLength(){typeof this._length=="number"&&--this._length}_setLength(e){typeof this._length=="number"&&(this._length=e)}get length(){return this._length}get empty(){return!this.head}*[Symbol.iterator](){let e=this.head;for(;e;)yield e,e=e.next}remove(e){if(!e)throw new Error("node is undefined!");ih(this,e),this._decrementLength(),Cp(e)}getNode(e){let t=this.head;for(;t!==null;){if(!t)throw new Error("current is undefined!");if(t.item===e)return t;t=t.next}}moveAfter(e,t){if(e!==t){ih(this,t);var n=e.next;e.next=t,this.tail===e?this.tail=t:n&&(n.previous=t),t.next=n,t.previous=e}}moveBefore(e,t){if(e!==t){ih(this,t);var n=e.previous;e.previous=t,this.head===e?this.head=t:n&&(n.next=t),t.previous=n,t.next=e}}insertBefore(e,t){const n=rh(t,e.previous,e);return e.previous&&(e.previous.next=n),e.previous=n,this.head===e&&(this.head=n),this._incrementLength(),n}insertAfter(e,t){const n=rh(t,e,e.next);return e.next&&(e.next.previous=n),e.next=n,this.tail===e&&(this.tail=n),this._incrementLength(),n}_setFirstNode(e){if(this.head||this.tail)throw new Error("_setFirstNode error!");const t=rh(e,void 0,void 0);if(this.head=t,this.tail=t,this._incrementLength(),this._length!==1)throw new Error("_setFirstNode error! this._length !== 1");return t}push(e){return this.tail?this.insertAfter(this.tail,e):this._setFirstNode(e)}pop(){if(!this.tail)throw new Error("DoublyLinkedList is empty!");const e=this.tail.item;return this.remove(this.tail),e}shift(){if(!this.head)throw new Error("DoublyLinkedList is empty!");const e=this.head.item;return this.remove(this.head),e}unshift(e){return this.head?this.insertBefore(this.head,e):this._setFirstNode(e)}removeAll(){let e=this.head;for(;e;){const t=e.next;Cp(e),e=t}this.head=void 0,this.tail=void 0,this._setLength(0)}}function i_(){return{func:void 0,scope:void 0,_hasRemoved:!1,_once:!1}}function s_(r){r.func=void 0,r.scope=void 0,r._hasRemoved=!1,r._once=!1}const Zs=new Tl(i_,s_,!0);class sh{constructor(){d(this,"__dll");d(this,"__currentListenerStack")}get _dll(){return this.__dll=this.__dll??new Sp({needLength:!0}),this.__dll}_pushCurrentListener(e){this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.push(e):this.__currentListenerStack=[this.__currentListenerStack,e]:this.__currentListenerStack=e}_popCurrentListener(){if(this.__currentListenerStack)Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.pop():this.__currentListenerStack=void 0;else throw new Error("cannot pop!")}_hasCurrentListener(e){return this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.indexOf(e)!==-1:this.__currentListenerStack===e:!1}do(...e){if(this.__dll&&!this._dll.empty){let t=this._dll.head;for(;t;){const n=t.item;n._hasRemoved||(this._pushCurrentListener(n),n.func.call(n.scope,...e),this._popCurrentListener());const i=t.next;n._once&&!n._hasRemoved&&(this.remove(t),t=void 0),t&&this._clearHasRemoved(t),t=i}}}get empty(){if(!this.__dll||this._dll.empty)return!0;let e=!0,t=this._dll.head;for(;t;){if(!t.item._hasRemoved){e=!1;break}t=t.next}return e}isHandlerValid(e){return!e.item._hasRemoved}nextHandler(e){if(!e.item._hasRemoved)throw new Error("handler has removed!");let t=e.next;for(;t&&t.item._hasRemoved;)t=t.next;return t}prevHandler(e){if(!e.item._hasRemoved)throw new Error("handler has removed!");let t=e.previous;for(;t&&t.item._hasRemoved;)t=t.previous;return t}moveAfter(e,t){if(e.item._hasRemoved||t.item._hasRemoved)throw new Error("handler or nextHandler has removed!");return this._dll.moveAfter(e,t)}moveBefore(e,t){if(e.item._hasRemoved||t.item._hasRemoved)throw new Error("handler or prevHandler has removed!");return this._dll.moveBefore(e,t)}insertBefore(e,t,n,i=!1){if(e.item._hasRemoved)throw new Error("handler has removed!");const s=Zs.create();return s.func=t,s.scope=n,s._once=i,this._dll.insertBefore(e,s)}insertAfter(e,t,n,i=!1){if(e.item._hasRemoved)throw new Error("handler has removed!");const s=Zs.create();return s.func=t,s.scope=n,s._once=i,this._dll.insertAfter(e,s)}_clearHasRemoved(e){e.item._hasRemoved&&!this._hasCurrentListener(e.item)&&(Zs.destroy(e.item),this._dll.remove(e))}remove(e){if(!e.item||e.item._hasRemoved)throw new Error("handler has removed!");this._hasCurrentListener(e.item)?e.item._hasRemoved=!0:(Zs.destroy(e.item),this._dll.remove(e))}removeAll(){if(this.__dll&&!this._dll.empty){let e=this._dll.head;for(;e;){const t=e.next;e.item._hasRemoved||this.remove(e),e=t}}}destroy(){if(!this.__dll)return;let e=this._dll.head;for(;e;){const t=e.next,n=e;this._hasCurrentListener(n.item)||(console.warn("Event has remove item that on current stack!"),console.warn(`${n.item.func.toString()}`)),Zs.destroy(n.item),this._dll.remove(n),e=t}this.__dll=void 0,this.__currentListenerStack=void 0}push(e,t,n=!1){const i=Zs.create();return i.func=e,i.scope=t,i._once=n,this._dll.push(i)}pop(){const e=this.tail;if(!e)throw new Error("pop error!");this.remove(e)}shift(){const e=this.head;if(!e)throw new Error("shift error!");this.remove(e)}unshift(e,t,n=!1){const i=Zs.create();return i.func=e,i.scope=t,i._once=n,this._dll.unshift(i)}get tail(){let e=this._dll.tail;for(;e&&e.item._hasRemoved;)e=e.previous;return e}get head(){let e=this._dll.head;for(;e&&e.item._hasRemoved;)e=e.previous;return e}}class Eu{constructor(){d(this,"_listenerHandler");d(this,"_cid")}_reset(e,t){this._listenerHandler=e,this._cid=t}clone(e){return e=e??new Eu,e._reset(this._listenerHandler,this._cid),e}get valid(){if(typeof this._listenerHandler<"u"&&typeof this._cid=="number"){const e=this._listenerHandler._cid;if(typeof e<"u"&&this._cid===e)return!0}return!1}}class oh extends Eu{}let O=class extends V{constructor(){super(...arguments);d(this,"__pipe");d(this,"beforeCallback");d(this,"afterCallback")}get _pipe(){return this.__pipe=this.__pipe??new sh,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}emit(...t){!this.isDestroyed()&&this.beforeCallback&&this.beforeCallback(...t),!this.isDestroyed()&&this._pipe.do(...t),!this.isDestroyed()&&this.afterCallback&&this.afterCallback(...t)}on(t,n,i=!1,s){const o=i?this._pipe.unshift(t,n,!1):this._pipe.push(t,n,!1);return s=s??new oh,s._reset(o,o._cid),s}disposableOn(t,n,i=!1,s){const o=this.on(t,n,i,s);return()=>{o.valid&&this.off(o)}}don(t,n,i=!1,s){return this.disposableOn(t,n,i,s)}disposableWeakOn(t,n,i=!1,s){const o=new V,a=()=>{!o.isDestroyed()&&o.destroy()};return o.dispose(this.disposableOn(t,n,i,s)),o.dispose(this.toDestroyEvent.disposableOn(a)),a}dwon(t,n,i=!1,s){return this.disposableWeakOn(t,n,i,s)}once(t,n,i=!1,s){const o=i?this._pipe.unshift(t,n,!0):this._pipe.push(t,n,!0);return s=s??new oh,s._reset(o,o._cid),s}disposableOnce(t,n,i=!1,s){const o=this.once(t,n,i,s);return()=>o.valid&&this.off(o)}donce(t,n,i=!1,s){const o=this.once(t,n,i,s);return()=>o.valid&&this.off(o)}off(t){if(!t.valid)throw new Error("handler is not valid!");this._pipe.remove(t._listenerHandler),t._reset()}reset(){this._pipe.removeAll()}destroyImp(){this.empty||(Xo("The event is destroying with listeners!"),this._pipe.removeAll())}};wp(O);function Yo(r,e){return e=e??new Eu,e._reset(r,r._cid),e}class o_{constructor(){d(this,"__pipe")}get _pipe(){return this.__pipe=this.__pipe??new sh,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}do(...e){return this._pipe.do(...e)}isHandlerValid(e){return e.valid?this._pipe.isHandlerValid(e._listenerHandler):!1}moveAfter(e,t){if(!e.valid||!t.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(e._listenerHandler,t._listenerHandler)}moveBefore(e,t){if(!e.valid||!t.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(e._listenerHandler,t._listenerHandler)}insertBefore(e,t,n,i=!1,s){if(!e.valid)throw new Error("handler is not valid!");const o=this._pipe.insertBefore(e._listenerHandler,t,n,i);return Yo(o,s)}insertAfter(e,t,n,i=!1,s){if(!e.valid)throw new Error("handler is not valid!");const o=this._pipe.insertAfter(e._listenerHandler,t,n,i);return Yo(o,s)}remove(e){if(!e.valid)throw new Error("handler is not valid!");return this._pipe.remove(e._listenerHandler)}removeAll(){return this._pipe.removeAll()}push(e,t,n=!1,i){const s=this._pipe.push(e,t,n);return Yo(s,i)}pop(){return this._pipe.pop()}shift(){return this._pipe.shift()}unshift(e,t,n=!1,i){const s=this._pipe.unshift(e,t,n);return Yo(s,i)}getTail(e){const t=this._pipe.tail;if(t)return Yo(t,e)}getHead(e){const t=this._pipe.head;if(t)return Yo(t,e)}}class ze extends V{constructor(t,n,i){super();d(this,"_changed");d(this,"_value");d(this,"_oldValue");d(this,"toChangeFunc");this._equalsFunc=n,this._assignFunc=i,this._value=this._assignFunc&&this._assignFunc(t,void 0)||t}get assignFunc(){return this._assignFunc}get equalsFunc(){return this._equalsFunc}equals(t){return this._equalsFunc?this._equalsFunc(this._value,t):this._value===t}set value(t){if(this._equalsFunc?!this._equalsFunc(this._value,t):this._value!==t){if(this.toChangeFunc&&!this.toChangeFunc(t,this._value))return;this._assignFunc?(this._oldValue=this._assignFunc(this._value,this._oldValue),this._value=this._assignFunc(t,this._value)):(this._oldValue=this._value,this._value=t),this._changed&&this._changed.emit(t,this._oldValue)}}get value(){return this._value}get changed(){return this._changed||(this._changed=this.disposeVar(new O)),this._changed}forceChange(){this._changed&&this._changed.emit(this._value,this._value)}}function j(r,e,t){return new ze(r,e,t)}function dt(r){return new ze(r,(e,t)=>e.length!==t.length?!1:e.every((n,i)=>n===t[i]),(e,t)=>{const n=t||new Array(e.length);return n.length=e.length,e.forEach((i,s)=>n[s]=i),n})}function re(r){return j(r,(e,t)=>e===void 0||t===void 0?e===void 0&&t===void 0:e.length!==t.length?!1:e.every((n,i)=>n===t[i]),(e,t)=>{if(!e)return;const n=t||new Array(e.length);return n.length=e.length,e.forEach((i,s)=>n[s]=i),n})}function Ol(r,e,t){return j(r,(n,i)=>n.length!==i.length?!1:n.every((s,o)=>e&&e(s,i[o])||s===i[o]),(n,i)=>{const s=i||new Array(n.length);return s.length=n.length,n.forEach((o,a)=>{s[a]=t?t(o):o}),s})}function vs(r,e,t){return j(r,(n,i)=>n===void 0||i===void 0?n===void 0&&i===void 0:n.length!==i.length?!1:n.every((s,o)=>e&&e(s,i[o])||s===i[o]),(n,i)=>{if(!n)return;const s=i||new Array(n.length);return s.length=n.length,n.forEach((o,a)=>{s[a]=t?t(o):o}),s})}function wt(r){return new ze(r,(e,t)=>e===t||e!==void 0&&t!==void 0&&JSON.stringify(e)===JSON.stringify(t),(e,t)=>{if(e!==void 0)return JSON.parse(JSON.stringify(e))})}function Qt(r){return new ze(r,(e,t)=>e===t||e!==void 0&&t!==void 0&&JSON.stringify(e)===JSON.stringify(t),(e,t)=>{if(e!==void 0)return JSON.parse(JSON.stringify(e))})}function a_(r){return new ze(r,(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;const n=Object.keys(e),i=Object.keys(t);return n.length!==i.length?!1:n.every((s,o)=>s===i[o]&&e[s]===t[s])},(e,t)=>e&&{...e})}function u_(r){return new ze(r,(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;const n=Object.keys(e),i=Object.keys(t);return n.length!==i.length?!1:n.every((s,o)=>s===i[o]&&e[s]===t[s])},(e,t)=>e&&{...e})}function l_(r){return Ol(r,(e,t)=>e.every((n,i)=>n===t[i]),e=>[...e])}function ah(r){return vs(r,(e,t)=>e.every((n,i)=>n===t[i]),e=>[...e])}function c_(r){return Ol(r,(e,t)=>JSON.stringify(e)===JSON.stringify(t),e=>JSON.parse(JSON.stringify(e)))}function h_(r){return vs(r,(e,t)=>JSON.stringify(e)===JSON.stringify(t),e=>JSON.parse(JSON.stringify(e)))}function Nl(r){return ah(r)}function bp(r){return vs(r,(e,t)=>e.length===t.length&&e.every((n,i)=>n.every((s,o)=>s===t[i][o])),e=>e.map(t=>[...t]))}function d_(r){return vs(r,(e,t)=>e.length===t.length&&e.every((n,i)=>n.every((s,o)=>s===t[i][o])),e=>e.map(t=>[...t]))}function Dl(r){const e=r instanceof ze?[r,"value","changed"]:[...r];return e[2]=e[2]||e[1]+"Changed",e}function uh(r,e,t,n=!1){e[2]=e[2]||e[1]+"Changed";const i=()=>{const s=e[0][e[1]];t?r[0][r[1]]=t(s):r[0][r[1]]=s};return i(),n?e[0][e[2]].disposableWeakOn(i):e[0][e[2]].disposableOn(i)}function f_(r,e,t,n,i=!1){const s=uh(r,e,t,i),o=uh(e,r,n,i);return()=>(s(),o())}function B(r,e,t,n=!1){const i=r instanceof ze?[r,"value","changed"]:r,s=e instanceof ze?[e,"value","changed"]:e;return uh(i,s,t,n)}function nt(r,e,t,n,i=!1){const s=Dl(r),o=Dl(e);return f_(s,o,t,n,i)}function p_(r,e,t,n=!1){const[i]=zi(e);return nt(r,e,s=>s??t,s=>{if(!(s===t&&i()===void 0))return s},n)}function Jo(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var e=Math.random()*16|0,t=r==="x"?e:e&3|8;return t.toString(16)})}function Ml(r,e){if(!globalThis||!globalThis.setTimeout||!globalThis.clearTimeout)throw new Error("目前只适合在浏览器中使用!");let t=0;function n(){t>0&&(globalThis.clearTimeout(t),t=0)}function i(...s){n(),t=globalThis.setTimeout(r,e,...s)}return[i,n]}function lh(r,e,...t){const n=setInterval(r,e,...t);return()=>clearInterval(n)}function ch(r,e,...t){const n=setTimeout(r,e,...t);return()=>clearTimeout(n)}function Rl(r,...e){let t;const n=()=>{const i=performance.now();r(i,...e),t=requestAnimationFrame(n)};return n(),()=>typeof t<"u"&&(cancelAnimationFrame(t),t=void 0)}function $o(r,...e){let t;return t=requestAnimationFrame(()=>{const i=performance.now();r(i,...e)}),()=>typeof t<"u"&&(cancelAnimationFrame(t),t=void 0)}function Cu(r,...e){let t=!1,n;return new Promise((i,s)=>{n=s,i()}).then(()=>{!t&&r(...e)}).catch(i=>{console.error(i)}),()=>(t=!0)&&n&&(n("nextMicroTask cancelled!"),n=void 0)}class Ll extends O{constructor(t,n,...i){super();d(this,"_cancellFunc");this._nextFunc=t,this.dispose(()=>{this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0)}),i.forEach(s=>this.dispose(s[n?"dwon":"don"](()=>{this.next()})))}next(){this._cancellFunc||(this._cancellFunc=this._nextFunc(()=>(this._cancellFunc=void 0,this.emit())))}flush(){this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0,this.emit())}}class hh extends Ll{constructor(...e){super(Cu,!1,...e)}}function g_(...r){return new hh(...r)}class m_ extends Ll{constructor(...e){super(Cu,!0,...e)}}function v_(...r){return new hh(...r)}class Fl extends Ll{constructor(...e){super($o,!1,...e)}}function Ie(...r){return new Fl(...r)}function y_(r,e){return new Fl(...r).don(e())}class Pp extends Ll{constructor(...e){super($o,!0,...e)}}function __(...r){return new Pp(...r)}function Ui(r,e,t={time:"don",immediate:!1}){const n=new Fl(...Array.isArray(r)?r:[r]),i=n[t.time??"don"](e);return(t.immediate??!1)&&e(),()=>{i(),n.destroy()}}function Su(r){let e;if(typeof r.next=="function")e=r;else if(typeof r[Symbol.iterator]=="function")e=r[Symbol.iterator]();else throw new Error("iteratorOrIterable error!");return e}function dh(r,e){let t=!1;const n=Su(r);let i=-1;for(;;){const{done:s,value:o}=n.next();if(s)break;if(e(o,++i)){t=!0;break}}return t}function fh(r,e){return!dh(r,(n,i)=>!e(n,i))}function bu(r,e,t,n){const i=r;if(!i[e]){const s=n(),o=Object.fromEntries(Object.entries(s).filter(([a,u])=>{const l=Object.getPrototypeOf(t),c=a in l;if(c){const h=u instanceof ze?u.value:u;r[a]=h}return!c}).map(([a,u])=>u instanceof ze?[a,u]:[a,Array.isArray(u)?re(u):j(u)]));i[e]=o}return i[e]}function Gi(r,e){var n;const t=Symbol(`${(n=r==null?void 0:r.constructor)==null?void 0:n.name}-createDefaultProps`);r.constructor.__xbsj_dpSymbol=t,r.constructor.__xbsj_createDefaultProps=e;for(let[i,s]of Object.entries(e()))if(!Reflect.has(r,i)){const o=function(a){var c,h;if(a[t])return;const u=[];let l=Object.getPrototypeOf(a);for(;l;)u.push(l),l=Object.getPrototypeOf(l);u.reverse();for(let f of u){const p=(c=f.constructor)==null?void 0:c.__xbsj_dpSymbol;if(!p)continue;const v=(h=f.constructor)==null?void 0:h.__xbsj_createDefaultProps;v&&bu(a,p,f,v)}};Object.defineProperties(r,{[i]:{get(){return o(this),bu(this,t,r,e)[i].value},set(a){o(this);const u=bu(this,t,r,e)[i];if(!u){console.error("!propObj");debugger}u.value=a}},[`${i}Changed`]:{get(){return o(this),bu(this,t,r,e)[i].changed}},[`${i}React`]:{get(){return o(this),bu(this,t,r,e)[i]}}})}}const Pu=new WeakMap;function fi(r,e,t){Pu.has(r)||Pu.set(r,{});const n=Pu.get(r);n[e]=t}function Xn(r,e){return Pu.has(r)?Pu.get(r)[e]:void 0}function pi(r,e){const t=Su(r);let n=0;for(;;){const{done:i,value:s}=t.next();if(i)break;e(s,n++)}}function Iu(r,e,t){const n=Su(r);let i=t,s=0;for(;;){const{done:o,value:a}=n.next();if(o)break;i=e(i,a,s++)}return i}const w_=r=>++r;function ph(r){return Iu(r,w_,0)}function Wi(r){return Iu(r,(e,t)=>e>t?e:t,Number.NEGATIVE_INFINITY)}function ys(r){return Iu(r,(e,t)=>e<t?e:t,Number.POSITIVE_INFINITY)}function Ip(r,e){let t=r;for(let n of e)t=t[n];return t}function E_(r,e,t){if(e.length===0)throw new Error("props的数量必须大于0");const n=e.length-1,i=e[n];let s=r;for(let o=0;o<n;++o){const a=e[o];typeof s[a]>"u"&&(s[a]={}),s=s[a]}s[i]=t}function*Qs(r,e){const t=Su(r);for(;;){const{done:n,value:i}=t.next();if(n)break;yield Ip(i,e)}}class xu extends V{constructor(){super();d(this,"_innerObj");d(this,"_toChangeEvent");d(this,"_changedEvent");this._innerObj=[],this.dispose(()=>{if(this.length=0,this._innerObj.length>0)throw new Error("this._innerObj.length > 0");this._toChangeEvent&&this._toChangeEvent.reset(),this._innerObj=void 0})}get toChangeEvent(){return this._toChangeEvent||(this._toChangeEvent=new O),this._toChangeEvent}get changedEvent(){return this._changedEvent||(this._changedEvent=new O),this._changedEvent}_resetArray(t){this._toChangeEvent&&this._toChangeEvent.emit([{start:0,deleteCount:this._innerObj.length,items:t}],this);const{length:n}=t;this._innerObj.length=n;for(let i=0;i<n;++i)this._innerObj[i]=t[i];this._changedEvent&&this._changedEvent.emit(this)}splice(t,n,...i){const{length:s}=this._innerObj;t=t>this._innerObj.length?this._innerObj.length:t,t>s?t=s:t<0&&(t+=s,t<0&&(t=0));const o=this._innerObj.length-t;if(n>o?n=o:n<0&&(n=0),arguments.length===1){this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:this._innerObj.length-t,items:[]}],this);const a=this._innerObj.splice(t);return this._changedEvent&&this._changedEvent.emit(this),a}else if(arguments.length===2){this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:n,items:[]}],this);const a=this._innerObj.splice(t,n);return this._changedEvent&&this._changedEvent.emit(this),a}else{this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:n,items:i}],this);const a=this._innerObj.splice(t,n,...i);return this._changedEvent&&this._changedEvent.emit(this),a}}pop(){if(this._innerObj.length===0)return;if(this._toChangeEvent){const n=this._innerObj.length-1,i=1,s=[];this._toChangeEvent.emit([{start:n,deleteCount:i,items:s}],this)}const t=this._innerObj.pop();return this._changedEvent&&this._changedEvent.emit(this),t}push(...t){if(this._toChangeEvent){const i=this._innerObj.length;this._toChangeEvent.emit([{start:i,deleteCount:0,items:t}],this)}const n=this._innerObj.push(...t);return this._changedEvent&&this._changedEvent.emit(this),n}get length(){return this._innerObj.length}set length(t){if(t<0)throw new Error("value < 0");const{length:n}=this._innerObj;if(n!==t){if(this._toChangeEvent){let i,s,o;n>t?(i=t,s=n-t,o=[]):(i=n,s=0,o=new Array(t-n)),this._toChangeEvent.emit([{start:i,deleteCount:s,items:o}],this)}this._innerObj.length=t,this._changedEvent&&this._changedEvent.emit(this)}}get(t){return this._innerObj[t]}set(t,n){const{length:i}=this._innerObj;if(t<0||t>=i)throw new Error("index < 0 || index >= length");this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:1,items:[n]}],this),this._innerObj[t]=n,this._changedEvent&&this._changedEvent.emit(this)}indexOf(t){return this._innerObj.indexOf(t)}[Symbol.iterator](){return this._innerObj[Symbol.iterator]()}}function gh(r,e,...t){let n=r;for(let i of t){if(!n[i])if(e)n[i]={};else return;n=n[i]}return n}function C_(r,e,t){typeof t>"u"&&(e.endsWith(".gltf")?t="model/gltf+json":e.endsWith(".bin")?t="application/octet-stream":e.endsWith(".glb")?t="model/gltf-binary":e.endsWith(".jpg")||e.endsWith(".jpeg")?t="image/jpeg":e.endsWith(".png")?t="image/png":e.endsWith(".glsl")?t="text/plain":e.endsWith(".json")?t="application/json":e.endsWith(".b3dm")||e.endsWith(".i3dm")||e.endsWith("pnts")||e.endsWith("cmpt")?t="application/octet-stream":console.warn(`save ${e}: MimeType无法确定!`));const n=new Blob([r],{type:t||""});let i=URL.createObjectURL(n);var s=document.createElement("a"),o=new MouseEvent("click");s.download=e,s.href=i,s.dispatchEvent(o),URL.revokeObjectURL(i)}function S_(r,e){const t=document.createElement("a"),n=new MouseEvent("click");t.download=e||"下载",t.href=r,t.dispatchEvent(n)}function b_(){return new Promise((r,e)=>{const t=performance.now();requestAnimationFrame(n=>r(n>t))})}const Al=r=>{let e,t;return t=n=>{n=performance.now(),e=requestAnimationFrame(t),r(n)},e=requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}};function mh(r,e,t=Al){let n=Number.NEGATIVE_INFINITY,i;function s(u){u-n>e&&i&&(r(...i),i=void 0,n=u)}const o=t&&t(s)||void 0;function a(...u){i=u}return[a,o]}const xp=[];function Tp(r,e,t){if(xp.includes(r)){console.warn(`_loadJs ${r} has loaded before!`),e&&e();return}var n=document.getElementsByTagName("head")[0],i=document.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",r),i.onload=i.onreadystatechange=function(){this.readyState&&this.readyState!=="complete"||(xp.push(r),e&&e(),i.onload=i.onreadystatechange=null)},i.onerror=(s,o,a,u,l)=>{t(l)},n.appendChild(i)}function vh(r,e=!0){if(e){const t=globalThis.L;globalThis.L&&(globalThis.L=void 0);const n=globalThis.define;return globalThis.define&&(globalThis.define=void 0),new Promise((i,s)=>{Tp(r,i,s)}).then(()=>(globalThis.define=n,globalThis.L=t,Promise.resolve()))}else return new Promise((t,n)=>{Tp(r,t,n)})}async function Op(r,e=""){return new Promise((t,n)=>{var i=new Image;i.crossOrigin=e,i.src=r,i.onload=()=>t(i),i.onerror=s=>n(s)})}class P_ extends V{constructor(e){super(),this._owner=e}get owner(){return this._owner}}function I_(r,e){if(r.length%3!==0)throw new Error("positions.length % 3 !== 0");const t=r.length/3;function*n(o){for(let a=0;a<t;++a)yield r[a*3+o]}const i=(e==null?void 0:e.min)??[NaN,NaN,NaN],s=(e==null?void 0:e.max)??[NaN,NaN,NaN];return i[0]=ys(n(0))??NaN,i[1]=ys(n(1))??NaN,i[2]=ys(n(2))??NaN,s[0]=Wi(n(0))??NaN,s[1]=Wi(n(1))??NaN,s[2]=Wi(n(2))??NaN,{min:i,max:s}}async function x_(r,e=fetch){const t=await e(r);return t.ok?await t.arrayBuffer():void 0}function kl(r,...e){if(r>16)throw new Error("length > 16");const t=new Array(r);for(let n=0;n<r;++n)t[n]=e[n]??0;return t}class Vl{constructor(e,t){this._xyzw=e,this._length=t}set 0(e){this._xyzw.x=e}set 1(e){this._xyzw.y=e}set 2(e){this._xyzw.z=e}set 3(e){this._xyzw.w=e}get 0(){return this._xyzw.x??0}get 1(){return this._xyzw.y??0}get 2(){return this._xyzw.z??0}get 3(){return this._xyzw.w??0}get length(){return this._length}}function T_(r){return new Vl(r,2)}function O_(r){return new Vl(r,3)}function N_(r){return new Vl(r,4)}class D_{constructor(e,t,n,i){this._array=e,this._length=t,this._start=n,this._stride=i}get length(){return this._length}set 0(e){this._array[this._start+0*this._stride]=e}set 1(e){this._array[this._start+1*this._stride]=e}set 2(e){this._array[this._start+2*this._stride]=e}set 3(e){this._array[this._start+3*this._stride]=e}set 4(e){this._array[this._start+4*this._stride]=e}set 5(e){this._array[this._start+5*this._stride]=e}set 6(e){this._array[this._start+6*this._stride]=e}set 7(e){this._array[this._start+7*this._stride]=e}set 8(e){this._array[this._start+8*this._stride]=e}set 9(e){this._array[this._start+9*this._stride]=e}set 10(e){this._array[this._start+10*this._stride]=e}set 11(e){this._array[this._start+11*this._stride]=e}set 12(e){this._array[this._start+12*this._stride]=e}set 13(e){this._array[this._start+13*this._stride]=e}set 14(e){this._array[this._start+14*this._stride]=e}set 15(e){this._array[this._start+15*this._stride]=e}set 16(e){this._array[this._start+16*this._stride]=e}get 0(){return this._array[this._start+0*this._stride]}get 1(){return this._array[this._start+1*this._stride]}get 2(){return this._array[this._start+2*this._stride]}get 3(){return this._array[this._start+3*this._stride]}get 4(){return this._array[this._start+4*this._stride]}get 5(){return this._array[this._start+5*this._stride]}get 6(){return this._array[this._start+6*this._stride]}get 7(){return this._array[this._start+7*this._stride]}get 8(){return this._array[this._start+8*this._stride]}get 9(){return this._array[this._start+9*this._stride]}get 10(){return this._array[this._start+10*this._stride]}get 11(){return this._array[this._start+11*this._stride]}get 12(){return this._array[this._start+12*this._stride]}get 13(){return this._array[this._start+13*this._stride]}get 14(){return this._array[this._start+14*this._stride]}get 15(){return this._array[this._start+15*this._stride]}get 16(){return this._array[this._start+16*this._stride]}}function M_(r,e,t=0,n=1){return new D_(r,e,t,n)}g.Vector=void 0,(r=>{function e(z,...G){if(z=z||kl(G.length),G.length>z.length)throw new Error("args.length > target.length");return z instanceof Float64Array?z.set(G):x(G,z),z}r.set=e;function t(z,G){const ft=z.length;for(let Vt=0;Vt<ft;++Vt)if(!G(z[Vt],Vt))return!1;return!0}r.every=t;function n(z,G,ft){const Vt=z.length;let ne=ft;for(let we=0;we<Vt;++we)ne=G(ne,z[we],we);return ne}r.reduce=n;function*i(z){for(let G=0;G<z.length;++G)yield z[G]}r.itr=i;const s=(z,G)=>z+=G*G;function o(z){return n(z,s,0)}r.magnitudeSquared=o;function a(z){const G=o(z);return Math.sqrt(G)}r.magnitude=a;function u(z,G=1e-5){const ft=o(z);return Math.abs(ft-1)<G}r.isNormalized=u;let l;const c=(z,G,ft)=>z+G*l[ft];function h(z,G){return b(z,G),l=G,n(z,c,0)}r.dot=h;let f;const p=(z,G,ft)=>z+=(G-f[ft])*(G-f[ft]);function v(z,G){return b(z,G),f=G,n(z,p,0)}r.distanceSquared=v;function C(z,G){return Math.sqrt(v(z,G))}r.distance=C;let S;const P=(z,G)=>z===S[G];function y(z,G){return b(z,G),S=G,t(z,P)}r.equals=y;let _,m;const w=(z,G)=>Math.abs(z-_[G])<m;function E(z,G,ft=0){return b(z,G),_=G,m=ft,t(z,w)}r.equalsEpsilon=E;function b(z,G){if(z.length!==G.length)throw new Error("left.length !== right.length")}function I(z,G,ft){const Vt=z.length;ft=ft||kl(Vt),b(z,ft);for(let ne=0;ne<Vt;++ne)ft[ne]=G(z[ne],ne);return ft}r.op1=I;function T(z,G,ft,Vt){b(z,G),Vt&&b(z,Vt);const ne=z.length;Vt=Vt||kl(ne);for(let we=0;we<ne;++we)Vt[we]=ft(z[we],G[we]);return Vt}r.op2=T;const D=z=>z;function x(z,G){return I(z,D,G)}r.clone=x;let N=0;const L=(z,G)=>z*N;function A(z,G,ft){return N=G,I(z,L,ft)}r.multiplyByScalar=A;function J(z,G,ft=0){const Vt=o(z);if(Vt<=ft)return;const ne=Math.sqrt(Vt);return A(z,1/ne,G)}r.normalize=J;function H(z,G){return A(z,-1,G)}r.negate=H;const Z=z=>Math.abs(z);function ct(z,G){return I(z,Z,G)}r.abs=ct;const mt=z=>z-Math.floor(z);function Y(z,G){return I(z,mt,G)}r.fract=Y;const $=(z,G)=>z-G;function K(z,G,ft){return T(z,G,$,ft)}r.subtract=K;const Et=(z,G)=>z+G;function kt(z,G,ft){return T(z,G,Et,ft)}r.add=kt;const Nt=(z,G)=>z*G;function Dt(z,G,ft){return T(z,G,Nt,ft)}r.multiply=Dt;const zt=(z,G)=>z/G;function ye(z,G,ft){return T(z,G,zt,ft)}r.divide=ye;let Zt;const Sn=(z,G)=>z*(1-Zt)+G*Zt;function bn(z,G,ft,Vt){return Zt=ft,T(z,G,Sn,Vt)}r.lerp=bn})(g.Vector||(g.Vector={}));function jl(r,e=0,t=1){return r<e?e:r>t?t:r}class Bl extends V{constructor(t,n,i,s,o,a,u,l){super();d(this,"__status");d(this,"_statusChangedEvent");d(this,"_forceCancelFunc");d(this,"_startEvent");d(this,"_progressEvent");d(this,"_completeEvent");d(this,"_cancelEvent");d(this,"_cancelledEvent");d(this,"_errorEvent");d(this,"_finishedEvent");d(this,"_processingID",-1);this._startProcessingFunc=t,this.startFunc=n,this.progressFunc=i,this.completeFunc=s,this.cancelFunc=o,this.cancelledFunc=a,this.errorFunc=u,this.finishedFunc=l,this._status="Initial",this.dispose(()=>{var c;return(c=this._statusChangedEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._startEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._progressEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._completeEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._cancelEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._cancelledEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._errorEvent)==null?void 0:c.destroy()}),this.dispose(()=>{var c;return(c=this._finishedEvent)==null?void 0:c.destroy()}),this.dispose(()=>this.reset())}get startEvent(){return this._startEvent=this._startEvent||new O,this._startEvent}get progressEvent(){return this._progressEvent=this._progressEvent||new O,this._progressEvent}get completeEvent(){return this._completeEvent=this._completeEvent||new O,this._completeEvent}get cancelEvent(){return this._cancelEvent=this._cancelEvent||new O,this._cancelEvent}get cancelledEvent(){return this._cancelledEvent=this._cancelledEvent||new O,this._cancelledEvent}get errorEvent(){return this._errorEvent=this._errorEvent||new O,this._errorEvent}get finishedEvent(){return this._finishedEvent=this._finishedEvent||new O,this._finishedEvent}_completeFunc(t,n){this.processingID===t&&this._status==="Running"&&(this._status="Completed",this.completeFunc&&this.completeFunc(n),this._completeEvent&&this._completeEvent.emit(n),this.finishedFunc&&this.finishedFunc({status:"Completed",value:n}),this._finishedEvent&&this._finishedEvent.emit({status:"Completed",value:n}))}_cancelFunc(t){this._status==="Running"&&(this._status="Cancelling",this.cancelFunc&&this.cancelFunc(t),this._cancelEvent&&this._cancelEvent.emit(t))}_cancelledFunc(t){this._status==="Cancelling"&&(this._status="Cancelled",this.cancelledFunc&&this.cancelledFunc(t),this._cancelledEvent&&this._cancelledEvent.emit(t),this.finishedFunc&&this.finishedFunc({status:"Cancelled",cancelError:t}),this._finishedEvent&&this._finishedEvent.emit({status:"Cancelled",cancelError:t}))}_errorFunc(t,n){this.processingID===t&&this._status==="Running"&&(this._status="Error",this.errorFunc&&this.errorFunc(n),this._errorEvent&&this._errorEvent.emit(n),this.finishedFunc&&this.finishedFunc({status:"Error",error:n}),this._finishedEvent&&this._finishedEvent.emit({status:"Error",error:n}))}_progressFunc(t,n){this.processingID===t&&this._status==="Running"&&(this.progressFunc&&this.progressFunc(n),this._progressEvent&&this._progressEvent.emit(n))}_startFunc(...t){if(this._status==="Initial"){this._status="Running";const n=++this._processingID,i={completeFunc:this._completeFunc.bind(this,n),errorFunc:this._errorFunc.bind(this,n),progressFunc:this._progressFunc.bind(this,n),cancelFunc:this._cancel.bind(this,n),processingID:n},s=this._startProcessingFunc(i,...t);return this._forceCancelFunc=s,this.startFunc&&this.startFunc(...t),this._startEvent&&this._startEvent.emit(...t),n}else return console.warn("this._status !== 'Initial' but start again!"),-1}set _status(t){if(this.__status!==t){const n=this.__status;this.__status=t,this._statusChangedEvent&&this._statusChangedEvent.emit(t,n)}}get _status(){return this.__status}get processingID(){return this._processingID}get statusChangedEvent(){return this._statusChangedEvent||(this._statusChangedEvent=new O),this._statusChangedEvent}reset(t){this._status==="Running"&&this.cancel(t),this._status==="Cancelled"||this._status==="Error"||this._status==="Completed"?this._status="Initial":this._status==="Cancelling"&&console.warn("Cannot reset! (this._status === 'Cancelling')")}get status(){return this._status}cancel(t,n=this.processingID){return this._cancel(n,t)}_cancel(t,n){if(this.processingID===t)if(this._status==="Running"){if(!this._forceCancelFunc)throw new Error("this._forceCancelFunc is undefined!");this._cancelFunc(n);const i=this._forceCancelFunc(n);if(this._forceCancelFunc=void 0,i&&i instanceof Promise)return i.then(()=>{this._cancelledFunc(n)});this._cancelledFunc(n)}else console.warn("this._status !== 'Running' but cancel")}start(...t){try{return this._startFunc(...t)}catch(n){console.error(`processing start error: ${n}`)}}restart(t,...n){try{return this.isRunning&&this.cancel(t),this.isFinished&&this.reset(t),this.isInitial?this._startFunc(...n):(console.warn("restart failed!"),-1)}catch(i){console.error(`processing restart error: ${i}`)}}get isCompleted(){return this._status==="Completed"}get isCancelled(){return this._status==="Cancelled"}get isCancelling(){return this._status==="Cancelling"}get isError(){return this._status==="Error"}get isInitial(){return this._status==="Initial"}get isRunning(){return this._status==="Running"}get isFinished(){return this.isCancelled||this.isCompleted||this.isError}}let yh=class extends Error{};function Np(r,e){typeof r=="function"?r(e):r.cancelFunc=e}class _h extends Bl{constructor(t=300){super(({progressFunc:n,completeFunc:i,errorFunc:s})=>{const[o,a]=Ml(()=>{if(!this._lastDebounceValue)throw new Error("!this._lastDebounceValue");n([this._lastDebounceValue,this._debouncTimes]),this._debouncTimes=0},this._delayTime);return this._d=o,()=>{a()}});d(this,"_lastDebounceValue");d(this,"_debouncTimes",0);d(this,"_d");this._delayTime=t}get delayTime(){return this._delayTime}debounce(...t){this.isRunning?(++this._debouncTimes,this._lastDebounceValue=t,this._d&&this._d()):console.warn("Debouncing is not running!")}}function Dp(r,e,...t){const n=new AbortController;let i=n.signal,[s,o]=t;if(o!=null&&o.signal)throw console.error("init?.signal"),new Error("init?.signal");o=o||{},o.signal=i;let a=!1;Np(r,()=>{a=!0,n.abort()});let u=fetch(s,o);return e&&(u=u.then(l=>{if(!l.ok)return l;if(!l.body)throw Error("ReadableStream not yet supported in this browser.");const c=l.headers.get("content-length"),h=c?parseInt(c,10):0;let f=0;return new Response(new ReadableStream({start(p){if(!l.body)throw new Error("!response.body");const v=l.body.getReader();C();function C(){v.read().then(({done:S,value:P})=>{if(S){p.close();return}if(!P)throw new Error("!value");if(!e)throw new Error("!progressFunc");f+=P.byteLength,e(f,h),p.enqueue(P),C()}).catch(S=>{p.error(S)})}}}),{status:l.status,statusText:l.statusText,headers:l.headers})}).catch(l=>{throw a?(l instanceof Error&&l.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new yh("fetching cancelled!")):(l instanceof Error&&l.code===20&&console.error("error.code === 20"),l)})),u}function Mp(...r){if(r.length>=1)if(typeof r[0]=="function"||typeof r[0]>"u"){const e={};let t=Dp(e,...r);const{cancelFunc:n}=e;if(!n)throw new Error("!cancelResult.cancelFunc");return[n,t]}else return Dp(...r);throw new Error("cancelableFetch args error!")}class R_ extends Bl{constructor(t,...n){super(({progressFunc:i,completeFunc:s,errorFunc:o},...a)=>{const u={};let l={loaded:0,total:0};const c=(p,v)=>{l.loaded=p,l.total=v,i(l)},h=this._fetchArgs||a;if(h.length===0)throw new Error("fetchArgs.length === 0");if(Mp(u,c,...h).then(t).then(s).catch(p=>{p instanceof yh||o(p)}),!u.cancelFunc)throw new Error("!cancelResult.cancelFunc");return u.cancelFunc});d(this,"_fetchArgs");n.length>0&&(this._fetchArgs=n)}get fetchArgs(){return this._fetchArgs}}function wh(r,e,t,n){const i="_"+e,s="_"+e+"Changed",o=e+"Changed";Object.defineProperties(r.prototype,{[e]:{get(){return typeof this[i]>"u"&&typeof t<"u"&&(this[i]=t),this[i]},set(a){if(typeof this[i]>"u"&&typeof t<"u"&&(this[i]=t),n?!n(this[i],a):this[i]!==a){const u=this[i];this[i]=a,this[s]&&this[s].emit(a,u)}}},[o]:{get(){return typeof this[s]>"u"&&(this[s]=new O,typeof this.dispose<"u"&&this.dispose(()=>this[s].destroy())),this[s]}}})}class Eh extends Bl{constructor(t,n=!0){super(({progressFunc:i,completeFunc:s,errorFunc:o})=>(this._intervalFunc=i,this._intervalID&&console.error("this._intervalID should be undefined!"),this.leading&&i(),this._intervalID=setInterval(i,this.intervalTime),()=>{if(!this._intervalID)throw console.error("this._intervalID should not be undefined!"),new Error("this._intervalID should not be undefined!");clearInterval(this._intervalID),this._intervalID=void 0}));d(this,"_intervalID");d(this,"_intervalFunc");this.intervalTime=t,this.leading=n,this.dispose(this.intervalTimeChanged.disposableOn(()=>{this._intervalID&&this._intervalFunc&&(clearInterval(this._intervalID),this._intervalID=setInterval(this._intervalFunc,this.intervalTime))}))}}wh(Eh,"leading",!0),wh(Eh,"intervalTime",500);function L_(r,e){let t,n;const i=new Promise((o,a)=>{n=a,t=globalThis.setTimeout(()=>{t=void 0,o()},r)}),s=o=>{t&&(clearTimeout(t),t=void 0),n&&n(o??new yh("sleep cancel error!"))};if(typeof e=="boolean"&&e)return[s,i];if(e)return Np(e,s),i}class F_{constructor(e=0,t=0,n=0,i,s){d(this,"_processData");d(this,"_lastUpdateTimeStamp",0);this.startTime=e,this.duration=t,this.delay=n,this.proccessFunc=i,this.completeFunc=s,this._processData={ratio:0,timeStamp:0,timeStampFromStart:0,timeStampFromLastUpdate:0}}update(e){const t=(e-this.startTime)/this.duration;t>=0&&(this._processData.ratio=t,this._processData.timeStamp=e,this._processData.timeStampFromStart=e-this.startTime,this._processData.timeStampFromLastUpdate=e-this._lastUpdateTimeStamp,this._lastUpdateTimeStamp=e,this.proccessFunc&&this.proccessFunc(this._processData),t>=1&&this.completeFunc&&this.completeFunc())}start(){this.startTime=performance.now()+this.delay,this._lastUpdateTimeStamp=this.startTime}}class Rp extends Bl{constructor(t=1e3,n=0,i=Al){let s;function o(){s&&s()}super(({progressFunc:u,completeFunc:l,errorFunc:c})=>{const h=this.startUpdateFunc&&this.startUpdateFunc(this._base.update.bind(this._base))||void 0;return this._base.startTime=performance.now(),this._base.duration=this.duration,this._base.delay=this.delay,this._base.proccessFunc=u,this._base.completeFunc=()=>{h&&h(),l()},this._base.start(),s=h,o});d(this,"_base");d(this,"duration");d(this,"delay");d(this,"startUpdateFunc");this._base=new F_,this.duration=t,this.delay=n,this.startUpdateFunc=i}get startTime(){return this._base.startTime}}class A_ extends V{constructor(t){super();d(this,"_target",0);d(this,"_current",0);d(this,"_start",0);d(this,"_timing",new Rp(Number.POSITIVE_INFINITY));d(this,"_currentChanged");this._duration=t,this._timing.progressFunc=({ratio:n})=>{n=n<0?0:n>1?1:n;const i=this._start*(1-n)+this._target*n;this._current=i,this._currentChanged&&this._currentChanged.emit(this._target,this._current)},this.dispose(()=>{this._timing.isRunning&&this._timing.cancel(),this._timing.destroy()})}reset(t,n=t){this._timing.isRunning&&this._timing.cancel(),this._target=t,this._current=n,this._start=t}set target(t){if(this._target!==t){this._target=t,this._timing.isRunning&&this._timing.cancel(),this._timing.reset(),this._start=this._current;const n=Math.abs(this._target-this._start);this._timing.duration=n*this._duration,this._timing.start()}}get target(){return this._target}get current(){return this._current}get currentChanged(){return this._currentChanged||(this._currentChanged=new O),this._currentChanged}}function Lp(r,e){e=e||[];const t=r.parentNode;return t?Lp(t,e.concat(t)):e}function k_(r){const e=r.composedPath&&r.composedPath()||r.path,t=r.target;if(e!=null)return e.indexOf(globalThis)<0?e.concat(globalThis):e;if(t===globalThis)return[globalThis];if(t===null)throw new Error("target === null");return[t].concat(Lp(t),globalThis)}function ln(r,e=!1){const{offsetX:t,offsetY:n}=r;let i=t,s=n;{const o=k_(r);for(let a=0;a<o.length;++a){const u=o[a];if(u!==r.currentTarget&&u instanceof HTMLElement)i+=u.clientLeft,s+=u.clientTop,i+=u.offsetLeft,s+=u.offsetTop;else break}}return e?[i*globalThis.devicePixelRatio,s*globalThis.devicePixelRatio]:[i,s]}function Ko(r,e=!1){const t=r.target,n=r.currentTarget||r.__xbsj_lastCurrentTarget__;if(!t||!n)return[r.clientX,r.clientY];const i=t.getBoundingClientRect(),s=n.getBoundingClientRect(),o=i.left+r.offsetX,a=i.top+r.offsetY,u=o-s.left,l=a-s.top;return e?[u*globalThis.devicePixelRatio,l*globalThis.devicePixelRatio]:[u,l]}class Fp extends V{constructor(t){super();d(this,"_clickEvent",new O);d(this,"_dbclickEvent",new O);d(this,"_downEvent",new O);d(this,"_upEvent",new O);d(this,"_moveEvent",new O);d(this,"_debouncing",new _h(300));this.dispose(()=>{this._clickEvent.destroy(),this._dbclickEvent.destroy(),this._downEvent.destroy(),this._upEvent.destroy(),this._moveEvent.destroy(),this._debouncing.destroy()});let n=!1,i=[0,0],s=!1;this._debouncing.progressFunc=([[c,h,f],p])=>{p===1?this._clickEvent.emit(c,h,f):p>=2?this._dbclickEvent.emit(c,h,f):console.error("point click should not be here!")},this._debouncing.start(),this.dispose(()=>{this._debouncing.isRunning&&this._debouncing.cancel(),this._debouncing.destroy()});const o=c=>{n=!0;const[h,f]=ln(c);i[0]=h,i[1]=f,this._downEvent.emit(h,f,c)},a=c=>{const[h,f]=ln(c);n&&!s&&this._debouncing.debounce(h,f,c),n=!1,s=!1,this._upEvent.emit(h,f,c)},u=c=>{const[h,f]=ln(c);if(n&&!s){const[p,v]=i;(Math.abs(h-p)>3||Math.abs(f-v)>3)&&(s=!0)}this._moveEvent.emit(h,f,c)},l=()=>{n=!1,s=!1};t.addEventListener("pointerdown",o),t.addEventListener("pointerup",a),t.addEventListener("pointermove",u),t.addEventListener("pointerout",l),this.dispose(()=>{t.removeEventListener("pointerdown",o),t.removeEventListener("pointerup",a),t.removeEventListener("pointermove",u),t.removeEventListener("pointerout",l)})}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}get downEvent(){return this._downEvent}get upEvent(){return this._upEvent}get moveEvent(){return this._moveEvent}}class Ch extends V{constructor(){super();d(this,"_pickRectEvent",this.disposeVar(new O));d(this,"_updateRectEvent",this.disposeVar(new O));d(this,"_pointerActionEvent",this.disposeVar(new O));d(this,"_active",this.disposeVar(j(!1)));d(this,"_pickRect",{left0:0,top0:0,left1:0,top1:0});let t=0,n=0,i=0,s=0;this.dispose(this._pointerActionEvent.disposableOn(({type:o,left:a,top:u})=>{o==="PointerDown"?(this._active.value=!0,t=a,n=u,i=a,s=u,this._setPickRect({left0:t,top0:n,left1:i,top1:s}),this._updateRectEvent.emit(this._pickRect)):o==="PointerMove"?this._active.value&&(i=a,s=u,this._setPickRect({left0:t,top0:n,left1:i,top1:s}),this._updateRectEvent.emit(this._pickRect)):o==="PointerUp"&&this._active.value&&(this._active.value=!1,i=a,s=u,this._setPickRect({left0:t,top0:n,left1:i,top1:s}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect))}))}_setPickRect({left0:t,left1:n,top0:i,top1:s}){this._pickRect.left0=t,this._pickRect.left1=n,this._pickRect.top0=i,this._pickRect.top1=s}pointerDown(t,n){this._pointerActionEvent.emit({type:"PointerDown",left:t,top:n})}pointerMove(t,n){this._pointerActionEvent.emit({type:"PointerMove",left:t,top:n})}pointerUp(t,n){this._pointerActionEvent.emit({type:"PointerUp",left:t,top:n})}reset(){this._setPickRect({left0:0,top0:0,left1:0,top1:0}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect)}get activeEvent(){return this._active.changed}get updateRectEvent(){return this._updateRectEvent}get pickRectEvent(){return this._pickRectEvent}static getLeftTopAndSize(t,n){n=n||{left:0,top:0,width:0,height:0,forward:!0};const{left0:i,top0:s,left1:o,top1:a}=t;return n.width=Math.abs(i-o),n.height=Math.abs(s-a),n.left=Math.min(i,o),n.top=Math.min(s,a),n.forward=o>i,n}static contains(t,n,i){const{left:s,top:o,width:a,height:u}=i;return t>s&&t<=s+a&&n>=o&&n<=o+u}}class V_ extends Ch{constructor(e){super();const t=this.disposeVar(new Fp(e));this.dispose(t.downEvent.disposableOn((o,a,u)=>u.altKey&&this.pointerDown(o,a))),this.dispose(t.moveEvent.disposableOn((o,a)=>this.pointerMove(o,a))),this.dispose(t.upEvent.disposableOn((o,a)=>this.pointerUp(o,a)));const n=document.createElement("div");n.style.backgroundColor="rgba(0, 0, 0, 0)",n.style.border="2px dashed red",n.style.position="absolute",n.style.boxSizing="border-box",n.style.pointerEvents="none",n.style.height="0px",n.style.width="0px",n.style.left="0px",n.style.top="0px",n.style.display="none",e.appendChild(n),this.dispose(()=>e.removeChild(n)),this.dispose(this.activeEvent.disposableOn(o=>{n.style.display=o?"block":"none"}));const i=()=>{this.reset()};e.addEventListener("contextmenu",i),this.dispose(()=>e.removeEventListener("contextmenu",i));const s={left:0,top:0,width:0,height:0,forward:!1};this.dispose(this.updateRectEvent.disposableOn(o=>{if(Ch.getLeftTopAndSize(o,s)){const{left:a,top:u,width:l,height:c}=s;n.style.height=`${c|0}px`,n.style.width=`${l|0}px`,n.style.left=`${a|0}px`,n.style.top=`${u|0}px`}}))}}class Fr extends Error{}function _s(r,e){Xn(r,"_promise_cancel")&&console.warn("setPromiseCancel warn: promise has cancelFunc!"),fi(r,"_promise_cancel",e)}function Zo(r){return Xn(r,"_promise_cancel")}function Qo(r){return!!Zo(r)}function Sh(r,e){const t=Zo(r);return t?(t(e),!0):!1}function bh(r){const[e,t]=r;return _s(t,e),t}function ta(r){let e;const t=new Promise((n,i)=>{e=i,r.then(n).catch(i)});return _s(t,e),t}function j_(r){let e,t;var n=new Promise((i,s)=>{t=r.disposableOn((...o)=>{t&&t(),i(o)}),e=o=>{t&&t(),s(o)}});return[e,n]}function B_(r){const e=new O,t=new O;return r.then(n=>{e.isDestroyed()||e.emit(n)}).catch(n=>{t.isDestroyed()||t.emit(n)}),[e,t]}class Ph extends V{constructor(){super();d(this,"_cancelled",!1);d(this,"_cancelError");d(this,"_promiseSet",new Set);d(this,"_disposer")}get disposer(){return this._disposer=this._disposer||new V,this._disposer}destroyImp(){this.finally()}cancel(t){var n;if(!this._cancelled){this._cancelled=!0,(n=this._disposer)==null||n.destroy(),this._cancelError=t;for(let i of this._promiseSet)Sh(i);this._promiseSet.clear()}}get cancelFuncsNum(){return Iu(this._promiseSet,t=>t+1,0)}finally(){this._disposer&&!this._disposer.isDestroyed()&&this._disposer.destroy(),this._promiseSet.clear()}check(){if(this._cancelled)throw this._cancelError??new Fr("cancel from CancelManager!")}promise(t){return this._promiseSet.add(t),t.finally(()=>(this._promiseSet.delete(t),this.check()))}promiseAny(t){const n=[],i=t.map(s=>(this._promiseSet.add(s),Qo(s)&&n.push(Zo(s)),s.finally(()=>this._promiseSet.delete(s))));return Promise.any(i).finally(()=>(n.forEach(s=>s(new Fr("cancel from promiseAny!"))),n.length=0))}promiseAll(t){const n=[],i=t.map(s=>(this._promiseSet.add(s),Qo(s)&&n.push(Zo(s)),s.finally(()=>this._promiseSet.delete(s))));return Promise.all(i).finally(()=>(n.forEach(s=>s(new Fr("cancel from promiseAll!"))),n.length=0))}promiseRace(t){const n=[],i=t.map(s=>(this._promiseSet.add(s),Qo(s)&&n.push(Zo(s)),s.finally(()=>this._promiseSet.delete(s))));return Promise.race(i).finally(()=>(n.forEach(s=>s(new Fr("cancel from promiseRace!"))),n.length=0))}}class Fe extends V{constructor(t){super();d(this,"_status","Initial");d(this,"_completeEvent");d(this,"_errorEvent");d(this,"_completeFunc");d(this,"_errorFunc");d(this,"_cancelFunc");d(this,"_runningId",-1);this._startFunc=t,this.dispose(()=>this.isRunning&&this.cancel())}get errorEvent(){return this._errorEvent||(this._errorEvent=new O),this._errorEvent}get completeEvent(){return this._completeEvent||(this._completeEvent=new O),this._completeEvent}get errorFunc(){return this._errorFunc}get completeFunc(){return this._completeFunc}set errorFunc(t){this._errorFunc!==t&&(this._errorFunc=t)}set completeFunc(t){this._completeFunc!==t&&(this._completeFunc=t)}start(...t){if(this._status!=="Initial")return;const n=++this._runningId;this._status="Running",this._cancelFunc=this._startFunc({completeFunc:i=>{var s;n===this._runningId&&this._status==="Running"&&(this._status="Completed",this._completeFunc&&this._completeFunc(i),(s=this._completeEvent)==null||s.emit(i))},errorFunc:i=>{var s;n===this._runningId&&this._status==="Running"&&(this._status="Error",this._errorFunc&&this._errorFunc(i),(s=this._errorEvent)==null||s.emit(i))},runningingID:n},...t)}cancel(t=new Fr("")){var n;if(this._status==="Running"){if(!this._cancelFunc)throw new Error("!this._cancelFunc");this._status="Error",this._errorFunc&&this._errorFunc(t),(n=this._errorEvent)==null||n.emit(t),this._cancelFunc(t),this._cancelFunc=void 0}}reset(){this._status==="Running"&&console.error("processing cannot reset while running. you can first cancel it!"),(this._status==="Completed"||this._status==="Error")&&(this._status="Initial")}get status(){return this._status}get isInitial(){return this._status==="Initial"}get isRunning(){return this._status==="Running"}get isCompleted(){return this._status==="Completed"}get isError(){return this._status==="Error"}get runningId(){return this._runningId}restart(t=new Fr(""),...n){this.isRunning&&this.cancel(t),this.reset(),this.start(...n)}restartIfNotRunning(...t){this.isRunning||(this.reset(),this.start(...t))}}function Tu(r){return(e,...t)=>{const n=new Ph,{completeFunc:i,errorFunc:s}=e,o=r(n,...t).then(i).catch(s).finally(()=>n.destroy());return _s(o,n.cancel.bind(n)),a=>Sh(o,a)}}class z_ extends Fe{constructor(){super(({errorFunc:t},n,i)=>{try{const[s,o]=Ml(n,i);return this._doFunc=s,o}catch(s){return t(s),()=>{}}});d(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class U_ extends Fe{constructor(t,n){super(({errorFunc:i})=>{try{const[s,o]=Ml(t,n);return this._doFunc=s,o}catch(s){return i(s),()=>{}}});d(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}function G_(r){return new Fe(Tu((e,...t)=>e.promise(r(...t))))}function W_(r,...e){return new Fe(Tu(t=>t.promise(r(...e))))}function zl(r){return G_((...e)=>{const t=r(...e);return Qo(t)?t:ta(t)})}function Ih(r,...e){return W_(()=>{const t=r(...e);return Qo(t)?t:ta(t)})}function H_(r){let e;const t=new Promise((n,i)=>{e=()=>{r(),i()}});return _s(t,e),t}function q_(r,...e){const t=new Ph,n=r(t,...e).finally(()=>t.destroy());return _s(n,t.cancel.bind(t)),n}function Yn(r){return new Fe(Tu(r))}function X_(r,...e){return new Fe(Tu(t=>r(t,...e)))}function Ap(r,...e){const t=new AbortController;let n=t.signal,[i,s]=e;if(s!=null&&s.signal)throw console.error("init?.signal"),new Error("init?.signal");s=s||{},s.signal&&console.warn("revocableFetch error: init.signal would be override!"),s.signal=n;let o=!1;const a=()=>{o=!0,t.abort()};let u=fetch(i,s);return r&&(u=u.then(l=>{if(!l.ok)return l;if(!l.body)throw Error("ReadableStream not yet supported in this browser.");const c=l.headers.get("content-length");c||console.warn("response.headers.get('content-length') is undefined... cannot get contentLength!");const h=c?parseInt(c,10):0;let f=0;return new Response(new ReadableStream({start(p){if(!l.body)throw new Error("!response.body");const v=l.body.getReader();C();function C(){v.read().then(({done:S,value:P})=>{if(S){p.close();return}if(!P)throw new Error("!value");if(!r)throw new Error("!progressFunc");f+=P.byteLength,r(f,h),p.enqueue(P),C()}).catch(S=>{p.error(S)})}}}),{status:l.status,statusText:l.statusText,headers:l.headers})}).catch(l=>{throw o?(l instanceof Error&&l.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new Fr(`fetching cancelled! error: ${l}`)):(l instanceof Error&&l.code===20&&console.error("error.code === 20"),l)})),_s(u,a),u}function Y_(r,...e){return Ap(r,...e)}function xh(...r){return Ap(void 0,...r)}function J_(){return zl(xh)}function $_(...r){return Ih(xh,...r)}function Th(r,...e){let t=-1;var n=new Promise((i,s)=>{r.isRunning&&r.cancel(),r.reset();const o=new V;o.dispose(r.completeEvent.disposableOn(a=>{if(i(a),o.isDestroyed()){debugger;console.error(`disposer is destroyed! ${o}`);return}o.destroy()})),o.dispose(r.errorEvent.disposableOn(a=>{if(s(a),o.isDestroyed()){debugger;console.error(`disposer is destroyed! ${o}`);return}o.destroy()})),r.start(...e),t=r.runningId});return[i=>t===r.runningId&&r.isRunning&&r.cancel(i),n]}function gi(r,e,...t){try{return e(...t)}catch(n){r(n)}}function K_(){return new Fe(({completeFunc:r,errorFunc:e},t)=>$o(()=>gi(e,()=>{t&&t(),r()})))}function Z_(r){return new Fe(({completeFunc:e,errorFunc:t})=>$o(()=>gi(t,()=>{r&&r(),e()})))}function Q_(){return new Fe(({completeFunc:r,errorFunc:e},t)=>Cu(()=>{gi(e,()=>{t&&t(),r()})}))}function t0(r){return new Fe(({completeFunc:e,errorFunc:t})=>Cu(()=>{gi(t,()=>{r&&r(),e()})}))}function kp(){return new Fe(({completeFunc:r,errorFunc:e},t,n)=>ch(()=>{gi(e,()=>{t&&t(),r()})},n??1e3))}function Vp(r,e){return new Fe(({completeFunc:t,errorFunc:n})=>ch(()=>{gi(n,()=>{r&&r(),t()})},e??1e3))}function e0(){return new Fe(({errorFunc:r},e,t=1e3)=>lh(()=>gi(r,e),t))}function n0(r,e=1e3){return new Fe(({errorFunc:t})=>lh(()=>gi(t,r),e))}function Ou(){return new Fe(({errorFunc:r},e)=>Rl(t=>gi(r,e,t)))}function ea(r){return new Fe(({errorFunc:e})=>Rl(t=>gi(e,r,t)))}function Nu(r,...e){let t,n;const i=new Promise((o,a)=>{n=a,t=globalThis.setTimeout(()=>{t=void 0,o(e)},r)});return _s(i,o=>{t&&(clearTimeout(t),t=void 0),n&&n(o??new Fr("sleep cancel error!"))}),i}function r0(){return zl(Nu)}function i0(r,...e){return Ih(Nu,r,...e)}function to(r,e,...t){return r.promise(bh(Th(Yn(async(n,...i)=>(r.disposer.dispose(()=>{n.isDestroyed()||n.cancel()}),await e(n,...i))),...t)))}function s0(r,e,...t){return r.promise(bh(Th(e,...t)))}class o0 extends Fe{constructor(){super(({errorFunc:t},n,i)=>{try{const[s,o]=mh(n,i);return this._doFunc=s,o}catch(s){return t(s),()=>{}}});d(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class a0 extends Fe{constructor(t,n){super(({errorFunc:i})=>{try{const[s,o]=mh(t,n);return this._doFunc=s,o}catch(s){return i(s),()=>{}}});d(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class Ul extends V{constructor(t=1e3,n=Al){super();d(this,"_speed");d(this,"_speedChangedEvent");d(this,"_duration");d(this,"_durationChangedEvent");d(this,"_loop");d(this,"startUpdateFunc");d(this,"_updateBindThis");d(this,"_cancelStartUpdateFunc");d(this,"_startTimeStamp");d(this,"_playingChangedEvent");d(this,"_startPlayingEvent");d(this,"_stopPlayingEvent");d(this,"_loopChangedEvent");d(this,"_currentTime",this.disposeVar(j(0)));this._speed=1,this._duration=t,this._loop=!1,this.startUpdateFunc=n,this._updateBindThis=this._update.bind(this),this.dispose(()=>{this._cancelStartUpdateFunc&&(this._cancelStartUpdateFunc(),this._cancelStartUpdateFunc=void 0)}),this._startTimeStamp=Number.NaN,this.dispose(()=>{this._startPlayingEvent&&this._startPlayingEvent.reset(),this._stopPlayingEvent&&this._stopPlayingEvent.reset()})}get startPlayingEvent(){return this._startPlayingEvent=this._startPlayingEvent||new O,this._startPlayingEvent}get stopPlayingEvent(){return this._stopPlayingEvent=this._stopPlayingEvent||new O,this._stopPlayingEvent}get currentTimeChangedEvent(){return this._currentTime.changed}get loopChangedEvent(){return this._loopChangedEvent=this._loopChangedEvent||new O,this._loopChangedEvent}set loop(t){this._loop!==t&&(this._loop=t,this._loopChangedEvent&&this._loopChangedEvent.emit(this._loop))}get loop(){return this._loop}_update(t){if(Number.isNaN(this._startTimeStamp))console.warn("Number.isNaN(this._startTimeStamp)");else{const n=(t-this._startTimeStamp)*this._speed;this._setCurrentTimeInner(n)}}get currentTime(){return this._currentTime.value}set currentTime(t){this._setCurrentTimeInner(t),this._resetStartTime()}_setCurrentTimeInner(t){this._currentTime.value!==t&&(this._duration<=0?this._currentTime.value=0:t<0?this.loop?this._currentTime.value=this._duration+t%this._duration:(this._currentTime.value=0,this.playing&&this._stopPlaying()):t>this._duration?this.loop?this._currentTime.value=t%this._duration:(this._currentTime.value=this._duration,this.playing&&this._stopPlaying()):this._currentTime.value=t)}get durationChangedEvent(){return this._durationChangedEvent||(this._durationChangedEvent=new O),this._durationChangedEvent}get duration(){return this._duration}set duration(t){var n;if(t<0)console.warn("duration sholud greater than 0!");else if(this._duration!==t){const i=this._duration;this._duration=t,this._currentTime.value>this._duration&&(this._currentTime.value=this._duration),(n=this._durationChangedEvent)==null||n.emit(this._duration,i)}}get speedChangedEvent(){return this._speedChangedEvent||(this._speedChangedEvent=new O),this._speedChangedEvent}get speed(){return this._speed}set speed(t){var n;if(this._speed!==t&&t!==0){const i=this._speed;this._speed=t,this._resetStartTime(),(n=this._speedChangedEvent)==null||n.emit(this._speed,i)}}_resetStartTime(){this._startTimeStamp=performance.now()-this._currentTime.value/this._speed}_startPlaying(){var t,n;this._resetStartTime(),this._cancelStartUpdateFunc=this.startUpdateFunc(this._updateBindThis),(t=this._startPlayingEvent)==null||t.emit(this._currentTime.value),(n=this._playingChangedEvent)==null||n.emit(!0)}_stopPlaying(){var t,n;if(!this._cancelStartUpdateFunc)throw new Error("this._cancelStartUpdateFunc is undefined!");this._cancelStartUpdateFunc(),this._cancelStartUpdateFunc=void 0,(t=this._stopPlayingEvent)==null||t.emit(this._currentTime.value),(n=this._playingChangedEvent)==null||n.emit(!1)}get playingChangedEvent(){return this._playingChangedEvent||(this._playingChangedEvent=new O),this._playingChangedEvent}get playing(){return!!this._cancelStartUpdateFunc}set playing(t){!!this._cancelStartUpdateFunc!==t&&(t?this._startPlaying():this._stopPlaying())}}class Du extends V{constructor(t){super();d(this,"_stop",this.disposeVar(j(0)));d(this,"_current",this.disposeVar(j(0)));d(this,"_start",this.disposeVar(j(0)));d(this,"_player",this.disposeVar(new Ul(200)));this.dispose(this._player.currentTimeChangedEvent.disposableOn(n=>{let i=n/this._player.duration;i=i>1?1:i<0?0:i;const s=this._start.value,o=this._stop.value;this._current.value=s+(o-s)*i})),this.duration=t}get current(){return this._current.value}get currentChanged(){return this._current.changed}get source(){return this._start.value}get sourceChanged(){return this._start.changed}get target(){return this._stop.value}get targetChanged(){return this._stop.changed}get duration(){return this._player.duration}set duration(t){this._player.duration=t}set target(t){this._start.value=this._current.value,this._stop.value=t,this._player.currentTime=0,this._player.playing=!0}reset(t){this._start.value=t,this._current.value=t,this._stop.value=t,this._player.playing=!1}}let jp=-1;class ue extends O{constructor(e,t,n,i){super(),this._domElement=e,this._type=t,this.callback=i;const s=o=>(o.__xbsj_listenerNo__=++jp,o.__xbsj_listenerTime__=Date.now(),o.__xbsj_lastCurrentTarget__=o.currentTarget,this.emit(o),this.callback&&this.callback(o));this._domElement.addEventListener(this._type,s,n),this.dispose(()=>this._domElement.removeEventListener(this._type,s,n))}static getLastLisenNo(){return jp}static getCurrentTarget(e){return e.__xbsj_lastCurrentTarget__}static getListenerNo(e){return e.__xbsj_listenerNo__}static getListenerTime(e){return e.__xbsj_listenerTime__}static on(e,t){const n=ue.getLastLisenNo();return e.disposableOn(i=>{const s=ue.getListenerNo(i);(s===void 0||s>n)&&t(i)})}get element(){return this._domElement}static create(e,t,n){return new ue(e,t,n)}}class Oh extends V{constructor(){super();d(this,"_clickEvent",this.disposeVar(new O));d(this,"_dbclickEvent",this.disposeVar(new O));d(this,"_pointerdownEvent",this.disposeVar(new O));d(this,"_pointerupEvent",this.disposeVar(new O));d(this,"_pointermoveEvent",this.disposeVar(new O));d(this,"_pointeroutEvent",this.disposeVar(new O));d(this,"dbClickDelayTime",300);d(this,"nativeClickDelayTime",500);d(this,"clickMovementTolerantPixelSize",3);d(this,"debugging",!1);d(this,"_enabled",this.disposeVar(j(!0)));const t=this.disposeVar(Yn(async i=>{do{const s=await to(i,u=>new Promise((l,c)=>{u.disposer.dispose(c),u.disposer.dispose(ue.on(this._pointerdownEvent,l))})),o=ln(s);if(this.debugging&&console.log(`鼠标按下 ${o.toString()}`),!await to(i,u=>new Promise((l,c)=>{u.disposer.dispose(c);const h=setTimeout(()=>l(!0),this.nativeClickDelayTime);u.disposer.dispose(()=>clearTimeout(h)),u.disposer.dispose(ue.on(this._pointermoveEvent,f=>{const[p,v]=ln(f),[C,S]=o;(Math.abs(p-C)>3||Math.abs(v-S)>3)&&l(!1)})),u.disposer.dispose(ue.on(this._pointeroutEvent,()=>l(!1))),u.disposer.dispose(ue.on(this._pointerupEvent,()=>l(!0)))}))){this.debugging&&console.log("取消1");continue}const a=await to(i,u=>new Promise((l,c)=>{u.disposer.dispose(c);const h=setTimeout(()=>l("timeout"),this.dbClickDelayTime);u.disposer.dispose(()=>clearTimeout(h)),u.disposer.dispose(ue.on(this._pointermoveEvent,f=>{const[p,v]=ln(f),[C,S]=o;(Math.abs(p-C)>3||Math.abs(v-S)>3)&&l("moved")})),u.disposer.dispose(ue.on(this._pointerdownEvent,l)),u.disposer.dispose(ue.on(this._pointeroutEvent,()=>l("pointouted"))),u.disposer.dispose(ue.on(this._pointerupEvent,()=>l("pointuped")))}));if(typeof a=="string"){this.debugging&&console.log(`触发单击事件!取消双击监听!error: ${a}`),this._clickEvent.emit(s);continue}if(!await to(i,u=>new Promise((l,c)=>{u.disposer.dispose(c);const h=setTimeout(()=>l(!1),this.nativeClickDelayTime);u.disposer.dispose(()=>clearTimeout(h)),u.disposer.dispose(ue.on(this._pointermoveEvent,f=>{const[p,v]=ln(f),[C,S]=o;(Math.abs(p-C)>3||Math.abs(v-S)>3)&&l(!1)})),u.disposer.dispose(ue.on(this._pointeroutEvent,()=>l(!1))),u.disposer.dispose(ue.on(this._pointerupEvent,()=>l(!0)))}))){this.debugging&&console.log("取消2");continue}this.debugging&&console.log("触发双击事件!"),this._dbclickEvent.emit(a)}while(!0)})),n=i=>{i?t.restart():t.isRunning&&t.cancel()};n(this.enabled),this.dispose(this.enabledChanged.disposableOn(n))}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}pointerDown(t){this._pointerdownEvent.emit(t)}pointerUp(t){this._pointerupEvent.emit(t)}pointerMove(t){this._pointermoveEvent.emit(t)}pointerOut(t){this._pointeroutEvent.emit(t)}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}}class u0 extends V{constructor(t,n){super();d(this,"_pointerClick",this.disposeVar(new Oh));this._div=t;const{div:i,pointerClick:s}=this,o=c=>s.pointerDown(c),a=c=>s.pointerMove(c),u=c=>s.pointerOut(c),l=c=>s.pointerUp(c);i.addEventListener("pointerdown",o,n),i.addEventListener("pointermove",a,n),i.addEventListener("pointerout",u,n),i.addEventListener("pointerup",l,n),this.dispose(()=>{i.removeEventListener("pointerdown",o,n),i.removeEventListener("pointermove",a,n),i.removeEventListener("pointerout",u,n),i.removeEventListener("pointerup",l,n)})}get div(){return this._div}get pointerClick(){return this._pointerClick}get clickEvent(){return this.pointerClick.clickEvent}get dbclickEvent(){return this.pointerClick.dbclickEvent}}class Bp extends V{constructor(){super();d(this,"_hoverEvent",this.disposeVar(new O));d(this,"_hoverOutEvent",this.disposeVar(new O));d(this,"_pointerdownEvent",this.disposeVar(new O));d(this,"_pointerupEvent",this.disposeVar(new O));d(this,"_pointermoveEvent",this.disposeVar(new O));d(this,"_pointeroutEvent",this.disposeVar(new O));d(this,"delayTime",800);const t=this.disposeVar(kp()),n=l=>{this._hoverOutEvent.emit()},i=l=>{this._hoverOutEvent.emit()};let s;const o=()=>{if(!s){console.warn("!lastPointerEvent");return}this._hoverEvent.emit(s)},a=l=>{s=l,t.restart(void 0,o,this.delayTime),this._hoverOutEvent.emit()},u=l=>{t.cancel(),this._hoverOutEvent.emit()};this.dispose(this._pointerdownEvent.disposableOn(n)),this.dispose(this._pointerupEvent.disposableOn(i)),this.dispose(this._pointermoveEvent.disposableOn(a)),this.dispose(this._pointeroutEvent.disposableOn(u))}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}pointerDown(t){this._pointerdownEvent.emit(t)}pointerUp(t){this._pointerupEvent.emit(t)}pointerMove(t){this._pointermoveEvent.emit(t)}pointerOut(t){this._pointeroutEvent.emit(t)}}class l0 extends V{constructor(t,n=1500){super();d(this,"_hoverEvent",new O);d(this,"_hoverOutEvent",new O);const i=new _h(n);this.dispose(()=>i.destroy());let s=0,o=0,a;i.progressFunc=()=>this._hoverEvent.emit(s,o,a);const u=f=>{!i.isRunning&&i.restart(),a=f,[s,o]=ln(f),i.debounce(),this._hoverOutEvent.emit()},l=f=>{!i.isRunning&&i.restart(),a=f,[s,o]=ln(a),i.debounce(),this._hoverOutEvent.emit()},c=f=>{!i.isRunning&&i.restart(),a=f,[s,o]=ln(a),i.debounce(),this._hoverOutEvent.emit()},h=f=>{i.isRunning&&i.cancel(),this._hoverOutEvent.emit()};t.addEventListener("pointerdown",u),t.addEventListener("pointerup",l),t.addEventListener("pointermove",c),t.addEventListener("pointerout",h),this.dispose(()=>{t.removeEventListener("pointerdown",u),t.removeEventListener("pointerup",l),t.removeEventListener("pointermove",c),t.removeEventListener("pointerout",h)})}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}}class zp extends V{constructor(t,n={}){super();d(this,"_needRedrawEvent");d(this,"_needPickRedrawEvent");d(this,"_id",Jo());d(this,"_clickEvent");d(this,"_clickOutEvent");d(this,"_dbclickEvent");d(this,"_dbclickOutEvent");d(this,"_actived",!1);d(this,"_activedChanged");d(this,"_hovered",!1);d(this,"_hoveredChanged");d(this,"_selected",!1);d(this,"_selectedChanged");d(this,"_opacity",1);d(this,"_opacityChanged");d(this,"_show",!0);d(this,"_showChanged");this._canvasPrimitivesContext=t;const{needRedraw:i=!0,needPickRedraw:s=!0}=n;i&&(this._needRedrawEvent=new O),s&&(this._needPickRedrawEvent=new O),this._canvasPrimitivesContext.addPoi(this),this.dispose(()=>this._canvasPrimitivesContext.removePoi(this)),this.dispose(this.showChanged.disposableOn(()=>{this.needRedraw(),this.needPickRedraw()})),this.dispose(this.opacityChanged.disposableOn(()=>this.needRedraw()))}get id(){return this._id}get context(){return this._canvasPrimitivesContext}needRedraw(){this._needRedrawEvent?this._needRedrawEvent.emit():console.warn("no needRedrawEvent!")}needPickRedraw(){this._needPickRedrawEvent?this._needPickRedrawEvent.emit():console.warn("no needPickRedrawEvent!")}hasClickEvent(){return!!this._clickEvent}get clickEvent(){return this._clickEvent=this._clickEvent||new O,this._clickEvent}hasClickOutEvent(){return!!this._clickOutEvent}get clickOutEvent(){return this._clickOutEvent=this._clickOutEvent||new O,this._clickOutEvent}hasDbclickEvent(){return!!this._dbclickEvent}get dbclickEvent(){return this._dbclickEvent=this._dbclickEvent||new O,this._dbclickEvent}hasDbclickOutEvent(){return!!this._dbclickOutEvent}get dbclickOutEvent(){return this._dbclickOutEvent=this._dbclickOutEvent||new O,this._dbclickOutEvent}set actived(t){this._actived!==t&&(this._actived=t,this._activedChanged&&this._activedChanged.emit(t,this))}get actived(){return this._actived}get activedChanged(){return this._activedChanged=this._activedChanged||new O,this._activedChanged}set hovered(t){this._hovered!==t&&(this._hovered=t,this._hoveredChanged&&this._hoveredChanged.emit(t,this))}get hovered(){return this._hovered}get hoveredChanged(){return this._hoveredChanged=this._hoveredChanged||new O,this._hoveredChanged}set selected(t){this._selected!==t&&(this._selected=t,this._selectedChanged&&this._selectedChanged.emit(t,this))}get selected(){return this._selected}get selectedChanged(){return this._selectedChanged=this._selectedChanged||new O,this._selectedChanged}set opacity(t){this._opacity!==t&&(this._opacity=t,this._opacityChanged&&this._opacityChanged.emit(t,this))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new O,this._opacityChanged}set show(t){this._show!==t&&(this._show=t,this._showChanged&&this._showChanged.emit(t,this))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new O,this._showChanged}}class Nh extends zp{constructor(t,n=[0,0],i=0){super(t);d(this,"_winPosAndDepthChanged");this._winPos=n,this._depth=i,this.dispose(this.winPosAndDepthChanged.disposableOn(()=>{this.needRedraw(),this.needPickRedraw()}))}set winPos(t){(this._winPos[0]!==t[0]||this._winPos[1]!==t[1])&&(this._winPos[0]=t[0],this._winPos[1]=t[1],this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get winPos(){return this._winPos}set depth(t){this._depth!==t&&(this._depth=t,this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get depth(){return this._depth}get winPosAndDepthChanged(){return this._winPosAndDepthChanged||(this._winPosAndDepthChanged=new O),this._winPosAndDepthChanged}}function eo(r,e,t,n){const[i,s]=r,[o,a,u,l]=n,c=e[0]*t[0],h=e[1]*t[1],f=i-(c*o+u),p=s-(h*a+l);return{left:f,top:p,right:f+c,bottom:p+h}}function no(r,e,t,n,i){r.beginPath(),r.moveTo(e,t),r.lineTo(e-n*.5,t-n*.5),r.arc(e,t-n,n*.7071067811865475,Math.PI*.75,Math.PI*.25),r.lineTo(e,t),r.fillStyle=i,r.fill()}function Up(r,e,t,n,i,s){r.beginPath(),r.moveTo(e+s,t),r.lineTo(e+n-s,t),r.arcTo(e+n,t,e+n,t+s,s),r.lineTo(e+n,t+i-s),r.arcTo(e+n,t+i,e+n-s,t+i,s),r.lineTo(e+s,t+i),r.arcTo(e,t+i,e,t+i-s,s),r.lineTo(e,t+s),r.arcTo(e,t,e+s,t,s)}function Gp(r,e,t,n,i,s){r.font=i;const o=r.measureText(n),a=o.actualBoundingBoxLeft+o.actualBoundingBoxRight,u=Number.isFinite(o.fontBoundingBoxAscent)?o.fontBoundingBoxAscent:o.actualBoundingBoxAscent,l=Number.isFinite(o.fontBoundingBoxDescent)?o.fontBoundingBoxDescent:o.actualBoundingBoxDescent;let c=u+l;r.fillStyle=s,r.fillText(n,e-a*.5,t+c*.5-l)}function Wp(r){const{width:e,height:t}=r,n=e instanceof SVGAnimatedLength?e.baseVal.SVG_LENGTHTYPE_PX:e,i=t instanceof SVGAnimatedLength?t.baseVal.SVG_LENGTHTYPE_PX:t,s=document.createElement("canvas");s.width=n,s.height=i;const o=s.getContext("2d");if(!o)throw new Error("!cavnasCtx");return o.drawImage(r,0,0,n,i),s}function Hp(r,e){const{width:t,height:n}=r,i=r.getContext("2d");if(!i)throw new Error("!cavnasCtx");const[s,o,a]=e.map(h=>h*255|0),u=i.getImageData(0,0,t,n),l=u.data;for(var c=0;c<l.length;c+=4)l[c]=s,l[c+1]=o,l[c+2]=a;i.putImageData(u,0,0)}function Dh(r,e,t,n=[.5,1,0,0],i,s="12px Arial",o=2,a="#FFF",u="#000A"){r.font=s;const l=r.measureText(i),c=l.actualBoundingBoxLeft+l.actualBoundingBoxRight,h=l.fontBoundingBoxAscent+l.fontBoundingBoxDescent,f=e,p=t,v=c+o*2,C=h+o*2,{left:S,top:P,bottom:y}=eo([f,p],[v,C],[1,1],n);r.fillStyle=u,Up(r,S,P,v,C,o),r.fill(),r.fillStyle=a,r.fillText(i,S+o,y-o-l.fontBoundingBoxDescent)}function Mu(r){return("00"+r.toString(16).toUpperCase()).substr(-2)}function Ru(r){const[e,t,n,i]=r.map(s=>s*255|0);return`#${Mu(e)}${Mu(t)}${Mu(n)}${Mu(i)}`}function Mh(r,e){const[t,n,i]=e,s=`${t}-${n}-${i}`;let o=Xn(r,s);return o||(o=Wp(r),Hp(o,e),fi(r,s,o)),o}class c0 extends Nh{constructor(t,n,i=[32,32],s=[.5,1,0,0],o="#F00F"){super(t);d(this,"_tooltip","");d(this,"_title","");d(this,"__scale",[1,1]);d(this,"_tooltipAlpha",0);d(this,"_bgColor",[.3,.3,.3,.8]);d(this,"_bgColorHexStr",Ru(this._bgColor));d(this,"_fgColor",[1,1,1,1]);d(this,"_fgColorHexStr",Ru(this._fgColor));this._image=n,this._size=i,this._originRatioAndOffset=s,this._defaultColorStr=o;const a=new Du(100),u=new Du(100);this.dispose(()=>{a.destroy(),u.destroy()});const l=()=>{if(this._clickEvent&&!this._clickEvent.empty){const c=(1+.08*u.current)*(1+.08*a.current);this._scale=[c,c],this._tooltipAlpha=a.current}};this.dispose(this.activedChanged.disposableOn(c=>{u.target=c?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(c=>{a.target=c?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(()=>{this.needRedraw()})),this.dispose(u.currentChanged.disposableOn(l)),this.dispose(a.currentChanged.disposableOn(l))}set size(t){const[n,i]=t,[s,o]=this._size;(s!==n||o!==i)&&(this._size[0]=n,this._size[1]=i,this.needRedraw(),this.needPickRedraw())}get size(){return this._size}set _scale(t){const[n,i]=t,[s,o]=this.__scale;(s!==n||o!==i)&&(this.__scale[0]=n,this.__scale[1]=i,this.needRedraw(),this.needPickRedraw())}get _scale(){return this.__scale}set fgColor(t){if(!this._fgColor.every((n,i)=>t[i]===n)){const[n,i,s,o]=t;this._fgColor.splice(0,4,n,i,s,o),this._fgColorHexStr=Ru(this._fgColor),this.needRedraw()}}get fgColor(){return this._fgColor}set bgColor(t){if(!this._bgColor.every((n,i)=>t[i]===n)){const[n,i,s,o]=t;this._bgColor.splice(0,4,n,i,s,o),this._bgColorHexStr=Ru(this._bgColor),this.needRedraw()}}get bgColor(){return this._bgColor}set originRatioAndOffset(t){const[n,i,s,o]=this._originRatioAndOffset,[a,u,l,c]=t;(n!==a||i!==u||s!==l||o!==c)&&(this._originRatioAndOffset.splice(0,4,a,u,l,c),this.needRedraw(),this.needPickRedraw())}get originRatioAndOffset(){return this._originRatioAndOffset}set image(t){this._image!==t&&(this._image=t,this.needRedraw())}get image(){return this._image}set defaultColorStr(t){this._defaultColorStr!==t&&(this._defaultColorStr=t,this.needRedraw())}get defaultColorStr(){return this._defaultColorStr}set tooltip(t){this._tooltip!==t&&(this._tooltip=t,this.needRedraw())}get tooltip(){return this._tooltip}set title(t){this._title!==t&&(this._title=t,this.needRedraw())}get title(){return this._title}draw(t){if(!this._show)return;const[n,i]=this._winPos,s=this._size[0]*this.__scale[0],o=this._size[1]*this.__scale[1],{left:a,top:u}=eo([n,i],this._size,this.__scale,this._originRatioAndOffset),l=t.globalAlpha;if(t.globalAlpha=this.opacity,this._image){if(this.selected){const c=Mh(this._image,[1,0,0]),{left:h,top:f}=eo([n,i+3],[s+6,o+6],[1,1],this._originRatioAndOffset);t.drawImage(c,h,f,s+6,o+6)}if(this.actived){const[c,h,f,p]=this._fgColor,v=Mh(this._image,[c,h,f]),{left:C,top:S}=eo([n,i+4],[s+8,o+8],[1,1],this._originRatioAndOffset);t.drawImage(v,C,S,s+8,o+8)}if(this.hovered){const[c,h,f,p]=this._bgColor,v=Mh(this._image,[c,h,f]),{left:C,top:S}=eo([n,i+2],[s+4,o+4],[1,1],this._originRatioAndOffset);t.drawImage(v,C,S,s+4,o+4)}t.drawImage(this._image,a,u,s,o)}else t.fillStyle=this._fgColorHexStr,t.fillRect(a,u,s,o);if(this._title!==""&&Dh(t,n+20,i-16,[0,.5,0,0],this._title,"14px Arial",4,this._fgColorHexStr,this._bgColorHexStr),t.globalAlpha=l,this._hovered&&this._tooltip!==""){const c=t.globalAlpha;t.globalAlpha=this._tooltipAlpha,Dh(t,n,i-42,[.5,1,0,0],this._tooltip,"12px Arial",4,this._fgColorHexStr,this._bgColorHexStr),t.globalAlpha=c}}drawForPick(t,n){if(!this._show)return;const[i,s]=this._winPos,o=n("default"),a=this._size[0]*this.__scale[0],u=this._size[1]*this.__scale[1],{left:l,top:c}=eo([i,s],this._size,this.__scale,this._originRatioAndOffset);t.fillStyle=o,t.fillRect(l,c,a,u)}}class h0 extends Nh{constructor(t){super(t);d(this,"_width",16);d(this,"_text","");d(this,"_fillStyle","#0F0");d(this,"_scale",1);d(this,"_scaleChanged");this.dispose(this.scaleChanged.disposableOn(o=>{this.needRedraw(),this.needPickRedraw()}));const n=this.disposeVar(new Du(100)),i=this.disposeVar(new Du(100)),s=()=>{this._clickEvent&&!this._clickEvent.empty&&(this.scale=(1+.1*i.current)*(1+.2*n.current))};this.dispose(i.currentChanged.disposableOn(s)),this.dispose(n.currentChanged.disposableOn(s)),this.dispose(this.activedChanged.disposableOn(o=>{i.target=o?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(o=>{n.target=o?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(o=>{this.needRedraw()}))}set scale(t){this._scale!==t&&(this._scale=t,this._scaleChanged&&this._scaleChanged.emit(t,this))}get scale(){return this._scale}get scaleChanged(){return this._scaleChanged||(this._scaleChanged=new O),this._scaleChanged}set width(t){this._width!==t&&(this._width=t,this.needRedraw(),this.needPickRedraw())}get width(){return this._width}set text(t){this._text!==t&&(this._text=t,this.needRedraw())}get text(){return this._text}set fillStyle(t){this._fillStyle!==t&&(this._fillStyle=t,this.needRedraw())}get fillStyle(){return this._fillStyle}draw(t){if(!this._show)return;const[n,i]=this._winPos,s=t.globalAlpha;t.globalAlpha=this.opacity;const o=this._width*this._scale;this.selected&&no(t,n,i+3,o+3,"#F00"),this.actived&&this._clickEvent&&!this._clickEvent.empty&&no(t,n,i+5,o+5,"#FFF"),this.hovered?no(t,n,i+3,o+3,"#000A"):no(t,n,i+1,o+1,"#000A"),no(t,n,i,o,this._fillStyle);const a=this._scale>1.2?"bold 14px Arial":"bold 10px Arial";Gp(t,n,i-o,this._text,a,"#000"),t.globalAlpha=s}drawForPick(t,n){if(!this._show)return;const[i,s]=this._winPos,o=this._width*this._scale,a=n("default");no(t,i,s,o,a)}}const qp=new ArrayBuffer(4),Xp=new Uint32Array(qp),ro=new Uint8Array(qp);function Yp(r){if(r>=16777215)throw new Error("uint32 > 0xFFFFFF");return Xp[0]=r,[ro[0],ro[1],ro[2]]}function Jp(r,e,t){return ro[0]=r,ro[1]=e,ro[2]=t,ro[3]=0,Xp[0]}class $p extends V{constructor(){super(...arguments);d(this,"_pickColors",new Array(16777215));d(this,"_pickColorIndex",0)}reset(){for(let t=0;t<this._pickColorIndex;++t){const n=this._pickColors[t];if(!n)throw console.error("this._pickColors[i] should not be undefined!"),new Error("this._pickColors[i] should not be undefined!");n.poi=null,n.tag=""}this._pickColorIndex=0}createPickColor(t,n){const i=this._pickColorIndex;++this._pickColorIndex;const s=this._pickColors[i];s?(s.poi=t,s.tag=n):this._pickColors[i]={poi:t,tag:n};const[o,a,u]=Yp(i);return[o,a,u]}getPickInfoFromColor(t,n,i){const s=Jp(t,n,i);if(s>=this._pickColorIndex){console.error("index >= this._pickColorIndex");return}const o=this._pickColors[s];if(!o){console.error("!this._pickColors[index]");return}return o}destroyImp(){this.reset()}}const Kp=(r,e)=>e.depth-r.depth;class d0 extends V{constructor(){super();d(this,"_pois",[]);d(this,"_canvasElement");d(this,"_ctx");d(this,"_offscreenCanvasElement");d(this,"_offscreenCanvasElement2");d(this,"_offscreenCtx");d(this,"_offscreenCtx2");d(this,"_size",[0,0]);d(this,"_needRedraw",!1);d(this,"_needPickRedraw",!1);d(this,"_pickColorManager",new $p);const t=document.createElement("canvas");t.style.width="100%",t.style.height="100%",this._canvasElement=t;const n=t.getContext("2d");if(n===null)throw new Error("cannot get context 2d!");this._ctx=n,this._offscreenCanvasElement=document.createElement("canvas"),this._offscreenCtx=this._offscreenCanvasElement.getContext("2d"),this._offscreenCtx.imageSmoothingEnabled=!1,this._offscreenCanvasElement2=document.createElement("canvas"),this._offscreenCtx2=this._offscreenCanvasElement2.getContext("2d"),this._offscreenCtx2.imageSmoothingEnabled=!1,this.disposeVar(ea(()=>{const[s,o]=this._size,{clientWidth:a,clientHeight:u}=this._canvasElement;(s!==a||o!==u)&&(this._size[0]=a,this._size[1]=u,this._canvasElement.width=a,this._canvasElement.height=u,this._offscreenCanvasElement.width=a,this._offscreenCanvasElement.height=u,this._offscreenCanvasElement2.width=a,this._offscreenCanvasElement2.height=u,this._dirty()),this._needRedraw&&(this._needRedraw=!1,this._draw())})).start()}get element(){return this._canvasElement}get pois(){return this._pois}_dirty(){this._needRedraw=!0,this._needPickRedraw=!0}get size(){return this._size}addPoi(t){if(typeof Xn(t,"listenHandler")<"u"){console.error("可能有poi重复加载poiManager中!");return}if(this._pois.indexOf(t)!==-1){console.error("同一个poi加了多次!");return}this._pois.push(t),this._dirty();const n=t._needRedrawEvent;if(n){const s=n.on(()=>{this._needRedraw=!0});fi(t,"needRedrawEventHandler",s)}const i=t._needPickRedrawEvent;if(i){const s=i.on(()=>{this._needPickRedraw=!0});fi(t,"needPickRedrawEventHandler",s)}}removePoi(t){const n=this._pois.indexOf(t);if(n===-1){console.error("删除一个不存在的poi!");return}this._pois.splice(n,1),this._dirty();const i=t._needRedrawEvent;if(i){const o=Xn(t,"needRedrawEventHandler");o?i.off(o):console.error("poi没有listenHandler!")}const s=t._needPickRedrawEvent;if(s){const o=Xn(t,"needPickRedrawEventHandler");o?s.off(o):console.error("poi没有listenHandler!")}}_draw(){this._pois.sort(Kp);const[t,n]=this._size;this._ctx.clearRect(0,0,t,n),this._pois.forEach(i=>i.draw(this._ctx))}pick(t,n,i,s){return this._needPickRedraw&&(this._needPickRedraw=!1,this._pickDraw()),this._getPickInfo(t,n,i,s)}_pickDraw(){this._pickColorManager.reset(),this._pois.sort(Kp);const[t,n]=this._size;this._offscreenCtx.clearRect(0,0,t,n),this._pois.forEach(i=>{const s=o=>{const[a,u,l]=this._pickColorManager.createPickColor(i,o);return`rgb(${a}, ${u}, ${l})`};i.drawForPick(this._offscreenCtx,s)})}_getPickInfo(t,n,i,s){const o=this._offscreenCtx.getImageData(t,n,i,s),a=[],u=o.data.length/4;for(let l=0;l<u;++l){const c=o.data[l*4+0],h=o.data[l*4+1],f=o.data[l*4+2];if(o.data[l*4+3]===255){const v=this._pickColorManager.getPickInfoFromColor(c,h,f);if(v&&v.poi&&!a.includes(v)){let C=!0;{const[S,P]=this._size;this._offscreenCtx2.clearRect(0,0,S,P);const y=b=>"rgb(255, 255, 255)";v.poi.drawForPick(this._offscreenCtx2,y);const _=this._offscreenCtx2.getImageData(t,n,i,s),m=_.data[l*4+0],w=_.data[l*4+1],E=_.data[l*4+2];_.data[l*4+3],m===255&&w===255&&E===255||(C=!1)}C&&a.push(v)}}}return a}}class Rh extends V{constructor(){super(...arguments);d(this,"_closeEvent");d(this,"_show",!0);d(this,"_showChanged");d(this,"_opacity",1);d(this,"_opacityChanged");d(this,"_winPos",[0,0]);d(this,"_winPosChanged")}set winPos(t){const[n,i]=t,[s,o]=this._winPos;(n!==s||i!==o)&&(this._winPos[0]=n,this._winPos[1]=i,this._winPosChanged&&this._winPosChanged.emit(this._winPos))}get winPos(){return this._winPos}get winPosChanged(){return this._winPosChanged=this._winPosChanged||new O,this._winPosChanged}set opacity(t){this._opacity!==t&&(this._opacity=t,this._opacityChanged&&this._opacityChanged.emit(this._opacity))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new O,this._opacityChanged}set show(t){this._show!==t&&(this._show=t,this._showChanged&&this._showChanged.emit(this._show))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new O,this._showChanged}get closeEvent(){return this._closeEvent||(this._closeEvent=new O),this._closeEvent}}const Lh=new WeakMap;function Fh(r){if(!Lh.has(r)){const e=new Tl(()=>new r,t=>t.reset());Lh.set(r,e)}return Lh.get(r)}class Ah extends Rh{constructor(){super();d(this,"_div");d(this,"_contentDiv");d(this,"_originOffsetX",0);d(this,"_originOffsetY",0);d(this,"_originRatioX",.5);d(this,"_originRatioY",1);d(this,"_divChanged",new O);const t=document.createElement("div");t.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible;";const n=document.createElement("div");n.style.cssText=`position: absolute; left: ${-this._originOffsetX}px; top: ${-this._originOffsetY}px; transform: translateX(-${100*this._originRatioX}%) translateY(-${100*this._originRatioY}%); margin: 0; padding: 0; pointer-events: none;`;const i=document.createElement("div");this._contentDiv=i,n.appendChild(i),t.appendChild(n),this._div=t,this.dispose(this._divChanged.disposableOn(()=>{n.style.left=`${-this._originOffsetX}px`,n.style.top=`${-this._originOffsetY}px`,n.style.transform=`translateX(-${100*this._originRatioX}%) translateY(-${100*this._originRatioY}%)`})),this.dispose(this.winPosChanged.disposableOn(([s,o])=>{this._div.style.left=`${s}px`,this._div.style.top=`${o}px`})),this.dispose(this.opacityChanged.disposableOn(s=>{this._div.style.opacity=`${s}`})),this.dispose(this.showChanged.disposableOn(s=>{this._div.style.visibility=s?"visible":"hidden"}))}get contentDiv(){return this._contentDiv}reset(){}get originOffsetX(){return this._originOffsetX}set originOffsetX(t){this._originOffsetX!==t&&(this._originOffsetX=t,this._divChanged.emit())}get originOffsetY(){return this._originOffsetY}set originOffsetY(t){this._originOffsetY!==t&&(this._originOffsetY=t,this._divChanged.emit())}get originRatioX(){return this._originRatioX}set originRatioX(t){this._originRatioX!==t&&(this._originRatioX=t,this._divChanged.emit())}get originRatioY(){return this._originRatioY}set originRatioY(t){this._originRatioY!==t&&(this._originRatioY=t,this._divChanged.emit())}get element(){return this._div}}class Zp extends V{constructor(t,n){super();d(this,"_floatDiv");d(this,"_show",!1);d(this,"_showChanged");this._customDivClass=t,this._divContainer=n,this.dispose(()=>{this.show=!1})}_updateDivPoi(){if(this._show){const{floatDiv:n}=this;n.element.parentElement||this._divContainer.appendChild(n.element)}else{const{_floatDiv:n}=this;n&&n.element.parentElement&&this._divContainer.removeChild(n.element)}}set show(t){this._show!==t&&(this._show=t,this._updateDivPoi(),this._showChanged&&this._showChanged.emit(t))}get show(){return this._show}get floatDiv(){if(!this._floatDiv){const t=Fh(this._customDivClass).create();this.dispose(()=>{Fh(this._customDivClass).destroy(t)}),this._floatDiv=t}return this._floatDiv}get showChanged(){return this._showChanged||(this._showChanged=new O),this._showChanged}}const f0=["top","bottom","left","right"];function p0(r){return Object.entries(r).map(([e,t])=>f0.includes(e)?`${e}: ${t}px; `:"").join("")}function Qp(r,e,t){const n=document.createElement("div");n.style.cssText=`position: absolute; ${p0(t)} background-color: ${r}; border-radius: ${e}px;`;const i='<svg viewBox="0 0 1024 1024" style="display: block;" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2420" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M512 128C300.8 128 128 300.8 128 512s172.8 384 384 384 384-172.8 384-384S723.2 128 512 128zM512 832c-179.2 0-320-140.8-320-320s140.8-320 320-320 320 140.8 320 320S691.2 832 512 832z" p-id="2421" fill="#ffffff"></path><path d="M672 352c-12.8-12.8-32-12.8-44.8 0L512 467.2 396.8 352C384 339.2 364.8 339.2 352 352S339.2 384 352 396.8L467.2 512 352 627.2c-12.8 12.8-12.8 32 0 44.8s32 12.8 44.8 0L512 556.8l115.2 115.2c12.8 12.8 32 12.8 44.8 0s12.8-32 0-44.8L556.8 512l115.2-115.2C684.8 384 684.8 364.8 672 352z" p-id="2422" fill="#ffffff"></path></svg>';return n.innerHTML=i,n}function tg(r,e,t="rgba(0,0,0,0.7)"){const n=document.createElement("div");n.style.cssText=`margin: 0 auto; width: ${r}px; height: ${e}px; position: relative; pointer-events: none;`;const i=document.createElement("div");return i.style.cssText=`position: absolute; left: 0px; top: 0px; width: 0; height: 0; border-left: ${r*.5}px solid transparent; border-right: ${r*.5}px solid transparent; border-top: ${e}px solid ${t};`,n.appendChild(i),[n,i]}class eg extends Ah{constructor(){super();d(this,"_borderDiv");d(this,"_closeDiv");d(this,"_innerContentDiv");d(this,"_colorStr","rgba(0, 0, 0, 0.7)");d(this,"_divColorChanged",new O);d(this,"_borderRadius",10);const t=document.createElement("div");t.style.cssText=`position: relative; background-color: ${this._colorStr}; border-radius: ${this._borderRadius}px; padding: 5px; pointer-events: all;`,this._borderDiv=t;const n=Qp(this._colorStr,10,{top:3,right:3}),[i,s]=tg(2*this._borderRadius,2*this._borderRadius,this._colorStr),o=document.createElement("div");this._innerContentDiv=o,t.appendChild(o),t.appendChild(n),this.contentDiv.appendChild(t),this.contentDiv.appendChild(i),n.style.opacity="0.1",n.onmouseenter=()=>{n.style.opacity="1.0"},n.onmouseleave=()=>{n.style.opacity="0.1"},n.onclick=()=>{this._closeEvent&&this._closeEvent.emit()},this._closeDiv=n,this.dispose(this._divColorChanged.disposableOn(()=>{s.style.borderTopColor=this._colorStr,t.style.backgroundColor=this._colorStr,i.style.width=`${this._borderRadius*2}px`,i.style.height=`${this._borderRadius*2}px`,s.style.borderLeft=`${this._borderRadius}px`,s.style.borderRight=`${this._borderRadius}px`,s.style.borderTop=`${this._borderRadius*2}px`}));const a=u=>{u.key==="Escape"&&this._closeEvent&&this._closeEvent.emit()};document.body.addEventListener("keydown",a,!0),this.dispose(()=>{document.removeEventListener("keydown",a,!0)})}get borderDiv(){return this._borderDiv}get innerContentDiv(){return this._innerContentDiv}reset(){this.show=!1,this.opacity=0,this._closeDiv.style.opacity="0.1",super.reset()}get colorStr(){return this._colorStr}set colorStr(t){this._colorStr!==t&&(this._colorStr=t,this._divColorChanged.emit())}get borderRadius(){return this._borderRadius}set borderRadius(t){this._borderRadius!==t&&(this._borderRadius=t,this._divColorChanged.emit())}}class g0 extends eg{constructor(){super();d(this,"_iframe");d(this,"_iframeMessageEvent");const t=document.createElement("iframe");t.style.cssText="width: 100%; height: 100%; border-width: 0px; border-radius: 5px; display: block;",t.src="http://www.weather.com.cn/live/index.shtml",this._iframe=t,this.innerContentDiv.appendChild(t);const n=i=>{i.source===this._iframe.contentWindow&&(this._iframeMessageEvent?this._iframeMessageEvent.emit(i):console.warn(`iframe消息接收到未处理!data: ${i.data}`))};globalThis.addEventListener("message",n),this.dispose(()=>{globalThis.removeEventListener("message",n)})}reset(){super.reset(),this.src=""}set src(t){this._iframe.src!==t&&(this._iframe.src=t)}get src(){return this._iframe.src}get iframe(){return this._iframe}get iframeMessageEvent(){return this._iframeMessageEvent=this._iframeMessageEvent||new O,this._iframeMessageEvent}}class m0 extends Rh{constructor(){super();d(this,"_div");d(this,"_contentContainer");d(this,"_text","");const t=document.createElement("div");this._div=t,t.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible; transition: opacity 0.5s;";const n=document.createElement("div");n.style.cssText="position: absolute; left: 0px; bottom: 0px; transform: translateX(-50%); margin: 0; padding: 0; pointer-events: none;";const i=document.createElement("div");i.style.cssText="position: relative; background-color: rgba(0, 0, 0, 0.7); border-radius: 5px; padding: 3px; pointer-events: all; color: white; white-space: nowrap;",i.innerText=this._text,this._div.appendChild(n),n.appendChild(i),this._contentContainer=i,this._div=t,this.dispose(this.winPosChanged.disposableOn(([s,o])=>{this._div.style.left=`${s}px`,this._div.style.top=`${o-50}px`})),this.dispose(this.opacityChanged.disposableOn(s=>{this._div.style.opacity=`${s}`})),this.dispose(this.showChanged.disposableOn(s=>{this._div.style.visibility=s?"visible":"hidden"}))}get element(){return this._div}reset(){this.opacity=1,this.show=!0}set text(t){this._text!==t&&(this._text=t,this._contentContainer.innerText=t)}get text(){return this._text}}class v0 extends Ah{constructor(){super(),this.contentDiv.style.backgroundColor="rgba(0, 0, 0, 0.8)",this.contentDiv.style.borderRadius="3px",this.contentDiv.style.color="rgb(255, 255, 255)",this.contentDiv.style.padding="1px 5px 1px 5px",this.contentDiv.style.fontSize="12px",this.contentDiv.style.whiteSpace="nowrap",this.contentDiv.innerText="未定义光标信息!",this.originRatioX=0,this.originRatioY=0,this.originOffsetX=-16}}class y0 extends V{constructor(t,n){super();d(this,"_cursorDiv");d(this,"_pointerOut",this.disposeVar(j(!1)));d(this,"_show",this.disposeVar(j(!0)));this._cursorDiv=new Zp(n,t),this.dispose(()=>this._cursorDiv.destroy());const i=o=>{const[a,u]=ln(o);this._cursorDiv.floatDiv.winPos=[a,u]};t.addEventListener("pointermove",i),this.dispose(()=>t.removeEventListener("pointermove",i));const s=()=>{this._cursorDiv.show=this.show&&this._pointerOut.value};s(),this.dispose(this.showChanged.disposableOn(s)),this.dispose(this._pointerOut.changed.disposableOn(s))}set show(t){this._show.value=t}get show(){return this._show.value}get showChanged(){return this._show.changed}reset(){this._pointerOut.value=!1}get cursorDiv(){return this._cursorDiv}set text(t){this._cursorDiv.floatDiv.contentDiv.innerText=t}get text(){return this._cursorDiv.floatDiv.contentDiv.innerText}}function Lu(r,e,t){if(!(r.tree===e.tree&&r!==e&&!r.isAncestorOf(e))||r.tree!==e.tree||!r.parent)return!1;if(!r.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");return!(e===r||r.isAncestorOf(e)||t!=="inner"&&!e.parent||t==="inner"&&!e.children)}function Gl(r,e,t){if(!r.tree||!e.tree||r.tree!==e.tree)return;if(!r.parent){console.warn("当前节点没有父节点,那么该节点无法被移动!");return}if(!r.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");if(e===r){console.warn("自身不能拖放到自身!");return}if(r.isAncestorOf(e)){console.warn("当前节点不能拖放到它自身的后代节点之上!");return}if(t!=="inner"&&!e.parent){console.warn("目标节点没有父节点,无法拖放!");return}if(t==="inner"&&!e.children){console.warn("无法移动到目标节点的子节点中,因为目标节点不是组节点!");return}r.tree._startTransaction();const n=r.parent.children.indexOf(r);if(r.parent.children.splice(n,1),t!=="inner"){const{parent:i}=e;if(!i||!i.children)throw new Error("!parent");const s=i.children.indexOf(e);t==="before"?i.children.splice(s,0,r):t==="after"&&i.children.splice(s+1,0,r)}else e.children.push(r);r.tree._stopTransaction()}function ng(r,e,t){return fh(r,n=>Lu(n,e,t))}function rg(r,e,t){for(let n of r)Lu(n,e,t)?Gl(n,e,t):console.warn(`treeItem(id: ${n.id}) cannot move...`)}const _0={checked:1,unchecked:2,indeterminate:3},w0=["checked","unchecked","indeterminate"];class ig extends V{constructor(t){super();d(this,"_collapsed",this.disposeVar(j(!1)));d(this,"_checkedStatus",this.disposeVar(j("unchecked")));d(this,"_selected",this.disposeVar(j(!1)));d(this,"_moveToPositionMode",this.disposeVar(j("none")));d(this,"_updateCheckedStatusFromChildrenEvent",this.disposeVar(new O));this._treeItem=t;const n=()=>this._treeItem.tree&&this._treeItem.tree.itemsChanged.emit([this._treeItem]);this.dispose(this._collapsed.changed.disposableOn(n)),this.dispose(this._checkedStatus.changed.disposableOn(n)),this.dispose(this._selected.changed.disposableOn(n)),this.dispose(this._moveToPositionMode.changed.disposableOn(n)),this.dispose(this._checkedStatus.changed.disposableOn(()=>this._treeItem.parent&&this._treeItem.parent.uiTreeObject.updateCheckedStatusFromChildren())),this.dispose(this._treeItem.childrenChangedEvent.disposableOn(()=>{this.updateCheckedStatusFromChildren()}));const i=this.disposeVar(Ie(this._updateCheckedStatusFromChildrenEvent));this.dispose(i.disposableOn(()=>{if(!this._treeItem.children)return;let s=0;dh(this._treeItem.children,o=>(s|=_0[o.uiTreeObject.checkedStatus],s===3)),s>0&&(this._checkedStatus.value=w0[s-1])})),this.dispose(this._treeItem.childrenResetedEvent.disposableOn(s=>{!s&&this.checkedStatus==="indeterminate"&&(this._checkedStatus.value="unchecked")}));{const s=(o,a,u=!0)=>{if(a)o.selectedItems.push(this._treeItem);else{const l=o.selectedItems.indexOf(this._treeItem);l===-1?u&&console.error("selectedItems index -1"):o.selectedItems.splice(l,1)}};this.dispose(this._selected.changed.disposableOn(o=>{const{tree:a}=this._treeItem;a&&s(a,o)})),this.dispose(()=>this.selected=!1)}}get treeItem(){return this._treeItem}get collapsed(){return this._collapsed.value}set collapsed(t){this._collapsed.value=t}get collapsedChanged(){return this._collapsed.changed}get checkedStatus(){return this._checkedStatus.value}check(t){const n=t?"checked":"unchecked";if(this._checkedStatus.value!==n&&(this._checkedStatus.value=n,this._treeItem.children))for(let i of this._treeItem.children)i.uiTreeObject.check(t)}updateCheckedStatusFromChildren(){this._updateCheckedStatusFromChildrenEvent.emit()}get checkedStatusChanged(){return this._checkedStatus.changed}get selected(){return this._selected.value}set selected(t){this._selected.value=t}get selectedChanged(){return this._selected.changed}get moveToPositionMode(){return this._moveToPositionMode.value}set moveToPositionMode(t){this._moveToPositionMode.value=t}get moveToPositionModeChanged(){return this._moveToPositionMode.changed}}const ii=class ii extends V{constructor(t,n=!1,i){super();d(this,"_children");d(this,"_childrenResetedEvent");d(this,"_childrenToChangeEvent");d(this,"_childrenChangedEvent");d(this,"_parent",this.disposeVar(j(void 0)));d(this,"_level",this.disposeVar(j(0)));d(this,"_id");d(this,"_uiTreeObject",this.disposeVar(new ig(this)));this._tree=t,this._hasChildren=n,this._id=i??Jo(),this._id!=="_ROOT"&&ii.wm.has(this._id)&&console.warn(`创建了id(${this._id})相同的树节点,会导致之前的树节点无法索引!`),ii.wm.set(this._id,this),this.dispose(()=>{if(this._id!=="_ROOT"&&!ii.wm.has(this._id)){console.warn(`树节点(${this._id})不在wm树上!`);return}ii.wm.delete(this._id)}),this.dispose(this._parent.changed.disposableOn(()=>{this._updateLevel()})),this.dispose(this._level.changed.disposableOn(()=>{if(this.children)for(let s of this.children)s._updateLevel()})),ii.allTreeItems.set(this._id,this),this.dispose(()=>{ii.allTreeItems.delete(this._id)})}static getFromId(t){return ii.wm.get(t)}get uiTreeObject(){return this._uiTreeObject}get id(){return this._id}_updateLevel(){this.parent&&(this._level.value=this.parent.level+1)}get parent(){return this._parent.value}get parentChanged(){return this._parent.changed}get children(){if(this._hasChildren){if(!this._children){const t=this.disposeVar(new xu);this._children=t,this.dispose(t.toChangeEvent.disposableOn((s,o)=>{for(let a of s){const{start:u,deleteCount:l,items:c}=a;for(let h=u;h<u+l;++h)o.get(h)._parent.value=void 0;for(let h of c){if(h.parent)throw console.error("请检查新增的treeItem是否正在使用!"),new Error("item.parent should not exist!");h._parent.value=this}}}));const n=new Set,i=new Set;this.dispose(t.toChangeEvent.disposableOn((s,o)=>{var a;if(this.tree){n.clear(),i.clear();for(let u of s){const{start:l,deleteCount:c,items:h}=u;for(let f=l;f<l+c;++f)n.add(o.get(f));for(let f of h)i.add(f)}for(let u of n)i.has(u)&&(n.delete(u),i.delete(u));(a=this.tree)==null||a.itemChildrenToChange.emit(this,s,n,i)}})),this.dispose(t.changedEvent.disposableOn(()=>{var s;(s=this.tree)==null||s.itemChildrenChanged.emit(this)})),this.dispose(t.toChangeEvent.disposableOn((...s)=>this._childrenToChangeEvent&&this._childrenToChangeEvent.emit(...s))),this.dispose(t.changedEvent.disposableOn((...s)=>this._childrenChangedEvent&&this._childrenChangedEvent.emit(...s)))}return this._children}else return}get childrenResetedEvent(){return this._childrenResetedEvent||(this._childrenResetedEvent=new O),this._childrenResetedEvent}get childrenToChangeEvent(){return this._childrenToChangeEvent||(this._childrenToChangeEvent=new O),this._childrenToChangeEvent}get childrenChangedEvent(){return this._childrenChangedEvent||(this._childrenChangedEvent=new O),this._childrenChangedEvent}resetChildren(t=!1){this._children&&(this._children.length=0),this._hasChildren=t,this._childrenResetedEvent&&this._childrenResetedEvent.emit(t)}*getDescendants(t){const n=this,i=[],s=[];for(n.children&&n.children.length>0&&(!t||t(n))&&(i.push(0),s.push(n.children));i.length>0;){const o=i[i.length-1],a=s[s.length-1],u=a.get(o);yield u,o<a.length-1?++i[i.length-1]:(s.pop(),i.pop()),u.children&&u.children.length>0&&(!t||t(u))&&(i.push(0),s.push(u.children))}}*getAncestors(t){let n=this.parent;for(;n&&(yield n,!(t&&!t(n)));)n=n.parent}isDescendantOf(t){for(let n of this.getAncestors())if(n===t)return!0;return!1}isAncestorOf(t){return t.isDescendantOf(this)}get level(){return this._level.value}get levelChanged(){return this._level.changed}get tree(){return this._tree}canMoveTo(t,n){return Lu(this,t,n)}moveTo(t,n){Gl(this,t,n)}detachFromParent(){if(!this.parent||!this.parent.children)return;const t=this.parent.children.indexOf(this);this.parent.children.splice(t,1)}insertNewTreeItem(t,n){if(n&&n.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&t.startsWith("Inner"))return n&&this.children.push(n),!0;if(t==="Inner")return!1;const i=this.parent;if(!i||!i.children)return!1;const s=i.children.indexOf(this);return t.endsWith("Before")?n&&i.children.splice(s,0,n):t.endsWith("After")&&n&&i.children.splice(s+1,0,n),!0}};d(ii,"wm",new Map),d(ii,"allTreeItems",new Map);let na=ii;class sg extends V{constructor(t){super();d(this,"_redrawEvent",this.disposeVar(new O));d(this,"_containerScrollTop",this.disposeVar(j(0)));d(this,"_containerClientHeight",this.disposeVar(j(-1)));d(this,"_container",this.disposeVar(j(void 0)));d(this,"_redrawInfo",{topFreeSpaceHeight:0,topUnvisibleItemNum:0,middleTreeItems:[],bottomFreeSpaceHeight:0,bottomUnvisibleItemNum:0});this._tree=t;const n=this._containerClientHeight,i=this._containerScrollTop,s=this._tree._forceRedrawEvent,o=this.disposeVar(Ie(this._tree.itemDivHeightChanged,this._tree.itemChildrenChanged,this._tree.itemsChanged,n.changed,i.changed,s)),{redrawInfo:a}=this,u=c=>{const h=c.uiTreeObject;return!!c.children&&(!h||!h.collapsed)};this.dispose(o.disposableOn(()=>{if(a.topFreeSpaceHeight=0,a.topUnvisibleItemNum=0,a.middleTreeItems.length=0,a.bottomFreeSpaceHeight=0,a.bottomUnvisibleItemNum=0,this._containerClientHeight.value>=0){const c=ph(this._tree.getDescendants(u)),h=this._tree.itemDivHeight,f=h*c,p=Wi([ys([Wi([f-n.value,0]),i.value]),0]),v=p/h|0,C=Math.ceil((p-v*h+n.value)/h)|0;v>0&&(a.topUnvisibleItemNum=v,a.topFreeSpaceHeight=v*this._tree.itemDivHeight);const S=v+C;let P=0;for(let _ of this._tree.getDescendants(u)){if(P>=S)break;P>=v&&a.middleTreeItems.push(_),++P}const y=c-v-C;y>0&&(a.bottomUnvisibleItemNum=y,a.bottomFreeSpaceHeight=y*this._tree.itemDivHeight)}else for(let c of this._tree.getDescendants(u))a.middleTreeItems.push(c);this._redrawEvent.emit(a)}));let l;this.dispose(()=>l&&(l.destroy(),l=void 0)),this.dispose(this.containerChanged.disposableOn(c=>{l&&(l.destroy(),l=void 0),c&&(l=Ou(),l.start(()=>{const{scrollTop:h,clientHeight:f}=c;typeof h>"u"||typeof f>"u"?Xo("createUiTreeWithContainer error: conainter has no scrollTop or clientHeight property!"):(this.containerScrollTop=h,this.containerClientHeight=f)}))}))}get container(){return this._container.value}set container(t){this._container.value=t}get containerChanged(){return this._container.changed}get redrawInfo(){return this._redrawInfo}getTreeItemPos(t){const n=o=>{const a=o.uiTreeObject;return!!o.children&&(!a||!a.collapsed)};let i=0,s=!1;for(let o of this._tree.getDescendants(n)){if(o===t){s=!0;break}++i}if(s)return[i,i*this._tree.itemDivHeight]}collapseAll(){console.log("collapseAll");for(let t of this.tree.root.getDescendants()){const n=t.uiTreeObject;n.collapsed=!0}}get tree(){return this._tree}get redrawEvent(){return this._redrawEvent}set containerScrollTop(t){this._containerScrollTop.value=t}get containerScrollTop(){return this._containerScrollTop.value}get containerScrollTopChanged(){return this._containerScrollTop.changed}set containerClientHeight(t){this._containerClientHeight.value=t}get containerClientHeight(){return this._containerClientHeight.value}get containerClientHeightChanged(){return this._containerClientHeight.changed}*getAllItems(t){for(let n of this._tree.getDescendants())(!t||t(n))&&(yield n)}getAllSelectedItems(){return this.getAllItems(t=>t.uiTreeObject.selected)}getAllCheckedLeafItems(){return this.getAllItems(t=>!t.children&&t.uiTreeObject.checkedStatus==="checked")}clearAllSelectedItems(t){for(let n of this.getAllSelectedItems())(!t||!t.includes(n))&&(n.uiTreeObject.selected=!1)}}let ra=(si=class extends V{constructor(t){super();d(this,"_root",this.disposeVar(new na(this,!0,"_ROOT")));d(this,"_itemChildrenChanged",this.disposeVar(new O));d(this,"_itemChildrenToChange",this.disposeVar(new O));d(this,"_itemsAdded",this.disposeVar(new O));d(this,"_itemsDeleted",this.disposeVar(new O));d(this,"_itemsChanged",this.disposeVar(new O));d(this,"_transactionStack",0);d(this,"_addedItems",new Set);d(this,"_deletedItems",new Set);d(this,"_selectedItems",this.disposeVar(new xu));d(this,"_itemDivHeight",this.disposeVar(j(si.defaultItemDivHeight)));d(this,"_forceRedrawEvent",this.disposeVar(new O));d(this,"_uiTree",this.disposeVar(new sg(this)));this._root._tree.value=this,this.dispose(this._itemChildrenToChange.disposableOn((n,i)=>{if(!n.children){console.error("!item.children");return}for(let s of i){const{start:o,deleteCount:a,items:u}=s;for(let l=o;l<o+a;++l){const c=n.children.get(l);this._deletedItems.has(c)?console.error(`this._deletedItems.has(currentItem(${c.id}))`):this._deletedItems.add(c)}for(let l of u)this._deletedItems.has(l)?this._deletedItems.delete(l):this._addedItems.add(l)}this._execTransaction()})),t!==void 0&&(this.itemDivHeight=t)}get selectedItems(){return this._selectedItems}get lastSelectedItem(){return this._selectedItems.length>0?this._selectedItems.get(this._selectedItems.length-1):void 0}get itemDivHeight(){return this._itemDivHeight.value}set itemDivHeight(t){this._itemDivHeight.value=t}get itemDivHeightChanged(){return this._itemDivHeight.changed}forceRedraw(){this._forceRedrawEvent.emit()}get uiTree(){return this._uiTree}get root(){return this._root}get children(){return this._root.children}getDescendants(t){return this._root.getDescendants(t)}getTreeItemFromId(t){let n;for(let i of this.getDescendants())if(i.id===t){n=i;break}return n}_startTransaction(){this._transactionStack===0&&(this._deletedItems.size>0&&(console.warn("this._deletedItems.size > 0"),this._deletedItems.clear()),this._addedItems.size>0&&(console.warn("this._addedItems.size > 0"),this._addedItems.clear())),++this._transactionStack}_stopTransaction(){--this._transactionStack,this._execTransaction()}_execTransaction(){this._transactionStack===0&&(this._deletedItems.size>0&&(this._itemsDeleted.emit([...this._deletedItems]),this._deletedItems.clear()),this._addedItems.size>0&&(this._itemsAdded.emit([...this._addedItems]),this._addedItems.clear()))}get itemChildrenChanged(){return this._itemChildrenChanged}get itemChildrenToChange(){return this._itemChildrenToChange}get itemsChanged(){return this._itemsChanged}get itemsAdded(){return this._itemsAdded}get itemsDeleted(){return this._itemsDeleted}},d(si,"defaultItemDivHeight",24),d(si,"canMoveToTreeItem",Lu),d(si,"moveToTreeItem",Gl),d(si,"canMoveToTreeItems",ng),d(si,"moveToTreeItems",rg),si);class Ee extends V{constructor(t,n,i=!0,s){super();d(this,"_obj",this.disposeVar(j(void 0)));this._resetEvent=t,this._createFunc=n;const o=this._resetEvent,a=this._createFunc,u=()=>{this._obj.value&&(this._obj.value.destroy(),this._obj.value=void 0)};this.dispose(u);const l=(...c)=>{u(),this._obj.value=a(...c)};i&&(s?this._obj.value=a(...s):this._obj.value=a()),this.dispose(o.disposableOn(l))}get obj(){return this._obj.value}get objChanged(){return this._obj.changed}}class E0 extends V{constructor(t,n=!0,i){super();d(this,"_event",this.disposeVar(new O));d(this,"_objResettingWithEvent");this._createFunc=t,this._execOnInit=n,this._initParams=i,this._objResettingWithEvent=this.disposeVar(new Ee(this._event,this._createFunc,this._execOnInit,this._initParams))}get obj(){return this._objResettingWithEvent.obj}get objChanged(){return this._objResettingWithEvent.objChanged}reset(...t){this._event.emit(...t)}}const th=class th extends V{constructor(){super();d(this,"_set",new Set);d(this,"_toChangeEvent",this.dv(new O));d(this,"_changedEvent",this.dv(new O));d(this,"main");this.dispose(()=>{this._set.size!==0&&(th.warnOnDestroying&&console.warn("this._set.size > 0"),this.clear())})}get toChange(){return this._toChangeEvent}get changed(){return this._changedEvent}add(...t){if(t.length==2&&typeof t[1]=="boolean")t[1]&&(this.main=t[0]);else for(let n of t)this._toChangeEvent.emit([],[n]),this._set.add(n),this._changedEvent.emit([],[n])}delete(...t){for(let n of t)this.main&&this.main==n&&(this.main=void 0),this._toChangeEvent.emit([n],[]),this._set.delete(n),this._changedEvent.emit([n],[])}disposableAdd(...t){return t.length==2&&typeof t[1]=="boolean"?(t[1]&&(this.main=t[0]),this.add(t[0]),()=>this.delete(t[0])):(this.add(...t),()=>this.delete(...t))}get size(){return this._set.size}clear(){const t=[...this._set];this._toChangeEvent.emit([],t),this._set.clear(),this._changedEvent.emit([],t),this.main=void 0}values(){return this._set.values()}};d(th,"warnOnDestroying",!0);let Wl=th;async function og(r){const e=[],t=[],n=r.entries();for await(const[i,s]of n){const o=s;o.kind==="file"?e.push(i):o.kind==="directory"&&t.push(i)}return{files:e,dirs:t}}async function kh(r){return await(await r.getFile()).text()}async function ag(r){const e=await kh(r);try{return JSON.parse(e)}catch{return}}async function ug(r){return await(await r.getFile()).arrayBuffer()}class lg extends V{constructor(e){super(),this._rootDirHandle=e}get rootDirHandle(){return this._rootDirHandle}async getSubFilesAndDirs(){return await og(this._rootDirHandle)}async getDir(e){let t=this._rootDirHandle;for(const n of e)if(t=await(t==null?void 0:t.getDirectoryHandle(n)),!t){console.log(`getDirectoryHandle ${n} failed`);return}return t}async getFile(e,t){const n=await this.getDir(e);if(n)try{return await n.getFileHandle(t)}catch(i){console.error(`未能获取当前文件 ${e.join("/")}/${t} error: ${i}`,i);return}}}class cg extends V{constructor(t){super();d(this,"_startRootDirId",0);d(this,"_dirMap",new Map);this._prefix=t}get prefix(){return this._prefix}async getRootDirId(t){let n;try{console.log("window.showDirectoryPicker begin"),n=await globalThis.showDirectoryPicker({id:t,mode:"read"}),console.log("window.showDirectoryPicker end",n)}catch(i){console.error(`LocalFileServer getRootDirId failed: ${i}`,i);return}if(n){const i=++this._startRootDirId,s=`${this._prefix}${i}`;return this._dirMap.set(s,new lg(n)),s}}getRootDir(t){return this._dirMap.get(t)}async getFile(t){const n=t.split("/");if(n.length<2){console.warn(`LocalFileServer getFile failed: ${t}`);return}const i=n[0],s=this._dirMap.get(i);if(!s){console.warn(`LocalFileServer getFile failed: ${t}`);return}const o=n.slice(1,n.length-1),a=n[n.length-1],u=await s.getFile(o,a);if(!u){console.warn(`LocalFileServer getFile failed: ${t}`);return}return u}async getText(t){const n=await this.getFile(t);if(n)return await kh(n)}async getArrayBuffer(t){const n=await this.getFile(t);if(n)return await ug(n)}async getJson(t){const n=await this.getFile(t);if(n)return await ag(n)}async getLocalFilePath(t,n,i){const s=await this.getRootDirId(n);if(!s){console.warn("getRootDirId error!");return}const o=this.getRootDir(s);if(!o){console.warn("getRootDir error!");return}const a=await o.getSubFilesAndDirs();if(!a.files){console.warn("getSubFilesAndDirs error! 找不到符合要求的文件!");return}const u=t?a.files.filter(l=>t.some(c=>l.endsWith(c))):a.files;if(u.length===0){console.warn("找不到符合要求的文件!");return}return`https://${s}/${u[0]}`}}const hg=new cg("xe2_local");async function C0(r,e,t){return await hg.getLocalFilePath(r,e,t)}class dg extends V{constructor(t,n){super();d(this,"_processing",this.disposeVar(Yn(async t=>{const n=this._complexImage,i=await t.promise(Op(this._imageUri,this._complexImage.crossOrigin));i&&i instanceof HTMLImageElement&&(n.size=[i.naturalWidth,i.naturalHeight],n.pixelFormat="RGBA",n.copyTexture({source:i}))})));this._complexImage=t,this._imageUri=n,this._processing.start()}get processing(){return this._processing}}const fg=["DEPTH_COMPONENT","DEPTH_STENCIL","ALPHA","RED","RG","RGB","RGBA","LUMINANCE","LUMINANCE_ALPHA","RGB_DXT1","RGBA_DXT1","RGBA_DXT3","RGBA_DXT5","RGB_PVRTC_4BPPV1","RGB_PVRTC_2BPPV1","RGBA_PVRTC_4BPPV1","RGBA_PVRTC_2BPPV1","RGBA_ASTC","RGB_ETC1","RGB8_ETC2","RGBA8_ETC2_EAC","RGBA_BC7"],pg=["img","gif","video","flv","hls"];let S0=class extends V{constructor(t,n){super();d(this,"_element");this._complexImage=t,this._videoSrc=n;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden",i.style.width="0px",i.style.height="0px";{const s=()=>{i.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{i.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{i.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}};class gg extends V{constructor(t,n){super();d(this,"_videoDom");d(this,"_update",this.disposeVar(ea(()=>this.update())));d(this,"_updateStart",this._update.start());this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new S0(this._complexImage,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:i}=this.videoElement;t.size=[n,i],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}function Vh(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function b0(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var jh={},Hi={},mg;function P0(){if(mg)return Hi;mg=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.loop=Hi.conditional=Hi.parse=void 0;var r=function n(i,s){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o;if(Array.isArray(s))s.forEach(function(l){return n(i,l,o,a)});else if(typeof s=="function")s(i,o,a,n);else{var u=Object.keys(s)[0];Array.isArray(s[u])?(a[u]={},n(i,s[u],o,a[u])):a[u]=s[u](i,o,a,n)}return o};Hi.parse=r;var e=function(i,s){return function(o,a,u,l){s(o,a,u)&&l(o,i,a,u)}};Hi.conditional=e;var t=function(i,s){return function(o,a,u,l){for(var c=[],h=o.pos;s(o,a,u);){var f={};if(l(o,i,a,f),o.pos===h)break;h=o.pos,c.push(f)}return c}};return Hi.loop=t,Hi}var Ce={},vg;function yg(){if(vg)return Ce;vg=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.readBits=Ce.readArray=Ce.readUnsigned=Ce.readString=Ce.peekBytes=Ce.readBytes=Ce.peekByte=Ce.readByte=Ce.buildStream=void 0;var r=function(h){return{data:h,pos:0}};Ce.buildStream=r;var e=function(){return function(h){return h.data[h.pos++]}};Ce.readByte=e;var t=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(f){return f.data[f.pos+h]}};Ce.peekByte=t;var n=function(h){return function(f){return f.data.subarray(f.pos,f.pos+=h)}};Ce.readBytes=n;var i=function(h){return function(f){return f.data.subarray(f.pos,f.pos+h)}};Ce.peekBytes=i;var s=function(h){return function(f){return Array.from(n(h)(f)).map(function(p){return String.fromCharCode(p)}).join("")}};Ce.readString=s;var o=function(h){return function(f){var p=n(2)(f);return h?(p[1]<<8)+p[0]:(p[0]<<8)+p[1]}};Ce.readUnsigned=o;var a=function(h,f){return function(p,v,C){for(var S=typeof f=="function"?f(p,v,C):f,P=n(h),y=new Array(S),_=0;_<S;_++)y[_]=P(p);return y}};Ce.readArray=a;var u=function(h,f,p){for(var v=0,C=0;C<p;C++)v+=h[f+C]&&Math.pow(2,p-C-1);return v},l=function(h){return function(f){for(var p=e()(f),v=new Array(8),C=0;C<8;C++)v[7-C]=!!(p&1<<C);return Object.keys(h).reduce(function(S,P){var y=h[P];return y.length?S[P]=u(v,y.index,y.length):S[P]=v[y.index],S},{})}};return Ce.readBits=l,Ce}var _g;function I0(){return _g||(_g=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var e=P0(),t=yg(),n={blocks:function(f){for(var p=0,v=[],C=f.data.length,S=0,P=(0,t.readByte)()(f);P!==p&&P;P=(0,t.readByte)()(f)){if(f.pos+P>=C){var y=C-f.pos;v.push((0,t.readBytes)(y)(f)),S+=y;break}v.push((0,t.readBytes)(P)(f)),S+=P}for(var _=new Uint8Array(S),m=0,w=0;w<v.length;w++)_.set(v[w],m),m+=v[w].length;return _}},i=(0,e.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},function(h){var f=(0,t.peekBytes)(2)(h);return f[0]===33&&f[1]===249}),s=(0,e.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,t.readArray)(3,function(h,f,p){return Math.pow(2,p.descriptor.lct.size+1)})},function(h,f,p){return p.descriptor.lct.exists}),{data:[{minCodeSize:(0,t.readByte)()},n]}]},function(h){return(0,t.peekByte)()(h)===44}),o=(0,e.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(f,p,v){return(0,t.readBytes)(v.text.blockSize)(f)}},n]},function(h){var f=(0,t.peekBytes)(2)(h);return f[0]===33&&f[1]===1}),a=(0,e.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(f,p,v){return(0,t.readString)(v.blockSize)(f)}},n]},function(h){var f=(0,t.peekBytes)(2)(h);return f[0]===33&&f[1]===255}),u=(0,e.conditional)({comment:[{codes:(0,t.readBytes)(2)},n]},function(h){var f=(0,t.peekBytes)(2)(h);return f[0]===33&&f[1]===254}),l=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,e.conditional)({gct:(0,t.readArray)(3,function(h,f){return Math.pow(2,f.lsd.gct.size+1)})},function(h,f){return f.lsd.gct.exists}),{frames:(0,e.loop)([i,a,u,s,o],function(h){var f=(0,t.peekByte)()(h);return f===33||f===44})}],c=l;r.default=c}(jh)),jh}var x0=I0();const T0=Vh(x0);var O0=yg();const N0=(r,e)=>{const t=new Array(r.length),n=r.length/e,i=function(c,h){const f=r.slice(h*e,(h+1)*e);t.splice.apply(t,[c*e,e].concat(f))},s=[0,4,2,1],o=[8,8,4,2];for(var a=0,u=0;u<4;u++)for(var l=s[u];l<n;l+=o[u])i(l,a),a++;return t},D0=(r,e,t)=>{const s=t;var o,a,u,l,c,h,f,w,p,v,m,C,E,b,T,I;const S=new Array(t),P=new Array(4096),y=new Array(4096),_=new Array(4097);for(C=r,a=1<<C,c=a+1,o=a+2,f=-1,l=C+1,u=(1<<l)-1,p=0;p<a;p++)P[p]=0,y[p]=p;var m,w,E,b,I,T;for(m=w=E=b=I=T=0,v=0;v<s;){if(b===0){if(w<l){m+=e[T]<<w,w+=8,T++;continue}if(p=m&u,m>>=l,w-=l,p>o||p==c)break;if(p==a){l=C+1,u=(1<<l)-1,o=a+2,f=-1;continue}if(f==-1){_[b++]=y[p],f=p,E=p;continue}for(h=p,p==o&&(_[b++]=E,p=f);p>a;)_[b++]=y[p],p=P[p];E=y[p]&255,_[b++]=E,o<4096&&(P[o]=f,y[o]=E,o++,(o&u)===0&&o<4096&&(l++,u+=o)),f=h}b--,S[I++]=_[b],v++}for(v=I;v<s;v++)S[v]=0;return S},M0=r=>{const e=new Uint8Array(r);return qn.parse(O0.buildStream(e),T0)},R0=r=>{const e=r.pixels.length,t=new Uint8ClampedArray(e*4);for(var n=0;n<e;n++){const i=n*4,s=r.pixels[n],o=r.colorTable[s]||[0,0,0];t[i]=o[0],t[i+1]=o[1],t[i+2]=o[2],t[i+3]=s!==r.transparentIndex?255:0}return t},L0=(r,e,t)=>{if(!r.image){console.warn("gif frame does not have associated image.");return}const{image:n}=r,i=n.descriptor.width*n.descriptor.height;var s=D0(n.data.minCodeSize,n.data.blocks,i);n.descriptor.lct.interlaced&&(s=N0(s,n.descriptor.width));const o={pixels:s,dims:{top:r.image.descriptor.top,left:r.image.descriptor.left,width:r.image.descriptor.width,height:r.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?o.colorTable=n.lct:o.colorTable=e,r.gce&&(o.delay=(r.gce.delay||10)*10,o.disposalType=r.gce.extras.disposal,r.gce.extras.transparentColorGiven&&(o.transparentIndex=r.gce.transparentColorIndex)),o.patch=R0(o),o},F0=(r,e)=>r.frames.filter(t=>t.image).map(t=>L0(t,r.gct));async function wg(r){const t=await(await fetch(r)).arrayBuffer(),n=M0(t),i=F0(n);return{gif:n,gifFrames:i,arrayBuffer:t}}function Eg(r,e,t){return r<e?e:r>t?t:r}class Cg extends Ul{constructor(t,n=!0,i){super();d(this,"_gifFrames",this.disposeVar(j(void 0)));d(this,"_gifDurations",[]);d(this,"_gifDuration",this.disposeVar(j(0)));d(this,"_gifSize",this.disposeVar(j([0,0],(t,n)=>t.every((i,s)=>i===n[s]),t=>[...t])));d(this,"_autoPlayOnLoad",this.disposeVar(j(!0)));d(this,"_gifCanvas");this._container=t,this.loop=!0;const s=document.createElement("canvas");this._gifCanvas=s,s.style.width="100%",s.style.height="100%";const o=s.getContext("2d");this._container&&this._container.appendChild(s),this.dispose(()=>this._container&&this._container.removeChild(s));let a;this.dispose(this._gifFrames.changed.disposableOn(l=>{if(!l||l.length===0){s.width=0,s.height=0;return}const{width:c,height:h}=l[0].dims;this._gifSize.value=[c,h];const f=l.length;let p=0;this._gifDurations.length=0;for(let v=0;v<f;++v)p+=l[v].delay,this._gifDurations.push(p);this._gifDuration.value=this._gifDurations[this._gifDurations.length-1],s.width=c,s.height=h,a=o.createImageData(c,h),this.currentTimeChangedEvent.emit(this.currentTime,this.currentTime),this._autoPlayOnLoad.value&&(this.currentTime=0,this.playing=!0)}));let u=-1;this.dispose(this.currentTimeChangedEvent.disposableOn(l=>{const c=Eg(l/this.duration,0,1),h=this.gifDuration*c,f=this._gifFrames.value;if(f&&f.length>0){const p=this._getFrame(h);if(p===u)return;u=p;const v=f[p];if(v.disposalType!==0&&v.disposalType!==1&&v.disposalType!==2&&Xo(`gif parsed get disposalType ${v.disposalType}... frame: ${p} size: ${JSON.stringify(v.dims)}`,`gif parsed get disposalType ${v.disposalType}...`),a&&(p===0||v.disposalType===2)&&a.data.fill(0),a){const[C,S]=this._gifSize.value,{width:P,height:y,left:_,top:m}=v.dims;if(y>S)throw new Error("height > canvasHeight");for(let w=0;w<y;++w)for(let E=0;E<P;++E){const b=w*P+E,I=m+w,T=_+E,D=I*C+T,x=a.data,N=v.patch,L=N[b*4+3]/255;x[D*4+0]=x[D*4+0]*(1-L)+N[b*4+0]*L|0,x[D*4+1]=x[D*4+1]*(1-L)+N[b*4+1]*L|0,x[D*4+2]=x[D*4+2]*(1-L)+N[b*4+2]*L|0,x[D*4+3]=Eg(x[D*4+3]+N[b*4+3],0,255)|0}o.putImageData(a,0,0)}}else Xo("gif资源未加载!无法播放!")})),this.dispose(this._gifDuration.changed.disposableOn(()=>{this.duration=this.gifDuration})),this._autoPlayOnLoad.value=n,this._gifFrames.value=i}get gifCanvas(){return this._gifCanvas}set gifFrames(t){this._gifFrames.value=t}get gifFrames(){return this._gifFrames.value}get gifFramesChanged(){return this._gifFrames.changed}get gifSize(){return this._gifSize.value}get gifSizeChanged(){return this._gifSize.changed}get gifDuration(){return this._gifDuration.value}get gifDurationChanged(){return this._gifDuration.changed}get autoPlayOnLoad(){return this._autoPlayOnLoad.value}set autoPlayOnLoad(t){this._autoPlayOnLoad.value=t}get autoPlayOnLoadChanged(){return this._autoPlayOnLoad.changed}_getFrame(t){const n=this._gifDurations.length;for(let i=0;i<n;++i)if(t<=this._gifDurations[i])return i;throw new Error("should not be here")}}class Sg extends V{constructor(t){super();d(this,"_player");d(this,"_url",this.disposeVar(j("")));d(this,"_loadGifFramesProcessing",this.disposeVar(zl(t=>ta(wg(t)))));this._player=this.disposeVar(new Cg(t)),this._player.autoPlayOnLoad=!0,this._loadGifFramesProcessing.completeFunc=({gifFrames:n})=>this._player.gifFrames=n,this.dispose(this._url.changed.disposableOn(n=>{this._player.gifFrames=void 0,this._loadGifFramesProcessing.restart(new Fr(`reload gif(${n})`),n)}))}get player(){return this._player}set url(t){this._url.value=t}get url(){return this._url.value}get loadedEvent(){return this._loadGifFramesProcessing.completeEvent}get size(){return this._player.gifSize}get sizeChanged(){return this._player.gifSizeChanged}get duration(){return this._player.gifDuration}get durationChanged(){return this._player.gifDurationChanged}}class bg extends V{constructor(t,n){super();d(this,"_gif",this.disposeVar(new Sg));d(this,"_update",this.disposeVar(ea(()=>this.update())));d(this,"_updateStart",this._update.start());this._complexImage=t,this._imageUri=n,this._gif.url=this._imageUri}get gif(){return this._gif}update(){const{player:t}=this._gif;if(!t.gifFrames)return;const n=this._complexImage,{width:i,height:s}=t.gifCanvas;n.size=[i,s],n.pixelFormat="RGBA",n.copyTexture({source:t.gifCanvas});{const o=()=>{t.autoPlayOnLoad=this._complexImage.autoplay};o(),this.dispose(this._complexImage.autoplayChanged.disposableOn(o))}{const o=()=>{t.loop=this._complexImage.loop};o(),this.dispose(this._complexImage.loopChanged.disposableOn(o))}}}function Pg(r,e){const[t,n,i]=zi(r),s=j(void 0),o=()=>{const a=t()??e;s.value=a&&rt.context.getStrFromEnv(a)};return o(),i&&s.d(i.don(o)),s.d(rt.context.environmentVariablesChanged.don(o)),s}function Ig(r){const e=/\${(.*?)\}/g;if(!e.test(r))return r;const t=r.replace(e,(n,i)=>{const s=rt.context.getEnv(i);return s===void 0?(console.warn(`环境变量(${i})不存在,无法进行转换`),"{env-error}"):s});return Ig(t)}class A0 extends V{constructor(t){super();d(this,"_sceneObjRefs",new Map);d(this,"_refs",{});d(this,"_refsChanged",this.dv(new O));const n=(i,s,o)=>{if(o){const a=this.getLastSceneObject(o),u=this._sceneObjRefs.get(o);if(!u)console.warn(`this._sceneObjRefs中不存在ref(${o}), 可能系统存在逻辑问题`);else{const c=u.indexOf(i);c===-1?console.warn(`this._sceneObjRefs中不存在当前对象(id: ${i.id} type: ${i.typeName})!可能系统存在逻辑问题`):(u.splice(c,1),u.length===0&&this._sceneObjRefs.delete(o))}const l=this.getLastSceneObject(o);this._refs[o]=l,this._refsChanged.emit(l,a)}if(s){const a=this.getLastSceneObject(s),u=this._sceneObjRefs.get(s);u?(u.push(i),u.length>0&&console.warn(`同时存在多个ref${s}相同的场景对象!
22
22
  ${u.map(c=>`${c.id} ${c.typeName}
23
- `).join(" ")}`)):this._sceneObjRefs.set(s,[i]);const l=this.getLastSceneObject(s);this._refs[s]=l,this._refsChanged.emit(l,a)}};this.d(t.sceneObjCreatedEvent.don(i=>{const s=(o,a)=>n(i,o,a);i.ref&&s(i.ref,void 0),i.refChanged.don(s)})),this.d(t.sceneObjToDestroyEvent.don(i=>{i.ref&&n(i,void 0,i.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(t){const n=this.getSceneObjects(t);if(n)return n[n.length-1]}getSceneObjects(t){const n=this._sceneObjRefs.get(t);if(!(!n||n.length===0))return n}}class A0 extends V{constructor(){super();d(this,"_esObjConstructors",new Map);d(this,"_sceneObjs",new Map);d(this,"_sceneObjCreatedEvent",new O);d(this,"_sceneObjToDestroyEvent",new O);d(this,"_refsManager",this.dv(new F0(this)));d(this,"_environmentVariables",globalThis.ESSDK_ENV||{});d(this,"_environmentVariablesChanged",this.dv(new O))}get typeNames(){return this._esObjConstructors.keys()}get sceneObjs(){return this._sceneObjs.values()}get sceneObjCreatedEvent(){return this._sceneObjCreatedEvent}get sceneObjToDestroyEvent(){return this._sceneObjToDestroyEvent}get refsManager(){return this._refsManager}get $refs(){return this._refsManager.refs}register(t,n,i){return this._esObjConstructors.has(t)&&console.warn(`register warn: ${t} has registered ! will be override!`),this._esObjConstructors.set(t,n),i&&fi(n,"__sceneObjExtraInfo",i),t}_addSceneObject(t){this._sceneObjs.set(t.id,t),this._sceneObjCreatedEvent.emit(t),t.d(()=>this._deleteSceneObject(t))}addSceneObject(t){this._addSceneObject(t)}_deleteSceneObject(t){this._sceneObjToDestroyEvent.emit(t),this._sceneObjs.delete(t.id)}deleteSceneObject(t){this._deleteSceneObject(t)}createSceneObjectFromClass(t,n){if(!n||this._sceneObjs.has(n)){const s=Jo();n&&console.warn(`已存在相同id的对象!id自动变更!${n} -> ${s} 请注意:id变更可能导致引用失效!`),n=s}if(!n)throw new Error("id不能为空!");const i=new t(n);return i.id!==n&&(console.warn(`sceneObj.id(${i.id}) !== id(${n}) sceneObjectType: ${i.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(i),i}createSceneObject(t,n){if(typeof t=="string"){const i=this._getSceneObjConstructor(t);if(!i){console.warn(`Cannot find SceneObjectType: ${t}`);return}return this.createSceneObjectFromClass(i,n)}else return this.createSceneObjectFromClass(t,n)}createSceneObjectFromUrl(t,n){let i;const s=t.toLowerCase();if(s.includes(".gltf")||s.includes(".glb")?i="ESGltfModel":s.includes("tileset.json")?i="ES3DTileset":s.includes("layer.json")||s.includes("ion://1")?i="ESTerrainLayer":s.includes(".jpg")||s.includes(".png")||s.includes(".jpeg")||s.includes(".webp")||s.includes("image/jpg")||s.includes("image/png")||s.includes("image/jpeg")||s.includes("image/webp")?i="ESImageLabel":(s.includes("/tilemapresource.xml")||s.includes("ion://")||s.includes("wms")||s.includes("wmts")||s.includes("{x}")||s.includes("{y}")||s.includes("{z}"))&&(i="ESImageryLayer"),!!i)return this.createSceneObjectFromJson({type:i,id:n,url:t})}createSceneObjectFromJson(t){const n=this.createSceneObject(t.type,t.id);return n&&(n.json=t),n}destroySceneObject(t){return this._deleteSceneObject(t),t.destroy(),t.isDestroyed()}getSceneObjectById(t){return this._sceneObjs.get(t)}getSceneObject(t){if(!t&&t!="")return Array.from(this._sceneObjs.values());if(t.startsWith("ES")){const n=[];for(const i of this._sceneObjs.values())i.typeName===t&&n.push(i);return n}else return this._sceneObjs.get(t)}_getSceneObjConstructor(t){const n=this._esObjConstructors.get(t);if(n)return n}getProps(t){const n=this._getSceneObjConstructor(t);if(!n){console.warn(`cannot get constructor from type: ${t}`);return}return Xn(n,"__sceneObjExtraInfo")}setProps(t,n){const i=this._getSceneObjConstructor(t);if(!i){console.warn(`cannot get constructor from type: ${t}`);return}let s=Xn(i,"__sceneObjExtraInfo");s||(s={},fi(i,"__sceneObjExtraInfo",s)),Object.assign(s,n)}getProp(t,n){const i=this.getProps(t);return i&&i[n]}setProp(t,n,i){this.setProps(t,{[n]:i})}get environmentVariables(){return this._environmentVariables}set environmentVariables(t){for(let[n,i]of Object.entries(t))this.setEnv(n,i)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(t,n){if(this._environmentVariables[t]!==n){const i=this._environmentVariables[t];this._environmentVariables[t]=n,this._environmentVariablesChanged.emit(t,n,i)}globalThis.ESSDK_ENV={...this._environmentVariables}}getEnv(t){return this._environmentVariables[t]}getStrFromEnv(t){return Ig(t)}createEnvStrReact(t,n){return Pg(t,n)}createEvnStrReact(t,n){return Pg(t,n)}}const _t=class _t extends V{constructor(t){super();d(this,"_components",this.dv(new Wl));d(this,"_viewerAttached",this.dv(new O));d(this,"_viewerDetached",this.dv(new O));d(this,"_attachedViewers",(()=>{const t=new Set;return this.d(this._viewerAttached.don(n=>{n.actived&&(this.activeViewer=n),n.ad(n.activedChanged.don(i=>{i&&t.has(n)&&(this.activeViewer=n)})),t.add(n)})),this.d(this._viewerDetached.don(n=>{t.delete(n),this.activeViewer==n&&(this.activeViewer=void 0)})),t})());d(this,"_activeViewer",this.disposeVar(j(void 0)));d(this,"_createdEvent",this.dv(new O));d(this,"_flushEvent",this.dv(new O));d(this,"_id");d(this,"_updateFuncReact",this.dv(j(void 0)));d(this,"_toDestroyFuncReact",this.dv(j(void 0)));d(this,"_parentID");t!==void 0&&(typeof t!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof t},值为${t}`):t.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):t.trim()!==t&&console.warn(`id前后有空字符串!id: ${t}`)),this._id=t??Jo(),this._initName();{const n=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(i){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`)}};n(),this.d(this.execOnceFuncStrChanged.don(n))}{const n=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(s){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};n(),this.d(this.updateFuncStrChanged.don(n));let i;this.d(()=>i&&i.destroy()),this.d(this.updateFuncChanged.don(()=>{i&&i.cancel(),this.updateFunc&&(i=i||Ou(),i.restart(void 0,s=>{this.updateFunc&&this.updateFunc(this,s)}))}))}{const n=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(i){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`),this.toDestroyFunc=void 0}};n(),this.d(this.toDestroyFuncStrChanged.don(n)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static getParentClass(){return Object.getPrototypeOf(this)}static register(t,n,i){Gi(n.prototype,n.createDefaultProps);const s=n.createDefaultProps();n.defaults&&(n.defaults={});for(const o of Object.keys(s))n.defaults[o]=s[o]instanceof ze?s[o].value:s[o];return this.innerRegister(t,n,i),t}static get envs(){return _t.context.environmentVariables}static get $refs(){return _t.context.refsManager.refs}get components(){return this._components}get viewerAttached(){return this._viewerAttached}get viewerDetached(){return this._viewerDetached}get attachedViewers(){return this._attachedViewers}get activeViewer(){return this._activeViewer.value}set activeViewer(t){this._activeViewer.value=t}get activeViewerChanged(){return this._activeViewer.changed}removefromViewer(t){this.attachedViewers.has(t)&&t.delete(this)}addToViewer(t){this.attachedViewers.has(t)||t.add(this)}registerAttachedObject(t){const n=new Map;this.d(()=>{n.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(i=>{const s=t(i);s&&n.set(i,s)})),this.d(this._viewerDetached.don(i=>{if(!n.has(i))return;const s=n.get(i);s&&(s.destroy(),n.delete(i))}))}createAttachedObject(t){const n=new Map,i=()=>{for(let[u,l]of n.entries())l.destroy();n.clear()},s=u=>{const l=t(u);l&&n.set(u,l)};for(let u of this.attachedViewers)s(u);const o=this._viewerAttached.don(s),a=this._viewerDetached.don(u=>{if(!n.has(u))return;const l=n.get(u);l&&(l.destroy(),n.delete(u))});return()=>{a(),o(),i()}}registerAttachedObjectForContainer(t){this.registerAttachedObject(n=>new k0(n,t))}get createdEvent(){return this._createdEvent}get flushEvent(){return this._flushEvent}flush(){this.flushEvent.emit()}get id(){return this._id}get typeName(){return this.constructor.type}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return this.constructor.createDefaultProps()}_innerGetJson(t=!0){const n={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(t){let s,o=this.defaultProps[i];o instanceof ze?s=o.equals(this[i]):s=o===this[i],s||(n[i]=this[i])}else n[i]=this[i];return n}_innerSetJson(t,n,i){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in t)this[a]=t[a]===null?void 0:t[a];else if(!(i??!1)){let u=this.defaultProps[a];u instanceof ze&&(u=u.value),this[a]=u}}get completeJson(){return this._innerGetJson(!1)}get json(){return this._innerGetJson()}set json(t){this._innerSetJson(t)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(t){this._innerSetJson(JSON.parse(t))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID??this.id}set parentID(t){this._parentID=t}getProperties(t){const n={...this.getESProperties()},i=[];return n.general.length>0&&i.push(new ut(n.general,"general")),Object.keys(n).forEach(s=>{s!=="defaultMenu"&&s!=="general"&&n[s].length>0&&i.push(new ut(n[s],s))}),i}getESProperties(){return{defaultMenu:"general",basic:[],general:[new pt([this,"typeName"],"类型",void 0,!1,!0),new pt([this,"id"],"唯一标识",void 0,!1,!0),new pt([this,"name"],"名称")],dataSource:[],location:[],coordinate:[],style:[],more:[new pt([this,"ref"],"ref",void 0,!0),new it([this,"extras"],"extras",void 0,void 0,!0),new Dg(()=>this._jsonStr,t=>t&&(this._jsonStr=t),"JSON")]}}};d(_t,"context",new A0),d(_t,"innerRegister",_t.context.register.bind(_t.context)),d(_t,"defaults",{}),d(_t,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:wt(void 0),devTags:re(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),d(_t,"type",_t.register("ESSceneObject",_t,{chsName:"场景类",tags:["ESObjects"],description:""})),d(_t,"create",_t.context.createSceneObject.bind(_t.context)),d(_t,"createFromUrl",_t.context.createSceneObjectFromUrl.bind(_t.context)),d(_t,"createFromClass",_t.context.createSceneObjectFromClass.bind(_t.context)),d(_t,"createFromJson",_t.context.createSceneObjectFromJson.bind(_t.context)),d(_t,"destroySceneObject",_t.context.destroySceneObject.bind(_t.context)),d(_t,"getSceneObjById",_t.context.getSceneObjectById.bind(_t.context)),d(_t,"getSceneObj",_t.context.getSceneObject.bind(_t.context)),d(_t,"getEnv",_t.context.getEnv.bind(_t.context)),d(_t,"setEnv",_t.context.setEnv.bind(_t.context)),d(_t,"getStrFromEnv",_t.context.getStrFromEnv.bind(_t.context)),d(_t,"getSceneObjectById",_t.context.getSceneObjectById.bind(_t.context)),d(_t,"getSceneObject",_t.context.getSceneObject.bind(_t.context));let rt=_t;class k0 extends V{constructor(e,t){super(),this.dv(new Ee(e.subContainerChanged,()=>{if(e.subContainer)return t(e,e.subContainer)}))}}const eh=class eh extends V{constructor(t,n){super();d(this,"_id",++eh._accumId);this._name=t,this._description=n}get id(){return this._id}get name(){return this._name}get description(){return this._description}};d(eh,"_accumId",-1);let ws=eh;class Bh extends ws{constructor(e,t,n,i,s){super(e,t),this._withUndefined=n,this._readonly=i,this._defaultValue=s}get withUndefined(){return this._withUndefined}get readonly(){return this._readonly}get defaultValue(){return this._defaultValue instanceof Function?this._defaultValue():this._defaultValue}}class Tt extends Bh{constructor(e,t,n,i,s,o){const a=e instanceof ze?"未获取到属性名":e[1].toString();super(t??a,o??a,i??!1,s??!1,n),this._reactVar=e}get reactVar(){return this._reactVar}}class X extends Tt{get type(){return"BooleanProperty"}}class pt extends Tt{get type(){return"StringProperty"}}class M extends Tt{get type(){return"NumberProperty"}}class V0 extends Tt{get type(){return"MaximumScreenSpaceErrorProperty"}}class xg extends Tt{get type(){return"StringsProperty"}}class j0 extends Tt{get type(){return"NumbersProperty"}}class B0 extends Tt{get type(){return"BooleansProperty"}}class z0 extends Tt{get type(){return"String2Property"}}class U0 extends Tt{get type(){return"String3Property"}}class G0 extends Tt{get type(){return"String4Property"}}class Tg extends Tt{get type(){return"String2sProperty"}}class W0 extends Tt{get type(){return"String3sProperty"}}class H0 extends Tt{get type(){return"String4sProperty"}}class Ae extends Tt{get type(){return"Number2Property"}}class cn extends Tt{get type(){return"Number3Property"}}class Ar extends Tt{get type(){return"Number4Property"}}class q0 extends Tt{get type(){return"Number4WithUndefinedProperty"}}class Og extends Tt{get type(){return"Number2sProperty"}}class zh extends Tt{get type(){return"Number3sProperty"}}class X0 extends Tt{get type(){return"Number4sProperty"}}class Y0 extends Tt{get type(){return"Boolean2Property"}}class J0 extends Tt{get type(){return"Boolean3Property"}}class $0 extends Tt{get type(){return"Boolean4Property"}}class K0 extends Tt{get type(){return"Boolean2sProperty"}}class Z0 extends Tt{get type(){return"Boolean3sProperty"}}class Q0 extends Tt{get type(){return"Boolean4sProperty"}}class tw extends Tt{get type(){return"StringNumberProperty"}}class ew extends Tt{get type(){return"StringNumbersProperty"}}class Mt extends Ar{get type(){return"ColorProperty"}}class nw extends cn{get type(){return"ColorRgbProperty"}}class rw extends M{get type(){return"DashPatternProperty"}}class Pt extends Tt{constructor(e,t,n,i,s,o,a){super(e,n,i,s,o,a),this._enums=t}get type(){return"EnumProperty"}get enums(){return this._enums}}class iw extends Tt{constructor(e,t,n,i,s,o,a){super(e,n,i,s,o,a),this._enums=t}get type(){return"EnumStringsProperty"}get enums(){return this._enums}}class Es extends Tt{constructor(e,t,n,i,s,o,a){super(e,t,n,s,o,a),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"EvalStringProperty"}}class Ng extends Tt{constructor(e,t,n,i,s){super(e,t,i,!1,!1,s),this._paramTypes=n}get type(){return"ParamsProperty"}get paramTypes(){return this._paramTypes}}class lt extends ws{constructor(t,n,i,s,o){const a=s??"Unnamed Function";super(a,o??a);d(this,"_paramsProperty");d(this,"_getValueFunc");this._func=n;const u=this.disposeVar(wt(i));this._paramsProperty=this.disposeVar(new Ng(u,a+"_params",t,i));const[l]=zi(this._paramsProperty.reactVar);this._getValueFunc=l}get paramsProperty(){return this._paramsProperty}exec(){this._func(...this._getValueFunc())}get type(){return"FunctionProperty"}}class ut extends ws{constructor(e,t,n){const i=t??"分组";super(i,n??i),this._children=e}get type(){return"GroupProperty"}get children(){return this._children}}class it extends Tt{constructor(e,t,n,i,s,o,a){super(e,t,n,s,o,a),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"JsonProperty"}}class Uh extends Tt{constructor(e,t,n,i,s,o,a){super(e,t,n,s,o,a),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"LongStringProperty"}}class sw extends Ae{get type(){return"MinmaxProperty"}}class ow extends Ar{get type(){return"NearFarScalerProperty"}}class Dg extends Bh{constructor(e,t,n,i,s,o,a){const u=n??"非响应式Json";super(u,a??u,s??!1,o??!1,i),this._getJsonStringFunc=e,this._setJsonStringFunc=t}get type(){return"NonreactiveJsonStringProperty"}get getJsonStringFunc(){return this._getJsonStringFunc}get setJsonStringFunc(){return this._setJsonStringFunc}}class aw extends Ae{get type(){return"NumberRangeProperty"}}class Ue extends Tt{constructor(e,t,n,i,s,o,a,u){super(e,i,s,o,a,u),this._step=t,this._minMax=n}get type(){return"NumberSliderProperty"}get minMax(){return this._minMax}get step(){return this._step}}function uw(r,e){const[t,n,i]=zi(r),[s,o,a]=zi(e),u=j((t()??0)/(s()??3e3)),l=()=>{const c=u.value,h=s()??3e3,f=t()??0;if(!Number.isFinite(h)||!Number.isFinite(f)){console.warn(`duration || currentTime error: duration: ${h} currentTime: ${f}`);return}Math.abs(c*h-f)<.001||(h<=0?u.value=0:u.value=f/h)};return u.dispose(i.disposableOn(l)),u.dispose(a.disposableOn(l)),u.dispose(u.changed.disposableOn(()=>{const c=u.value,h=s()??3e3,f=t()??0;if(!Number.isFinite(h)||!Number.isFinite(f)){console.warn(`duration || currentTime error: duration: ${h} currentTime: ${f}`);return}Math.abs(c*h-f)<.001||n(c*h)})),u}class Hl extends ws{constructor(t,n,i,s,o,a){super(s??"播放器",a??"播放器");d(this,"_defaults",{playing:!1,ratio:0,loop:!1});this._playingReact=t,this._ratioReact=n,this._loopReact=i,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.ratio=o.ratio??this._defaults.ratio,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"PlayerProperty"}get playingReact(){return this._playingReact}get ratioReact(){return this._ratioReact}get loopReact(){return this._loopReact}get defaults(){return this._defaults}}d(Hl,"createPlayingRatio",uw);class ia extends cn{get type(){return"PositionProperty"}}class Mg extends Tt{get type(){return"PositionsProperty"}}class lw extends Tt{get type(){return"PositionsSetPropety"}}class Gh extends cn{get type(){return"RotationProperty"}}class Fu extends pt{get type(){return"UriProperty"}}class Rg extends ws{constructor(t,n,i,s,o,a){const u=s??"视角播放器";super(u,a??u);d(this,"_defaults",{playing:!1,loop:!1});this._playingReact=t,this._stopFn=n,this._loopReact=i,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"ViewPlayerProperty"}get playingReact(){return this._playingReact}get loopReact(){return this._loopReact}get stopFn(){return this._stopFn}get defaults(){return this._defaults}}class Lg extends Tt{get type(){return"DatesProperty"}}class io extends Tt{get type(){return"DateProperty"}}var et=(r=>(r.Place="place",r.Translation="translation",r.Rotation="rotation",r.Scale="scale",r.DoublePointsAppend="doublePointsAppend",r.DoublePointsModify="doublePointsModify",r.CircularAppend="circularAppend",r.CircularInsert="circularInsert",r.LineStringAppend="lineStringAppend",r.LineStringInsert="lineStringInsert",r.ScatterAppend="scatterAppend",r.ScatterModify="scatterModify",r.VisibilityAppend="visibilityAppend",r.VisibilityModify="visibilityModify",r.HeightModify="heightModify",r))(et||{}),Fg=(r=>(r.DECIMAL_DEGREE="DECIMAL_DEGREE",r.DEGREES_DECIMAL_MINUTES="DEGREES_DECIMAL_MINUTES",r.SEXAGESIMAL_DEGREE="SEXAGESIMAL_DEGREE",r))(Fg||{});class cw{constructor(e){this.childPickedInfo=e}}class hw{constructor(e,t,n,i,s,o){this.pickResult=e,this.sceneObject=t,this.tilesetPickInfo=n,this.geojsonPickInfo=i,this.attachedInfo=s,this.screenPosition=o}assign(e){e!=null&&e.pickedResult&&(this.pickResult=e.pickedResult),e!=null&&e.sceneObject&&(this.sceneObject=e.sceneObject),e!=null&&e.tilesetPickInfo&&(this.tilesetPickInfo=e.tilesetPickInfo),e!=null&&e.geojsonPickInfo&&(this.geojsonPickInfo=e.geojsonPickInfo),e!=null&&e.attachedInfo&&(this.attachedInfo=e.attachedInfo),e!=null&&e.screenPosition&&(this.screenPosition=e.screenPosition)}}const _e=class _e extends rt{constructor(t){super(t);d(this,"_editing",this.dv(j(!1)));d(this,"editingID");d(this,"editingBindMode","singlePoint");d(this,"_deprecated",[]);d(this,"_flyInEvent",this.dv(new O));d(this,"_flyToEvent",this.dv(new O));d(this,"_flyOverEvent",this.disposeVar(new O));d(this,"_pickedEvent",this.dv(new O));d(this,"_calcFlyToParamEvent",this.dv(new O));d(this,"_calcFlyInParamEvent",this.dv(new O));d(this,"useCalcFlyToParamInESObjectWithLocation",!1);Bg(this,this.updateEditing)}supportEditingModes(){return this.constructor.supportEditingModes}get editing(){return this._editing.value}set editing(t){this._editing.value=t}get editingChanged(){return this._editing.changed}updateEditing(){}_deprecatedWarning(){const t=this._deprecated;for(let n=0;n<t.length;n++){const i=t[n];typeof i=="string"?Reflect.has(this,i+"Changed")&&this.d(this[i+"Changed"].don(()=>{console.warn(`注意:${this.typeName} 的 ${i} 属性下版本将会被移除!`)})):Object.keys(i).forEach(s=>{Reflect.has(this,s+"Changed")&&this.d(this[s+"Changed"].don(a=>{const u=i[s];typeof u=="string"?console.warn(`注意:${this.typeName} 的 ${s} 属性下版本将会被移除!`):Object.keys(u).forEach(l=>{a===l&&console.warn(`注意:${this.typeName} 的 ${s} 属性值 ${l} 下版本将会被移除,推荐使用属性值 ${u[l]}`)})}))})}}get flyInEvent(){return this._flyInEvent}flyIn(t=1){this._flyInEvent.emit(t,_e._lastFlyInId)}get flyToEvent(){return this._flyToEvent}flyTo(t=1){this._flyToEvent.emit(t,_e._lastFlyToId)}get flyOverEvent(){return this._flyOverEvent}get pickedEvent(){return this._pickedEvent}get calcFlyToParamEvent(){return this._calcFlyToParamEvent}calcFlyToParam(){this._calcFlyToParamEvent.emit()}get calcFlyInParamEvent(){return this._calcFlyInParamEvent}calcFlyInParam(){this._calcFlyInParamEvent.emit()}emptyFlyToParam(){this.flyToParam=void 0}emptyFlyInParam(){this.flyInParam=void 0}async getBoundSphere(t){return await t.getBoundSphere(this.id)}getESProperties(){const t={...super.getESProperties()};return{...t,general:[...t.general,new X([this,"show"],"是否显示",_e.defaults.show),new X([this,"collision"],"开启碰撞",_e.defaults.collision),new X([this,"allowPicking"],"允许拾取",_e.defaults.allowPicking),new lt([],()=>this.calcFlyToParam(),[],"保存观察视角","保存当前flyToParam"),new lt([],()=>this.emptyFlyToParam(),[],"清空飞向参数","清空飞向参数"),new lt([],()=>this.emptyFlyInParam(),[],"清空飞入参数","清空飞入参数"),new lt([],()=>this.calcFlyInParam(),[],"保存飞入参数","保存飞入参数flyInParam")],more:[...t.more,new ut([],"飞行定位","飞向参数"),new lt(["number"],n=>this.flyTo(n),[1],"飞向"),new it([this,"flyToParam"],"flyToParam",void 0,void 0,!0),new M([this,"flyToDistance"],"flyToDistance",void 0,!0),new M([this,"flyToHeading"],"flyToHeading",void 0,!0),new M([this,"flyToPitch"],"flyToPitch",void 0,!0),new M([this,"flyToFlyDuration"],"flyToFlyDuration",void 0,!0),new M([this,"flyToHDelta"],"flyToHDelta",void 0,!0),new M([this,"flyToPDelta"],"flyToPDelta",void 0,!0),new ut([],"飞入参数"),new lt(["number"],n=>this.flyIn(n),[1],"飞入"),new it([this,"flyInParam"],"flyInParam",void 0,void 0,!0)]}}get flyToDistance(){return this.flyToParam&&this.flyToParam.distance}get flyToHeading(){return this.flyToParam&&this.flyToParam.heading}get flyToPitch(){return this.flyToParam&&this.flyToParam.pitch}get flyToFlyDuration(){return this.flyToParam&&this.flyToParam.flyDuration}get flyToHDelta(){return this.flyToParam&&this.flyToParam.hDelta}get flyToPDelta(){return this.flyToParam&&this.flyToParam.pDelta}get flyToDistanceChanged(){return this.flyToParamChanged}get flyToHeadingChanged(){return this.flyToParamChanged}get flyToPitchChanged(){return this.flyToParamChanged}get flyToFlyDurationChanged(){return this.flyToParamChanged}get flyToHDeltaChanged(){return this.flyToParamChanged}get flyToPDeltaChanged(){return this.flyToParamChanged}set flyToDistance(t){this.flyToParam=t!==void 0?{...this.flyToParam??_e.defaultFlyToParam,distance:t}:void 0}set flyToHeading(t){this.flyToParam=t!==void 0?{...this.flyToParam??_e.defaultFlyToParam,heading:t}:void 0}set flyToPitch(t){this.flyToParam=t!==void 0?{...this.flyToParam??_e.defaultFlyToParam,pitch:t}:void 0}set flyToFlyDuration(t){this.flyToParam=t!==void 0?{...this.flyToParam??_e.defaultFlyToParam,flyDuration:t}:void 0}set flyToHDelta(t){this.flyToParam=t!==void 0?{...this.flyToParam??_e.defaultFlyToParam,hDelta:t}:void 0}set flyToPDelta(t){this.flyToParam=t!==void 0?{...this.flyToParam??_e.defaultFlyToParam,pDelta:t}:void 0}};d(_e,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,collision:!0,allowPicking:!1,flyToParam:Qt(void 0),flyInParam:Qt(void 0)})),d(_e,"type",_e.register("ESVisualObject",_e,{chsName:"可视化对象",tags:["ESObjects"],description:"可视化对象"})),d(_e,"supportEditingModes",[]),d(_e,"defaultFlyToParam",{distance:0,heading:0,pitch:0,flyDuration:1,hDelta:0,pDelta:0}),d(_e,"defaultFlyInParam",{position:[0,0,0],rotation:[0,0,0],flyDuration:1}),d(_e,"_lastFlyInId",0),d(_e,"_lastFlyToId",0);let Ht=_e;class Ag extends V{constructor(){super();d(this,"_data",this.dv(j(void 0)))}set data(t){this._data.value=t}get data(){return this._data.value}get dataChanged(){return this._data.changed}}class kg extends V{constructor(){super(...arguments);d(this,"_dragStartEvent",this.dv(new O));d(this,"_dragOverEvent",this.dv(new O));d(this,"_dragLeaveEvent",this.dv(new O));d(this,"_dropEvent",this.dv(new O))}dragStart(t){this._dragStartEvent.emit(t)}dragOver(t){this._dragOverEvent.emit(t)}dragLeave(t){this._dragLeaveEvent.emit(t)}drop(t){this._dropEvent.emit(t)}}function dw(r,e){e&&(Reflect.has(e,"editing")?e.editing=!0:Reflect.has(e,"positionEditing")&&(e.positionEditing=!0))}function fw(r){["Czm3DTiles","View","ESCameraView","OlView","GeoCameraController"].includes(r.typeName)||(Reflect.has(r,"editing")?r.editing=!0:Reflect.has(r,"positionEditing")&&(r.positionEditing=!0)),typeof r.execOnCreating=="function"&&r.execOnCreating()}function ql(r,e){Xn(r,"__treeItem")&&console.error("setSceneObjectTreeItem error!"),fi(r,"__treeItem",e)}function pw(r){return Xn(r,"__treeItem")}function gw(r){if(!(r.startsWith("./")||r.startsWith("../")||r.startsWith("/")))return r;const e=document.createElement("a");e.href=r;const t=e.href;return e.remove(),t}function Wh(r){if(typeof r!="string")return!1;try{const e=JSON.parse(r);return typeof e=="object"&&e!==null}catch{return!1}}function mw(r){try{return new DOMParser().parseFromString(r,"application/xml").getElementsByTagName("parsererror").length===0}catch{return!1}}function vw(r){return r instanceof Function?r():r}function Vg(r,e){for(let t of r)if(e.includes(t))return!0;return!1}function qi(r,e){const t=r,n=e;return t===void 0||t.length===0||n===void 0||n.length===0?!0:Vg(t,n)}function yw(r){const e=setTimeout(()=>{r(),clearTimeout(e)})}function sa(r){let e=r%360;return e=e<0?360+e:e,e}function jg(r){return sa(r+180)-180}function Xl(r,e,t){let n=sa(r),i=sa(e);Math.abs(n-i)>180&&(n<i?n+=360:i+=360);const s=n*(1-t)+i*t;return jg(s)}function Hh(r,e,t,n){return n=n||[0,0,0],n[0]=Xl(r[0],e[0],t),n[1]=Xl(r[1],e[1],t),n[2]=Xl(r[2],e[2],t),n}function Bg(r,e,t="editing"){const n=new V;r.ad(n);const i=e.bind(r);return n.ad(new Ee(r.activeViewerChanged,()=>{const s=new V;let o=r.activeViewer;return o?(s.ad(r[`${t}Changed`].don(()=>{var a;r[`${t}`]?i():(a=(r.components.main??r).editingID)!=null&&a.includes("inner")&&r.activeViewer&&r.activeViewer.stopEditing()})),s.ad(o.editingEvent.don(a=>{if(a.objectIDs.includes(r.id)&&a.type==="end"){const u=r.components.main??r;u.editingID&&a.editingID.includes(u.editingID)?r[`${t}`]=!1:r[`${t}`]=!u.editingID.includes("outer")}}))):s.ad(r[`${t}Changed`].don(()=>{r[`${t}`]=!1})),s})),r[`${t}`]&&i(),n}function _w(r){var t;const e=((t=r.type)==null?void 0:t.toLowerCase())??"";switch(e){case"geometrycollection":return ww(r);case"topology":const n=r.objects,i=[];for(const s in n){const o=$y.feature(r,n[s]);i.push(...o.features)}return{type:"FeatureCollection",features:i};case"feature":return{type:"FeatureCollection",features:[r]};case"featurecollection":return r;case"":default:return console.warn(`GeoJson数据转换可能有误,数据类型${e}`),{type:"FeatureCollection",features:Array.isArray(r.features)?r.features:[]}}}function ww(r,e){const t=[],n=r.geometries||[];function i(s,o={}){!s||!s.type||(s.type==="GeometryCollection"&&Array.isArray(s.geometries)?s.geometries.forEach(a=>i(a,o)):t.push({type:"Feature",geometry:s,properties:{...s.properties||{},...o}}))}return n.forEach(s=>i(s,{})),{type:"FeatureCollection",features:t}}function Ew(r){const e=r.cloneNode(!0);e.style.position="fixed",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.top="0",e.style.left="0",e.style.display="inline-block",document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{x:t.x,y:t.y,width:t.width,height:t.height}}class qh extends V{constructor(t){super();d(this,"_sceneObject",this.dv(j(void 0)));this._id=t,this.d(()=>{this._sceneObject.value=void 0});const n=rt.getSceneObjById(this._id);n&&(this._sceneObject.value=n),this.d(rt.context.sceneObjCreatedEvent.don(i=>{i.id===this._id&&(this._sceneObject.value=i)})),this.d(rt.context.sceneObjToDestroyEvent.don(i=>{i.id===this._id&&(this._sceneObject.value=void 0)}))}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}get id(){return this._id}}class Cw extends V{constructor(t,n){super();d(this,"_sofi");this._id=t,this._sofi=this.dv(new qh(this._id));{const i=()=>{n.sceneObject=this._sofi.sceneObject};i(),this.d(this._sofi.sceneObjectChanged.don(i))}}}class zg extends V{constructor(){super();d(this,"_id",this.dv(j(void 0)));d(this,"_sceneObject",this.dv(j(void 0)));d(this,"_resetting",this.dv(new Ee(this.idChanged,()=>{const{id:t}=this;if(t===void 0||t===""){this.sceneObject=void 0;return}return new Cw(t,this)})))}get id(){return this._id.value}get idChanged(){return this._id.changed}set id(t){this._id.value=t}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}set sceneObject(t){this._sceneObject.value=t}get resetting(){return this._resetting}}class Sw extends V{constructor(t,n,i,s){super();d(this,"_sceneObjectId",this.dv(new zg));this._id=t,this._startTimeStamp=n,this._duration=i,this._parent=s,this._sceneObjectId.id=this._id;const o=()=>{if(!this.player)return;const{currentTime:a=0}=this._parent,u=a-this._startTimeStamp;this.player.currentTime=jl(u,0,this._duration)*(this.player.speed??1)};o(),this.d(this._parent.currentTimeChanged.don(o)),this.d(this.playerChanged.don(o))}get player(){return this._sceneObjectId.sceneObject instanceof kr?this._sceneObjectId.sceneObject:void 0}get playerChanged(){return this._sceneObjectId.sceneObjectChanged}}const bw=`
23
+ `).join(" ")}`)):this._sceneObjRefs.set(s,[i]);const l=this.getLastSceneObject(s);this._refs[s]=l,this._refsChanged.emit(l,a)}};this.d(t.sceneObjCreatedEvent.don(i=>{const s=(o,a)=>n(i,o,a);i.ref&&s(i.ref,void 0),i.refChanged.don(s)})),this.d(t.sceneObjToDestroyEvent.don(i=>{i.ref&&n(i,void 0,i.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(t){const n=this.getSceneObjects(t);if(n)return n[n.length-1]}getSceneObjects(t){const n=this._sceneObjRefs.get(t);if(!(!n||n.length===0))return n}}class k0 extends V{constructor(){super();d(this,"_esObjConstructors",new Map);d(this,"_sceneObjs",new Map);d(this,"_sceneObjCreatedEvent",new O);d(this,"_sceneObjToDestroyEvent",new O);d(this,"_refsManager",this.dv(new A0(this)));d(this,"_environmentVariables",globalThis.ESSDK_ENV||{});d(this,"_environmentVariablesChanged",this.dv(new O))}get typeNames(){return this._esObjConstructors.keys()}get sceneObjs(){return this._sceneObjs.values()}get sceneObjCreatedEvent(){return this._sceneObjCreatedEvent}get sceneObjToDestroyEvent(){return this._sceneObjToDestroyEvent}get refsManager(){return this._refsManager}get $refs(){return this._refsManager.refs}register(t,n,i){return this._esObjConstructors.has(t)&&console.warn(`register warn: ${t} has registered ! will be override!`),this._esObjConstructors.set(t,n),i&&fi(n,"__sceneObjExtraInfo",i),t}_addSceneObject(t){this._sceneObjs.set(t.id,t),this._sceneObjCreatedEvent.emit(t),t.d(()=>this._deleteSceneObject(t))}addSceneObject(t){this._addSceneObject(t)}_deleteSceneObject(t){this._sceneObjToDestroyEvent.emit(t),this._sceneObjs.delete(t.id)}deleteSceneObject(t){this._deleteSceneObject(t)}createSceneObjectFromClass(t,n){if(!n||this._sceneObjs.has(n)){const s=Jo();n&&console.warn(`已存在相同id的对象!id自动变更!${n} -> ${s} 请注意:id变更可能导致引用失效!`),n=s}if(!n)throw new Error("id不能为空!");const i=new t(n);return i.id!==n&&(console.warn(`sceneObj.id(${i.id}) !== id(${n}) sceneObjectType: ${i.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(i),i}createSceneObject(t,n){if(typeof t=="string"){const i=this._getSceneObjConstructor(t);if(!i){console.warn(`Cannot find SceneObjectType: ${t}`);return}return this.createSceneObjectFromClass(i,n)}else return this.createSceneObjectFromClass(t,n)}createSceneObjectFromUrl(t,n){let i;const s=t.toLowerCase();if(s.includes(".gltf")||s.includes(".glb")?i="ESGltfModel":s.includes("tileset.json")?i="ES3DTileset":s.includes("layer.json")||s.includes("ion://1")?i="ESTerrainLayer":s.includes(".jpg")||s.includes(".png")||s.includes(".jpeg")||s.includes(".webp")||s.includes("image/jpg")||s.includes("image/png")||s.includes("image/jpeg")||s.includes("image/webp")?i="ESImageLabel":(s.includes("/tilemapresource.xml")||s.includes("ion://")||s.includes("wms")||s.includes("wmts")||s.includes("{x}")||s.includes("{y}")||s.includes("{z}"))&&(i="ESImageryLayer"),!!i)return this.createSceneObjectFromJson({type:i,id:n,url:t})}createSceneObjectFromJson(t){const n=this.createSceneObject(t.type,t.id);return n&&(n.json=t),n}destroySceneObject(t){return this._deleteSceneObject(t),t.destroy(),t.isDestroyed()}getSceneObjectById(t){return this._sceneObjs.get(t)}getSceneObject(t){if(!t&&t!="")return Array.from(this._sceneObjs.values());if(t.startsWith("ES")){const n=[];for(const i of this._sceneObjs.values())i.typeName===t&&n.push(i);return n}else return this._sceneObjs.get(t)}_getSceneObjConstructor(t){const n=this._esObjConstructors.get(t);if(n)return n}getProps(t){const n=this._getSceneObjConstructor(t);if(!n){console.warn(`cannot get constructor from type: ${t}`);return}return Xn(n,"__sceneObjExtraInfo")}setProps(t,n){const i=this._getSceneObjConstructor(t);if(!i){console.warn(`cannot get constructor from type: ${t}`);return}let s=Xn(i,"__sceneObjExtraInfo");s||(s={},fi(i,"__sceneObjExtraInfo",s)),Object.assign(s,n)}getProp(t,n){const i=this.getProps(t);return i&&i[n]}setProp(t,n,i){this.setProps(t,{[n]:i})}get environmentVariables(){return this._environmentVariables}set environmentVariables(t){for(let[n,i]of Object.entries(t))this.setEnv(n,i)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(t,n){if(this._environmentVariables[t]!==n){const i=this._environmentVariables[t];this._environmentVariables[t]=n,this._environmentVariablesChanged.emit(t,n,i)}globalThis.ESSDK_ENV={...this._environmentVariables}}getEnv(t){return this._environmentVariables[t]}getStrFromEnv(t){return Ig(t)}createEnvStrReact(t,n){return Pg(t,n)}createEvnStrReact(t,n){return Pg(t,n)}}const _t=class _t extends V{constructor(t){super();d(this,"_components",this.dv(new Wl));d(this,"_viewerAttached",this.dv(new O));d(this,"_viewerDetached",this.dv(new O));d(this,"_attachedViewers",(()=>{const t=new Set;return this.d(this._viewerAttached.don(n=>{n.actived&&(this.activeViewer=n),n.ad(n.activedChanged.don(i=>{i&&t.has(n)&&(this.activeViewer=n)})),t.add(n)})),this.d(this._viewerDetached.don(n=>{t.delete(n),this.activeViewer==n&&(this.activeViewer=void 0)})),t})());d(this,"_activeViewer",this.disposeVar(j(void 0)));d(this,"_createdEvent",this.dv(new O));d(this,"_flushEvent",this.dv(new O));d(this,"_id");d(this,"_updateFuncReact",this.dv(j(void 0)));d(this,"_toDestroyFuncReact",this.dv(j(void 0)));d(this,"_parentID");t!==void 0&&(typeof t!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof t},值为${t}`):t.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):t.trim()!==t&&console.warn(`id前后有空字符串!id: ${t}`)),this._id=t??Jo(),this._initName();{const n=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(i){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`)}};n(),this.d(this.execOnceFuncStrChanged.don(n))}{const n=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(s){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};n(),this.d(this.updateFuncStrChanged.don(n));let i;this.d(()=>i&&i.destroy()),this.d(this.updateFuncChanged.don(()=>{i&&i.cancel(),this.updateFunc&&(i=i||Ou(),i.restart(void 0,s=>{this.updateFunc&&this.updateFunc(this,s)}))}))}{const n=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(i){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`),this.toDestroyFunc=void 0}};n(),this.d(this.toDestroyFuncStrChanged.don(n)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static getParentClass(){return Object.getPrototypeOf(this)}static register(t,n,i){Gi(n.prototype,n.createDefaultProps);const s=n.createDefaultProps();n.defaults&&(n.defaults={});for(const o of Object.keys(s))n.defaults[o]=s[o]instanceof ze?s[o].value:s[o];return this.innerRegister(t,n,i),t}static get envs(){return _t.context.environmentVariables}static get $refs(){return _t.context.refsManager.refs}get components(){return this._components}get viewerAttached(){return this._viewerAttached}get viewerDetached(){return this._viewerDetached}get attachedViewers(){return this._attachedViewers}get activeViewer(){return this._activeViewer.value}set activeViewer(t){this._activeViewer.value=t}get activeViewerChanged(){return this._activeViewer.changed}removefromViewer(t){this.attachedViewers.has(t)&&t.delete(this)}addToViewer(t){this.attachedViewers.has(t)||t.add(this)}registerAttachedObject(t){const n=new Map;this.d(()=>{n.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(i=>{const s=t(i);s&&n.set(i,s)})),this.d(this._viewerDetached.don(i=>{if(!n.has(i))return;const s=n.get(i);s&&(s.destroy(),n.delete(i))}))}createAttachedObject(t){const n=new Map,i=()=>{for(let[u,l]of n.entries())l.destroy();n.clear()},s=u=>{const l=t(u);l&&n.set(u,l)};for(let u of this.attachedViewers)s(u);const o=this._viewerAttached.don(s),a=this._viewerDetached.don(u=>{if(!n.has(u))return;const l=n.get(u);l&&(l.destroy(),n.delete(u))});return()=>{a(),o(),i()}}registerAttachedObjectForContainer(t){this.registerAttachedObject(n=>new V0(n,t))}get createdEvent(){return this._createdEvent}get flushEvent(){return this._flushEvent}flush(){this.flushEvent.emit()}get id(){return this._id}get typeName(){return this.constructor.type}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return this.constructor.createDefaultProps()}_innerGetJson(t=!0){const n={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(t){let s,o=this.defaultProps[i];o instanceof ze?s=o.equals(this[i]):s=o===this[i],s||(n[i]=this[i])}else n[i]=this[i];return n}_innerSetJson(t,n,i){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in t)this[a]=t[a]===null?void 0:t[a];else if(!(i??!1)){let u=this.defaultProps[a];u instanceof ze&&(u=u.value),this[a]=u}}get completeJson(){return this._innerGetJson(!1)}get json(){return this._innerGetJson()}set json(t){this._innerSetJson(t)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(t){this._innerSetJson(JSON.parse(t))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID??this.id}set parentID(t){this._parentID=t}getProperties(t){const n={...this.getESProperties()},i=[];return n.general.length>0&&i.push(new ut(n.general,"general")),Object.keys(n).forEach(s=>{s!=="defaultMenu"&&s!=="general"&&n[s].length>0&&i.push(new ut(n[s],s))}),i}getESProperties(){return{defaultMenu:"general",basic:[],general:[new pt([this,"typeName"],"类型",void 0,!1,!0),new pt([this,"id"],"唯一标识",void 0,!1,!0),new pt([this,"name"],"名称")],dataSource:[],location:[],coordinate:[],style:[],more:[new pt([this,"ref"],"ref",void 0,!0),new it([this,"extras"],"extras",void 0,void 0,!0),new Dg(()=>this._jsonStr,t=>t&&(this._jsonStr=t),"JSON")]}}};d(_t,"context",new k0),d(_t,"innerRegister",_t.context.register.bind(_t.context)),d(_t,"defaults",{}),d(_t,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:wt(void 0),devTags:re(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),d(_t,"type",_t.register("ESSceneObject",_t,{chsName:"场景类",tags:["ESObjects"],description:""})),d(_t,"create",_t.context.createSceneObject.bind(_t.context)),d(_t,"createFromUrl",_t.context.createSceneObjectFromUrl.bind(_t.context)),d(_t,"createFromClass",_t.context.createSceneObjectFromClass.bind(_t.context)),d(_t,"createFromJson",_t.context.createSceneObjectFromJson.bind(_t.context)),d(_t,"destroySceneObject",_t.context.destroySceneObject.bind(_t.context)),d(_t,"getSceneObjById",_t.context.getSceneObjectById.bind(_t.context)),d(_t,"getSceneObj",_t.context.getSceneObject.bind(_t.context)),d(_t,"getEnv",_t.context.getEnv.bind(_t.context)),d(_t,"setEnv",_t.context.setEnv.bind(_t.context)),d(_t,"getStrFromEnv",_t.context.getStrFromEnv.bind(_t.context)),d(_t,"getSceneObjectById",_t.context.getSceneObjectById.bind(_t.context)),d(_t,"getSceneObject",_t.context.getSceneObject.bind(_t.context));let rt=_t;class V0 extends V{constructor(e,t){super(),this.dv(new Ee(e.subContainerChanged,()=>{if(e.subContainer)return t(e,e.subContainer)}))}}const eh=class eh extends V{constructor(t,n){super();d(this,"_id",++eh._accumId);this._name=t,this._description=n}get id(){return this._id}get name(){return this._name}get description(){return this._description}};d(eh,"_accumId",-1);let ws=eh;class Bh extends ws{constructor(e,t,n,i,s){super(e,t),this._withUndefined=n,this._readonly=i,this._defaultValue=s}get withUndefined(){return this._withUndefined}get readonly(){return this._readonly}get defaultValue(){return this._defaultValue instanceof Function?this._defaultValue():this._defaultValue}}class Tt extends Bh{constructor(e,t,n,i,s,o){const a=e instanceof ze?"未获取到属性名":e[1].toString();super(t??a,o??a,i??!1,s??!1,n),this._reactVar=e}get reactVar(){return this._reactVar}}class X extends Tt{get type(){return"BooleanProperty"}}class pt extends Tt{get type(){return"StringProperty"}}class M extends Tt{get type(){return"NumberProperty"}}class j0 extends Tt{get type(){return"MaximumScreenSpaceErrorProperty"}}class xg extends Tt{get type(){return"StringsProperty"}}class B0 extends Tt{get type(){return"NumbersProperty"}}class z0 extends Tt{get type(){return"BooleansProperty"}}class U0 extends Tt{get type(){return"String2Property"}}class G0 extends Tt{get type(){return"String3Property"}}class W0 extends Tt{get type(){return"String4Property"}}class Tg extends Tt{get type(){return"String2sProperty"}}class H0 extends Tt{get type(){return"String3sProperty"}}class q0 extends Tt{get type(){return"String4sProperty"}}class Ae extends Tt{get type(){return"Number2Property"}}class cn extends Tt{get type(){return"Number3Property"}}class Ar extends Tt{get type(){return"Number4Property"}}class X0 extends Tt{get type(){return"Number4WithUndefinedProperty"}}class Og extends Tt{get type(){return"Number2sProperty"}}class zh extends Tt{get type(){return"Number3sProperty"}}class Y0 extends Tt{get type(){return"Number4sProperty"}}class J0 extends Tt{get type(){return"Boolean2Property"}}class $0 extends Tt{get type(){return"Boolean3Property"}}class K0 extends Tt{get type(){return"Boolean4Property"}}class Z0 extends Tt{get type(){return"Boolean2sProperty"}}class Q0 extends Tt{get type(){return"Boolean3sProperty"}}class tw extends Tt{get type(){return"Boolean4sProperty"}}class ew extends Tt{get type(){return"StringNumberProperty"}}class nw extends Tt{get type(){return"StringNumbersProperty"}}class Mt extends Ar{get type(){return"ColorProperty"}}class rw extends cn{get type(){return"ColorRgbProperty"}}class iw extends M{get type(){return"DashPatternProperty"}}class Pt extends Tt{constructor(e,t,n,i,s,o,a){super(e,n,i,s,o,a),this._enums=t}get type(){return"EnumProperty"}get enums(){return this._enums}}class sw extends Tt{constructor(e,t,n,i,s,o,a){super(e,n,i,s,o,a),this._enums=t}get type(){return"EnumStringsProperty"}get enums(){return this._enums}}class Es extends Tt{constructor(e,t,n,i,s,o,a){super(e,t,n,s,o,a),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"EvalStringProperty"}}class Ng extends Tt{constructor(e,t,n,i,s){super(e,t,i,!1,!1,s),this._paramTypes=n}get type(){return"ParamsProperty"}get paramTypes(){return this._paramTypes}}class lt extends ws{constructor(t,n,i,s,o){const a=s??"Unnamed Function";super(a,o??a);d(this,"_paramsProperty");d(this,"_getValueFunc");this._func=n;const u=this.disposeVar(wt(i));this._paramsProperty=this.disposeVar(new Ng(u,a+"_params",t,i));const[l]=zi(this._paramsProperty.reactVar);this._getValueFunc=l}get paramsProperty(){return this._paramsProperty}exec(){this._func(...this._getValueFunc())}get type(){return"FunctionProperty"}}class ut extends ws{constructor(e,t,n){const i=t??"分组";super(i,n??i),this._children=e}get type(){return"GroupProperty"}get children(){return this._children}}class it extends Tt{constructor(e,t,n,i,s,o,a){super(e,t,n,s,o,a),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"JsonProperty"}}class Uh extends Tt{constructor(e,t,n,i,s,o,a){super(e,t,n,s,o,a),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"LongStringProperty"}}class ow extends Ae{get type(){return"MinmaxProperty"}}class aw extends Ar{get type(){return"NearFarScalerProperty"}}class Dg extends Bh{constructor(e,t,n,i,s,o,a){const u=n??"非响应式Json";super(u,a??u,s??!1,o??!1,i),this._getJsonStringFunc=e,this._setJsonStringFunc=t}get type(){return"NonreactiveJsonStringProperty"}get getJsonStringFunc(){return this._getJsonStringFunc}get setJsonStringFunc(){return this._setJsonStringFunc}}class uw extends Ae{get type(){return"NumberRangeProperty"}}class Ue extends Tt{constructor(e,t,n,i,s,o,a,u){super(e,i,s,o,a,u),this._step=t,this._minMax=n}get type(){return"NumberSliderProperty"}get minMax(){return this._minMax}get step(){return this._step}}function lw(r,e){const[t,n,i]=zi(r),[s,o,a]=zi(e),u=j((t()??0)/(s()??3e3)),l=()=>{const c=u.value,h=s()??3e3,f=t()??0;if(!Number.isFinite(h)||!Number.isFinite(f)){console.warn(`duration || currentTime error: duration: ${h} currentTime: ${f}`);return}Math.abs(c*h-f)<.001||(h<=0?u.value=0:u.value=f/h)};return u.dispose(i.disposableOn(l)),u.dispose(a.disposableOn(l)),u.dispose(u.changed.disposableOn(()=>{const c=u.value,h=s()??3e3,f=t()??0;if(!Number.isFinite(h)||!Number.isFinite(f)){console.warn(`duration || currentTime error: duration: ${h} currentTime: ${f}`);return}Math.abs(c*h-f)<.001||n(c*h)})),u}class Hl extends ws{constructor(t,n,i,s,o,a){super(s??"播放器",a??"播放器");d(this,"_defaults",{playing:!1,ratio:0,loop:!1});this._playingReact=t,this._ratioReact=n,this._loopReact=i,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.ratio=o.ratio??this._defaults.ratio,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"PlayerProperty"}get playingReact(){return this._playingReact}get ratioReact(){return this._ratioReact}get loopReact(){return this._loopReact}get defaults(){return this._defaults}}d(Hl,"createPlayingRatio",lw);class ia extends cn{get type(){return"PositionProperty"}}class Mg extends Tt{get type(){return"PositionsProperty"}}class cw extends Tt{get type(){return"PositionsSetPropety"}}class Gh extends cn{get type(){return"RotationProperty"}}class Fu extends pt{get type(){return"UriProperty"}}class Rg extends ws{constructor(t,n,i,s,o,a){const u=s??"视角播放器";super(u,a??u);d(this,"_defaults",{playing:!1,loop:!1});this._playingReact=t,this._stopFn=n,this._loopReact=i,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"ViewPlayerProperty"}get playingReact(){return this._playingReact}get loopReact(){return this._loopReact}get stopFn(){return this._stopFn}get defaults(){return this._defaults}}class Lg extends Tt{get type(){return"DatesProperty"}}class io extends Tt{get type(){return"DateProperty"}}var et=(r=>(r.Place="place",r.Translation="translation",r.Rotation="rotation",r.Scale="scale",r.DoublePointsAppend="doublePointsAppend",r.DoublePointsModify="doublePointsModify",r.CircularAppend="circularAppend",r.CircularInsert="circularInsert",r.LineStringAppend="lineStringAppend",r.LineStringInsert="lineStringInsert",r.ScatterAppend="scatterAppend",r.ScatterModify="scatterModify",r.VisibilityAppend="visibilityAppend",r.VisibilityModify="visibilityModify",r.HeightModify="heightModify",r))(et||{}),Fg=(r=>(r.DECIMAL_DEGREE="DECIMAL_DEGREE",r.DEGREES_DECIMAL_MINUTES="DEGREES_DECIMAL_MINUTES",r.SEXAGESIMAL_DEGREE="SEXAGESIMAL_DEGREE",r))(Fg||{});class hw{constructor(e){this.childPickedInfo=e}}class dw{constructor(e,t,n,i,s,o){this.pickResult=e,this.sceneObject=t,this.tilesetPickInfo=n,this.geojsonPickInfo=i,this.attachedInfo=s,this.screenPosition=o}assign(e){e!=null&&e.pickedResult&&(this.pickResult=e.pickedResult),e!=null&&e.sceneObject&&(this.sceneObject=e.sceneObject),e!=null&&e.tilesetPickInfo&&(this.tilesetPickInfo=e.tilesetPickInfo),e!=null&&e.geojsonPickInfo&&(this.geojsonPickInfo=e.geojsonPickInfo),e!=null&&e.attachedInfo&&(this.attachedInfo=e.attachedInfo),e!=null&&e.screenPosition&&(this.screenPosition=e.screenPosition)}}const _e=class _e extends rt{constructor(t){super(t);d(this,"_editing",this.dv(j(!1)));d(this,"editingID");d(this,"editingBindMode","singlePoint");d(this,"_deprecated",[]);d(this,"_flyInEvent",this.dv(new O));d(this,"_flyToEvent",this.dv(new O));d(this,"_flyOverEvent",this.disposeVar(new O));d(this,"_pickedEvent",this.dv(new O));d(this,"_calcFlyToParamEvent",this.dv(new O));d(this,"_calcFlyInParamEvent",this.dv(new O));d(this,"useCalcFlyToParamInESObjectWithLocation",!1);Bg(this,this.updateEditing)}supportEditingModes(){return this.constructor.supportEditingModes}get editing(){return this._editing.value}set editing(t){this._editing.value=t}get editingChanged(){return this._editing.changed}updateEditing(){}_deprecatedWarning(){const t=this._deprecated;for(let n=0;n<t.length;n++){const i=t[n];typeof i=="string"?Reflect.has(this,i+"Changed")&&this.d(this[i+"Changed"].don(()=>{console.warn(`注意:${this.typeName} 的 ${i} 属性下版本将会被移除!`)})):Object.keys(i).forEach(s=>{Reflect.has(this,s+"Changed")&&this.d(this[s+"Changed"].don(a=>{const u=i[s];typeof u=="string"?console.warn(`注意:${this.typeName} 的 ${s} 属性下版本将会被移除!`):Object.keys(u).forEach(l=>{a===l&&console.warn(`注意:${this.typeName} 的 ${s} 属性值 ${l} 下版本将会被移除,推荐使用属性值 ${u[l]}`)})}))})}}get flyInEvent(){return this._flyInEvent}flyIn(t=1){this._flyInEvent.emit(t,_e._lastFlyInId)}get flyToEvent(){return this._flyToEvent}flyTo(t=1){this._flyToEvent.emit(t,_e._lastFlyToId)}get flyOverEvent(){return this._flyOverEvent}get pickedEvent(){return this._pickedEvent}get calcFlyToParamEvent(){return this._calcFlyToParamEvent}calcFlyToParam(){this._calcFlyToParamEvent.emit()}get calcFlyInParamEvent(){return this._calcFlyInParamEvent}calcFlyInParam(){this._calcFlyInParamEvent.emit()}emptyFlyToParam(){this.flyToParam=void 0}emptyFlyInParam(){this.flyInParam=void 0}async getBoundSphere(t){return await t.getBoundSphere(this.id)}getESProperties(){const t={...super.getESProperties()};return{...t,general:[...t.general,new X([this,"show"],"是否显示",_e.defaults.show),new X([this,"collision"],"开启碰撞",_e.defaults.collision),new X([this,"allowPicking"],"允许拾取",_e.defaults.allowPicking),new lt([],()=>this.calcFlyToParam(),[],"保存观察视角","保存当前flyToParam"),new lt([],()=>this.emptyFlyToParam(),[],"清空飞向参数","清空飞向参数"),new lt([],()=>this.emptyFlyInParam(),[],"清空飞入参数","清空飞入参数"),new lt([],()=>this.calcFlyInParam(),[],"保存飞入参数","保存飞入参数flyInParam")],more:[...t.more,new ut([],"飞行定位","飞向参数"),new lt(["number"],n=>this.flyTo(n),[1],"飞向"),new it([this,"flyToParam"],"flyToParam",void 0,void 0,!0),new M([this,"flyToDistance"],"flyToDistance",void 0,!0),new M([this,"flyToHeading"],"flyToHeading",void 0,!0),new M([this,"flyToPitch"],"flyToPitch",void 0,!0),new M([this,"flyToFlyDuration"],"flyToFlyDuration",void 0,!0),new M([this,"flyToHDelta"],"flyToHDelta",void 0,!0),new M([this,"flyToPDelta"],"flyToPDelta",void 0,!0),new ut([],"飞入参数"),new lt(["number"],n=>this.flyIn(n),[1],"飞入"),new it([this,"flyInParam"],"flyInParam",void 0,void 0,!0)]}}get flyToDistance(){return this.flyToParam&&this.flyToParam.distance}get flyToHeading(){return this.flyToParam&&this.flyToParam.heading}get flyToPitch(){return this.flyToParam&&this.flyToParam.pitch}get flyToFlyDuration(){return this.flyToParam&&this.flyToParam.flyDuration}get flyToHDelta(){return this.flyToParam&&this.flyToParam.hDelta}get flyToPDelta(){return this.flyToParam&&this.flyToParam.pDelta}get flyToDistanceChanged(){return this.flyToParamChanged}get flyToHeadingChanged(){return this.flyToParamChanged}get flyToPitchChanged(){return this.flyToParamChanged}get flyToFlyDurationChanged(){return this.flyToParamChanged}get flyToHDeltaChanged(){return this.flyToParamChanged}get flyToPDeltaChanged(){return this.flyToParamChanged}set flyToDistance(t){this.flyToParam=t!==void 0?{...this.flyToParam??_e.defaultFlyToParam,distance:t}:void 0}set flyToHeading(t){this.flyToParam=t!==void 0?{...this.flyToParam??_e.defaultFlyToParam,heading:t}:void 0}set flyToPitch(t){this.flyToParam=t!==void 0?{...this.flyToParam??_e.defaultFlyToParam,pitch:t}:void 0}set flyToFlyDuration(t){this.flyToParam=t!==void 0?{...this.flyToParam??_e.defaultFlyToParam,flyDuration:t}:void 0}set flyToHDelta(t){this.flyToParam=t!==void 0?{...this.flyToParam??_e.defaultFlyToParam,hDelta:t}:void 0}set flyToPDelta(t){this.flyToParam=t!==void 0?{...this.flyToParam??_e.defaultFlyToParam,pDelta:t}:void 0}};d(_e,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,collision:!0,allowPicking:!1,flyToParam:Qt(void 0),flyInParam:Qt(void 0)})),d(_e,"type",_e.register("ESVisualObject",_e,{chsName:"可视化对象",tags:["ESObjects"],description:"可视化对象"})),d(_e,"supportEditingModes",[]),d(_e,"defaultFlyToParam",{distance:0,heading:0,pitch:0,flyDuration:1,hDelta:0,pDelta:0}),d(_e,"defaultFlyInParam",{position:[0,0,0],rotation:[0,0,0],flyDuration:1}),d(_e,"_lastFlyInId",0),d(_e,"_lastFlyToId",0);let Ht=_e;class Ag extends V{constructor(){super();d(this,"_data",this.dv(j(void 0)))}set data(t){this._data.value=t}get data(){return this._data.value}get dataChanged(){return this._data.changed}}class kg extends V{constructor(){super(...arguments);d(this,"_dragStartEvent",this.dv(new O));d(this,"_dragOverEvent",this.dv(new O));d(this,"_dragLeaveEvent",this.dv(new O));d(this,"_dropEvent",this.dv(new O))}dragStart(t){this._dragStartEvent.emit(t)}dragOver(t){this._dragOverEvent.emit(t)}dragLeave(t){this._dragLeaveEvent.emit(t)}drop(t){this._dropEvent.emit(t)}}function fw(r,e){e&&(Reflect.has(e,"editing")?e.editing=!0:Reflect.has(e,"positionEditing")&&(e.positionEditing=!0))}function pw(r){["Czm3DTiles","View","ESCameraView","OlView","GeoCameraController"].includes(r.typeName)||(Reflect.has(r,"editing")?r.editing=!0:Reflect.has(r,"positionEditing")&&(r.positionEditing=!0)),typeof r.execOnCreating=="function"&&r.execOnCreating()}function ql(r,e){Xn(r,"__treeItem")&&console.error("setSceneObjectTreeItem error!"),fi(r,"__treeItem",e)}function gw(r){return Xn(r,"__treeItem")}function mw(r){if(!(r.startsWith("./")||r.startsWith("../")||r.startsWith("/")))return r;const e=document.createElement("a");e.href=r;const t=e.href;return e.remove(),t}function Wh(r){if(typeof r!="string")return!1;try{const e=JSON.parse(r);return typeof e=="object"&&e!==null}catch{return!1}}function vw(r){try{return new DOMParser().parseFromString(r,"application/xml").getElementsByTagName("parsererror").length===0}catch{return!1}}function yw(r){return r instanceof Function?r():r}function Vg(r,e){for(let t of r)if(e.includes(t))return!0;return!1}function qi(r,e){const t=r,n=e;return t===void 0||t.length===0||n===void 0||n.length===0?!0:Vg(t,n)}function _w(r){const e=setTimeout(()=>{r(),clearTimeout(e)})}function sa(r){let e=r%360;return e=e<0?360+e:e,e}function jg(r){return sa(r+180)-180}function Xl(r,e,t){let n=sa(r),i=sa(e);Math.abs(n-i)>180&&(n<i?n+=360:i+=360);const s=n*(1-t)+i*t;return jg(s)}function Hh(r,e,t,n){return n=n||[0,0,0],n[0]=Xl(r[0],e[0],t),n[1]=Xl(r[1],e[1],t),n[2]=Xl(r[2],e[2],t),n}function Bg(r,e,t="editing"){const n=new V;r.ad(n);const i=e.bind(r);return n.ad(new Ee(r.activeViewerChanged,()=>{const s=new V;let o=r.activeViewer;return o?(s.ad(r[`${t}Changed`].don(()=>{var a;r[`${t}`]?i():(a=(r.components.main??r).editingID)!=null&&a.includes("inner")&&r.activeViewer&&r.activeViewer.stopEditing()})),s.ad(o.editingEvent.don(a=>{if(a.objectIDs.includes(r.id)&&a.type==="end"){const u=r.components.main??r;u.editingID&&a.editingID.includes(u.editingID)?r[`${t}`]=!1:r[`${t}`]=!u.editingID.includes("outer")}}))):s.ad(r[`${t}Changed`].don(()=>{r[`${t}`]=!1})),s})),r[`${t}`]&&i(),n}function ww(r){var t;const e=((t=r.type)==null?void 0:t.toLowerCase())??"";switch(e){case"geometrycollection":return Ew(r);case"topology":const n=r.objects,i=[];for(const s in n){const o=Ky.feature(r,n[s]);i.push(...o.features)}return{type:"FeatureCollection",features:i};case"feature":return{type:"FeatureCollection",features:[r]};case"featurecollection":return r;case"":default:return console.warn(`GeoJson数据转换可能有误,数据类型${e}`),{type:"FeatureCollection",features:Array.isArray(r.features)?r.features:[]}}}function Ew(r,e){const t=[],n=r.geometries||[];function i(s,o={}){!s||!s.type||(s.type==="GeometryCollection"&&Array.isArray(s.geometries)?s.geometries.forEach(a=>i(a,o)):t.push({type:"Feature",geometry:s,properties:{...s.properties||{},...o}}))}return n.forEach(s=>i(s,{})),{type:"FeatureCollection",features:t}}function Cw(r){const e=r.cloneNode(!0);e.style.position="fixed",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.top="0",e.style.left="0",e.style.display="inline-block",document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{x:t.x,y:t.y,width:t.width,height:t.height}}class qh extends V{constructor(t){super();d(this,"_sceneObject",this.dv(j(void 0)));this._id=t,this.d(()=>{this._sceneObject.value=void 0});const n=rt.getSceneObjById(this._id);n&&(this._sceneObject.value=n),this.d(rt.context.sceneObjCreatedEvent.don(i=>{i.id===this._id&&(this._sceneObject.value=i)})),this.d(rt.context.sceneObjToDestroyEvent.don(i=>{i.id===this._id&&(this._sceneObject.value=void 0)}))}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}get id(){return this._id}}class Sw extends V{constructor(t,n){super();d(this,"_sofi");this._id=t,this._sofi=this.dv(new qh(this._id));{const i=()=>{n.sceneObject=this._sofi.sceneObject};i(),this.d(this._sofi.sceneObjectChanged.don(i))}}}class zg extends V{constructor(){super();d(this,"_id",this.dv(j(void 0)));d(this,"_sceneObject",this.dv(j(void 0)));d(this,"_resetting",this.dv(new Ee(this.idChanged,()=>{const{id:t}=this;if(t===void 0||t===""){this.sceneObject=void 0;return}return new Sw(t,this)})))}get id(){return this._id.value}get idChanged(){return this._id.changed}set id(t){this._id.value=t}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}set sceneObject(t){this._sceneObject.value=t}get resetting(){return this._resetting}}class bw extends V{constructor(t,n,i,s){super();d(this,"_sceneObjectId",this.dv(new zg));this._id=t,this._startTimeStamp=n,this._duration=i,this._parent=s,this._sceneObjectId.id=this._id;const o=()=>{if(!this.player)return;const{currentTime:a=0}=this._parent,u=a-this._startTimeStamp;this.player.currentTime=jl(u,0,this._duration)*(this.player.speed??1)};o(),this.d(this._parent.currentTimeChanged.don(o)),this.d(this.playerChanged.don(o))}get player(){return this._sceneObjectId.sceneObject instanceof kr?this._sceneObjectId.sceneObject:void 0}get playerChanged(){return this._sceneObjectId.sceneObjectChanged}}const Pw=`
24
24
  用来配置子播放器,它是一个数组形式,数组的每个元素仍然是一个数组,形式是[子播放器的ID, 起始时间, 持续时间]。
25
25
  注意时间的单位是毫秒。
26
26
  示例如下:
@@ -38,10 +38,10 @@ ${u.map(c=>`${c.id} ${c.typeName}
38
38
  ]
39
39
  ]
40
40
  \`\`\`
41
- `,an=class an extends V{constructor(){super();d(this,"_ratio",this.dv(j(0)));d(this,"_subPlayers",this.dv(new xu));const t=this.dv(new Ul);{const o=()=>{t.loop=this.loop??an.defaults.loop};o(),this.d(this.loopChanged.don(o))}{const o=()=>{(this.loop??an.defaults.loop)!==t.loop&&(this.loop=t.loop)};o(),this.d(t.loopChangedEvent.don(o))}{const o=()=>{t.currentTime=this.currentTime??an.defaults.currentTime};o(),this.d(this.currentTimeChanged.don(o))}{const o=()=>{(this.currentTime??an.defaults.currentTime)!==t.currentTime&&(this.currentTime=t.currentTime)};o(),this.d(t.currentTimeChangedEvent.don(o))}{const o=()=>{t.duration=this.duration??an.defaults.duration};o(),this.d(this.durationChanged.don(o))}{const o=()=>{(this.duration??an.defaults.duration)!==t.duration&&(this.duration=t.duration)};o(),this.d(t.durationChangedEvent.don(o))}{const o=()=>{t.speed=this.speed??an.defaults.speed};o(),this.d(this.speedChanged.don(o))}{const o=()=>{(this.speed??an.defaults.speed)!==t.speed&&(this.speed=t.speed)};o(),this.d(t.speedChangedEvent.don(o))}{const o=()=>{t.playing=this.playing??an.defaults.playing};o(),this.d(this.playingChanged.don(o))}{const o=()=>{(this.playing??an.defaults.playing)!==t.playing&&(this.playing=t.playing)};o(),this.d(t.playingChangedEvent.don(o))}const n=()=>{const o=this.duration??an.defaults.duration;o>0&&(this._ratio.value=(this.currentTime??an.defaults.currentTime)/o)};n();const i=this.dv(Ie(this.currentTimeChanged,this.durationChanged));this.d(i.don(n)),this.d(()=>{const{length:o}=this._subPlayers;for(let a=0;a<o;++a)this._subPlayers.get(a).destroy();this._subPlayers.length=0});const s=()=>{for(let a of this._subPlayers)a.destroy();if(this._subPlayers.length=0,!this.channels)return;const o=this.channels.map(a=>{const[u,l,c]=a;return new Sw(u,l,c,this)});this._subPlayers.splice(0,0,...o)};s(),this.d(this.channelsChanged.don(s))}get ratio(){return this._ratio.value}set ratio(t){Math.abs(this._ratio.value-t)<.001||(this.currentTime=(this.duration??an.defaults.duration)*t)}get ratioChanged(){return this._ratio.changed}};d(an,"defaults",{loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:!0,ratio:0}),d(an,"channelsReadMe",bw);let kr=an;(r=>{r.createDefaultProps=()=>({loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:vs(void 0,(e,t)=>e==null?void 0:e.every((n,i)=>n===t[i]),e=>[...e])})})(kr||(kr={})),Gi(kr.prototype,kr.createDefaultProps);class Pw extends V{constructor(e,t,n,i){super(),this.disposeVar(new Ee(e.sceneObjectChanged,()=>{let s;i.debug&&console.log("正在获取Event事件...");const o=e.sceneObject;if(o&&t){const a=t.split(".");if(a.length===0)i.debug&&console.warn("propNames.length === 0");else{let u=gh(o,!1,...a);(!u||!(u instanceof O))&&(a[a.length-1]=a[a.length-1]+"Changed",i.debug&&console.warn(`event未能获取,那么将属性名的最后一项加上Changed(${a[a.length-1]})再试试!`),u=gh(o,!1,...a),i.debug&&u&&console.warn("event仍然获取不到!")),u?u instanceof O?(s=u,i.debug&&console.log(`Event获取成功 propChangedName: ${t}`,s)):i.debug&&console.warn(`the prop is not event from ${o.id}-${o.name}-${o.ref}-${t}`):i.debug&&console.warn(`cannot get changed from ${o.id}-${o.name}-${o.ref}-${t}`)}}if(s){const a=new V;return a.d(s.dwon(()=>n.emit())),a}else{i.debug&&console.log(`未获取到Event!propChangedName: ${t}`);return}}))}}const Ug=Object.freeze(Object.defineProperty({__proto__:null,WatcherObjects:class extends V{constructor(t,n,i){super();d(this,"_doEvalEvent",this.dv(new O));const s=this._doEvalEvent,o=this.disposeVar(Ie(s)),a=t.map(([u,l])=>{const c=new qh(u),h=l&&new Pw(c,l,s,n)||void 0;return[c,h]});this.d(()=>{a.forEach(([u,l])=>{l==null||l.destroy(),u.destroy()}),a.length=0}),this.d(s.don(()=>{const{evalMode:u="NextAnimateFrame",evalOnlyWhenObjsAllExist:l=!0}=n;if(u==="Immediate"){const c=a.map(([h])=>h.sceneObject);(!l||c.every(h=>h!==void 0))&&i(c)}})),this.d(o.don(()=>{const{evalMode:u="NextAnimateFrame",evalOnlyWhenObjsAllExist:l=!0}=n;if(u==="NextAnimateFrame"){const c=a.map(([h])=>h.sceneObject);(!l||c.every(h=>h!==void 0))&&i(c)}}))}forceExecute(){this._doEvalEvent.emit()}}},Symbol.toStringTag,{value:"Module"})),{WatcherObjects:Iw}=Ug;class Au extends V{constructor(){super();d(this,"_evalFunc");d(this,"_forceExecute",new O);const t=this.dv(j(void 0)),n=()=>{try{t.value=this.evalFuncStr&&Function('"use strict";return ('+this.evalFuncStr+")")(),this.debug&&console.log("evalFunc成功构建",t.value)}catch(o){console.error(`evalFunc get error! ${o}`),t.value=void 0}};n(),this.dispose(this.evalFuncStrChanged.disposableOn(n));const i=o=>{this.enabled&&(this.debug&&console.log("执行evalFunc..."),this._evalFunc&&this._evalFunc(o),t.value&&t.value(o))},s=this.disposeVar(new Ee(this.objIdAndPropChangedNamesChanged,()=>{if(this.objIdAndPropChangedNames.length>0)return this.debug&&console.log("监视对象发生变化,重新创建WatcherObjects"),new Iw(this.objIdAndPropChangedNames,this,i)}));this.dispose(this._forceExecute.disposableOn(()=>{var o;(o=s.obj)==null||o.forceExecute()}))}get evalFunc(){return this._evalFunc}set evalFunc(t){this._evalFunc=t}forceExecute(){this._forceExecute.emit()}}(r=>{r.createDefaultProps=()=>({enabled:!1,objIdAndPropChangedNames:Ol([],(e,t)=>e[0]===t[0]&&e[1]===t[1],e=>[e[0],e[1]]),evalFuncStr:"",evalMode:"NextAnimateFrame",evalOnlyWhenObjsAllExist:!0,debug:!1,name:"未命名场景对象",ref:void 0,extras:wt(void 0),devTags:re(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})})(Au||(Au={})),Gi(Au.prototype,Au.createDefaultProps);const Gg=gp("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=geocent +datum=WGS84");function Vr(r){return Gg.forward(r)}function Xh(r){return Gg.inverse(r)}const Wg=gp("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");function xw(r){const e=Wg.forward([r[0],r[1]]);return[e[0],e[1],r[2]]}function Tw(r){const e=Wg.inverse([r[0],r[1]]);return[e[0],e[1],r[2]]}function Ow(r,e){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1])&&r.push(r[0]);const t=Qe.point(e),n=Qe.polygon([r]);return Qe.booleanPointInPolygon(t,n)}var tn=63710088e-1,Hg={centimeters:tn*100,centimetres:tn*100,degrees:tn/111325,feet:tn*3.28084,inches:tn*39.37,kilometers:tn/1e3,kilometres:tn/1e3,meters:tn,metres:tn,miles:tn/1609.344,millimeters:tn*1e3,millimetres:tn*1e3,nauticalmiles:tn/1852,radians:1,yards:tn*1.0936};function jr(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}function Jt(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!qg(r[0])||!qg(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return jr(n,e,t)}function Pn(r,e,t){t===void 0&&(t={});for(var n=0,i=r;n<i.length;n++){var s=i[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<s[s.length-1].length;o++)if(s[s.length-1][o]!==s[0][o])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:r};return jr(a,e,t)}function Br(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return jr(n,e,t)}function oa(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}function Yh(r,e,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:r};return jr(n,e,t)}function Jh(r,e){e===void 0&&(e="kilometers");var t=Hg[e];if(!t)throw new Error(e+" units is invalid");return r*t}function $h(r,e){e===void 0&&(e="kilometers");var t=Hg[e];if(!t)throw new Error(e+" units is invalid");return r/t}function Yl(r){var e=r%(2*Math.PI);return e*180/Math.PI}function hn(r){var e=r%360;return e*Math.PI/180}function Kh(r,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Jh($h(r,e),t)}function qg(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function In(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function so(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Xg(r,e,t){if(!r)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!r.geometry||r.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+r.geometry.type)}function Jn(r){return r.type==="Feature"?r.geometry:r}function Nw(r,e){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function ku(r,e,t){if(t===void 0&&(t={}),t.final===!0)return Dw(r,e);var n=In(r),i=In(e),s=hn(n[0]),o=hn(i[0]),a=hn(n[1]),u=hn(i[1]),l=Math.sin(o-s)*Math.cos(u),c=Math.cos(a)*Math.sin(u)-Math.sin(a)*Math.cos(u)*Math.cos(o-s);return Yl(Math.atan2(l,c))}function Dw(r,e){var t=ku(e,r);return t=(t+180)%360,t}function aa(r,e,t,n){n===void 0&&(n={});var i=In(r),s=hn(i[0]),o=hn(i[1]),a=hn(t),u=$h(e,n.units),l=Math.asin(Math.sin(o)*Math.cos(u)+Math.cos(o)*Math.sin(u)*Math.cos(a)),c=s+Math.atan2(Math.sin(a)*Math.sin(u)*Math.cos(o),Math.cos(u)-Math.sin(o)*Math.sin(l)),h=Yl(c),f=Yl(l);return Jt([h,f],n.properties)}function Xi(r,e,t){t===void 0&&(t={});var n=In(r),i=In(e),s=hn(i[1]-n[1]),o=hn(i[0]-n[0]),a=hn(n[1]),u=hn(i[1]),l=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(a)*Math.cos(u);return Jh(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),t.units)}function Mw(r,e,t){t===void 0&&(t={});for(var n=Jn(r),i=n.coordinates,s=0,o=0;o<i.length&&!(e>=s&&o===i.length-1);o++)if(s>=e){var a=e-s;if(a){var u=ku(i[o],i[o-1])-180,l=aa(i[o],a,u,t);return l}else return Jt(i[o])}else s+=Xi(i[o],i[o+1],t);return Jt(i[i.length-1])}function Rw(r,e){const t=Br(r);return Mw(t,e,{units:"meters"}).geometry.coordinates}function ua(r,e,t){if(r!==null)for(var n,i,s,o,a,u,l,c=0,h=0,f,p=r.type,v=p==="FeatureCollection",C=p==="Feature",S=v?r.features.length:1,P=0;P<S;P++){l=v?r.features[P].geometry:C?r.geometry:r,f=l?l.type==="GeometryCollection":!1,a=f?l.geometries.length:1;for(var y=0;y<a;y++){var _=0,m=0;if(o=f?l.geometries[y]:l,o!==null){u=o.coordinates;var w=o.type;switch(c=t&&(w==="Polygon"||w==="MultiPolygon")?1:0,w){case null:break;case"Point":if(e(u,h,P,_,m)===!1)return!1;h++,_++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(e(u[n],h,P,_,m)===!1)return!1;h++,w==="MultiPoint"&&_++}w==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-c;i++){if(e(u[n][i],h,P,_,m)===!1)return!1;h++}w==="MultiLineString"&&_++,w==="Polygon"&&m++}w==="Polygon"&&_++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(m=0,i=0;i<u[n].length;i++){for(s=0;s<u[n][i].length-c;s++){if(e(u[n][i][s],h,P,_,m)===!1)return!1;h++}m++}_++}break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(ua(o.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Jl(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}function $l(r,e){var t,n,i,s,o,a,u,l,c,h,f=0,p=r.type==="FeatureCollection",v=r.type==="Feature",C=p?r.features.length:1;for(t=0;t<C;t++){for(a=p?r.features[t].geometry:v?r.geometry:r,l=p?r.features[t].properties:v?r.properties:{},c=p?r.features[t].bbox:v?r.bbox:void 0,h=p?r.features[t].id:v?r.id:void 0,u=a?a.type==="GeometryCollection":!1,o=u?a.geometries.length:1,i=0;i<o;i++){if(s=u?a.geometries[i]:a,s===null){if(e(null,f,l,c,h)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(s,f,l,c,h)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(e(s.geometries[n],f,l,c,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Lw(r,e,t){var n=t;return $l(r,function(i,s,o,a,u){n=e(n,i,s,o,a,u)}),n}function Zh(r,e){$l(r,function(t,n,i,s,o){var a=t===null?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return e(jr(t,i,{bbox:s,id:o}),n,0)===!1?!1:void 0}var u;switch(a){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var l=0;l<t.coordinates.length;l++){var c=t.coordinates[l],h={type:u,coordinates:c};if(e(jr(h,i),n,l)===!1)return!1}})}function Fw(r,e){Zh(r,function(t,n,i){var s=0;if(t.geometry){var o=t.geometry.type;if(!(o==="Point"||o==="MultiPoint")){var a,u=0,l=0,c=0;if(ua(t,function(h,f,p,v,C){if(a===void 0||n>u||v>l||C>c){a=h,u=n,l=v,c=C,s=0;return}var S=Br([a,h],t.properties);if(e(S,n,i,C,s)===!1)return!1;s++,a=h})===!1)return!1}}})}var Yg=6378137;function Aw(r){return Lw(r,function(e,t){return e+kw(t)},0)}function kw(r){var e=0,t;switch(r.type){case"Polygon":return Jg(r.coordinates);case"MultiPolygon":for(t=0;t<r.coordinates.length;t++)e+=Jg(r.coordinates[t]);return e;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function Jg(r){var e=0;if(r&&r.length>0){e+=Math.abs($g(r[0]));for(var t=1;t<r.length;t++)e-=Math.abs($g(r[t]))}return e}function $g(r){var e,t,n,i,s,o,a,u=0,l=r.length;if(l>2){for(a=0;a<l;a++)a===l-2?(i=l-2,s=l-1,o=0):a===l-1?(i=l-1,s=0,o=1):(i=a,s=a+1,o=a+2),e=r[i],t=r[s],n=r[o],u+=(Qh(n[0])-Qh(e[0]))*Math.sin(Qh(t[1]));u=u*Yg*Yg/2}return u}function Qh(r){return r*Math.PI/180}function td(r){if((r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),r.length<=3)return 0;const e=Pn([r]);return Aw(e)}var Kl={exports:{}},Zl={exports:{}},Vw=Zl.exports,Kg;function Zg(){return Kg||(Kg=1,function(r,e){(function(t,n){r.exports=n()})(Vw,function(){function t(y,_,m,w,E){(function b(I,T,D,x,N){for(;x>D;){if(x-D>600){var L=x-D+1,A=T-D+1,J=Math.log(L),H=.5*Math.exp(2*J/3),Z=.5*Math.sqrt(J*H*(L-H)/L)*(A-L/2<0?-1:1),ct=Math.max(D,Math.floor(T-A*H/L+Z)),mt=Math.min(x,Math.floor(T+(L-A)*H/L+Z));b(I,T,ct,mt,N)}var Y=I[T],$=D,K=x;for(n(I,D,T),N(I[x],Y)>0&&n(I,D,x);$<K;){for(n(I,$,K),$++,K--;N(I[$],Y)<0;)$++;for(;N(I[K],Y)>0;)K--}N(I[D],Y)===0?n(I,D,K):n(I,++K,x),K<=T&&(D=K+1),T<=K&&(x=K-1)}})(y,_,m||0,w||y.length-1,E||i)}function n(y,_,m){var w=y[_];y[_]=y[m],y[m]=w}function i(y,_){return y<_?-1:y>_?1:0}var s=function(y){y===void 0&&(y=9),this._maxEntries=Math.max(4,y),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(y,_,m){if(!m)return _.indexOf(y);for(var w=0;w<_.length;w++)if(m(y,_[w]))return w;return-1}function a(y,_){u(y,0,y.children.length,_,y)}function u(y,_,m,w,E){E||(E=S(null)),E.minX=1/0,E.minY=1/0,E.maxX=-1/0,E.maxY=-1/0;for(var b=_;b<m;b++){var I=y.children[b];l(E,y.leaf?w(I):I)}return E}function l(y,_){return y.minX=Math.min(y.minX,_.minX),y.minY=Math.min(y.minY,_.minY),y.maxX=Math.max(y.maxX,_.maxX),y.maxY=Math.max(y.maxY,_.maxY),y}function c(y,_){return y.minX-_.minX}function h(y,_){return y.minY-_.minY}function f(y){return(y.maxX-y.minX)*(y.maxY-y.minY)}function p(y){return y.maxX-y.minX+(y.maxY-y.minY)}function v(y,_){return y.minX<=_.minX&&y.minY<=_.minY&&_.maxX<=y.maxX&&_.maxY<=y.maxY}function C(y,_){return _.minX<=y.maxX&&_.minY<=y.maxY&&_.maxX>=y.minX&&_.maxY>=y.minY}function S(y){return{children:y,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(y,_,m,w,E){for(var b=[_,m];b.length;)if(!((m=b.pop())-(_=b.pop())<=w)){var I=_+Math.ceil((m-_)/w/2)*w;t(y,I,_,m,E),b.push(_,I,I,m)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(y){var _=this.data,m=[];if(!C(y,_))return m;for(var w=this.toBBox,E=[];_;){for(var b=0;b<_.children.length;b++){var I=_.children[b],T=_.leaf?w(I):I;C(y,T)&&(_.leaf?m.push(I):v(y,T)?this._all(I,m):E.push(I))}_=E.pop()}return m},s.prototype.collides=function(y){var _=this.data;if(!C(y,_))return!1;for(var m=[];_;){for(var w=0;w<_.children.length;w++){var E=_.children[w],b=_.leaf?this.toBBox(E):E;if(C(y,b)){if(_.leaf||v(y,b))return!0;m.push(E)}}_=m.pop()}return!1},s.prototype.load=function(y){if(!y||!y.length)return this;if(y.length<this._minEntries){for(var _=0;_<y.length;_++)this.insert(y[_]);return this}var m=this._build(y.slice(),0,y.length-1,0);if(this.data.children.length)if(this.data.height===m.height)this._splitRoot(this.data,m);else{if(this.data.height<m.height){var w=this.data;this.data=m,m=w}this._insert(m,this.data.height-m.height-1,!0)}else this.data=m;return this},s.prototype.insert=function(y){return y&&this._insert(y,this.data.height-1),this},s.prototype.clear=function(){return this.data=S([]),this},s.prototype.remove=function(y,_){if(!y)return this;for(var m,w,E,b=this.data,I=this.toBBox(y),T=[],D=[];b||T.length;){if(b||(b=T.pop(),w=T[T.length-1],m=D.pop(),E=!0),b.leaf){var x=o(y,b.children,_);if(x!==-1)return b.children.splice(x,1),T.push(b),this._condense(T),this}E||b.leaf||!v(b,I)?w?(m++,b=w.children[m],E=!1):b=null:(T.push(b),D.push(m),m=0,w=b,b=b.children[0])}return this},s.prototype.toBBox=function(y){return y},s.prototype.compareMinX=function(y,_){return y.minX-_.minX},s.prototype.compareMinY=function(y,_){return y.minY-_.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(y){return this.data=y,this},s.prototype._all=function(y,_){for(var m=[];y;)y.leaf?_.push.apply(_,y.children):m.push.apply(m,y.children),y=m.pop();return _},s.prototype._build=function(y,_,m,w){var E,b=m-_+1,I=this._maxEntries;if(b<=I)return a(E=S(y.slice(_,m+1)),this.toBBox),E;w||(w=Math.ceil(Math.log(b)/Math.log(I)),I=Math.ceil(b/Math.pow(I,w-1))),(E=S([])).leaf=!1,E.height=w;var T=Math.ceil(b/I),D=T*Math.ceil(Math.sqrt(I));P(y,_,m,D,this.compareMinX);for(var x=_;x<=m;x+=D){var N=Math.min(x+D-1,m);P(y,x,N,T,this.compareMinY);for(var L=x;L<=N;L+=T){var A=Math.min(L+T-1,N);E.children.push(this._build(y,L,A,w-1))}}return a(E,this.toBBox),E},s.prototype._chooseSubtree=function(y,_,m,w){for(;w.push(_),!_.leaf&&w.length-1!==m;){for(var E=1/0,b=1/0,I=void 0,T=0;T<_.children.length;T++){var D=_.children[T],x=f(D),N=(L=y,A=D,(Math.max(A.maxX,L.maxX)-Math.min(A.minX,L.minX))*(Math.max(A.maxY,L.maxY)-Math.min(A.minY,L.minY))-x);N<b?(b=N,E=x<E?x:E,I=D):N===b&&x<E&&(E=x,I=D)}_=I||_.children[0]}var L,A;return _},s.prototype._insert=function(y,_,m){var w=m?y:this.toBBox(y),E=[],b=this._chooseSubtree(w,this.data,_,E);for(b.children.push(y),l(b,w);_>=0&&E[_].children.length>this._maxEntries;)this._split(E,_),_--;this._adjustParentBBoxes(w,E,_)},s.prototype._split=function(y,_){var m=y[_],w=m.children.length,E=this._minEntries;this._chooseSplitAxis(m,E,w);var b=this._chooseSplitIndex(m,E,w),I=S(m.children.splice(b,m.children.length-b));I.height=m.height,I.leaf=m.leaf,a(m,this.toBBox),a(I,this.toBBox),_?y[_-1].children.push(I):this._splitRoot(m,I)},s.prototype._splitRoot=function(y,_){this.data=S([y,_]),this.data.height=y.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(y,_,m){for(var w,E,b,I,T,D,x,N=1/0,L=1/0,A=_;A<=m-_;A++){var J=u(y,0,A,this.toBBox),H=u(y,A,m,this.toBBox),Z=(E=J,b=H,I=void 0,T=void 0,D=void 0,x=void 0,I=Math.max(E.minX,b.minX),T=Math.max(E.minY,b.minY),D=Math.min(E.maxX,b.maxX),x=Math.min(E.maxY,b.maxY),Math.max(0,D-I)*Math.max(0,x-T)),ct=f(J)+f(H);Z<N?(N=Z,w=A,L=ct<L?ct:L):Z===N&&ct<L&&(L=ct,w=A)}return w||m-_},s.prototype._chooseSplitAxis=function(y,_,m){var w=y.leaf?this.compareMinX:c,E=y.leaf?this.compareMinY:h;this._allDistMargin(y,_,m,w)<this._allDistMargin(y,_,m,E)&&y.children.sort(w)},s.prototype._allDistMargin=function(y,_,m,w){y.children.sort(w);for(var E=this.toBBox,b=u(y,0,_,E),I=u(y,m-_,m,E),T=p(b)+p(I),D=_;D<m-_;D++){var x=y.children[D];l(b,y.leaf?E(x):x),T+=p(b)}for(var N=m-_-1;N>=_;N--){var L=y.children[N];l(I,y.leaf?E(L):L),T+=p(I)}return T},s.prototype._adjustParentBBoxes=function(y,_,m){for(var w=m;w>=0;w--)l(_[w],y)},s.prototype._condense=function(y){for(var _=y.length-1,m=void 0;_>=0;_--)y[_].children.length===0?_>0?(m=y[_-1].children).splice(m.indexOf(y[_]),1):this.clear():a(y[_],this.toBBox)},s})}(Zl)),Zl.exports}class jw{constructor(e=[],t=Bw){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:n}=this,i=t[e];for(;e>0;){const s=e-1>>1,o=t[s];if(n(i,o)>=0)break;t[e]=o,e=s}t[e]=i}_down(e){const{data:t,compare:n}=this,i=this.length>>1,s=t[e];for(;e<i;){let o=(e<<1)+1,a=t[o];const u=o+1;if(u<this.length&&n(t[u],a)<0&&(o=u,a=t[u]),n(a,s)>=0)break;t[e]=a,e=o}t[e]=s}}function Bw(r,e){return r<e?-1:r>e?1:0}const zw=S0(Object.freeze(Object.defineProperty({__proto__:null,default:jw},Symbol.toStringTag,{value:"Module"})));var Vu={exports:{}},ed,Qg;function Uw(){return Qg||(Qg=1,ed=function(e,t,n,i){var s=e[0],o=e[1],a=!1;n===void 0&&(n=0),i===void 0&&(i=t.length);for(var u=(i-n)/2,l=0,c=u-1;l<u;c=l++){var h=t[n+l*2+0],f=t[n+l*2+1],p=t[n+c*2+0],v=t[n+c*2+1],C=f>o!=v>o&&s<(p-h)*(o-f)/(v-f)+h;C&&(a=!a)}return a}),ed}var nd,tm;function Gw(){return tm||(tm=1,nd=function(e,t,n,i){var s=e[0],o=e[1],a=!1;n===void 0&&(n=0),i===void 0&&(i=t.length);for(var u=i-n,l=0,c=u-1;l<u;c=l++){var h=t[l+n][0],f=t[l+n][1],p=t[c+n][0],v=t[c+n][1],C=f>o!=v>o&&s<(p-h)*(o-f)/(v-f)+h;C&&(a=!a)}return a}),nd}var em;function Ww(){if(em)return Vu.exports;em=1;var r=Uw(),e=Gw();return Vu.exports=function(n,i,s,o){return i.length>0&&Array.isArray(i[0])?e(n,i,s,o):r(n,i,s,o)},Vu.exports.nested=e,Vu.exports.flat=r,Vu.exports}var ju={exports:{}},Hw=ju.exports,nm;function qw(){return nm||(nm=1,function(r,e){(function(t,n){n(e)})(Hw,function(t){const i=33306690738754706e-32;function s(C,S,P,y,_){let m,w,E,b,I=S[0],T=y[0],D=0,x=0;T>I==T>-I?(m=I,I=S[++D]):(m=T,T=y[++x]);let N=0;if(D<C&&x<P)for(T>I==T>-I?(E=m-((w=I+m)-I),I=S[++D]):(E=m-((w=T+m)-T),T=y[++x]),m=w,E!==0&&(_[N++]=E);D<C&&x<P;)T>I==T>-I?(E=m-((w=m+I)-(b=w-m))+(I-b),I=S[++D]):(E=m-((w=m+T)-(b=w-m))+(T-b),T=y[++x]),m=w,E!==0&&(_[N++]=E);for(;D<C;)E=m-((w=m+I)-(b=w-m))+(I-b),I=S[++D],m=w,E!==0&&(_[N++]=E);for(;x<P;)E=m-((w=m+T)-(b=w-m))+(T-b),T=y[++x],m=w,E!==0&&(_[N++]=E);return m===0&&N!==0||(_[N++]=m),N}function o(C){return new Float64Array(C)}const a=33306690738754716e-32,u=22204460492503146e-32,l=11093356479670487e-47,c=o(4),h=o(8),f=o(12),p=o(16),v=o(4);t.orient2d=function(C,S,P,y,_,m){const w=(S-m)*(P-_),E=(C-_)*(y-m),b=w-E;if(w===0||E===0||w>0!=E>0)return b;const I=Math.abs(w+E);return Math.abs(b)>=a*I?b:-function(T,D,x,N,L,A,J){let H,Z,ct,mt,Y,$,K,Et,kt,Nt,Dt,zt,ye,Zt,Sn,bn,z,G;const ft=T-L,Vt=x-L,ne=D-A,we=N-A;Y=(Sn=(Et=ft-(K=($=134217729*ft)-($-ft)))*(Nt=we-(kt=($=134217729*we)-($-we)))-((Zt=ft*we)-K*kt-Et*kt-K*Nt))-(Dt=Sn-(z=(Et=ne-(K=($=134217729*ne)-($-ne)))*(Nt=Vt-(kt=($=134217729*Vt)-($-Vt)))-((bn=ne*Vt)-K*kt-Et*kt-K*Nt))),c[0]=Sn-(Dt+Y)+(Y-z),Y=(ye=Zt-((zt=Zt+Dt)-(Y=zt-Zt))+(Dt-Y))-(Dt=ye-bn),c[1]=ye-(Dt+Y)+(Y-bn),Y=(G=zt+Dt)-zt,c[2]=zt-(G-Y)+(Dt-Y),c[3]=G;let Ks=function(Wb,qy){let Xy=qy[0];for(let pp=1;pp<Wb;pp++)Xy+=qy[pp];return Xy}(4,c),xl=u*J;if(Ks>=xl||-Ks>=xl||(H=T-(ft+(Y=T-ft))+(Y-L),ct=x-(Vt+(Y=x-Vt))+(Y-L),Z=D-(ne+(Y=D-ne))+(Y-A),mt=N-(we+(Y=N-we))+(Y-A),H===0&&Z===0&&ct===0&&mt===0)||(xl=l*J+i*Math.abs(Ks),(Ks+=ft*mt+we*H-(ne*ct+Vt*Z))>=xl||-Ks>=xl))return Ks;Y=(Sn=(Et=H-(K=($=134217729*H)-($-H)))*(Nt=we-(kt=($=134217729*we)-($-we)))-((Zt=H*we)-K*kt-Et*kt-K*Nt))-(Dt=Sn-(z=(Et=Z-(K=($=134217729*Z)-($-Z)))*(Nt=Vt-(kt=($=134217729*Vt)-($-Vt)))-((bn=Z*Vt)-K*kt-Et*kt-K*Nt))),v[0]=Sn-(Dt+Y)+(Y-z),Y=(ye=Zt-((zt=Zt+Dt)-(Y=zt-Zt))+(Dt-Y))-(Dt=ye-bn),v[1]=ye-(Dt+Y)+(Y-bn),Y=(G=zt+Dt)-zt,v[2]=zt-(G-Y)+(Dt-Y),v[3]=G;const zb=s(4,c,4,v,h);Y=(Sn=(Et=ft-(K=($=134217729*ft)-($-ft)))*(Nt=mt-(kt=($=134217729*mt)-($-mt)))-((Zt=ft*mt)-K*kt-Et*kt-K*Nt))-(Dt=Sn-(z=(Et=ne-(K=($=134217729*ne)-($-ne)))*(Nt=ct-(kt=($=134217729*ct)-($-ct)))-((bn=ne*ct)-K*kt-Et*kt-K*Nt))),v[0]=Sn-(Dt+Y)+(Y-z),Y=(ye=Zt-((zt=Zt+Dt)-(Y=zt-Zt))+(Dt-Y))-(Dt=ye-bn),v[1]=ye-(Dt+Y)+(Y-bn),Y=(G=zt+Dt)-zt,v[2]=zt-(G-Y)+(Dt-Y),v[3]=G;const Ub=s(zb,h,4,v,f);Y=(Sn=(Et=H-(K=($=134217729*H)-($-H)))*(Nt=mt-(kt=($=134217729*mt)-($-mt)))-((Zt=H*mt)-K*kt-Et*kt-K*Nt))-(Dt=Sn-(z=(Et=Z-(K=($=134217729*Z)-($-Z)))*(Nt=ct-(kt=($=134217729*ct)-($-ct)))-((bn=Z*ct)-K*kt-Et*kt-K*Nt))),v[0]=Sn-(Dt+Y)+(Y-z),Y=(ye=Zt-((zt=Zt+Dt)-(Y=zt-Zt))+(Dt-Y))-(Dt=ye-bn),v[1]=ye-(Dt+Y)+(Y-bn),Y=(G=zt+Dt)-zt,v[2]=zt-(G-Y)+(Dt-Y),v[3]=G;const Gb=s(Ub,f,4,v,p);return p[Gb-1]}(C,S,P,y,_,m,I)},t.orient2dfast=function(C,S,P,y,_,m){return(S-m)*(P-_)-(C-_)*(y-m)},Object.defineProperty(t,"__esModule",{value:!0})})}(ju,ju.exports)),ju.exports}var rm;function Xw(){if(rm)return Kl.exports;rm=1;var r=Zg(),e=zw,t=Ww(),n=qw().orient2d;e.default&&(e=e.default),Kl.exports=i,Kl.exports.default=i;function i(m,w,E){w=Math.max(0,w===void 0?2:w),E=E||0;var b=p(m),I=new r(16);I.toBBox=function(K){return{minX:K[0],minY:K[1],maxX:K[0],maxY:K[1]}},I.compareMinX=function(K,Et){return K[0]-Et[0]},I.compareMinY=function(K,Et){return K[1]-Et[1]},I.load(m);for(var T=[],D=0,x;D<b.length;D++){var N=b[D];I.remove(N),x=v(N,x),T.push(x)}var L=new r(16);for(D=0;D<T.length;D++)L.insert(f(T[D]));for(var A=w*w,J=E*E;T.length;){var H=T.shift(),Z=H.p,ct=H.next.p,mt=C(Z,ct);if(!(mt<J)){var Y=mt/A;N=s(I,H.prev.p,Z,ct,H.next.next.p,Y,L),N&&Math.min(C(N,Z),C(N,ct))<=Y&&(T.push(H),T.push(v(N,H)),I.remove(N),L.remove(H),L.insert(f(H)),L.insert(f(H.next)))}}H=x;var $=[];do $.push(H.p),H=H.next;while(H!==x);return $.push(H.p),$}function s(m,w,E,b,I,T,D){for(var x=new e([],o),N=m.data;N;){for(var L=0;L<N.children.length;L++){var A=N.children[L],J=N.leaf?S(A,E,b):a(E,b,A);J>T||x.push({node:A,dist:J})}for(;x.length&&!x.peek().node.children;){var H=x.pop(),Z=H.node,ct=S(Z,w,E),mt=S(Z,b,I);if(H.dist<ct&&H.dist<mt&&l(E,Z,D)&&l(b,Z,D))return Z}N=x.pop(),N&&(N=N.node)}return null}function o(m,w){return m.dist-w.dist}function a(m,w,E){if(u(m,E)||u(w,E))return 0;var b=P(m[0],m[1],w[0],w[1],E.minX,E.minY,E.maxX,E.minY);if(b===0)return 0;var I=P(m[0],m[1],w[0],w[1],E.minX,E.minY,E.minX,E.maxY);if(I===0)return 0;var T=P(m[0],m[1],w[0],w[1],E.maxX,E.minY,E.maxX,E.maxY);if(T===0)return 0;var D=P(m[0],m[1],w[0],w[1],E.minX,E.maxY,E.maxX,E.maxY);return D===0?0:Math.min(b,I,T,D)}function u(m,w){return m[0]>=w.minX&&m[0]<=w.maxX&&m[1]>=w.minY&&m[1]<=w.maxY}function l(m,w,E){for(var b=Math.min(m[0],w[0]),I=Math.min(m[1],w[1]),T=Math.max(m[0],w[0]),D=Math.max(m[1],w[1]),x=E.search({minX:b,minY:I,maxX:T,maxY:D}),N=0;N<x.length;N++)if(h(x[N].p,x[N].next.p,m,w))return!1;return!0}function c(m,w,E){return n(m[0],m[1],w[0],w[1],E[0],E[1])}function h(m,w,E,b){return m!==b&&w!==E&&c(m,w,E)>0!=c(m,w,b)>0&&c(E,b,m)>0!=c(E,b,w)>0}function f(m){var w=m.p,E=m.next.p;return m.minX=Math.min(w[0],E[0]),m.minY=Math.min(w[1],E[1]),m.maxX=Math.max(w[0],E[0]),m.maxY=Math.max(w[1],E[1]),m}function p(m){for(var w=m[0],E=m[0],b=m[0],I=m[0],T=0;T<m.length;T++){var D=m[T];D[0]<w[0]&&(w=D),D[0]>b[0]&&(b=D),D[1]<E[1]&&(E=D),D[1]>I[1]&&(I=D)}var x=[w,E,b,I],N=x.slice();for(T=0;T<m.length;T++)t(m[T],x)||N.push(m[T]);return _(N)}function v(m,w){var E={p:m,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return w?(E.next=w.next,E.prev=w,w.next.prev=E,w.next=E):(E.prev=E,E.next=E),E}function C(m,w){var E=m[0]-w[0],b=m[1]-w[1];return E*E+b*b}function S(m,w,E){var b=w[0],I=w[1],T=E[0]-b,D=E[1]-I;if(T!==0||D!==0){var x=((m[0]-b)*T+(m[1]-I)*D)/(T*T+D*D);x>1?(b=E[0],I=E[1]):x>0&&(b+=T*x,I+=D*x)}return T=m[0]-b,D=m[1]-I,T*T+D*D}function P(m,w,E,b,I,T,D,x){var N=E-m,L=b-w,A=D-I,J=x-T,H=m-I,Z=w-T,ct=N*N+L*L,mt=N*A+L*J,Y=A*A+J*J,$=N*H+L*Z,K=A*H+J*Z,Et=ct*Y-mt*mt,kt,Nt,Dt,zt,ye=Et,Zt=Et;Et===0?(Nt=0,ye=1,zt=K,Zt=Y):(Nt=mt*K-Y*$,zt=ct*K-mt*$,Nt<0?(Nt=0,zt=K,Zt=Y):Nt>ye&&(Nt=ye,zt=K+mt,Zt=Y)),zt<0?(zt=0,-$<0?Nt=0:-$>ct?Nt=ye:(Nt=-$,ye=ct)):zt>Zt&&(zt=Zt,-$+mt<0?Nt=0:-$+mt>ct?Nt=ye:(Nt=-$+mt,ye=ct)),kt=Nt===0?0:Nt/ye,Dt=zt===0?0:zt/Zt;var Sn=(1-kt)*m+kt*E,bn=(1-kt)*w+kt*b,z=(1-Dt)*I+Dt*D,G=(1-Dt)*T+Dt*x,ft=z-Sn,Vt=G-bn;return ft*ft+Vt*Vt}function y(m,w){return m[0]===w[0]?m[1]-w[1]:m[0]-w[0]}function _(m){m.sort(y);for(var w=[],E=0;E<m.length;E++){for(;w.length>=2&&c(w[w.length-2],w[w.length-1],m[E])<=0;)w.pop();w.push(m[E])}for(var b=[],I=m.length-1;I>=0;I--){for(;b.length>=2&&c(b[b.length-2],b[b.length-1],m[I])<=0;)b.pop();b.push(m[I])}return b.pop(),w.pop(),w.concat(b)}return Kl.exports}var Yw=Xw();const Jw=Vh(Yw);function $w(r,e){e===void 0&&(e={}),e.concavity=e.concavity||1/0;var t=[];if(ua(r,function(i){t.push([i[0],i[1]])}),!t.length)return null;var n=Jw(t,e.concavity);return n.length>3?Pn([n]):null}function im(r,e){e===void 0&&(e={});var t=0,n=0,i=0;return ua(r,function(s){t+=s[0],n+=s[1],i++},!0),Jt([t/i,n/i],e.properties)}function sm(r,e){switch(e===void 0&&(e={}),Nw(r)){case"Point":return Jt(In(r),e.properties);case"Polygon":var t=[];ua(r,function(m){t.push(m)});var n=im(r,{properties:e.properties}),i=n.geometry.coordinates,s=0,o=0,a=0,u,l,c,h,f,p,v,C,S=t.map(function(m){return[m[0]-i[0],m[1]-i[1]]});for(u=0;u<t.length-1;u++)l=S[u],h=l[0],p=l[1],c=S[u+1],f=c[0],v=c[1],C=h*v-f*p,a+=C,s+=(h+f)*C,o+=(p+v)*C;if(a===0)return n;var P=a*.5,y=1/(6*P);return Jt([i[0]+y*s,i[1]+y*o],e.properties);default:var _=$w(r);return _?sm(_,{properties:e.properties}):im(r,{properties:e.properties})}}function Kw(r){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]);const e=Pn([r]),n=sm(e).geometry.coordinates;return[n[0],n[1],n[2]??r[0][2]??0]}function om(r,e,t,n){const[i,s,o]=r,a=aa(Jt([i,s]),e,t,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return n=n||[0,0,0],n[0]=a.geometry.coordinates[0],n[1]=a.geometry.coordinates[1],n[2]=o,n}function Ql(r,e){return Xi(Jt(r),Jt(e),{units:"meters"})}function Bu(r,e){return ku(Jt(r),Jt(e))}function am(r){if(!r)throw new Error("geojson is required");var e=[];return Zh(r,function(t){Zw(t,e)}),oa(e)}function Zw(r,e){var t=[],n=r.geometry;if(n!==null){switch(n.type){case"Polygon":t=so(n);break;case"LineString":t=[so(n)]}t.forEach(function(i){var s=Qw(i,r.properties);s.forEach(function(o){o.id=e.length,e.push(o)})})}}function Qw(r,e){var t=[];return r.reduce(function(n,i){var s=Br([n,i],e);return s.bbox=tE(n,i),t.push(s),i}),t}function tE(r,e){var t=r[0],n=r[1],i=e[0],s=e[1],o=t<i?t:i,a=n<s?n:s,u=t>i?t:i,l=n>s?n:s;return[o,a,u,l]}var tc={exports:{}},rd={},um;function lm(){return um||(um=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=63710088e-1,r.factors={centimeters:r.earthRadius*100,centimetres:r.earthRadius*100,degrees:r.earthRadius/111325,feet:r.earthRadius*3.28084,inches:r.earthRadius*39.37,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:r.earthRadius*1e3,millimetres:r.earthRadius*1e3,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius*1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1.0936133},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function e(x,N,L){L===void 0&&(L={});var A={type:"Feature"};return(L.id===0||L.id)&&(A.id=L.id),L.bbox&&(A.bbox=L.bbox),A.properties=N||{},A.geometry=x,A}r.feature=e;function t(x,N,L){switch(x){case"Point":return n(N).geometry;case"LineString":return a(N).geometry;case"Polygon":return s(N).geometry;case"MultiPoint":return h(N).geometry;case"MultiLineString":return c(N).geometry;case"MultiPolygon":return f(N).geometry;default:throw new Error(x+" is invalid")}}r.geometry=t;function n(x,N,L){if(L===void 0&&(L={}),!x)throw new Error("coordinates is required");if(!Array.isArray(x))throw new Error("coordinates must be an Array");if(x.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!b(x[0])||!b(x[1]))throw new Error("coordinates must contain numbers");var A={type:"Point",coordinates:x};return e(A,N,L)}r.point=n;function i(x,N,L){return L===void 0&&(L={}),l(x.map(function(A){return n(A,N)}),L)}r.points=i;function s(x,N,L){L===void 0&&(L={});for(var A=0,J=x;A<J.length;A++){var H=J[A];if(H.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var Z=0;Z<H[H.length-1].length;Z++)if(H[H.length-1][Z]!==H[0][Z])throw new Error("First and last Position are not equivalent.")}var ct={type:"Polygon",coordinates:x};return e(ct,N,L)}r.polygon=s;function o(x,N,L){return L===void 0&&(L={}),l(x.map(function(A){return s(A,N)}),L)}r.polygons=o;function a(x,N,L){if(L===void 0&&(L={}),x.length<2)throw new Error("coordinates must be an array of two or more positions");var A={type:"LineString",coordinates:x};return e(A,N,L)}r.lineString=a;function u(x,N,L){return L===void 0&&(L={}),l(x.map(function(A){return a(A,N)}),L)}r.lineStrings=u;function l(x,N){N===void 0&&(N={});var L={type:"FeatureCollection"};return N.id&&(L.id=N.id),N.bbox&&(L.bbox=N.bbox),L.features=x,L}r.featureCollection=l;function c(x,N,L){L===void 0&&(L={});var A={type:"MultiLineString",coordinates:x};return e(A,N,L)}r.multiLineString=c;function h(x,N,L){L===void 0&&(L={});var A={type:"MultiPoint",coordinates:x};return e(A,N,L)}r.multiPoint=h;function f(x,N,L){L===void 0&&(L={});var A={type:"MultiPolygon",coordinates:x};return e(A,N,L)}r.multiPolygon=f;function p(x,N,L){L===void 0&&(L={});var A={type:"GeometryCollection",geometries:x};return e(A,N,L)}r.geometryCollection=p;function v(x,N){if(N===void 0&&(N=0),N&&!(N>=0))throw new Error("precision must be a positive number");var L=Math.pow(10,N||0);return Math.round(x*L)/L}r.round=v;function C(x,N){N===void 0&&(N="kilometers");var L=r.factors[N];if(!L)throw new Error(N+" units is invalid");return x*L}r.radiansToLength=C;function S(x,N){N===void 0&&(N="kilometers");var L=r.factors[N];if(!L)throw new Error(N+" units is invalid");return x/L}r.lengthToRadians=S;function P(x,N){return _(S(x,N))}r.lengthToDegrees=P;function y(x){var N=x%360;return N<0&&(N+=360),N}r.bearingToAzimuth=y;function _(x){var N=x%(2*Math.PI);return N*180/Math.PI}r.radiansToDegrees=_;function m(x){var N=x%360;return N*Math.PI/180}r.degreesToRadians=m;function w(x,N,L){if(N===void 0&&(N="kilometers"),L===void 0&&(L="kilometers"),!(x>=0))throw new Error("length must be a positive number");return C(S(x,N),L)}r.convertLength=w;function E(x,N,L){if(N===void 0&&(N="meters"),L===void 0&&(L="kilometers"),!(x>=0))throw new Error("area must be a positive number");var A=r.areaFactors[N];if(!A)throw new Error("invalid original units");var J=r.areaFactors[L];if(!J)throw new Error("invalid final units");return x/A*J}r.convertArea=E;function b(x){return!isNaN(x)&&x!==null&&!Array.isArray(x)}r.isNumber=b;function I(x){return!!x&&x.constructor===Object}r.isObject=I;function T(x){if(!x)throw new Error("bbox is required");if(!Array.isArray(x))throw new Error("bbox must be an Array");if(x.length!==4&&x.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");x.forEach(function(N){if(!b(N))throw new Error("bbox must only contain numbers")})}r.validateBBox=T;function D(x){if(!x)throw new Error("id is required");if(["string","number"].indexOf(typeof x)===-1)throw new Error("id must be a number or a string")}r.validateId=D}(rd)),rd}var xe={},cm;function hm(){if(cm)return xe;cm=1,Object.defineProperty(xe,"__esModule",{value:!0});var r=lm();function e(y,_,m){if(y!==null)for(var w,E,b,I,T,D,x,N=0,L=0,A,J=y.type,H=J==="FeatureCollection",Z=J==="Feature",ct=H?y.features.length:1,mt=0;mt<ct;mt++){x=H?y.features[mt].geometry:Z?y.geometry:y,A=x?x.type==="GeometryCollection":!1,T=A?x.geometries.length:1;for(var Y=0;Y<T;Y++){var $=0,K=0;if(I=A?x.geometries[Y]:x,I!==null){D=I.coordinates;var Et=I.type;switch(N=m&&(Et==="Polygon"||Et==="MultiPolygon")?1:0,Et){case null:break;case"Point":if(_(D,L,mt,$,K)===!1)return!1;L++,$++;break;case"LineString":case"MultiPoint":for(w=0;w<D.length;w++){if(_(D[w],L,mt,$,K)===!1)return!1;L++,Et==="MultiPoint"&&$++}Et==="LineString"&&$++;break;case"Polygon":case"MultiLineString":for(w=0;w<D.length;w++){for(E=0;E<D[w].length-N;E++){if(_(D[w][E],L,mt,$,K)===!1)return!1;L++}Et==="MultiLineString"&&$++,Et==="Polygon"&&K++}Et==="Polygon"&&$++;break;case"MultiPolygon":for(w=0;w<D.length;w++){for(K=0,E=0;E<D[w].length;E++){for(b=0;b<D[w][E].length-N;b++){if(_(D[w][E][b],L,mt,$,K)===!1)return!1;L++}K++}$++}break;case"GeometryCollection":for(w=0;w<I.geometries.length;w++)if(e(I.geometries[w],_,m)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function t(y,_,m,w){var E=m;return e(y,function(b,I,T,D,x){I===0&&m===void 0?E=b:E=_(E,b,I,T,D,x)},w),E}function n(y,_){var m;switch(y.type){case"FeatureCollection":for(m=0;m<y.features.length&&_(y.features[m].properties,m)!==!1;m++);break;case"Feature":_(y.properties,0);break}}function i(y,_,m){var w=m;return n(y,function(E,b){b===0&&m===void 0?w=E:w=_(w,E,b)}),w}function s(y,_){if(y.type==="Feature")_(y,0);else if(y.type==="FeatureCollection")for(var m=0;m<y.features.length&&_(y.features[m],m)!==!1;m++);}function o(y,_,m){var w=m;return s(y,function(E,b){b===0&&m===void 0?w=E:w=_(w,E,b)}),w}function a(y){var _=[];return e(y,function(m){_.push(m)}),_}function u(y,_){var m,w,E,b,I,T,D,x,N,L,A=0,J=y.type==="FeatureCollection",H=y.type==="Feature",Z=J?y.features.length:1;for(m=0;m<Z;m++){for(T=J?y.features[m].geometry:H?y.geometry:y,x=J?y.features[m].properties:H?y.properties:{},N=J?y.features[m].bbox:H?y.bbox:void 0,L=J?y.features[m].id:H?y.id:void 0,D=T?T.type==="GeometryCollection":!1,I=D?T.geometries.length:1,E=0;E<I;E++){if(b=D?T.geometries[E]:T,b===null){if(_(null,A,x,N,L)===!1)return!1;continue}switch(b.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(_(b,A,x,N,L)===!1)return!1;break}case"GeometryCollection":{for(w=0;w<b.geometries.length;w++)if(_(b.geometries[w],A,x,N,L)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}A++}}function l(y,_,m){var w=m;return u(y,function(E,b,I,T,D){b===0&&m===void 0?w=E:w=_(w,E,b,I,T,D)}),w}function c(y,_){u(y,function(m,w,E,b,I){var T=m===null?null:m.type;switch(T){case null:case"Point":case"LineString":case"Polygon":return _(r.feature(m,E,{bbox:b,id:I}),w,0)===!1?!1:void 0}var D;switch(T){case"MultiPoint":D="Point";break;case"MultiLineString":D="LineString";break;case"MultiPolygon":D="Polygon";break}for(var x=0;x<m.coordinates.length;x++){var N=m.coordinates[x],L={type:D,coordinates:N};if(_(r.feature(L,E),w,x)===!1)return!1}})}function h(y,_,m){var w=m;return c(y,function(E,b,I){b===0&&I===0&&m===void 0?w=E:w=_(w,E,b,I)}),w}function f(y,_){c(y,function(m,w,E){var b=0;if(m.geometry){var I=m.geometry.type;if(!(I==="Point"||I==="MultiPoint")){var T,D=0,x=0,N=0;if(e(m,function(L,A,J,H,Z){if(T===void 0||w>D||H>x||Z>N){T=L,D=w,x=H,N=Z,b=0;return}var ct=r.lineString([T,L],m.properties);if(_(ct,w,E,Z,b)===!1)return!1;b++,T=L})===!1)return!1}}})}function p(y,_,m){var w=m,E=!1;return f(y,function(b,I,T,D,x){E===!1&&m===void 0?w=b:w=_(w,b,I,T,D,x),E=!0}),w}function v(y,_){if(!y)throw new Error("geojson is required");c(y,function(m,w,E){if(m.geometry!==null){var b=m.geometry.type,I=m.geometry.coordinates;switch(b){case"LineString":if(_(m,w,E,0,0)===!1)return!1;break;case"Polygon":for(var T=0;T<I.length;T++)if(_(r.lineString(I[T],m.properties),w,E,T)===!1)return!1;break}}})}function C(y,_,m){var w=m;return v(y,function(E,b,I,T){b===0&&m===void 0?w=E:w=_(w,E,b,I,T)}),w}function S(y,_){if(_=_||{},!r.isObject(_))throw new Error("options is invalid");var m=_.featureIndex||0,w=_.multiFeatureIndex||0,E=_.geometryIndex||0,b=_.segmentIndex||0,I=_.properties,T;switch(y.type){case"FeatureCollection":m<0&&(m=y.features.length+m),I=I||y.features[m].properties,T=y.features[m].geometry;break;case"Feature":I=I||y.properties,T=y.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":T=y;break;default:throw new Error("geojson is invalid")}if(T===null)return null;var D=T.coordinates;switch(T.type){case"Point":case"MultiPoint":return null;case"LineString":return b<0&&(b=D.length+b-1),r.lineString([D[b],D[b+1]],I,_);case"Polygon":return E<0&&(E=D.length+E),b<0&&(b=D[E].length+b-1),r.lineString([D[E][b],D[E][b+1]],I,_);case"MultiLineString":return w<0&&(w=D.length+w),b<0&&(b=D[w].length+b-1),r.lineString([D[w][b],D[w][b+1]],I,_);case"MultiPolygon":return w<0&&(w=D.length+w),E<0&&(E=D[w].length+E),b<0&&(b=D[w][E].length-b-1),r.lineString([D[w][E][b],D[w][E][b+1]],I,_)}throw new Error("geojson is invalid")}function P(y,_){if(_=_||{},!r.isObject(_))throw new Error("options is invalid");var m=_.featureIndex||0,w=_.multiFeatureIndex||0,E=_.geometryIndex||0,b=_.coordIndex||0,I=_.properties,T;switch(y.type){case"FeatureCollection":m<0&&(m=y.features.length+m),I=I||y.features[m].properties,T=y.features[m].geometry;break;case"Feature":I=I||y.properties,T=y.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":T=y;break;default:throw new Error("geojson is invalid")}if(T===null)return null;var D=T.coordinates;switch(T.type){case"Point":return r.point(D,I,_);case"MultiPoint":return w<0&&(w=D.length+w),r.point(D[w],I,_);case"LineString":return b<0&&(b=D.length+b),r.point(D[b],I,_);case"Polygon":return E<0&&(E=D.length+E),b<0&&(b=D[E].length+b),r.point(D[E][b],I,_);case"MultiLineString":return w<0&&(w=D.length+w),b<0&&(b=D[w].length+b),r.point(D[w][b],I,_);case"MultiPolygon":return w<0&&(w=D.length+w),E<0&&(E=D[w].length+E),b<0&&(b=D[w][E].length-b),r.point(D[w][E][b],I,_)}throw new Error("geojson is invalid")}return xe.coordAll=a,xe.coordEach=e,xe.coordReduce=t,xe.featureEach=s,xe.featureReduce=o,xe.findPoint=P,xe.findSegment=S,xe.flattenEach=c,xe.flattenReduce=h,xe.geomEach=u,xe.geomReduce=l,xe.lineEach=v,xe.lineReduce=C,xe.propEach=n,xe.propReduce=i,xe.segmentEach=f,xe.segmentReduce=p,xe}var ec={},dm;function eE(){if(dm)return ec;dm=1,Object.defineProperty(ec,"__esModule",{value:!0});var r=hm();function e(t){var n=[1/0,1/0,-1/0,-1/0];return r.coordEach(t,function(i){n[0]>i[0]&&(n[0]=i[0]),n[1]>i[1]&&(n[1]=i[1]),n[2]<i[0]&&(n[2]=i[0]),n[3]<i[1]&&(n[3]=i[1])}),n}return e.default=e,ec.default=e,ec}var fm;function nE(){if(fm)return tc.exports;fm=1;var r=Zg(),e=lm(),t=hm(),n=eE().default,i=t.featureEach;t.coordEach,e.polygon;var s=e.featureCollection;function o(a){var u=new r(a);return u.insert=function(l){if(l.type!=="Feature")throw new Error("invalid feature");return l.bbox=l.bbox?l.bbox:n(l),r.prototype.insert.call(this,l)},u.load=function(l){var c=[];return Array.isArray(l)?l.forEach(function(h){if(h.type!=="Feature")throw new Error("invalid features");h.bbox=h.bbox?h.bbox:n(h),c.push(h)}):i(l,function(h){if(h.type!=="Feature")throw new Error("invalid features");h.bbox=h.bbox?h.bbox:n(h),c.push(h)}),r.prototype.load.call(this,c)},u.remove=function(l,c){if(l.type!=="Feature")throw new Error("invalid feature");return l.bbox=l.bbox?l.bbox:n(l),r.prototype.remove.call(this,l,c)},u.clear=function(){return r.prototype.clear.call(this)},u.search=function(l){var c=r.prototype.search.call(this,this.toBBox(l));return s(c)},u.collides=function(l){return r.prototype.collides.call(this,this.toBBox(l))},u.all=function(){var l=r.prototype.all.call(this);return s(l)},u.toJSON=function(){return r.prototype.toJSON.call(this)},u.fromJSON=function(l){return r.prototype.fromJSON.call(this,l)},u.toBBox=function(l){var c;if(l.bbox)c=l.bbox;else if(Array.isArray(l)&&l.length===4)c=l;else if(Array.isArray(l)&&l.length===6)c=[l[0],l[1],l[3],l[4]];else if(l.type==="Feature")c=n(l);else if(l.type==="FeatureCollection")c=n(l);else throw new Error("invalid geojson");return{minX:c[0],minY:c[1],maxX:c[2],maxY:c[3]}},u}return tc.exports=o,tc.exports.default=o,tc.exports}var rE=nE();const iE=Vh(rE);function pm(r,e){var t={},n=[];if(r.type==="LineString"&&(r=jr(r)),e.type==="LineString"&&(e=jr(e)),r.type==="Feature"&&e.type==="Feature"&&r.geometry!==null&&e.geometry!==null&&r.geometry.type==="LineString"&&e.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var i=gm(r,e);return i&&n.push(i),oa(n)}var s=iE();return s.load(am(e)),Jl(am(r),function(o){Jl(s.search(o),function(a){var u=gm(o,a);if(u){var l=so(u).join(",");t[l]||(t[l]=!0,n.push(u))}})}),oa(n)}function gm(r,e){var t=so(r),n=so(e);if(t.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=t[0][0],s=t[0][1],o=t[1][0],a=t[1][1],u=n[0][0],l=n[0][1],c=n[1][0],h=n[1][1],f=(h-l)*(o-i)-(c-u)*(a-s),p=(c-u)*(s-l)-(h-l)*(i-u),v=(o-i)*(s-l)-(a-s)*(i-u);if(f===0)return null;var C=p/f,S=v/f;if(C>=0&&C<=1&&S>=0&&S<=1){var P=i+C*(o-i),y=s+C*(a-s);return Jt([P,y])}return null}function sE(r,e){return pm(Br(r),Br(e))}function oE(r,e){var t=Xi(r,e),n=ku(r,e),i=aa(r,t/2,n);return i}function aE(r,e){const t=Jt(r),n=Jt(e),i=oE(t,n),s=(r[2]+e[2])/2;return[...i.geometry.coordinates,s]}function uE(r,e,t){t===void 0&&(t={});var n=Jt([1/0,1/0],{dist:1/0}),i=0;return Zh(r,function(s){for(var o=so(s),a=0;a<o.length-1;a++){var u=Jt(o[a]);u.properties.dist=Xi(e,u,t);var l=Jt(o[a+1]);l.properties.dist=Xi(e,l,t);var c=Xi(u,l,t),h=Math.max(u.properties.dist,l.properties.dist),f=ku(u,l),p=aa(e,h,f+90,t),v=aa(e,h,f-90,t),C=pm(Br([p.geometry.coordinates,v.geometry.coordinates]),Br([u.geometry.coordinates,l.geometry.coordinates])),S=null;C.features.length>0&&(S=C.features[0],S.properties.dist=Xi(e,S,t),S.properties.location=i+Xi(u,S,t)),u.properties.dist<n.properties.dist&&(n=u,n.properties.index=a,n.properties.location=i),l.properties.dist<n.properties.dist&&(n=l,n.properties.index=a+1,n.properties.location=i+c),S&&S.properties.dist<n.properties.dist&&(n=S,n.properties.index=a),i+=c}}),n}function lE(r,e){const t=Jt(e),n=Br(r);return uE(n,t,{units:"meters"})}function mm(r,e,t){t===void 0&&(t={});var n=In(r),i=In(e);i[0]+=i[0]-n[0]>180?-360:n[0]-i[0]>180?360:0;var s=cE(n,i),o=Kh(s,"meters",t.units);return o}function cE(r,e,t){t=t===void 0?tn:Number(t);var n=t,i=r[1]*Math.PI/180,s=e[1]*Math.PI/180,o=s-i,a=Math.abs(e[0]-r[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),l=Math.abs(u)>1e-11?o/u:Math.cos(i),c=Math.sqrt(o*o+l*l*a*a),h=c*n;return h}function hE(r,e,t){if(t===void 0&&(t={}),t.method||(t.method="geodesic"),t.units||(t.units="kilometers"),!r)throw new Error("pt is required");if(Array.isArray(r)?r=Jt(r):r.type==="Point"?r=jr(r):Xg(r,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=Br(e):e.type==="LineString"?e=jr(e):Xg(e,"LineString","line");var n=1/0,i=r.geometry.coordinates;return Fw(e,function(s){var o=s.geometry.coordinates[0],a=s.geometry.coordinates[1],u=dE(i,o,a,t);u<n&&(n=u)}),Kh(n,"degrees",t.units)}function dE(r,e,t,n){var i=[t[0]-e[0],t[1]-e[1]],s=[r[0]-e[0],r[1]-e[1]],o=vm(s,i);if(o<=0)return id(r,e,{method:n.method,units:"degrees"});var a=vm(i,i);if(a<=o)return id(r,t,{method:n.method,units:"degrees"});var u=o/a,l=[e[0]+u*i[0],e[1]+u*i[1]];return id(r,l,{method:n.method,units:"degrees"})}function vm(r,e){return r[0]*e[0]+r[1]*e[1]}function id(r,e,t){return t.method==="planar"?mm(r,e,t):Xi(r,e,t)}function fE(r,e){const t=Jt(r),n=Br(e);return hE(t,n,{units:"meters"})}function pE(r,e,t,n){n===void 0&&(n={});var i=e<0,s=Kh(Math.abs(e),n.units,"meters");i&&(s=-Math.abs(s));var o=In(r),a=gE(o,s,t);return a[0]+=a[0]-o[0]>180?-360:o[0]-a[0]>180?360:0,Jt(a,n.properties)}function gE(r,e,t,n){n=n===void 0?tn:Number(n);var i=e/n,s=r[0]*Math.PI/180,o=hn(r[1]),a=hn(t),u=i*Math.cos(a),l=o+u;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var c=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),h=Math.abs(c)>1e-11?u/c:Math.cos(o),f=i*Math.sin(a)/h,p=s+f;return[(p*180/Math.PI+540)%360-180,l*180/Math.PI]}function mE(r,e,t,n){const[i,s,o]=r,a=pE(Jt([i,s]),e,t,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return n=n||[0,0,0],n[0]=a.geometry.coordinates[0],n[1]=a.geometry.coordinates[1],n[2]=o,n}function ym(r,e){return mm(Jt(r),Jt(e),{units:"meters"})}function vE(r,e,t){t===void 0&&(t={});var n;t.final?n=_m(In(e),In(r)):n=_m(In(r),In(e));var i=n>180?-(360-n):n;return i}function _m(r,e){var t=hn(r[1]),n=hn(e[1]),i=hn(e[0]-r[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var s=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(t/2+Math.PI/4)),o=Math.atan2(i,s);return(Yl(o)+360)%360}function yE(r,e){return vE(Jt(r),Jt(e))}function zr(r){var e=[1/0,1/0,-1/0,-1/0];return ua(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}zr.default=zr;function Ur(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=In(r),i=Jn(e),s=i.type,o=e.bbox,a=i.coordinates;if(o&&_E(n,o)===!1)return!1;s==="Polygon"&&(a=[a]);for(var u=!1,l=0;l<a.length&&!u;l++)if(wm(n,a[l][0],t.ignoreBoundary)){for(var c=!1,h=1;h<a[l].length&&!c;)wm(n,a[l][h],!t.ignoreBoundary)&&(c=!0),h++;c||(u=!0)}return u}function wm(r,e,t){var n=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,s=e.length-1;i<e.length;s=i++){var o=e[i][0],a=e[i][1],u=e[s][0],l=e[s][1],c=r[1]*(o-u)+a*(u-r[0])+l*(r[0]-o)===0&&(o-r[0])*(u-r[0])<=0&&(a-r[1])*(l-r[1])<=0;if(c)return!t;var h=a>r[1]!=l>r[1]&&r[0]<(u-o)*(r[1]-a)/(l-a)+o;h&&(n=!n)}return n}function _E(r,e){return e[0]<=r[0]&&e[1]<=r[1]&&e[2]>=r[0]&&e[3]>=r[1]}function Yi(r,e,t){t===void 0&&(t={});for(var n=In(r),i=so(e),s=0;s<i.length-1;s++){var o=!1;if(t.ignoreEndVertices&&(s===0&&(o="start"),s===i.length-2&&(o="end"),s===0&&s+1===i.length-1&&(o="both")),wE(i[s],i[s+1],n,o,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function wE(r,e,t,n,i){var s=t[0],o=t[1],a=r[0],u=r[1],l=e[0],c=e[1],h=t[0]-a,f=t[1]-u,p=l-a,v=c-u,C=h*v-f*p;if(i!==null){if(Math.abs(C)>i)return!1}else if(C!==0)return!1;if(n){if(n==="start")return Math.abs(p)>=Math.abs(v)?p>0?a<s&&s<=l:l<=s&&s<a:v>0?u<o&&o<=c:c<=o&&o<u;if(n==="end")return Math.abs(p)>=Math.abs(v)?p>0?a<=s&&s<l:l<s&&s<=a:v>0?u<=o&&o<c:c<o&&o<=u;if(n==="both")return Math.abs(p)>=Math.abs(v)?p>0?a<s&&s<l:l<s&&s<a:v>0?u<o&&o<c:c<o&&o<u}else return Math.abs(p)>=Math.abs(v)?p>0?a<=s&&s<=l:l<=s&&s<=a:v>0?u<=o&&o<=c:c<=o&&o<=u;return!1}function EE(r,e){var t=Jn(r),n=Jn(e),i=t.type,s=n.type,o=t.coordinates,a=n.coordinates;switch(i){case"Point":switch(s){case"Point":return sd(o,a);default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"Point":return CE(t,n);case"MultiPoint":return SE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"Point":return Yi(n,t,{ignoreEndVertices:!0});case"LineString":return IE(t,n);case"MultiPoint":return bE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Point":return Ur(n,t,{ignoreBoundary:!0});case"LineString":return xE(t,n);case"Polygon":return TE(t,n);case"MultiPoint":return PE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function CE(r,e){var t,n=!1;for(t=0;t<r.coordinates.length;t++)if(sd(r.coordinates[t],e.coordinates)){n=!0;break}return n}function SE(r,e){for(var t=0,n=e.coordinates;t<n.length;t++){for(var i=n[t],s=!1,o=0,a=r.coordinates;o<a.length;o++){var u=a[o];if(sd(i,u)){s=!0;break}}if(!s)return!1}return!0}function bE(r,e){for(var t=!1,n=0,i=e.coordinates;n<i.length;n++){var s=i[n];if(Yi(s,r,{ignoreEndVertices:!0})&&(t=!0),!Yi(s,r))return!1}return!!t}function PE(r,e){for(var t=0,n=e.coordinates;t<n.length;t++){var i=n[t];if(!Ur(i,r,{ignoreBoundary:!0}))return!1}return!0}function IE(r,e){for(var t=!1,n=0,i=e.coordinates;n<i.length;n++){var s=i[n];if(Yi({type:"Point",coordinates:s},r,{ignoreEndVertices:!0})&&(t=!0),!Yi({type:"Point",coordinates:s},r,{ignoreEndVertices:!1}))return!1}return t}function xE(r,e){var t=!1,n=0,i=zr(r),s=zr(e);if(!Em(i,s))return!1;for(n;n<e.coordinates.length-1;n++){var o=OE(e.coordinates[n],e.coordinates[n+1]);if(Ur({type:"Point",coordinates:o},r,{ignoreBoundary:!0})){t=!0;break}}return t}function TE(r,e){if(r.type==="Feature"&&r.geometry===null||e.type==="Feature"&&e.geometry===null)return!1;var t=zr(r),n=zr(e);if(!Em(t,n))return!1;for(var i=Jn(e).coordinates,s=0,o=i;s<o.length;s++)for(var a=o[s],u=0,l=a;u<l.length;u++){var c=l[u];if(!Ur(c,r))return!1}return!0}function Em(r,e){return!(r[0]>e[0]||r[2]<e[2]||r[1]>e[1]||r[3]<e[3])}function sd(r,e){return r[0]===e[0]&&r[1]===e[1]}function OE(r,e){return[(r[0]+e[0])/2,(r[1]+e[1])/2]}function NE(r,e){var t=Jn(r),n=Jn(e),i=t.type,s=n.type;switch(i){case"Point":switch(s){case"MultiPoint":return DE(t,n);case"LineString":return Yi(t,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Ur(t,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return ME(t,n);case"LineString":return RE(t,n);case"Polygon":case"MultiPolygon":return LE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return FE(t,n);case"Polygon":case"MultiPolygon":return AE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return kE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function DE(r,e){var t,n=!1;for(t=0;t<e.coordinates.length;t++)if(Sm(e.coordinates[t],r.coordinates)){n=!0;break}return n}function ME(r,e){for(var t=0;t<r.coordinates.length;t++){for(var n=!1,i=0;i<e.coordinates.length;i++)Sm(r.coordinates[t],e.coordinates[i])&&(n=!0);if(!n)return!1}return!0}function RE(r,e){for(var t=!1,n=0;n<r.coordinates.length;n++){if(!Yi(r.coordinates[n],e))return!1;t||(t=Yi(r.coordinates[n],e,{ignoreEndVertices:!0}))}return t}function LE(r,e){for(var t=!0,n=!1,i=0;i<r.coordinates.length;i++){if(n=Ur(r.coordinates[1],e),!n){t=!1;break}n=Ur(r.coordinates[1],e,{ignoreBoundary:!0})}return t&&n}function FE(r,e){for(var t=0;t<r.coordinates.length;t++)if(!Yi(r.coordinates[t],e))return!1;return!0}function AE(r,e){var t=zr(e),n=zr(r);if(!Cm(t,n))return!1;for(var i=!1,s=0;s<r.coordinates.length-1;s++){if(!Ur(r.coordinates[s],e))return!1;if(i||(i=Ur(r.coordinates[s],e,{ignoreBoundary:!0})),!i){var o=VE(r.coordinates[s],r.coordinates[s+1]);i=Ur(o,e,{ignoreBoundary:!0})}}return i}function kE(r,e){var t=zr(r),n=zr(e);if(!Cm(n,t))return!1;for(var i=0;i<r.coordinates[0].length;i++)if(!Ur(r.coordinates[0][i],e))return!1;return!0}function Cm(r,e){return!(r[0]>e[0]||r[2]<e[2]||r[1]>e[1]||r[3]<e[3])}function Sm(r,e){return r[0]===e[0]&&r[1]===e[1]}function VE(r,e){return[(r[0]+e[0])/2,(r[1]+e[1])/2]}function jE(r,e){e===void 0&&(e={});var t=zr(r),n=(t[0]+t[2])/2,i=(t[1]+t[3])/2;return Jt([n,i],e.properties,e)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(e){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var t=Object(this),n=Math.max(Math.min(t.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(n+i,0):Math.min(i,n);var s=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:n;for(s=s<0?Math.max(n+arguments[2],0):Math.min(s,n);i<s;)t[i]=e,++i;return t},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!==r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var oo=function(){};oo.prototype.interfaces_=function(){return[]},oo.prototype.getClass=function(){return oo},oo.prototype.equalsWithTolerance=function(e,t,n){return Math.abs(e-t)<=n};var Yt=function(r){function e(t){r.call(this,t),this.name="IllegalArgumentException",this.message=t,this.stack=new r().stack}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e}(Error),ht=function(){},bm={MAX_VALUE:{configurable:!0}};ht.isNaN=function(e){return Number.isNaN(e)},ht.doubleToLongBits=function(e){return e},ht.longBitsToDouble=function(e){return e},ht.isInfinite=function(e){return!Number.isFinite(e)},bm.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(ht,bm);var An=function(){},nc=function(){},la=function(){};function kn(){}var R=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},ao={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};R.prototype.setOrdinate=function(e,t){switch(e){case R.X:this.x=t;break;case R.Y:this.y=t;break;case R.Z:this.z=t;break;default:throw new Yt("Invalid ordinate index: "+e)}},R.prototype.equals2D=function(){if(arguments.length===1){var e=arguments[0];return!(this.x!==e.x||this.y!==e.y)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return!(!oo.equalsWithTolerance(this.x,t.x,n)||!oo.equalsWithTolerance(this.y,t.y,n))}},R.prototype.getOrdinate=function(e){switch(e){case R.X:return this.x;case R.Y:return this.y;case R.Z:return this.z}throw new Yt("Invalid ordinate index: "+e)},R.prototype.equals3D=function(e){return this.x===e.x&&this.y===e.y&&(this.z===e.z||ht.isNaN(this.z))&&ht.isNaN(e.z)},R.prototype.equals=function(e){return e instanceof R?this.equals2D(e):!1},R.prototype.equalInZ=function(e,t){return oo.equalsWithTolerance(this.z,e.z,t)},R.prototype.compareTo=function(e){var t=e;return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0},R.prototype.clone=function(){},R.prototype.copy=function(){return new R(this)},R.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},R.prototype.distance3D=function(e){var t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return Math.sqrt(t*t+n*n+i*i)},R.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},R.prototype.hashCode=function(){var e=17;return e=37*e+R.hashCode(this.x),e=37*e+R.hashCode(this.y),e},R.prototype.setCoordinate=function(e){this.x=e.x,this.y=e.y,this.z=e.z},R.prototype.interfaces_=function(){return[An,nc,kn]},R.prototype.getClass=function(){return R},R.hashCode=function(){if(arguments.length===1){var e=arguments[0],t=ht.doubleToLongBits(e);return Math.trunc((t^t)>>>32)}},ao.DimensionalComparator.get=function(){return Ji},ao.serialVersionUID.get=function(){return 6683108902428367e3},ao.NULL_ORDINATE.get=function(){return ht.NaN},ao.X.get=function(){return 0},ao.Y.get=function(){return 1},ao.Z.get=function(){return 2},Object.defineProperties(R,ao);var Ji=function(e){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t!==2&&t!==3)throw new Yt("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}};Ji.prototype.compare=function(e,t){var n=e,i=t,s=Ji.compare(n.x,i.x);if(s!==0)return s;var o=Ji.compare(n.y,i.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var a=Ji.compare(n.z,i.z);return a},Ji.prototype.interfaces_=function(){return[la]},Ji.prototype.getClass=function(){return Ji},Ji.compare=function(e,t){return e<t?-1:e>t?1:ht.isNaN(e)?ht.isNaN(t)?0:-1:ht.isNaN(t)?1:0};var ca=function(){};ca.prototype.create=function(){},ca.prototype.interfaces_=function(){return[]},ca.prototype.getClass=function(){return ca};var F=function(){},zu={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};F.prototype.interfaces_=function(){return[]},F.prototype.getClass=function(){return F},F.toLocationSymbol=function(e){switch(e){case F.EXTERIOR:return"e";case F.BOUNDARY:return"b";case F.INTERIOR:return"i";case F.NONE:return"-"}throw new Yt("Unknown location value: "+e)},zu.INTERIOR.get=function(){return 0},zu.BOUNDARY.get=function(){return 1},zu.EXTERIOR.get=function(){return 2},zu.NONE.get=function(){return-1},Object.defineProperties(F,zu);var at=function(r,e){return r.interfaces_&&r.interfaces_().indexOf(e)>-1},xn=function(){},Pm={LOG_10:{configurable:!0}};xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},xn.log10=function(e){var t=Math.log(e);return ht.isInfinite(t)||ht.isNaN(t)?t:t/xn.LOG_10},xn.min=function(e,t,n,i){var s=e;return t<s&&(s=t),n<s&&(s=n),i<s&&(s=i),s},xn.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1],n=arguments[2];return e<t?t:e>n?n:e}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],s=arguments[1],o=arguments[2];return i<s?s:i>o?o:i}},xn.wrap=function(e,t){return e<0?t- -e%t:e%t},xn.max=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2],i=e;return t>i&&(i=t),n>i&&(i=n),i}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=s;return o>l&&(l=o),a>l&&(l=a),u>l&&(l=u),l}},xn.average=function(e,t){return(e+t)/2},Pm.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(xn,Pm);var lr=function(e){this.str=e};lr.prototype.append=function(e){this.str+=e},lr.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)},lr.prototype.toString=function(e){return this.str};var cr=function(e){this.value=e};cr.prototype.intValue=function(){return this.value},cr.prototype.compareTo=function(e){return this.value<e?-1:this.value>e?1:0},cr.isNaN=function(e){return Number.isNaN(e)};var Uu=function(){};Uu.isWhitespace=function(e){return e<=32&&e>=0||e===127},Uu.toUpperCase=function(e){return e.toUpperCase()};var k=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof r){var t=arguments[0];this.init(t)}else if(typeof arguments[0]=="string"){var n=arguments[0];r.call(this,r.parse(n))}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.init(i,s)}},$n={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};k.prototype.le=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<=e._lo},k.prototype.extractSignificantDigits=function(e,t){var n=this.abs(),i=k.magnitude(n._hi),s=k.TEN.pow(i);n=n.divide(s),n.gt(k.TEN)?(n=n.divide(k.TEN),i+=1):n.lt(k.ONE)&&(n=n.multiply(k.TEN),i-=1);for(var o=i+1,a=new lr,u=k.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){e&&l===o&&a.append(".");var c=Math.trunc(n._hi);if(c<0)break;var h=!1,f=0;c>9?(h=!0,f="9"):f="0"+c,a.append(f),n=n.subtract(k.valueOf(c)).multiply(k.TEN),h&&n.selfAdd(k.TEN);var p=!0,v=k.magnitude(n._hi);if(v<0&&Math.abs(v)>=u-l&&(p=!1),!p)break}return t[0]=i,a.toString()},k.prototype.sqr=function(){return this.multiply(this)},k.prototype.doubleValue=function(){return this._hi+this._lo},k.prototype.subtract=function(){if(arguments[0]instanceof k){var e=arguments[0];return this.add(e.negate())}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.add(-t)}},k.prototype.equals=function(){if(arguments.length===1){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}},k.prototype.isZero=function(){return this._hi===0&&this._lo===0},k.prototype.selfSubtract=function(){if(arguments[0]instanceof k){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}},k.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},k.prototype.min=function(e){return this.le(e)?this:e},k.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof k){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfDivide(t,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=null,o=null,a=null,u=null,l=null,c=null,h=null,f=null;return l=this._hi/n,c=k.SPLIT*l,s=c-l,f=k.SPLIT*n,s=c-s,o=l-s,a=f-n,h=l*n,a=f-a,u=n-a,f=s*a-h+s*u+o*a+o*u,c=(this._hi-h-f+this._lo-l*i)/n,f=l+c,this._hi=f,this._lo=l-f+c,this}},k.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},k.prototype.divide=function(){if(arguments[0]instanceof k){var e=arguments[0],t=null,n=null,i=null,s=null,o=null,a=null,u=null,l=null;o=this._hi/e._hi,a=k.SPLIT*o,t=a-o,l=k.SPLIT*e._hi,t=a-t,n=o-t,i=l-e._hi,u=o*e._hi,i=l-i,s=e._hi-i,l=t*i-u+t*s+n*i+n*s,a=(this._hi-u-l+this._lo-o*e._lo)/e._hi,l=o+a;var c=l,h=o-l+a;return new k(c,h)}else if(typeof arguments[0]=="number"){var f=arguments[0];return ht.isNaN(f)?k.createNaN():k.copy(this).selfDivide(f,0)}},k.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo},k.prototype.pow=function(e){if(e===0)return k.valueOf(1);var t=new k(this),n=k.valueOf(1),i=Math.abs(e);if(i>1)for(;i>0;)i%2===1&&n.selfMultiply(t),i/=2,i>0&&(t=t.sqr());else n=t;return e<0?n.reciprocal():n},k.prototype.ceil=function(){if(this.isNaN())return k.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new k(e,t)},k.prototype.compareTo=function(e){var t=e;return this._hi<t._hi?-1:this._hi>t._hi?1:this._lo<t._lo?-1:this._lo>t._lo?1:0},k.prototype.rint=function(){if(this.isNaN())return this;var e=this.add(.5);return e.floor()},k.prototype.setValue=function(){if(arguments[0]instanceof k){var e=arguments[0];return this.init(e),this}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.init(t),this}},k.prototype.max=function(e){return this.ge(e)?this:e},k.prototype.sqrt=function(){if(this.isZero())return k.valueOf(0);if(this.isNegative())return k.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,n=k.valueOf(t),i=this.subtract(n.sqr()),s=i._hi*(e*.5);return n.add(s)},k.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof k){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0],n=null,i=null,s=null,o=null,a=null,u=null;return s=this._hi+t,a=s-this._hi,o=s-a,o=t-a+(this._hi-o),u=o+this._lo,n=s+u,i=u+(s-n),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(arguments.length===2){var l=arguments[0],c=arguments[1],h=null,f=null,p=null,v=null,C=null,S=null,P=null,y=null;C=this._hi+l,p=this._lo+c,P=C-this._hi,y=p-this._lo,S=C-P,v=p-y,S=l-P+(this._hi-S),v=c-y+(this._lo-v),P=S+p,h=C+P,f=P+(C-h),P=v+f;var _=h+P,m=P+(h-_);return this._hi=_,this._lo=m,this}},k.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof k){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfMultiply(t,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=null,o=null,a=null,u=null,l=null,c=null;l=k.SPLIT*this._hi,s=l-this._hi,c=k.SPLIT*n,s=l-s,o=this._hi-s,a=c-n,l=this._hi*n,a=c-a,u=n-a,c=s*a-l+s*u+o*a+o*u+(this._hi*i+this._lo*n);var h=l+c;s=l-h;var f=c+s;return this._hi=h,this._lo=f,this}},k.prototype.selfSqr=function(){return this.selfMultiply(this)},k.prototype.floor=function(){if(this.isNaN())return k.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new k(e,t)},k.prototype.negate=function(){return this.isNaN()?this:new k(-this._hi,-this._lo)},k.prototype.clone=function(){},k.prototype.multiply=function(){if(arguments[0]instanceof k){var e=arguments[0];return e.isNaN()?k.createNaN():k.copy(this).selfMultiply(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return ht.isNaN(t)?k.createNaN():k.copy(this).selfMultiply(t,0)}},k.prototype.isNaN=function(){return ht.isNaN(this._hi)},k.prototype.intValue=function(){return Math.trunc(this._hi)},k.prototype.toString=function(){var e=k.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()},k.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!0,t),i=t[0]+1,s=n;if(n.charAt(0)===".")s="0"+n;else if(i<0)s="0."+k.stringOfChar("0",-i)+n;else if(n.indexOf(".")===-1){var o=i-n.length,a=k.stringOfChar("0",o);s=n+a+".0"}return this.isNegative()?"-"+s:s},k.prototype.reciprocal=function(){var e=null,t=null,n=null,i=null,s=null,o=null,a=null,u=null;s=1/this._hi,o=k.SPLIT*s,e=o-s,u=k.SPLIT*this._hi,e=o-e,t=s-e,n=u-this._hi,a=s*this._hi,n=u-n,i=this._hi-n,u=e*n-a+e*i+t*n+t*i,o=(1-a-u-s*this._lo)/this._hi;var l=s+o,c=s-l+o;return new k(l,c)},k.prototype.toSciNotation=function(){if(this.isZero())return k.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!1,t),i=k.SCI_NOT_EXPONENT_CHAR+t[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var s="";n.length>1&&(s=n.substring(1));var o=n.charAt(0)+"."+s;return this.isNegative()?"-"+o+i:o+i},k.prototype.abs=function(){return this.isNaN()?k.NaN:this.isNegative()?this.negate():new k(this)},k.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},k.prototype.lt=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<e._lo},k.prototype.add=function(){if(arguments[0]instanceof k){var e=arguments[0];return k.copy(this).selfAdd(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return k.copy(this).selfAdd(t)}},k.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this._hi=e,this._lo=0}else if(arguments[0]instanceof k){var t=arguments[0];this._hi=t._hi,this._lo=t._lo}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._hi=n,this._lo=i}},k.prototype.gt=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>e._lo},k.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},k.prototype.trunc=function(){return this.isNaN()?k.NaN:this.isPositive()?this.floor():this.ceil()},k.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},k.prototype.interfaces_=function(){return[kn,An,nc]},k.prototype.getClass=function(){return k},k.sqr=function(e){return k.valueOf(e).selfMultiply(e)},k.valueOf=function(){if(typeof arguments[0]=="string"){var e=arguments[0];return k.parse(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return new k(t)}},k.sqrt=function(e){return k.valueOf(e).sqrt()},k.parse=function(e){for(var t=0,n=e.length;Uu.isWhitespace(e.charAt(t));)t++;var i=!1;if(t<n){var s=e.charAt(t);(s==="-"||s==="+")&&(t++,s==="-"&&(i=!0))}for(var o=new k,a=0,u=0,l=0;!(t>=n);){var c=e.charAt(t);if(t++,Uu.isDigit(c)){var h=c-"0";o.selfMultiply(k.TEN),o.selfAdd(h),a++;continue}if(c==="."){u=a;continue}if(c==="e"||c==="E"){var f=e.substring(t);try{l=cr.parseInt(f)}catch(P){throw P instanceof Error?new Error("Invalid exponent "+f+" in string "+e):P}finally{}break}throw new Error("Unexpected character '"+c+"' at position "+t+" in string "+e)}var p=o,v=a-u-l;if(v===0)p=o;else if(v>0){var C=k.TEN.pow(v);p=o.divide(C)}else if(v<0){var S=k.TEN.pow(-v);p=o.multiply(S)}return i?p.negate():p},k.createNaN=function(){return new k(ht.NaN,ht.NaN)},k.copy=function(e){return new k(e)},k.magnitude=function(e){var t=Math.abs(e),n=Math.log(t)/Math.log(10),i=Math.trunc(Math.floor(n)),s=Math.pow(10,i);return s*10<=t&&(i+=1),i},k.stringOfChar=function(e,t){for(var n=new lr,i=0;i<t;i++)n.append(e);return n.toString()},$n.PI.get=function(){return new k(3.141592653589793,12246467991473532e-32)},$n.TWO_PI.get=function(){return new k(6.283185307179586,24492935982947064e-32)},$n.PI_2.get=function(){return new k(1.5707963267948966,6123233995736766e-32)},$n.E.get=function(){return new k(2.718281828459045,14456468917292502e-32)},$n.NaN.get=function(){return new k(ht.NaN,ht.NaN)},$n.EPS.get=function(){return 123259516440783e-46},$n.SPLIT.get=function(){return 134217729},$n.MAX_PRINT_DIGITS.get=function(){return 32},$n.TEN.get=function(){return k.valueOf(10)},$n.ONE.get=function(){return k.valueOf(1)},$n.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},$n.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(k,$n);var en=function(){},Im={DP_SAFE_EPSILON:{configurable:!0}};en.prototype.interfaces_=function(){return[]},en.prototype.getClass=function(){return en},en.orientationIndex=function(e,t,n){var i=en.orientationIndexFilter(e,t,n);if(i<=1)return i;var s=k.valueOf(t.x).selfAdd(-e.x),o=k.valueOf(t.y).selfAdd(-e.y),a=k.valueOf(n.x).selfAdd(-t.x),u=k.valueOf(n.y).selfAdd(-t.y);return s.selfMultiply(u).selfSubtract(o.selfMultiply(a)).signum()},en.signOfDet2x2=function(e,t,n,i){var s=e.multiply(i).selfSubtract(t.multiply(n));return s.signum()},en.intersection=function(e,t,n,i){var s=k.valueOf(i.y).selfSubtract(n.y).selfMultiply(k.valueOf(t.x).selfSubtract(e.x)),o=k.valueOf(i.x).selfSubtract(n.x).selfMultiply(k.valueOf(t.y).selfSubtract(e.y)),a=s.subtract(o),u=k.valueOf(i.x).selfSubtract(n.x).selfMultiply(k.valueOf(e.y).selfSubtract(n.y)),l=k.valueOf(i.y).selfSubtract(n.y).selfMultiply(k.valueOf(e.x).selfSubtract(n.x)),c=u.subtract(l),h=c.selfDivide(a).doubleValue(),f=k.valueOf(e.x).selfAdd(k.valueOf(t.x).selfSubtract(e.x).selfMultiply(h)).doubleValue(),p=k.valueOf(t.x).selfSubtract(e.x).selfMultiply(k.valueOf(e.y).selfSubtract(n.y)),v=k.valueOf(t.y).selfSubtract(e.y).selfMultiply(k.valueOf(e.x).selfSubtract(n.x)),C=p.subtract(v),S=C.selfDivide(a).doubleValue(),P=k.valueOf(n.y).selfAdd(k.valueOf(i.y).selfSubtract(n.y).selfMultiply(S)).doubleValue();return new R(f,P)},en.orientationIndexFilter=function(e,t,n){var i=null,s=(e.x-n.x)*(t.y-n.y),o=(e.y-n.y)*(t.x-n.x),a=s-o;if(s>0){if(o<=0)return en.signum(a);i=s+o}else if(s<0){if(o>=0)return en.signum(a);i=-s-o}else return en.signum(a);var u=en.DP_SAFE_EPSILON*i;return a>=u||-a>=u?en.signum(a):2},en.signum=function(e){return e>0?1:e<0?-1:0},Im.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(en,Im);var Ot=function(){},Gu={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Gu.X.get=function(){return 0},Gu.Y.get=function(){return 1},Gu.Z.get=function(){return 2},Gu.M.get=function(){return 3},Ot.prototype.setOrdinate=function(e,t,n){},Ot.prototype.size=function(){},Ot.prototype.getOrdinate=function(e,t){},Ot.prototype.getCoordinate=function(){},Ot.prototype.getCoordinateCopy=function(e){},Ot.prototype.getDimension=function(){},Ot.prototype.getX=function(e){},Ot.prototype.clone=function(){},Ot.prototype.expandEnvelope=function(e){},Ot.prototype.copy=function(){},Ot.prototype.getY=function(e){},Ot.prototype.toCoordinateArray=function(){},Ot.prototype.interfaces_=function(){return[nc]},Ot.prototype.getClass=function(){return Ot},Object.defineProperties(Ot,Gu);var xm=function(){},ha=function(r){function e(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(xm),Te=function(){};Te.arraycopy=function(e,t,n,i,s){for(var o=0,a=t;a<t+s;a++)n[i+o]=e[a],o++},Te.getProperty=function(e){return{"line.separator":`
42
- `}[e]};var Kn=function r(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],n=arguments[1];this.x=t,this.y=n,this.w=1}else if(arguments[0]instanceof r&&arguments[1]instanceof r){var i=arguments[0],s=arguments[1];this.x=i.y*s.w-s.y*i.w,this.y=s.x*i.w-i.x*s.w,this.w=i.x*s.y-s.x*i.y}else if(arguments[0]instanceof R&&arguments[1]instanceof R){var o=arguments[0],a=arguments[1];this.x=o.y-a.y,this.y=a.x-o.x,this.w=o.x*a.y-a.x*o.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(arguments.length===4){var h=arguments[0],f=arguments[1],p=arguments[2],v=arguments[3],C=h.y-f.y,S=f.x-h.x,P=h.x*f.y-f.x*h.y,y=p.y-v.y,_=v.x-p.x,m=p.x*v.y-v.x*p.y;this.x=S*m-_*P,this.y=y*P-C*m,this.w=C*_-y*S}};Kn.prototype.getY=function(){var e=this.y/this.w;if(ht.isNaN(e)||ht.isInfinite(e))throw new ha;return e},Kn.prototype.getX=function(){var e=this.x/this.w;if(ht.isNaN(e)||ht.isInfinite(e))throw new ha;return e},Kn.prototype.getCoordinate=function(){var e=new R;return e.x=this.getX(),e.y=this.getY(),e},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn},Kn.intersection=function(e,t,n,i){var s=e.y-t.y,o=t.x-e.x,a=e.x*t.y-t.x*e.y,u=n.y-i.y,l=i.x-n.x,c=n.x*i.y-i.x*n.y,h=o*c-l*a,f=u*a-s*c,p=s*l-u*o,v=h/p,C=f/p;if(ht.isNaN(v)||ht.isInfinite(v)||ht.isNaN(C)||ht.isInfinite(C))throw new ha;return new R(v,C)};var Q=function r(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof R){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof r){var t=arguments[0];this.init(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];this.init(s,o,a,u)}},Tm={serialVersionUID:{configurable:!0}};Q.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Q.prototype.equals=function(e){if(!(e instanceof Q))return!1;var t=e;return this.isNull()?t.isNull():this._maxx===t.getMaxX()&&this._maxy===t.getMaxY()&&this._minx===t.getMinX()&&this._miny===t.getMinY()},Q.prototype.intersection=function(e){if(this.isNull()||e.isNull()||!this.intersects(e))return new Q;var t=this._minx>e._minx?this._minx:e._minx,n=this._miny>e._miny?this._miny:e._miny,i=this._maxx<e._maxx?this._maxx:e._maxx,s=this._maxy<e._maxy?this._maxy:e._maxy;return new Q(t,i,n,s)},Q.prototype.isNull=function(){return this._maxx<this._minx},Q.prototype.getMaxX=function(){return this._maxx},Q.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof R){var e=arguments[0];return this.covers(e.x,e.y)}else if(arguments[0]instanceof Q){var t=arguments[0];return this.isNull()||t.isNull()?!1:t.getMinX()>=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}},Q.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Q){var e=arguments[0];return this.isNull()||e.isNull()?!1:!(e._minx>this._maxx||e._maxx<this._minx||e._miny>this._maxy||e._maxy<this._miny)}else if(arguments[0]instanceof R){var t=arguments[0];return this.intersects(t.x,t.y)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||i>this._maxy||i<this._miny)}},Q.prototype.getMinY=function(){return this._miny},Q.prototype.getMinX=function(){return this._minx},Q.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof R){var e=arguments[0];this.expandToInclude(e.x,e.y)}else if(arguments[0]instanceof Q){var t=arguments[0];if(t.isNull())return null;this.isNull()?(this._minx=t.getMinX(),this._maxx=t.getMaxX(),this._miny=t.getMinY(),this._maxy=t.getMaxY()):(t._minx<this._minx&&(this._minx=t._minx),t._maxx>this._maxx&&(this._maxx=t._maxx),t._miny<this._miny&&(this._miny=t._miny),t._maxy>this._maxy&&(this._maxy=t._maxy))}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},Q.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e<t?e:t},Q.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Q.prototype.compareTo=function(e){var t=e;return this.isNull()?t.isNull()?0:-1:t.isNull()?1:this._minx<t._minx?-1:this._minx>t._minx?1:this._miny<t._miny?-1:this._miny>t._miny?1:this._maxx<t._maxx?-1:this._maxx>t._maxx?1:this._maxy<t._maxy?-1:this._maxy>t._maxy?1:0},Q.prototype.translate=function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)},Q.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Q.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Q.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Q.prototype.maxExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t},Q.prototype.expandBy=function(){if(arguments.length===1){var e=arguments[0];this.expandBy(e,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Q.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Q){var e=arguments[0];return this.covers(e)}else if(arguments[0]instanceof R){var t=arguments[0];return this.covers(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},Q.prototype.centre=function(){return this.isNull()?null:new R((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Q.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof R){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof Q){var t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];s<o?(this._minx=s,this._maxx=o):(this._minx=o,this._maxx=s),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}},Q.prototype.getMaxY=function(){return this._maxy},Q.prototype.distance=function(e){if(this.intersects(e))return 0;var t=0;this._maxx<e._minx?t=e._minx-this._maxx:this._minx>e._maxx&&(t=this._minx-e._maxx);var n=0;return this._maxy<e._miny?n=e._miny-this._maxy:this._miny>e._maxy&&(n=this._miny-e._maxy),t===0?n:n===0?t:Math.sqrt(t*t+n*n)},Q.prototype.hashCode=function(){var e=17;return e=37*e+R.hashCode(this._minx),e=37*e+R.hashCode(this._maxx),e=37*e+R.hashCode(this._miny),e=37*e+R.hashCode(this._maxy),e},Q.prototype.interfaces_=function(){return[An,kn]},Q.prototype.getClass=function(){return Q},Q.intersects=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2];return n.x>=(e.x<t.x?e.x:t.x)&&n.x<=(e.x>t.x?e.x:t.x)&&n.y>=(e.y<t.y?e.y:t.y)&&n.y<=(e.y>t.y?e.y:t.y)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=Math.min(o.x,a.x),l=Math.max(o.x,a.x),c=Math.min(i.x,s.x),h=Math.max(i.x,s.x);return!(c>l||h<u||(u=Math.min(o.y,a.y),l=Math.max(o.y,a.y),c=Math.min(i.y,s.y),h=Math.max(i.y,s.y),c>l)||h<u)}},Tm.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(Q,Tm);var hr={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},rc=function(e){this.geometryFactory=e||new St};rc.prototype.read=function(e){var t,n,i;e=e.replace(/[\n\r]/g," ");var s=hr.typeStr.exec(e);if(e.search("EMPTY")!==-1&&(s=hr.emptyTypeStr.exec(e),s[2]=void 0),s&&(n=s[1].toLowerCase(),i=s[2],da[n]&&(t=da[n].apply(this,[i]))),t===void 0)throw new Error("Could not parse WKT "+e);return t},rc.prototype.write=function(e){return this.extractGeometry(e)},rc.prototype.extractGeometry=function(e){var t=e.getGeometryType().toLowerCase();if(!mi[t])return null;var n=t.toUpperCase(),i;return e.isEmpty()?i=n+" EMPTY":i=n+"("+mi[t].apply(this,[e])+")",i};var mi={coordinate:function(e){return e.x+" "+e.y},point:function(e){return mi.coordinate.call(this,e._coordinates._coordinates[0])},multipoint:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push("("+mi.point.apply(t,[e._geometries[i]])+")");return n.join(",")},linestring:function(e){for(var t=this,n=[],i=0,s=e._points._coordinates.length;i<s;++i)n.push(mi.coordinate.apply(t,[e._points._coordinates[i]]));return n.join(",")},linearring:function(e){for(var t=this,n=[],i=0,s=e._points._coordinates.length;i<s;++i)n.push(mi.coordinate.apply(t,[e._points._coordinates[i]]));return n.join(",")},multilinestring:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push("("+mi.linestring.apply(t,[e._geometries[i]])+")");return n.join(",")},polygon:function(e){var t=this,n=[];n.push("("+mi.linestring.apply(this,[e._shell])+")");for(var i=0,s=e._holes.length;i<s;++i)n.push("("+mi.linestring.apply(t,[e._holes[i]])+")");return n.join(",")},multipolygon:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push("("+mi.polygon.apply(t,[e._geometries[i]])+")");return n.join(",")},geometrycollection:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push(t.extractGeometry(e._geometries[i]));return n.join(",")}},da={point:function(e){if(e===void 0)return this.geometryFactory.createPoint();var t=e.trim().split(hr.spaces);return this.geometryFactory.createPoint(new R(Number.parseFloat(t[0]),Number.parseFloat(t[1])))},multipoint:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiPoint();for(var n,i=e.trim().split(","),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(hr.trimParens,"$1"),s.push(da.point.apply(t,[n]));return this.geometryFactory.createMultiPoint(s)},linestring:function(e){if(e===void 0)return this.geometryFactory.createLineString();for(var t=e.trim().split(","),n=[],i,s=0,o=t.length;s<o;++s)i=t[s].trim().split(hr.spaces),n.push(new R(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(n)},linearring:function(e){if(e===void 0)return this.geometryFactory.createLinearRing();for(var t=e.trim().split(","),n=[],i,s=0,o=t.length;s<o;++s)i=t[s].trim().split(hr.spaces),n.push(new R(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiLineString();for(var n,i=e.trim().split(hr.parenComma),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(hr.trimParens,"$1"),s.push(da.linestring.apply(t,[n]));return this.geometryFactory.createMultiLineString(s)},polygon:function(e){var t=this;if(e===void 0)return this.geometryFactory.createPolygon();for(var n,i,s,o=e.trim().split(hr.parenComma),a,u=[],l=0,c=o.length;l<c;++l)n=o[l].replace(hr.trimParens,"$1"),i=da.linestring.apply(t,[n]),s=t.geometryFactory.createLinearRing(i._points),l===0?a=s:u.push(s);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiPolygon();for(var n,i=e.trim().split(hr.doubleParenComma),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(hr.trimParens,"$1"),s.push(da.polygon.apply(t,[n]));return this.geometryFactory.createMultiPolygon(s)},geometrycollection:function(e){var t=this;if(e===void 0)return this.geometryFactory.createGeometryCollection();e=e.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=e.trim().split("|"),i=[],s=0,o=n.length;s<o;++s)i.push(t.read(n[s]));return this.geometryFactory.createGeometryCollection(i)}},Zn=function(e){this.parser=new rc(e)};Zn.prototype.write=function(e){return this.parser.write(e)},Zn.toLineString=function(e,t){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+e.x+" "+e.y+", "+t.x+" "+t.y+" )"};var vi=function(r){function e(t){r.call(this,t),this.name="RuntimeException",this.message=t,this.stack=new r().stack}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e}(Error),ic=function(r){function e(){if(r.call(this),arguments.length===0)r.call(this);else if(arguments.length===1){var t=arguments[0];r.call(this,t)}}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(vi),yt=function(){};yt.prototype.interfaces_=function(){return[]},yt.prototype.getClass=function(){return yt},yt.shouldNeverReachHere=function(){if(arguments.length===0)yt.shouldNeverReachHere(null);else if(arguments.length===1){var e=arguments[0];throw new ic("Should never reach here"+(e!==null?": "+e:""))}},yt.isTrue=function(){var e,t;if(arguments.length===1)e=arguments[0],yt.isTrue(e,null);else if(arguments.length===2&&(e=arguments[0],t=arguments[1],!e))throw t===null?new ic:new ic(t)},yt.equals=function(){var e,t,n;if(arguments.length===2)e=arguments[0],t=arguments[1],yt.equals(e,t,null);else if(arguments.length===3&&(e=arguments[0],t=arguments[1],n=arguments[2],!t.equals(e)))throw new ic("Expected "+e+" but encountered "+t+(n!==null?": "+n:""))};var $t=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new R,this._intPt[1]=new R,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},uo={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};$t.prototype.getIndexAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intLineIndex[e][t]},$t.prototype.getTopologySummary=function(){var e=new lr;return this.isEndPoint()&&e.append(" endpoint"),this._isProper&&e.append(" proper"),this.isCollinear()&&e.append(" collinear"),e.toString()},$t.prototype.computeIntersection=function(e,t,n,i){this._inputLines[0][0]=e,this._inputLines[0][1]=t,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(e,t,n,i)},$t.prototype.getIntersectionNum=function(){return this._result},$t.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var e=arguments[0],t=this.getEdgeDistance(e,0),n=this.getEdgeDistance(e,1);t>n?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}},$t.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},$t.prototype.setPrecisionModel=function(e){this._precisionModel=e},$t.prototype.isInteriorIntersection=function(){var e=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var t=arguments[0],n=0;n<this._result;n++)if(!(e._intPt[n].equals2D(e._inputLines[t][0])||e._intPt[n].equals2D(e._inputLines[t][1])))return!0;return!1}},$t.prototype.getIntersection=function(e){return this._intPt[e]},$t.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},$t.prototype.hasIntersection=function(){return this._result!==$t.NO_INTERSECTION},$t.prototype.getEdgeDistance=function(e,t){var n=$t.computeEdgeDistance(this._intPt[t],this._inputLines[e][0],this._inputLines[e][1]);return n},$t.prototype.isCollinear=function(){return this._result===$t.COLLINEAR_INTERSECTION},$t.prototype.toString=function(){return Zn.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Zn.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},$t.prototype.getEndpoint=function(e,t){return this._inputLines[e][t]},$t.prototype.isIntersection=function(e){for(var t=this,n=0;n<this._result;n++)if(t._intPt[n].equals2D(e))return!0;return!1},$t.prototype.getIntersectionAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[e][t]]},$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t},$t.computeEdgeDistance=function(e,t,n){var i=Math.abs(n.x-t.x),s=Math.abs(n.y-t.y),o=-1;if(e.equals(t))o=0;else if(e.equals(n))i>s?o=i:o=s;else{var a=Math.abs(e.x-t.x),u=Math.abs(e.y-t.y);i>s?o=a:o=u,o===0&&!e.equals(t)&&(o=Math.max(a,u))}return yt.isTrue(!(o===0&&!e.equals(t)),"Bad distance calculation"),o},$t.nonRobustComputeEdgeDistance=function(e,t,n){var i=e.x-t.x,s=e.y-t.y,o=Math.sqrt(i*i+s*s);return yt.isTrue(!(o===0&&!e.equals(t)),"Invalid distance calculation"),o},uo.DONT_INTERSECT.get=function(){return 0},uo.DO_INTERSECT.get=function(){return 1},uo.COLLINEAR.get=function(){return 2},uo.NO_INTERSECTION.get=function(){return 0},uo.POINT_INTERSECTION.get=function(){return 1},uo.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties($t,uo);var Cs=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(n){var i=new Q(this._inputLines[0][0],this._inputLines[0][1]),s=new Q(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(n)&&s.contains(n)},e.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];if(this._isProper=!1,Q.intersects(i,s,n)&&q.orientationIndex(i,s,n)===0&&q.orientationIndex(s,i,n)===0)return this._isProper=!0,(n.equals(i)||n.equals(s))&&(this._isProper=!1),this._result=r.POINT_INTERSECTION,null;this._result=r.NO_INTERSECTION}else return r.prototype.computeIntersection.apply(this,arguments)},e.prototype.normalizeToMinimum=function(n,i,s,o,a){a.x=this.smallestInAbsValue(n.x,i.x,s.x,o.x),a.y=this.smallestInAbsValue(n.y,i.y,s.y,o.y),n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},e.prototype.safeHCoordinateIntersection=function(n,i,s,o){var a=null;try{a=Kn.intersection(n,i,s,o)}catch(u){if(u instanceof ha)a=e.nearestEndpoint(n,i,s,o);else throw u}finally{}return a},e.prototype.intersection=function(n,i,s,o){var a=this.intersectionWithNormalization(n,i,s,o);return this.isInSegmentEnvelopes(a)||(a=new R(e.nearestEndpoint(n,i,s,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},e.prototype.smallestInAbsValue=function(n,i,s,o){var a=n,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(s)<u&&(a=s,u=Math.abs(s)),Math.abs(o)<u&&(a=o),a},e.prototype.checkDD=function(n,i,s,o,a){var u=en.intersection(n,i,s,o),l=this.isInSegmentEnvelopes(u);Te.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&Te.out.println("Distance = "+a.distance(u))},e.prototype.intersectionWithNormalization=function(n,i,s,o){var a=new R(n),u=new R(i),l=new R(s),c=new R(o),h=new R;this.normalizeToEnvCentre(a,u,l,c,h);var f=this.safeHCoordinateIntersection(a,u,l,c);return f.x+=h.x,f.y+=h.y,f},e.prototype.computeCollinearIntersection=function(n,i,s,o){var a=Q.intersects(n,i,s),u=Q.intersects(n,i,o),l=Q.intersects(s,o,n),c=Q.intersects(s,o,i);return a&&u?(this._intPt[0]=s,this._intPt[1]=o,r.COLLINEAR_INTERSECTION):l&&c?(this._intPt[0]=n,this._intPt[1]=i,r.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!u&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!u&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!a&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!a&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):r.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(n,i,s,o,a){var u=n.x<i.x?n.x:i.x,l=n.y<i.y?n.y:i.y,c=n.x>i.x?n.x:i.x,h=n.y>i.y?n.y:i.y,f=s.x<o.x?s.x:o.x,p=s.y<o.y?s.y:o.y,v=s.x>o.x?s.x:o.x,C=s.y>o.y?s.y:o.y,S=u>f?u:f,P=c<v?c:v,y=l>p?l:p,_=h<C?h:C,m=(S+P)/2,w=(y+_)/2;a.x=m,a.y=w,n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},e.prototype.computeIntersect=function(n,i,s,o){if(this._isProper=!1,!Q.intersects(n,i,s,o))return r.NO_INTERSECTION;var a=q.orientationIndex(n,i,s),u=q.orientationIndex(n,i,o);if(a>0&&u>0||a<0&&u<0)return r.NO_INTERSECTION;var l=q.orientationIndex(s,o,n),c=q.orientationIndex(s,o,i);if(l>0&&c>0||l<0&&c<0)return r.NO_INTERSECTION;var h=a===0&&u===0&&l===0&&c===0;return h?this.computeCollinearIntersection(n,i,s,o):(a===0||u===0||l===0||c===0?(this._isProper=!1,n.equals2D(s)||n.equals2D(o)?this._intPt[0]=n:i.equals2D(s)||i.equals2D(o)?this._intPt[0]=i:a===0?this._intPt[0]=new R(s):u===0?this._intPt[0]=new R(o):l===0?this._intPt[0]=new R(n):c===0&&(this._intPt[0]=new R(i))):(this._isProper=!0,this._intPt[0]=this.intersection(n,i,s,o)),r.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(n,i,s,o){var a=n,u=q.distancePointLine(n,s,o),l=q.distancePointLine(i,s,o);return l<u&&(u=l,a=i),l=q.distancePointLine(s,n,i),l<u&&(u=l,a=s),l=q.distancePointLine(o,n,i),l<u&&(u=l,a=o),a},e}($t),lo=function(){};lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo},lo.orientationIndex=function(e,t,n){var i=t.x-e.x,s=t.y-e.y,o=n.x-t.x,a=n.y-t.y;return lo.signOfDet2x2(i,s,o,a)},lo.signOfDet2x2=function(e,t,n,i){var s=null,o=null,a=null;if(s=1,e===0||i===0)return t===0||n===0?0:t>0?n>0?-s:s:n>0?s:-s;if(t===0||n===0)return i>0?e>0?s:-s:e>0?-s:s;if(t>0?i>0?t<=i||(s=-s,o=e,e=n,n=o,o=t,t=i,i=o):t<=-i?(s=-s,n=-n,i=-i):(o=e,e=-n,n=o,o=t,t=-i,i=o):i>0?-t<=i?(s=-s,e=-e,t=-t):(o=-e,e=n,n=o,o=-t,t=i,i=o):t>=i?(e=-e,t=-t,n=-n,i=-i):(s=-s,o=-e,e=-n,n=o,o=-t,t=-i,i=o),e>0)if(n>0){if(!(e<=n))return s}else return s;else{if(n>0)return-s;if(e>=n)s=-s,e=-e,n=-n;else return-s}for(;;){if(a=Math.floor(n/e),n=n-a*e,i=i-a*t,i<0)return-s;if(i>t)return s;if(e>n+n){if(t<i+i)return s}else{if(t>i+i)return-s;n=e-n,i=t-i,s=-s}if(i===0)return n===0?0:-s;if(n===0||(a=Math.floor(e/n),e=e-a*n,t=t-a*i,t<0))return s;if(t>i)return-s;if(n>e+e){if(i<t+t)return-s}else{if(i>t+t)return s;e=n-e,t=i-t,s=-s}if(t===0)return e===0?0:s;if(e===0)return-s}};var dr=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e};dr.prototype.countSegment=function(e,t){if(e.x<this._p.x&&t.x<this._p.x)return null;if(this._p.x===t.x&&this._p.y===t.y)return this._isPointOnSegment=!0,null;if(e.y===this._p.y&&t.y===this._p.y){var n=e.x,i=t.x;return n>i&&(n=t.x,i=e.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(e.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&e.y<=this._p.y){var s=e.x-this._p.x,o=e.y-this._p.y,a=t.x-this._p.x,u=t.y-this._p.y,l=lo.signOfDet2x2(s,o,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<o&&(l=-l),l>0&&this._crossingCount++}},dr.prototype.isPointInPolygon=function(){return this.getLocation()!==F.EXTERIOR},dr.prototype.getLocation=function(){return this._isPointOnSegment?F.BOUNDARY:this._crossingCount%2===1?F.INTERIOR:F.EXTERIOR},dr.prototype.isOnSegment=function(){return this._isPointOnSegment},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},dr.locatePointInRing=function(){if(arguments[0]instanceof R&&at(arguments[1],Ot)){for(var e=arguments[0],t=arguments[1],n=new dr(e),i=new R,s=new R,o=1;o<t.size();o++)if(t.getCoordinate(o,i),t.getCoordinate(o-1,s),n.countSegment(i,s),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof R&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new dr(a),c=1;c<u.length;c++){var h=u[c],f=u[c-1];if(l.countSegment(h,f),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var q=function(){},co={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};q.prototype.interfaces_=function(){return[]},q.prototype.getClass=function(){return q},q.orientationIndex=function(e,t,n){return en.orientationIndex(e,t,n)},q.signedArea=function(){if(arguments[0]instanceof Array){var e=arguments[0];if(e.length<3)return 0;for(var t=0,n=e[0].x,i=1;i<e.length-1;i++){var s=e[i].x-n,o=e[i+1].y,a=e[i-1].y;t+=s*(a-o)}return t/2}else if(at(arguments[0],Ot)){var u=arguments[0],l=u.size();if(l<3)return 0;var c=new R,h=new R,f=new R;u.getCoordinate(0,h),u.getCoordinate(1,f);var p=h.x;f.x-=p;for(var v=0,C=1;C<l-1;C++)c.y=h.y,h.x=f.x,h.y=f.y,u.getCoordinate(C+1,f),f.x-=p,v+=h.x*(c.y-f.y);return v/2}},q.distanceLineLine=function(e,t,n,i){if(e.equals(t))return q.distancePointLine(e,n,i);if(n.equals(i))return q.distancePointLine(i,e,t);var s=!1;if(!Q.intersects(e,t,n,i))s=!0;else{var o=(t.x-e.x)*(i.y-n.y)-(t.y-e.y)*(i.x-n.x);if(o===0)s=!0;else{var a=(e.y-n.y)*(i.x-n.x)-(e.x-n.x)*(i.y-n.y),u=(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y),l=u/o,c=a/o;(c<0||c>1||l<0||l>1)&&(s=!0)}}return s?xn.min(q.distancePointLine(e,n,i),q.distancePointLine(t,n,i),q.distancePointLine(n,e,t),q.distancePointLine(i,e,t)):0},q.isPointInRing=function(e,t){return q.locatePointInRing(e,t)!==F.EXTERIOR},q.computeLength=function(e){var t=e.size();if(t<=1)return 0;var n=0,i=new R;e.getCoordinate(0,i);for(var s=i.x,o=i.y,a=1;a<t;a++){e.getCoordinate(a,i);var u=i.x,l=i.y,c=u-s,h=l-o;n+=Math.sqrt(c*c+h*h),s=u,o=l}return n},q.isCCW=function(e){var t=e.length-1;if(t<3)throw new Yt("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=e[0],i=0,s=1;s<=t;s++){var o=e[s];o.y>n.y&&(n=o,i=s)}var a=i;do a=a-1,a<0&&(a=t);while(e[a].equals2D(n)&&a!==i);var u=i;do u=(u+1)%t;while(e[u].equals2D(n)&&u!==i);var l=e[a],c=e[u];if(l.equals2D(n)||c.equals2D(n)||l.equals2D(c))return!1;var h=q.computeOrientation(l,n,c),f=!1;return h===0?f=l.x>c.x:f=h>0,f},q.locatePointInRing=function(e,t){return dr.locatePointInRing(e,t)},q.distancePointLinePerpendicular=function(e,t,n){var i=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y),s=((t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y))/i;return Math.abs(s)*Math.sqrt(i)},q.computeOrientation=function(e,t,n){return q.orientationIndex(e,t,n)},q.distancePointLine=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(t.length===0)throw new Yt("Line array must contain at least one vertex");for(var n=e.distance(t[0]),i=0;i<t.length-1;i++){var s=q.distancePointLine(e,t[i],t[i+1]);s<n&&(n=s)}return n}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return o.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((o.x-a.x)*(u.x-a.x)+(o.y-a.y)*(u.y-a.y))/l;if(c<=0)return o.distance(a);if(c>=1)return o.distance(u);var h=((a.y-o.y)*(u.x-a.x)-(a.x-o.x)*(u.y-a.y))/l;return Math.abs(h)*Math.sqrt(l)}},q.isOnLine=function(e,t){for(var n=new Cs,i=1;i<t.length;i++){var s=t[i-1],o=t[i];if(n.computeIntersection(e,s,o),n.hasIntersection())return!0}return!1},co.CLOCKWISE.get=function(){return-1},co.RIGHT.get=function(){return q.CLOCKWISE},co.COUNTERCLOCKWISE.get=function(){return 1},co.LEFT.get=function(){return q.COUNTERCLOCKWISE},co.COLLINEAR.get=function(){return 0},co.STRAIGHT.get=function(){return q.COLLINEAR},Object.defineProperties(q,co);var yi=function(){};yi.prototype.filter=function(e){},yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi};var ot=function(){var e=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=e,this._SRID=e.getSRID()},Gr={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};ot.prototype.isGeometryCollection=function(){return this.getSortIndex()===ot.SORTINDEX_GEOMETRYCOLLECTION},ot.prototype.getFactory=function(){return this._factory},ot.prototype.getGeometryN=function(e){return this},ot.prototype.getArea=function(){return 0},ot.prototype.isRectangle=function(){return!1},ot.prototype.equals=function(){if(arguments[0]instanceof ot){var e=arguments[0];return e===null?!1:this.equalsTopo(e)}else if(arguments[0]instanceof Object){var t=arguments[0];if(!(t instanceof ot))return!1;var n=t;return this.equalsExact(n)}},ot.prototype.equalsExact=function(e){return this===e||this.equalsExact(e,0)},ot.prototype.geometryChanged=function(){this.apply(ot.geometryChangedFilter)},ot.prototype.geometryChangedAction=function(){this._envelope=null},ot.prototype.equalsNorm=function(e){return e===null?!1:this.norm().equalsExact(e.norm())},ot.prototype.getLength=function(){return 0},ot.prototype.getNumGeometries=function(){return 1},ot.prototype.compareTo=function(){if(arguments.length===1){var e=arguments[0],t=e;return this.getSortIndex()!==t.getSortIndex()?this.getSortIndex()-t.getSortIndex():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(e)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,i)}},ot.prototype.getUserData=function(){return this._userData},ot.prototype.getSRID=function(){return this._SRID},ot.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ot.prototype.checkNotGeometryCollection=function(e){if(e.getSortIndex()===ot.SORTINDEX_GEOMETRYCOLLECTION)throw new Yt("This method does not support GeometryCollection arguments")},ot.prototype.equal=function(e,t,n){return n===0?e.equals(t):e.distance(t)<=n},ot.prototype.norm=function(){var e=this.copy();return e.normalize(),e},ot.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ot.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new Q(this._envelope)},ot.prototype.setSRID=function(e){this._SRID=e},ot.prototype.setUserData=function(e){this._userData=e},ot.prototype.compare=function(e,t){for(var n=e.iterator(),i=t.iterator();n.hasNext()&&i.hasNext();){var s=n.next(),o=i.next(),a=s.compareTo(o);if(a!==0)return a}return n.hasNext()?1:i.hasNext()?-1:0},ot.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ot.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ot.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ot.SORTINDEX_MULTIPOINT||this.getSortIndex()===ot.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ot.SORTINDEX_MULTIPOLYGON},ot.prototype.interfaces_=function(){return[nc,An,kn]},ot.prototype.getClass=function(){return ot},ot.hasNonEmptyElements=function(e){for(var t=0;t<e.length;t++)if(!e[t].isEmpty())return!0;return!1},ot.hasNullElements=function(e){for(var t=0;t<e.length;t++)if(e[t]===null)return!0;return!1},Gr.serialVersionUID.get=function(){return 8763622679187377e3},Gr.SORTINDEX_POINT.get=function(){return 0},Gr.SORTINDEX_MULTIPOINT.get=function(){return 1},Gr.SORTINDEX_LINESTRING.get=function(){return 2},Gr.SORTINDEX_LINEARRING.get=function(){return 3},Gr.SORTINDEX_MULTILINESTRING.get=function(){return 4},Gr.SORTINDEX_POLYGON.get=function(){return 5},Gr.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Gr.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Gr.geometryChangedFilter.get=function(){return od},Object.defineProperties(ot,Gr);var od=function(){};od.interfaces_=function(){return[yi]},od.filter=function(e){e.geometryChangedAction()};var Wr=function(){};Wr.prototype.filter=function(e){},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var Vn=function(){},_i={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Vn.prototype.isInBoundary=function(e){},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn},_i.Mod2BoundaryNodeRule.get=function(){return fa},_i.EndPointBoundaryNodeRule.get=function(){return pa},_i.MultiValentEndPointBoundaryNodeRule.get=function(){return ga},_i.MonoValentEndPointBoundaryNodeRule.get=function(){return ma},_i.MOD2_BOUNDARY_RULE.get=function(){return new fa},_i.ENDPOINT_BOUNDARY_RULE.get=function(){return new pa},_i.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new ga},_i.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new ma},_i.OGC_SFS_BOUNDARY_RULE.get=function(){return Vn.MOD2_BOUNDARY_RULE},Object.defineProperties(Vn,_i);var fa=function(){};fa.prototype.isInBoundary=function(e){return e%2===1},fa.prototype.interfaces_=function(){return[Vn]},fa.prototype.getClass=function(){return fa};var pa=function(){};pa.prototype.isInBoundary=function(e){return e>0},pa.prototype.interfaces_=function(){return[Vn]},pa.prototype.getClass=function(){return pa};var ga=function(){};ga.prototype.isInBoundary=function(e){return e>1},ga.prototype.interfaces_=function(){return[Vn]},ga.prototype.getClass=function(){return ga};var ma=function(){};ma.prototype.isInBoundary=function(e){return e===1},ma.prototype.interfaces_=function(){return[Vn]},ma.prototype.getClass=function(){return ma};var fe=function(){};fe.prototype.add=function(){},fe.prototype.addAll=function(){},fe.prototype.isEmpty=function(){},fe.prototype.iterator=function(){},fe.prototype.size=function(){},fe.prototype.toArray=function(){},fe.prototype.remove=function(){};function ad(r){this.message=r||""}ad.prototype=new Error,ad.prototype.name="IndexOutOfBoundsException";var va=function(){};va.prototype.hasNext=function(){},va.prototype.next=function(){},va.prototype.remove=function(){};var Qn=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(fe);function ya(r){this.message=r||""}ya.prototype=new Error,ya.prototype.name="NoSuchElementException";var W=function(r){function e(){r.call(this),this.array_=[],arguments[0]instanceof fe&&this.addAll(arguments[0])}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[r,fe]},e.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(n){for(var i=this,s=n.iterator();s.hasNext();)i.add(s.next());return!0},e.prototype.set=function(n,i){var s=this.array_[n];return this.array_[n]=i,s},e.prototype.iterator=function(){return new BE(this)},e.prototype.get=function(n){if(n<0||n>=this.size())throw new ad;return this.array_[n]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var n=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(n.array_[s]);return i},e.prototype.remove=function(n){for(var i=this,s=!1,o=0,a=this.array_.length;o<a;o++)if(i.array_[o]===n){i.array_.splice(o,1),s=!0;break}return s},e}(Qn),BE=function(r){function e(t){r.call(this),this.arrayList_=t,this.position_=0}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new ya;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(va),Wu=function(r){function e(){if(r.call(this),arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.ensureCapacity(i.length),this.add(i,s)}}}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={coordArrayType:{configurable:!0}};return t.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(i){return this.get(i)},e.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=!1,u=s.iterator();u.hasNext();)i.add(u.next(),o),a=!0;return a}else return r.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var i=this,s=r.prototype.clone.call(this),o=0;o<this.size();o++)s.add(o,i.get(o).copy());return s},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){var i=this;if(arguments.length===1){var s=arguments[0];r.prototype.add.call(this,s)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1];return this.add(o,a,!0),!0}else if(arguments[0]instanceof R&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(u))return null}r.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var h=arguments[0],f=arguments[1];return this.add(h,f),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var p=arguments[0],v=arguments[1],C=arguments[2];if(C)for(var S=0;S<p.length;S++)i.add(p[S],v);else for(var P=p.length-1;P>=0;P--)i.add(p[P],v);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof R){var y=arguments[0],_=arguments[1],m=arguments[2];if(!m){var w=this.size();if(w>0){if(y>0){var E=this.get(y-1);if(E.equals2D(_))return null}if(y<w){var b=this.get(y);if(b.equals2D(_))return null}}}r.prototype.add.call(this,y,_)}}else if(arguments.length===4){var I=arguments[0],T=arguments[1],D=arguments[2],x=arguments[3],N=1;D>x&&(N=-1);for(var L=D;L!==x;L+=N)i.add(I[L],T);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new R(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,t),e}(W),Ct=function(){},sc={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};sc.ForwardComparator.get=function(){return Hu},sc.BidirectionalComparator.get=function(){return _a},sc.coordArrayType.get=function(){return new Array(0).fill(null)},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.isRing=function(e){return!(e.length<4||!e[0].equals2D(e[e.length-1]))},Ct.ptNotInList=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(Ct.indexOf(i,t)<0)return i}return null},Ct.scroll=function(e,t){var n=Ct.indexOf(t,e);if(n<0)return null;var i=new Array(e.length).fill(null);Te.arraycopy(e,n,i,0,e.length-n),Te.arraycopy(e,0,i,e.length-n,n),Te.arraycopy(i,0,e,0,e.length)},Ct.equals=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(e===t)return!0;if(e===null||t===null||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].equals(t[n]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(i===s)return!0;if(i===null||s===null||i.length!==s.length)return!1;for(var a=0;a<i.length;a++)if(o.compare(i[a],s[a])!==0)return!1;return!0}},Ct.intersection=function(e,t){for(var n=new Wu,i=0;i<e.length;i++)t.intersects(e[i])&&n.add(e[i],!0);return n.toCoordinateArray()},Ct.hasRepeatedPoints=function(e){for(var t=1;t<e.length;t++)if(e[t-1].equals(e[t]))return!0;return!1},Ct.removeRepeatedPoints=function(e){if(!Ct.hasRepeatedPoints(e))return e;var t=new Wu(e,!1);return t.toCoordinateArray()},Ct.reverse=function(e){for(var t=e.length-1,n=Math.trunc(t/2),i=0;i<=n;i++){var s=e[i];e[i]=e[t-i],e[t-i]=s}},Ct.removeNull=function(e){for(var t=0,n=0;n<e.length;n++)e[n]!==null&&t++;var i=new Array(t).fill(null);if(t===0)return i;for(var s=0,o=0;o<e.length;o++)e[o]!==null&&(i[s++]=e[o]);return i},Ct.copyDeep=function(){if(arguments.length===1){for(var e=arguments[0],t=new Array(e.length).fill(null),n=0;n<e.length;n++)t[n]=new R(e[n]);return t}else if(arguments.length===5)for(var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)o[a+l]=new R(i[s+l])},Ct.isEqualReversed=function(e,t){for(var n=0;n<e.length;n++){var i=e[n],s=t[e.length-n-1];if(i.compareTo(s)!==0)return!1}return!0},Ct.envelope=function(e){for(var t=new Q,n=0;n<e.length;n++)t.expandToInclude(e[n]);return t},Ct.toCoordinateArray=function(e){return e.toArray(Ct.coordArrayType)},Ct.atLeastNCoordinatesOrNothing=function(e,t){return t.length>=e?t:[]},Ct.indexOf=function(e,t){for(var n=0;n<t.length;n++)if(e.equals(t[n]))return n;return-1},Ct.increasingDirection=function(e){for(var t=0;t<Math.trunc(e.length/2);t++){var n=e.length-1-t,i=e[t].compareTo(e[n]);if(i!==0)return i}return 1},Ct.compare=function(e,t){for(var n=0;n<e.length&&n<t.length;){var i=e[n].compareTo(t[n]);if(i!==0)return i;n++}return n<t.length?-1:n<e.length?1:0},Ct.minCoordinate=function(e){for(var t=null,n=0;n<e.length;n++)(t===null||t.compareTo(e[n])>0)&&(t=e[n]);return t},Ct.extract=function(e,t,n){t=xn.clamp(t,0,e.length),n=xn.clamp(n,-1,e.length);var i=n-t+1;n<0&&(i=0),t>=e.length&&(i=0),n<t&&(i=0);var s=new Array(i).fill(null);if(i===0)return s;for(var o=0,a=t;a<=n;a++)s[o++]=e[a];return s},Object.defineProperties(Ct,sc);var Hu=function(){};Hu.prototype.compare=function(e,t){var n=e,i=t;return Ct.compare(n,i)},Hu.prototype.interfaces_=function(){return[la]},Hu.prototype.getClass=function(){return Hu};var _a=function(){};_a.prototype.compare=function(e,t){var n=e,i=t;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;var s=Ct.compare(n,i),o=Ct.isEqualReversed(n,i);return o?0:s},_a.prototype.OLDcompare=function(e,t){var n=e,i=t;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;for(var s=Ct.increasingDirection(n),o=Ct.increasingDirection(i),a=s>0?0:n.length-1,u=o>0?0:n.length-1,l=0;l<n.length;l++){var c=n[a].compareTo(i[u]);if(c!==0)return c;a+=s,u+=o}return 0},_a.prototype.interfaces_=function(){return[la]},_a.prototype.getClass=function(){return _a};var ho=function(){};ho.prototype.get=function(){},ho.prototype.put=function(){},ho.prototype.size=function(){},ho.prototype.values=function(){},ho.prototype.entrySet=function(){};var zE=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e}(ho);function qu(r){this.message=r||""}qu.prototype=new Error,qu.prototype.name="OperationNotSupported";function oc(){}oc.prototype=new fe,oc.prototype.contains=function(){};var ud=function(r){function e(){r.call(this),this.array_=[],arguments[0]instanceof fe&&this.addAll(arguments[0])}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.contains=function(n){for(var i=this,s=0,o=this.array_.length;s<o;s++){var a=i.array_[s];if(a===n)return!0}return!1},e.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},e.prototype.addAll=function(n){for(var i=this,s=n.iterator();s.hasNext();)i.add(s.next());return!0},e.prototype.remove=function(n){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.toArray=function(){for(var n=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(n.array_[s]);return i},e.prototype.iterator=function(){return new UE(this)},e}(oc),UE=function(r){function e(t){r.call(this),this.hashSet_=t,this.position_=0}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new ya;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new qu},e}(va),wi=0,Ss=1;function Om(r){return r===null?wi:r.color}function Gt(r){return r===null?null:r.parent}function Ei(r,e){r!==null&&(r.color=e)}function ld(r){return r===null?null:r.left}function Nm(r){return r===null?null:r.right}function ke(){this.root_=null,this.size_=0}ke.prototype=new zE,ke.prototype.get=function(r){for(var e=this.root_;e!==null;){var t=r.compareTo(e.key);if(t<0)e=e.left;else if(t>0)e=e.right;else return e.value}return null},ke.prototype.put=function(r,e){if(this.root_===null)return this.root_={key:r,value:e,left:null,right:null,parent:null,color:wi,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var t=this.root_,n,i;do if(n=t,i=r.compareTo(t.key),i<0)t=t.left;else if(i>0)t=t.right;else{var s=t.value;return t.value=e,s}while(t!==null);var o={key:r,left:null,right:null,value:e,parent:n,color:wi,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=o:n.right=o,this.fixAfterInsertion(o),this.size_++,null},ke.prototype.fixAfterInsertion=function(r){var e=this;for(r.color=Ss;r!=null&&r!==this.root_&&r.parent.color===Ss;)if(Gt(r)===ld(Gt(Gt(r)))){var t=Nm(Gt(Gt(r)));Om(t)===Ss?(Ei(Gt(r),wi),Ei(t,wi),Ei(Gt(Gt(r)),Ss),r=Gt(Gt(r))):(r===Nm(Gt(r))&&(r=Gt(r),e.rotateLeft(r)),Ei(Gt(r),wi),Ei(Gt(Gt(r)),Ss),e.rotateRight(Gt(Gt(r))))}else{var n=ld(Gt(Gt(r)));Om(n)===Ss?(Ei(Gt(r),wi),Ei(n,wi),Ei(Gt(Gt(r)),Ss),r=Gt(Gt(r))):(r===ld(Gt(r))&&(r=Gt(r),e.rotateRight(r)),Ei(Gt(r),wi),Ei(Gt(Gt(r)),Ss),e.rotateLeft(Gt(Gt(r))))}this.root_.color=wi},ke.prototype.values=function(){var r=new W,e=this.getFirstEntry();if(e!==null)for(r.add(e.value);(e=ke.successor(e))!==null;)r.add(e.value);return r},ke.prototype.entrySet=function(){var r=new ud,e=this.getFirstEntry();if(e!==null)for(r.add(e);(e=ke.successor(e))!==null;)r.add(e);return r},ke.prototype.rotateLeft=function(r){if(r!=null){var e=r.right;r.right=e.left,e.left!=null&&(e.left.parent=r),e.parent=r.parent,r.parent===null?this.root_=e:r.parent.left===r?r.parent.left=e:r.parent.right=e,e.left=r,r.parent=e}},ke.prototype.rotateRight=function(r){if(r!=null){var e=r.left;r.left=e.right,e.right!=null&&(e.right.parent=r),e.parent=r.parent,r.parent===null?this.root_=e:r.parent.right===r?r.parent.right=e:r.parent.left=e,e.right=r,r.parent=e}},ke.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},ke.successor=function(r){if(r===null)return null;if(r.right!==null){for(var e=r.right;e.left!==null;)e=e.left;return e}else{for(var t=r.parent,n=r;t!==null&&n===t.right;)n=t,t=t.parent;return t}},ke.prototype.size=function(){return this.size_};var Xu=function(){};Xu.prototype.interfaces_=function(){return[]},Xu.prototype.getClass=function(){return Xu};function Dm(){}Dm.prototype=new oc;function fr(){this.array_=[],arguments[0]instanceof fe&&this.addAll(arguments[0])}fr.prototype=new Dm,fr.prototype.contains=function(r){for(var e=this,t=0,n=this.array_.length;t<n;t++){var i=e.array_[t];if(i.compareTo(r)===0)return!0}return!1},fr.prototype.add=function(r){var e=this;if(this.contains(r))return!1;for(var t=0,n=this.array_.length;t<n;t++){var i=e.array_[t];if(i.compareTo(r)===1)return e.array_.splice(t,0,r),!0}return this.array_.push(r),!0},fr.prototype.addAll=function(r){for(var e=this,t=r.iterator();t.hasNext();)e.add(t.next());return!0},fr.prototype.remove=function(r){throw new qu},fr.prototype.size=function(){return this.array_.length},fr.prototype.isEmpty=function(){return this.array_.length===0},fr.prototype.toArray=function(){for(var r=this,e=[],t=0,n=this.array_.length;t<n;t++)e.push(r.array_[t]);return e},fr.prototype.iterator=function(){return new ac(this)};var ac=function(r){this.treeSet_=r,this.position_=0};ac.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new ya;return this.treeSet_.array_[this.position_++]},ac.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},ac.prototype.remove=function(){throw new qu};var bs=function(){};bs.sort=function(){var e=arguments[0],t,n,i,s;if(arguments.length===1)s=function(a,u){return a.compareTo(u)},e.sort(s);else if(arguments.length===2)i=arguments[1],s=function(a,u){return i.compare(a,u)},e.sort(s);else if(arguments.length===3){n=e.slice(arguments[1],arguments[2]),n.sort();var o=e.slice(0,arguments[1]).concat(n,e.slice(arguments[2],e.length));for(e.splice(0,e.length),t=0;t<o.length;t++)e.push(o[t])}else if(arguments.length===4)for(n=e.slice(arguments[1],arguments[2]),i=arguments[3],s=function(a,u){return i.compare(a,u)},n.sort(s),o=e.slice(0,arguments[1]).concat(n,e.slice(arguments[2],e.length)),e.splice(0,e.length),t=0;t<o.length;t++)e.push(o[t])},bs.asList=function(e){for(var t=new W,n=0,i=e.length;n<i;n++)t.add(e[n]);return t};var Rt=function(){},tr={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};tr.P.get=function(){return 0},tr.L.get=function(){return 1},tr.A.get=function(){return 2},tr.FALSE.get=function(){return-1},tr.TRUE.get=function(){return-2},tr.DONTCARE.get=function(){return-3},tr.SYM_FALSE.get=function(){return"F"},tr.SYM_TRUE.get=function(){return"T"},tr.SYM_DONTCARE.get=function(){return"*"},tr.SYM_P.get=function(){return"0"},tr.SYM_L.get=function(){return"1"},tr.SYM_A.get=function(){return"2"},Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt},Rt.toDimensionSymbol=function(e){switch(e){case Rt.FALSE:return Rt.SYM_FALSE;case Rt.TRUE:return Rt.SYM_TRUE;case Rt.DONTCARE:return Rt.SYM_DONTCARE;case Rt.P:return Rt.SYM_P;case Rt.L:return Rt.SYM_L;case Rt.A:return Rt.SYM_A}throw new Yt("Unknown dimension value: "+e)},Rt.toDimensionValue=function(e){switch(Uu.toUpperCase(e)){case Rt.SYM_FALSE:return Rt.FALSE;case Rt.SYM_TRUE:return Rt.TRUE;case Rt.SYM_DONTCARE:return Rt.DONTCARE;case Rt.SYM_P:return Rt.P;case Rt.SYM_L:return Rt.L;case Rt.SYM_A:return Rt.A}throw new Yt("Unknown dimension symbol: "+e)},Object.defineProperties(Rt,tr);var pr=function(){};pr.prototype.filter=function(e){},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr};var er=function(){};er.prototype.filter=function(e,t){},er.prototype.isDone=function(){},er.prototype.isGeometryChanged=function(){},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er};var Ge=function(r){function e(n,i){if(r.call(this,i),this._geometries=n||[],r.hasNullElements(this._geometries))throw new Yt("geometries must not contain null elements")}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var i=this,s=new Q,o=0;o<this._geometries.length;o++)s.expandToInclude(i._geometries[o].getEnvelopeInternal());return s},e.prototype.getGeometryN=function(i){return this._geometries[i]},e.prototype.getSortIndex=function(){return r.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var i=this,s=new Array(this.getNumPoints()).fill(null),o=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)o++,s[o]=u[l];return s},e.prototype.getArea=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getArea();return s},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._geometries.length!==a._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(a._geometries[u],o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var i=this,s=0;s<this._geometries.length;s++)i._geometries[s].normalize();bs.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var i=this,s=Rt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getBoundaryDimension());return s},e.prototype.getDimension=function(){for(var i=this,s=Rt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getDimension());return s},e.prototype.getLength=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getLength();return s},e.prototype.getNumPoints=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getNumPoints();return s},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(o)},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=new fr(bs.asList(this._geometries)),a=new fr(bs.asList(s._geometries));return this.compare(o,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],c=u,h=this.getNumGeometries(),f=c.getNumGeometries(),p=0;p<h&&p<f;){var v=i.getGeometryN(p),C=c.getGeometryN(p),S=v.compareToSameClass(C,l);if(S!==0)return S;p++}return p<h?1:p<f?-1:0}},e.prototype.apply=function(){var i=this;if(at(arguments[0],Wr))for(var s=arguments[0],o=0;o<this._geometries.length;o++)i._geometries[o].apply(s);else if(at(arguments[0],er)){var a=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(a),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(at(arguments[0],pr)){var l=arguments[0];l.filter(this);for(var c=0;c<this._geometries.length;c++)i._geometries[c].apply(l)}else if(at(arguments[0],yi)){var h=arguments[0];h.filter(this);for(var f=0;f<this._geometries.length;f++)i._geometries[f].apply(h)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),yt.shouldNeverReachHere(),null},e.prototype.clone=function(){var i=this,s=r.prototype.clone.call(this);s._geometries=new Array(this._geometries.length).fill(null);for(var o=0;o<this._geometries.length;o++)s._geometries[o]=i._geometries[o].clone();return s},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.isEmpty=function(){for(var i=this,s=0;s<this._geometries.length;s++)if(!i._geometries[s].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(e,t),e}(ot),Ps=function(r){function e(){r.apply(this,arguments)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Rt.FALSE:0},e.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var s=0;s<this._geometries.length;s++)if(!i._geometries[s].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[s-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(o)},e.prototype.getBoundary=function(){return new jn(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.interfaces_=function(){return[Xu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(e,t),e}(Ge),jn=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var e=arguments[0],t=Vn.MOD2_BOUNDARY_RULE;this._geom=e,this._geomFact=e.getFactory(),this._bnRule=t}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}};jn.prototype.boundaryMultiLineString=function(e){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var t=this.computeBoundaryCoordinates(e);return t.length===1?this._geomFact.createPoint(t[0]):this._geomFact.createMultiPointFromCoords(t)},jn.prototype.getBoundary=function(){return this._geom instanceof te?this.boundaryLineString(this._geom):this._geom instanceof Ps?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},jn.prototype.boundaryLineString=function(e){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(e.isClosed()){var t=this._bnRule.isInBoundary(2);return t?e.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([e.getStartPoint(),e.getEndPoint()])},jn.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},jn.prototype.computeBoundaryCoordinates=function(e){var t=this,n=new W;this._endpointMap=new ke;for(var i=0;i<e.getNumGeometries();i++){var s=e.getGeometryN(i);s.getNumPoints()!==0&&(t.addEndpoint(s.getCoordinateN(0)),t.addEndpoint(s.getCoordinateN(s.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var a=o.next(),u=a.getValue(),l=u.count;t._bnRule.isInBoundary(l)&&n.add(a.getKey())}return Ct.toCoordinateArray(n)},jn.prototype.addEndpoint=function(e){var t=this._endpointMap.get(e);t===null&&(t=new uc,this._endpointMap.put(e,t)),t.count++},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.getBoundary=function(){if(arguments.length===1){var e=arguments[0],t=new jn(e);return t.getBoundary()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=new jn(n,i);return s.getBoundary()}};var uc=function(){this.count=null};uc.prototype.interfaces_=function(){return[]},uc.prototype.getClass=function(){return uc};function GE(){}function WE(){}var HE=function(){};function qE(){}function XE(){}function YE(){}var Bn=function(){},cd={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},Bn.chars=function(e,t){for(var n=new Array(t).fill(null),i=0;i<t;i++)n[i]=e;return String(n)},Bn.getStackTrace=function(){if(arguments.length===1){var e=arguments[0],t=new qE,n=new GE;return e.printStackTrace(n),t.toString()}else if(arguments.length===2){var i=arguments[0],s=arguments[1],o="";new WE(Bn.getStackTrace(i));for(var a=new YE,u=0;u<s;u++)try{o+=a.readLine()+Bn.NEWLINE}catch(l){if(l instanceof XE)yt.shouldNeverReachHere();else throw l}finally{}return o}},Bn.split=function(e,t){for(var n=t.length,i=new W,s=""+e,o=s.indexOf(t);o>=0;){var a=s.substring(0,o);i.add(a),s=s.substring(o+n),o=s.indexOf(t)}s.length>0&&i.add(s);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},Bn.toString=function(){if(arguments.length===1){var e=arguments[0];return Bn.SIMPLE_ORDINATE_FORMAT.format(e)}},Bn.spaces=function(e){return Bn.chars(" ",e)},cd.NEWLINE.get=function(){return Te.getProperty("line.separator")},cd.SIMPLE_ORDINATE_FORMAT.get=function(){return new HE},Object.defineProperties(Bn,cd);var ie=function(){};ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie},ie.copyCoord=function(e,t,n,i){for(var s=Math.min(e.getDimension(),n.getDimension()),o=0;o<s;o++)n.setOrdinate(i,o,e.getOrdinate(t,o))},ie.isRing=function(e){var t=e.size();return t===0?!0:t<=3?!1:e.getOrdinate(0,Ot.X)===e.getOrdinate(t-1,Ot.X)&&e.getOrdinate(0,Ot.Y)===e.getOrdinate(t-1,Ot.Y)},ie.isEqual=function(e,t){var n=e.size(),i=t.size();if(n!==i)return!1;for(var s=Math.min(e.getDimension(),t.getDimension()),o=0;o<n;o++)for(var a=0;a<s;a++){var u=e.getOrdinate(o,a),l=t.getOrdinate(o,a);if(e.getOrdinate(o,a)!==t.getOrdinate(o,a)&&!(ht.isNaN(u)&&ht.isNaN(l)))return!1}return!0},ie.extend=function(e,t,n){var i=e.create(n,t.getDimension()),s=t.size();if(ie.copy(t,0,i,0,s),s>0)for(var o=s;o<n;o++)ie.copy(t,s-1,i,o,1);return i},ie.reverse=function(e){for(var t=e.size()-1,n=Math.trunc(t/2),i=0;i<=n;i++)ie.swap(e,i,t-i)},ie.swap=function(e,t,n){if(t===n)return null;for(var i=0;i<e.getDimension();i++){var s=e.getOrdinate(t,i);e.setOrdinate(t,i,e.getOrdinate(n,i)),e.setOrdinate(n,i,s)}},ie.copy=function(e,t,n,i,s){for(var o=0;o<s;o++)ie.copyCoord(e,t+o,n,i+o)},ie.toString=function(){if(arguments.length===1){var e=arguments[0],t=e.size();if(t===0)return"()";var n=e.getDimension(),i=new lr;i.append("(");for(var s=0;s<t;s++){s>0&&i.append(" ");for(var o=0;o<n;o++)o>0&&i.append(","),i.append(Bn.toString(e.getOrdinate(s,o)))}return i.append(")"),i.toString()}},ie.ensureValidRing=function(e,t){var n=t.size();if(n===0)return t;if(n<=3)return ie.createClosedRing(e,t,4);var i=t.getOrdinate(0,Ot.X)===t.getOrdinate(n-1,Ot.X)&&t.getOrdinate(0,Ot.Y)===t.getOrdinate(n-1,Ot.Y);return i?t:ie.createClosedRing(e,t,n+1)},ie.createClosedRing=function(e,t,n){var i=e.create(n,t.getDimension()),s=t.size();ie.copy(t,0,i,0,s);for(var o=s;o<n;o++)ie.copy(t,0,i,o,1);return i};var te=function(r){function e(n,i){r.call(this,i),this._points=null,this.init(n)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Q:this._points.expandEnvelope(new Q)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return r.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._points.size()!==a._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),a._points.getCoordinate(u),o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var i=this,s=0;s<Math.trunc(this._points.size()/2);s++){var o=i._points.size()-1-s;if(!i._points.getCoordinate(s).equals(i._points.getCoordinate(o)))return i._points.getCoordinate(s).compareTo(i._points.getCoordinate(o))>0&&ie.reverse(i._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Rt.FALSE:0},e.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return q.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var i=this._points.copy();ie.reverse(i);var s=this.getFactory().createLineString(i);return s},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var s=arguments[0],o=s,a=0,u=0;a<this._points.size()&&u<o._points.size();){var l=i._points.getCoordinate(a).compareTo(o._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<o._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],h=arguments[1],f=c;return h.compare(this._points,f._points)}},e.prototype.apply=function(){var i=this;if(at(arguments[0],Wr))for(var s=arguments[0],o=0;o<this._points.size();o++)s.filter(i._points.getCoordinate(o));else if(at(arguments[0],er)){var a=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(a.filter(i._points,u),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(at(arguments[0],pr)){var l=arguments[0];l.filter(this)}else if(at(arguments[0],yi)){var c=arguments[0];c.filter(this)}},e.prototype.getBoundary=function(){return new jn(this).getBoundary()},e.prototype.isEquivalentClass=function(i){return i instanceof e},e.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._points=this._points.clone(),i},e.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return this._points.size()===0},e.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new Yt("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},e.prototype.isCoordinate=function(i){for(var s=this,o=0;o<this._points.size();o++)if(s._points.getCoordinate(o).equals(i))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},e.prototype.interfaces_=function(){return[Xu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,t),e}(ot),Yu=function(){};Yu.prototype.interfaces_=function(){return[]},Yu.prototype.getClass=function(){return Yu};var dn=function(r){function e(n,i){r.call(this,i),this._coordinates=n||null,this.init(this._coordinates)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Q;var i=new Q;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},e.prototype.getSortIndex=function(){return r.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Rt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],s=i;return this.getCoordinate().compareTo(s.getCoordinate())}else if(arguments.length===2){var o=arguments[0],a=arguments[1],u=o;return a.compare(this._coordinates,u._coordinates)}},e.prototype.apply=function(){if(at(arguments[0],Wr)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(at(arguments[0],er)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(at(arguments[0],pr)){var o=arguments[0];o.filter(this)}else if(at(arguments[0],yi)){var a=arguments[0];a.filter(this)}},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return this._coordinates.size()===0},e.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),yt.isTrue(i.size()<=1),this._coordinates=i},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Yu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(e,t),e}(ot),$i=function(){};$i.prototype.interfaces_=function(){return[]},$i.prototype.getClass=function(){return $i};var pe=function(r){function e(n,i,s){if(r.call(this,s),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),i===null&&(i=[]),r.hasNullElements(i))throw new Yt("holes must not contain null elements");if(n.isEmpty()&&r.hasNonEmptyElements(i))throw new Yt("shell is empty but holes are not");this._shell=n,this._holes=i}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return r.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var s=new Array(this.getNumPoints()).fill(null),o=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)o++,s[o]=a[u];for(var l=0;l<this._holes.length;l++)for(var c=i._holes[l].getCoordinates(),h=0;h<c.length;h++)o++,s[o]=c[h];return s},e.prototype.getArea=function(){var i=this,s=0;s+=Math.abs(q.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)s-=Math.abs(q.signedArea(i._holes[o].getCoordinateSequence()));return s},e.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),s=this.getEnvelopeInternal(),o=0;o<5;o++){var a=i.getX(o);if(!(a===s.getMinX()||a===s.getMaxX()))return!1;var u=i.getY(o);if(!(u===s.getMinY()||u===s.getMaxY()))return!1}for(var l=i.getX(0),c=i.getY(0),h=1;h<=4;h++){var f=i.getX(h),p=i.getY(h),v=f!==l,C=p!==c;if(v===C)return!1;l=f,c=p}return!0},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s,u=this._shell,l=a._shell;if(!u.equalsExact(l,o)||this._holes.length!==a._holes.length)return!1;for(var c=0;c<this._holes.length;c++)if(!i._holes[c].equalsExact(a._holes[c],o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var s=0;s<this._holes.length;s++)i.normalize(i._holes[s],!1);bs.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],a=arguments[1];if(o.isEmpty())return null;var u=new Array(o.getCoordinates().length-1).fill(null);Te.arraycopy(o.getCoordinates(),0,u,0,u.length);var l=Ct.minCoordinate(o.getCoordinates());Ct.scroll(u,l),Te.arraycopy(u,0,o.getCoordinates(),0,u.length),o.getCoordinates()[u.length]=u[0],q.isCCW(o.getCoordinates())===a&&Ct.reverse(o.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var i=this,s=0;s+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)s+=i._holes[o].getLength();return s},e.prototype.getNumPoints=function(){for(var i=this,s=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)s+=i._holes[o].getNumPoints();return s},e.prototype.reverse=function(){var i=this,s=this.copy();s._shell=this._shell.copy().reverse(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].copy().reverse();return s},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=this._shell,a=s._shell;return o.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],c=u,h=this._shell,f=c._shell,p=h.compareToSameClass(f,l);if(p!==0)return p;for(var v=this.getNumInteriorRing(),C=c.getNumInteriorRing(),S=0;S<v&&S<C;){var P=i.getInteriorRingN(S),y=c.getInteriorRingN(S),_=P.compareToSameClass(y,l);if(_!==0)return _;S++}return S<v?1:S<C?-1:0}},e.prototype.apply=function(i){var s=this;if(at(i,Wr)){this._shell.apply(i);for(var o=0;o<this._holes.length;o++)s._holes[o].apply(i)}else if(at(i,er)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(s._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(at(i,pr))i.filter(this);else if(at(i,yi)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)s._holes[u].apply(i)}},e.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var s=new Array(this._holes.length+1).fill(null);s[0]=this._shell;for(var o=0;o<this._holes.length;o++)s[o+1]=i._holes[o];return s.length<=1?this.getFactory().createLinearRing(s[0].getCoordinateSequence()):this.getFactory().createMultiLineString(s)},e.prototype.clone=function(){var i=this,s=r.prototype.clone.call(this);s._shell=this._shell.clone(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].clone();return s},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var i=this,s=this._shell.copy(),o=new Array(this._holes.length).fill(null),a=0;a<o.length;a++)o[a]=i._holes[a].copy();return new e(s,o,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(i){return this._holes[i]},e.prototype.interfaces_=function(){return[$i]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,t),e}(ot),wa=function(r){function e(){r.apply(this,arguments)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return r.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Rt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.interfaces_=function(){return[Yu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(e,t),e}(Ge),Hr=function(r){function e(n,i){n instanceof R&&i instanceof St&&(n=i.getCoordinateSequenceFactory().create(n)),r.call(this,n,i),this.validateConstruction()}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Rt.FALSE},e.prototype.isClosed=function(){return this.isEmpty()?!0:r.prototype.isClosed.call(this)},e.prototype.reverse=function(){var i=this._points.copy();ie.reverse(i);var s=this.getFactory().createLinearRing(i);return s},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new Yt("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new Yt("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.MINIMUM_VALID_SIZE.get=function(){return 4},t.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,t),e}(te),qr=function(r){function e(){r.apply(this,arguments)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(o)},e.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var s=new W,o=0;o<this._geometries.length;o++)for(var a=i._geometries[o],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)s.add(u.getGeometryN(l));var c=new Array(s.size()).fill(null);return this.getFactory().createMultiLineString(s.toArray(c))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.interfaces_=function(){return[$i]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,t),e}(Ge),zn=function(e){this._factory=e||null,this._isUserDataCopied=!1},lc={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};zn.prototype.setCopyUserData=function(e){this._isUserDataCopied=e},zn.prototype.edit=function(e,t){if(e===null)return null;var n=this.editInternal(e,t);return this._isUserDataCopied&&n.setUserData(e.getUserData()),n},zn.prototype.editInternal=function(e,t){return this._factory===null&&(this._factory=e.getFactory()),e instanceof Ge?this.editGeometryCollection(e,t):e instanceof pe?this.editPolygon(e,t):e instanceof dn?t.edit(e,this._factory):e instanceof te?t.edit(e,this._factory):(yt.shouldNeverReachHere("Unsupported Geometry class: "+e.getClass().getName()),null)},zn.prototype.editGeometryCollection=function(e,t){for(var n=this,i=t.edit(e,this._factory),s=new W,o=0;o<i.getNumGeometries();o++){var a=n.edit(i.getGeometryN(o),t);a===null||a.isEmpty()||s.add(a)}return i.getClass()===wa?this._factory.createMultiPoint(s.toArray([])):i.getClass()===Ps?this._factory.createMultiLineString(s.toArray([])):i.getClass()===qr?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))},zn.prototype.editPolygon=function(e,t){var n=this,i=t.edit(e,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var s=this.edit(i.getExteriorRing(),t);if(s===null||s.isEmpty())return this._factory.createPolygon();for(var o=new W,a=0;a<i.getNumInteriorRing();a++){var u=n.edit(i.getInteriorRingN(a),t);u===null||u.isEmpty()||o.add(u)}return this._factory.createPolygon(s,o.toArray([]))},zn.prototype.interfaces_=function(){return[]},zn.prototype.getClass=function(){return zn},zn.GeometryEditorOperation=function(){},lc.NoOpGeometryOperation.get=function(){return Ju},lc.CoordinateOperation.get=function(){return $u},lc.CoordinateSequenceOperation.get=function(){return Ku},Object.defineProperties(zn,lc);var Ju=function(){};Ju.prototype.edit=function(e,t){return e},Ju.prototype.interfaces_=function(){return[zn.GeometryEditorOperation]},Ju.prototype.getClass=function(){return Ju};var $u=function(){};$u.prototype.edit=function(e,t){var n=this.editCoordinates(e.getCoordinates(),e);return n===null?e:e instanceof Hr?t.createLinearRing(n):e instanceof te?t.createLineString(n):e instanceof dn?n.length>0?t.createPoint(n[0]):t.createPoint():e},$u.prototype.interfaces_=function(){return[zn.GeometryEditorOperation]},$u.prototype.getClass=function(){return $u};var Ku=function(){};Ku.prototype.edit=function(e,t){return e instanceof Hr?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof te?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof dn?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e},Ku.prototype.interfaces_=function(){return[zn.GeometryEditorOperation]},Ku.prototype.getClass=function(){return Ku};var se=function(){var e=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var n=0;n<t;n++)e._coordinates[n]=new R}else if(at(arguments[0],Ot)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var s=0;s<this._coordinates.length;s++)e._coordinates[s]=i.getCoordinateCopy(s)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],a=arguments[1];this._coordinates=o,this._dimension=a,o===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var c=0;c<u;c++)e._coordinates[c]=new R}}},Mm={serialVersionUID:{configurable:!0}};se.prototype.setOrdinate=function(e,t,n){switch(t){case Ot.X:this._coordinates[e].x=n;break;case Ot.Y:this._coordinates[e].y=n;break;case Ot.Z:this._coordinates[e].z=n;break;default:throw new Yt("invalid ordinateIndex")}},se.prototype.size=function(){return this._coordinates.length},se.prototype.getOrdinate=function(e,t){switch(t){case Ot.X:return this._coordinates[e].x;case Ot.Y:return this._coordinates[e].y;case Ot.Z:return this._coordinates[e].z}return ht.NaN},se.prototype.getCoordinate=function(){if(arguments.length===1){var e=arguments[0];return this._coordinates[e]}else if(arguments.length===2){var t=arguments[0],n=arguments[1];n.x=this._coordinates[t].x,n.y=this._coordinates[t].y,n.z=this._coordinates[t].z}},se.prototype.getCoordinateCopy=function(e){return new R(this._coordinates[e])},se.prototype.getDimension=function(){return this._dimension},se.prototype.getX=function(e){return this._coordinates[e].x},se.prototype.clone=function(){for(var e=this,t=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)t[n]=e._coordinates[n].clone();return new se(t,this._dimension)},se.prototype.expandEnvelope=function(e){for(var t=this,n=0;n<this._coordinates.length;n++)e.expandToInclude(t._coordinates[n]);return e},se.prototype.copy=function(){for(var e=this,t=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)t[n]=e._coordinates[n].copy();return new se(t,this._dimension)},se.prototype.toString=function(){var e=this;if(this._coordinates.length>0){var t=new lr(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)t.append(", "),t.append(e._coordinates[n]);return t.append(")"),t.toString()}else return"()"},se.prototype.getY=function(e){return this._coordinates[e].y},se.prototype.toCoordinateArray=function(){return this._coordinates},se.prototype.interfaces_=function(){return[Ot,kn]},se.prototype.getClass=function(){return se},Mm.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(se,Mm);var Xr=function(){},hd={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Xr.prototype.readResolve=function(){return Xr.instance()},Xr.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new se(e)}else if(at(arguments[0],Ot)){var t=arguments[0];return new se(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new se(n):new se(n,i)}},Xr.prototype.interfaces_=function(){return[ca,kn]},Xr.prototype.getClass=function(){return Xr},Xr.instance=function(){return Xr.instanceObject},hd.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},hd.instanceObject.get=function(){return new Xr},Object.defineProperties(Xr,hd);var Rm=function(r){function e(){r.call(this),this.map_=new Map}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.get=function(n){return this.map_.get(n)||null},e.prototype.put=function(n,i){return this.map_.set(n,i),i},e.prototype.values=function(){for(var n=new W,i=this.map_.values(),s=i.next();!s.done;)n.add(s.value),s=i.next();return n},e.prototype.entrySet=function(){var n=new ud;return this.map_.entries().forEach(function(i){return n.add(i)}),n},e.prototype.size=function(){return this.map_.size()},e}(ho),Lt=function r(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=r.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof gr){var e=arguments[0];this._modelType=e,e===r.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var t=arguments[0];this._modelType=r.FIXED,this.setScale(t)}else if(arguments[0]instanceof r){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},dd={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Lt.prototype.equals=function(e){if(!(e instanceof Lt))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale},Lt.prototype.compareTo=function(e){var t=e,n=this.getMaximumSignificantDigits(),i=t.getMaximumSignificantDigits();return new cr(n).compareTo(new cr(i))},Lt.prototype.getScale=function(){return this._scale},Lt.prototype.isFloating=function(){return this._modelType===Lt.FLOATING||this._modelType===Lt.FLOATING_SINGLE},Lt.prototype.getType=function(){return this._modelType},Lt.prototype.toString=function(){var e="UNKNOWN";return this._modelType===Lt.FLOATING?e="Floating":this._modelType===Lt.FLOATING_SINGLE?e="Floating-Single":this._modelType===Lt.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e},Lt.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var e=arguments[0];if(ht.isNaN(e))return e;if(this._modelType===Lt.FLOATING_SINGLE){var t=e;return t}return this._modelType===Lt.FIXED?Math.round(e*this._scale)/this._scale:e}else if(arguments[0]instanceof R){var n=arguments[0];if(this._modelType===Lt.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},Lt.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===Lt.FLOATING?e=16:this._modelType===Lt.FLOATING_SINGLE?e=6:this._modelType===Lt.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e},Lt.prototype.setScale=function(e){this._scale=Math.abs(e)},Lt.prototype.interfaces_=function(){return[kn,An]},Lt.prototype.getClass=function(){return Lt},Lt.mostPrecise=function(e,t){return e.compareTo(t)>=0?e:t},dd.serialVersionUID.get=function(){return 7777263578777804e3},dd.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Lt,dd);var gr=function r(e){this._name=e||null,r.nameToTypeMap.put(e,this)},fd={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};gr.prototype.readResolve=function(){return gr.nameToTypeMap.get(this._name)},gr.prototype.toString=function(){return this._name},gr.prototype.interfaces_=function(){return[kn]},gr.prototype.getClass=function(){return gr},fd.serialVersionUID.get=function(){return-552860263173159e4},fd.nameToTypeMap.get=function(){return new Rm},Object.defineProperties(gr,fd),Lt.Type=gr,Lt.FIXED=new gr("FIXED"),Lt.FLOATING=new gr("FLOATING"),Lt.FLOATING_SINGLE=new gr("FLOATING SINGLE");var St=function r(){this._precisionModel=new Lt,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?at(arguments[0],ca)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Lt&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Lm={serialVersionUID:{configurable:!0}};St.prototype.toGeometry=function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new R(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new R(e.getMinX(),e.getMinY()),new R(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new R(e.getMinX(),e.getMinY()),new R(e.getMinX(),e.getMaxY()),new R(e.getMaxX(),e.getMaxY()),new R(e.getMaxX(),e.getMinY()),new R(e.getMinX(),e.getMinY())]),null)},St.prototype.createLineString=function(e){if(e){if(e instanceof Array)return new te(this.getCoordinateSequenceFactory().create(e),this);if(at(e,Ot))return new te(e,this)}else return new te(this.getCoordinateSequenceFactory().create([]),this)},St.prototype.createMultiLineString=function(){if(arguments.length===0)return new Ps(null,this);if(arguments.length===1){var e=arguments[0];return new Ps(e,this)}},St.prototype.buildGeometry=function(e){for(var t=null,n=!1,i=!1,s=e.iterator();s.hasNext();){var o=s.next(),a=o.getClass();t===null&&(t=a),a!==t&&(n=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(t===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(St.toGeometryArray(e));var u=e.iterator().next(),l=e.size()>1;if(l){if(u instanceof pe)return this.createMultiPolygon(St.toPolygonArray(e));if(u instanceof te)return this.createMultiLineString(St.toLineStringArray(e));if(u instanceof dn)return this.createMultiPoint(St.toPointArray(e));yt.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},St.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)},St.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof R){var e=arguments[0];return this.createPoint(e!==null?this.getCoordinateSequenceFactory().create([e]):null)}else if(at(arguments[0],Ot)){var t=arguments[0];return new dn(t,this)}}},St.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},St.prototype.createPolygon=function(){if(arguments.length===0)return new pe(null,null,this);if(arguments.length===1){if(at(arguments[0],Ot)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Hr){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];return new pe(i,s,this)}},St.prototype.getSRID=function(){return this._SRID},St.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Ge(null,this);if(arguments.length===1){var e=arguments[0];return new Ge(e,this)}},St.prototype.createGeometry=function(e){var t=new zn(this);return t.edit(e,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},St.prototype.getPrecisionModel=function(){return this._precisionModel},St.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(e!==null?this.getCoordinateSequenceFactory().create(e):null)}else if(at(arguments[0],Ot)){var t=arguments[0];return new Hr(t,this)}}},St.prototype.createMultiPolygon=function(){if(arguments.length===0)return new qr(null,this);if(arguments.length===1){var e=arguments[0];return new qr(e,this)}},St.prototype.createMultiPoint=function(){var e=this;if(arguments.length===0)return new wa(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new wa(t,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(at(arguments[0],Ot)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(i.size()).fill(null),o=0;o<i.size();o++){var a=e.getCoordinateSequenceFactory().create(1,i.getDimension());ie.copy(i,o,a,0,1),s[o]=e.createPoint(a)}return this.createMultiPoint(s)}}},St.prototype.interfaces_=function(){return[kn]},St.prototype.getClass=function(){return St},St.toMultiPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.toGeometryArray=function(e){if(e===null)return null;var t=new Array(e.size()).fill(null);return e.toArray(t)},St.getDefaultCoordinateSequenceFactory=function(){return Xr.instance()},St.toMultiLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.toLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.toMultiPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.toLinearRingArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.toPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.toPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.createPointFromInternalCoord=function(e,t){return t.getPrecisionModel().makePrecise(e),t.getFactory().createPoint(e)},Lm.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(St,Lm);var JE=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],cc=function(e){this.geometryFactory=e||new St};cc.prototype.read=function(e){var t;typeof e=="string"?t=JSON.parse(e):t=e;var n=t.type;if(!mr[n])throw new Error("Unknown GeoJSON type: "+t.type);return JE.indexOf(n)!==-1?mr[n].apply(this,[t.coordinates]):n==="GeometryCollection"?mr[n].apply(this,[t.geometries]):mr[n].apply(this,[t])},cc.prototype.write=function(e){var t=e.getGeometryType();if(!Ci[t])throw new Error("Geometry is not supported");return Ci[t].apply(this,[e])};var mr={Feature:function(r){var e={};for(var t in r)e[t]=r[t];if(r.geometry){var n=r.geometry.type;if(!mr[n])throw new Error("Unknown GeoJSON type: "+r.type);e.geometry=this.read(r.geometry)}return r.bbox&&(e.bbox=mr.bbox.apply(this,[r.bbox])),e},FeatureCollection:function(r){var e=this,t={};if(r.features){t.features=[];for(var n=0;n<r.features.length;++n)t.features.push(e.read(r.features[n]))}return r.bbox&&(t.bbox=this.parse.bbox.apply(this,[r.bbox])),t},coordinates:function(r){for(var e=[],t=0;t<r.length;++t){var n=r[t];e.push(new R(n[0],n[1]))}return e},bbox:function(r){return this.geometryFactory.createLinearRing([new R(r[0],r[1]),new R(r[2],r[1]),new R(r[2],r[3]),new R(r[0],r[3]),new R(r[0],r[1])])},Point:function(r){var e=new R(r[0],r[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(r){for(var e=this,t=[],n=0;n<r.length;++n)t.push(mr.Point.apply(e,[r[n]]));return this.geometryFactory.createMultiPoint(t)},LineString:function(r){var e=mr.coordinates.apply(this,[r]);return this.geometryFactory.createLineString(e)},MultiLineString:function(r){for(var e=this,t=[],n=0;n<r.length;++n)t.push(mr.LineString.apply(e,[r[n]]));return this.geometryFactory.createMultiLineString(t)},Polygon:function(r){for(var e=this,t=mr.coordinates.apply(this,[r[0]]),n=this.geometryFactory.createLinearRing(t),i=[],s=1;s<r.length;++s){var o=r[s],a=mr.coordinates.apply(e,[o]),u=e.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(r){for(var e=this,t=[],n=0;n<r.length;++n){var i=r[n];t.push(mr.Polygon.apply(e,[i]))}return this.geometryFactory.createMultiPolygon(t)},GeometryCollection:function(r){for(var e=this,t=[],n=0;n<r.length;++n){var i=r[n];t.push(e.read(i))}return this.geometryFactory.createGeometryCollection(t)}},Ci={coordinate:function(r){return[r.x,r.y]},Point:function(r){var e=Ci.coordinate.apply(this,[r.getCoordinate()]);return{type:"Point",coordinates:e}},MultiPoint:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=Ci.Point.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiPoint",coordinates:t}},LineString:function(r){for(var e=this,t=[],n=r.getCoordinates(),i=0;i<n.length;++i){var s=n[i];t.push(Ci.coordinate.apply(e,[s]))}return{type:"LineString",coordinates:t}},MultiLineString:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=Ci.LineString.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiLineString",coordinates:t}},Polygon:function(r){var e=this,t=[],n=Ci.LineString.apply(this,[r._shell]);t.push(n.coordinates);for(var i=0;i<r._holes.length;++i){var s=r._holes[i],o=Ci.LineString.apply(e,[s]);t.push(o.coordinates)}return{type:"Polygon",coordinates:t}},MultiPolygon:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=Ci.Polygon.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiPolygon",coordinates:t}},GeometryCollection:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=i.getGeometryType();t.push(Ci[s].apply(e,[i]))}return{type:"GeometryCollection",geometries:t}}},pd=function(e){this.geometryFactory=e||new St,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new cc(this.geometryFactory)};pd.prototype.read=function(e){var t=this.parser.read(e);return this.precisionModel.getType()===Lt.FIXED&&this.reducePrecision(t),t},pd.prototype.reducePrecision=function(e){var t=this,n,i;if(e.coordinate)this.precisionModel.makePrecise(e.coordinate);else if(e.points)for(n=0,i=e.points.length;n<i;n++)t.precisionModel.makePrecise(e.points[n]);else if(e.geometries)for(n=0,i=e.geometries.length;n<i;n++)t.reducePrecision(e.geometries[n])};var Fm=function(){this.parser=new cc(this.geometryFactory)};Fm.prototype.write=function(e){return this.parser.write(e)};var U=function(){},hc={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};U.prototype.interfaces_=function(){return[]},U.prototype.getClass=function(){return U},U.opposite=function(e){return e===U.LEFT?U.RIGHT:e===U.RIGHT?U.LEFT:e},hc.ON.get=function(){return 0},hc.LEFT.get=function(){return 1},hc.RIGHT.get=function(){return 2},Object.defineProperties(U,hc);function dc(r){this.message=r||""}dc.prototype=new Error,dc.prototype.name="EmptyStackException";function vr(){this.array_=[]}vr.prototype=new Qn,vr.prototype.add=function(r){return this.array_.push(r),!0},vr.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},vr.prototype.push=function(r){return this.array_.push(r),r},vr.prototype.pop=function(r){if(this.array_.length===0)throw new dc;return this.array_.pop()},vr.prototype.peek=function(){if(this.array_.length===0)throw new dc;return this.array_[this.array_.length-1]},vr.prototype.empty=function(){return this.array_.length===0},vr.prototype.isEmpty=function(){return this.empty()},vr.prototype.search=function(r){return this.array_.indexOf(r)},vr.prototype.size=function(){return this.array_.length},vr.prototype.toArray=function(){for(var r=this,e=[],t=0,n=this.array_.length;t<n;t++)e.push(r.array_[t]);return e};var yr=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};yr.prototype.getCoordinate=function(){return this._minCoord},yr.prototype.getRightmostSide=function(e,t){var n=this.getRightmostSideOfSegment(e,t);return n<0&&(n=this.getRightmostSideOfSegment(e,t-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(e)),n},yr.prototype.findRightmostEdgeAtVertex=function(){var e=this._minDe.getEdge().getCoordinates();yt.isTrue(this._minIndex>0&&this._minIndex<e.length,"rightmost point expected to be interior vertex of edge");var t=e[this._minIndex-1],n=e[this._minIndex+1],i=q.computeOrientation(this._minCoord,n,t),s=!1;(t.y<this._minCoord.y&&n.y<this._minCoord.y&&i===q.COUNTERCLOCKWISE||t.y>this._minCoord.y&&n.y>this._minCoord.y&&i===q.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)},yr.prototype.getRightmostSideOfSegment=function(e,t){var n=e.getEdge(),i=n.getCoordinates();if(t<0||t+1>=i.length||i[t].y===i[t+1].y)return-1;var s=U.LEFT;return i[t].y<i[t+1].y&&(s=U.RIGHT),s},yr.prototype.getEdge=function(){return this._orientedDe},yr.prototype.checkForRightmostCoordinate=function(e){for(var t=this,n=e.getEdge().getCoordinates(),i=0;i<n.length-1;i++)(t._minCoord===null||n[i].x>t._minCoord.x)&&(t._minDe=e,t._minIndex=i,t._minCoord=n[i])},yr.prototype.findRightmostEdgeAtNode=function(){var e=this._minDe.getNode(),t=e.getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},yr.prototype.findEdge=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next();i.isForward()&&t.checkForRightmostCoordinate(i)}yt.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var s=this.getRightmostSide(this._minDe,this._minIndex);s===U.LEFT&&(this._orientedDe=this._minDe.getSym())},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var Si=function(r){function e(t,n){r.call(this,e.msgWithCoord(t,n)),this.pt=n?new R(n):null,this.name="TopologyException"}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(n,i){return i?n:n+" [ "+i+" ]"},e}(vi),fc=function(){this.array_=[]};fc.prototype.addLast=function(e){this.array_.push(e)},fc.prototype.removeFirst=function(){return this.array_.shift()},fc.prototype.isEmpty=function(){return this.array_.length===0};var We=function(){this._finder=null,this._dirEdgeList=new W,this._nodes=new W,this._rightMostCoord=null,this._env=null,this._finder=new yr};We.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.setVisited(!1)}},We.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},We.prototype.computeNodeDepth=function(e){for(var t=this,n=null,i=e.getEdges().iterator();i.hasNext();){var s=i.next();if(s.isVisited()||s.getSym().isVisited()){n=s;break}}if(n===null)throw new Si("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(n);for(var o=e.getEdges().iterator();o.hasNext();){var a=o.next();a.setVisited(!0),t.copySymDepths(a)}},We.prototype.computeDepth=function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(U.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)},We.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},We.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(U.RIGHT)>=1&&t.getDepth(U.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}},We.prototype.computeDepths=function(e){var t=this,n=new ud,i=new fc,s=e.getNode();for(i.addLast(s),n.add(s),e.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();n.add(o),t.computeNodeDepth(o);for(var a=o.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var c=l.getNode();n.contains(c)||(i.addLast(c),n.add(c))}}}},We.prototype.compareTo=function(e){var t=e;return this._rightMostCoord.x<t._rightMostCoord.x?-1:this._rightMostCoord.x>t._rightMostCoord.x?1:0},We.prototype.getEnvelope=function(){if(this._env===null){for(var e=new Q,t=this._dirEdgeList.iterator();t.hasNext();)for(var n=t.next(),i=n.getEdge().getCoordinates(),s=0;s<i.length-1;s++)e.expandToInclude(i[s]);this._env=e}return this._env},We.prototype.addReachable=function(e){var t=this,n=new vr;for(n.add(e);!n.empty();){var i=n.pop();t.add(i,n)}},We.prototype.copySymDepths=function(e){var t=e.getSym();t.setDepth(U.LEFT,e.getDepth(U.RIGHT)),t.setDepth(U.RIGHT,e.getDepth(U.LEFT))},We.prototype.add=function(e,t){var n=this;e.setVisited(!0),this._nodes.add(e);for(var i=e.getEdges().iterator();i.hasNext();){var s=i.next();n._dirEdgeList.add(s);var o=s.getSym(),a=o.getNode();a.isVisited()||t.push(a)}},We.prototype.getNodes=function(){return this._nodes},We.prototype.getDirectedEdges=function(){return this._dirEdgeList},We.prototype.interfaces_=function(){return[An]},We.prototype.getClass=function(){return We};var Wt=function r(){var e=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[U.ON]=n}else if(arguments[0]instanceof r){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var s=0;s<this.location.length;s++)e.location[s]=i.location[s]}}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[U.ON]=o,this.location[U.LEFT]=a,this.location[U.RIGHT]=u}};Wt.prototype.setAllLocations=function(e){for(var t=this,n=0;n<this.location.length;n++)t.location[n]=e},Wt.prototype.isNull=function(){for(var e=this,t=0;t<this.location.length;t++)if(e.location[t]!==F.NONE)return!1;return!0},Wt.prototype.setAllLocationsIfNull=function(e){for(var t=this,n=0;n<this.location.length;n++)t.location[n]===F.NONE&&(t.location[n]=e)},Wt.prototype.isLine=function(){return this.location.length===1},Wt.prototype.merge=function(e){var t=this;if(e.location.length>this.location.length){var n=new Array(3).fill(null);n[U.ON]=this.location[U.ON],n[U.LEFT]=F.NONE,n[U.RIGHT]=F.NONE,this.location=n}for(var i=0;i<this.location.length;i++)t.location[i]===F.NONE&&i<e.location.length&&(t.location[i]=e.location[i])},Wt.prototype.getLocations=function(){return this.location},Wt.prototype.flip=function(){if(this.location.length<=1)return null;var e=this.location[U.LEFT];this.location[U.LEFT]=this.location[U.RIGHT],this.location[U.RIGHT]=e},Wt.prototype.toString=function(){var e=new lr;return this.location.length>1&&e.append(F.toLocationSymbol(this.location[U.LEFT])),e.append(F.toLocationSymbol(this.location[U.ON])),this.location.length>1&&e.append(F.toLocationSymbol(this.location[U.RIGHT])),e.toString()},Wt.prototype.setLocations=function(e,t,n){this.location[U.ON]=e,this.location[U.LEFT]=t,this.location[U.RIGHT]=n},Wt.prototype.get=function(e){return e<this.location.length?this.location[e]:F.NONE},Wt.prototype.isArea=function(){return this.location.length>1},Wt.prototype.isAnyNull=function(){for(var e=this,t=0;t<this.location.length;t++)if(e.location[t]===F.NONE)return!0;return!1},Wt.prototype.setLocation=function(){if(arguments.length===1){var e=arguments[0];this.setLocation(U.ON,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.location[t]=n}},Wt.prototype.init=function(e){this.location=new Array(e).fill(null),this.setAllLocations(F.NONE)},Wt.prototype.isEqualOnSide=function(e,t){return this.location[t]===e.location[t]},Wt.prototype.allPositionsEqual=function(e){for(var t=this,n=0;n<this.location.length;n++)if(t.location[n]!==e)return!1;return!0},Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt};var jt=function r(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Wt(e),this.elt[1]=new Wt(e)}else if(arguments[0]instanceof r){var t=arguments[0];this.elt[0]=new Wt(t.elt[0]),this.elt[1]=new Wt(t.elt[1])}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[0]=new Wt(F.NONE),this.elt[1]=new Wt(F.NONE),this.elt[n].setLocation(i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this.elt[0]=new Wt(s,o,a),this.elt[1]=new Wt(s,o,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new Wt(F.NONE,F.NONE,F.NONE),this.elt[1]=new Wt(F.NONE,F.NONE,F.NONE),this.elt[u].setLocations(l,c,h)}};jt.prototype.getGeometryCount=function(){var e=0;return this.elt[0].isNull()||e++,this.elt[1].isNull()||e++,e},jt.prototype.setAllLocations=function(e,t){this.elt[e].setAllLocations(t)},jt.prototype.isNull=function(e){return this.elt[e].isNull()},jt.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var e=arguments[0];this.setAllLocationsIfNull(0,e),this.setAllLocationsIfNull(1,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.elt[t].setAllLocationsIfNull(n)}},jt.prototype.isLine=function(e){return this.elt[e].isLine()},jt.prototype.merge=function(e){for(var t=this,n=0;n<2;n++)t.elt[n]===null&&e.elt[n]!==null?t.elt[n]=new Wt(e.elt[n]):t.elt[n].merge(e.elt[n])},jt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},jt.prototype.getLocation=function(){if(arguments.length===1){var e=arguments[0];return this.elt[e].get(U.ON)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return this.elt[t].get(n)}},jt.prototype.toString=function(){var e=new lr;return this.elt[0]!==null&&(e.append("A:"),e.append(this.elt[0].toString())),this.elt[1]!==null&&(e.append(" B:"),e.append(this.elt[1].toString())),e.toString()},jt.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var e=arguments[0];return this.elt[e].isArea()}},jt.prototype.isAnyNull=function(e){return this.elt[e].isAnyNull()},jt.prototype.setLocation=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.elt[e].setLocation(U.ON,t)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this.elt[n].setLocation(i,s)}},jt.prototype.isEqualOnSide=function(e,t){return this.elt[0].isEqualOnSide(e.elt[0],t)&&this.elt[1].isEqualOnSide(e.elt[1],t)},jt.prototype.allPositionsEqual=function(e,t){return this.elt[e].allPositionsEqual(t)},jt.prototype.toLine=function(e){this.elt[e].isArea()&&(this.elt[e]=new Wt(this.elt[e].location[0]))},jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.toLineLabel=function(e){for(var t=new jt(F.NONE),n=0;n<2;n++)t.setLocation(n,e.getLocation(n));return t};var le=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new W,this._pts=new W,this._label=new jt(F.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new W,this._geometryFactory=null;var e=arguments[0],t=arguments[1];this._geometryFactory=t,this.computePoints(e),this.computeRing()};le.prototype.computeRing=function(){var e=this;if(this._ring!==null)return null;for(var t=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)t[n]=e._pts.get(n);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=q.isCCW(this._ring.getCoordinates())},le.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},le.prototype.computePoints=function(e){var t=this;this._startDe=e;var n=e,i=!0;do{if(n===null)throw new Si("Found null DirectedEdge");if(n.getEdgeRing()===t)throw new Si("Directed Edge visited twice during ring-building at "+n.getCoordinate());t._edges.add(n);var s=n.getLabel();yt.isTrue(s.isArea()),t.mergeLabel(s),t.addPoints(n.getEdge(),n.isForward(),i),i=!1,t.setEdgeRing(n,t),n=t.getNext(n)}while(n!==this._startDe)},le.prototype.getLinearRing=function(){return this._ring},le.prototype.getCoordinate=function(e){return this._pts.get(e)},le.prototype.computeMaxNodeDegree=function(){var e=this;this._maxNodeDegree=0;var t=this._startDe;do{var n=t.getNode(),i=n.getEdges().getOutgoingDegree(e);i>e._maxNodeDegree&&(e._maxNodeDegree=i),t=e.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},le.prototype.addPoints=function(e,t,n){var i=this,s=e.getCoordinates();if(t){var o=1;n&&(o=0);for(var a=o;a<s.length;a++)i._pts.add(s[a])}else{var u=s.length-2;n&&(u=s.length-1);for(var l=u;l>=0;l--)i._pts.add(s[l])}},le.prototype.isHole=function(){return this._isHole},le.prototype.setInResult=function(){var e=this._startDe;do e.getEdge().setInResult(!0),e=e.getNext();while(e!==this._startDe)},le.prototype.containsPoint=function(e){var t=this.getLinearRing(),n=t.getEnvelopeInternal();if(!n.contains(e)||!q.isPointInRing(e,t.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var s=i.next();if(s.containsPoint(e))return!1}return!0},le.prototype.addHole=function(e){this._holes.add(e)},le.prototype.isShell=function(){return this._shell===null},le.prototype.getLabel=function(){return this._label},le.prototype.getEdges=function(){return this._edges},le.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},le.prototype.getShell=function(){return this._shell},le.prototype.mergeLabel=function(){if(arguments.length===1){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],i=t.getLocation(n,U.RIGHT);if(i===F.NONE)return null;if(this._label.getLocation(n)===F.NONE)return this._label.setLocation(n,i),null}},le.prototype.setShell=function(e){this._shell=e,e!==null&&e.addHole(this)},le.prototype.toPolygon=function(e){for(var t=this,n=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)n[i]=t._holes.get(i).getLinearRing();var s=e.createPolygon(this.getLinearRing(),n);return s},le.prototype.interfaces_=function(){return[]},le.prototype.getClass=function(){return le};var $E=function(r){function e(){var t=arguments[0],n=arguments[1];r.call(this,t,n)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(n,i){n.setMinEdgeRing(i)},e.prototype.getNext=function(n){return n.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(le),KE=function(r){function e(){var t=arguments[0],n=arguments[1];r.call(this,t,n)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var n=this,i=new W,s=this._startDe;do{if(s.getMinEdgeRing()===null){var o=new $E(s,n._geometryFactory);i.add(o)}s=s.getNext()}while(s!==this._startDe);return i},e.prototype.setEdgeRing=function(n,i){n.setEdgeRing(i)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,i=this._startDe;do{var s=i.getNode();s.getEdges().linkMinimalDirectedEdges(n),i=i.getNext()}while(i!==this._startDe)},e.prototype.getNext=function(n){return n.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(le),Tn=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._label=e}}};Tn.prototype.setVisited=function(e){this._isVisited=e},Tn.prototype.setInResult=function(e){this._isInResult=e},Tn.prototype.isCovered=function(){return this._isCovered},Tn.prototype.isCoveredSet=function(){return this._isCoveredSet},Tn.prototype.setLabel=function(e){this._label=e},Tn.prototype.getLabel=function(){return this._label},Tn.prototype.setCovered=function(e){this._isCovered=e,this._isCoveredSet=!0},Tn.prototype.updateIM=function(e){yt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(e)},Tn.prototype.isInResult=function(){return this._isInResult},Tn.prototype.isVisited=function(){return this._isVisited},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn};var pc=function(r){function e(){r.call(this),this._coord=null,this._edges=null;var t=arguments[0],n=arguments[1];this._coord=t,this._edges=n,this._label=new jt(0,F.NONE)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdge().isInResult())return!0}return!1},e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(n){},e.prototype.computeMergedLocation=function(n,i){var s=F.NONE;if(s=this._label.getLocation(i),!n.isNull(i)){var o=n.getLocation(i);s!==F.BOUNDARY&&(s=o)}return s},e.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this._label===null?this._label=new jt(n,i):this._label.setLocation(n,i)}else return r.prototype.setLabel.apply(this,arguments)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof e){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof jt)for(var s=arguments[0],o=0;o<2;o++){var a=n.computeMergedLocation(s,o),u=n._label.getLocation(o);u===F.NONE&&n._label.setLocation(o,a)}},e.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},e.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var i=F.NONE;this._label!==null&&(i=this._label.getLocation(n));var s=null;switch(i){case F.BOUNDARY:s=F.INTERIOR;break;case F.INTERIOR:s=F.BOUNDARY;break;default:s=F.BOUNDARY;break}this._label.setLocation(n,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Tn),_r=function(){this.nodeMap=new ke,this.nodeFact=null;var e=arguments[0];this.nodeFact=e};_r.prototype.find=function(e){return this.nodeMap.get(e)},_r.prototype.addNode=function(){if(arguments[0]instanceof R){var e=arguments[0],t=this.nodeMap.get(e);return t===null&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}else if(arguments[0]instanceof pc){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},_r.prototype.print=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},_r.prototype.iterator=function(){return this.nodeMap.values().iterator()},_r.prototype.values=function(){return this.nodeMap.values()},_r.prototype.getBoundaryNodes=function(e){for(var t=new W,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(e)===F.BOUNDARY&&t.add(i)}return t},_r.prototype.add=function(e){var t=e.getCoordinate(),n=this.addNode(t);n.add(e)},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r};var Bt=function(){},Zu={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Bt.prototype.interfaces_=function(){return[]},Bt.prototype.getClass=function(){return Bt},Bt.isNorthern=function(e){return e===Bt.NE||e===Bt.NW},Bt.isOpposite=function(e,t){if(e===t)return!1;var n=(e-t+4)%4;return n===2},Bt.commonHalfPlane=function(e,t){if(e===t)return e;var n=(e-t+4)%4;if(n===2)return-1;var i=e<t?e:t,s=e>t?e:t;return i===0&&s===3?3:i},Bt.isInHalfPlane=function(e,t){return t===Bt.SE?e===Bt.SE||e===Bt.SW:e===t||e===t+1},Bt.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new Yt("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?Bt.NE:Bt.SE:t>=0?Bt.NW:Bt.SW}else if(arguments[0]instanceof R&&arguments[1]instanceof R){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new Yt("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?Bt.NE:Bt.SE:i.y>=n.y?Bt.NW:Bt.SW}},Zu.NE.get=function(){return 0},Zu.NW.get=function(){return 1},Zu.SW.get=function(){return 2},Zu.SE.get=function(){return 3},Object.defineProperties(Bt,Zu);var Ve=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var e=arguments[0];this._edge=e}else if(arguments.length===3){var t=arguments[0],n=arguments[1],i=arguments[2],s=null;this._edge=t,this.init(n,i),this._label=s}else if(arguments.length===4){var o=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=o,this.init(a,u),this._label=l}};Ve.prototype.compareDirection=function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant<e._quadrant?-1:q.computeOrientation(e._p0,e._p1,this._p1)},Ve.prototype.getDy=function(){return this._dy},Ve.prototype.getCoordinate=function(){return this._p0},Ve.prototype.setNode=function(e){this._node=e},Ve.prototype.print=function(e){var t=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),s=n.substring(i+1);e.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label)},Ve.prototype.compareTo=function(e){var t=e;return this.compareDirection(t)},Ve.prototype.getDirectedCoordinate=function(){return this._p1},Ve.prototype.getDx=function(){return this._dx},Ve.prototype.getLabel=function(){return this._label},Ve.prototype.getEdge=function(){return this._edge},Ve.prototype.getQuadrant=function(){return this._quadrant},Ve.prototype.getNode=function(){return this._node},Ve.prototype.toString=function(){var e=Math.atan2(this._dy,this._dx),t=this.getClass().getName(),n=t.lastIndexOf("."),i=t.substring(n+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label},Ve.prototype.computeLabel=function(e){},Ve.prototype.init=function(e,t){this._p0=e,this._p1=t,this._dx=t.x-e.x,this._dy=t.y-e.y,this._quadrant=Bt.quadrant(this._dx,this._dy),yt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Ve.prototype.interfaces_=function(){return[An]},Ve.prototype.getClass=function(){return Ve};var gd=function(r){function e(){var t=arguments[0],n=arguments[1];if(r.call(this,t),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(t.getCoordinate(0),t.getCoordinate(1));else{var i=t.getNumPoints()-1;this.init(t.getCoordinate(i),t.getCoordinate(i-1))}this.computeDirectedLabel()}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(n){return this._depth[n]},e.prototype.setVisited=function(n){this._isVisited=n},e.prototype.computeDirectedLabel=function(){this._label=new jt(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(n,i){if(this._depth[n]!==-999&&this._depth[n]!==i)throw new Si("assigned depths do not match",this.getCoordinate());this._depth[n]=i},e.prototype.isInteriorAreaEdge=function(){for(var n=this,i=!0,s=0;s<2;s++)n._label.isArea(s)&&n._label.getLocation(s,U.LEFT)===F.INTERIOR&&n._label.getLocation(s,U.RIGHT)===F.INTERIOR||(i=!1);return i},e.prototype.setNextMin=function(n){this._nextMin=n},e.prototype.print=function(n){r.prototype.print.call(this,n),n.print(" "+this._depth[U.LEFT]+"/"+this._depth[U.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},e.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},e.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,F.EXTERIOR),s=!this._label.isArea(1)||this._label.allPositionsEqual(1,F.EXTERIOR);return n&&i&&s},e.prototype.setEdgeRing=function(n){this._edgeRing=n},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},e.prototype.setInResult=function(n){this._isInResult=n},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},e.prototype.setSym=function(n){this._sym=n},e.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},e.prototype.setEdgeDepths=function(n,i){var s=this.getEdge().getDepthDelta();this._isForward||(s=-s);var o=1;n===U.LEFT&&(o=-1);var a=U.opposite(n),u=s*o,l=i+u;this.setDepth(n,i),this.setDepth(a,l)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(n){this._next=n},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(n,i){return n===F.EXTERIOR&&i===F.INTERIOR?1:n===F.INTERIOR&&i===F.EXTERIOR?-1:0},e}(Ve),Ea=function(){};Ea.prototype.createNode=function(e){return new pc(e,null)},Ea.prototype.interfaces_=function(){return[]},Ea.prototype.getClass=function(){return Ea};var Kt=function(){if(this._edges=new W,this._nodes=null,this._edgeEndList=new W,arguments.length===0)this._nodes=new _r(new Ea);else if(arguments.length===1){var e=arguments[0];this._nodes=new _r(e)}};Kt.prototype.printEdges=function(e){var t=this;e.println("Edges:");for(var n=0;n<this._edges.size();n++){e.println("edge "+n+":");var i=t._edges.get(n);i.print(e),i.eiList.print(e)}},Kt.prototype.find=function(e){return this._nodes.find(e)},Kt.prototype.addNode=function(){if(arguments[0]instanceof pc){var e=arguments[0];return this._nodes.addNode(e)}else if(arguments[0]instanceof R){var t=arguments[0];return this._nodes.addNode(t)}},Kt.prototype.getNodeIterator=function(){return this._nodes.iterator()},Kt.prototype.linkResultDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();){var t=e.next();t.getEdges().linkResultDirectedEdges()}},Kt.prototype.debugPrintln=function(e){Te.out.println(e)},Kt.prototype.isBoundaryNode=function(e,t){var n=this._nodes.find(t);if(n===null)return!1;var i=n.getLabel();return i!==null&&i.getLocation(e)===F.BOUNDARY},Kt.prototype.linkAllDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();){var t=e.next();t.getEdges().linkAllDirectedEdges()}},Kt.prototype.matchInSameDirection=function(e,t,n,i){return e.equals(n)?q.computeOrientation(e,t,i)===q.COLLINEAR&&Bt.quadrant(e,t)===Bt.quadrant(n,i):!1},Kt.prototype.getEdgeEnds=function(){return this._edgeEndList},Kt.prototype.debugPrint=function(e){Te.out.print(e)},Kt.prototype.getEdgeIterator=function(){return this._edges.iterator()},Kt.prototype.findEdgeInSameDirection=function(e,t){for(var n=this,i=0;i<this._edges.size();i++){var s=n._edges.get(i),o=s.getCoordinates();if(n.matchInSameDirection(e,t,o[0],o[1])||n.matchInSameDirection(e,t,o[o.length-1],o[o.length-2]))return s}return null},Kt.prototype.insertEdge=function(e){this._edges.add(e)},Kt.prototype.findEdgeEnd=function(e){for(var t=this.getEdgeEnds().iterator();t.hasNext();){var n=t.next();if(n.getEdge()===e)return n}return null},Kt.prototype.addEdges=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next();t._edges.add(i);var s=new gd(i,!0),o=new gd(i,!1);s.setSym(o),o.setSym(s),t.add(s),t.add(o)}},Kt.prototype.add=function(e){this._nodes.add(e),this._edgeEndList.add(e)},Kt.prototype.getNodes=function(){return this._nodes.values()},Kt.prototype.findEdge=function(e,t){for(var n=this,i=0;i<this._edges.size();i++){var s=n._edges.get(i),o=s.getCoordinates();if(e.equals(o[0])&&t.equals(o[1]))return s}return null},Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt},Kt.linkResultDirectedEdges=function(e){for(var t=e.iterator();t.hasNext();){var n=t.next();n.getEdges().linkResultDirectedEdges()}};var fn=function(){this._geometryFactory=null,this._shellList=new W;var e=arguments[0];this._geometryFactory=e};fn.prototype.sortShellsAndHoles=function(e,t,n){for(var i=e.iterator();i.hasNext();){var s=i.next();s.isHole()?n.add(s):t.add(s)}},fn.prototype.computePolygons=function(e){for(var t=this,n=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=s.toPolygon(t._geometryFactory);n.add(o)}return n},fn.prototype.placeFreeHoles=function(e,t){for(var n=this,i=t.iterator();i.hasNext();){var s=i.next();if(s.getShell()===null){var o=n.findEdgeRingContaining(s,e);if(o===null)throw new Si("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(o)}}},fn.prototype.buildMinimalEdgeRings=function(e,t,n){for(var i=this,s=new W,o=e.iterator();o.hasNext();){var a=o.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),t.add(l)):n.addAll(u)}else s.add(a)}return s},fn.prototype.containsPoint=function(e){for(var t=this._shellList.iterator();t.hasNext();){var n=t.next();if(n.containsPoint(e))return!0}return!1},fn.prototype.buildMaximalEdgeRings=function(e){for(var t=this,n=new W,i=e.iterator();i.hasNext();){var s=i.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var o=new KE(s,t._geometryFactory);n.add(o),o.setInResult()}}return n},fn.prototype.placePolygonHoles=function(e,t){for(var n=t.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(e)}},fn.prototype.getPolygons=function(){var e=this.computePolygons(this._shellList);return e},fn.prototype.findEdgeRingContaining=function(e,t){for(var n=e.getLinearRing(),i=n.getEnvelopeInternal(),s=n.getCoordinateN(0),o=null,a=null,u=t.iterator();u.hasNext();){var l=u.next(),c=l.getLinearRing(),h=c.getEnvelopeInternal();o!==null&&(a=o.getLinearRing().getEnvelopeInternal());var f=!1;h.contains(i)&&q.isPointInRing(s,c.getCoordinates())&&(f=!0),f&&(o===null||a.contains(h))&&(o=l)}return o},fn.prototype.findShell=function(e){for(var t=0,n=null,i=e.iterator();i.hasNext();){var s=i.next();s.isHole()||(n=s,t++)}return yt.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),n},fn.prototype.add=function(){if(arguments.length===1){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(arguments.length===2){var t=arguments[0],n=arguments[1];Kt.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(t),s=new W,o=this.buildMinimalEdgeRings(i,this._shellList,s);this.sortShellsAndHoles(o,this._shellList,s),this.placeFreeHoles(this._shellList,s)}},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn};var Ca=function(){};Ca.prototype.getBounds=function(){},Ca.prototype.interfaces_=function(){return[]},Ca.prototype.getClass=function(){return Ca};var nr=function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t};nr.prototype.getItem=function(){return this._item},nr.prototype.getBounds=function(){return this._bounds},nr.prototype.interfaces_=function(){return[Ca,kn]},nr.prototype.getClass=function(){return nr};var bi=function(){this._size=null,this._items=null,this._size=0,this._items=new W,this._items.add(null)};bi.prototype.poll=function(){if(this.isEmpty())return null;var e=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),e},bi.prototype.size=function(){return this._size},bi.prototype.reorder=function(e){for(var t=this,n=null,i=this._items.get(e);e*2<=this._size&&(n=e*2,n!==t._size&&t._items.get(n+1).compareTo(t._items.get(n))<0&&n++,t._items.get(n).compareTo(i)<0);e=n)t._items.set(e,t._items.get(n));this._items.set(e,i)},bi.prototype.clear=function(){this._size=0,this._items.clear()},bi.prototype.isEmpty=function(){return this._size===0},bi.prototype.add=function(e){var t=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)t._items.set(n,t._items.get(Math.trunc(n/2)));this._items.set(n,e)},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi};var Ki=function(){};Ki.prototype.visitItem=function(e){},Ki.prototype.interfaces_=function(){return[]},Ki.prototype.getClass=function(){return Ki};var fo=function(){};fo.prototype.insert=function(e,t){},fo.prototype.remove=function(e,t){},fo.prototype.query=function(){},fo.prototype.interfaces_=function(){return[]},fo.prototype.getClass=function(){return fo};var ge=function(){if(this._childBoundables=new W,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._level=e}}},Am={serialVersionUID:{configurable:!0}};ge.prototype.getLevel=function(){return this._level},ge.prototype.size=function(){return this._childBoundables.size()},ge.prototype.getChildBoundables=function(){return this._childBoundables},ge.prototype.addChildBoundable=function(e){yt.isTrue(this._bounds===null),this._childBoundables.add(e)},ge.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},ge.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},ge.prototype.interfaces_=function(){return[Ca,kn]},ge.prototype.getClass=function(){return ge},Am.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(ge,Am);var rr=function(){};rr.reverseOrder=function(){return{compare:function(t,n){return n.compareTo(t)}}},rr.min=function(e){return rr.sort(e),e.get(0)},rr.sort=function(e,t){var n=e.toArray();t?bs.sort(n,t):bs.sort(n);for(var i=e.iterator(),s=0,o=n.length;s<o;s++)i.next(),i.set(n[s])},rr.singletonList=function(e){var t=new W;return t.add(e),t};var ce=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var e=arguments[0],t=arguments[1],n=arguments[2];this._boundable1=e,this._boundable2=t,this._itemDistance=n,this._distance=this.distance()};ce.prototype.expandToQueue=function(e,t){var n=ce.isComposite(this._boundable1),i=ce.isComposite(this._boundable2);if(n&&i)return ce.area(this._boundable1)>ce.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,e,t),null):(this.expand(this._boundable2,this._boundable1,e,t),null);if(n)return this.expand(this._boundable1,this._boundable2,e,t),null;if(i)return this.expand(this._boundable2,this._boundable1,e,t),null;throw new Yt("neither boundable is composite")},ce.prototype.isLeaves=function(){return!(ce.isComposite(this._boundable1)||ce.isComposite(this._boundable2))},ce.prototype.compareTo=function(e){var t=e;return this._distance<t._distance?-1:this._distance>t._distance?1:0},ce.prototype.expand=function(e,t,n,i){for(var s=this,o=e.getChildBoundables(),a=o.iterator();a.hasNext();){var u=a.next(),l=new ce(u,t,s._itemDistance);l.getDistance()<i&&n.add(l)}},ce.prototype.getBoundable=function(e){return e===0?this._boundable1:this._boundable2},ce.prototype.getDistance=function(){return this._distance},ce.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},ce.prototype.interfaces_=function(){return[An]},ce.prototype.getClass=function(){return ce},ce.area=function(e){return e.getBounds().getArea()},ce.isComposite=function(e){return e instanceof ge};var Se=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new W,this._nodeCapacity=null,arguments.length===0){var e=r.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(arguments.length===1){var t=arguments[0];yt.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t}},gc={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Se.prototype.getNodeCapacity=function(){return this._nodeCapacity},Se.prototype.lastNode=function(e){return e.get(e.size()-1)},Se.prototype.size=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var t=arguments[0],n=0,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof ge?n+=e.size(s):s instanceof nr&&(n+=1)}return n}},Se.prototype.removeItem=function(e,t){for(var n=null,i=e.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof nr&&s.getItem()===t&&(n=s)}return n!==null?(e.getChildBoundables().remove(n),!0):!1},Se.prototype.itemsTree=function(){var e=this;if(arguments.length===0){this.build();var t=this.itemsTree(this._root);return t===null?new W:t}else if(arguments.length===1){for(var n=arguments[0],i=new W,s=n.getChildBoundables().iterator();s.hasNext();){var o=s.next();if(o instanceof ge){var a=e.itemsTree(o);a!==null&&i.add(a)}else o instanceof nr?i.add(o.getItem()):yt.shouldNeverReachHere()}return i.size()<=0?null:i}},Se.prototype.insert=function(e,t){yt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new nr(e,t))},Se.prototype.boundablesAtLevel=function(){var e=this;if(arguments.length===1){var t=arguments[0],n=new W;return this.boundablesAtLevel(t,this._root,n),n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(yt.isTrue(i>-2),s.getLevel()===i)return o.add(s),null;for(var a=s.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof ge?e.boundablesAtLevel(i,u,o):(yt.isTrue(u instanceof nr),i===-1&&o.add(u))}return null}},Se.prototype.query=function(){var e=this;if(arguments.length===1){var t=arguments[0];this.build();var n=new W;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,n),n}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,s)}else if(arguments.length===3){if(at(arguments[2],Ki)&&arguments[0]instanceof Object&&arguments[1]instanceof ge)for(var o=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),c=0;c<l.size();c++){var h=l.get(c);e.getIntersectsOp().intersects(h.getBounds(),o)&&(h instanceof ge?e.query(o,h,u):h instanceof nr?u.visitItem(h.getItem()):yt.shouldNeverReachHere())}else if(at(arguments[2],Qn)&&arguments[0]instanceof Object&&arguments[1]instanceof ge)for(var f=arguments[0],p=arguments[1],v=arguments[2],C=p.getChildBoundables(),S=0;S<C.size();S++){var P=C.get(S);e.getIntersectsOp().intersects(P.getBounds(),f)&&(P instanceof ge?e.query(f,P,v):P instanceof nr?v.add(P.getItem()):yt.shouldNeverReachHere())}}},Se.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Se.prototype.getRoot=function(){return this.build(),this._root},Se.prototype.remove=function(){var e=this;if(arguments.length===2){var t=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),t)?this.remove(t,this._root,n):!1}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=this.removeItem(s,o);if(a)return!0;for(var u=null,l=s.getChildBoundables().iterator();l.hasNext();){var c=l.next();if(e.getIntersectsOp().intersects(c.getBounds(),i)&&c instanceof ge&&(a=e.remove(i,c,o),a)){u=c;break}}return u!==null&&u.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(u),a}},Se.prototype.createHigherLevels=function(e,t){yt.isTrue(!e.isEmpty());var n=this.createParentBoundables(e,t+1);return n.size()===1?n.get(0):this.createHigherLevels(n,t+1)},Se.prototype.depth=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var t=arguments[0],n=0,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof ge){var o=e.depth(s);o>n&&(n=o)}}return n+1}},Se.prototype.createParentBoundables=function(e,t){var n=this;yt.isTrue(!e.isEmpty());var i=new W;i.add(this.createNode(t));var s=new W(e);rr.sort(s,this.getComparator());for(var o=s.iterator();o.hasNext();){var a=o.next();n.lastNode(i).getChildBoundables().size()===n.getNodeCapacity()&&i.add(n.createNode(t)),n.lastNode(i).addChildBoundable(a)}return i},Se.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Se.prototype.interfaces_=function(){return[kn]},Se.prototype.getClass=function(){return Se},Se.compareDoubles=function(e,t){return e>t?1:e<t?-1:0},gc.IntersectsOp.get=function(){return ZE},gc.serialVersionUID.get=function(){return-3886435814360241e3},gc.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Se,gc);var ZE=function(){},Sa=function(){};Sa.prototype.distance=function(e,t){},Sa.prototype.interfaces_=function(){return[]},Sa.prototype.getClass=function(){return Sa};var km=function(r){function e(n){n=n||e.DEFAULT_NODE_CAPACITY,r.call(this,n)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return e.prototype.createParentBoundablesFromVerticalSlices=function(i,s){var o=this;yt.isTrue(i.length>0);for(var a=new W,u=0;u<i.length;u++)a.addAll(o.createParentBoundablesFromVerticalSlice(i[u],s));return a},e.prototype.createNode=function(i){return new Vm(i)},e.prototype.size=function(){return arguments.length===0?r.prototype.size.call(this):r.prototype.size.apply(this,arguments)},e.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];if(i.isNull())return null;r.prototype.insert.call(this,i,s)}else return r.prototype.insert.apply(this,arguments)},e.prototype.getIntersectsOp=function(){return e.intersectsOp},e.prototype.verticalSlices=function(i,s){for(var o=Math.trunc(Math.ceil(i.size()/s)),a=new Array(s).fill(null),u=i.iterator(),l=0;l<s;l++){a[l]=new W;for(var c=0;u.hasNext()&&c<o;){var h=u.next();a[l].add(h),c++}}return a},e.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return r.prototype.query.call(this,i)}else if(arguments.length===2){var s=arguments[0],o=arguments[1];r.prototype.query.call(this,s,o)}else if(arguments.length===3){if(at(arguments[2],Ki)&&arguments[0]instanceof Object&&arguments[1]instanceof ge){var a=arguments[0],u=arguments[1],l=arguments[2];r.prototype.query.call(this,a,u,l)}else if(at(arguments[2],Qn)&&arguments[0]instanceof Object&&arguments[1]instanceof ge){var c=arguments[0],h=arguments[1],f=arguments[2];r.prototype.query.call(this,c,h,f)}}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(i,s){return r.prototype.createParentBoundables.call(this,i,s)},e.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return r.prototype.remove.call(this,i,s)}else return r.prototype.remove.apply(this,arguments)},e.prototype.depth=function(){return arguments.length===0?r.prototype.depth.call(this):r.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(i,s){yt.isTrue(!i.isEmpty());var o=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new W(i);rr.sort(a,e.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(u,s)},e.prototype.nearestNeighbour=function(){if(arguments.length===1){if(at(arguments[0],Sa)){var i=arguments[0],s=new ce(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(s)}else if(arguments[0]instanceof ce){var o=arguments[0];return this.nearestNeighbour(o,ht.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof e&&at(arguments[1],Sa)){var a=arguments[0],u=arguments[1],l=new ce(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof ce&&typeof arguments[1]=="number"){var c=arguments[0],h=arguments[1],f=h,p=null,v=new bi;for(v.add(c);!v.isEmpty()&&f>0;){var C=v.poll(),S=C.getDistance();if(S>=f)break;C.isLeaves()?(f=S,p=C):C.expandToQueue(v,f)}return[p.getBoundable(0).getItem(),p.getBoundable(1).getItem()]}}else if(arguments.length===3){var P=arguments[0],y=arguments[1],_=arguments[2],m=new nr(P,y),w=new ce(this.getRoot(),m,_);return this.nearestNeighbour(w)[0]}},e.prototype.interfaces_=function(){return[fo,kn]},e.prototype.getClass=function(){return e},e.centreX=function(i){return e.avg(i.getMinX(),i.getMaxX())},e.avg=function(i,s){return(i+s)/2},e.centreY=function(i){return e.avg(i.getMinY(),i.getMaxY())},t.STRtreeNode.get=function(){return Vm},t.serialVersionUID.get=function(){return 0x39920f7d5f261e0},t.xComparator.get=function(){return{interfaces_:function(){return[la]},compare:function(n,i){return r.compareDoubles(e.centreX(n.getBounds()),e.centreX(i.getBounds()))}}},t.yComparator.get=function(){return{interfaces_:function(){return[la]},compare:function(n,i){return r.compareDoubles(e.centreY(n.getBounds()),e.centreY(i.getBounds()))}}},t.intersectsOp.get=function(){return{interfaces_:function(){return[r.IntersectsOp]},intersects:function(n,i){return n.intersects(i)}}},t.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,t),e}(Se),Vm=function(r){function e(){var t=arguments[0];r.call(this,t)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var n=null,i=this.getChildBoundables().iterator();i.hasNext();){var s=i.next();n===null?n=new Q(s.getBounds()):n.expandToInclude(s.getBounds())}return n},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ge),nn=function(){};nn.prototype.interfaces_=function(){return[]},nn.prototype.getClass=function(){return nn},nn.relativeSign=function(e,t){return e<t?-1:e>t?1:0},nn.compare=function(e,t,n){if(t.equals2D(n))return 0;var i=nn.relativeSign(t.x,n.x),s=nn.relativeSign(t.y,n.y);switch(e){case 0:return nn.compareValue(i,s);case 1:return nn.compareValue(s,i);case 2:return nn.compareValue(s,-i);case 3:return nn.compareValue(-i,s);case 4:return nn.compareValue(-i,-s);case 5:return nn.compareValue(-s,-i);case 6:return nn.compareValue(-s,i);case 7:return nn.compareValue(i,-s)}return yt.shouldNeverReachHere("invalid octant value"),0},nn.compareValue=function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0};var Zi=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this._segString=e,this.coord=new R(t),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!t.equals2D(e.getCoordinate(n))};Zi.prototype.getCoordinate=function(){return this.coord},Zi.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)},Zi.prototype.compareTo=function(e){var t=e;return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:nn.compare(this._segmentOctant,this.coord,t.coord)},Zi.prototype.isEndPoint=function(e){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===e},Zi.prototype.isInterior=function(){return this._isInterior},Zi.prototype.interfaces_=function(){return[An]},Zi.prototype.getClass=function(){return Zi};var He=function(){this._nodeMap=new ke,this._edge=null;var e=arguments[0];this._edge=e};He.prototype.getSplitCoordinates=function(){var e=this,t=new Wu;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next();e.addEdgeCoordinates(i,s,t),i=s}return t.toCoordinateArray()},He.prototype.addCollapsedNodes=function(){var e=this,t=new W;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var n=t.iterator();n.hasNext();){var i=n.next().intValue();e.add(e._edge.getCoordinate(i),i)}},He.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},He.prototype.findCollapsesFromExistingVertices=function(e){for(var t=this,n=0;n<this._edge.size()-2;n++){var i=t._edge.getCoordinate(n),s=t._edge.getCoordinate(n+2);i.equals2D(s)&&e.add(new cr(n+1))}},He.prototype.addEdgeCoordinates=function(e,t,n){var i=this,s=this._edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(s);n.add(new R(e.coord),!1);for(var a=e.segmentIndex+1;a<=t.segmentIndex;a++)n.add(i._edge.getCoordinate(a));o&&n.add(new R(t.coord))},He.prototype.iterator=function(){return this._nodeMap.values().iterator()},He.prototype.addSplitEdges=function(e){var t=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next(),o=t.createSplitEdge(i,s);e.add(o),i=s}},He.prototype.findCollapseIndex=function(e,t,n){if(!e.coord.equals2D(t.coord))return!1;var i=t.segmentIndex-e.segmentIndex;return t.isInterior()||i--,i===1?(n[0]=e.segmentIndex+1,!0):!1},He.prototype.findCollapsesFromInsertedNodes=function(e){for(var t=this,n=new Array(1).fill(null),i=this.iterator(),s=i.next();i.hasNext();){var o=i.next(),a=t.findCollapseIndex(s,o,n);a&&e.add(new cr(n[0])),s=o}},He.prototype.getEdge=function(){return this._edge},He.prototype.addEndpoints=function(){var e=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(e),e)},He.prototype.createSplitEdge=function(e,t){var n=this,i=t.segmentIndex-e.segmentIndex+2,s=this._edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new R(e.coord);for(var l=e.segmentIndex+1;l<=t.segmentIndex;l++)a[u++]=n._edge.getCoordinate(l);return o&&(a[u]=new R(t.coord)),new oe(a,this._edge.getData())},He.prototype.add=function(e,t){var n=new Zi(this._edge,e,t,this._edge.getSegmentOctant(t)),i=this._nodeMap.get(n);return i!==null?(yt.isTrue(i.coord.equals2D(e),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)},He.prototype.checkSplitEdgesCorrectness=function(e){var t=this._edge.getCoordinates(),n=e.get(0),i=n.getCoordinate(0);if(!i.equals2D(t[0]))throw new vi("bad split edge start point at "+i);var s=e.get(e.size()-1),o=s.getCoordinates(),a=o[o.length-1];if(!a.equals2D(t[t.length-1]))throw new vi("bad split edge end point at "+a)},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var po=function(){};po.prototype.interfaces_=function(){return[]},po.prototype.getClass=function(){return po},po.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new Yt("Cannot compute the octant for point ( "+e+", "+t+" )");var n=Math.abs(e),i=Math.abs(t);return e>=0?t>=0?n>=i?0:1:n>=i?7:6:t>=0?n>=i?3:2:n>=i?4:5}else if(arguments[0]instanceof R&&arguments[1]instanceof R){var s=arguments[0],o=arguments[1],a=o.x-s.x,u=o.y-s.y;if(a===0&&u===0)throw new Yt("Cannot compute the octant for two identical points "+s);return po.octant(a,u)}};var Yr=function(){};Yr.prototype.getCoordinates=function(){},Yr.prototype.size=function(){},Yr.prototype.getCoordinate=function(e){},Yr.prototype.isClosed=function(){},Yr.prototype.setData=function(e){},Yr.prototype.getData=function(){},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr};var Qu=function(){};Qu.prototype.addIntersection=function(e,t){},Qu.prototype.interfaces_=function(){return[Yr]},Qu.prototype.getClass=function(){return Qu};var oe=function(){this._nodeList=new He(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};oe.prototype.getCoordinates=function(){return this._pts},oe.prototype.size=function(){return this._pts.length},oe.prototype.getCoordinate=function(e){return this._pts[e]},oe.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},oe.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))},oe.prototype.setData=function(e){this._data=e},oe.prototype.safeOctant=function(e,t){return e.equals2D(t)?0:po.octant(e,t)},oe.prototype.getData=function(){return this._data},oe.prototype.addIntersection=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[3],o=new R(n.getIntersection(s));this.addIntersection(o,i)}},oe.prototype.toString=function(){return Zn.toLineString(new se(this._pts))},oe.prototype.getNodeList=function(){return this._nodeList},oe.prototype.addIntersectionNode=function(e,t){var n=t,i=n+1;if(i<this._pts.length){var s=this._pts[i];e.equals2D(s)&&(n=i)}var o=this._nodeList.add(e,n);return o},oe.prototype.addIntersections=function(e,t,n){for(var i=this,s=0;s<e.getIntersectionNum();s++)i.addIntersection(e,t,n,s)},oe.prototype.interfaces_=function(){return[Qu]},oe.prototype.getClass=function(){return oe},oe.getNodedSubstrings=function(){if(arguments.length===1){var e=arguments[0],t=new W;return oe.getNodedSubstrings(e,t),t}else if(arguments.length===2)for(var n=arguments[0],i=arguments[1],s=n.iterator();s.hasNext();){var o=s.next();o.getNodeList().addSplitEdges(i)}};var tt=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new R,this.p1=new R;else if(arguments.length===1){var e=arguments[0];this.p0=new R(e.p0),this.p1=new R(e.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var t=arguments[0],n=arguments[1],i=arguments[2],s=arguments[3];this.p0=new R(t,n),this.p1=new R(i,s)}},jm={serialVersionUID:{configurable:!0}};tt.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},tt.prototype.orientationIndex=function(){if(arguments[0]instanceof tt){var e=arguments[0],t=q.orientationIndex(this.p0,this.p1,e.p0),n=q.orientationIndex(this.p0,this.p1,e.p1);return t>=0&&n>=0||t<=0&&n<=0?Math.max(t,n):0}else if(arguments[0]instanceof R){var i=arguments[0];return q.orientationIndex(this.p0,this.p1,i)}},tt.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])},tt.prototype.isVertical=function(){return this.p0.x===this.p1.x},tt.prototype.equals=function(e){if(!(e instanceof tt))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)},tt.prototype.intersection=function(e){var t=new Cs;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null},tt.prototype.project=function(){if(arguments[0]instanceof R){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new R(e);var t=this.projectionFactor(e),n=new R;return n.x=this.p0.x+t*(this.p1.x-this.p0.x),n.y=this.p0.y+t*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof tt){var i=arguments[0],s=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(s>=1&&o>=1||s<=0&&o<=0)return null;var a=this.project(i.p0);s<0&&(a=this.p0),s>1&&(a=this.p1);var u=this.project(i.p1);return o<0&&(u=this.p0),o>1&&(u=this.p1),new tt(a,u)}},tt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},tt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},tt.prototype.getCoordinate=function(e){return e===0?this.p0:this.p1},tt.prototype.distancePerpendicular=function(e){return q.distancePointLinePerpendicular(e,this.p0,this.p1)},tt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},tt.prototype.midPoint=function(){return tt.midPoint(this.p0,this.p1)},tt.prototype.projectionFactor=function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=t*t+n*n;if(i<=0)return ht.NaN;var s=((e.x-this.p0.x)*t+(e.y-this.p0.y)*n)/i;return s},tt.prototype.closestPoints=function(e){var t=this.intersection(e);if(t!==null)return[t,t];var n=new Array(2).fill(null),i=ht.MAX_VALUE,s=null,o=this.closestPoint(e.p0);i=o.distance(e.p0),n[0]=o,n[1]=e.p0;var a=this.closestPoint(e.p1);s=a.distance(e.p1),s<i&&(i=s,n[0]=a,n[1]=e.p1);var u=e.closestPoint(this.p0);s=u.distance(this.p0),s<i&&(i=s,n[0]=this.p0,n[1]=u);var l=e.closestPoint(this.p1);return s=l.distance(this.p1),s<i&&(i=s,n[0]=this.p1,n[1]=l),n},tt.prototype.closestPoint=function(e){var t=this.projectionFactor(e);if(t>0&&t<1)return this.project(e);var n=this.p0.distance(e),i=this.p1.distance(e);return n<i?this.p0:this.p1},tt.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},tt.prototype.getLength=function(){return this.p0.distance(this.p1)},tt.prototype.compareTo=function(e){var t=e,n=this.p0.compareTo(t.p0);return n!==0?n:this.p1.compareTo(t.p1)},tt.prototype.reverse=function(){var e=this.p0;this.p0=this.p1,this.p1=e},tt.prototype.equalsTopo=function(e){return this.p0.equals(e.p0)&&(this.p1.equals(e.p1)||this.p0.equals(e.p1))&&this.p1.equals(e.p0)},tt.prototype.lineIntersection=function(e){try{var t=Kn.intersection(this.p0,this.p1,e.p0,e.p1);return t}catch(n){if(!(n instanceof ha))throw n}finally{}return null},tt.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},tt.prototype.pointAlongOffset=function(e,t){var n=this.p0.x+e*(this.p1.x-this.p0.x),i=this.p0.y+e*(this.p1.y-this.p0.y),s=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,a=Math.sqrt(s*s+o*o),u=0,l=0;if(t!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=t*s/a,l=t*o/a}var c=n-l,h=i+u,f=new R(c,h);return f},tt.prototype.setCoordinates=function(){if(arguments.length===1){var e=arguments[0];this.setCoordinates(e.p0,e.p1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.p0.x=t.x,this.p0.y=t.y,this.p1.x=n.x,this.p1.y=n.y}},tt.prototype.segmentFraction=function(e){var t=this.projectionFactor(e);return t<0?t=0:(t>1||ht.isNaN(t))&&(t=1),t},tt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},tt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},tt.prototype.distance=function(){if(arguments[0]instanceof tt){var e=arguments[0];return q.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}else if(arguments[0]instanceof R){var t=arguments[0];return q.distancePointLine(t,this.p0,this.p1)}},tt.prototype.pointAlong=function(e){var t=new R;return t.x=this.p0.x+e*(this.p1.x-this.p0.x),t.y=this.p0.y+e*(this.p1.y-this.p0.y),t},tt.prototype.hashCode=function(){var e=ht.doubleToLongBits(this.p0.x);e^=ht.doubleToLongBits(this.p0.y)*31;var t=Math.trunc(e)^Math.trunc(e>>32),n=ht.doubleToLongBits(this.p1.x);n^=ht.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(n)^Math.trunc(n>>32);return t^i},tt.prototype.interfaces_=function(){return[An,kn]},tt.prototype.getClass=function(){return tt},tt.midPoint=function(e,t){return new R((e.x+t.x)/2,(e.y+t.y)/2)},jm.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(tt,jm);var tl=function(){this.tempEnv1=new Q,this.tempEnv2=new Q,this._overlapSeg1=new tt,this._overlapSeg2=new tt};tl.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];e.getLineSegment(t,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},tl.prototype.interfaces_=function(){return[]},tl.prototype.getClass=function(){return tl};var pn=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this._pts=e,this._start=t,this._end=n,this._context=i};pn.prototype.getLineSegment=function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]},pn.prototype.computeSelect=function(e,t,n,i){var s=this._pts[t],o=this._pts[n];if(i.tempEnv1.init(s,o),n-t===1)return i.select(this,t),null;if(!e.intersects(i.tempEnv1))return null;var a=Math.trunc((t+n)/2);t<a&&this.computeSelect(e,t,a,i),a<n&&this.computeSelect(e,a,n,i)},pn.prototype.getCoordinates=function(){for(var e=this,t=new Array(this._end-this._start+1).fill(null),n=0,i=this._start;i<=this._end;i++)t[n++]=e._pts[i];return t},pn.prototype.computeOverlaps=function(e,t){this.computeOverlapsInternal(this._start,this._end,e,e._start,e._end,t)},pn.prototype.setId=function(e){this._id=e},pn.prototype.select=function(e,t){this.computeSelect(e,this._start,this._end,t)},pn.prototype.getEnvelope=function(){if(this._env===null){var e=this._pts[this._start],t=this._pts[this._end];this._env=new Q(e,t)}return this._env},pn.prototype.getEndIndex=function(){return this._end},pn.prototype.getStartIndex=function(){return this._start},pn.prototype.getContext=function(){return this._context},pn.prototype.getId=function(){return this._id},pn.prototype.computeOverlapsInternal=function(e,t,n,i,s,o){var a=this._pts[e],u=this._pts[t],l=n._pts[i],c=n._pts[s];if(t-e===1&&s-i===1)return o.overlap(this,e,n,i),null;if(o.tempEnv1.init(a,u),o.tempEnv2.init(l,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var h=Math.trunc((e+t)/2),f=Math.trunc((i+s)/2);e<h&&(i<f&&this.computeOverlapsInternal(e,h,n,i,f,o),f<s&&this.computeOverlapsInternal(e,h,n,f,s,o)),h<t&&(i<f&&this.computeOverlapsInternal(h,t,n,i,f,o),f<s&&this.computeOverlapsInternal(h,t,n,f,s,o))},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var wr=function(){};wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},wr.getChainStartIndices=function(e){var t=0,n=new W;n.add(new cr(t));do{var i=wr.findChainEnd(e,t);n.add(new cr(i)),t=i}while(t<e.length-1);var s=wr.toIntArray(n);return s},wr.findChainEnd=function(e,t){for(var n=t;n<e.length-1&&e[n].equals2D(e[n+1]);)n++;if(n>=e.length-1)return e.length-1;for(var i=Bt.quadrant(e[n],e[n+1]),s=t+1;s<e.length;){if(!e[s-1].equals2D(e[s])){var o=Bt.quadrant(e[s-1],e[s]);if(o!==i)break}s++}return s-1},wr.getChains=function(){if(arguments.length===1){var e=arguments[0];return wr.getChains(e,null)}else if(arguments.length===2){for(var t=arguments[0],n=arguments[1],i=new W,s=wr.getChainStartIndices(t),o=0;o<s.length-1;o++){var a=new pn(t,s[o],s[o+1],n);i.add(a)}return i}},wr.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),n=0;n<t.length;n++)t[n]=e.get(n).intValue();return t};var Is=function(){};Is.prototype.computeNodes=function(e){},Is.prototype.getNodedSubstrings=function(){},Is.prototype.interfaces_=function(){return[]},Is.prototype.getClass=function(){return Is};var el=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setSegmentIntersector(e)}}};el.prototype.setSegmentIntersector=function(e){this._segInt=e},el.prototype.interfaces_=function(){return[Is]},el.prototype.getClass=function(){return el};var md=function(r){function e(n){n?r.call(this,n):r.call(this),this._monoChains=new W,this._index=new km,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return oe.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(i){for(var s=this,o=wr.getChains(i.getCoordinates(),i),a=o.iterator();a.hasNext();){var u=a.next();u.setId(s._idCounter++),s._index.insert(u.getEnvelope(),u),s._monoChains.add(u)}},e.prototype.computeNodes=function(i){var s=this;this._nodedSegStrings=i;for(var o=i.iterator();o.hasNext();)s.add(o.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var i=this,s=new Bm(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var a=o.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var c=l.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,s),i._nOverlaps++),i._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.SegmentOverlapAction.get=function(){return Bm},Object.defineProperties(e,t),e}(el),Bm=function(r){function e(){r.call(this),this._si=null;var t=arguments[0];this._si=t}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3],a=n.getContext(),u=s.getContext();this._si.processIntersections(a,i,u,o)}else return r.prototype.overlap.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(tl),Ft=function r(){if(this._quadrantSegments=r.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=r.CAP_ROUND,this._joinStyle=r.JOIN_ROUND,this._mitreLimit=r.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=r.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.setQuadrantSegments(t),this.setEndCapStyle(n)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(s),this.setJoinStyle(o),this.setMitreLimit(a)}}},Pi={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Ft.prototype.getEndCapStyle=function(){return this._endCapStyle},Ft.prototype.isSingleSided=function(){return this._isSingleSided},Ft.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,this._quadrantSegments===0&&(this._joinStyle=Ft.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Ft.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==Ft.JOIN_ROUND&&(this._quadrantSegments=Ft.DEFAULT_QUADRANT_SEGMENTS)},Ft.prototype.getJoinStyle=function(){return this._joinStyle},Ft.prototype.setJoinStyle=function(e){this._joinStyle=e},Ft.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e},Ft.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Ft.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Ft.prototype.setEndCapStyle=function(e){this._endCapStyle=e},Ft.prototype.getMitreLimit=function(){return this._mitreLimit},Ft.prototype.setMitreLimit=function(e){this._mitreLimit=e},Ft.prototype.setSingleSided=function(e){this._isSingleSided=e},Ft.prototype.interfaces_=function(){return[]},Ft.prototype.getClass=function(){return Ft},Ft.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)},Pi.CAP_ROUND.get=function(){return 1},Pi.CAP_FLAT.get=function(){return 2},Pi.CAP_SQUARE.get=function(){return 3},Pi.JOIN_ROUND.get=function(){return 1},Pi.JOIN_MITRE.get=function(){return 2},Pi.JOIN_BEVEL.get=function(){return 3},Pi.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Pi.DEFAULT_MITRE_LIMIT.get=function(){return 5},Pi.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Ft,Pi);var ee=function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=q.COUNTERCLOCKWISE,this._inputLine=e||null},nl={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};ee.prototype.isDeletable=function(e,t,n,i){var s=this._inputLine[e],o=this._inputLine[t],a=this._inputLine[n];return!this.isConcave(s,o,a)||!this.isShallow(s,o,a,i)?!1:this.isShallowSampled(s,o,e,n,i)},ee.prototype.deleteShallowConcavities=function(){for(var e=this,t=1,n=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(n),s=!1;i<this._inputLine.length;){var o=!1;e.isDeletable(t,n,i,e._distanceTol)&&(e._isDeleted[n]=ee.DELETE,o=!0,s=!0),o?t=i:t=n,n=e.findNextNonDeletedIndex(t),i=e.findNextNonDeletedIndex(n)}return s},ee.prototype.isShallowConcavity=function(e,t,n,i){var s=q.computeOrientation(e,t,n),o=s===this._angleOrientation;if(!o)return!1;var a=q.distancePointLine(t,e,n);return a<i},ee.prototype.isShallowSampled=function(e,t,n,i,s){var o=this,a=Math.trunc((i-n)/ee.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=n;u<i;u+=a)if(!o.isShallow(e,t,o._inputLine[u],s))return!1;return!0},ee.prototype.isConcave=function(e,t,n){var i=q.computeOrientation(e,t,n),s=i===this._angleOrientation;return s},ee.prototype.simplify=function(e){var t=this;this._distanceTol=Math.abs(e),e<0&&(this._angleOrientation=q.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=t.deleteShallowConcavities();while(n);return this.collapseLine()},ee.prototype.findNextNonDeletedIndex=function(e){for(var t=e+1;t<this._inputLine.length&&this._isDeleted[t]===ee.DELETE;)t++;return t},ee.prototype.isShallow=function(e,t,n,i){var s=q.distancePointLine(t,e,n);return s<i},ee.prototype.collapseLine=function(){for(var e=this,t=new Wu,n=0;n<this._inputLine.length;n++)e._isDeleted[n]!==ee.DELETE&&t.add(e._inputLine[n]);return t.toCoordinateArray()},ee.prototype.interfaces_=function(){return[]},ee.prototype.getClass=function(){return ee},ee.simplify=function(e,t){var n=new ee(e);return n.simplify(t)},nl.INIT.get=function(){return 0},nl.DELETE.get=function(){return 1},nl.KEEP.get=function(){return 1},nl.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(ee,nl);var On=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new W},zm={COORDINATE_ARRAY_TYPE:{configurable:!0}};On.prototype.getCoordinates=function(){var e=this._ptList.toArray(On.COORDINATE_ARRAY_TYPE);return e},On.prototype.setPrecisionModel=function(e){this._precisionModel=e},On.prototype.addPt=function(e){var t=new R(e);if(this._precisionModel.makePrecise(t),this.isRedundant(t))return null;this._ptList.add(t)},On.prototype.revere=function(){},On.prototype.addPts=function(e,t){var n=this;if(t)for(var i=0;i<e.length;i++)n.addPt(e[i]);else for(var s=e.length-1;s>=0;s--)n.addPt(e[s])},On.prototype.isRedundant=function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1),n=e.distance(t);return n<this._minimimVertexDistance},On.prototype.toString=function(){var e=new St,t=e.createLineString(this.getCoordinates());return t.toString()},On.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var e=new R(this._ptList.get(0)),t=this._ptList.get(this._ptList.size()-1);if(e.equals(t))return null;this._ptList.add(e)},On.prototype.setMinimumVertexDistance=function(e){this._minimimVertexDistance=e},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},zm.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(On,zm);var xt=function(){},go={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};xt.prototype.interfaces_=function(){return[]},xt.prototype.getClass=function(){return xt},xt.toDegrees=function(e){return e*180/Math.PI},xt.normalize=function(e){for(;e>Math.PI;)e-=xt.PI_TIMES_2;for(;e<=-Math.PI;)e+=xt.PI_TIMES_2;return e},xt.angle=function(){if(arguments.length===1){var e=arguments[0];return Math.atan2(e.y,e.x)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],i=n.x-t.x,s=n.y-t.y;return Math.atan2(s,i)}},xt.isAcute=function(e,t,n){var i=e.x-t.x,s=e.y-t.y,o=n.x-t.x,a=n.y-t.y,u=i*o+s*a;return u>0},xt.isObtuse=function(e,t,n){var i=e.x-t.x,s=e.y-t.y,o=n.x-t.x,a=n.y-t.y,u=i*o+s*a;return u<0},xt.interiorAngle=function(e,t,n){var i=xt.angle(t,e),s=xt.angle(t,n);return Math.abs(s-i)},xt.normalizePositive=function(e){if(e<0){for(;e<0;)e+=xt.PI_TIMES_2;e>=xt.PI_TIMES_2&&(e=0)}else{for(;e>=xt.PI_TIMES_2;)e-=xt.PI_TIMES_2;e<0&&(e=0)}return e},xt.angleBetween=function(e,t,n){var i=xt.angle(t,e),s=xt.angle(t,n);return xt.diff(i,s)},xt.diff=function(e,t){var n=null;return e<t?n=t-e:n=e-t,n>Math.PI&&(n=2*Math.PI-n),n},xt.toRadians=function(e){return e*Math.PI/180},xt.getTurn=function(e,t){var n=Math.sin(t-e);return n>0?xt.COUNTERCLOCKWISE:n<0?xt.CLOCKWISE:xt.NONE},xt.angleBetweenOriented=function(e,t,n){var i=xt.angle(t,e),s=xt.angle(t,n),o=s-i;return o<=-Math.PI?o+xt.PI_TIMES_2:o>Math.PI?o-xt.PI_TIMES_2:o},go.PI_TIMES_2.get=function(){return 2*Math.PI},go.PI_OVER_2.get=function(){return Math.PI/2},go.PI_OVER_4.get=function(){return Math.PI/4},go.COUNTERCLOCKWISE.get=function(){return q.COUNTERCLOCKWISE},go.CLOCKWISE.get=function(){return q.CLOCKWISE},go.NONE.get=function(){return q.COLLINEAR},Object.defineProperties(xt,go);var qt=function r(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new tt,this._seg1=new tt,this._offset0=new tt,this._offset1=new tt,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._precisionModel=e,this._bufParams=t,this._li=new Cs,this._filletAngleQuantum=Math.PI/2/t.getQuadrantSegments(),t.getQuadrantSegments()>=8&&t.getJoinStyle()===Ft.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},rl={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};qt.prototype.addNextSegment=function(e,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=e,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=q.computeOrientation(this._s0,this._s1,this._s2),i=n===q.CLOCKWISE&&this._side===U.LEFT||n===q.COUNTERCLOCKWISE&&this._side===U.RIGHT;n===0?this.addCollinear(t):i?this.addOutsideTurn(n,t):this.addInsideTurn(n,t)},qt.prototype.addLineEndCap=function(e,t){var n=new tt(e,t),i=new tt;this.computeOffsetSegment(n,U.LEFT,this._distance,i);var s=new tt;this.computeOffsetSegment(n,U.RIGHT,this._distance,s);var o=t.x-e.x,a=t.y-e.y,u=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case Ft.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(t,u+Math.PI/2,u-Math.PI/2,q.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case Ft.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(s.p1);break;case Ft.CAP_SQUARE:var l=new R;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var c=new R(i.p1.x+l.x,i.p1.y+l.y),h=new R(s.p1.x+l.x,s.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(h);break}},qt.prototype.getCoordinates=function(){var e=this._segList.getCoordinates();return e},qt.prototype.addMitreJoin=function(e,t,n,i){var s=!0,o=null;try{o=Kn.intersection(t.p0,t.p1,n.p0,n.p1);var a=i<=0?1:o.distance(e)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(s=!1)}catch(u){if(u instanceof ha)o=new R(0,0),s=!1;else throw u}finally{}s?this._segList.addPt(o):this.addLimitedMitreJoin(t,n,i,this._bufParams.getMitreLimit())},qt.prototype.addFilletCorner=function(e,t,n,i,s){var o=t.x-e.x,a=t.y-e.y,u=Math.atan2(a,o),l=n.x-e.x,c=n.y-e.y,h=Math.atan2(c,l);i===q.CLOCKWISE?u<=h&&(u+=2*Math.PI):u>=h&&(u-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(e,u,h,i,s),this._segList.addPt(n)},qt.prototype.addOutsideTurn=function(e,t){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*qt.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Ft.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Ft.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(t&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,e,this._distance),this._segList.addPt(this._offset1.p0))},qt.prototype.createSquare=function(e){this._segList.addPt(new R(e.x+this._distance,e.y+this._distance)),this._segList.addPt(new R(e.x+this._distance,e.y-this._distance)),this._segList.addPt(new R(e.x-this._distance,e.y-this._distance)),this._segList.addPt(new R(e.x-this._distance,e.y+this._distance)),this._segList.closeRing()},qt.prototype.addSegments=function(e,t){this._segList.addPts(e,t)},qt.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},qt.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},qt.prototype.initSideSegments=function(e,t,n){this._s1=e,this._s2=t,this._side=n,this._seg1.setCoordinates(e,t),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},qt.prototype.addLimitedMitreJoin=function(e,t,n,i){var s=this._seg0.p1,o=xt.angle(s,this._seg0.p0),a=xt.angleBetweenOriented(this._seg0.p0,s,this._seg1.p1),u=a/2,l=xt.normalize(o+u),c=xt.normalize(l+Math.PI),h=i*n,f=h*Math.abs(Math.sin(u)),p=n-f,v=s.x+h*Math.cos(c),C=s.y+h*Math.sin(c),S=new R(v,C),P=new tt(s,S),y=P.pointAlongOffset(1,p),_=P.pointAlongOffset(1,-p);this._side===U.LEFT?(this._segList.addPt(y),this._segList.addPt(_)):(this._segList.addPt(_),this._segList.addPt(y))},qt.prototype.computeOffsetSegment=function(e,t,n,i){var s=t===U.LEFT?1:-1,o=e.p1.x-e.p0.x,a=e.p1.y-e.p0.y,u=Math.sqrt(o*o+a*a),l=s*n*o/u,c=s*n*a/u;i.p0.x=e.p0.x-c,i.p0.y=e.p0.y+l,i.p1.x=e.p1.x-c,i.p1.y=e.p1.y+l},qt.prototype.addFilletArc=function(e,t,n,i,s){var o=this,a=i===q.CLOCKWISE?-1:1,u=Math.abs(t-n),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var c=0,h=u/l,f=c,p=new R;f<u;){var v=t+a*f;p.x=e.x+s*Math.cos(v),p.y=e.y+s*Math.sin(v),o._segList.addPt(p),f+=h}},qt.prototype.addInsideTurn=function(e,t){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*qt.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new R((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new R((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},qt.prototype.createCircle=function(e){var t=new R(e.x+this._distance,e.y);this._segList.addPt(t),this.addFilletArc(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},qt.prototype.addBevelJoin=function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)},qt.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new On,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*qt.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},qt.prototype.addCollinear=function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var t=this._li.getIntersectionNum();t>=2&&(this._bufParams.getJoinStyle()===Ft.JOIN_BEVEL||this._bufParams.getJoinStyle()===Ft.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,q.CLOCKWISE,this._distance))},qt.prototype.closeRing=function(){this._segList.closeRing()},qt.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},rl.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},rl.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},rl.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},rl.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(qt,rl);var rn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t};rn.prototype.getOffsetCurve=function(e,t){if(this._distance=t,t===0)return null;var n=t<0,i=Math.abs(t),s=this.getSegGen(i);e.length<=1?this.computePointCurve(e[0],s):this.computeOffsetCurve(e,n,s);var o=s.getCoordinates();return n&&Ct.reverse(o),o},rn.prototype.computeSingleSidedBufferCurve=function(e,t,n){var i=this.simplifyTolerance(this._distance);if(t){n.addSegments(e,!0);var s=ee.simplify(e,-i),o=s.length-1;n.initSideSegments(s[o],s[o-1],U.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{n.addSegments(e,!1);var u=ee.simplify(e,i),l=u.length-1;n.initSideSegments(u[0],u[1],U.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment(),n.closeRing()},rn.prototype.computeRingBufferCurve=function(e,t,n){var i=this.simplifyTolerance(this._distance);t===U.RIGHT&&(i=-i);var s=ee.simplify(e,i),o=s.length-1;n.initSideSegments(s[o-1],s[0],t);for(var a=1;a<=o;a++){var u=a!==1;n.addNextSegment(s[a],u)}n.closeRing()},rn.prototype.computeLineBufferCurve=function(e,t){var n=this.simplifyTolerance(this._distance),i=ee.simplify(e,n),s=i.length-1;t.initSideSegments(i[0],i[1],U.LEFT);for(var o=2;o<=s;o++)t.addNextSegment(i[o],!0);t.addLastSegment(),t.addLineEndCap(i[s-1],i[s]);var a=ee.simplify(e,-n),u=a.length-1;t.initSideSegments(a[u],a[u-1],U.LEFT);for(var l=u-2;l>=0;l--)t.addNextSegment(a[l],!0);t.addLastSegment(),t.addLineEndCap(a[1],a[0]),t.closeRing()},rn.prototype.computePointCurve=function(e,t){switch(this._bufParams.getEndCapStyle()){case Ft.CAP_ROUND:t.createCircle(e);break;case Ft.CAP_SQUARE:t.createSquare(e);break}},rn.prototype.getLineCurve=function(e,t){if(this._distance=t,t<0&&!this._bufParams.isSingleSided()||t===0)return null;var n=Math.abs(t),i=this.getSegGen(n);if(e.length<=1)this.computePointCurve(e[0],i);else if(this._bufParams.isSingleSided()){var s=t<0;this.computeSingleSidedBufferCurve(e,s,i)}else this.computeLineBufferCurve(e,i);var o=i.getCoordinates();return o},rn.prototype.getBufferParameters=function(){return this._bufParams},rn.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()},rn.prototype.getRingCurve=function(e,t,n){if(this._distance=n,e.length<=2)return this.getLineCurve(e,n);if(n===0)return rn.copyCoordinates(e);var i=this.getSegGen(n);return this.computeRingBufferCurve(e,t,i),i.getCoordinates()},rn.prototype.computeOffsetCurve=function(e,t,n){var i=this.simplifyTolerance(this._distance);if(t){var s=ee.simplify(e,-i),o=s.length-1;n.initSideSegments(s[o],s[o-1],U.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{var u=ee.simplify(e,i),l=u.length-1;n.initSideSegments(u[0],u[1],U.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment()},rn.prototype.getSegGen=function(e){return new qt(this._precisionModel,this._bufParams,e)},rn.prototype.interfaces_=function(){return[]},rn.prototype.getClass=function(){return rn},rn.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),n=0;n<t.length;n++)t[n]=new R(e[n]);return t};var mo=function(){this._subgraphs=null,this._seg=new tt,this._cga=new q;var e=arguments[0];this._subgraphs=e},Um={DepthSegment:{configurable:!0}};mo.prototype.findStabbedSegments=function(){var e=this;if(arguments.length===1){for(var t=arguments[0],n=new W,i=this._subgraphs.iterator();i.hasNext();){var s=i.next(),o=s.getEnvelope();t.y<o.getMinY()||t.y>o.getMaxY()||e.findStabbedSegments(t,s.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(at(arguments[2],Qn)&&arguments[0]instanceof R&&arguments[1]instanceof gd)for(var a=arguments[0],u=arguments[1],l=arguments[2],c=u.getEdge().getCoordinates(),h=0;h<c.length-1;h++){e._seg.p0=c[h],e._seg.p1=c[h+1],e._seg.p0.y>e._seg.p1.y&&e._seg.reverse();var f=Math.max(e._seg.p0.x,e._seg.p1.x);if(!(f<a.x)&&!e._seg.isHorizontal()&&!(a.y<e._seg.p0.y||a.y>e._seg.p1.y)&&q.computeOrientation(e._seg.p0,e._seg.p1,a)!==q.RIGHT){var p=u.getDepth(U.LEFT);e._seg.p0.equals(c[h])||(p=u.getDepth(U.RIGHT));var v=new xs(e._seg,p);l.add(v)}}else if(at(arguments[2],Qn)&&arguments[0]instanceof R&&at(arguments[1],Qn))for(var C=arguments[0],S=arguments[1],P=arguments[2],y=S.iterator();y.hasNext();){var _=y.next();_.isForward()&&e.findStabbedSegments(C,_,P)}}},mo.prototype.getDepth=function(e){var t=this.findStabbedSegments(e);if(t.size()===0)return 0;var n=rr.min(t);return n._leftDepth},mo.prototype.interfaces_=function(){return[]},mo.prototype.getClass=function(){return mo},Um.DepthSegment.get=function(){return xs},Object.defineProperties(mo,Um);var xs=function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new tt(e),this._leftDepth=t};xs.prototype.compareTo=function(e){var t=e;if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(t._upwardSeg);return n!==0||(n=-1*t._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(t._upwardSeg)},xs.prototype.compareX=function(e,t){var n=e.p0.compareTo(t.p0);return n!==0?n:e.p1.compareTo(t.p1)},xs.prototype.toString=function(){return this._upwardSeg.toString()},xs.prototype.interfaces_=function(){return[An]},xs.prototype.getClass=function(){return xs};var At=function(e,t,n){this.p0=e||null,this.p1=t||null,this.p2=n||null};At.prototype.area=function(){return At.area(this.p0,this.p1,this.p2)},At.prototype.signedArea=function(){return At.signedArea(this.p0,this.p1,this.p2)},At.prototype.interpolateZ=function(e){if(e===null)throw new Yt("Supplied point is null.");return At.interpolateZ(e,this.p0,this.p1,this.p2)},At.prototype.longestSideLength=function(){return At.longestSideLength(this.p0,this.p1,this.p2)},At.prototype.isAcute=function(){return At.isAcute(this.p0,this.p1,this.p2)},At.prototype.circumcentre=function(){return At.circumcentre(this.p0,this.p1,this.p2)},At.prototype.area3D=function(){return At.area3D(this.p0,this.p1,this.p2)},At.prototype.centroid=function(){return At.centroid(this.p0,this.p1,this.p2)},At.prototype.inCentre=function(){return At.inCentre(this.p0,this.p1,this.p2)},At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.area=function(e,t,n){return Math.abs(((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2)},At.signedArea=function(e,t,n){return((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2},At.det=function(e,t,n,i){return e*i-t*n},At.interpolateZ=function(e,t,n,i){var s=t.x,o=t.y,a=n.x-s,u=i.x-s,l=n.y-o,c=i.y-o,h=a*c-u*l,f=e.x-s,p=e.y-o,v=(c*f-u*p)/h,C=(-l*f+a*p)/h,S=t.z+v*(n.z-t.z)+C*(i.z-t.z);return S},At.longestSideLength=function(e,t,n){var i=e.distance(t),s=t.distance(n),o=n.distance(e),a=i;return s>a&&(a=s),o>a&&(a=o),a},At.isAcute=function(e,t,n){return!(!xt.isAcute(e,t,n)||!xt.isAcute(t,n,e)||!xt.isAcute(n,e,t))},At.circumcentre=function(e,t,n){var i=n.x,s=n.y,o=e.x-i,a=e.y-s,u=t.x-i,l=t.y-s,c=2*At.det(o,a,u,l),h=At.det(a,o*o+a*a,l,u*u+l*l),f=At.det(o,o*o+a*a,u,u*u+l*l),p=i-h/c,v=s+f/c;return new R(p,v)},At.perpendicularBisector=function(e,t){var n=t.x-e.x,i=t.y-e.y,s=new Kn(e.x+n/2,e.y+i/2,1),o=new Kn(e.x-i+n/2,e.y+n+i/2,1);return new Kn(s,o)},At.angleBisector=function(e,t,n){var i=t.distance(e),s=t.distance(n),o=i/(i+s),a=n.x-e.x,u=n.y-e.y,l=new R(e.x+o*a,e.y+o*u);return l},At.area3D=function(e,t,n){var i=t.x-e.x,s=t.y-e.y,o=t.z-e.z,a=n.x-e.x,u=n.y-e.y,l=n.z-e.z,c=s*l-o*u,h=o*a-i*l,f=i*u-s*a,p=c*c+h*h+f*f,v=Math.sqrt(p)/2;return v},At.centroid=function(e,t,n){var i=(e.x+t.x+n.x)/3,s=(e.y+t.y+n.y)/3;return new R(i,s)},At.inCentre=function(e,t,n){var i=t.distance(n),s=e.distance(n),o=e.distance(t),a=i+s+o,u=(i*e.x+s*t.x+o*n.x)/a,l=(i*e.y+s*t.y+o*n.y)/a;return new R(u,l)};var Un=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new W;var e=arguments[0],t=arguments[1],n=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=n};Un.prototype.addPoint=function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,F.EXTERIOR,F.INTERIOR)},Un.prototype.addPolygon=function(e){var t=this,n=this._distance,i=U.LEFT;this._distance<0&&(n=-this._distance,i=U.RIGHT);var s=e.getExteriorRing(),o=Ct.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,n,i,F.EXTERIOR,F.INTERIOR);for(var a=0;a<e.getNumInteriorRing();a++){var u=e.getInteriorRingN(a),l=Ct.removeRepeatedPoints(u.getCoordinates());t._distance>0&&t.isErodedCompletely(u,-t._distance)||t.addPolygonRing(l,n,U.opposite(i),F.INTERIOR,F.EXTERIOR)}},Un.prototype.isTriangleErodedCompletely=function(e,t){var n=new At(e[0],e[1],e[2]),i=n.inCentre(),s=q.distancePointLine(i,n.p0,n.p1);return s<Math.abs(t)},Un.prototype.addLineString=function(e){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var t=Ct.removeRepeatedPoints(e.getCoordinates()),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,F.EXTERIOR,F.INTERIOR)},Un.prototype.addCurve=function(e,t,n){if(e===null||e.length<2)return null;var i=new oe(e,new jt(0,F.BOUNDARY,t,n));this._curveList.add(i)},Un.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Un.prototype.addPolygonRing=function(e,t,n,i,s){if(t===0&&e.length<Hr.MINIMUM_VALID_SIZE)return null;var o=i,a=s;e.length>=Hr.MINIMUM_VALID_SIZE&&q.isCCW(e)&&(o=s,a=i,n=U.opposite(n));var u=this._curveBuilder.getRingCurve(e,n,t);this.addCurve(u,o,a)},Un.prototype.add=function(e){if(e.isEmpty())return null;e instanceof pe?this.addPolygon(e):e instanceof te?this.addLineString(e):e instanceof dn?this.addPoint(e):e instanceof wa?this.addCollection(e):e instanceof Ps?this.addCollection(e):e instanceof qr?this.addCollection(e):e instanceof Ge&&this.addCollection(e)},Un.prototype.isErodedCompletely=function(e,t){var n=e.getCoordinates();if(n.length<4)return t<0;if(n.length===4)return this.isTriangleErodedCompletely(n,t);var i=e.getEnvelopeInternal(),s=Math.min(i.getHeight(),i.getWidth());return t<0&&2*Math.abs(t)>s},Un.prototype.addCollection=function(e){for(var t=this,n=0;n<e.getNumGeometries();n++){var i=e.getGeometryN(n);t.add(i)}},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var ba=function(){};ba.prototype.locate=function(e){},ba.prototype.interfaces_=function(){return[]},ba.prototype.getClass=function(){return ba};var Jr=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var e=arguments[0];this._parent=e,this._atStart=!0,this._index=0,this._max=e.getNumGeometries()};Jr.prototype.next=function(){if(this._atStart)return this._atStart=!1,Jr.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new ya;var e=this._parent.getGeometryN(this._index++);return e instanceof Ge?(this._subcollectionIterator=new Jr(e),this._subcollectionIterator.next()):e},Jr.prototype.remove=function(){throw new Error(this.getClass().getName())},Jr.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Jr.prototype.interfaces_=function(){return[va]},Jr.prototype.getClass=function(){return Jr},Jr.isAtomic=function(e){return!(e instanceof Ge)};var Nn=function(){this._geom=null;var e=arguments[0];this._geom=e};Nn.prototype.locate=function(e){return Nn.locate(e,this._geom)},Nn.prototype.interfaces_=function(){return[ba]},Nn.prototype.getClass=function(){return Nn},Nn.isPointInRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?q.isPointInRing(e,t.getCoordinates()):!1},Nn.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var n=t.getExteriorRing();if(!Nn.isPointInRing(e,n))return!1;for(var i=0;i<t.getNumInteriorRing();i++){var s=t.getInteriorRingN(i);if(Nn.isPointInRing(e,s))return!1}return!0},Nn.containsPoint=function(e,t){if(t instanceof pe)return Nn.containsPointInPolygon(e,t);if(t instanceof Ge)for(var n=new Jr(t);n.hasNext();){var i=n.next();if(i!==t&&Nn.containsPoint(e,i))return!0}return!1},Nn.locate=function(e,t){return t.isEmpty()?F.EXTERIOR:Nn.containsPoint(e,t)?F.INTERIOR:F.EXTERIOR};var je=function(){this._edgeMap=new ke,this._edgeList=null,this._ptInAreaLocation=[F.NONE,F.NONE]};je.prototype.getNextCW=function(e){this.getEdges();var t=this._edgeList.indexOf(e),n=t-1;return t===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)},je.prototype.propagateSideLabels=function(e){for(var t=F.NONE,n=this.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();s.isArea(e)&&s.getLocation(e,U.LEFT)!==F.NONE&&(t=s.getLocation(e,U.LEFT))}if(t===F.NONE)return null;for(var o=t,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(e,U.ON)===F.NONE&&l.setLocation(e,U.ON,o),l.isArea(e)){var c=l.getLocation(e,U.LEFT),h=l.getLocation(e,U.RIGHT);if(h!==F.NONE){if(h!==o)throw new Si("side location conflict",u.getCoordinate());c===F.NONE&&yt.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),o=c}else yt.isTrue(l.getLocation(e,U.LEFT)===F.NONE,"found single null side"),l.setLocation(e,U.RIGHT,o),l.setLocation(e,U.LEFT,o)}}},je.prototype.getCoordinate=function(){var e=this.iterator();if(!e.hasNext())return null;var t=e.next();return t.getCoordinate()},je.prototype.print=function(e){Te.out.println("EdgeEndStar: "+this.getCoordinate());for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},je.prototype.isAreaLabelsConsistent=function(e){return this.computeEdgeEndLabels(e.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},je.prototype.checkAreaLabelsConsistent=function(e){var t=this.getEdges();if(t.size()<=0)return!0;var n=t.size()-1,i=t.get(n).getLabel(),s=i.getLocation(e,U.LEFT);yt.isTrue(s!==F.NONE,"Found unlabelled area edge");for(var o=s,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();yt.isTrue(l.isArea(e),"Found non-area edge");var c=l.getLocation(e,U.LEFT),h=l.getLocation(e,U.RIGHT);if(c===h||h!==o)return!1;o=c}return!0},je.prototype.findIndex=function(e){var t=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var i=t._edgeList.get(n);if(i===e)return n}return-1},je.prototype.iterator=function(){return this.getEdges().iterator()},je.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new W(this._edgeMap.values())),this._edgeList},je.prototype.getLocation=function(e,t,n){return this._ptInAreaLocation[e]===F.NONE&&(this._ptInAreaLocation[e]=Nn.locate(t,n[e].getGeometry())),this._ptInAreaLocation[e]},je.prototype.toString=function(){var e=new lr;e.append("EdgeEndStar: "+this.getCoordinate()),e.append(`
41
+ `,an=class an extends V{constructor(){super();d(this,"_ratio",this.dv(j(0)));d(this,"_subPlayers",this.dv(new xu));const t=this.dv(new Ul);{const o=()=>{t.loop=this.loop??an.defaults.loop};o(),this.d(this.loopChanged.don(o))}{const o=()=>{(this.loop??an.defaults.loop)!==t.loop&&(this.loop=t.loop)};o(),this.d(t.loopChangedEvent.don(o))}{const o=()=>{t.currentTime=this.currentTime??an.defaults.currentTime};o(),this.d(this.currentTimeChanged.don(o))}{const o=()=>{(this.currentTime??an.defaults.currentTime)!==t.currentTime&&(this.currentTime=t.currentTime)};o(),this.d(t.currentTimeChangedEvent.don(o))}{const o=()=>{t.duration=this.duration??an.defaults.duration};o(),this.d(this.durationChanged.don(o))}{const o=()=>{(this.duration??an.defaults.duration)!==t.duration&&(this.duration=t.duration)};o(),this.d(t.durationChangedEvent.don(o))}{const o=()=>{t.speed=this.speed??an.defaults.speed};o(),this.d(this.speedChanged.don(o))}{const o=()=>{(this.speed??an.defaults.speed)!==t.speed&&(this.speed=t.speed)};o(),this.d(t.speedChangedEvent.don(o))}{const o=()=>{t.playing=this.playing??an.defaults.playing};o(),this.d(this.playingChanged.don(o))}{const o=()=>{(this.playing??an.defaults.playing)!==t.playing&&(this.playing=t.playing)};o(),this.d(t.playingChangedEvent.don(o))}const n=()=>{const o=this.duration??an.defaults.duration;o>0&&(this._ratio.value=(this.currentTime??an.defaults.currentTime)/o)};n();const i=this.dv(Ie(this.currentTimeChanged,this.durationChanged));this.d(i.don(n)),this.d(()=>{const{length:o}=this._subPlayers;for(let a=0;a<o;++a)this._subPlayers.get(a).destroy();this._subPlayers.length=0});const s=()=>{for(let a of this._subPlayers)a.destroy();if(this._subPlayers.length=0,!this.channels)return;const o=this.channels.map(a=>{const[u,l,c]=a;return new bw(u,l,c,this)});this._subPlayers.splice(0,0,...o)};s(),this.d(this.channelsChanged.don(s))}get ratio(){return this._ratio.value}set ratio(t){Math.abs(this._ratio.value-t)<.001||(this.currentTime=(this.duration??an.defaults.duration)*t)}get ratioChanged(){return this._ratio.changed}};d(an,"defaults",{loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:!0,ratio:0}),d(an,"channelsReadMe",Pw);let kr=an;(r=>{r.createDefaultProps=()=>({loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:vs(void 0,(e,t)=>e==null?void 0:e.every((n,i)=>n===t[i]),e=>[...e])})})(kr||(kr={})),Gi(kr.prototype,kr.createDefaultProps);class Iw extends V{constructor(e,t,n,i){super(),this.disposeVar(new Ee(e.sceneObjectChanged,()=>{let s;i.debug&&console.log("正在获取Event事件...");const o=e.sceneObject;if(o&&t){const a=t.split(".");if(a.length===0)i.debug&&console.warn("propNames.length === 0");else{let u=gh(o,!1,...a);(!u||!(u instanceof O))&&(a[a.length-1]=a[a.length-1]+"Changed",i.debug&&console.warn(`event未能获取,那么将属性名的最后一项加上Changed(${a[a.length-1]})再试试!`),u=gh(o,!1,...a),i.debug&&u&&console.warn("event仍然获取不到!")),u?u instanceof O?(s=u,i.debug&&console.log(`Event获取成功 propChangedName: ${t}`,s)):i.debug&&console.warn(`the prop is not event from ${o.id}-${o.name}-${o.ref}-${t}`):i.debug&&console.warn(`cannot get changed from ${o.id}-${o.name}-${o.ref}-${t}`)}}if(s){const a=new V;return a.d(s.dwon(()=>n.emit())),a}else{i.debug&&console.log(`未获取到Event!propChangedName: ${t}`);return}}))}}const Ug=Object.freeze(Object.defineProperty({__proto__:null,WatcherObjects:class extends V{constructor(t,n,i){super();d(this,"_doEvalEvent",this.dv(new O));const s=this._doEvalEvent,o=this.disposeVar(Ie(s)),a=t.map(([u,l])=>{const c=new qh(u),h=l&&new Iw(c,l,s,n)||void 0;return[c,h]});this.d(()=>{a.forEach(([u,l])=>{l==null||l.destroy(),u.destroy()}),a.length=0}),this.d(s.don(()=>{const{evalMode:u="NextAnimateFrame",evalOnlyWhenObjsAllExist:l=!0}=n;if(u==="Immediate"){const c=a.map(([h])=>h.sceneObject);(!l||c.every(h=>h!==void 0))&&i(c)}})),this.d(o.don(()=>{const{evalMode:u="NextAnimateFrame",evalOnlyWhenObjsAllExist:l=!0}=n;if(u==="NextAnimateFrame"){const c=a.map(([h])=>h.sceneObject);(!l||c.every(h=>h!==void 0))&&i(c)}}))}forceExecute(){this._doEvalEvent.emit()}}},Symbol.toStringTag,{value:"Module"})),{WatcherObjects:xw}=Ug;class Au extends V{constructor(){super();d(this,"_evalFunc");d(this,"_forceExecute",new O);const t=this.dv(j(void 0)),n=()=>{try{t.value=this.evalFuncStr&&Function('"use strict";return ('+this.evalFuncStr+")")(),this.debug&&console.log("evalFunc成功构建",t.value)}catch(o){console.error(`evalFunc get error! ${o}`),t.value=void 0}};n(),this.dispose(this.evalFuncStrChanged.disposableOn(n));const i=o=>{this.enabled&&(this.debug&&console.log("执行evalFunc..."),this._evalFunc&&this._evalFunc(o),t.value&&t.value(o))},s=this.disposeVar(new Ee(this.objIdAndPropChangedNamesChanged,()=>{if(this.objIdAndPropChangedNames.length>0)return this.debug&&console.log("监视对象发生变化,重新创建WatcherObjects"),new xw(this.objIdAndPropChangedNames,this,i)}));this.dispose(this._forceExecute.disposableOn(()=>{var o;(o=s.obj)==null||o.forceExecute()}))}get evalFunc(){return this._evalFunc}set evalFunc(t){this._evalFunc=t}forceExecute(){this._forceExecute.emit()}}(r=>{r.createDefaultProps=()=>({enabled:!1,objIdAndPropChangedNames:Ol([],(e,t)=>e[0]===t[0]&&e[1]===t[1],e=>[e[0],e[1]]),evalFuncStr:"",evalMode:"NextAnimateFrame",evalOnlyWhenObjsAllExist:!0,debug:!1,name:"未命名场景对象",ref:void 0,extras:wt(void 0),devTags:re(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})})(Au||(Au={})),Gi(Au.prototype,Au.createDefaultProps);const Gg=gp("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=geocent +datum=WGS84");function Vr(r){return Gg.forward(r)}function Xh(r){return Gg.inverse(r)}const Wg=gp("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");function Tw(r){const e=Wg.forward([r[0],r[1]]);return[e[0],e[1],r[2]]}function Ow(r){const e=Wg.inverse([r[0],r[1]]);return[e[0],e[1],r[2]]}function Nw(r,e){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1])&&r.push(r[0]);const t=Qe.point(e),n=Qe.polygon([r]);return Qe.booleanPointInPolygon(t,n)}var tn=63710088e-1,Hg={centimeters:tn*100,centimetres:tn*100,degrees:tn/111325,feet:tn*3.28084,inches:tn*39.37,kilometers:tn/1e3,kilometres:tn/1e3,meters:tn,metres:tn,miles:tn/1609.344,millimeters:tn*1e3,millimetres:tn*1e3,nauticalmiles:tn/1852,radians:1,yards:tn*1.0936};function jr(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}function Jt(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!qg(r[0])||!qg(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return jr(n,e,t)}function Pn(r,e,t){t===void 0&&(t={});for(var n=0,i=r;n<i.length;n++){var s=i[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<s[s.length-1].length;o++)if(s[s.length-1][o]!==s[0][o])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:r};return jr(a,e,t)}function Br(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return jr(n,e,t)}function oa(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}function Yh(r,e,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:r};return jr(n,e,t)}function Jh(r,e){e===void 0&&(e="kilometers");var t=Hg[e];if(!t)throw new Error(e+" units is invalid");return r*t}function $h(r,e){e===void 0&&(e="kilometers");var t=Hg[e];if(!t)throw new Error(e+" units is invalid");return r/t}function Yl(r){var e=r%(2*Math.PI);return e*180/Math.PI}function hn(r){var e=r%360;return e*Math.PI/180}function Kh(r,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Jh($h(r,e),t)}function qg(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function In(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function so(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Xg(r,e,t){if(!r)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!r.geometry||r.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+r.geometry.type)}function Jn(r){return r.type==="Feature"?r.geometry:r}function Dw(r,e){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function ku(r,e,t){if(t===void 0&&(t={}),t.final===!0)return Mw(r,e);var n=In(r),i=In(e),s=hn(n[0]),o=hn(i[0]),a=hn(n[1]),u=hn(i[1]),l=Math.sin(o-s)*Math.cos(u),c=Math.cos(a)*Math.sin(u)-Math.sin(a)*Math.cos(u)*Math.cos(o-s);return Yl(Math.atan2(l,c))}function Mw(r,e){var t=ku(e,r);return t=(t+180)%360,t}function aa(r,e,t,n){n===void 0&&(n={});var i=In(r),s=hn(i[0]),o=hn(i[1]),a=hn(t),u=$h(e,n.units),l=Math.asin(Math.sin(o)*Math.cos(u)+Math.cos(o)*Math.sin(u)*Math.cos(a)),c=s+Math.atan2(Math.sin(a)*Math.sin(u)*Math.cos(o),Math.cos(u)-Math.sin(o)*Math.sin(l)),h=Yl(c),f=Yl(l);return Jt([h,f],n.properties)}function Xi(r,e,t){t===void 0&&(t={});var n=In(r),i=In(e),s=hn(i[1]-n[1]),o=hn(i[0]-n[0]),a=hn(n[1]),u=hn(i[1]),l=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(a)*Math.cos(u);return Jh(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),t.units)}function Rw(r,e,t){t===void 0&&(t={});for(var n=Jn(r),i=n.coordinates,s=0,o=0;o<i.length&&!(e>=s&&o===i.length-1);o++)if(s>=e){var a=e-s;if(a){var u=ku(i[o],i[o-1])-180,l=aa(i[o],a,u,t);return l}else return Jt(i[o])}else s+=Xi(i[o],i[o+1],t);return Jt(i[i.length-1])}function Lw(r,e){const t=Br(r);return Rw(t,e,{units:"meters"}).geometry.coordinates}function ua(r,e,t){if(r!==null)for(var n,i,s,o,a,u,l,c=0,h=0,f,p=r.type,v=p==="FeatureCollection",C=p==="Feature",S=v?r.features.length:1,P=0;P<S;P++){l=v?r.features[P].geometry:C?r.geometry:r,f=l?l.type==="GeometryCollection":!1,a=f?l.geometries.length:1;for(var y=0;y<a;y++){var _=0,m=0;if(o=f?l.geometries[y]:l,o!==null){u=o.coordinates;var w=o.type;switch(c=t&&(w==="Polygon"||w==="MultiPolygon")?1:0,w){case null:break;case"Point":if(e(u,h,P,_,m)===!1)return!1;h++,_++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(e(u[n],h,P,_,m)===!1)return!1;h++,w==="MultiPoint"&&_++}w==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-c;i++){if(e(u[n][i],h,P,_,m)===!1)return!1;h++}w==="MultiLineString"&&_++,w==="Polygon"&&m++}w==="Polygon"&&_++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(m=0,i=0;i<u[n].length;i++){for(s=0;s<u[n][i].length-c;s++){if(e(u[n][i][s],h,P,_,m)===!1)return!1;h++}m++}_++}break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(ua(o.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Jl(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}function $l(r,e){var t,n,i,s,o,a,u,l,c,h,f=0,p=r.type==="FeatureCollection",v=r.type==="Feature",C=p?r.features.length:1;for(t=0;t<C;t++){for(a=p?r.features[t].geometry:v?r.geometry:r,l=p?r.features[t].properties:v?r.properties:{},c=p?r.features[t].bbox:v?r.bbox:void 0,h=p?r.features[t].id:v?r.id:void 0,u=a?a.type==="GeometryCollection":!1,o=u?a.geometries.length:1,i=0;i<o;i++){if(s=u?a.geometries[i]:a,s===null){if(e(null,f,l,c,h)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(s,f,l,c,h)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(e(s.geometries[n],f,l,c,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Fw(r,e,t){var n=t;return $l(r,function(i,s,o,a,u){n=e(n,i,s,o,a,u)}),n}function Zh(r,e){$l(r,function(t,n,i,s,o){var a=t===null?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return e(jr(t,i,{bbox:s,id:o}),n,0)===!1?!1:void 0}var u;switch(a){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var l=0;l<t.coordinates.length;l++){var c=t.coordinates[l],h={type:u,coordinates:c};if(e(jr(h,i),n,l)===!1)return!1}})}function Aw(r,e){Zh(r,function(t,n,i){var s=0;if(t.geometry){var o=t.geometry.type;if(!(o==="Point"||o==="MultiPoint")){var a,u=0,l=0,c=0;if(ua(t,function(h,f,p,v,C){if(a===void 0||n>u||v>l||C>c){a=h,u=n,l=v,c=C,s=0;return}var S=Br([a,h],t.properties);if(e(S,n,i,C,s)===!1)return!1;s++,a=h})===!1)return!1}}})}var Yg=6378137;function kw(r){return Fw(r,function(e,t){return e+Vw(t)},0)}function Vw(r){var e=0,t;switch(r.type){case"Polygon":return Jg(r.coordinates);case"MultiPolygon":for(t=0;t<r.coordinates.length;t++)e+=Jg(r.coordinates[t]);return e;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function Jg(r){var e=0;if(r&&r.length>0){e+=Math.abs($g(r[0]));for(var t=1;t<r.length;t++)e-=Math.abs($g(r[t]))}return e}function $g(r){var e,t,n,i,s,o,a,u=0,l=r.length;if(l>2){for(a=0;a<l;a++)a===l-2?(i=l-2,s=l-1,o=0):a===l-1?(i=l-1,s=0,o=1):(i=a,s=a+1,o=a+2),e=r[i],t=r[s],n=r[o],u+=(Qh(n[0])-Qh(e[0]))*Math.sin(Qh(t[1]));u=u*Yg*Yg/2}return u}function Qh(r){return r*Math.PI/180}function td(r){if((r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),r.length<=3)return 0;const e=Pn([r]);return kw(e)}var Kl={exports:{}},Zl={exports:{}},jw=Zl.exports,Kg;function Zg(){return Kg||(Kg=1,function(r,e){(function(t,n){r.exports=n()})(jw,function(){function t(y,_,m,w,E){(function b(I,T,D,x,N){for(;x>D;){if(x-D>600){var L=x-D+1,A=T-D+1,J=Math.log(L),H=.5*Math.exp(2*J/3),Z=.5*Math.sqrt(J*H*(L-H)/L)*(A-L/2<0?-1:1),ct=Math.max(D,Math.floor(T-A*H/L+Z)),mt=Math.min(x,Math.floor(T+(L-A)*H/L+Z));b(I,T,ct,mt,N)}var Y=I[T],$=D,K=x;for(n(I,D,T),N(I[x],Y)>0&&n(I,D,x);$<K;){for(n(I,$,K),$++,K--;N(I[$],Y)<0;)$++;for(;N(I[K],Y)>0;)K--}N(I[D],Y)===0?n(I,D,K):n(I,++K,x),K<=T&&(D=K+1),T<=K&&(x=K-1)}})(y,_,m||0,w||y.length-1,E||i)}function n(y,_,m){var w=y[_];y[_]=y[m],y[m]=w}function i(y,_){return y<_?-1:y>_?1:0}var s=function(y){y===void 0&&(y=9),this._maxEntries=Math.max(4,y),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(y,_,m){if(!m)return _.indexOf(y);for(var w=0;w<_.length;w++)if(m(y,_[w]))return w;return-1}function a(y,_){u(y,0,y.children.length,_,y)}function u(y,_,m,w,E){E||(E=S(null)),E.minX=1/0,E.minY=1/0,E.maxX=-1/0,E.maxY=-1/0;for(var b=_;b<m;b++){var I=y.children[b];l(E,y.leaf?w(I):I)}return E}function l(y,_){return y.minX=Math.min(y.minX,_.minX),y.minY=Math.min(y.minY,_.minY),y.maxX=Math.max(y.maxX,_.maxX),y.maxY=Math.max(y.maxY,_.maxY),y}function c(y,_){return y.minX-_.minX}function h(y,_){return y.minY-_.minY}function f(y){return(y.maxX-y.minX)*(y.maxY-y.minY)}function p(y){return y.maxX-y.minX+(y.maxY-y.minY)}function v(y,_){return y.minX<=_.minX&&y.minY<=_.minY&&_.maxX<=y.maxX&&_.maxY<=y.maxY}function C(y,_){return _.minX<=y.maxX&&_.minY<=y.maxY&&_.maxX>=y.minX&&_.maxY>=y.minY}function S(y){return{children:y,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(y,_,m,w,E){for(var b=[_,m];b.length;)if(!((m=b.pop())-(_=b.pop())<=w)){var I=_+Math.ceil((m-_)/w/2)*w;t(y,I,_,m,E),b.push(_,I,I,m)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(y){var _=this.data,m=[];if(!C(y,_))return m;for(var w=this.toBBox,E=[];_;){for(var b=0;b<_.children.length;b++){var I=_.children[b],T=_.leaf?w(I):I;C(y,T)&&(_.leaf?m.push(I):v(y,T)?this._all(I,m):E.push(I))}_=E.pop()}return m},s.prototype.collides=function(y){var _=this.data;if(!C(y,_))return!1;for(var m=[];_;){for(var w=0;w<_.children.length;w++){var E=_.children[w],b=_.leaf?this.toBBox(E):E;if(C(y,b)){if(_.leaf||v(y,b))return!0;m.push(E)}}_=m.pop()}return!1},s.prototype.load=function(y){if(!y||!y.length)return this;if(y.length<this._minEntries){for(var _=0;_<y.length;_++)this.insert(y[_]);return this}var m=this._build(y.slice(),0,y.length-1,0);if(this.data.children.length)if(this.data.height===m.height)this._splitRoot(this.data,m);else{if(this.data.height<m.height){var w=this.data;this.data=m,m=w}this._insert(m,this.data.height-m.height-1,!0)}else this.data=m;return this},s.prototype.insert=function(y){return y&&this._insert(y,this.data.height-1),this},s.prototype.clear=function(){return this.data=S([]),this},s.prototype.remove=function(y,_){if(!y)return this;for(var m,w,E,b=this.data,I=this.toBBox(y),T=[],D=[];b||T.length;){if(b||(b=T.pop(),w=T[T.length-1],m=D.pop(),E=!0),b.leaf){var x=o(y,b.children,_);if(x!==-1)return b.children.splice(x,1),T.push(b),this._condense(T),this}E||b.leaf||!v(b,I)?w?(m++,b=w.children[m],E=!1):b=null:(T.push(b),D.push(m),m=0,w=b,b=b.children[0])}return this},s.prototype.toBBox=function(y){return y},s.prototype.compareMinX=function(y,_){return y.minX-_.minX},s.prototype.compareMinY=function(y,_){return y.minY-_.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(y){return this.data=y,this},s.prototype._all=function(y,_){for(var m=[];y;)y.leaf?_.push.apply(_,y.children):m.push.apply(m,y.children),y=m.pop();return _},s.prototype._build=function(y,_,m,w){var E,b=m-_+1,I=this._maxEntries;if(b<=I)return a(E=S(y.slice(_,m+1)),this.toBBox),E;w||(w=Math.ceil(Math.log(b)/Math.log(I)),I=Math.ceil(b/Math.pow(I,w-1))),(E=S([])).leaf=!1,E.height=w;var T=Math.ceil(b/I),D=T*Math.ceil(Math.sqrt(I));P(y,_,m,D,this.compareMinX);for(var x=_;x<=m;x+=D){var N=Math.min(x+D-1,m);P(y,x,N,T,this.compareMinY);for(var L=x;L<=N;L+=T){var A=Math.min(L+T-1,N);E.children.push(this._build(y,L,A,w-1))}}return a(E,this.toBBox),E},s.prototype._chooseSubtree=function(y,_,m,w){for(;w.push(_),!_.leaf&&w.length-1!==m;){for(var E=1/0,b=1/0,I=void 0,T=0;T<_.children.length;T++){var D=_.children[T],x=f(D),N=(L=y,A=D,(Math.max(A.maxX,L.maxX)-Math.min(A.minX,L.minX))*(Math.max(A.maxY,L.maxY)-Math.min(A.minY,L.minY))-x);N<b?(b=N,E=x<E?x:E,I=D):N===b&&x<E&&(E=x,I=D)}_=I||_.children[0]}var L,A;return _},s.prototype._insert=function(y,_,m){var w=m?y:this.toBBox(y),E=[],b=this._chooseSubtree(w,this.data,_,E);for(b.children.push(y),l(b,w);_>=0&&E[_].children.length>this._maxEntries;)this._split(E,_),_--;this._adjustParentBBoxes(w,E,_)},s.prototype._split=function(y,_){var m=y[_],w=m.children.length,E=this._minEntries;this._chooseSplitAxis(m,E,w);var b=this._chooseSplitIndex(m,E,w),I=S(m.children.splice(b,m.children.length-b));I.height=m.height,I.leaf=m.leaf,a(m,this.toBBox),a(I,this.toBBox),_?y[_-1].children.push(I):this._splitRoot(m,I)},s.prototype._splitRoot=function(y,_){this.data=S([y,_]),this.data.height=y.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(y,_,m){for(var w,E,b,I,T,D,x,N=1/0,L=1/0,A=_;A<=m-_;A++){var J=u(y,0,A,this.toBBox),H=u(y,A,m,this.toBBox),Z=(E=J,b=H,I=void 0,T=void 0,D=void 0,x=void 0,I=Math.max(E.minX,b.minX),T=Math.max(E.minY,b.minY),D=Math.min(E.maxX,b.maxX),x=Math.min(E.maxY,b.maxY),Math.max(0,D-I)*Math.max(0,x-T)),ct=f(J)+f(H);Z<N?(N=Z,w=A,L=ct<L?ct:L):Z===N&&ct<L&&(L=ct,w=A)}return w||m-_},s.prototype._chooseSplitAxis=function(y,_,m){var w=y.leaf?this.compareMinX:c,E=y.leaf?this.compareMinY:h;this._allDistMargin(y,_,m,w)<this._allDistMargin(y,_,m,E)&&y.children.sort(w)},s.prototype._allDistMargin=function(y,_,m,w){y.children.sort(w);for(var E=this.toBBox,b=u(y,0,_,E),I=u(y,m-_,m,E),T=p(b)+p(I),D=_;D<m-_;D++){var x=y.children[D];l(b,y.leaf?E(x):x),T+=p(b)}for(var N=m-_-1;N>=_;N--){var L=y.children[N];l(I,y.leaf?E(L):L),T+=p(I)}return T},s.prototype._adjustParentBBoxes=function(y,_,m){for(var w=m;w>=0;w--)l(_[w],y)},s.prototype._condense=function(y){for(var _=y.length-1,m=void 0;_>=0;_--)y[_].children.length===0?_>0?(m=y[_-1].children).splice(m.indexOf(y[_]),1):this.clear():a(y[_],this.toBBox)},s})}(Zl)),Zl.exports}class Bw{constructor(e=[],t=zw){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:n}=this,i=t[e];for(;e>0;){const s=e-1>>1,o=t[s];if(n(i,o)>=0)break;t[e]=o,e=s}t[e]=i}_down(e){const{data:t,compare:n}=this,i=this.length>>1,s=t[e];for(;e<i;){let o=(e<<1)+1,a=t[o];const u=o+1;if(u<this.length&&n(t[u],a)<0&&(o=u,a=t[u]),n(a,s)>=0)break;t[e]=a,e=o}t[e]=s}}function zw(r,e){return r<e?-1:r>e?1:0}const Uw=b0(Object.freeze(Object.defineProperty({__proto__:null,default:Bw},Symbol.toStringTag,{value:"Module"})));var Vu={exports:{}},ed,Qg;function Gw(){return Qg||(Qg=1,ed=function(e,t,n,i){var s=e[0],o=e[1],a=!1;n===void 0&&(n=0),i===void 0&&(i=t.length);for(var u=(i-n)/2,l=0,c=u-1;l<u;c=l++){var h=t[n+l*2+0],f=t[n+l*2+1],p=t[n+c*2+0],v=t[n+c*2+1],C=f>o!=v>o&&s<(p-h)*(o-f)/(v-f)+h;C&&(a=!a)}return a}),ed}var nd,tm;function Ww(){return tm||(tm=1,nd=function(e,t,n,i){var s=e[0],o=e[1],a=!1;n===void 0&&(n=0),i===void 0&&(i=t.length);for(var u=i-n,l=0,c=u-1;l<u;c=l++){var h=t[l+n][0],f=t[l+n][1],p=t[c+n][0],v=t[c+n][1],C=f>o!=v>o&&s<(p-h)*(o-f)/(v-f)+h;C&&(a=!a)}return a}),nd}var em;function Hw(){if(em)return Vu.exports;em=1;var r=Gw(),e=Ww();return Vu.exports=function(n,i,s,o){return i.length>0&&Array.isArray(i[0])?e(n,i,s,o):r(n,i,s,o)},Vu.exports.nested=e,Vu.exports.flat=r,Vu.exports}var ju={exports:{}},qw=ju.exports,nm;function Xw(){return nm||(nm=1,function(r,e){(function(t,n){n(e)})(qw,function(t){const i=33306690738754706e-32;function s(C,S,P,y,_){let m,w,E,b,I=S[0],T=y[0],D=0,x=0;T>I==T>-I?(m=I,I=S[++D]):(m=T,T=y[++x]);let N=0;if(D<C&&x<P)for(T>I==T>-I?(E=m-((w=I+m)-I),I=S[++D]):(E=m-((w=T+m)-T),T=y[++x]),m=w,E!==0&&(_[N++]=E);D<C&&x<P;)T>I==T>-I?(E=m-((w=m+I)-(b=w-m))+(I-b),I=S[++D]):(E=m-((w=m+T)-(b=w-m))+(T-b),T=y[++x]),m=w,E!==0&&(_[N++]=E);for(;D<C;)E=m-((w=m+I)-(b=w-m))+(I-b),I=S[++D],m=w,E!==0&&(_[N++]=E);for(;x<P;)E=m-((w=m+T)-(b=w-m))+(T-b),T=y[++x],m=w,E!==0&&(_[N++]=E);return m===0&&N!==0||(_[N++]=m),N}function o(C){return new Float64Array(C)}const a=33306690738754716e-32,u=22204460492503146e-32,l=11093356479670487e-47,c=o(4),h=o(8),f=o(12),p=o(16),v=o(4);t.orient2d=function(C,S,P,y,_,m){const w=(S-m)*(P-_),E=(C-_)*(y-m),b=w-E;if(w===0||E===0||w>0!=E>0)return b;const I=Math.abs(w+E);return Math.abs(b)>=a*I?b:-function(T,D,x,N,L,A,J){let H,Z,ct,mt,Y,$,K,Et,kt,Nt,Dt,zt,ye,Zt,Sn,bn,z,G;const ft=T-L,Vt=x-L,ne=D-A,we=N-A;Y=(Sn=(Et=ft-(K=($=134217729*ft)-($-ft)))*(Nt=we-(kt=($=134217729*we)-($-we)))-((Zt=ft*we)-K*kt-Et*kt-K*Nt))-(Dt=Sn-(z=(Et=ne-(K=($=134217729*ne)-($-ne)))*(Nt=Vt-(kt=($=134217729*Vt)-($-Vt)))-((bn=ne*Vt)-K*kt-Et*kt-K*Nt))),c[0]=Sn-(Dt+Y)+(Y-z),Y=(ye=Zt-((zt=Zt+Dt)-(Y=zt-Zt))+(Dt-Y))-(Dt=ye-bn),c[1]=ye-(Dt+Y)+(Y-bn),Y=(G=zt+Dt)-zt,c[2]=zt-(G-Y)+(Dt-Y),c[3]=G;let Ks=function(Wb,Xy){let Yy=Xy[0];for(let pp=1;pp<Wb;pp++)Yy+=Xy[pp];return Yy}(4,c),xl=u*J;if(Ks>=xl||-Ks>=xl||(H=T-(ft+(Y=T-ft))+(Y-L),ct=x-(Vt+(Y=x-Vt))+(Y-L),Z=D-(ne+(Y=D-ne))+(Y-A),mt=N-(we+(Y=N-we))+(Y-A),H===0&&Z===0&&ct===0&&mt===0)||(xl=l*J+i*Math.abs(Ks),(Ks+=ft*mt+we*H-(ne*ct+Vt*Z))>=xl||-Ks>=xl))return Ks;Y=(Sn=(Et=H-(K=($=134217729*H)-($-H)))*(Nt=we-(kt=($=134217729*we)-($-we)))-((Zt=H*we)-K*kt-Et*kt-K*Nt))-(Dt=Sn-(z=(Et=Z-(K=($=134217729*Z)-($-Z)))*(Nt=Vt-(kt=($=134217729*Vt)-($-Vt)))-((bn=Z*Vt)-K*kt-Et*kt-K*Nt))),v[0]=Sn-(Dt+Y)+(Y-z),Y=(ye=Zt-((zt=Zt+Dt)-(Y=zt-Zt))+(Dt-Y))-(Dt=ye-bn),v[1]=ye-(Dt+Y)+(Y-bn),Y=(G=zt+Dt)-zt,v[2]=zt-(G-Y)+(Dt-Y),v[3]=G;const zb=s(4,c,4,v,h);Y=(Sn=(Et=ft-(K=($=134217729*ft)-($-ft)))*(Nt=mt-(kt=($=134217729*mt)-($-mt)))-((Zt=ft*mt)-K*kt-Et*kt-K*Nt))-(Dt=Sn-(z=(Et=ne-(K=($=134217729*ne)-($-ne)))*(Nt=ct-(kt=($=134217729*ct)-($-ct)))-((bn=ne*ct)-K*kt-Et*kt-K*Nt))),v[0]=Sn-(Dt+Y)+(Y-z),Y=(ye=Zt-((zt=Zt+Dt)-(Y=zt-Zt))+(Dt-Y))-(Dt=ye-bn),v[1]=ye-(Dt+Y)+(Y-bn),Y=(G=zt+Dt)-zt,v[2]=zt-(G-Y)+(Dt-Y),v[3]=G;const Ub=s(zb,h,4,v,f);Y=(Sn=(Et=H-(K=($=134217729*H)-($-H)))*(Nt=mt-(kt=($=134217729*mt)-($-mt)))-((Zt=H*mt)-K*kt-Et*kt-K*Nt))-(Dt=Sn-(z=(Et=Z-(K=($=134217729*Z)-($-Z)))*(Nt=ct-(kt=($=134217729*ct)-($-ct)))-((bn=Z*ct)-K*kt-Et*kt-K*Nt))),v[0]=Sn-(Dt+Y)+(Y-z),Y=(ye=Zt-((zt=Zt+Dt)-(Y=zt-Zt))+(Dt-Y))-(Dt=ye-bn),v[1]=ye-(Dt+Y)+(Y-bn),Y=(G=zt+Dt)-zt,v[2]=zt-(G-Y)+(Dt-Y),v[3]=G;const Gb=s(Ub,f,4,v,p);return p[Gb-1]}(C,S,P,y,_,m,I)},t.orient2dfast=function(C,S,P,y,_,m){return(S-m)*(P-_)-(C-_)*(y-m)},Object.defineProperty(t,"__esModule",{value:!0})})}(ju,ju.exports)),ju.exports}var rm;function Yw(){if(rm)return Kl.exports;rm=1;var r=Zg(),e=Uw,t=Hw(),n=Xw().orient2d;e.default&&(e=e.default),Kl.exports=i,Kl.exports.default=i;function i(m,w,E){w=Math.max(0,w===void 0?2:w),E=E||0;var b=p(m),I=new r(16);I.toBBox=function(K){return{minX:K[0],minY:K[1],maxX:K[0],maxY:K[1]}},I.compareMinX=function(K,Et){return K[0]-Et[0]},I.compareMinY=function(K,Et){return K[1]-Et[1]},I.load(m);for(var T=[],D=0,x;D<b.length;D++){var N=b[D];I.remove(N),x=v(N,x),T.push(x)}var L=new r(16);for(D=0;D<T.length;D++)L.insert(f(T[D]));for(var A=w*w,J=E*E;T.length;){var H=T.shift(),Z=H.p,ct=H.next.p,mt=C(Z,ct);if(!(mt<J)){var Y=mt/A;N=s(I,H.prev.p,Z,ct,H.next.next.p,Y,L),N&&Math.min(C(N,Z),C(N,ct))<=Y&&(T.push(H),T.push(v(N,H)),I.remove(N),L.remove(H),L.insert(f(H)),L.insert(f(H.next)))}}H=x;var $=[];do $.push(H.p),H=H.next;while(H!==x);return $.push(H.p),$}function s(m,w,E,b,I,T,D){for(var x=new e([],o),N=m.data;N;){for(var L=0;L<N.children.length;L++){var A=N.children[L],J=N.leaf?S(A,E,b):a(E,b,A);J>T||x.push({node:A,dist:J})}for(;x.length&&!x.peek().node.children;){var H=x.pop(),Z=H.node,ct=S(Z,w,E),mt=S(Z,b,I);if(H.dist<ct&&H.dist<mt&&l(E,Z,D)&&l(b,Z,D))return Z}N=x.pop(),N&&(N=N.node)}return null}function o(m,w){return m.dist-w.dist}function a(m,w,E){if(u(m,E)||u(w,E))return 0;var b=P(m[0],m[1],w[0],w[1],E.minX,E.minY,E.maxX,E.minY);if(b===0)return 0;var I=P(m[0],m[1],w[0],w[1],E.minX,E.minY,E.minX,E.maxY);if(I===0)return 0;var T=P(m[0],m[1],w[0],w[1],E.maxX,E.minY,E.maxX,E.maxY);if(T===0)return 0;var D=P(m[0],m[1],w[0],w[1],E.minX,E.maxY,E.maxX,E.maxY);return D===0?0:Math.min(b,I,T,D)}function u(m,w){return m[0]>=w.minX&&m[0]<=w.maxX&&m[1]>=w.minY&&m[1]<=w.maxY}function l(m,w,E){for(var b=Math.min(m[0],w[0]),I=Math.min(m[1],w[1]),T=Math.max(m[0],w[0]),D=Math.max(m[1],w[1]),x=E.search({minX:b,minY:I,maxX:T,maxY:D}),N=0;N<x.length;N++)if(h(x[N].p,x[N].next.p,m,w))return!1;return!0}function c(m,w,E){return n(m[0],m[1],w[0],w[1],E[0],E[1])}function h(m,w,E,b){return m!==b&&w!==E&&c(m,w,E)>0!=c(m,w,b)>0&&c(E,b,m)>0!=c(E,b,w)>0}function f(m){var w=m.p,E=m.next.p;return m.minX=Math.min(w[0],E[0]),m.minY=Math.min(w[1],E[1]),m.maxX=Math.max(w[0],E[0]),m.maxY=Math.max(w[1],E[1]),m}function p(m){for(var w=m[0],E=m[0],b=m[0],I=m[0],T=0;T<m.length;T++){var D=m[T];D[0]<w[0]&&(w=D),D[0]>b[0]&&(b=D),D[1]<E[1]&&(E=D),D[1]>I[1]&&(I=D)}var x=[w,E,b,I],N=x.slice();for(T=0;T<m.length;T++)t(m[T],x)||N.push(m[T]);return _(N)}function v(m,w){var E={p:m,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return w?(E.next=w.next,E.prev=w,w.next.prev=E,w.next=E):(E.prev=E,E.next=E),E}function C(m,w){var E=m[0]-w[0],b=m[1]-w[1];return E*E+b*b}function S(m,w,E){var b=w[0],I=w[1],T=E[0]-b,D=E[1]-I;if(T!==0||D!==0){var x=((m[0]-b)*T+(m[1]-I)*D)/(T*T+D*D);x>1?(b=E[0],I=E[1]):x>0&&(b+=T*x,I+=D*x)}return T=m[0]-b,D=m[1]-I,T*T+D*D}function P(m,w,E,b,I,T,D,x){var N=E-m,L=b-w,A=D-I,J=x-T,H=m-I,Z=w-T,ct=N*N+L*L,mt=N*A+L*J,Y=A*A+J*J,$=N*H+L*Z,K=A*H+J*Z,Et=ct*Y-mt*mt,kt,Nt,Dt,zt,ye=Et,Zt=Et;Et===0?(Nt=0,ye=1,zt=K,Zt=Y):(Nt=mt*K-Y*$,zt=ct*K-mt*$,Nt<0?(Nt=0,zt=K,Zt=Y):Nt>ye&&(Nt=ye,zt=K+mt,Zt=Y)),zt<0?(zt=0,-$<0?Nt=0:-$>ct?Nt=ye:(Nt=-$,ye=ct)):zt>Zt&&(zt=Zt,-$+mt<0?Nt=0:-$+mt>ct?Nt=ye:(Nt=-$+mt,ye=ct)),kt=Nt===0?0:Nt/ye,Dt=zt===0?0:zt/Zt;var Sn=(1-kt)*m+kt*E,bn=(1-kt)*w+kt*b,z=(1-Dt)*I+Dt*D,G=(1-Dt)*T+Dt*x,ft=z-Sn,Vt=G-bn;return ft*ft+Vt*Vt}function y(m,w){return m[0]===w[0]?m[1]-w[1]:m[0]-w[0]}function _(m){m.sort(y);for(var w=[],E=0;E<m.length;E++){for(;w.length>=2&&c(w[w.length-2],w[w.length-1],m[E])<=0;)w.pop();w.push(m[E])}for(var b=[],I=m.length-1;I>=0;I--){for(;b.length>=2&&c(b[b.length-2],b[b.length-1],m[I])<=0;)b.pop();b.push(m[I])}return b.pop(),w.pop(),w.concat(b)}return Kl.exports}var Jw=Yw();const $w=Vh(Jw);function Kw(r,e){e===void 0&&(e={}),e.concavity=e.concavity||1/0;var t=[];if(ua(r,function(i){t.push([i[0],i[1]])}),!t.length)return null;var n=$w(t,e.concavity);return n.length>3?Pn([n]):null}function im(r,e){e===void 0&&(e={});var t=0,n=0,i=0;return ua(r,function(s){t+=s[0],n+=s[1],i++},!0),Jt([t/i,n/i],e.properties)}function sm(r,e){switch(e===void 0&&(e={}),Dw(r)){case"Point":return Jt(In(r),e.properties);case"Polygon":var t=[];ua(r,function(m){t.push(m)});var n=im(r,{properties:e.properties}),i=n.geometry.coordinates,s=0,o=0,a=0,u,l,c,h,f,p,v,C,S=t.map(function(m){return[m[0]-i[0],m[1]-i[1]]});for(u=0;u<t.length-1;u++)l=S[u],h=l[0],p=l[1],c=S[u+1],f=c[0],v=c[1],C=h*v-f*p,a+=C,s+=(h+f)*C,o+=(p+v)*C;if(a===0)return n;var P=a*.5,y=1/(6*P);return Jt([i[0]+y*s,i[1]+y*o],e.properties);default:var _=Kw(r);return _?sm(_,{properties:e.properties}):im(r,{properties:e.properties})}}function Zw(r){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]);const e=Pn([r]),n=sm(e).geometry.coordinates;return[n[0],n[1],n[2]??r[0][2]??0]}function om(r,e,t,n){const[i,s,o]=r,a=aa(Jt([i,s]),e,t,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return n=n||[0,0,0],n[0]=a.geometry.coordinates[0],n[1]=a.geometry.coordinates[1],n[2]=o,n}function Ql(r,e){return Xi(Jt(r),Jt(e),{units:"meters"})}function Bu(r,e){return ku(Jt(r),Jt(e))}function am(r){if(!r)throw new Error("geojson is required");var e=[];return Zh(r,function(t){Qw(t,e)}),oa(e)}function Qw(r,e){var t=[],n=r.geometry;if(n!==null){switch(n.type){case"Polygon":t=so(n);break;case"LineString":t=[so(n)]}t.forEach(function(i){var s=tE(i,r.properties);s.forEach(function(o){o.id=e.length,e.push(o)})})}}function tE(r,e){var t=[];return r.reduce(function(n,i){var s=Br([n,i],e);return s.bbox=eE(n,i),t.push(s),i}),t}function eE(r,e){var t=r[0],n=r[1],i=e[0],s=e[1],o=t<i?t:i,a=n<s?n:s,u=t>i?t:i,l=n>s?n:s;return[o,a,u,l]}var tc={exports:{}},rd={},um;function lm(){return um||(um=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=63710088e-1,r.factors={centimeters:r.earthRadius*100,centimetres:r.earthRadius*100,degrees:r.earthRadius/111325,feet:r.earthRadius*3.28084,inches:r.earthRadius*39.37,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:r.earthRadius*1e3,millimetres:r.earthRadius*1e3,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius*1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1.0936133},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function e(x,N,L){L===void 0&&(L={});var A={type:"Feature"};return(L.id===0||L.id)&&(A.id=L.id),L.bbox&&(A.bbox=L.bbox),A.properties=N||{},A.geometry=x,A}r.feature=e;function t(x,N,L){switch(x){case"Point":return n(N).geometry;case"LineString":return a(N).geometry;case"Polygon":return s(N).geometry;case"MultiPoint":return h(N).geometry;case"MultiLineString":return c(N).geometry;case"MultiPolygon":return f(N).geometry;default:throw new Error(x+" is invalid")}}r.geometry=t;function n(x,N,L){if(L===void 0&&(L={}),!x)throw new Error("coordinates is required");if(!Array.isArray(x))throw new Error("coordinates must be an Array");if(x.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!b(x[0])||!b(x[1]))throw new Error("coordinates must contain numbers");var A={type:"Point",coordinates:x};return e(A,N,L)}r.point=n;function i(x,N,L){return L===void 0&&(L={}),l(x.map(function(A){return n(A,N)}),L)}r.points=i;function s(x,N,L){L===void 0&&(L={});for(var A=0,J=x;A<J.length;A++){var H=J[A];if(H.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var Z=0;Z<H[H.length-1].length;Z++)if(H[H.length-1][Z]!==H[0][Z])throw new Error("First and last Position are not equivalent.")}var ct={type:"Polygon",coordinates:x};return e(ct,N,L)}r.polygon=s;function o(x,N,L){return L===void 0&&(L={}),l(x.map(function(A){return s(A,N)}),L)}r.polygons=o;function a(x,N,L){if(L===void 0&&(L={}),x.length<2)throw new Error("coordinates must be an array of two or more positions");var A={type:"LineString",coordinates:x};return e(A,N,L)}r.lineString=a;function u(x,N,L){return L===void 0&&(L={}),l(x.map(function(A){return a(A,N)}),L)}r.lineStrings=u;function l(x,N){N===void 0&&(N={});var L={type:"FeatureCollection"};return N.id&&(L.id=N.id),N.bbox&&(L.bbox=N.bbox),L.features=x,L}r.featureCollection=l;function c(x,N,L){L===void 0&&(L={});var A={type:"MultiLineString",coordinates:x};return e(A,N,L)}r.multiLineString=c;function h(x,N,L){L===void 0&&(L={});var A={type:"MultiPoint",coordinates:x};return e(A,N,L)}r.multiPoint=h;function f(x,N,L){L===void 0&&(L={});var A={type:"MultiPolygon",coordinates:x};return e(A,N,L)}r.multiPolygon=f;function p(x,N,L){L===void 0&&(L={});var A={type:"GeometryCollection",geometries:x};return e(A,N,L)}r.geometryCollection=p;function v(x,N){if(N===void 0&&(N=0),N&&!(N>=0))throw new Error("precision must be a positive number");var L=Math.pow(10,N||0);return Math.round(x*L)/L}r.round=v;function C(x,N){N===void 0&&(N="kilometers");var L=r.factors[N];if(!L)throw new Error(N+" units is invalid");return x*L}r.radiansToLength=C;function S(x,N){N===void 0&&(N="kilometers");var L=r.factors[N];if(!L)throw new Error(N+" units is invalid");return x/L}r.lengthToRadians=S;function P(x,N){return _(S(x,N))}r.lengthToDegrees=P;function y(x){var N=x%360;return N<0&&(N+=360),N}r.bearingToAzimuth=y;function _(x){var N=x%(2*Math.PI);return N*180/Math.PI}r.radiansToDegrees=_;function m(x){var N=x%360;return N*Math.PI/180}r.degreesToRadians=m;function w(x,N,L){if(N===void 0&&(N="kilometers"),L===void 0&&(L="kilometers"),!(x>=0))throw new Error("length must be a positive number");return C(S(x,N),L)}r.convertLength=w;function E(x,N,L){if(N===void 0&&(N="meters"),L===void 0&&(L="kilometers"),!(x>=0))throw new Error("area must be a positive number");var A=r.areaFactors[N];if(!A)throw new Error("invalid original units");var J=r.areaFactors[L];if(!J)throw new Error("invalid final units");return x/A*J}r.convertArea=E;function b(x){return!isNaN(x)&&x!==null&&!Array.isArray(x)}r.isNumber=b;function I(x){return!!x&&x.constructor===Object}r.isObject=I;function T(x){if(!x)throw new Error("bbox is required");if(!Array.isArray(x))throw new Error("bbox must be an Array");if(x.length!==4&&x.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");x.forEach(function(N){if(!b(N))throw new Error("bbox must only contain numbers")})}r.validateBBox=T;function D(x){if(!x)throw new Error("id is required");if(["string","number"].indexOf(typeof x)===-1)throw new Error("id must be a number or a string")}r.validateId=D}(rd)),rd}var xe={},cm;function hm(){if(cm)return xe;cm=1,Object.defineProperty(xe,"__esModule",{value:!0});var r=lm();function e(y,_,m){if(y!==null)for(var w,E,b,I,T,D,x,N=0,L=0,A,J=y.type,H=J==="FeatureCollection",Z=J==="Feature",ct=H?y.features.length:1,mt=0;mt<ct;mt++){x=H?y.features[mt].geometry:Z?y.geometry:y,A=x?x.type==="GeometryCollection":!1,T=A?x.geometries.length:1;for(var Y=0;Y<T;Y++){var $=0,K=0;if(I=A?x.geometries[Y]:x,I!==null){D=I.coordinates;var Et=I.type;switch(N=m&&(Et==="Polygon"||Et==="MultiPolygon")?1:0,Et){case null:break;case"Point":if(_(D,L,mt,$,K)===!1)return!1;L++,$++;break;case"LineString":case"MultiPoint":for(w=0;w<D.length;w++){if(_(D[w],L,mt,$,K)===!1)return!1;L++,Et==="MultiPoint"&&$++}Et==="LineString"&&$++;break;case"Polygon":case"MultiLineString":for(w=0;w<D.length;w++){for(E=0;E<D[w].length-N;E++){if(_(D[w][E],L,mt,$,K)===!1)return!1;L++}Et==="MultiLineString"&&$++,Et==="Polygon"&&K++}Et==="Polygon"&&$++;break;case"MultiPolygon":for(w=0;w<D.length;w++){for(K=0,E=0;E<D[w].length;E++){for(b=0;b<D[w][E].length-N;b++){if(_(D[w][E][b],L,mt,$,K)===!1)return!1;L++}K++}$++}break;case"GeometryCollection":for(w=0;w<I.geometries.length;w++)if(e(I.geometries[w],_,m)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function t(y,_,m,w){var E=m;return e(y,function(b,I,T,D,x){I===0&&m===void 0?E=b:E=_(E,b,I,T,D,x)},w),E}function n(y,_){var m;switch(y.type){case"FeatureCollection":for(m=0;m<y.features.length&&_(y.features[m].properties,m)!==!1;m++);break;case"Feature":_(y.properties,0);break}}function i(y,_,m){var w=m;return n(y,function(E,b){b===0&&m===void 0?w=E:w=_(w,E,b)}),w}function s(y,_){if(y.type==="Feature")_(y,0);else if(y.type==="FeatureCollection")for(var m=0;m<y.features.length&&_(y.features[m],m)!==!1;m++);}function o(y,_,m){var w=m;return s(y,function(E,b){b===0&&m===void 0?w=E:w=_(w,E,b)}),w}function a(y){var _=[];return e(y,function(m){_.push(m)}),_}function u(y,_){var m,w,E,b,I,T,D,x,N,L,A=0,J=y.type==="FeatureCollection",H=y.type==="Feature",Z=J?y.features.length:1;for(m=0;m<Z;m++){for(T=J?y.features[m].geometry:H?y.geometry:y,x=J?y.features[m].properties:H?y.properties:{},N=J?y.features[m].bbox:H?y.bbox:void 0,L=J?y.features[m].id:H?y.id:void 0,D=T?T.type==="GeometryCollection":!1,I=D?T.geometries.length:1,E=0;E<I;E++){if(b=D?T.geometries[E]:T,b===null){if(_(null,A,x,N,L)===!1)return!1;continue}switch(b.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(_(b,A,x,N,L)===!1)return!1;break}case"GeometryCollection":{for(w=0;w<b.geometries.length;w++)if(_(b.geometries[w],A,x,N,L)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}A++}}function l(y,_,m){var w=m;return u(y,function(E,b,I,T,D){b===0&&m===void 0?w=E:w=_(w,E,b,I,T,D)}),w}function c(y,_){u(y,function(m,w,E,b,I){var T=m===null?null:m.type;switch(T){case null:case"Point":case"LineString":case"Polygon":return _(r.feature(m,E,{bbox:b,id:I}),w,0)===!1?!1:void 0}var D;switch(T){case"MultiPoint":D="Point";break;case"MultiLineString":D="LineString";break;case"MultiPolygon":D="Polygon";break}for(var x=0;x<m.coordinates.length;x++){var N=m.coordinates[x],L={type:D,coordinates:N};if(_(r.feature(L,E),w,x)===!1)return!1}})}function h(y,_,m){var w=m;return c(y,function(E,b,I){b===0&&I===0&&m===void 0?w=E:w=_(w,E,b,I)}),w}function f(y,_){c(y,function(m,w,E){var b=0;if(m.geometry){var I=m.geometry.type;if(!(I==="Point"||I==="MultiPoint")){var T,D=0,x=0,N=0;if(e(m,function(L,A,J,H,Z){if(T===void 0||w>D||H>x||Z>N){T=L,D=w,x=H,N=Z,b=0;return}var ct=r.lineString([T,L],m.properties);if(_(ct,w,E,Z,b)===!1)return!1;b++,T=L})===!1)return!1}}})}function p(y,_,m){var w=m,E=!1;return f(y,function(b,I,T,D,x){E===!1&&m===void 0?w=b:w=_(w,b,I,T,D,x),E=!0}),w}function v(y,_){if(!y)throw new Error("geojson is required");c(y,function(m,w,E){if(m.geometry!==null){var b=m.geometry.type,I=m.geometry.coordinates;switch(b){case"LineString":if(_(m,w,E,0,0)===!1)return!1;break;case"Polygon":for(var T=0;T<I.length;T++)if(_(r.lineString(I[T],m.properties),w,E,T)===!1)return!1;break}}})}function C(y,_,m){var w=m;return v(y,function(E,b,I,T){b===0&&m===void 0?w=E:w=_(w,E,b,I,T)}),w}function S(y,_){if(_=_||{},!r.isObject(_))throw new Error("options is invalid");var m=_.featureIndex||0,w=_.multiFeatureIndex||0,E=_.geometryIndex||0,b=_.segmentIndex||0,I=_.properties,T;switch(y.type){case"FeatureCollection":m<0&&(m=y.features.length+m),I=I||y.features[m].properties,T=y.features[m].geometry;break;case"Feature":I=I||y.properties,T=y.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":T=y;break;default:throw new Error("geojson is invalid")}if(T===null)return null;var D=T.coordinates;switch(T.type){case"Point":case"MultiPoint":return null;case"LineString":return b<0&&(b=D.length+b-1),r.lineString([D[b],D[b+1]],I,_);case"Polygon":return E<0&&(E=D.length+E),b<0&&(b=D[E].length+b-1),r.lineString([D[E][b],D[E][b+1]],I,_);case"MultiLineString":return w<0&&(w=D.length+w),b<0&&(b=D[w].length+b-1),r.lineString([D[w][b],D[w][b+1]],I,_);case"MultiPolygon":return w<0&&(w=D.length+w),E<0&&(E=D[w].length+E),b<0&&(b=D[w][E].length-b-1),r.lineString([D[w][E][b],D[w][E][b+1]],I,_)}throw new Error("geojson is invalid")}function P(y,_){if(_=_||{},!r.isObject(_))throw new Error("options is invalid");var m=_.featureIndex||0,w=_.multiFeatureIndex||0,E=_.geometryIndex||0,b=_.coordIndex||0,I=_.properties,T;switch(y.type){case"FeatureCollection":m<0&&(m=y.features.length+m),I=I||y.features[m].properties,T=y.features[m].geometry;break;case"Feature":I=I||y.properties,T=y.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":T=y;break;default:throw new Error("geojson is invalid")}if(T===null)return null;var D=T.coordinates;switch(T.type){case"Point":return r.point(D,I,_);case"MultiPoint":return w<0&&(w=D.length+w),r.point(D[w],I,_);case"LineString":return b<0&&(b=D.length+b),r.point(D[b],I,_);case"Polygon":return E<0&&(E=D.length+E),b<0&&(b=D[E].length+b),r.point(D[E][b],I,_);case"MultiLineString":return w<0&&(w=D.length+w),b<0&&(b=D[w].length+b),r.point(D[w][b],I,_);case"MultiPolygon":return w<0&&(w=D.length+w),E<0&&(E=D[w].length+E),b<0&&(b=D[w][E].length-b),r.point(D[w][E][b],I,_)}throw new Error("geojson is invalid")}return xe.coordAll=a,xe.coordEach=e,xe.coordReduce=t,xe.featureEach=s,xe.featureReduce=o,xe.findPoint=P,xe.findSegment=S,xe.flattenEach=c,xe.flattenReduce=h,xe.geomEach=u,xe.geomReduce=l,xe.lineEach=v,xe.lineReduce=C,xe.propEach=n,xe.propReduce=i,xe.segmentEach=f,xe.segmentReduce=p,xe}var ec={},dm;function nE(){if(dm)return ec;dm=1,Object.defineProperty(ec,"__esModule",{value:!0});var r=hm();function e(t){var n=[1/0,1/0,-1/0,-1/0];return r.coordEach(t,function(i){n[0]>i[0]&&(n[0]=i[0]),n[1]>i[1]&&(n[1]=i[1]),n[2]<i[0]&&(n[2]=i[0]),n[3]<i[1]&&(n[3]=i[1])}),n}return e.default=e,ec.default=e,ec}var fm;function rE(){if(fm)return tc.exports;fm=1;var r=Zg(),e=lm(),t=hm(),n=nE().default,i=t.featureEach;t.coordEach,e.polygon;var s=e.featureCollection;function o(a){var u=new r(a);return u.insert=function(l){if(l.type!=="Feature")throw new Error("invalid feature");return l.bbox=l.bbox?l.bbox:n(l),r.prototype.insert.call(this,l)},u.load=function(l){var c=[];return Array.isArray(l)?l.forEach(function(h){if(h.type!=="Feature")throw new Error("invalid features");h.bbox=h.bbox?h.bbox:n(h),c.push(h)}):i(l,function(h){if(h.type!=="Feature")throw new Error("invalid features");h.bbox=h.bbox?h.bbox:n(h),c.push(h)}),r.prototype.load.call(this,c)},u.remove=function(l,c){if(l.type!=="Feature")throw new Error("invalid feature");return l.bbox=l.bbox?l.bbox:n(l),r.prototype.remove.call(this,l,c)},u.clear=function(){return r.prototype.clear.call(this)},u.search=function(l){var c=r.prototype.search.call(this,this.toBBox(l));return s(c)},u.collides=function(l){return r.prototype.collides.call(this,this.toBBox(l))},u.all=function(){var l=r.prototype.all.call(this);return s(l)},u.toJSON=function(){return r.prototype.toJSON.call(this)},u.fromJSON=function(l){return r.prototype.fromJSON.call(this,l)},u.toBBox=function(l){var c;if(l.bbox)c=l.bbox;else if(Array.isArray(l)&&l.length===4)c=l;else if(Array.isArray(l)&&l.length===6)c=[l[0],l[1],l[3],l[4]];else if(l.type==="Feature")c=n(l);else if(l.type==="FeatureCollection")c=n(l);else throw new Error("invalid geojson");return{minX:c[0],minY:c[1],maxX:c[2],maxY:c[3]}},u}return tc.exports=o,tc.exports.default=o,tc.exports}var iE=rE();const sE=Vh(iE);function pm(r,e){var t={},n=[];if(r.type==="LineString"&&(r=jr(r)),e.type==="LineString"&&(e=jr(e)),r.type==="Feature"&&e.type==="Feature"&&r.geometry!==null&&e.geometry!==null&&r.geometry.type==="LineString"&&e.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var i=gm(r,e);return i&&n.push(i),oa(n)}var s=sE();return s.load(am(e)),Jl(am(r),function(o){Jl(s.search(o),function(a){var u=gm(o,a);if(u){var l=so(u).join(",");t[l]||(t[l]=!0,n.push(u))}})}),oa(n)}function gm(r,e){var t=so(r),n=so(e);if(t.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=t[0][0],s=t[0][1],o=t[1][0],a=t[1][1],u=n[0][0],l=n[0][1],c=n[1][0],h=n[1][1],f=(h-l)*(o-i)-(c-u)*(a-s),p=(c-u)*(s-l)-(h-l)*(i-u),v=(o-i)*(s-l)-(a-s)*(i-u);if(f===0)return null;var C=p/f,S=v/f;if(C>=0&&C<=1&&S>=0&&S<=1){var P=i+C*(o-i),y=s+C*(a-s);return Jt([P,y])}return null}function oE(r,e){return pm(Br(r),Br(e))}function aE(r,e){var t=Xi(r,e),n=ku(r,e),i=aa(r,t/2,n);return i}function uE(r,e){const t=Jt(r),n=Jt(e),i=aE(t,n),s=(r[2]+e[2])/2;return[...i.geometry.coordinates,s]}function lE(r,e,t){t===void 0&&(t={});var n=Jt([1/0,1/0],{dist:1/0}),i=0;return Zh(r,function(s){for(var o=so(s),a=0;a<o.length-1;a++){var u=Jt(o[a]);u.properties.dist=Xi(e,u,t);var l=Jt(o[a+1]);l.properties.dist=Xi(e,l,t);var c=Xi(u,l,t),h=Math.max(u.properties.dist,l.properties.dist),f=ku(u,l),p=aa(e,h,f+90,t),v=aa(e,h,f-90,t),C=pm(Br([p.geometry.coordinates,v.geometry.coordinates]),Br([u.geometry.coordinates,l.geometry.coordinates])),S=null;C.features.length>0&&(S=C.features[0],S.properties.dist=Xi(e,S,t),S.properties.location=i+Xi(u,S,t)),u.properties.dist<n.properties.dist&&(n=u,n.properties.index=a,n.properties.location=i),l.properties.dist<n.properties.dist&&(n=l,n.properties.index=a+1,n.properties.location=i+c),S&&S.properties.dist<n.properties.dist&&(n=S,n.properties.index=a),i+=c}}),n}function cE(r,e){const t=Jt(e),n=Br(r);return lE(n,t,{units:"meters"})}function mm(r,e,t){t===void 0&&(t={});var n=In(r),i=In(e);i[0]+=i[0]-n[0]>180?-360:n[0]-i[0]>180?360:0;var s=hE(n,i),o=Kh(s,"meters",t.units);return o}function hE(r,e,t){t=t===void 0?tn:Number(t);var n=t,i=r[1]*Math.PI/180,s=e[1]*Math.PI/180,o=s-i,a=Math.abs(e[0]-r[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),l=Math.abs(u)>1e-11?o/u:Math.cos(i),c=Math.sqrt(o*o+l*l*a*a),h=c*n;return h}function dE(r,e,t){if(t===void 0&&(t={}),t.method||(t.method="geodesic"),t.units||(t.units="kilometers"),!r)throw new Error("pt is required");if(Array.isArray(r)?r=Jt(r):r.type==="Point"?r=jr(r):Xg(r,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=Br(e):e.type==="LineString"?e=jr(e):Xg(e,"LineString","line");var n=1/0,i=r.geometry.coordinates;return Aw(e,function(s){var o=s.geometry.coordinates[0],a=s.geometry.coordinates[1],u=fE(i,o,a,t);u<n&&(n=u)}),Kh(n,"degrees",t.units)}function fE(r,e,t,n){var i=[t[0]-e[0],t[1]-e[1]],s=[r[0]-e[0],r[1]-e[1]],o=vm(s,i);if(o<=0)return id(r,e,{method:n.method,units:"degrees"});var a=vm(i,i);if(a<=o)return id(r,t,{method:n.method,units:"degrees"});var u=o/a,l=[e[0]+u*i[0],e[1]+u*i[1]];return id(r,l,{method:n.method,units:"degrees"})}function vm(r,e){return r[0]*e[0]+r[1]*e[1]}function id(r,e,t){return t.method==="planar"?mm(r,e,t):Xi(r,e,t)}function pE(r,e){const t=Jt(r),n=Br(e);return dE(t,n,{units:"meters"})}function gE(r,e,t,n){n===void 0&&(n={});var i=e<0,s=Kh(Math.abs(e),n.units,"meters");i&&(s=-Math.abs(s));var o=In(r),a=mE(o,s,t);return a[0]+=a[0]-o[0]>180?-360:o[0]-a[0]>180?360:0,Jt(a,n.properties)}function mE(r,e,t,n){n=n===void 0?tn:Number(n);var i=e/n,s=r[0]*Math.PI/180,o=hn(r[1]),a=hn(t),u=i*Math.cos(a),l=o+u;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var c=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),h=Math.abs(c)>1e-11?u/c:Math.cos(o),f=i*Math.sin(a)/h,p=s+f;return[(p*180/Math.PI+540)%360-180,l*180/Math.PI]}function vE(r,e,t,n){const[i,s,o]=r,a=gE(Jt([i,s]),e,t,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return n=n||[0,0,0],n[0]=a.geometry.coordinates[0],n[1]=a.geometry.coordinates[1],n[2]=o,n}function ym(r,e){return mm(Jt(r),Jt(e),{units:"meters"})}function yE(r,e,t){t===void 0&&(t={});var n;t.final?n=_m(In(e),In(r)):n=_m(In(r),In(e));var i=n>180?-(360-n):n;return i}function _m(r,e){var t=hn(r[1]),n=hn(e[1]),i=hn(e[0]-r[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var s=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(t/2+Math.PI/4)),o=Math.atan2(i,s);return(Yl(o)+360)%360}function _E(r,e){return yE(Jt(r),Jt(e))}function zr(r){var e=[1/0,1/0,-1/0,-1/0];return ua(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}zr.default=zr;function Ur(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=In(r),i=Jn(e),s=i.type,o=e.bbox,a=i.coordinates;if(o&&wE(n,o)===!1)return!1;s==="Polygon"&&(a=[a]);for(var u=!1,l=0;l<a.length&&!u;l++)if(wm(n,a[l][0],t.ignoreBoundary)){for(var c=!1,h=1;h<a[l].length&&!c;)wm(n,a[l][h],!t.ignoreBoundary)&&(c=!0),h++;c||(u=!0)}return u}function wm(r,e,t){var n=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,s=e.length-1;i<e.length;s=i++){var o=e[i][0],a=e[i][1],u=e[s][0],l=e[s][1],c=r[1]*(o-u)+a*(u-r[0])+l*(r[0]-o)===0&&(o-r[0])*(u-r[0])<=0&&(a-r[1])*(l-r[1])<=0;if(c)return!t;var h=a>r[1]!=l>r[1]&&r[0]<(u-o)*(r[1]-a)/(l-a)+o;h&&(n=!n)}return n}function wE(r,e){return e[0]<=r[0]&&e[1]<=r[1]&&e[2]>=r[0]&&e[3]>=r[1]}function Yi(r,e,t){t===void 0&&(t={});for(var n=In(r),i=so(e),s=0;s<i.length-1;s++){var o=!1;if(t.ignoreEndVertices&&(s===0&&(o="start"),s===i.length-2&&(o="end"),s===0&&s+1===i.length-1&&(o="both")),EE(i[s],i[s+1],n,o,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function EE(r,e,t,n,i){var s=t[0],o=t[1],a=r[0],u=r[1],l=e[0],c=e[1],h=t[0]-a,f=t[1]-u,p=l-a,v=c-u,C=h*v-f*p;if(i!==null){if(Math.abs(C)>i)return!1}else if(C!==0)return!1;if(n){if(n==="start")return Math.abs(p)>=Math.abs(v)?p>0?a<s&&s<=l:l<=s&&s<a:v>0?u<o&&o<=c:c<=o&&o<u;if(n==="end")return Math.abs(p)>=Math.abs(v)?p>0?a<=s&&s<l:l<s&&s<=a:v>0?u<=o&&o<c:c<o&&o<=u;if(n==="both")return Math.abs(p)>=Math.abs(v)?p>0?a<s&&s<l:l<s&&s<a:v>0?u<o&&o<c:c<o&&o<u}else return Math.abs(p)>=Math.abs(v)?p>0?a<=s&&s<=l:l<=s&&s<=a:v>0?u<=o&&o<=c:c<=o&&o<=u;return!1}function CE(r,e){var t=Jn(r),n=Jn(e),i=t.type,s=n.type,o=t.coordinates,a=n.coordinates;switch(i){case"Point":switch(s){case"Point":return sd(o,a);default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"Point":return SE(t,n);case"MultiPoint":return bE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"Point":return Yi(n,t,{ignoreEndVertices:!0});case"LineString":return xE(t,n);case"MultiPoint":return PE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Point":return Ur(n,t,{ignoreBoundary:!0});case"LineString":return TE(t,n);case"Polygon":return OE(t,n);case"MultiPoint":return IE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function SE(r,e){var t,n=!1;for(t=0;t<r.coordinates.length;t++)if(sd(r.coordinates[t],e.coordinates)){n=!0;break}return n}function bE(r,e){for(var t=0,n=e.coordinates;t<n.length;t++){for(var i=n[t],s=!1,o=0,a=r.coordinates;o<a.length;o++){var u=a[o];if(sd(i,u)){s=!0;break}}if(!s)return!1}return!0}function PE(r,e){for(var t=!1,n=0,i=e.coordinates;n<i.length;n++){var s=i[n];if(Yi(s,r,{ignoreEndVertices:!0})&&(t=!0),!Yi(s,r))return!1}return!!t}function IE(r,e){for(var t=0,n=e.coordinates;t<n.length;t++){var i=n[t];if(!Ur(i,r,{ignoreBoundary:!0}))return!1}return!0}function xE(r,e){for(var t=!1,n=0,i=e.coordinates;n<i.length;n++){var s=i[n];if(Yi({type:"Point",coordinates:s},r,{ignoreEndVertices:!0})&&(t=!0),!Yi({type:"Point",coordinates:s},r,{ignoreEndVertices:!1}))return!1}return t}function TE(r,e){var t=!1,n=0,i=zr(r),s=zr(e);if(!Em(i,s))return!1;for(n;n<e.coordinates.length-1;n++){var o=NE(e.coordinates[n],e.coordinates[n+1]);if(Ur({type:"Point",coordinates:o},r,{ignoreBoundary:!0})){t=!0;break}}return t}function OE(r,e){if(r.type==="Feature"&&r.geometry===null||e.type==="Feature"&&e.geometry===null)return!1;var t=zr(r),n=zr(e);if(!Em(t,n))return!1;for(var i=Jn(e).coordinates,s=0,o=i;s<o.length;s++)for(var a=o[s],u=0,l=a;u<l.length;u++){var c=l[u];if(!Ur(c,r))return!1}return!0}function Em(r,e){return!(r[0]>e[0]||r[2]<e[2]||r[1]>e[1]||r[3]<e[3])}function sd(r,e){return r[0]===e[0]&&r[1]===e[1]}function NE(r,e){return[(r[0]+e[0])/2,(r[1]+e[1])/2]}function DE(r,e){var t=Jn(r),n=Jn(e),i=t.type,s=n.type;switch(i){case"Point":switch(s){case"MultiPoint":return ME(t,n);case"LineString":return Yi(t,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Ur(t,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return RE(t,n);case"LineString":return LE(t,n);case"Polygon":case"MultiPolygon":return FE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return AE(t,n);case"Polygon":case"MultiPolygon":return kE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return VE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function ME(r,e){var t,n=!1;for(t=0;t<e.coordinates.length;t++)if(Sm(e.coordinates[t],r.coordinates)){n=!0;break}return n}function RE(r,e){for(var t=0;t<r.coordinates.length;t++){for(var n=!1,i=0;i<e.coordinates.length;i++)Sm(r.coordinates[t],e.coordinates[i])&&(n=!0);if(!n)return!1}return!0}function LE(r,e){for(var t=!1,n=0;n<r.coordinates.length;n++){if(!Yi(r.coordinates[n],e))return!1;t||(t=Yi(r.coordinates[n],e,{ignoreEndVertices:!0}))}return t}function FE(r,e){for(var t=!0,n=!1,i=0;i<r.coordinates.length;i++){if(n=Ur(r.coordinates[1],e),!n){t=!1;break}n=Ur(r.coordinates[1],e,{ignoreBoundary:!0})}return t&&n}function AE(r,e){for(var t=0;t<r.coordinates.length;t++)if(!Yi(r.coordinates[t],e))return!1;return!0}function kE(r,e){var t=zr(e),n=zr(r);if(!Cm(t,n))return!1;for(var i=!1,s=0;s<r.coordinates.length-1;s++){if(!Ur(r.coordinates[s],e))return!1;if(i||(i=Ur(r.coordinates[s],e,{ignoreBoundary:!0})),!i){var o=jE(r.coordinates[s],r.coordinates[s+1]);i=Ur(o,e,{ignoreBoundary:!0})}}return i}function VE(r,e){var t=zr(r),n=zr(e);if(!Cm(n,t))return!1;for(var i=0;i<r.coordinates[0].length;i++)if(!Ur(r.coordinates[0][i],e))return!1;return!0}function Cm(r,e){return!(r[0]>e[0]||r[2]<e[2]||r[1]>e[1]||r[3]<e[3])}function Sm(r,e){return r[0]===e[0]&&r[1]===e[1]}function jE(r,e){return[(r[0]+e[0])/2,(r[1]+e[1])/2]}function BE(r,e){e===void 0&&(e={});var t=zr(r),n=(t[0]+t[2])/2,i=(t[1]+t[3])/2;return Jt([n,i],e.properties,e)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(e){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var t=Object(this),n=Math.max(Math.min(t.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(n+i,0):Math.min(i,n);var s=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:n;for(s=s<0?Math.max(n+arguments[2],0):Math.min(s,n);i<s;)t[i]=e,++i;return t},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!==r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var oo=function(){};oo.prototype.interfaces_=function(){return[]},oo.prototype.getClass=function(){return oo},oo.prototype.equalsWithTolerance=function(e,t,n){return Math.abs(e-t)<=n};var Yt=function(r){function e(t){r.call(this,t),this.name="IllegalArgumentException",this.message=t,this.stack=new r().stack}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e}(Error),ht=function(){},bm={MAX_VALUE:{configurable:!0}};ht.isNaN=function(e){return Number.isNaN(e)},ht.doubleToLongBits=function(e){return e},ht.longBitsToDouble=function(e){return e},ht.isInfinite=function(e){return!Number.isFinite(e)},bm.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(ht,bm);var An=function(){},nc=function(){},la=function(){};function kn(){}var R=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},ao={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};R.prototype.setOrdinate=function(e,t){switch(e){case R.X:this.x=t;break;case R.Y:this.y=t;break;case R.Z:this.z=t;break;default:throw new Yt("Invalid ordinate index: "+e)}},R.prototype.equals2D=function(){if(arguments.length===1){var e=arguments[0];return!(this.x!==e.x||this.y!==e.y)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return!(!oo.equalsWithTolerance(this.x,t.x,n)||!oo.equalsWithTolerance(this.y,t.y,n))}},R.prototype.getOrdinate=function(e){switch(e){case R.X:return this.x;case R.Y:return this.y;case R.Z:return this.z}throw new Yt("Invalid ordinate index: "+e)},R.prototype.equals3D=function(e){return this.x===e.x&&this.y===e.y&&(this.z===e.z||ht.isNaN(this.z))&&ht.isNaN(e.z)},R.prototype.equals=function(e){return e instanceof R?this.equals2D(e):!1},R.prototype.equalInZ=function(e,t){return oo.equalsWithTolerance(this.z,e.z,t)},R.prototype.compareTo=function(e){var t=e;return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0},R.prototype.clone=function(){},R.prototype.copy=function(){return new R(this)},R.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},R.prototype.distance3D=function(e){var t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return Math.sqrt(t*t+n*n+i*i)},R.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},R.prototype.hashCode=function(){var e=17;return e=37*e+R.hashCode(this.x),e=37*e+R.hashCode(this.y),e},R.prototype.setCoordinate=function(e){this.x=e.x,this.y=e.y,this.z=e.z},R.prototype.interfaces_=function(){return[An,nc,kn]},R.prototype.getClass=function(){return R},R.hashCode=function(){if(arguments.length===1){var e=arguments[0],t=ht.doubleToLongBits(e);return Math.trunc((t^t)>>>32)}},ao.DimensionalComparator.get=function(){return Ji},ao.serialVersionUID.get=function(){return 6683108902428367e3},ao.NULL_ORDINATE.get=function(){return ht.NaN},ao.X.get=function(){return 0},ao.Y.get=function(){return 1},ao.Z.get=function(){return 2},Object.defineProperties(R,ao);var Ji=function(e){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t!==2&&t!==3)throw new Yt("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}};Ji.prototype.compare=function(e,t){var n=e,i=t,s=Ji.compare(n.x,i.x);if(s!==0)return s;var o=Ji.compare(n.y,i.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var a=Ji.compare(n.z,i.z);return a},Ji.prototype.interfaces_=function(){return[la]},Ji.prototype.getClass=function(){return Ji},Ji.compare=function(e,t){return e<t?-1:e>t?1:ht.isNaN(e)?ht.isNaN(t)?0:-1:ht.isNaN(t)?1:0};var ca=function(){};ca.prototype.create=function(){},ca.prototype.interfaces_=function(){return[]},ca.prototype.getClass=function(){return ca};var F=function(){},zu={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};F.prototype.interfaces_=function(){return[]},F.prototype.getClass=function(){return F},F.toLocationSymbol=function(e){switch(e){case F.EXTERIOR:return"e";case F.BOUNDARY:return"b";case F.INTERIOR:return"i";case F.NONE:return"-"}throw new Yt("Unknown location value: "+e)},zu.INTERIOR.get=function(){return 0},zu.BOUNDARY.get=function(){return 1},zu.EXTERIOR.get=function(){return 2},zu.NONE.get=function(){return-1},Object.defineProperties(F,zu);var at=function(r,e){return r.interfaces_&&r.interfaces_().indexOf(e)>-1},xn=function(){},Pm={LOG_10:{configurable:!0}};xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},xn.log10=function(e){var t=Math.log(e);return ht.isInfinite(t)||ht.isNaN(t)?t:t/xn.LOG_10},xn.min=function(e,t,n,i){var s=e;return t<s&&(s=t),n<s&&(s=n),i<s&&(s=i),s},xn.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1],n=arguments[2];return e<t?t:e>n?n:e}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],s=arguments[1],o=arguments[2];return i<s?s:i>o?o:i}},xn.wrap=function(e,t){return e<0?t- -e%t:e%t},xn.max=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2],i=e;return t>i&&(i=t),n>i&&(i=n),i}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=s;return o>l&&(l=o),a>l&&(l=a),u>l&&(l=u),l}},xn.average=function(e,t){return(e+t)/2},Pm.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(xn,Pm);var lr=function(e){this.str=e};lr.prototype.append=function(e){this.str+=e},lr.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)},lr.prototype.toString=function(e){return this.str};var cr=function(e){this.value=e};cr.prototype.intValue=function(){return this.value},cr.prototype.compareTo=function(e){return this.value<e?-1:this.value>e?1:0},cr.isNaN=function(e){return Number.isNaN(e)};var Uu=function(){};Uu.isWhitespace=function(e){return e<=32&&e>=0||e===127},Uu.toUpperCase=function(e){return e.toUpperCase()};var k=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof r){var t=arguments[0];this.init(t)}else if(typeof arguments[0]=="string"){var n=arguments[0];r.call(this,r.parse(n))}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.init(i,s)}},$n={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};k.prototype.le=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<=e._lo},k.prototype.extractSignificantDigits=function(e,t){var n=this.abs(),i=k.magnitude(n._hi),s=k.TEN.pow(i);n=n.divide(s),n.gt(k.TEN)?(n=n.divide(k.TEN),i+=1):n.lt(k.ONE)&&(n=n.multiply(k.TEN),i-=1);for(var o=i+1,a=new lr,u=k.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){e&&l===o&&a.append(".");var c=Math.trunc(n._hi);if(c<0)break;var h=!1,f=0;c>9?(h=!0,f="9"):f="0"+c,a.append(f),n=n.subtract(k.valueOf(c)).multiply(k.TEN),h&&n.selfAdd(k.TEN);var p=!0,v=k.magnitude(n._hi);if(v<0&&Math.abs(v)>=u-l&&(p=!1),!p)break}return t[0]=i,a.toString()},k.prototype.sqr=function(){return this.multiply(this)},k.prototype.doubleValue=function(){return this._hi+this._lo},k.prototype.subtract=function(){if(arguments[0]instanceof k){var e=arguments[0];return this.add(e.negate())}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.add(-t)}},k.prototype.equals=function(){if(arguments.length===1){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}},k.prototype.isZero=function(){return this._hi===0&&this._lo===0},k.prototype.selfSubtract=function(){if(arguments[0]instanceof k){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}},k.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},k.prototype.min=function(e){return this.le(e)?this:e},k.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof k){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfDivide(t,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=null,o=null,a=null,u=null,l=null,c=null,h=null,f=null;return l=this._hi/n,c=k.SPLIT*l,s=c-l,f=k.SPLIT*n,s=c-s,o=l-s,a=f-n,h=l*n,a=f-a,u=n-a,f=s*a-h+s*u+o*a+o*u,c=(this._hi-h-f+this._lo-l*i)/n,f=l+c,this._hi=f,this._lo=l-f+c,this}},k.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},k.prototype.divide=function(){if(arguments[0]instanceof k){var e=arguments[0],t=null,n=null,i=null,s=null,o=null,a=null,u=null,l=null;o=this._hi/e._hi,a=k.SPLIT*o,t=a-o,l=k.SPLIT*e._hi,t=a-t,n=o-t,i=l-e._hi,u=o*e._hi,i=l-i,s=e._hi-i,l=t*i-u+t*s+n*i+n*s,a=(this._hi-u-l+this._lo-o*e._lo)/e._hi,l=o+a;var c=l,h=o-l+a;return new k(c,h)}else if(typeof arguments[0]=="number"){var f=arguments[0];return ht.isNaN(f)?k.createNaN():k.copy(this).selfDivide(f,0)}},k.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo},k.prototype.pow=function(e){if(e===0)return k.valueOf(1);var t=new k(this),n=k.valueOf(1),i=Math.abs(e);if(i>1)for(;i>0;)i%2===1&&n.selfMultiply(t),i/=2,i>0&&(t=t.sqr());else n=t;return e<0?n.reciprocal():n},k.prototype.ceil=function(){if(this.isNaN())return k.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new k(e,t)},k.prototype.compareTo=function(e){var t=e;return this._hi<t._hi?-1:this._hi>t._hi?1:this._lo<t._lo?-1:this._lo>t._lo?1:0},k.prototype.rint=function(){if(this.isNaN())return this;var e=this.add(.5);return e.floor()},k.prototype.setValue=function(){if(arguments[0]instanceof k){var e=arguments[0];return this.init(e),this}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.init(t),this}},k.prototype.max=function(e){return this.ge(e)?this:e},k.prototype.sqrt=function(){if(this.isZero())return k.valueOf(0);if(this.isNegative())return k.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,n=k.valueOf(t),i=this.subtract(n.sqr()),s=i._hi*(e*.5);return n.add(s)},k.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof k){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0],n=null,i=null,s=null,o=null,a=null,u=null;return s=this._hi+t,a=s-this._hi,o=s-a,o=t-a+(this._hi-o),u=o+this._lo,n=s+u,i=u+(s-n),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(arguments.length===2){var l=arguments[0],c=arguments[1],h=null,f=null,p=null,v=null,C=null,S=null,P=null,y=null;C=this._hi+l,p=this._lo+c,P=C-this._hi,y=p-this._lo,S=C-P,v=p-y,S=l-P+(this._hi-S),v=c-y+(this._lo-v),P=S+p,h=C+P,f=P+(C-h),P=v+f;var _=h+P,m=P+(h-_);return this._hi=_,this._lo=m,this}},k.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof k){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfMultiply(t,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=null,o=null,a=null,u=null,l=null,c=null;l=k.SPLIT*this._hi,s=l-this._hi,c=k.SPLIT*n,s=l-s,o=this._hi-s,a=c-n,l=this._hi*n,a=c-a,u=n-a,c=s*a-l+s*u+o*a+o*u+(this._hi*i+this._lo*n);var h=l+c;s=l-h;var f=c+s;return this._hi=h,this._lo=f,this}},k.prototype.selfSqr=function(){return this.selfMultiply(this)},k.prototype.floor=function(){if(this.isNaN())return k.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new k(e,t)},k.prototype.negate=function(){return this.isNaN()?this:new k(-this._hi,-this._lo)},k.prototype.clone=function(){},k.prototype.multiply=function(){if(arguments[0]instanceof k){var e=arguments[0];return e.isNaN()?k.createNaN():k.copy(this).selfMultiply(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return ht.isNaN(t)?k.createNaN():k.copy(this).selfMultiply(t,0)}},k.prototype.isNaN=function(){return ht.isNaN(this._hi)},k.prototype.intValue=function(){return Math.trunc(this._hi)},k.prototype.toString=function(){var e=k.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()},k.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!0,t),i=t[0]+1,s=n;if(n.charAt(0)===".")s="0"+n;else if(i<0)s="0."+k.stringOfChar("0",-i)+n;else if(n.indexOf(".")===-1){var o=i-n.length,a=k.stringOfChar("0",o);s=n+a+".0"}return this.isNegative()?"-"+s:s},k.prototype.reciprocal=function(){var e=null,t=null,n=null,i=null,s=null,o=null,a=null,u=null;s=1/this._hi,o=k.SPLIT*s,e=o-s,u=k.SPLIT*this._hi,e=o-e,t=s-e,n=u-this._hi,a=s*this._hi,n=u-n,i=this._hi-n,u=e*n-a+e*i+t*n+t*i,o=(1-a-u-s*this._lo)/this._hi;var l=s+o,c=s-l+o;return new k(l,c)},k.prototype.toSciNotation=function(){if(this.isZero())return k.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!1,t),i=k.SCI_NOT_EXPONENT_CHAR+t[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var s="";n.length>1&&(s=n.substring(1));var o=n.charAt(0)+"."+s;return this.isNegative()?"-"+o+i:o+i},k.prototype.abs=function(){return this.isNaN()?k.NaN:this.isNegative()?this.negate():new k(this)},k.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},k.prototype.lt=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<e._lo},k.prototype.add=function(){if(arguments[0]instanceof k){var e=arguments[0];return k.copy(this).selfAdd(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return k.copy(this).selfAdd(t)}},k.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this._hi=e,this._lo=0}else if(arguments[0]instanceof k){var t=arguments[0];this._hi=t._hi,this._lo=t._lo}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._hi=n,this._lo=i}},k.prototype.gt=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>e._lo},k.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},k.prototype.trunc=function(){return this.isNaN()?k.NaN:this.isPositive()?this.floor():this.ceil()},k.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},k.prototype.interfaces_=function(){return[kn,An,nc]},k.prototype.getClass=function(){return k},k.sqr=function(e){return k.valueOf(e).selfMultiply(e)},k.valueOf=function(){if(typeof arguments[0]=="string"){var e=arguments[0];return k.parse(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return new k(t)}},k.sqrt=function(e){return k.valueOf(e).sqrt()},k.parse=function(e){for(var t=0,n=e.length;Uu.isWhitespace(e.charAt(t));)t++;var i=!1;if(t<n){var s=e.charAt(t);(s==="-"||s==="+")&&(t++,s==="-"&&(i=!0))}for(var o=new k,a=0,u=0,l=0;!(t>=n);){var c=e.charAt(t);if(t++,Uu.isDigit(c)){var h=c-"0";o.selfMultiply(k.TEN),o.selfAdd(h),a++;continue}if(c==="."){u=a;continue}if(c==="e"||c==="E"){var f=e.substring(t);try{l=cr.parseInt(f)}catch(P){throw P instanceof Error?new Error("Invalid exponent "+f+" in string "+e):P}finally{}break}throw new Error("Unexpected character '"+c+"' at position "+t+" in string "+e)}var p=o,v=a-u-l;if(v===0)p=o;else if(v>0){var C=k.TEN.pow(v);p=o.divide(C)}else if(v<0){var S=k.TEN.pow(-v);p=o.multiply(S)}return i?p.negate():p},k.createNaN=function(){return new k(ht.NaN,ht.NaN)},k.copy=function(e){return new k(e)},k.magnitude=function(e){var t=Math.abs(e),n=Math.log(t)/Math.log(10),i=Math.trunc(Math.floor(n)),s=Math.pow(10,i);return s*10<=t&&(i+=1),i},k.stringOfChar=function(e,t){for(var n=new lr,i=0;i<t;i++)n.append(e);return n.toString()},$n.PI.get=function(){return new k(3.141592653589793,12246467991473532e-32)},$n.TWO_PI.get=function(){return new k(6.283185307179586,24492935982947064e-32)},$n.PI_2.get=function(){return new k(1.5707963267948966,6123233995736766e-32)},$n.E.get=function(){return new k(2.718281828459045,14456468917292502e-32)},$n.NaN.get=function(){return new k(ht.NaN,ht.NaN)},$n.EPS.get=function(){return 123259516440783e-46},$n.SPLIT.get=function(){return 134217729},$n.MAX_PRINT_DIGITS.get=function(){return 32},$n.TEN.get=function(){return k.valueOf(10)},$n.ONE.get=function(){return k.valueOf(1)},$n.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},$n.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(k,$n);var en=function(){},Im={DP_SAFE_EPSILON:{configurable:!0}};en.prototype.interfaces_=function(){return[]},en.prototype.getClass=function(){return en},en.orientationIndex=function(e,t,n){var i=en.orientationIndexFilter(e,t,n);if(i<=1)return i;var s=k.valueOf(t.x).selfAdd(-e.x),o=k.valueOf(t.y).selfAdd(-e.y),a=k.valueOf(n.x).selfAdd(-t.x),u=k.valueOf(n.y).selfAdd(-t.y);return s.selfMultiply(u).selfSubtract(o.selfMultiply(a)).signum()},en.signOfDet2x2=function(e,t,n,i){var s=e.multiply(i).selfSubtract(t.multiply(n));return s.signum()},en.intersection=function(e,t,n,i){var s=k.valueOf(i.y).selfSubtract(n.y).selfMultiply(k.valueOf(t.x).selfSubtract(e.x)),o=k.valueOf(i.x).selfSubtract(n.x).selfMultiply(k.valueOf(t.y).selfSubtract(e.y)),a=s.subtract(o),u=k.valueOf(i.x).selfSubtract(n.x).selfMultiply(k.valueOf(e.y).selfSubtract(n.y)),l=k.valueOf(i.y).selfSubtract(n.y).selfMultiply(k.valueOf(e.x).selfSubtract(n.x)),c=u.subtract(l),h=c.selfDivide(a).doubleValue(),f=k.valueOf(e.x).selfAdd(k.valueOf(t.x).selfSubtract(e.x).selfMultiply(h)).doubleValue(),p=k.valueOf(t.x).selfSubtract(e.x).selfMultiply(k.valueOf(e.y).selfSubtract(n.y)),v=k.valueOf(t.y).selfSubtract(e.y).selfMultiply(k.valueOf(e.x).selfSubtract(n.x)),C=p.subtract(v),S=C.selfDivide(a).doubleValue(),P=k.valueOf(n.y).selfAdd(k.valueOf(i.y).selfSubtract(n.y).selfMultiply(S)).doubleValue();return new R(f,P)},en.orientationIndexFilter=function(e,t,n){var i=null,s=(e.x-n.x)*(t.y-n.y),o=(e.y-n.y)*(t.x-n.x),a=s-o;if(s>0){if(o<=0)return en.signum(a);i=s+o}else if(s<0){if(o>=0)return en.signum(a);i=-s-o}else return en.signum(a);var u=en.DP_SAFE_EPSILON*i;return a>=u||-a>=u?en.signum(a):2},en.signum=function(e){return e>0?1:e<0?-1:0},Im.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(en,Im);var Ot=function(){},Gu={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Gu.X.get=function(){return 0},Gu.Y.get=function(){return 1},Gu.Z.get=function(){return 2},Gu.M.get=function(){return 3},Ot.prototype.setOrdinate=function(e,t,n){},Ot.prototype.size=function(){},Ot.prototype.getOrdinate=function(e,t){},Ot.prototype.getCoordinate=function(){},Ot.prototype.getCoordinateCopy=function(e){},Ot.prototype.getDimension=function(){},Ot.prototype.getX=function(e){},Ot.prototype.clone=function(){},Ot.prototype.expandEnvelope=function(e){},Ot.prototype.copy=function(){},Ot.prototype.getY=function(e){},Ot.prototype.toCoordinateArray=function(){},Ot.prototype.interfaces_=function(){return[nc]},Ot.prototype.getClass=function(){return Ot},Object.defineProperties(Ot,Gu);var xm=function(){},ha=function(r){function e(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(xm),Te=function(){};Te.arraycopy=function(e,t,n,i,s){for(var o=0,a=t;a<t+s;a++)n[i+o]=e[a],o++},Te.getProperty=function(e){return{"line.separator":`
42
+ `}[e]};var Kn=function r(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],n=arguments[1];this.x=t,this.y=n,this.w=1}else if(arguments[0]instanceof r&&arguments[1]instanceof r){var i=arguments[0],s=arguments[1];this.x=i.y*s.w-s.y*i.w,this.y=s.x*i.w-i.x*s.w,this.w=i.x*s.y-s.x*i.y}else if(arguments[0]instanceof R&&arguments[1]instanceof R){var o=arguments[0],a=arguments[1];this.x=o.y-a.y,this.y=a.x-o.x,this.w=o.x*a.y-a.x*o.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(arguments.length===4){var h=arguments[0],f=arguments[1],p=arguments[2],v=arguments[3],C=h.y-f.y,S=f.x-h.x,P=h.x*f.y-f.x*h.y,y=p.y-v.y,_=v.x-p.x,m=p.x*v.y-v.x*p.y;this.x=S*m-_*P,this.y=y*P-C*m,this.w=C*_-y*S}};Kn.prototype.getY=function(){var e=this.y/this.w;if(ht.isNaN(e)||ht.isInfinite(e))throw new ha;return e},Kn.prototype.getX=function(){var e=this.x/this.w;if(ht.isNaN(e)||ht.isInfinite(e))throw new ha;return e},Kn.prototype.getCoordinate=function(){var e=new R;return e.x=this.getX(),e.y=this.getY(),e},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn},Kn.intersection=function(e,t,n,i){var s=e.y-t.y,o=t.x-e.x,a=e.x*t.y-t.x*e.y,u=n.y-i.y,l=i.x-n.x,c=n.x*i.y-i.x*n.y,h=o*c-l*a,f=u*a-s*c,p=s*l-u*o,v=h/p,C=f/p;if(ht.isNaN(v)||ht.isInfinite(v)||ht.isNaN(C)||ht.isInfinite(C))throw new ha;return new R(v,C)};var Q=function r(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof R){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof r){var t=arguments[0];this.init(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];this.init(s,o,a,u)}},Tm={serialVersionUID:{configurable:!0}};Q.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Q.prototype.equals=function(e){if(!(e instanceof Q))return!1;var t=e;return this.isNull()?t.isNull():this._maxx===t.getMaxX()&&this._maxy===t.getMaxY()&&this._minx===t.getMinX()&&this._miny===t.getMinY()},Q.prototype.intersection=function(e){if(this.isNull()||e.isNull()||!this.intersects(e))return new Q;var t=this._minx>e._minx?this._minx:e._minx,n=this._miny>e._miny?this._miny:e._miny,i=this._maxx<e._maxx?this._maxx:e._maxx,s=this._maxy<e._maxy?this._maxy:e._maxy;return new Q(t,i,n,s)},Q.prototype.isNull=function(){return this._maxx<this._minx},Q.prototype.getMaxX=function(){return this._maxx},Q.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof R){var e=arguments[0];return this.covers(e.x,e.y)}else if(arguments[0]instanceof Q){var t=arguments[0];return this.isNull()||t.isNull()?!1:t.getMinX()>=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}},Q.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Q){var e=arguments[0];return this.isNull()||e.isNull()?!1:!(e._minx>this._maxx||e._maxx<this._minx||e._miny>this._maxy||e._maxy<this._miny)}else if(arguments[0]instanceof R){var t=arguments[0];return this.intersects(t.x,t.y)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||i>this._maxy||i<this._miny)}},Q.prototype.getMinY=function(){return this._miny},Q.prototype.getMinX=function(){return this._minx},Q.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof R){var e=arguments[0];this.expandToInclude(e.x,e.y)}else if(arguments[0]instanceof Q){var t=arguments[0];if(t.isNull())return null;this.isNull()?(this._minx=t.getMinX(),this._maxx=t.getMaxX(),this._miny=t.getMinY(),this._maxy=t.getMaxY()):(t._minx<this._minx&&(this._minx=t._minx),t._maxx>this._maxx&&(this._maxx=t._maxx),t._miny<this._miny&&(this._miny=t._miny),t._maxy>this._maxy&&(this._maxy=t._maxy))}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},Q.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e<t?e:t},Q.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Q.prototype.compareTo=function(e){var t=e;return this.isNull()?t.isNull()?0:-1:t.isNull()?1:this._minx<t._minx?-1:this._minx>t._minx?1:this._miny<t._miny?-1:this._miny>t._miny?1:this._maxx<t._maxx?-1:this._maxx>t._maxx?1:this._maxy<t._maxy?-1:this._maxy>t._maxy?1:0},Q.prototype.translate=function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)},Q.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Q.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Q.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Q.prototype.maxExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t},Q.prototype.expandBy=function(){if(arguments.length===1){var e=arguments[0];this.expandBy(e,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Q.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Q){var e=arguments[0];return this.covers(e)}else if(arguments[0]instanceof R){var t=arguments[0];return this.covers(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},Q.prototype.centre=function(){return this.isNull()?null:new R((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Q.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof R){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof Q){var t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];s<o?(this._minx=s,this._maxx=o):(this._minx=o,this._maxx=s),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}},Q.prototype.getMaxY=function(){return this._maxy},Q.prototype.distance=function(e){if(this.intersects(e))return 0;var t=0;this._maxx<e._minx?t=e._minx-this._maxx:this._minx>e._maxx&&(t=this._minx-e._maxx);var n=0;return this._maxy<e._miny?n=e._miny-this._maxy:this._miny>e._maxy&&(n=this._miny-e._maxy),t===0?n:n===0?t:Math.sqrt(t*t+n*n)},Q.prototype.hashCode=function(){var e=17;return e=37*e+R.hashCode(this._minx),e=37*e+R.hashCode(this._maxx),e=37*e+R.hashCode(this._miny),e=37*e+R.hashCode(this._maxy),e},Q.prototype.interfaces_=function(){return[An,kn]},Q.prototype.getClass=function(){return Q},Q.intersects=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2];return n.x>=(e.x<t.x?e.x:t.x)&&n.x<=(e.x>t.x?e.x:t.x)&&n.y>=(e.y<t.y?e.y:t.y)&&n.y<=(e.y>t.y?e.y:t.y)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=Math.min(o.x,a.x),l=Math.max(o.x,a.x),c=Math.min(i.x,s.x),h=Math.max(i.x,s.x);return!(c>l||h<u||(u=Math.min(o.y,a.y),l=Math.max(o.y,a.y),c=Math.min(i.y,s.y),h=Math.max(i.y,s.y),c>l)||h<u)}},Tm.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(Q,Tm);var hr={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},rc=function(e){this.geometryFactory=e||new St};rc.prototype.read=function(e){var t,n,i;e=e.replace(/[\n\r]/g," ");var s=hr.typeStr.exec(e);if(e.search("EMPTY")!==-1&&(s=hr.emptyTypeStr.exec(e),s[2]=void 0),s&&(n=s[1].toLowerCase(),i=s[2],da[n]&&(t=da[n].apply(this,[i]))),t===void 0)throw new Error("Could not parse WKT "+e);return t},rc.prototype.write=function(e){return this.extractGeometry(e)},rc.prototype.extractGeometry=function(e){var t=e.getGeometryType().toLowerCase();if(!mi[t])return null;var n=t.toUpperCase(),i;return e.isEmpty()?i=n+" EMPTY":i=n+"("+mi[t].apply(this,[e])+")",i};var mi={coordinate:function(e){return e.x+" "+e.y},point:function(e){return mi.coordinate.call(this,e._coordinates._coordinates[0])},multipoint:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push("("+mi.point.apply(t,[e._geometries[i]])+")");return n.join(",")},linestring:function(e){for(var t=this,n=[],i=0,s=e._points._coordinates.length;i<s;++i)n.push(mi.coordinate.apply(t,[e._points._coordinates[i]]));return n.join(",")},linearring:function(e){for(var t=this,n=[],i=0,s=e._points._coordinates.length;i<s;++i)n.push(mi.coordinate.apply(t,[e._points._coordinates[i]]));return n.join(",")},multilinestring:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push("("+mi.linestring.apply(t,[e._geometries[i]])+")");return n.join(",")},polygon:function(e){var t=this,n=[];n.push("("+mi.linestring.apply(this,[e._shell])+")");for(var i=0,s=e._holes.length;i<s;++i)n.push("("+mi.linestring.apply(t,[e._holes[i]])+")");return n.join(",")},multipolygon:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push("("+mi.polygon.apply(t,[e._geometries[i]])+")");return n.join(",")},geometrycollection:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push(t.extractGeometry(e._geometries[i]));return n.join(",")}},da={point:function(e){if(e===void 0)return this.geometryFactory.createPoint();var t=e.trim().split(hr.spaces);return this.geometryFactory.createPoint(new R(Number.parseFloat(t[0]),Number.parseFloat(t[1])))},multipoint:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiPoint();for(var n,i=e.trim().split(","),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(hr.trimParens,"$1"),s.push(da.point.apply(t,[n]));return this.geometryFactory.createMultiPoint(s)},linestring:function(e){if(e===void 0)return this.geometryFactory.createLineString();for(var t=e.trim().split(","),n=[],i,s=0,o=t.length;s<o;++s)i=t[s].trim().split(hr.spaces),n.push(new R(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(n)},linearring:function(e){if(e===void 0)return this.geometryFactory.createLinearRing();for(var t=e.trim().split(","),n=[],i,s=0,o=t.length;s<o;++s)i=t[s].trim().split(hr.spaces),n.push(new R(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiLineString();for(var n,i=e.trim().split(hr.parenComma),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(hr.trimParens,"$1"),s.push(da.linestring.apply(t,[n]));return this.geometryFactory.createMultiLineString(s)},polygon:function(e){var t=this;if(e===void 0)return this.geometryFactory.createPolygon();for(var n,i,s,o=e.trim().split(hr.parenComma),a,u=[],l=0,c=o.length;l<c;++l)n=o[l].replace(hr.trimParens,"$1"),i=da.linestring.apply(t,[n]),s=t.geometryFactory.createLinearRing(i._points),l===0?a=s:u.push(s);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiPolygon();for(var n,i=e.trim().split(hr.doubleParenComma),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(hr.trimParens,"$1"),s.push(da.polygon.apply(t,[n]));return this.geometryFactory.createMultiPolygon(s)},geometrycollection:function(e){var t=this;if(e===void 0)return this.geometryFactory.createGeometryCollection();e=e.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=e.trim().split("|"),i=[],s=0,o=n.length;s<o;++s)i.push(t.read(n[s]));return this.geometryFactory.createGeometryCollection(i)}},Zn=function(e){this.parser=new rc(e)};Zn.prototype.write=function(e){return this.parser.write(e)},Zn.toLineString=function(e,t){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+e.x+" "+e.y+", "+t.x+" "+t.y+" )"};var vi=function(r){function e(t){r.call(this,t),this.name="RuntimeException",this.message=t,this.stack=new r().stack}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e}(Error),ic=function(r){function e(){if(r.call(this),arguments.length===0)r.call(this);else if(arguments.length===1){var t=arguments[0];r.call(this,t)}}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(vi),yt=function(){};yt.prototype.interfaces_=function(){return[]},yt.prototype.getClass=function(){return yt},yt.shouldNeverReachHere=function(){if(arguments.length===0)yt.shouldNeverReachHere(null);else if(arguments.length===1){var e=arguments[0];throw new ic("Should never reach here"+(e!==null?": "+e:""))}},yt.isTrue=function(){var e,t;if(arguments.length===1)e=arguments[0],yt.isTrue(e,null);else if(arguments.length===2&&(e=arguments[0],t=arguments[1],!e))throw t===null?new ic:new ic(t)},yt.equals=function(){var e,t,n;if(arguments.length===2)e=arguments[0],t=arguments[1],yt.equals(e,t,null);else if(arguments.length===3&&(e=arguments[0],t=arguments[1],n=arguments[2],!t.equals(e)))throw new ic("Expected "+e+" but encountered "+t+(n!==null?": "+n:""))};var $t=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new R,this._intPt[1]=new R,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},uo={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};$t.prototype.getIndexAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intLineIndex[e][t]},$t.prototype.getTopologySummary=function(){var e=new lr;return this.isEndPoint()&&e.append(" endpoint"),this._isProper&&e.append(" proper"),this.isCollinear()&&e.append(" collinear"),e.toString()},$t.prototype.computeIntersection=function(e,t,n,i){this._inputLines[0][0]=e,this._inputLines[0][1]=t,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(e,t,n,i)},$t.prototype.getIntersectionNum=function(){return this._result},$t.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var e=arguments[0],t=this.getEdgeDistance(e,0),n=this.getEdgeDistance(e,1);t>n?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}},$t.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},$t.prototype.setPrecisionModel=function(e){this._precisionModel=e},$t.prototype.isInteriorIntersection=function(){var e=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var t=arguments[0],n=0;n<this._result;n++)if(!(e._intPt[n].equals2D(e._inputLines[t][0])||e._intPt[n].equals2D(e._inputLines[t][1])))return!0;return!1}},$t.prototype.getIntersection=function(e){return this._intPt[e]},$t.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},$t.prototype.hasIntersection=function(){return this._result!==$t.NO_INTERSECTION},$t.prototype.getEdgeDistance=function(e,t){var n=$t.computeEdgeDistance(this._intPt[t],this._inputLines[e][0],this._inputLines[e][1]);return n},$t.prototype.isCollinear=function(){return this._result===$t.COLLINEAR_INTERSECTION},$t.prototype.toString=function(){return Zn.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Zn.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},$t.prototype.getEndpoint=function(e,t){return this._inputLines[e][t]},$t.prototype.isIntersection=function(e){for(var t=this,n=0;n<this._result;n++)if(t._intPt[n].equals2D(e))return!0;return!1},$t.prototype.getIntersectionAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[e][t]]},$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t},$t.computeEdgeDistance=function(e,t,n){var i=Math.abs(n.x-t.x),s=Math.abs(n.y-t.y),o=-1;if(e.equals(t))o=0;else if(e.equals(n))i>s?o=i:o=s;else{var a=Math.abs(e.x-t.x),u=Math.abs(e.y-t.y);i>s?o=a:o=u,o===0&&!e.equals(t)&&(o=Math.max(a,u))}return yt.isTrue(!(o===0&&!e.equals(t)),"Bad distance calculation"),o},$t.nonRobustComputeEdgeDistance=function(e,t,n){var i=e.x-t.x,s=e.y-t.y,o=Math.sqrt(i*i+s*s);return yt.isTrue(!(o===0&&!e.equals(t)),"Invalid distance calculation"),o},uo.DONT_INTERSECT.get=function(){return 0},uo.DO_INTERSECT.get=function(){return 1},uo.COLLINEAR.get=function(){return 2},uo.NO_INTERSECTION.get=function(){return 0},uo.POINT_INTERSECTION.get=function(){return 1},uo.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties($t,uo);var Cs=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(n){var i=new Q(this._inputLines[0][0],this._inputLines[0][1]),s=new Q(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(n)&&s.contains(n)},e.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];if(this._isProper=!1,Q.intersects(i,s,n)&&q.orientationIndex(i,s,n)===0&&q.orientationIndex(s,i,n)===0)return this._isProper=!0,(n.equals(i)||n.equals(s))&&(this._isProper=!1),this._result=r.POINT_INTERSECTION,null;this._result=r.NO_INTERSECTION}else return r.prototype.computeIntersection.apply(this,arguments)},e.prototype.normalizeToMinimum=function(n,i,s,o,a){a.x=this.smallestInAbsValue(n.x,i.x,s.x,o.x),a.y=this.smallestInAbsValue(n.y,i.y,s.y,o.y),n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},e.prototype.safeHCoordinateIntersection=function(n,i,s,o){var a=null;try{a=Kn.intersection(n,i,s,o)}catch(u){if(u instanceof ha)a=e.nearestEndpoint(n,i,s,o);else throw u}finally{}return a},e.prototype.intersection=function(n,i,s,o){var a=this.intersectionWithNormalization(n,i,s,o);return this.isInSegmentEnvelopes(a)||(a=new R(e.nearestEndpoint(n,i,s,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},e.prototype.smallestInAbsValue=function(n,i,s,o){var a=n,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(s)<u&&(a=s,u=Math.abs(s)),Math.abs(o)<u&&(a=o),a},e.prototype.checkDD=function(n,i,s,o,a){var u=en.intersection(n,i,s,o),l=this.isInSegmentEnvelopes(u);Te.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&Te.out.println("Distance = "+a.distance(u))},e.prototype.intersectionWithNormalization=function(n,i,s,o){var a=new R(n),u=new R(i),l=new R(s),c=new R(o),h=new R;this.normalizeToEnvCentre(a,u,l,c,h);var f=this.safeHCoordinateIntersection(a,u,l,c);return f.x+=h.x,f.y+=h.y,f},e.prototype.computeCollinearIntersection=function(n,i,s,o){var a=Q.intersects(n,i,s),u=Q.intersects(n,i,o),l=Q.intersects(s,o,n),c=Q.intersects(s,o,i);return a&&u?(this._intPt[0]=s,this._intPt[1]=o,r.COLLINEAR_INTERSECTION):l&&c?(this._intPt[0]=n,this._intPt[1]=i,r.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!u&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!u&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!a&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!a&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):r.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(n,i,s,o,a){var u=n.x<i.x?n.x:i.x,l=n.y<i.y?n.y:i.y,c=n.x>i.x?n.x:i.x,h=n.y>i.y?n.y:i.y,f=s.x<o.x?s.x:o.x,p=s.y<o.y?s.y:o.y,v=s.x>o.x?s.x:o.x,C=s.y>o.y?s.y:o.y,S=u>f?u:f,P=c<v?c:v,y=l>p?l:p,_=h<C?h:C,m=(S+P)/2,w=(y+_)/2;a.x=m,a.y=w,n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},e.prototype.computeIntersect=function(n,i,s,o){if(this._isProper=!1,!Q.intersects(n,i,s,o))return r.NO_INTERSECTION;var a=q.orientationIndex(n,i,s),u=q.orientationIndex(n,i,o);if(a>0&&u>0||a<0&&u<0)return r.NO_INTERSECTION;var l=q.orientationIndex(s,o,n),c=q.orientationIndex(s,o,i);if(l>0&&c>0||l<0&&c<0)return r.NO_INTERSECTION;var h=a===0&&u===0&&l===0&&c===0;return h?this.computeCollinearIntersection(n,i,s,o):(a===0||u===0||l===0||c===0?(this._isProper=!1,n.equals2D(s)||n.equals2D(o)?this._intPt[0]=n:i.equals2D(s)||i.equals2D(o)?this._intPt[0]=i:a===0?this._intPt[0]=new R(s):u===0?this._intPt[0]=new R(o):l===0?this._intPt[0]=new R(n):c===0&&(this._intPt[0]=new R(i))):(this._isProper=!0,this._intPt[0]=this.intersection(n,i,s,o)),r.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(n,i,s,o){var a=n,u=q.distancePointLine(n,s,o),l=q.distancePointLine(i,s,o);return l<u&&(u=l,a=i),l=q.distancePointLine(s,n,i),l<u&&(u=l,a=s),l=q.distancePointLine(o,n,i),l<u&&(u=l,a=o),a},e}($t),lo=function(){};lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo},lo.orientationIndex=function(e,t,n){var i=t.x-e.x,s=t.y-e.y,o=n.x-t.x,a=n.y-t.y;return lo.signOfDet2x2(i,s,o,a)},lo.signOfDet2x2=function(e,t,n,i){var s=null,o=null,a=null;if(s=1,e===0||i===0)return t===0||n===0?0:t>0?n>0?-s:s:n>0?s:-s;if(t===0||n===0)return i>0?e>0?s:-s:e>0?-s:s;if(t>0?i>0?t<=i||(s=-s,o=e,e=n,n=o,o=t,t=i,i=o):t<=-i?(s=-s,n=-n,i=-i):(o=e,e=-n,n=o,o=t,t=-i,i=o):i>0?-t<=i?(s=-s,e=-e,t=-t):(o=-e,e=n,n=o,o=-t,t=i,i=o):t>=i?(e=-e,t=-t,n=-n,i=-i):(s=-s,o=-e,e=-n,n=o,o=-t,t=-i,i=o),e>0)if(n>0){if(!(e<=n))return s}else return s;else{if(n>0)return-s;if(e>=n)s=-s,e=-e,n=-n;else return-s}for(;;){if(a=Math.floor(n/e),n=n-a*e,i=i-a*t,i<0)return-s;if(i>t)return s;if(e>n+n){if(t<i+i)return s}else{if(t>i+i)return-s;n=e-n,i=t-i,s=-s}if(i===0)return n===0?0:-s;if(n===0||(a=Math.floor(e/n),e=e-a*n,t=t-a*i,t<0))return s;if(t>i)return-s;if(n>e+e){if(i<t+t)return-s}else{if(i>t+t)return s;e=n-e,t=i-t,s=-s}if(t===0)return e===0?0:s;if(e===0)return-s}};var dr=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e};dr.prototype.countSegment=function(e,t){if(e.x<this._p.x&&t.x<this._p.x)return null;if(this._p.x===t.x&&this._p.y===t.y)return this._isPointOnSegment=!0,null;if(e.y===this._p.y&&t.y===this._p.y){var n=e.x,i=t.x;return n>i&&(n=t.x,i=e.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(e.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&e.y<=this._p.y){var s=e.x-this._p.x,o=e.y-this._p.y,a=t.x-this._p.x,u=t.y-this._p.y,l=lo.signOfDet2x2(s,o,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<o&&(l=-l),l>0&&this._crossingCount++}},dr.prototype.isPointInPolygon=function(){return this.getLocation()!==F.EXTERIOR},dr.prototype.getLocation=function(){return this._isPointOnSegment?F.BOUNDARY:this._crossingCount%2===1?F.INTERIOR:F.EXTERIOR},dr.prototype.isOnSegment=function(){return this._isPointOnSegment},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},dr.locatePointInRing=function(){if(arguments[0]instanceof R&&at(arguments[1],Ot)){for(var e=arguments[0],t=arguments[1],n=new dr(e),i=new R,s=new R,o=1;o<t.size();o++)if(t.getCoordinate(o,i),t.getCoordinate(o-1,s),n.countSegment(i,s),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof R&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new dr(a),c=1;c<u.length;c++){var h=u[c],f=u[c-1];if(l.countSegment(h,f),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var q=function(){},co={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};q.prototype.interfaces_=function(){return[]},q.prototype.getClass=function(){return q},q.orientationIndex=function(e,t,n){return en.orientationIndex(e,t,n)},q.signedArea=function(){if(arguments[0]instanceof Array){var e=arguments[0];if(e.length<3)return 0;for(var t=0,n=e[0].x,i=1;i<e.length-1;i++){var s=e[i].x-n,o=e[i+1].y,a=e[i-1].y;t+=s*(a-o)}return t/2}else if(at(arguments[0],Ot)){var u=arguments[0],l=u.size();if(l<3)return 0;var c=new R,h=new R,f=new R;u.getCoordinate(0,h),u.getCoordinate(1,f);var p=h.x;f.x-=p;for(var v=0,C=1;C<l-1;C++)c.y=h.y,h.x=f.x,h.y=f.y,u.getCoordinate(C+1,f),f.x-=p,v+=h.x*(c.y-f.y);return v/2}},q.distanceLineLine=function(e,t,n,i){if(e.equals(t))return q.distancePointLine(e,n,i);if(n.equals(i))return q.distancePointLine(i,e,t);var s=!1;if(!Q.intersects(e,t,n,i))s=!0;else{var o=(t.x-e.x)*(i.y-n.y)-(t.y-e.y)*(i.x-n.x);if(o===0)s=!0;else{var a=(e.y-n.y)*(i.x-n.x)-(e.x-n.x)*(i.y-n.y),u=(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y),l=u/o,c=a/o;(c<0||c>1||l<0||l>1)&&(s=!0)}}return s?xn.min(q.distancePointLine(e,n,i),q.distancePointLine(t,n,i),q.distancePointLine(n,e,t),q.distancePointLine(i,e,t)):0},q.isPointInRing=function(e,t){return q.locatePointInRing(e,t)!==F.EXTERIOR},q.computeLength=function(e){var t=e.size();if(t<=1)return 0;var n=0,i=new R;e.getCoordinate(0,i);for(var s=i.x,o=i.y,a=1;a<t;a++){e.getCoordinate(a,i);var u=i.x,l=i.y,c=u-s,h=l-o;n+=Math.sqrt(c*c+h*h),s=u,o=l}return n},q.isCCW=function(e){var t=e.length-1;if(t<3)throw new Yt("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=e[0],i=0,s=1;s<=t;s++){var o=e[s];o.y>n.y&&(n=o,i=s)}var a=i;do a=a-1,a<0&&(a=t);while(e[a].equals2D(n)&&a!==i);var u=i;do u=(u+1)%t;while(e[u].equals2D(n)&&u!==i);var l=e[a],c=e[u];if(l.equals2D(n)||c.equals2D(n)||l.equals2D(c))return!1;var h=q.computeOrientation(l,n,c),f=!1;return h===0?f=l.x>c.x:f=h>0,f},q.locatePointInRing=function(e,t){return dr.locatePointInRing(e,t)},q.distancePointLinePerpendicular=function(e,t,n){var i=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y),s=((t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y))/i;return Math.abs(s)*Math.sqrt(i)},q.computeOrientation=function(e,t,n){return q.orientationIndex(e,t,n)},q.distancePointLine=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(t.length===0)throw new Yt("Line array must contain at least one vertex");for(var n=e.distance(t[0]),i=0;i<t.length-1;i++){var s=q.distancePointLine(e,t[i],t[i+1]);s<n&&(n=s)}return n}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return o.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((o.x-a.x)*(u.x-a.x)+(o.y-a.y)*(u.y-a.y))/l;if(c<=0)return o.distance(a);if(c>=1)return o.distance(u);var h=((a.y-o.y)*(u.x-a.x)-(a.x-o.x)*(u.y-a.y))/l;return Math.abs(h)*Math.sqrt(l)}},q.isOnLine=function(e,t){for(var n=new Cs,i=1;i<t.length;i++){var s=t[i-1],o=t[i];if(n.computeIntersection(e,s,o),n.hasIntersection())return!0}return!1},co.CLOCKWISE.get=function(){return-1},co.RIGHT.get=function(){return q.CLOCKWISE},co.COUNTERCLOCKWISE.get=function(){return 1},co.LEFT.get=function(){return q.COUNTERCLOCKWISE},co.COLLINEAR.get=function(){return 0},co.STRAIGHT.get=function(){return q.COLLINEAR},Object.defineProperties(q,co);var yi=function(){};yi.prototype.filter=function(e){},yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi};var ot=function(){var e=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=e,this._SRID=e.getSRID()},Gr={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};ot.prototype.isGeometryCollection=function(){return this.getSortIndex()===ot.SORTINDEX_GEOMETRYCOLLECTION},ot.prototype.getFactory=function(){return this._factory},ot.prototype.getGeometryN=function(e){return this},ot.prototype.getArea=function(){return 0},ot.prototype.isRectangle=function(){return!1},ot.prototype.equals=function(){if(arguments[0]instanceof ot){var e=arguments[0];return e===null?!1:this.equalsTopo(e)}else if(arguments[0]instanceof Object){var t=arguments[0];if(!(t instanceof ot))return!1;var n=t;return this.equalsExact(n)}},ot.prototype.equalsExact=function(e){return this===e||this.equalsExact(e,0)},ot.prototype.geometryChanged=function(){this.apply(ot.geometryChangedFilter)},ot.prototype.geometryChangedAction=function(){this._envelope=null},ot.prototype.equalsNorm=function(e){return e===null?!1:this.norm().equalsExact(e.norm())},ot.prototype.getLength=function(){return 0},ot.prototype.getNumGeometries=function(){return 1},ot.prototype.compareTo=function(){if(arguments.length===1){var e=arguments[0],t=e;return this.getSortIndex()!==t.getSortIndex()?this.getSortIndex()-t.getSortIndex():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(e)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,i)}},ot.prototype.getUserData=function(){return this._userData},ot.prototype.getSRID=function(){return this._SRID},ot.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ot.prototype.checkNotGeometryCollection=function(e){if(e.getSortIndex()===ot.SORTINDEX_GEOMETRYCOLLECTION)throw new Yt("This method does not support GeometryCollection arguments")},ot.prototype.equal=function(e,t,n){return n===0?e.equals(t):e.distance(t)<=n},ot.prototype.norm=function(){var e=this.copy();return e.normalize(),e},ot.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ot.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new Q(this._envelope)},ot.prototype.setSRID=function(e){this._SRID=e},ot.prototype.setUserData=function(e){this._userData=e},ot.prototype.compare=function(e,t){for(var n=e.iterator(),i=t.iterator();n.hasNext()&&i.hasNext();){var s=n.next(),o=i.next(),a=s.compareTo(o);if(a!==0)return a}return n.hasNext()?1:i.hasNext()?-1:0},ot.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ot.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ot.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ot.SORTINDEX_MULTIPOINT||this.getSortIndex()===ot.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ot.SORTINDEX_MULTIPOLYGON},ot.prototype.interfaces_=function(){return[nc,An,kn]},ot.prototype.getClass=function(){return ot},ot.hasNonEmptyElements=function(e){for(var t=0;t<e.length;t++)if(!e[t].isEmpty())return!0;return!1},ot.hasNullElements=function(e){for(var t=0;t<e.length;t++)if(e[t]===null)return!0;return!1},Gr.serialVersionUID.get=function(){return 8763622679187377e3},Gr.SORTINDEX_POINT.get=function(){return 0},Gr.SORTINDEX_MULTIPOINT.get=function(){return 1},Gr.SORTINDEX_LINESTRING.get=function(){return 2},Gr.SORTINDEX_LINEARRING.get=function(){return 3},Gr.SORTINDEX_MULTILINESTRING.get=function(){return 4},Gr.SORTINDEX_POLYGON.get=function(){return 5},Gr.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Gr.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Gr.geometryChangedFilter.get=function(){return od},Object.defineProperties(ot,Gr);var od=function(){};od.interfaces_=function(){return[yi]},od.filter=function(e){e.geometryChangedAction()};var Wr=function(){};Wr.prototype.filter=function(e){},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var Vn=function(){},_i={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Vn.prototype.isInBoundary=function(e){},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn},_i.Mod2BoundaryNodeRule.get=function(){return fa},_i.EndPointBoundaryNodeRule.get=function(){return pa},_i.MultiValentEndPointBoundaryNodeRule.get=function(){return ga},_i.MonoValentEndPointBoundaryNodeRule.get=function(){return ma},_i.MOD2_BOUNDARY_RULE.get=function(){return new fa},_i.ENDPOINT_BOUNDARY_RULE.get=function(){return new pa},_i.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new ga},_i.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new ma},_i.OGC_SFS_BOUNDARY_RULE.get=function(){return Vn.MOD2_BOUNDARY_RULE},Object.defineProperties(Vn,_i);var fa=function(){};fa.prototype.isInBoundary=function(e){return e%2===1},fa.prototype.interfaces_=function(){return[Vn]},fa.prototype.getClass=function(){return fa};var pa=function(){};pa.prototype.isInBoundary=function(e){return e>0},pa.prototype.interfaces_=function(){return[Vn]},pa.prototype.getClass=function(){return pa};var ga=function(){};ga.prototype.isInBoundary=function(e){return e>1},ga.prototype.interfaces_=function(){return[Vn]},ga.prototype.getClass=function(){return ga};var ma=function(){};ma.prototype.isInBoundary=function(e){return e===1},ma.prototype.interfaces_=function(){return[Vn]},ma.prototype.getClass=function(){return ma};var fe=function(){};fe.prototype.add=function(){},fe.prototype.addAll=function(){},fe.prototype.isEmpty=function(){},fe.prototype.iterator=function(){},fe.prototype.size=function(){},fe.prototype.toArray=function(){},fe.prototype.remove=function(){};function ad(r){this.message=r||""}ad.prototype=new Error,ad.prototype.name="IndexOutOfBoundsException";var va=function(){};va.prototype.hasNext=function(){},va.prototype.next=function(){},va.prototype.remove=function(){};var Qn=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(fe);function ya(r){this.message=r||""}ya.prototype=new Error,ya.prototype.name="NoSuchElementException";var W=function(r){function e(){r.call(this),this.array_=[],arguments[0]instanceof fe&&this.addAll(arguments[0])}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[r,fe]},e.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(n){for(var i=this,s=n.iterator();s.hasNext();)i.add(s.next());return!0},e.prototype.set=function(n,i){var s=this.array_[n];return this.array_[n]=i,s},e.prototype.iterator=function(){return new zE(this)},e.prototype.get=function(n){if(n<0||n>=this.size())throw new ad;return this.array_[n]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var n=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(n.array_[s]);return i},e.prototype.remove=function(n){for(var i=this,s=!1,o=0,a=this.array_.length;o<a;o++)if(i.array_[o]===n){i.array_.splice(o,1),s=!0;break}return s},e}(Qn),zE=function(r){function e(t){r.call(this),this.arrayList_=t,this.position_=0}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new ya;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(va),Wu=function(r){function e(){if(r.call(this),arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.ensureCapacity(i.length),this.add(i,s)}}}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={coordArrayType:{configurable:!0}};return t.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(i){return this.get(i)},e.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=!1,u=s.iterator();u.hasNext();)i.add(u.next(),o),a=!0;return a}else return r.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var i=this,s=r.prototype.clone.call(this),o=0;o<this.size();o++)s.add(o,i.get(o).copy());return s},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){var i=this;if(arguments.length===1){var s=arguments[0];r.prototype.add.call(this,s)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1];return this.add(o,a,!0),!0}else if(arguments[0]instanceof R&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(u))return null}r.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var h=arguments[0],f=arguments[1];return this.add(h,f),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var p=arguments[0],v=arguments[1],C=arguments[2];if(C)for(var S=0;S<p.length;S++)i.add(p[S],v);else for(var P=p.length-1;P>=0;P--)i.add(p[P],v);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof R){var y=arguments[0],_=arguments[1],m=arguments[2];if(!m){var w=this.size();if(w>0){if(y>0){var E=this.get(y-1);if(E.equals2D(_))return null}if(y<w){var b=this.get(y);if(b.equals2D(_))return null}}}r.prototype.add.call(this,y,_)}}else if(arguments.length===4){var I=arguments[0],T=arguments[1],D=arguments[2],x=arguments[3],N=1;D>x&&(N=-1);for(var L=D;L!==x;L+=N)i.add(I[L],T);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new R(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,t),e}(W),Ct=function(){},sc={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};sc.ForwardComparator.get=function(){return Hu},sc.BidirectionalComparator.get=function(){return _a},sc.coordArrayType.get=function(){return new Array(0).fill(null)},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.isRing=function(e){return!(e.length<4||!e[0].equals2D(e[e.length-1]))},Ct.ptNotInList=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(Ct.indexOf(i,t)<0)return i}return null},Ct.scroll=function(e,t){var n=Ct.indexOf(t,e);if(n<0)return null;var i=new Array(e.length).fill(null);Te.arraycopy(e,n,i,0,e.length-n),Te.arraycopy(e,0,i,e.length-n,n),Te.arraycopy(i,0,e,0,e.length)},Ct.equals=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(e===t)return!0;if(e===null||t===null||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].equals(t[n]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(i===s)return!0;if(i===null||s===null||i.length!==s.length)return!1;for(var a=0;a<i.length;a++)if(o.compare(i[a],s[a])!==0)return!1;return!0}},Ct.intersection=function(e,t){for(var n=new Wu,i=0;i<e.length;i++)t.intersects(e[i])&&n.add(e[i],!0);return n.toCoordinateArray()},Ct.hasRepeatedPoints=function(e){for(var t=1;t<e.length;t++)if(e[t-1].equals(e[t]))return!0;return!1},Ct.removeRepeatedPoints=function(e){if(!Ct.hasRepeatedPoints(e))return e;var t=new Wu(e,!1);return t.toCoordinateArray()},Ct.reverse=function(e){for(var t=e.length-1,n=Math.trunc(t/2),i=0;i<=n;i++){var s=e[i];e[i]=e[t-i],e[t-i]=s}},Ct.removeNull=function(e){for(var t=0,n=0;n<e.length;n++)e[n]!==null&&t++;var i=new Array(t).fill(null);if(t===0)return i;for(var s=0,o=0;o<e.length;o++)e[o]!==null&&(i[s++]=e[o]);return i},Ct.copyDeep=function(){if(arguments.length===1){for(var e=arguments[0],t=new Array(e.length).fill(null),n=0;n<e.length;n++)t[n]=new R(e[n]);return t}else if(arguments.length===5)for(var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)o[a+l]=new R(i[s+l])},Ct.isEqualReversed=function(e,t){for(var n=0;n<e.length;n++){var i=e[n],s=t[e.length-n-1];if(i.compareTo(s)!==0)return!1}return!0},Ct.envelope=function(e){for(var t=new Q,n=0;n<e.length;n++)t.expandToInclude(e[n]);return t},Ct.toCoordinateArray=function(e){return e.toArray(Ct.coordArrayType)},Ct.atLeastNCoordinatesOrNothing=function(e,t){return t.length>=e?t:[]},Ct.indexOf=function(e,t){for(var n=0;n<t.length;n++)if(e.equals(t[n]))return n;return-1},Ct.increasingDirection=function(e){for(var t=0;t<Math.trunc(e.length/2);t++){var n=e.length-1-t,i=e[t].compareTo(e[n]);if(i!==0)return i}return 1},Ct.compare=function(e,t){for(var n=0;n<e.length&&n<t.length;){var i=e[n].compareTo(t[n]);if(i!==0)return i;n++}return n<t.length?-1:n<e.length?1:0},Ct.minCoordinate=function(e){for(var t=null,n=0;n<e.length;n++)(t===null||t.compareTo(e[n])>0)&&(t=e[n]);return t},Ct.extract=function(e,t,n){t=xn.clamp(t,0,e.length),n=xn.clamp(n,-1,e.length);var i=n-t+1;n<0&&(i=0),t>=e.length&&(i=0),n<t&&(i=0);var s=new Array(i).fill(null);if(i===0)return s;for(var o=0,a=t;a<=n;a++)s[o++]=e[a];return s},Object.defineProperties(Ct,sc);var Hu=function(){};Hu.prototype.compare=function(e,t){var n=e,i=t;return Ct.compare(n,i)},Hu.prototype.interfaces_=function(){return[la]},Hu.prototype.getClass=function(){return Hu};var _a=function(){};_a.prototype.compare=function(e,t){var n=e,i=t;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;var s=Ct.compare(n,i),o=Ct.isEqualReversed(n,i);return o?0:s},_a.prototype.OLDcompare=function(e,t){var n=e,i=t;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;for(var s=Ct.increasingDirection(n),o=Ct.increasingDirection(i),a=s>0?0:n.length-1,u=o>0?0:n.length-1,l=0;l<n.length;l++){var c=n[a].compareTo(i[u]);if(c!==0)return c;a+=s,u+=o}return 0},_a.prototype.interfaces_=function(){return[la]},_a.prototype.getClass=function(){return _a};var ho=function(){};ho.prototype.get=function(){},ho.prototype.put=function(){},ho.prototype.size=function(){},ho.prototype.values=function(){},ho.prototype.entrySet=function(){};var UE=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e}(ho);function qu(r){this.message=r||""}qu.prototype=new Error,qu.prototype.name="OperationNotSupported";function oc(){}oc.prototype=new fe,oc.prototype.contains=function(){};var ud=function(r){function e(){r.call(this),this.array_=[],arguments[0]instanceof fe&&this.addAll(arguments[0])}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.contains=function(n){for(var i=this,s=0,o=this.array_.length;s<o;s++){var a=i.array_[s];if(a===n)return!0}return!1},e.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},e.prototype.addAll=function(n){for(var i=this,s=n.iterator();s.hasNext();)i.add(s.next());return!0},e.prototype.remove=function(n){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.toArray=function(){for(var n=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(n.array_[s]);return i},e.prototype.iterator=function(){return new GE(this)},e}(oc),GE=function(r){function e(t){r.call(this),this.hashSet_=t,this.position_=0}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new ya;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new qu},e}(va),wi=0,Ss=1;function Om(r){return r===null?wi:r.color}function Gt(r){return r===null?null:r.parent}function Ei(r,e){r!==null&&(r.color=e)}function ld(r){return r===null?null:r.left}function Nm(r){return r===null?null:r.right}function ke(){this.root_=null,this.size_=0}ke.prototype=new UE,ke.prototype.get=function(r){for(var e=this.root_;e!==null;){var t=r.compareTo(e.key);if(t<0)e=e.left;else if(t>0)e=e.right;else return e.value}return null},ke.prototype.put=function(r,e){if(this.root_===null)return this.root_={key:r,value:e,left:null,right:null,parent:null,color:wi,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var t=this.root_,n,i;do if(n=t,i=r.compareTo(t.key),i<0)t=t.left;else if(i>0)t=t.right;else{var s=t.value;return t.value=e,s}while(t!==null);var o={key:r,left:null,right:null,value:e,parent:n,color:wi,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=o:n.right=o,this.fixAfterInsertion(o),this.size_++,null},ke.prototype.fixAfterInsertion=function(r){var e=this;for(r.color=Ss;r!=null&&r!==this.root_&&r.parent.color===Ss;)if(Gt(r)===ld(Gt(Gt(r)))){var t=Nm(Gt(Gt(r)));Om(t)===Ss?(Ei(Gt(r),wi),Ei(t,wi),Ei(Gt(Gt(r)),Ss),r=Gt(Gt(r))):(r===Nm(Gt(r))&&(r=Gt(r),e.rotateLeft(r)),Ei(Gt(r),wi),Ei(Gt(Gt(r)),Ss),e.rotateRight(Gt(Gt(r))))}else{var n=ld(Gt(Gt(r)));Om(n)===Ss?(Ei(Gt(r),wi),Ei(n,wi),Ei(Gt(Gt(r)),Ss),r=Gt(Gt(r))):(r===ld(Gt(r))&&(r=Gt(r),e.rotateRight(r)),Ei(Gt(r),wi),Ei(Gt(Gt(r)),Ss),e.rotateLeft(Gt(Gt(r))))}this.root_.color=wi},ke.prototype.values=function(){var r=new W,e=this.getFirstEntry();if(e!==null)for(r.add(e.value);(e=ke.successor(e))!==null;)r.add(e.value);return r},ke.prototype.entrySet=function(){var r=new ud,e=this.getFirstEntry();if(e!==null)for(r.add(e);(e=ke.successor(e))!==null;)r.add(e);return r},ke.prototype.rotateLeft=function(r){if(r!=null){var e=r.right;r.right=e.left,e.left!=null&&(e.left.parent=r),e.parent=r.parent,r.parent===null?this.root_=e:r.parent.left===r?r.parent.left=e:r.parent.right=e,e.left=r,r.parent=e}},ke.prototype.rotateRight=function(r){if(r!=null){var e=r.left;r.left=e.right,e.right!=null&&(e.right.parent=r),e.parent=r.parent,r.parent===null?this.root_=e:r.parent.right===r?r.parent.right=e:r.parent.left=e,e.right=r,r.parent=e}},ke.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},ke.successor=function(r){if(r===null)return null;if(r.right!==null){for(var e=r.right;e.left!==null;)e=e.left;return e}else{for(var t=r.parent,n=r;t!==null&&n===t.right;)n=t,t=t.parent;return t}},ke.prototype.size=function(){return this.size_};var Xu=function(){};Xu.prototype.interfaces_=function(){return[]},Xu.prototype.getClass=function(){return Xu};function Dm(){}Dm.prototype=new oc;function fr(){this.array_=[],arguments[0]instanceof fe&&this.addAll(arguments[0])}fr.prototype=new Dm,fr.prototype.contains=function(r){for(var e=this,t=0,n=this.array_.length;t<n;t++){var i=e.array_[t];if(i.compareTo(r)===0)return!0}return!1},fr.prototype.add=function(r){var e=this;if(this.contains(r))return!1;for(var t=0,n=this.array_.length;t<n;t++){var i=e.array_[t];if(i.compareTo(r)===1)return e.array_.splice(t,0,r),!0}return this.array_.push(r),!0},fr.prototype.addAll=function(r){for(var e=this,t=r.iterator();t.hasNext();)e.add(t.next());return!0},fr.prototype.remove=function(r){throw new qu},fr.prototype.size=function(){return this.array_.length},fr.prototype.isEmpty=function(){return this.array_.length===0},fr.prototype.toArray=function(){for(var r=this,e=[],t=0,n=this.array_.length;t<n;t++)e.push(r.array_[t]);return e},fr.prototype.iterator=function(){return new ac(this)};var ac=function(r){this.treeSet_=r,this.position_=0};ac.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new ya;return this.treeSet_.array_[this.position_++]},ac.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},ac.prototype.remove=function(){throw new qu};var bs=function(){};bs.sort=function(){var e=arguments[0],t,n,i,s;if(arguments.length===1)s=function(a,u){return a.compareTo(u)},e.sort(s);else if(arguments.length===2)i=arguments[1],s=function(a,u){return i.compare(a,u)},e.sort(s);else if(arguments.length===3){n=e.slice(arguments[1],arguments[2]),n.sort();var o=e.slice(0,arguments[1]).concat(n,e.slice(arguments[2],e.length));for(e.splice(0,e.length),t=0;t<o.length;t++)e.push(o[t])}else if(arguments.length===4)for(n=e.slice(arguments[1],arguments[2]),i=arguments[3],s=function(a,u){return i.compare(a,u)},n.sort(s),o=e.slice(0,arguments[1]).concat(n,e.slice(arguments[2],e.length)),e.splice(0,e.length),t=0;t<o.length;t++)e.push(o[t])},bs.asList=function(e){for(var t=new W,n=0,i=e.length;n<i;n++)t.add(e[n]);return t};var Rt=function(){},tr={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};tr.P.get=function(){return 0},tr.L.get=function(){return 1},tr.A.get=function(){return 2},tr.FALSE.get=function(){return-1},tr.TRUE.get=function(){return-2},tr.DONTCARE.get=function(){return-3},tr.SYM_FALSE.get=function(){return"F"},tr.SYM_TRUE.get=function(){return"T"},tr.SYM_DONTCARE.get=function(){return"*"},tr.SYM_P.get=function(){return"0"},tr.SYM_L.get=function(){return"1"},tr.SYM_A.get=function(){return"2"},Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt},Rt.toDimensionSymbol=function(e){switch(e){case Rt.FALSE:return Rt.SYM_FALSE;case Rt.TRUE:return Rt.SYM_TRUE;case Rt.DONTCARE:return Rt.SYM_DONTCARE;case Rt.P:return Rt.SYM_P;case Rt.L:return Rt.SYM_L;case Rt.A:return Rt.SYM_A}throw new Yt("Unknown dimension value: "+e)},Rt.toDimensionValue=function(e){switch(Uu.toUpperCase(e)){case Rt.SYM_FALSE:return Rt.FALSE;case Rt.SYM_TRUE:return Rt.TRUE;case Rt.SYM_DONTCARE:return Rt.DONTCARE;case Rt.SYM_P:return Rt.P;case Rt.SYM_L:return Rt.L;case Rt.SYM_A:return Rt.A}throw new Yt("Unknown dimension symbol: "+e)},Object.defineProperties(Rt,tr);var pr=function(){};pr.prototype.filter=function(e){},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr};var er=function(){};er.prototype.filter=function(e,t){},er.prototype.isDone=function(){},er.prototype.isGeometryChanged=function(){},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er};var Ge=function(r){function e(n,i){if(r.call(this,i),this._geometries=n||[],r.hasNullElements(this._geometries))throw new Yt("geometries must not contain null elements")}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var i=this,s=new Q,o=0;o<this._geometries.length;o++)s.expandToInclude(i._geometries[o].getEnvelopeInternal());return s},e.prototype.getGeometryN=function(i){return this._geometries[i]},e.prototype.getSortIndex=function(){return r.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var i=this,s=new Array(this.getNumPoints()).fill(null),o=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)o++,s[o]=u[l];return s},e.prototype.getArea=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getArea();return s},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._geometries.length!==a._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(a._geometries[u],o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var i=this,s=0;s<this._geometries.length;s++)i._geometries[s].normalize();bs.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var i=this,s=Rt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getBoundaryDimension());return s},e.prototype.getDimension=function(){for(var i=this,s=Rt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getDimension());return s},e.prototype.getLength=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getLength();return s},e.prototype.getNumPoints=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getNumPoints();return s},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(o)},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=new fr(bs.asList(this._geometries)),a=new fr(bs.asList(s._geometries));return this.compare(o,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],c=u,h=this.getNumGeometries(),f=c.getNumGeometries(),p=0;p<h&&p<f;){var v=i.getGeometryN(p),C=c.getGeometryN(p),S=v.compareToSameClass(C,l);if(S!==0)return S;p++}return p<h?1:p<f?-1:0}},e.prototype.apply=function(){var i=this;if(at(arguments[0],Wr))for(var s=arguments[0],o=0;o<this._geometries.length;o++)i._geometries[o].apply(s);else if(at(arguments[0],er)){var a=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(a),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(at(arguments[0],pr)){var l=arguments[0];l.filter(this);for(var c=0;c<this._geometries.length;c++)i._geometries[c].apply(l)}else if(at(arguments[0],yi)){var h=arguments[0];h.filter(this);for(var f=0;f<this._geometries.length;f++)i._geometries[f].apply(h)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),yt.shouldNeverReachHere(),null},e.prototype.clone=function(){var i=this,s=r.prototype.clone.call(this);s._geometries=new Array(this._geometries.length).fill(null);for(var o=0;o<this._geometries.length;o++)s._geometries[o]=i._geometries[o].clone();return s},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.isEmpty=function(){for(var i=this,s=0;s<this._geometries.length;s++)if(!i._geometries[s].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(e,t),e}(ot),Ps=function(r){function e(){r.apply(this,arguments)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Rt.FALSE:0},e.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var s=0;s<this._geometries.length;s++)if(!i._geometries[s].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[s-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(o)},e.prototype.getBoundary=function(){return new jn(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.interfaces_=function(){return[Xu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(e,t),e}(Ge),jn=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var e=arguments[0],t=Vn.MOD2_BOUNDARY_RULE;this._geom=e,this._geomFact=e.getFactory(),this._bnRule=t}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}};jn.prototype.boundaryMultiLineString=function(e){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var t=this.computeBoundaryCoordinates(e);return t.length===1?this._geomFact.createPoint(t[0]):this._geomFact.createMultiPointFromCoords(t)},jn.prototype.getBoundary=function(){return this._geom instanceof te?this.boundaryLineString(this._geom):this._geom instanceof Ps?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},jn.prototype.boundaryLineString=function(e){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(e.isClosed()){var t=this._bnRule.isInBoundary(2);return t?e.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([e.getStartPoint(),e.getEndPoint()])},jn.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},jn.prototype.computeBoundaryCoordinates=function(e){var t=this,n=new W;this._endpointMap=new ke;for(var i=0;i<e.getNumGeometries();i++){var s=e.getGeometryN(i);s.getNumPoints()!==0&&(t.addEndpoint(s.getCoordinateN(0)),t.addEndpoint(s.getCoordinateN(s.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var a=o.next(),u=a.getValue(),l=u.count;t._bnRule.isInBoundary(l)&&n.add(a.getKey())}return Ct.toCoordinateArray(n)},jn.prototype.addEndpoint=function(e){var t=this._endpointMap.get(e);t===null&&(t=new uc,this._endpointMap.put(e,t)),t.count++},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.getBoundary=function(){if(arguments.length===1){var e=arguments[0],t=new jn(e);return t.getBoundary()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=new jn(n,i);return s.getBoundary()}};var uc=function(){this.count=null};uc.prototype.interfaces_=function(){return[]},uc.prototype.getClass=function(){return uc};function WE(){}function HE(){}var qE=function(){};function XE(){}function YE(){}function JE(){}var Bn=function(){},cd={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},Bn.chars=function(e,t){for(var n=new Array(t).fill(null),i=0;i<t;i++)n[i]=e;return String(n)},Bn.getStackTrace=function(){if(arguments.length===1){var e=arguments[0],t=new XE,n=new WE;return e.printStackTrace(n),t.toString()}else if(arguments.length===2){var i=arguments[0],s=arguments[1],o="";new HE(Bn.getStackTrace(i));for(var a=new JE,u=0;u<s;u++)try{o+=a.readLine()+Bn.NEWLINE}catch(l){if(l instanceof YE)yt.shouldNeverReachHere();else throw l}finally{}return o}},Bn.split=function(e,t){for(var n=t.length,i=new W,s=""+e,o=s.indexOf(t);o>=0;){var a=s.substring(0,o);i.add(a),s=s.substring(o+n),o=s.indexOf(t)}s.length>0&&i.add(s);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},Bn.toString=function(){if(arguments.length===1){var e=arguments[0];return Bn.SIMPLE_ORDINATE_FORMAT.format(e)}},Bn.spaces=function(e){return Bn.chars(" ",e)},cd.NEWLINE.get=function(){return Te.getProperty("line.separator")},cd.SIMPLE_ORDINATE_FORMAT.get=function(){return new qE},Object.defineProperties(Bn,cd);var ie=function(){};ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie},ie.copyCoord=function(e,t,n,i){for(var s=Math.min(e.getDimension(),n.getDimension()),o=0;o<s;o++)n.setOrdinate(i,o,e.getOrdinate(t,o))},ie.isRing=function(e){var t=e.size();return t===0?!0:t<=3?!1:e.getOrdinate(0,Ot.X)===e.getOrdinate(t-1,Ot.X)&&e.getOrdinate(0,Ot.Y)===e.getOrdinate(t-1,Ot.Y)},ie.isEqual=function(e,t){var n=e.size(),i=t.size();if(n!==i)return!1;for(var s=Math.min(e.getDimension(),t.getDimension()),o=0;o<n;o++)for(var a=0;a<s;a++){var u=e.getOrdinate(o,a),l=t.getOrdinate(o,a);if(e.getOrdinate(o,a)!==t.getOrdinate(o,a)&&!(ht.isNaN(u)&&ht.isNaN(l)))return!1}return!0},ie.extend=function(e,t,n){var i=e.create(n,t.getDimension()),s=t.size();if(ie.copy(t,0,i,0,s),s>0)for(var o=s;o<n;o++)ie.copy(t,s-1,i,o,1);return i},ie.reverse=function(e){for(var t=e.size()-1,n=Math.trunc(t/2),i=0;i<=n;i++)ie.swap(e,i,t-i)},ie.swap=function(e,t,n){if(t===n)return null;for(var i=0;i<e.getDimension();i++){var s=e.getOrdinate(t,i);e.setOrdinate(t,i,e.getOrdinate(n,i)),e.setOrdinate(n,i,s)}},ie.copy=function(e,t,n,i,s){for(var o=0;o<s;o++)ie.copyCoord(e,t+o,n,i+o)},ie.toString=function(){if(arguments.length===1){var e=arguments[0],t=e.size();if(t===0)return"()";var n=e.getDimension(),i=new lr;i.append("(");for(var s=0;s<t;s++){s>0&&i.append(" ");for(var o=0;o<n;o++)o>0&&i.append(","),i.append(Bn.toString(e.getOrdinate(s,o)))}return i.append(")"),i.toString()}},ie.ensureValidRing=function(e,t){var n=t.size();if(n===0)return t;if(n<=3)return ie.createClosedRing(e,t,4);var i=t.getOrdinate(0,Ot.X)===t.getOrdinate(n-1,Ot.X)&&t.getOrdinate(0,Ot.Y)===t.getOrdinate(n-1,Ot.Y);return i?t:ie.createClosedRing(e,t,n+1)},ie.createClosedRing=function(e,t,n){var i=e.create(n,t.getDimension()),s=t.size();ie.copy(t,0,i,0,s);for(var o=s;o<n;o++)ie.copy(t,0,i,o,1);return i};var te=function(r){function e(n,i){r.call(this,i),this._points=null,this.init(n)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Q:this._points.expandEnvelope(new Q)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return r.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._points.size()!==a._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),a._points.getCoordinate(u),o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var i=this,s=0;s<Math.trunc(this._points.size()/2);s++){var o=i._points.size()-1-s;if(!i._points.getCoordinate(s).equals(i._points.getCoordinate(o)))return i._points.getCoordinate(s).compareTo(i._points.getCoordinate(o))>0&&ie.reverse(i._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Rt.FALSE:0},e.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return q.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var i=this._points.copy();ie.reverse(i);var s=this.getFactory().createLineString(i);return s},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var s=arguments[0],o=s,a=0,u=0;a<this._points.size()&&u<o._points.size();){var l=i._points.getCoordinate(a).compareTo(o._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<o._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],h=arguments[1],f=c;return h.compare(this._points,f._points)}},e.prototype.apply=function(){var i=this;if(at(arguments[0],Wr))for(var s=arguments[0],o=0;o<this._points.size();o++)s.filter(i._points.getCoordinate(o));else if(at(arguments[0],er)){var a=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(a.filter(i._points,u),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(at(arguments[0],pr)){var l=arguments[0];l.filter(this)}else if(at(arguments[0],yi)){var c=arguments[0];c.filter(this)}},e.prototype.getBoundary=function(){return new jn(this).getBoundary()},e.prototype.isEquivalentClass=function(i){return i instanceof e},e.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._points=this._points.clone(),i},e.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return this._points.size()===0},e.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new Yt("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},e.prototype.isCoordinate=function(i){for(var s=this,o=0;o<this._points.size();o++)if(s._points.getCoordinate(o).equals(i))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},e.prototype.interfaces_=function(){return[Xu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,t),e}(ot),Yu=function(){};Yu.prototype.interfaces_=function(){return[]},Yu.prototype.getClass=function(){return Yu};var dn=function(r){function e(n,i){r.call(this,i),this._coordinates=n||null,this.init(this._coordinates)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Q;var i=new Q;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},e.prototype.getSortIndex=function(){return r.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Rt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],s=i;return this.getCoordinate().compareTo(s.getCoordinate())}else if(arguments.length===2){var o=arguments[0],a=arguments[1],u=o;return a.compare(this._coordinates,u._coordinates)}},e.prototype.apply=function(){if(at(arguments[0],Wr)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(at(arguments[0],er)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(at(arguments[0],pr)){var o=arguments[0];o.filter(this)}else if(at(arguments[0],yi)){var a=arguments[0];a.filter(this)}},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return this._coordinates.size()===0},e.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),yt.isTrue(i.size()<=1),this._coordinates=i},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Yu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(e,t),e}(ot),$i=function(){};$i.prototype.interfaces_=function(){return[]},$i.prototype.getClass=function(){return $i};var pe=function(r){function e(n,i,s){if(r.call(this,s),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),i===null&&(i=[]),r.hasNullElements(i))throw new Yt("holes must not contain null elements");if(n.isEmpty()&&r.hasNonEmptyElements(i))throw new Yt("shell is empty but holes are not");this._shell=n,this._holes=i}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return r.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var s=new Array(this.getNumPoints()).fill(null),o=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)o++,s[o]=a[u];for(var l=0;l<this._holes.length;l++)for(var c=i._holes[l].getCoordinates(),h=0;h<c.length;h++)o++,s[o]=c[h];return s},e.prototype.getArea=function(){var i=this,s=0;s+=Math.abs(q.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)s-=Math.abs(q.signedArea(i._holes[o].getCoordinateSequence()));return s},e.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),s=this.getEnvelopeInternal(),o=0;o<5;o++){var a=i.getX(o);if(!(a===s.getMinX()||a===s.getMaxX()))return!1;var u=i.getY(o);if(!(u===s.getMinY()||u===s.getMaxY()))return!1}for(var l=i.getX(0),c=i.getY(0),h=1;h<=4;h++){var f=i.getX(h),p=i.getY(h),v=f!==l,C=p!==c;if(v===C)return!1;l=f,c=p}return!0},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s,u=this._shell,l=a._shell;if(!u.equalsExact(l,o)||this._holes.length!==a._holes.length)return!1;for(var c=0;c<this._holes.length;c++)if(!i._holes[c].equalsExact(a._holes[c],o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var s=0;s<this._holes.length;s++)i.normalize(i._holes[s],!1);bs.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],a=arguments[1];if(o.isEmpty())return null;var u=new Array(o.getCoordinates().length-1).fill(null);Te.arraycopy(o.getCoordinates(),0,u,0,u.length);var l=Ct.minCoordinate(o.getCoordinates());Ct.scroll(u,l),Te.arraycopy(u,0,o.getCoordinates(),0,u.length),o.getCoordinates()[u.length]=u[0],q.isCCW(o.getCoordinates())===a&&Ct.reverse(o.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var i=this,s=0;s+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)s+=i._holes[o].getLength();return s},e.prototype.getNumPoints=function(){for(var i=this,s=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)s+=i._holes[o].getNumPoints();return s},e.prototype.reverse=function(){var i=this,s=this.copy();s._shell=this._shell.copy().reverse(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].copy().reverse();return s},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=this._shell,a=s._shell;return o.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],c=u,h=this._shell,f=c._shell,p=h.compareToSameClass(f,l);if(p!==0)return p;for(var v=this.getNumInteriorRing(),C=c.getNumInteriorRing(),S=0;S<v&&S<C;){var P=i.getInteriorRingN(S),y=c.getInteriorRingN(S),_=P.compareToSameClass(y,l);if(_!==0)return _;S++}return S<v?1:S<C?-1:0}},e.prototype.apply=function(i){var s=this;if(at(i,Wr)){this._shell.apply(i);for(var o=0;o<this._holes.length;o++)s._holes[o].apply(i)}else if(at(i,er)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(s._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(at(i,pr))i.filter(this);else if(at(i,yi)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)s._holes[u].apply(i)}},e.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var s=new Array(this._holes.length+1).fill(null);s[0]=this._shell;for(var o=0;o<this._holes.length;o++)s[o+1]=i._holes[o];return s.length<=1?this.getFactory().createLinearRing(s[0].getCoordinateSequence()):this.getFactory().createMultiLineString(s)},e.prototype.clone=function(){var i=this,s=r.prototype.clone.call(this);s._shell=this._shell.clone(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].clone();return s},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var i=this,s=this._shell.copy(),o=new Array(this._holes.length).fill(null),a=0;a<o.length;a++)o[a]=i._holes[a].copy();return new e(s,o,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(i){return this._holes[i]},e.prototype.interfaces_=function(){return[$i]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,t),e}(ot),wa=function(r){function e(){r.apply(this,arguments)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return r.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Rt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.interfaces_=function(){return[Yu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(e,t),e}(Ge),Hr=function(r){function e(n,i){n instanceof R&&i instanceof St&&(n=i.getCoordinateSequenceFactory().create(n)),r.call(this,n,i),this.validateConstruction()}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Rt.FALSE},e.prototype.isClosed=function(){return this.isEmpty()?!0:r.prototype.isClosed.call(this)},e.prototype.reverse=function(){var i=this._points.copy();ie.reverse(i);var s=this.getFactory().createLinearRing(i);return s},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new Yt("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new Yt("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.MINIMUM_VALID_SIZE.get=function(){return 4},t.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,t),e}(te),qr=function(r){function e(){r.apply(this,arguments)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(o)},e.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var s=new W,o=0;o<this._geometries.length;o++)for(var a=i._geometries[o],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)s.add(u.getGeometryN(l));var c=new Array(s.size()).fill(null);return this.getFactory().createMultiLineString(s.toArray(c))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.interfaces_=function(){return[$i]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,t),e}(Ge),zn=function(e){this._factory=e||null,this._isUserDataCopied=!1},lc={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};zn.prototype.setCopyUserData=function(e){this._isUserDataCopied=e},zn.prototype.edit=function(e,t){if(e===null)return null;var n=this.editInternal(e,t);return this._isUserDataCopied&&n.setUserData(e.getUserData()),n},zn.prototype.editInternal=function(e,t){return this._factory===null&&(this._factory=e.getFactory()),e instanceof Ge?this.editGeometryCollection(e,t):e instanceof pe?this.editPolygon(e,t):e instanceof dn?t.edit(e,this._factory):e instanceof te?t.edit(e,this._factory):(yt.shouldNeverReachHere("Unsupported Geometry class: "+e.getClass().getName()),null)},zn.prototype.editGeometryCollection=function(e,t){for(var n=this,i=t.edit(e,this._factory),s=new W,o=0;o<i.getNumGeometries();o++){var a=n.edit(i.getGeometryN(o),t);a===null||a.isEmpty()||s.add(a)}return i.getClass()===wa?this._factory.createMultiPoint(s.toArray([])):i.getClass()===Ps?this._factory.createMultiLineString(s.toArray([])):i.getClass()===qr?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))},zn.prototype.editPolygon=function(e,t){var n=this,i=t.edit(e,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var s=this.edit(i.getExteriorRing(),t);if(s===null||s.isEmpty())return this._factory.createPolygon();for(var o=new W,a=0;a<i.getNumInteriorRing();a++){var u=n.edit(i.getInteriorRingN(a),t);u===null||u.isEmpty()||o.add(u)}return this._factory.createPolygon(s,o.toArray([]))},zn.prototype.interfaces_=function(){return[]},zn.prototype.getClass=function(){return zn},zn.GeometryEditorOperation=function(){},lc.NoOpGeometryOperation.get=function(){return Ju},lc.CoordinateOperation.get=function(){return $u},lc.CoordinateSequenceOperation.get=function(){return Ku},Object.defineProperties(zn,lc);var Ju=function(){};Ju.prototype.edit=function(e,t){return e},Ju.prototype.interfaces_=function(){return[zn.GeometryEditorOperation]},Ju.prototype.getClass=function(){return Ju};var $u=function(){};$u.prototype.edit=function(e,t){var n=this.editCoordinates(e.getCoordinates(),e);return n===null?e:e instanceof Hr?t.createLinearRing(n):e instanceof te?t.createLineString(n):e instanceof dn?n.length>0?t.createPoint(n[0]):t.createPoint():e},$u.prototype.interfaces_=function(){return[zn.GeometryEditorOperation]},$u.prototype.getClass=function(){return $u};var Ku=function(){};Ku.prototype.edit=function(e,t){return e instanceof Hr?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof te?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof dn?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e},Ku.prototype.interfaces_=function(){return[zn.GeometryEditorOperation]},Ku.prototype.getClass=function(){return Ku};var se=function(){var e=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var n=0;n<t;n++)e._coordinates[n]=new R}else if(at(arguments[0],Ot)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var s=0;s<this._coordinates.length;s++)e._coordinates[s]=i.getCoordinateCopy(s)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],a=arguments[1];this._coordinates=o,this._dimension=a,o===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var c=0;c<u;c++)e._coordinates[c]=new R}}},Mm={serialVersionUID:{configurable:!0}};se.prototype.setOrdinate=function(e,t,n){switch(t){case Ot.X:this._coordinates[e].x=n;break;case Ot.Y:this._coordinates[e].y=n;break;case Ot.Z:this._coordinates[e].z=n;break;default:throw new Yt("invalid ordinateIndex")}},se.prototype.size=function(){return this._coordinates.length},se.prototype.getOrdinate=function(e,t){switch(t){case Ot.X:return this._coordinates[e].x;case Ot.Y:return this._coordinates[e].y;case Ot.Z:return this._coordinates[e].z}return ht.NaN},se.prototype.getCoordinate=function(){if(arguments.length===1){var e=arguments[0];return this._coordinates[e]}else if(arguments.length===2){var t=arguments[0],n=arguments[1];n.x=this._coordinates[t].x,n.y=this._coordinates[t].y,n.z=this._coordinates[t].z}},se.prototype.getCoordinateCopy=function(e){return new R(this._coordinates[e])},se.prototype.getDimension=function(){return this._dimension},se.prototype.getX=function(e){return this._coordinates[e].x},se.prototype.clone=function(){for(var e=this,t=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)t[n]=e._coordinates[n].clone();return new se(t,this._dimension)},se.prototype.expandEnvelope=function(e){for(var t=this,n=0;n<this._coordinates.length;n++)e.expandToInclude(t._coordinates[n]);return e},se.prototype.copy=function(){for(var e=this,t=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)t[n]=e._coordinates[n].copy();return new se(t,this._dimension)},se.prototype.toString=function(){var e=this;if(this._coordinates.length>0){var t=new lr(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)t.append(", "),t.append(e._coordinates[n]);return t.append(")"),t.toString()}else return"()"},se.prototype.getY=function(e){return this._coordinates[e].y},se.prototype.toCoordinateArray=function(){return this._coordinates},se.prototype.interfaces_=function(){return[Ot,kn]},se.prototype.getClass=function(){return se},Mm.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(se,Mm);var Xr=function(){},hd={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Xr.prototype.readResolve=function(){return Xr.instance()},Xr.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new se(e)}else if(at(arguments[0],Ot)){var t=arguments[0];return new se(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new se(n):new se(n,i)}},Xr.prototype.interfaces_=function(){return[ca,kn]},Xr.prototype.getClass=function(){return Xr},Xr.instance=function(){return Xr.instanceObject},hd.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},hd.instanceObject.get=function(){return new Xr},Object.defineProperties(Xr,hd);var Rm=function(r){function e(){r.call(this),this.map_=new Map}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.get=function(n){return this.map_.get(n)||null},e.prototype.put=function(n,i){return this.map_.set(n,i),i},e.prototype.values=function(){for(var n=new W,i=this.map_.values(),s=i.next();!s.done;)n.add(s.value),s=i.next();return n},e.prototype.entrySet=function(){var n=new ud;return this.map_.entries().forEach(function(i){return n.add(i)}),n},e.prototype.size=function(){return this.map_.size()},e}(ho),Lt=function r(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=r.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof gr){var e=arguments[0];this._modelType=e,e===r.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var t=arguments[0];this._modelType=r.FIXED,this.setScale(t)}else if(arguments[0]instanceof r){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},dd={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Lt.prototype.equals=function(e){if(!(e instanceof Lt))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale},Lt.prototype.compareTo=function(e){var t=e,n=this.getMaximumSignificantDigits(),i=t.getMaximumSignificantDigits();return new cr(n).compareTo(new cr(i))},Lt.prototype.getScale=function(){return this._scale},Lt.prototype.isFloating=function(){return this._modelType===Lt.FLOATING||this._modelType===Lt.FLOATING_SINGLE},Lt.prototype.getType=function(){return this._modelType},Lt.prototype.toString=function(){var e="UNKNOWN";return this._modelType===Lt.FLOATING?e="Floating":this._modelType===Lt.FLOATING_SINGLE?e="Floating-Single":this._modelType===Lt.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e},Lt.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var e=arguments[0];if(ht.isNaN(e))return e;if(this._modelType===Lt.FLOATING_SINGLE){var t=e;return t}return this._modelType===Lt.FIXED?Math.round(e*this._scale)/this._scale:e}else if(arguments[0]instanceof R){var n=arguments[0];if(this._modelType===Lt.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},Lt.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===Lt.FLOATING?e=16:this._modelType===Lt.FLOATING_SINGLE?e=6:this._modelType===Lt.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e},Lt.prototype.setScale=function(e){this._scale=Math.abs(e)},Lt.prototype.interfaces_=function(){return[kn,An]},Lt.prototype.getClass=function(){return Lt},Lt.mostPrecise=function(e,t){return e.compareTo(t)>=0?e:t},dd.serialVersionUID.get=function(){return 7777263578777804e3},dd.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Lt,dd);var gr=function r(e){this._name=e||null,r.nameToTypeMap.put(e,this)},fd={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};gr.prototype.readResolve=function(){return gr.nameToTypeMap.get(this._name)},gr.prototype.toString=function(){return this._name},gr.prototype.interfaces_=function(){return[kn]},gr.prototype.getClass=function(){return gr},fd.serialVersionUID.get=function(){return-552860263173159e4},fd.nameToTypeMap.get=function(){return new Rm},Object.defineProperties(gr,fd),Lt.Type=gr,Lt.FIXED=new gr("FIXED"),Lt.FLOATING=new gr("FLOATING"),Lt.FLOATING_SINGLE=new gr("FLOATING SINGLE");var St=function r(){this._precisionModel=new Lt,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?at(arguments[0],ca)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Lt&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Lm={serialVersionUID:{configurable:!0}};St.prototype.toGeometry=function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new R(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new R(e.getMinX(),e.getMinY()),new R(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new R(e.getMinX(),e.getMinY()),new R(e.getMinX(),e.getMaxY()),new R(e.getMaxX(),e.getMaxY()),new R(e.getMaxX(),e.getMinY()),new R(e.getMinX(),e.getMinY())]),null)},St.prototype.createLineString=function(e){if(e){if(e instanceof Array)return new te(this.getCoordinateSequenceFactory().create(e),this);if(at(e,Ot))return new te(e,this)}else return new te(this.getCoordinateSequenceFactory().create([]),this)},St.prototype.createMultiLineString=function(){if(arguments.length===0)return new Ps(null,this);if(arguments.length===1){var e=arguments[0];return new Ps(e,this)}},St.prototype.buildGeometry=function(e){for(var t=null,n=!1,i=!1,s=e.iterator();s.hasNext();){var o=s.next(),a=o.getClass();t===null&&(t=a),a!==t&&(n=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(t===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(St.toGeometryArray(e));var u=e.iterator().next(),l=e.size()>1;if(l){if(u instanceof pe)return this.createMultiPolygon(St.toPolygonArray(e));if(u instanceof te)return this.createMultiLineString(St.toLineStringArray(e));if(u instanceof dn)return this.createMultiPoint(St.toPointArray(e));yt.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},St.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)},St.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof R){var e=arguments[0];return this.createPoint(e!==null?this.getCoordinateSequenceFactory().create([e]):null)}else if(at(arguments[0],Ot)){var t=arguments[0];return new dn(t,this)}}},St.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},St.prototype.createPolygon=function(){if(arguments.length===0)return new pe(null,null,this);if(arguments.length===1){if(at(arguments[0],Ot)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Hr){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];return new pe(i,s,this)}},St.prototype.getSRID=function(){return this._SRID},St.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Ge(null,this);if(arguments.length===1){var e=arguments[0];return new Ge(e,this)}},St.prototype.createGeometry=function(e){var t=new zn(this);return t.edit(e,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},St.prototype.getPrecisionModel=function(){return this._precisionModel},St.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(e!==null?this.getCoordinateSequenceFactory().create(e):null)}else if(at(arguments[0],Ot)){var t=arguments[0];return new Hr(t,this)}}},St.prototype.createMultiPolygon=function(){if(arguments.length===0)return new qr(null,this);if(arguments.length===1){var e=arguments[0];return new qr(e,this)}},St.prototype.createMultiPoint=function(){var e=this;if(arguments.length===0)return new wa(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new wa(t,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(at(arguments[0],Ot)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(i.size()).fill(null),o=0;o<i.size();o++){var a=e.getCoordinateSequenceFactory().create(1,i.getDimension());ie.copy(i,o,a,0,1),s[o]=e.createPoint(a)}return this.createMultiPoint(s)}}},St.prototype.interfaces_=function(){return[kn]},St.prototype.getClass=function(){return St},St.toMultiPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.toGeometryArray=function(e){if(e===null)return null;var t=new Array(e.size()).fill(null);return e.toArray(t)},St.getDefaultCoordinateSequenceFactory=function(){return Xr.instance()},St.toMultiLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.toLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.toMultiPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.toLinearRingArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.toPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.toPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},St.createPointFromInternalCoord=function(e,t){return t.getPrecisionModel().makePrecise(e),t.getFactory().createPoint(e)},Lm.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(St,Lm);var $E=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],cc=function(e){this.geometryFactory=e||new St};cc.prototype.read=function(e){var t;typeof e=="string"?t=JSON.parse(e):t=e;var n=t.type;if(!mr[n])throw new Error("Unknown GeoJSON type: "+t.type);return $E.indexOf(n)!==-1?mr[n].apply(this,[t.coordinates]):n==="GeometryCollection"?mr[n].apply(this,[t.geometries]):mr[n].apply(this,[t])},cc.prototype.write=function(e){var t=e.getGeometryType();if(!Ci[t])throw new Error("Geometry is not supported");return Ci[t].apply(this,[e])};var mr={Feature:function(r){var e={};for(var t in r)e[t]=r[t];if(r.geometry){var n=r.geometry.type;if(!mr[n])throw new Error("Unknown GeoJSON type: "+r.type);e.geometry=this.read(r.geometry)}return r.bbox&&(e.bbox=mr.bbox.apply(this,[r.bbox])),e},FeatureCollection:function(r){var e=this,t={};if(r.features){t.features=[];for(var n=0;n<r.features.length;++n)t.features.push(e.read(r.features[n]))}return r.bbox&&(t.bbox=this.parse.bbox.apply(this,[r.bbox])),t},coordinates:function(r){for(var e=[],t=0;t<r.length;++t){var n=r[t];e.push(new R(n[0],n[1]))}return e},bbox:function(r){return this.geometryFactory.createLinearRing([new R(r[0],r[1]),new R(r[2],r[1]),new R(r[2],r[3]),new R(r[0],r[3]),new R(r[0],r[1])])},Point:function(r){var e=new R(r[0],r[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(r){for(var e=this,t=[],n=0;n<r.length;++n)t.push(mr.Point.apply(e,[r[n]]));return this.geometryFactory.createMultiPoint(t)},LineString:function(r){var e=mr.coordinates.apply(this,[r]);return this.geometryFactory.createLineString(e)},MultiLineString:function(r){for(var e=this,t=[],n=0;n<r.length;++n)t.push(mr.LineString.apply(e,[r[n]]));return this.geometryFactory.createMultiLineString(t)},Polygon:function(r){for(var e=this,t=mr.coordinates.apply(this,[r[0]]),n=this.geometryFactory.createLinearRing(t),i=[],s=1;s<r.length;++s){var o=r[s],a=mr.coordinates.apply(e,[o]),u=e.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(r){for(var e=this,t=[],n=0;n<r.length;++n){var i=r[n];t.push(mr.Polygon.apply(e,[i]))}return this.geometryFactory.createMultiPolygon(t)},GeometryCollection:function(r){for(var e=this,t=[],n=0;n<r.length;++n){var i=r[n];t.push(e.read(i))}return this.geometryFactory.createGeometryCollection(t)}},Ci={coordinate:function(r){return[r.x,r.y]},Point:function(r){var e=Ci.coordinate.apply(this,[r.getCoordinate()]);return{type:"Point",coordinates:e}},MultiPoint:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=Ci.Point.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiPoint",coordinates:t}},LineString:function(r){for(var e=this,t=[],n=r.getCoordinates(),i=0;i<n.length;++i){var s=n[i];t.push(Ci.coordinate.apply(e,[s]))}return{type:"LineString",coordinates:t}},MultiLineString:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=Ci.LineString.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiLineString",coordinates:t}},Polygon:function(r){var e=this,t=[],n=Ci.LineString.apply(this,[r._shell]);t.push(n.coordinates);for(var i=0;i<r._holes.length;++i){var s=r._holes[i],o=Ci.LineString.apply(e,[s]);t.push(o.coordinates)}return{type:"Polygon",coordinates:t}},MultiPolygon:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=Ci.Polygon.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiPolygon",coordinates:t}},GeometryCollection:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=i.getGeometryType();t.push(Ci[s].apply(e,[i]))}return{type:"GeometryCollection",geometries:t}}},pd=function(e){this.geometryFactory=e||new St,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new cc(this.geometryFactory)};pd.prototype.read=function(e){var t=this.parser.read(e);return this.precisionModel.getType()===Lt.FIXED&&this.reducePrecision(t),t},pd.prototype.reducePrecision=function(e){var t=this,n,i;if(e.coordinate)this.precisionModel.makePrecise(e.coordinate);else if(e.points)for(n=0,i=e.points.length;n<i;n++)t.precisionModel.makePrecise(e.points[n]);else if(e.geometries)for(n=0,i=e.geometries.length;n<i;n++)t.reducePrecision(e.geometries[n])};var Fm=function(){this.parser=new cc(this.geometryFactory)};Fm.prototype.write=function(e){return this.parser.write(e)};var U=function(){},hc={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};U.prototype.interfaces_=function(){return[]},U.prototype.getClass=function(){return U},U.opposite=function(e){return e===U.LEFT?U.RIGHT:e===U.RIGHT?U.LEFT:e},hc.ON.get=function(){return 0},hc.LEFT.get=function(){return 1},hc.RIGHT.get=function(){return 2},Object.defineProperties(U,hc);function dc(r){this.message=r||""}dc.prototype=new Error,dc.prototype.name="EmptyStackException";function vr(){this.array_=[]}vr.prototype=new Qn,vr.prototype.add=function(r){return this.array_.push(r),!0},vr.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},vr.prototype.push=function(r){return this.array_.push(r),r},vr.prototype.pop=function(r){if(this.array_.length===0)throw new dc;return this.array_.pop()},vr.prototype.peek=function(){if(this.array_.length===0)throw new dc;return this.array_[this.array_.length-1]},vr.prototype.empty=function(){return this.array_.length===0},vr.prototype.isEmpty=function(){return this.empty()},vr.prototype.search=function(r){return this.array_.indexOf(r)},vr.prototype.size=function(){return this.array_.length},vr.prototype.toArray=function(){for(var r=this,e=[],t=0,n=this.array_.length;t<n;t++)e.push(r.array_[t]);return e};var yr=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};yr.prototype.getCoordinate=function(){return this._minCoord},yr.prototype.getRightmostSide=function(e,t){var n=this.getRightmostSideOfSegment(e,t);return n<0&&(n=this.getRightmostSideOfSegment(e,t-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(e)),n},yr.prototype.findRightmostEdgeAtVertex=function(){var e=this._minDe.getEdge().getCoordinates();yt.isTrue(this._minIndex>0&&this._minIndex<e.length,"rightmost point expected to be interior vertex of edge");var t=e[this._minIndex-1],n=e[this._minIndex+1],i=q.computeOrientation(this._minCoord,n,t),s=!1;(t.y<this._minCoord.y&&n.y<this._minCoord.y&&i===q.COUNTERCLOCKWISE||t.y>this._minCoord.y&&n.y>this._minCoord.y&&i===q.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)},yr.prototype.getRightmostSideOfSegment=function(e,t){var n=e.getEdge(),i=n.getCoordinates();if(t<0||t+1>=i.length||i[t].y===i[t+1].y)return-1;var s=U.LEFT;return i[t].y<i[t+1].y&&(s=U.RIGHT),s},yr.prototype.getEdge=function(){return this._orientedDe},yr.prototype.checkForRightmostCoordinate=function(e){for(var t=this,n=e.getEdge().getCoordinates(),i=0;i<n.length-1;i++)(t._minCoord===null||n[i].x>t._minCoord.x)&&(t._minDe=e,t._minIndex=i,t._minCoord=n[i])},yr.prototype.findRightmostEdgeAtNode=function(){var e=this._minDe.getNode(),t=e.getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},yr.prototype.findEdge=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next();i.isForward()&&t.checkForRightmostCoordinate(i)}yt.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var s=this.getRightmostSide(this._minDe,this._minIndex);s===U.LEFT&&(this._orientedDe=this._minDe.getSym())},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var Si=function(r){function e(t,n){r.call(this,e.msgWithCoord(t,n)),this.pt=n?new R(n):null,this.name="TopologyException"}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(n,i){return i?n:n+" [ "+i+" ]"},e}(vi),fc=function(){this.array_=[]};fc.prototype.addLast=function(e){this.array_.push(e)},fc.prototype.removeFirst=function(){return this.array_.shift()},fc.prototype.isEmpty=function(){return this.array_.length===0};var We=function(){this._finder=null,this._dirEdgeList=new W,this._nodes=new W,this._rightMostCoord=null,this._env=null,this._finder=new yr};We.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.setVisited(!1)}},We.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},We.prototype.computeNodeDepth=function(e){for(var t=this,n=null,i=e.getEdges().iterator();i.hasNext();){var s=i.next();if(s.isVisited()||s.getSym().isVisited()){n=s;break}}if(n===null)throw new Si("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(n);for(var o=e.getEdges().iterator();o.hasNext();){var a=o.next();a.setVisited(!0),t.copySymDepths(a)}},We.prototype.computeDepth=function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(U.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)},We.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},We.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(U.RIGHT)>=1&&t.getDepth(U.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}},We.prototype.computeDepths=function(e){var t=this,n=new ud,i=new fc,s=e.getNode();for(i.addLast(s),n.add(s),e.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();n.add(o),t.computeNodeDepth(o);for(var a=o.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var c=l.getNode();n.contains(c)||(i.addLast(c),n.add(c))}}}},We.prototype.compareTo=function(e){var t=e;return this._rightMostCoord.x<t._rightMostCoord.x?-1:this._rightMostCoord.x>t._rightMostCoord.x?1:0},We.prototype.getEnvelope=function(){if(this._env===null){for(var e=new Q,t=this._dirEdgeList.iterator();t.hasNext();)for(var n=t.next(),i=n.getEdge().getCoordinates(),s=0;s<i.length-1;s++)e.expandToInclude(i[s]);this._env=e}return this._env},We.prototype.addReachable=function(e){var t=this,n=new vr;for(n.add(e);!n.empty();){var i=n.pop();t.add(i,n)}},We.prototype.copySymDepths=function(e){var t=e.getSym();t.setDepth(U.LEFT,e.getDepth(U.RIGHT)),t.setDepth(U.RIGHT,e.getDepth(U.LEFT))},We.prototype.add=function(e,t){var n=this;e.setVisited(!0),this._nodes.add(e);for(var i=e.getEdges().iterator();i.hasNext();){var s=i.next();n._dirEdgeList.add(s);var o=s.getSym(),a=o.getNode();a.isVisited()||t.push(a)}},We.prototype.getNodes=function(){return this._nodes},We.prototype.getDirectedEdges=function(){return this._dirEdgeList},We.prototype.interfaces_=function(){return[An]},We.prototype.getClass=function(){return We};var Wt=function r(){var e=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[U.ON]=n}else if(arguments[0]instanceof r){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var s=0;s<this.location.length;s++)e.location[s]=i.location[s]}}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[U.ON]=o,this.location[U.LEFT]=a,this.location[U.RIGHT]=u}};Wt.prototype.setAllLocations=function(e){for(var t=this,n=0;n<this.location.length;n++)t.location[n]=e},Wt.prototype.isNull=function(){for(var e=this,t=0;t<this.location.length;t++)if(e.location[t]!==F.NONE)return!1;return!0},Wt.prototype.setAllLocationsIfNull=function(e){for(var t=this,n=0;n<this.location.length;n++)t.location[n]===F.NONE&&(t.location[n]=e)},Wt.prototype.isLine=function(){return this.location.length===1},Wt.prototype.merge=function(e){var t=this;if(e.location.length>this.location.length){var n=new Array(3).fill(null);n[U.ON]=this.location[U.ON],n[U.LEFT]=F.NONE,n[U.RIGHT]=F.NONE,this.location=n}for(var i=0;i<this.location.length;i++)t.location[i]===F.NONE&&i<e.location.length&&(t.location[i]=e.location[i])},Wt.prototype.getLocations=function(){return this.location},Wt.prototype.flip=function(){if(this.location.length<=1)return null;var e=this.location[U.LEFT];this.location[U.LEFT]=this.location[U.RIGHT],this.location[U.RIGHT]=e},Wt.prototype.toString=function(){var e=new lr;return this.location.length>1&&e.append(F.toLocationSymbol(this.location[U.LEFT])),e.append(F.toLocationSymbol(this.location[U.ON])),this.location.length>1&&e.append(F.toLocationSymbol(this.location[U.RIGHT])),e.toString()},Wt.prototype.setLocations=function(e,t,n){this.location[U.ON]=e,this.location[U.LEFT]=t,this.location[U.RIGHT]=n},Wt.prototype.get=function(e){return e<this.location.length?this.location[e]:F.NONE},Wt.prototype.isArea=function(){return this.location.length>1},Wt.prototype.isAnyNull=function(){for(var e=this,t=0;t<this.location.length;t++)if(e.location[t]===F.NONE)return!0;return!1},Wt.prototype.setLocation=function(){if(arguments.length===1){var e=arguments[0];this.setLocation(U.ON,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.location[t]=n}},Wt.prototype.init=function(e){this.location=new Array(e).fill(null),this.setAllLocations(F.NONE)},Wt.prototype.isEqualOnSide=function(e,t){return this.location[t]===e.location[t]},Wt.prototype.allPositionsEqual=function(e){for(var t=this,n=0;n<this.location.length;n++)if(t.location[n]!==e)return!1;return!0},Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt};var jt=function r(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Wt(e),this.elt[1]=new Wt(e)}else if(arguments[0]instanceof r){var t=arguments[0];this.elt[0]=new Wt(t.elt[0]),this.elt[1]=new Wt(t.elt[1])}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[0]=new Wt(F.NONE),this.elt[1]=new Wt(F.NONE),this.elt[n].setLocation(i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this.elt[0]=new Wt(s,o,a),this.elt[1]=new Wt(s,o,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new Wt(F.NONE,F.NONE,F.NONE),this.elt[1]=new Wt(F.NONE,F.NONE,F.NONE),this.elt[u].setLocations(l,c,h)}};jt.prototype.getGeometryCount=function(){var e=0;return this.elt[0].isNull()||e++,this.elt[1].isNull()||e++,e},jt.prototype.setAllLocations=function(e,t){this.elt[e].setAllLocations(t)},jt.prototype.isNull=function(e){return this.elt[e].isNull()},jt.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var e=arguments[0];this.setAllLocationsIfNull(0,e),this.setAllLocationsIfNull(1,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.elt[t].setAllLocationsIfNull(n)}},jt.prototype.isLine=function(e){return this.elt[e].isLine()},jt.prototype.merge=function(e){for(var t=this,n=0;n<2;n++)t.elt[n]===null&&e.elt[n]!==null?t.elt[n]=new Wt(e.elt[n]):t.elt[n].merge(e.elt[n])},jt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},jt.prototype.getLocation=function(){if(arguments.length===1){var e=arguments[0];return this.elt[e].get(U.ON)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return this.elt[t].get(n)}},jt.prototype.toString=function(){var e=new lr;return this.elt[0]!==null&&(e.append("A:"),e.append(this.elt[0].toString())),this.elt[1]!==null&&(e.append(" B:"),e.append(this.elt[1].toString())),e.toString()},jt.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var e=arguments[0];return this.elt[e].isArea()}},jt.prototype.isAnyNull=function(e){return this.elt[e].isAnyNull()},jt.prototype.setLocation=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.elt[e].setLocation(U.ON,t)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this.elt[n].setLocation(i,s)}},jt.prototype.isEqualOnSide=function(e,t){return this.elt[0].isEqualOnSide(e.elt[0],t)&&this.elt[1].isEqualOnSide(e.elt[1],t)},jt.prototype.allPositionsEqual=function(e,t){return this.elt[e].allPositionsEqual(t)},jt.prototype.toLine=function(e){this.elt[e].isArea()&&(this.elt[e]=new Wt(this.elt[e].location[0]))},jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.toLineLabel=function(e){for(var t=new jt(F.NONE),n=0;n<2;n++)t.setLocation(n,e.getLocation(n));return t};var le=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new W,this._pts=new W,this._label=new jt(F.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new W,this._geometryFactory=null;var e=arguments[0],t=arguments[1];this._geometryFactory=t,this.computePoints(e),this.computeRing()};le.prototype.computeRing=function(){var e=this;if(this._ring!==null)return null;for(var t=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)t[n]=e._pts.get(n);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=q.isCCW(this._ring.getCoordinates())},le.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},le.prototype.computePoints=function(e){var t=this;this._startDe=e;var n=e,i=!0;do{if(n===null)throw new Si("Found null DirectedEdge");if(n.getEdgeRing()===t)throw new Si("Directed Edge visited twice during ring-building at "+n.getCoordinate());t._edges.add(n);var s=n.getLabel();yt.isTrue(s.isArea()),t.mergeLabel(s),t.addPoints(n.getEdge(),n.isForward(),i),i=!1,t.setEdgeRing(n,t),n=t.getNext(n)}while(n!==this._startDe)},le.prototype.getLinearRing=function(){return this._ring},le.prototype.getCoordinate=function(e){return this._pts.get(e)},le.prototype.computeMaxNodeDegree=function(){var e=this;this._maxNodeDegree=0;var t=this._startDe;do{var n=t.getNode(),i=n.getEdges().getOutgoingDegree(e);i>e._maxNodeDegree&&(e._maxNodeDegree=i),t=e.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},le.prototype.addPoints=function(e,t,n){var i=this,s=e.getCoordinates();if(t){var o=1;n&&(o=0);for(var a=o;a<s.length;a++)i._pts.add(s[a])}else{var u=s.length-2;n&&(u=s.length-1);for(var l=u;l>=0;l--)i._pts.add(s[l])}},le.prototype.isHole=function(){return this._isHole},le.prototype.setInResult=function(){var e=this._startDe;do e.getEdge().setInResult(!0),e=e.getNext();while(e!==this._startDe)},le.prototype.containsPoint=function(e){var t=this.getLinearRing(),n=t.getEnvelopeInternal();if(!n.contains(e)||!q.isPointInRing(e,t.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var s=i.next();if(s.containsPoint(e))return!1}return!0},le.prototype.addHole=function(e){this._holes.add(e)},le.prototype.isShell=function(){return this._shell===null},le.prototype.getLabel=function(){return this._label},le.prototype.getEdges=function(){return this._edges},le.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},le.prototype.getShell=function(){return this._shell},le.prototype.mergeLabel=function(){if(arguments.length===1){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],i=t.getLocation(n,U.RIGHT);if(i===F.NONE)return null;if(this._label.getLocation(n)===F.NONE)return this._label.setLocation(n,i),null}},le.prototype.setShell=function(e){this._shell=e,e!==null&&e.addHole(this)},le.prototype.toPolygon=function(e){for(var t=this,n=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)n[i]=t._holes.get(i).getLinearRing();var s=e.createPolygon(this.getLinearRing(),n);return s},le.prototype.interfaces_=function(){return[]},le.prototype.getClass=function(){return le};var KE=function(r){function e(){var t=arguments[0],n=arguments[1];r.call(this,t,n)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(n,i){n.setMinEdgeRing(i)},e.prototype.getNext=function(n){return n.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(le),ZE=function(r){function e(){var t=arguments[0],n=arguments[1];r.call(this,t,n)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var n=this,i=new W,s=this._startDe;do{if(s.getMinEdgeRing()===null){var o=new KE(s,n._geometryFactory);i.add(o)}s=s.getNext()}while(s!==this._startDe);return i},e.prototype.setEdgeRing=function(n,i){n.setEdgeRing(i)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,i=this._startDe;do{var s=i.getNode();s.getEdges().linkMinimalDirectedEdges(n),i=i.getNext()}while(i!==this._startDe)},e.prototype.getNext=function(n){return n.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(le),Tn=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._label=e}}};Tn.prototype.setVisited=function(e){this._isVisited=e},Tn.prototype.setInResult=function(e){this._isInResult=e},Tn.prototype.isCovered=function(){return this._isCovered},Tn.prototype.isCoveredSet=function(){return this._isCoveredSet},Tn.prototype.setLabel=function(e){this._label=e},Tn.prototype.getLabel=function(){return this._label},Tn.prototype.setCovered=function(e){this._isCovered=e,this._isCoveredSet=!0},Tn.prototype.updateIM=function(e){yt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(e)},Tn.prototype.isInResult=function(){return this._isInResult},Tn.prototype.isVisited=function(){return this._isVisited},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn};var pc=function(r){function e(){r.call(this),this._coord=null,this._edges=null;var t=arguments[0],n=arguments[1];this._coord=t,this._edges=n,this._label=new jt(0,F.NONE)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdge().isInResult())return!0}return!1},e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(n){},e.prototype.computeMergedLocation=function(n,i){var s=F.NONE;if(s=this._label.getLocation(i),!n.isNull(i)){var o=n.getLocation(i);s!==F.BOUNDARY&&(s=o)}return s},e.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this._label===null?this._label=new jt(n,i):this._label.setLocation(n,i)}else return r.prototype.setLabel.apply(this,arguments)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof e){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof jt)for(var s=arguments[0],o=0;o<2;o++){var a=n.computeMergedLocation(s,o),u=n._label.getLocation(o);u===F.NONE&&n._label.setLocation(o,a)}},e.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},e.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var i=F.NONE;this._label!==null&&(i=this._label.getLocation(n));var s=null;switch(i){case F.BOUNDARY:s=F.INTERIOR;break;case F.INTERIOR:s=F.BOUNDARY;break;default:s=F.BOUNDARY;break}this._label.setLocation(n,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Tn),_r=function(){this.nodeMap=new ke,this.nodeFact=null;var e=arguments[0];this.nodeFact=e};_r.prototype.find=function(e){return this.nodeMap.get(e)},_r.prototype.addNode=function(){if(arguments[0]instanceof R){var e=arguments[0],t=this.nodeMap.get(e);return t===null&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}else if(arguments[0]instanceof pc){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},_r.prototype.print=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},_r.prototype.iterator=function(){return this.nodeMap.values().iterator()},_r.prototype.values=function(){return this.nodeMap.values()},_r.prototype.getBoundaryNodes=function(e){for(var t=new W,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(e)===F.BOUNDARY&&t.add(i)}return t},_r.prototype.add=function(e){var t=e.getCoordinate(),n=this.addNode(t);n.add(e)},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r};var Bt=function(){},Zu={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Bt.prototype.interfaces_=function(){return[]},Bt.prototype.getClass=function(){return Bt},Bt.isNorthern=function(e){return e===Bt.NE||e===Bt.NW},Bt.isOpposite=function(e,t){if(e===t)return!1;var n=(e-t+4)%4;return n===2},Bt.commonHalfPlane=function(e,t){if(e===t)return e;var n=(e-t+4)%4;if(n===2)return-1;var i=e<t?e:t,s=e>t?e:t;return i===0&&s===3?3:i},Bt.isInHalfPlane=function(e,t){return t===Bt.SE?e===Bt.SE||e===Bt.SW:e===t||e===t+1},Bt.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new Yt("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?Bt.NE:Bt.SE:t>=0?Bt.NW:Bt.SW}else if(arguments[0]instanceof R&&arguments[1]instanceof R){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new Yt("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?Bt.NE:Bt.SE:i.y>=n.y?Bt.NW:Bt.SW}},Zu.NE.get=function(){return 0},Zu.NW.get=function(){return 1},Zu.SW.get=function(){return 2},Zu.SE.get=function(){return 3},Object.defineProperties(Bt,Zu);var Ve=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var e=arguments[0];this._edge=e}else if(arguments.length===3){var t=arguments[0],n=arguments[1],i=arguments[2],s=null;this._edge=t,this.init(n,i),this._label=s}else if(arguments.length===4){var o=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=o,this.init(a,u),this._label=l}};Ve.prototype.compareDirection=function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant<e._quadrant?-1:q.computeOrientation(e._p0,e._p1,this._p1)},Ve.prototype.getDy=function(){return this._dy},Ve.prototype.getCoordinate=function(){return this._p0},Ve.prototype.setNode=function(e){this._node=e},Ve.prototype.print=function(e){var t=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),s=n.substring(i+1);e.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label)},Ve.prototype.compareTo=function(e){var t=e;return this.compareDirection(t)},Ve.prototype.getDirectedCoordinate=function(){return this._p1},Ve.prototype.getDx=function(){return this._dx},Ve.prototype.getLabel=function(){return this._label},Ve.prototype.getEdge=function(){return this._edge},Ve.prototype.getQuadrant=function(){return this._quadrant},Ve.prototype.getNode=function(){return this._node},Ve.prototype.toString=function(){var e=Math.atan2(this._dy,this._dx),t=this.getClass().getName(),n=t.lastIndexOf("."),i=t.substring(n+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label},Ve.prototype.computeLabel=function(e){},Ve.prototype.init=function(e,t){this._p0=e,this._p1=t,this._dx=t.x-e.x,this._dy=t.y-e.y,this._quadrant=Bt.quadrant(this._dx,this._dy),yt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Ve.prototype.interfaces_=function(){return[An]},Ve.prototype.getClass=function(){return Ve};var gd=function(r){function e(){var t=arguments[0],n=arguments[1];if(r.call(this,t),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(t.getCoordinate(0),t.getCoordinate(1));else{var i=t.getNumPoints()-1;this.init(t.getCoordinate(i),t.getCoordinate(i-1))}this.computeDirectedLabel()}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(n){return this._depth[n]},e.prototype.setVisited=function(n){this._isVisited=n},e.prototype.computeDirectedLabel=function(){this._label=new jt(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(n,i){if(this._depth[n]!==-999&&this._depth[n]!==i)throw new Si("assigned depths do not match",this.getCoordinate());this._depth[n]=i},e.prototype.isInteriorAreaEdge=function(){for(var n=this,i=!0,s=0;s<2;s++)n._label.isArea(s)&&n._label.getLocation(s,U.LEFT)===F.INTERIOR&&n._label.getLocation(s,U.RIGHT)===F.INTERIOR||(i=!1);return i},e.prototype.setNextMin=function(n){this._nextMin=n},e.prototype.print=function(n){r.prototype.print.call(this,n),n.print(" "+this._depth[U.LEFT]+"/"+this._depth[U.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},e.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},e.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,F.EXTERIOR),s=!this._label.isArea(1)||this._label.allPositionsEqual(1,F.EXTERIOR);return n&&i&&s},e.prototype.setEdgeRing=function(n){this._edgeRing=n},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},e.prototype.setInResult=function(n){this._isInResult=n},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},e.prototype.setSym=function(n){this._sym=n},e.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},e.prototype.setEdgeDepths=function(n,i){var s=this.getEdge().getDepthDelta();this._isForward||(s=-s);var o=1;n===U.LEFT&&(o=-1);var a=U.opposite(n),u=s*o,l=i+u;this.setDepth(n,i),this.setDepth(a,l)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(n){this._next=n},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(n,i){return n===F.EXTERIOR&&i===F.INTERIOR?1:n===F.INTERIOR&&i===F.EXTERIOR?-1:0},e}(Ve),Ea=function(){};Ea.prototype.createNode=function(e){return new pc(e,null)},Ea.prototype.interfaces_=function(){return[]},Ea.prototype.getClass=function(){return Ea};var Kt=function(){if(this._edges=new W,this._nodes=null,this._edgeEndList=new W,arguments.length===0)this._nodes=new _r(new Ea);else if(arguments.length===1){var e=arguments[0];this._nodes=new _r(e)}};Kt.prototype.printEdges=function(e){var t=this;e.println("Edges:");for(var n=0;n<this._edges.size();n++){e.println("edge "+n+":");var i=t._edges.get(n);i.print(e),i.eiList.print(e)}},Kt.prototype.find=function(e){return this._nodes.find(e)},Kt.prototype.addNode=function(){if(arguments[0]instanceof pc){var e=arguments[0];return this._nodes.addNode(e)}else if(arguments[0]instanceof R){var t=arguments[0];return this._nodes.addNode(t)}},Kt.prototype.getNodeIterator=function(){return this._nodes.iterator()},Kt.prototype.linkResultDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();){var t=e.next();t.getEdges().linkResultDirectedEdges()}},Kt.prototype.debugPrintln=function(e){Te.out.println(e)},Kt.prototype.isBoundaryNode=function(e,t){var n=this._nodes.find(t);if(n===null)return!1;var i=n.getLabel();return i!==null&&i.getLocation(e)===F.BOUNDARY},Kt.prototype.linkAllDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();){var t=e.next();t.getEdges().linkAllDirectedEdges()}},Kt.prototype.matchInSameDirection=function(e,t,n,i){return e.equals(n)?q.computeOrientation(e,t,i)===q.COLLINEAR&&Bt.quadrant(e,t)===Bt.quadrant(n,i):!1},Kt.prototype.getEdgeEnds=function(){return this._edgeEndList},Kt.prototype.debugPrint=function(e){Te.out.print(e)},Kt.prototype.getEdgeIterator=function(){return this._edges.iterator()},Kt.prototype.findEdgeInSameDirection=function(e,t){for(var n=this,i=0;i<this._edges.size();i++){var s=n._edges.get(i),o=s.getCoordinates();if(n.matchInSameDirection(e,t,o[0],o[1])||n.matchInSameDirection(e,t,o[o.length-1],o[o.length-2]))return s}return null},Kt.prototype.insertEdge=function(e){this._edges.add(e)},Kt.prototype.findEdgeEnd=function(e){for(var t=this.getEdgeEnds().iterator();t.hasNext();){var n=t.next();if(n.getEdge()===e)return n}return null},Kt.prototype.addEdges=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next();t._edges.add(i);var s=new gd(i,!0),o=new gd(i,!1);s.setSym(o),o.setSym(s),t.add(s),t.add(o)}},Kt.prototype.add=function(e){this._nodes.add(e),this._edgeEndList.add(e)},Kt.prototype.getNodes=function(){return this._nodes.values()},Kt.prototype.findEdge=function(e,t){for(var n=this,i=0;i<this._edges.size();i++){var s=n._edges.get(i),o=s.getCoordinates();if(e.equals(o[0])&&t.equals(o[1]))return s}return null},Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt},Kt.linkResultDirectedEdges=function(e){for(var t=e.iterator();t.hasNext();){var n=t.next();n.getEdges().linkResultDirectedEdges()}};var fn=function(){this._geometryFactory=null,this._shellList=new W;var e=arguments[0];this._geometryFactory=e};fn.prototype.sortShellsAndHoles=function(e,t,n){for(var i=e.iterator();i.hasNext();){var s=i.next();s.isHole()?n.add(s):t.add(s)}},fn.prototype.computePolygons=function(e){for(var t=this,n=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=s.toPolygon(t._geometryFactory);n.add(o)}return n},fn.prototype.placeFreeHoles=function(e,t){for(var n=this,i=t.iterator();i.hasNext();){var s=i.next();if(s.getShell()===null){var o=n.findEdgeRingContaining(s,e);if(o===null)throw new Si("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(o)}}},fn.prototype.buildMinimalEdgeRings=function(e,t,n){for(var i=this,s=new W,o=e.iterator();o.hasNext();){var a=o.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),t.add(l)):n.addAll(u)}else s.add(a)}return s},fn.prototype.containsPoint=function(e){for(var t=this._shellList.iterator();t.hasNext();){var n=t.next();if(n.containsPoint(e))return!0}return!1},fn.prototype.buildMaximalEdgeRings=function(e){for(var t=this,n=new W,i=e.iterator();i.hasNext();){var s=i.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var o=new ZE(s,t._geometryFactory);n.add(o),o.setInResult()}}return n},fn.prototype.placePolygonHoles=function(e,t){for(var n=t.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(e)}},fn.prototype.getPolygons=function(){var e=this.computePolygons(this._shellList);return e},fn.prototype.findEdgeRingContaining=function(e,t){for(var n=e.getLinearRing(),i=n.getEnvelopeInternal(),s=n.getCoordinateN(0),o=null,a=null,u=t.iterator();u.hasNext();){var l=u.next(),c=l.getLinearRing(),h=c.getEnvelopeInternal();o!==null&&(a=o.getLinearRing().getEnvelopeInternal());var f=!1;h.contains(i)&&q.isPointInRing(s,c.getCoordinates())&&(f=!0),f&&(o===null||a.contains(h))&&(o=l)}return o},fn.prototype.findShell=function(e){for(var t=0,n=null,i=e.iterator();i.hasNext();){var s=i.next();s.isHole()||(n=s,t++)}return yt.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),n},fn.prototype.add=function(){if(arguments.length===1){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(arguments.length===2){var t=arguments[0],n=arguments[1];Kt.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(t),s=new W,o=this.buildMinimalEdgeRings(i,this._shellList,s);this.sortShellsAndHoles(o,this._shellList,s),this.placeFreeHoles(this._shellList,s)}},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn};var Ca=function(){};Ca.prototype.getBounds=function(){},Ca.prototype.interfaces_=function(){return[]},Ca.prototype.getClass=function(){return Ca};var nr=function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t};nr.prototype.getItem=function(){return this._item},nr.prototype.getBounds=function(){return this._bounds},nr.prototype.interfaces_=function(){return[Ca,kn]},nr.prototype.getClass=function(){return nr};var bi=function(){this._size=null,this._items=null,this._size=0,this._items=new W,this._items.add(null)};bi.prototype.poll=function(){if(this.isEmpty())return null;var e=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),e},bi.prototype.size=function(){return this._size},bi.prototype.reorder=function(e){for(var t=this,n=null,i=this._items.get(e);e*2<=this._size&&(n=e*2,n!==t._size&&t._items.get(n+1).compareTo(t._items.get(n))<0&&n++,t._items.get(n).compareTo(i)<0);e=n)t._items.set(e,t._items.get(n));this._items.set(e,i)},bi.prototype.clear=function(){this._size=0,this._items.clear()},bi.prototype.isEmpty=function(){return this._size===0},bi.prototype.add=function(e){var t=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)t._items.set(n,t._items.get(Math.trunc(n/2)));this._items.set(n,e)},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi};var Ki=function(){};Ki.prototype.visitItem=function(e){},Ki.prototype.interfaces_=function(){return[]},Ki.prototype.getClass=function(){return Ki};var fo=function(){};fo.prototype.insert=function(e,t){},fo.prototype.remove=function(e,t){},fo.prototype.query=function(){},fo.prototype.interfaces_=function(){return[]},fo.prototype.getClass=function(){return fo};var ge=function(){if(this._childBoundables=new W,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._level=e}}},Am={serialVersionUID:{configurable:!0}};ge.prototype.getLevel=function(){return this._level},ge.prototype.size=function(){return this._childBoundables.size()},ge.prototype.getChildBoundables=function(){return this._childBoundables},ge.prototype.addChildBoundable=function(e){yt.isTrue(this._bounds===null),this._childBoundables.add(e)},ge.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},ge.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},ge.prototype.interfaces_=function(){return[Ca,kn]},ge.prototype.getClass=function(){return ge},Am.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(ge,Am);var rr=function(){};rr.reverseOrder=function(){return{compare:function(t,n){return n.compareTo(t)}}},rr.min=function(e){return rr.sort(e),e.get(0)},rr.sort=function(e,t){var n=e.toArray();t?bs.sort(n,t):bs.sort(n);for(var i=e.iterator(),s=0,o=n.length;s<o;s++)i.next(),i.set(n[s])},rr.singletonList=function(e){var t=new W;return t.add(e),t};var ce=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var e=arguments[0],t=arguments[1],n=arguments[2];this._boundable1=e,this._boundable2=t,this._itemDistance=n,this._distance=this.distance()};ce.prototype.expandToQueue=function(e,t){var n=ce.isComposite(this._boundable1),i=ce.isComposite(this._boundable2);if(n&&i)return ce.area(this._boundable1)>ce.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,e,t),null):(this.expand(this._boundable2,this._boundable1,e,t),null);if(n)return this.expand(this._boundable1,this._boundable2,e,t),null;if(i)return this.expand(this._boundable2,this._boundable1,e,t),null;throw new Yt("neither boundable is composite")},ce.prototype.isLeaves=function(){return!(ce.isComposite(this._boundable1)||ce.isComposite(this._boundable2))},ce.prototype.compareTo=function(e){var t=e;return this._distance<t._distance?-1:this._distance>t._distance?1:0},ce.prototype.expand=function(e,t,n,i){for(var s=this,o=e.getChildBoundables(),a=o.iterator();a.hasNext();){var u=a.next(),l=new ce(u,t,s._itemDistance);l.getDistance()<i&&n.add(l)}},ce.prototype.getBoundable=function(e){return e===0?this._boundable1:this._boundable2},ce.prototype.getDistance=function(){return this._distance},ce.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},ce.prototype.interfaces_=function(){return[An]},ce.prototype.getClass=function(){return ce},ce.area=function(e){return e.getBounds().getArea()},ce.isComposite=function(e){return e instanceof ge};var Se=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new W,this._nodeCapacity=null,arguments.length===0){var e=r.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(arguments.length===1){var t=arguments[0];yt.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t}},gc={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Se.prototype.getNodeCapacity=function(){return this._nodeCapacity},Se.prototype.lastNode=function(e){return e.get(e.size()-1)},Se.prototype.size=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var t=arguments[0],n=0,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof ge?n+=e.size(s):s instanceof nr&&(n+=1)}return n}},Se.prototype.removeItem=function(e,t){for(var n=null,i=e.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof nr&&s.getItem()===t&&(n=s)}return n!==null?(e.getChildBoundables().remove(n),!0):!1},Se.prototype.itemsTree=function(){var e=this;if(arguments.length===0){this.build();var t=this.itemsTree(this._root);return t===null?new W:t}else if(arguments.length===1){for(var n=arguments[0],i=new W,s=n.getChildBoundables().iterator();s.hasNext();){var o=s.next();if(o instanceof ge){var a=e.itemsTree(o);a!==null&&i.add(a)}else o instanceof nr?i.add(o.getItem()):yt.shouldNeverReachHere()}return i.size()<=0?null:i}},Se.prototype.insert=function(e,t){yt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new nr(e,t))},Se.prototype.boundablesAtLevel=function(){var e=this;if(arguments.length===1){var t=arguments[0],n=new W;return this.boundablesAtLevel(t,this._root,n),n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(yt.isTrue(i>-2),s.getLevel()===i)return o.add(s),null;for(var a=s.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof ge?e.boundablesAtLevel(i,u,o):(yt.isTrue(u instanceof nr),i===-1&&o.add(u))}return null}},Se.prototype.query=function(){var e=this;if(arguments.length===1){var t=arguments[0];this.build();var n=new W;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,n),n}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,s)}else if(arguments.length===3){if(at(arguments[2],Ki)&&arguments[0]instanceof Object&&arguments[1]instanceof ge)for(var o=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),c=0;c<l.size();c++){var h=l.get(c);e.getIntersectsOp().intersects(h.getBounds(),o)&&(h instanceof ge?e.query(o,h,u):h instanceof nr?u.visitItem(h.getItem()):yt.shouldNeverReachHere())}else if(at(arguments[2],Qn)&&arguments[0]instanceof Object&&arguments[1]instanceof ge)for(var f=arguments[0],p=arguments[1],v=arguments[2],C=p.getChildBoundables(),S=0;S<C.size();S++){var P=C.get(S);e.getIntersectsOp().intersects(P.getBounds(),f)&&(P instanceof ge?e.query(f,P,v):P instanceof nr?v.add(P.getItem()):yt.shouldNeverReachHere())}}},Se.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Se.prototype.getRoot=function(){return this.build(),this._root},Se.prototype.remove=function(){var e=this;if(arguments.length===2){var t=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),t)?this.remove(t,this._root,n):!1}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=this.removeItem(s,o);if(a)return!0;for(var u=null,l=s.getChildBoundables().iterator();l.hasNext();){var c=l.next();if(e.getIntersectsOp().intersects(c.getBounds(),i)&&c instanceof ge&&(a=e.remove(i,c,o),a)){u=c;break}}return u!==null&&u.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(u),a}},Se.prototype.createHigherLevels=function(e,t){yt.isTrue(!e.isEmpty());var n=this.createParentBoundables(e,t+1);return n.size()===1?n.get(0):this.createHigherLevels(n,t+1)},Se.prototype.depth=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var t=arguments[0],n=0,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof ge){var o=e.depth(s);o>n&&(n=o)}}return n+1}},Se.prototype.createParentBoundables=function(e,t){var n=this;yt.isTrue(!e.isEmpty());var i=new W;i.add(this.createNode(t));var s=new W(e);rr.sort(s,this.getComparator());for(var o=s.iterator();o.hasNext();){var a=o.next();n.lastNode(i).getChildBoundables().size()===n.getNodeCapacity()&&i.add(n.createNode(t)),n.lastNode(i).addChildBoundable(a)}return i},Se.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Se.prototype.interfaces_=function(){return[kn]},Se.prototype.getClass=function(){return Se},Se.compareDoubles=function(e,t){return e>t?1:e<t?-1:0},gc.IntersectsOp.get=function(){return QE},gc.serialVersionUID.get=function(){return-3886435814360241e3},gc.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Se,gc);var QE=function(){},Sa=function(){};Sa.prototype.distance=function(e,t){},Sa.prototype.interfaces_=function(){return[]},Sa.prototype.getClass=function(){return Sa};var km=function(r){function e(n){n=n||e.DEFAULT_NODE_CAPACITY,r.call(this,n)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return e.prototype.createParentBoundablesFromVerticalSlices=function(i,s){var o=this;yt.isTrue(i.length>0);for(var a=new W,u=0;u<i.length;u++)a.addAll(o.createParentBoundablesFromVerticalSlice(i[u],s));return a},e.prototype.createNode=function(i){return new Vm(i)},e.prototype.size=function(){return arguments.length===0?r.prototype.size.call(this):r.prototype.size.apply(this,arguments)},e.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];if(i.isNull())return null;r.prototype.insert.call(this,i,s)}else return r.prototype.insert.apply(this,arguments)},e.prototype.getIntersectsOp=function(){return e.intersectsOp},e.prototype.verticalSlices=function(i,s){for(var o=Math.trunc(Math.ceil(i.size()/s)),a=new Array(s).fill(null),u=i.iterator(),l=0;l<s;l++){a[l]=new W;for(var c=0;u.hasNext()&&c<o;){var h=u.next();a[l].add(h),c++}}return a},e.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return r.prototype.query.call(this,i)}else if(arguments.length===2){var s=arguments[0],o=arguments[1];r.prototype.query.call(this,s,o)}else if(arguments.length===3){if(at(arguments[2],Ki)&&arguments[0]instanceof Object&&arguments[1]instanceof ge){var a=arguments[0],u=arguments[1],l=arguments[2];r.prototype.query.call(this,a,u,l)}else if(at(arguments[2],Qn)&&arguments[0]instanceof Object&&arguments[1]instanceof ge){var c=arguments[0],h=arguments[1],f=arguments[2];r.prototype.query.call(this,c,h,f)}}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(i,s){return r.prototype.createParentBoundables.call(this,i,s)},e.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return r.prototype.remove.call(this,i,s)}else return r.prototype.remove.apply(this,arguments)},e.prototype.depth=function(){return arguments.length===0?r.prototype.depth.call(this):r.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(i,s){yt.isTrue(!i.isEmpty());var o=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new W(i);rr.sort(a,e.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(u,s)},e.prototype.nearestNeighbour=function(){if(arguments.length===1){if(at(arguments[0],Sa)){var i=arguments[0],s=new ce(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(s)}else if(arguments[0]instanceof ce){var o=arguments[0];return this.nearestNeighbour(o,ht.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof e&&at(arguments[1],Sa)){var a=arguments[0],u=arguments[1],l=new ce(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof ce&&typeof arguments[1]=="number"){var c=arguments[0],h=arguments[1],f=h,p=null,v=new bi;for(v.add(c);!v.isEmpty()&&f>0;){var C=v.poll(),S=C.getDistance();if(S>=f)break;C.isLeaves()?(f=S,p=C):C.expandToQueue(v,f)}return[p.getBoundable(0).getItem(),p.getBoundable(1).getItem()]}}else if(arguments.length===3){var P=arguments[0],y=arguments[1],_=arguments[2],m=new nr(P,y),w=new ce(this.getRoot(),m,_);return this.nearestNeighbour(w)[0]}},e.prototype.interfaces_=function(){return[fo,kn]},e.prototype.getClass=function(){return e},e.centreX=function(i){return e.avg(i.getMinX(),i.getMaxX())},e.avg=function(i,s){return(i+s)/2},e.centreY=function(i){return e.avg(i.getMinY(),i.getMaxY())},t.STRtreeNode.get=function(){return Vm},t.serialVersionUID.get=function(){return 0x39920f7d5f261e0},t.xComparator.get=function(){return{interfaces_:function(){return[la]},compare:function(n,i){return r.compareDoubles(e.centreX(n.getBounds()),e.centreX(i.getBounds()))}}},t.yComparator.get=function(){return{interfaces_:function(){return[la]},compare:function(n,i){return r.compareDoubles(e.centreY(n.getBounds()),e.centreY(i.getBounds()))}}},t.intersectsOp.get=function(){return{interfaces_:function(){return[r.IntersectsOp]},intersects:function(n,i){return n.intersects(i)}}},t.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,t),e}(Se),Vm=function(r){function e(){var t=arguments[0];r.call(this,t)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var n=null,i=this.getChildBoundables().iterator();i.hasNext();){var s=i.next();n===null?n=new Q(s.getBounds()):n.expandToInclude(s.getBounds())}return n},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ge),nn=function(){};nn.prototype.interfaces_=function(){return[]},nn.prototype.getClass=function(){return nn},nn.relativeSign=function(e,t){return e<t?-1:e>t?1:0},nn.compare=function(e,t,n){if(t.equals2D(n))return 0;var i=nn.relativeSign(t.x,n.x),s=nn.relativeSign(t.y,n.y);switch(e){case 0:return nn.compareValue(i,s);case 1:return nn.compareValue(s,i);case 2:return nn.compareValue(s,-i);case 3:return nn.compareValue(-i,s);case 4:return nn.compareValue(-i,-s);case 5:return nn.compareValue(-s,-i);case 6:return nn.compareValue(-s,i);case 7:return nn.compareValue(i,-s)}return yt.shouldNeverReachHere("invalid octant value"),0},nn.compareValue=function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0};var Zi=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this._segString=e,this.coord=new R(t),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!t.equals2D(e.getCoordinate(n))};Zi.prototype.getCoordinate=function(){return this.coord},Zi.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)},Zi.prototype.compareTo=function(e){var t=e;return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:nn.compare(this._segmentOctant,this.coord,t.coord)},Zi.prototype.isEndPoint=function(e){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===e},Zi.prototype.isInterior=function(){return this._isInterior},Zi.prototype.interfaces_=function(){return[An]},Zi.prototype.getClass=function(){return Zi};var He=function(){this._nodeMap=new ke,this._edge=null;var e=arguments[0];this._edge=e};He.prototype.getSplitCoordinates=function(){var e=this,t=new Wu;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next();e.addEdgeCoordinates(i,s,t),i=s}return t.toCoordinateArray()},He.prototype.addCollapsedNodes=function(){var e=this,t=new W;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var n=t.iterator();n.hasNext();){var i=n.next().intValue();e.add(e._edge.getCoordinate(i),i)}},He.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},He.prototype.findCollapsesFromExistingVertices=function(e){for(var t=this,n=0;n<this._edge.size()-2;n++){var i=t._edge.getCoordinate(n),s=t._edge.getCoordinate(n+2);i.equals2D(s)&&e.add(new cr(n+1))}},He.prototype.addEdgeCoordinates=function(e,t,n){var i=this,s=this._edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(s);n.add(new R(e.coord),!1);for(var a=e.segmentIndex+1;a<=t.segmentIndex;a++)n.add(i._edge.getCoordinate(a));o&&n.add(new R(t.coord))},He.prototype.iterator=function(){return this._nodeMap.values().iterator()},He.prototype.addSplitEdges=function(e){var t=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next(),o=t.createSplitEdge(i,s);e.add(o),i=s}},He.prototype.findCollapseIndex=function(e,t,n){if(!e.coord.equals2D(t.coord))return!1;var i=t.segmentIndex-e.segmentIndex;return t.isInterior()||i--,i===1?(n[0]=e.segmentIndex+1,!0):!1},He.prototype.findCollapsesFromInsertedNodes=function(e){for(var t=this,n=new Array(1).fill(null),i=this.iterator(),s=i.next();i.hasNext();){var o=i.next(),a=t.findCollapseIndex(s,o,n);a&&e.add(new cr(n[0])),s=o}},He.prototype.getEdge=function(){return this._edge},He.prototype.addEndpoints=function(){var e=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(e),e)},He.prototype.createSplitEdge=function(e,t){var n=this,i=t.segmentIndex-e.segmentIndex+2,s=this._edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new R(e.coord);for(var l=e.segmentIndex+1;l<=t.segmentIndex;l++)a[u++]=n._edge.getCoordinate(l);return o&&(a[u]=new R(t.coord)),new oe(a,this._edge.getData())},He.prototype.add=function(e,t){var n=new Zi(this._edge,e,t,this._edge.getSegmentOctant(t)),i=this._nodeMap.get(n);return i!==null?(yt.isTrue(i.coord.equals2D(e),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)},He.prototype.checkSplitEdgesCorrectness=function(e){var t=this._edge.getCoordinates(),n=e.get(0),i=n.getCoordinate(0);if(!i.equals2D(t[0]))throw new vi("bad split edge start point at "+i);var s=e.get(e.size()-1),o=s.getCoordinates(),a=o[o.length-1];if(!a.equals2D(t[t.length-1]))throw new vi("bad split edge end point at "+a)},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var po=function(){};po.prototype.interfaces_=function(){return[]},po.prototype.getClass=function(){return po},po.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new Yt("Cannot compute the octant for point ( "+e+", "+t+" )");var n=Math.abs(e),i=Math.abs(t);return e>=0?t>=0?n>=i?0:1:n>=i?7:6:t>=0?n>=i?3:2:n>=i?4:5}else if(arguments[0]instanceof R&&arguments[1]instanceof R){var s=arguments[0],o=arguments[1],a=o.x-s.x,u=o.y-s.y;if(a===0&&u===0)throw new Yt("Cannot compute the octant for two identical points "+s);return po.octant(a,u)}};var Yr=function(){};Yr.prototype.getCoordinates=function(){},Yr.prototype.size=function(){},Yr.prototype.getCoordinate=function(e){},Yr.prototype.isClosed=function(){},Yr.prototype.setData=function(e){},Yr.prototype.getData=function(){},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr};var Qu=function(){};Qu.prototype.addIntersection=function(e,t){},Qu.prototype.interfaces_=function(){return[Yr]},Qu.prototype.getClass=function(){return Qu};var oe=function(){this._nodeList=new He(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};oe.prototype.getCoordinates=function(){return this._pts},oe.prototype.size=function(){return this._pts.length},oe.prototype.getCoordinate=function(e){return this._pts[e]},oe.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},oe.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))},oe.prototype.setData=function(e){this._data=e},oe.prototype.safeOctant=function(e,t){return e.equals2D(t)?0:po.octant(e,t)},oe.prototype.getData=function(){return this._data},oe.prototype.addIntersection=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[3],o=new R(n.getIntersection(s));this.addIntersection(o,i)}},oe.prototype.toString=function(){return Zn.toLineString(new se(this._pts))},oe.prototype.getNodeList=function(){return this._nodeList},oe.prototype.addIntersectionNode=function(e,t){var n=t,i=n+1;if(i<this._pts.length){var s=this._pts[i];e.equals2D(s)&&(n=i)}var o=this._nodeList.add(e,n);return o},oe.prototype.addIntersections=function(e,t,n){for(var i=this,s=0;s<e.getIntersectionNum();s++)i.addIntersection(e,t,n,s)},oe.prototype.interfaces_=function(){return[Qu]},oe.prototype.getClass=function(){return oe},oe.getNodedSubstrings=function(){if(arguments.length===1){var e=arguments[0],t=new W;return oe.getNodedSubstrings(e,t),t}else if(arguments.length===2)for(var n=arguments[0],i=arguments[1],s=n.iterator();s.hasNext();){var o=s.next();o.getNodeList().addSplitEdges(i)}};var tt=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new R,this.p1=new R;else if(arguments.length===1){var e=arguments[0];this.p0=new R(e.p0),this.p1=new R(e.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var t=arguments[0],n=arguments[1],i=arguments[2],s=arguments[3];this.p0=new R(t,n),this.p1=new R(i,s)}},jm={serialVersionUID:{configurable:!0}};tt.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},tt.prototype.orientationIndex=function(){if(arguments[0]instanceof tt){var e=arguments[0],t=q.orientationIndex(this.p0,this.p1,e.p0),n=q.orientationIndex(this.p0,this.p1,e.p1);return t>=0&&n>=0||t<=0&&n<=0?Math.max(t,n):0}else if(arguments[0]instanceof R){var i=arguments[0];return q.orientationIndex(this.p0,this.p1,i)}},tt.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])},tt.prototype.isVertical=function(){return this.p0.x===this.p1.x},tt.prototype.equals=function(e){if(!(e instanceof tt))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)},tt.prototype.intersection=function(e){var t=new Cs;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null},tt.prototype.project=function(){if(arguments[0]instanceof R){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new R(e);var t=this.projectionFactor(e),n=new R;return n.x=this.p0.x+t*(this.p1.x-this.p0.x),n.y=this.p0.y+t*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof tt){var i=arguments[0],s=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(s>=1&&o>=1||s<=0&&o<=0)return null;var a=this.project(i.p0);s<0&&(a=this.p0),s>1&&(a=this.p1);var u=this.project(i.p1);return o<0&&(u=this.p0),o>1&&(u=this.p1),new tt(a,u)}},tt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},tt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},tt.prototype.getCoordinate=function(e){return e===0?this.p0:this.p1},tt.prototype.distancePerpendicular=function(e){return q.distancePointLinePerpendicular(e,this.p0,this.p1)},tt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},tt.prototype.midPoint=function(){return tt.midPoint(this.p0,this.p1)},tt.prototype.projectionFactor=function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=t*t+n*n;if(i<=0)return ht.NaN;var s=((e.x-this.p0.x)*t+(e.y-this.p0.y)*n)/i;return s},tt.prototype.closestPoints=function(e){var t=this.intersection(e);if(t!==null)return[t,t];var n=new Array(2).fill(null),i=ht.MAX_VALUE,s=null,o=this.closestPoint(e.p0);i=o.distance(e.p0),n[0]=o,n[1]=e.p0;var a=this.closestPoint(e.p1);s=a.distance(e.p1),s<i&&(i=s,n[0]=a,n[1]=e.p1);var u=e.closestPoint(this.p0);s=u.distance(this.p0),s<i&&(i=s,n[0]=this.p0,n[1]=u);var l=e.closestPoint(this.p1);return s=l.distance(this.p1),s<i&&(i=s,n[0]=this.p1,n[1]=l),n},tt.prototype.closestPoint=function(e){var t=this.projectionFactor(e);if(t>0&&t<1)return this.project(e);var n=this.p0.distance(e),i=this.p1.distance(e);return n<i?this.p0:this.p1},tt.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},tt.prototype.getLength=function(){return this.p0.distance(this.p1)},tt.prototype.compareTo=function(e){var t=e,n=this.p0.compareTo(t.p0);return n!==0?n:this.p1.compareTo(t.p1)},tt.prototype.reverse=function(){var e=this.p0;this.p0=this.p1,this.p1=e},tt.prototype.equalsTopo=function(e){return this.p0.equals(e.p0)&&(this.p1.equals(e.p1)||this.p0.equals(e.p1))&&this.p1.equals(e.p0)},tt.prototype.lineIntersection=function(e){try{var t=Kn.intersection(this.p0,this.p1,e.p0,e.p1);return t}catch(n){if(!(n instanceof ha))throw n}finally{}return null},tt.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},tt.prototype.pointAlongOffset=function(e,t){var n=this.p0.x+e*(this.p1.x-this.p0.x),i=this.p0.y+e*(this.p1.y-this.p0.y),s=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,a=Math.sqrt(s*s+o*o),u=0,l=0;if(t!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=t*s/a,l=t*o/a}var c=n-l,h=i+u,f=new R(c,h);return f},tt.prototype.setCoordinates=function(){if(arguments.length===1){var e=arguments[0];this.setCoordinates(e.p0,e.p1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.p0.x=t.x,this.p0.y=t.y,this.p1.x=n.x,this.p1.y=n.y}},tt.prototype.segmentFraction=function(e){var t=this.projectionFactor(e);return t<0?t=0:(t>1||ht.isNaN(t))&&(t=1),t},tt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},tt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},tt.prototype.distance=function(){if(arguments[0]instanceof tt){var e=arguments[0];return q.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}else if(arguments[0]instanceof R){var t=arguments[0];return q.distancePointLine(t,this.p0,this.p1)}},tt.prototype.pointAlong=function(e){var t=new R;return t.x=this.p0.x+e*(this.p1.x-this.p0.x),t.y=this.p0.y+e*(this.p1.y-this.p0.y),t},tt.prototype.hashCode=function(){var e=ht.doubleToLongBits(this.p0.x);e^=ht.doubleToLongBits(this.p0.y)*31;var t=Math.trunc(e)^Math.trunc(e>>32),n=ht.doubleToLongBits(this.p1.x);n^=ht.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(n)^Math.trunc(n>>32);return t^i},tt.prototype.interfaces_=function(){return[An,kn]},tt.prototype.getClass=function(){return tt},tt.midPoint=function(e,t){return new R((e.x+t.x)/2,(e.y+t.y)/2)},jm.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(tt,jm);var tl=function(){this.tempEnv1=new Q,this.tempEnv2=new Q,this._overlapSeg1=new tt,this._overlapSeg2=new tt};tl.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];e.getLineSegment(t,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},tl.prototype.interfaces_=function(){return[]},tl.prototype.getClass=function(){return tl};var pn=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this._pts=e,this._start=t,this._end=n,this._context=i};pn.prototype.getLineSegment=function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]},pn.prototype.computeSelect=function(e,t,n,i){var s=this._pts[t],o=this._pts[n];if(i.tempEnv1.init(s,o),n-t===1)return i.select(this,t),null;if(!e.intersects(i.tempEnv1))return null;var a=Math.trunc((t+n)/2);t<a&&this.computeSelect(e,t,a,i),a<n&&this.computeSelect(e,a,n,i)},pn.prototype.getCoordinates=function(){for(var e=this,t=new Array(this._end-this._start+1).fill(null),n=0,i=this._start;i<=this._end;i++)t[n++]=e._pts[i];return t},pn.prototype.computeOverlaps=function(e,t){this.computeOverlapsInternal(this._start,this._end,e,e._start,e._end,t)},pn.prototype.setId=function(e){this._id=e},pn.prototype.select=function(e,t){this.computeSelect(e,this._start,this._end,t)},pn.prototype.getEnvelope=function(){if(this._env===null){var e=this._pts[this._start],t=this._pts[this._end];this._env=new Q(e,t)}return this._env},pn.prototype.getEndIndex=function(){return this._end},pn.prototype.getStartIndex=function(){return this._start},pn.prototype.getContext=function(){return this._context},pn.prototype.getId=function(){return this._id},pn.prototype.computeOverlapsInternal=function(e,t,n,i,s,o){var a=this._pts[e],u=this._pts[t],l=n._pts[i],c=n._pts[s];if(t-e===1&&s-i===1)return o.overlap(this,e,n,i),null;if(o.tempEnv1.init(a,u),o.tempEnv2.init(l,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var h=Math.trunc((e+t)/2),f=Math.trunc((i+s)/2);e<h&&(i<f&&this.computeOverlapsInternal(e,h,n,i,f,o),f<s&&this.computeOverlapsInternal(e,h,n,f,s,o)),h<t&&(i<f&&this.computeOverlapsInternal(h,t,n,i,f,o),f<s&&this.computeOverlapsInternal(h,t,n,f,s,o))},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var wr=function(){};wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},wr.getChainStartIndices=function(e){var t=0,n=new W;n.add(new cr(t));do{var i=wr.findChainEnd(e,t);n.add(new cr(i)),t=i}while(t<e.length-1);var s=wr.toIntArray(n);return s},wr.findChainEnd=function(e,t){for(var n=t;n<e.length-1&&e[n].equals2D(e[n+1]);)n++;if(n>=e.length-1)return e.length-1;for(var i=Bt.quadrant(e[n],e[n+1]),s=t+1;s<e.length;){if(!e[s-1].equals2D(e[s])){var o=Bt.quadrant(e[s-1],e[s]);if(o!==i)break}s++}return s-1},wr.getChains=function(){if(arguments.length===1){var e=arguments[0];return wr.getChains(e,null)}else if(arguments.length===2){for(var t=arguments[0],n=arguments[1],i=new W,s=wr.getChainStartIndices(t),o=0;o<s.length-1;o++){var a=new pn(t,s[o],s[o+1],n);i.add(a)}return i}},wr.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),n=0;n<t.length;n++)t[n]=e.get(n).intValue();return t};var Is=function(){};Is.prototype.computeNodes=function(e){},Is.prototype.getNodedSubstrings=function(){},Is.prototype.interfaces_=function(){return[]},Is.prototype.getClass=function(){return Is};var el=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setSegmentIntersector(e)}}};el.prototype.setSegmentIntersector=function(e){this._segInt=e},el.prototype.interfaces_=function(){return[Is]},el.prototype.getClass=function(){return el};var md=function(r){function e(n){n?r.call(this,n):r.call(this),this._monoChains=new W,this._index=new km,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return oe.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(i){for(var s=this,o=wr.getChains(i.getCoordinates(),i),a=o.iterator();a.hasNext();){var u=a.next();u.setId(s._idCounter++),s._index.insert(u.getEnvelope(),u),s._monoChains.add(u)}},e.prototype.computeNodes=function(i){var s=this;this._nodedSegStrings=i;for(var o=i.iterator();o.hasNext();)s.add(o.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var i=this,s=new Bm(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var a=o.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var c=l.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,s),i._nOverlaps++),i._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.SegmentOverlapAction.get=function(){return Bm},Object.defineProperties(e,t),e}(el),Bm=function(r){function e(){r.call(this),this._si=null;var t=arguments[0];this._si=t}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3],a=n.getContext(),u=s.getContext();this._si.processIntersections(a,i,u,o)}else return r.prototype.overlap.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(tl),Ft=function r(){if(this._quadrantSegments=r.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=r.CAP_ROUND,this._joinStyle=r.JOIN_ROUND,this._mitreLimit=r.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=r.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.setQuadrantSegments(t),this.setEndCapStyle(n)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(s),this.setJoinStyle(o),this.setMitreLimit(a)}}},Pi={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Ft.prototype.getEndCapStyle=function(){return this._endCapStyle},Ft.prototype.isSingleSided=function(){return this._isSingleSided},Ft.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,this._quadrantSegments===0&&(this._joinStyle=Ft.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Ft.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==Ft.JOIN_ROUND&&(this._quadrantSegments=Ft.DEFAULT_QUADRANT_SEGMENTS)},Ft.prototype.getJoinStyle=function(){return this._joinStyle},Ft.prototype.setJoinStyle=function(e){this._joinStyle=e},Ft.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e},Ft.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Ft.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Ft.prototype.setEndCapStyle=function(e){this._endCapStyle=e},Ft.prototype.getMitreLimit=function(){return this._mitreLimit},Ft.prototype.setMitreLimit=function(e){this._mitreLimit=e},Ft.prototype.setSingleSided=function(e){this._isSingleSided=e},Ft.prototype.interfaces_=function(){return[]},Ft.prototype.getClass=function(){return Ft},Ft.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)},Pi.CAP_ROUND.get=function(){return 1},Pi.CAP_FLAT.get=function(){return 2},Pi.CAP_SQUARE.get=function(){return 3},Pi.JOIN_ROUND.get=function(){return 1},Pi.JOIN_MITRE.get=function(){return 2},Pi.JOIN_BEVEL.get=function(){return 3},Pi.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Pi.DEFAULT_MITRE_LIMIT.get=function(){return 5},Pi.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Ft,Pi);var ee=function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=q.COUNTERCLOCKWISE,this._inputLine=e||null},nl={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};ee.prototype.isDeletable=function(e,t,n,i){var s=this._inputLine[e],o=this._inputLine[t],a=this._inputLine[n];return!this.isConcave(s,o,a)||!this.isShallow(s,o,a,i)?!1:this.isShallowSampled(s,o,e,n,i)},ee.prototype.deleteShallowConcavities=function(){for(var e=this,t=1,n=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(n),s=!1;i<this._inputLine.length;){var o=!1;e.isDeletable(t,n,i,e._distanceTol)&&(e._isDeleted[n]=ee.DELETE,o=!0,s=!0),o?t=i:t=n,n=e.findNextNonDeletedIndex(t),i=e.findNextNonDeletedIndex(n)}return s},ee.prototype.isShallowConcavity=function(e,t,n,i){var s=q.computeOrientation(e,t,n),o=s===this._angleOrientation;if(!o)return!1;var a=q.distancePointLine(t,e,n);return a<i},ee.prototype.isShallowSampled=function(e,t,n,i,s){var o=this,a=Math.trunc((i-n)/ee.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=n;u<i;u+=a)if(!o.isShallow(e,t,o._inputLine[u],s))return!1;return!0},ee.prototype.isConcave=function(e,t,n){var i=q.computeOrientation(e,t,n),s=i===this._angleOrientation;return s},ee.prototype.simplify=function(e){var t=this;this._distanceTol=Math.abs(e),e<0&&(this._angleOrientation=q.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=t.deleteShallowConcavities();while(n);return this.collapseLine()},ee.prototype.findNextNonDeletedIndex=function(e){for(var t=e+1;t<this._inputLine.length&&this._isDeleted[t]===ee.DELETE;)t++;return t},ee.prototype.isShallow=function(e,t,n,i){var s=q.distancePointLine(t,e,n);return s<i},ee.prototype.collapseLine=function(){for(var e=this,t=new Wu,n=0;n<this._inputLine.length;n++)e._isDeleted[n]!==ee.DELETE&&t.add(e._inputLine[n]);return t.toCoordinateArray()},ee.prototype.interfaces_=function(){return[]},ee.prototype.getClass=function(){return ee},ee.simplify=function(e,t){var n=new ee(e);return n.simplify(t)},nl.INIT.get=function(){return 0},nl.DELETE.get=function(){return 1},nl.KEEP.get=function(){return 1},nl.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(ee,nl);var On=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new W},zm={COORDINATE_ARRAY_TYPE:{configurable:!0}};On.prototype.getCoordinates=function(){var e=this._ptList.toArray(On.COORDINATE_ARRAY_TYPE);return e},On.prototype.setPrecisionModel=function(e){this._precisionModel=e},On.prototype.addPt=function(e){var t=new R(e);if(this._precisionModel.makePrecise(t),this.isRedundant(t))return null;this._ptList.add(t)},On.prototype.revere=function(){},On.prototype.addPts=function(e,t){var n=this;if(t)for(var i=0;i<e.length;i++)n.addPt(e[i]);else for(var s=e.length-1;s>=0;s--)n.addPt(e[s])},On.prototype.isRedundant=function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1),n=e.distance(t);return n<this._minimimVertexDistance},On.prototype.toString=function(){var e=new St,t=e.createLineString(this.getCoordinates());return t.toString()},On.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var e=new R(this._ptList.get(0)),t=this._ptList.get(this._ptList.size()-1);if(e.equals(t))return null;this._ptList.add(e)},On.prototype.setMinimumVertexDistance=function(e){this._minimimVertexDistance=e},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},zm.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(On,zm);var xt=function(){},go={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};xt.prototype.interfaces_=function(){return[]},xt.prototype.getClass=function(){return xt},xt.toDegrees=function(e){return e*180/Math.PI},xt.normalize=function(e){for(;e>Math.PI;)e-=xt.PI_TIMES_2;for(;e<=-Math.PI;)e+=xt.PI_TIMES_2;return e},xt.angle=function(){if(arguments.length===1){var e=arguments[0];return Math.atan2(e.y,e.x)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],i=n.x-t.x,s=n.y-t.y;return Math.atan2(s,i)}},xt.isAcute=function(e,t,n){var i=e.x-t.x,s=e.y-t.y,o=n.x-t.x,a=n.y-t.y,u=i*o+s*a;return u>0},xt.isObtuse=function(e,t,n){var i=e.x-t.x,s=e.y-t.y,o=n.x-t.x,a=n.y-t.y,u=i*o+s*a;return u<0},xt.interiorAngle=function(e,t,n){var i=xt.angle(t,e),s=xt.angle(t,n);return Math.abs(s-i)},xt.normalizePositive=function(e){if(e<0){for(;e<0;)e+=xt.PI_TIMES_2;e>=xt.PI_TIMES_2&&(e=0)}else{for(;e>=xt.PI_TIMES_2;)e-=xt.PI_TIMES_2;e<0&&(e=0)}return e},xt.angleBetween=function(e,t,n){var i=xt.angle(t,e),s=xt.angle(t,n);return xt.diff(i,s)},xt.diff=function(e,t){var n=null;return e<t?n=t-e:n=e-t,n>Math.PI&&(n=2*Math.PI-n),n},xt.toRadians=function(e){return e*Math.PI/180},xt.getTurn=function(e,t){var n=Math.sin(t-e);return n>0?xt.COUNTERCLOCKWISE:n<0?xt.CLOCKWISE:xt.NONE},xt.angleBetweenOriented=function(e,t,n){var i=xt.angle(t,e),s=xt.angle(t,n),o=s-i;return o<=-Math.PI?o+xt.PI_TIMES_2:o>Math.PI?o-xt.PI_TIMES_2:o},go.PI_TIMES_2.get=function(){return 2*Math.PI},go.PI_OVER_2.get=function(){return Math.PI/2},go.PI_OVER_4.get=function(){return Math.PI/4},go.COUNTERCLOCKWISE.get=function(){return q.COUNTERCLOCKWISE},go.CLOCKWISE.get=function(){return q.CLOCKWISE},go.NONE.get=function(){return q.COLLINEAR},Object.defineProperties(xt,go);var qt=function r(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new tt,this._seg1=new tt,this._offset0=new tt,this._offset1=new tt,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._precisionModel=e,this._bufParams=t,this._li=new Cs,this._filletAngleQuantum=Math.PI/2/t.getQuadrantSegments(),t.getQuadrantSegments()>=8&&t.getJoinStyle()===Ft.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},rl={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};qt.prototype.addNextSegment=function(e,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=e,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=q.computeOrientation(this._s0,this._s1,this._s2),i=n===q.CLOCKWISE&&this._side===U.LEFT||n===q.COUNTERCLOCKWISE&&this._side===U.RIGHT;n===0?this.addCollinear(t):i?this.addOutsideTurn(n,t):this.addInsideTurn(n,t)},qt.prototype.addLineEndCap=function(e,t){var n=new tt(e,t),i=new tt;this.computeOffsetSegment(n,U.LEFT,this._distance,i);var s=new tt;this.computeOffsetSegment(n,U.RIGHT,this._distance,s);var o=t.x-e.x,a=t.y-e.y,u=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case Ft.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(t,u+Math.PI/2,u-Math.PI/2,q.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case Ft.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(s.p1);break;case Ft.CAP_SQUARE:var l=new R;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var c=new R(i.p1.x+l.x,i.p1.y+l.y),h=new R(s.p1.x+l.x,s.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(h);break}},qt.prototype.getCoordinates=function(){var e=this._segList.getCoordinates();return e},qt.prototype.addMitreJoin=function(e,t,n,i){var s=!0,o=null;try{o=Kn.intersection(t.p0,t.p1,n.p0,n.p1);var a=i<=0?1:o.distance(e)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(s=!1)}catch(u){if(u instanceof ha)o=new R(0,0),s=!1;else throw u}finally{}s?this._segList.addPt(o):this.addLimitedMitreJoin(t,n,i,this._bufParams.getMitreLimit())},qt.prototype.addFilletCorner=function(e,t,n,i,s){var o=t.x-e.x,a=t.y-e.y,u=Math.atan2(a,o),l=n.x-e.x,c=n.y-e.y,h=Math.atan2(c,l);i===q.CLOCKWISE?u<=h&&(u+=2*Math.PI):u>=h&&(u-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(e,u,h,i,s),this._segList.addPt(n)},qt.prototype.addOutsideTurn=function(e,t){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*qt.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Ft.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Ft.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(t&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,e,this._distance),this._segList.addPt(this._offset1.p0))},qt.prototype.createSquare=function(e){this._segList.addPt(new R(e.x+this._distance,e.y+this._distance)),this._segList.addPt(new R(e.x+this._distance,e.y-this._distance)),this._segList.addPt(new R(e.x-this._distance,e.y-this._distance)),this._segList.addPt(new R(e.x-this._distance,e.y+this._distance)),this._segList.closeRing()},qt.prototype.addSegments=function(e,t){this._segList.addPts(e,t)},qt.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},qt.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},qt.prototype.initSideSegments=function(e,t,n){this._s1=e,this._s2=t,this._side=n,this._seg1.setCoordinates(e,t),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},qt.prototype.addLimitedMitreJoin=function(e,t,n,i){var s=this._seg0.p1,o=xt.angle(s,this._seg0.p0),a=xt.angleBetweenOriented(this._seg0.p0,s,this._seg1.p1),u=a/2,l=xt.normalize(o+u),c=xt.normalize(l+Math.PI),h=i*n,f=h*Math.abs(Math.sin(u)),p=n-f,v=s.x+h*Math.cos(c),C=s.y+h*Math.sin(c),S=new R(v,C),P=new tt(s,S),y=P.pointAlongOffset(1,p),_=P.pointAlongOffset(1,-p);this._side===U.LEFT?(this._segList.addPt(y),this._segList.addPt(_)):(this._segList.addPt(_),this._segList.addPt(y))},qt.prototype.computeOffsetSegment=function(e,t,n,i){var s=t===U.LEFT?1:-1,o=e.p1.x-e.p0.x,a=e.p1.y-e.p0.y,u=Math.sqrt(o*o+a*a),l=s*n*o/u,c=s*n*a/u;i.p0.x=e.p0.x-c,i.p0.y=e.p0.y+l,i.p1.x=e.p1.x-c,i.p1.y=e.p1.y+l},qt.prototype.addFilletArc=function(e,t,n,i,s){var o=this,a=i===q.CLOCKWISE?-1:1,u=Math.abs(t-n),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var c=0,h=u/l,f=c,p=new R;f<u;){var v=t+a*f;p.x=e.x+s*Math.cos(v),p.y=e.y+s*Math.sin(v),o._segList.addPt(p),f+=h}},qt.prototype.addInsideTurn=function(e,t){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*qt.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new R((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new R((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},qt.prototype.createCircle=function(e){var t=new R(e.x+this._distance,e.y);this._segList.addPt(t),this.addFilletArc(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},qt.prototype.addBevelJoin=function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)},qt.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new On,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*qt.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},qt.prototype.addCollinear=function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var t=this._li.getIntersectionNum();t>=2&&(this._bufParams.getJoinStyle()===Ft.JOIN_BEVEL||this._bufParams.getJoinStyle()===Ft.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,q.CLOCKWISE,this._distance))},qt.prototype.closeRing=function(){this._segList.closeRing()},qt.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},rl.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},rl.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},rl.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},rl.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(qt,rl);var rn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t};rn.prototype.getOffsetCurve=function(e,t){if(this._distance=t,t===0)return null;var n=t<0,i=Math.abs(t),s=this.getSegGen(i);e.length<=1?this.computePointCurve(e[0],s):this.computeOffsetCurve(e,n,s);var o=s.getCoordinates();return n&&Ct.reverse(o),o},rn.prototype.computeSingleSidedBufferCurve=function(e,t,n){var i=this.simplifyTolerance(this._distance);if(t){n.addSegments(e,!0);var s=ee.simplify(e,-i),o=s.length-1;n.initSideSegments(s[o],s[o-1],U.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{n.addSegments(e,!1);var u=ee.simplify(e,i),l=u.length-1;n.initSideSegments(u[0],u[1],U.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment(),n.closeRing()},rn.prototype.computeRingBufferCurve=function(e,t,n){var i=this.simplifyTolerance(this._distance);t===U.RIGHT&&(i=-i);var s=ee.simplify(e,i),o=s.length-1;n.initSideSegments(s[o-1],s[0],t);for(var a=1;a<=o;a++){var u=a!==1;n.addNextSegment(s[a],u)}n.closeRing()},rn.prototype.computeLineBufferCurve=function(e,t){var n=this.simplifyTolerance(this._distance),i=ee.simplify(e,n),s=i.length-1;t.initSideSegments(i[0],i[1],U.LEFT);for(var o=2;o<=s;o++)t.addNextSegment(i[o],!0);t.addLastSegment(),t.addLineEndCap(i[s-1],i[s]);var a=ee.simplify(e,-n),u=a.length-1;t.initSideSegments(a[u],a[u-1],U.LEFT);for(var l=u-2;l>=0;l--)t.addNextSegment(a[l],!0);t.addLastSegment(),t.addLineEndCap(a[1],a[0]),t.closeRing()},rn.prototype.computePointCurve=function(e,t){switch(this._bufParams.getEndCapStyle()){case Ft.CAP_ROUND:t.createCircle(e);break;case Ft.CAP_SQUARE:t.createSquare(e);break}},rn.prototype.getLineCurve=function(e,t){if(this._distance=t,t<0&&!this._bufParams.isSingleSided()||t===0)return null;var n=Math.abs(t),i=this.getSegGen(n);if(e.length<=1)this.computePointCurve(e[0],i);else if(this._bufParams.isSingleSided()){var s=t<0;this.computeSingleSidedBufferCurve(e,s,i)}else this.computeLineBufferCurve(e,i);var o=i.getCoordinates();return o},rn.prototype.getBufferParameters=function(){return this._bufParams},rn.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()},rn.prototype.getRingCurve=function(e,t,n){if(this._distance=n,e.length<=2)return this.getLineCurve(e,n);if(n===0)return rn.copyCoordinates(e);var i=this.getSegGen(n);return this.computeRingBufferCurve(e,t,i),i.getCoordinates()},rn.prototype.computeOffsetCurve=function(e,t,n){var i=this.simplifyTolerance(this._distance);if(t){var s=ee.simplify(e,-i),o=s.length-1;n.initSideSegments(s[o],s[o-1],U.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{var u=ee.simplify(e,i),l=u.length-1;n.initSideSegments(u[0],u[1],U.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment()},rn.prototype.getSegGen=function(e){return new qt(this._precisionModel,this._bufParams,e)},rn.prototype.interfaces_=function(){return[]},rn.prototype.getClass=function(){return rn},rn.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),n=0;n<t.length;n++)t[n]=new R(e[n]);return t};var mo=function(){this._subgraphs=null,this._seg=new tt,this._cga=new q;var e=arguments[0];this._subgraphs=e},Um={DepthSegment:{configurable:!0}};mo.prototype.findStabbedSegments=function(){var e=this;if(arguments.length===1){for(var t=arguments[0],n=new W,i=this._subgraphs.iterator();i.hasNext();){var s=i.next(),o=s.getEnvelope();t.y<o.getMinY()||t.y>o.getMaxY()||e.findStabbedSegments(t,s.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(at(arguments[2],Qn)&&arguments[0]instanceof R&&arguments[1]instanceof gd)for(var a=arguments[0],u=arguments[1],l=arguments[2],c=u.getEdge().getCoordinates(),h=0;h<c.length-1;h++){e._seg.p0=c[h],e._seg.p1=c[h+1],e._seg.p0.y>e._seg.p1.y&&e._seg.reverse();var f=Math.max(e._seg.p0.x,e._seg.p1.x);if(!(f<a.x)&&!e._seg.isHorizontal()&&!(a.y<e._seg.p0.y||a.y>e._seg.p1.y)&&q.computeOrientation(e._seg.p0,e._seg.p1,a)!==q.RIGHT){var p=u.getDepth(U.LEFT);e._seg.p0.equals(c[h])||(p=u.getDepth(U.RIGHT));var v=new xs(e._seg,p);l.add(v)}}else if(at(arguments[2],Qn)&&arguments[0]instanceof R&&at(arguments[1],Qn))for(var C=arguments[0],S=arguments[1],P=arguments[2],y=S.iterator();y.hasNext();){var _=y.next();_.isForward()&&e.findStabbedSegments(C,_,P)}}},mo.prototype.getDepth=function(e){var t=this.findStabbedSegments(e);if(t.size()===0)return 0;var n=rr.min(t);return n._leftDepth},mo.prototype.interfaces_=function(){return[]},mo.prototype.getClass=function(){return mo},Um.DepthSegment.get=function(){return xs},Object.defineProperties(mo,Um);var xs=function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new tt(e),this._leftDepth=t};xs.prototype.compareTo=function(e){var t=e;if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(t._upwardSeg);return n!==0||(n=-1*t._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(t._upwardSeg)},xs.prototype.compareX=function(e,t){var n=e.p0.compareTo(t.p0);return n!==0?n:e.p1.compareTo(t.p1)},xs.prototype.toString=function(){return this._upwardSeg.toString()},xs.prototype.interfaces_=function(){return[An]},xs.prototype.getClass=function(){return xs};var At=function(e,t,n){this.p0=e||null,this.p1=t||null,this.p2=n||null};At.prototype.area=function(){return At.area(this.p0,this.p1,this.p2)},At.prototype.signedArea=function(){return At.signedArea(this.p0,this.p1,this.p2)},At.prototype.interpolateZ=function(e){if(e===null)throw new Yt("Supplied point is null.");return At.interpolateZ(e,this.p0,this.p1,this.p2)},At.prototype.longestSideLength=function(){return At.longestSideLength(this.p0,this.p1,this.p2)},At.prototype.isAcute=function(){return At.isAcute(this.p0,this.p1,this.p2)},At.prototype.circumcentre=function(){return At.circumcentre(this.p0,this.p1,this.p2)},At.prototype.area3D=function(){return At.area3D(this.p0,this.p1,this.p2)},At.prototype.centroid=function(){return At.centroid(this.p0,this.p1,this.p2)},At.prototype.inCentre=function(){return At.inCentre(this.p0,this.p1,this.p2)},At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.area=function(e,t,n){return Math.abs(((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2)},At.signedArea=function(e,t,n){return((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2},At.det=function(e,t,n,i){return e*i-t*n},At.interpolateZ=function(e,t,n,i){var s=t.x,o=t.y,a=n.x-s,u=i.x-s,l=n.y-o,c=i.y-o,h=a*c-u*l,f=e.x-s,p=e.y-o,v=(c*f-u*p)/h,C=(-l*f+a*p)/h,S=t.z+v*(n.z-t.z)+C*(i.z-t.z);return S},At.longestSideLength=function(e,t,n){var i=e.distance(t),s=t.distance(n),o=n.distance(e),a=i;return s>a&&(a=s),o>a&&(a=o),a},At.isAcute=function(e,t,n){return!(!xt.isAcute(e,t,n)||!xt.isAcute(t,n,e)||!xt.isAcute(n,e,t))},At.circumcentre=function(e,t,n){var i=n.x,s=n.y,o=e.x-i,a=e.y-s,u=t.x-i,l=t.y-s,c=2*At.det(o,a,u,l),h=At.det(a,o*o+a*a,l,u*u+l*l),f=At.det(o,o*o+a*a,u,u*u+l*l),p=i-h/c,v=s+f/c;return new R(p,v)},At.perpendicularBisector=function(e,t){var n=t.x-e.x,i=t.y-e.y,s=new Kn(e.x+n/2,e.y+i/2,1),o=new Kn(e.x-i+n/2,e.y+n+i/2,1);return new Kn(s,o)},At.angleBisector=function(e,t,n){var i=t.distance(e),s=t.distance(n),o=i/(i+s),a=n.x-e.x,u=n.y-e.y,l=new R(e.x+o*a,e.y+o*u);return l},At.area3D=function(e,t,n){var i=t.x-e.x,s=t.y-e.y,o=t.z-e.z,a=n.x-e.x,u=n.y-e.y,l=n.z-e.z,c=s*l-o*u,h=o*a-i*l,f=i*u-s*a,p=c*c+h*h+f*f,v=Math.sqrt(p)/2;return v},At.centroid=function(e,t,n){var i=(e.x+t.x+n.x)/3,s=(e.y+t.y+n.y)/3;return new R(i,s)},At.inCentre=function(e,t,n){var i=t.distance(n),s=e.distance(n),o=e.distance(t),a=i+s+o,u=(i*e.x+s*t.x+o*n.x)/a,l=(i*e.y+s*t.y+o*n.y)/a;return new R(u,l)};var Un=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new W;var e=arguments[0],t=arguments[1],n=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=n};Un.prototype.addPoint=function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,F.EXTERIOR,F.INTERIOR)},Un.prototype.addPolygon=function(e){var t=this,n=this._distance,i=U.LEFT;this._distance<0&&(n=-this._distance,i=U.RIGHT);var s=e.getExteriorRing(),o=Ct.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,n,i,F.EXTERIOR,F.INTERIOR);for(var a=0;a<e.getNumInteriorRing();a++){var u=e.getInteriorRingN(a),l=Ct.removeRepeatedPoints(u.getCoordinates());t._distance>0&&t.isErodedCompletely(u,-t._distance)||t.addPolygonRing(l,n,U.opposite(i),F.INTERIOR,F.EXTERIOR)}},Un.prototype.isTriangleErodedCompletely=function(e,t){var n=new At(e[0],e[1],e[2]),i=n.inCentre(),s=q.distancePointLine(i,n.p0,n.p1);return s<Math.abs(t)},Un.prototype.addLineString=function(e){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var t=Ct.removeRepeatedPoints(e.getCoordinates()),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,F.EXTERIOR,F.INTERIOR)},Un.prototype.addCurve=function(e,t,n){if(e===null||e.length<2)return null;var i=new oe(e,new jt(0,F.BOUNDARY,t,n));this._curveList.add(i)},Un.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Un.prototype.addPolygonRing=function(e,t,n,i,s){if(t===0&&e.length<Hr.MINIMUM_VALID_SIZE)return null;var o=i,a=s;e.length>=Hr.MINIMUM_VALID_SIZE&&q.isCCW(e)&&(o=s,a=i,n=U.opposite(n));var u=this._curveBuilder.getRingCurve(e,n,t);this.addCurve(u,o,a)},Un.prototype.add=function(e){if(e.isEmpty())return null;e instanceof pe?this.addPolygon(e):e instanceof te?this.addLineString(e):e instanceof dn?this.addPoint(e):e instanceof wa?this.addCollection(e):e instanceof Ps?this.addCollection(e):e instanceof qr?this.addCollection(e):e instanceof Ge&&this.addCollection(e)},Un.prototype.isErodedCompletely=function(e,t){var n=e.getCoordinates();if(n.length<4)return t<0;if(n.length===4)return this.isTriangleErodedCompletely(n,t);var i=e.getEnvelopeInternal(),s=Math.min(i.getHeight(),i.getWidth());return t<0&&2*Math.abs(t)>s},Un.prototype.addCollection=function(e){for(var t=this,n=0;n<e.getNumGeometries();n++){var i=e.getGeometryN(n);t.add(i)}},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var ba=function(){};ba.prototype.locate=function(e){},ba.prototype.interfaces_=function(){return[]},ba.prototype.getClass=function(){return ba};var Jr=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var e=arguments[0];this._parent=e,this._atStart=!0,this._index=0,this._max=e.getNumGeometries()};Jr.prototype.next=function(){if(this._atStart)return this._atStart=!1,Jr.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new ya;var e=this._parent.getGeometryN(this._index++);return e instanceof Ge?(this._subcollectionIterator=new Jr(e),this._subcollectionIterator.next()):e},Jr.prototype.remove=function(){throw new Error(this.getClass().getName())},Jr.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Jr.prototype.interfaces_=function(){return[va]},Jr.prototype.getClass=function(){return Jr},Jr.isAtomic=function(e){return!(e instanceof Ge)};var Nn=function(){this._geom=null;var e=arguments[0];this._geom=e};Nn.prototype.locate=function(e){return Nn.locate(e,this._geom)},Nn.prototype.interfaces_=function(){return[ba]},Nn.prototype.getClass=function(){return Nn},Nn.isPointInRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?q.isPointInRing(e,t.getCoordinates()):!1},Nn.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var n=t.getExteriorRing();if(!Nn.isPointInRing(e,n))return!1;for(var i=0;i<t.getNumInteriorRing();i++){var s=t.getInteriorRingN(i);if(Nn.isPointInRing(e,s))return!1}return!0},Nn.containsPoint=function(e,t){if(t instanceof pe)return Nn.containsPointInPolygon(e,t);if(t instanceof Ge)for(var n=new Jr(t);n.hasNext();){var i=n.next();if(i!==t&&Nn.containsPoint(e,i))return!0}return!1},Nn.locate=function(e,t){return t.isEmpty()?F.EXTERIOR:Nn.containsPoint(e,t)?F.INTERIOR:F.EXTERIOR};var je=function(){this._edgeMap=new ke,this._edgeList=null,this._ptInAreaLocation=[F.NONE,F.NONE]};je.prototype.getNextCW=function(e){this.getEdges();var t=this._edgeList.indexOf(e),n=t-1;return t===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)},je.prototype.propagateSideLabels=function(e){for(var t=F.NONE,n=this.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();s.isArea(e)&&s.getLocation(e,U.LEFT)!==F.NONE&&(t=s.getLocation(e,U.LEFT))}if(t===F.NONE)return null;for(var o=t,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(e,U.ON)===F.NONE&&l.setLocation(e,U.ON,o),l.isArea(e)){var c=l.getLocation(e,U.LEFT),h=l.getLocation(e,U.RIGHT);if(h!==F.NONE){if(h!==o)throw new Si("side location conflict",u.getCoordinate());c===F.NONE&&yt.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),o=c}else yt.isTrue(l.getLocation(e,U.LEFT)===F.NONE,"found single null side"),l.setLocation(e,U.RIGHT,o),l.setLocation(e,U.LEFT,o)}}},je.prototype.getCoordinate=function(){var e=this.iterator();if(!e.hasNext())return null;var t=e.next();return t.getCoordinate()},je.prototype.print=function(e){Te.out.println("EdgeEndStar: "+this.getCoordinate());for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},je.prototype.isAreaLabelsConsistent=function(e){return this.computeEdgeEndLabels(e.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},je.prototype.checkAreaLabelsConsistent=function(e){var t=this.getEdges();if(t.size()<=0)return!0;var n=t.size()-1,i=t.get(n).getLabel(),s=i.getLocation(e,U.LEFT);yt.isTrue(s!==F.NONE,"Found unlabelled area edge");for(var o=s,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();yt.isTrue(l.isArea(e),"Found non-area edge");var c=l.getLocation(e,U.LEFT),h=l.getLocation(e,U.RIGHT);if(c===h||h!==o)return!1;o=c}return!0},je.prototype.findIndex=function(e){var t=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var i=t._edgeList.get(n);if(i===e)return n}return-1},je.prototype.iterator=function(){return this.getEdges().iterator()},je.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new W(this._edgeMap.values())),this._edgeList},je.prototype.getLocation=function(e,t,n){return this._ptInAreaLocation[e]===F.NONE&&(this._ptInAreaLocation[e]=Nn.locate(t,n[e].getGeometry())),this._ptInAreaLocation[e]},je.prototype.toString=function(){var e=new lr;e.append("EdgeEndStar: "+this.getCoordinate()),e.append(`
43
43
  `);for(var t=this.iterator();t.hasNext();){var n=t.next();e.append(n),e.append(`
44
- `)}return e.toString()},je.prototype.computeEdgeEndLabels=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();n.computeLabel(e)}},je.prototype.computeLabelling=function(e){var t=this;this.computeEdgeEndLabels(e[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],i=this.iterator();i.hasNext();)for(var s=i.next(),o=s.getLabel(),a=0;a<2;a++)o.isLine(a)&&o.getLocation(a)===F.BOUNDARY&&(n[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),c=l.getLabel(),h=0;h<2;h++)if(c.isAnyNull(h)){var f=F.NONE;if(n[h])f=F.EXTERIOR;else{var p=l.getCoordinate();f=t.getLocation(h,p,e)}c.setAllLocationsIfNull(h,f)}},je.prototype.getDegree=function(){return this._edgeMap.size()},je.prototype.insertEdgeEnd=function(e,t){this._edgeMap.put(e,t),this._edgeList=null},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var QE=function(r){function e(){r.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var i=null,s=null,o=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=n._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),o){case n._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;s=l,o=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(!u.isInResult())continue;s.setNext(u),o=n._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(i===null)throw new Si("no outgoing dirEdge found",this.getCoordinate());yt.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),s.setNext(i)}},e.prototype.insert=function(n){var i=n;this.insertEdgeEnd(i,i)},e.prototype.getRightmostEdge=function(){var n=this.getEdges(),i=n.size();if(i<1)return null;var s=n.get(0);if(i===1)return s;var o=n.get(i-1),a=s.getQuadrant(),u=o.getQuadrant();return Bt.isNorthern(a)&&Bt.isNorthern(u)?s:!Bt.isNorthern(a)&&!Bt.isNorthern(u)?o:s.getDy()!==0?s:o.getDy()!==0?o:(yt.shouldNeverReachHere("found two horizontal edges incident on node"),null)},e.prototype.print=function(n){Te.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var s=i.next();n.print("out "),s.print(n),n.println(),n.print("in "),s.getSym().print(n),n.println()}},e.prototype.getResultAreaEdges=function(){var n=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new W;for(var i=this.iterator();i.hasNext();){var s=i.next();(s.isInResult()||s.getSym().isInResult())&&n._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(n){for(var i=this.iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.setAllLocationsIfNull(0,n.getLocation(0)),o.setAllLocationsIfNull(1,n.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){var n=this;this.getEdges();for(var i=null,s=null,o=this._edgeList.size()-1;o>=0;o--){var a=n._edgeList.get(o),u=a.getSym();s===null&&(s=u),i!==null&&u.setNext(i),i=a}s.setNext(i)},e.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var i=arguments[0],s=this.findIndex(i),o=i.getDepth(U.LEFT),a=i.getDepth(U.RIGHT),u=this.computeDepths(s+1,this._edgeList.size(),o),l=this.computeDepths(0,s,u);if(l!==a)throw new Si("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],h=arguments[1],f=arguments[2],p=f,v=c;v<h;v++){var C=n._edgeList.get(v);C.setEdgeDepths(U.RIGHT,p),p=C.getDepth(U.LEFT)}return p}},e.prototype.mergeSymLabels=function(){for(var n=this.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();s.merge(i.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(n){for(var i=this,s=null,o=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),c=l.getSym();switch(s===null&&l.getEdgeRing()===n&&(s=l),a){case i._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==n)continue;o=c,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==n)continue;o.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(yt.isTrue(s!==null,"found null for first outgoing dirEdge"),yt.isTrue(s.getEdgeRing()===n,"unable to link last incoming dirEdge"),o.setNextMin(s))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,i=this.iterator();i.hasNext();){var s=i.next();s.isInResult()&&n++}return n}else if(arguments.length===1){for(var o=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===o&&a++}return a}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var n=F.NONE,i=this.iterator();i.hasNext();){var s=i.next(),o=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){n=F.INTERIOR;break}if(o.isInResult()){n=F.EXTERIOR;break}}}if(n===F.NONE)return null;for(var a=n,u=this.iterator();u.hasNext();){var l=u.next(),c=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===F.INTERIOR):(l.isInResult()&&(a=F.EXTERIOR),c.isInResult()&&(a=F.INTERIOR))}},e.prototype.computeLabelling=function(n){var i=this;r.prototype.computeLabelling.call(this,n),this._label=new jt(F.NONE);for(var s=this.iterator();s.hasNext();)for(var o=s.next(),a=o.getEdge(),u=a.getLabel(),l=0;l<2;l++){var c=u.getLocation(l);(c===F.INTERIOR||c===F.BOUNDARY)&&i._label.setLocation(l,F.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(je),Gm=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.createNode=function(n){return new pc(n,new QE)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ea),Qi=function r(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=r.orientation(e)};Qi.prototype.compareTo=function(e){var t=e,n=Qi.compareOriented(this._pts,this._orientation,t._pts,t._orientation);return n},Qi.prototype.interfaces_=function(){return[An]},Qi.prototype.getClass=function(){return Qi},Qi.orientation=function(e){return Ct.increasingDirection(e)===1},Qi.compareOriented=function(e,t,n,i){for(var s=t?1:-1,o=i?1:-1,a=t?e.length:-1,u=i?n.length:-1,l=t?0:e.length-1,c=i?0:n.length-1;;){var h=e[l].compareTo(n[c]);if(h!==0)return h;l+=s,c+=o;var f=l===a,p=c===u;if(f&&!p)return-1;if(!f&&p)return 1;if(f&&p)return 0}};var ir=function(){this._edges=new W,this._ocaMap=new ke};ir.prototype.print=function(e){var t=this;e.print("MULTILINESTRING ( ");for(var n=0;n<this._edges.size();n++){var i=t._edges.get(n);n>0&&e.print(","),e.print("(");for(var s=i.getCoordinates(),o=0;o<s.length;o++)o>0&&e.print(","),e.print(s[o].x+" "+s[o].y);e.println(")")}e.print(") ")},ir.prototype.addAll=function(e){for(var t=this,n=e.iterator();n.hasNext();)t.add(n.next())},ir.prototype.findEdgeIndex=function(e){for(var t=this,n=0;n<this._edges.size();n++)if(t._edges.get(n).equals(e))return n;return-1},ir.prototype.iterator=function(){return this._edges.iterator()},ir.prototype.getEdges=function(){return this._edges},ir.prototype.get=function(e){return this._edges.get(e)},ir.prototype.findEqualEdge=function(e){var t=new Qi(e.getCoordinates()),n=this._ocaMap.get(t);return n},ir.prototype.add=function(e){this._edges.add(e);var t=new Qi(e.getCoordinates());this._ocaMap.put(t,e)},ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir};var Ts=function(){};Ts.prototype.processIntersections=function(e,t,n,i){},Ts.prototype.isDone=function(){},Ts.prototype.interfaces_=function(){return[]},Ts.prototype.getClass=function(){return Ts};var Dn=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var e=arguments[0];this._li=e};Dn.prototype.isTrivialIntersection=function(e,t,n,i){if(e===n&&this._li.getIntersectionNum()===1){if(Dn.isAdjacentSegments(t,i))return!0;if(e.isClosed()){var s=e.size()-1;if(t===0&&i===s||i===0&&t===s)return!0}}return!1},Dn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Dn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Dn.prototype.getLineIntersector=function(){return this._li},Dn.prototype.hasProperIntersection=function(){return this._hasProper},Dn.prototype.processIntersections=function(e,t,n,i){if(e===n&&t===i)return null;this.numTests++;var s=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(e,t,n,i)||(this._hasIntersection=!0,e.addIntersections(this._li,t,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Dn.prototype.hasIntersection=function(){return this._hasIntersection},Dn.prototype.isDone=function(){return!1},Dn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Dn.prototype.interfaces_=function(){return[Ts]},Dn.prototype.getClass=function(){return Dn},Dn.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var Er=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var e=arguments[0],t=arguments[1],n=arguments[2];this.coord=new R(e),this.segmentIndex=t,this.dist=n};Er.prototype.getSegmentIndex=function(){return this.segmentIndex},Er.prototype.getCoordinate=function(){return this.coord},Er.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex),e.println(" dist = "+this.dist)},Er.prototype.compareTo=function(e){var t=e;return this.compare(t.segmentIndex,t.dist)},Er.prototype.isEndPoint=function(e){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===e},Er.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Er.prototype.getDistance=function(){return this.dist},Er.prototype.compare=function(e,t){return this.segmentIndex<e?-1:this.segmentIndex>e?1:this.dist<t?-1:this.dist>t?1:0},Er.prototype.interfaces_=function(){return[An]},Er.prototype.getClass=function(){return Er};var $r=function(){this._nodeMap=new ke,this.edge=null;var e=arguments[0];this.edge=e};$r.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},$r.prototype.iterator=function(){return this._nodeMap.values().iterator()},$r.prototype.addSplitEdges=function(e){var t=this;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next(),o=t.createSplitEdge(i,s);e.add(o),i=s}},$r.prototype.addEndpoints=function(){var e=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[e],e,0)},$r.prototype.createSplitEdge=function(e,t){var n=this,i=t.segmentIndex-e.segmentIndex+2,s=this.edge.pts[t.segmentIndex],o=t.dist>0||!t.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new R(e.coord);for(var l=e.segmentIndex+1;l<=t.segmentIndex;l++)a[u++]=n.edge.pts[l];return o&&(a[u]=t.coord),new mc(a,new jt(this.edge._label))},$r.prototype.add=function(e,t,n){var i=new Er(e,t,n),s=this._nodeMap.get(i);return s!==null?s:(this._nodeMap.put(i,i),i)},$r.prototype.isIntersection=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();if(n.coord.equals(e))return!0}return!1},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r};var Os=function(){};Os.prototype.getChainStartIndices=function(e){var t=this,n=0,i=new W;i.add(new cr(n));do{var s=t.findChainEnd(e,n);i.add(new cr(s)),n=s}while(n<e.length-1);var o=Os.toIntArray(i);return o},Os.prototype.findChainEnd=function(e,t){for(var n=Bt.quadrant(e[t],e[t+1]),i=t+1;i<e.length;){var s=Bt.quadrant(e[i-1],e[i]);if(s!==n)break;i++}return i-1},Os.prototype.interfaces_=function(){return[]},Os.prototype.getClass=function(){return Os},Os.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),n=0;n<t.length;n++)t[n]=e.get(n).intValue();return t};var Ii=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Q,this.env2=new Q;var e=arguments[0];this.e=e,this.pts=e.getCoordinates();var t=new Os;this.startIndex=t.getChainStartIndices(this.pts)};Ii.prototype.getCoordinates=function(){return this.pts},Ii.prototype.getMaxX=function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return t>n?t:n},Ii.prototype.getMinX=function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return t<n?t:n},Ii.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[e],this.startIndex[e+1],t,t.startIndex[n],t.startIndex[n+1],i)}else if(arguments.length===6){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5],h=this.pts[s],f=this.pts[o],p=a.pts[u],v=a.pts[l];if(o-s===1&&l-u===1)return c.addIntersections(this.e,s,a.e,u),null;if(this.env1.init(h,f),this.env2.init(p,v),!this.env1.intersects(this.env2))return null;var C=Math.trunc((s+o)/2),S=Math.trunc((u+l)/2);s<C&&(u<S&&this.computeIntersectsForChain(s,C,a,u,S,c),S<l&&this.computeIntersectsForChain(s,C,a,S,l,c)),C<o&&(u<S&&this.computeIntersectsForChain(C,o,a,u,S,c),S<l&&this.computeIntersectsForChain(C,o,a,S,l,c))}},Ii.prototype.getStartIndexes=function(){return this.startIndex},Ii.prototype.computeIntersects=function(e,t){for(var n=this,i=0;i<this.startIndex.length-1;i++)for(var s=0;s<e.startIndex.length-1;s++)n.computeIntersectsForChain(i,e,s,t)},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var Oe=function r(){var e=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var t=0;t<2;t++)for(var n=0;n<3;n++)e._depth[t][n]=r.NULL_VALUE},Wm={NULL_VALUE:{configurable:!0}};Oe.prototype.getDepth=function(e,t){return this._depth[e][t]},Oe.prototype.setDepth=function(e,t,n){this._depth[e][t]=n},Oe.prototype.isNull=function(){var e=this;if(arguments.length===0){for(var t=0;t<2;t++)for(var n=0;n<3;n++)if(e._depth[t][n]!==Oe.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===Oe.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._depth[s][o]===Oe.NULL_VALUE}},Oe.prototype.normalize=function(){for(var e=this,t=0;t<2;t++)if(!e.isNull(t)){var n=e._depth[t][1];e._depth[t][2]<n&&(n=e._depth[t][2]),n<0&&(n=0);for(var i=1;i<3;i++){var s=0;e._depth[t][i]>n&&(s=1),e._depth[t][i]=s}}},Oe.prototype.getDelta=function(e){return this._depth[e][U.RIGHT]-this._depth[e][U.LEFT]},Oe.prototype.getLocation=function(e,t){return this._depth[e][t]<=0?F.EXTERIOR:F.INTERIOR},Oe.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Oe.prototype.add=function(){var e=this;if(arguments.length===1)for(var t=arguments[0],n=0;n<2;n++)for(var i=1;i<3;i++){var s=t.getLocation(n,i);(s===F.EXTERIOR||s===F.INTERIOR)&&(e.isNull(n,i)?e._depth[n][i]=Oe.depthAtLocation(s):e._depth[n][i]+=Oe.depthAtLocation(s))}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];u===F.INTERIOR&&this._depth[o][a]++}},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Oe.depthAtLocation=function(e){return e===F.EXTERIOR?0:e===F.INTERIOR?1:Oe.NULL_VALUE},Wm.NULL_VALUE.get=function(){return-1},Object.defineProperties(Oe,Wm);var mc=function(r){function e(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new $r(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Oe,this._depthDelta=0,arguments.length===1){var t=arguments[0];e.call(this,t,null)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var i=new e(n,jt.toLineLabel(this._label));return i},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(n){this._isIsolated=n},e.prototype.setName=function(n){this._name=n},e.prototype.equals=function(n){var i=this;if(!(n instanceof e))return!1;var s=n;if(this.pts.length!==s.pts.length)return!1;for(var o=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(s.pts[l])||(o=!1),i.pts[l].equals2D(s.pts[--u])||(a=!1),!o&&!a)return!1;return!0},e.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},e.prototype.print=function(n){var i=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&n.print(","),n.print(i.pts[s].x+" "+i.pts[s].y);n.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(n){e.updateIM(this._label,n)},e.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(n){var i=this;n.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)n.print(i.pts[s]+" ");n.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Ii(this)),this._mce},e.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new Q;for(var i=0;i<this.pts.length;i++)n._env.expandToInclude(n.pts[i])}return this._env},e.prototype.addIntersection=function(n,i,s,o){var a=new R(n.getIntersection(o)),u=i,l=n.getEdgeDistance(s,o),c=u+1;if(c<this.pts.length){var h=this.pts[c];a.equals2D(h)&&(u=c,l=0)}this.eiList.add(a,u,l)},e.prototype.toString=function(){var n=this,i=new lr;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&i.append(","),i.append(n.pts[s].x+" "+n.pts[s].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},e.prototype.isPointwiseEqual=function(n){var i=this;if(this.pts.length!==n.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!i.pts[s].equals2D(n.pts[s]))return!1;return!0},e.prototype.setDepthDelta=function(n){this._depthDelta=n},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(n,i,s){for(var o=this,a=0;a<n.getIntersectionNum();a++)o.addIntersection(n,i,s,a)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];i.setAtLeastIfValid(n.getLocation(0,U.ON),n.getLocation(1,U.ON),1),n.isArea()&&(i.setAtLeastIfValid(n.getLocation(0,U.LEFT),n.getLocation(1,U.LEFT),2),i.setAtLeastIfValid(n.getLocation(0,U.RIGHT),n.getLocation(1,U.RIGHT),2))}else return r.prototype.updateIM.apply(this,arguments)},e}(Tn),qe=function(e){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new ir,this._bufParams=e||null};qe.prototype.setWorkingPrecisionModel=function(e){this._workingPrecisionModel=e},qe.prototype.insertUniqueEdge=function(e){var t=this._edgeList.findEqualEdge(e);if(t!==null){var n=t.getLabel(),i=e.getLabel();t.isPointwiseEqual(e)||(i=new jt(e.getLabel()),i.flip()),n.merge(i);var s=qe.depthDelta(i),o=t.getDepthDelta(),a=o+s;t.setDepthDelta(a)}else this._edgeList.add(e),e.setDepthDelta(qe.depthDelta(e.getLabel()))},qe.prototype.buildSubgraphs=function(e,t){for(var n=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=s.getRightmostCoordinate(),a=new mo(n),u=a.getDepth(o);s.computeDepth(u),s.findResultEdges(),n.add(s),t.add(s.getDirectedEdges(),s.getNodes())}},qe.prototype.createSubgraphs=function(e){for(var t=new W,n=e.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var s=new We;s.create(i),t.add(s)}}return rr.sort(t,rr.reverseOrder()),t},qe.prototype.createEmptyResultGeometry=function(){var e=this._geomFact.createPolygon();return e},qe.prototype.getNoder=function(e){if(this._workingNoder!==null)return this._workingNoder;var t=new md,n=new Cs;return n.setPrecisionModel(e),t.setSegmentIntersector(new Dn(n)),t},qe.prototype.buffer=function(e,t){var n=this._workingPrecisionModel;n===null&&(n=e.getPrecisionModel()),this._geomFact=e.getFactory();var i=new rn(n,this._bufParams),s=new Un(e,t,i),o=s.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,n),this._graph=new Kt(new Gm),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new fn(this._geomFact);this.buildSubgraphs(a,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var c=this._geomFact.buildGeometry(l);return c},qe.prototype.computeNodedEdges=function(e,t){var n=this,i=this.getNoder(t);i.computeNodes(e);for(var s=i.getNodedSubstrings(),o=s.iterator();o.hasNext();){var a=o.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),c=new mc(a.getCoordinates(),new jt(l));n.insertUniqueEdge(c)}}},qe.prototype.setNoder=function(e){this._workingNoder=e},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.depthDelta=function(e){var t=e.getLocation(0,U.LEFT),n=e.getLocation(0,U.RIGHT);return t===F.INTERIOR&&n===F.EXTERIOR?1:t===F.EXTERIOR&&n===F.INTERIOR?-1:0},qe.convertSegStrings=function(e){for(var t=new St,n=new W;e.hasNext();){var i=e.next(),s=t.createLineString(i.getCoordinates());n.add(s)}return t.buildGeometry(n)};var ts=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var e=arguments[0],t=arguments[1];this._noder=e,this._scaleFactor=t,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=i,this._offsetX=s,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};ts.prototype.rescale=function(){var e=this;if(at(arguments[0],fe))for(var t=arguments[0],n=t.iterator();n.hasNext();){var i=n.next();e.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var s=arguments[0],o=0;o<s.length;o++)s[o].x=s[o].x/e._scaleFactor+e._offsetX,s[o].y=s[o].y/e._scaleFactor+e._offsetY;s.length===2&&s[0].equals2D(s[1])&&Te.out.println(s)}},ts.prototype.scale=function(){var e=this;if(at(arguments[0],fe)){for(var t=arguments[0],n=new W,i=t.iterator();i.hasNext();){var s=i.next();n.add(new oe(e.scale(s.getCoordinates()),s.getData()))}return n}else if(arguments[0]instanceof Array){for(var o=arguments[0],a=new Array(o.length).fill(null),u=0;u<o.length;u++)a[u]=new R(Math.round((o[u].x-e._offsetX)*e._scaleFactor),Math.round((o[u].y-e._offsetY)*e._scaleFactor),o[u].z);var l=Ct.removeRepeatedPoints(a);return l}},ts.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},ts.prototype.getNodedSubstrings=function(){var e=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(e),e},ts.prototype.computeNodes=function(e){var t=e;this._isScaled&&(t=this.scale(e)),this._noder.computeNodes(t)},ts.prototype.interfaces_=function(){return[Is]},ts.prototype.getClass=function(){return ts};var Cr=function(){this._li=new Cs,this._segStrings=null;var e=arguments[0];this._segStrings=e},Hm={fact:{configurable:!0}};Cr.prototype.checkEndPtVertexIntersections=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var n=t.next(),i=n.getCoordinates();e.checkEndPtVertexIntersections(i[0],e._segStrings),e.checkEndPtVertexIntersections(i[i.length-1],e._segStrings)}else if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=o.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),c=1;c<l.length-1;c++)if(l[c].equals(s))throw new vi("found endpt/interior pt intersection at index "+c+" :pt "+s)}},Cr.prototype.checkInteriorIntersections=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();)for(var n=t.next(),i=this._segStrings.iterator();i.hasNext();){var s=i.next();e.checkInteriorIntersections(n,s)}else if(arguments.length===2)for(var o=arguments[0],a=arguments[1],u=o.getCoordinates(),l=a.getCoordinates(),c=0;c<u.length-1;c++)for(var h=0;h<l.length-1;h++)e.checkInteriorIntersections(o,c,a,h);else if(arguments.length===4){var f=arguments[0],p=arguments[1],v=arguments[2],C=arguments[3];if(f===v&&p===C)return null;var S=f.getCoordinates()[p],P=f.getCoordinates()[p+1],y=v.getCoordinates()[C],_=v.getCoordinates()[C+1];if(this._li.computeIntersection(S,P,y,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,S,P)||this.hasInteriorIntersection(this._li,y,_)))throw new vi("found non-noded intersection at "+S+"-"+P+" and "+y+"-"+_)}},Cr.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Cr.prototype.checkCollapses=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var n=t.next();e.checkCollapses(n)}else if(arguments.length===1)for(var i=arguments[0],s=i.getCoordinates(),o=0;o<s.length-2;o++)e.checkCollapse(s[o],s[o+1],s[o+2])},Cr.prototype.hasInteriorIntersection=function(e,t,n){for(var i=0;i<e.getIntersectionNum();i++){var s=e.getIntersection(i);if(!(s.equals(t)||s.equals(n)))return!0}return!1},Cr.prototype.checkCollapse=function(e,t,n){if(e.equals(n))throw new vi("found non-noded collapse at "+Cr.fact.createLineString([e,t,n]))},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Hm.fact.get=function(){return new St},Object.defineProperties(Cr,Hm);var sn=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var e=arguments[0],t=arguments[1],n=arguments[2];if(this._originalPt=e,this._pt=e,this._scaleFactor=t,this._li=n,t<=0)throw new Yt("Scale factor must be non-zero");t!==1&&(this._pt=new R(this.scale(e.x),this.scale(e.y)),this._p0Scaled=new R,this._p1Scaled=new R),this.initCorners(this._pt)},qm={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};sn.prototype.intersectsScaled=function(e,t){var n=Math.min(e.x,t.x),i=Math.max(e.x,t.x),s=Math.min(e.y,t.y),o=Math.max(e.y,t.y),a=this._maxx<n||this._minx>i||this._maxy<s||this._miny>o;if(a)return!1;var u=this.intersectsToleranceSquare(e,t);return yt.isTrue(!(a&&u),"Found bad envelope test"),u},sn.prototype.initCorners=function(e){var t=.5;this._minx=e.x-t,this._maxx=e.x+t,this._miny=e.y-t,this._maxy=e.y+t,this._corner[0]=new R(this._maxx,this._maxy),this._corner[1]=new R(this._minx,this._maxy),this._corner[2]=new R(this._minx,this._miny),this._corner[3]=new R(this._maxx,this._miny)},sn.prototype.intersects=function(e,t){return this._scaleFactor===1?this.intersectsScaled(e,t):(this.copyScaled(e,this._p0Scaled),this.copyScaled(t,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},sn.prototype.scale=function(e){return Math.round(e*this._scaleFactor)},sn.prototype.getCoordinate=function(){return this._originalPt},sn.prototype.copyScaled=function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)},sn.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var e=sn.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Q(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv},sn.prototype.intersectsPixelClosure=function(e,t){return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.hasIntersection()))},sn.prototype.intersectsToleranceSquare=function(e,t){var n=!1,i=!1;return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.isProper())||n&&i||e.equals(this._pt)||t.equals(this._pt))},sn.prototype.addSnappedNode=function(e,t){var n=e.getCoordinate(t),i=e.getCoordinate(t+1);return this.intersects(n,i)?(e.addIntersection(this.getCoordinate(),t),!0):!1},sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn},qm.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(sn,qm);var il=function(){this.tempEnv1=new Q,this.selectedSegment=new tt};il.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}},il.prototype.interfaces_=function(){return[]},il.prototype.getClass=function(){return il};var Pa=function(){this._index=null;var e=arguments[0];this._index=e},Xm={HotPixelSnapAction:{configurable:!0}};Pa.prototype.snap=function(){if(arguments.length===1){var e=arguments[0];return this.snap(e,null,-1)}else if(arguments.length===3){var t=arguments[0],n=arguments[1],i=arguments[2],s=t.getSafeEnvelope(),o=new Ym(t,n,i);return this._index.query(s,{interfaces_:function(){return[Ki]},visitItem:function(a){var u=a;u.select(s,o)}}),o.isNodeAdded()}},Pa.prototype.interfaces_=function(){return[]},Pa.prototype.getClass=function(){return Pa},Xm.HotPixelSnapAction.get=function(){return Ym},Object.defineProperties(Pa,Xm);var Ym=function(r){function e(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],n=arguments[1],i=arguments[2];this._hotPixel=t,this._parentEdge=n,this._hotPixelVertexIndex=i}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1],s=n.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,i)}else return r.prototype.select.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(il),vo=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new W};vo.prototype.processIntersections=function(e,t,n,i){var s=this;if(e===n&&t===i)return null;var o=e.getCoordinates()[t],a=e.getCoordinates()[t+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];if(this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var c=0;c<this._li.getIntersectionNum();c++)s._interiorIntersections.add(s._li.getIntersection(c));e.addIntersections(this._li,t,0),n.addIntersections(this._li,i,1)}},vo.prototype.isDone=function(){return!1},vo.prototype.getInteriorIntersections=function(){return this._interiorIntersections},vo.prototype.interfaces_=function(){return[Ts]},vo.prototype.getClass=function(){return vo};var Kr=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var e=arguments[0];this._pm=e,this._li=new Cs,this._li.setPrecisionModel(e),this._scaleFactor=e.getScale()};Kr.prototype.checkCorrectness=function(e){var t=oe.getNodedSubstrings(e),n=new Cr(t);try{n.checkValid()}catch(i){if(i instanceof xm)i.printStackTrace();else throw i}finally{}},Kr.prototype.getNodedSubstrings=function(){return oe.getNodedSubstrings(this._nodedSegStrings)},Kr.prototype.snapRound=function(e,t){var n=this.findInteriorIntersections(e,t);this.computeIntersectionSnaps(n),this.computeVertexSnaps(e)},Kr.prototype.findInteriorIntersections=function(e,t){var n=new vo(t);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(e),n.getInteriorIntersections()},Kr.prototype.computeVertexSnaps=function(){var e=this;if(at(arguments[0],fe))for(var t=arguments[0],n=t.iterator();n.hasNext();){var i=n.next();e.computeVertexSnaps(i)}else if(arguments[0]instanceof oe)for(var s=arguments[0],o=s.getCoordinates(),a=0;a<o.length;a++){var u=new sn(o[a],e._scaleFactor,e._li),l=e._pointSnapper.snap(u,s,a);l&&s.addIntersection(o[a],a)}},Kr.prototype.computeNodes=function(e){this._nodedSegStrings=e,this._noder=new md,this._pointSnapper=new Pa(this._noder.getIndex()),this.snapRound(e,this._li)},Kr.prototype.computeIntersectionSnaps=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next(),s=new sn(i,t._scaleFactor,t._li);t._pointSnapper.snap(s)}},Kr.prototype.interfaces_=function(){return[Is]},Kr.prototype.getClass=function(){return Kr};var Ne=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Ft,this._resultGeometry=null,this._saveException=null,arguments.length===1){var e=arguments[0];this._argGeom=e}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this._argGeom=t,this._bufParams=n}},Ia={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Ne.prototype.bufferFixedPrecision=function(e){var t=new ts(new Kr(new Lt(1)),e.getScale()),n=new qe(this._bufParams);n.setWorkingPrecisionModel(e),n.setNoder(t),this._resultGeometry=n.buffer(this._argGeom,this._distance)},Ne.prototype.bufferReducedPrecision=function(){var e=this;if(arguments.length===0){for(var t=Ne.MAX_PRECISION_DIGITS;t>=0;t--){try{e.bufferReducedPrecision(t)}catch(o){if(o instanceof Si)e._saveException=o;else throw o}finally{}if(e._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],i=Ne.precisionScaleFactor(this._argGeom,this._distance,n),s=new Lt(i);this.bufferFixedPrecision(s)}},Ne.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===Lt.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()},Ne.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)},Ne.prototype.bufferOriginalPrecision=function(){try{var e=new qe(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(t){if(t instanceof vi)this._saveException=t;else throw t}finally{}},Ne.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry},Ne.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ne.bufferOp=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new Ne(e),i=n.getResultGeometry(t);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ot&&typeof arguments[1]=="number"){var s=arguments[0],o=arguments[1],a=arguments[2],u=new Ne(s);u.setQuadrantSegments(a);var l=u.getResultGeometry(o);return l}else if(arguments[2]instanceof Ft&&arguments[0]instanceof ot&&typeof arguments[1]=="number"){var c=arguments[0],h=arguments[1],f=arguments[2],p=new Ne(c,f),v=p.getResultGeometry(h);return v}}else if(arguments.length===4){var C=arguments[0],S=arguments[1],P=arguments[2],y=arguments[3],_=new Ne(C);_.setQuadrantSegments(P),_.setEndCapStyle(y);var m=_.getResultGeometry(S);return m}},Ne.precisionScaleFactor=function(e,t,n){var i=e.getEnvelopeInternal(),s=xn.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=t>0?t:0,a=s+2*o,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=n-u,c=Math.pow(10,l);return c},Ia.CAP_ROUND.get=function(){return Ft.CAP_ROUND},Ia.CAP_BUTT.get=function(){return Ft.CAP_FLAT},Ia.CAP_FLAT.get=function(){return Ft.CAP_FLAT},Ia.CAP_SQUARE.get=function(){return Ft.CAP_SQUARE},Ia.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Ne,Ia);var Xe=function(){this._pt=[new R,new R],this._distance=ht.NaN,this._isNull=!0};Xe.prototype.getCoordinates=function(){return this._pt},Xe.prototype.getCoordinate=function(e){return this._pt[e]},Xe.prototype.setMinimum=function(){if(arguments.length===1){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var i=t.distance(n);i<this._distance&&this.initialize(t,n,i)}},Xe.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var e=arguments[0],t=arguments[1];this._pt[0].setCoordinate(e),this._pt[1].setCoordinate(t),this._distance=e.distance(t),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},Xe.prototype.getDistance=function(){return this._distance},Xe.prototype.setMaximum=function(){if(arguments.length===1){var e=arguments[0];this.setMaximum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var i=t.distance(n);i>this._distance&&this.initialize(t,n,i)}},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var Zr=function(){};Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.computeDistance=function(){if(arguments[2]instanceof Xe&&arguments[0]instanceof te&&arguments[1]instanceof R)for(var e=arguments[0],t=arguments[1],n=arguments[2],i=e.getCoordinates(),s=new tt,o=0;o<i.length-1;o++){s.setCoordinates(i[o],i[o+1]);var a=s.closestPoint(t);n.setMinimum(a,t)}else if(arguments[2]instanceof Xe&&arguments[0]instanceof pe&&arguments[1]instanceof R){var u=arguments[0],l=arguments[1],c=arguments[2];Zr.computeDistance(u.getExteriorRing(),l,c);for(var h=0;h<u.getNumInteriorRing();h++)Zr.computeDistance(u.getInteriorRingN(h),l,c)}else if(arguments[2]instanceof Xe&&arguments[0]instanceof ot&&arguments[1]instanceof R){var f=arguments[0],p=arguments[1],v=arguments[2];if(f instanceof te)Zr.computeDistance(f,p,v);else if(f instanceof pe)Zr.computeDistance(f,p,v);else if(f instanceof Ge)for(var C=f,S=0;S<C.getNumGeometries();S++){var P=C.getGeometryN(S);Zr.computeDistance(P,p,v)}else v.setMinimum(f.getCoordinate(),p)}else if(arguments[2]instanceof Xe&&arguments[0]instanceof tt&&arguments[1]instanceof R){var y=arguments[0],_=arguments[1],m=arguments[2],w=y.closestPoint(_);m.setMinimum(w,_)}};var Ns=function(e){this._maxPtDist=new Xe,this._inputGeom=e||null},vd={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Ns.prototype.computeMaxMidpointDistance=function(e){var t=new es(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())},Ns.prototype.computeMaxVertexDistance=function(e){var t=new yo(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())},Ns.prototype.findDistance=function(e){return this.computeMaxVertexDistance(e),this.computeMaxMidpointDistance(e),this._maxPtDist.getDistance()},Ns.prototype.getDistancePoints=function(){return this._maxPtDist},Ns.prototype.interfaces_=function(){return[]},Ns.prototype.getClass=function(){return Ns},vd.MaxPointDistanceFilter.get=function(){return yo},vd.MaxMidpointDistanceFilter.get=function(){return es},Object.defineProperties(Ns,vd);var yo=function(e){this._maxPtDist=new Xe,this._minPtDist=new Xe,this._geom=e||null};yo.prototype.filter=function(e){this._minPtDist.initialize(),Zr.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},yo.prototype.getMaxPointDistance=function(){return this._maxPtDist},yo.prototype.interfaces_=function(){return[Wr]},yo.prototype.getClass=function(){return yo};var es=function(e){this._maxPtDist=new Xe,this._minPtDist=new Xe,this._geom=e||null};es.prototype.filter=function(e,t){if(t===0)return null;var n=e.getCoordinate(t-1),i=e.getCoordinate(t),s=new R((n.x+i.x)/2,(n.y+i.y)/2);this._minPtDist.initialize(),Zr.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},es.prototype.isDone=function(){return!1},es.prototype.isGeometryChanged=function(){return!1},es.prototype.getMaxPointDistance=function(){return this._maxPtDist},es.prototype.interfaces_=function(){return[er]},es.prototype.getClass=function(){return es};var xi=function(e){this._comps=e||null};xi.prototype.filter=function(e){e instanceof pe&&this._comps.add(e)},xi.prototype.interfaces_=function(){return[pr]},xi.prototype.getClass=function(){return xi},xi.getPolygons=function(){if(arguments.length===1){var e=arguments[0];return xi.getPolygons(e,new W)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return t instanceof pe?n.add(t):t instanceof Ge&&t.apply(new xi(n)),n}};var De=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var e=arguments[0];this._lines=e}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this._lines=t,this._isForcedToLineString=n}};De.prototype.filter=function(e){if(this._isForcedToLineString&&e instanceof Hr){var t=e.getFactory().createLineString(e.getCoordinateSequence());return this._lines.add(t),null}e instanceof te&&this._lines.add(e)},De.prototype.setForceToLineString=function(e){this._isForcedToLineString=e},De.prototype.interfaces_=function(){return[yi]},De.prototype.getClass=function(){return De},De.getGeometry=function(){if(arguments.length===1){var e=arguments[0];return e.getFactory().buildGeometry(De.getLines(e))}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return t.getFactory().buildGeometry(De.getLines(t,n))}},De.getLines=function(){if(arguments.length===1){var e=arguments[0];return De.getLines(e,!1)}else if(arguments.length===2){if(at(arguments[0],fe)&&at(arguments[1],fe)){for(var t=arguments[0],n=arguments[1],i=t.iterator();i.hasNext();){var s=i.next();De.getLines(s,n)}return n}else if(arguments[0]instanceof ot&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1],u=new W;return o.apply(new De(u,a)),u}else if(arguments[0]instanceof ot&&at(arguments[1],fe)){var l=arguments[0],c=arguments[1];return l instanceof te?c.add(l):l.apply(new De(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&at(arguments[0],fe)&&at(arguments[1],fe)){for(var h=arguments[0],f=arguments[1],p=arguments[2],v=h.iterator();v.hasNext();){var C=v.next();De.getLines(C,f,p)}return f}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof ot&&at(arguments[1],fe)){var S=arguments[0],P=arguments[1],y=arguments[2];return S.apply(new De(P,y)),P}}};var sr=function(){if(this._boundaryRule=Vn.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e===null)throw new Yt("Rule must be non-null");this._boundaryRule=e}}};sr.prototype.locateInternal=function(){var e=this;if(arguments[0]instanceof R&&arguments[1]instanceof pe){var t=arguments[0],n=arguments[1];if(n.isEmpty())return F.EXTERIOR;var i=n.getExteriorRing(),s=this.locateInPolygonRing(t,i);if(s===F.EXTERIOR)return F.EXTERIOR;if(s===F.BOUNDARY)return F.BOUNDARY;for(var o=0;o<n.getNumInteriorRing();o++){var a=n.getInteriorRingN(o),u=e.locateInPolygonRing(t,a);if(u===F.INTERIOR)return F.EXTERIOR;if(u===F.BOUNDARY)return F.BOUNDARY}return F.INTERIOR}else if(arguments[0]instanceof R&&arguments[1]instanceof te){var l=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(l))return F.EXTERIOR;var h=c.getCoordinates();return!c.isClosed()&&(l.equals(h[0])||l.equals(h[h.length-1]))?F.BOUNDARY:q.isOnLine(l,h)?F.INTERIOR:F.EXTERIOR}else if(arguments[0]instanceof R&&arguments[1]instanceof dn){var f=arguments[0],p=arguments[1],v=p.getCoordinate();return v.equals2D(f)?F.INTERIOR:F.EXTERIOR}},sr.prototype.locateInPolygonRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?q.locatePointInRing(e,t.getCoordinates()):F.EXTERIOR},sr.prototype.intersects=function(e,t){return this.locate(e,t)!==F.EXTERIOR},sr.prototype.updateLocationInfo=function(e){e===F.INTERIOR&&(this._isIn=!0),e===F.BOUNDARY&&this._numBoundaries++},sr.prototype.computeLocation=function(e,t){var n=this;if(t instanceof dn&&this.updateLocationInfo(this.locateInternal(e,t)),t instanceof te)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof pe)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof Ps)for(var i=t,s=0;s<i.getNumGeometries();s++){var o=i.getGeometryN(s);n.updateLocationInfo(n.locateInternal(e,o))}else if(t instanceof qr)for(var a=t,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);n.updateLocationInfo(n.locateInternal(e,l))}else if(t instanceof Ge)for(var c=new Jr(t);c.hasNext();){var h=c.next();h!==t&&n.computeLocation(e,h)}},sr.prototype.locate=function(e,t){return t.isEmpty()?F.EXTERIOR:t instanceof te?this.locateInternal(e,t):t instanceof pe?this.locateInternal(e,t):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(e,t),this._boundaryRule.isInBoundary(this._numBoundaries)?F.BOUNDARY:this._numBoundaries>0||this._isIn?F.INTERIOR:F.EXTERIOR)},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr};var Ye=function r(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],t=arguments[1];r.call(this,e,r.INSIDE_AREA,t)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._component=n,this._segIndex=i,this._pt=s}},Jm={INSIDE_AREA:{configurable:!0}};Ye.prototype.isInsideArea=function(){return this._segIndex===Ye.INSIDE_AREA},Ye.prototype.getCoordinate=function(){return this._pt},Ye.prototype.getGeometryComponent=function(){return this._component},Ye.prototype.getSegmentIndex=function(){return this._segIndex},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Jm.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Ye,Jm);var ns=function(e){this._pts=e||null};ns.prototype.filter=function(e){e instanceof dn&&this._pts.add(e)},ns.prototype.interfaces_=function(){return[pr]},ns.prototype.getClass=function(){return ns},ns.getPoints=function(){if(arguments.length===1){var e=arguments[0];return e instanceof dn?rr.singletonList(e):ns.getPoints(e,new W)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return t instanceof dn?n.add(t):t instanceof Ge&&t.apply(new ns(n)),n}};var _o=function(){this._locations=null;var e=arguments[0];this._locations=e};_o.prototype.filter=function(e){(e instanceof dn||e instanceof te||e instanceof pe)&&this._locations.add(new Ye(e,0,e.getCoordinate()))},_o.prototype.interfaces_=function(){return[pr]},_o.prototype.getClass=function(){return _o},_o.getLocations=function(e){var t=new W;return e.apply(new _o(t)),t};var Me=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new sr,this._minDistanceLocation=null,this._minDistance=ht.MAX_VALUE,arguments.length===2){var e=arguments[0],t=arguments[1];this._geom=[e,t],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=s}};Me.prototype.computeContainmentDistance=function(){var e=this;if(arguments.length===0){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=1-n,o=xi.getPolygons(this._geom[n]);if(o.size()>0){var a=_o.getLocations(this._geom[s]);if(this.computeContainmentDistance(a,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=i[0],this._minDistanceLocation[n]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&at(arguments[0],Qn)&&at(arguments[1],Qn)){for(var u=arguments[0],l=arguments[1],c=arguments[2],h=0;h<u.size();h++)for(var f=u.get(h),p=0;p<l.size();p++)if(e.computeContainmentDistance(f,l.get(p),c),e._minDistance<=e._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Ye&&arguments[1]instanceof pe){var v=arguments[0],C=arguments[1],S=arguments[2],P=v.getCoordinate();if(F.EXTERIOR!==this._ptLocator.locate(P,C))return this._minDistance=0,S[0]=v,S[1]=new Ye(C,P),null}}},Me.prototype.computeMinDistanceLinesPoints=function(e,t,n){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var u=t.get(a);if(i.computeMinDistance(o,u,n),i._minDistance<=i._terminateDistance)return null}},Me.prototype.computeFacetDistance=function(){var e=new Array(2).fill(null),t=De.getLines(this._geom[0]),n=De.getLines(this._geom[1]),i=ns.getPoints(this._geom[0]),s=ns.getPoints(this._geom[1]);if(this.computeMinDistanceLines(t,n,e),this.updateMinDistance(e,!1),this._minDistance<=this._terminateDistance||(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(t,s,e),this.updateMinDistance(e,!1),this._minDistance<=this._terminateDistance)||(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(n,i,e),this.updateMinDistance(e,!0),this._minDistance<=this._terminateDistance))return null;e[0]=null,e[1]=null,this.computeMinDistancePoints(i,s,e),this.updateMinDistance(e,!1)},Me.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Me.prototype.updateMinDistance=function(e,t){if(e[0]===null)return null;t?(this._minDistanceLocation[0]=e[1],this._minDistanceLocation[1]=e[0]):(this._minDistanceLocation[0]=e[0],this._minDistanceLocation[1]=e[1])},Me.prototype.nearestPoints=function(){this.computeMinDistance();var e=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return e},Me.prototype.computeMinDistance=function(){var e=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof te&&arguments[1]instanceof dn){var t=arguments[0],n=arguments[1],i=arguments[2];if(t.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var s=t.getCoordinates(),o=n.getCoordinate(),a=0;a<s.length-1;a++){var u=q.distancePointLine(o,s[a],s[a+1]);if(u<e._minDistance){e._minDistance=u;var l=new tt(s[a],s[a+1]),c=l.closestPoint(o);i[0]=new Ye(t,a,c),i[1]=new Ye(n,0,o)}if(e._minDistance<=e._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof te&&arguments[1]instanceof te){var h=arguments[0],f=arguments[1],p=arguments[2];if(h.getEnvelopeInternal().distance(f.getEnvelopeInternal())>this._minDistance)return null;for(var v=h.getCoordinates(),C=f.getCoordinates(),S=0;S<v.length-1;S++)for(var P=0;P<C.length-1;P++){var y=q.distanceLineLine(v[S],v[S+1],C[P],C[P+1]);if(y<e._minDistance){e._minDistance=y;var _=new tt(v[S],v[S+1]),m=new tt(C[P],C[P+1]),w=_.closestPoints(m);p[0]=new Ye(h,S,w[0]),p[1]=new Ye(f,P,w[1])}if(e._minDistance<=e._terminateDistance)return null}}}},Me.prototype.computeMinDistancePoints=function(e,t,n){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var u=t.get(a),l=o.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,n[0]=new Ye(o,0,o.getCoordinate()),n[1]=new Ye(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},Me.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new Yt("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Me.prototype.computeMinDistanceLines=function(e,t,n){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var u=t.get(a);if(i.computeMinDistance(o,u,n),i._minDistance<=i._terminateDistance)return null}},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.distance=function(e,t){var n=new Me(e,t);return n.distance()},Me.isWithinDistance=function(e,t,n){var i=new Me(e,t,n);return i.distance()<=n},Me.nearestPoints=function(e,t){var n=new Me(e,t);return n.nearestPoints()};var Be=function(){this._pt=[new R,new R],this._distance=ht.NaN,this._isNull=!0};Be.prototype.getCoordinates=function(){return this._pt},Be.prototype.getCoordinate=function(e){return this._pt[e]},Be.prototype.setMinimum=function(){if(arguments.length===1){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var i=t.distance(n);i<this._distance&&this.initialize(t,n,i)}},Be.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var e=arguments[0],t=arguments[1];this._pt[0].setCoordinate(e),this._pt[1].setCoordinate(t),this._distance=e.distance(t),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},Be.prototype.toString=function(){return Zn.toLineString(this._pt[0],this._pt[1])},Be.prototype.getDistance=function(){return this._distance},Be.prototype.setMaximum=function(){if(arguments.length===1){var e=arguments[0];this.setMaximum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var i=t.distance(n);i>this._distance&&this.initialize(t,n,i)}},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be};var Sr=function(){};Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr},Sr.computeDistance=function(){if(arguments[2]instanceof Be&&arguments[0]instanceof te&&arguments[1]instanceof R)for(var e=arguments[0],t=arguments[1],n=arguments[2],i=new tt,s=e.getCoordinates(),o=0;o<s.length-1;o++){i.setCoordinates(s[o],s[o+1]);var a=i.closestPoint(t);n.setMinimum(a,t)}else if(arguments[2]instanceof Be&&arguments[0]instanceof pe&&arguments[1]instanceof R){var u=arguments[0],l=arguments[1],c=arguments[2];Sr.computeDistance(u.getExteriorRing(),l,c);for(var h=0;h<u.getNumInteriorRing();h++)Sr.computeDistance(u.getInteriorRingN(h),l,c)}else if(arguments[2]instanceof Be&&arguments[0]instanceof ot&&arguments[1]instanceof R){var f=arguments[0],p=arguments[1],v=arguments[2];if(f instanceof te)Sr.computeDistance(f,p,v);else if(f instanceof pe)Sr.computeDistance(f,p,v);else if(f instanceof Ge)for(var C=f,S=0;S<C.getNumGeometries();S++){var P=C.getGeometryN(S);Sr.computeDistance(P,p,v)}else v.setMinimum(f.getCoordinate(),p)}else if(arguments[2]instanceof Be&&arguments[0]instanceof tt&&arguments[1]instanceof R){var y=arguments[0],_=arguments[1],m=arguments[2],w=y.closestPoint(_);m.setMinimum(w,_)}};var Gn=function(){this._g0=null,this._g1=null,this._ptDist=new Be,this._densifyFrac=0;var e=arguments[0],t=arguments[1];this._g0=e,this._g1=t},yd={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Gn.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Gn.prototype.setDensifyFraction=function(e){if(e>1||e<=0)throw new Yt("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e},Gn.prototype.compute=function(e,t){this.computeOrientedDistance(e,t,this._ptDist),this.computeOrientedDistance(t,e,this._ptDist)},Gn.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Gn.prototype.computeOrientedDistance=function(e,t,n){var i=new wo(t);if(e.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var s=new rs(t,this._densifyFrac);e.apply(s),n.setMaximum(s.getMaxPointDistance())}},Gn.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn},Gn.distance=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new Gn(e,t);return n.distance()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new Gn(i,s);return a.setDensifyFraction(o),a.distance()}},yd.MaxPointDistanceFilter.get=function(){return wo},yd.MaxDensifiedByFractionDistanceFilter.get=function(){return rs},Object.defineProperties(Gn,yd);var wo=function(){this._maxPtDist=new Be,this._minPtDist=new Be,this._euclideanDist=new Sr,this._geom=null;var e=arguments[0];this._geom=e};wo.prototype.filter=function(e){this._minPtDist.initialize(),Sr.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},wo.prototype.getMaxPointDistance=function(){return this._maxPtDist},wo.prototype.interfaces_=function(){return[Wr]},wo.prototype.getClass=function(){return wo};var rs=function(){this._maxPtDist=new Be,this._minPtDist=new Be,this._geom=null,this._numSubSegs=0;var e=arguments[0],t=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/t))};rs.prototype.filter=function(e,t){var n=this;if(t===0)return null;for(var i=e.getCoordinate(t-1),s=e.getCoordinate(t),o=(s.x-i.x)/this._numSubSegs,a=(s.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*o,c=i.y+u*a,h=new R(l,c);n._minPtDist.initialize(),Sr.computeDistance(n._geom,h,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}},rs.prototype.isDone=function(){return!1},rs.prototype.isGeometryChanged=function(){return!1},rs.prototype.getMaxPointDistance=function(){return this._maxPtDist},rs.prototype.interfaces_=function(){return[er]},rs.prototype.getClass=function(){return rs};var gn=function(e,t,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=e||null,this._bufDistance=t||null,this._result=n||null},_d={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};gn.prototype.checkMaximumDistance=function(e,t,n){var i=new Gn(t,e);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var s=i.getCoordinates();this._errorLocation=s[1],this._errorIndicator=e.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Zn.toLineString(s[0],s[1])+")"}},gn.prototype.isValid=function(){var e=Math.abs(this._bufDistance),t=gn.MAX_DISTANCE_DIFF_FRAC*e;return this._minValidDistance=e-t,this._maxValidDistance=e+t,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),gn.VERBOSE&&Te.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},gn.prototype.checkNegativeValid=function(){if(!(this._input instanceof pe||this._input instanceof qr||this._input instanceof Ge))return null;var e=this.getPolygonLines(this._input);if(this.checkMinimumDistance(e,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(e,this._result,this._maxValidDistance)},gn.prototype.getErrorIndicator=function(){return this._errorIndicator},gn.prototype.checkMinimumDistance=function(e,t,n){var i=new Me(e,t,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound<n){this._isValid=!1;var s=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=e.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Zn.toLineString(s[0],s[1])+" )"}},gn.prototype.checkPositiveValid=function(){var e=this._result.getBoundary();if(this.checkMinimumDistance(this._input,e,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,e,this._maxValidDistance)},gn.prototype.getErrorLocation=function(){return this._errorLocation},gn.prototype.getPolygonLines=function(e){for(var t=new W,n=new De(t),i=xi.getPolygons(e),s=i.iterator();s.hasNext();){var o=s.next();o.apply(n)}return e.getFactory().buildGeometry(t)},gn.prototype.getErrorMessage=function(){return this._errMsg},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn},_d.VERBOSE.get=function(){return!1},_d.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(gn,_d);var Re=function(e,t,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=e||null,this._distance=t||null,this._result=n||null},wd={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Re.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Re.prototype.checkEnvelope=function(){if(this._distance<0)return null;var e=this._distance*Re.MAX_ENV_DIFF_FRAC;e===0&&(e=.001);var t=new Q(this._input.getEnvelopeInternal());t.expandBy(this._distance);var n=new Q(this._result.getEnvelopeInternal());n.expandBy(e),n.contains(t)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Re.prototype.checkDistance=function(){var e=new gn(this._input,this._distance,this._result);e.isValid()||(this._isValid=!1,this._errorMsg=e.getErrorMessage(),this._errorLocation=e.getErrorLocation(),this._errorIndicator=e.getErrorIndicator()),this.report("Distance")},Re.prototype.checkArea=function(){var e=this._input.getArea(),t=this._result.getArea();this._distance>0&&e>t&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&e<t&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Re.prototype.checkPolygonal=function(){this._result instanceof pe||this._result instanceof qr||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Re.prototype.getErrorIndicator=function(){return this._errorIndicator},Re.prototype.getErrorLocation=function(){return this._errorLocation},Re.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},Re.prototype.report=function(e){if(!Re.VERBOSE)return null;Te.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))},Re.prototype.getErrorMessage=function(){return this._errorMsg},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re},Re.isValidMsg=function(e,t,n){var i=new Re(e,t,n);return i.isValid()?null:i.getErrorMessage()},Re.isValid=function(e,t,n){var i=new Re(e,t,n);return!!i.isValid()},wd.VERBOSE.get=function(){return!1},wd.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Re,wd);var br=function(){this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};br.prototype.getCoordinates=function(){return this._pts},br.prototype.size=function(){return this._pts.length},br.prototype.getCoordinate=function(e){return this._pts[e]},br.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},br.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:po.octant(this.getCoordinate(e),this.getCoordinate(e+1))},br.prototype.setData=function(e){this._data=e},br.prototype.getData=function(){return this._data},br.prototype.toString=function(){return Zn.toLineString(new se(this._pts))},br.prototype.interfaces_=function(){return[Yr]},br.prototype.getClass=function(){return br};var be=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new W,this._intersectionCount=0,this._keepIntersections=!0;var e=arguments[0];this._li=e,this._interiorIntersection=null};be.prototype.getInteriorIntersection=function(){return this._interiorIntersection},be.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e},be.prototype.getIntersectionSegments=function(){return this._intSegments},be.prototype.count=function(){return this._intersectionCount},be.prototype.getIntersections=function(){return this._intersections},be.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},be.prototype.setKeepIntersections=function(e){this._keepIntersections=e},be.prototype.processIntersections=function(e,t,n,i){if(!this._findAllIntersections&&this.hasIntersection()||e===n&&t===i)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(e,t)||this.isEndSegment(n,i);if(!s)return null}var o=e.getCoordinates()[t],a=e.getCoordinates()[t+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=a,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},be.prototype.isEndSegment=function(e,t){return t===0||t>=e.size()-2},be.prototype.hasIntersection=function(){return this._interiorIntersection!==null},be.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},be.prototype.interfaces_=function(){return[Ts]},be.prototype.getClass=function(){return be},be.createAllIntersectionsFinder=function(e){var t=new be(e);return t.setFindAllIntersections(!0),t},be.createAnyIntersectionFinder=function(e){return new be(e)},be.createIntersectionCounter=function(e){var t=new be(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};var or=function(){this._li=new Cs,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e};or.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},or.prototype.getIntersections=function(){return this._segInt.getIntersections()},or.prototype.isValid=function(){return this.execute(),this._isValid},or.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},or.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new be(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new md;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},or.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Si(this.getErrorMessage(),this._segInt.getInteriorIntersection())},or.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Zn.toLineString(e[0],e[1])+" and "+Zn.toLineString(e[2],e[3])},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},or.computeIntersections=function(e){var t=new or(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};var Ds=function r(){this._nv=null;var e=arguments[0];this._nv=new or(r.toSegmentStrings(e))};Ds.prototype.checkValid=function(){this._nv.checkValid()},Ds.prototype.interfaces_=function(){return[]},Ds.prototype.getClass=function(){return Ds},Ds.toSegmentStrings=function(e){for(var t=new W,n=e.iterator();n.hasNext();){var i=n.next();t.add(new br(i.getCoordinates(),i))}return t},Ds.checkValid=function(e){var t=new Ds(e);t.checkValid()};var Eo=function(e){this._mapOp=e};Eo.prototype.map=function(e){for(var t=this,n=new W,i=0;i<e.getNumGeometries();i++){var s=t._mapOp.map(e.getGeometryN(i));s.isEmpty()||n.add(s)}return e.getFactory().createGeometryCollection(St.toGeometryArray(n))},Eo.prototype.interfaces_=function(){return[]},Eo.prototype.getClass=function(){return Eo},Eo.map=function(e,t){var n=new Eo(t);return n.map(e)};var Pr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new W,this._resultLineList=new W;var e=arguments[0],t=arguments[1],n=arguments[2];this._op=e,this._geometryFactory=t,this._ptLocator=n};Pr.prototype.collectLines=function(e){for(var t=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var i=n.next();t.collectLineEdge(i,e,t._lineEdgesList),t.collectBoundaryTouchEdge(i,e,t._lineEdgesList)}},Pr.prototype.labelIsolatedLine=function(e,t){var n=this._ptLocator.locate(e.getCoordinate(),this._op.getArgGeometry(t));e.getLabel().setLocation(t,n)},Pr.prototype.build=function(e){return this.findCoveredLineEdges(),this.collectLines(e),this.buildLines(e),this._resultLineList},Pr.prototype.collectLineEdge=function(e,t,n){var i=e.getLabel(),s=e.getEdge();e.isLineEdge()&&!e.isVisited()&&gt.isResultOfOp(i,t)&&!s.isCovered()&&(n.add(s),e.setVisitedEdge(!0))},Pr.prototype.findCoveredLineEdges=function(){for(var e=this,t=this._op.getGraph().getNodes().iterator();t.hasNext();){var n=t.next();n.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getEdge();if(s.isLineEdge()&&!o.isCoveredSet()){var a=e._op.isCoveredByA(s.getCoordinate());o.setCovered(a)}}},Pr.prototype.labelIsolatedLines=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();i.isIsolated()&&(s.isNull(0)?t.labelIsolatedLine(i,0):t.labelIsolatedLine(i,1))}},Pr.prototype.buildLines=function(e){for(var t=this,n=this._lineEdgesList.iterator();n.hasNext();){var i=n.next(),s=t._geometryFactory.createLineString(i.getCoordinates());t._resultLineList.add(s),i.setInResult(!0)}},Pr.prototype.collectBoundaryTouchEdge=function(e,t,n){var i=e.getLabel();if(e.isLineEdge()||e.isVisited()||e.isInteriorAreaEdge()||e.getEdge().isInResult())return null;yt.isTrue(!(e.isInResult()||e.getSym().isInResult())||!e.getEdge().isInResult()),gt.isResultOfOp(i,t)&&t===gt.INTERSECTION&&(n.add(e.getEdge()),e.setVisitedEdge(!0))},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr};var Co=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new W;var e=arguments[0],t=arguments[1];this._op=e,this._geometryFactory=t};Co.prototype.filterCoveredNodeToPoint=function(e){var t=e.getCoordinate();if(!this._op.isCoveredByLA(t)){var n=this._geometryFactory.createPoint(t);this._resultPointList.add(n)}},Co.prototype.extractNonCoveredResultNodes=function(e){for(var t=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||e===gt.INTERSECTION)){var s=i.getLabel();gt.isResultOfOp(s,e)&&t.filterCoveredNodeToPoint(i)}}},Co.prototype.build=function(e){return this.extractNonCoveredResultNodes(e),this._resultPointList},Co.prototype.interfaces_=function(){return[]},Co.prototype.getClass=function(){return Co};var on=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};on.prototype.transformPoint=function(e,t){return this._factory.createPoint(this.transformCoordinates(e.getCoordinateSequence(),e))},on.prototype.transformPolygon=function(e,t){var n=this,i=!0,s=this.transformLinearRing(e.getExteriorRing(),e);(s===null||!(s instanceof Hr)||s.isEmpty())&&(i=!1);for(var o=new W,a=0;a<e.getNumInteriorRing();a++){var u=n.transformLinearRing(e.getInteriorRingN(a),e);u===null||u.isEmpty()||(u instanceof Hr||(i=!1),o.add(u))}if(i)return this._factory.createPolygon(s,o.toArray([]));var l=new W;return s!==null&&l.add(s),l.addAll(o),this._factory.buildGeometry(l)},on.prototype.createCoordinateSequence=function(e){return this._factory.getCoordinateSequenceFactory().create(e)},on.prototype.getInputGeometry=function(){return this._inputGeom},on.prototype.transformMultiLineString=function(e,t){for(var n=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=n.transformLineString(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},on.prototype.transformCoordinates=function(e,t){return this.copy(e)},on.prototype.transformLineString=function(e,t){return this._factory.createLineString(this.transformCoordinates(e.getCoordinateSequence(),e))},on.prototype.transformMultiPoint=function(e,t){for(var n=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=n.transformPoint(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},on.prototype.transformMultiPolygon=function(e,t){for(var n=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=n.transformPolygon(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},on.prototype.copy=function(e){return e.copy()},on.prototype.transformGeometryCollection=function(e,t){for(var n=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=n.transform(e.getGeometryN(s));o!==null&&(n._pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(St.toGeometryArray(i)):this._factory.buildGeometry(i)},on.prototype.transform=function(e){if(this._inputGeom=e,this._factory=e.getFactory(),e instanceof dn)return this.transformPoint(e,null);if(e instanceof wa)return this.transformMultiPoint(e,null);if(e instanceof Hr)return this.transformLinearRing(e,null);if(e instanceof te)return this.transformLineString(e,null);if(e instanceof Ps)return this.transformMultiLineString(e,null);if(e instanceof pe)return this.transformPolygon(e,null);if(e instanceof qr)return this.transformMultiPolygon(e,null);if(e instanceof Ge)return this.transformGeometryCollection(e,null);throw new Yt("Unknown Geometry subtype: "+e.getClass().getName())},on.prototype.transformLinearRing=function(e,t){var n=this.transformCoordinates(e.getCoordinateSequence(),e);if(n===null)return this._factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on};var Qr=function r(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new tt,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof te&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];r.call(this,e.getCoordinates(),t)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=r.isClosed(n),this._snapTolerance=i}};Qr.prototype.snapVertices=function(e,t){for(var n=this,i=this._isClosed?e.size()-1:e.size(),s=0;s<i;s++){var o=e.get(s),a=n.findSnapForVertex(o,t);a!==null&&(e.set(s,new R(a)),s===0&&n._isClosed&&e.set(e.size()-1,new R(a)))}},Qr.prototype.findSnapForVertex=function(e,t){for(var n=this,i=0;i<t.length;i++){if(e.equals2D(t[i]))return null;if(e.distance(t[i])<n._snapTolerance)return t[i]}return null},Qr.prototype.snapTo=function(e){var t=new Wu(this._srcPts);this.snapVertices(t,e),this.snapSegments(t,e);var n=t.toCoordinateArray();return n},Qr.prototype.snapSegments=function(e,t){var n=this;if(t.length===0)return null;var i=t.length;t[0].equals2D(t[t.length-1])&&(i=t.length-1);for(var s=0;s<i;s++){var o=t[s],a=n.findSegmentIndexToSnap(o,e);a>=0&&e.add(a+1,new R(o),!1)}},Qr.prototype.findSegmentIndexToSnap=function(e,t){for(var n=this,i=ht.MAX_VALUE,s=-1,o=0;o<t.size()-1;o++){if(n._seg.p0=t.get(o),n._seg.p1=t.get(o+1),n._seg.p0.equals2D(e)||n._seg.p1.equals2D(e)){if(n._allowSnappingToSourceVertices)continue;return-1}var a=n._seg.distance(e);a<n._snapTolerance&&a<i&&(i=a,s=o)}return s},Qr.prototype.setAllowSnappingToSourceVertices=function(e){this._allowSnappingToSourceVertices=e},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr},Qr.isClosed=function(e){return e.length<=1?!1:e[0].equals2D(e[e.length-1])};var ae=function(e){this._srcGeom=e||null},$m={SNAP_PRECISION_FACTOR:{configurable:!0}};ae.prototype.snapTo=function(e,t){var n=this.extractTargetCoordinates(e),i=new Km(t,n);return i.transform(this._srcGeom)},ae.prototype.snapToSelf=function(e,t){var n=this.extractTargetCoordinates(this._srcGeom),i=new Km(e,n,!0),s=i.transform(this._srcGeom),o=s;return t&&at(o,$i)&&(o=s.buffer(0)),o},ae.prototype.computeSnapTolerance=function(e){var t=this.computeMinimumSegmentLength(e),n=t/10;return n},ae.prototype.extractTargetCoordinates=function(e){for(var t=new fr,n=e.getCoordinates(),i=0;i<n.length;i++)t.add(n[i]);return t.toArray(new Array(0).fill(null))},ae.prototype.computeMinimumSegmentLength=function(e){for(var t=ht.MAX_VALUE,n=0;n<e.length-1;n++){var i=e[n].distance(e[n+1]);i<t&&(t=i)}return t},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},ae.snap=function(e,t,n){var i=new Array(2).fill(null),s=new ae(e);i[0]=s.snapTo(t,n);var o=new ae(t);return i[1]=o.snapTo(i[0],n),i},ae.computeOverlaySnapTolerance=function(){if(arguments.length===1){var e=arguments[0],t=ae.computeSizeBasedSnapTolerance(e),n=e.getPrecisionModel();if(n.getType()===Lt.FIXED){var i=1/n.getScale()*2/1.415;i>t&&(t=i)}return t}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return Math.min(ae.computeOverlaySnapTolerance(s),ae.computeOverlaySnapTolerance(o))}},ae.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal(),n=Math.min(t.getHeight(),t.getWidth()),i=n*ae.SNAP_PRECISION_FACTOR;return i},ae.snapToSelf=function(e,t,n){var i=new ae(e);return i.snapToSelf(t,n)},$m.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(ae,$m);var Km=function(r){function e(t,n,i){r.call(this),this._snapTolerance=t||null,this._snapPts=n||null,this._isSelfSnap=i!==void 0?i:!1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(n,i){var s=new Qr(n,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(i)},e.prototype.transformCoordinates=function(n,i){var s=n.toCoordinateArray(),o=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(on),Je=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Je.prototype.getCommon=function(){return ht.longBitsToDouble(this._commonBits)},Je.prototype.add=function(e){var t=ht.doubleToLongBits(e);if(this._isFirst)return this._commonBits=t,this._commonSignExp=Je.signExpBits(this._commonBits),this._isFirst=!1,null;var n=Je.signExpBits(t);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Je.numCommonMostSigMantissaBits(this._commonBits,t),this._commonBits=Je.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Je.prototype.toString=function(){if(arguments.length===1){var e=arguments[0],t=ht.longBitsToDouble(e),n=ht.toBinaryString(e),i="0000000000000000000000000000000000000000000000000000000000000000"+n,s=i.substring(i.length-64),o=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+t+" ]";return o}},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je},Je.getBit=function(e,t){var n=1<<t;return(e&n)!==0?1:0},Je.signExpBits=function(e){return e>>52},Je.zeroLowerBits=function(e,t){var n=(1<<t)-1,i=~n,s=e&i;return s},Je.numCommonMostSigMantissaBits=function(e,t){for(var n=0,i=52;i>=0;i--){if(Je.getBit(e,i)!==Je.getBit(t,i))return n;n++}return 52};var is=function(){this._commonCoord=null,this._ccFilter=new So},Ed={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};is.prototype.addCommonBits=function(e){var t=new ss(this._commonCoord);e.apply(t),e.geometryChanged()},is.prototype.removeCommonBits=function(e){if(this._commonCoord.x===0&&this._commonCoord.y===0)return e;var t=new R(this._commonCoord);t.x=-t.x,t.y=-t.y;var n=new ss(t);return e.apply(n),e.geometryChanged(),e},is.prototype.getCommonCoordinate=function(){return this._commonCoord},is.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},is.prototype.interfaces_=function(){return[]},is.prototype.getClass=function(){return is},Ed.CommonCoordinateFilter.get=function(){return So},Ed.Translater.get=function(){return ss},Object.defineProperties(is,Ed);var So=function(){this._commonBitsX=new Je,this._commonBitsY=new Je};So.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)},So.prototype.getCommonCoordinate=function(){return new R(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},So.prototype.interfaces_=function(){return[Wr]},So.prototype.getClass=function(){return So};var ss=function(){this.trans=null;var e=arguments[0];this.trans=e};ss.prototype.filter=function(e,t){var n=e.getOrdinate(t,0)+this.trans.x,i=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,n),e.setOrdinate(t,1,i)},ss.prototype.isDone=function(){return!1},ss.prototype.isGeometryChanged=function(){return!0},ss.prototype.interfaces_=function(){return[er]},ss.prototype.getClass=function(){return ss};var Pe=function(e,t){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=e,this._geom[1]=t,this.computeSnapTolerance()};Pe.prototype.selfSnap=function(e){var t=new ae(e),n=t.snapTo(e,this._snapTolerance);return n},Pe.prototype.removeCommonBits=function(e){this._cbr=new is,this._cbr.add(e[0]),this._cbr.add(e[1]);var t=new Array(2).fill(null);return t[0]=this._cbr.removeCommonBits(e[0].copy()),t[1]=this._cbr.removeCommonBits(e[1].copy()),t},Pe.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e},Pe.prototype.getResultGeometry=function(e){var t=this.snap(this._geom),n=gt.overlayOp(t[0],t[1],e);return this.prepareResult(n)},Pe.prototype.checkValid=function(e){e.isValid()||Te.out.println("Snapped geometry is invalid")},Pe.prototype.computeSnapTolerance=function(){this._snapTolerance=ae.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Pe.prototype.snap=function(e){var t=this.removeCommonBits(e),n=ae.snap(t[0],t[1],this._snapTolerance);return n},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe},Pe.overlayOp=function(e,t,n){var i=new Pe(e,t);return i.getResultGeometry(n)},Pe.union=function(e,t){return Pe.overlayOp(e,t,gt.UNION)},Pe.intersection=function(e,t){return Pe.overlayOp(e,t,gt.INTERSECTION)},Pe.symDifference=function(e,t){return Pe.overlayOp(e,t,gt.SYMDIFFERENCE)},Pe.difference=function(e,t){return Pe.overlayOp(e,t,gt.DIFFERENCE)};var $e=function(e,t){this._geom=new Array(2).fill(null),this._geom[0]=e,this._geom[1]=t};$e.prototype.getResultGeometry=function(e){var t=null,n=!1,i=null;try{t=gt.overlayOp(this._geom[0],this._geom[1],e);var s=!0;s&&(n=!0)}catch(o){if(o instanceof vi)i=o;else throw o}finally{}if(!n)try{t=Pe.overlayOp(this._geom[0],this._geom[1],e)}catch(o){throw o instanceof vi?i:o}finally{}return t},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e},$e.overlayOp=function(e,t,n){var i=new $e(e,t);return i.getResultGeometry(n)},$e.union=function(e,t){return $e.overlayOp(e,t,gt.UNION)},$e.intersection=function(e,t){return $e.overlayOp(e,t,gt.INTERSECTION)},$e.symDifference=function(e,t){return $e.overlayOp(e,t,gt.SYMDIFFERENCE)},$e.difference=function(e,t){return $e.overlayOp(e,t,gt.DIFFERENCE)};var sl=function(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t};sl.prototype.computeIntersections=function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)},sl.prototype.interfaces_=function(){return[]},sl.prototype.getClass=function(){return sl};var mn=function r(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var e=arguments[0],t=arguments[1];this._eventType=r.DELETE,this._xValue=e,this._insertEvent=t}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._eventType=r.INSERT,this._label=n,this._xValue=i,this._obj=s}},Cd={INSERT:{configurable:!0},DELETE:{configurable:!0}};mn.prototype.isDelete=function(){return this._eventType===mn.DELETE},mn.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e},mn.prototype.getObject=function(){return this._obj},mn.prototype.compareTo=function(e){var t=e;return this._xValue<t._xValue?-1:this._xValue>t._xValue?1:this._eventType<t._eventType?-1:this._eventType>t._eventType?1:0},mn.prototype.getInsertEvent=function(){return this._insertEvent},mn.prototype.isInsert=function(){return this._eventType===mn.INSERT},mn.prototype.isSameLabel=function(e){return this._label===null?!1:this._label===e._label},mn.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},mn.prototype.interfaces_=function(){return[An]},mn.prototype.getClass=function(){return mn},Cd.INSERT.get=function(){return 1},Cd.DELETE.get=function(){return 2},Object.defineProperties(mn,Cd);var vc=function(){};vc.prototype.interfaces_=function(){return[]},vc.prototype.getClass=function(){return vc};var Le=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._li=e,this._includeProper=t,this._recordIsolated=n};Le.prototype.isTrivialIntersection=function(e,t,n,i){if(e===n&&this._li.getIntersectionNum()===1){if(Le.isAdjacentSegments(t,i))return!0;if(e.isClosed()){var s=e.getNumPoints()-1;if(t===0&&i===s||i===0&&t===s)return!0}}return!1},Le.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Le.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e},Le.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Le.prototype.isBoundaryPointInternal=function(e,t){for(var n=t.iterator();n.hasNext();){var i=n.next(),s=i.getCoordinate();if(e.isIntersection(s))return!0}return!1},Le.prototype.hasProperIntersection=function(){return this._hasProper},Le.prototype.hasIntersection=function(){return this._hasIntersection},Le.prototype.isDone=function(){return this._isDone},Le.prototype.isBoundaryPoint=function(e,t){return t===null?!1:!!(this.isBoundaryPointInternal(e,t[0])||this.isBoundaryPointInternal(e,t[1]))},Le.prototype.setBoundaryNodes=function(e,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=t},Le.prototype.addIntersections=function(e,t,n,i){if(e===n&&t===i)return null;this.numTests++;var s=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,t,n,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(e.addIntersections(this._li,t,0),n.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le},Le.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var tC=function(r){function e(){r.call(this),this.events=new W,this.nOverlaps=null}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){var n=this;rr.sort(this.events);for(var i=0;i<this.events.size();i++){var s=n.events.get(i);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(i)}},e.prototype.computeIntersections=function(){var n=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var s=0;s<this.events.size();s++){var o=n.events.get(s);if(o.isInsert()&&n.processOverlaps(s,o.getDeleteEventIndex(),o,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Le&&at(arguments[0],Qn)&&at(arguments[1],Qn)){var a=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(a,a),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&at(arguments[0],Qn)&&arguments[1]instanceof Le){var c=arguments[0],h=arguments[1],f=arguments[2];f?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(h)}}},e.prototype.addEdge=function(n,i){for(var s=this,o=n.getMonotoneChainEdge(),a=o.getStartIndexes(),u=0;u<a.length-1;u++){var l=new sl(o,u),c=new mn(i,o.getMinX(u),l);s.events.add(c),s.events.add(new mn(o.getMaxX(u),c))}},e.prototype.processOverlaps=function(n,i,s,o){for(var a=this,u=s.getObject(),l=n;l<i;l++){var c=a.events.get(l);if(c.isInsert()){var h=c.getObject();s.isSameLabel(c)||(u.computeIntersections(h,o),a.nOverlaps++)}}},e.prototype.addEdges=function(){var n=this;if(arguments.length===1)for(var i=arguments[0],s=i.iterator();s.hasNext();){var o=s.next();n.addEdge(o,o)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var c=l.next();n.addEdge(c,u)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(vc),ti=function(){this._min=ht.POSITIVE_INFINITY,this._max=ht.NEGATIVE_INFINITY},Zm={NodeComparator:{configurable:!0}};ti.prototype.getMin=function(){return this._min},ti.prototype.intersects=function(e,t){return!(this._min>t||this._max<e)},ti.prototype.getMax=function(){return this._max},ti.prototype.toString=function(){return Zn.toLineString(new R(this._min,0),new R(this._max,0))},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},Zm.NodeComparator.get=function(){return ol},Object.defineProperties(ti,Zm);var ol=function(){};ol.prototype.compare=function(e,t){var n=e,i=t,s=(n._min+n._max)/2,o=(i._min+i._max)/2;return s<o?-1:s>o?1:0},ol.prototype.interfaces_=function(){return[la]},ol.prototype.getClass=function(){return ol};var eC=function(r){function e(){r.call(this),this._item=null;var t=arguments[0],n=arguments[1],i=arguments[2];this._min=t,this._max=n,this._item=i}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.query=function(n,i,s){if(!this.intersects(n,i))return null;s.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ti),nC=function(r){function e(){r.call(this),this._node1=null,this._node2=null;var t=arguments[0],n=arguments[1];this._node1=t,this._node2=n,this.buildExtent(this._node1,this._node2)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(n,i){this._min=Math.min(n._min,i._min),this._max=Math.max(n._max,i._max)},e.prototype.query=function(n,i,s){if(!this.intersects(n,i))return null;this._node1!==null&&this._node1.query(n,i,s),this._node2!==null&&this._node2.query(n,i,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ti),ei=function(){this._leaves=new W,this._root=null,this._level=0};ei.prototype.buildTree=function(){var e=this;rr.sort(this._leaves,new ti.NodeComparator);for(var t=this._leaves,n=null,i=new W;;){if(e.buildLevel(t,i),i.size()===1)return i.get(0);n=t,t=i,i=n}},ei.prototype.insert=function(e,t,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new eC(e,t,n))},ei.prototype.query=function(e,t,n){this.init(),this._root.query(e,t,n)},ei.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},ei.prototype.printNode=function(e){Te.out.println(Zn.toLineString(new R(e._min,this._level),new R(e._max,this._level)))},ei.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},ei.prototype.buildLevel=function(e,t){this._level++,t.clear();for(var n=0;n<e.size();n+=2){var i=e.get(n),s=n+1<e.size()?e.get(n):null;if(s===null)t.add(i);else{var o=new nC(e.get(n),e.get(n+1));t.add(o)}}},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei};var xa=function(){this._items=new W};xa.prototype.visitItem=function(e){this._items.add(e)},xa.prototype.getItems=function(){return this._items},xa.prototype.interfaces_=function(){return[Ki]},xa.prototype.getClass=function(){return xa};var Ta=function(){this._index=null;var e=arguments[0];if(!at(e,$i))throw new Yt("Argument must be Polygonal");this._index=new Ms(e)},Sd={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Ta.prototype.locate=function(e){var t=new dr(e),n=new Oa(t);return this._index.query(e.y,e.y,n),t.getLocation()},Ta.prototype.interfaces_=function(){return[ba]},Ta.prototype.getClass=function(){return Ta},Sd.SegmentVisitor.get=function(){return Oa},Sd.IntervalIndexedGeometry.get=function(){return Ms},Object.defineProperties(Ta,Sd);var Oa=function(){this._counter=null;var e=arguments[0];this._counter=e};Oa.prototype.visitItem=function(e){var t=e;this._counter.countSegment(t.getCoordinate(0),t.getCoordinate(1))},Oa.prototype.interfaces_=function(){return[Ki]},Oa.prototype.getClass=function(){return Oa};var Ms=function(){this._index=new ei;var e=arguments[0];this.init(e)};Ms.prototype.init=function(e){for(var t=this,n=De.getLines(e),i=n.iterator();i.hasNext();){var s=i.next(),o=s.getCoordinates();t.addLine(o)}},Ms.prototype.addLine=function(e){for(var t=this,n=1;n<e.length;n++){var i=new tt(e[n-1],e[n]),s=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);t._index.insert(s,o,i)}},Ms.prototype.query=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new xa;return this._index.query(e,t,n),n.getItems()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];this._index.query(i,s,o)}},Ms.prototype.interfaces_=function(){return[]},Ms.prototype.getClass=function(){return Ms};var al=function(r){function e(){if(r.call(this),this._parentGeom=null,this._lineEdgeMap=new Rm,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new sr,arguments.length===2){var t=arguments[0],n=arguments[1],i=Vn.OGC_SFS_BOUNDARY_RULE;this._argIndex=t,this._parentGeom=n,this._boundaryNodeRule=i,n!==null&&this.add(n)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this._argIndex=s,this._parentGeom=o,this._boundaryNodeRule=a,o!==null&&this.add(o)}}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(n,i){var s=this._nodes.addNode(i),o=s.getLabel(),a=1,u=F.NONE;u=o.getLocation(n,U.ON),u===F.BOUNDARY&&a++;var l=e.determineBoundary(this._boundaryNodeRule,a);o.setLocation(n,l)},e.prototype.computeSelfNodes=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.computeSelfNodes(n,i,!1)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2],u=new Le(s,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),c=this._parentGeom instanceof Hr||this._parentGeom instanceof pe||this._parentGeom instanceof qr,h=o||!c;return l.computeIntersections(this._edges,u,h),this.addSelfIntersectionNodes(this._argIndex),u}},e.prototype.computeSplitEdges=function(n){for(var i=this._edges.iterator();i.hasNext();){var s=i.next();s.eiList.addSplitEdges(n)}},e.prototype.computeEdgeIntersections=function(n,i,s){var o=new Le(i,s,!0);o.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,n._edges,o),o},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof dn){var n=arguments[0],i=n.getCoordinate();this.insertPoint(this._argIndex,i,F.INTERIOR)}else if(arguments[0]instanceof R){var s=arguments[0];this.insertPoint(this._argIndex,s,F.INTERIOR)}},e.prototype.addPolygon=function(n){var i=this;this.addPolygonRing(n.getExteriorRing(),F.EXTERIOR,F.INTERIOR);for(var s=0;s<n.getNumInteriorRing();s++){var o=n.getInteriorRingN(s);i.addPolygonRing(o,F.INTERIOR,F.EXTERIOR)}},e.prototype.addEdge=function(n){this.insertEdge(n);var i=n.getCoordinates();this.insertPoint(this._argIndex,i[0],F.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],F.BOUNDARY)},e.prototype.addLineString=function(n){var i=Ct.removeRepeatedPoints(n.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var s=new mc(i,new jt(this._argIndex,F.INTERIOR));this._lineEdgeMap.put(n,s),this.insertEdge(s),yt.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),i=new Array(n.size()).fill(null),s=0,o=n.iterator();o.hasNext();){var a=o.next();i[s++]=a.getCoordinate().copy()}return i},e.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(n,i,s){if(this.isBoundaryNode(n,i))return null;s===F.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,i):this.insertPoint(n,i,s)},e.prototype.addPolygonRing=function(n,i,s){if(n.isEmpty())return null;var o=Ct.removeRepeatedPoints(n.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var a=i,u=s;q.isCCW(o)&&(a=s,u=i);var l=new mc(o,new jt(this._argIndex,F.BOUNDARY,a,u));this._lineEdgeMap.put(n,l),this.insertEdge(l),this.insertPoint(this._argIndex,o[0],F.BOUNDARY)},e.prototype.insertPoint=function(n,i,s){var o=this._nodes.addNode(i),a=o.getLabel();a===null?o._label=new jt(n,s):a.setLocation(n,s)},e.prototype.createEdgeSetIntersector=function(){return new tC},e.prototype.addSelfIntersectionNodes=function(n){for(var i=this,s=this._edges.iterator();s.hasNext();)for(var o=s.next(),a=o.getLabel().getLocation(n),u=o.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(n,l.coord,a)}},e.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof qr&&(this._useBoundaryDeterminationRule=!1),n instanceof pe)this.addPolygon(n);else if(n instanceof te)this.addLineString(n);else if(n instanceof dn)this.addPoint(n);else if(n instanceof wa)this.addCollection(n);else if(n instanceof Ps)this.addCollection(n);else if(n instanceof qr)this.addCollection(n);else if(n instanceof Ge)this.addCollection(n);else throw new Error(n.getClass().getName())}else return r.prototype.add.apply(this,arguments)},e.prototype.addCollection=function(n){for(var i=this,s=0;s<n.getNumGeometries();s++){var o=n.getGeometryN(s);i.add(o)}},e.prototype.locate=function(n){return at(this._parentGeom,$i)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Ta(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return r.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(n,i){return n.isInBoundary(i)?F.BOUNDARY:F.INTERIOR},e}(Kt),Na=function(){if(this._li=new Cs,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var e=arguments[0];this.setComputationPrecision(e.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new al(0,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],i=Vn.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new al(0,t,i),this._arg[1]=new al(1,n,i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];s.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new al(0,s,a),this._arg[1]=new al(1,o,a)}};Na.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()},Na.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)},Na.prototype.interfaces_=function(){return[]},Na.prototype.getClass=function(){return Na};var Rs=function(){};Rs.prototype.interfaces_=function(){return[]},Rs.prototype.getClass=function(){return Rs},Rs.map=function(){if(arguments[0]instanceof ot&&at(arguments[1],Rs.MapOp)){for(var e=arguments[0],t=arguments[1],n=new W,i=0;i<e.getNumGeometries();i++){var s=t.map(e.getGeometryN(i));s!==null&&n.add(s)}return e.getFactory().buildGeometry(n)}else if(at(arguments[0],fe)&&at(arguments[1],Rs.MapOp)){for(var o=arguments[0],a=arguments[1],u=new W,l=o.iterator();l.hasNext();){var c=l.next(),h=a.map(c);h!==null&&u.add(h)}return u}},Rs.MapOp=function(){};var gt=function(r){function e(){var t=arguments[0],n=arguments[1];r.call(this,t,n),this._ptLocator=new sr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new ir,this._resultPolyList=new W,this._resultLineList=new W,this._resultPointList=new W,this._graph=new Kt(new Gm),this._geomFact=t.getFactory()}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(n){var i=this._edgeList.findEqualEdge(n);if(i!==null){var s=i.getLabel(),o=n.getLabel();i.isPointwiseEqual(n)||(o=new jt(n.getLabel()),o.flip());var a=i.getDepth();a.isNull()&&a.add(s),a.add(o),s.merge(o)}else this._edgeList.add(n)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var i=n.next(),s=i.getSym();i.isInResult()&&s.isInResult()&&(i.setInResult(!1),s.setInResult(!1))}},e.prototype.isCoveredByLA=function(n){return!!(this.isCovered(n,this._resultLineList)||this.isCovered(n,this._resultPolyList))},e.prototype.computeGeometry=function(n,i,s,o){var a=new W;return a.addAll(n),a.addAll(i),a.addAll(s),a.isEmpty()?e.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},e.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next();i.getEdges().mergeSymLabels()}},e.prototype.isCovered=function(n,i){for(var s=this,o=i.iterator();o.hasNext();){var a=o.next(),u=s._ptLocator.locate(n,a);if(u!==F.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var n=new W,i=this._edgeList.iterator();i.hasNext();){var s=i.next();s.isCollapsed()&&(i.remove(),n.add(s.getCollapsedEdge()))}this._edgeList.addAll(n)},e.prototype.updateNodeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next(),s=i.getEdges().getLabel();i.getLabel().merge(s)}},e.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},e.prototype.insertUniqueEdges=function(n){for(var i=this,s=n.iterator();s.hasNext();){var o=s.next();i.insertUniqueEdge(o)}},e.prototype.computeOverlay=function(n){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var i=new W;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Ds.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(n),this.cancelDuplicateResultEdges();var s=new fn(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var o=new Pr(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(n);var a=new Co(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(n),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},e.prototype.labelIncompleteNode=function(n,i){var s=this._ptLocator.locate(n.getCoordinate(),this._arg[i].getGeometry());n.getLabel().setLocation(i,s)},e.prototype.copyPoints=function(n){for(var i=this,s=this._arg[n].getNodeIterator();s.hasNext();){var o=s.next(),a=i._graph.addNode(o.getCoordinate());a.setLabel(n,o.getLabel().getLocation(n))}},e.prototype.findResultAreaEdges=function(n){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.isArea()&&!s.isInteriorAreaEdge()&&e.isResultOfOp(o.getLocation(0,U.RIGHT),o.getLocation(1,U.RIGHT),n)&&s.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var n=this._edgeList.iterator();n.hasNext();){var i=n.next(),s=i.getLabel(),o=i.getDepth();if(!o.isNull()){o.normalize();for(var a=0;a<2;a++)!s.isNull(a)&&s.isArea()&&!o.isNull(a)&&(o.getDelta(a)===0?s.toLine(a):(yt.isTrue(!o.isNull(a,U.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(a,U.LEFT,o.getLocation(a,U.LEFT)),yt.isTrue(!o.isNull(a,U.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(a,U.RIGHT,o.getLocation(a,U.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next();s.getEdges().computeLabelling(n._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();s.isIsolated()&&(o.isNull(0)?n.labelIncompleteNode(s,0):n.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(o)}},e.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Na);gt.overlayOp=function(r,e,t){var n=new gt(r,e),i=n.getResultGeometry(t);return i},gt.intersection=function(r,e){if(r.isEmpty()||e.isEmpty())return gt.createEmptyResult(gt.INTERSECTION,r,e,r.getFactory());if(r.isGeometryCollection()){var t=e;return Eo.map(r,{interfaces_:function(){return[Rs.MapOp]},map:function(n){return n.intersection(t)}})}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(e),$e.overlayOp(r,e,gt.INTERSECTION)},gt.symDifference=function(r,e){if(r.isEmpty()||e.isEmpty()){if(r.isEmpty()&&e.isEmpty())return gt.createEmptyResult(gt.SYMDIFFERENCE,r,e,r.getFactory());if(r.isEmpty())return e.copy();if(e.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(e),$e.overlayOp(r,e,gt.SYMDIFFERENCE)},gt.resultDimension=function(r,e,t){var n=e.getDimension(),i=t.getDimension(),s=-1;switch(r){case gt.INTERSECTION:s=Math.min(n,i);break;case gt.UNION:s=Math.max(n,i);break;case gt.DIFFERENCE:s=n;break;case gt.SYMDIFFERENCE:s=Math.max(n,i);break}return s},gt.createEmptyResult=function(r,e,t,n){var i=null;switch(gt.resultDimension(r,e,t)){case-1:i=n.createGeometryCollection(new Array(0).fill(null));break;case 0:i=n.createPoint();break;case 1:i=n.createLineString();break;case 2:i=n.createPolygon();break}return i},gt.difference=function(r,e){return r.isEmpty()?gt.createEmptyResult(gt.DIFFERENCE,r,e,r.getFactory()):e.isEmpty()?r.copy():(r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(e),$e.overlayOp(r,e,gt.DIFFERENCE))},gt.isResultOfOp=function(){if(arguments.length===2){var r=arguments[0],e=arguments[1],t=r.getLocation(0),n=r.getLocation(1);return gt.isResultOfOp(t,n,e)}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];switch(i===F.BOUNDARY&&(i=F.INTERIOR),s===F.BOUNDARY&&(s=F.INTERIOR),o){case gt.INTERSECTION:return i===F.INTERIOR&&s===F.INTERIOR;case gt.UNION:return i===F.INTERIOR||s===F.INTERIOR;case gt.DIFFERENCE:return i===F.INTERIOR&&s!==F.INTERIOR;case gt.SYMDIFFERENCE:return i===F.INTERIOR&&s!==F.INTERIOR||i!==F.INTERIOR&&s===F.INTERIOR}return!1}},gt.INTERSECTION=1,gt.UNION=2,gt.DIFFERENCE=3,gt.SYMDIFFERENCE=4;var os=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new sr,this._seg=new tt;var e=arguments[0],t=arguments[1];this._g=e,this._boundaryDistanceTolerance=t,this._linework=this.extractLinework(e)};os.prototype.isWithinToleranceOfBoundary=function(e){for(var t=this,n=0;n<this._linework.getNumGeometries();n++)for(var i=t._linework.getGeometryN(n),s=i.getCoordinateSequence(),o=0;o<s.size()-1;o++){s.getCoordinate(o,t._seg.p0),s.getCoordinate(o+1,t._seg.p1);var a=t._seg.distance(e);if(a<=t._boundaryDistanceTolerance)return!0}return!1},os.prototype.getLocation=function(e){return this.isWithinToleranceOfBoundary(e)?F.BOUNDARY:this._ptLocator.locate(e,this._g)},os.prototype.extractLinework=function(e){var t=new Da;e.apply(t);var n=t.getLinework(),i=St.toLineStringArray(n);return e.getFactory().createMultiLineString(i)},os.prototype.interfaces_=function(){return[]},os.prototype.getClass=function(){return os};var Da=function(){this._linework=null,this._linework=new W};Da.prototype.getLinework=function(){return this._linework},Da.prototype.filter=function(e){var t=this;if(e instanceof pe){var n=e;this._linework.add(n.getExteriorRing());for(var i=0;i<n.getNumInteriorRing();i++)t._linework.add(n.getInteriorRingN(i))}},Da.prototype.interfaces_=function(){return[pr]},Da.prototype.getClass=function(){return Da};var Ls=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var e=arguments[0];this._g=e};Ls.prototype.extractPoints=function(e,t,n){for(var i=this,s=e.getCoordinates(),o=0;o<s.length-1;o++)i.computeOffsetPoints(s[o],s[o+1],t,n)},Ls.prototype.setSidesToGenerate=function(e,t){this._doLeft=e,this._doRight=t},Ls.prototype.getPoints=function(e){for(var t=this,n=new W,i=De.getLines(this._g),s=i.iterator();s.hasNext();){var o=s.next();t.extractPoints(o,e,n)}return n},Ls.prototype.computeOffsetPoints=function(e,t,n,i){var s=t.x-e.x,o=t.y-e.y,a=Math.sqrt(s*s+o*o),u=n*s/a,l=n*o/a,c=(t.x+e.x)/2,h=(t.y+e.y)/2;if(this._doLeft){var f=new R(c-l,h+u);i.add(f)}if(this._doRight){var p=new R(c+l,h-u);i.add(p)}},Ls.prototype.interfaces_=function(){return[]},Ls.prototype.getClass=function(){return Ls};var Mn=function r(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=r.TOLERANCE,this._testCoords=new W;var e=arguments[0],t=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=r.computeBoundaryDistanceTolerance(e,t),this._geom=[e,t,n],this._locFinder=[new os(this._geom[0],this._boundaryDistanceTolerance),new os(this._geom[1],this._boundaryDistanceTolerance),new os(this._geom[2],this._boundaryDistanceTolerance)]},Qm={TOLERANCE:{configurable:!0}};Mn.prototype.reportResult=function(e,t,n){Te.out.println("Overlay result invalid - A:"+F.toLocationSymbol(t[0])+" B:"+F.toLocationSymbol(t[1])+" expected:"+(n?"i":"e")+" actual:"+F.toLocationSymbol(t[2]))},Mn.prototype.isValid=function(e){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var t=this.checkValid(e);return t},Mn.prototype.checkValid=function(){var e=this;if(arguments.length===1){for(var t=arguments[0],n=0;n<this._testCoords.size();n++){var i=e._testCoords.get(n);if(!e.checkValid(t,i))return e._invalidLocation=i,!1}return!0}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),Mn.hasLocation(this._location,F.BOUNDARY)?!0:this.isValidResult(s,this._location)}},Mn.prototype.addTestPts=function(e){var t=new Ls(e);this._testCoords.addAll(t.getPoints(5*this._boundaryDistanceTolerance))},Mn.prototype.isValidResult=function(e,t){var n=gt.isResultOfOp(t[0],t[1],e),i=t[2]===F.INTERIOR,s=!(n^i);return s||this.reportResult(e,t,n),s},Mn.prototype.getInvalidLocation=function(){return this._invalidLocation},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Mn.hasLocation=function(e,t){for(var n=0;n<3;n++)if(e[n]===t)return!0;return!1},Mn.computeBoundaryDistanceTolerance=function(e,t){return Math.min(ae.computeSizeBasedSnapTolerance(e),ae.computeSizeBasedSnapTolerance(t))},Mn.isValid=function(e,t,n,i){var s=new Mn(e,t,i);return s.isValid(n)},Qm.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Mn,Qm);var Rn=function r(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=r.extractFactory(e),this._inputGeoms=e};Rn.prototype.extractElements=function(e,t){var n=this;if(e===null)return null;for(var i=0;i<e.getNumGeometries();i++){var s=e.getGeometryN(i);n._skipEmpty&&s.isEmpty()||t.add(s)}},Rn.prototype.combine=function(){for(var e=this,t=new W,n=this._inputGeoms.iterator();n.hasNext();){var i=n.next();e.extractElements(i,t)}return t.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},Rn.combine=function(){if(arguments.length===1){var e=arguments[0],t=new Rn(e);return t.combine()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=new Rn(Rn.createList(n,i));return s.combine()}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2],l=new Rn(Rn.createList(o,a,u));return l.combine()}},Rn.extractFactory=function(e){return e.isEmpty()?null:e.iterator().next().getFactory()},Rn.createList=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new W;return n.add(e),n.add(t),n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new W;return a.add(i),a.add(s),a.add(o),a}};var he=function(){this._inputPolys=null,this._geomFactory=null;var e=arguments[0];this._inputPolys=e,this._inputPolys===null&&(this._inputPolys=new W)},tv={STRTREE_NODE_CAPACITY:{configurable:!0}};he.prototype.reduceToGeometries=function(e){for(var t=this,n=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=null;at(s,Qn)?o=t.unionTree(s):s instanceof ot&&(o=s),n.add(o)}return n},he.prototype.extractByEnvelope=function(e,t,n){for(var i=new W,s=0;s<t.getNumGeometries();s++){var o=t.getGeometryN(s);o.getEnvelopeInternal().intersects(e)?i.add(o):n.add(o)}return this._geomFactory.buildGeometry(i)},he.prototype.unionOptimized=function(e,t){var n=e.getEnvelopeInternal(),i=t.getEnvelopeInternal();if(!n.intersects(i)){var s=Rn.combine(e,t);return s}if(e.getNumGeometries()<=1&&t.getNumGeometries()<=1)return this.unionActual(e,t);var o=n.intersection(i);return this.unionUsingEnvelopeIntersection(e,t,o)},he.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var e=new km(he.STRTREE_NODE_CAPACITY),t=this._inputPolys.iterator();t.hasNext();){var n=t.next();e.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var i=e.itemsTree(),s=this.unionTree(i);return s},he.prototype.binaryUnion=function(){if(arguments.length===1){var e=arguments[0];return this.binaryUnion(e,0,e.size())}else if(arguments.length===3){var t=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1){var s=he.getGeometry(t,n);return this.unionSafe(s,null)}else{if(i-n===2)return this.unionSafe(he.getGeometry(t,n),he.getGeometry(t,n+1));var o=Math.trunc((i+n)/2),a=this.binaryUnion(t,n,o),u=this.binaryUnion(t,o,i);return this.unionSafe(a,u)}}},he.prototype.repeatedUnion=function(e){for(var t=null,n=e.iterator();n.hasNext();){var i=n.next();t===null?t=i.copy():t=t.union(i)}return t},he.prototype.unionSafe=function(e,t){return e===null&&t===null?null:e===null?t.copy():t===null?e.copy():this.unionOptimized(e,t)},he.prototype.unionActual=function(e,t){return he.restrictToPolygons(e.union(t))},he.prototype.unionTree=function(e){var t=this.reduceToGeometries(e),n=this.binaryUnion(t);return n},he.prototype.unionUsingEnvelopeIntersection=function(e,t,n){var i=new W,s=this.extractByEnvelope(n,e,i),o=this.extractByEnvelope(n,t,i),a=this.unionActual(s,o);i.add(a);var u=Rn.combine(i);return u},he.prototype.bufferUnion=function(){if(arguments.length===1){var e=arguments[0],t=e.get(0).getFactory(),n=t.buildGeometry(e),i=n.buffer(0);return i}else if(arguments.length===2){var s=arguments[0],o=arguments[1],a=s.getFactory(),u=a.createGeometryCollection([s,o]),l=u.buffer(0);return l}},he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},he.restrictToPolygons=function(e){if(at(e,$i))return e;var t=xi.getPolygons(e);return t.size()===1?t.get(0):e.getFactory().createMultiPolygon(St.toPolygonArray(t))},he.getGeometry=function(e,t){return t>=e.size()?null:e.get(t)},he.union=function(e){var t=new he(e);return t.union()},tv.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(he,tv);var yc=function(){};yc.prototype.interfaces_=function(){return[]},yc.prototype.getClass=function(){return yc},yc.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return gt.createEmptyResult(gt.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),$e.overlayOp(e,t,gt.UNION)};function Fs(){return new _c}function _c(){this.reset()}_c.prototype={constructor:_c,reset:function(){this.s=this.t=0},add:function(r){ev(wc,r,this.t),ev(this,wc.s,this.s),this.s?this.t+=wc.t:this.s=wc.t},valueOf:function(){return this.s}};var wc=new _c;function ev(r,e,t){var n=r.s=e+t,i=n-e,s=n-i;r.t=e-s+(t-i)}var de=1e-6,Ut=Math.PI,Ti=Ut/2,nv=Ut/4,Oi=Ut*2,As=180/Ut,Ir=Ut/180,Ke=Math.abs,rC=Math.atan,Ma=Math.atan2,me=Math.cos,ve=Math.sin,Ra=Math.sqrt;function rv(r){return r>1?0:r<-1?Ut:Math.acos(r)}function bo(r){return r>1?Ti:r<-1?-Ti:Math.asin(r)}function ul(){}function Ec(r,e){r&&sv.hasOwnProperty(r.type)&&sv[r.type](r,e)}var iv={Feature:function(r,e){Ec(r.geometry,e)},FeatureCollection:function(r,e){for(var t=r.features,n=-1,i=t.length;++n<i;)Ec(t[n].geometry,e)}},sv={Sphere:function(r,e){e.sphere()},Point:function(r,e){r=r.coordinates,e.point(r[0],r[1],r[2])},MultiPoint:function(r,e){for(var t=r.coordinates,n=-1,i=t.length;++n<i;)r=t[n],e.point(r[0],r[1],r[2])},LineString:function(r,e){bd(r.coordinates,e,0)},MultiLineString:function(r,e){for(var t=r.coordinates,n=-1,i=t.length;++n<i;)bd(t[n],e,0)},Polygon:function(r,e){ov(r.coordinates,e)},MultiPolygon:function(r,e){for(var t=r.coordinates,n=-1,i=t.length;++n<i;)ov(t[n],e)},GeometryCollection:function(r,e){for(var t=r.geometries,n=-1,i=t.length;++n<i;)Ec(t[n],e)}};function bd(r,e,t){var n=-1,i=r.length-t,s;for(e.lineStart();++n<i;)s=r[n],e.point(s[0],s[1],s[2]);e.lineEnd()}function ov(r,e){var t=-1,n=r.length;for(e.polygonStart();++t<n;)bd(r[t],e,1);e.polygonEnd()}function iC(r,e){r&&iv.hasOwnProperty(r.type)?iv[r.type](r,e):Ec(r,e)}Fs(),Fs();function Pd(r){return[Ma(r[1],r[0]),bo(r[2])]}function La(r){var e=r[0],t=r[1],n=me(t);return[n*me(e),n*ve(e),ve(t)]}function Cc(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function Sc(r,e){return[r[1]*e[2]-r[2]*e[1],r[2]*e[0]-r[0]*e[2],r[0]*e[1]-r[1]*e[0]]}function Id(r,e){r[0]+=e[0],r[1]+=e[1],r[2]+=e[2]}function bc(r,e){return[r[0]*e,r[1]*e,r[2]*e]}function xd(r){var e=Ra(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=e,r[1]/=e,r[2]/=e}Fs();function av(r,e){function t(n,i){return n=r(n,i),e(n[0],n[1])}return r.invert&&e.invert&&(t.invert=function(n,i){return n=e.invert(n,i),n&&r.invert(n[0],n[1])}),t}function Td(r,e){return[r>Ut?r-Oi:r<-Ut?r+Oi:r,e]}Td.invert=Td;function sC(r,e,t){return(r%=Oi)?e||t?av(lv(r),cv(e,t)):lv(r):e||t?cv(e,t):Td}function uv(r){return function(e,t){return e+=r,[e>Ut?e-Oi:e<-Ut?e+Oi:e,t]}}function lv(r){var e=uv(r);return e.invert=uv(-r),e}function cv(r,e){var t=me(r),n=ve(r),i=me(e),s=ve(e);function o(a,u){var l=me(u),c=me(a)*l,h=ve(a)*l,f=ve(u),p=f*t+c*n;return[Ma(h*i-p*s,c*t-f*n),bo(p*i+h*s)]}return o.invert=function(a,u){var l=me(u),c=me(a)*l,h=ve(a)*l,f=ve(u),p=f*i-h*s;return[Ma(h*i+f*s,c*t+p*n),bo(p*t-c*n)]},o}function oC(r,e,t,n,i,s){if(t){var o=me(e),a=ve(e),u=n*t;i==null?(i=e+n*Oi,s=e-u/2):(i=hv(o,i),s=hv(o,s),(n>0?i<s:i>s)&&(i+=n*Oi));for(var l,c=i;n>0?c>s:c<s;c-=u)l=Pd([o,-a*me(c),-a*ve(c)]),r.point(l[0],l[1])}}function hv(r,e){e=La(e),e[0]-=r,xd(e);var t=rv(-e[1]);return((-e[2]<0?-t:t)+Oi-de)%Oi}function dv(){var r=[],e;return{point:function(t,n){e.push([t,n])},lineStart:function(){r.push(e=[])},lineEnd:ul,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var t=r;return r=[],e=null,t}}}function aC(r,e,t,n,i,s){var o=r[0],a=r[1],u=e[0],l=e[1],c=0,h=1,f=u-o,p=l-a,v;if(v=t-o,!(!f&&v>0)){if(v/=f,f<0){if(v<c)return;v<h&&(h=v)}else if(f>0){if(v>h)return;v>c&&(c=v)}if(v=i-o,!(!f&&v<0)){if(v/=f,f<0){if(v>h)return;v>c&&(c=v)}else if(f>0){if(v<c)return;v<h&&(h=v)}if(v=n-a,!(!p&&v>0)){if(v/=p,p<0){if(v<c)return;v<h&&(h=v)}else if(p>0){if(v>h)return;v>c&&(c=v)}if(v=s-a,!(!p&&v<0)){if(v/=p,p<0){if(v>h)return;v>c&&(c=v)}else if(p>0){if(v<c)return;v<h&&(h=v)}return c>0&&(r[0]=o+c*f,r[1]=a+c*p),h<1&&(e[0]=o+h*f,e[1]=a+h*p),!0}}}}}function Pc(r,e){return Ke(r[0]-e[0])<de&&Ke(r[1]-e[1])<de}function Ic(r,e,t,n){this.x=r,this.z=e,this.o=t,this.e=n,this.v=!1,this.n=this.p=null}function fv(r,e,t,n,i){var s=[],o=[],a,u;if(r.forEach(function(v){if(!((C=v.length-1)<=0)){var C,S=v[0],P=v[C],y;if(Pc(S,P)){for(i.lineStart(),a=0;a<C;++a)i.point((S=v[a])[0],S[1]);i.lineEnd();return}s.push(y=new Ic(S,v,null,!0)),o.push(y.o=new Ic(S,null,y,!1)),s.push(y=new Ic(P,v,null,!1)),o.push(y.o=new Ic(P,null,y,!0))}}),!!s.length){for(o.sort(e),pv(s),pv(o),a=0,u=o.length;a<u;++a)o[a].e=t=!t;for(var l=s[0],c,h;;){for(var f=l,p=!0;f.v;)if((f=f.n)===l)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(a=0,u=c.length;a<u;++a)i.point((h=c[a])[0],h[1]);else n(f.x,f.n.x,1,i);f=f.n}else{if(p)for(c=f.p.z,a=c.length-1;a>=0;--a)i.point((h=c[a])[0],h[1]);else n(f.x,f.p.x,-1,i);f=f.p}f=f.o,c=f.z,p=!p}while(!f.v);i.lineEnd()}}}function pv(r){if(e=r.length){for(var e,t=0,n=r[0],i;++t<e;)n.n=i=r[t],i.p=n,n=i;n.n=i=r[0],i.p=n}}function gv(r,e){return r<e?-1:r>e?1:r>=e?0:NaN}function uC(r){return r.length===1&&(r=lC(r)),{left:function(e,t,n,i){for(n==null&&(n=0),i==null&&(i=e.length);n<i;){var s=n+i>>>1;r(e[s],t)<0?n=s+1:i=s}return n},right:function(e,t,n,i){for(n==null&&(n=0),i==null&&(i=e.length);n<i;){var s=n+i>>>1;r(e[s],t)>0?i=s:n=s+1}return n}}}function lC(r){return function(e,t){return gv(r(e),t)}}uC(gv);function mv(r){for(var e=r.length,t,n=-1,i=0,s,o;++n<e;)i+=r[n].length;for(s=new Array(i);--e>=0;)for(o=r[e],t=o.length;--t>=0;)s[--i]=o[t];return s}var xc=1e9,Tc=-1e9;function cC(r,e,t,n){function i(l,c){return r<=l&&l<=t&&e<=c&&c<=n}function s(l,c,h,f){var p=0,v=0;if(l==null||(p=o(l,h))!==(v=o(c,h))||u(l,c)<0^h>0)do f.point(p===0||p===3?r:t,p>1?n:e);while((p=(p+h+4)%4)!==v);else f.point(c[0],c[1])}function o(l,c){return Ke(l[0]-r)<de?c>0?0:3:Ke(l[0]-t)<de?c>0?2:1:Ke(l[1]-e)<de?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var h=o(l,1),f=o(c,1);return h!==f?h-f:h===0?c[1]-l[1]:h===1?l[0]-c[0]:h===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,h=dv(),f,p,v,C,S,P,y,_,m,w,E,b={point:I,lineStart:N,lineEnd:L,polygonStart:D,polygonEnd:x};function I(J,H){i(J,H)&&c.point(J,H)}function T(){for(var J=0,H=0,Z=p.length;H<Z;++H)for(var ct=p[H],mt=1,Y=ct.length,$=ct[0],K,Et,kt=$[0],Nt=$[1];mt<Y;++mt)K=kt,Et=Nt,$=ct[mt],kt=$[0],Nt=$[1],Et<=n?Nt>n&&(kt-K)*(n-Et)>(Nt-Et)*(r-K)&&++J:Nt<=n&&(kt-K)*(n-Et)<(Nt-Et)*(r-K)&&--J;return J}function D(){c=h,f=[],p=[],E=!0}function x(){var J=T(),H=E&&J,Z=(f=mv(f)).length;(H||Z)&&(l.polygonStart(),H&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),Z&&fv(f,a,J,s,l),l.polygonEnd()),c=l,f=p=v=null}function N(){b.point=A,p&&p.push(v=[]),w=!0,m=!1,y=_=NaN}function L(){f&&(A(C,S),P&&m&&h.rejoin(),f.push(h.result())),b.point=I,m&&c.lineEnd()}function A(J,H){var Z=i(J,H);if(p&&v.push([J,H]),w)C=J,S=H,P=Z,w=!1,Z&&(c.lineStart(),c.point(J,H));else if(Z&&m)c.point(J,H);else{var ct=[y=Math.max(Tc,Math.min(xc,y)),_=Math.max(Tc,Math.min(xc,_))],mt=[J=Math.max(Tc,Math.min(xc,J)),H=Math.max(Tc,Math.min(xc,H))];aC(ct,mt,r,e,t,n)?(m||(c.lineStart(),c.point(ct[0],ct[1])),c.point(mt[0],mt[1]),Z||c.lineEnd(),E=!1):Z&&(c.lineStart(),c.point(J,H),E=!1)}y=J,_=H,m=Z}return b}}var Od=Fs();function hC(r,e){var t=e[0],n=e[1],i=[ve(t),-me(t),0],s=0,o=0;Od.reset();for(var a=0,u=r.length;a<u;++a)if(c=(l=r[a]).length)for(var l,c,h=l[c-1],f=h[0],p=h[1]/2+nv,v=ve(p),C=me(p),S=0;S<c;++S,f=y,v=m,C=w,h=P){var P=l[S],y=P[0],_=P[1]/2+nv,m=ve(_),w=me(_),E=y-f,b=E>=0?1:-1,I=b*E,T=I>Ut,D=v*m;if(Od.add(Ma(D*b*ve(I),C*w+D*me(I))),s+=T?E+b*Oi:E,T^f>=t^y>=t){var x=Sc(La(h),La(P));xd(x);var N=Sc(i,x);xd(N);var L=(T^E>=0?-1:1)*bo(N[2]);(n>L||n===L&&(x[0]||x[1]))&&(o+=T^E>=0?1:-1)}}return(s<-1e-6||s<de&&Od<-1e-6)^o&1}Fs();function vv(r){return r}Fs(),Fs();var Fa=1/0,Oc=Fa,ll=-Fa,Nc=ll,yv={point:dC,lineStart:ul,lineEnd:ul,polygonStart:ul,polygonEnd:ul,result:function(){var r=[[Fa,Oc],[ll,Nc]];return ll=Nc=-(Oc=Fa=1/0),r}};function dC(r,e){r<Fa&&(Fa=r),r>ll&&(ll=r),e<Oc&&(Oc=e),e>Nc&&(Nc=e)}Fs();function _v(r,e,t,n){return function(i,s){var o=e(s),a=i.invert(n[0],n[1]),u=dv(),l=e(u),c=!1,h,f,p,v={point:C,lineStart:P,lineEnd:y,polygonStart:function(){v.point=_,v.lineStart=m,v.lineEnd=w,f=[],h=[]},polygonEnd:function(){v.point=C,v.lineStart=P,v.lineEnd=y,f=mv(f);var E=hC(h,a);f.length?(c||(s.polygonStart(),c=!0),fv(f,pC,E,t,s)):E&&(c||(s.polygonStart(),c=!0),s.lineStart(),t(null,null,1,s),s.lineEnd()),c&&(s.polygonEnd(),c=!1),f=h=null},sphere:function(){s.polygonStart(),s.lineStart(),t(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function C(E,b){var I=i(E,b);r(E=I[0],b=I[1])&&s.point(E,b)}function S(E,b){var I=i(E,b);o.point(I[0],I[1])}function P(){v.point=S,o.lineStart()}function y(){v.point=C,o.lineEnd()}function _(E,b){p.push([E,b]);var I=i(E,b);l.point(I[0],I[1])}function m(){l.lineStart(),p=[]}function w(){_(p[0][0],p[0][1]),l.lineEnd();var E=l.clean(),b=u.result(),I,T=b.length,D,x,N;if(p.pop(),h.push(p),p=null,!!T){if(E&1){if(x=b[0],(D=x.length-1)>0){for(c||(s.polygonStart(),c=!0),s.lineStart(),I=0;I<D;++I)s.point((N=x[I])[0],N[1]);s.lineEnd()}return}T>1&&E&2&&b.push(b.pop().concat(b.shift())),f.push(b.filter(fC))}}return v}}function fC(r){return r.length>1}function pC(r,e){return((r=r.x)[0]<0?r[1]-Ti-de:Ti-r[1])-((e=e.x)[0]<0?e[1]-Ti-de:Ti-e[1])}const wv=_v(function(){return!0},gC,vC,[-Ut,-Ti]);function gC(r){var e=NaN,t=NaN,n=NaN,i;return{lineStart:function(){r.lineStart(),i=1},point:function(s,o){var a=s>0?Ut:-Ut,u=Ke(s-e);Ke(u-Ut)<de?(r.point(e,t=(t+o)/2>0?Ti:-Ti),r.point(n,t),r.lineEnd(),r.lineStart(),r.point(a,t),r.point(s,t),i=0):n!==a&&u>=Ut&&(Ke(e-n)<de&&(e-=n*de),Ke(s-a)<de&&(s-=a*de),t=mC(e,t,s,o),r.point(n,t),r.lineEnd(),r.lineStart(),r.point(a,t),i=0),r.point(e=s,t=o),n=a},lineEnd:function(){r.lineEnd(),e=t=NaN},clean:function(){return 2-i}}}function mC(r,e,t,n){var i,s,o=ve(r-t);return Ke(o)>de?rC((ve(e)*(s=me(n))*ve(t)-ve(n)*(i=me(e))*ve(r))/(i*s*o)):(e+n)/2}function vC(r,e,t,n){var i;if(r==null)i=t*Ti,n.point(-Ut,i),n.point(0,i),n.point(Ut,i),n.point(Ut,0),n.point(Ut,-i),n.point(0,-i),n.point(-Ut,-i),n.point(-Ut,0),n.point(-Ut,i);else if(Ke(r[0]-e[0])>de){var s=r[0]<e[0]?Ut:-Ut;i=t*s/2,n.point(-s,i),n.point(0,i),n.point(s,i)}else n.point(e[0],e[1])}function yC(r,e){var t=me(r),n=t>0,i=Ke(t)>de;function s(c,h,f,p){oC(p,r,e,f,c,h)}function o(c,h){return me(c)*me(h)>t}function a(c){var h,f,p,v,C;return{lineStart:function(){v=p=!1,C=1},point:function(S,P){var y=[S,P],_,m=o(S,P),w=n?m?0:l(S,P):m?l(S+(S<0?Ut:-Ut),P):0;if(!h&&(v=p=m)&&c.lineStart(),m!==p&&(_=u(h,y),(!_||Pc(h,_)||Pc(y,_))&&(y[0]+=de,y[1]+=de,m=o(y[0],y[1]))),m!==p)C=0,m?(c.lineStart(),_=u(y,h),c.point(_[0],_[1])):(_=u(h,y),c.point(_[0],_[1]),c.lineEnd()),h=_;else if(i&&h&&n^m){var E;!(w&f)&&(E=u(y,h,!0))&&(C=0,n?(c.lineStart(),c.point(E[0][0],E[0][1]),c.point(E[1][0],E[1][1]),c.lineEnd()):(c.point(E[1][0],E[1][1]),c.lineEnd(),c.lineStart(),c.point(E[0][0],E[0][1])))}m&&(!h||!Pc(h,y))&&c.point(y[0],y[1]),h=y,p=m,f=w},lineEnd:function(){p&&c.lineEnd(),h=null},clean:function(){return C|(v&&p)<<1}}}function u(c,h,f){var p=La(c),v=La(h),C=[1,0,0],S=Sc(p,v),P=Cc(S,S),y=S[0],_=P-y*y;if(!_)return!f&&c;var m=t*P/_,w=-t*y/_,E=Sc(C,S),b=bc(C,m),I=bc(S,w);Id(b,I);var T=E,D=Cc(b,T),x=Cc(T,T),N=D*D-x*(Cc(b,b)-1);if(!(N<0)){var L=Ra(N),A=bc(T,(-D-L)/x);if(Id(A,b),A=Pd(A),!f)return A;var J=c[0],H=h[0],Z=c[1],ct=h[1],mt;H<J&&(mt=J,J=H,H=mt);var Y=H-J,$=Ke(Y-Ut)<de,K=$||Y<de;if(!$&&ct<Z&&(mt=Z,Z=ct,ct=mt),K?$?Z+ct>0^A[1]<(Ke(A[0]-J)<de?Z:ct):Z<=A[1]&&A[1]<=ct:Y>Ut^(J<=A[0]&&A[0]<=H)){var Et=bc(T,(-D+L)/x);return Id(Et,b),[A,Pd(Et)]}}}function l(c,h){var f=n?r:Ut-r,p=0;return c<-f?p|=1:c>f&&(p|=2),h<-f?p|=4:h>f&&(p|=8),p}return _v(o,a,s,n?[0,-r]:[-Ut,r-Ut])}function Ev(r){return function(e){var t=new Nd;for(var n in r)t[n]=r[n];return t.stream=e,t}}function Nd(){}Nd.prototype={constructor:Nd,point:function(r,e){this.stream.point(r,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Cv(r,e,t){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],s=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),s!=null&&r.clipExtent(null),iC(t,r.stream(yv));var o=yv.result(),a=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),u=+e[0][0]+(n-a*(o[1][0]+o[0][0]))/2,l=+e[0][1]+(i-a*(o[1][1]+o[0][1]))/2;return s!=null&&r.clipExtent(s),r.scale(a*150).translate([u,l])}function _C(r,e,t){return Cv(r,[[0,0],e],t)}var Sv=16,wC=me(30*Ir);function bv(r,e){return+e?CC(r,e):EC(r)}function EC(r){return Ev({point:function(e,t){e=r(e,t),this.stream.point(e[0],e[1])}})}function CC(r,e){function t(n,i,s,o,a,u,l,c,h,f,p,v,C,S){var P=l-n,y=c-i,_=P*P+y*y;if(_>4*e&&C--){var m=o+f,w=a+p,E=u+v,b=Ra(m*m+w*w+E*E),I=bo(E/=b),T=Ke(Ke(E)-1)<de||Ke(s-h)<de?(s+h)/2:Ma(w,m),D=r(T,I),x=D[0],N=D[1],L=x-n,A=N-i,J=y*L-P*A;(J*J/_>e||Ke((P*L+y*A)/_-.5)>.3||o*f+a*p+u*v<wC)&&(t(n,i,s,o,a,u,x,N,T,m/=b,w/=b,E,C,S),S.point(x,N),t(x,N,T,m,w,E,l,c,h,f,p,v,C,S))}}return function(n){var i,s,o,a,u,l,c,h,f,p,v,C,S={point:P,lineStart:y,lineEnd:m,polygonStart:function(){n.polygonStart(),S.lineStart=w},polygonEnd:function(){n.polygonEnd(),S.lineStart=y}};function P(I,T){I=r(I,T),n.point(I[0],I[1])}function y(){h=NaN,S.point=_,n.lineStart()}function _(I,T){var D=La([I,T]),x=r(I,T);t(h,f,c,p,v,C,h=x[0],f=x[1],c=I,p=D[0],v=D[1],C=D[2],Sv,n),n.point(h,f)}function m(){S.point=P,n.lineEnd()}function w(){y(),S.point=E,S.lineEnd=b}function E(I,T){_(i=I,T),s=h,o=f,a=p,u=v,l=C,S.point=_}function b(){t(h,f,c,p,v,C,s,o,i,a,u,l,Sv,n),S.lineEnd=m,m()}return S}}var SC=Ev({point:function(r,e){this.stream.point(r*Ir,e*Ir)}});function bC(r){return PC(function(){return r})()}function PC(r){var e,t=150,n=480,i=250,s,o,a=0,u=0,l=0,c=0,h=0,f,p,v=null,C=wv,S=null,P,y,_,m=vv,w=.5,E=bv(x,w),b,I;function T(A){return A=p(A[0]*Ir,A[1]*Ir),[A[0]*t+s,o-A[1]*t]}function D(A){return A=p.invert((A[0]-s)/t,(o-A[1])/t),A&&[A[0]*As,A[1]*As]}function x(A,J){return A=e(A,J),[A[0]*t+s,o-A[1]*t]}T.stream=function(A){return b&&I===A?b:b=SC(C(f,E(m(I=A))))},T.clipAngle=function(A){return arguments.length?(C=+A?yC(v=A*Ir,6*Ir):(v=null,wv),L()):v*As},T.clipExtent=function(A){return arguments.length?(m=A==null?(S=P=y=_=null,vv):cC(S=+A[0][0],P=+A[0][1],y=+A[1][0],_=+A[1][1]),L()):S==null?null:[[S,P],[y,_]]},T.scale=function(A){return arguments.length?(t=+A,N()):t},T.translate=function(A){return arguments.length?(n=+A[0],i=+A[1],N()):[n,i]},T.center=function(A){return arguments.length?(a=A[0]%360*Ir,u=A[1]%360*Ir,N()):[a*As,u*As]},T.rotate=function(A){return arguments.length?(l=A[0]%360*Ir,c=A[1]%360*Ir,h=A.length>2?A[2]%360*Ir:0,N()):[l*As,c*As,h*As]},T.precision=function(A){return arguments.length?(E=bv(x,w=A*A),L()):Ra(w)},T.fitExtent=function(A,J){return Cv(T,A,J)},T.fitSize=function(A,J){return _C(T,A,J)};function N(){p=av(f=sC(l,c,h),e);var A=e(a,u);return s=n-A[0]*t,o=i+A[1]*t,L()}function L(){return b=I=null,T}return function(){return e=r.apply(this,arguments),T.invert=e.invert&&D,N()}}function Pv(r){return function(e,t){var n=me(e),i=me(t),s=r(n*i);return[s*i*ve(e),s*ve(t)]}}function Iv(r){return function(e,t){var n=Ra(e*e+t*t),i=r(n),s=ve(i),o=me(i);return[Ma(e*s,n*o),bo(n&&t*s/n)]}}var IC=Pv(function(r){return Ra(2/(1+r))});IC.invert=Iv(function(r){return 2*bo(r/2)});var xv=Pv(function(r){return(r=rv(r))&&r/ve(r)});xv.invert=Iv(function(r){return r});function xC(){return bC(xv).scale(79.4188).clipAngle(180-.001)}function Tv(r,e){return[r,e]}Tv.invert=Tv;function TC(r,e,t){t=t||{};var n=t.units||"kilometers",i=t.steps||8;if(!r)throw new Error("geojson is required");if(typeof t!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(e===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var s=[];switch(r.type){case"GeometryCollection":return $l(r,function(o){var a=Dc(o,e,n,i);a&&s.push(a)}),oa(s);case"FeatureCollection":return Jl(r,function(o){var a=Dc(o,e,n,i);a&&Jl(a,function(u){u&&s.push(u)})}),oa(s)}return Dc(r,e,n,i)}function Dc(r,e,t,n){var i=r.properties||{},s=r.type==="Feature"?r.geometry:r;if(s.type==="GeometryCollection"){var o=[];return $l(r,function(C){var S=Dc(C,e,t,n);S&&o.push(S)}),oa(o)}var a=OC(s),u={type:s.type,coordinates:Nv(s.coordinates,a)},l=new pd,c=l.read(u),h=Jh($h(e,t),"meters"),f=Ne.bufferOp(c,h,n),p=new Fm;if(f=p.write(f),!Ov(f.coordinates)){var v={type:f.type,coordinates:Dv(f.coordinates,a)};return jr(v,i)}}function Ov(r){return Array.isArray(r[0])?Ov(r[0]):isNaN(r[0])}function Nv(r,e){return typeof r[0]!="object"?e(r):r.map(function(t){return Nv(t,e)})}function Dv(r,e){return typeof r[0]!="object"?e.invert(r):r.map(function(t){return Dv(t,e)})}function OC(r){var e=jE(r).geometry.coordinates,t=[-e[0],-e[1]];return xC().rotate(t).scale(tn)}function NC(r,e,t){t===void 0&&(t={});for(var n=t.steps||64,i=t.properties?t.properties:!Array.isArray(r)&&r.type==="Feature"&&r.properties?r.properties:{},s=[],o=0;o<n;o++)s.push(aa(r,e,o*-360/n,t).geometry.coordinates);return s.push(s[0]),Pn([s],i)}/**
44
+ `)}return e.toString()},je.prototype.computeEdgeEndLabels=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();n.computeLabel(e)}},je.prototype.computeLabelling=function(e){var t=this;this.computeEdgeEndLabels(e[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],i=this.iterator();i.hasNext();)for(var s=i.next(),o=s.getLabel(),a=0;a<2;a++)o.isLine(a)&&o.getLocation(a)===F.BOUNDARY&&(n[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),c=l.getLabel(),h=0;h<2;h++)if(c.isAnyNull(h)){var f=F.NONE;if(n[h])f=F.EXTERIOR;else{var p=l.getCoordinate();f=t.getLocation(h,p,e)}c.setAllLocationsIfNull(h,f)}},je.prototype.getDegree=function(){return this._edgeMap.size()},je.prototype.insertEdgeEnd=function(e,t){this._edgeMap.put(e,t),this._edgeList=null},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var tC=function(r){function e(){r.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var i=null,s=null,o=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=n._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),o){case n._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;s=l,o=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(!u.isInResult())continue;s.setNext(u),o=n._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(i===null)throw new Si("no outgoing dirEdge found",this.getCoordinate());yt.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),s.setNext(i)}},e.prototype.insert=function(n){var i=n;this.insertEdgeEnd(i,i)},e.prototype.getRightmostEdge=function(){var n=this.getEdges(),i=n.size();if(i<1)return null;var s=n.get(0);if(i===1)return s;var o=n.get(i-1),a=s.getQuadrant(),u=o.getQuadrant();return Bt.isNorthern(a)&&Bt.isNorthern(u)?s:!Bt.isNorthern(a)&&!Bt.isNorthern(u)?o:s.getDy()!==0?s:o.getDy()!==0?o:(yt.shouldNeverReachHere("found two horizontal edges incident on node"),null)},e.prototype.print=function(n){Te.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var s=i.next();n.print("out "),s.print(n),n.println(),n.print("in "),s.getSym().print(n),n.println()}},e.prototype.getResultAreaEdges=function(){var n=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new W;for(var i=this.iterator();i.hasNext();){var s=i.next();(s.isInResult()||s.getSym().isInResult())&&n._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(n){for(var i=this.iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.setAllLocationsIfNull(0,n.getLocation(0)),o.setAllLocationsIfNull(1,n.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){var n=this;this.getEdges();for(var i=null,s=null,o=this._edgeList.size()-1;o>=0;o--){var a=n._edgeList.get(o),u=a.getSym();s===null&&(s=u),i!==null&&u.setNext(i),i=a}s.setNext(i)},e.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var i=arguments[0],s=this.findIndex(i),o=i.getDepth(U.LEFT),a=i.getDepth(U.RIGHT),u=this.computeDepths(s+1,this._edgeList.size(),o),l=this.computeDepths(0,s,u);if(l!==a)throw new Si("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],h=arguments[1],f=arguments[2],p=f,v=c;v<h;v++){var C=n._edgeList.get(v);C.setEdgeDepths(U.RIGHT,p),p=C.getDepth(U.LEFT)}return p}},e.prototype.mergeSymLabels=function(){for(var n=this.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();s.merge(i.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(n){for(var i=this,s=null,o=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),c=l.getSym();switch(s===null&&l.getEdgeRing()===n&&(s=l),a){case i._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==n)continue;o=c,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==n)continue;o.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(yt.isTrue(s!==null,"found null for first outgoing dirEdge"),yt.isTrue(s.getEdgeRing()===n,"unable to link last incoming dirEdge"),o.setNextMin(s))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,i=this.iterator();i.hasNext();){var s=i.next();s.isInResult()&&n++}return n}else if(arguments.length===1){for(var o=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===o&&a++}return a}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var n=F.NONE,i=this.iterator();i.hasNext();){var s=i.next(),o=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){n=F.INTERIOR;break}if(o.isInResult()){n=F.EXTERIOR;break}}}if(n===F.NONE)return null;for(var a=n,u=this.iterator();u.hasNext();){var l=u.next(),c=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===F.INTERIOR):(l.isInResult()&&(a=F.EXTERIOR),c.isInResult()&&(a=F.INTERIOR))}},e.prototype.computeLabelling=function(n){var i=this;r.prototype.computeLabelling.call(this,n),this._label=new jt(F.NONE);for(var s=this.iterator();s.hasNext();)for(var o=s.next(),a=o.getEdge(),u=a.getLabel(),l=0;l<2;l++){var c=u.getLocation(l);(c===F.INTERIOR||c===F.BOUNDARY)&&i._label.setLocation(l,F.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(je),Gm=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.createNode=function(n){return new pc(n,new tC)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ea),Qi=function r(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=r.orientation(e)};Qi.prototype.compareTo=function(e){var t=e,n=Qi.compareOriented(this._pts,this._orientation,t._pts,t._orientation);return n},Qi.prototype.interfaces_=function(){return[An]},Qi.prototype.getClass=function(){return Qi},Qi.orientation=function(e){return Ct.increasingDirection(e)===1},Qi.compareOriented=function(e,t,n,i){for(var s=t?1:-1,o=i?1:-1,a=t?e.length:-1,u=i?n.length:-1,l=t?0:e.length-1,c=i?0:n.length-1;;){var h=e[l].compareTo(n[c]);if(h!==0)return h;l+=s,c+=o;var f=l===a,p=c===u;if(f&&!p)return-1;if(!f&&p)return 1;if(f&&p)return 0}};var ir=function(){this._edges=new W,this._ocaMap=new ke};ir.prototype.print=function(e){var t=this;e.print("MULTILINESTRING ( ");for(var n=0;n<this._edges.size();n++){var i=t._edges.get(n);n>0&&e.print(","),e.print("(");for(var s=i.getCoordinates(),o=0;o<s.length;o++)o>0&&e.print(","),e.print(s[o].x+" "+s[o].y);e.println(")")}e.print(") ")},ir.prototype.addAll=function(e){for(var t=this,n=e.iterator();n.hasNext();)t.add(n.next())},ir.prototype.findEdgeIndex=function(e){for(var t=this,n=0;n<this._edges.size();n++)if(t._edges.get(n).equals(e))return n;return-1},ir.prototype.iterator=function(){return this._edges.iterator()},ir.prototype.getEdges=function(){return this._edges},ir.prototype.get=function(e){return this._edges.get(e)},ir.prototype.findEqualEdge=function(e){var t=new Qi(e.getCoordinates()),n=this._ocaMap.get(t);return n},ir.prototype.add=function(e){this._edges.add(e);var t=new Qi(e.getCoordinates());this._ocaMap.put(t,e)},ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir};var Ts=function(){};Ts.prototype.processIntersections=function(e,t,n,i){},Ts.prototype.isDone=function(){},Ts.prototype.interfaces_=function(){return[]},Ts.prototype.getClass=function(){return Ts};var Dn=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var e=arguments[0];this._li=e};Dn.prototype.isTrivialIntersection=function(e,t,n,i){if(e===n&&this._li.getIntersectionNum()===1){if(Dn.isAdjacentSegments(t,i))return!0;if(e.isClosed()){var s=e.size()-1;if(t===0&&i===s||i===0&&t===s)return!0}}return!1},Dn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Dn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Dn.prototype.getLineIntersector=function(){return this._li},Dn.prototype.hasProperIntersection=function(){return this._hasProper},Dn.prototype.processIntersections=function(e,t,n,i){if(e===n&&t===i)return null;this.numTests++;var s=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(e,t,n,i)||(this._hasIntersection=!0,e.addIntersections(this._li,t,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Dn.prototype.hasIntersection=function(){return this._hasIntersection},Dn.prototype.isDone=function(){return!1},Dn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Dn.prototype.interfaces_=function(){return[Ts]},Dn.prototype.getClass=function(){return Dn},Dn.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var Er=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var e=arguments[0],t=arguments[1],n=arguments[2];this.coord=new R(e),this.segmentIndex=t,this.dist=n};Er.prototype.getSegmentIndex=function(){return this.segmentIndex},Er.prototype.getCoordinate=function(){return this.coord},Er.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex),e.println(" dist = "+this.dist)},Er.prototype.compareTo=function(e){var t=e;return this.compare(t.segmentIndex,t.dist)},Er.prototype.isEndPoint=function(e){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===e},Er.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Er.prototype.getDistance=function(){return this.dist},Er.prototype.compare=function(e,t){return this.segmentIndex<e?-1:this.segmentIndex>e?1:this.dist<t?-1:this.dist>t?1:0},Er.prototype.interfaces_=function(){return[An]},Er.prototype.getClass=function(){return Er};var $r=function(){this._nodeMap=new ke,this.edge=null;var e=arguments[0];this.edge=e};$r.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},$r.prototype.iterator=function(){return this._nodeMap.values().iterator()},$r.prototype.addSplitEdges=function(e){var t=this;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next(),o=t.createSplitEdge(i,s);e.add(o),i=s}},$r.prototype.addEndpoints=function(){var e=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[e],e,0)},$r.prototype.createSplitEdge=function(e,t){var n=this,i=t.segmentIndex-e.segmentIndex+2,s=this.edge.pts[t.segmentIndex],o=t.dist>0||!t.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new R(e.coord);for(var l=e.segmentIndex+1;l<=t.segmentIndex;l++)a[u++]=n.edge.pts[l];return o&&(a[u]=t.coord),new mc(a,new jt(this.edge._label))},$r.prototype.add=function(e,t,n){var i=new Er(e,t,n),s=this._nodeMap.get(i);return s!==null?s:(this._nodeMap.put(i,i),i)},$r.prototype.isIntersection=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();if(n.coord.equals(e))return!0}return!1},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r};var Os=function(){};Os.prototype.getChainStartIndices=function(e){var t=this,n=0,i=new W;i.add(new cr(n));do{var s=t.findChainEnd(e,n);i.add(new cr(s)),n=s}while(n<e.length-1);var o=Os.toIntArray(i);return o},Os.prototype.findChainEnd=function(e,t){for(var n=Bt.quadrant(e[t],e[t+1]),i=t+1;i<e.length;){var s=Bt.quadrant(e[i-1],e[i]);if(s!==n)break;i++}return i-1},Os.prototype.interfaces_=function(){return[]},Os.prototype.getClass=function(){return Os},Os.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),n=0;n<t.length;n++)t[n]=e.get(n).intValue();return t};var Ii=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Q,this.env2=new Q;var e=arguments[0];this.e=e,this.pts=e.getCoordinates();var t=new Os;this.startIndex=t.getChainStartIndices(this.pts)};Ii.prototype.getCoordinates=function(){return this.pts},Ii.prototype.getMaxX=function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return t>n?t:n},Ii.prototype.getMinX=function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return t<n?t:n},Ii.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[e],this.startIndex[e+1],t,t.startIndex[n],t.startIndex[n+1],i)}else if(arguments.length===6){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5],h=this.pts[s],f=this.pts[o],p=a.pts[u],v=a.pts[l];if(o-s===1&&l-u===1)return c.addIntersections(this.e,s,a.e,u),null;if(this.env1.init(h,f),this.env2.init(p,v),!this.env1.intersects(this.env2))return null;var C=Math.trunc((s+o)/2),S=Math.trunc((u+l)/2);s<C&&(u<S&&this.computeIntersectsForChain(s,C,a,u,S,c),S<l&&this.computeIntersectsForChain(s,C,a,S,l,c)),C<o&&(u<S&&this.computeIntersectsForChain(C,o,a,u,S,c),S<l&&this.computeIntersectsForChain(C,o,a,S,l,c))}},Ii.prototype.getStartIndexes=function(){return this.startIndex},Ii.prototype.computeIntersects=function(e,t){for(var n=this,i=0;i<this.startIndex.length-1;i++)for(var s=0;s<e.startIndex.length-1;s++)n.computeIntersectsForChain(i,e,s,t)},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var Oe=function r(){var e=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var t=0;t<2;t++)for(var n=0;n<3;n++)e._depth[t][n]=r.NULL_VALUE},Wm={NULL_VALUE:{configurable:!0}};Oe.prototype.getDepth=function(e,t){return this._depth[e][t]},Oe.prototype.setDepth=function(e,t,n){this._depth[e][t]=n},Oe.prototype.isNull=function(){var e=this;if(arguments.length===0){for(var t=0;t<2;t++)for(var n=0;n<3;n++)if(e._depth[t][n]!==Oe.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===Oe.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._depth[s][o]===Oe.NULL_VALUE}},Oe.prototype.normalize=function(){for(var e=this,t=0;t<2;t++)if(!e.isNull(t)){var n=e._depth[t][1];e._depth[t][2]<n&&(n=e._depth[t][2]),n<0&&(n=0);for(var i=1;i<3;i++){var s=0;e._depth[t][i]>n&&(s=1),e._depth[t][i]=s}}},Oe.prototype.getDelta=function(e){return this._depth[e][U.RIGHT]-this._depth[e][U.LEFT]},Oe.prototype.getLocation=function(e,t){return this._depth[e][t]<=0?F.EXTERIOR:F.INTERIOR},Oe.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Oe.prototype.add=function(){var e=this;if(arguments.length===1)for(var t=arguments[0],n=0;n<2;n++)for(var i=1;i<3;i++){var s=t.getLocation(n,i);(s===F.EXTERIOR||s===F.INTERIOR)&&(e.isNull(n,i)?e._depth[n][i]=Oe.depthAtLocation(s):e._depth[n][i]+=Oe.depthAtLocation(s))}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];u===F.INTERIOR&&this._depth[o][a]++}},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Oe.depthAtLocation=function(e){return e===F.EXTERIOR?0:e===F.INTERIOR?1:Oe.NULL_VALUE},Wm.NULL_VALUE.get=function(){return-1},Object.defineProperties(Oe,Wm);var mc=function(r){function e(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new $r(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Oe,this._depthDelta=0,arguments.length===1){var t=arguments[0];e.call(this,t,null)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var i=new e(n,jt.toLineLabel(this._label));return i},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(n){this._isIsolated=n},e.prototype.setName=function(n){this._name=n},e.prototype.equals=function(n){var i=this;if(!(n instanceof e))return!1;var s=n;if(this.pts.length!==s.pts.length)return!1;for(var o=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(s.pts[l])||(o=!1),i.pts[l].equals2D(s.pts[--u])||(a=!1),!o&&!a)return!1;return!0},e.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},e.prototype.print=function(n){var i=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&n.print(","),n.print(i.pts[s].x+" "+i.pts[s].y);n.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(n){e.updateIM(this._label,n)},e.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(n){var i=this;n.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)n.print(i.pts[s]+" ");n.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Ii(this)),this._mce},e.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new Q;for(var i=0;i<this.pts.length;i++)n._env.expandToInclude(n.pts[i])}return this._env},e.prototype.addIntersection=function(n,i,s,o){var a=new R(n.getIntersection(o)),u=i,l=n.getEdgeDistance(s,o),c=u+1;if(c<this.pts.length){var h=this.pts[c];a.equals2D(h)&&(u=c,l=0)}this.eiList.add(a,u,l)},e.prototype.toString=function(){var n=this,i=new lr;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&i.append(","),i.append(n.pts[s].x+" "+n.pts[s].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},e.prototype.isPointwiseEqual=function(n){var i=this;if(this.pts.length!==n.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!i.pts[s].equals2D(n.pts[s]))return!1;return!0},e.prototype.setDepthDelta=function(n){this._depthDelta=n},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(n,i,s){for(var o=this,a=0;a<n.getIntersectionNum();a++)o.addIntersection(n,i,s,a)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];i.setAtLeastIfValid(n.getLocation(0,U.ON),n.getLocation(1,U.ON),1),n.isArea()&&(i.setAtLeastIfValid(n.getLocation(0,U.LEFT),n.getLocation(1,U.LEFT),2),i.setAtLeastIfValid(n.getLocation(0,U.RIGHT),n.getLocation(1,U.RIGHT),2))}else return r.prototype.updateIM.apply(this,arguments)},e}(Tn),qe=function(e){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new ir,this._bufParams=e||null};qe.prototype.setWorkingPrecisionModel=function(e){this._workingPrecisionModel=e},qe.prototype.insertUniqueEdge=function(e){var t=this._edgeList.findEqualEdge(e);if(t!==null){var n=t.getLabel(),i=e.getLabel();t.isPointwiseEqual(e)||(i=new jt(e.getLabel()),i.flip()),n.merge(i);var s=qe.depthDelta(i),o=t.getDepthDelta(),a=o+s;t.setDepthDelta(a)}else this._edgeList.add(e),e.setDepthDelta(qe.depthDelta(e.getLabel()))},qe.prototype.buildSubgraphs=function(e,t){for(var n=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=s.getRightmostCoordinate(),a=new mo(n),u=a.getDepth(o);s.computeDepth(u),s.findResultEdges(),n.add(s),t.add(s.getDirectedEdges(),s.getNodes())}},qe.prototype.createSubgraphs=function(e){for(var t=new W,n=e.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var s=new We;s.create(i),t.add(s)}}return rr.sort(t,rr.reverseOrder()),t},qe.prototype.createEmptyResultGeometry=function(){var e=this._geomFact.createPolygon();return e},qe.prototype.getNoder=function(e){if(this._workingNoder!==null)return this._workingNoder;var t=new md,n=new Cs;return n.setPrecisionModel(e),t.setSegmentIntersector(new Dn(n)),t},qe.prototype.buffer=function(e,t){var n=this._workingPrecisionModel;n===null&&(n=e.getPrecisionModel()),this._geomFact=e.getFactory();var i=new rn(n,this._bufParams),s=new Un(e,t,i),o=s.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,n),this._graph=new Kt(new Gm),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new fn(this._geomFact);this.buildSubgraphs(a,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var c=this._geomFact.buildGeometry(l);return c},qe.prototype.computeNodedEdges=function(e,t){var n=this,i=this.getNoder(t);i.computeNodes(e);for(var s=i.getNodedSubstrings(),o=s.iterator();o.hasNext();){var a=o.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),c=new mc(a.getCoordinates(),new jt(l));n.insertUniqueEdge(c)}}},qe.prototype.setNoder=function(e){this._workingNoder=e},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.depthDelta=function(e){var t=e.getLocation(0,U.LEFT),n=e.getLocation(0,U.RIGHT);return t===F.INTERIOR&&n===F.EXTERIOR?1:t===F.EXTERIOR&&n===F.INTERIOR?-1:0},qe.convertSegStrings=function(e){for(var t=new St,n=new W;e.hasNext();){var i=e.next(),s=t.createLineString(i.getCoordinates());n.add(s)}return t.buildGeometry(n)};var ts=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var e=arguments[0],t=arguments[1];this._noder=e,this._scaleFactor=t,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=i,this._offsetX=s,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};ts.prototype.rescale=function(){var e=this;if(at(arguments[0],fe))for(var t=arguments[0],n=t.iterator();n.hasNext();){var i=n.next();e.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var s=arguments[0],o=0;o<s.length;o++)s[o].x=s[o].x/e._scaleFactor+e._offsetX,s[o].y=s[o].y/e._scaleFactor+e._offsetY;s.length===2&&s[0].equals2D(s[1])&&Te.out.println(s)}},ts.prototype.scale=function(){var e=this;if(at(arguments[0],fe)){for(var t=arguments[0],n=new W,i=t.iterator();i.hasNext();){var s=i.next();n.add(new oe(e.scale(s.getCoordinates()),s.getData()))}return n}else if(arguments[0]instanceof Array){for(var o=arguments[0],a=new Array(o.length).fill(null),u=0;u<o.length;u++)a[u]=new R(Math.round((o[u].x-e._offsetX)*e._scaleFactor),Math.round((o[u].y-e._offsetY)*e._scaleFactor),o[u].z);var l=Ct.removeRepeatedPoints(a);return l}},ts.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},ts.prototype.getNodedSubstrings=function(){var e=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(e),e},ts.prototype.computeNodes=function(e){var t=e;this._isScaled&&(t=this.scale(e)),this._noder.computeNodes(t)},ts.prototype.interfaces_=function(){return[Is]},ts.prototype.getClass=function(){return ts};var Cr=function(){this._li=new Cs,this._segStrings=null;var e=arguments[0];this._segStrings=e},Hm={fact:{configurable:!0}};Cr.prototype.checkEndPtVertexIntersections=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var n=t.next(),i=n.getCoordinates();e.checkEndPtVertexIntersections(i[0],e._segStrings),e.checkEndPtVertexIntersections(i[i.length-1],e._segStrings)}else if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=o.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),c=1;c<l.length-1;c++)if(l[c].equals(s))throw new vi("found endpt/interior pt intersection at index "+c+" :pt "+s)}},Cr.prototype.checkInteriorIntersections=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();)for(var n=t.next(),i=this._segStrings.iterator();i.hasNext();){var s=i.next();e.checkInteriorIntersections(n,s)}else if(arguments.length===2)for(var o=arguments[0],a=arguments[1],u=o.getCoordinates(),l=a.getCoordinates(),c=0;c<u.length-1;c++)for(var h=0;h<l.length-1;h++)e.checkInteriorIntersections(o,c,a,h);else if(arguments.length===4){var f=arguments[0],p=arguments[1],v=arguments[2],C=arguments[3];if(f===v&&p===C)return null;var S=f.getCoordinates()[p],P=f.getCoordinates()[p+1],y=v.getCoordinates()[C],_=v.getCoordinates()[C+1];if(this._li.computeIntersection(S,P,y,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,S,P)||this.hasInteriorIntersection(this._li,y,_)))throw new vi("found non-noded intersection at "+S+"-"+P+" and "+y+"-"+_)}},Cr.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Cr.prototype.checkCollapses=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var n=t.next();e.checkCollapses(n)}else if(arguments.length===1)for(var i=arguments[0],s=i.getCoordinates(),o=0;o<s.length-2;o++)e.checkCollapse(s[o],s[o+1],s[o+2])},Cr.prototype.hasInteriorIntersection=function(e,t,n){for(var i=0;i<e.getIntersectionNum();i++){var s=e.getIntersection(i);if(!(s.equals(t)||s.equals(n)))return!0}return!1},Cr.prototype.checkCollapse=function(e,t,n){if(e.equals(n))throw new vi("found non-noded collapse at "+Cr.fact.createLineString([e,t,n]))},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Hm.fact.get=function(){return new St},Object.defineProperties(Cr,Hm);var sn=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var e=arguments[0],t=arguments[1],n=arguments[2];if(this._originalPt=e,this._pt=e,this._scaleFactor=t,this._li=n,t<=0)throw new Yt("Scale factor must be non-zero");t!==1&&(this._pt=new R(this.scale(e.x),this.scale(e.y)),this._p0Scaled=new R,this._p1Scaled=new R),this.initCorners(this._pt)},qm={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};sn.prototype.intersectsScaled=function(e,t){var n=Math.min(e.x,t.x),i=Math.max(e.x,t.x),s=Math.min(e.y,t.y),o=Math.max(e.y,t.y),a=this._maxx<n||this._minx>i||this._maxy<s||this._miny>o;if(a)return!1;var u=this.intersectsToleranceSquare(e,t);return yt.isTrue(!(a&&u),"Found bad envelope test"),u},sn.prototype.initCorners=function(e){var t=.5;this._minx=e.x-t,this._maxx=e.x+t,this._miny=e.y-t,this._maxy=e.y+t,this._corner[0]=new R(this._maxx,this._maxy),this._corner[1]=new R(this._minx,this._maxy),this._corner[2]=new R(this._minx,this._miny),this._corner[3]=new R(this._maxx,this._miny)},sn.prototype.intersects=function(e,t){return this._scaleFactor===1?this.intersectsScaled(e,t):(this.copyScaled(e,this._p0Scaled),this.copyScaled(t,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},sn.prototype.scale=function(e){return Math.round(e*this._scaleFactor)},sn.prototype.getCoordinate=function(){return this._originalPt},sn.prototype.copyScaled=function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)},sn.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var e=sn.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Q(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv},sn.prototype.intersectsPixelClosure=function(e,t){return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.hasIntersection()))},sn.prototype.intersectsToleranceSquare=function(e,t){var n=!1,i=!1;return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.isProper())||n&&i||e.equals(this._pt)||t.equals(this._pt))},sn.prototype.addSnappedNode=function(e,t){var n=e.getCoordinate(t),i=e.getCoordinate(t+1);return this.intersects(n,i)?(e.addIntersection(this.getCoordinate(),t),!0):!1},sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn},qm.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(sn,qm);var il=function(){this.tempEnv1=new Q,this.selectedSegment=new tt};il.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}},il.prototype.interfaces_=function(){return[]},il.prototype.getClass=function(){return il};var Pa=function(){this._index=null;var e=arguments[0];this._index=e},Xm={HotPixelSnapAction:{configurable:!0}};Pa.prototype.snap=function(){if(arguments.length===1){var e=arguments[0];return this.snap(e,null,-1)}else if(arguments.length===3){var t=arguments[0],n=arguments[1],i=arguments[2],s=t.getSafeEnvelope(),o=new Ym(t,n,i);return this._index.query(s,{interfaces_:function(){return[Ki]},visitItem:function(a){var u=a;u.select(s,o)}}),o.isNodeAdded()}},Pa.prototype.interfaces_=function(){return[]},Pa.prototype.getClass=function(){return Pa},Xm.HotPixelSnapAction.get=function(){return Ym},Object.defineProperties(Pa,Xm);var Ym=function(r){function e(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],n=arguments[1],i=arguments[2];this._hotPixel=t,this._parentEdge=n,this._hotPixelVertexIndex=i}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1],s=n.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,i)}else return r.prototype.select.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(il),vo=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new W};vo.prototype.processIntersections=function(e,t,n,i){var s=this;if(e===n&&t===i)return null;var o=e.getCoordinates()[t],a=e.getCoordinates()[t+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];if(this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var c=0;c<this._li.getIntersectionNum();c++)s._interiorIntersections.add(s._li.getIntersection(c));e.addIntersections(this._li,t,0),n.addIntersections(this._li,i,1)}},vo.prototype.isDone=function(){return!1},vo.prototype.getInteriorIntersections=function(){return this._interiorIntersections},vo.prototype.interfaces_=function(){return[Ts]},vo.prototype.getClass=function(){return vo};var Kr=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var e=arguments[0];this._pm=e,this._li=new Cs,this._li.setPrecisionModel(e),this._scaleFactor=e.getScale()};Kr.prototype.checkCorrectness=function(e){var t=oe.getNodedSubstrings(e),n=new Cr(t);try{n.checkValid()}catch(i){if(i instanceof xm)i.printStackTrace();else throw i}finally{}},Kr.prototype.getNodedSubstrings=function(){return oe.getNodedSubstrings(this._nodedSegStrings)},Kr.prototype.snapRound=function(e,t){var n=this.findInteriorIntersections(e,t);this.computeIntersectionSnaps(n),this.computeVertexSnaps(e)},Kr.prototype.findInteriorIntersections=function(e,t){var n=new vo(t);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(e),n.getInteriorIntersections()},Kr.prototype.computeVertexSnaps=function(){var e=this;if(at(arguments[0],fe))for(var t=arguments[0],n=t.iterator();n.hasNext();){var i=n.next();e.computeVertexSnaps(i)}else if(arguments[0]instanceof oe)for(var s=arguments[0],o=s.getCoordinates(),a=0;a<o.length;a++){var u=new sn(o[a],e._scaleFactor,e._li),l=e._pointSnapper.snap(u,s,a);l&&s.addIntersection(o[a],a)}},Kr.prototype.computeNodes=function(e){this._nodedSegStrings=e,this._noder=new md,this._pointSnapper=new Pa(this._noder.getIndex()),this.snapRound(e,this._li)},Kr.prototype.computeIntersectionSnaps=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next(),s=new sn(i,t._scaleFactor,t._li);t._pointSnapper.snap(s)}},Kr.prototype.interfaces_=function(){return[Is]},Kr.prototype.getClass=function(){return Kr};var Ne=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Ft,this._resultGeometry=null,this._saveException=null,arguments.length===1){var e=arguments[0];this._argGeom=e}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this._argGeom=t,this._bufParams=n}},Ia={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Ne.prototype.bufferFixedPrecision=function(e){var t=new ts(new Kr(new Lt(1)),e.getScale()),n=new qe(this._bufParams);n.setWorkingPrecisionModel(e),n.setNoder(t),this._resultGeometry=n.buffer(this._argGeom,this._distance)},Ne.prototype.bufferReducedPrecision=function(){var e=this;if(arguments.length===0){for(var t=Ne.MAX_PRECISION_DIGITS;t>=0;t--){try{e.bufferReducedPrecision(t)}catch(o){if(o instanceof Si)e._saveException=o;else throw o}finally{}if(e._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],i=Ne.precisionScaleFactor(this._argGeom,this._distance,n),s=new Lt(i);this.bufferFixedPrecision(s)}},Ne.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===Lt.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()},Ne.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)},Ne.prototype.bufferOriginalPrecision=function(){try{var e=new qe(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(t){if(t instanceof vi)this._saveException=t;else throw t}finally{}},Ne.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry},Ne.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ne.bufferOp=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new Ne(e),i=n.getResultGeometry(t);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ot&&typeof arguments[1]=="number"){var s=arguments[0],o=arguments[1],a=arguments[2],u=new Ne(s);u.setQuadrantSegments(a);var l=u.getResultGeometry(o);return l}else if(arguments[2]instanceof Ft&&arguments[0]instanceof ot&&typeof arguments[1]=="number"){var c=arguments[0],h=arguments[1],f=arguments[2],p=new Ne(c,f),v=p.getResultGeometry(h);return v}}else if(arguments.length===4){var C=arguments[0],S=arguments[1],P=arguments[2],y=arguments[3],_=new Ne(C);_.setQuadrantSegments(P),_.setEndCapStyle(y);var m=_.getResultGeometry(S);return m}},Ne.precisionScaleFactor=function(e,t,n){var i=e.getEnvelopeInternal(),s=xn.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=t>0?t:0,a=s+2*o,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=n-u,c=Math.pow(10,l);return c},Ia.CAP_ROUND.get=function(){return Ft.CAP_ROUND},Ia.CAP_BUTT.get=function(){return Ft.CAP_FLAT},Ia.CAP_FLAT.get=function(){return Ft.CAP_FLAT},Ia.CAP_SQUARE.get=function(){return Ft.CAP_SQUARE},Ia.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Ne,Ia);var Xe=function(){this._pt=[new R,new R],this._distance=ht.NaN,this._isNull=!0};Xe.prototype.getCoordinates=function(){return this._pt},Xe.prototype.getCoordinate=function(e){return this._pt[e]},Xe.prototype.setMinimum=function(){if(arguments.length===1){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var i=t.distance(n);i<this._distance&&this.initialize(t,n,i)}},Xe.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var e=arguments[0],t=arguments[1];this._pt[0].setCoordinate(e),this._pt[1].setCoordinate(t),this._distance=e.distance(t),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},Xe.prototype.getDistance=function(){return this._distance},Xe.prototype.setMaximum=function(){if(arguments.length===1){var e=arguments[0];this.setMaximum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var i=t.distance(n);i>this._distance&&this.initialize(t,n,i)}},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var Zr=function(){};Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.computeDistance=function(){if(arguments[2]instanceof Xe&&arguments[0]instanceof te&&arguments[1]instanceof R)for(var e=arguments[0],t=arguments[1],n=arguments[2],i=e.getCoordinates(),s=new tt,o=0;o<i.length-1;o++){s.setCoordinates(i[o],i[o+1]);var a=s.closestPoint(t);n.setMinimum(a,t)}else if(arguments[2]instanceof Xe&&arguments[0]instanceof pe&&arguments[1]instanceof R){var u=arguments[0],l=arguments[1],c=arguments[2];Zr.computeDistance(u.getExteriorRing(),l,c);for(var h=0;h<u.getNumInteriorRing();h++)Zr.computeDistance(u.getInteriorRingN(h),l,c)}else if(arguments[2]instanceof Xe&&arguments[0]instanceof ot&&arguments[1]instanceof R){var f=arguments[0],p=arguments[1],v=arguments[2];if(f instanceof te)Zr.computeDistance(f,p,v);else if(f instanceof pe)Zr.computeDistance(f,p,v);else if(f instanceof Ge)for(var C=f,S=0;S<C.getNumGeometries();S++){var P=C.getGeometryN(S);Zr.computeDistance(P,p,v)}else v.setMinimum(f.getCoordinate(),p)}else if(arguments[2]instanceof Xe&&arguments[0]instanceof tt&&arguments[1]instanceof R){var y=arguments[0],_=arguments[1],m=arguments[2],w=y.closestPoint(_);m.setMinimum(w,_)}};var Ns=function(e){this._maxPtDist=new Xe,this._inputGeom=e||null},vd={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Ns.prototype.computeMaxMidpointDistance=function(e){var t=new es(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())},Ns.prototype.computeMaxVertexDistance=function(e){var t=new yo(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())},Ns.prototype.findDistance=function(e){return this.computeMaxVertexDistance(e),this.computeMaxMidpointDistance(e),this._maxPtDist.getDistance()},Ns.prototype.getDistancePoints=function(){return this._maxPtDist},Ns.prototype.interfaces_=function(){return[]},Ns.prototype.getClass=function(){return Ns},vd.MaxPointDistanceFilter.get=function(){return yo},vd.MaxMidpointDistanceFilter.get=function(){return es},Object.defineProperties(Ns,vd);var yo=function(e){this._maxPtDist=new Xe,this._minPtDist=new Xe,this._geom=e||null};yo.prototype.filter=function(e){this._minPtDist.initialize(),Zr.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},yo.prototype.getMaxPointDistance=function(){return this._maxPtDist},yo.prototype.interfaces_=function(){return[Wr]},yo.prototype.getClass=function(){return yo};var es=function(e){this._maxPtDist=new Xe,this._minPtDist=new Xe,this._geom=e||null};es.prototype.filter=function(e,t){if(t===0)return null;var n=e.getCoordinate(t-1),i=e.getCoordinate(t),s=new R((n.x+i.x)/2,(n.y+i.y)/2);this._minPtDist.initialize(),Zr.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},es.prototype.isDone=function(){return!1},es.prototype.isGeometryChanged=function(){return!1},es.prototype.getMaxPointDistance=function(){return this._maxPtDist},es.prototype.interfaces_=function(){return[er]},es.prototype.getClass=function(){return es};var xi=function(e){this._comps=e||null};xi.prototype.filter=function(e){e instanceof pe&&this._comps.add(e)},xi.prototype.interfaces_=function(){return[pr]},xi.prototype.getClass=function(){return xi},xi.getPolygons=function(){if(arguments.length===1){var e=arguments[0];return xi.getPolygons(e,new W)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return t instanceof pe?n.add(t):t instanceof Ge&&t.apply(new xi(n)),n}};var De=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var e=arguments[0];this._lines=e}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this._lines=t,this._isForcedToLineString=n}};De.prototype.filter=function(e){if(this._isForcedToLineString&&e instanceof Hr){var t=e.getFactory().createLineString(e.getCoordinateSequence());return this._lines.add(t),null}e instanceof te&&this._lines.add(e)},De.prototype.setForceToLineString=function(e){this._isForcedToLineString=e},De.prototype.interfaces_=function(){return[yi]},De.prototype.getClass=function(){return De},De.getGeometry=function(){if(arguments.length===1){var e=arguments[0];return e.getFactory().buildGeometry(De.getLines(e))}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return t.getFactory().buildGeometry(De.getLines(t,n))}},De.getLines=function(){if(arguments.length===1){var e=arguments[0];return De.getLines(e,!1)}else if(arguments.length===2){if(at(arguments[0],fe)&&at(arguments[1],fe)){for(var t=arguments[0],n=arguments[1],i=t.iterator();i.hasNext();){var s=i.next();De.getLines(s,n)}return n}else if(arguments[0]instanceof ot&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1],u=new W;return o.apply(new De(u,a)),u}else if(arguments[0]instanceof ot&&at(arguments[1],fe)){var l=arguments[0],c=arguments[1];return l instanceof te?c.add(l):l.apply(new De(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&at(arguments[0],fe)&&at(arguments[1],fe)){for(var h=arguments[0],f=arguments[1],p=arguments[2],v=h.iterator();v.hasNext();){var C=v.next();De.getLines(C,f,p)}return f}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof ot&&at(arguments[1],fe)){var S=arguments[0],P=arguments[1],y=arguments[2];return S.apply(new De(P,y)),P}}};var sr=function(){if(this._boundaryRule=Vn.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e===null)throw new Yt("Rule must be non-null");this._boundaryRule=e}}};sr.prototype.locateInternal=function(){var e=this;if(arguments[0]instanceof R&&arguments[1]instanceof pe){var t=arguments[0],n=arguments[1];if(n.isEmpty())return F.EXTERIOR;var i=n.getExteriorRing(),s=this.locateInPolygonRing(t,i);if(s===F.EXTERIOR)return F.EXTERIOR;if(s===F.BOUNDARY)return F.BOUNDARY;for(var o=0;o<n.getNumInteriorRing();o++){var a=n.getInteriorRingN(o),u=e.locateInPolygonRing(t,a);if(u===F.INTERIOR)return F.EXTERIOR;if(u===F.BOUNDARY)return F.BOUNDARY}return F.INTERIOR}else if(arguments[0]instanceof R&&arguments[1]instanceof te){var l=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(l))return F.EXTERIOR;var h=c.getCoordinates();return!c.isClosed()&&(l.equals(h[0])||l.equals(h[h.length-1]))?F.BOUNDARY:q.isOnLine(l,h)?F.INTERIOR:F.EXTERIOR}else if(arguments[0]instanceof R&&arguments[1]instanceof dn){var f=arguments[0],p=arguments[1],v=p.getCoordinate();return v.equals2D(f)?F.INTERIOR:F.EXTERIOR}},sr.prototype.locateInPolygonRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?q.locatePointInRing(e,t.getCoordinates()):F.EXTERIOR},sr.prototype.intersects=function(e,t){return this.locate(e,t)!==F.EXTERIOR},sr.prototype.updateLocationInfo=function(e){e===F.INTERIOR&&(this._isIn=!0),e===F.BOUNDARY&&this._numBoundaries++},sr.prototype.computeLocation=function(e,t){var n=this;if(t instanceof dn&&this.updateLocationInfo(this.locateInternal(e,t)),t instanceof te)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof pe)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof Ps)for(var i=t,s=0;s<i.getNumGeometries();s++){var o=i.getGeometryN(s);n.updateLocationInfo(n.locateInternal(e,o))}else if(t instanceof qr)for(var a=t,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);n.updateLocationInfo(n.locateInternal(e,l))}else if(t instanceof Ge)for(var c=new Jr(t);c.hasNext();){var h=c.next();h!==t&&n.computeLocation(e,h)}},sr.prototype.locate=function(e,t){return t.isEmpty()?F.EXTERIOR:t instanceof te?this.locateInternal(e,t):t instanceof pe?this.locateInternal(e,t):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(e,t),this._boundaryRule.isInBoundary(this._numBoundaries)?F.BOUNDARY:this._numBoundaries>0||this._isIn?F.INTERIOR:F.EXTERIOR)},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr};var Ye=function r(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],t=arguments[1];r.call(this,e,r.INSIDE_AREA,t)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._component=n,this._segIndex=i,this._pt=s}},Jm={INSIDE_AREA:{configurable:!0}};Ye.prototype.isInsideArea=function(){return this._segIndex===Ye.INSIDE_AREA},Ye.prototype.getCoordinate=function(){return this._pt},Ye.prototype.getGeometryComponent=function(){return this._component},Ye.prototype.getSegmentIndex=function(){return this._segIndex},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Jm.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Ye,Jm);var ns=function(e){this._pts=e||null};ns.prototype.filter=function(e){e instanceof dn&&this._pts.add(e)},ns.prototype.interfaces_=function(){return[pr]},ns.prototype.getClass=function(){return ns},ns.getPoints=function(){if(arguments.length===1){var e=arguments[0];return e instanceof dn?rr.singletonList(e):ns.getPoints(e,new W)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return t instanceof dn?n.add(t):t instanceof Ge&&t.apply(new ns(n)),n}};var _o=function(){this._locations=null;var e=arguments[0];this._locations=e};_o.prototype.filter=function(e){(e instanceof dn||e instanceof te||e instanceof pe)&&this._locations.add(new Ye(e,0,e.getCoordinate()))},_o.prototype.interfaces_=function(){return[pr]},_o.prototype.getClass=function(){return _o},_o.getLocations=function(e){var t=new W;return e.apply(new _o(t)),t};var Me=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new sr,this._minDistanceLocation=null,this._minDistance=ht.MAX_VALUE,arguments.length===2){var e=arguments[0],t=arguments[1];this._geom=[e,t],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=s}};Me.prototype.computeContainmentDistance=function(){var e=this;if(arguments.length===0){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=1-n,o=xi.getPolygons(this._geom[n]);if(o.size()>0){var a=_o.getLocations(this._geom[s]);if(this.computeContainmentDistance(a,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=i[0],this._minDistanceLocation[n]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&at(arguments[0],Qn)&&at(arguments[1],Qn)){for(var u=arguments[0],l=arguments[1],c=arguments[2],h=0;h<u.size();h++)for(var f=u.get(h),p=0;p<l.size();p++)if(e.computeContainmentDistance(f,l.get(p),c),e._minDistance<=e._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Ye&&arguments[1]instanceof pe){var v=arguments[0],C=arguments[1],S=arguments[2],P=v.getCoordinate();if(F.EXTERIOR!==this._ptLocator.locate(P,C))return this._minDistance=0,S[0]=v,S[1]=new Ye(C,P),null}}},Me.prototype.computeMinDistanceLinesPoints=function(e,t,n){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var u=t.get(a);if(i.computeMinDistance(o,u,n),i._minDistance<=i._terminateDistance)return null}},Me.prototype.computeFacetDistance=function(){var e=new Array(2).fill(null),t=De.getLines(this._geom[0]),n=De.getLines(this._geom[1]),i=ns.getPoints(this._geom[0]),s=ns.getPoints(this._geom[1]);if(this.computeMinDistanceLines(t,n,e),this.updateMinDistance(e,!1),this._minDistance<=this._terminateDistance||(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(t,s,e),this.updateMinDistance(e,!1),this._minDistance<=this._terminateDistance)||(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(n,i,e),this.updateMinDistance(e,!0),this._minDistance<=this._terminateDistance))return null;e[0]=null,e[1]=null,this.computeMinDistancePoints(i,s,e),this.updateMinDistance(e,!1)},Me.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Me.prototype.updateMinDistance=function(e,t){if(e[0]===null)return null;t?(this._minDistanceLocation[0]=e[1],this._minDistanceLocation[1]=e[0]):(this._minDistanceLocation[0]=e[0],this._minDistanceLocation[1]=e[1])},Me.prototype.nearestPoints=function(){this.computeMinDistance();var e=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return e},Me.prototype.computeMinDistance=function(){var e=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof te&&arguments[1]instanceof dn){var t=arguments[0],n=arguments[1],i=arguments[2];if(t.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var s=t.getCoordinates(),o=n.getCoordinate(),a=0;a<s.length-1;a++){var u=q.distancePointLine(o,s[a],s[a+1]);if(u<e._minDistance){e._minDistance=u;var l=new tt(s[a],s[a+1]),c=l.closestPoint(o);i[0]=new Ye(t,a,c),i[1]=new Ye(n,0,o)}if(e._minDistance<=e._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof te&&arguments[1]instanceof te){var h=arguments[0],f=arguments[1],p=arguments[2];if(h.getEnvelopeInternal().distance(f.getEnvelopeInternal())>this._minDistance)return null;for(var v=h.getCoordinates(),C=f.getCoordinates(),S=0;S<v.length-1;S++)for(var P=0;P<C.length-1;P++){var y=q.distanceLineLine(v[S],v[S+1],C[P],C[P+1]);if(y<e._minDistance){e._minDistance=y;var _=new tt(v[S],v[S+1]),m=new tt(C[P],C[P+1]),w=_.closestPoints(m);p[0]=new Ye(h,S,w[0]),p[1]=new Ye(f,P,w[1])}if(e._minDistance<=e._terminateDistance)return null}}}},Me.prototype.computeMinDistancePoints=function(e,t,n){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var u=t.get(a),l=o.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,n[0]=new Ye(o,0,o.getCoordinate()),n[1]=new Ye(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},Me.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new Yt("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Me.prototype.computeMinDistanceLines=function(e,t,n){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var u=t.get(a);if(i.computeMinDistance(o,u,n),i._minDistance<=i._terminateDistance)return null}},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.distance=function(e,t){var n=new Me(e,t);return n.distance()},Me.isWithinDistance=function(e,t,n){var i=new Me(e,t,n);return i.distance()<=n},Me.nearestPoints=function(e,t){var n=new Me(e,t);return n.nearestPoints()};var Be=function(){this._pt=[new R,new R],this._distance=ht.NaN,this._isNull=!0};Be.prototype.getCoordinates=function(){return this._pt},Be.prototype.getCoordinate=function(e){return this._pt[e]},Be.prototype.setMinimum=function(){if(arguments.length===1){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var i=t.distance(n);i<this._distance&&this.initialize(t,n,i)}},Be.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var e=arguments[0],t=arguments[1];this._pt[0].setCoordinate(e),this._pt[1].setCoordinate(t),this._distance=e.distance(t),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},Be.prototype.toString=function(){return Zn.toLineString(this._pt[0],this._pt[1])},Be.prototype.getDistance=function(){return this._distance},Be.prototype.setMaximum=function(){if(arguments.length===1){var e=arguments[0];this.setMaximum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var i=t.distance(n);i>this._distance&&this.initialize(t,n,i)}},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be};var Sr=function(){};Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr},Sr.computeDistance=function(){if(arguments[2]instanceof Be&&arguments[0]instanceof te&&arguments[1]instanceof R)for(var e=arguments[0],t=arguments[1],n=arguments[2],i=new tt,s=e.getCoordinates(),o=0;o<s.length-1;o++){i.setCoordinates(s[o],s[o+1]);var a=i.closestPoint(t);n.setMinimum(a,t)}else if(arguments[2]instanceof Be&&arguments[0]instanceof pe&&arguments[1]instanceof R){var u=arguments[0],l=arguments[1],c=arguments[2];Sr.computeDistance(u.getExteriorRing(),l,c);for(var h=0;h<u.getNumInteriorRing();h++)Sr.computeDistance(u.getInteriorRingN(h),l,c)}else if(arguments[2]instanceof Be&&arguments[0]instanceof ot&&arguments[1]instanceof R){var f=arguments[0],p=arguments[1],v=arguments[2];if(f instanceof te)Sr.computeDistance(f,p,v);else if(f instanceof pe)Sr.computeDistance(f,p,v);else if(f instanceof Ge)for(var C=f,S=0;S<C.getNumGeometries();S++){var P=C.getGeometryN(S);Sr.computeDistance(P,p,v)}else v.setMinimum(f.getCoordinate(),p)}else if(arguments[2]instanceof Be&&arguments[0]instanceof tt&&arguments[1]instanceof R){var y=arguments[0],_=arguments[1],m=arguments[2],w=y.closestPoint(_);m.setMinimum(w,_)}};var Gn=function(){this._g0=null,this._g1=null,this._ptDist=new Be,this._densifyFrac=0;var e=arguments[0],t=arguments[1];this._g0=e,this._g1=t},yd={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Gn.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Gn.prototype.setDensifyFraction=function(e){if(e>1||e<=0)throw new Yt("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e},Gn.prototype.compute=function(e,t){this.computeOrientedDistance(e,t,this._ptDist),this.computeOrientedDistance(t,e,this._ptDist)},Gn.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Gn.prototype.computeOrientedDistance=function(e,t,n){var i=new wo(t);if(e.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var s=new rs(t,this._densifyFrac);e.apply(s),n.setMaximum(s.getMaxPointDistance())}},Gn.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn},Gn.distance=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new Gn(e,t);return n.distance()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new Gn(i,s);return a.setDensifyFraction(o),a.distance()}},yd.MaxPointDistanceFilter.get=function(){return wo},yd.MaxDensifiedByFractionDistanceFilter.get=function(){return rs},Object.defineProperties(Gn,yd);var wo=function(){this._maxPtDist=new Be,this._minPtDist=new Be,this._euclideanDist=new Sr,this._geom=null;var e=arguments[0];this._geom=e};wo.prototype.filter=function(e){this._minPtDist.initialize(),Sr.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},wo.prototype.getMaxPointDistance=function(){return this._maxPtDist},wo.prototype.interfaces_=function(){return[Wr]},wo.prototype.getClass=function(){return wo};var rs=function(){this._maxPtDist=new Be,this._minPtDist=new Be,this._geom=null,this._numSubSegs=0;var e=arguments[0],t=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/t))};rs.prototype.filter=function(e,t){var n=this;if(t===0)return null;for(var i=e.getCoordinate(t-1),s=e.getCoordinate(t),o=(s.x-i.x)/this._numSubSegs,a=(s.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*o,c=i.y+u*a,h=new R(l,c);n._minPtDist.initialize(),Sr.computeDistance(n._geom,h,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}},rs.prototype.isDone=function(){return!1},rs.prototype.isGeometryChanged=function(){return!1},rs.prototype.getMaxPointDistance=function(){return this._maxPtDist},rs.prototype.interfaces_=function(){return[er]},rs.prototype.getClass=function(){return rs};var gn=function(e,t,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=e||null,this._bufDistance=t||null,this._result=n||null},_d={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};gn.prototype.checkMaximumDistance=function(e,t,n){var i=new Gn(t,e);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var s=i.getCoordinates();this._errorLocation=s[1],this._errorIndicator=e.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Zn.toLineString(s[0],s[1])+")"}},gn.prototype.isValid=function(){var e=Math.abs(this._bufDistance),t=gn.MAX_DISTANCE_DIFF_FRAC*e;return this._minValidDistance=e-t,this._maxValidDistance=e+t,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),gn.VERBOSE&&Te.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},gn.prototype.checkNegativeValid=function(){if(!(this._input instanceof pe||this._input instanceof qr||this._input instanceof Ge))return null;var e=this.getPolygonLines(this._input);if(this.checkMinimumDistance(e,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(e,this._result,this._maxValidDistance)},gn.prototype.getErrorIndicator=function(){return this._errorIndicator},gn.prototype.checkMinimumDistance=function(e,t,n){var i=new Me(e,t,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound<n){this._isValid=!1;var s=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=e.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Zn.toLineString(s[0],s[1])+" )"}},gn.prototype.checkPositiveValid=function(){var e=this._result.getBoundary();if(this.checkMinimumDistance(this._input,e,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,e,this._maxValidDistance)},gn.prototype.getErrorLocation=function(){return this._errorLocation},gn.prototype.getPolygonLines=function(e){for(var t=new W,n=new De(t),i=xi.getPolygons(e),s=i.iterator();s.hasNext();){var o=s.next();o.apply(n)}return e.getFactory().buildGeometry(t)},gn.prototype.getErrorMessage=function(){return this._errMsg},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn},_d.VERBOSE.get=function(){return!1},_d.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(gn,_d);var Re=function(e,t,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=e||null,this._distance=t||null,this._result=n||null},wd={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Re.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Re.prototype.checkEnvelope=function(){if(this._distance<0)return null;var e=this._distance*Re.MAX_ENV_DIFF_FRAC;e===0&&(e=.001);var t=new Q(this._input.getEnvelopeInternal());t.expandBy(this._distance);var n=new Q(this._result.getEnvelopeInternal());n.expandBy(e),n.contains(t)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Re.prototype.checkDistance=function(){var e=new gn(this._input,this._distance,this._result);e.isValid()||(this._isValid=!1,this._errorMsg=e.getErrorMessage(),this._errorLocation=e.getErrorLocation(),this._errorIndicator=e.getErrorIndicator()),this.report("Distance")},Re.prototype.checkArea=function(){var e=this._input.getArea(),t=this._result.getArea();this._distance>0&&e>t&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&e<t&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Re.prototype.checkPolygonal=function(){this._result instanceof pe||this._result instanceof qr||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Re.prototype.getErrorIndicator=function(){return this._errorIndicator},Re.prototype.getErrorLocation=function(){return this._errorLocation},Re.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},Re.prototype.report=function(e){if(!Re.VERBOSE)return null;Te.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))},Re.prototype.getErrorMessage=function(){return this._errorMsg},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re},Re.isValidMsg=function(e,t,n){var i=new Re(e,t,n);return i.isValid()?null:i.getErrorMessage()},Re.isValid=function(e,t,n){var i=new Re(e,t,n);return!!i.isValid()},wd.VERBOSE.get=function(){return!1},wd.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Re,wd);var br=function(){this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};br.prototype.getCoordinates=function(){return this._pts},br.prototype.size=function(){return this._pts.length},br.prototype.getCoordinate=function(e){return this._pts[e]},br.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},br.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:po.octant(this.getCoordinate(e),this.getCoordinate(e+1))},br.prototype.setData=function(e){this._data=e},br.prototype.getData=function(){return this._data},br.prototype.toString=function(){return Zn.toLineString(new se(this._pts))},br.prototype.interfaces_=function(){return[Yr]},br.prototype.getClass=function(){return br};var be=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new W,this._intersectionCount=0,this._keepIntersections=!0;var e=arguments[0];this._li=e,this._interiorIntersection=null};be.prototype.getInteriorIntersection=function(){return this._interiorIntersection},be.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e},be.prototype.getIntersectionSegments=function(){return this._intSegments},be.prototype.count=function(){return this._intersectionCount},be.prototype.getIntersections=function(){return this._intersections},be.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},be.prototype.setKeepIntersections=function(e){this._keepIntersections=e},be.prototype.processIntersections=function(e,t,n,i){if(!this._findAllIntersections&&this.hasIntersection()||e===n&&t===i)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(e,t)||this.isEndSegment(n,i);if(!s)return null}var o=e.getCoordinates()[t],a=e.getCoordinates()[t+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=a,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},be.prototype.isEndSegment=function(e,t){return t===0||t>=e.size()-2},be.prototype.hasIntersection=function(){return this._interiorIntersection!==null},be.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},be.prototype.interfaces_=function(){return[Ts]},be.prototype.getClass=function(){return be},be.createAllIntersectionsFinder=function(e){var t=new be(e);return t.setFindAllIntersections(!0),t},be.createAnyIntersectionFinder=function(e){return new be(e)},be.createIntersectionCounter=function(e){var t=new be(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};var or=function(){this._li=new Cs,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e};or.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},or.prototype.getIntersections=function(){return this._segInt.getIntersections()},or.prototype.isValid=function(){return this.execute(),this._isValid},or.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},or.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new be(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new md;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},or.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Si(this.getErrorMessage(),this._segInt.getInteriorIntersection())},or.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Zn.toLineString(e[0],e[1])+" and "+Zn.toLineString(e[2],e[3])},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},or.computeIntersections=function(e){var t=new or(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};var Ds=function r(){this._nv=null;var e=arguments[0];this._nv=new or(r.toSegmentStrings(e))};Ds.prototype.checkValid=function(){this._nv.checkValid()},Ds.prototype.interfaces_=function(){return[]},Ds.prototype.getClass=function(){return Ds},Ds.toSegmentStrings=function(e){for(var t=new W,n=e.iterator();n.hasNext();){var i=n.next();t.add(new br(i.getCoordinates(),i))}return t},Ds.checkValid=function(e){var t=new Ds(e);t.checkValid()};var Eo=function(e){this._mapOp=e};Eo.prototype.map=function(e){for(var t=this,n=new W,i=0;i<e.getNumGeometries();i++){var s=t._mapOp.map(e.getGeometryN(i));s.isEmpty()||n.add(s)}return e.getFactory().createGeometryCollection(St.toGeometryArray(n))},Eo.prototype.interfaces_=function(){return[]},Eo.prototype.getClass=function(){return Eo},Eo.map=function(e,t){var n=new Eo(t);return n.map(e)};var Pr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new W,this._resultLineList=new W;var e=arguments[0],t=arguments[1],n=arguments[2];this._op=e,this._geometryFactory=t,this._ptLocator=n};Pr.prototype.collectLines=function(e){for(var t=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var i=n.next();t.collectLineEdge(i,e,t._lineEdgesList),t.collectBoundaryTouchEdge(i,e,t._lineEdgesList)}},Pr.prototype.labelIsolatedLine=function(e,t){var n=this._ptLocator.locate(e.getCoordinate(),this._op.getArgGeometry(t));e.getLabel().setLocation(t,n)},Pr.prototype.build=function(e){return this.findCoveredLineEdges(),this.collectLines(e),this.buildLines(e),this._resultLineList},Pr.prototype.collectLineEdge=function(e,t,n){var i=e.getLabel(),s=e.getEdge();e.isLineEdge()&&!e.isVisited()&&gt.isResultOfOp(i,t)&&!s.isCovered()&&(n.add(s),e.setVisitedEdge(!0))},Pr.prototype.findCoveredLineEdges=function(){for(var e=this,t=this._op.getGraph().getNodes().iterator();t.hasNext();){var n=t.next();n.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getEdge();if(s.isLineEdge()&&!o.isCoveredSet()){var a=e._op.isCoveredByA(s.getCoordinate());o.setCovered(a)}}},Pr.prototype.labelIsolatedLines=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();i.isIsolated()&&(s.isNull(0)?t.labelIsolatedLine(i,0):t.labelIsolatedLine(i,1))}},Pr.prototype.buildLines=function(e){for(var t=this,n=this._lineEdgesList.iterator();n.hasNext();){var i=n.next(),s=t._geometryFactory.createLineString(i.getCoordinates());t._resultLineList.add(s),i.setInResult(!0)}},Pr.prototype.collectBoundaryTouchEdge=function(e,t,n){var i=e.getLabel();if(e.isLineEdge()||e.isVisited()||e.isInteriorAreaEdge()||e.getEdge().isInResult())return null;yt.isTrue(!(e.isInResult()||e.getSym().isInResult())||!e.getEdge().isInResult()),gt.isResultOfOp(i,t)&&t===gt.INTERSECTION&&(n.add(e.getEdge()),e.setVisitedEdge(!0))},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr};var Co=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new W;var e=arguments[0],t=arguments[1];this._op=e,this._geometryFactory=t};Co.prototype.filterCoveredNodeToPoint=function(e){var t=e.getCoordinate();if(!this._op.isCoveredByLA(t)){var n=this._geometryFactory.createPoint(t);this._resultPointList.add(n)}},Co.prototype.extractNonCoveredResultNodes=function(e){for(var t=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||e===gt.INTERSECTION)){var s=i.getLabel();gt.isResultOfOp(s,e)&&t.filterCoveredNodeToPoint(i)}}},Co.prototype.build=function(e){return this.extractNonCoveredResultNodes(e),this._resultPointList},Co.prototype.interfaces_=function(){return[]},Co.prototype.getClass=function(){return Co};var on=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};on.prototype.transformPoint=function(e,t){return this._factory.createPoint(this.transformCoordinates(e.getCoordinateSequence(),e))},on.prototype.transformPolygon=function(e,t){var n=this,i=!0,s=this.transformLinearRing(e.getExteriorRing(),e);(s===null||!(s instanceof Hr)||s.isEmpty())&&(i=!1);for(var o=new W,a=0;a<e.getNumInteriorRing();a++){var u=n.transformLinearRing(e.getInteriorRingN(a),e);u===null||u.isEmpty()||(u instanceof Hr||(i=!1),o.add(u))}if(i)return this._factory.createPolygon(s,o.toArray([]));var l=new W;return s!==null&&l.add(s),l.addAll(o),this._factory.buildGeometry(l)},on.prototype.createCoordinateSequence=function(e){return this._factory.getCoordinateSequenceFactory().create(e)},on.prototype.getInputGeometry=function(){return this._inputGeom},on.prototype.transformMultiLineString=function(e,t){for(var n=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=n.transformLineString(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},on.prototype.transformCoordinates=function(e,t){return this.copy(e)},on.prototype.transformLineString=function(e,t){return this._factory.createLineString(this.transformCoordinates(e.getCoordinateSequence(),e))},on.prototype.transformMultiPoint=function(e,t){for(var n=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=n.transformPoint(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},on.prototype.transformMultiPolygon=function(e,t){for(var n=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=n.transformPolygon(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},on.prototype.copy=function(e){return e.copy()},on.prototype.transformGeometryCollection=function(e,t){for(var n=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=n.transform(e.getGeometryN(s));o!==null&&(n._pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(St.toGeometryArray(i)):this._factory.buildGeometry(i)},on.prototype.transform=function(e){if(this._inputGeom=e,this._factory=e.getFactory(),e instanceof dn)return this.transformPoint(e,null);if(e instanceof wa)return this.transformMultiPoint(e,null);if(e instanceof Hr)return this.transformLinearRing(e,null);if(e instanceof te)return this.transformLineString(e,null);if(e instanceof Ps)return this.transformMultiLineString(e,null);if(e instanceof pe)return this.transformPolygon(e,null);if(e instanceof qr)return this.transformMultiPolygon(e,null);if(e instanceof Ge)return this.transformGeometryCollection(e,null);throw new Yt("Unknown Geometry subtype: "+e.getClass().getName())},on.prototype.transformLinearRing=function(e,t){var n=this.transformCoordinates(e.getCoordinateSequence(),e);if(n===null)return this._factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on};var Qr=function r(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new tt,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof te&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];r.call(this,e.getCoordinates(),t)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=r.isClosed(n),this._snapTolerance=i}};Qr.prototype.snapVertices=function(e,t){for(var n=this,i=this._isClosed?e.size()-1:e.size(),s=0;s<i;s++){var o=e.get(s),a=n.findSnapForVertex(o,t);a!==null&&(e.set(s,new R(a)),s===0&&n._isClosed&&e.set(e.size()-1,new R(a)))}},Qr.prototype.findSnapForVertex=function(e,t){for(var n=this,i=0;i<t.length;i++){if(e.equals2D(t[i]))return null;if(e.distance(t[i])<n._snapTolerance)return t[i]}return null},Qr.prototype.snapTo=function(e){var t=new Wu(this._srcPts);this.snapVertices(t,e),this.snapSegments(t,e);var n=t.toCoordinateArray();return n},Qr.prototype.snapSegments=function(e,t){var n=this;if(t.length===0)return null;var i=t.length;t[0].equals2D(t[t.length-1])&&(i=t.length-1);for(var s=0;s<i;s++){var o=t[s],a=n.findSegmentIndexToSnap(o,e);a>=0&&e.add(a+1,new R(o),!1)}},Qr.prototype.findSegmentIndexToSnap=function(e,t){for(var n=this,i=ht.MAX_VALUE,s=-1,o=0;o<t.size()-1;o++){if(n._seg.p0=t.get(o),n._seg.p1=t.get(o+1),n._seg.p0.equals2D(e)||n._seg.p1.equals2D(e)){if(n._allowSnappingToSourceVertices)continue;return-1}var a=n._seg.distance(e);a<n._snapTolerance&&a<i&&(i=a,s=o)}return s},Qr.prototype.setAllowSnappingToSourceVertices=function(e){this._allowSnappingToSourceVertices=e},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr},Qr.isClosed=function(e){return e.length<=1?!1:e[0].equals2D(e[e.length-1])};var ae=function(e){this._srcGeom=e||null},$m={SNAP_PRECISION_FACTOR:{configurable:!0}};ae.prototype.snapTo=function(e,t){var n=this.extractTargetCoordinates(e),i=new Km(t,n);return i.transform(this._srcGeom)},ae.prototype.snapToSelf=function(e,t){var n=this.extractTargetCoordinates(this._srcGeom),i=new Km(e,n,!0),s=i.transform(this._srcGeom),o=s;return t&&at(o,$i)&&(o=s.buffer(0)),o},ae.prototype.computeSnapTolerance=function(e){var t=this.computeMinimumSegmentLength(e),n=t/10;return n},ae.prototype.extractTargetCoordinates=function(e){for(var t=new fr,n=e.getCoordinates(),i=0;i<n.length;i++)t.add(n[i]);return t.toArray(new Array(0).fill(null))},ae.prototype.computeMinimumSegmentLength=function(e){for(var t=ht.MAX_VALUE,n=0;n<e.length-1;n++){var i=e[n].distance(e[n+1]);i<t&&(t=i)}return t},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},ae.snap=function(e,t,n){var i=new Array(2).fill(null),s=new ae(e);i[0]=s.snapTo(t,n);var o=new ae(t);return i[1]=o.snapTo(i[0],n),i},ae.computeOverlaySnapTolerance=function(){if(arguments.length===1){var e=arguments[0],t=ae.computeSizeBasedSnapTolerance(e),n=e.getPrecisionModel();if(n.getType()===Lt.FIXED){var i=1/n.getScale()*2/1.415;i>t&&(t=i)}return t}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return Math.min(ae.computeOverlaySnapTolerance(s),ae.computeOverlaySnapTolerance(o))}},ae.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal(),n=Math.min(t.getHeight(),t.getWidth()),i=n*ae.SNAP_PRECISION_FACTOR;return i},ae.snapToSelf=function(e,t,n){var i=new ae(e);return i.snapToSelf(t,n)},$m.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(ae,$m);var Km=function(r){function e(t,n,i){r.call(this),this._snapTolerance=t||null,this._snapPts=n||null,this._isSelfSnap=i!==void 0?i:!1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(n,i){var s=new Qr(n,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(i)},e.prototype.transformCoordinates=function(n,i){var s=n.toCoordinateArray(),o=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(on),Je=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Je.prototype.getCommon=function(){return ht.longBitsToDouble(this._commonBits)},Je.prototype.add=function(e){var t=ht.doubleToLongBits(e);if(this._isFirst)return this._commonBits=t,this._commonSignExp=Je.signExpBits(this._commonBits),this._isFirst=!1,null;var n=Je.signExpBits(t);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Je.numCommonMostSigMantissaBits(this._commonBits,t),this._commonBits=Je.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Je.prototype.toString=function(){if(arguments.length===1){var e=arguments[0],t=ht.longBitsToDouble(e),n=ht.toBinaryString(e),i="0000000000000000000000000000000000000000000000000000000000000000"+n,s=i.substring(i.length-64),o=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+t+" ]";return o}},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je},Je.getBit=function(e,t){var n=1<<t;return(e&n)!==0?1:0},Je.signExpBits=function(e){return e>>52},Je.zeroLowerBits=function(e,t){var n=(1<<t)-1,i=~n,s=e&i;return s},Je.numCommonMostSigMantissaBits=function(e,t){for(var n=0,i=52;i>=0;i--){if(Je.getBit(e,i)!==Je.getBit(t,i))return n;n++}return 52};var is=function(){this._commonCoord=null,this._ccFilter=new So},Ed={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};is.prototype.addCommonBits=function(e){var t=new ss(this._commonCoord);e.apply(t),e.geometryChanged()},is.prototype.removeCommonBits=function(e){if(this._commonCoord.x===0&&this._commonCoord.y===0)return e;var t=new R(this._commonCoord);t.x=-t.x,t.y=-t.y;var n=new ss(t);return e.apply(n),e.geometryChanged(),e},is.prototype.getCommonCoordinate=function(){return this._commonCoord},is.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},is.prototype.interfaces_=function(){return[]},is.prototype.getClass=function(){return is},Ed.CommonCoordinateFilter.get=function(){return So},Ed.Translater.get=function(){return ss},Object.defineProperties(is,Ed);var So=function(){this._commonBitsX=new Je,this._commonBitsY=new Je};So.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)},So.prototype.getCommonCoordinate=function(){return new R(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},So.prototype.interfaces_=function(){return[Wr]},So.prototype.getClass=function(){return So};var ss=function(){this.trans=null;var e=arguments[0];this.trans=e};ss.prototype.filter=function(e,t){var n=e.getOrdinate(t,0)+this.trans.x,i=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,n),e.setOrdinate(t,1,i)},ss.prototype.isDone=function(){return!1},ss.prototype.isGeometryChanged=function(){return!0},ss.prototype.interfaces_=function(){return[er]},ss.prototype.getClass=function(){return ss};var Pe=function(e,t){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=e,this._geom[1]=t,this.computeSnapTolerance()};Pe.prototype.selfSnap=function(e){var t=new ae(e),n=t.snapTo(e,this._snapTolerance);return n},Pe.prototype.removeCommonBits=function(e){this._cbr=new is,this._cbr.add(e[0]),this._cbr.add(e[1]);var t=new Array(2).fill(null);return t[0]=this._cbr.removeCommonBits(e[0].copy()),t[1]=this._cbr.removeCommonBits(e[1].copy()),t},Pe.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e},Pe.prototype.getResultGeometry=function(e){var t=this.snap(this._geom),n=gt.overlayOp(t[0],t[1],e);return this.prepareResult(n)},Pe.prototype.checkValid=function(e){e.isValid()||Te.out.println("Snapped geometry is invalid")},Pe.prototype.computeSnapTolerance=function(){this._snapTolerance=ae.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Pe.prototype.snap=function(e){var t=this.removeCommonBits(e),n=ae.snap(t[0],t[1],this._snapTolerance);return n},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe},Pe.overlayOp=function(e,t,n){var i=new Pe(e,t);return i.getResultGeometry(n)},Pe.union=function(e,t){return Pe.overlayOp(e,t,gt.UNION)},Pe.intersection=function(e,t){return Pe.overlayOp(e,t,gt.INTERSECTION)},Pe.symDifference=function(e,t){return Pe.overlayOp(e,t,gt.SYMDIFFERENCE)},Pe.difference=function(e,t){return Pe.overlayOp(e,t,gt.DIFFERENCE)};var $e=function(e,t){this._geom=new Array(2).fill(null),this._geom[0]=e,this._geom[1]=t};$e.prototype.getResultGeometry=function(e){var t=null,n=!1,i=null;try{t=gt.overlayOp(this._geom[0],this._geom[1],e);var s=!0;s&&(n=!0)}catch(o){if(o instanceof vi)i=o;else throw o}finally{}if(!n)try{t=Pe.overlayOp(this._geom[0],this._geom[1],e)}catch(o){throw o instanceof vi?i:o}finally{}return t},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e},$e.overlayOp=function(e,t,n){var i=new $e(e,t);return i.getResultGeometry(n)},$e.union=function(e,t){return $e.overlayOp(e,t,gt.UNION)},$e.intersection=function(e,t){return $e.overlayOp(e,t,gt.INTERSECTION)},$e.symDifference=function(e,t){return $e.overlayOp(e,t,gt.SYMDIFFERENCE)},$e.difference=function(e,t){return $e.overlayOp(e,t,gt.DIFFERENCE)};var sl=function(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t};sl.prototype.computeIntersections=function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)},sl.prototype.interfaces_=function(){return[]},sl.prototype.getClass=function(){return sl};var mn=function r(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var e=arguments[0],t=arguments[1];this._eventType=r.DELETE,this._xValue=e,this._insertEvent=t}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._eventType=r.INSERT,this._label=n,this._xValue=i,this._obj=s}},Cd={INSERT:{configurable:!0},DELETE:{configurable:!0}};mn.prototype.isDelete=function(){return this._eventType===mn.DELETE},mn.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e},mn.prototype.getObject=function(){return this._obj},mn.prototype.compareTo=function(e){var t=e;return this._xValue<t._xValue?-1:this._xValue>t._xValue?1:this._eventType<t._eventType?-1:this._eventType>t._eventType?1:0},mn.prototype.getInsertEvent=function(){return this._insertEvent},mn.prototype.isInsert=function(){return this._eventType===mn.INSERT},mn.prototype.isSameLabel=function(e){return this._label===null?!1:this._label===e._label},mn.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},mn.prototype.interfaces_=function(){return[An]},mn.prototype.getClass=function(){return mn},Cd.INSERT.get=function(){return 1},Cd.DELETE.get=function(){return 2},Object.defineProperties(mn,Cd);var vc=function(){};vc.prototype.interfaces_=function(){return[]},vc.prototype.getClass=function(){return vc};var Le=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._li=e,this._includeProper=t,this._recordIsolated=n};Le.prototype.isTrivialIntersection=function(e,t,n,i){if(e===n&&this._li.getIntersectionNum()===1){if(Le.isAdjacentSegments(t,i))return!0;if(e.isClosed()){var s=e.getNumPoints()-1;if(t===0&&i===s||i===0&&t===s)return!0}}return!1},Le.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Le.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e},Le.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Le.prototype.isBoundaryPointInternal=function(e,t){for(var n=t.iterator();n.hasNext();){var i=n.next(),s=i.getCoordinate();if(e.isIntersection(s))return!0}return!1},Le.prototype.hasProperIntersection=function(){return this._hasProper},Le.prototype.hasIntersection=function(){return this._hasIntersection},Le.prototype.isDone=function(){return this._isDone},Le.prototype.isBoundaryPoint=function(e,t){return t===null?!1:!!(this.isBoundaryPointInternal(e,t[0])||this.isBoundaryPointInternal(e,t[1]))},Le.prototype.setBoundaryNodes=function(e,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=t},Le.prototype.addIntersections=function(e,t,n,i){if(e===n&&t===i)return null;this.numTests++;var s=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,t,n,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(e.addIntersections(this._li,t,0),n.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le},Le.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var eC=function(r){function e(){r.call(this),this.events=new W,this.nOverlaps=null}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){var n=this;rr.sort(this.events);for(var i=0;i<this.events.size();i++){var s=n.events.get(i);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(i)}},e.prototype.computeIntersections=function(){var n=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var s=0;s<this.events.size();s++){var o=n.events.get(s);if(o.isInsert()&&n.processOverlaps(s,o.getDeleteEventIndex(),o,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Le&&at(arguments[0],Qn)&&at(arguments[1],Qn)){var a=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(a,a),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&at(arguments[0],Qn)&&arguments[1]instanceof Le){var c=arguments[0],h=arguments[1],f=arguments[2];f?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(h)}}},e.prototype.addEdge=function(n,i){for(var s=this,o=n.getMonotoneChainEdge(),a=o.getStartIndexes(),u=0;u<a.length-1;u++){var l=new sl(o,u),c=new mn(i,o.getMinX(u),l);s.events.add(c),s.events.add(new mn(o.getMaxX(u),c))}},e.prototype.processOverlaps=function(n,i,s,o){for(var a=this,u=s.getObject(),l=n;l<i;l++){var c=a.events.get(l);if(c.isInsert()){var h=c.getObject();s.isSameLabel(c)||(u.computeIntersections(h,o),a.nOverlaps++)}}},e.prototype.addEdges=function(){var n=this;if(arguments.length===1)for(var i=arguments[0],s=i.iterator();s.hasNext();){var o=s.next();n.addEdge(o,o)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var c=l.next();n.addEdge(c,u)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(vc),ti=function(){this._min=ht.POSITIVE_INFINITY,this._max=ht.NEGATIVE_INFINITY},Zm={NodeComparator:{configurable:!0}};ti.prototype.getMin=function(){return this._min},ti.prototype.intersects=function(e,t){return!(this._min>t||this._max<e)},ti.prototype.getMax=function(){return this._max},ti.prototype.toString=function(){return Zn.toLineString(new R(this._min,0),new R(this._max,0))},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},Zm.NodeComparator.get=function(){return ol},Object.defineProperties(ti,Zm);var ol=function(){};ol.prototype.compare=function(e,t){var n=e,i=t,s=(n._min+n._max)/2,o=(i._min+i._max)/2;return s<o?-1:s>o?1:0},ol.prototype.interfaces_=function(){return[la]},ol.prototype.getClass=function(){return ol};var nC=function(r){function e(){r.call(this),this._item=null;var t=arguments[0],n=arguments[1],i=arguments[2];this._min=t,this._max=n,this._item=i}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.query=function(n,i,s){if(!this.intersects(n,i))return null;s.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ti),rC=function(r){function e(){r.call(this),this._node1=null,this._node2=null;var t=arguments[0],n=arguments[1];this._node1=t,this._node2=n,this.buildExtent(this._node1,this._node2)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(n,i){this._min=Math.min(n._min,i._min),this._max=Math.max(n._max,i._max)},e.prototype.query=function(n,i,s){if(!this.intersects(n,i))return null;this._node1!==null&&this._node1.query(n,i,s),this._node2!==null&&this._node2.query(n,i,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ti),ei=function(){this._leaves=new W,this._root=null,this._level=0};ei.prototype.buildTree=function(){var e=this;rr.sort(this._leaves,new ti.NodeComparator);for(var t=this._leaves,n=null,i=new W;;){if(e.buildLevel(t,i),i.size()===1)return i.get(0);n=t,t=i,i=n}},ei.prototype.insert=function(e,t,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new nC(e,t,n))},ei.prototype.query=function(e,t,n){this.init(),this._root.query(e,t,n)},ei.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},ei.prototype.printNode=function(e){Te.out.println(Zn.toLineString(new R(e._min,this._level),new R(e._max,this._level)))},ei.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},ei.prototype.buildLevel=function(e,t){this._level++,t.clear();for(var n=0;n<e.size();n+=2){var i=e.get(n),s=n+1<e.size()?e.get(n):null;if(s===null)t.add(i);else{var o=new rC(e.get(n),e.get(n+1));t.add(o)}}},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei};var xa=function(){this._items=new W};xa.prototype.visitItem=function(e){this._items.add(e)},xa.prototype.getItems=function(){return this._items},xa.prototype.interfaces_=function(){return[Ki]},xa.prototype.getClass=function(){return xa};var Ta=function(){this._index=null;var e=arguments[0];if(!at(e,$i))throw new Yt("Argument must be Polygonal");this._index=new Ms(e)},Sd={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Ta.prototype.locate=function(e){var t=new dr(e),n=new Oa(t);return this._index.query(e.y,e.y,n),t.getLocation()},Ta.prototype.interfaces_=function(){return[ba]},Ta.prototype.getClass=function(){return Ta},Sd.SegmentVisitor.get=function(){return Oa},Sd.IntervalIndexedGeometry.get=function(){return Ms},Object.defineProperties(Ta,Sd);var Oa=function(){this._counter=null;var e=arguments[0];this._counter=e};Oa.prototype.visitItem=function(e){var t=e;this._counter.countSegment(t.getCoordinate(0),t.getCoordinate(1))},Oa.prototype.interfaces_=function(){return[Ki]},Oa.prototype.getClass=function(){return Oa};var Ms=function(){this._index=new ei;var e=arguments[0];this.init(e)};Ms.prototype.init=function(e){for(var t=this,n=De.getLines(e),i=n.iterator();i.hasNext();){var s=i.next(),o=s.getCoordinates();t.addLine(o)}},Ms.prototype.addLine=function(e){for(var t=this,n=1;n<e.length;n++){var i=new tt(e[n-1],e[n]),s=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);t._index.insert(s,o,i)}},Ms.prototype.query=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new xa;return this._index.query(e,t,n),n.getItems()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];this._index.query(i,s,o)}},Ms.prototype.interfaces_=function(){return[]},Ms.prototype.getClass=function(){return Ms};var al=function(r){function e(){if(r.call(this),this._parentGeom=null,this._lineEdgeMap=new Rm,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new sr,arguments.length===2){var t=arguments[0],n=arguments[1],i=Vn.OGC_SFS_BOUNDARY_RULE;this._argIndex=t,this._parentGeom=n,this._boundaryNodeRule=i,n!==null&&this.add(n)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this._argIndex=s,this._parentGeom=o,this._boundaryNodeRule=a,o!==null&&this.add(o)}}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(n,i){var s=this._nodes.addNode(i),o=s.getLabel(),a=1,u=F.NONE;u=o.getLocation(n,U.ON),u===F.BOUNDARY&&a++;var l=e.determineBoundary(this._boundaryNodeRule,a);o.setLocation(n,l)},e.prototype.computeSelfNodes=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.computeSelfNodes(n,i,!1)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2],u=new Le(s,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),c=this._parentGeom instanceof Hr||this._parentGeom instanceof pe||this._parentGeom instanceof qr,h=o||!c;return l.computeIntersections(this._edges,u,h),this.addSelfIntersectionNodes(this._argIndex),u}},e.prototype.computeSplitEdges=function(n){for(var i=this._edges.iterator();i.hasNext();){var s=i.next();s.eiList.addSplitEdges(n)}},e.prototype.computeEdgeIntersections=function(n,i,s){var o=new Le(i,s,!0);o.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,n._edges,o),o},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof dn){var n=arguments[0],i=n.getCoordinate();this.insertPoint(this._argIndex,i,F.INTERIOR)}else if(arguments[0]instanceof R){var s=arguments[0];this.insertPoint(this._argIndex,s,F.INTERIOR)}},e.prototype.addPolygon=function(n){var i=this;this.addPolygonRing(n.getExteriorRing(),F.EXTERIOR,F.INTERIOR);for(var s=0;s<n.getNumInteriorRing();s++){var o=n.getInteriorRingN(s);i.addPolygonRing(o,F.INTERIOR,F.EXTERIOR)}},e.prototype.addEdge=function(n){this.insertEdge(n);var i=n.getCoordinates();this.insertPoint(this._argIndex,i[0],F.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],F.BOUNDARY)},e.prototype.addLineString=function(n){var i=Ct.removeRepeatedPoints(n.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var s=new mc(i,new jt(this._argIndex,F.INTERIOR));this._lineEdgeMap.put(n,s),this.insertEdge(s),yt.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),i=new Array(n.size()).fill(null),s=0,o=n.iterator();o.hasNext();){var a=o.next();i[s++]=a.getCoordinate().copy()}return i},e.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(n,i,s){if(this.isBoundaryNode(n,i))return null;s===F.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,i):this.insertPoint(n,i,s)},e.prototype.addPolygonRing=function(n,i,s){if(n.isEmpty())return null;var o=Ct.removeRepeatedPoints(n.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var a=i,u=s;q.isCCW(o)&&(a=s,u=i);var l=new mc(o,new jt(this._argIndex,F.BOUNDARY,a,u));this._lineEdgeMap.put(n,l),this.insertEdge(l),this.insertPoint(this._argIndex,o[0],F.BOUNDARY)},e.prototype.insertPoint=function(n,i,s){var o=this._nodes.addNode(i),a=o.getLabel();a===null?o._label=new jt(n,s):a.setLocation(n,s)},e.prototype.createEdgeSetIntersector=function(){return new eC},e.prototype.addSelfIntersectionNodes=function(n){for(var i=this,s=this._edges.iterator();s.hasNext();)for(var o=s.next(),a=o.getLabel().getLocation(n),u=o.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(n,l.coord,a)}},e.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof qr&&(this._useBoundaryDeterminationRule=!1),n instanceof pe)this.addPolygon(n);else if(n instanceof te)this.addLineString(n);else if(n instanceof dn)this.addPoint(n);else if(n instanceof wa)this.addCollection(n);else if(n instanceof Ps)this.addCollection(n);else if(n instanceof qr)this.addCollection(n);else if(n instanceof Ge)this.addCollection(n);else throw new Error(n.getClass().getName())}else return r.prototype.add.apply(this,arguments)},e.prototype.addCollection=function(n){for(var i=this,s=0;s<n.getNumGeometries();s++){var o=n.getGeometryN(s);i.add(o)}},e.prototype.locate=function(n){return at(this._parentGeom,$i)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Ta(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return r.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(n,i){return n.isInBoundary(i)?F.BOUNDARY:F.INTERIOR},e}(Kt),Na=function(){if(this._li=new Cs,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var e=arguments[0];this.setComputationPrecision(e.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new al(0,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],i=Vn.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new al(0,t,i),this._arg[1]=new al(1,n,i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];s.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new al(0,s,a),this._arg[1]=new al(1,o,a)}};Na.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()},Na.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)},Na.prototype.interfaces_=function(){return[]},Na.prototype.getClass=function(){return Na};var Rs=function(){};Rs.prototype.interfaces_=function(){return[]},Rs.prototype.getClass=function(){return Rs},Rs.map=function(){if(arguments[0]instanceof ot&&at(arguments[1],Rs.MapOp)){for(var e=arguments[0],t=arguments[1],n=new W,i=0;i<e.getNumGeometries();i++){var s=t.map(e.getGeometryN(i));s!==null&&n.add(s)}return e.getFactory().buildGeometry(n)}else if(at(arguments[0],fe)&&at(arguments[1],Rs.MapOp)){for(var o=arguments[0],a=arguments[1],u=new W,l=o.iterator();l.hasNext();){var c=l.next(),h=a.map(c);h!==null&&u.add(h)}return u}},Rs.MapOp=function(){};var gt=function(r){function e(){var t=arguments[0],n=arguments[1];r.call(this,t,n),this._ptLocator=new sr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new ir,this._resultPolyList=new W,this._resultLineList=new W,this._resultPointList=new W,this._graph=new Kt(new Gm),this._geomFact=t.getFactory()}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(n){var i=this._edgeList.findEqualEdge(n);if(i!==null){var s=i.getLabel(),o=n.getLabel();i.isPointwiseEqual(n)||(o=new jt(n.getLabel()),o.flip());var a=i.getDepth();a.isNull()&&a.add(s),a.add(o),s.merge(o)}else this._edgeList.add(n)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var i=n.next(),s=i.getSym();i.isInResult()&&s.isInResult()&&(i.setInResult(!1),s.setInResult(!1))}},e.prototype.isCoveredByLA=function(n){return!!(this.isCovered(n,this._resultLineList)||this.isCovered(n,this._resultPolyList))},e.prototype.computeGeometry=function(n,i,s,o){var a=new W;return a.addAll(n),a.addAll(i),a.addAll(s),a.isEmpty()?e.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},e.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next();i.getEdges().mergeSymLabels()}},e.prototype.isCovered=function(n,i){for(var s=this,o=i.iterator();o.hasNext();){var a=o.next(),u=s._ptLocator.locate(n,a);if(u!==F.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var n=new W,i=this._edgeList.iterator();i.hasNext();){var s=i.next();s.isCollapsed()&&(i.remove(),n.add(s.getCollapsedEdge()))}this._edgeList.addAll(n)},e.prototype.updateNodeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next(),s=i.getEdges().getLabel();i.getLabel().merge(s)}},e.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},e.prototype.insertUniqueEdges=function(n){for(var i=this,s=n.iterator();s.hasNext();){var o=s.next();i.insertUniqueEdge(o)}},e.prototype.computeOverlay=function(n){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var i=new W;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Ds.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(n),this.cancelDuplicateResultEdges();var s=new fn(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var o=new Pr(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(n);var a=new Co(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(n),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},e.prototype.labelIncompleteNode=function(n,i){var s=this._ptLocator.locate(n.getCoordinate(),this._arg[i].getGeometry());n.getLabel().setLocation(i,s)},e.prototype.copyPoints=function(n){for(var i=this,s=this._arg[n].getNodeIterator();s.hasNext();){var o=s.next(),a=i._graph.addNode(o.getCoordinate());a.setLabel(n,o.getLabel().getLocation(n))}},e.prototype.findResultAreaEdges=function(n){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.isArea()&&!s.isInteriorAreaEdge()&&e.isResultOfOp(o.getLocation(0,U.RIGHT),o.getLocation(1,U.RIGHT),n)&&s.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var n=this._edgeList.iterator();n.hasNext();){var i=n.next(),s=i.getLabel(),o=i.getDepth();if(!o.isNull()){o.normalize();for(var a=0;a<2;a++)!s.isNull(a)&&s.isArea()&&!o.isNull(a)&&(o.getDelta(a)===0?s.toLine(a):(yt.isTrue(!o.isNull(a,U.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(a,U.LEFT,o.getLocation(a,U.LEFT)),yt.isTrue(!o.isNull(a,U.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(a,U.RIGHT,o.getLocation(a,U.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next();s.getEdges().computeLabelling(n._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();s.isIsolated()&&(o.isNull(0)?n.labelIncompleteNode(s,0):n.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(o)}},e.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Na);gt.overlayOp=function(r,e,t){var n=new gt(r,e),i=n.getResultGeometry(t);return i},gt.intersection=function(r,e){if(r.isEmpty()||e.isEmpty())return gt.createEmptyResult(gt.INTERSECTION,r,e,r.getFactory());if(r.isGeometryCollection()){var t=e;return Eo.map(r,{interfaces_:function(){return[Rs.MapOp]},map:function(n){return n.intersection(t)}})}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(e),$e.overlayOp(r,e,gt.INTERSECTION)},gt.symDifference=function(r,e){if(r.isEmpty()||e.isEmpty()){if(r.isEmpty()&&e.isEmpty())return gt.createEmptyResult(gt.SYMDIFFERENCE,r,e,r.getFactory());if(r.isEmpty())return e.copy();if(e.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(e),$e.overlayOp(r,e,gt.SYMDIFFERENCE)},gt.resultDimension=function(r,e,t){var n=e.getDimension(),i=t.getDimension(),s=-1;switch(r){case gt.INTERSECTION:s=Math.min(n,i);break;case gt.UNION:s=Math.max(n,i);break;case gt.DIFFERENCE:s=n;break;case gt.SYMDIFFERENCE:s=Math.max(n,i);break}return s},gt.createEmptyResult=function(r,e,t,n){var i=null;switch(gt.resultDimension(r,e,t)){case-1:i=n.createGeometryCollection(new Array(0).fill(null));break;case 0:i=n.createPoint();break;case 1:i=n.createLineString();break;case 2:i=n.createPolygon();break}return i},gt.difference=function(r,e){return r.isEmpty()?gt.createEmptyResult(gt.DIFFERENCE,r,e,r.getFactory()):e.isEmpty()?r.copy():(r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(e),$e.overlayOp(r,e,gt.DIFFERENCE))},gt.isResultOfOp=function(){if(arguments.length===2){var r=arguments[0],e=arguments[1],t=r.getLocation(0),n=r.getLocation(1);return gt.isResultOfOp(t,n,e)}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];switch(i===F.BOUNDARY&&(i=F.INTERIOR),s===F.BOUNDARY&&(s=F.INTERIOR),o){case gt.INTERSECTION:return i===F.INTERIOR&&s===F.INTERIOR;case gt.UNION:return i===F.INTERIOR||s===F.INTERIOR;case gt.DIFFERENCE:return i===F.INTERIOR&&s!==F.INTERIOR;case gt.SYMDIFFERENCE:return i===F.INTERIOR&&s!==F.INTERIOR||i!==F.INTERIOR&&s===F.INTERIOR}return!1}},gt.INTERSECTION=1,gt.UNION=2,gt.DIFFERENCE=3,gt.SYMDIFFERENCE=4;var os=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new sr,this._seg=new tt;var e=arguments[0],t=arguments[1];this._g=e,this._boundaryDistanceTolerance=t,this._linework=this.extractLinework(e)};os.prototype.isWithinToleranceOfBoundary=function(e){for(var t=this,n=0;n<this._linework.getNumGeometries();n++)for(var i=t._linework.getGeometryN(n),s=i.getCoordinateSequence(),o=0;o<s.size()-1;o++){s.getCoordinate(o,t._seg.p0),s.getCoordinate(o+1,t._seg.p1);var a=t._seg.distance(e);if(a<=t._boundaryDistanceTolerance)return!0}return!1},os.prototype.getLocation=function(e){return this.isWithinToleranceOfBoundary(e)?F.BOUNDARY:this._ptLocator.locate(e,this._g)},os.prototype.extractLinework=function(e){var t=new Da;e.apply(t);var n=t.getLinework(),i=St.toLineStringArray(n);return e.getFactory().createMultiLineString(i)},os.prototype.interfaces_=function(){return[]},os.prototype.getClass=function(){return os};var Da=function(){this._linework=null,this._linework=new W};Da.prototype.getLinework=function(){return this._linework},Da.prototype.filter=function(e){var t=this;if(e instanceof pe){var n=e;this._linework.add(n.getExteriorRing());for(var i=0;i<n.getNumInteriorRing();i++)t._linework.add(n.getInteriorRingN(i))}},Da.prototype.interfaces_=function(){return[pr]},Da.prototype.getClass=function(){return Da};var Ls=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var e=arguments[0];this._g=e};Ls.prototype.extractPoints=function(e,t,n){for(var i=this,s=e.getCoordinates(),o=0;o<s.length-1;o++)i.computeOffsetPoints(s[o],s[o+1],t,n)},Ls.prototype.setSidesToGenerate=function(e,t){this._doLeft=e,this._doRight=t},Ls.prototype.getPoints=function(e){for(var t=this,n=new W,i=De.getLines(this._g),s=i.iterator();s.hasNext();){var o=s.next();t.extractPoints(o,e,n)}return n},Ls.prototype.computeOffsetPoints=function(e,t,n,i){var s=t.x-e.x,o=t.y-e.y,a=Math.sqrt(s*s+o*o),u=n*s/a,l=n*o/a,c=(t.x+e.x)/2,h=(t.y+e.y)/2;if(this._doLeft){var f=new R(c-l,h+u);i.add(f)}if(this._doRight){var p=new R(c+l,h-u);i.add(p)}},Ls.prototype.interfaces_=function(){return[]},Ls.prototype.getClass=function(){return Ls};var Mn=function r(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=r.TOLERANCE,this._testCoords=new W;var e=arguments[0],t=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=r.computeBoundaryDistanceTolerance(e,t),this._geom=[e,t,n],this._locFinder=[new os(this._geom[0],this._boundaryDistanceTolerance),new os(this._geom[1],this._boundaryDistanceTolerance),new os(this._geom[2],this._boundaryDistanceTolerance)]},Qm={TOLERANCE:{configurable:!0}};Mn.prototype.reportResult=function(e,t,n){Te.out.println("Overlay result invalid - A:"+F.toLocationSymbol(t[0])+" B:"+F.toLocationSymbol(t[1])+" expected:"+(n?"i":"e")+" actual:"+F.toLocationSymbol(t[2]))},Mn.prototype.isValid=function(e){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var t=this.checkValid(e);return t},Mn.prototype.checkValid=function(){var e=this;if(arguments.length===1){for(var t=arguments[0],n=0;n<this._testCoords.size();n++){var i=e._testCoords.get(n);if(!e.checkValid(t,i))return e._invalidLocation=i,!1}return!0}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),Mn.hasLocation(this._location,F.BOUNDARY)?!0:this.isValidResult(s,this._location)}},Mn.prototype.addTestPts=function(e){var t=new Ls(e);this._testCoords.addAll(t.getPoints(5*this._boundaryDistanceTolerance))},Mn.prototype.isValidResult=function(e,t){var n=gt.isResultOfOp(t[0],t[1],e),i=t[2]===F.INTERIOR,s=!(n^i);return s||this.reportResult(e,t,n),s},Mn.prototype.getInvalidLocation=function(){return this._invalidLocation},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Mn.hasLocation=function(e,t){for(var n=0;n<3;n++)if(e[n]===t)return!0;return!1},Mn.computeBoundaryDistanceTolerance=function(e,t){return Math.min(ae.computeSizeBasedSnapTolerance(e),ae.computeSizeBasedSnapTolerance(t))},Mn.isValid=function(e,t,n,i){var s=new Mn(e,t,i);return s.isValid(n)},Qm.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Mn,Qm);var Rn=function r(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=r.extractFactory(e),this._inputGeoms=e};Rn.prototype.extractElements=function(e,t){var n=this;if(e===null)return null;for(var i=0;i<e.getNumGeometries();i++){var s=e.getGeometryN(i);n._skipEmpty&&s.isEmpty()||t.add(s)}},Rn.prototype.combine=function(){for(var e=this,t=new W,n=this._inputGeoms.iterator();n.hasNext();){var i=n.next();e.extractElements(i,t)}return t.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},Rn.combine=function(){if(arguments.length===1){var e=arguments[0],t=new Rn(e);return t.combine()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=new Rn(Rn.createList(n,i));return s.combine()}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2],l=new Rn(Rn.createList(o,a,u));return l.combine()}},Rn.extractFactory=function(e){return e.isEmpty()?null:e.iterator().next().getFactory()},Rn.createList=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new W;return n.add(e),n.add(t),n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new W;return a.add(i),a.add(s),a.add(o),a}};var he=function(){this._inputPolys=null,this._geomFactory=null;var e=arguments[0];this._inputPolys=e,this._inputPolys===null&&(this._inputPolys=new W)},tv={STRTREE_NODE_CAPACITY:{configurable:!0}};he.prototype.reduceToGeometries=function(e){for(var t=this,n=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=null;at(s,Qn)?o=t.unionTree(s):s instanceof ot&&(o=s),n.add(o)}return n},he.prototype.extractByEnvelope=function(e,t,n){for(var i=new W,s=0;s<t.getNumGeometries();s++){var o=t.getGeometryN(s);o.getEnvelopeInternal().intersects(e)?i.add(o):n.add(o)}return this._geomFactory.buildGeometry(i)},he.prototype.unionOptimized=function(e,t){var n=e.getEnvelopeInternal(),i=t.getEnvelopeInternal();if(!n.intersects(i)){var s=Rn.combine(e,t);return s}if(e.getNumGeometries()<=1&&t.getNumGeometries()<=1)return this.unionActual(e,t);var o=n.intersection(i);return this.unionUsingEnvelopeIntersection(e,t,o)},he.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var e=new km(he.STRTREE_NODE_CAPACITY),t=this._inputPolys.iterator();t.hasNext();){var n=t.next();e.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var i=e.itemsTree(),s=this.unionTree(i);return s},he.prototype.binaryUnion=function(){if(arguments.length===1){var e=arguments[0];return this.binaryUnion(e,0,e.size())}else if(arguments.length===3){var t=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1){var s=he.getGeometry(t,n);return this.unionSafe(s,null)}else{if(i-n===2)return this.unionSafe(he.getGeometry(t,n),he.getGeometry(t,n+1));var o=Math.trunc((i+n)/2),a=this.binaryUnion(t,n,o),u=this.binaryUnion(t,o,i);return this.unionSafe(a,u)}}},he.prototype.repeatedUnion=function(e){for(var t=null,n=e.iterator();n.hasNext();){var i=n.next();t===null?t=i.copy():t=t.union(i)}return t},he.prototype.unionSafe=function(e,t){return e===null&&t===null?null:e===null?t.copy():t===null?e.copy():this.unionOptimized(e,t)},he.prototype.unionActual=function(e,t){return he.restrictToPolygons(e.union(t))},he.prototype.unionTree=function(e){var t=this.reduceToGeometries(e),n=this.binaryUnion(t);return n},he.prototype.unionUsingEnvelopeIntersection=function(e,t,n){var i=new W,s=this.extractByEnvelope(n,e,i),o=this.extractByEnvelope(n,t,i),a=this.unionActual(s,o);i.add(a);var u=Rn.combine(i);return u},he.prototype.bufferUnion=function(){if(arguments.length===1){var e=arguments[0],t=e.get(0).getFactory(),n=t.buildGeometry(e),i=n.buffer(0);return i}else if(arguments.length===2){var s=arguments[0],o=arguments[1],a=s.getFactory(),u=a.createGeometryCollection([s,o]),l=u.buffer(0);return l}},he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},he.restrictToPolygons=function(e){if(at(e,$i))return e;var t=xi.getPolygons(e);return t.size()===1?t.get(0):e.getFactory().createMultiPolygon(St.toPolygonArray(t))},he.getGeometry=function(e,t){return t>=e.size()?null:e.get(t)},he.union=function(e){var t=new he(e);return t.union()},tv.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(he,tv);var yc=function(){};yc.prototype.interfaces_=function(){return[]},yc.prototype.getClass=function(){return yc},yc.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return gt.createEmptyResult(gt.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),$e.overlayOp(e,t,gt.UNION)};function Fs(){return new _c}function _c(){this.reset()}_c.prototype={constructor:_c,reset:function(){this.s=this.t=0},add:function(r){ev(wc,r,this.t),ev(this,wc.s,this.s),this.s?this.t+=wc.t:this.s=wc.t},valueOf:function(){return this.s}};var wc=new _c;function ev(r,e,t){var n=r.s=e+t,i=n-e,s=n-i;r.t=e-s+(t-i)}var de=1e-6,Ut=Math.PI,Ti=Ut/2,nv=Ut/4,Oi=Ut*2,As=180/Ut,Ir=Ut/180,Ke=Math.abs,iC=Math.atan,Ma=Math.atan2,me=Math.cos,ve=Math.sin,Ra=Math.sqrt;function rv(r){return r>1?0:r<-1?Ut:Math.acos(r)}function bo(r){return r>1?Ti:r<-1?-Ti:Math.asin(r)}function ul(){}function Ec(r,e){r&&sv.hasOwnProperty(r.type)&&sv[r.type](r,e)}var iv={Feature:function(r,e){Ec(r.geometry,e)},FeatureCollection:function(r,e){for(var t=r.features,n=-1,i=t.length;++n<i;)Ec(t[n].geometry,e)}},sv={Sphere:function(r,e){e.sphere()},Point:function(r,e){r=r.coordinates,e.point(r[0],r[1],r[2])},MultiPoint:function(r,e){for(var t=r.coordinates,n=-1,i=t.length;++n<i;)r=t[n],e.point(r[0],r[1],r[2])},LineString:function(r,e){bd(r.coordinates,e,0)},MultiLineString:function(r,e){for(var t=r.coordinates,n=-1,i=t.length;++n<i;)bd(t[n],e,0)},Polygon:function(r,e){ov(r.coordinates,e)},MultiPolygon:function(r,e){for(var t=r.coordinates,n=-1,i=t.length;++n<i;)ov(t[n],e)},GeometryCollection:function(r,e){for(var t=r.geometries,n=-1,i=t.length;++n<i;)Ec(t[n],e)}};function bd(r,e,t){var n=-1,i=r.length-t,s;for(e.lineStart();++n<i;)s=r[n],e.point(s[0],s[1],s[2]);e.lineEnd()}function ov(r,e){var t=-1,n=r.length;for(e.polygonStart();++t<n;)bd(r[t],e,1);e.polygonEnd()}function sC(r,e){r&&iv.hasOwnProperty(r.type)?iv[r.type](r,e):Ec(r,e)}Fs(),Fs();function Pd(r){return[Ma(r[1],r[0]),bo(r[2])]}function La(r){var e=r[0],t=r[1],n=me(t);return[n*me(e),n*ve(e),ve(t)]}function Cc(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function Sc(r,e){return[r[1]*e[2]-r[2]*e[1],r[2]*e[0]-r[0]*e[2],r[0]*e[1]-r[1]*e[0]]}function Id(r,e){r[0]+=e[0],r[1]+=e[1],r[2]+=e[2]}function bc(r,e){return[r[0]*e,r[1]*e,r[2]*e]}function xd(r){var e=Ra(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=e,r[1]/=e,r[2]/=e}Fs();function av(r,e){function t(n,i){return n=r(n,i),e(n[0],n[1])}return r.invert&&e.invert&&(t.invert=function(n,i){return n=e.invert(n,i),n&&r.invert(n[0],n[1])}),t}function Td(r,e){return[r>Ut?r-Oi:r<-Ut?r+Oi:r,e]}Td.invert=Td;function oC(r,e,t){return(r%=Oi)?e||t?av(lv(r),cv(e,t)):lv(r):e||t?cv(e,t):Td}function uv(r){return function(e,t){return e+=r,[e>Ut?e-Oi:e<-Ut?e+Oi:e,t]}}function lv(r){var e=uv(r);return e.invert=uv(-r),e}function cv(r,e){var t=me(r),n=ve(r),i=me(e),s=ve(e);function o(a,u){var l=me(u),c=me(a)*l,h=ve(a)*l,f=ve(u),p=f*t+c*n;return[Ma(h*i-p*s,c*t-f*n),bo(p*i+h*s)]}return o.invert=function(a,u){var l=me(u),c=me(a)*l,h=ve(a)*l,f=ve(u),p=f*i-h*s;return[Ma(h*i+f*s,c*t+p*n),bo(p*t-c*n)]},o}function aC(r,e,t,n,i,s){if(t){var o=me(e),a=ve(e),u=n*t;i==null?(i=e+n*Oi,s=e-u/2):(i=hv(o,i),s=hv(o,s),(n>0?i<s:i>s)&&(i+=n*Oi));for(var l,c=i;n>0?c>s:c<s;c-=u)l=Pd([o,-a*me(c),-a*ve(c)]),r.point(l[0],l[1])}}function hv(r,e){e=La(e),e[0]-=r,xd(e);var t=rv(-e[1]);return((-e[2]<0?-t:t)+Oi-de)%Oi}function dv(){var r=[],e;return{point:function(t,n){e.push([t,n])},lineStart:function(){r.push(e=[])},lineEnd:ul,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var t=r;return r=[],e=null,t}}}function uC(r,e,t,n,i,s){var o=r[0],a=r[1],u=e[0],l=e[1],c=0,h=1,f=u-o,p=l-a,v;if(v=t-o,!(!f&&v>0)){if(v/=f,f<0){if(v<c)return;v<h&&(h=v)}else if(f>0){if(v>h)return;v>c&&(c=v)}if(v=i-o,!(!f&&v<0)){if(v/=f,f<0){if(v>h)return;v>c&&(c=v)}else if(f>0){if(v<c)return;v<h&&(h=v)}if(v=n-a,!(!p&&v>0)){if(v/=p,p<0){if(v<c)return;v<h&&(h=v)}else if(p>0){if(v>h)return;v>c&&(c=v)}if(v=s-a,!(!p&&v<0)){if(v/=p,p<0){if(v>h)return;v>c&&(c=v)}else if(p>0){if(v<c)return;v<h&&(h=v)}return c>0&&(r[0]=o+c*f,r[1]=a+c*p),h<1&&(e[0]=o+h*f,e[1]=a+h*p),!0}}}}}function Pc(r,e){return Ke(r[0]-e[0])<de&&Ke(r[1]-e[1])<de}function Ic(r,e,t,n){this.x=r,this.z=e,this.o=t,this.e=n,this.v=!1,this.n=this.p=null}function fv(r,e,t,n,i){var s=[],o=[],a,u;if(r.forEach(function(v){if(!((C=v.length-1)<=0)){var C,S=v[0],P=v[C],y;if(Pc(S,P)){for(i.lineStart(),a=0;a<C;++a)i.point((S=v[a])[0],S[1]);i.lineEnd();return}s.push(y=new Ic(S,v,null,!0)),o.push(y.o=new Ic(S,null,y,!1)),s.push(y=new Ic(P,v,null,!1)),o.push(y.o=new Ic(P,null,y,!0))}}),!!s.length){for(o.sort(e),pv(s),pv(o),a=0,u=o.length;a<u;++a)o[a].e=t=!t;for(var l=s[0],c,h;;){for(var f=l,p=!0;f.v;)if((f=f.n)===l)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(a=0,u=c.length;a<u;++a)i.point((h=c[a])[0],h[1]);else n(f.x,f.n.x,1,i);f=f.n}else{if(p)for(c=f.p.z,a=c.length-1;a>=0;--a)i.point((h=c[a])[0],h[1]);else n(f.x,f.p.x,-1,i);f=f.p}f=f.o,c=f.z,p=!p}while(!f.v);i.lineEnd()}}}function pv(r){if(e=r.length){for(var e,t=0,n=r[0],i;++t<e;)n.n=i=r[t],i.p=n,n=i;n.n=i=r[0],i.p=n}}function gv(r,e){return r<e?-1:r>e?1:r>=e?0:NaN}function lC(r){return r.length===1&&(r=cC(r)),{left:function(e,t,n,i){for(n==null&&(n=0),i==null&&(i=e.length);n<i;){var s=n+i>>>1;r(e[s],t)<0?n=s+1:i=s}return n},right:function(e,t,n,i){for(n==null&&(n=0),i==null&&(i=e.length);n<i;){var s=n+i>>>1;r(e[s],t)>0?i=s:n=s+1}return n}}}function cC(r){return function(e,t){return gv(r(e),t)}}lC(gv);function mv(r){for(var e=r.length,t,n=-1,i=0,s,o;++n<e;)i+=r[n].length;for(s=new Array(i);--e>=0;)for(o=r[e],t=o.length;--t>=0;)s[--i]=o[t];return s}var xc=1e9,Tc=-1e9;function hC(r,e,t,n){function i(l,c){return r<=l&&l<=t&&e<=c&&c<=n}function s(l,c,h,f){var p=0,v=0;if(l==null||(p=o(l,h))!==(v=o(c,h))||u(l,c)<0^h>0)do f.point(p===0||p===3?r:t,p>1?n:e);while((p=(p+h+4)%4)!==v);else f.point(c[0],c[1])}function o(l,c){return Ke(l[0]-r)<de?c>0?0:3:Ke(l[0]-t)<de?c>0?2:1:Ke(l[1]-e)<de?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var h=o(l,1),f=o(c,1);return h!==f?h-f:h===0?c[1]-l[1]:h===1?l[0]-c[0]:h===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,h=dv(),f,p,v,C,S,P,y,_,m,w,E,b={point:I,lineStart:N,lineEnd:L,polygonStart:D,polygonEnd:x};function I(J,H){i(J,H)&&c.point(J,H)}function T(){for(var J=0,H=0,Z=p.length;H<Z;++H)for(var ct=p[H],mt=1,Y=ct.length,$=ct[0],K,Et,kt=$[0],Nt=$[1];mt<Y;++mt)K=kt,Et=Nt,$=ct[mt],kt=$[0],Nt=$[1],Et<=n?Nt>n&&(kt-K)*(n-Et)>(Nt-Et)*(r-K)&&++J:Nt<=n&&(kt-K)*(n-Et)<(Nt-Et)*(r-K)&&--J;return J}function D(){c=h,f=[],p=[],E=!0}function x(){var J=T(),H=E&&J,Z=(f=mv(f)).length;(H||Z)&&(l.polygonStart(),H&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),Z&&fv(f,a,J,s,l),l.polygonEnd()),c=l,f=p=v=null}function N(){b.point=A,p&&p.push(v=[]),w=!0,m=!1,y=_=NaN}function L(){f&&(A(C,S),P&&m&&h.rejoin(),f.push(h.result())),b.point=I,m&&c.lineEnd()}function A(J,H){var Z=i(J,H);if(p&&v.push([J,H]),w)C=J,S=H,P=Z,w=!1,Z&&(c.lineStart(),c.point(J,H));else if(Z&&m)c.point(J,H);else{var ct=[y=Math.max(Tc,Math.min(xc,y)),_=Math.max(Tc,Math.min(xc,_))],mt=[J=Math.max(Tc,Math.min(xc,J)),H=Math.max(Tc,Math.min(xc,H))];uC(ct,mt,r,e,t,n)?(m||(c.lineStart(),c.point(ct[0],ct[1])),c.point(mt[0],mt[1]),Z||c.lineEnd(),E=!1):Z&&(c.lineStart(),c.point(J,H),E=!1)}y=J,_=H,m=Z}return b}}var Od=Fs();function dC(r,e){var t=e[0],n=e[1],i=[ve(t),-me(t),0],s=0,o=0;Od.reset();for(var a=0,u=r.length;a<u;++a)if(c=(l=r[a]).length)for(var l,c,h=l[c-1],f=h[0],p=h[1]/2+nv,v=ve(p),C=me(p),S=0;S<c;++S,f=y,v=m,C=w,h=P){var P=l[S],y=P[0],_=P[1]/2+nv,m=ve(_),w=me(_),E=y-f,b=E>=0?1:-1,I=b*E,T=I>Ut,D=v*m;if(Od.add(Ma(D*b*ve(I),C*w+D*me(I))),s+=T?E+b*Oi:E,T^f>=t^y>=t){var x=Sc(La(h),La(P));xd(x);var N=Sc(i,x);xd(N);var L=(T^E>=0?-1:1)*bo(N[2]);(n>L||n===L&&(x[0]||x[1]))&&(o+=T^E>=0?1:-1)}}return(s<-1e-6||s<de&&Od<-1e-6)^o&1}Fs();function vv(r){return r}Fs(),Fs();var Fa=1/0,Oc=Fa,ll=-Fa,Nc=ll,yv={point:fC,lineStart:ul,lineEnd:ul,polygonStart:ul,polygonEnd:ul,result:function(){var r=[[Fa,Oc],[ll,Nc]];return ll=Nc=-(Oc=Fa=1/0),r}};function fC(r,e){r<Fa&&(Fa=r),r>ll&&(ll=r),e<Oc&&(Oc=e),e>Nc&&(Nc=e)}Fs();function _v(r,e,t,n){return function(i,s){var o=e(s),a=i.invert(n[0],n[1]),u=dv(),l=e(u),c=!1,h,f,p,v={point:C,lineStart:P,lineEnd:y,polygonStart:function(){v.point=_,v.lineStart=m,v.lineEnd=w,f=[],h=[]},polygonEnd:function(){v.point=C,v.lineStart=P,v.lineEnd=y,f=mv(f);var E=dC(h,a);f.length?(c||(s.polygonStart(),c=!0),fv(f,gC,E,t,s)):E&&(c||(s.polygonStart(),c=!0),s.lineStart(),t(null,null,1,s),s.lineEnd()),c&&(s.polygonEnd(),c=!1),f=h=null},sphere:function(){s.polygonStart(),s.lineStart(),t(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function C(E,b){var I=i(E,b);r(E=I[0],b=I[1])&&s.point(E,b)}function S(E,b){var I=i(E,b);o.point(I[0],I[1])}function P(){v.point=S,o.lineStart()}function y(){v.point=C,o.lineEnd()}function _(E,b){p.push([E,b]);var I=i(E,b);l.point(I[0],I[1])}function m(){l.lineStart(),p=[]}function w(){_(p[0][0],p[0][1]),l.lineEnd();var E=l.clean(),b=u.result(),I,T=b.length,D,x,N;if(p.pop(),h.push(p),p=null,!!T){if(E&1){if(x=b[0],(D=x.length-1)>0){for(c||(s.polygonStart(),c=!0),s.lineStart(),I=0;I<D;++I)s.point((N=x[I])[0],N[1]);s.lineEnd()}return}T>1&&E&2&&b.push(b.pop().concat(b.shift())),f.push(b.filter(pC))}}return v}}function pC(r){return r.length>1}function gC(r,e){return((r=r.x)[0]<0?r[1]-Ti-de:Ti-r[1])-((e=e.x)[0]<0?e[1]-Ti-de:Ti-e[1])}const wv=_v(function(){return!0},mC,yC,[-Ut,-Ti]);function mC(r){var e=NaN,t=NaN,n=NaN,i;return{lineStart:function(){r.lineStart(),i=1},point:function(s,o){var a=s>0?Ut:-Ut,u=Ke(s-e);Ke(u-Ut)<de?(r.point(e,t=(t+o)/2>0?Ti:-Ti),r.point(n,t),r.lineEnd(),r.lineStart(),r.point(a,t),r.point(s,t),i=0):n!==a&&u>=Ut&&(Ke(e-n)<de&&(e-=n*de),Ke(s-a)<de&&(s-=a*de),t=vC(e,t,s,o),r.point(n,t),r.lineEnd(),r.lineStart(),r.point(a,t),i=0),r.point(e=s,t=o),n=a},lineEnd:function(){r.lineEnd(),e=t=NaN},clean:function(){return 2-i}}}function vC(r,e,t,n){var i,s,o=ve(r-t);return Ke(o)>de?iC((ve(e)*(s=me(n))*ve(t)-ve(n)*(i=me(e))*ve(r))/(i*s*o)):(e+n)/2}function yC(r,e,t,n){var i;if(r==null)i=t*Ti,n.point(-Ut,i),n.point(0,i),n.point(Ut,i),n.point(Ut,0),n.point(Ut,-i),n.point(0,-i),n.point(-Ut,-i),n.point(-Ut,0),n.point(-Ut,i);else if(Ke(r[0]-e[0])>de){var s=r[0]<e[0]?Ut:-Ut;i=t*s/2,n.point(-s,i),n.point(0,i),n.point(s,i)}else n.point(e[0],e[1])}function _C(r,e){var t=me(r),n=t>0,i=Ke(t)>de;function s(c,h,f,p){aC(p,r,e,f,c,h)}function o(c,h){return me(c)*me(h)>t}function a(c){var h,f,p,v,C;return{lineStart:function(){v=p=!1,C=1},point:function(S,P){var y=[S,P],_,m=o(S,P),w=n?m?0:l(S,P):m?l(S+(S<0?Ut:-Ut),P):0;if(!h&&(v=p=m)&&c.lineStart(),m!==p&&(_=u(h,y),(!_||Pc(h,_)||Pc(y,_))&&(y[0]+=de,y[1]+=de,m=o(y[0],y[1]))),m!==p)C=0,m?(c.lineStart(),_=u(y,h),c.point(_[0],_[1])):(_=u(h,y),c.point(_[0],_[1]),c.lineEnd()),h=_;else if(i&&h&&n^m){var E;!(w&f)&&(E=u(y,h,!0))&&(C=0,n?(c.lineStart(),c.point(E[0][0],E[0][1]),c.point(E[1][0],E[1][1]),c.lineEnd()):(c.point(E[1][0],E[1][1]),c.lineEnd(),c.lineStart(),c.point(E[0][0],E[0][1])))}m&&(!h||!Pc(h,y))&&c.point(y[0],y[1]),h=y,p=m,f=w},lineEnd:function(){p&&c.lineEnd(),h=null},clean:function(){return C|(v&&p)<<1}}}function u(c,h,f){var p=La(c),v=La(h),C=[1,0,0],S=Sc(p,v),P=Cc(S,S),y=S[0],_=P-y*y;if(!_)return!f&&c;var m=t*P/_,w=-t*y/_,E=Sc(C,S),b=bc(C,m),I=bc(S,w);Id(b,I);var T=E,D=Cc(b,T),x=Cc(T,T),N=D*D-x*(Cc(b,b)-1);if(!(N<0)){var L=Ra(N),A=bc(T,(-D-L)/x);if(Id(A,b),A=Pd(A),!f)return A;var J=c[0],H=h[0],Z=c[1],ct=h[1],mt;H<J&&(mt=J,J=H,H=mt);var Y=H-J,$=Ke(Y-Ut)<de,K=$||Y<de;if(!$&&ct<Z&&(mt=Z,Z=ct,ct=mt),K?$?Z+ct>0^A[1]<(Ke(A[0]-J)<de?Z:ct):Z<=A[1]&&A[1]<=ct:Y>Ut^(J<=A[0]&&A[0]<=H)){var Et=bc(T,(-D+L)/x);return Id(Et,b),[A,Pd(Et)]}}}function l(c,h){var f=n?r:Ut-r,p=0;return c<-f?p|=1:c>f&&(p|=2),h<-f?p|=4:h>f&&(p|=8),p}return _v(o,a,s,n?[0,-r]:[-Ut,r-Ut])}function Ev(r){return function(e){var t=new Nd;for(var n in r)t[n]=r[n];return t.stream=e,t}}function Nd(){}Nd.prototype={constructor:Nd,point:function(r,e){this.stream.point(r,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Cv(r,e,t){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],s=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),s!=null&&r.clipExtent(null),sC(t,r.stream(yv));var o=yv.result(),a=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),u=+e[0][0]+(n-a*(o[1][0]+o[0][0]))/2,l=+e[0][1]+(i-a*(o[1][1]+o[0][1]))/2;return s!=null&&r.clipExtent(s),r.scale(a*150).translate([u,l])}function wC(r,e,t){return Cv(r,[[0,0],e],t)}var Sv=16,EC=me(30*Ir);function bv(r,e){return+e?SC(r,e):CC(r)}function CC(r){return Ev({point:function(e,t){e=r(e,t),this.stream.point(e[0],e[1])}})}function SC(r,e){function t(n,i,s,o,a,u,l,c,h,f,p,v,C,S){var P=l-n,y=c-i,_=P*P+y*y;if(_>4*e&&C--){var m=o+f,w=a+p,E=u+v,b=Ra(m*m+w*w+E*E),I=bo(E/=b),T=Ke(Ke(E)-1)<de||Ke(s-h)<de?(s+h)/2:Ma(w,m),D=r(T,I),x=D[0],N=D[1],L=x-n,A=N-i,J=y*L-P*A;(J*J/_>e||Ke((P*L+y*A)/_-.5)>.3||o*f+a*p+u*v<EC)&&(t(n,i,s,o,a,u,x,N,T,m/=b,w/=b,E,C,S),S.point(x,N),t(x,N,T,m,w,E,l,c,h,f,p,v,C,S))}}return function(n){var i,s,o,a,u,l,c,h,f,p,v,C,S={point:P,lineStart:y,lineEnd:m,polygonStart:function(){n.polygonStart(),S.lineStart=w},polygonEnd:function(){n.polygonEnd(),S.lineStart=y}};function P(I,T){I=r(I,T),n.point(I[0],I[1])}function y(){h=NaN,S.point=_,n.lineStart()}function _(I,T){var D=La([I,T]),x=r(I,T);t(h,f,c,p,v,C,h=x[0],f=x[1],c=I,p=D[0],v=D[1],C=D[2],Sv,n),n.point(h,f)}function m(){S.point=P,n.lineEnd()}function w(){y(),S.point=E,S.lineEnd=b}function E(I,T){_(i=I,T),s=h,o=f,a=p,u=v,l=C,S.point=_}function b(){t(h,f,c,p,v,C,s,o,i,a,u,l,Sv,n),S.lineEnd=m,m()}return S}}var bC=Ev({point:function(r,e){this.stream.point(r*Ir,e*Ir)}});function PC(r){return IC(function(){return r})()}function IC(r){var e,t=150,n=480,i=250,s,o,a=0,u=0,l=0,c=0,h=0,f,p,v=null,C=wv,S=null,P,y,_,m=vv,w=.5,E=bv(x,w),b,I;function T(A){return A=p(A[0]*Ir,A[1]*Ir),[A[0]*t+s,o-A[1]*t]}function D(A){return A=p.invert((A[0]-s)/t,(o-A[1])/t),A&&[A[0]*As,A[1]*As]}function x(A,J){return A=e(A,J),[A[0]*t+s,o-A[1]*t]}T.stream=function(A){return b&&I===A?b:b=bC(C(f,E(m(I=A))))},T.clipAngle=function(A){return arguments.length?(C=+A?_C(v=A*Ir,6*Ir):(v=null,wv),L()):v*As},T.clipExtent=function(A){return arguments.length?(m=A==null?(S=P=y=_=null,vv):hC(S=+A[0][0],P=+A[0][1],y=+A[1][0],_=+A[1][1]),L()):S==null?null:[[S,P],[y,_]]},T.scale=function(A){return arguments.length?(t=+A,N()):t},T.translate=function(A){return arguments.length?(n=+A[0],i=+A[1],N()):[n,i]},T.center=function(A){return arguments.length?(a=A[0]%360*Ir,u=A[1]%360*Ir,N()):[a*As,u*As]},T.rotate=function(A){return arguments.length?(l=A[0]%360*Ir,c=A[1]%360*Ir,h=A.length>2?A[2]%360*Ir:0,N()):[l*As,c*As,h*As]},T.precision=function(A){return arguments.length?(E=bv(x,w=A*A),L()):Ra(w)},T.fitExtent=function(A,J){return Cv(T,A,J)},T.fitSize=function(A,J){return wC(T,A,J)};function N(){p=av(f=oC(l,c,h),e);var A=e(a,u);return s=n-A[0]*t,o=i+A[1]*t,L()}function L(){return b=I=null,T}return function(){return e=r.apply(this,arguments),T.invert=e.invert&&D,N()}}function Pv(r){return function(e,t){var n=me(e),i=me(t),s=r(n*i);return[s*i*ve(e),s*ve(t)]}}function Iv(r){return function(e,t){var n=Ra(e*e+t*t),i=r(n),s=ve(i),o=me(i);return[Ma(e*s,n*o),bo(n&&t*s/n)]}}var xC=Pv(function(r){return Ra(2/(1+r))});xC.invert=Iv(function(r){return 2*bo(r/2)});var xv=Pv(function(r){return(r=rv(r))&&r/ve(r)});xv.invert=Iv(function(r){return r});function TC(){return PC(xv).scale(79.4188).clipAngle(180-.001)}function Tv(r,e){return[r,e]}Tv.invert=Tv;function OC(r,e,t){t=t||{};var n=t.units||"kilometers",i=t.steps||8;if(!r)throw new Error("geojson is required");if(typeof t!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(e===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var s=[];switch(r.type){case"GeometryCollection":return $l(r,function(o){var a=Dc(o,e,n,i);a&&s.push(a)}),oa(s);case"FeatureCollection":return Jl(r,function(o){var a=Dc(o,e,n,i);a&&Jl(a,function(u){u&&s.push(u)})}),oa(s)}return Dc(r,e,n,i)}function Dc(r,e,t,n){var i=r.properties||{},s=r.type==="Feature"?r.geometry:r;if(s.type==="GeometryCollection"){var o=[];return $l(r,function(C){var S=Dc(C,e,t,n);S&&o.push(S)}),oa(o)}var a=NC(s),u={type:s.type,coordinates:Nv(s.coordinates,a)},l=new pd,c=l.read(u),h=Jh($h(e,t),"meters"),f=Ne.bufferOp(c,h,n),p=new Fm;if(f=p.write(f),!Ov(f.coordinates)){var v={type:f.type,coordinates:Dv(f.coordinates,a)};return jr(v,i)}}function Ov(r){return Array.isArray(r[0])?Ov(r[0]):isNaN(r[0])}function Nv(r,e){return typeof r[0]!="object"?e(r):r.map(function(t){return Nv(t,e)})}function Dv(r,e){return typeof r[0]!="object"?e.invert(r):r.map(function(t){return Dv(t,e)})}function NC(r){var e=BE(r).geometry.coordinates,t=[-e[0],-e[1]];return TC().rotate(t).scale(tn)}function DC(r,e,t){t===void 0&&(t={});for(var n=t.steps||64,i=t.properties?t.properties:!Array.isArray(r)&&r.type==="Feature"&&r.properties?r.properties:{},s=[],o=0;o<n;o++)s.push(aa(r,e,o*-360/n,t).geometry.coordinates);return s.push(s[0]),Pn([s],i)}/**
45
45
  * splaytree v3.1.2
46
46
  * Fast Splay tree for Node and browser
47
47
  *
@@ -61,11 +61,11 @@ ${u.map(c=>`${c.id} ${c.typeName}
61
61
 
62
62
  See the Apache Version 2.0 License for specific language governing permissions
63
63
  and limitations under the License.
64
- ***************************************************************************** */function DC(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(c){l=[6,c],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var ks=function(){function r(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return r}();function MC(r,e){return r>e?1:r<e?-1:0}function Vs(r,e,t){for(var n=new ks(null,null),i=n,s=n;;){var o=t(r,e.key);if(o<0){if(e.left===null)break;if(t(r,e.left.key)<0){var a=e.left;if(e.left=a.right,a.right=e,e=a,e.left===null)break}s.left=e,s=e,e=e.left}else if(o>0){if(e.right===null)break;if(t(r,e.right.key)>0){var a=e.right;if(e.right=a.left,a.left=e,e=a,e.right===null)break}i.right=e,i=e,e=e.right}else break}return i.right=e.left,s.left=e.right,e.left=n.right,e.right=n.left,e}function Dd(r,e,t,n){var i=new ks(r,e);if(t===null)return i.left=i.right=null,i;t=Vs(r,t,n);var s=n(r,t.key);return s<0?(i.left=t.left,i.right=t,t.left=null):s>=0&&(i.right=t.right,i.left=t,t.right=null),i}function Mv(r,e,t){var n=null,i=null;if(e){e=Vs(r,e,t);var s=t(e.key,r);s===0?(n=e.left,i=e.right):s<0?(i=e.right,e.right=null,n=e):(n=e.left,e.left=null,i=e)}return{left:n,right:i}}function RC(r,e,t){return e===null?r:(r===null||(e=Vs(r.key,e,t),e.left=r),e)}function Md(r,e,t,n,i){if(r){n(""+e+(t?"└── ":"├── ")+i(r)+`
65
- `);var s=e+(t?" ":"│ ");r.left&&Md(r.left,s,!1,n,i),r.right&&Md(r.right,s,!0,n,i)}}var Rd=function(){function r(e){e===void 0&&(e=MC),this._root=null,this._size=0,this._comparator=e}return r.prototype.insert=function(e,t){return this._size++,this._root=Dd(e,t,this._root,this._comparator)},r.prototype.add=function(e,t){var n=new ks(e,t);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,s=Vs(e,this._root,i),o=i(e,s.key);return o===0?this._root=s:(o<0?(n.left=s.left,n.right=s,s.left=null):o>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},r.prototype._remove=function(e,t,n){var i;if(t===null)return null;t=Vs(e,t,n);var s=n(e,t.key);return s===0?(t.left===null?i=t.right:(i=Vs(e,t.left,n),i.right=t.right),this._size--,i):t},r.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=Vs(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},r.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var i=n(e,t.key);if(i===0)return t;i<0?t=t.left:t=t.right}return null},r.prototype.find=function(e){return this._root&&(this._root=Vs(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},r.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var i=n(e,t.key);if(i===0)return!0;i<0?t=t.left:t=t.right}return!1},r.prototype.forEach=function(e,t){for(var n=this._root,i=[],s=!1;!s;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),e.call(t,n),n=n.right):s=!0;return this},r.prototype.range=function(e,t,n,i){for(var s=[],o=this._comparator,a=this._root,u;s.length!==0||a;)if(a)s.push(a),a=a.left;else{if(a=s.pop(),u=o(a.key,t),u>0)break;if(o(a.key,e)>=0&&n.call(i,a))return this;a=a.right}return this},r.prototype.keys=function(){var e=[];return this.forEach(function(t){var n=t.key;return e.push(n)}),e},r.prototype.values=function(){var e=[];return this.forEach(function(t){var n=t.data;return e.push(n)}),e},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},r.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},r.prototype.at=function(e){for(var t=this._root,n=!1,i=0,s=[];!n;)if(t)s.push(t),t=t.left;else if(s.length>0){if(t=s.pop(),i===e)return t;i++,t=t.right}else n=!0;return null},r.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var i=this._comparator;t;){var s=i(e.key,t.key);if(s===0)break;s<0?(n=t,t=t.left):t=t.right}return n},r.prototype.prev=function(e){var t=this._root,n=null;if(e.left!==null){for(n=e.left;n.right;)n=n.right;return n}for(var i=this._comparator;t;){var s=i(e.key,t.key);if(s===0)break;s<0?t=t.left:(n=t,t=t.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return FC(this._root)},r.prototype.load=function(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!1);var i=e.length,s=this._comparator;if(n&&Ad(e,t,0,i-1,s),this._root===null)this._root=Ld(e,t,0,i),this._size=i;else{var o=AC(this.toList(),LC(e,t),s);i=this._size+i,this._root=Fd({head:o},0,i)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(e){e===void 0&&(e=function(n){return String(n.key)});var t=[];return Md(this._root,"",!0,function(n){return t.push(n)},e),t.join("")},r.prototype.update=function(e,t,n){var i=this._comparator,s=Mv(e,this._root,i),o=s.left,a=s.right;i(e,t)<0?a=Dd(t,n,a,i):o=Dd(t,n,o,i),this._root=RC(o,a,i)},r.prototype.split=function(e){return Mv(e,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var e,t,n;return DC(this,function(i){switch(i.label){case 0:e=this._root,t=[],n=!1,i.label=1;case 1:return n?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return i.sent(),e=e.right,[3,5];case 4:n=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},r}();function Ld(r,e,t,n){var i=n-t;if(i>0){var s=t+Math.floor(i/2),o=r[s],a=e[s],u=new ks(o,a);return u.left=Ld(r,e,t,s),u.right=Ld(r,e,s+1,n),u}return null}function LC(r,e){for(var t=new ks(null,null),n=t,i=0;i<r.length;i++)n=n.next=new ks(r[i],e[i]);return n.next=null,t.next}function FC(r){for(var e=r,t=[],n=!1,i=new ks(null,null),s=i;!n;)e?(t.push(e),e=e.left):t.length>0?(e=s=s.next=t.pop(),e=e.right):n=!0;return s.next=null,i.next}function Fd(r,e,t){var n=t-e;if(n>0){var i=e+Math.floor(n/2),s=Fd(r,e,i),o=r.head;return o.left=s,r.head=r.head.next,o.right=Fd(r,i+1,t),o}return null}function AC(r,e,t){for(var n=new ks(null,null),i=n,s=r,o=e;s!==null&&o!==null;)t(s.key,o.key)<0?(i.next=s,s=s.next):(i.next=o,o=o.next),i=i.next;return s!==null?i.next=s:o!==null&&(i.next=o),n.next}function Ad(r,e,t,n,i){if(!(t>=n)){for(var s=r[t+n>>1],o=t-1,a=n+1;;){do o++;while(i(r[o],s)<0);do a--;while(i(r[a],s)>0);if(o>=a)break;var u=r[o];r[o]=r[a],r[a]=u,u=e[o],e[o]=e[a],e[a]=u}Ad(r,e,t,a,i),Ad(r,e,a+1,n,i)}}const as=11102230246251565e-32,vn=134217729,kC=(3+8*as)*as;function kd(r,e,t,n,i){let s,o,a,u,l=e[0],c=n[0],h=0,f=0;c>l==c>-l?(s=l,l=e[++h]):(s=c,c=n[++f]);let p=0;if(h<r&&f<t)for(c>l==c>-l?(o=l+s,a=s-(o-l),l=e[++h]):(o=c+s,a=s-(o-c),c=n[++f]),s=o,a!==0&&(i[p++]=a);h<r&&f<t;)c>l==c>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=e[++h]):(o=s+c,u=o-s,a=s-(o-u)+(c-u),c=n[++f]),s=o,a!==0&&(i[p++]=a);for(;h<r;)o=s+l,u=o-s,a=s-(o-u)+(l-u),l=e[++h],s=o,a!==0&&(i[p++]=a);for(;f<t;)o=s+c,u=o-s,a=s-(o-u)+(c-u),c=n[++f],s=o,a!==0&&(i[p++]=a);return(s!==0||p===0)&&(i[p++]=s),p}function VC(r,e){let t=e[0];for(let n=1;n<r;n++)t+=e[n];return t}function cl(r){return new Float64Array(r)}const jC=(3+16*as)*as,BC=(2+12*as)*as,zC=(9+64*as)*as*as,Aa=cl(4),Rv=cl(8),Lv=cl(12),Fv=cl(16),Ln=cl(4);function UC(r,e,t,n,i,s,o){let a,u,l,c,h,f,p,v,C,S,P,y,_,m,w,E,b,I;const T=r-i,D=t-i,x=e-s,N=n-s;m=T*N,f=vn*T,p=f-(f-T),v=T-p,f=vn*N,C=f-(f-N),S=N-C,w=v*S-(m-p*C-v*C-p*S),E=x*D,f=vn*x,p=f-(f-x),v=x-p,f=vn*D,C=f-(f-D),S=D-C,b=v*S-(E-p*C-v*C-p*S),P=w-b,h=w-P,Aa[0]=w-(P+h)+(h-b),y=m+P,h=y-m,_=m-(y-h)+(P-h),P=_-E,h=_-P,Aa[1]=_-(P+h)+(h-E),I=y+P,h=I-y,Aa[2]=y-(I-h)+(P-h),Aa[3]=I;let L=VC(4,Aa),A=BC*o;if(L>=A||-L>=A||(h=r-T,a=r-(T+h)+(h-i),h=t-D,l=t-(D+h)+(h-i),h=e-x,u=e-(x+h)+(h-s),h=n-N,c=n-(N+h)+(h-s),a===0&&u===0&&l===0&&c===0)||(A=zC*o+kC*Math.abs(L),L+=T*c+N*a-(x*l+D*u),L>=A||-L>=A))return L;m=a*N,f=vn*a,p=f-(f-a),v=a-p,f=vn*N,C=f-(f-N),S=N-C,w=v*S-(m-p*C-v*C-p*S),E=u*D,f=vn*u,p=f-(f-u),v=u-p,f=vn*D,C=f-(f-D),S=D-C,b=v*S-(E-p*C-v*C-p*S),P=w-b,h=w-P,Ln[0]=w-(P+h)+(h-b),y=m+P,h=y-m,_=m-(y-h)+(P-h),P=_-E,h=_-P,Ln[1]=_-(P+h)+(h-E),I=y+P,h=I-y,Ln[2]=y-(I-h)+(P-h),Ln[3]=I;const J=kd(4,Aa,4,Ln,Rv);m=T*c,f=vn*T,p=f-(f-T),v=T-p,f=vn*c,C=f-(f-c),S=c-C,w=v*S-(m-p*C-v*C-p*S),E=x*l,f=vn*x,p=f-(f-x),v=x-p,f=vn*l,C=f-(f-l),S=l-C,b=v*S-(E-p*C-v*C-p*S),P=w-b,h=w-P,Ln[0]=w-(P+h)+(h-b),y=m+P,h=y-m,_=m-(y-h)+(P-h),P=_-E,h=_-P,Ln[1]=_-(P+h)+(h-E),I=y+P,h=I-y,Ln[2]=y-(I-h)+(P-h),Ln[3]=I;const H=kd(J,Rv,4,Ln,Lv);m=a*c,f=vn*a,p=f-(f-a),v=a-p,f=vn*c,C=f-(f-c),S=c-C,w=v*S-(m-p*C-v*C-p*S),E=u*l,f=vn*u,p=f-(f-u),v=u-p,f=vn*l,C=f-(f-l),S=l-C,b=v*S-(E-p*C-v*C-p*S),P=w-b,h=w-P,Ln[0]=w-(P+h)+(h-b),y=m+P,h=y-m,_=m-(y-h)+(P-h),P=_-E,h=_-P,Ln[1]=_-(P+h)+(h-E),I=y+P,h=I-y,Ln[2]=y-(I-h)+(P-h),Ln[3]=I;const Z=kd(H,Lv,4,Ln,Fv);return Fv[Z-1]}function GC(r,e,t,n,i,s){const o=(e-s)*(t-i),a=(r-i)*(n-s),u=o-a,l=Math.abs(o+a);return Math.abs(u)>=jC*l?u:-UC(r,e,t,n,i,s,l)}const hl=(r,e)=>r.ll.x<=e.x&&e.x<=r.ur.x&&r.ll.y<=e.y&&e.y<=r.ur.y,Vd=(r,e)=>{if(e.ur.x<r.ll.x||r.ur.x<e.ll.x||e.ur.y<r.ll.y||r.ur.y<e.ll.y)return null;const t=r.ll.x<e.ll.x?e.ll.x:r.ll.x,n=r.ur.x<e.ur.x?r.ur.x:e.ur.x,i=r.ll.y<e.ll.y?e.ll.y:r.ll.y,s=r.ur.y<e.ur.y?r.ur.y:e.ur.y;return{ll:{x:t,y:i},ur:{x:n,y:s}}};let js=Number.EPSILON;js===void 0&&(js=Math.pow(2,-52));const WC=js*js,Av=(r,e)=>{if(-js<r&&r<js&&-js<e&&e<js)return 0;const t=r-e;return t*t<WC*r*e?0:r<e?-1:1};class HC{constructor(){this.reset()}reset(){this.xRounder=new kv,this.yRounder=new kv}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class kv{constructor(){this.tree=new Rd,this.round(0)}round(e){const t=this.tree.add(e),n=this.tree.prev(t);if(n!==null&&Av(t.key,n.key)===0)return this.tree.remove(e),n.key;const i=this.tree.next(t);return i!==null&&Av(t.key,i.key)===0?(this.tree.remove(e),i.key):e}}const dl=new HC,Mc=(r,e)=>r.x*e.y-r.y*e.x,Vv=(r,e)=>r.x*e.x+r.y*e.y,jv=(r,e,t)=>{const n=GC(r.x,r.y,e.x,e.y,t.x,t.y);return n>0?-1:n<0?1:0},Rc=r=>Math.sqrt(Vv(r,r)),qC=(r,e,t)=>{const n={x:e.x-r.x,y:e.y-r.y},i={x:t.x-r.x,y:t.y-r.y};return Mc(i,n)/Rc(i)/Rc(n)},XC=(r,e,t)=>{const n={x:e.x-r.x,y:e.y-r.y},i={x:t.x-r.x,y:t.y-r.y};return Vv(i,n)/Rc(i)/Rc(n)},Bv=(r,e,t)=>e.y===0?null:{x:r.x+e.x/e.y*(t-r.y),y:t},zv=(r,e,t)=>e.x===0?null:{x:t,y:r.y+e.y/e.x*(t-r.x)},YC=(r,e,t,n)=>{if(e.x===0)return zv(t,n,r.x);if(n.x===0)return zv(r,e,t.x);if(e.y===0)return Bv(t,n,r.y);if(n.y===0)return Bv(r,e,t.y);const i=Mc(e,n);if(i==0)return null;const s={x:t.x-r.x,y:t.y-r.y},o=Mc(s,e)/i,a=Mc(s,n)/i,u=r.x+a*e.x,l=t.x+o*n.x,c=r.y+a*e.y,h=t.y+o*n.y,f=(u+l)/2,p=(c+h)/2;return{x:f,y:p}};class xr{static compare(e,t){const n=xr.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Bs.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,i=t.length;n<i;n++){const s=t[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let i=t+1;i<e;i++){const s=this.point.events[i];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const i=this.point.events[t];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&e.push(i)}return e}getLeftmostComparator(e){const t=new Map,n=i=>{const s=i.otherSE;t.set(i,{sine:qC(this.point,e.point,s.point),cosine:XC(this.point,e.point,s.point)})};return(i,s)=>{t.has(i)||n(i),t.has(s)||n(s);const{sine:o,cosine:a}=t.get(i),{sine:u,cosine:l}=t.get(s);return o>=0&&u>=0?a<l?1:a>l?-1:0:o<0&&u<0?a<l?-1:a>l?1:0:u<o?-1:u>o?1:0}}}let JC=0;class Bs{static compare(e,t){const n=e.leftSE.point.x,i=t.leftSE.point.x,s=e.rightSE.point.x,o=t.rightSE.point.x;if(o<n)return 1;if(s<i)return-1;const a=e.leftSE.point.y,u=t.leftSE.point.y,l=e.rightSE.point.y,c=t.rightSE.point.y;if(n<i){if(u<a&&u<l)return 1;if(u>a&&u>l)return-1;const h=e.comparePoint(t.leftSE.point);if(h<0)return 1;if(h>0)return-1;const f=t.comparePoint(e.rightSE.point);return f!==0?f:-1}if(n>i){if(a<u&&a<c)return-1;if(a>u&&a>c)return 1;const h=t.comparePoint(e.leftSE.point);if(h!==0)return h;const f=e.comparePoint(t.rightSE.point);return f<0?1:f>0?-1:1}if(a<u)return-1;if(a>u)return 1;if(s<o){const h=t.comparePoint(e.rightSE.point);if(h!==0)return h}if(s>o){const h=e.comparePoint(t.rightSE.point);if(h<0)return 1;if(h>0)return-1}if(s!==o){const h=l-a,f=s-n,p=c-u,v=o-i;if(h>f&&p<v)return 1;if(h<f&&p>v)return-1}return s>o?1:s<o||l<c?-1:l>c?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,n,i){this.id=++JC,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=i}static fromRing(e,t,n){let i,s,o;const a=xr.comparePoints(e,t);if(a<0)i=e,s=t,o=1;else if(a>0)i=t,s=e,o=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const u=new xr(i,!0),l=new xr(s,!1);return new Bs(u,l,[n],[o])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,n=this.rightSE.point,i=this.vector();if(t.x===n.x)return e.x===t.x?0:e.x<t.x?1:-1;const s=(e.y-t.y)/i.y,o=t.x+s*i.x;if(e.x===o)return 0;const a=(e.x-t.x)/i.x,u=t.y+a*i.y;return e.y===u?0:e.y<u?-1:1}getIntersection(e){const t=this.bbox(),n=e.bbox(),i=Vd(t,n);if(i===null)return null;const s=this.leftSE.point,o=this.rightSE.point,a=e.leftSE.point,u=e.rightSE.point,l=hl(t,a)&&this.comparePoint(a)===0,c=hl(n,s)&&e.comparePoint(s)===0,h=hl(t,u)&&this.comparePoint(u)===0,f=hl(n,o)&&e.comparePoint(o)===0;if(c&&l)return f&&!h?o:!f&&h?u:null;if(c)return h&&s.x===u.x&&s.y===u.y?null:s;if(l)return f&&o.x===a.x&&o.y===a.y?null:a;if(f&&h)return null;if(f)return o;if(h)return u;const p=YC(s,this.vector(),a,e.vector());return p===null||!hl(i,p)?null:dl.round(p.x,p.y)}split(e){const t=[],n=e.events!==void 0,i=new xr(e,!0),s=new xr(e,!1),o=this.rightSE;this.replaceRightSE(s),t.push(s),t.push(i);const a=new Bs(i,o,this.rings.slice(),this.windings.slice());return xr.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),xr.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),s.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const i=Bs.compare(t,n);if(i!==0){if(i>0){const s=t;t=n,n=s}if(t.prev===n){const s=t;t=n,n=s}for(let s=0,o=n.rings.length;s<o;s++){const a=n.rings[s],u=n.windings[s],l=t.rings.indexOf(a);l===-1?(t.rings.push(a),t.windings.push(u)):t.windings[l]+=u}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let a=0,u=this.rings.length;a<u;a++){const l=this.rings[a],c=this.windings[a],h=t.indexOf(l);h===-1?(t.push(l),n.push(c)):n[h]+=c}const s=[],o=[];for(let a=0,u=t.length;a<u;a++){if(n[a]===0)continue;const l=t[a],c=l.poly;if(o.indexOf(c)===-1)if(l.isExterior)s.push(c);else{o.indexOf(c)===-1&&o.push(c);const h=s.indexOf(l.poly);h!==-1&&s.splice(h,1)}}for(let a=0,u=s.length;a<u;a++){const l=s[a].multiPoly;i.indexOf(l)===-1&&i.push(l)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(ni.type){case"union":{const n=e.length===0,i=t.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;e.length<t.length?(n=e.length,i=t.length):(n=t.length,i=e.length),this._isInResult=i===ni.numMultiPolys&&n<i;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2===1;break}case"difference":{const n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(e)!==n(t);break}default:throw new Error(`Unrecognized operation type found ${ni.type}`)}return this._isInResult}}class Uv{constructor(e,t,n){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=n,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=dl.round(e[0][0],e[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let s=i;for(let o=1,a=e.length;o<a;o++){if(typeof e[o][0]!="number"||typeof e[o][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let u=dl.round(e[o][0],e[o][1]);u.x===s.x&&u.y===s.y||(this.segments.push(Bs.fromRing(s,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),s=u)}(i.x!==s.x||i.y!==s.y)&&this.segments.push(Bs.fromRing(s,i,this))}getSweepEvents(){const e=[];for(let t=0,n=this.segments.length;t<n;t++){const i=this.segments[t];e.push(i.leftSE),e.push(i.rightSE)}return e}}class $C{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Uv(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,i=e.length;n<i;n++){const s=new Uv(e[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,n=this.interiorRings.length;t<n;t++){const i=this.interiorRings[t].getSweepEvents();for(let s=0,o=i.length;s<o;s++)e.push(i[s])}return e}}class Gv{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,i=e.length;n<i;n++){const s=new $C(e[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const i=this.polys[t].getSweepEvents();for(let s=0,o=i.length;s<o;s++)e.push(i[s])}return e}}class Lc{static factory(e){const t=[];for(let n=0,i=e.length;n<i;n++){const s=e[n];if(!s.isInResult()||s.ringOut)continue;let o=null,a=s.leftSE,u=s.rightSE;const l=[a],c=a.point,h=[];for(;o=a,a=u,l.push(a),a.point!==c;)for(;;){const f=a.getAvailableLinkedEvents();if(f.length===0){const C=l[0].point,S=l[l.length-1].point;throw new Error(`Unable to complete output ring starting at [${C.x}, ${C.y}]. Last matching segment found ends at [${S.x}, ${S.y}].`)}if(f.length===1){u=f[0].otherSE;break}let p=null;for(let C=0,S=h.length;C<S;C++)if(h[C].point===a.point){p=C;break}if(p!==null){const C=h.splice(p)[0],S=l.splice(C.index);S.unshift(S[0].otherSE),t.push(new Lc(S.reverse()));continue}h.push({index:l.length,point:a.point});const v=a.getLeftmostComparator(o);u=f.sort(v)[0].otherSE;break}t.push(new Lc(l))}return t}constructor(e){this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let l=1,c=this.events.length-1;l<c;l++){const h=this.events[l].point,f=this.events[l+1].point;jv(h,e,f)!==0&&(t.push(h),e=h)}if(t.length===1)return null;const n=t[0],i=t[1];jv(n,e,i)===0&&t.shift(),t.push(t[0]);const s=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:t.length-1,a=this.isExteriorRing()?t.length:-1,u=[];for(let l=o;l!=a;l+=s)u.push([t[l].x,t[l].y]);return u}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let i=1,s=this.events.length;i<s;i++){const o=this.events[i];xr.compare(e,o)>0&&(e=o)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return n.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}}class Wv{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,n=this.interiorRings.length;t<n;t++){const i=this.interiorRings[t].getGeom();i!==null&&e.push(i)}return e}}class KC{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const i=this.polys[t].getGeom();i!==null&&e.push(i)}return e}_composePolys(e){const t=[];for(let n=0,i=e.length;n<i;n++){const s=e[n];if(!s.poly)if(s.isExteriorRing())t.push(new Wv(s));else{const o=s.enclosingRing();o.poly||t.push(new Wv(o)),o.poly.addInterior(s)}}return t}}class ZC{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bs.compare;this.queue=e,this.tree=new Rd(t),this.segments=[]}process(e){const t=e.segment,n=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),n;const i=e.isLeft?this.tree.add(t):this.tree.find(t);if(!i)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let s=i,o=i,a,u;for(;a===void 0;)s=this.tree.prev(s),s===null?a=null:s.key.consumedBy===void 0&&(a=s.key);for(;u===void 0;)o=this.tree.next(o),o===null?u=null:o.key.consumedBy===void 0&&(u=o.key);if(e.isLeft){let l=null;if(a){const h=a.getIntersection(t);if(h!==null&&(t.isAnEndpoint(h)||(l=h),!a.isAnEndpoint(h))){const f=this._splitSafely(a,h);for(let p=0,v=f.length;p<v;p++)n.push(f[p])}}let c=null;if(u){const h=u.getIntersection(t);if(h!==null&&(t.isAnEndpoint(h)||(c=h),!u.isAnEndpoint(h))){const f=this._splitSafely(u,h);for(let p=0,v=f.length;p<v;p++)n.push(f[p])}}if(l!==null||c!==null){let h=null;l===null?h=c:c===null?h=l:h=xr.comparePoints(l,c)<=0?l:c,this.queue.remove(t.rightSE),n.push(t.rightSE);const f=t.split(h);for(let p=0,v=f.length;p<v;p++)n.push(f[p])}n.length>0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=a)}else{if(a&&u){const l=a.getIntersection(u);if(l!==null){if(!a.isAnEndpoint(l)){const c=this._splitSafely(a,l);for(let h=0,f=c.length;h<f;h++)n.push(c[h])}if(!u.isAnEndpoint(l)){const c=this._splitSafely(u,l);for(let h=0,f=c.length;h<f;h++)n.push(c[h])}}}this.tree.remove(t)}return n}_splitSafely(e,t){this.tree.remove(e);const n=e.rightSE;this.queue.remove(n);const i=e.split(t);return i.push(n),e.consumedBy===void 0&&this.tree.add(e),i}}const Hv=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,QC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class tS{run(e,t,n){ni.type=e,dl.reset();const i=[new Gv(t,!0)];for(let h=0,f=n.length;h<f;h++)i.push(new Gv(n[h],!1));if(ni.numMultiPolys=i.length,ni.type==="difference"){const h=i[0];let f=1;for(;f<i.length;)Vd(i[f].bbox,h.bbox)!==null?f++:i.splice(f,1)}if(ni.type==="intersection")for(let h=0,f=i.length;h<f;h++){const p=i[h];for(let v=h+1,C=i.length;v<C;v++)if(Vd(p.bbox,i[v].bbox)===null)return[]}const s=new Rd(xr.compare);for(let h=0,f=i.length;h<f;h++){const p=i[h].getSweepEvents();for(let v=0,C=p.length;v<C;v++)if(s.insert(p[v]),s.size>Hv)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new ZC(s);let a=s.size,u=s.pop();for(;u;){const h=u.key;if(s.size===a){const p=h.segment;throw new Error(`Unable to pop() ${h.isLeft?"left":"right"} SweepEvent [${h.point.x}, ${h.point.y}] from segment #${p.id} [${p.leftSE.point.x}, ${p.leftSE.point.y}] -> [${p.rightSE.point.x}, ${p.rightSE.point.y}] from queue.`)}if(s.size>Hv)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>QC)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=o.process(h);for(let p=0,v=f.length;p<v;p++){const C=f[p];C.consumedBy===void 0&&s.insert(C)}a=s.size,u=s.pop()}dl.reset();const l=Lc.factory(o.segments);return new KC(l).getGeom()}}const ni=new tS;var jd={union:function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ni.run("union",r,t)},intersection:function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ni.run("intersection",r,t)},xor:function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ni.run("xor",r,t)},difference:function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ni.run("difference",r,t)}};function eS(r,e){var t=Jn(r),n=Jn(e),i=r.properties||{},s=jd.difference(t.coordinates,n.coordinates);return s.length===0?null:s.length===1?Pn(s[0],i):Yh(s,i)}function nS(r,e,t){t===void 0&&(t={});var n=Jn(r),i=Jn(e),s=jd.intersection(n.coordinates,i.coordinates);return s.length===0?null:s.length===1?Pn(s[0],t.properties):Yh(s,t.properties)}function rS(r,e,t){t===void 0&&(t={});var n=Jn(r),i=Jn(e),s=jd.union(n.coordinates,i.coordinates);return s.length===0?null:s.length===1?Pn(s[0],t.properties):Yh(s,t.properties)}function qv(r,e){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=nS(Pn([r]),Pn([e]));if(t)return t.geometry.coordinates}function Xv(r,e){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=rS(Pn([r]),Pn([e]));if(t)return t.geometry.coordinates}function Yv(r,e=500,t="meters"){const n=TC(Br(r),e,{units:t});if(n)return n.geometry.coordinates}function Jv(r,e){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=eS(Pn([r]),Pn([e]));if(t)return t.geometry.coordinates}function $v(r,e,t=10,n="meters"){return NC(r,e,{steps:t,units:n}).geometry.coordinates}function Bd(r,e){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=Pn([r]),n=Pn([e]);return EE(t,n)?"oneBig":NE(t,n)?"twoBig":!1}function Kv(r){const e=ys(Qs(r,["0"])),t=ys(Qs(r,["1"])),n=ys(Qs(r,["2"])),i=Wi(Qs(r,["0"])),s=Wi(Qs(r,["1"])),o=Wi(Qs(r,["2"]));return{minPos:[e,t,n],maxPos:[i,s,o],center:[(e+i)*.5,(t+s)*.5,(n+o)*.5]}}function Zv(r){const{minPos:e,maxPos:t,center:n}=Kv(r);if(e.some(a=>!Number.isFinite(a)||t.some(u=>!Number.isFinite(u))||n.some(u=>!Number.isFinite(u)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const i=Ql(e,t);let s=i*.5;const o=Math.abs(e[2]-t[2]);return o!=0&&(s=Math.sqrt(i*i+o*o)*.5),{center:n,radius:s}}function Qv(r,e){const t=Vr(r),n=Vr(e);return g.Vector.distance(t,n)}function fl(r,e){const t=[],n=r.length;let i=0;for(let s=0;s<n-1;++s){if(e===void 0||e==="GEODESIC"){const o=Ql(r[s],r[s+1]),a=Math.abs(r[s][2]-r[s+1][2]);if(a===0)i+=o;else{const u=Math.sqrt(o*o+a*a);i+=u}}else if(e==="RHUMB"){const o=ym(r[s],r[s+1]),a=Math.abs(r[s][2]-r[s+1][2]);if(a===0)i+=o;else{const u=Math.sqrt(o*o+a*a);i+=u}}else if(e==="NONE"){const o=Qv(r[s],r[s+1]);i+=o}else console.warn(`未知的arcType: ${e},导致距离无法计算!`);t.push(i)}return t}function zd(r){const e="__getXyzFromPostion";let t=Xn(r,e);return(!t||!g.Vector.equals(t[0],r))&&(t=[[...r],Vr(r)],fi(r,e,t)),t[1]}class iS{constructor(e){this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(let t=0;t<this.length;t++)this.points[t].z=this.points[t].z||0;for(let t=0;t<this.length-1;t++){const n=this.points[t],i=this.points[t+1];this.centers.push({x:(n.x+i.x)/2,y:(n.y+i.y)/2,z:(n.z+i.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(let t=0;t<this.centers.length-1;t++){const n=this.points[t+1].x-(this.centers[t].x+this.centers[t+1].x)/2,i=this.points[t+1].y-(this.centers[t].y+this.centers[t+1].y)/2,s=this.points[t+1].z-(this.centers[t].z+this.centers[t+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t].x+n),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t].y+i),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t].z+s)},{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t+1].x+n),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t+1].y+i),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}cacheSteps(e){const t=[];let n=this.pos(0);t.push(0);for(let i=0;i<this.duration;i+=10){const s=this.pos(i);Math.sqrt((s.x-n.x)*(s.x-n.x)+(s.y-n.y)*(s.y-n.y)+(s.z-n.z)*(s.z-n.z))>e&&(t.push(i),n=s)}return t}vector(e){const t=this.pos(e+10),n=this.pos(e-10);return{angle:180*Math.atan2(t.y-n.y,t.x-n.x)/3.14,speed:Math.sqrt((n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y)+(n.z-t.z)*(n.z-t.z))}}pos(e){let t=e-this.delay;t<0&&(t=0),t>this.duration&&(t=this.duration-1);const n=t/this.duration;if(n>=1)return this.points[this.length-1];const i=Math.floor((this.points.length-1)*n),s=(this.length-1)*n-i;return sS(s,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])}}function sS(r,e,t,n,i){const s=oS(r);return{x:i.x*s[0]+n.x*s[1]+t.x*s[2]+e.x*s[3],y:i.y*s[0]+n.y*s[1]+t.y*s[2]+e.y*s[3],z:i.z*s[0]+n.z*s[1]+t.z*s[2]+e.z*s[3]}}function oS(r){const e=r*r;return[e*r,3*e*(1-r),3*r*(1-r)*(1-r),(1-r)*(1-r)*(1-r)]}function aS(r,e){e===void 0&&(e={});var t=e.resolution||1e3,n=e.sharpness||.85;const i=[],s=r.map(l=>{const[c,h,f]=Vr(l);return{x:c,y:h,z:f}});for(var o=new iS({duration:t,points:s,sharpness:n}),a=function(l){var c=o.pos(l);const h=Xh([c.x,c.y,c.z]);i.push(h)},u=0;u<o.duration;u+=10)a(u);return a(o.duration),i}function ty(r,e,t){return aS(r,{resolution:e,sharpness:t})}class ey extends ra{constructor(e){super(e)}get propUiTree(){return this.uiTree}}class Ud extends na{constructor(e,t,n){super(e,t),this._property=n}get property(){return this._property}}class Gd extends Ud{constructor(e,t){super(e,!1,t)}}class Wd extends Ud{constructor(e,t){super(e,!0,t)}get groupChildren(){return this.children}}function ny(r,e){const t=new ey(e),n=r.getProperties("chinese"),i=[];for(let s of n)if(s instanceof ut){const o=new Wd(t,s);o.d(()=>s.destroy()),t.children.push(o),i.push(o)}else{const o=new Gd(t,s);t.children.push(o),o.d(()=>s.destroy())}for(;i.length>0;){const s=i.pop();if(!s)throw new Error("should not be here!");const o=s;if(!(o.property instanceof ut))throw new Error("!(treeItem.property instanceof GroupProperty)");for(let a of o.property.children)if(a instanceof ut){const u=new Wd(t,a);u.d(()=>a.destroy()),o.groupChildren.push(u),i.push(u)}else{const u=new Gd(t,a);o.groupChildren.push(u),u.d(()=>a.destroy())}}return t.d(()=>{t.itemChildrenChanged.reset(),t.itemChildrenToChange.reset();const s=[...t.getDescendants()];s.forEach(o=>{o.children&&(o.children.length=0),o.destroy()}),s.length=0}),t}class ka extends V{constructor(t){super();d(this,"_propTreeReact",this.dv(j(void 0)));this.d(()=>this._propTreeReact.value=void 0),this.dv(new Ee(this.sceneObjectChanged,n=>{if(!n)return;const i=new V;return i.d(n.toDestroyEvent.don(()=>{this.sceneObject=void 0})),i})),this.d(this.sceneObjectChanged.don(n=>{this._propTreeReact.value=void 0,!(!n||!(n instanceof rt))&&(this._propTreeReact.value=ny(n,t))}))}get propTree(){return this._propTreeReact.value}get propTreeChanged(){return this._propTreeReact.changed}}(r=>{r.createDefaultProps=()=>({sceneObject:void 0})})(ka||(ka={})),Gi(ka.prototype,ka.createDefaultProps);function Hd(r){return vs(r,(e,t)=>e[0]===t[0]&&e[1]===t[1],e=>[...e])}function ry(r,e){const t=new Array;for(let n of r)t.push(e(n));return t}function qd(r,e){return r===void 0&&e===void 0?!0:!r||!e?!1:r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]}function uS(r,e,t){var i;((i=e.attachedViewers.values().toArray()[0])==null?void 0:i.getEngineObject(e))?t.call(r):(r.dispose(e.viewerAttached.don(()=>{t.call(r)})),r.dispose(e.createdEvent.don(()=>t.call(r))))}function lS(r,e,t,n=!0){n&&t(),r.dispose(e.disposableOn(t))}function cS(r,e){const{type:t,id:n}=r;if(t){const i=rt.create(t,n);if(i)return i.json=r,i;console.warn(`cannot create sceneObject from type(${t})`)}else console.warn(`cannot create sceneObject from type(${t})`)}function iy(r){const e=r.children&&fh(r.children,n=>{if(!(n instanceof yn))throw new Error("!(treeItem instanceof SceneTreeItem)");return!n.show})||!1,t=r.sceneTree.getSceneObjectShowFunc(r.sceneObject);return!e||t}class yn extends na{constructor(t,n=!1,i,s,o=!0){super(t,n,i);d(this,"_dragDrop");d(this,"_showChangedNotAffectChildren",!1);d(this,"_showChangedNotAffectParent",!1);d(this,"_type",this.dv(j("Unknown")));d(this,"_isExport",this.dv(j(!0)));const a=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(a)),this.name=`未命名条目(${this.id})`,this.extras=s,this._isExport.value=o;let u;const l=()=>{u&&(u(),u=void 0)};this.dispose(l),this.dispose(this.sceneObjectChanged.disposableOn(c=>{l(),c&&(u=nt([this,"name"],[c,"name"]))})),this.dispose(this.showChanged.disposableOn(c=>{if(t.setSceneObjectShowFunc(this.sceneObject,c),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let h of this.children)h instanceof yn&&(h._showChangedNotAffectParent=!0,h.show=c,h._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof yn&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=iy(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new Ee(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const c=new V;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof O){const h=()=>{this.show=t.getSceneObjectShowFunc(this.sceneObject)};h(),c.dispose(this.sceneObject.showChanged.disposableOn(h))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof O){const h=()=>{this.show=t.getSceneObjectShowFunc(this.sceneObject)};h(),c.dispose(this.sceneObject.enabledChanged.disposableOn(h))}return c})),this.childrenChangedEvent.disposableOn(()=>{const c=iy(this);this._showChangedNotAffectChildren=!0,this.show=c,this._showChangedNotAffectChildren=!1});{const c=()=>{let h="Unknown";this.sceneObject?h=this.sceneObject.typeName:this.children&&(h="Folder"),this._type.value=h};this.dispose(this.sceneObjectChanged.disposableOn(c)),this.dispose(this.childrenResetedEvent.disposableOn(c)),c()}}get dragDrop(){return this._dragDrop||(this._dragDrop=this.dv(this.sceneTree.createTreeItemDragDropFunc(this))),this._dragDrop}get type(){return this._type.value}get typeChanged(){return this._type.changed}get isExport(){return this._isExport.value}get isExportChanged(){return this._isExport.changed}set isExport(t){this._isExport.value=t}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(t){try{this.json=JSON.parse(t)}catch(n){console.error(`sceneTreeItem.jsonStr error ${n}`,n)}}get completeJson(){const t=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.completeJson);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.completeJson,children:t,extras:this.extras}}get json(){const t=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.json);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.json,children:t,extras:this.extras}}set json(t){if(t.name!==void 0&&(this.name=t.name),this.extras=t.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=t.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=t.collapsed??!1,this.sceneObject=void 0,t.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(t.sceneObj,this)),!!t.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let n of t.children){const i=new yn(this.tree,!0);i.json=n,this.children.push(i)}}}clone(){try{const t=new yn(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return t.json=this.json,t.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),t}catch(t){console.error(`SceneTreeItem.clone error: ${t}`,t)}}insertNewTreeItem(t,n){if(t==="FolderInnerOrAfter"||t==="FolderInnerOrBefore"||t==="FolderInner"){if(n&&n.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&!(t.includes("Or")&&this.sceneObject))return n&&this.children.push(n),!0;if(t==="FolderInner")return!1;if(t==="FolderInnerOrAfter")return super.insertNewTreeItem("After",n);if(t==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",n);throw new Error("should not be here!")}else return super.insertNewTreeItem(t,n)}}(r=>{r.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:Qt(void 0)})})(yn||(yn={})),Gi(yn.prototype,yn.createDefaultProps);function sy(r,e,t){let{offsetY:n}=e;if(!e.target||!("clientTop"in e.target))return"none";n+=2,n+=e.target.clientTop;let i="none";return r.children?n<=t*.3?i="before":n>=t*.7?!r.uiTreeObject.collapsed&&r.children.length>0?i="inner":i="after":i="inner":n<=t*.5?i="before":i="after",i}class oy extends kg{constructor(e){super(),this._treeItem=e;const{dragStartDataManager:t}=this._treeItem.sceneTree;let n="none";const i=this.disposeVar(Vp(()=>{this._treeItem.uiTreeObject.moveToPositionMode=n,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${n});`)},200));function s(o){n!==o&&(n=o,i.restart())}this.dispose(this._dragStartEvent.disposableOn(o=>{t.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(o=>{if(!o.dataTransfer)return;o.preventDefault();const a=t;if(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0){const u=a.data.value,l=this._treeItem,{tree:c}=l;if(c){const h=[...c.selectedItems];~h.indexOf(u)||h.push(u);const f=sy(l,o,c.itemDivHeight);if(f!=="none"&&ra.canMoveToTreeItems(h,l,f)){o.dataTransfer.dropEffect="move",s(f);return}}}o.dataTransfer.dropEffect="none",s("none")})),this.dispose(this._dropEvent.disposableOn(o=>{const a=t;if(!(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0))return;const u=a.data.value,l=this._treeItem,{tree:c}=l;if(!c)return;const h=[...c.selectedItems];~h.indexOf(u)||h.push(u);const f=sy(l,o,c.itemDivHeight);f!=="none"&&ra.canMoveToTreeItems(h,l,f)&&(ra.moveToTreeItems(h,l,f),a.data=void 0,s("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{n="none",i.restart()}))}}function hS(r){if(!(r instanceof yn))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new oy(r)}function dS(r){let e=!1;return r&&("show"in r?e=r.show??!0:"enabled"in r&&(e=r.enabled??!0)),e}function fS(r,e){r&&("show"in r?r.show=e:"enabled"in r&&(r.enabled=e))}const pS=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function gS(r){const e=[],{root:t={}}=r,n=[t];for(;n.length>0;){const i=n.pop();if(!i)throw new Error("!todo");if(i.children){for(let s of i.children)if(s.children&&n.unshift(s),s.sceneObj){const{type:o=void 0}=s.sceneObj;o||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(s.sceneObj)),o&&pS.includes(o)&&e.push(s.sceneObj)}}}return e}async function mS(r,e){const t=gS(r);let n=0;const i=t.length;for(let s of t)if(++n,e){const o=n/i;e(o,n,i)}}class ay extends V{constructor(t,n){super();d(this,"treeItemContexMenuCallback");this._sceneTree=t,this._projectManager=n}get sceneTree(){return this._sceneTree}}class vS extends V{constructor(t){super();d(this,"_jsonLoadingEvent",this.disposeVar(new O));d(this,"_setJsonProcessing",this.disposeVar(Yn(async(t,n)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),n&&await t.promise(this._sceneTree.preloadFunc(n)),this._setJson(n),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=t,this._setJsonProcessing.errorFunc=n=>{this._jsonLoadingEvent.emit({type:"error",error:n})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(t){try{this._sceneTree.setJson(t||{})}catch(n){console.error(`json数据装配时发生错误!error: ${n}`)}}get json(){return this._sceneTree.getJson()}set json(t){this._setJsonProcessing.restart(new Fr("JSON重新赋值!"),t)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(t){this.json=JSON.parse(t)}}function yS(r){return r.name+"_clone"}function Xd(r,e,t){if(r instanceof yn)return r.insertNewTreeItem(e,t);{const n={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return r.insertNewTreeItem(n[e],t)}}function _S(r){[r,...r.getDescendants()].forEach(e=>e.destroy())}const Hn=class Hn extends ra{constructor(t,n,i,s){super(i);d(this,"_jsonLoading",this.disposeVar(new vS(this)));d(this,"createSceneObjectFunc",Hn.defaultCreateSceneObjectFunc);d(this,"createTreeItemDragDropFunc",Hn.defaultCreateTreeItemDragDropFunc);d(this,"preloadFunc",Hn.defaultPreload);d(this,"getSceneObjectShowFunc",Hn.defaultGetSceneObjectShow);d(this,"setSceneObjectShowFunc",Hn.defaultSetSceneObjectShow);d(this,"getSceneTreeItemCloneNameFunc",Hn.defaultGetSceneTreeItemCloneNameFunc);d(this,"debug",!1);d(this,"_contextMenu",this.disposeVar(new ay(this,this.projectManager)));d(this,"_showPropUiOnSelecting",this.disposeVar(j(!0)));this._name=t,this._dragStartDataManager=n,this._projectManager=s,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var a,u;globalThis.lssn=this.lastSelectedItem,globalThis.lsso=(a=this.lastSelectedItem)==null?void 0:a.sceneObject,this.debug&&console.log(((u=this.lastSelectedItem)==null?void 0:u.sceneObject)??"select null")}));const{sceneObjectsManager:o}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(a=>{for(let u of a){const l=u,{sceneObject:c}=l;c&&o.deleteSceneObject(c)&&c.destroy()&&ql(c,void 0);for(let h of l.getDescendants()){const{sceneObject:f}=h;f&&o.deleteSceneObject(f)&&f.destroy()&&ql(f,void 0)}_S(u)}})),this.dispose(this.itemsAdded.disposableOn(a=>{for(let u of a){const l=u;l.sceneObject&&o.addSceneObject(l.sceneObject)&&ql(l.sceneObject,l)}})),this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{if(!this.showPropUiOnSelecting)return;this._projectManager.propUiTreeManager.sceneObject=void 0;const{lastSelectedItem:a}=this;a&&(this._projectManager.propUiTreeManager.sceneObject=a.sceneObject)}))}get json(){return this._jsonLoading.json}set json(t){this._jsonLoading.json=t}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(t){this._jsonLoading.jsonStr=t}get jsonLoadingEvent(){return this._jsonLoading.jsonLoadingEvent}get name(){return this._name}get projectManager(){return this._projectManager}get contextMenu(){return this._contextMenu}get showPropUiOnSelecting(){return this._showPropUiOnSelecting.value}set showPropUiOnSelecting(t){this._showPropUiOnSelecting.value=t}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(t){const n=this.getDescendants();let i;for(let s of n)if(s.sceneObject&&s.sceneObject.id===t){i=s;break}return i}getTreeItemsFromSceneObjType(t){const n=this.getDescendants(),i=[],s=Array.isArray(t)?t:[t];for(let o of n)o.sceneObject&&s.includes(o.sceneObject.typeName)&&i.push(o);return i}getTreeItemsFromSceneObjName(t){var s;const n=this.getDescendants(),i=[];for(let o of n)(s=o.sceneObject)!=null&&s.name.includes(t)&&i.push(o);return i}get dragStartDataManager(){return this._dragStartDataManager}get completeJson(){return{root:{children:[...this.children].filter(t=>t.isExport).map(t=>t.completeJson)}}}getJson(){return{root:{children:[...this.children].filter(t=>t.isExport).map(t=>t.json)}}}setJson(t){var i;t.root=t.root||{};const n=t.root.children??[];this.root.resetChildren(!0);for(let s of n){const o=new yn(this,!0);o.json=s,(i=this.root.children)==null||i.push(o)}}testAddNewTreeItem(t,n){const i=t||this.lastSelectedItem||this.root;return i?Xd(i,n):!1}addNewTreeItem(t,n,i,s){const o=t||this.lastSelectedItem||this.root;if(o&&Xd(o,n)){const a=new yn(this,i);if(a.sceneObject=s,!Xd(o,n,a))throw new Error("currentTreeItem.insertNewTreeItem return false!");return a}}createSceneObjectTreeItem(t,n,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const a=rt.create(t,n);return a?this.addNewTreeItem(i,s??"FolderInnerOrAfter",!0,a):void 0}createGroupTreeItem(t,n,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const a=this.addNewTreeItem(i,s??"FolderInnerOrAfter",!0);if(!a){console.warn("addNewTreeItem error!");return}return a.name=t??"未命名组节点",a}createSceneObjectTreeItemFromClass(t,n,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o))return;const a=rt.createFromClass(t,n);return a?this.addNewTreeItem(i,o,!0,a):void 0}createSceneObjectTreeItemFromJson(t,n,i){const s=i??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,s))return;const o=rt.createFromJson(t);return console.log(o),o?this.addNewTreeItem(n,i??"FolderInnerOrAfter",!0,o):void 0}destroySceneObjectTreeItem(t){if(t===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}t.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const t=[...this.root.children];for(let n of t)this.destroySceneObjectTreeItem(n)}};d(Hn,"defaultCreateSceneObjectFunc",cS),d(Hn,"defaultCreateTreeItemDragDropFunc",hS),d(Hn,"defaultPreload",mS),d(Hn,"defaultGetSceneObjectShow",dS),d(Hn,"defaultSetSceneObjectShow",fS),d(Hn,"defaultGetSceneTreeItemCloneNameFunc",yS);let pl=Hn;const Yd={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class wS extends V{constructor(t){super();d(this,"_currentPosition",this.disposeVar(re(void 0)));d(this,"_currentRotation",this.disposeVar(re(void 0)));d(this,"_currentHeading",this.disposeVar(j(void 0)));d(this,"_isRotating",this.disposeVar(j(!1)));d(this,"_isGround",this.disposeVar(j(!1)));d(this,"_startPosition",[0,0,0]);d(this,"_startRotation",[0,0,0]);d(this,"_processing",this.disposeVar(Yn(async(t,n,i,s)=>{const{currentPosition:o,currentRotation:a}=this;if(!o||s<=0||!a){this._currentPosition.value=n,this._currentRotation.value=i;return}const u=this._startPosition;u.splice(0,3,...o);const l=this._startRotation;l.splice(0,3,...a);let c=Date.now();const h=Bu(u,n);this._currentHeading.value=h;const p=Ql(u,n)/s,v=[i[0]-l[0],i[1]-l[1],i[2]-l[2]],C=n[2]-u[2];await t.promise(new Promise(S=>{t.disposer.dispose(Rl(async()=>{let P=Date.now()-c;P=P<0?0:P,P=P>s?s:P;const y=P*p,_=om(u,y,h);if(this.isGround&&_){const m=await this._esviewer.getTerrainHeight([_[0],_[1]]);this._currentPosition.value=[_[0],_[1],m??0]}else _&&(_[2]+=C*(P/s)),this._currentPosition.value=_;if(this.isRotating){const[m,w,E]=v,b=P/s;this._currentRotation.value=[l[0]+m*b,l[1]+w*b,l[2]+E*b]}P===s&&(this._currentPosition.value=n,this.isRotating&&(this._currentRotation.value=i),this.isRotating=!1,this.isGround=!1,S())}))}))})));this._esviewer=t}get currentPosition(){return this._currentPosition.value}get currentPositionChanged(){return this._currentPosition.changed}get currentRotation(){return this._currentRotation.value}get currentRotationChanged(){return this._currentRotation.changed}get currentHeading(){return this._currentHeading.value}get currentHeadingChanged(){return this._currentHeading.changed}get isRotating(){return this._isRotating.value}set isRotating(t){this._isRotating.value=t}get isRotatingChanged(){return this._isRotating.changed}get isGround(){return this._isGround.value}set isGround(t){this._isGround.value=t}get isGroundChanged(){return this._isGround.changed}get processing(){return this._processing}restart(t,n,i){this._processing.restart(void 0,t,n,i)}cancel(){this._processing.cancel()}}function uy(r){let e=0;function t(n,i){i++,e=Math.max(i,e),n.forEach(s=>{Array.isArray(s)&&t(s,i)})}return t(r,0),e}const Di=class Di extends Ht{constructor(t){super(t);d(this,"editingBindMode","lineString");d(this,"_area",this.dv(j(0)));d(this,"_perimeter",this.dv(j(0)));this.d(Ui(this.pointsChanged,()=>{this._updateArea(),this._updatePerimeter()},{immediate:!0}))}updateEditing(){var n;const t=[];this.editingBindMode=="doublePoints"?t.push(et.DoublePointsAppend,et.DoublePointsModify):this.editingBindMode=="lineString"?t.push(et.LineStringAppend,et.LineStringInsert,et.Translation):this.editingBindMode=="circular"?(t.push(et.CircularAppend,et.CircularInsert,et.Translation),this.supportEditingModes().includes(et.HeightModify)&&t.push(et.HeightModify)):this.editingBindMode=="visibility"?t.push(et.VisibilityAppend,et.VisibilityModify):this.editingBindMode=="scatter"&&t.push(et.ScatterAppend,et.ScatterModify),(n=this.activeViewer)==null||n.startEditing(this,t,{callSource:"inner"})}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}_updateArea(){this._area.value=this.getArea()??0}_updatePerimeter(){this._perimeter.value=this.getPerimeter()??0}getArea(){if(this.points&&this.points.length>=3)return td([...this.points])}getDistance(){if(this.points&&this.points.length>=2){const t=fl(this.points,"GEODESIC");return t[t.length-1]}else return}getPerimeter(){if(this.points&&this.points.length>=3){const t=[...this.points,this.points[0]],n=fl(t,"GEODESIC");return n[n.length-1]}else return}getIntersect(t){if(this.points&&this.points.length>=3&&t.length>=3){const n=qv(this.points,t);if(!n)return;const i=n[0][0][0];if(Array.isArray(i)){const s=[...n],o=[];return s.forEach(a=>{const u=a[0].map(l=>[...l,0]);o.push(u)}),o}else return[[...n][0].map(a=>[...a,0])]}else return}getUnion(t){if(this.points&&this.points.length>=3&&t.length>=3){const n=Xv(this.points,t);if(!n)return;const i=n[0][0][0];if(Array.isArray(i)){const s=[...n],o=[];return s.forEach(a=>{const u=a[0].map(l=>[...l,0]);o.push(u)}),o}else return[[...n][0].map(a=>[...a,0])]}else return}getDifference(t){if(this.points&&this.points.length>=3&&t.length>=3){let n=[...t];const i=t[0],s=t[t.length-1];i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]||n.push(i);const o=Jv([...this.points,this.points[0]],[...n]);if(!o)return{status:"undefined",positions:void 0};const a=[...o];if(uy(a)===3){const u=a.map(f=>f.map(p=>[...p,0]));if(u.length<=1)return{status:"notIncluded",positions:u};const l=u[0],c=u[1];return Bd([...l],[...c])==="oneBig"?{status:"included",positions:u}:{status:"notIncluded",positions:u}}else if(uy(a)===4){const l=[...a.map(h=>h.map(f=>f.map(p=>[...p,0])))],c=[];return l.forEach(h=>{c.push(h[0])}),{status:"notIncluded",positions:c}}else return{status:"undefined",positions:void 0}}else return{status:"undefined",positions:void 0}}getBuffer(t=500,n){if(this.points&&this.points.length>=2){const i=Yv(this.points,t,n);return i?[i[0].map(s=>[...s,0])]:void 0}else return}geoPolygonOverlap(t){if(this.points&&this.points.length>=3&&t.length>=3){const n=Bd(this.points,t);return n==="oneBig"?!0:n==="twoBig"?!1:void 0}else return}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"style",coordinate:[...t.coordinate,new X([this,"editing"],"编辑",!1),new it([this,"points"],"位置数组",Di.defaults.points,void 0,!0)],style:[...t.style,new ut([],"点样式"),new X([this,"pointed"],"开启",!1),new M([this,"pointSize"],"点大小",1),new Pt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Mt([this,"pointColor"],"点颜色",[1,1,1,1]),new Mt([this,"pointOutlineColor"],"轮廓颜色",Di.defaults.pointStyle.outlineColor),new M([this,"pointOutlineWidth"],"轮廓宽度",Di.defaults.pointStyle.outlineWidth),new ut([],"线样式"),new X([this,"stroked"],"开启线样式",!0),new X([this,"strokeGround"],"贴地",!1),new M([this,"strokeWidth"],"线宽",1),new Pt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Mt([this,"strokeColor"],"线颜色",[1,1,1,1]),new ut([],"面样式"),new X([this,"filled"],"开启",!1),new X([this,"fillGround"],"贴地",!1),new Mt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...t.more,new ut([],"点样式集合"),new pt([this,"pointMaterial"],"点材质"),new it([this,"pointMaterialParams"],"点材质参数"),new ut([],"线样式集合"),new pt([this,"strokeMaterial"],"线材质"),new it([this,"strokeMaterialParams"],"线材质参数"),new ut([],"面样式集合"),new pt([this,"fillMaterial"],"面材质"),new it([this,"fillMaterialParams"],"面材质参数")]}}get pointSize(){return this.pointStyle.size}set pointSize(t){this.pointStyle={...this.pointStyle,size:t}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(t){this.pointStyle={...this.pointStyle,sizeType:t}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(t){this.pointStyle={...this.pointStyle,color:[...t]}}get pointColorChanged(){return this.pointStyleChanged}get pointOutlineColor(){return this.pointStyle.outlineColor}set pointOutlineColor(t){this.pointStyle={...this.pointStyle,outlineColor:[...t]}}get pointOutlineColorChanged(){return this.pointStyleChanged}get pointOutlineWidth(){return this.pointStyle.outlineWidth}set pointOutlineWidth(t){this.pointStyle={...this.pointStyle,outlineWidth:t}}get pointOutlineWidthChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(t){this.pointStyle={...this.pointStyle,material:t}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(t){this.pointStyle={...this.pointStyle,materialParams:t}}get pointMaterialParamsChanged(){return this.pointStyleChanged}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}};d(Di,"createDefaultProps",()=>({...Ht.createDefaultProps(),pointed:!1,pointStyle:wt({size:10,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),stroked:!1,strokeStyle:wt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:wt({color:[1,1,1,1],material:"",materialParams:{},ground:!1}),points:Nl([])})),d(Di,"type",Di.register("ESGeoVector",Di,{chsName:"地理矢量",tags:["ESObjects"],description:"地理矢量"})),d(Di,"supportEditingModes",[...Ht.supportEditingModes,et.Translation]);let It=Di;const To=class To extends Ht{constructor(){super(...arguments);d(this,"_statusDis",this.dv(j(!0)));d(this,"_smoothMoveEvent",this.dv(new O));d(this,"_smoothMoveWithRotationEvent",this.dv(new O));d(this,"_smoothMoveOnGroundEvent",this.dv(new O));d(this,"_smoothMoveWithRotationOnGroundEvent",this.dv(new O));d(this,"_automaticLandingEvent",this.dv(new O));d(this,"_smoothMoveKeepPitchEvent",this.dv(new O));d(this,"_smoothMoveRelativelyEvent",this.dv(new O));d(this,"_smoothMoveRelativelyWithRotationEvent",this.dv(new O));d(this,"useCalcFlyToParamInESObjectWithLocation",!0)}updateEditing(){var n;const t=[];this.editingBindMode=="singlePoint"?(t.push(et.Place,et.Translation),["ESLocationMeasurement"].includes(this.typeName)||t.push(et.Rotation),["ESClippingPlane","ESLocationMeasurement","ESLocalRectangle","ESBoxClipping"].includes(this.typeName)||t.push(et.Scale)):this.editingBindMode=="doublePoints"&&t.push(et.DoublePointsAppend,et.DoublePointsModify),(n=this.activeViewer)==null||n.startEditing(this,t,{callSource:"inner"})}get statusDis(){return this._statusDis.value}get statusDisChanged(){return this._statusDis.changed}get smoothMoveEvent(){return this._smoothMoveEvent}smoothMove(t,n){this._smoothMoveEvent.emit(t,n)}get smoothMoveWithRotationEvent(){return this._smoothMoveWithRotationEvent}smoothMoveWithRotation(t,n,i){this._smoothMoveWithRotationEvent.emit(t,n,i)}get smoothMoveOnGroundEvent(){return this._smoothMoveOnGroundEvent}smoothMoveOnGround(t,n,i,s){this._smoothMoveOnGroundEvent.emit(t,n,i,s)}get smoothMoveWithRotationOnGroundEvent(){return this._smoothMoveWithRotationOnGroundEvent}smoothMoveWithRotationOnGround(t,n,i,s,o){this._smoothMoveWithRotationOnGroundEvent.emit(t,n,i,s,o)}get automaticLandingEvent(){return this._automaticLandingEvent}automaticLanding(){const t=this.collision;this.collision=!1,setTimeout(()=>{this._automaticLandingEvent.emit(t)},100)}get smoothMoveKeepPitchEvent(){return this._smoothMoveKeepPitchEvent}smoothMoveKeepPitch(t,n){this._smoothMoveKeepPitchEvent.emit(t,n)}get smoothMoveRelativelyEvent(){return this._smoothMoveRelativelyEvent}smoothMoveRelatively(t,n){this._smoothMoveRelativelyEvent.emit(t,n)}get smoothMoveRelativelyWithRotationEvent(){return this._smoothMoveRelativelyWithRotationEvent}smoothMoveRelativelyWithRotation(t,n,i){this._smoothMoveRelativelyWithRotationEvent.emit(t,n,i)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",location:[...t.location,new X([this,"editing"],"是否编辑"),new lt([],()=>this.automaticLanding(),[],"自动落地"),new ia([this,"position"],"位置数组",[0,0,0]),new Gh([this,"rotation"],"姿态数组",[0,0,0]),new cn([this,"scale"],"缩放",[1,1,1]),new M([this,"minVisibleDistance"],"最小可见距离",0),new M([this,"maxVisibleDistance"],"最大可见距离",0)],more:[...t.more,new lt(["numbers","number"],(n,i)=>this.smoothMove(n,i),[[0,0,0],0],"平滑移动","smoothMove"),new lt(["numbers","number"],(n,i)=>this.smoothMoveKeepPitch(n,i),[[0,0,0],0],"固定方向平滑移动","smoothMoveKeepPitch"),new lt(["numbers","numbers","number"],(n,i,s)=>this.smoothMoveWithRotation(n,i,s),[[0,0,0],[0,0,0],0],"平滑偏移","smoothMoveWithRotation"),new lt(["number","number","number","string"],(n,i,s,o)=>this.smoothMoveOnGround(n,i,s,o),[0,0,0,""],"贴地平滑移动","smoothMoveOnGround"),new lt(["numbers","number","number","number","string"],(n,i,s,o,a)=>this.smoothMoveWithRotationOnGround(n,i,s,o,a),[[0,0,0],0,0,0,""],"贴地平滑偏移","smoothMoveWithRotationOnGround"),new lt(["numbers","number"],(n,i)=>this.smoothMoveRelatively(n,i),[[0,0,0],0],"smoothMoveRelatively","smoothMoveRelatively"),new lt(["numbers","numbers","number"],(n,i,s)=>this.smoothMoveRelativelyWithRotation(n,i,s),[[0,0,0],[0,0,0],0],"smoothMoveRelativelyWithRotation","smoothMoveRelativelyWithRotation"),new X([this,"enableVisibleDistance"],"是否应用距离显隐")]}}get pointSize(){return this.pointStyle.size}set pointSize(t){this.pointStyle={...this.pointStyle,size:t}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(t){this.pointStyle={...this.pointStyle,sizeType:t}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(t){this.pointStyle={...this.pointStyle,color:[...t]}}get pointColorChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(t){this.pointStyle={...this.pointStyle,material:t}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(t){this.pointStyle={...this.pointStyle,materialParams:t}}get pointMaterialParamsChanged(){return this.pointStyleChanged}};d(To,"createDefaultProps",()=>({...Ht.createDefaultProps(),pointed:!1,pointStyle:wt({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),position:dt([0,0,0]),rotation:dt([0,0,0]),scale:dt([1,1,1]),minVisibleDistance:j(0),maxVisibleDistance:j(0)})),d(To,"type",To.register("ESObjectWithLocation",To,{chsName:"对象位置",tags:["ESObjects"],description:"对象位置"})),d(To,"supportEditingModes",[...Ht.supportEditingModes,et.Place,et.Translation,et.Rotation,et.Scale,et.DoublePointsAppend,et.DoublePointsModify]);let st=To;const Wa=class Wa extends st{getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new ut([],"点样式集合"),new X([this,"pointed"],"开启点样式",!1),new M([this,"pointSize"],"点大小",1),new Pt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Mt([this,"pointColor"],"点颜色",[1,1,1,1]),new ut([],"线样式集合"),new X([this,"stroked"],"开启线样式",!1),new X([this,"strokeGround"],"是否贴地(线)",!1),new M([this,"strokeWidth"],"线宽",1),new Pt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Mt([this,"strokeColor"],"线颜色",[1,1,1,1]),new ut([],"面样式集合"),new X([this,"filled"],"开启填充样式",!1),new X([this,"fillGround"],"是否贴地",!1),new Mt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...e.more,new ut([],"点样式"),new pt([this,"pointMaterial"],"点材质",""),new it([this,"pointMaterialParams"],"点材质参数",{}),new ut([],"线样式"),new pt([this,"strokeMaterial"],"线材质",""),new it([this,"strokeMaterialParams"],"线材质参数",{}),new ut([],"填充样式"),new pt([this,"fillMaterial"],"面材质",""),new it([this,"fillMaterialParams"],"面材质参数",{})]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}};d(Wa,"createDefaultProps",()=>({...st.createDefaultProps(),pointed:!1,pointStyle:wt({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:1}),stroked:!1,strokeStyle:wt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:wt({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(Wa,"type",Wa.register("ESLocalVector",Wa,{chsName:"本地矢量",tags:["ESObjects"],description:"本地矢量对象"}));let Va=Wa;const Sl=class Sl extends Va{};d(Sl,"type",Sl.register("ESLocalVector2D",Sl,{chsName:"本地矢量2D",tags:["ESObjects"],description:"本地矢量2D对象"}));let us=Sl;const ES=[["固定朝向",0],["面向屏幕旋转",1],["绕自身Z轴旋转",2]],CS=[["单面不透明",0],["双面不透明",1],["单面遮罩",2],["双面遮罩",3],["单面透明",4],["双面透明",5],["单面未遮挡透明",6],["双面未遮挡透明",7]],Ha=class Ha extends st{constructor(){super(...arguments);d(this,"_widgetEvent",this.dv(new O))}get widgetEvent(){return this._widgetEvent}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new X([this,"screenRender"],"屏幕渲染",!0),new X([this,"sizeByContent"],"尺寸自适应",!0),new Ae([this,"size"],"尺寸大小",[100,100]),new Ae([this,"anchor"],"偏移比例",[.5,1]),new Ae([this,"offset"],"像素偏移",[0,0]),new Pt([this,"renderMode"],CS,"渲染模式",0),new Pt([this,"rotationType"],ES,"漫游旋转类型",1),new pt([this,"actorTag"],"绑定对象"),new pt([this,"socketName"],"插槽名称"),new cn([this,"positionOffset"],"位置偏移"),new cn([this,"rotationOffset"],"相对姿态")],more:[...t.more,new M([this,"zOrder"],"排序",0)]}}};d(Ha,"createDefaultProps",()=>({...st.createDefaultProps(),screenRender:!0,size:dt([100,100]),anchor:dt([.5,1]),offset:dt([0,0]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,actorTag:"",socketName:"",positionOffset:dt([0,0,0]),rotationOffset:dt([0,0,0])})),d(Ha,"type",Ha.register("ESLabel",Ha,{chsName:"标签",tags:["ESObjects"],description:"标签对象"}));let ar=Ha;const qa=class qa extends rt{constructor(e){super(e)}};d(qa,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,fillStyle:wt({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(qa,"type",qa.register("ESTestObject",qa,{chsName:"测试",tags:["ESObjects"],description:""}));let Jd=qa;const Mi=class Mi extends Ht{constructor(t){super(t);d(this,"_refreshTilesetEvent",this.dv(new O));d(this,"_tilesetReadyEvent",this.dv(new O));d(this,"_supportEdit",this.dv(j(!0)));d(this,"_highlightFeatureEvent",this.dv(new O));d(this,"_highlightFeatureAndFlyToEvent",this.dv(new O));d(this,"_strokeFeatureEvent",this.disposeVar(new O));d(this,"_getFeatureTableEvent",this.dv(new O));d(this,"_featureTableResultEvent",this.dv(new O));d(this,"_getMaterialNameListEvent",this.disposeVar(new O));d(this,"_setFeatureStyleEvent",this.dv(new O));d(this,"_setFeatureColorEvent",this.dv(new O));d(this,"_setFeatureVisableEvent",this.dv(new O));d(this,"_resetFeatureStyleEvent",this.dv(new O));d(this,"setMaterialInfoEvent",this.ad(new O));d(this,"_setMaterialEvent",this.disposeVar(new O));d(this,"_clippingPlanesId",this.dv(j("")));d(this,"_clippingPlaneIds",this.dv(j([])));d(this,"_flattenedPlaneId",this.dv(j("")));d(this,"_flattenedPlaneEnabled",this.dv(j(!1)));d(this,"_clippingPlaneId",this.dv(j("")));d(this,"_excavateId",this.dv(dt([])))}updateEditing(){var t;(t=this.activeViewer)==null||t.startEditing(this,[et.Translation,et.Rotation],{callSource:"inner"})}get refreshTilesetEvent(){return this._refreshTilesetEvent}refreshTileset(){this._refreshTilesetEvent.emit()}get tilesetReady(){return this._tilesetReadyEvent}get supportEdit(){return this._supportEdit.value}set supportEdit(t){this._supportEdit.value=t}get supportEditChanged(){return this._supportEdit.changed}get highlightFeatureEvent(){return this._highlightFeatureEvent}highlightFeature(t,n){this._highlightFeatureEvent.emit(t,n)}get highlightFeatureAndFlyToEvent(){return this._highlightFeatureAndFlyToEvent}highlightFeatureAndFlyTo(t,n,i,s){this._highlightFeatureAndFlyToEvent.emit(t,n,i,s)}get strokeFeatureEvent(){return this._strokeFeatureEvent}strokeFeature(t,n=[1,0,0,1]){this._strokeFeatureEvent.emit(t,n)}get getFeatureTableEvent(){return this._getFeatureTableEvent}getFeatureTable(){return Promise.race([new Promise(t=>{const n=this.d(this._featureTableResultEvent.donce(t));this._getFeatureTableEvent.emit(),setTimeout(()=>{n(),t(void 0)},2e3)})])}get getMaterialNameListEvent(){return this._getMaterialNameListEvent}getMaterialNameList(){return new Promise(t=>{const n=new V;n.d(this.getMaterialNameListEvent.don(i=>{i!=="start"&&(n.destroy(),t(i))})),this.getMaterialNameListEvent.emit("start"),setTimeout(()=>{n.isDestroyed()||(n.destroy(),t(void 0))},2e3)})}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(t){this._setFeatureStyleEvent.emit(t)}get setFeatureColorEvent(){return this._setFeatureColorEvent}setFeatureColor(t,n){this._setFeatureColorEvent.emit(t,typeof n=="string"?JSON.parse(n):n)}get setFeatureVisableEvent(){return this._setFeatureVisableEvent}setFeatureVisable(t,n){this._setFeatureVisableEvent.emit(t,typeof n=="string"?JSON.parse(n):n)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(){this._resetFeatureStyleEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(t){return new Promise(n=>{const i=new V;i.ad(this.setMaterialInfoEvent.donce(s=>{i.destroy(),n(s)})),this._setMaterialEvent.emit(t)})}get clippingPlanesId(){return this._clippingPlanesId.value}set clippingPlanesId(t){this._clippingPlanesId.value=t}get clippingPlanesIdChanged(){return this._clippingPlanesId.changed}get clippingPlaneIds(){return this._clippingPlaneIds.value}set clippingPlaneIds(t){this._clippingPlaneIds.value=t}get clippingPlaneIdsChanged(){return this._clippingPlaneIds.changed}get flattenedPlaneId(){return this._flattenedPlaneId.value}set flattenedPlaneId(t){this._flattenedPlaneId.value=t}get flattenedPlaneIdChanged(){return this._flattenedPlaneId.changed}get flattenedPlaneEnabled(){return this._flattenedPlaneEnabled.value}set flattenedPlaneEnabled(t){this._flattenedPlaneEnabled.value=t}get flattenedPlaneEnabledChanged(){return this._flattenedPlaneEnabled.changed}get clippingPlaneId(){return this._clippingPlaneId.value}set clippingPlaneId(t){this._clippingPlaneId.value=t}get clippingPlaneIdChanged(){return this._clippingPlaneId.changed}get excavateId(){return this._excavateId.value}set excavateId(t){this._excavateId.value=t}get excavateIdChanged(){return this._excavateId.changed}setLight122(){this.czmEnvironmentMapManager={...Yd}}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",basic:[...t.basic,new Ue([this,"maximumScreenSpaceError"],1,[0,256],"精度",16),new Pt([this,"materialMode"],[["常规","normal"],["科技感","technology"]],"材质模式","normal",!0),new Pt([this,"colorBlendMode"],[["默认","HIGHLIGHT"],["替换","REPLACE"],["混合","MIX"]],"颜色模式","HIGHLIGHT"),new it([this,"materialOverrideMap"],"材质替换",Mi.defaults.materialOverrideMap)],dataSource:[...t.dataSource,new it([this,"url"],"服务地址",Mi.defaults.url,void 0,!0)],coordinate:[...t.coordinate,new X([this,"editing"],"编辑",!1,!0),new cn([this,"offset"],"偏移",[0,0,0],!0),new Gh([this,"rotation"],"旋转",[0,0,0])],more:[...t.more,new it([this,"materialParams"],"materialParams",Mi.defaults.materialParams),new lt(["string","string"],(n,i)=>this.highlightFeature(n,i),["","rgba(255,0,0,1)"],"highlightFeature"),new lt(["string","string"],(n,i)=>this.setFeatureColor(n,i),["",""],"setFeatureColor"),new lt(["string","string"],(n,i)=>this.setFeatureVisable(n,i),["",""],"setFeatureVisable"),new lt([],()=>this.resetFeatureStyle(),[],"resetFeatureStyle"),new ut([],"ue"),new lt([],()=>this.refreshTileset(),[],"refreshTileset"),new pt([this,"actorTag"]),new X([this,"highlight"],"是否高亮"),new Mt([this,"highlightColor"]),new M([this,"highlightID"]),new ut([],"czm"),new ut([],"可视化"),new Ae([this,"czmImageBasedLightingFactor"],"反射强度"),new M([this,"czmAtmosphereScatteringIntensity"],"大气散射强度"),new it([this,"czmEnvironmentMapManager"],"动态环境贴图管理器"),new M([this,"czmMaximumMemoryUsage"],"最大内存"),new ut([],"常用"),new Pt([this,"czmClassificationType"],[["NONE","NONE"],["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]],"czmClassificationType","NONE",!0),new it([this,"czmStyleJson"],"czmStyle"),new X([this,"czmBackFaceCulling"]),new X([this,"czmSkipLevelOfDetail"]),new M([this,"cacheBytes"],"最大缓存",512*1024*1024),new ut([],"调试信息"),new X([this,"czmDebugShowBoundingVolume"]),new X([this,"czmDebugShowContentBoundingVolume"]),new ut([],"clippingPlanes"),new X([this,"clippingPlaneEnabled"]),new X([this,"unionClippingRegions"]),new Mt([this,"clippingPlaneEdgeColor"]),new M([this,"clippingPlaneEdgeWidth"])]}}};d(Mi,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",actorTag:"",materialMode:"normal",highlight:!1,maximumScreenSpaceError:16,highlightID:0,highlightColor:dt([1,0,0,1]),offset:re([0,0,0]),rotation:dt([0,0,0]),czmImageBasedLightingFactor:dt([1,1]),czmEnvironmentMapManager:Qt(void 0),czmLuminanceAtZenith:2,czmAtmosphereScatteringIntensity:2,czmMaximumMemoryUsage:512,czmClassificationType:"NONE",czmStyleJson:wt({}),czmBackFaceCulling:!0,czmDebugShowBoundingVolume:!1,czmDebugShowContentBoundingVolume:!1,czmSkipLevelOfDetail:!1,cacheBytes:512*1024*1024,colorBlendMode:"HIGHLIGHT",clippingPlaneEnabled:!0,unionClippingRegions:!0,clippingPlaneEdgeColor:dt([1,1,1,1]),clippingPlaneEdgeWidth:2,materialParams:{baseColor:[0,.5,1]},allowPicking:!0,materialOverrideMap:Qt({}),featureIdLabel:0,splitDirection:"NONE"})),d(Mi,"type",Mi.register("ES3DTileset",Mi,{chsName:"3DTileset",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"3DTileset"})),d(Mi,"supportEditingModes",[...Ht.supportEditingModes,et.Translation,et.Rotation]);let Tr=Mi;const Xa=class Xa extends st{constructor(t){super(t);d(this,"_isFlyInCreated",this.dv(j(!1)));d(this,"_readyEvent",this.dv(new O));this.collision=!1,this.d(this.createdEvent.don(()=>{setTimeout(()=>{if((this.editing??!1)||!this.position)this.d(Ui([this.positionChanged,this.editingChanged],()=>{this.editing||!this.position||this.isFlyInCreated&&this.flyTo()},{time:"donce"}));else{if(!this.isFlyInCreated)return;this.flyTo()}},1e3)}))}get isFlyInCreated(){return this._isFlyInCreated.value}set isFlyInCreated(t){this._isFlyInCreated.value=t}get isFlyInCreatedChanged(){return this._isFlyInCreated.changed}get readyEvent(){return this._readyEvent}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Pt([this,"mode"],[["柱状警告","cylinder"],["圆形警告","circle"]],"模式","cylinder"),new M([this,"radius"],"半径",10)]}}};d(Xa,"createDefaultProps",()=>({...st.createDefaultProps(),mode:"cylinder",radius:10})),d(Xa,"type",Xa.register("ESAlarm",Xa,{chsName:"报警",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警告类"}));let $d=Xa;const SS=[["扫描","scan"],["扩散","diffuse"]],Gs=class Gs extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new M([this,"radius"],"半径",1),new Pt([this,"mode"],SS,"模式",Gs.defaults.mode),new Mt([this,"color"],"颜色",Gs.defaults.color)]}}};d(Gs,"createDefaultProps",()=>({...st.createDefaultProps(),radius:1,mode:"scan",color:[0,.7,1,1],collision:!1})),d(Gs,"type",Gs.register("ESApertureEffect",Gs,{chsName:"光圈特效",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"光圈特效"}));let Kd=Gs;const Oo=class Oo extends It{constructor(t){super(t);d(this,"editingBindMode","circular")}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new M([this,"area"],"面积",0,!1,!0),new M([this,"perimeter"],"周长",0,!1,!0)]}}};d(Oo,"createDefaultProps",()=>({...It.createDefaultProps(),fillStyle:wt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1}),strokeStyle:wt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!0,stroked:!1,collision:!1})),d(Oo,"type",Oo.register("ESGeoPolygon",Oo,{chsName:"地理多边形",tags:["ESObjects"],description:"地理多边形"})),d(Oo,"supportEditingModes",[...It.supportEditingModes,et.CircularAppend,et.CircularInsert]);let Xt=Oo;const ls=class ls extends Xt{get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialParams(){return this.fillStyle?this.fillStyle.materialParams:ls.defaults.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle??ls.defaults.fillStyle,materialParams:e??ls.defaults.fillStyle.materialParams}}constructor(e){super(e)}};d(ls,"createDefaultProps",()=>({...Xt.createDefaultProps(),stroked:!0,filled:!0,units:dt(["SquareMeter_SquareKilometer","MU_Hectare","PerimeterMeter_PerimeterKilometer"]),fillStyle:wt({color:[1,1,1,1],material:"Material'/EarthSDKForUE/M_ES_Material.M_ES_Material'",materialParams:{Opacity:.4},ground:!0}),strokeStyle:wt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(ls,"type",ls.register("ESAreaMeasurement",ls,{chsName:"面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"面积测量"}));let Zd=ls;const Ya=class Ya extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"general",more:[...e.more,new ut([],"czm"),new Fu([this,"image"],"图片"),new cn([this,"translation"],"偏移")]}}};d(Ya,"createDefaultProps",()=>({...st.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",translation:dt([0,0,0])})),d(Ya,"type",Ya.register("ESBlastParticleSystem",Ya,{chsName:"粒子爆炸",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子爆炸"}));let Qd=Ya;const oi=class oi extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new X([this,"reverse"],"反转",oi.defaults.reverse),new cn([this,"size"],"尺寸",oi.defaults.size),new Mt([this,"edgeColor"],"边框颜色",oi.defaults.edgeColor),new M([this,"edgeWidth"],"边框宽度",oi.defaults.edgeWidth),new pt([this,"targetID"],"瓦片图层",oi.defaults.targetID)]}}};d(oi,"createDefaultProps",()=>({...st.createDefaultProps(),reverse:!1,edgeColor:dt([1,1,1,1]),edgeWidth:2,size:dt([10,10,10]),targetID:""})),d(oi,"type",oi.register("ESBoxClipping",oi,{chsName:"体剖切",tags:["ESObjects","_ES_Impl_Cesium"],description:"体剖切,体裁剪,体裁切,盒裁切"}));let tf=oi;const bl=class bl extends st{constructor(){super(...arguments);d(this,"_thumbnail",this.dv(j("")));d(this,"_duration",this.dv(j(1)));d(this,"_resetWithCurrentCameraEvent",this.dv(new O));d(this,"_captureEvent",this.dv(new O))}get thumbnail(){return this._thumbnail.value}set thumbnail(t){this._thumbnail.value=t}get thumbnailChanged(){return this._thumbnail.changed}get duration(){return this._duration.value}set duration(t){this._duration.value=t}get durationChanged(){return this._duration.changed}flyIn(t=1,n="default"){this.flyInEvent.emit(t,-1,n)}get resetWithCurrentCameraEvent(){return this._resetWithCurrentCameraEvent}resetWithCurrentCamera(){this._resetWithCurrentCameraEvent.emit()}get captureEvent(){return this._captureEvent}capture(t,n){this._captureEvent.emit(t,n)}execOnCreating(){this.resetWithCurrentCamera()}async initByCurrent(){this.resetWithCurrentCamera()}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"ESCameraView"),new lt([],()=>this.resetWithCurrentCamera(),[],"设置为当前视角"),new lt(["number","number"],(n,i)=>this.capture(n,i),[64,64],"获取缩略图"),new pt([this,"thumbnail"],"缩略图","",!0),new M([this,"duration"],"飞行时间",1,!0)]}}};d(bl,"type",bl.register("ESCameraView",bl,{chsName:"视角",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角"}));let Fc=bl;class Ac extends V{constructor(t,n,i){super();d(this,"_view",this.dv(new Fc));if(this.d(t.components.disposableAdd(this._view)),this._view.name=(i==null?void 0:i.name)??`视角${t.views.length+1}`,n){const a=this._view,u=n;a.duration=u.duration??1,a.position=u.position,a.rotation=u.rotation??[0,0,0],a.thumbnail=u.thumbnail??"",a.name=u.name}else{const a=(i==null?void 0:i.size)??[64,64];this.d($o(()=>{this._view.resetWithCurrentCamera(),this._view.capture(a[0],a[1])}))}const s=this._view,o=this.dv(Ie(s.durationChanged,s.positionChanged,s.rotationChanged,s.thumbnailChanged,s.nameChanged));this.d(o.don(()=>t.emitViewsWarpper()))}get view(){return this._view}get viewInfo(){const t=this._view;return{duration:t.duration,position:t.position,rotation:t.rotation,thumbnail:t.thumbnail,name:t.name}}}const Or=class Or extends rt{constructor(t){super(t);d(this,"_currentViewIndex",this.dv(j(-1)));d(this,"_viewWrappers",this.dv(new xu));d(this,"_currentViewWrapper",this.dv(j(void 0)));d(this,"_container",this.dv(j(void 0)));this.initProcessing();{const n=()=>{if(!this._currentViewWrapper.value)return;this._viewWrappers.indexOf(this._currentViewWrapper.value)===-1&&(this._currentViewWrapper.value=void 0)};n(),this.d(this._viewWrappers.changedEvent.don(n))}{const n=()=>{const i=this._currentViewWrapper.value;this._currentViewIndex.value=i?this._getIndex(i):-1};n(),this.d(this._viewWrappers.changedEvent.don(n)),this.d(this._currentViewWrapper.changed.don(n))}this.d(()=>{this.clearAllViews()})}get json(){return{...this._innerGetJson(),views:this.views}}set json(t){this._innerSetJson(t),this.views=t.views}get currentViewIndex(){return this._currentViewIndex.value}get currentViewIndexChanged(){return this._currentViewIndex.changed}emitViewsWarpper(){this._viewWrappers.changedEvent.emit(this._viewWrappers)}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(t){this._container.value=t}get views(){return ry(this._viewWrappers,t=>t.viewInfo)}get viewsChanged(){return this._viewWrappers.changedEvent}set views(t){if(t.length===this._viewWrappers.length){const n=this._viewWrappers;if(t.every((i,s)=>{const o=n.get(s).view;return i.duration===o.duration&&qd(i.position,o.position)&&qd(i.rotation,o.rotation)&&i.thumbnail===o.thumbnail&&i.name===o.name}))return}this.clearAllViews();for(let n of t)this._viewWrappers.push(new Ac(this,n))}_getIndex(t){return this._viewWrappers.indexOf(t)}clearAllViews(){for(let t of this._viewWrappers)t.destroy();this._viewWrappers.length=0}add(t=`视角${this.views.length+1}`,n=[64,64]){this._viewWrappers.push(new Ac(this,void 0,{name:t,size:n}))}update(t,n,i=[64,64]){if(t>=this._viewWrappers.length||t<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const s=this._viewWrappers.get(t);return n&&(s.view.name=n),s.view.resetWithCurrentCamera(),s.view.capture(i[0],i[1]),!0}addView(){this._viewWrappers.push(new Ac(this))}insertView(t){if(this._viewWrappers.length+1<=t||t<0){console.error("this._views.length <= index || index < 0");return}this._viewWrappers.splice(t,0,new Ac(this))}setCurrentView(t){if(t>=this._viewWrappers.length||t<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const n=this._viewWrappers.get(t);return this._currentViewWrapper.value=n,!0}resetView(t){if(t>=this._viewWrappers.length||t<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const n=this._viewWrappers.get(t);n.view.resetWithCurrentCamera(),n.view.capture()}resetViewName(t,n){if(t>=this._viewWrappers.length||t<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const i=this._viewWrappers.get(t);i.view.name=n}updateView(t,n){if(t>=this._viewWrappers.length||t<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const i=this._viewWrappers.get(t);return i.view.position=n.position,i.view.rotation=n.rotation??[0,0,0],i.view.duration=n.duration??1,i.view.thumbnail=n.thumbnail??"",i.view.name=n.name??"",!0}flyToView(t){if(this.setCurrentView(t)){if(!this._currentViewWrapper.value)throw new Error("this._currentViewWrapper.value");const n=this._currentViewWrapper.value.view.duration;this._currentViewWrapper.value.view.flyIn(n,this.flyMode??Or.defaults.flyMode)}}flyToPrevView(){const t=this._currentViewWrapper.value;if(!t)return this.flyToView(0),!0;const n=this._getIndex(t);return this.loop??Or.defaults.loop?(this.flyToView((this._viewWrappers.length+n-1)%this._viewWrappers.length),!0):n-1<0?!1:(this.flyToView(n-1),!0)}moveToPreView(){const t=this._currentViewWrapper.value;if(!t)return;const n=this._getIndex(t);if(n===0)return;const i=this._viewWrappers.splice(n-1,1,t)[0];this._viewWrappers.set(n,i)}moveToNextView(){const t=this._currentViewWrapper.value;if(!t)return;const n=this._getIndex(t);if(n===this._viewWrappers.length-1)return;const i=this._viewWrappers.splice(n+1,1,t)[0];this._viewWrappers.set(n,i)}flyToNextView(){const t=this._currentViewWrapper.value;if(!t)return this.flyToView(0),!0;const n=this._getIndex(t);return this.loop??Or.defaults.loop?(this.flyToView((n+1)%this._viewWrappers.length),!0):n+1>this._viewWrappers.length-1?!1:(this.flyToView(n+1),!0)}stop(){this._currentViewWrapper.value=void 0,this.playing=!1}deleteView(t){if(t<0||t>=this._viewWrappers.length){console.warn("index < 0 || index >= this._viewWrappers.length");return}this._viewWrappers.get(t).destroy(),this._viewWrappers.splice(t,1)}deleteCurrentView(){const t=this._currentViewWrapper.value;if(!t){console.warn("!this._currentViewWrapper.value");return}const n=this._getIndex(t);if(n===-1){console.warn("index === -1");return}this.deleteView(n)}transitionImageUrl(t){return rt.context.getStrFromEnv(t)}_flyStep(t){var o;if(!this.flyToNextView())return this.playing=!1,Promise.resolve();const n=this.intervalTime??Or.defaults.intervalTime,s=((((o=this._currentViewWrapper.value)==null?void 0:o.viewInfo.duration)??0)+n)*1e3;return t.promise(Nu(s)).then(()=>this._flyStep(t))}initProcessing(){const t=this.dv(Yn(async i=>this._flyStep(i))),n=()=>{this.playing?t.restart():t.cancel()};n(),this.d(this.playingChanged.don(n))}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Pt([this,"flyMode"],[["默认","default"],["直线飞行","uniform"]],"飞行模式",Or.defaults.flyMode),new lt([],()=>this.addView(),[],"添加视角"),new lt(["number"],n=>this.insertView(n),[0],"插入视角"),new lt([],()=>this.clearAllViews(),[],"清空所有视角"),new lt([],()=>this.insertView(this.currentViewIndex+1),[],"当前位置插入视角"),new lt([],()=>this.flyToPrevView(),[],"上一个视角"),new lt([],()=>this.flyToNextView(),[],"下一个视角"),new lt([],()=>this.moveToPreView(),[],"当前视角移动到上一个视角"),new lt([],()=>this.moveToNextView(),[],"当前视角移动到下一个视角"),new lt(["number"],n=>this.flyToView(n),[0],"飞入指定视角"),new lt(["number"],n=>this.setCurrentView(n),[0],"设置当前视角"),new lt([],()=>this.deleteCurrentView(),[],"删除当前视角"),new lt(["number"],n=>this.deleteView(n),[0],"删除指定视角"),new lt(["number"],n=>this.resetView(n),[0],"重置视角"),new M([this,"currentViewIndex"],"当前序号",-1,!1,!0),new Rg([this,"playing"],()=>this.stop(),[this,"loop"],"播放",Or.defaults),new X([this,"playing"],"是否播放"),new lt([],()=>this.stop(),[],"停止"),new X([this,"loop"],"是否循环"),new M([this,"intervalTime"],"间隔时间"),new it([this,"views"],"视角集合",[],void 0,!0)]}}};d(Or,"createDefaultProps",()=>({...rt.createDefaultProps(),playing:!1,loop:!0,intervalTime:5,flyMode:"default"})),d(Or,"type",Or.register("ESCameraViewCollection",Or,{chsName:"视角集合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角集合"}));let kc=Or;const Ja=class Ja extends st{constructor(t){super(t);d(this,"editingBindMode","doublePoints")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new M([this,"aspectRatio"],"宽高比",1.77778),new M([this,"fov"],"横向夹角",90),new M([this,"far"],"视野长度",100),new M([this,"near"],"近面距离",5)]}}};d(Ja,"createDefaultProps",()=>({...st.createDefaultProps(),fov:90,aspectRatio:1.77778,far:100,near:5,collision:!1})),d(Ja,"type",Ja.register("ESCameraVisibleRange",Ja,{chsName:"摄像头可视域",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"摄像头可视域"}));let ef=Ja;const $a=class $a extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Pt([this,"mode"],[["警车","policeCar"]],"模式","policeCar")]}}};d($a,"createDefaultProps",()=>({...st.createDefaultProps(),mode:"policeCar",allowPicking:!0})),d($a,"type",$a.register("ESCar",$a,{chsName:"车辆",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警车等基础车辆模型"}));let Vc=$a;const No=class No extends It{constructor(t){super(t);d(this,"editingBindMode","circular")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new M([this,"height"],"高度",10)],coordinate:[...t.coordinate,new M([this,"area"],"面积",0,!1,!0),new M([this,"perimeter"],"周长",0,!1,!0)]}}};d(No,"createDefaultProps",()=>({...It.createDefaultProps(),height:10,filled:!0,fillStyle:wt({material:"",materialParams:{},ground:!0,color:[1,1,1,1]})})),d(No,"type",No.register("ESClassification",No,{chsName:"倾斜单体化",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平尾箭头"})),d(No,"supportEditingModes",[...It.supportEditingModes,et.CircularAppend,et.CircularInsert,et.HeightModify]);let jc=No;const Ka=class Ka extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new X([this,"showArrow"],"显示箭头",!0),new Mt([this,"edgeColor"],"线框颜色",[1,1,1,1]),new M([this,"edgetWidth"],"线框宽度",2),new M([this,"width"],"裁剪宽度",200),new M([this,"height"],"裁剪高度",200),new pt([this,"targetID"],"瓦片图层","")]}}};d(Ka,"createDefaultProps",()=>({...st.createDefaultProps(),showArrow:!0,edgeColor:dt([1,1,1,1]),edgetWidth:2,width:200,height:200,targetID:""})),d(Ka,"type",Ka.register("ESClippingPlane",Ka,{chsName:"裁切",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESClippingPlane"}));let nf=Ka;class bS extends V{constructor(e,t,n){super();const i=document.createElement("div");i.setAttribute("xe2-div",`ESCustomDiv(${t.id})(viewer: ${n.id}) container`);{const u=()=>{const c=` ${t.cssText}
64
+ ***************************************************************************** */function MC(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(c){l=[6,c],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var ks=function(){function r(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return r}();function RC(r,e){return r>e?1:r<e?-1:0}function Vs(r,e,t){for(var n=new ks(null,null),i=n,s=n;;){var o=t(r,e.key);if(o<0){if(e.left===null)break;if(t(r,e.left.key)<0){var a=e.left;if(e.left=a.right,a.right=e,e=a,e.left===null)break}s.left=e,s=e,e=e.left}else if(o>0){if(e.right===null)break;if(t(r,e.right.key)>0){var a=e.right;if(e.right=a.left,a.left=e,e=a,e.right===null)break}i.right=e,i=e,e=e.right}else break}return i.right=e.left,s.left=e.right,e.left=n.right,e.right=n.left,e}function Dd(r,e,t,n){var i=new ks(r,e);if(t===null)return i.left=i.right=null,i;t=Vs(r,t,n);var s=n(r,t.key);return s<0?(i.left=t.left,i.right=t,t.left=null):s>=0&&(i.right=t.right,i.left=t,t.right=null),i}function Mv(r,e,t){var n=null,i=null;if(e){e=Vs(r,e,t);var s=t(e.key,r);s===0?(n=e.left,i=e.right):s<0?(i=e.right,e.right=null,n=e):(n=e.left,e.left=null,i=e)}return{left:n,right:i}}function LC(r,e,t){return e===null?r:(r===null||(e=Vs(r.key,e,t),e.left=r),e)}function Md(r,e,t,n,i){if(r){n(""+e+(t?"└── ":"├── ")+i(r)+`
65
+ `);var s=e+(t?" ":"│ ");r.left&&Md(r.left,s,!1,n,i),r.right&&Md(r.right,s,!0,n,i)}}var Rd=function(){function r(e){e===void 0&&(e=RC),this._root=null,this._size=0,this._comparator=e}return r.prototype.insert=function(e,t){return this._size++,this._root=Dd(e,t,this._root,this._comparator)},r.prototype.add=function(e,t){var n=new ks(e,t);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,s=Vs(e,this._root,i),o=i(e,s.key);return o===0?this._root=s:(o<0?(n.left=s.left,n.right=s,s.left=null):o>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},r.prototype._remove=function(e,t,n){var i;if(t===null)return null;t=Vs(e,t,n);var s=n(e,t.key);return s===0?(t.left===null?i=t.right:(i=Vs(e,t.left,n),i.right=t.right),this._size--,i):t},r.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=Vs(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},r.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var i=n(e,t.key);if(i===0)return t;i<0?t=t.left:t=t.right}return null},r.prototype.find=function(e){return this._root&&(this._root=Vs(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},r.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var i=n(e,t.key);if(i===0)return!0;i<0?t=t.left:t=t.right}return!1},r.prototype.forEach=function(e,t){for(var n=this._root,i=[],s=!1;!s;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),e.call(t,n),n=n.right):s=!0;return this},r.prototype.range=function(e,t,n,i){for(var s=[],o=this._comparator,a=this._root,u;s.length!==0||a;)if(a)s.push(a),a=a.left;else{if(a=s.pop(),u=o(a.key,t),u>0)break;if(o(a.key,e)>=0&&n.call(i,a))return this;a=a.right}return this},r.prototype.keys=function(){var e=[];return this.forEach(function(t){var n=t.key;return e.push(n)}),e},r.prototype.values=function(){var e=[];return this.forEach(function(t){var n=t.data;return e.push(n)}),e},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},r.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},r.prototype.at=function(e){for(var t=this._root,n=!1,i=0,s=[];!n;)if(t)s.push(t),t=t.left;else if(s.length>0){if(t=s.pop(),i===e)return t;i++,t=t.right}else n=!0;return null},r.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var i=this._comparator;t;){var s=i(e.key,t.key);if(s===0)break;s<0?(n=t,t=t.left):t=t.right}return n},r.prototype.prev=function(e){var t=this._root,n=null;if(e.left!==null){for(n=e.left;n.right;)n=n.right;return n}for(var i=this._comparator;t;){var s=i(e.key,t.key);if(s===0)break;s<0?t=t.left:(n=t,t=t.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return AC(this._root)},r.prototype.load=function(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!1);var i=e.length,s=this._comparator;if(n&&Ad(e,t,0,i-1,s),this._root===null)this._root=Ld(e,t,0,i),this._size=i;else{var o=kC(this.toList(),FC(e,t),s);i=this._size+i,this._root=Fd({head:o},0,i)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(e){e===void 0&&(e=function(n){return String(n.key)});var t=[];return Md(this._root,"",!0,function(n){return t.push(n)},e),t.join("")},r.prototype.update=function(e,t,n){var i=this._comparator,s=Mv(e,this._root,i),o=s.left,a=s.right;i(e,t)<0?a=Dd(t,n,a,i):o=Dd(t,n,o,i),this._root=LC(o,a,i)},r.prototype.split=function(e){return Mv(e,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var e,t,n;return MC(this,function(i){switch(i.label){case 0:e=this._root,t=[],n=!1,i.label=1;case 1:return n?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return i.sent(),e=e.right,[3,5];case 4:n=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},r}();function Ld(r,e,t,n){var i=n-t;if(i>0){var s=t+Math.floor(i/2),o=r[s],a=e[s],u=new ks(o,a);return u.left=Ld(r,e,t,s),u.right=Ld(r,e,s+1,n),u}return null}function FC(r,e){for(var t=new ks(null,null),n=t,i=0;i<r.length;i++)n=n.next=new ks(r[i],e[i]);return n.next=null,t.next}function AC(r){for(var e=r,t=[],n=!1,i=new ks(null,null),s=i;!n;)e?(t.push(e),e=e.left):t.length>0?(e=s=s.next=t.pop(),e=e.right):n=!0;return s.next=null,i.next}function Fd(r,e,t){var n=t-e;if(n>0){var i=e+Math.floor(n/2),s=Fd(r,e,i),o=r.head;return o.left=s,r.head=r.head.next,o.right=Fd(r,i+1,t),o}return null}function kC(r,e,t){for(var n=new ks(null,null),i=n,s=r,o=e;s!==null&&o!==null;)t(s.key,o.key)<0?(i.next=s,s=s.next):(i.next=o,o=o.next),i=i.next;return s!==null?i.next=s:o!==null&&(i.next=o),n.next}function Ad(r,e,t,n,i){if(!(t>=n)){for(var s=r[t+n>>1],o=t-1,a=n+1;;){do o++;while(i(r[o],s)<0);do a--;while(i(r[a],s)>0);if(o>=a)break;var u=r[o];r[o]=r[a],r[a]=u,u=e[o],e[o]=e[a],e[a]=u}Ad(r,e,t,a,i),Ad(r,e,a+1,n,i)}}const as=11102230246251565e-32,vn=134217729,VC=(3+8*as)*as;function kd(r,e,t,n,i){let s,o,a,u,l=e[0],c=n[0],h=0,f=0;c>l==c>-l?(s=l,l=e[++h]):(s=c,c=n[++f]);let p=0;if(h<r&&f<t)for(c>l==c>-l?(o=l+s,a=s-(o-l),l=e[++h]):(o=c+s,a=s-(o-c),c=n[++f]),s=o,a!==0&&(i[p++]=a);h<r&&f<t;)c>l==c>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=e[++h]):(o=s+c,u=o-s,a=s-(o-u)+(c-u),c=n[++f]),s=o,a!==0&&(i[p++]=a);for(;h<r;)o=s+l,u=o-s,a=s-(o-u)+(l-u),l=e[++h],s=o,a!==0&&(i[p++]=a);for(;f<t;)o=s+c,u=o-s,a=s-(o-u)+(c-u),c=n[++f],s=o,a!==0&&(i[p++]=a);return(s!==0||p===0)&&(i[p++]=s),p}function jC(r,e){let t=e[0];for(let n=1;n<r;n++)t+=e[n];return t}function cl(r){return new Float64Array(r)}const BC=(3+16*as)*as,zC=(2+12*as)*as,UC=(9+64*as)*as*as,Aa=cl(4),Rv=cl(8),Lv=cl(12),Fv=cl(16),Ln=cl(4);function GC(r,e,t,n,i,s,o){let a,u,l,c,h,f,p,v,C,S,P,y,_,m,w,E,b,I;const T=r-i,D=t-i,x=e-s,N=n-s;m=T*N,f=vn*T,p=f-(f-T),v=T-p,f=vn*N,C=f-(f-N),S=N-C,w=v*S-(m-p*C-v*C-p*S),E=x*D,f=vn*x,p=f-(f-x),v=x-p,f=vn*D,C=f-(f-D),S=D-C,b=v*S-(E-p*C-v*C-p*S),P=w-b,h=w-P,Aa[0]=w-(P+h)+(h-b),y=m+P,h=y-m,_=m-(y-h)+(P-h),P=_-E,h=_-P,Aa[1]=_-(P+h)+(h-E),I=y+P,h=I-y,Aa[2]=y-(I-h)+(P-h),Aa[3]=I;let L=jC(4,Aa),A=zC*o;if(L>=A||-L>=A||(h=r-T,a=r-(T+h)+(h-i),h=t-D,l=t-(D+h)+(h-i),h=e-x,u=e-(x+h)+(h-s),h=n-N,c=n-(N+h)+(h-s),a===0&&u===0&&l===0&&c===0)||(A=UC*o+VC*Math.abs(L),L+=T*c+N*a-(x*l+D*u),L>=A||-L>=A))return L;m=a*N,f=vn*a,p=f-(f-a),v=a-p,f=vn*N,C=f-(f-N),S=N-C,w=v*S-(m-p*C-v*C-p*S),E=u*D,f=vn*u,p=f-(f-u),v=u-p,f=vn*D,C=f-(f-D),S=D-C,b=v*S-(E-p*C-v*C-p*S),P=w-b,h=w-P,Ln[0]=w-(P+h)+(h-b),y=m+P,h=y-m,_=m-(y-h)+(P-h),P=_-E,h=_-P,Ln[1]=_-(P+h)+(h-E),I=y+P,h=I-y,Ln[2]=y-(I-h)+(P-h),Ln[3]=I;const J=kd(4,Aa,4,Ln,Rv);m=T*c,f=vn*T,p=f-(f-T),v=T-p,f=vn*c,C=f-(f-c),S=c-C,w=v*S-(m-p*C-v*C-p*S),E=x*l,f=vn*x,p=f-(f-x),v=x-p,f=vn*l,C=f-(f-l),S=l-C,b=v*S-(E-p*C-v*C-p*S),P=w-b,h=w-P,Ln[0]=w-(P+h)+(h-b),y=m+P,h=y-m,_=m-(y-h)+(P-h),P=_-E,h=_-P,Ln[1]=_-(P+h)+(h-E),I=y+P,h=I-y,Ln[2]=y-(I-h)+(P-h),Ln[3]=I;const H=kd(J,Rv,4,Ln,Lv);m=a*c,f=vn*a,p=f-(f-a),v=a-p,f=vn*c,C=f-(f-c),S=c-C,w=v*S-(m-p*C-v*C-p*S),E=u*l,f=vn*u,p=f-(f-u),v=u-p,f=vn*l,C=f-(f-l),S=l-C,b=v*S-(E-p*C-v*C-p*S),P=w-b,h=w-P,Ln[0]=w-(P+h)+(h-b),y=m+P,h=y-m,_=m-(y-h)+(P-h),P=_-E,h=_-P,Ln[1]=_-(P+h)+(h-E),I=y+P,h=I-y,Ln[2]=y-(I-h)+(P-h),Ln[3]=I;const Z=kd(H,Lv,4,Ln,Fv);return Fv[Z-1]}function WC(r,e,t,n,i,s){const o=(e-s)*(t-i),a=(r-i)*(n-s),u=o-a,l=Math.abs(o+a);return Math.abs(u)>=BC*l?u:-GC(r,e,t,n,i,s,l)}const hl=(r,e)=>r.ll.x<=e.x&&e.x<=r.ur.x&&r.ll.y<=e.y&&e.y<=r.ur.y,Vd=(r,e)=>{if(e.ur.x<r.ll.x||r.ur.x<e.ll.x||e.ur.y<r.ll.y||r.ur.y<e.ll.y)return null;const t=r.ll.x<e.ll.x?e.ll.x:r.ll.x,n=r.ur.x<e.ur.x?r.ur.x:e.ur.x,i=r.ll.y<e.ll.y?e.ll.y:r.ll.y,s=r.ur.y<e.ur.y?r.ur.y:e.ur.y;return{ll:{x:t,y:i},ur:{x:n,y:s}}};let js=Number.EPSILON;js===void 0&&(js=Math.pow(2,-52));const HC=js*js,Av=(r,e)=>{if(-js<r&&r<js&&-js<e&&e<js)return 0;const t=r-e;return t*t<HC*r*e?0:r<e?-1:1};class qC{constructor(){this.reset()}reset(){this.xRounder=new kv,this.yRounder=new kv}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class kv{constructor(){this.tree=new Rd,this.round(0)}round(e){const t=this.tree.add(e),n=this.tree.prev(t);if(n!==null&&Av(t.key,n.key)===0)return this.tree.remove(e),n.key;const i=this.tree.next(t);return i!==null&&Av(t.key,i.key)===0?(this.tree.remove(e),i.key):e}}const dl=new qC,Mc=(r,e)=>r.x*e.y-r.y*e.x,Vv=(r,e)=>r.x*e.x+r.y*e.y,jv=(r,e,t)=>{const n=WC(r.x,r.y,e.x,e.y,t.x,t.y);return n>0?-1:n<0?1:0},Rc=r=>Math.sqrt(Vv(r,r)),XC=(r,e,t)=>{const n={x:e.x-r.x,y:e.y-r.y},i={x:t.x-r.x,y:t.y-r.y};return Mc(i,n)/Rc(i)/Rc(n)},YC=(r,e,t)=>{const n={x:e.x-r.x,y:e.y-r.y},i={x:t.x-r.x,y:t.y-r.y};return Vv(i,n)/Rc(i)/Rc(n)},Bv=(r,e,t)=>e.y===0?null:{x:r.x+e.x/e.y*(t-r.y),y:t},zv=(r,e,t)=>e.x===0?null:{x:t,y:r.y+e.y/e.x*(t-r.x)},JC=(r,e,t,n)=>{if(e.x===0)return zv(t,n,r.x);if(n.x===0)return zv(r,e,t.x);if(e.y===0)return Bv(t,n,r.y);if(n.y===0)return Bv(r,e,t.y);const i=Mc(e,n);if(i==0)return null;const s={x:t.x-r.x,y:t.y-r.y},o=Mc(s,e)/i,a=Mc(s,n)/i,u=r.x+a*e.x,l=t.x+o*n.x,c=r.y+a*e.y,h=t.y+o*n.y,f=(u+l)/2,p=(c+h)/2;return{x:f,y:p}};class xr{static compare(e,t){const n=xr.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Bs.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,i=t.length;n<i;n++){const s=t[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let i=t+1;i<e;i++){const s=this.point.events[i];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const i=this.point.events[t];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&e.push(i)}return e}getLeftmostComparator(e){const t=new Map,n=i=>{const s=i.otherSE;t.set(i,{sine:XC(this.point,e.point,s.point),cosine:YC(this.point,e.point,s.point)})};return(i,s)=>{t.has(i)||n(i),t.has(s)||n(s);const{sine:o,cosine:a}=t.get(i),{sine:u,cosine:l}=t.get(s);return o>=0&&u>=0?a<l?1:a>l?-1:0:o<0&&u<0?a<l?-1:a>l?1:0:u<o?-1:u>o?1:0}}}let $C=0;class Bs{static compare(e,t){const n=e.leftSE.point.x,i=t.leftSE.point.x,s=e.rightSE.point.x,o=t.rightSE.point.x;if(o<n)return 1;if(s<i)return-1;const a=e.leftSE.point.y,u=t.leftSE.point.y,l=e.rightSE.point.y,c=t.rightSE.point.y;if(n<i){if(u<a&&u<l)return 1;if(u>a&&u>l)return-1;const h=e.comparePoint(t.leftSE.point);if(h<0)return 1;if(h>0)return-1;const f=t.comparePoint(e.rightSE.point);return f!==0?f:-1}if(n>i){if(a<u&&a<c)return-1;if(a>u&&a>c)return 1;const h=t.comparePoint(e.leftSE.point);if(h!==0)return h;const f=e.comparePoint(t.rightSE.point);return f<0?1:f>0?-1:1}if(a<u)return-1;if(a>u)return 1;if(s<o){const h=t.comparePoint(e.rightSE.point);if(h!==0)return h}if(s>o){const h=e.comparePoint(t.rightSE.point);if(h<0)return 1;if(h>0)return-1}if(s!==o){const h=l-a,f=s-n,p=c-u,v=o-i;if(h>f&&p<v)return 1;if(h<f&&p>v)return-1}return s>o?1:s<o||l<c?-1:l>c?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,n,i){this.id=++$C,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=i}static fromRing(e,t,n){let i,s,o;const a=xr.comparePoints(e,t);if(a<0)i=e,s=t,o=1;else if(a>0)i=t,s=e,o=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const u=new xr(i,!0),l=new xr(s,!1);return new Bs(u,l,[n],[o])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,n=this.rightSE.point,i=this.vector();if(t.x===n.x)return e.x===t.x?0:e.x<t.x?1:-1;const s=(e.y-t.y)/i.y,o=t.x+s*i.x;if(e.x===o)return 0;const a=(e.x-t.x)/i.x,u=t.y+a*i.y;return e.y===u?0:e.y<u?-1:1}getIntersection(e){const t=this.bbox(),n=e.bbox(),i=Vd(t,n);if(i===null)return null;const s=this.leftSE.point,o=this.rightSE.point,a=e.leftSE.point,u=e.rightSE.point,l=hl(t,a)&&this.comparePoint(a)===0,c=hl(n,s)&&e.comparePoint(s)===0,h=hl(t,u)&&this.comparePoint(u)===0,f=hl(n,o)&&e.comparePoint(o)===0;if(c&&l)return f&&!h?o:!f&&h?u:null;if(c)return h&&s.x===u.x&&s.y===u.y?null:s;if(l)return f&&o.x===a.x&&o.y===a.y?null:a;if(f&&h)return null;if(f)return o;if(h)return u;const p=JC(s,this.vector(),a,e.vector());return p===null||!hl(i,p)?null:dl.round(p.x,p.y)}split(e){const t=[],n=e.events!==void 0,i=new xr(e,!0),s=new xr(e,!1),o=this.rightSE;this.replaceRightSE(s),t.push(s),t.push(i);const a=new Bs(i,o,this.rings.slice(),this.windings.slice());return xr.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),xr.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),s.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const i=Bs.compare(t,n);if(i!==0){if(i>0){const s=t;t=n,n=s}if(t.prev===n){const s=t;t=n,n=s}for(let s=0,o=n.rings.length;s<o;s++){const a=n.rings[s],u=n.windings[s],l=t.rings.indexOf(a);l===-1?(t.rings.push(a),t.windings.push(u)):t.windings[l]+=u}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let a=0,u=this.rings.length;a<u;a++){const l=this.rings[a],c=this.windings[a],h=t.indexOf(l);h===-1?(t.push(l),n.push(c)):n[h]+=c}const s=[],o=[];for(let a=0,u=t.length;a<u;a++){if(n[a]===0)continue;const l=t[a],c=l.poly;if(o.indexOf(c)===-1)if(l.isExterior)s.push(c);else{o.indexOf(c)===-1&&o.push(c);const h=s.indexOf(l.poly);h!==-1&&s.splice(h,1)}}for(let a=0,u=s.length;a<u;a++){const l=s[a].multiPoly;i.indexOf(l)===-1&&i.push(l)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(ni.type){case"union":{const n=e.length===0,i=t.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;e.length<t.length?(n=e.length,i=t.length):(n=t.length,i=e.length),this._isInResult=i===ni.numMultiPolys&&n<i;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2===1;break}case"difference":{const n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(e)!==n(t);break}default:throw new Error(`Unrecognized operation type found ${ni.type}`)}return this._isInResult}}class Uv{constructor(e,t,n){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=n,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=dl.round(e[0][0],e[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let s=i;for(let o=1,a=e.length;o<a;o++){if(typeof e[o][0]!="number"||typeof e[o][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let u=dl.round(e[o][0],e[o][1]);u.x===s.x&&u.y===s.y||(this.segments.push(Bs.fromRing(s,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),s=u)}(i.x!==s.x||i.y!==s.y)&&this.segments.push(Bs.fromRing(s,i,this))}getSweepEvents(){const e=[];for(let t=0,n=this.segments.length;t<n;t++){const i=this.segments[t];e.push(i.leftSE),e.push(i.rightSE)}return e}}class KC{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Uv(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,i=e.length;n<i;n++){const s=new Uv(e[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,n=this.interiorRings.length;t<n;t++){const i=this.interiorRings[t].getSweepEvents();for(let s=0,o=i.length;s<o;s++)e.push(i[s])}return e}}class Gv{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,i=e.length;n<i;n++){const s=new KC(e[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const i=this.polys[t].getSweepEvents();for(let s=0,o=i.length;s<o;s++)e.push(i[s])}return e}}class Lc{static factory(e){const t=[];for(let n=0,i=e.length;n<i;n++){const s=e[n];if(!s.isInResult()||s.ringOut)continue;let o=null,a=s.leftSE,u=s.rightSE;const l=[a],c=a.point,h=[];for(;o=a,a=u,l.push(a),a.point!==c;)for(;;){const f=a.getAvailableLinkedEvents();if(f.length===0){const C=l[0].point,S=l[l.length-1].point;throw new Error(`Unable to complete output ring starting at [${C.x}, ${C.y}]. Last matching segment found ends at [${S.x}, ${S.y}].`)}if(f.length===1){u=f[0].otherSE;break}let p=null;for(let C=0,S=h.length;C<S;C++)if(h[C].point===a.point){p=C;break}if(p!==null){const C=h.splice(p)[0],S=l.splice(C.index);S.unshift(S[0].otherSE),t.push(new Lc(S.reverse()));continue}h.push({index:l.length,point:a.point});const v=a.getLeftmostComparator(o);u=f.sort(v)[0].otherSE;break}t.push(new Lc(l))}return t}constructor(e){this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let l=1,c=this.events.length-1;l<c;l++){const h=this.events[l].point,f=this.events[l+1].point;jv(h,e,f)!==0&&(t.push(h),e=h)}if(t.length===1)return null;const n=t[0],i=t[1];jv(n,e,i)===0&&t.shift(),t.push(t[0]);const s=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:t.length-1,a=this.isExteriorRing()?t.length:-1,u=[];for(let l=o;l!=a;l+=s)u.push([t[l].x,t[l].y]);return u}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let i=1,s=this.events.length;i<s;i++){const o=this.events[i];xr.compare(e,o)>0&&(e=o)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return n.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}}class Wv{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,n=this.interiorRings.length;t<n;t++){const i=this.interiorRings[t].getGeom();i!==null&&e.push(i)}return e}}class ZC{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const i=this.polys[t].getGeom();i!==null&&e.push(i)}return e}_composePolys(e){const t=[];for(let n=0,i=e.length;n<i;n++){const s=e[n];if(!s.poly)if(s.isExteriorRing())t.push(new Wv(s));else{const o=s.enclosingRing();o.poly||t.push(new Wv(o)),o.poly.addInterior(s)}}return t}}class QC{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bs.compare;this.queue=e,this.tree=new Rd(t),this.segments=[]}process(e){const t=e.segment,n=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),n;const i=e.isLeft?this.tree.add(t):this.tree.find(t);if(!i)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let s=i,o=i,a,u;for(;a===void 0;)s=this.tree.prev(s),s===null?a=null:s.key.consumedBy===void 0&&(a=s.key);for(;u===void 0;)o=this.tree.next(o),o===null?u=null:o.key.consumedBy===void 0&&(u=o.key);if(e.isLeft){let l=null;if(a){const h=a.getIntersection(t);if(h!==null&&(t.isAnEndpoint(h)||(l=h),!a.isAnEndpoint(h))){const f=this._splitSafely(a,h);for(let p=0,v=f.length;p<v;p++)n.push(f[p])}}let c=null;if(u){const h=u.getIntersection(t);if(h!==null&&(t.isAnEndpoint(h)||(c=h),!u.isAnEndpoint(h))){const f=this._splitSafely(u,h);for(let p=0,v=f.length;p<v;p++)n.push(f[p])}}if(l!==null||c!==null){let h=null;l===null?h=c:c===null?h=l:h=xr.comparePoints(l,c)<=0?l:c,this.queue.remove(t.rightSE),n.push(t.rightSE);const f=t.split(h);for(let p=0,v=f.length;p<v;p++)n.push(f[p])}n.length>0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=a)}else{if(a&&u){const l=a.getIntersection(u);if(l!==null){if(!a.isAnEndpoint(l)){const c=this._splitSafely(a,l);for(let h=0,f=c.length;h<f;h++)n.push(c[h])}if(!u.isAnEndpoint(l)){const c=this._splitSafely(u,l);for(let h=0,f=c.length;h<f;h++)n.push(c[h])}}}this.tree.remove(t)}return n}_splitSafely(e,t){this.tree.remove(e);const n=e.rightSE;this.queue.remove(n);const i=e.split(t);return i.push(n),e.consumedBy===void 0&&this.tree.add(e),i}}const Hv=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,tS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class eS{run(e,t,n){ni.type=e,dl.reset();const i=[new Gv(t,!0)];for(let h=0,f=n.length;h<f;h++)i.push(new Gv(n[h],!1));if(ni.numMultiPolys=i.length,ni.type==="difference"){const h=i[0];let f=1;for(;f<i.length;)Vd(i[f].bbox,h.bbox)!==null?f++:i.splice(f,1)}if(ni.type==="intersection")for(let h=0,f=i.length;h<f;h++){const p=i[h];for(let v=h+1,C=i.length;v<C;v++)if(Vd(p.bbox,i[v].bbox)===null)return[]}const s=new Rd(xr.compare);for(let h=0,f=i.length;h<f;h++){const p=i[h].getSweepEvents();for(let v=0,C=p.length;v<C;v++)if(s.insert(p[v]),s.size>Hv)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new QC(s);let a=s.size,u=s.pop();for(;u;){const h=u.key;if(s.size===a){const p=h.segment;throw new Error(`Unable to pop() ${h.isLeft?"left":"right"} SweepEvent [${h.point.x}, ${h.point.y}] from segment #${p.id} [${p.leftSE.point.x}, ${p.leftSE.point.y}] -> [${p.rightSE.point.x}, ${p.rightSE.point.y}] from queue.`)}if(s.size>Hv)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>tS)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=o.process(h);for(let p=0,v=f.length;p<v;p++){const C=f[p];C.consumedBy===void 0&&s.insert(C)}a=s.size,u=s.pop()}dl.reset();const l=Lc.factory(o.segments);return new ZC(l).getGeom()}}const ni=new eS;var jd={union:function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ni.run("union",r,t)},intersection:function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ni.run("intersection",r,t)},xor:function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ni.run("xor",r,t)},difference:function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ni.run("difference",r,t)}};function nS(r,e){var t=Jn(r),n=Jn(e),i=r.properties||{},s=jd.difference(t.coordinates,n.coordinates);return s.length===0?null:s.length===1?Pn(s[0],i):Yh(s,i)}function rS(r,e,t){t===void 0&&(t={});var n=Jn(r),i=Jn(e),s=jd.intersection(n.coordinates,i.coordinates);return s.length===0?null:s.length===1?Pn(s[0],t.properties):Yh(s,t.properties)}function iS(r,e,t){t===void 0&&(t={});var n=Jn(r),i=Jn(e),s=jd.union(n.coordinates,i.coordinates);return s.length===0?null:s.length===1?Pn(s[0],t.properties):Yh(s,t.properties)}function qv(r,e){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=rS(Pn([r]),Pn([e]));if(t)return t.geometry.coordinates}function Xv(r,e){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=iS(Pn([r]),Pn([e]));if(t)return t.geometry.coordinates}function Yv(r,e=500,t="meters"){const n=OC(Br(r),e,{units:t});if(n)return n.geometry.coordinates}function Jv(r,e){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=nS(Pn([r]),Pn([e]));if(t)return t.geometry.coordinates}function $v(r,e,t=10,n="meters"){return DC(r,e,{steps:t,units:n}).geometry.coordinates}function Bd(r,e){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=Pn([r]),n=Pn([e]);return CE(t,n)?"oneBig":DE(t,n)?"twoBig":!1}function Kv(r){const e=ys(Qs(r,["0"])),t=ys(Qs(r,["1"])),n=ys(Qs(r,["2"])),i=Wi(Qs(r,["0"])),s=Wi(Qs(r,["1"])),o=Wi(Qs(r,["2"]));return{minPos:[e,t,n],maxPos:[i,s,o],center:[(e+i)*.5,(t+s)*.5,(n+o)*.5]}}function Zv(r){const{minPos:e,maxPos:t,center:n}=Kv(r);if(e.some(a=>!Number.isFinite(a)||t.some(u=>!Number.isFinite(u))||n.some(u=>!Number.isFinite(u)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const i=Ql(e,t);let s=i*.5;const o=Math.abs(e[2]-t[2]);return o!=0&&(s=Math.sqrt(i*i+o*o)*.5),{center:n,radius:s}}function Qv(r,e){const t=Vr(r),n=Vr(e);return g.Vector.distance(t,n)}function fl(r,e){const t=[],n=r.length;let i=0;for(let s=0;s<n-1;++s){if(e===void 0||e==="GEODESIC"){const o=Ql(r[s],r[s+1]),a=Math.abs(r[s][2]-r[s+1][2]);if(a===0)i+=o;else{const u=Math.sqrt(o*o+a*a);i+=u}}else if(e==="RHUMB"){const o=ym(r[s],r[s+1]),a=Math.abs(r[s][2]-r[s+1][2]);if(a===0)i+=o;else{const u=Math.sqrt(o*o+a*a);i+=u}}else if(e==="NONE"){const o=Qv(r[s],r[s+1]);i+=o}else console.warn(`未知的arcType: ${e},导致距离无法计算!`);t.push(i)}return t}function zd(r){const e="__getXyzFromPostion";let t=Xn(r,e);return(!t||!g.Vector.equals(t[0],r))&&(t=[[...r],Vr(r)],fi(r,e,t)),t[1]}class sS{constructor(e){this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(let t=0;t<this.length;t++)this.points[t].z=this.points[t].z||0;for(let t=0;t<this.length-1;t++){const n=this.points[t],i=this.points[t+1];this.centers.push({x:(n.x+i.x)/2,y:(n.y+i.y)/2,z:(n.z+i.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(let t=0;t<this.centers.length-1;t++){const n=this.points[t+1].x-(this.centers[t].x+this.centers[t+1].x)/2,i=this.points[t+1].y-(this.centers[t].y+this.centers[t+1].y)/2,s=this.points[t+1].z-(this.centers[t].z+this.centers[t+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t].x+n),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t].y+i),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t].z+s)},{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t+1].x+n),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t+1].y+i),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}cacheSteps(e){const t=[];let n=this.pos(0);t.push(0);for(let i=0;i<this.duration;i+=10){const s=this.pos(i);Math.sqrt((s.x-n.x)*(s.x-n.x)+(s.y-n.y)*(s.y-n.y)+(s.z-n.z)*(s.z-n.z))>e&&(t.push(i),n=s)}return t}vector(e){const t=this.pos(e+10),n=this.pos(e-10);return{angle:180*Math.atan2(t.y-n.y,t.x-n.x)/3.14,speed:Math.sqrt((n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y)+(n.z-t.z)*(n.z-t.z))}}pos(e){let t=e-this.delay;t<0&&(t=0),t>this.duration&&(t=this.duration-1);const n=t/this.duration;if(n>=1)return this.points[this.length-1];const i=Math.floor((this.points.length-1)*n),s=(this.length-1)*n-i;return oS(s,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])}}function oS(r,e,t,n,i){const s=aS(r);return{x:i.x*s[0]+n.x*s[1]+t.x*s[2]+e.x*s[3],y:i.y*s[0]+n.y*s[1]+t.y*s[2]+e.y*s[3],z:i.z*s[0]+n.z*s[1]+t.z*s[2]+e.z*s[3]}}function aS(r){const e=r*r;return[e*r,3*e*(1-r),3*r*(1-r)*(1-r),(1-r)*(1-r)*(1-r)]}function uS(r,e){e===void 0&&(e={});var t=e.resolution||1e3,n=e.sharpness||.85;const i=[],s=r.map(l=>{const[c,h,f]=Vr(l);return{x:c,y:h,z:f}});for(var o=new sS({duration:t,points:s,sharpness:n}),a=function(l){var c=o.pos(l);const h=Xh([c.x,c.y,c.z]);i.push(h)},u=0;u<o.duration;u+=10)a(u);return a(o.duration),i}function ty(r,e,t){return uS(r,{resolution:e,sharpness:t})}class ey extends ra{constructor(e){super(e)}get propUiTree(){return this.uiTree}}class Ud extends na{constructor(e,t,n){super(e,t),this._property=n}get property(){return this._property}}class Gd extends Ud{constructor(e,t){super(e,!1,t)}}class Wd extends Ud{constructor(e,t){super(e,!0,t)}get groupChildren(){return this.children}}function ny(r,e){const t=new ey(e),n=r.getProperties("chinese"),i=[];for(let s of n)if(s instanceof ut){const o=new Wd(t,s);o.d(()=>s.destroy()),t.children.push(o),i.push(o)}else{const o=new Gd(t,s);t.children.push(o),o.d(()=>s.destroy())}for(;i.length>0;){const s=i.pop();if(!s)throw new Error("should not be here!");const o=s;if(!(o.property instanceof ut))throw new Error("!(treeItem.property instanceof GroupProperty)");for(let a of o.property.children)if(a instanceof ut){const u=new Wd(t,a);u.d(()=>a.destroy()),o.groupChildren.push(u),i.push(u)}else{const u=new Gd(t,a);o.groupChildren.push(u),u.d(()=>a.destroy())}}return t.d(()=>{t.itemChildrenChanged.reset(),t.itemChildrenToChange.reset();const s=[...t.getDescendants()];s.forEach(o=>{o.children&&(o.children.length=0),o.destroy()}),s.length=0}),t}class ka extends V{constructor(t){super();d(this,"_propTreeReact",this.dv(j(void 0)));this.d(()=>this._propTreeReact.value=void 0),this.dv(new Ee(this.sceneObjectChanged,n=>{if(!n)return;const i=new V;return i.d(n.toDestroyEvent.don(()=>{this.sceneObject=void 0})),i})),this.d(this.sceneObjectChanged.don(n=>{this._propTreeReact.value=void 0,!(!n||!(n instanceof rt))&&(this._propTreeReact.value=ny(n,t))}))}get propTree(){return this._propTreeReact.value}get propTreeChanged(){return this._propTreeReact.changed}}(r=>{r.createDefaultProps=()=>({sceneObject:void 0})})(ka||(ka={})),Gi(ka.prototype,ka.createDefaultProps);function Hd(r){return vs(r,(e,t)=>e[0]===t[0]&&e[1]===t[1],e=>[...e])}function ry(r,e){const t=new Array;for(let n of r)t.push(e(n));return t}function qd(r,e){return r===void 0&&e===void 0?!0:!r||!e?!1:r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]}function iy(r,e,t){var i;((i=e.attachedViewers.values().toArray()[0])==null?void 0:i.getEngineObject(e))?t.call(r):requestAnimationFrame(()=>iy(r,e,t))}function lS(r,e,t,n=!0){n&&t(),r.dispose(e.disposableOn(t))}function cS(r,e){const{type:t,id:n}=r;if(t){const i=rt.create(t,n);if(i)return i.json=r,i;console.warn(`cannot create sceneObject from type(${t})`)}else console.warn(`cannot create sceneObject from type(${t})`)}function sy(r){const e=r.children&&fh(r.children,n=>{if(!(n instanceof yn))throw new Error("!(treeItem instanceof SceneTreeItem)");return!n.show})||!1,t=r.sceneTree.getSceneObjectShowFunc(r.sceneObject);return!e||t}class yn extends na{constructor(t,n=!1,i,s,o=!0){super(t,n,i);d(this,"_dragDrop");d(this,"_showChangedNotAffectChildren",!1);d(this,"_showChangedNotAffectParent",!1);d(this,"_type",this.dv(j("Unknown")));d(this,"_isExport",this.dv(j(!0)));const a=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(a)),this.name=`未命名条目(${this.id})`,this.extras=s,this._isExport.value=o;let u;const l=()=>{u&&(u(),u=void 0)};this.dispose(l),this.dispose(this.sceneObjectChanged.disposableOn(c=>{l(),c&&(u=nt([this,"name"],[c,"name"]))})),this.dispose(this.showChanged.disposableOn(c=>{if(t.setSceneObjectShowFunc(this.sceneObject,c),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let h of this.children)h instanceof yn&&(h._showChangedNotAffectParent=!0,h.show=c,h._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof yn&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=sy(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new Ee(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const c=new V;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof O){const h=()=>{this.show=t.getSceneObjectShowFunc(this.sceneObject)};h(),c.dispose(this.sceneObject.showChanged.disposableOn(h))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof O){const h=()=>{this.show=t.getSceneObjectShowFunc(this.sceneObject)};h(),c.dispose(this.sceneObject.enabledChanged.disposableOn(h))}return c})),this.childrenChangedEvent.disposableOn(()=>{const c=sy(this);this._showChangedNotAffectChildren=!0,this.show=c,this._showChangedNotAffectChildren=!1});{const c=()=>{let h="Unknown";this.sceneObject?h=this.sceneObject.typeName:this.children&&(h="Folder"),this._type.value=h};this.dispose(this.sceneObjectChanged.disposableOn(c)),this.dispose(this.childrenResetedEvent.disposableOn(c)),c()}}get dragDrop(){return this._dragDrop||(this._dragDrop=this.dv(this.sceneTree.createTreeItemDragDropFunc(this))),this._dragDrop}get type(){return this._type.value}get typeChanged(){return this._type.changed}get isExport(){return this._isExport.value}get isExportChanged(){return this._isExport.changed}set isExport(t){this._isExport.value=t}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(t){try{this.json=JSON.parse(t)}catch(n){console.error(`sceneTreeItem.jsonStr error ${n}`,n)}}get completeJson(){const t=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.completeJson);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.completeJson,children:t,extras:this.extras}}get json(){const t=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.json);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.json,children:t,extras:this.extras}}set json(t){if(t.name!==void 0&&(this.name=t.name),this.extras=t.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=t.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=t.collapsed??!1,this.sceneObject=void 0,t.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(t.sceneObj,this)),!!t.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let n of t.children){const i=new yn(this.tree,!0);i.json=n,this.children.push(i)}}}clone(){try{const t=new yn(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return t.json=this.json,t.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),t}catch(t){console.error(`SceneTreeItem.clone error: ${t}`,t)}}insertNewTreeItem(t,n){if(t==="FolderInnerOrAfter"||t==="FolderInnerOrBefore"||t==="FolderInner"){if(n&&n.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&!(t.includes("Or")&&this.sceneObject))return n&&this.children.push(n),!0;if(t==="FolderInner")return!1;if(t==="FolderInnerOrAfter")return super.insertNewTreeItem("After",n);if(t==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",n);throw new Error("should not be here!")}else return super.insertNewTreeItem(t,n)}}(r=>{r.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:Qt(void 0)})})(yn||(yn={})),Gi(yn.prototype,yn.createDefaultProps);function oy(r,e,t){let{offsetY:n}=e;if(!e.target||!("clientTop"in e.target))return"none";n+=2,n+=e.target.clientTop;let i="none";return r.children?n<=t*.3?i="before":n>=t*.7?!r.uiTreeObject.collapsed&&r.children.length>0?i="inner":i="after":i="inner":n<=t*.5?i="before":i="after",i}class ay extends kg{constructor(e){super(),this._treeItem=e;const{dragStartDataManager:t}=this._treeItem.sceneTree;let n="none";const i=this.disposeVar(Vp(()=>{this._treeItem.uiTreeObject.moveToPositionMode=n,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${n});`)},200));function s(o){n!==o&&(n=o,i.restart())}this.dispose(this._dragStartEvent.disposableOn(o=>{t.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(o=>{if(!o.dataTransfer)return;o.preventDefault();const a=t;if(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0){const u=a.data.value,l=this._treeItem,{tree:c}=l;if(c){const h=[...c.selectedItems];~h.indexOf(u)||h.push(u);const f=oy(l,o,c.itemDivHeight);if(f!=="none"&&ra.canMoveToTreeItems(h,l,f)){o.dataTransfer.dropEffect="move",s(f);return}}}o.dataTransfer.dropEffect="none",s("none")})),this.dispose(this._dropEvent.disposableOn(o=>{const a=t;if(!(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0))return;const u=a.data.value,l=this._treeItem,{tree:c}=l;if(!c)return;const h=[...c.selectedItems];~h.indexOf(u)||h.push(u);const f=oy(l,o,c.itemDivHeight);f!=="none"&&ra.canMoveToTreeItems(h,l,f)&&(ra.moveToTreeItems(h,l,f),a.data=void 0,s("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{n="none",i.restart()}))}}function hS(r){if(!(r instanceof yn))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new ay(r)}function dS(r){let e=!1;return r&&("show"in r?e=r.show??!0:"enabled"in r&&(e=r.enabled??!0)),e}function fS(r,e){r&&("show"in r?r.show=e:"enabled"in r&&(r.enabled=e))}const pS=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function gS(r){const e=[],{root:t={}}=r,n=[t];for(;n.length>0;){const i=n.pop();if(!i)throw new Error("!todo");if(i.children){for(let s of i.children)if(s.children&&n.unshift(s),s.sceneObj){const{type:o=void 0}=s.sceneObj;o||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(s.sceneObj)),o&&pS.includes(o)&&e.push(s.sceneObj)}}}return e}async function mS(r,e){const t=gS(r);let n=0;const i=t.length;for(let s of t)if(++n,e){const o=n/i;e(o,n,i)}}class uy extends V{constructor(t,n){super();d(this,"treeItemContexMenuCallback");this._sceneTree=t,this._projectManager=n}get sceneTree(){return this._sceneTree}}class vS extends V{constructor(t){super();d(this,"_jsonLoadingEvent",this.disposeVar(new O));d(this,"_setJsonProcessing",this.disposeVar(Yn(async(t,n)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),n&&await t.promise(this._sceneTree.preloadFunc(n)),this._setJson(n),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=t,this._setJsonProcessing.errorFunc=n=>{this._jsonLoadingEvent.emit({type:"error",error:n})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(t){try{this._sceneTree.setJson(t||{})}catch(n){console.error(`json数据装配时发生错误!error: ${n}`)}}get json(){return this._sceneTree.getJson()}set json(t){this._setJsonProcessing.restart(new Fr("JSON重新赋值!"),t)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(t){this.json=JSON.parse(t)}}function yS(r){return r.name+"_clone"}function Xd(r,e,t){if(r instanceof yn)return r.insertNewTreeItem(e,t);{const n={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return r.insertNewTreeItem(n[e],t)}}function _S(r){[r,...r.getDescendants()].forEach(e=>e.destroy())}const Hn=class Hn extends ra{constructor(t,n,i,s){super(i);d(this,"_jsonLoading",this.disposeVar(new vS(this)));d(this,"createSceneObjectFunc",Hn.defaultCreateSceneObjectFunc);d(this,"createTreeItemDragDropFunc",Hn.defaultCreateTreeItemDragDropFunc);d(this,"preloadFunc",Hn.defaultPreload);d(this,"getSceneObjectShowFunc",Hn.defaultGetSceneObjectShow);d(this,"setSceneObjectShowFunc",Hn.defaultSetSceneObjectShow);d(this,"getSceneTreeItemCloneNameFunc",Hn.defaultGetSceneTreeItemCloneNameFunc);d(this,"debug",!1);d(this,"_contextMenu",this.disposeVar(new uy(this,this.projectManager)));d(this,"_showPropUiOnSelecting",this.disposeVar(j(!0)));this._name=t,this._dragStartDataManager=n,this._projectManager=s,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var a,u;globalThis.lssn=this.lastSelectedItem,globalThis.lsso=(a=this.lastSelectedItem)==null?void 0:a.sceneObject,this.debug&&console.log(((u=this.lastSelectedItem)==null?void 0:u.sceneObject)??"select null")}));const{sceneObjectsManager:o}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(a=>{for(let u of a){const l=u,{sceneObject:c}=l;c&&o.deleteSceneObject(c)&&c.destroy()&&ql(c,void 0);for(let h of l.getDescendants()){const{sceneObject:f}=h;f&&o.deleteSceneObject(f)&&f.destroy()&&ql(f,void 0)}_S(u)}})),this.dispose(this.itemsAdded.disposableOn(a=>{for(let u of a){const l=u;l.sceneObject&&o.addSceneObject(l.sceneObject)&&ql(l.sceneObject,l)}})),this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{if(!this.showPropUiOnSelecting)return;this._projectManager.propUiTreeManager.sceneObject=void 0;const{lastSelectedItem:a}=this;a&&(this._projectManager.propUiTreeManager.sceneObject=a.sceneObject)}))}get json(){return this._jsonLoading.json}set json(t){this._jsonLoading.json=t}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(t){this._jsonLoading.jsonStr=t}get jsonLoadingEvent(){return this._jsonLoading.jsonLoadingEvent}get name(){return this._name}get projectManager(){return this._projectManager}get contextMenu(){return this._contextMenu}get showPropUiOnSelecting(){return this._showPropUiOnSelecting.value}set showPropUiOnSelecting(t){this._showPropUiOnSelecting.value=t}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(t){const n=this.getDescendants();let i;for(let s of n)if(s.sceneObject&&s.sceneObject.id===t){i=s;break}return i}getTreeItemsFromSceneObjType(t){const n=this.getDescendants(),i=[],s=Array.isArray(t)?t:[t];for(let o of n)o.sceneObject&&s.includes(o.sceneObject.typeName)&&i.push(o);return i}getTreeItemsFromSceneObjName(t){var s;const n=this.getDescendants(),i=[];for(let o of n)(s=o.sceneObject)!=null&&s.name.includes(t)&&i.push(o);return i}get dragStartDataManager(){return this._dragStartDataManager}get completeJson(){return{root:{children:[...this.children].filter(t=>t.isExport).map(t=>t.completeJson)}}}getJson(){return{root:{children:[...this.children].filter(t=>t.isExport).map(t=>t.json)}}}setJson(t){var i;t.root=t.root||{};const n=t.root.children??[];this.root.resetChildren(!0);for(let s of n){const o=new yn(this,!0);o.json=s,(i=this.root.children)==null||i.push(o)}}testAddNewTreeItem(t,n){const i=t||this.lastSelectedItem||this.root;return i?Xd(i,n):!1}addNewTreeItem(t,n,i,s){const o=t||this.lastSelectedItem||this.root;if(o&&Xd(o,n)){const a=new yn(this,i);if(a.sceneObject=s,!Xd(o,n,a))throw new Error("currentTreeItem.insertNewTreeItem return false!");return a}}createSceneObjectTreeItem(t,n,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const a=rt.create(t,n);return a?this.addNewTreeItem(i,s??"FolderInnerOrAfter",!0,a):void 0}createGroupTreeItem(t,n,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const a=this.addNewTreeItem(i,s??"FolderInnerOrAfter",!0);if(!a){console.warn("addNewTreeItem error!");return}return a.name=t??"未命名组节点",a}createSceneObjectTreeItemFromClass(t,n,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o))return;const a=rt.createFromClass(t,n);return a?this.addNewTreeItem(i,o,!0,a):void 0}createSceneObjectTreeItemFromJson(t,n,i){const s=i??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,s))return;const o=rt.createFromJson(t);return console.log(o),o?this.addNewTreeItem(n,i??"FolderInnerOrAfter",!0,o):void 0}destroySceneObjectTreeItem(t){if(t===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}t.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const t=[...this.root.children];for(let n of t)this.destroySceneObjectTreeItem(n)}};d(Hn,"defaultCreateSceneObjectFunc",cS),d(Hn,"defaultCreateTreeItemDragDropFunc",hS),d(Hn,"defaultPreload",mS),d(Hn,"defaultGetSceneObjectShow",dS),d(Hn,"defaultSetSceneObjectShow",fS),d(Hn,"defaultGetSceneTreeItemCloneNameFunc",yS);let pl=Hn;const Yd={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class wS extends V{constructor(t){super();d(this,"_currentPosition",this.disposeVar(re(void 0)));d(this,"_currentRotation",this.disposeVar(re(void 0)));d(this,"_currentHeading",this.disposeVar(j(void 0)));d(this,"_isRotating",this.disposeVar(j(!1)));d(this,"_isGround",this.disposeVar(j(!1)));d(this,"_startPosition",[0,0,0]);d(this,"_startRotation",[0,0,0]);d(this,"_processing",this.disposeVar(Yn(async(t,n,i,s)=>{const{currentPosition:o,currentRotation:a}=this;if(!o||s<=0||!a){this._currentPosition.value=n,this._currentRotation.value=i;return}const u=this._startPosition;u.splice(0,3,...o);const l=this._startRotation;l.splice(0,3,...a);let c=Date.now();const h=Bu(u,n);this._currentHeading.value=h;const p=Ql(u,n)/s,v=[i[0]-l[0],i[1]-l[1],i[2]-l[2]],C=n[2]-u[2];await t.promise(new Promise(S=>{t.disposer.dispose(Rl(async()=>{let P=Date.now()-c;P=P<0?0:P,P=P>s?s:P;const y=P*p,_=om(u,y,h);if(this.isGround&&_){const m=await this._esviewer.getTerrainHeight([_[0],_[1]]);this._currentPosition.value=[_[0],_[1],m??0]}else _&&(_[2]+=C*(P/s)),this._currentPosition.value=_;if(this.isRotating){const[m,w,E]=v,b=P/s;this._currentRotation.value=[l[0]+m*b,l[1]+w*b,l[2]+E*b]}P===s&&(this._currentPosition.value=n,this.isRotating&&(this._currentRotation.value=i),this.isRotating=!1,this.isGround=!1,S())}))}))})));this._esviewer=t}get currentPosition(){return this._currentPosition.value}get currentPositionChanged(){return this._currentPosition.changed}get currentRotation(){return this._currentRotation.value}get currentRotationChanged(){return this._currentRotation.changed}get currentHeading(){return this._currentHeading.value}get currentHeadingChanged(){return this._currentHeading.changed}get isRotating(){return this._isRotating.value}set isRotating(t){this._isRotating.value=t}get isRotatingChanged(){return this._isRotating.changed}get isGround(){return this._isGround.value}set isGround(t){this._isGround.value=t}get isGroundChanged(){return this._isGround.changed}get processing(){return this._processing}restart(t,n,i){this._processing.restart(void 0,t,n,i)}cancel(){this._processing.cancel()}}function ly(r){let e=0;function t(n,i){i++,e=Math.max(i,e),n.forEach(s=>{Array.isArray(s)&&t(s,i)})}return t(r,0),e}const Di=class Di extends Ht{constructor(t){super(t);d(this,"editingBindMode","lineString");d(this,"_area",this.dv(j(0)));d(this,"_perimeter",this.dv(j(0)));this.d(Ui(this.pointsChanged,()=>{this._updateArea(),this._updatePerimeter()},{immediate:!0}))}updateEditing(){var n;const t=[];this.editingBindMode=="doublePoints"?t.push(et.DoublePointsAppend,et.DoublePointsModify):this.editingBindMode=="lineString"?t.push(et.LineStringAppend,et.LineStringInsert,et.Translation):this.editingBindMode=="circular"?(t.push(et.CircularAppend,et.CircularInsert,et.Translation),this.supportEditingModes().includes(et.HeightModify)&&t.push(et.HeightModify)):this.editingBindMode=="visibility"?t.push(et.VisibilityAppend,et.VisibilityModify):this.editingBindMode=="scatter"&&t.push(et.ScatterAppend,et.ScatterModify),(n=this.activeViewer)==null||n.startEditing(this,t,{callSource:"inner"})}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}_updateArea(){this._area.value=this.getArea()??0}_updatePerimeter(){this._perimeter.value=this.getPerimeter()??0}getArea(){if(this.points&&this.points.length>=3)return td([...this.points])}getDistance(){if(this.points&&this.points.length>=2){const t=fl(this.points,"GEODESIC");return t[t.length-1]}else return}getPerimeter(){if(this.points&&this.points.length>=3){const t=[...this.points,this.points[0]],n=fl(t,"GEODESIC");return n[n.length-1]}else return}getIntersect(t){if(this.points&&this.points.length>=3&&t.length>=3){const n=qv(this.points,t);if(!n)return;const i=n[0][0][0];if(Array.isArray(i)){const s=[...n],o=[];return s.forEach(a=>{const u=a[0].map(l=>[...l,0]);o.push(u)}),o}else return[[...n][0].map(a=>[...a,0])]}else return}getUnion(t){if(this.points&&this.points.length>=3&&t.length>=3){const n=Xv(this.points,t);if(!n)return;const i=n[0][0][0];if(Array.isArray(i)){const s=[...n],o=[];return s.forEach(a=>{const u=a[0].map(l=>[...l,0]);o.push(u)}),o}else return[[...n][0].map(a=>[...a,0])]}else return}getDifference(t){if(this.points&&this.points.length>=3&&t.length>=3){let n=[...t];const i=t[0],s=t[t.length-1];i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]||n.push(i);const o=Jv([...this.points,this.points[0]],[...n]);if(!o)return{status:"undefined",positions:void 0};const a=[...o];if(ly(a)===3){const u=a.map(f=>f.map(p=>[...p,0]));if(u.length<=1)return{status:"notIncluded",positions:u};const l=u[0],c=u[1];return Bd([...l],[...c])==="oneBig"?{status:"included",positions:u}:{status:"notIncluded",positions:u}}else if(ly(a)===4){const l=[...a.map(h=>h.map(f=>f.map(p=>[...p,0])))],c=[];return l.forEach(h=>{c.push(h[0])}),{status:"notIncluded",positions:c}}else return{status:"undefined",positions:void 0}}else return{status:"undefined",positions:void 0}}getBuffer(t=500,n){if(this.points&&this.points.length>=2){const i=Yv(this.points,t,n);return i?[i[0].map(s=>[...s,0])]:void 0}else return}geoPolygonOverlap(t){if(this.points&&this.points.length>=3&&t.length>=3){const n=Bd(this.points,t);return n==="oneBig"?!0:n==="twoBig"?!1:void 0}else return}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"style",coordinate:[...t.coordinate,new X([this,"editing"],"编辑",!1),new it([this,"points"],"位置数组",Di.defaults.points,void 0,!0)],style:[...t.style,new ut([],"点样式"),new X([this,"pointed"],"开启",!1),new M([this,"pointSize"],"点大小",1),new Pt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Mt([this,"pointColor"],"点颜色",[1,1,1,1]),new Mt([this,"pointOutlineColor"],"轮廓颜色",Di.defaults.pointStyle.outlineColor),new M([this,"pointOutlineWidth"],"轮廓宽度",Di.defaults.pointStyle.outlineWidth),new ut([],"线样式"),new X([this,"stroked"],"开启线样式",!0),new X([this,"strokeGround"],"贴地",!1),new M([this,"strokeWidth"],"线宽",1),new Pt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Mt([this,"strokeColor"],"线颜色",[1,1,1,1]),new ut([],"面样式"),new X([this,"filled"],"开启",!1),new X([this,"fillGround"],"贴地",!1),new Mt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...t.more,new ut([],"点样式集合"),new pt([this,"pointMaterial"],"点材质"),new it([this,"pointMaterialParams"],"点材质参数"),new ut([],"线样式集合"),new pt([this,"strokeMaterial"],"线材质"),new it([this,"strokeMaterialParams"],"线材质参数"),new ut([],"面样式集合"),new pt([this,"fillMaterial"],"面材质"),new it([this,"fillMaterialParams"],"面材质参数")]}}get pointSize(){return this.pointStyle.size}set pointSize(t){this.pointStyle={...this.pointStyle,size:t}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(t){this.pointStyle={...this.pointStyle,sizeType:t}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(t){this.pointStyle={...this.pointStyle,color:[...t]}}get pointColorChanged(){return this.pointStyleChanged}get pointOutlineColor(){return this.pointStyle.outlineColor}set pointOutlineColor(t){this.pointStyle={...this.pointStyle,outlineColor:[...t]}}get pointOutlineColorChanged(){return this.pointStyleChanged}get pointOutlineWidth(){return this.pointStyle.outlineWidth}set pointOutlineWidth(t){this.pointStyle={...this.pointStyle,outlineWidth:t}}get pointOutlineWidthChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(t){this.pointStyle={...this.pointStyle,material:t}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(t){this.pointStyle={...this.pointStyle,materialParams:t}}get pointMaterialParamsChanged(){return this.pointStyleChanged}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}};d(Di,"createDefaultProps",()=>({...Ht.createDefaultProps(),pointed:!1,pointStyle:wt({size:10,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),stroked:!1,strokeStyle:wt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:wt({color:[1,1,1,1],material:"",materialParams:{},ground:!1}),points:Nl([])})),d(Di,"type",Di.register("ESGeoVector",Di,{chsName:"地理矢量",tags:["ESObjects"],description:"地理矢量"})),d(Di,"supportEditingModes",[...Ht.supportEditingModes,et.Translation]);let It=Di;const To=class To extends Ht{constructor(){super(...arguments);d(this,"_statusDis",this.dv(j(!0)));d(this,"_smoothMoveEvent",this.dv(new O));d(this,"_smoothMoveWithRotationEvent",this.dv(new O));d(this,"_smoothMoveOnGroundEvent",this.dv(new O));d(this,"_smoothMoveWithRotationOnGroundEvent",this.dv(new O));d(this,"_automaticLandingEvent",this.dv(new O));d(this,"_smoothMoveKeepPitchEvent",this.dv(new O));d(this,"_smoothMoveRelativelyEvent",this.dv(new O));d(this,"_smoothMoveRelativelyWithRotationEvent",this.dv(new O));d(this,"useCalcFlyToParamInESObjectWithLocation",!0)}updateEditing(){var n;const t=[];this.editingBindMode=="singlePoint"?(t.push(et.Place,et.Translation),["ESLocationMeasurement"].includes(this.typeName)||t.push(et.Rotation),["ESClippingPlane","ESLocationMeasurement","ESLocalRectangle","ESBoxClipping"].includes(this.typeName)||t.push(et.Scale)):this.editingBindMode=="doublePoints"&&t.push(et.DoublePointsAppend,et.DoublePointsModify),(n=this.activeViewer)==null||n.startEditing(this,t,{callSource:"inner"})}get statusDis(){return this._statusDis.value}get statusDisChanged(){return this._statusDis.changed}get smoothMoveEvent(){return this._smoothMoveEvent}smoothMove(t,n){this._smoothMoveEvent.emit(t,n)}get smoothMoveWithRotationEvent(){return this._smoothMoveWithRotationEvent}smoothMoveWithRotation(t,n,i){this._smoothMoveWithRotationEvent.emit(t,n,i)}get smoothMoveOnGroundEvent(){return this._smoothMoveOnGroundEvent}smoothMoveOnGround(t,n,i,s){this._smoothMoveOnGroundEvent.emit(t,n,i,s)}get smoothMoveWithRotationOnGroundEvent(){return this._smoothMoveWithRotationOnGroundEvent}smoothMoveWithRotationOnGround(t,n,i,s,o){this._smoothMoveWithRotationOnGroundEvent.emit(t,n,i,s,o)}get automaticLandingEvent(){return this._automaticLandingEvent}automaticLanding(){const t=this.collision;this.collision=!1,setTimeout(()=>{this._automaticLandingEvent.emit(t)},100)}get smoothMoveKeepPitchEvent(){return this._smoothMoveKeepPitchEvent}smoothMoveKeepPitch(t,n){this._smoothMoveKeepPitchEvent.emit(t,n)}get smoothMoveRelativelyEvent(){return this._smoothMoveRelativelyEvent}smoothMoveRelatively(t,n){this._smoothMoveRelativelyEvent.emit(t,n)}get smoothMoveRelativelyWithRotationEvent(){return this._smoothMoveRelativelyWithRotationEvent}smoothMoveRelativelyWithRotation(t,n,i){this._smoothMoveRelativelyWithRotationEvent.emit(t,n,i)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",location:[...t.location,new X([this,"editing"],"是否编辑"),new lt([],()=>this.automaticLanding(),[],"自动落地"),new ia([this,"position"],"位置数组",[0,0,0]),new Gh([this,"rotation"],"姿态数组",[0,0,0]),new cn([this,"scale"],"缩放",[1,1,1]),new M([this,"minVisibleDistance"],"最小可见距离",0),new M([this,"maxVisibleDistance"],"最大可见距离",0)],more:[...t.more,new lt(["numbers","number"],(n,i)=>this.smoothMove(n,i),[[0,0,0],0],"平滑移动","smoothMove"),new lt(["numbers","number"],(n,i)=>this.smoothMoveKeepPitch(n,i),[[0,0,0],0],"固定方向平滑移动","smoothMoveKeepPitch"),new lt(["numbers","numbers","number"],(n,i,s)=>this.smoothMoveWithRotation(n,i,s),[[0,0,0],[0,0,0],0],"平滑偏移","smoothMoveWithRotation"),new lt(["number","number","number","string"],(n,i,s,o)=>this.smoothMoveOnGround(n,i,s,o),[0,0,0,""],"贴地平滑移动","smoothMoveOnGround"),new lt(["numbers","number","number","number","string"],(n,i,s,o,a)=>this.smoothMoveWithRotationOnGround(n,i,s,o,a),[[0,0,0],0,0,0,""],"贴地平滑偏移","smoothMoveWithRotationOnGround"),new lt(["numbers","number"],(n,i)=>this.smoothMoveRelatively(n,i),[[0,0,0],0],"smoothMoveRelatively","smoothMoveRelatively"),new lt(["numbers","numbers","number"],(n,i,s)=>this.smoothMoveRelativelyWithRotation(n,i,s),[[0,0,0],[0,0,0],0],"smoothMoveRelativelyWithRotation","smoothMoveRelativelyWithRotation"),new X([this,"enableVisibleDistance"],"是否应用距离显隐")]}}get pointSize(){return this.pointStyle.size}set pointSize(t){this.pointStyle={...this.pointStyle,size:t}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(t){this.pointStyle={...this.pointStyle,sizeType:t}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(t){this.pointStyle={...this.pointStyle,color:[...t]}}get pointColorChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(t){this.pointStyle={...this.pointStyle,material:t}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(t){this.pointStyle={...this.pointStyle,materialParams:t}}get pointMaterialParamsChanged(){return this.pointStyleChanged}};d(To,"createDefaultProps",()=>({...Ht.createDefaultProps(),pointed:!1,pointStyle:wt({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),position:dt([0,0,0]),rotation:dt([0,0,0]),scale:dt([1,1,1]),minVisibleDistance:j(0),maxVisibleDistance:j(0)})),d(To,"type",To.register("ESObjectWithLocation",To,{chsName:"对象位置",tags:["ESObjects"],description:"对象位置"})),d(To,"supportEditingModes",[...Ht.supportEditingModes,et.Place,et.Translation,et.Rotation,et.Scale,et.DoublePointsAppend,et.DoublePointsModify]);let st=To;const Wa=class Wa extends st{getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new ut([],"点样式集合"),new X([this,"pointed"],"开启点样式",!1),new M([this,"pointSize"],"点大小",1),new Pt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Mt([this,"pointColor"],"点颜色",[1,1,1,1]),new ut([],"线样式集合"),new X([this,"stroked"],"开启线样式",!1),new X([this,"strokeGround"],"是否贴地(线)",!1),new M([this,"strokeWidth"],"线宽",1),new Pt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Mt([this,"strokeColor"],"线颜色",[1,1,1,1]),new ut([],"面样式集合"),new X([this,"filled"],"开启填充样式",!1),new X([this,"fillGround"],"是否贴地",!1),new Mt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...e.more,new ut([],"点样式"),new pt([this,"pointMaterial"],"点材质",""),new it([this,"pointMaterialParams"],"点材质参数",{}),new ut([],"线样式"),new pt([this,"strokeMaterial"],"线材质",""),new it([this,"strokeMaterialParams"],"线材质参数",{}),new ut([],"填充样式"),new pt([this,"fillMaterial"],"面材质",""),new it([this,"fillMaterialParams"],"面材质参数",{})]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}};d(Wa,"createDefaultProps",()=>({...st.createDefaultProps(),pointed:!1,pointStyle:wt({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:1}),stroked:!1,strokeStyle:wt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:wt({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(Wa,"type",Wa.register("ESLocalVector",Wa,{chsName:"本地矢量",tags:["ESObjects"],description:"本地矢量对象"}));let Va=Wa;const Sl=class Sl extends Va{};d(Sl,"type",Sl.register("ESLocalVector2D",Sl,{chsName:"本地矢量2D",tags:["ESObjects"],description:"本地矢量2D对象"}));let us=Sl;const ES=[["固定朝向",0],["面向屏幕旋转",1],["绕自身Z轴旋转",2]],CS=[["单面不透明",0],["双面不透明",1],["单面遮罩",2],["双面遮罩",3],["单面透明",4],["双面透明",5],["单面未遮挡透明",6],["双面未遮挡透明",7]],Ha=class Ha extends st{constructor(){super(...arguments);d(this,"_widgetEvent",this.dv(new O))}get widgetEvent(){return this._widgetEvent}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new X([this,"screenRender"],"屏幕渲染",!0),new X([this,"sizeByContent"],"尺寸自适应",!0),new Ae([this,"size"],"尺寸大小",[100,100]),new Ae([this,"anchor"],"偏移比例",[.5,1]),new Ae([this,"offset"],"像素偏移",[0,0]),new Pt([this,"renderMode"],CS,"渲染模式",0),new Pt([this,"rotationType"],ES,"漫游旋转类型",1),new pt([this,"actorTag"],"绑定对象"),new pt([this,"socketName"],"插槽名称"),new cn([this,"positionOffset"],"位置偏移"),new cn([this,"rotationOffset"],"相对姿态")],more:[...t.more,new M([this,"zOrder"],"排序",0)]}}};d(Ha,"createDefaultProps",()=>({...st.createDefaultProps(),screenRender:!0,size:dt([100,100]),anchor:dt([.5,1]),offset:dt([0,0]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,actorTag:"",socketName:"",positionOffset:dt([0,0,0]),rotationOffset:dt([0,0,0])})),d(Ha,"type",Ha.register("ESLabel",Ha,{chsName:"标签",tags:["ESObjects"],description:"标签对象"}));let ar=Ha;const qa=class qa extends rt{constructor(e){super(e)}};d(qa,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,fillStyle:wt({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(qa,"type",qa.register("ESTestObject",qa,{chsName:"测试",tags:["ESObjects"],description:""}));let Jd=qa;const Mi=class Mi extends Ht{constructor(t){super(t);d(this,"_refreshTilesetEvent",this.dv(new O));d(this,"_tilesetReadyEvent",this.dv(new O));d(this,"_supportEdit",this.dv(j(!0)));d(this,"_highlightFeatureEvent",this.dv(new O));d(this,"_highlightFeatureAndFlyToEvent",this.dv(new O));d(this,"_strokeFeatureEvent",this.disposeVar(new O));d(this,"_getFeatureTableEvent",this.dv(new O));d(this,"_featureTableResultEvent",this.dv(new O));d(this,"_getMaterialNameListEvent",this.disposeVar(new O));d(this,"_setFeatureStyleEvent",this.dv(new O));d(this,"_setFeatureColorEvent",this.dv(new O));d(this,"_setFeatureVisableEvent",this.dv(new O));d(this,"_resetFeatureStyleEvent",this.dv(new O));d(this,"setMaterialInfoEvent",this.ad(new O));d(this,"_setMaterialEvent",this.disposeVar(new O));d(this,"_clippingPlanesId",this.dv(j("")));d(this,"_clippingPlaneIds",this.dv(j([])));d(this,"_flattenedPlaneId",this.dv(j("")));d(this,"_flattenedPlaneEnabled",this.dv(j(!1)));d(this,"_clippingPlaneId",this.dv(j("")));d(this,"_excavateId",this.dv(dt([])))}updateEditing(){var t;(t=this.activeViewer)==null||t.startEditing(this,[et.Translation,et.Rotation],{callSource:"inner"})}get refreshTilesetEvent(){return this._refreshTilesetEvent}refreshTileset(){this._refreshTilesetEvent.emit()}get tilesetReady(){return this._tilesetReadyEvent}get supportEdit(){return this._supportEdit.value}set supportEdit(t){this._supportEdit.value=t}get supportEditChanged(){return this._supportEdit.changed}get highlightFeatureEvent(){return this._highlightFeatureEvent}highlightFeature(t,n){this._highlightFeatureEvent.emit(t,n)}get highlightFeatureAndFlyToEvent(){return this._highlightFeatureAndFlyToEvent}highlightFeatureAndFlyTo(t,n,i,s){this._highlightFeatureAndFlyToEvent.emit(t,n,i,s)}get strokeFeatureEvent(){return this._strokeFeatureEvent}strokeFeature(t,n=[1,0,0,1]){this._strokeFeatureEvent.emit(t,n)}get getFeatureTableEvent(){return this._getFeatureTableEvent}getFeatureTable(){return Promise.race([new Promise(t=>{const n=this.d(this._featureTableResultEvent.donce(t));this._getFeatureTableEvent.emit(),setTimeout(()=>{n(),t(void 0)},2e3)})])}get getMaterialNameListEvent(){return this._getMaterialNameListEvent}getMaterialNameList(){return new Promise(t=>{const n=new V;n.d(this.getMaterialNameListEvent.don(i=>{i!=="start"&&(n.destroy(),t(i))})),this.getMaterialNameListEvent.emit("start"),setTimeout(()=>{n.isDestroyed()||(n.destroy(),t(void 0))},2e3)})}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(t){this._setFeatureStyleEvent.emit(t)}get setFeatureColorEvent(){return this._setFeatureColorEvent}setFeatureColor(t,n){this._setFeatureColorEvent.emit(t,typeof n=="string"?JSON.parse(n):n)}get setFeatureVisableEvent(){return this._setFeatureVisableEvent}setFeatureVisable(t,n){this._setFeatureVisableEvent.emit(t,typeof n=="string"?JSON.parse(n):n)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(){this._resetFeatureStyleEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(t){return new Promise(n=>{const i=new V;i.ad(this.setMaterialInfoEvent.donce(s=>{i.destroy(),n(s)})),this._setMaterialEvent.emit(t)})}get clippingPlanesId(){return this._clippingPlanesId.value}set clippingPlanesId(t){this._clippingPlanesId.value=t}get clippingPlanesIdChanged(){return this._clippingPlanesId.changed}get clippingPlaneIds(){return this._clippingPlaneIds.value}set clippingPlaneIds(t){this._clippingPlaneIds.value=t}get clippingPlaneIdsChanged(){return this._clippingPlaneIds.changed}get flattenedPlaneId(){return this._flattenedPlaneId.value}set flattenedPlaneId(t){this._flattenedPlaneId.value=t}get flattenedPlaneIdChanged(){return this._flattenedPlaneId.changed}get flattenedPlaneEnabled(){return this._flattenedPlaneEnabled.value}set flattenedPlaneEnabled(t){this._flattenedPlaneEnabled.value=t}get flattenedPlaneEnabledChanged(){return this._flattenedPlaneEnabled.changed}get clippingPlaneId(){return this._clippingPlaneId.value}set clippingPlaneId(t){this._clippingPlaneId.value=t}get clippingPlaneIdChanged(){return this._clippingPlaneId.changed}get excavateId(){return this._excavateId.value}set excavateId(t){this._excavateId.value=t}get excavateIdChanged(){return this._excavateId.changed}setLight122(){this.czmEnvironmentMapManager={...Yd}}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",basic:[...t.basic,new Ue([this,"maximumScreenSpaceError"],1,[0,256],"精度",16),new Pt([this,"materialMode"],[["常规","normal"],["科技感","technology"]],"材质模式","normal",!0),new Pt([this,"colorBlendMode"],[["默认","HIGHLIGHT"],["替换","REPLACE"],["混合","MIX"]],"颜色模式","HIGHLIGHT"),new it([this,"materialOverrideMap"],"材质替换",Mi.defaults.materialOverrideMap)],dataSource:[...t.dataSource,new it([this,"url"],"服务地址",Mi.defaults.url,void 0,!0)],coordinate:[...t.coordinate,new X([this,"editing"],"编辑",!1,!0),new cn([this,"offset"],"偏移",[0,0,0],!0),new Gh([this,"rotation"],"旋转",[0,0,0])],more:[...t.more,new it([this,"materialParams"],"materialParams",Mi.defaults.materialParams),new lt(["string","string"],(n,i)=>this.highlightFeature(n,i),["","rgba(255,0,0,1)"],"highlightFeature"),new lt(["string","string"],(n,i)=>this.setFeatureColor(n,i),["",""],"setFeatureColor"),new lt(["string","string"],(n,i)=>this.setFeatureVisable(n,i),["",""],"setFeatureVisable"),new lt([],()=>this.resetFeatureStyle(),[],"resetFeatureStyle"),new ut([],"ue"),new lt([],()=>this.refreshTileset(),[],"refreshTileset"),new pt([this,"actorTag"]),new X([this,"highlight"],"是否高亮"),new Mt([this,"highlightColor"]),new M([this,"highlightID"]),new ut([],"czm"),new ut([],"可视化"),new Ae([this,"czmImageBasedLightingFactor"],"反射强度"),new M([this,"czmAtmosphereScatteringIntensity"],"大气散射强度"),new it([this,"czmEnvironmentMapManager"],"动态环境贴图管理器"),new M([this,"czmMaximumMemoryUsage"],"最大内存"),new ut([],"常用"),new Pt([this,"czmClassificationType"],[["NONE","NONE"],["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]],"czmClassificationType","NONE",!0),new it([this,"czmStyleJson"],"czmStyle"),new X([this,"czmBackFaceCulling"]),new X([this,"czmSkipLevelOfDetail"]),new M([this,"cacheBytes"],"最大缓存",512*1024*1024),new ut([],"调试信息"),new X([this,"czmDebugShowBoundingVolume"]),new X([this,"czmDebugShowContentBoundingVolume"]),new ut([],"clippingPlanes"),new X([this,"clippingPlaneEnabled"]),new X([this,"unionClippingRegions"]),new Mt([this,"clippingPlaneEdgeColor"]),new M([this,"clippingPlaneEdgeWidth"])]}}};d(Mi,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",actorTag:"",materialMode:"normal",highlight:!1,maximumScreenSpaceError:16,highlightID:0,highlightColor:dt([1,0,0,1]),offset:re([0,0,0]),rotation:dt([0,0,0]),czmImageBasedLightingFactor:dt([1,1]),czmEnvironmentMapManager:Qt(void 0),czmLuminanceAtZenith:2,czmAtmosphereScatteringIntensity:2,czmMaximumMemoryUsage:512,czmClassificationType:"NONE",czmStyleJson:wt({}),czmBackFaceCulling:!0,czmDebugShowBoundingVolume:!1,czmDebugShowContentBoundingVolume:!1,czmSkipLevelOfDetail:!1,cacheBytes:512*1024*1024,colorBlendMode:"HIGHLIGHT",clippingPlaneEnabled:!0,unionClippingRegions:!0,clippingPlaneEdgeColor:dt([1,1,1,1]),clippingPlaneEdgeWidth:2,materialParams:{baseColor:[0,.5,1]},allowPicking:!0,materialOverrideMap:Qt({}),featureIdLabel:0,splitDirection:"NONE"})),d(Mi,"type",Mi.register("ES3DTileset",Mi,{chsName:"3DTileset",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"3DTileset"})),d(Mi,"supportEditingModes",[...Ht.supportEditingModes,et.Translation,et.Rotation]);let Tr=Mi;const Xa=class Xa extends st{constructor(t){super(t);d(this,"_isFlyInCreated",this.dv(j(!1)));d(this,"_readyEvent",this.dv(new O));this.collision=!1,this.d(this.createdEvent.don(()=>{setTimeout(()=>{if((this.editing??!1)||!this.position)this.d(Ui([this.positionChanged,this.editingChanged],()=>{this.editing||!this.position||this.isFlyInCreated&&this.flyTo()},{time:"donce"}));else{if(!this.isFlyInCreated)return;this.flyTo()}},1e3)}))}get isFlyInCreated(){return this._isFlyInCreated.value}set isFlyInCreated(t){this._isFlyInCreated.value=t}get isFlyInCreatedChanged(){return this._isFlyInCreated.changed}get readyEvent(){return this._readyEvent}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Pt([this,"mode"],[["柱状警告","cylinder"],["圆形警告","circle"]],"模式","cylinder"),new M([this,"radius"],"半径",10)]}}};d(Xa,"createDefaultProps",()=>({...st.createDefaultProps(),mode:"cylinder",radius:10})),d(Xa,"type",Xa.register("ESAlarm",Xa,{chsName:"报警",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警告类"}));let $d=Xa;const SS=[["扫描","scan"],["扩散","diffuse"]],Gs=class Gs extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new M([this,"radius"],"半径",1),new Pt([this,"mode"],SS,"模式",Gs.defaults.mode),new Mt([this,"color"],"颜色",Gs.defaults.color)]}}};d(Gs,"createDefaultProps",()=>({...st.createDefaultProps(),radius:1,mode:"scan",color:[0,.7,1,1],collision:!1})),d(Gs,"type",Gs.register("ESApertureEffect",Gs,{chsName:"光圈特效",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"光圈特效"}));let Kd=Gs;const Oo=class Oo extends It{constructor(t){super(t);d(this,"editingBindMode","circular")}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new M([this,"area"],"面积",0,!1,!0),new M([this,"perimeter"],"周长",0,!1,!0)]}}};d(Oo,"createDefaultProps",()=>({...It.createDefaultProps(),fillStyle:wt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1}),strokeStyle:wt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!0,stroked:!1,collision:!1})),d(Oo,"type",Oo.register("ESGeoPolygon",Oo,{chsName:"地理多边形",tags:["ESObjects"],description:"地理多边形"})),d(Oo,"supportEditingModes",[...It.supportEditingModes,et.CircularAppend,et.CircularInsert]);let Xt=Oo;const ls=class ls extends Xt{get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialParams(){return this.fillStyle?this.fillStyle.materialParams:ls.defaults.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle??ls.defaults.fillStyle,materialParams:e??ls.defaults.fillStyle.materialParams}}constructor(e){super(e)}};d(ls,"createDefaultProps",()=>({...Xt.createDefaultProps(),stroked:!0,filled:!0,units:dt(["SquareMeter_SquareKilometer","MU_Hectare","PerimeterMeter_PerimeterKilometer"]),fillStyle:wt({color:[1,1,1,1],material:"Material'/EarthSDKForUE/M_ES_Material.M_ES_Material'",materialParams:{Opacity:.4},ground:!0}),strokeStyle:wt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(ls,"type",ls.register("ESAreaMeasurement",ls,{chsName:"面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"面积测量"}));let Zd=ls;const Ya=class Ya extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"general",more:[...e.more,new ut([],"czm"),new Fu([this,"image"],"图片"),new cn([this,"translation"],"偏移")]}}};d(Ya,"createDefaultProps",()=>({...st.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",translation:dt([0,0,0])})),d(Ya,"type",Ya.register("ESBlastParticleSystem",Ya,{chsName:"粒子爆炸",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子爆炸"}));let Qd=Ya;const oi=class oi extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new X([this,"reverse"],"反转",oi.defaults.reverse),new cn([this,"size"],"尺寸",oi.defaults.size),new Mt([this,"edgeColor"],"边框颜色",oi.defaults.edgeColor),new M([this,"edgeWidth"],"边框宽度",oi.defaults.edgeWidth),new pt([this,"targetID"],"瓦片图层",oi.defaults.targetID)]}}};d(oi,"createDefaultProps",()=>({...st.createDefaultProps(),reverse:!1,edgeColor:dt([1,1,1,1]),edgeWidth:2,size:dt([10,10,10]),targetID:""})),d(oi,"type",oi.register("ESBoxClipping",oi,{chsName:"体剖切",tags:["ESObjects","_ES_Impl_Cesium"],description:"体剖切,体裁剪,体裁切,盒裁切"}));let tf=oi;const bl=class bl extends st{constructor(){super(...arguments);d(this,"_thumbnail",this.dv(j("")));d(this,"_duration",this.dv(j(1)));d(this,"_resetWithCurrentCameraEvent",this.dv(new O));d(this,"_captureEvent",this.dv(new O))}get thumbnail(){return this._thumbnail.value}set thumbnail(t){this._thumbnail.value=t}get thumbnailChanged(){return this._thumbnail.changed}get duration(){return this._duration.value}set duration(t){this._duration.value=t}get durationChanged(){return this._duration.changed}flyIn(t=1,n="default"){this.flyInEvent.emit(t,-1,n)}get resetWithCurrentCameraEvent(){return this._resetWithCurrentCameraEvent}resetWithCurrentCamera(){this._resetWithCurrentCameraEvent.emit()}get captureEvent(){return this._captureEvent}capture(t,n){this._captureEvent.emit(t,n)}execOnCreating(){this.resetWithCurrentCamera()}async initByCurrent(){this.resetWithCurrentCamera()}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"ESCameraView"),new lt([],()=>this.resetWithCurrentCamera(),[],"设置为当前视角"),new lt(["number","number"],(n,i)=>this.capture(n,i),[64,64],"获取缩略图"),new pt([this,"thumbnail"],"缩略图","",!0),new M([this,"duration"],"飞行时间",1,!0)]}}};d(bl,"type",bl.register("ESCameraView",bl,{chsName:"视角",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角"}));let Fc=bl;class Ac extends V{constructor(t,n,i){super();d(this,"_view",this.dv(new Fc));if(this.d(t.components.disposableAdd(this._view)),this._view.name=(i==null?void 0:i.name)??`视角${t.views.length+1}`,n){const a=this._view,u=n;a.duration=u.duration??1,a.position=u.position,a.rotation=u.rotation??[0,0,0],a.thumbnail=u.thumbnail??"",a.name=u.name}else{const a=(i==null?void 0:i.size)??[64,64];this.d($o(()=>{this._view.resetWithCurrentCamera(),this._view.capture(a[0],a[1])}))}const s=this._view,o=this.dv(Ie(s.durationChanged,s.positionChanged,s.rotationChanged,s.thumbnailChanged,s.nameChanged));this.d(o.don(()=>t.emitViewsWarpper()))}get view(){return this._view}get viewInfo(){const t=this._view;return{duration:t.duration,position:t.position,rotation:t.rotation,thumbnail:t.thumbnail,name:t.name}}}const Or=class Or extends rt{constructor(t){super(t);d(this,"_currentViewIndex",this.dv(j(-1)));d(this,"_viewWrappers",this.dv(new xu));d(this,"_currentViewWrapper",this.dv(j(void 0)));d(this,"_container",this.dv(j(void 0)));this.initProcessing();{const n=()=>{if(!this._currentViewWrapper.value)return;this._viewWrappers.indexOf(this._currentViewWrapper.value)===-1&&(this._currentViewWrapper.value=void 0)};n(),this.d(this._viewWrappers.changedEvent.don(n))}{const n=()=>{const i=this._currentViewWrapper.value;this._currentViewIndex.value=i?this._getIndex(i):-1};n(),this.d(this._viewWrappers.changedEvent.don(n)),this.d(this._currentViewWrapper.changed.don(n))}this.d(()=>{this.clearAllViews()})}get json(){return{...this._innerGetJson(),views:this.views}}set json(t){this._innerSetJson(t),this.views=t.views}get currentViewIndex(){return this._currentViewIndex.value}get currentViewIndexChanged(){return this._currentViewIndex.changed}emitViewsWarpper(){this._viewWrappers.changedEvent.emit(this._viewWrappers)}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(t){this._container.value=t}get views(){return ry(this._viewWrappers,t=>t.viewInfo)}get viewsChanged(){return this._viewWrappers.changedEvent}set views(t){if(t.length===this._viewWrappers.length){const n=this._viewWrappers;if(t.every((i,s)=>{const o=n.get(s).view;return i.duration===o.duration&&qd(i.position,o.position)&&qd(i.rotation,o.rotation)&&i.thumbnail===o.thumbnail&&i.name===o.name}))return}this.clearAllViews();for(let n of t)this._viewWrappers.push(new Ac(this,n))}_getIndex(t){return this._viewWrappers.indexOf(t)}clearAllViews(){for(let t of this._viewWrappers)t.destroy();this._viewWrappers.length=0}add(t=`视角${this.views.length+1}`,n=[64,64]){this._viewWrappers.push(new Ac(this,void 0,{name:t,size:n}))}update(t,n,i=[64,64]){if(t>=this._viewWrappers.length||t<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const s=this._viewWrappers.get(t);return n&&(s.view.name=n),s.view.resetWithCurrentCamera(),s.view.capture(i[0],i[1]),!0}addView(){this._viewWrappers.push(new Ac(this))}insertView(t){if(this._viewWrappers.length+1<=t||t<0){console.error("this._views.length <= index || index < 0");return}this._viewWrappers.splice(t,0,new Ac(this))}setCurrentView(t){if(t>=this._viewWrappers.length||t<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const n=this._viewWrappers.get(t);return this._currentViewWrapper.value=n,!0}resetView(t){if(t>=this._viewWrappers.length||t<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const n=this._viewWrappers.get(t);n.view.resetWithCurrentCamera(),n.view.capture()}resetViewName(t,n){if(t>=this._viewWrappers.length||t<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const i=this._viewWrappers.get(t);i.view.name=n}updateView(t,n){if(t>=this._viewWrappers.length||t<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const i=this._viewWrappers.get(t);return i.view.position=n.position,i.view.rotation=n.rotation??[0,0,0],i.view.duration=n.duration??1,i.view.thumbnail=n.thumbnail??"",i.view.name=n.name??"",!0}flyToView(t){if(this.setCurrentView(t)){if(!this._currentViewWrapper.value)throw new Error("this._currentViewWrapper.value");const n=this._currentViewWrapper.value.view.duration;this._currentViewWrapper.value.view.flyIn(n,this.flyMode??Or.defaults.flyMode)}}flyToPrevView(){const t=this._currentViewWrapper.value;if(!t)return this.flyToView(0),!0;const n=this._getIndex(t);return this.loop??Or.defaults.loop?(this.flyToView((this._viewWrappers.length+n-1)%this._viewWrappers.length),!0):n-1<0?!1:(this.flyToView(n-1),!0)}moveToPreView(){const t=this._currentViewWrapper.value;if(!t)return;const n=this._getIndex(t);if(n===0)return;const i=this._viewWrappers.splice(n-1,1,t)[0];this._viewWrappers.set(n,i)}moveToNextView(){const t=this._currentViewWrapper.value;if(!t)return;const n=this._getIndex(t);if(n===this._viewWrappers.length-1)return;const i=this._viewWrappers.splice(n+1,1,t)[0];this._viewWrappers.set(n,i)}flyToNextView(){const t=this._currentViewWrapper.value;if(!t)return this.flyToView(0),!0;const n=this._getIndex(t);return this.loop??Or.defaults.loop?(this.flyToView((n+1)%this._viewWrappers.length),!0):n+1>this._viewWrappers.length-1?!1:(this.flyToView(n+1),!0)}stop(){this._currentViewWrapper.value=void 0,this.playing=!1}deleteView(t){if(t<0||t>=this._viewWrappers.length){console.warn("index < 0 || index >= this._viewWrappers.length");return}this._viewWrappers.get(t).destroy(),this._viewWrappers.splice(t,1)}deleteCurrentView(){const t=this._currentViewWrapper.value;if(!t){console.warn("!this._currentViewWrapper.value");return}const n=this._getIndex(t);if(n===-1){console.warn("index === -1");return}this.deleteView(n)}transitionImageUrl(t){return rt.context.getStrFromEnv(t)}_flyStep(t){var o;if(!this.flyToNextView())return this.playing=!1,Promise.resolve();const n=this.intervalTime??Or.defaults.intervalTime,s=((((o=this._currentViewWrapper.value)==null?void 0:o.viewInfo.duration)??0)+n)*1e3;return t.promise(Nu(s)).then(()=>this._flyStep(t))}initProcessing(){const t=this.dv(Yn(async i=>this._flyStep(i))),n=()=>{this.playing?t.restart():t.cancel()};n(),this.d(this.playingChanged.don(n))}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Pt([this,"flyMode"],[["默认","default"],["直线飞行","uniform"]],"飞行模式",Or.defaults.flyMode),new lt([],()=>this.addView(),[],"添加视角"),new lt(["number"],n=>this.insertView(n),[0],"插入视角"),new lt([],()=>this.clearAllViews(),[],"清空所有视角"),new lt([],()=>this.insertView(this.currentViewIndex+1),[],"当前位置插入视角"),new lt([],()=>this.flyToPrevView(),[],"上一个视角"),new lt([],()=>this.flyToNextView(),[],"下一个视角"),new lt([],()=>this.moveToPreView(),[],"当前视角移动到上一个视角"),new lt([],()=>this.moveToNextView(),[],"当前视角移动到下一个视角"),new lt(["number"],n=>this.flyToView(n),[0],"飞入指定视角"),new lt(["number"],n=>this.setCurrentView(n),[0],"设置当前视角"),new lt([],()=>this.deleteCurrentView(),[],"删除当前视角"),new lt(["number"],n=>this.deleteView(n),[0],"删除指定视角"),new lt(["number"],n=>this.resetView(n),[0],"重置视角"),new M([this,"currentViewIndex"],"当前序号",-1,!1,!0),new Rg([this,"playing"],()=>this.stop(),[this,"loop"],"播放",Or.defaults),new X([this,"playing"],"是否播放"),new lt([],()=>this.stop(),[],"停止"),new X([this,"loop"],"是否循环"),new M([this,"intervalTime"],"间隔时间"),new it([this,"views"],"视角集合",[],void 0,!0)]}}};d(Or,"createDefaultProps",()=>({...rt.createDefaultProps(),playing:!1,loop:!0,intervalTime:5,flyMode:"default"})),d(Or,"type",Or.register("ESCameraViewCollection",Or,{chsName:"视角集合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角集合"}));let kc=Or;const Ja=class Ja extends st{constructor(t){super(t);d(this,"editingBindMode","doublePoints")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new M([this,"aspectRatio"],"宽高比",1.77778),new M([this,"fov"],"横向夹角",90),new M([this,"far"],"视野长度",100),new M([this,"near"],"近面距离",5)]}}};d(Ja,"createDefaultProps",()=>({...st.createDefaultProps(),fov:90,aspectRatio:1.77778,far:100,near:5,collision:!1})),d(Ja,"type",Ja.register("ESCameraVisibleRange",Ja,{chsName:"摄像头可视域",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"摄像头可视域"}));let ef=Ja;const $a=class $a extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Pt([this,"mode"],[["警车","policeCar"]],"模式","policeCar")]}}};d($a,"createDefaultProps",()=>({...st.createDefaultProps(),mode:"policeCar",allowPicking:!0})),d($a,"type",$a.register("ESCar",$a,{chsName:"车辆",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警车等基础车辆模型"}));let Vc=$a;const No=class No extends It{constructor(t){super(t);d(this,"editingBindMode","circular")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new M([this,"height"],"高度",10)],coordinate:[...t.coordinate,new M([this,"area"],"面积",0,!1,!0),new M([this,"perimeter"],"周长",0,!1,!0)]}}};d(No,"createDefaultProps",()=>({...It.createDefaultProps(),height:10,filled:!0,fillStyle:wt({material:"",materialParams:{},ground:!0,color:[1,1,1,1]})})),d(No,"type",No.register("ESClassification",No,{chsName:"倾斜单体化",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平尾箭头"})),d(No,"supportEditingModes",[...It.supportEditingModes,et.CircularAppend,et.CircularInsert,et.HeightModify]);let jc=No;const Ka=class Ka extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new X([this,"showArrow"],"显示箭头",!0),new Mt([this,"edgeColor"],"线框颜色",[1,1,1,1]),new M([this,"edgetWidth"],"线框宽度",2),new M([this,"width"],"裁剪宽度",200),new M([this,"height"],"裁剪高度",200),new pt([this,"targetID"],"瓦片图层","")]}}};d(Ka,"createDefaultProps",()=>({...st.createDefaultProps(),showArrow:!0,edgeColor:dt([1,1,1,1]),edgetWidth:2,width:200,height:200,targetID:""})),d(Ka,"type",Ka.register("ESClippingPlane",Ka,{chsName:"裁切",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESClippingPlane"}));let nf=Ka;class bS extends V{constructor(e,t,n){super();const i=document.createElement("div");i.setAttribute("xe2-div",`ESCustomDiv(${t.id})(viewer: ${n.id}) container`);{const u=()=>{const c=` ${t.cssText}
66
66
  ${t.cssAllInitial?"all: initial;":""}
67
67
  ${t.show?"":"display: none"}
68
- `;i.style.cssText=c};u();const l=this.dv(Ie(t.cssAllInitialChanged,t.cssTextChanged,t.showChanged));this.d(l.don(u))}e.appendChild(i),this.d(()=>e.removeChild(i));const s=this.dv(Ie(t.instanceClassChanged,t.containerChanged,t.shadowDomChanged)),o=this.dv(new Ee(s,()=>{const{instanceClass:u,container:l}=t;if(!u||l)return;let c=i;if(i.firstElementChild&&i.removeChild(i.firstElementChild),t.shadowDom){const h=i.appendChild(document.createElement("div"));h.setAttribute("xe2-div",`ESCustomDiv(${t.id})(viewer: ${n.id}) container shadowDiv`),c=h.attachShadow({mode:"open"}).appendChild(document.createElement("div")),c.setAttribute("xe2-div",`ESCustomDiv(${t.id})(viewer: ${n.id}) container shadowDiv div`)}return new u(c,t,n)})),{_updateEvent:a}=t;this.d(a.don(u=>{if(o.obj)try{u(o.obj,t,n)}catch(l){console.error(`ESCustomDiv update error! ${l}`)}}))}}const ly=`class MyDiv {
68
+ `;i.style.cssText=c};u();const l=this.dv(Ie(t.cssAllInitialChanged,t.cssTextChanged,t.showChanged));this.d(l.don(u))}e.appendChild(i),this.d(()=>e.removeChild(i));const s=this.dv(Ie(t.instanceClassChanged,t.containerChanged,t.shadowDomChanged)),o=this.dv(new Ee(s,()=>{const{instanceClass:u,container:l}=t;if(!u||l)return;let c=i;if(i.firstElementChild&&i.removeChild(i.firstElementChild),t.shadowDom){const h=i.appendChild(document.createElement("div"));h.setAttribute("xe2-div",`ESCustomDiv(${t.id})(viewer: ${n.id}) container shadowDiv`),c=h.attachShadow({mode:"open"}).appendChild(document.createElement("div")),c.setAttribute("xe2-div",`ESCustomDiv(${t.id})(viewer: ${n.id}) container shadowDiv div`)}return new u(c,t,n)})),{_updateEvent:a}=t;this.d(a.don(u=>{if(o.obj)try{u(o.obj,t,n)}catch(l){console.error(`ESCustomDiv update error! ${l}`)}}))}}const cy=`class MyDiv {
69
69
  // subContainer是外部视口的div容器,可以在这里创建自己需要的DOM元素
70
70
  // customDiv指向当前的CustomDiv场景对象
71
71
  // viewer指定当前的视口
@@ -105,7 +105,7 @@ ${u.map(c=>`${c.id} ${c.typeName}
105
105
  }
106
106
  }`,PS=`示例代码:
107
107
  \`\`\`
108
- ${ly}
108
+ ${cy}
109
109
  \`\`\`
110
110
  `,Nr=class Nr extends rt{constructor(t){super(t);d(this,"_updateEvent",this.dv(new O));d(this,"_instanceClassReact",this.dv(j(void 0)));d(this,"_innerHtmlMounted",this.dv(new O));d(this,"_container",this.dv(j(void 0)));this.registerAttachedObjectForContainer((i,s)=>new bS(s,this,i));{const i=()=>{try{this.instanceClass=this.instanceClassStr&&Function(`"use strict";return (${this.instanceClassStr})`)()}catch{this.instanceClass=void 0}};i(),this.d(this.instanceClassStrChanged.don(i))}{const i=()=>{if(this.innerHTML===void 0){this.instanceClassStr=void 0;return}const s=`class MyDiv {
111
111
  // subContainer是外部视口的div容器,可以在这里创建自己需要的DOM元素
@@ -128,7 +128,7 @@ ${ly}
128
128
  }`;this.instanceClassStr=s};i(),this.d(this.innerHTMLChanged.don(i))}const n=document.createElement("div");n.setAttribute("xe2-div",`ESCustomDiv(${this.id}) container`);{const i=()=>{const o=` ${this.cssText};
129
129
  ${this.cssAllInitial?"all: initial;":""}
130
130
  ${this.show?"":"display: none;"}
131
- `;n.style.cssText=o};i();const s=this.dv(Ie(this.cssAllInitialChanged,this.cssTextChanged,this.showChanged));this.d(s.don(i))}{const i=()=>{if(this.containerId===void 0||this.containerId==="")this.container=void 0;else{const s=document.getElementById(this.containerId);s instanceof HTMLElement?this.container=s:(this.container=void 0,console.warn(`Div from containerId(${this.containerId}) is not HTMLDivElement!`))}};i(),this.d(this.containerIdChanged.don(i))}{class i extends V{constructor(o){super(),o.appendChild(n),this.d(()=>o.removeChild(n))}}this.dv(new Ee(this.containerChanged,()=>{if(this.container)return new i(this.container)}))}{const i=this.dv(Ie(this.containerChanged,this.instanceClassChanged,this.shadowDomChanged));this.dv(new Ee(i,()=>{if(!this.container||!this.instanceClass)return;let s=n;if(n.firstElementChild&&n.removeChild(n.firstElementChild),this.shadowDom){const o=n.appendChild(document.createElement("div"));o.setAttribute("xe2-div","ESCustomDiv container shadowDiv"),s=o.attachShadow({mode:"open"}).appendChild(document.createElement("div")),s.setAttribute("xe2-div","ESCustomDiv container shadowDiv div")}return new this.instanceClass(s,this,void 0)}))}}update(t){this._updateEvent.emit(t)}get instanceClass(){return this._instanceClassReact.value}set instanceClass(t){this._instanceClassReact.value=t}get instanceClassChanged(){return this._instanceClassReact.changed}get innerHtmlMounted(){return this._innerHtmlMounted}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(t){this._container.value=t}getESProperties(){const t={...super.getESProperties()},n=i=>{i||alert("evalFuncStr为空,无法执行!");try{const s=i&&Function(`"use strict";return (${i})`)();this.update(s)}catch(s){alert(`updateDivFunc error: ${s}`)}};return{...t,more:[...t.more,new ut([new X([this,"show"],"显示"),new Es([this,"instanceClassStr"],"实例类",ly,PS,!0),new Es([this,"innerHTML"],"innerHTML",Nr.defaultInnerHTML,Nr.innerHTMLReadMe,!0),new lt(["string"],n,["(divClass, dom, viewer) => divClass.update && divClass.update()"],"强制更新"),new X([this,"allowPicking"],"允许拾取",!0),new pt([this,"containerId"],"容器ID",Nr.defaults.containerId,!0),new X([this,"shadowDom"],"shadowDom"),new X([this,"cssAllInitial"],"cssAllInitial"),new pt([this,"cssText"],"cssText")],"ESCustomDiv")]}}};d(Nr,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,instanceClassStr:void 0,innerHTML:void 0,allowPicking:void 0,containerId:"",shadowDom:!1,cssAllInitial:!1,cssText:""})),d(Nr,"type",Nr.register("ESCustomDiv",Nr,{chsName:"ESCustomDiv",tags:["ESObjects"],description:"自定义div"})),d(Nr,"defaultInnerHTML",` <!-- z-index样式需要设置,否则可能导致看不到!-->
131
+ `;n.style.cssText=o};i();const s=this.dv(Ie(this.cssAllInitialChanged,this.cssTextChanged,this.showChanged));this.d(s.don(i))}{const i=()=>{if(this.containerId===void 0||this.containerId==="")this.container=void 0;else{const s=document.getElementById(this.containerId);s instanceof HTMLElement?this.container=s:(this.container=void 0,console.warn(`Div from containerId(${this.containerId}) is not HTMLDivElement!`))}};i(),this.d(this.containerIdChanged.don(i))}{class i extends V{constructor(o){super(),o.appendChild(n),this.d(()=>o.removeChild(n))}}this.dv(new Ee(this.containerChanged,()=>{if(this.container)return new i(this.container)}))}{const i=this.dv(Ie(this.containerChanged,this.instanceClassChanged,this.shadowDomChanged));this.dv(new Ee(i,()=>{if(!this.container||!this.instanceClass)return;let s=n;if(n.firstElementChild&&n.removeChild(n.firstElementChild),this.shadowDom){const o=n.appendChild(document.createElement("div"));o.setAttribute("xe2-div","ESCustomDiv container shadowDiv"),s=o.attachShadow({mode:"open"}).appendChild(document.createElement("div")),s.setAttribute("xe2-div","ESCustomDiv container shadowDiv div")}return new this.instanceClass(s,this,void 0)}))}}update(t){this._updateEvent.emit(t)}get instanceClass(){return this._instanceClassReact.value}set instanceClass(t){this._instanceClassReact.value=t}get instanceClassChanged(){return this._instanceClassReact.changed}get innerHtmlMounted(){return this._innerHtmlMounted}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(t){this._container.value=t}getESProperties(){const t={...super.getESProperties()},n=i=>{i||alert("evalFuncStr为空,无法执行!");try{const s=i&&Function(`"use strict";return (${i})`)();this.update(s)}catch(s){alert(`updateDivFunc error: ${s}`)}};return{...t,more:[...t.more,new ut([new X([this,"show"],"显示"),new Es([this,"instanceClassStr"],"实例类",cy,PS,!0),new Es([this,"innerHTML"],"innerHTML",Nr.defaultInnerHTML,Nr.innerHTMLReadMe,!0),new lt(["string"],n,["(divClass, dom, viewer) => divClass.update && divClass.update()"],"强制更新"),new X([this,"allowPicking"],"允许拾取",!0),new pt([this,"containerId"],"容器ID",Nr.defaults.containerId,!0),new X([this,"shadowDom"],"shadowDom"),new X([this,"cssAllInitial"],"cssAllInitial"),new pt([this,"cssText"],"cssText")],"ESCustomDiv")]}}};d(Nr,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,instanceClassStr:void 0,innerHTML:void 0,allowPicking:void 0,containerId:"",shadowDom:!1,cssAllInitial:!1,cssText:""})),d(Nr,"type",Nr.register("ESCustomDiv",Nr,{chsName:"ESCustomDiv",tags:["ESObjects"],description:"自定义div"})),d(Nr,"defaultInnerHTML",` <!-- z-index样式需要设置,否则可能导致看不到!-->
132
132
  <div style="width: 300px; height: 50px; z-index: 100; position: absolute; left: 10px; top: 10px; background: rgba(120, 120, 0, 0.7); color: white; font-size: 30px; line-height: 50px; border: 1px solid white;">Hello world!</div>
133
133
  `),d(Nr,"innerHTMLReadMe",` 示例代码:
134
134
  \`\`\`
@@ -144,7 +144,7 @@ ${ly}
144
144
  space: number
145
145
  }
146
146
  \`\`\`
147
- `,Ro=class Ro extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new it([this,"url"],"路径",!0),new it([this,"treeTypes"],"treeTypes",[],void 0,!0),new it([this,"xiaoBanWidget"],"xiaoBanWidget",Ro.defaults.xiaoBanWidget,IS,!0),new pt([this,"youShiSZ"]),new pt([this,"diLei"]),new pt([this,"senLinLB"]),new pt([this,"labelMaterial"]),new M([this,"heightOffset"])]}}};d(Ro,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",treeTypes:Qt([]),xiaoBanWidget:Qt({class:"WidgetBlueprint'/ESFoliage/ESDefaultXiaoBan.ESDefaultXiaoBan",pivot:[.5,1],space:1}),youShiSZ:"StringTable'/ESFoliage/You_Shi_SZ.You_Shi_SZ'",diLei:"StringTable'/ESFoliage/Di_Lei.Di_Lei'",senLinLB:"StringTable'/ESFoliage/Sen_Lin_LB.Sen_Lin_LB'",labelMaterial:"Material'/ESFoliage/ES3DWidgetMaterial.ES3DWidgetMaterial'",heightOffset:40})),d(Ro,"type",Ro.register("ESForestTileset",Ro,{chsName:"森林切片图层",tags:["ESObjects","_ES_Impl_UE"],description:"ESForestTileset"}));let af=Ro;const cy=`class MyDiv {
147
+ `,Ro=class Ro extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new it([this,"url"],"路径",!0),new it([this,"treeTypes"],"treeTypes",[],void 0,!0),new it([this,"xiaoBanWidget"],"xiaoBanWidget",Ro.defaults.xiaoBanWidget,IS,!0),new pt([this,"youShiSZ"]),new pt([this,"diLei"]),new pt([this,"senLinLB"]),new pt([this,"labelMaterial"]),new M([this,"heightOffset"])]}}};d(Ro,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",treeTypes:Qt([]),xiaoBanWidget:Qt({class:"WidgetBlueprint'/ESFoliage/ESDefaultXiaoBan.ESDefaultXiaoBan",pivot:[.5,1],space:1}),youShiSZ:"StringTable'/ESFoliage/You_Shi_SZ.You_Shi_SZ'",diLei:"StringTable'/ESFoliage/Di_Lei.Di_Lei'",senLinLB:"StringTable'/ESFoliage/Sen_Lin_LB.Sen_Lin_LB'",labelMaterial:"Material'/ESFoliage/ES3DWidgetMaterial.ES3DWidgetMaterial'",heightOffset:40})),d(Ro,"type",Ro.register("ESForestTileset",Ro,{chsName:"森林切片图层",tags:["ESObjects","_ES_Impl_UE"],description:"ESForestTileset"}));let af=Ro;const hy=`class MyDiv {
148
148
  // container是Poi的div
149
149
  // geoCustomDivPoi指向当前的GeoCustomDivPoi场景对象
150
150
  // viewer指定当前的视口
@@ -177,12 +177,12 @@ ${ly}
177
177
  }
178
178
  }`,xS=`示例代码:
179
179
  \`\`\`
180
- ${cy}
180
+ ${hy}
181
181
  \`\`\`
182
- `,hy=`<div style="width: 300px; height: 50px; background: rgba(120, 120, 0, 0.7); color: white; font-size: 30px; line-height: 50px; border: 1px solid white;">Hello world!</div>
182
+ `,dy=`<div style="width: 300px; height: 50px; background: rgba(120, 120, 0, 0.7); color: white; font-size: 30px; line-height: 50px; border: 1px solid white;">Hello world!</div>
183
183
  `,TS=`示例代码:
184
184
  \`\`\`
185
- ${hy}
185
+ ${dy}
186
186
  \`\`\`
187
187
  `,ai=class ai extends st{constructor(t){super(t);d(this,"_widgetEvent",this.dv(new O));d(this,"_echartsFunReact",this.dv(j(void 0)));d(this,"_instanceClassReact",this.dv(j(void 0)));const n=()=>{try{this.instanceClass=this.instanceClassStr&&Function(`"use strict";return (${this.instanceClassStr})`)()}catch{this.instanceClass=void 0}};n(),this.d(this.instanceClassStrChanged.don(n));{const i=()=>{if(this.innerHTML===void 0){this.instanceClassStr=void 0;return}const s=`class MyDiv {
188
188
  // container是Poi的div
@@ -200,7 +200,7 @@ ${hy}
200
200
  destroy() {
201
201
  this._container.removeChild(this._div);
202
202
  }
203
- }`;this.instanceClassStr=s};i(),this.d(this.innerHTMLChanged.don(i))}}get widgetEvent(){return this._widgetEvent}get echartsFun(){return this._echartsFunReact.value}set echartsFun(t){this._echartsFunReact.value=t}get echartsFunChanged(){return this._echartsFunReact.changed}get instanceClass(){return this._instanceClassReact.value}set instanceClass(t){this._instanceClassReact.value=t}get instanceClassChanged(){return this._instanceClassReact.changed}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new M([this,"opacity"],"透明度",ai.defaults.opacity,!0),new M([this,"zOrder"],"zOrder",ai.defaults.zOrder,!0),new Ae([this,"anchor"],"偏移比例",ai.defaults.anchor,!0),new Es([this,"innerHTML"],"innerHTML",ai.defaults.innerHTML,TS,!0),new Es([this,"instanceClassStr"],"实例类",ai.defaults.instanceClassStr,xS,!0),new X([this,"renderInUE"],"是否在UE中渲染",!0,!1)]}}};d(ai,"createDefaultProps",()=>({...st.createDefaultProps(),opacity:1,anchor:dt([.5,1]),instanceClassStr:cy,innerHTML:hy,zOrder:0,renderInUE:!1})),d(ai,"type",ai.register("ESGeoDiv",ai,{chsName:"ESGeoDiv",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESGeoDiv"}));let uf=ai;const Lo=class Lo extends It{constructor(t){super(t);d(this,"editingBindMode","doublePoints")}toPolygon(){if(this.points&&this.points.length>=2){const t=[...this.points][0],n=[...this.points][1];return[t,[t[0],n[1],t[2]],n,[n[0],t[1],n[2]]]}else return}_updateArea(){if(this.points&&this.points.length>=2){const t=[...this.points],n=t[0],i=t[1],s=[n,[n[0],i[1],n[2]],i,[i[0],n[1],i[2]]];this._area.value=td(s)}else this._area.value=0}_updatePerimeter(){if(this.points&&this.points.length>=2){const t=[...this.points],n=t[0],i=t[1],s=[n,[n[0],i[1],n[2]],i,[i[0],n[1],i[2]]],o=[...s,s[0]],a=fl(o,"GEODESIC"),u=a[a.length-1];this._perimeter.value=u}else this._perimeter.value=0}getESProperties(){const t=super.getESProperties();return{...t,coordinate:[...t.coordinate,new M([this,"area"],"面积",0,!1,!0),new M([this,"perimeter"],"周长",0,!1,!0)]}}};d(Lo,"createDefaultProps",()=>({...It.createDefaultProps(),collision:!1,stroked:!0,filled:!0,fillStyle:wt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),d(Lo,"type",Lo.register("ESGeoRectangle",Lo,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),d(Lo,"supportEditingModes",[...It.supportEditingModes,et.DoublePointsAppend,et.DoublePointsModify]);let lf=Lo;const cf={translationX:0,translationY:0,translationZ:0,rotationHeading:0,rotationPitch:0,rotationRoll:0,scaleX:1,scaleY:1,scaleZ:1},Hs=class Hs extends st{constructor(t){super(t);d(this,"_nodeTransformations",this.dv(j(void 0)));d(this,"_czmModelReadyEvent",this.dv(new O));d(this,"_setNodePositionEvent",this.dv(new O));d(this,"_setNodeRotationEvent",this.dv(new O));d(this,"_setNodeScaleEvent",this.dv(new O));d(this,"_printDebugInfoEvent",this.dv(new O));d(this,"setMaterialInfoEvent",this.ad(new O));d(this,"_setMaterialEvent",this.disposeVar(new O))}get nodeTransformations(){return this._nodeTransformations.value}set nodeTransformations(t){this._nodeTransformations.value=t}get nodeTransformationsChanged(){return this._nodeTransformations.changed}get czmModelReadyEvent(){return this._czmModelReadyEvent}get readyEvent(){return this._czmModelReadyEvent}deleteNodeTransformation(t){if(!this.nodeTransformations||!this.nodeTransformations[t])return;const n={...this.nodeTransformations};delete n[t],this.nodeTransformations=n}get setNodePositionEvent(){return this._setNodePositionEvent}setNodePosition(t,n){this._setNodePositionEvent.emit(t,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const i=this._nodeTransformations.value[t]??{...cf};if(n.some(s=>!Number.isFinite(s))){console.error(`setNodePosition error: ${t} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[t]:{...i,translationX:n[0],translationY:n[1],translationZ:n[2]}}}get setNodeRotationEvent(){return this._setNodeRotationEvent}setNodeRotation(t,n){this._setNodeRotationEvent.emit(t,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const i=this._nodeTransformations.value[t]??{...cf};if(n.some(s=>!Number.isFinite(s))){console.error(`setNodeRotation error: ${t} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[t]:{...i,rotationHeading:n[0],rotationPitch:n[1],rotationRoll:n[2]}}}get setNodeScaleEvent(){return this._setNodeScaleEvent}setNodeScale(t,n){this._setNodeScaleEvent.emit(t,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const i=this._nodeTransformations.value[t]??{...cf};if(n.some(s=>!Number.isFinite(s)||s<0)){console.error(`setNodeScale error: !Number.isFinite(e) || e < 0 ${t} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[t]:{...i,scaleX:n[0],scaleY:n[1],scaleZ:n[2]}}}getNodePosition(t){if(!this.nodeTransformations)return;const n=this.nodeTransformations[t];if(n)return[n.translationX,n.translationY,n.translationZ]}getNodeRotation(t){if(!this.nodeTransformations)return;const n=this.nodeTransformations[t];if(n)return[n.rotationHeading,n.rotationPitch,n.rotationRoll]}getNodeScale(t){if(!this.nodeTransformations)return;const n=this.nodeTransformations[t];if(n)return[n.scaleX,n.scaleY,n.scaleZ]}get printDebugInfoEvent(){return this._printDebugInfoEvent}printDebugInfo(){this._printDebugInfoEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(t){return new Promise(n=>{const i=new V;i.ad(this.setMaterialInfoEvent.donce(s=>{i.destroy(),n(s)})),this._setMaterialEvent.emit(t)})}setLight122(){this.czmEnvironmentMapManager={...Yd}}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",dataSource:[...t.dataSource,new it([this,"url"],"模型路径",Hs.defaults.url,void 0,!0),new it([this,"instances"],"实例化矩阵",Hs.defaults.instances,void 0,!0)],more:[...t.more,new Ae([this,"czmImageBasedLightingFactor"]),new M([this,"czmAtmosphereScatteringIntensity"]),new it([this,"czmEnvironmentMapManager"]),new lt([],()=>this.printDebugInfo(),[],"控制台输出模型信息"),new M([this,"czmMaximumScale"],"最大缩放比例",void 0,!0),new M([this,"czmNativeScale"],"统一缩放值"),new M([this,"czmMinimumPixelSize"],"最小像素尺寸"),new Mt([this,"czmColor"],"颜色")]}}};d(Hs,"createDefaultProps",()=>({...st.createDefaultProps(),url:"${earthsdk3-assets-script-dir}/assets/glb/building.glb",czmMaximumScale:void 0,czmMinimumPixelSize:0,czmNativeScale:1,czmColor:dt([1,1,1,1]),allowPicking:!0,instances:re([]),czmImageBasedLightingFactor:dt([1,1]),czmAtmosphereScatteringIntensity:2,czmEnvironmentMapManager:Qt(void 0)})),d(Hs,"type",Hs.register("ESGltfModel",Hs,{chsName:"模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"gltf模型"}));let zs=Hs;const Dr=class Dr extends st{constructor(t){super(t);d(this,"_aiMoveToEvent",this.dv(new O));d(this,"_stopAIMoveEvent",this.dv(new O));d(this,"_readyEvent",this.dv(new O))}get aiMoveToEvent(){return this._aiMoveToEvent}aiMoveTo(t,n){this._aiMoveToEvent.emit(t,n)}get stopAIMoveEvent(){return this._stopAIMoveEvent}stopAIMove(){this._stopAIMoveEvent.emit()}get readyEvent(){return this._readyEvent}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Pt([this,"mode"],Dr.modes,"模式",Dr.defaults.mode,!0),new Pt([this,"animation"],Dr.animations,"动画",Dr.defaults.animation,!0)],more:[...t.more,new lt(["numbers","number"],(n,i)=>this.aiMoveTo(n,i),[[0,0,0],0],"自动寻路"),new lt([],()=>this.stopAIMove(),[],"停止自动寻路")]}}};d(Dr,"createDefaultProps",()=>({...st.createDefaultProps(),mode:"worker",animation:"standing",allowPicking:!0})),d(Dr,"type",Dr.register("ESHuman",Dr,{chsName:"人员",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"工人 警察 路人"})),d(Dr,"modes",[["工人","worker"],["警察","police"],["路人","pedestrian"],["陌生人","stranger"],["男士","suitMan"],["女士","suitWoman"]]),d(Dr,"animations",[["站立","standing"],["行走","walking"],["奔跑","running"]]);let Po=Dr;const Fo=class Fo extends ar{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new it([this,"url"],"图片路径",Fo.defaults.url),new X([this,"isHoverZoom"],"悬浮放大"),new X([this,"hoverHighlight"],"悬浮高亮")]}}};d(Fo,"createDefaultProps",()=>({...ar.createDefaultProps(),url:"inner://CameraBlue.png",isHoverZoom:!1,hoverHighlight:!1,renderMode:4})),d(Fo,"type",Fo.register("ESImageLabel",Fo,{chsName:"图片标签",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"基础图片标签。"}));let zc=Fo;const Ri=class Ri extends Ht{constructor(e){super(e),this.ad(nt([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(nt([this,"czmAlpha"],[this,"opacity"]))}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new M([this,"zIndex"],"层级序号",Ri.defaults.zIndex)],dataSource:[...e.dataSource,new it([this,"url"],"影像服务地址"),new Ar([this,"rectangle"],"矩形范围",Ri.defaults.rectangle,!0),new Ue([this,"maximumLevel"],1,[1,24],"最大级别",Ri.defaults.maximumLevel,!0),new it([this,"options"],"options",Ri.defaults.options,void 0,!0),new pt([this,"targetID"],"targetID"),new Ue([this,"opacity"],.01,[0,1],"opacity",1)],more:[...e.more,new ut([],"通用"),new M([this,"height"],"高度"),new pt([this,"actorTag"]),new pt([this,"componentTag"]),new M([this,"minimumLevel"]),new ut([],"图像"),new M([this,"czmAlpha"],"透明度"),new M([this,"czmBrightness"],"亮度"),new M([this,"czmContrast"],"对比度"),new M([this,"czmHue"],"色相"),new M([this,"czmSaturation"],"饱和度"),new M([this,"czmGamma"],"伽马值")]}}};d(Ri,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",rectangle:Qt([-180,-90,180,90]),options:Qt(void 0),zIndex:0,actorTag:"",componentTag:"",maximumLevel:22,minimumLevel:0,targetID:"",czmSplitDirection:"NONE",czmAlpha:1,czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1,opacity:1,splitDirection:"NONE"})),d(Ri,"type",Ri.register("ESImageryLayer",Ri,{chsName:"影像图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"影像图层"}));let hf=Ri;const OS=`
203
+ }`;this.instanceClassStr=s};i(),this.d(this.innerHTMLChanged.don(i))}}get widgetEvent(){return this._widgetEvent}get echartsFun(){return this._echartsFunReact.value}set echartsFun(t){this._echartsFunReact.value=t}get echartsFunChanged(){return this._echartsFunReact.changed}get instanceClass(){return this._instanceClassReact.value}set instanceClass(t){this._instanceClassReact.value=t}get instanceClassChanged(){return this._instanceClassReact.changed}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new M([this,"opacity"],"透明度",ai.defaults.opacity,!0),new M([this,"zOrder"],"zOrder",ai.defaults.zOrder,!0),new Ae([this,"anchor"],"偏移比例",ai.defaults.anchor,!0),new Es([this,"innerHTML"],"innerHTML",ai.defaults.innerHTML,TS,!0),new Es([this,"instanceClassStr"],"实例类",ai.defaults.instanceClassStr,xS,!0),new X([this,"renderInUE"],"是否在UE中渲染",!0,!1)]}}};d(ai,"createDefaultProps",()=>({...st.createDefaultProps(),opacity:1,anchor:dt([.5,1]),instanceClassStr:hy,innerHTML:dy,zOrder:0,renderInUE:!1})),d(ai,"type",ai.register("ESGeoDiv",ai,{chsName:"ESGeoDiv",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESGeoDiv"}));let uf=ai;const Lo=class Lo extends It{constructor(t){super(t);d(this,"editingBindMode","doublePoints")}toPolygon(){if(this.points&&this.points.length>=2){const t=[...this.points][0],n=[...this.points][1];return[t,[t[0],n[1],t[2]],n,[n[0],t[1],n[2]]]}else return}_updateArea(){if(this.points&&this.points.length>=2){const t=[...this.points],n=t[0],i=t[1],s=[n,[n[0],i[1],n[2]],i,[i[0],n[1],i[2]]];this._area.value=td(s)}else this._area.value=0}_updatePerimeter(){if(this.points&&this.points.length>=2){const t=[...this.points],n=t[0],i=t[1],s=[n,[n[0],i[1],n[2]],i,[i[0],n[1],i[2]]],o=[...s,s[0]],a=fl(o,"GEODESIC"),u=a[a.length-1];this._perimeter.value=u}else this._perimeter.value=0}getESProperties(){const t=super.getESProperties();return{...t,coordinate:[...t.coordinate,new M([this,"area"],"面积",0,!1,!0),new M([this,"perimeter"],"周长",0,!1,!0)]}}};d(Lo,"createDefaultProps",()=>({...It.createDefaultProps(),collision:!1,stroked:!0,filled:!0,fillStyle:wt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),d(Lo,"type",Lo.register("ESGeoRectangle",Lo,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),d(Lo,"supportEditingModes",[...It.supportEditingModes,et.DoublePointsAppend,et.DoublePointsModify]);let lf=Lo;const cf={translationX:0,translationY:0,translationZ:0,rotationHeading:0,rotationPitch:0,rotationRoll:0,scaleX:1,scaleY:1,scaleZ:1},Hs=class Hs extends st{constructor(t){super(t);d(this,"_nodeTransformations",this.dv(j(void 0)));d(this,"_czmModelReadyEvent",this.dv(new O));d(this,"_setNodePositionEvent",this.dv(new O));d(this,"_setNodeRotationEvent",this.dv(new O));d(this,"_setNodeScaleEvent",this.dv(new O));d(this,"_printDebugInfoEvent",this.dv(new O));d(this,"setMaterialInfoEvent",this.ad(new O));d(this,"_setMaterialEvent",this.disposeVar(new O))}get nodeTransformations(){return this._nodeTransformations.value}set nodeTransformations(t){this._nodeTransformations.value=t}get nodeTransformationsChanged(){return this._nodeTransformations.changed}get czmModelReadyEvent(){return this._czmModelReadyEvent}get readyEvent(){return this._czmModelReadyEvent}deleteNodeTransformation(t){if(!this.nodeTransformations||!this.nodeTransformations[t])return;const n={...this.nodeTransformations};delete n[t],this.nodeTransformations=n}get setNodePositionEvent(){return this._setNodePositionEvent}setNodePosition(t,n){this._setNodePositionEvent.emit(t,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const i=this._nodeTransformations.value[t]??{...cf};if(n.some(s=>!Number.isFinite(s))){console.error(`setNodePosition error: ${t} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[t]:{...i,translationX:n[0],translationY:n[1],translationZ:n[2]}}}get setNodeRotationEvent(){return this._setNodeRotationEvent}setNodeRotation(t,n){this._setNodeRotationEvent.emit(t,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const i=this._nodeTransformations.value[t]??{...cf};if(n.some(s=>!Number.isFinite(s))){console.error(`setNodeRotation error: ${t} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[t]:{...i,rotationHeading:n[0],rotationPitch:n[1],rotationRoll:n[2]}}}get setNodeScaleEvent(){return this._setNodeScaleEvent}setNodeScale(t,n){this._setNodeScaleEvent.emit(t,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const i=this._nodeTransformations.value[t]??{...cf};if(n.some(s=>!Number.isFinite(s)||s<0)){console.error(`setNodeScale error: !Number.isFinite(e) || e < 0 ${t} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[t]:{...i,scaleX:n[0],scaleY:n[1],scaleZ:n[2]}}}getNodePosition(t){if(!this.nodeTransformations)return;const n=this.nodeTransformations[t];if(n)return[n.translationX,n.translationY,n.translationZ]}getNodeRotation(t){if(!this.nodeTransformations)return;const n=this.nodeTransformations[t];if(n)return[n.rotationHeading,n.rotationPitch,n.rotationRoll]}getNodeScale(t){if(!this.nodeTransformations)return;const n=this.nodeTransformations[t];if(n)return[n.scaleX,n.scaleY,n.scaleZ]}get printDebugInfoEvent(){return this._printDebugInfoEvent}printDebugInfo(){this._printDebugInfoEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(t){return new Promise(n=>{const i=new V;i.ad(this.setMaterialInfoEvent.donce(s=>{i.destroy(),n(s)})),this._setMaterialEvent.emit(t)})}setLight122(){this.czmEnvironmentMapManager={...Yd}}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",dataSource:[...t.dataSource,new it([this,"url"],"模型路径",Hs.defaults.url,void 0,!0),new it([this,"instances"],"实例化矩阵",Hs.defaults.instances,void 0,!0)],more:[...t.more,new Ae([this,"czmImageBasedLightingFactor"]),new M([this,"czmAtmosphereScatteringIntensity"]),new it([this,"czmEnvironmentMapManager"]),new lt([],()=>this.printDebugInfo(),[],"控制台输出模型信息"),new M([this,"czmMaximumScale"],"最大缩放比例",void 0,!0),new M([this,"czmNativeScale"],"统一缩放值"),new M([this,"czmMinimumPixelSize"],"最小像素尺寸"),new Mt([this,"czmColor"],"颜色")]}}};d(Hs,"createDefaultProps",()=>({...st.createDefaultProps(),url:"${earthsdk3-assets-script-dir}/assets/glb/building.glb",czmMaximumScale:void 0,czmMinimumPixelSize:0,czmNativeScale:1,czmColor:dt([1,1,1,1]),allowPicking:!0,instances:re([]),czmImageBasedLightingFactor:dt([1,1]),czmAtmosphereScatteringIntensity:2,czmEnvironmentMapManager:Qt(void 0)})),d(Hs,"type",Hs.register("ESGltfModel",Hs,{chsName:"模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"gltf模型"}));let zs=Hs;const Dr=class Dr extends st{constructor(t){super(t);d(this,"_aiMoveToEvent",this.dv(new O));d(this,"_stopAIMoveEvent",this.dv(new O));d(this,"_readyEvent",this.dv(new O))}get aiMoveToEvent(){return this._aiMoveToEvent}aiMoveTo(t,n){this._aiMoveToEvent.emit(t,n)}get stopAIMoveEvent(){return this._stopAIMoveEvent}stopAIMove(){this._stopAIMoveEvent.emit()}get readyEvent(){return this._readyEvent}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Pt([this,"mode"],Dr.modes,"模式",Dr.defaults.mode,!0),new Pt([this,"animation"],Dr.animations,"动画",Dr.defaults.animation,!0)],more:[...t.more,new lt(["numbers","number"],(n,i)=>this.aiMoveTo(n,i),[[0,0,0],0],"自动寻路"),new lt([],()=>this.stopAIMove(),[],"停止自动寻路")]}}};d(Dr,"createDefaultProps",()=>({...st.createDefaultProps(),mode:"worker",animation:"standing",allowPicking:!0})),d(Dr,"type",Dr.register("ESHuman",Dr,{chsName:"人员",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"工人 警察 路人"})),d(Dr,"modes",[["工人","worker"],["警察","police"],["路人","pedestrian"],["陌生人","stranger"],["男士","suitMan"],["女士","suitWoman"]]),d(Dr,"animations",[["站立","standing"],["行走","walking"],["奔跑","running"]]);let Po=Dr;const Fo=class Fo extends ar{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new it([this,"url"],"图片路径",Fo.defaults.url),new X([this,"isHoverZoom"],"悬浮放大"),new X([this,"hoverHighlight"],"悬浮高亮")]}}};d(Fo,"createDefaultProps",()=>({...ar.createDefaultProps(),url:"inner://CameraBlue.png",isHoverZoom:!1,hoverHighlight:!1,renderMode:4})),d(Fo,"type",Fo.register("ESImageLabel",Fo,{chsName:"图片标签",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"基础图片标签。"}));let zc=Fo;const Ri=class Ri extends Ht{constructor(e){super(e),this.ad(nt([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(nt([this,"czmAlpha"],[this,"opacity"]))}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new M([this,"zIndex"],"层级序号",Ri.defaults.zIndex)],dataSource:[...e.dataSource,new it([this,"url"],"影像服务地址"),new Ar([this,"rectangle"],"矩形范围",Ri.defaults.rectangle,!0),new Ue([this,"maximumLevel"],1,[1,24],"最大级别",Ri.defaults.maximumLevel,!0),new it([this,"options"],"options",Ri.defaults.options,void 0,!0),new pt([this,"targetID"],"targetID"),new Ue([this,"opacity"],.01,[0,1],"opacity",1)],more:[...e.more,new ut([],"通用"),new M([this,"height"],"高度"),new pt([this,"actorTag"]),new pt([this,"componentTag"]),new M([this,"minimumLevel"]),new ut([],"图像"),new M([this,"czmAlpha"],"透明度"),new M([this,"czmBrightness"],"亮度"),new M([this,"czmContrast"],"对比度"),new M([this,"czmHue"],"色相"),new M([this,"czmSaturation"],"饱和度"),new M([this,"czmGamma"],"伽马值")]}}};d(Ri,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",rectangle:Qt([-180,-90,180,90]),options:Qt(void 0),zIndex:0,actorTag:"",componentTag:"",maximumLevel:22,minimumLevel:0,targetID:"",czmSplitDirection:"NONE",czmAlpha:1,czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1,opacity:1,splitDirection:"NONE"})),d(Ri,"type",Ri.register("ESImageryLayer",Ri,{chsName:"影像图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"影像图层"}));let hf=Ri;const OS=`
204
204
  # 声明文件
205
205
  ### options 类型
206
206
  \`\`\`javascript
@@ -306,7 +306,7 @@ export type ESJTimeIntervalCollectionJsonType = {
306
306
  };
307
307
 
308
308
  \`\`\`
309
- `,ui=class ui extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new M([this,"size"],"尺寸",ui.defaults.size),new X([this,"autoFollow"],"自动跟随",ui.defaults.autoFollow),new Pt([this,"mode"],ui.modes,"模式","blueSky")],more:[...e.more,new M([this,"autoOpacityFactor"],"自动消失系数",ui.defaults.autoOpacityFactor)]}}};d(ui,"createDefaultProps",()=>({...st.createDefaultProps(),size:1e4,autoFollow:!0,autoOpacityFactor:2,mode:"blueSky",collision:!1,allowPicking:!1})),d(ui,"type",ui.register("ESLocalSkyBox",ui,{chsName:"局部天空盒",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"效果类"})),d(ui,"modes",[["baiyun","baiyun"],["blueSky","blueSky"],["clearSky","clearSky"],["dream","dream"],["starrySky","starrySky"],["sunnySky","sunnySky"],["sunSets","sunSets"]]);let df=ui;const Pl=class Pl extends st{constructor(t){super(t);d(this,"_location",this.disposeVar(j(void 0)));{const n=()=>{this.location=this.position};n(),this.ad(this.positionChanged.don(n))}}get location(){return this._location.value}set location(t){this._location.value=t}get locationChanged(){return this._location.changed}};d(Pl,"type",Pl.register("ESLocationMeasurement",Pl,{chsName:"位置测量点",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"位置测量点"}));let ff=Pl;const un=class un extends st{constructor(t){super(t);d(this,"_player",this.dv(new kr));{const n=un.defaults;this.d(nt([this._player,"loop"],[this,"playingLoop"],i=>i??n.playingLoop,i=>i??n.playingLoop)),this.d(nt([this._player,"currentTime"],[this,"currentTime"],i=>i??n.currentTime,i=>i??n.currentTime)),this.d(nt([this._player,"duration"],[this,"duration"],i=>i??n.duration,i=>i??n.duration)),this.d(nt([this._player,"playing"],[this,"playing"],i=>i??n.playing,i=>i??n.playing)),this.d(nt([this._player,"speed"],[this,"playingSpeed"],i=>i??n.playingSpeed,i=>i??n.playingSpeed))}}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(t){this._player.ratio=t}get ratioChanged(){return this._player.ratioChanged}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"通用","通用"),new lt(["number"],n=>this.flyTo(n),[1e3],"飞入"),new Es([this,"updateCallback"],"更新回调函数",void 0,void 0,!0),new M([this,"emissionRate"],"发射率",5,!0),new X([this,"loop"],"是否循环",!0,!0),new M([this,"particleScale"],"等级",1,!0),new M([this,"startScale"],"初始等级",void 0,!0),new M([this,"endScale"],"结束等级",un.defaults.endScale,!0),new Mt([this,"color"],"颜色",void 0,!0),new Mt([this,"startColor"],"初始颜色",void 0,!0),new Mt([this,"endColor"],"结束颜色",void 0,!0),new X([this,"sizeInMeters"],"尺寸单位为米",void 0,!0),new M([this,"speed"],"速度",1,!0),new M([this,"minimumSpeed"],"最小速度",void 0,!0),new M([this,"maximumSpeed"],"最大速度",void 0,!0),new M([this,"lifetime"],"生命周期",Number.MAX_VALUE,!0),new M([this,"particleLife"],"粒子生命周期",un.defaults.particleLife,!0),new M([this,"minimumParticleLife"],"最小粒子生命周期",void 0,!0),new M([this,"maximumParticleLife"],"最大粒子生命周期",void 0,!0),new M([this,"mass"],"块数量",1,!0),new M([this,"minimumMass"],"最小块数量",void 0,!0),new M([this,"maximumMass"],"最大块数量",void 0,!0),new Ae([this,"imageSize"],"图片尺寸",un.defaults.imageSize,!0),new Ae([this,"minimumImageSize"],"最小图片尺寸",void 0,!0),new Ae([this,"maximumImageSize"],"最大图片尺寸",void 0,!0),new Fu([this,"image"],"图片",un.defaults.image,!0),new cn([this,"translation"],"偏移",[0,0,0],!0),new zh([this,"bursts"],"bursts",void 0,!0),new it([this,"emitter"],"emitter",un.defaults.emitter),new ut([],"播放器","播放器"),new M([this,"ratio"],"播放比率",0,!0),new Hl([this,"playing"],[this,"ratio"],[this,"playingLoop"],"播放器"),new X([this,"playingLoop"],"是否循环",un.defaults.playingLoop,!0),new M([this,"currentTime"],"当前时间",un.defaults.currentTime,!0),new M([this,"duration"],"过渡时间",un.defaults.duration,!0),new X([this,"playing"],"是否播放",un.defaults.playing,!0),new M([this,"playingSpeed"],"播放速度",un.defaults.playingSpeed,!0)]}}};d(un,"createDefaultProps",()=>({...st.createDefaultProps(),emitter:Qt({type:"CircleEmitter",radius:.5}),bursts:ah(void 0),translation:re(void 0),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",imageSize:re([20,20]),minimumImageSize:re(void 0),maximumImageSize:re(void 0),updateCallback:void 0,emissionRate:void 0,loop:void 0,particleScale:void 0,startScale:void 0,endScale:4,color:re(void 0),startColor:re(void 0),endColor:re(void 0),sizeInMeters:void 0,speed:void 0,minimumSpeed:void 0,maximumSpeed:void 0,lifetime:void 0,particleLife:.5,minimumParticleLife:void 0,maximumParticleLife:void 0,mass:void 0,minimumMass:void 0,maximumMass:void 0,playingLoop:!0,currentTime:0,duration:6e3,playingSpeed:1,playing:!0})),d(un,"type",un.register("ESParticleSystemPrimitive",un,{chsName:"粒子",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通过Cesium的Primitive API 实现的粒子特效。"}));let Uc=un;const li=class li extends ar{constructor(t){super(t);d(this,"initialStyle",this.ad(Qt(void 0)));d(this,"_getInitialStyleEvent",this.disposeVar(new O))}get getInitialStyleEvent(){return this._getInitialStyleEvent}getInitialStyle(){return Promise.race([new Promise(t=>{const n=this.d(this.initialStyle.changed.disposableOnce(t));this.getInitialStyleEvent.emit(),setTimeout(()=>{n(),t(void 0)},2e3)})])}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Pt([this,"mode"],li.modes,"模式",li.defaults.mode),new it([this,"style"],"样式",li.defaults.style),new X([this,"autoAnchor"],"自动锚点对齐",li.defaults.autoAnchor)]}}};d(li,"createDefaultProps",()=>({...ar.createDefaultProps(),mode:"SquareH01",style:wt({fontSize:16,imageSize:[60,60],textBackgroundColor:[1,1,1,0],textBackgroundSize:[120,30],textColor:[1,1,1,1],textOffset:[10,2],textBoxOffset:[40,0],textBoxAlign:"start",textBoxShow:!0,textBoxMode:"default"}),autoAnchor:!0})),d(li,"type",li.register("ESPoi2D",li,{chsName:"ESPoi2D",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"三角形,菱形"})),d(li,"modes",[["自定义","Custom"],["SquareH01","SquareH01"],["SquareH02","SquareH02"],["SquareV01","SquareV01"],["SquareV02","SquareV02"],["SquareV03","SquareV03"],["SquareV04","SquareV04"],["Flag01","Flag01"],["Flag02","Flag02"],["Linear01","Linear01"],["Linear02","Linear02"],["Linear03","Linear03"],["CircularH01","CircularH01"],["CircularH02","CircularH02"],["CircularV01","CircularV01"],["CircularV02","CircularV02"],["CircularV03","CircularV03"],["CircularV04","CircularV04"],["CircularV05","CircularV05"],["P3D01","P3D01"],["P3D02","P3D02"],["P3D03","P3D03"],["P3D04","P3D04"],["P3D05","P3D05"],["P3D06","P3D06"],["P3D07","P3D07"],["Diamond01","Diamond01"],["Diamond02","Diamond02"],["Stranger","Stranger"],["ManNormal","ManNormal"],["ManAbnormal","ManAbnormal"],["WomanNormal","WomanNormal"],["WomanAbnormal","WomanAbnormal"],["Camera","Camera"]]);let ml=li;const Li=class Li extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Pt([this,"mode"],Li.modes,"模式",Li.defaults.mode),new it([this,"style"],"样式",Li.defaults.style)]}}};d(Li,"createDefaultProps",()=>({...st.createDefaultProps(),mode:"triangle",style:wt({UI_Color:[.09803921568627451,.40784313725490196,.8,1],FX_Color:[.09803921568627451,.40784313725490196,.8,1]})})),d(Li,"type",Li.register("ESPoi3D",Li,{chsName:"ESPoi3D",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"三角形,菱形"})),d(Li,"modes",[["三角形","triangle"],["菱形","diamond"],["制(存)梁场","BridgePrefabricationSite"],["汽车运输便道","ExportRoad"],["拌合站","MixingStation"],["小型预制构件厂","PrefabricatedComponentsSite"],["项目部","ProjectDepartment"],["铁路岔线","RailwayFork"],["钢筋加工厂","RebarMachining"],["临时电力干线","TempElectricMain"],["铺轨基地","TrackLayingBase"],["汽车运梁通道","TransportationBridge"]]);let pf=Li;const tu=class tu extends Xt{constructor(t){super(t);d(this,"_czmFlattenedPlaneId",this.dv(j("")))}get czmFlattenedPlaneId(){return this._czmFlattenedPlaneId.value}set czmFlattenedPlaneId(t){this._czmFlattenedPlaneId.value=t}get czmFlattenedPlaneIdChanged(){return this._czmFlattenedPlaneId.changed}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new pt([this,"targetID"],"瓦片图层","")]}}};d(tu,"createDefaultProps",()=>({...Xt.createDefaultProps(),targetID:"",filled:!1})),d(tu,"type",tu.register("ESPolygonFlattenedPlane",tu,{chsName:"压平",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPolygonFlattenedPlane"}));let gf=tu;const dy=async(r,e,t)=>{const{viewer:n}=r;if(!n){console.error("AddTrees: ueViewer.viewer is undefined");return}const i=await n.callUeFunc({f:"AddTrees",p:{id:e,TreeParams:t}});return i.error&&console.error("AddTrees:",i.error),i},fy=async(r,e)=>{const{viewer:t}=r;if(!t){console.error("RemoveAllTrees: ueViewer.viewer is undefined");return}const n=await t.callUeFunc({f:"RemoveAllTrees",p:{id:e}});return n.error&&console.error("RemoveAllTrees:",n.error),n},py=async(r,e,t)=>{const{viewer:n}=r;if(!n){console.error("UpdateTreeParams: ueViewer.viewer is undefined");return}const i=await n.callUeFunc({f:"UpdateTreeParams",p:{id:e,TreeParams:t}});return i.error&&console.error("UpdateTreeParams:",i.error),i},gy=async(r,e,t,n)=>{const{viewer:i}=r;if(!i){console.error("CutDownTrees: ueViewer.viewer is undefined");return}const s=await i.callUeFunc({f:"CutDownTrees",p:{id:e,TreeIds:t,TimeLength:n}});return s.error&&console.error("CutDownTrees:",s.error),s},my=async(r,e,t,n,i)=>{const{viewer:s}=r;if(!s){console.error("GrowthSimulation: ueViewer.viewer is undefined");return}const o=await s.callUeFunc({f:"GrowthSimulation",p:{id:e,ToParams:t,SwitchTime:i,TimeLength:n}});return o.error&&console.error("GrowthSimulation:",o.error),o},eu=class eu extends Ht{constructor(t){super(t);d(this,"_addTreesEvent",this.dv(new O));d(this,"_removeAllTreesEvent",this.dv(new O));d(this,"_updateTreeParamsEvent",this.dv(new O));d(this,"_cutDownTreesEvent",this.dv(new O));d(this,"_growthSimulationEvent",this.dv(new O))}async addTreesCallFunc(t,n){return await dy(t,this.id,n)}async updateTreeParamsCallFunc(t,n){return await py(t,this.id,n)}async cutDownTreesCallFunc(t,n,i){return await gy(t,this.id,n,i)}async removeAllTreesCallFunc(t){return await fy(t,this.id)}async growthSimulationCallFunc(t,n,i,s){return await my(t,this.id,n,i,s)}async getIdByComponentNameAndHitItem(t,n,i){return await t.getIdByComponentNameAndHitItem(this.id,n,i)}get addTreesEvent(){return this._addTreesEvent}addTrees(t){this._addTreesEvent.emit(t)}get removeAllTreesEvent(){return this._removeAllTreesEvent}removeAllTrees(){this._removeAllTreesEvent.emit()}get updateTreeParamsEvent(){return this._updateTreeParamsEvent}updateTreeParams(t){this._updateTreeParamsEvent.emit(t)}get cutDownTreesEvent(){return this._cutDownTreesEvent}cutDownTrees(t,n){this._cutDownTreesEvent.emit(t,n)}get growthSimulationEvent(){return this._growthSimulationEvent}growthSimulation(t,n,i){this._growthSimulationEvent.emit(t,n,i)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"通用"),new it([this,"treeTypes"],"treeTypes",[],"{ name: string, meshPath: string }[]",!0),new M([this,"stumpId"],"树桩id"),new M([this,"intervalTime"],"动画间隔时间"),new M([this,"switchIntervalTime"],"切换间隔时间")]}}};d(eu,"createDefaultProps",()=>({...Ht.createDefaultProps(),treeTypes:Qt([]),stumpId:-1,intervalTime:.1,switchIntervalTime:.5})),d(eu,"type",eu.register("ESSeparateFoliage",eu,{chsName:"单体控制森林",tags:["ESObjects","_ES_Impl_UE"],description:"ESSeparateFoliage"}));let mf=eu;function Gc(r,e,t){const n="buffer"in r,i=n?r.buffer:r;n&&(e+=r.byteOffset);const s=new Array(t),o=new DataView(i);for(let a=0;a<t;++a){const u=o.getUint8(e+a);s[a]=String.fromCharCode(u)}return s.join("")}function Wc(r,e){const t="buffer"in r,n=t?r.buffer:r;return t&&(e+=r.byteOffset),new DataView(n).getUint32(e,!0)}function vy(r,e,t){const n="buffer"in r,i=n?r.buffer:r;if(n&&(e+=r.byteOffset),e+t>i.byteLength){console.error("byteOffset + length > buffer.byteLength");return}return new Uint8Array(i,e,t)}function NS(r,e,t){const n="buffer"in r,i=n?r.buffer:r;if(n&&(e+=r.byteOffset),e+t*2>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint16Array(i,e,t)}function DS(r,e,t){const n="buffer"in r,i=n?r.buffer:r;if(n&&(e+=r.byteOffset),e+t*4>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint32Array(i,e,t)}function MS(r,e,t){const n="buffer"in r,i=n?r.buffer:r;if(n&&(e+=r.byteOffset),e+t*4>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Float32Array(i,e,t)}function yy(r){if(Gc(r,0,4)!=="glTF"){console.error("Not a glTF file");return}const t=Wc(r,4);if(t!==2){console.error("Unsupported glTF version");return}const n=Wc(r,8);if(n!==r.byteLength){console.error("Invalid glTF length");return}const i=Wc(r,12);if(i+12+4>n){console.error("Invalid glTF chunk length");return}if(Gc(r,16,4)!=="JSON"){console.error("Invalid glTF chunk type");return}const o=Gc(r,20,i),a={version:t,length:n,gltfJson:o};if(20+i<r.byteLength){const u=Wc(r,20+i);if(Gc(r,20+i+4,4)!=="BIN\0"){console.error("Invalid glTF chunk type");return}const c=vy(r,20+i+8,u);a.gltfBinary=c}return a}globalThis.parseGlb=yy;function _y(r){const e=yy(r);if(e===void 0||!e.gltfBinary)return;const t=JSON.parse(e.gltfJson);return t.nodes.map(n=>{var i=t.meshes[n.mesh],s=i.primitives[0].attributes.POSITION,o=i.primitives[0].indices,a=t.accessors[s],u=t.bufferViews[a.bufferView];if(!e.gltfBinary)throw new Error("!glbParseResult.gltfBinary");const l=MS(e.gltfBinary,u.byteOffset??0,u.byteLength/4);var c=t.accessors[o],h=t.bufferViews[c.bufferView];if(!e.gltfBinary)throw new Error("!glbParseResult.gltfBinary");let f;return c.componentType===5121?f=vy(e.gltfBinary,h.byteOffset??0,h.byteLength/1):c.componentType===5123?f=NS(e.gltfBinary,h.byteOffset??0,h.byteLength/2):c.componentType===5125&&(f=DS(e.gltfBinary,h.byteOffset??0,h.byteLength/4)),{name:n.name,posBuffer:l,indicesBuffer:f}})}globalThis.parseWaterGlb=_y;const _n=class _n extends st{constructor(t){super(t);d(this,"_submergingData");d(this,"_allMoments",[]);d(this,"readyEvent",this.dv(new O));{const n=()=>{this.url!=""&&fetch(this.url).then(i=>{i.status==200&&i.ok&&i.arrayBuffer().then(s=>{this._submergingData=_y(s);const o=this._submergingData.map(a=>Date.parse(a.name)).sort();this._allMoments=o,this.currentTime==0&&(this.currentTime=o[0]),this.readyEvent.emit()})}).catch(i=>{console.log(i)})};n(),this.d(this.urlChanged.don(()=>{n()}))}}get getSubmergingData(){return this._submergingData}getAllMoments(){return this._allMoments}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new pt([this,"url"],"Url地址",_n.defaults.url),new Ue([this,"amplitude"],.01,[0,1],"振幅",_n.defaults.amplitude),new M([this,"frequency"],"频率",_n.defaults.frequency),new M([this,"currentTime"],"当前时间",_n.defaults.currentTime),new it([this,"materialParams"],"材质参数",_n.defaults.materialParams),new Pt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型","river"),new Mt([this,"waterColor"],"水的底色",_n.defaults.waterColor),new Ue([this,"waveVelocity"],.01,[0,1],"波动频率",_n.defaults.waveVelocity),new M([this,"flowSpeed"],"水流速度",_n.defaults.flowSpeed),new Ue([this,"specularIntensity"],.01,[0,1],"镜面反射强度",_n.defaults.specularIntensity),new Ue([this,"murkiness"],.01,[0,10],"水体浑浊度",_n.defaults.murkiness)]}}};d(_n,"createDefaultProps",()=>({...st.createDefaultProps(),allowPicking:!0,url:"",currentTime:0,materialParams:wt({}),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowSpeed:0,murkiness:5})),d(_n,"type",_n.register("ESSubmergingAnalysis",_n,{chsName:"淹没分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESSubmergingAnalysis"}));let vf=_n;const Ao=class Ao extends Xt{constructor(t){super(t);d(this,"_groundHeight",this.disposeVar(j(0)));d(this,"_startEvent",this.dv(new O));d(this,"_stopEvent",this.dv(new O));this.ad(Ui(this.pointsChanged,()=>{var n,i;this.groundHeight=((i=(n=this.points)==null?void 0:n[0])==null?void 0:i[2])??0},{immediate:!0}))}get groundHeight(){return this._groundHeight.value}set groundHeight(t){this._groundHeight.value=t}get groundHeightChanged(){return this._groundHeight.changed}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Mt([this,"startColor"],"起始颜色"),new Mt([this,"endColor"],"结束颜色"),new M([this,"progress"],"计算进度(%)",0,!0),new M([this,"height"],"分析区域高度(m)"),new M([this,"groundHeight"],"地面高度(m)",0,!1,!0),new M([this,"sampleDistance"],"采样间距(m)"),new M([this,"startTime"],"起始时间(ms)"),new M([this,"endTime"],"结束时间(ms)"),new M([this,"spanTime"],"时间跨度(h)"),new lt([],()=>this.start(),[],"开始分析"),new lt([],()=>this.stop(),[],"结束分析")]}}};d(Ao,"createDefaultProps",()=>({...Xt.createDefaultProps(),height:30,sampleDistance:10,startColor:dt([1,1,0,1]),endColor:dt([1,0,0,1]),startTime:0,endTime:36e6,spanTime:1,progress:0,filled:!1,stroked:!1})),d(Ao,"type",Ao.register("ESSunshineAnalysis",Ao,{chsName:"日照分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"日照分析"})),d(Ao,"supportEditingModes",[...Xt.supportEditingModes,et.HeightModify]);let yf=Ao;const cs=class cs extends Ht{constructor(t){super(t);d(this,"_activateEvent",this.disposeVar(new O));d(this,"activate",!1)}get activateEvent(){return this._activateEvent}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",basic:[...t.basic,new M([this,"zIndex"],"层级序号",cs.defaults.zIndex)],dataSource:[...t.dataSource,new it([this,"url"],"地形服务地址",cs.defaults.url),new Ar([this,"rectangle"],"矩形范围",cs.defaults.rectangle)],more:[...t.more,new M([this,"czmMinzoom"],"czmMinzoom",void 0,!0),new M([this,"czmMaxzoom"],"czmMaxzoom",void 0,!0)]}}};d(cs,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"http://inner.earthsdk.com/layer.json",rectangle:dt([-180,-90,180,90]),zIndex:0,czmMaxzoom:void 0,czmMinzoom:void 0})),d(cs,"type",cs.register("ESTerrainLayer",cs,{chsName:"地形图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地形图层"}));let _f=cs;const ci=class ci extends ar{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Mt([this,"color"],"文本颜色",[1,1,1,1]),new M([this,"fontSize"],"文字大小",14),new Uh([this,"text"],"内容",ci.defaults.text,void 0,!0),new Mt([this,"backgroundColor"],"背景颜色",ci.defaults.backgroundColor),new Ar([this,"padding"],"内边距",ci.defaults.padding),new Mt([this,"borderColor"],"边界颜色"),new Ar([this,"borderRadius"],"边界圆角"),new M([this,"borderWidth"],"边界宽度"),new M([this,"rotate"],"旋转角度",ci.defaults.rotate)],more:[...e.more,new ut([],"czm","czm"),new X([this,"textEditingInteraction"],"文本编辑交互"),new X([this,"textEditing"],"文本编辑"),new M([this,"width"],"宽度",ci.defaults.width,!0),new M([this,"opacity"],"透明度"),new Pt([this,"textAlign"],[["center","center"],["left","left"],["right","right"]],"文字位置","left"),new Pt([this,"borderStyle"],[["none","none"],["hidden","hidden"],["dotted","dotted"],["dashed","dashed"],["solid","solid"],["double","double"],["groove","groove"],["ridge","ridge"],["inset","inset"],["outset","outset"]],"边框类型")]}}};d(ci,"createDefaultProps",()=>({...ar.createDefaultProps(),text:"请输入文字",width:80,textEditing:!1,textEditingInteraction:!1,opacity:1,fontSize:14,textAlign:"left",color:dt([1,1,1,1]),backgroundColor:dt([0,0,0,.8]),padding:dt([5,5,5,5]),borderRadius:dt([6,6,6,6]),borderWidth:0,borderColor:dt([1,1,1,1]),borderStyle:"solid",rotate:0})),d(ci,"type",ci.register("ESTextLabel",ci,{chsName:"文本标签",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"文本标签。"}));let ja=ci;const RS=`
309
+ `,ui=class ui extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new M([this,"size"],"尺寸",ui.defaults.size),new X([this,"autoFollow"],"自动跟随",ui.defaults.autoFollow),new Pt([this,"mode"],ui.modes,"模式","blueSky")],more:[...e.more,new M([this,"autoOpacityFactor"],"自动消失系数",ui.defaults.autoOpacityFactor)]}}};d(ui,"createDefaultProps",()=>({...st.createDefaultProps(),size:1e4,autoFollow:!0,autoOpacityFactor:2,mode:"blueSky",collision:!1,allowPicking:!1})),d(ui,"type",ui.register("ESLocalSkyBox",ui,{chsName:"局部天空盒",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"效果类"})),d(ui,"modes",[["baiyun","baiyun"],["blueSky","blueSky"],["clearSky","clearSky"],["dream","dream"],["starrySky","starrySky"],["sunnySky","sunnySky"],["sunSets","sunSets"]]);let df=ui;const Pl=class Pl extends st{constructor(t){super(t);d(this,"_location",this.disposeVar(j(void 0)));{const n=()=>{this.location=this.position};n(),this.ad(this.positionChanged.don(n))}}get location(){return this._location.value}set location(t){this._location.value=t}get locationChanged(){return this._location.changed}};d(Pl,"type",Pl.register("ESLocationMeasurement",Pl,{chsName:"位置测量点",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"位置测量点"}));let ff=Pl;const un=class un extends st{constructor(t){super(t);d(this,"_player",this.dv(new kr));{const n=un.defaults;this.d(nt([this._player,"loop"],[this,"playingLoop"],i=>i??n.playingLoop,i=>i??n.playingLoop)),this.d(nt([this._player,"currentTime"],[this,"currentTime"],i=>i??n.currentTime,i=>i??n.currentTime)),this.d(nt([this._player,"duration"],[this,"duration"],i=>i??n.duration,i=>i??n.duration)),this.d(nt([this._player,"playing"],[this,"playing"],i=>i??n.playing,i=>i??n.playing)),this.d(nt([this._player,"speed"],[this,"playingSpeed"],i=>i??n.playingSpeed,i=>i??n.playingSpeed))}}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(t){this._player.ratio=t}get ratioChanged(){return this._player.ratioChanged}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"通用","通用"),new lt(["number"],n=>this.flyTo(n),[1e3],"飞入"),new Es([this,"updateCallback"],"更新回调函数",void 0,void 0,!0),new M([this,"emissionRate"],"发射率",5,!0),new X([this,"loop"],"是否循环",!0,!0),new M([this,"particleScale"],"等级",1,!0),new M([this,"startScale"],"初始等级",void 0,!0),new M([this,"endScale"],"结束等级",un.defaults.endScale,!0),new Mt([this,"color"],"颜色",void 0,!0),new Mt([this,"startColor"],"初始颜色",void 0,!0),new Mt([this,"endColor"],"结束颜色",void 0,!0),new X([this,"sizeInMeters"],"尺寸单位为米",void 0,!0),new M([this,"speed"],"速度",1,!0),new M([this,"minimumSpeed"],"最小速度",void 0,!0),new M([this,"maximumSpeed"],"最大速度",void 0,!0),new M([this,"lifetime"],"生命周期",Number.MAX_VALUE,!0),new M([this,"particleLife"],"粒子生命周期",un.defaults.particleLife,!0),new M([this,"minimumParticleLife"],"最小粒子生命周期",void 0,!0),new M([this,"maximumParticleLife"],"最大粒子生命周期",void 0,!0),new M([this,"mass"],"块数量",1,!0),new M([this,"minimumMass"],"最小块数量",void 0,!0),new M([this,"maximumMass"],"最大块数量",void 0,!0),new Ae([this,"imageSize"],"图片尺寸",un.defaults.imageSize,!0),new Ae([this,"minimumImageSize"],"最小图片尺寸",void 0,!0),new Ae([this,"maximumImageSize"],"最大图片尺寸",void 0,!0),new Fu([this,"image"],"图片",un.defaults.image,!0),new cn([this,"translation"],"偏移",[0,0,0],!0),new zh([this,"bursts"],"bursts",void 0,!0),new it([this,"emitter"],"emitter",un.defaults.emitter),new ut([],"播放器","播放器"),new M([this,"ratio"],"播放比率",0,!0),new Hl([this,"playing"],[this,"ratio"],[this,"playingLoop"],"播放器"),new X([this,"playingLoop"],"是否循环",un.defaults.playingLoop,!0),new M([this,"currentTime"],"当前时间",un.defaults.currentTime,!0),new M([this,"duration"],"过渡时间",un.defaults.duration,!0),new X([this,"playing"],"是否播放",un.defaults.playing,!0),new M([this,"playingSpeed"],"播放速度",un.defaults.playingSpeed,!0)]}}};d(un,"createDefaultProps",()=>({...st.createDefaultProps(),emitter:Qt({type:"CircleEmitter",radius:.5}),bursts:ah(void 0),translation:re(void 0),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",imageSize:re([20,20]),minimumImageSize:re(void 0),maximumImageSize:re(void 0),updateCallback:void 0,emissionRate:void 0,loop:void 0,particleScale:void 0,startScale:void 0,endScale:4,color:re(void 0),startColor:re(void 0),endColor:re(void 0),sizeInMeters:void 0,speed:void 0,minimumSpeed:void 0,maximumSpeed:void 0,lifetime:void 0,particleLife:.5,minimumParticleLife:void 0,maximumParticleLife:void 0,mass:void 0,minimumMass:void 0,maximumMass:void 0,playingLoop:!0,currentTime:0,duration:6e3,playingSpeed:1,playing:!0})),d(un,"type",un.register("ESParticleSystemPrimitive",un,{chsName:"粒子",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通过Cesium的Primitive API 实现的粒子特效。"}));let Uc=un;const li=class li extends ar{constructor(t){super(t);d(this,"initialStyle",this.ad(Qt(void 0)));d(this,"_getInitialStyleEvent",this.disposeVar(new O))}get getInitialStyleEvent(){return this._getInitialStyleEvent}getInitialStyle(){return Promise.race([new Promise(t=>{const n=this.d(this.initialStyle.changed.disposableOnce(t));this.getInitialStyleEvent.emit(),setTimeout(()=>{n(),t(void 0)},2e3)})])}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Pt([this,"mode"],li.modes,"模式",li.defaults.mode),new it([this,"style"],"样式",li.defaults.style),new X([this,"autoAnchor"],"自动锚点对齐",li.defaults.autoAnchor)]}}};d(li,"createDefaultProps",()=>({...ar.createDefaultProps(),mode:"SquareH01",style:wt({fontSize:16,imageSize:[60,60],textBackgroundColor:[1,1,1,0],textBackgroundSize:[120,30],textColor:[1,1,1,1],textOffset:[10,2],textBoxOffset:[40,0],textBoxAlign:"start",textBoxShow:!0,textBoxMode:"default"}),autoAnchor:!0})),d(li,"type",li.register("ESPoi2D",li,{chsName:"ESPoi2D",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"三角形,菱形"})),d(li,"modes",[["自定义","Custom"],["SquareH01","SquareH01"],["SquareH02","SquareH02"],["SquareV01","SquareV01"],["SquareV02","SquareV02"],["SquareV03","SquareV03"],["SquareV04","SquareV04"],["Flag01","Flag01"],["Flag02","Flag02"],["Linear01","Linear01"],["Linear02","Linear02"],["Linear03","Linear03"],["CircularH01","CircularH01"],["CircularH02","CircularH02"],["CircularV01","CircularV01"],["CircularV02","CircularV02"],["CircularV03","CircularV03"],["CircularV04","CircularV04"],["CircularV05","CircularV05"],["P3D01","P3D01"],["P3D02","P3D02"],["P3D03","P3D03"],["P3D04","P3D04"],["P3D05","P3D05"],["P3D06","P3D06"],["P3D07","P3D07"],["Diamond01","Diamond01"],["Diamond02","Diamond02"],["Stranger","Stranger"],["ManNormal","ManNormal"],["ManAbnormal","ManAbnormal"],["WomanNormal","WomanNormal"],["WomanAbnormal","WomanAbnormal"],["Camera","Camera"]]);let ml=li;const Li=class Li extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Pt([this,"mode"],Li.modes,"模式",Li.defaults.mode),new it([this,"style"],"样式",Li.defaults.style)]}}};d(Li,"createDefaultProps",()=>({...st.createDefaultProps(),mode:"triangle",style:wt({UI_Color:[.09803921568627451,.40784313725490196,.8,1],FX_Color:[.09803921568627451,.40784313725490196,.8,1]})})),d(Li,"type",Li.register("ESPoi3D",Li,{chsName:"ESPoi3D",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"三角形,菱形"})),d(Li,"modes",[["三角形","triangle"],["菱形","diamond"],["制(存)梁场","BridgePrefabricationSite"],["汽车运输便道","ExportRoad"],["拌合站","MixingStation"],["小型预制构件厂","PrefabricatedComponentsSite"],["项目部","ProjectDepartment"],["铁路岔线","RailwayFork"],["钢筋加工厂","RebarMachining"],["临时电力干线","TempElectricMain"],["铺轨基地","TrackLayingBase"],["汽车运梁通道","TransportationBridge"]]);let pf=Li;const tu=class tu extends Xt{constructor(t){super(t);d(this,"_czmFlattenedPlaneId",this.dv(j("")))}get czmFlattenedPlaneId(){return this._czmFlattenedPlaneId.value}set czmFlattenedPlaneId(t){this._czmFlattenedPlaneId.value=t}get czmFlattenedPlaneIdChanged(){return this._czmFlattenedPlaneId.changed}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new pt([this,"targetID"],"瓦片图层","")]}}};d(tu,"createDefaultProps",()=>({...Xt.createDefaultProps(),targetID:"",filled:!1})),d(tu,"type",tu.register("ESPolygonFlattenedPlane",tu,{chsName:"压平",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPolygonFlattenedPlane"}));let gf=tu;const fy=async(r,e,t)=>{const{viewer:n}=r;if(!n){console.error("AddTrees: ueViewer.viewer is undefined");return}const i=await n.callUeFunc({f:"AddTrees",p:{id:e,TreeParams:t}});return i.error&&console.error("AddTrees:",i.error),i},py=async(r,e)=>{const{viewer:t}=r;if(!t){console.error("RemoveAllTrees: ueViewer.viewer is undefined");return}const n=await t.callUeFunc({f:"RemoveAllTrees",p:{id:e}});return n.error&&console.error("RemoveAllTrees:",n.error),n},gy=async(r,e,t)=>{const{viewer:n}=r;if(!n){console.error("UpdateTreeParams: ueViewer.viewer is undefined");return}const i=await n.callUeFunc({f:"UpdateTreeParams",p:{id:e,TreeParams:t}});return i.error&&console.error("UpdateTreeParams:",i.error),i},my=async(r,e,t,n)=>{const{viewer:i}=r;if(!i){console.error("CutDownTrees: ueViewer.viewer is undefined");return}const s=await i.callUeFunc({f:"CutDownTrees",p:{id:e,TreeIds:t,TimeLength:n}});return s.error&&console.error("CutDownTrees:",s.error),s},vy=async(r,e,t,n,i)=>{const{viewer:s}=r;if(!s){console.error("GrowthSimulation: ueViewer.viewer is undefined");return}const o=await s.callUeFunc({f:"GrowthSimulation",p:{id:e,ToParams:t,SwitchTime:i,TimeLength:n}});return o.error&&console.error("GrowthSimulation:",o.error),o},eu=class eu extends Ht{constructor(t){super(t);d(this,"_addTreesEvent",this.dv(new O));d(this,"_removeAllTreesEvent",this.dv(new O));d(this,"_updateTreeParamsEvent",this.dv(new O));d(this,"_cutDownTreesEvent",this.dv(new O));d(this,"_growthSimulationEvent",this.dv(new O))}async addTreesCallFunc(t,n){return await fy(t,this.id,n)}async updateTreeParamsCallFunc(t,n){return await gy(t,this.id,n)}async cutDownTreesCallFunc(t,n,i){return await my(t,this.id,n,i)}async removeAllTreesCallFunc(t){return await py(t,this.id)}async growthSimulationCallFunc(t,n,i,s){return await vy(t,this.id,n,i,s)}async getIdByComponentNameAndHitItem(t,n,i){return await t.getIdByComponentNameAndHitItem(this.id,n,i)}get addTreesEvent(){return this._addTreesEvent}addTrees(t){this._addTreesEvent.emit(t)}get removeAllTreesEvent(){return this._removeAllTreesEvent}removeAllTrees(){this._removeAllTreesEvent.emit()}get updateTreeParamsEvent(){return this._updateTreeParamsEvent}updateTreeParams(t){this._updateTreeParamsEvent.emit(t)}get cutDownTreesEvent(){return this._cutDownTreesEvent}cutDownTrees(t,n){this._cutDownTreesEvent.emit(t,n)}get growthSimulationEvent(){return this._growthSimulationEvent}growthSimulation(t,n,i){this._growthSimulationEvent.emit(t,n,i)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"通用"),new it([this,"treeTypes"],"treeTypes",[],"{ name: string, meshPath: string }[]",!0),new M([this,"stumpId"],"树桩id"),new M([this,"intervalTime"],"动画间隔时间"),new M([this,"switchIntervalTime"],"切换间隔时间")]}}};d(eu,"createDefaultProps",()=>({...Ht.createDefaultProps(),treeTypes:Qt([]),stumpId:-1,intervalTime:.1,switchIntervalTime:.5})),d(eu,"type",eu.register("ESSeparateFoliage",eu,{chsName:"单体控制森林",tags:["ESObjects","_ES_Impl_UE"],description:"ESSeparateFoliage"}));let mf=eu;function Gc(r,e,t){const n="buffer"in r,i=n?r.buffer:r;n&&(e+=r.byteOffset);const s=new Array(t),o=new DataView(i);for(let a=0;a<t;++a){const u=o.getUint8(e+a);s[a]=String.fromCharCode(u)}return s.join("")}function Wc(r,e){const t="buffer"in r,n=t?r.buffer:r;return t&&(e+=r.byteOffset),new DataView(n).getUint32(e,!0)}function yy(r,e,t){const n="buffer"in r,i=n?r.buffer:r;if(n&&(e+=r.byteOffset),e+t>i.byteLength){console.error("byteOffset + length > buffer.byteLength");return}return new Uint8Array(i,e,t)}function NS(r,e,t){const n="buffer"in r,i=n?r.buffer:r;if(n&&(e+=r.byteOffset),e+t*2>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint16Array(i,e,t)}function DS(r,e,t){const n="buffer"in r,i=n?r.buffer:r;if(n&&(e+=r.byteOffset),e+t*4>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint32Array(i,e,t)}function MS(r,e,t){const n="buffer"in r,i=n?r.buffer:r;if(n&&(e+=r.byteOffset),e+t*4>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Float32Array(i,e,t)}function _y(r){if(Gc(r,0,4)!=="glTF"){console.error("Not a glTF file");return}const t=Wc(r,4);if(t!==2){console.error("Unsupported glTF version");return}const n=Wc(r,8);if(n!==r.byteLength){console.error("Invalid glTF length");return}const i=Wc(r,12);if(i+12+4>n){console.error("Invalid glTF chunk length");return}if(Gc(r,16,4)!=="JSON"){console.error("Invalid glTF chunk type");return}const o=Gc(r,20,i),a={version:t,length:n,gltfJson:o};if(20+i<r.byteLength){const u=Wc(r,20+i);if(Gc(r,20+i+4,4)!=="BIN\0"){console.error("Invalid glTF chunk type");return}const c=yy(r,20+i+8,u);a.gltfBinary=c}return a}globalThis.parseGlb=_y;function wy(r){const e=_y(r);if(e===void 0||!e.gltfBinary)return;const t=JSON.parse(e.gltfJson);return t.nodes.map(n=>{var i=t.meshes[n.mesh],s=i.primitives[0].attributes.POSITION,o=i.primitives[0].indices,a=t.accessors[s],u=t.bufferViews[a.bufferView];if(!e.gltfBinary)throw new Error("!glbParseResult.gltfBinary");const l=MS(e.gltfBinary,u.byteOffset??0,u.byteLength/4);var c=t.accessors[o],h=t.bufferViews[c.bufferView];if(!e.gltfBinary)throw new Error("!glbParseResult.gltfBinary");let f;return c.componentType===5121?f=yy(e.gltfBinary,h.byteOffset??0,h.byteLength/1):c.componentType===5123?f=NS(e.gltfBinary,h.byteOffset??0,h.byteLength/2):c.componentType===5125&&(f=DS(e.gltfBinary,h.byteOffset??0,h.byteLength/4)),{name:n.name,posBuffer:l,indicesBuffer:f}})}globalThis.parseWaterGlb=wy;const _n=class _n extends st{constructor(t){super(t);d(this,"_submergingData");d(this,"_allMoments",[]);d(this,"readyEvent",this.dv(new O));{const n=()=>{this.url!=""&&fetch(this.url).then(i=>{i.status==200&&i.ok&&i.arrayBuffer().then(s=>{this._submergingData=wy(s);const o=this._submergingData.map(a=>Date.parse(a.name)).sort();this._allMoments=o,this.currentTime==0&&(this.currentTime=o[0]),this.readyEvent.emit()})}).catch(i=>{console.log(i)})};n(),this.d(this.urlChanged.don(()=>{n()}))}}get getSubmergingData(){return this._submergingData}getAllMoments(){return this._allMoments}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new pt([this,"url"],"Url地址",_n.defaults.url),new Ue([this,"amplitude"],.01,[0,1],"振幅",_n.defaults.amplitude),new M([this,"frequency"],"频率",_n.defaults.frequency),new M([this,"currentTime"],"当前时间",_n.defaults.currentTime),new it([this,"materialParams"],"材质参数",_n.defaults.materialParams),new Pt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型","river"),new Mt([this,"waterColor"],"水的底色",_n.defaults.waterColor),new Ue([this,"waveVelocity"],.01,[0,1],"波动频率",_n.defaults.waveVelocity),new M([this,"flowSpeed"],"水流速度",_n.defaults.flowSpeed),new Ue([this,"specularIntensity"],.01,[0,1],"镜面反射强度",_n.defaults.specularIntensity),new Ue([this,"murkiness"],.01,[0,10],"水体浑浊度",_n.defaults.murkiness)]}}};d(_n,"createDefaultProps",()=>({...st.createDefaultProps(),allowPicking:!0,url:"",currentTime:0,materialParams:wt({}),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowSpeed:0,murkiness:5})),d(_n,"type",_n.register("ESSubmergingAnalysis",_n,{chsName:"淹没分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESSubmergingAnalysis"}));let vf=_n;const Ao=class Ao extends Xt{constructor(t){super(t);d(this,"_groundHeight",this.disposeVar(j(0)));d(this,"_startEvent",this.dv(new O));d(this,"_stopEvent",this.dv(new O));this.ad(Ui(this.pointsChanged,()=>{var n,i;this.groundHeight=((i=(n=this.points)==null?void 0:n[0])==null?void 0:i[2])??0},{immediate:!0}))}get groundHeight(){return this._groundHeight.value}set groundHeight(t){this._groundHeight.value=t}get groundHeightChanged(){return this._groundHeight.changed}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Mt([this,"startColor"],"起始颜色"),new Mt([this,"endColor"],"结束颜色"),new M([this,"progress"],"计算进度(%)",0,!0),new M([this,"height"],"分析区域高度(m)"),new M([this,"groundHeight"],"地面高度(m)",0,!1,!0),new M([this,"sampleDistance"],"采样间距(m)"),new M([this,"startTime"],"起始时间(ms)"),new M([this,"endTime"],"结束时间(ms)"),new M([this,"spanTime"],"时间跨度(h)"),new lt([],()=>this.start(),[],"开始分析"),new lt([],()=>this.stop(),[],"结束分析")]}}};d(Ao,"createDefaultProps",()=>({...Xt.createDefaultProps(),height:30,sampleDistance:10,startColor:dt([1,1,0,1]),endColor:dt([1,0,0,1]),startTime:0,endTime:36e6,spanTime:1,progress:0,filled:!1,stroked:!1})),d(Ao,"type",Ao.register("ESSunshineAnalysis",Ao,{chsName:"日照分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"日照分析"})),d(Ao,"supportEditingModes",[...Xt.supportEditingModes,et.HeightModify]);let yf=Ao;const cs=class cs extends Ht{constructor(t){super(t);d(this,"_activateEvent",this.disposeVar(new O));d(this,"activate",!1)}get activateEvent(){return this._activateEvent}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",basic:[...t.basic,new M([this,"zIndex"],"层级序号",cs.defaults.zIndex)],dataSource:[...t.dataSource,new it([this,"url"],"地形服务地址",cs.defaults.url),new Ar([this,"rectangle"],"矩形范围",cs.defaults.rectangle)],more:[...t.more,new M([this,"czmMinzoom"],"czmMinzoom",void 0,!0),new M([this,"czmMaxzoom"],"czmMaxzoom",void 0,!0)]}}};d(cs,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"http://inner.earthsdk.com/layer.json",rectangle:dt([-180,-90,180,90]),zIndex:0,czmMaxzoom:void 0,czmMinzoom:void 0})),d(cs,"type",cs.register("ESTerrainLayer",cs,{chsName:"地形图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地形图层"}));let _f=cs;const ci=class ci extends ar{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Mt([this,"color"],"文本颜色",[1,1,1,1]),new M([this,"fontSize"],"文字大小",14),new Uh([this,"text"],"内容",ci.defaults.text,void 0,!0),new Mt([this,"backgroundColor"],"背景颜色",ci.defaults.backgroundColor),new Ar([this,"padding"],"内边距",ci.defaults.padding),new Mt([this,"borderColor"],"边界颜色"),new Ar([this,"borderRadius"],"边界圆角"),new M([this,"borderWidth"],"边界宽度"),new M([this,"rotate"],"旋转角度",ci.defaults.rotate)],more:[...e.more,new ut([],"czm","czm"),new X([this,"textEditingInteraction"],"文本编辑交互"),new X([this,"textEditing"],"文本编辑"),new M([this,"width"],"宽度",ci.defaults.width,!0),new M([this,"opacity"],"透明度"),new Pt([this,"textAlign"],[["center","center"],["left","left"],["right","right"]],"文字位置","left"),new Pt([this,"borderStyle"],[["none","none"],["hidden","hidden"],["dotted","dotted"],["dashed","dashed"],["solid","solid"],["double","double"],["groove","groove"],["ridge","ridge"],["inset","inset"],["outset","outset"]],"边框类型")]}}};d(ci,"createDefaultProps",()=>({...ar.createDefaultProps(),text:"请输入文字",width:80,textEditing:!1,textEditingInteraction:!1,opacity:1,fontSize:14,textAlign:"left",color:dt([1,1,1,1]),backgroundColor:dt([0,0,0,.8]),padding:dt([5,5,5,5]),borderRadius:dt([6,6,6,6]),borderWidth:0,borderColor:dt([1,1,1,1]),borderStyle:"solid",rotate:0})),d(ci,"type",ci.register("ESTextLabel",ci,{chsName:"文本标签",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"文本标签。"}));let ja=ci;const RS=`
310
310
  #### 默认值如下
311
311
  \`\`\`js
312
312
  {
@@ -321,7 +321,7 @@ export type ESJTimeIntervalCollectionJsonType = {
321
321
  "Key":"Value",
322
322
  "内容": "这是一个示例\\n帮助你理解info的数据形式\\nnum:1\\nkey:'value'\\n"
323
323
  }
324
- \`\`\``,qs=class qs extends ar{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new it([this,"info"],"信息",qs.defaults.info,LS,!0)],more:[...e.more,new ut([],"通用","通用"),new ut([],"ue","ue"),new ia([this,"positionOffset"],"坐标偏移"),new ia([this,"rotationOffset"],"旋转偏移"),new pt([this,"actorTag"]),new pt([this,"widgetClass"]),new pt([this,"socketName"]),new ut([],"czm","czm"),new M([this,"opacity"],"透明度",qs.defaults.opacity,!0)]}}};d(qs,"createDefaultProps",()=>({...ar.createDefaultProps(),info:wt({title:"标题示例",内容:"内容示例"}),widgetClass:"WidgetBlueprint'/EarthSDKForUE/Widget/WBP_ES_DefaultInfo.WBP_ES_DefaultInfo'",actorTag:"",socketName:"",positionOffset:dt([0,0,0]),rotationOffset:dt([0,0,0]),opacity:1})),d(qs,"type",qs.register("ESWidget",qs,{chsName:"部件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ES组件"}));let bf=qs;const ko=class ko extends It{constructor(t){super(t);d(this,"_direction",this.disposeVar(j(0)));d(this,"editingBindMode","doublePoints");{const n=()=>{this.direction=this.points&&this.points.length>=2?sa(Bu(this.points[0],this.points[1])):0};n(),this.ad(this.pointsChanged.don(n))}}get direction(){return this._direction.value}set direction(t){this._direction.value=t}get directionChanged(){return this._direction.changed}};d(ko,"createDefaultProps",()=>({...It.createDefaultProps(),stroked:!0,strokeStyle:wt({width:10,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(ko,"type",ko.register("ESDirectionMeasurement",ko,{chsName:"方位角测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"方位角测量"})),d(ko,"supportEditingModes",[...It.supportEditingModes,et.Rotation,et.Scale,et.DoublePointsAppend,et.DoublePointsModify]);let Pf=ko;const wy=`// dataSource
324
+ \`\`\``,qs=class qs extends ar{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new it([this,"info"],"信息",qs.defaults.info,LS,!0)],more:[...e.more,new ut([],"通用","通用"),new ut([],"ue","ue"),new ia([this,"positionOffset"],"坐标偏移"),new ia([this,"rotationOffset"],"旋转偏移"),new pt([this,"actorTag"]),new pt([this,"widgetClass"]),new pt([this,"socketName"]),new ut([],"czm","czm"),new M([this,"opacity"],"透明度",qs.defaults.opacity,!0)]}}};d(qs,"createDefaultProps",()=>({...ar.createDefaultProps(),info:wt({title:"标题示例",内容:"内容示例"}),widgetClass:"WidgetBlueprint'/EarthSDKForUE/Widget/WBP_ES_DefaultInfo.WBP_ES_DefaultInfo'",actorTag:"",socketName:"",positionOffset:dt([0,0,0]),rotationOffset:dt([0,0,0]),opacity:1})),d(qs,"type",qs.register("ESWidget",qs,{chsName:"部件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ES组件"}));let bf=qs;const ko=class ko extends It{constructor(t){super(t);d(this,"_direction",this.disposeVar(j(0)));d(this,"editingBindMode","doublePoints");{const n=()=>{this.direction=this.points&&this.points.length>=2?sa(Bu(this.points[0],this.points[1])):0};n(),this.ad(this.pointsChanged.don(n))}}get direction(){return this._direction.value}set direction(t){this._direction.value=t}get directionChanged(){return this._direction.changed}};d(ko,"createDefaultProps",()=>({...It.createDefaultProps(),stroked:!0,strokeStyle:wt({width:10,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(ko,"type",ko.register("ESDirectionMeasurement",ko,{chsName:"方位角测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"方位角测量"})),d(ko,"supportEditingModes",[...It.supportEditingModes,et.Rotation,et.Scale,et.DoublePointsAppend,et.DoublePointsModify]);let Pf=ko;const Ey=`// dataSource
325
325
  (dataSource) => {
326
326
  if (dataSource) {
327
327
  dataSource.show = true;
@@ -349,9 +349,9 @@ export type ESJTimeIntervalCollectionJsonType = {
349
349
  }
350
350
  `,FS=`示例代码
351
351
  \`\`\`
352
- ${wy}
352
+ ${Ey}
353
353
  \`\`\`
354
- `,AS="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",bt=class bt extends Ht{constructor(t){super(t);d(this,"_flyToFeatureEvent",this.dv(new O));d(this,"_flyToFeatureIndexEvent",this.dv(new O));d(this,"_features",this.disposeVar(Qt(void 0)));d(this,"pickedInfoType","FeatureCollection");d(this,"abortController");this._updateUrl(),this.ad(this.urlChanged.don(()=>{this._updateUrl()})),this.ad(this.editingChanged.don(()=>{console.warn("ESGeoJson暂不支持编辑!")}))}get flyToFeatureEvent(){return this._flyToFeatureEvent}flyToFeature(t,n,i){this._flyToFeatureEvent.emit(t,n,i)}get flyToFeatureIndexEvent(){return this._flyToFeatureIndexEvent}flyToFeatureIndex(t,n){this._flyToFeatureIndexEvent.emit(t,n)}get features(){return this._features.value}set features(t){this._features.value=t}get featuresChanged(){return this._features.changed}getFeatures(){if(this.features)return this.features;console.log("数据未加载完成,请稍后调用此方法getFeatures()")}async _updateUrl(){var n;this.abortController&&this.abortController.abort(),this.abortController=new AbortController;const t=this.abortController.signal;if(!this.url){this.features=void 0;return}typeof this.url=="object"?this.features=this.url:Wh(this.url)?this.features=JSON.parse(this.url):await fetch(rt.context.getStrFromEnv(this.url),{signal:t}).then(i=>i.json()).then(i=>{this.features=i}).catch(i=>{i.name!="AbortError"&&console.warn("ESGeoJson数据加载失败",i)}),this.pickedInfoType=((n=this.features)==null?void 0:n.type)??"FeatureCollection"}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"style",dataSource:[...t.dataSource,new it([this,"url"],"服务地址",bt.defaults.url),new M([this,"minFeatureVisibleDistance"],"要素最小可视距离",bt.defaults.minFeatureVisibleDistance),new M([this,"maxFeatureVisibleDistance"],"要素最大可视距离",bt.defaults.maxFeatureVisibleDistance),new Pt([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new Pt([this,"classificationType"],bt.classificationTypes,"贴地附着目标",bt.defaults.classificationType),new M([this,"zIndex"],"层级排序",bt.defaults.zIndex)],style:[...t.style,new ut([],"点样式集合"),new X([this,"textShow"],"是否显示",bt.defaults.textShow),new Ae([this,"textAnchor"],"锚点",bt.defaults.anchor),new pt([this,"textProperty"],"标注显示属性",bt.defaults.textStyle.textProperty),new pt([this,"textDefaultText"],"默认文本",bt.defaults.textStyle.defaultText),new Mt([this,"textColor"],"文本颜色",bt.defaults.textStyle.color),new Mt([this,"textBackgroundColor"],"文本背景颜色",bt.defaults.textStyle.backgroundColor),new pt([this,"textFontStyle"],"字体样式",bt.defaults.textStyle.fontStyle),new pt([this,"textFontWeight"],"字体粗细",bt.defaults.textStyle.fontWeight),new M([this,"textFontSize"],"字体大小",bt.defaults.textStyle.fontSize),new Ae([this,"textOffset"],"像素偏移",bt.defaults.textStyle.offset),new ut([],"点图片样式集合"),new X([this,"imageShow"],"是否显示",bt.defaults.imageShow),new Ae([this,"imageAnchor"],"锚点",bt.defaults.imageStyle.anchor),new it([this,"imageUrl"],"图片地址",bt.defaults.imageStyle.url),new Ae([this,"imageSize"],"图片大小",bt.defaults.imageStyle.size),new Ae([this,"imageOffset"],"像素偏移",bt.defaults.imageStyle.offset),new ut([],"线样式集合"),new X([this,"stroked"],"是否显示",bt.defaults.stroked),new X([this,"strokeGround"],"贴地",bt.defaults.strokeStyle.ground),new M([this,"strokeWidth"],"线宽",bt.defaults.strokeStyle.width),new Pt([this,"strokeWidthType"],bt.strokeStyleWidthTypes,"线宽类型"),new Mt([this,"strokeColor"],"线颜色",bt.defaults.strokeStyle.color),new pt([this,"strokeMaterial"],"线材质",bt.defaults.strokeStyle.material),new it([this,"strokeMaterialParams"],"线材质参数",bt.defaults.strokeStyle.materialParams),new ut([],"面样式集合"),new X([this,"filled"],"是否显示",bt.defaults.filled),new X([this,"fillGround"],"贴地",bt.defaults.fillStyle.ground),new Mt([this,"fillColor"],"填充颜色",bt.defaults.fillStyle.color),new pt([this,"fillMaterial"],"填充材质",bt.defaults.fillStyle.material),new it([this,"fillMaterialParams"],"填充材质参数",bt.defaults.fillStyle.materialParams)],more:[...t.more,new ut([],"标注文本样式"),new pt([this,"textFontFamily"],"字体",bt.defaults.textStyle.fontFamily),new M([this,"zOrder"],"点排序优先级",bt.defaults.zOrder),new ut([],"通用"),new Es([this,"loadFuncStr"],"loadFnStr",wy,FS,!0)]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}get textProperty(){return this.textStyle.textProperty}set textProperty(t){this.textStyle={...this.textStyle,textProperty:t}}get textPropertyChanged(){return this.textStyleChanged}get textDefaultText(){return this.textStyle.defaultText}set textDefaultText(t){this.textStyle={...this.textStyle,defaultText:t}}get textDefaultTextChanged(){return this.textStyleChanged}get textColor(){return this.textStyle.color}set textColor(t){this.textStyle={...this.textStyle,color:t}}get textColorChanged(){return this.textStyleChanged}get textBackgroundColor(){return this.textStyle.backgroundColor}set textBackgroundColor(t){this.textStyle={...this.textStyle,backgroundColor:t}}get textBackgroundColorChanged(){return this.textStyleChanged}get textFontFamily(){return this.textStyle.fontFamily}set textFontFamily(t){this.textStyle={...this.textStyle,fontFamily:t}}get textFontFamilyChanged(){return this.textStyleChanged}get textFontStyle(){return this.textStyle.fontStyle}set textFontStyle(t){this.textStyle={...this.textStyle,fontStyle:t}}get textFontStyleChanged(){return this.textStyleChanged}get textFontWeight(){return this.textStyle.fontWeight}set textFontWeight(t){this.textStyle={...this.textStyle,fontWeight:t}}get textFontWeightChanged(){return this.textStyleChanged}get textFontSize(){return this.textStyle.fontSize}set textFontSize(t){this.textStyle={...this.textStyle,fontSize:t}}get textFontSizeChanged(){return this.textStyleChanged}get textAnchor(){return this.textStyle.anchor}set textAnchor(t){this.textStyle={...this.textStyle,anchor:t}}get textAnchorChanged(){return this.textStyleChanged}get textOffset(){return this.textStyle.offset}set textOffset(t){this.textStyle={...this.textStyle,offset:t}}get textOffsetChanged(){return this.textStyleChanged}get imageUrl(){return this.imageStyle.url}set imageUrl(t){this.imageStyle={...this.imageStyle,url:t}}get imageUrlChanged(){return this.imageStyleChanged}get imageSize(){return this.imageStyle.size}set imageSize(t){this.imageStyle={...this.imageStyle,size:t}}get imageSizeChanged(){return this.imageStyleChanged}get imageAnchor(){return this.imageStyle.anchor}set imageAnchor(t){this.imageStyle={...this.imageStyle,anchor:t}}get imageAnchorChanged(){return this.imageStyleChanged}get imageOffset(){return this.imageStyle.offset}set imageOffset(t){this.imageStyle={...this.imageStyle,offset:t}}get imageOffsetChanged(){return this.imageStyleChanged}};d(bt,"createDefaultProps",()=>({...Ht.createDefaultProps(),show:!0,allowPicking:!0,loadFuncStr:void 0,url:AS,stroked:!0,strokeStyle:wt({width:1,widthType:"world",color:[.79,.91,.06,1],material:"",materialParams:{},ground:!1}),filled:!0,fillStyle:wt({color:[.79,.91,.06,.2],material:"",materialParams:{},ground:!1}),imageShow:!0,imageStyle:wt({url:"${earthsdk3-assets-script-dir}/assets/img/location.png",size:[32,32],anchor:[.5,1],offset:[0,0]}),textShow:!0,textStyle:wt({textProperty:"",defaultText:"默认标注",color:[1,1,1,1],backgroundColor:void 0,fontFamily:"Arial",fontSize:16,fontStyle:"normal",fontWeight:"normal",anchor:[0,1],offset:[16,-8]}),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN",zIndex:0})),d(bt,"type",bt.register("ESGeoJson",bt,{chsName:"ESGeoJson",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"GeoJson数据加载"})),d(bt,"strokeStyleWidthTypes",[["screen","screen"],["world","world"]]),d(bt,"classificationTypes",[["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]]);let vl=bt;const Vo=class Vo extends It{constructor(t){super(t);d(this,"editingBindMode","doublePoints");d(this,"_height",this.disposeVar(j(0)));{const n=()=>{this.height=this.points&&this.points.length>=2?this.points[1][2]-this.points[0][2]:0};n(),this.ad(this.pointsChanged.don(n))}}get height(){return this._height.value}set height(t){this._height.value=t}get heightChanged(){return this._height.changed}};d(Vo,"createDefaultProps",()=>({...It.createDefaultProps(),stroked:!0,strokeStyle:wt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(Vo,"type",Vo.register("ESHeightMeasurement",Vo,{chsName:"高度测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"高度测量"})),d(Vo,"supportEditingModes",[...It.supportEditingModes,et.DoublePointsAppend,et.DoublePointsModify]);let If=Vo;const ru=class ru extends us{constructor(t){super(t);d(this,"_area",this.dv(j(0)));d(this,"_perimeter",this.dv(j(0)));d(this,"editingBindMode","doublePoints");const n=()=>{this._area.value=Math.PI*this.radius*this.radius,this._perimeter.value=2*Math.PI*this.radius};n(),this.d(this.radiusChanged.don(n))}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}toPolygon(t=10,n){return $v([...this.position],this.radius,t,n)[0].map(s=>[...s,this.position?this.position[2]:0])}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"style",basic:[...t.basic,new M([this,"radius"],"圆半径",1,!0)],coordinate:[...t.coordinate,new X([this,"editing"],"是否编辑"),new ia([this,"position"],"三维坐标",[0,0,0],!0),new M([this,"area"],"面积",0,!1,!0),new M([this,"perimeter"],"周长",0,!1,!0)]}}};d(ru,"createDefaultProps",()=>({...us.createDefaultProps(),radius:1,filled:!0,collision:!1,fillStyle:wt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),d(ru,"type",ru.register("ESLocalCircle",ru,{chsName:"局部坐标圆形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalCircle"}));let xf=ru;const iu=class iu extends us{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new Og([this,"points"],"坐标",[])]}}};d(iu,"createDefaultProps",()=>({...us.createDefaultProps(),points:Hd([]),filled:!0})),d(iu,"type",iu.register("ESLocalPolygon",iu,{chsName:"局部2D坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygon"}));let yl=iu;const su=class su extends Va{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new zh([this,"points"],"本地位置数组")]}}};d(su,"createDefaultProps",()=>({...Va.createDefaultProps(),points:Nl(void 0),filled:!0})),d(su,"type",su.register("ESLocalPolygonZ",su,{chsName:"局部坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygonZ"}));let Tf=su;const ou=class ou extends us{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new M([this,"width"],"宽度"),new M([this,"height"],"高度")]}}};d(ou,"createDefaultProps",()=>({...us.createDefaultProps(),width:5e5,height:3e5,filled:!0})),d(ou,"type",ou.register("ESLocalRectangle",ou,{chsName:"局部坐标四边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalRectangle"}));let Of=ou;const Fi=class Fi extends It{constructor(t){super(t);d(this,"editingBindMode","lineString");d(this,"_distance",this.dv(j(0)));d(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());const n=()=>{if(this.points&&this.points.length>=2){const i=fl(this.points,"GEODESIC"),s=i[i.length-1];this._distance.value=s}else this._distance.value=0};n(),this.d(this.pointsChanged.don(n))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new M([this,"height"],"高度",10),new M([this,"width"],"宽度",10),new Pt([this,"materialMode"],Fi.materialModes,"模式",Fi.defaults.materialMode)],coordinate:[...t.coordinate,new M([this,"distance"],"距离",0,!1,!0)]}}};d(Fi,"createDefaultProps",()=>({...It.createDefaultProps(),height:10,width:10,materialMode:"singleArrow",filled:!0,stroked:!0,fillStyle:wt({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),d(Fi,"type",Fi.register("ESPipeFence",Fi,{chsName:"管道电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"管道电子围栏"})),d(Fi,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","color"]]),d(Fi,"supportEditingModes",[...It.supportEditingModes,et.LineStringAppend,et.LineStringInsert]);let Hc=Fi;const hs=class hs extends Tr{constructor(t){super(t);d(this,"_setLayerVisibleEvent",this.dv(new O));d(this,"_setLayerColorEvent",this.dv(new O))}get setLayerVisibleEvent(){return this._setLayerVisibleEvent}setLayerVisible(t,n){this._setLayerVisibleEvent.emit(t,n)}get setLayerColorEvent(){return this._setLayerColorEvent}setLayerColor(t,n){this._setLayerColorEvent.emit(t,n)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"ESPipeserTileset"),new lt(["string","string"],(n,i)=>this.setLayerVisible(n,i),["",""],"setLayerVisible"),new lt(["string","string"],(n,i)=>this.setLayerColor(n,i),["",""],"setLayerColor"),new Pt([this,"colorMode"],hs.colorModes,"colorMode",hs.defaults.colorMode,!0)]}}};d(hs,"createDefaultProps",()=>({...Tr.createDefaultProps(),colorMode:"default"})),d(hs,"type",hs.register("ESPipeserTileset",hs,{chsName:"PipeSer图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"PipeSer图层"})),d(hs,"colorModes",[["default","default"],["color","color"],["blend","blend"]]);let Nf=hs;const ds=class ds extends It{constructor(t){super(t);d(this,"editingBindMode","circular")}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",coordinate:[...t.coordinate,new M([this,"area"],"面积",0,!1,!0),new M([this,"perimeter"],"周长",0,!1,!0)],basic:[...t.basic,new M([this,"height"],"高度",10),new Pt([this,"materialMode"],ds.materialModes,"模式","danger")]}}};d(ds,"createDefaultProps",()=>({...It.createDefaultProps(),height:10,materialMode:"danger",filled:!0,collision:!1})),d(ds,"type",ds.register("ESPolygonFence",ds,{chsName:"多边形电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"多边形电子围栏"})),d(ds,"materialModes",[["模式一","danger"],["模式二","checkerboard"],["模式三","warning"],["模式四","cord"],["模式五","scanline"],["模式六","honeycomb"],["模式七","gradientColor"]]),d(ds,"supportEditingModes",[...It.supportEditingModes,et.CircularAppend,et.CircularInsert,et.HeightModify]);let qc=ds;const Xs=class Xs extends It{constructor(t){super(t);d(this,"_deprecated",["ground"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());d(this,"editingBindMode","doublePoints")}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"通用","通用"),new X([this,"ground"],"是否贴地"),new X([this,"outlineTranslucent"],"轮廓线半透明"),new M([this,"height"],"高度"),new M([this,"extrudedHeight"],"拉伸高度"),new Ar([this,"rectangle"],"范围",Xs.defaults.rectangle,!0),new M([this,"stRotation"],"纹理旋转角度"),new M([this,"rotation"],"旋转角度"),new X([this,"pointEditing"],"是否单点编辑")]}}};d(Xs,"createDefaultProps",()=>({...It.createDefaultProps(),ground:!1,outlineTranslucent:!0,height:0,extrudedHeight:0,rectangle:re(void 0),rotation:0,stRotation:0,pointEditing:!1,filled:!0})),d(Xs,"type",Xs.register("ESRectangle",Xs,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),d(Xs,"supportEditingModes",[...It.supportEditingModes,et.DoublePointsAppend,et.DoublePointsModify]);let Df=Xs;const au=class au extends Xt{getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new it([this,"innerRings"],"裁切多边形数组",[],void 0,!0)]}}};d(au,"createDefaultProps",()=>({...Xt.createDefaultProps(),innerRings:bp([])})),d(au,"type",au.register("ESPolygonWithHole",au,{chsName:"内部裁切多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"带洞多边形"}));let Mf=au;const Ys=class Ys extends Xt{constructor(t){super(t);d(this,"_startEvent",this.disposeVar(new O));d(this,"_stopEvent",this.dv(new O));d(this,"_surfaceArea",this.disposeVar(j(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get surfaceArea(){return this._surfaceArea.value}set surfaceArea(t){this._surfaceArea.value=t}get surfaceChanged(){return this._surfaceArea.changed}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"表面积测量","表面积测量"),new lt([],()=>this.start(),[],"开始计算"),new M([this,"interpolation"],"插值距离",Ys.defaults.interpolation),new M([this,"offsetHeight"],"偏移高度",Ys.defaults.offsetHeight)]}}};d(Ys,"createDefaultProps",()=>({...Xt.createDefaultProps(),interpolation:.5,offsetHeight:0,units:dt(["SquareMeter_SquareKilometer","MU_Hectare"]),fillStyle:wt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),d(Ys,"type",Ys.register("ESSurfaceAreaMeasurement",Ys,{chsName:"表面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"表面积测量"}));let Rf=Ys;const Js=class Js extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new M([this,"downloadProgress"],"下载进度",Js.defaults.downloadProgress,!0,!0),new it([this,"importOptions"],"导入参数",Js.defaults.importOptions,void 0,!0)],dataSource:[...e.dataSource,new it([this,"url"],"路径")]}}};d(Js,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",importOptions:Qt({buildCollisions:"QueryAndPhysics",buildHierarchy:"Simplified",collisionType:"CTF_UseComplexAsSimple",bImportMetaData:!0}),downloadProgress:0})),d(Js,"type",Js.register("ESDatasmithRuntimeModel",Js,{chsName:"Datasmith Model",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Datasmith Model"}));let Lf=Js;const En=class En extends yl{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Pt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",En.defaults.waterType),new M([this,"frequency"],"频率",En.defaults.frequency),new Ue([this,"amplitude"],.01,[0,1],"振幅",En.defaults.amplitude),new Ue([this,"flowDirection"],1,[0,360],"流向",En.defaults.flowDirection),new Ue([this,"waveVelocity"],.01,[0,1],"波动频率",En.defaults.waveVelocity),new Ue([this,"specularIntensity"],.01,[0,1],"镜面反射强度",En.defaults.specularIntensity),new Ue([this,"murkiness"],.1,[0,10],"水体浑浊度",En.defaults.murkiness),new M([this,"flowSpeed"],"水流速度",En.defaults.flowSpeed),new Mt([this,"waterColor"],"水的底色",En.defaults.waterColor),new it([this,"waterImage"],"水的图片",En.defaults.waterImage)]}}};d(En,"createDefaultProps",()=>({...yl.createDefaultProps(),allowPicking:!0,waterImage:Qt(void 0),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5,stroked:!1,filled:!0})),d(En,"type",En.register("ESDynamicWater",En,{chsName:"动态水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"局部多边形水面"}));let Ff=En;const Cn=class Cn extends Xt{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new Pt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Cn.defaults.waterType),new M([this,"frequency"],"频率",Cn.defaults.frequency),new Ue([this,"amplitude"],.01,[0,1],"振幅",Cn.defaults.amplitude),new Ue([this,"flowDirection"],1,[0,360],"流向",Cn.defaults.flowDirection),new Ue([this,"waveVelocity"],.01,[0,1],"波动频率",Cn.defaults.waveVelocity),new Ue([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Cn.defaults.specularIntensity),new Ue([this,"murkiness"],.1,[0,10],"水体浑浊度",Cn.defaults.murkiness),new M([this,"flowSpeed"],"水流速度",Cn.defaults.flowSpeed),new Mt([this,"waterColor"],"水的底色",Cn.defaults.waterColor),new it([this,"waterImage"],"水的图片",Cn.defaults.waterImage)]}}};d(Cn,"createDefaultProps",()=>({...Xt.createDefaultProps(),allowPicking:!0,waterImage:Qt({}),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5})),d(Cn,"type",Cn.register("ESGeoWater",Cn,{chsName:"地理水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理动态水面"}));let Af=Cn;const jo=class jo extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new M([this,"downloadProgress"],"下载进度",jo.defaults.downloadProgress,!0,!0),new pt([this,"levelName"],"levelName",""),new M([this,"levelLoadDistance"],"levelLoadDistance",1e3),new cn([this,"levelOffset"],"levelOffset",[0,0,0])],dataSource:[...e.dataSource,new it([this,"url"],"url","")]}}};d(jo,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",downloadProgress:0,levelName:"",levelOffset:dt([0,0,0]),levelLoadDistance:1e3})),d(jo,"type",jo.register("ESLevelRuntimeModel",jo,{chsName:"关卡包模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"关卡包模型"}));let kf=jo;const ur=class ur extends Ni{constructor(t){super(t);d(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})())}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new M([this,"radius"],"半径",ur.defaults.radius),new M([this,"sides"],"圆边数",ur.defaults.sides),new M([this,"speed"],"材质速度",ur.defaults.speed),new Pt([this,"materialMode"],ur.materialModes,"材质模式",ur.defaults.materialMode),new it([this,"materialImage"],"材质图片和重复度",ur.defaults.materialImage)]}}};d(ur,"createDefaultProps",()=>({...Ni.createDefaultProps(),radius:10,sides:10,materialMode:"singleArrow",materialImage:wt({url:"",uDis:50,vDis:10}),speed:1,filled:!0,stroked:!1,fillStyle:wt({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),d(ur,"type",ur.register("ESPipeline",ur,{chsName:"管线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPipeline"})),d(ur,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"]]);let Vf=ur;const Ai=class Ai extends It{constructor(t){super(t);d(this,"editingBindMode","visibility")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Mt([this,"visibleColor"],"可视区域颜色",Ai.defaults.visibleColor),new Mt([this,"invisibleColor"],"遮挡区域颜色",Ai.defaults.invisibleColor),new M([this,"heightOffset"],"视点高度偏移",Ai.defaults.heightOffset)]}}};d(Ai,"createDefaultProps",()=>({...It.createDefaultProps(),visibleColor:dt([0,1,0,1]),invisibleColor:dt([1,0,0,1]),heightOffset:0})),d(Ai,"type",Ai.register("ESVisibilityAnalysis",Ai,{chsName:"通视分析,视线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通视分析,视线分析"})),d(Ai,"supportEditingModes",[...It.supportEditingModes,et.VisibilityAppend,et.VisibilityModify]);let jf=Ai;const uu=class uu extends Xt{constructor(t){super(t);d(this,"_startEvent",this.dv(new O));d(this,"_clearEvent",this.dv(new O));d(this,"_volume",this.disposeVar(j(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get volume(){return this._volume.value}set volume(t){this._volume.value=t}get volumeChanged(){return this._volume.changed}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"通用","通用"),new M([this,"planeHeight"],"基准面高程",void 0,!0),new M([this,"gridWidth"],"采样间距 m"),new M([this,"cutVolume"],"挖方",0,!1,!0),new M([this,"fillVolume"],"填方",0,!1,!0),new M([this,"cutAndFillVolume"],"挖填方",0,!1,!0),new M([this,"progress"],"计算进度",0,!1,!0),new lt([],()=>this.start(),[],"开始分析"),new lt([],()=>this.clear(),[],"清空分析结果"),new X([this,"depthTest"],"是否开启深度检测")]}}};d(uu,"createDefaultProps",()=>({...Xt.createDefaultProps(),planeHeight:j(void 0),gridWidth:1,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,filled:!1,stroked:!0,strokeStyle:wt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(uu,"type",uu.register("ESVolumeMeasurement",uu,{chsName:"体积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"体积测量"}));let Bf=uu;const lu=class lu extends Po{constructor(t){super(t);d(this,"_human",this.dv(new Po));d(this,"_poi",this.dv(new ml));this.d(this.components.disposableAdd(this._human,!0)),this.d(this.components.disposableAdd(this._poi));{const{_human:n,_poi:i}=this;this.d(B([n,"show"],[this,"show"])),this.d(B([i,"show"],[this,"show"])),this.d(B([n,"allowPicking"],[this,"allowPicking"])),this.d(B([i,"allowPicking"],[this,"allowPicking"])),this.d(nt([n,"scale"],[this,"scale"])),this.d(nt([i,"scale"],[this,"scale"])),this.d(B([n,"collision"],[this,"collision"])),this.d(B([i,"collision"],[this,"collision"])),this.d(nt([n,"flyInParam"],[this,"flyInParam"])),this.d(nt([n,"flyToParam"],[this,"flyToParam"])),this.d(B([n,"animation"],[this,"animation"])),this.d(B([n,"mode"],[this,"mode"])),this.d(B([n,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(B([n,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(B([i,"name"],[this,"name"])),this.d(B([i,"mode"],[this,"poiMode"])),this.d(B([i,"autoAnchor"],[this,"autoAnchor"])),this.d(B([i,"screenRender"],[this,"screenRender"])),this.d(B([i,"size"],[this,"size"])),this.d(B([i,"anchor"],[this,"anchor"])),this.d(B([i,"sizeByContent"],[this,"sizeByContent"])),this.d(B([i,"renderMode"],[this,"renderMode"])),this.d(B([i,"rotationType"],[this,"rotationType"])),this.d(B([i,"zOrder"],[this,"zOrder"])),this.d(B([i,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(B([i,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(nt([n,"position"],[this,"position"])),this.d(nt([n,"rotation"],[this,"rotation"])),this.d(this.flyInEvent.don(s=>{n.flyIn(s)})),this.d(this.flyToEvent.don(s=>{n.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()})),this.d(this.smoothMoveEvent.don((s,o)=>{n.smoothMove(s,o)})),this.d(this.smoothMoveWithRotationEvent.don((s,o,a)=>{n.smoothMoveWithRotation(s,o,a)})),this.d(this.smoothMoveOnGroundEvent.don((s,o,a,u)=>{n.smoothMoveOnGround(s,o,a,u)})),this.d(this.smoothMoveWithRotationOnGroundEvent.don((s,o,a,u,l)=>{n.smoothMoveWithRotationOnGround(s,o,a,u,l)})),this.d(this.automaticLandingEvent.don(()=>{n.automaticLanding()})),this.d(this._human.readyEvent.don(s=>{this.readyEvent.emit(s)}))}}get human(){return this._human}get poi(){return this._poi}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Pt([this,"poiMode"],ml.modes,"poi模式","SquareH01"),new M([this,"poiOffsetHeight"],"poi高度偏移",1.8)]}}};d(lu,"createDefaultProps",()=>({poiOffsetHeight:1.8,poiMode:"SquareH01",style:wt({}),autoAnchor:!0,screenRender:!0,size:dt([100,100]),anchor:dt([.5,1]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,...Po.createDefaultProps()})),d(lu,"type",lu.register("ESHumanPoi",lu,{chsName:"人员poi",tags:["ESObjects"],description:"ESHuman + ESPoi2D组合对象"}));let zf=lu;const hi=class hi extends Xt{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new M([this,"depth"],"深度",hi.defaults.depth),new M([this,"interpolation"],"插值",hi.defaults.interpolation),new M([this,"opacity"],"透明度",hi.defaults.opacity),new it([this,"sideImage"],"侧面图片",hi.defaults.sideImage),new it([this,"bottomImage"],"底面图片",hi.defaults.bottomImage)]}}};d(hi,"createDefaultProps",()=>({...Xt.createDefaultProps(),depth:100,sideImage:wt({url:rt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/side.jpg"),uDis:50,vDis:50}),bottomImage:wt({url:rt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/bottom.jpg"),uDis:50,vDis:50}),opacity:1,interpolation:50,collision:!1,allowPicking:!1,filled:!0})),d(hi,"type",hi.register("ESPit",hi,{chsName:"坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"坑"}));let Ba=hi;const cu=class cu extends Ba{constructor(t){super(t);d(this,"_excavate",this.dv(new gl));d(this,"_pit",this.dv(new Ba));this.d(this.components.disposableAdd(this._excavate)),this.d(this.components.disposableAdd(this._pit,!0));{const{_excavate:n,_pit:i}=this;this.d(B([n,"show"],[this,"show"])),this.d(B([i,"show"],[this,"show"])),this.d(B([n,"allowPicking"],[this,"allowPicking"])),this.d(B([i,"allowPicking"],[this,"allowPicking"])),this.d(B([n,"collision"],[this,"collision"])),this.d(B([i,"collision"],[this,"collision"])),this.d(nt([i,"points"],[this,"points"])),this.d(B([n,"points"],[this,"points"])),this.d(B([i,"pointed"],[this,"pointed"])),this.d(B([n,"pointed"],[this,"pointed"])),this.d(B([i,"pointStyle"],[this,"pointStyle"])),this.d(B([n,"pointStyle"],[this,"pointStyle"])),this.d(B([i,"stroked"],[this,"stroked"])),this.d(B([n,"stroked"],[this,"stroked"])),this.d(B([i,"strokeStyle"],[this,"strokeStyle"])),this.d(B([n,"strokeStyle"],[this,"strokeStyle"])),this.d(B([i,"filled"],[this,"filled"])),this.d(B([i,"fillStyle"],[this,"fillStyle"])),this.d(B([n,"fillStyle"],[this,"fillStyle"])),this.d(B([n,"mode"],[this,"mode"])),this.d(B([n,"targetID"],[this,"targetID"])),this.d(B([i,"depth"],[this,"depth"])),this.d(B([i,"sideImage"],[this,"sideImage"])),this.d(B([i,"bottomImage"],[this,"bottomImage"])),this.d(B([i,"opacity"],[this,"opacity"])),this.d(B([i,"interpolation"],[this,"interpolation"])),this.d(nt([i,"flyInParam"],[this,"flyInParam"])),this.d(nt([i,"flyToParam"],[this,"flyToParam"])),this.d(this.flyInEvent.don(s=>{i.flyIn(s)})),this.d(this.flyToEvent.don(s=>{i.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}}get excavate(){return this._excavate}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Pt([this,"mode"],gl.modes,"模式","in"),new pt([this,"targetID"],"瓦片图层","")]}}};d(cu,"createDefaultProps",()=>({...Ba.createDefaultProps(),mode:"in",targetID:""})),d(cu,"type",cu.register("ESHole",cu,{chsName:"挖坑(带材质+深度)",tags:["ESObjects"],description:"挖坑"}));let Uf=cu;const Gf={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},kS=async(r,e,t,n)=>{try{const i=globalThis.localStorage.getItem("Authorization");let s=r+`${Gf.layerconfigfind}?tileServiceName=${e}`;t&&(s+=`&earthdstoken=${encodeURIComponent(n)}`);const o={headers:{...!t&&i?{Authorization:i}:{}},mode:"cors"},u=await(await fetch(s,o)).text();return JSON.parse(u)}catch(i){console.error(i)}},VS=async(r,e,t,n,i)=>{try{const s=globalThis.localStorage.getItem("Authorization");let o=r+Gf.layerconfigsave;const a=i??{};t&&(o+=`?earthdstoken=${encodeURIComponent(n)}`);const u={method:"POST",headers:{"Content-Type":"application/json",...!t&&s?{Authorization:s}:{}},mode:"cors",body:JSON.stringify({tileServiceName:e,layerConfig:JSON.stringify(a)})},c=await(await fetch(o,u)).text();return JSON.parse(c)}catch(s){console.error(s)}},jS=async(r,e,t)=>{try{const n=globalThis.localStorage.getItem("Authorization");let i=r;e&&(i+=`?earthdstoken=${encodeURIComponent(t)}`);const s={headers:{...!e&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(i,s)).text(),u=JSON.parse(a);if(u.status=="ok")return u.data.port;console.error(u.status);return}catch(n){console.error(n)}},BS=async(r,e,t,n,i)=>{try{const s={tileServiceName:e,featureId:t},o=globalThis.localStorage.getItem("Authorization");let a=r+Gf.featureproperty;n&&(a+=`?earthdstoken=${encodeURIComponent(i)}`);const l=await(await fetch(a,{method:"post",headers:{"Content-Type":"application/json",...!n&&o?{Authorization:o}:{}},body:JSON.stringify(s),mode:"cors"})).text(),c=JSON.parse(l);if(c.status=="ok")return c.data;console.error(c.data.status);return}catch(s){console.error(s)}},hu=class hu extends Tr{constructor(t){super(t);d(this,"_es3DTileset",this.dv(new Tr));d(this,"_ids",this.dv(wt([])));d(this,"_useEarthDSToken",this.dv(j(!1)));d(this,"_earthdstoken",this.dv(j("")));d(this,"_visJson",this.disposeVar(j({})));d(this,"_highlightInner3DtilesetEvent",this.dv(new O));d(this,"_removeHighlightInner3DtilesetEvent",this.dv(new O));d(this,"_tilesetServePort",this.dv(j("")));{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ts01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(B([n,"allowPicking"],[this,"allowPicking"])),this.d(B([n,"collision"],[this,"collision"])),this.d(nt([n,"flyToParam"],[this,"flyToParam"])),this.d(nt([n,"flyToParam"],[this,"flyToParam"])),this.d(B([n,"actorTag"],[this,"actorTag"])),this.d(B([n,"materialMode"],[this,"materialMode"])),this.d(B([n,"highlight"],[this,"highlight"])),this.d(B([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(B([n,"highlightID"],[this,"highlightID"])),this.d(B([n,"highlightColor"],[this,"highlightColor"])),this.d(nt([n,"offset"],[this,"offset"])),this.d(nt([n,"rotation"],[this,"rotation"])),this.d(B([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(B([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(B([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(B([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(B([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(B([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(B([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(B([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(B([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(B([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(B([n,"cacheBytes"],[this,"cacheBytes"])),this.d(B([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(B([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(B([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(B([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(B([n,"materialParams"],[this,"materialParams"])),this.d(nt([n,"supportEdit"],[this,"supportEdit"])),this.d(nt([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(nt([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(nt([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(nt([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(nt([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(nt([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{n.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{n.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{n.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{n.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{n.resetFeatureStyle(...i)})),this.d(this.setFeatureStyleEvent.don((...i)=>{n.setFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{n.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{n.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{n.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{n.calcFlyInParam(...i)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(n.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(t){this._ids.value=t}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(t){this._useEarthDSToken.value=t}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(t){this._earthdstoken.value=t}get visJson(){return this._visJson.value}set visJson(t){this._visJson.value=t}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(t,n){var i;if((i=this.layerConfig)!=null&&i.length){const s={};s[n[0].value]=n[0].visable,this.visJson={...this.visJson,...s}}else this.setFeatureVisableEvent.emit(t,typeof n=="string"?JSON.parse(n):n)}async getFeatureProperty(t){return await BS(this.baseUrl,this.tileServiceName,t,this.useEarthDSToken,this.earthdstoken)}async getLayerConfig(){const t=await kS(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken);return!t||!Array.isArray(t)?this.layerConfig=[]:this.layerConfig=t,this.layerConfig}async saveLayerConfig(){const t=this.layerConfig;return await VS(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,t)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(t){this._highlightInner3DtilesetEvent.emit(t)}async highlightDSFeature(t){this._highlightInner3Dtileset(t)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(t){this._removeHighlightInner3DtilesetEvent.emit(t)}async removeHighlightDSFeature(t){this._removeHighlightInner3Dtileset(t)}async pickFeature(t,n){var a,u,l;const i=await t.pick(n),s=i.sceneObject;return!s||s.id!==this.id&&s.typeName!="ESRtsFeatureEditing"?void 0:s.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(a=i==null?void 0:i.tilesetPickInfo)==null?void 0:a.id],{featureId:(u=i==null?void 0:i.tilesetPickInfo)==null?void 0:u.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}):{featureId:(l=i==null?void 0:i.sceneObject)==null?void 0:l.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(t){this._tilesetServePort.value=t}async getport(){const t=await jS(this.url,this.useEarthDSToken,this.earthdstoken);if(t)return this.tilesetServePort=t,t;throw new Error("服务地址port获取失败!")}async refresh(){var n;if(!this.url||typeof this.url!="string")return;const t=+new Date;if(this.isSameIP){const i=(n=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:n[0];this._es3DTileset.url=`${i}/ts/tiles/${this.tileServiceName}/tileset.json?t=${t}`}else{const i=this.tileServiceIp,s=await this.getport();await this.getLayerConfig(),this._es3DTileset.url=`${i}:${s}/tiles/tileset.json?t=${t}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01")}get tileServiceName(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:t[1];if(!n)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return n}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new it([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};d(hu,"createDefaultProps",()=>({...Tr.createDefaultProps(),layerConfig:Qt([]),isSameIP:!1})),d(hu,"type",hu.register("ESRtsTileset",hu,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Wf=hu;function zS(r){return typeof r=="number"&&!isNaN(r)}const du=class du extends Tr{get json(){return{...this._innerGetJson(),show:this.show,materials:this.materials,changeMaterial:this.changeMaterial,props:this.props,rotation:this.rotation,offset:this.offset}}set json(e){this._innerSetJson(e)}async init(e,t){var i;this.featureId=t;const n=await e.getFeatureProperty(t);if(this.uiShowprops=n.allFields.map(s=>({featureClassName:s.featureClassName,fields:s.fields.map(o=>({key:o.name,type:o.type,value:o.type!="Double"?o.value:zS(o.value)?Number(o.value.toFixed(3)):""}))})),this.datasetName=n.datasetName,e.setFeatureVisable("id",[{value:this.featureId,visable:!1}]),this.d(()=>{e.setFeatureVisable("id",[{value:this.featureId,visable:!0}])}),e.isSameIP){const s=(i=e.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:i[0],o=e.tileServiceName;this.url=`${s}/ts/featuretiles/${o}/${this.featureId}/tileset.json`}else{const s=e.tileServiceIp,o=e.tilesetServePort;if(!o)throw new Error("ESRtsFeatureEditing2: port is not defined");this.url=`${s}:${o}/featuretiles/${this.featureId}/tileset.json`}this.allowPicking=!0,this.d(this.pickedEvent.don(s=>{s.assign({sceneObject:e}),e.pickedEvent.emit(s)})),this.d(()=>{this.editing=!1,e.removeHighlightDSFeature(this)})}constructor(e){super(e)}};d(du,"createDefaultProps",()=>({...Tr.createDefaultProps(),datasetName:void 0,featureId:void 0,materials:wt({}),changeMaterial:Qt(void 0),uiShowprops:wt({}),props:wt({})})),d(du,"type",du.register("ESRtsFeatureEditing",du,{chsName:"ESRtsFeatureEditing",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Hf=du;const US=async(r,e,t)=>{try{const n=globalThis.localStorage.getItem("Authorization");let i=r;e&&(i+=`?earthdstoken=${encodeURIComponent(t)}`);const s={headers:{...!e&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(i,s)).text(),u=JSON.parse(a);if(u.status=="ok")return u.data.port;console.error(u.status);return}catch(n){console.error(n)}},Il=class Il extends Tr{constructor(t){super(t);d(this,"_es3DTileset",this.dv(new Tr));d(this,"_tilesetServePort",this.dv(j("")));d(this,"_useEarthDSToken",this.dv(j(!1)));d(this,"_earthdstoken",this.dv(j("")));{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ms01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(B([n,"allowPicking"],[this,"allowPicking"])),this.d(B([n,"collision"],[this,"collision"])),this.d(nt([n,"flyToParam"],[this,"flyToParam"])),this.d(nt([n,"flyToParam"],[this,"flyToParam"])),this.d(B([n,"actorTag"],[this,"actorTag"])),this.d(B([n,"materialMode"],[this,"materialMode"])),this.d(B([n,"highlight"],[this,"highlight"])),this.d(B([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(B([n,"highlightID"],[this,"highlightID"])),this.d(B([n,"highlightColor"],[this,"highlightColor"])),this.d(nt([n,"offset"],[this,"offset"])),this.d(nt([n,"rotation"],[this,"rotation"])),this.d(B([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(B([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(B([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(B([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(B([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(B([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(B([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(B([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(B([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(B([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(B([n,"cacheBytes"],[this,"cacheBytes"])),this.d(B([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(B([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(B([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(B([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(B([n,"materialParams"],[this,"materialParams"])),this.d(nt([n,"supportEdit"],[this,"supportEdit"])),this.d(nt([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(nt([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(nt([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(nt([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(nt([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(nt([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{n.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{n.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{n.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{n.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{n.resetFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{n.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{n.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{n.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{n.calcFlyInParam(...i)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(n.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(t){this._tilesetServePort.value=t}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(t){this._useEarthDSToken.value=t}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(t){this._earthdstoken.value=t}async getport(){const t=await US(this.url,this.useEarthDSToken,this.earthdstoken);if(t)return this.tilesetServePort=t,t;throw new Error("服务地址port获取失败!")}async refresh(){var i;if(!this.url||typeof this.url!="string")return;const t=(i=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:i[1],n=+new Date;if(t){const s=this.tileServiceIp,o=await this.getport();this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${n}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceName(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:t[1];if(!n)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return n}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}};d(Il,"type",Il.register("ESMsTileset",Il,{chsName:"Modelser实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let qf=Il;const Ey={defaultValue:[{type:"2",widget:"WidgetBlueprint'/ESFoliage/PoiSheng.PoiSheng'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"3",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"4",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"5",widget:"WidgetBlueprint'/ESFoliage/PoiXiang.PoiXiang'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"6",widget:"WidgetBlueprint'/ESFoliage/PoiCun.PoiCun'",povit:[.5,1],worldScale:.1,hiddenDistance:40}],sampleValue:`
354
+ `,AS="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",bt=class bt extends Ht{constructor(t){super(t);d(this,"_flyToFeatureEvent",this.dv(new O));d(this,"_flyToFeatureIndexEvent",this.dv(new O));d(this,"_features",this.disposeVar(Qt(void 0)));d(this,"pickedInfoType","FeatureCollection");d(this,"abortController");this._updateUrl(),this.ad(this.urlChanged.don(()=>{this._updateUrl()})),this.ad(this.editingChanged.don(()=>{console.warn("ESGeoJson暂不支持编辑!")}))}get flyToFeatureEvent(){return this._flyToFeatureEvent}flyToFeature(t,n,i){this._flyToFeatureEvent.emit(t,n,i)}get flyToFeatureIndexEvent(){return this._flyToFeatureIndexEvent}flyToFeatureIndex(t,n){this._flyToFeatureIndexEvent.emit(t,n)}get features(){return this._features.value}set features(t){this._features.value=t}get featuresChanged(){return this._features.changed}getFeatures(){if(this.features)return this.features;console.log("数据未加载完成,请稍后调用此方法getFeatures()")}async _updateUrl(){var n;this.abortController&&this.abortController.abort(),this.abortController=new AbortController;const t=this.abortController.signal;if(!this.url){this.features=void 0;return}typeof this.url=="object"?this.features=this.url:Wh(this.url)?this.features=JSON.parse(this.url):await fetch(rt.context.getStrFromEnv(this.url),{signal:t}).then(i=>i.json()).then(i=>{this.features=i}).catch(i=>{i.name!="AbortError"&&console.warn("ESGeoJson数据加载失败",i)}),this.pickedInfoType=((n=this.features)==null?void 0:n.type)??"FeatureCollection"}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"style",dataSource:[...t.dataSource,new it([this,"url"],"服务地址",bt.defaults.url),new M([this,"minFeatureVisibleDistance"],"要素最小可视距离",bt.defaults.minFeatureVisibleDistance),new M([this,"maxFeatureVisibleDistance"],"要素最大可视距离",bt.defaults.maxFeatureVisibleDistance),new Pt([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new Pt([this,"classificationType"],bt.classificationTypes,"贴地附着目标",bt.defaults.classificationType),new M([this,"zIndex"],"层级排序",bt.defaults.zIndex)],style:[...t.style,new ut([],"点样式集合"),new X([this,"textShow"],"是否显示",bt.defaults.textShow),new Ae([this,"textAnchor"],"锚点",bt.defaults.anchor),new pt([this,"textProperty"],"标注显示属性",bt.defaults.textStyle.textProperty),new pt([this,"textDefaultText"],"默认文本",bt.defaults.textStyle.defaultText),new Mt([this,"textColor"],"文本颜色",bt.defaults.textStyle.color),new Mt([this,"textBackgroundColor"],"文本背景颜色",bt.defaults.textStyle.backgroundColor),new pt([this,"textFontStyle"],"字体样式",bt.defaults.textStyle.fontStyle),new pt([this,"textFontWeight"],"字体粗细",bt.defaults.textStyle.fontWeight),new M([this,"textFontSize"],"字体大小",bt.defaults.textStyle.fontSize),new Ae([this,"textOffset"],"像素偏移",bt.defaults.textStyle.offset),new ut([],"点图片样式集合"),new X([this,"imageShow"],"是否显示",bt.defaults.imageShow),new Ae([this,"imageAnchor"],"锚点",bt.defaults.imageStyle.anchor),new it([this,"imageUrl"],"图片地址",bt.defaults.imageStyle.url),new Ae([this,"imageSize"],"图片大小",bt.defaults.imageStyle.size),new Ae([this,"imageOffset"],"像素偏移",bt.defaults.imageStyle.offset),new ut([],"线样式集合"),new X([this,"stroked"],"是否显示",bt.defaults.stroked),new X([this,"strokeGround"],"贴地",bt.defaults.strokeStyle.ground),new M([this,"strokeWidth"],"线宽",bt.defaults.strokeStyle.width),new Pt([this,"strokeWidthType"],bt.strokeStyleWidthTypes,"线宽类型"),new Mt([this,"strokeColor"],"线颜色",bt.defaults.strokeStyle.color),new pt([this,"strokeMaterial"],"线材质",bt.defaults.strokeStyle.material),new it([this,"strokeMaterialParams"],"线材质参数",bt.defaults.strokeStyle.materialParams),new ut([],"面样式集合"),new X([this,"filled"],"是否显示",bt.defaults.filled),new X([this,"fillGround"],"贴地",bt.defaults.fillStyle.ground),new Mt([this,"fillColor"],"填充颜色",bt.defaults.fillStyle.color),new pt([this,"fillMaterial"],"填充材质",bt.defaults.fillStyle.material),new it([this,"fillMaterialParams"],"填充材质参数",bt.defaults.fillStyle.materialParams)],more:[...t.more,new ut([],"标注文本样式"),new pt([this,"textFontFamily"],"字体",bt.defaults.textStyle.fontFamily),new M([this,"zOrder"],"点排序优先级",bt.defaults.zOrder),new ut([],"通用"),new Es([this,"loadFuncStr"],"loadFnStr",Ey,FS,!0)]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}get textProperty(){return this.textStyle.textProperty}set textProperty(t){this.textStyle={...this.textStyle,textProperty:t}}get textPropertyChanged(){return this.textStyleChanged}get textDefaultText(){return this.textStyle.defaultText}set textDefaultText(t){this.textStyle={...this.textStyle,defaultText:t}}get textDefaultTextChanged(){return this.textStyleChanged}get textColor(){return this.textStyle.color}set textColor(t){this.textStyle={...this.textStyle,color:t}}get textColorChanged(){return this.textStyleChanged}get textBackgroundColor(){return this.textStyle.backgroundColor}set textBackgroundColor(t){this.textStyle={...this.textStyle,backgroundColor:t}}get textBackgroundColorChanged(){return this.textStyleChanged}get textFontFamily(){return this.textStyle.fontFamily}set textFontFamily(t){this.textStyle={...this.textStyle,fontFamily:t}}get textFontFamilyChanged(){return this.textStyleChanged}get textFontStyle(){return this.textStyle.fontStyle}set textFontStyle(t){this.textStyle={...this.textStyle,fontStyle:t}}get textFontStyleChanged(){return this.textStyleChanged}get textFontWeight(){return this.textStyle.fontWeight}set textFontWeight(t){this.textStyle={...this.textStyle,fontWeight:t}}get textFontWeightChanged(){return this.textStyleChanged}get textFontSize(){return this.textStyle.fontSize}set textFontSize(t){this.textStyle={...this.textStyle,fontSize:t}}get textFontSizeChanged(){return this.textStyleChanged}get textAnchor(){return this.textStyle.anchor}set textAnchor(t){this.textStyle={...this.textStyle,anchor:t}}get textAnchorChanged(){return this.textStyleChanged}get textOffset(){return this.textStyle.offset}set textOffset(t){this.textStyle={...this.textStyle,offset:t}}get textOffsetChanged(){return this.textStyleChanged}get imageUrl(){return this.imageStyle.url}set imageUrl(t){this.imageStyle={...this.imageStyle,url:t}}get imageUrlChanged(){return this.imageStyleChanged}get imageSize(){return this.imageStyle.size}set imageSize(t){this.imageStyle={...this.imageStyle,size:t}}get imageSizeChanged(){return this.imageStyleChanged}get imageAnchor(){return this.imageStyle.anchor}set imageAnchor(t){this.imageStyle={...this.imageStyle,anchor:t}}get imageAnchorChanged(){return this.imageStyleChanged}get imageOffset(){return this.imageStyle.offset}set imageOffset(t){this.imageStyle={...this.imageStyle,offset:t}}get imageOffsetChanged(){return this.imageStyleChanged}};d(bt,"createDefaultProps",()=>({...Ht.createDefaultProps(),show:!0,allowPicking:!0,loadFuncStr:void 0,url:AS,stroked:!0,strokeStyle:wt({width:1,widthType:"world",color:[.79,.91,.06,1],material:"",materialParams:{},ground:!1}),filled:!0,fillStyle:wt({color:[.79,.91,.06,.2],material:"",materialParams:{},ground:!1}),imageShow:!0,imageStyle:wt({url:"${earthsdk3-assets-script-dir}/assets/img/location.png",size:[32,32],anchor:[.5,1],offset:[0,0]}),textShow:!0,textStyle:wt({textProperty:"",defaultText:"默认标注",color:[1,1,1,1],backgroundColor:void 0,fontFamily:"Arial",fontSize:16,fontStyle:"normal",fontWeight:"normal",anchor:[0,1],offset:[16,-8]}),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN",zIndex:0})),d(bt,"type",bt.register("ESGeoJson",bt,{chsName:"ESGeoJson",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"GeoJson数据加载"})),d(bt,"strokeStyleWidthTypes",[["screen","screen"],["world","world"]]),d(bt,"classificationTypes",[["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]]);let vl=bt;const Vo=class Vo extends It{constructor(t){super(t);d(this,"editingBindMode","doublePoints");d(this,"_height",this.disposeVar(j(0)));{const n=()=>{this.height=this.points&&this.points.length>=2?this.points[1][2]-this.points[0][2]:0};n(),this.ad(this.pointsChanged.don(n))}}get height(){return this._height.value}set height(t){this._height.value=t}get heightChanged(){return this._height.changed}};d(Vo,"createDefaultProps",()=>({...It.createDefaultProps(),stroked:!0,strokeStyle:wt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(Vo,"type",Vo.register("ESHeightMeasurement",Vo,{chsName:"高度测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"高度测量"})),d(Vo,"supportEditingModes",[...It.supportEditingModes,et.DoublePointsAppend,et.DoublePointsModify]);let If=Vo;const ru=class ru extends us{constructor(t){super(t);d(this,"_area",this.dv(j(0)));d(this,"_perimeter",this.dv(j(0)));d(this,"editingBindMode","doublePoints");const n=()=>{this._area.value=Math.PI*this.radius*this.radius,this._perimeter.value=2*Math.PI*this.radius};n(),this.d(this.radiusChanged.don(n))}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}toPolygon(t=10,n){return $v([...this.position],this.radius,t,n)[0].map(s=>[...s,this.position?this.position[2]:0])}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"style",basic:[...t.basic,new M([this,"radius"],"圆半径",1,!0)],coordinate:[...t.coordinate,new X([this,"editing"],"是否编辑"),new ia([this,"position"],"三维坐标",[0,0,0],!0),new M([this,"area"],"面积",0,!1,!0),new M([this,"perimeter"],"周长",0,!1,!0)]}}};d(ru,"createDefaultProps",()=>({...us.createDefaultProps(),radius:1,filled:!0,collision:!1,fillStyle:wt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),d(ru,"type",ru.register("ESLocalCircle",ru,{chsName:"局部坐标圆形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalCircle"}));let xf=ru;const iu=class iu extends us{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new Og([this,"points"],"坐标",[])]}}};d(iu,"createDefaultProps",()=>({...us.createDefaultProps(),points:Hd([]),filled:!0})),d(iu,"type",iu.register("ESLocalPolygon",iu,{chsName:"局部2D坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygon"}));let yl=iu;const su=class su extends Va{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new zh([this,"points"],"本地位置数组")]}}};d(su,"createDefaultProps",()=>({...Va.createDefaultProps(),points:Nl(void 0),filled:!0})),d(su,"type",su.register("ESLocalPolygonZ",su,{chsName:"局部坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygonZ"}));let Tf=su;const ou=class ou extends us{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new M([this,"width"],"宽度"),new M([this,"height"],"高度")]}}};d(ou,"createDefaultProps",()=>({...us.createDefaultProps(),width:5e5,height:3e5,filled:!0})),d(ou,"type",ou.register("ESLocalRectangle",ou,{chsName:"局部坐标四边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalRectangle"}));let Of=ou;const Fi=class Fi extends It{constructor(t){super(t);d(this,"editingBindMode","lineString");d(this,"_distance",this.dv(j(0)));d(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());const n=()=>{if(this.points&&this.points.length>=2){const i=fl(this.points,"GEODESIC"),s=i[i.length-1];this._distance.value=s}else this._distance.value=0};n(),this.d(this.pointsChanged.don(n))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new M([this,"height"],"高度",10),new M([this,"width"],"宽度",10),new Pt([this,"materialMode"],Fi.materialModes,"模式",Fi.defaults.materialMode)],coordinate:[...t.coordinate,new M([this,"distance"],"距离",0,!1,!0)]}}};d(Fi,"createDefaultProps",()=>({...It.createDefaultProps(),height:10,width:10,materialMode:"singleArrow",filled:!0,stroked:!0,fillStyle:wt({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),d(Fi,"type",Fi.register("ESPipeFence",Fi,{chsName:"管道电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"管道电子围栏"})),d(Fi,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","color"]]),d(Fi,"supportEditingModes",[...It.supportEditingModes,et.LineStringAppend,et.LineStringInsert]);let Hc=Fi;const hs=class hs extends Tr{constructor(t){super(t);d(this,"_setLayerVisibleEvent",this.dv(new O));d(this,"_setLayerColorEvent",this.dv(new O))}get setLayerVisibleEvent(){return this._setLayerVisibleEvent}setLayerVisible(t,n){this._setLayerVisibleEvent.emit(t,n)}get setLayerColorEvent(){return this._setLayerColorEvent}setLayerColor(t,n){this._setLayerColorEvent.emit(t,n)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"ESPipeserTileset"),new lt(["string","string"],(n,i)=>this.setLayerVisible(n,i),["",""],"setLayerVisible"),new lt(["string","string"],(n,i)=>this.setLayerColor(n,i),["",""],"setLayerColor"),new Pt([this,"colorMode"],hs.colorModes,"colorMode",hs.defaults.colorMode,!0)]}}};d(hs,"createDefaultProps",()=>({...Tr.createDefaultProps(),colorMode:"default"})),d(hs,"type",hs.register("ESPipeserTileset",hs,{chsName:"PipeSer图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"PipeSer图层"})),d(hs,"colorModes",[["default","default"],["color","color"],["blend","blend"]]);let Nf=hs;const ds=class ds extends It{constructor(t){super(t);d(this,"editingBindMode","circular")}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",coordinate:[...t.coordinate,new M([this,"area"],"面积",0,!1,!0),new M([this,"perimeter"],"周长",0,!1,!0)],basic:[...t.basic,new M([this,"height"],"高度",10),new Pt([this,"materialMode"],ds.materialModes,"模式","danger")]}}};d(ds,"createDefaultProps",()=>({...It.createDefaultProps(),height:10,materialMode:"danger",filled:!0,collision:!1})),d(ds,"type",ds.register("ESPolygonFence",ds,{chsName:"多边形电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"多边形电子围栏"})),d(ds,"materialModes",[["模式一","danger"],["模式二","checkerboard"],["模式三","warning"],["模式四","cord"],["模式五","scanline"],["模式六","honeycomb"],["模式七","gradientColor"]]),d(ds,"supportEditingModes",[...It.supportEditingModes,et.CircularAppend,et.CircularInsert,et.HeightModify]);let qc=ds;const Xs=class Xs extends It{constructor(t){super(t);d(this,"_deprecated",["ground"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());d(this,"editingBindMode","doublePoints")}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"通用","通用"),new X([this,"ground"],"是否贴地"),new X([this,"outlineTranslucent"],"轮廓线半透明"),new M([this,"height"],"高度"),new M([this,"extrudedHeight"],"拉伸高度"),new Ar([this,"rectangle"],"范围",Xs.defaults.rectangle,!0),new M([this,"stRotation"],"纹理旋转角度"),new M([this,"rotation"],"旋转角度"),new X([this,"pointEditing"],"是否单点编辑")]}}};d(Xs,"createDefaultProps",()=>({...It.createDefaultProps(),ground:!1,outlineTranslucent:!0,height:0,extrudedHeight:0,rectangle:re(void 0),rotation:0,stRotation:0,pointEditing:!1,filled:!0})),d(Xs,"type",Xs.register("ESRectangle",Xs,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),d(Xs,"supportEditingModes",[...It.supportEditingModes,et.DoublePointsAppend,et.DoublePointsModify]);let Df=Xs;const au=class au extends Xt{getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new it([this,"innerRings"],"裁切多边形数组",[],void 0,!0)]}}};d(au,"createDefaultProps",()=>({...Xt.createDefaultProps(),innerRings:bp([])})),d(au,"type",au.register("ESPolygonWithHole",au,{chsName:"内部裁切多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"带洞多边形"}));let Mf=au;const Ys=class Ys extends Xt{constructor(t){super(t);d(this,"_startEvent",this.disposeVar(new O));d(this,"_stopEvent",this.dv(new O));d(this,"_surfaceArea",this.disposeVar(j(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get surfaceArea(){return this._surfaceArea.value}set surfaceArea(t){this._surfaceArea.value=t}get surfaceChanged(){return this._surfaceArea.changed}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"表面积测量","表面积测量"),new lt([],()=>this.start(),[],"开始计算"),new M([this,"interpolation"],"插值距离",Ys.defaults.interpolation),new M([this,"offsetHeight"],"偏移高度",Ys.defaults.offsetHeight)]}}};d(Ys,"createDefaultProps",()=>({...Xt.createDefaultProps(),interpolation:.5,offsetHeight:0,units:dt(["SquareMeter_SquareKilometer","MU_Hectare"]),fillStyle:wt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),d(Ys,"type",Ys.register("ESSurfaceAreaMeasurement",Ys,{chsName:"表面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"表面积测量"}));let Rf=Ys;const Js=class Js extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new M([this,"downloadProgress"],"下载进度",Js.defaults.downloadProgress,!0,!0),new it([this,"importOptions"],"导入参数",Js.defaults.importOptions,void 0,!0)],dataSource:[...e.dataSource,new it([this,"url"],"路径")]}}};d(Js,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",importOptions:Qt({buildCollisions:"QueryAndPhysics",buildHierarchy:"Simplified",collisionType:"CTF_UseComplexAsSimple",bImportMetaData:!0}),downloadProgress:0})),d(Js,"type",Js.register("ESDatasmithRuntimeModel",Js,{chsName:"Datasmith Model",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Datasmith Model"}));let Lf=Js;const En=class En extends yl{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Pt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",En.defaults.waterType),new M([this,"frequency"],"频率",En.defaults.frequency),new Ue([this,"amplitude"],.01,[0,1],"振幅",En.defaults.amplitude),new Ue([this,"flowDirection"],1,[0,360],"流向",En.defaults.flowDirection),new Ue([this,"waveVelocity"],.01,[0,1],"波动频率",En.defaults.waveVelocity),new Ue([this,"specularIntensity"],.01,[0,1],"镜面反射强度",En.defaults.specularIntensity),new Ue([this,"murkiness"],.1,[0,10],"水体浑浊度",En.defaults.murkiness),new M([this,"flowSpeed"],"水流速度",En.defaults.flowSpeed),new Mt([this,"waterColor"],"水的底色",En.defaults.waterColor),new it([this,"waterImage"],"水的图片",En.defaults.waterImage)]}}};d(En,"createDefaultProps",()=>({...yl.createDefaultProps(),allowPicking:!0,waterImage:Qt(void 0),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5,stroked:!1,filled:!0})),d(En,"type",En.register("ESDynamicWater",En,{chsName:"动态水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"局部多边形水面"}));let Ff=En;const Cn=class Cn extends Xt{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new Pt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Cn.defaults.waterType),new M([this,"frequency"],"频率",Cn.defaults.frequency),new Ue([this,"amplitude"],.01,[0,1],"振幅",Cn.defaults.amplitude),new Ue([this,"flowDirection"],1,[0,360],"流向",Cn.defaults.flowDirection),new Ue([this,"waveVelocity"],.01,[0,1],"波动频率",Cn.defaults.waveVelocity),new Ue([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Cn.defaults.specularIntensity),new Ue([this,"murkiness"],.1,[0,10],"水体浑浊度",Cn.defaults.murkiness),new M([this,"flowSpeed"],"水流速度",Cn.defaults.flowSpeed),new Mt([this,"waterColor"],"水的底色",Cn.defaults.waterColor),new it([this,"waterImage"],"水的图片",Cn.defaults.waterImage)]}}};d(Cn,"createDefaultProps",()=>({...Xt.createDefaultProps(),allowPicking:!0,waterImage:Qt({}),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5})),d(Cn,"type",Cn.register("ESGeoWater",Cn,{chsName:"地理水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理动态水面"}));let Af=Cn;const jo=class jo extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new M([this,"downloadProgress"],"下载进度",jo.defaults.downloadProgress,!0,!0),new pt([this,"levelName"],"levelName",""),new M([this,"levelLoadDistance"],"levelLoadDistance",1e3),new cn([this,"levelOffset"],"levelOffset",[0,0,0])],dataSource:[...e.dataSource,new it([this,"url"],"url","")]}}};d(jo,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",downloadProgress:0,levelName:"",levelOffset:dt([0,0,0]),levelLoadDistance:1e3})),d(jo,"type",jo.register("ESLevelRuntimeModel",jo,{chsName:"关卡包模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"关卡包模型"}));let kf=jo;const ur=class ur extends Ni{constructor(t){super(t);d(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})())}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new M([this,"radius"],"半径",ur.defaults.radius),new M([this,"sides"],"圆边数",ur.defaults.sides),new M([this,"speed"],"材质速度",ur.defaults.speed),new Pt([this,"materialMode"],ur.materialModes,"材质模式",ur.defaults.materialMode),new it([this,"materialImage"],"材质图片和重复度",ur.defaults.materialImage)]}}};d(ur,"createDefaultProps",()=>({...Ni.createDefaultProps(),radius:10,sides:10,materialMode:"singleArrow",materialImage:wt({url:"",uDis:50,vDis:10}),speed:1,filled:!0,stroked:!1,fillStyle:wt({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),d(ur,"type",ur.register("ESPipeline",ur,{chsName:"管线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPipeline"})),d(ur,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"]]);let Vf=ur;const Ai=class Ai extends It{constructor(t){super(t);d(this,"editingBindMode","visibility")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Mt([this,"visibleColor"],"可视区域颜色",Ai.defaults.visibleColor),new Mt([this,"invisibleColor"],"遮挡区域颜色",Ai.defaults.invisibleColor),new M([this,"heightOffset"],"视点高度偏移",Ai.defaults.heightOffset)]}}};d(Ai,"createDefaultProps",()=>({...It.createDefaultProps(),visibleColor:dt([0,1,0,1]),invisibleColor:dt([1,0,0,1]),heightOffset:0})),d(Ai,"type",Ai.register("ESVisibilityAnalysis",Ai,{chsName:"通视分析,视线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通视分析,视线分析"})),d(Ai,"supportEditingModes",[...It.supportEditingModes,et.VisibilityAppend,et.VisibilityModify]);let jf=Ai;const uu=class uu extends Xt{constructor(t){super(t);d(this,"_startEvent",this.dv(new O));d(this,"_clearEvent",this.dv(new O));d(this,"_volume",this.disposeVar(j(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get volume(){return this._volume.value}set volume(t){this._volume.value=t}get volumeChanged(){return this._volume.changed}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"通用","通用"),new M([this,"planeHeight"],"基准面高程",void 0,!0),new M([this,"gridWidth"],"采样间距 m"),new M([this,"cutVolume"],"挖方",0,!1,!0),new M([this,"fillVolume"],"填方",0,!1,!0),new M([this,"cutAndFillVolume"],"挖填方",0,!1,!0),new M([this,"progress"],"计算进度",0,!1,!0),new lt([],()=>this.start(),[],"开始分析"),new lt([],()=>this.clear(),[],"清空分析结果"),new X([this,"depthTest"],"是否开启深度检测")]}}};d(uu,"createDefaultProps",()=>({...Xt.createDefaultProps(),planeHeight:j(void 0),gridWidth:1,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,filled:!1,stroked:!0,strokeStyle:wt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(uu,"type",uu.register("ESVolumeMeasurement",uu,{chsName:"体积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"体积测量"}));let Bf=uu;const lu=class lu extends Po{constructor(t){super(t);d(this,"_human",this.dv(new Po));d(this,"_poi",this.dv(new ml));this.d(this.components.disposableAdd(this._human,!0)),this.d(this.components.disposableAdd(this._poi));{const{_human:n,_poi:i}=this;this.d(B([n,"show"],[this,"show"])),this.d(B([i,"show"],[this,"show"])),this.d(B([n,"allowPicking"],[this,"allowPicking"])),this.d(B([i,"allowPicking"],[this,"allowPicking"])),this.d(nt([n,"scale"],[this,"scale"])),this.d(nt([i,"scale"],[this,"scale"])),this.d(B([n,"collision"],[this,"collision"])),this.d(B([i,"collision"],[this,"collision"])),this.d(nt([n,"flyInParam"],[this,"flyInParam"])),this.d(nt([n,"flyToParam"],[this,"flyToParam"])),this.d(B([n,"animation"],[this,"animation"])),this.d(B([n,"mode"],[this,"mode"])),this.d(B([n,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(B([n,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(B([i,"name"],[this,"name"])),this.d(B([i,"mode"],[this,"poiMode"])),this.d(B([i,"autoAnchor"],[this,"autoAnchor"])),this.d(B([i,"screenRender"],[this,"screenRender"])),this.d(B([i,"size"],[this,"size"])),this.d(B([i,"anchor"],[this,"anchor"])),this.d(B([i,"sizeByContent"],[this,"sizeByContent"])),this.d(B([i,"renderMode"],[this,"renderMode"])),this.d(B([i,"rotationType"],[this,"rotationType"])),this.d(B([i,"zOrder"],[this,"zOrder"])),this.d(B([i,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(B([i,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(nt([n,"position"],[this,"position"])),this.d(nt([n,"rotation"],[this,"rotation"])),this.d(this.flyInEvent.don(s=>{n.flyIn(s)})),this.d(this.flyToEvent.don(s=>{n.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()})),this.d(this.smoothMoveEvent.don((s,o)=>{n.smoothMove(s,o)})),this.d(this.smoothMoveWithRotationEvent.don((s,o,a)=>{n.smoothMoveWithRotation(s,o,a)})),this.d(this.smoothMoveOnGroundEvent.don((s,o,a,u)=>{n.smoothMoveOnGround(s,o,a,u)})),this.d(this.smoothMoveWithRotationOnGroundEvent.don((s,o,a,u,l)=>{n.smoothMoveWithRotationOnGround(s,o,a,u,l)})),this.d(this.automaticLandingEvent.don(()=>{n.automaticLanding()})),this.d(this._human.readyEvent.don(s=>{this.readyEvent.emit(s)}))}}get human(){return this._human}get poi(){return this._poi}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Pt([this,"poiMode"],ml.modes,"poi模式","SquareH01"),new M([this,"poiOffsetHeight"],"poi高度偏移",1.8)]}}};d(lu,"createDefaultProps",()=>({poiOffsetHeight:1.8,poiMode:"SquareH01",style:wt({}),autoAnchor:!0,screenRender:!0,size:dt([100,100]),anchor:dt([.5,1]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,...Po.createDefaultProps()})),d(lu,"type",lu.register("ESHumanPoi",lu,{chsName:"人员poi",tags:["ESObjects"],description:"ESHuman + ESPoi2D组合对象"}));let zf=lu;const hi=class hi extends Xt{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new M([this,"depth"],"深度",hi.defaults.depth),new M([this,"interpolation"],"插值",hi.defaults.interpolation),new M([this,"opacity"],"透明度",hi.defaults.opacity),new it([this,"sideImage"],"侧面图片",hi.defaults.sideImage),new it([this,"bottomImage"],"底面图片",hi.defaults.bottomImage)]}}};d(hi,"createDefaultProps",()=>({...Xt.createDefaultProps(),depth:100,sideImage:wt({url:rt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/side.jpg"),uDis:50,vDis:50}),bottomImage:wt({url:rt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/bottom.jpg"),uDis:50,vDis:50}),opacity:1,interpolation:50,collision:!1,allowPicking:!1,filled:!0})),d(hi,"type",hi.register("ESPit",hi,{chsName:"坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"坑"}));let Ba=hi;const cu=class cu extends Ba{constructor(t){super(t);d(this,"_excavate",this.dv(new gl));d(this,"_pit",this.dv(new Ba));this.d(this.components.disposableAdd(this._excavate)),this.d(this.components.disposableAdd(this._pit,!0));{const{_excavate:n,_pit:i}=this;this.d(B([n,"show"],[this,"show"])),this.d(B([i,"show"],[this,"show"])),this.d(B([n,"allowPicking"],[this,"allowPicking"])),this.d(B([i,"allowPicking"],[this,"allowPicking"])),this.d(B([n,"collision"],[this,"collision"])),this.d(B([i,"collision"],[this,"collision"])),this.d(nt([i,"points"],[this,"points"])),this.d(B([n,"points"],[this,"points"])),this.d(B([i,"pointed"],[this,"pointed"])),this.d(B([n,"pointed"],[this,"pointed"])),this.d(B([i,"pointStyle"],[this,"pointStyle"])),this.d(B([n,"pointStyle"],[this,"pointStyle"])),this.d(B([i,"stroked"],[this,"stroked"])),this.d(B([n,"stroked"],[this,"stroked"])),this.d(B([i,"strokeStyle"],[this,"strokeStyle"])),this.d(B([n,"strokeStyle"],[this,"strokeStyle"])),this.d(B([i,"filled"],[this,"filled"])),this.d(B([i,"fillStyle"],[this,"fillStyle"])),this.d(B([n,"fillStyle"],[this,"fillStyle"])),this.d(B([n,"mode"],[this,"mode"])),this.d(B([n,"targetID"],[this,"targetID"])),this.d(B([i,"depth"],[this,"depth"])),this.d(B([i,"sideImage"],[this,"sideImage"])),this.d(B([i,"bottomImage"],[this,"bottomImage"])),this.d(B([i,"opacity"],[this,"opacity"])),this.d(B([i,"interpolation"],[this,"interpolation"])),this.d(nt([i,"flyInParam"],[this,"flyInParam"])),this.d(nt([i,"flyToParam"],[this,"flyToParam"])),this.d(this.flyInEvent.don(s=>{i.flyIn(s)})),this.d(this.flyToEvent.don(s=>{i.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}}get excavate(){return this._excavate}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Pt([this,"mode"],gl.modes,"模式","in"),new pt([this,"targetID"],"瓦片图层","")]}}};d(cu,"createDefaultProps",()=>({...Ba.createDefaultProps(),mode:"in",targetID:""})),d(cu,"type",cu.register("ESHole",cu,{chsName:"挖坑(带材质+深度)",tags:["ESObjects"],description:"挖坑"}));let Uf=cu;const Gf={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},kS=async(r,e,t,n)=>{try{const i=globalThis.localStorage.getItem("Authorization");let s=r+`${Gf.layerconfigfind}?tileServiceName=${e}`;t&&(s+=`&earthdstoken=${encodeURIComponent(n)}`);const o={headers:{...!t&&i?{Authorization:i}:{}},mode:"cors"},u=await(await fetch(s,o)).text();return JSON.parse(u)}catch(i){console.error(i)}},VS=async(r,e,t,n,i)=>{try{const s=globalThis.localStorage.getItem("Authorization");let o=r+Gf.layerconfigsave;const a=i??{};t&&(o+=`?earthdstoken=${encodeURIComponent(n)}`);const u={method:"POST",headers:{"Content-Type":"application/json",...!t&&s?{Authorization:s}:{}},mode:"cors",body:JSON.stringify({tileServiceName:e,layerConfig:JSON.stringify(a)})},c=await(await fetch(o,u)).text();return JSON.parse(c)}catch(s){console.error(s)}},jS=async(r,e,t)=>{try{const n=globalThis.localStorage.getItem("Authorization");let i=r;e&&(i+=`?earthdstoken=${encodeURIComponent(t)}`);const s={headers:{...!e&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(i,s)).text(),u=JSON.parse(a);if(u.status=="ok")return u.data.port;console.error(u.status);return}catch(n){console.error(n)}},BS=async(r,e,t,n,i)=>{try{const s={tileServiceName:e,featureId:t},o=globalThis.localStorage.getItem("Authorization");let a=r+Gf.featureproperty;n&&(a+=`?earthdstoken=${encodeURIComponent(i)}`);const l=await(await fetch(a,{method:"post",headers:{"Content-Type":"application/json",...!n&&o?{Authorization:o}:{}},body:JSON.stringify(s),mode:"cors"})).text(),c=JSON.parse(l);if(c.status=="ok")return c.data;console.error(c.data.status);return}catch(s){console.error(s)}},hu=class hu extends Tr{constructor(t){super(t);d(this,"_es3DTileset",this.dv(new Tr));d(this,"_ids",this.dv(wt([])));d(this,"_useEarthDSToken",this.dv(j(!1)));d(this,"_earthdstoken",this.dv(j("")));d(this,"_visJson",this.disposeVar(j({})));d(this,"_highlightInner3DtilesetEvent",this.dv(new O));d(this,"_removeHighlightInner3DtilesetEvent",this.dv(new O));d(this,"_tilesetServePort",this.dv(j("")));{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ts01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(B([n,"allowPicking"],[this,"allowPicking"])),this.d(B([n,"collision"],[this,"collision"])),this.d(nt([n,"flyToParam"],[this,"flyToParam"])),this.d(nt([n,"flyToParam"],[this,"flyToParam"])),this.d(B([n,"actorTag"],[this,"actorTag"])),this.d(B([n,"materialMode"],[this,"materialMode"])),this.d(B([n,"highlight"],[this,"highlight"])),this.d(B([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(B([n,"highlightID"],[this,"highlightID"])),this.d(B([n,"highlightColor"],[this,"highlightColor"])),this.d(nt([n,"offset"],[this,"offset"])),this.d(nt([n,"rotation"],[this,"rotation"])),this.d(B([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(B([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(B([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(B([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(B([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(B([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(B([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(B([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(B([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(B([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(B([n,"cacheBytes"],[this,"cacheBytes"])),this.d(B([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(B([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(B([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(B([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(B([n,"materialParams"],[this,"materialParams"])),this.d(nt([n,"supportEdit"],[this,"supportEdit"])),this.d(nt([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(nt([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(nt([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(nt([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(nt([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(nt([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{n.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{n.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{n.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{n.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{n.resetFeatureStyle(...i)})),this.d(this.setFeatureStyleEvent.don((...i)=>{n.setFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{n.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{n.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{n.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{n.calcFlyInParam(...i)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(n.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(t){this._ids.value=t}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(t){this._useEarthDSToken.value=t}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(t){this._earthdstoken.value=t}get visJson(){return this._visJson.value}set visJson(t){this._visJson.value=t}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(t,n){var i;if((i=this.layerConfig)!=null&&i.length){const s={};s[n[0].value]=n[0].visable,this.visJson={...this.visJson,...s}}else this.setFeatureVisableEvent.emit(t,typeof n=="string"?JSON.parse(n):n)}async getFeatureProperty(t){return await BS(this.baseUrl,this.tileServiceName,t,this.useEarthDSToken,this.earthdstoken)}async getLayerConfig(){const t=await kS(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken);return!t||!Array.isArray(t)?this.layerConfig=[]:this.layerConfig=t,this.layerConfig}async saveLayerConfig(){const t=this.layerConfig;return await VS(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,t)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(t){this._highlightInner3DtilesetEvent.emit(t)}async highlightDSFeature(t){this._highlightInner3Dtileset(t)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(t){this._removeHighlightInner3DtilesetEvent.emit(t)}async removeHighlightDSFeature(t){this._removeHighlightInner3Dtileset(t)}async pickFeature(t,n){var a,u,l;const i=await t.pick(n),s=i.sceneObject;return!s||s.id!==this.id&&s.typeName!="ESRtsFeatureEditing"?void 0:s.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(a=i==null?void 0:i.tilesetPickInfo)==null?void 0:a.id],{featureId:(u=i==null?void 0:i.tilesetPickInfo)==null?void 0:u.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}):{featureId:(l=i==null?void 0:i.sceneObject)==null?void 0:l.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(t){this._tilesetServePort.value=t}async getport(){const t=await jS(this.url,this.useEarthDSToken,this.earthdstoken);if(t)return this.tilesetServePort=t,t;throw new Error("服务地址port获取失败!")}async refresh(){var n;if(!this.url||typeof this.url!="string")return;const t=+new Date;if(this.isSameIP){const i=(n=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:n[0];this._es3DTileset.url=`${i}/ts/tiles/${this.tileServiceName}/tileset.json?t=${t}`}else{const i=this.tileServiceIp,s=await this.getport();await this.getLayerConfig(),this._es3DTileset.url=`${i}:${s}/tiles/tileset.json?t=${t}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01")}get tileServiceName(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:t[1];if(!n)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return n}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new it([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};d(hu,"createDefaultProps",()=>({...Tr.createDefaultProps(),layerConfig:Qt([]),isSameIP:!1})),d(hu,"type",hu.register("ESRtsTileset",hu,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Wf=hu;function zS(r){return typeof r=="number"&&!isNaN(r)}const du=class du extends Tr{get json(){return{...this._innerGetJson(),show:this.show,materials:this.materials,changeMaterial:this.changeMaterial,props:this.props,rotation:this.rotation,offset:this.offset}}set json(e){this._innerSetJson(e)}async init(e,t){var i;this.featureId=t;const n=await e.getFeatureProperty(t);if(this.uiShowprops=n.allFields.map(s=>({featureClassName:s.featureClassName,fields:s.fields.map(o=>({key:o.name,type:o.type,value:o.type!="Double"?o.value:zS(o.value)?Number(o.value.toFixed(3)):""}))})),this.datasetName=n.datasetName,e.setFeatureVisable("id",[{value:this.featureId,visable:!1}]),this.d(()=>{e.setFeatureVisable("id",[{value:this.featureId,visable:!0}])}),e.isSameIP){const s=(i=e.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:i[0],o=e.tileServiceName;this.url=`${s}/ts/featuretiles/${o}/${this.featureId}/tileset.json`}else{const s=e.tileServiceIp,o=e.tilesetServePort;if(!o)throw new Error("ESRtsFeatureEditing2: port is not defined");this.url=`${s}:${o}/featuretiles/${this.featureId}/tileset.json`}this.allowPicking=!0,this.d(this.pickedEvent.don(s=>{s.assign({sceneObject:e}),e.pickedEvent.emit(s)})),this.d(()=>{this.editing=!1,e.removeHighlightDSFeature(this)})}constructor(e){super(e)}};d(du,"createDefaultProps",()=>({...Tr.createDefaultProps(),datasetName:void 0,featureId:void 0,materials:wt({}),changeMaterial:Qt(void 0),uiShowprops:wt({}),props:wt({})})),d(du,"type",du.register("ESRtsFeatureEditing",du,{chsName:"ESRtsFeatureEditing",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Hf=du;const US=async(r,e,t)=>{try{const n=globalThis.localStorage.getItem("Authorization");let i=r;e&&(i+=`?earthdstoken=${encodeURIComponent(t)}`);const s={headers:{...!e&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(i,s)).text(),u=JSON.parse(a);if(u.status=="ok")return u.data.port;console.error(u.status);return}catch(n){console.error(n)}},Il=class Il extends Tr{constructor(t){super(t);d(this,"_es3DTileset",this.dv(new Tr));d(this,"_tilesetServePort",this.dv(j("")));d(this,"_useEarthDSToken",this.dv(j(!1)));d(this,"_earthdstoken",this.dv(j("")));{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ms01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(B([n,"allowPicking"],[this,"allowPicking"])),this.d(B([n,"collision"],[this,"collision"])),this.d(nt([n,"flyToParam"],[this,"flyToParam"])),this.d(nt([n,"flyToParam"],[this,"flyToParam"])),this.d(B([n,"actorTag"],[this,"actorTag"])),this.d(B([n,"materialMode"],[this,"materialMode"])),this.d(B([n,"highlight"],[this,"highlight"])),this.d(B([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(B([n,"highlightID"],[this,"highlightID"])),this.d(B([n,"highlightColor"],[this,"highlightColor"])),this.d(nt([n,"offset"],[this,"offset"])),this.d(nt([n,"rotation"],[this,"rotation"])),this.d(B([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(B([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(B([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(B([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(B([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(B([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(B([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(B([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(B([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(B([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(B([n,"cacheBytes"],[this,"cacheBytes"])),this.d(B([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(B([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(B([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(B([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(B([n,"materialParams"],[this,"materialParams"])),this.d(nt([n,"supportEdit"],[this,"supportEdit"])),this.d(nt([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(nt([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(nt([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(nt([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(nt([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(nt([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{n.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{n.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{n.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{n.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{n.resetFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{n.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{n.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{n.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{n.calcFlyInParam(...i)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(n.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(t){this._tilesetServePort.value=t}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(t){this._useEarthDSToken.value=t}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(t){this._earthdstoken.value=t}async getport(){const t=await US(this.url,this.useEarthDSToken,this.earthdstoken);if(t)return this.tilesetServePort=t,t;throw new Error("服务地址port获取失败!")}async refresh(){var i;if(!this.url||typeof this.url!="string")return;const t=(i=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:i[1],n=+new Date;if(t){const s=this.tileServiceIp,o=await this.getport();this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${n}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceName(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:t[1];if(!n)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return n}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}};d(Il,"type",Il.register("ESMsTileset",Il,{chsName:"Modelser实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let qf=Il;const Cy={defaultValue:[{type:"2",widget:"WidgetBlueprint'/ESFoliage/PoiSheng.PoiSheng'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"3",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"4",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"5",widget:"WidgetBlueprint'/ESFoliage/PoiXiang.PoiXiang'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"6",widget:"WidgetBlueprint'/ESFoliage/PoiCun.PoiCun'",povit:[.5,1],worldScale:.1,hiddenDistance:40}],sampleValue:`
355
355
  ## 参数类型为 ESPoiType[]
356
356
  \`\`\`js
357
357
  type Vector2D = [number, number]
@@ -364,7 +364,7 @@ ${wy}
364
364
  hiddenDistance: number
365
365
  }
366
366
  \`\`\`
367
- `},Bo=class Bo extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([],"通用"),new it([this,"url"],"路径"),new it([this,"poiTypes"],Bo.defaults.poiTypes,Ey.sampleValue),new M([this,"heightOffset"])]}}};d(Bo,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",poiTypes:Qt(Ey.defaultValue),heightOffset:40})),d(Bo,"type",Bo.register("ESPoiTileset",Bo,{chsName:"ESPoiTileset",tags:["ESObjects","_ES_Impl_UE"],description:"ESPoiTileset"}));let Xf=Bo;const fu=class fu extends rt{getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([],"通用","通用"),new X([this,"show"],"是否显示"),new Pt([this,"screenPosition"],[["left","left"],["right","right"]],"定位","right"),new Ae([this,"cssPosition"],"位置")]}}};d(fu,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,screenPosition:"right",cssPosition:[40,30]})),d(fu,"type",fu.register("ESScale",fu,{chsName:"比例尺",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"比例尺"}));let Yf=fu;const ki=class ki extends Xt{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new M([this,"height"],"高度",ki.defaults.height,!0),new M([this,"extrudedHeight"],"拉伸高度",ki.defaults.extrudedHeight,!0),new X([this,"perPositionHeight"],"应用每个位置高度",ki.defaults.perPositionHeight,!0)]}}};d(ki,"createDefaultProps",()=>({...Xt.createDefaultProps(),height:0,extrudedHeight:10,perPositionHeight:!1,collision:!1})),d(ki,"type",ki.register("ESGeoExtrudedPolygon",ki,{chsName:"拉升多边形体",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"拉升多边形体"})),d(ki,"supportEditingModes",[...Xt.supportEditingModes,et.HeightModify]);let Io=ki;const zo=class zo extends Xt{constructor(t){super(t);d(this,"_classification",this.dv(new jc));d(this,"_geoExtrudedPolygon",this.dv(new Io));this.d(this.components.disposableAdd(this._classification)),this.d(this.components.disposableAdd(this._geoExtrudedPolygon,!0));{const{_classification:n,_geoExtrudedPolygon:i}=this;i.perPositionHeight=!0,this.d(B([n,"collision"],[this,"collision"])),this.d(B([i,"collision"],[this,"collision"])),this.d(nt([i,"flyInParam"],[this,"flyInParam"])),this.d(nt([i,"flyToParam"],[this,"flyToParam"])),this.d(nt([i,"points"],[this,"points"])),this.d(nt([i,"extrudedHeight"],[this,"height"])),this.d(nt([n,"fillColor"],[this,"overheightColor"])),this.d(nt([i,"fillColor"],[this,"standardColor"]));{const s=()=>{const{height:o,points:a,maxHeight:u}=this;if(!a)return;const l=a.map(c=>[c[0],c[1],o]);n.points=l,n.height=u-o,u-o<=0?n.show=!1:n.show=this.show&&this.filled};s(),this.d(Ui([this.heightChanged,this.pointsChanged,this.maxHeightChanged],s))}{const s=()=>{const{show:o,filled:a}=this;n.show=o&&a,i.show=o&&a};s(),this.d(Ui([this.showChanged,this.filledChanged],s))}this.d(this.flyInEvent.don(s=>{i.flyIn(s)})),this.d(this.flyToEvent.don(s=>{i.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}}get classification(){return this._classification}get geoExtrudedPolygon(){return this._geoExtrudedPolygon}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new M([this,"height"],"高度",10),new M([this,"maxHeight"],"最高高度",200),new Mt([this,"overheightColor"],"超高颜色",[1,0,0,.5]),new Mt([this,"standardColor"],"标准颜色",[0,1,0,.5])]}}};d(zo,"createDefaultProps",()=>({...Xt.createDefaultProps(),height:10,maxHeight:200,overheightColor:[1,0,0,.5],standardColor:[0,1,0,.5]})),d(zo,"type",zo.register("ESHeightLimitAnalysis",zo,{chsName:"控高分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"控高分析对象"})),d(zo,"supportEditingModes",[...Xt.supportEditingModes,et.HeightModify]);let Jf=zo;const di=class di extends Ht{constructor(t){super(t);d(this,"_widgetEvent",this.dv(new O));d(this,"_data",this.dv(j(void 0)));{const n=()=>{this.url&&(typeof this.url=="object"?this.data=this.url:Wh(this.url)?this.data=JSON.parse(this.url):fetch(rt.context.getStrFromEnv(this.url)).then(i=>i.json()).then(i=>{this.data=i}).catch(i=>{console.warn("ESEntityCluster数据加载失败",i)}))};n(),this.d(this.urlChanged.don(n))}}get widgetEvent(){return this._widgetEvent}get data(){return this._data.value}set data(t){this._data.value=t}get dataChanged(){return this._data.changed}getFeatures(){if(this._data)return this._data;console.log("数据未加载完成,请稍后重试")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new it([this,"url"],"地址",di.defaults.url),new M([this,"pixelRange"],"集合范围",di.defaults.pixelRange),new M([this,"minimumClusterSize"],"最小数量",di.defaults.minimumClusterSize),new Pt([this,"heightReference"],[["None","None"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["CLAMP_TO_TERRAIN","CLAMP_TO_TERRAIN"]],"高度模式","None")],more:[...t.more,new it([this,"style"],"style",di.defaults.style),new X([this,"perspective"],"透视效果",di.defaults.perspective)]}}};d(di,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",pixelRange:200,minimumClusterSize:2,style:Qt({cluster:[{minValue:2,mode:"SquareV02",style:{}}],nonCluster:{mode:"SquareV03",style:{}}}),heightReference:"NONE",perspective:!1})),d(di,"type",di.register("ESEntityCluster",di,{chsName:"Poi聚合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于聚合POI标注,提高性能。"}));let $f=di;class _l extends V{constructor(){super();d(this,"_player",this.disposeVar(new kr));const t=this._player;{const n=()=>{const i=(this.stopTime??0)-(this.startTime??0);t.duration=i>0?i:0};n(),this.d(this.startTimeChanged.don(n)),this.d(this.stopTimeChanged.don(n))}this.d(nt([t,"playing"],[this,"playing"])),this.d(nt([t,"loop"],[this,"loop"])),this.d(nt([t,"speed"],[this,"speed"])),this.d(t.currentTimeChanged.don(()=>{this.startTime!==void 0&&t.currentTime!==void 0&&(this.currentTime=t.currentTime+this.startTime)})),this.d(this.currentTimeChanged.don(()=>{if(this.currentTime===void 0||this.startTime===void 0)return;const n=this.currentTime-this.startTime;t.currentTime=jl(n,0,t.duration)}))}get player(){return this._player}get ratio(){return this._player.ratio}get ratioChanged(){return this._player.ratioChanged}set ratio(t){this._player.ratio=t}}(r=>{r.createDefaultProps=()=>({...rt.createDefaultProps(),currentTime:void 0,startTime:void 0,stopTime:void 0,playing:void 0,loop:void 0,speed:void 0})})(_l||(_l={})),Gi(_l.prototype,_l.createDefaultProps);const pu=class pu extends rt{constructor(t){super(t);d(this,"_absolutePlayer",this.dv(new _l));const n=this.absolutePlayer;this.d(nt([n,"currentTime"],[this,"currentTime"])),this.d(nt([n,"startTime"],[this,"startTime"])),this.d(nt([n,"stopTime"],[this,"stopTime"])),this.d(nt([n,"playing"],[this,"playing"])),this.d(nt([n,"loop"],[this,"loop"])),this.d(nt([n,"speed"],[this,"speed"]))}get absolutePlayer(){return this._absolutePlayer}get ratio(){return this._absolutePlayer.ratio}get ratioChanged(){return this._absolutePlayer.ratioChanged}set ratio(t){this._absolutePlayer.ratio=t}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Hl([this,"playing"],[this,"ratio"],[this,"loop"],"播放器"),new io([this,"currentTime"],"currentTime"),new io([this,"startTime"]),new io([this,"stopTime"]),new X([this,"playing"]),new X([this,"loop"]),new M([this,"speed"])]}}};d(pu,"createDefaultProps",()=>({...rt.createDefaultProps(),currentTime:0,startTime:0,stopTime:0,playing:!1,loop:!1,speed:1})),d(pu,"type",pu.register("ESPlayer",pu,{chsName:"ESPlayer",tags:["ESObjects","_ES_Impl_UE"],description:"ESPlayer"}));let za=pu;function Cy(r,e=!1){const t=r.map(i=>[i[0],[...i[1]],i[2]?[...i[2]]:void 0]),n=t.length;if(n===0)return t;if(n===1)return(!t[0][2]===void 0||e)&&(t[0][2]=void 0),t;for(let i=1;i<n;++i){if(t[i][2]!==void 0&&!e)continue;const s=t[i-1][1],o=t[i][1],a=Vr(s),u=Vr(o),l=g.Vector.distance(a,u);if(l===0){t[i][2]=t[i-1][2];continue}const c=Bu(s,o),h=o[2]-s[2],f=Math.asin(h/l)*180/Math.PI,p=Number.isFinite(c)?c:0,v=Number.isFinite(f)?f:0;t[i][2]=[p,v,0]}return(t[0][2]===void 0||e)&&(t[0][2]=n>1?t[1][2]:void 0),t}function Sy(r,e=!1){const t=r.map(i=>[i[0],[...i[1]],i[2]?[...i[2]]:void 0]),n=t.length;if(n===0)return t;if(n===1)return(!t[0][2]===void 0||e)&&(t[0][2]=void 0),t;for(let i=n-2;i>=0;--i){if(t[i][2]!==void 0&&!e)continue;const s=t[i][1],o=t[i+1][1],a=Vr(s),u=Vr(o),l=g.Vector.distance(a,u);if(l===0){t[i][2]=t[i+1][2];continue}const c=Bu(s,o),h=o[2]-s[2],f=Math.asin(h/l)*180/Math.PI,p=Number.isFinite(c)?c:0,v=Number.isFinite(f)?f:0;t[i][2]=[p,v,0]}return(t[n-1][2]===void 0||e)&&(t[n-1][2]=n>1?t[n-2][2]:[0,0,0]),t}function GS(r,e=!1){const t=Cy(r,e),n=Sy(r,e);if(t.length!==n.length)throw new Error("p.length !== n.length");const i=t.length;for(let s=0;s<i;s++){const o=t[s][2],a=n[s][2];o===void 0&&a===void 0?t[s][2]=void 0:o===void 0?t[s][2]=a:a===void 0?t[s][2]=o:t[s][2]=Hh(o,a,.5)}return t}function WS(r,e,t){let i;if(!r.timePosRots)return;const s=[],o=r.timePosRots.length;if(!(o<=2)){s.push(r.timePosRots[0]);for(let a=1;a<o-1;++a){const u=r.timePosRots[a-1][0],l=r.timePosRots[a][0],c=r.timePosRots[a+1][0],h=r.accumDistances[a-1],f=r.accumDistances[a],p=r.accumDistances[a+1],v=f-h;if(v!==0){const S=v-(i??(e.length==1?e[0]:e[a-1]||e[e.length-1])*.5);let P=(S<0?0:S)/v;Number.isNaN(P)&&(P=0);const y=(1-P)*u+P*l,_=r.getCurrent(y);_&&s.push([y,_.position,_.rotation])}t&&s.push(r.timePosRots[a]);const C=p-f;if(C!==0){let S=(e.length==1?e[0]:e[a-1]||e[e.length-1])*.5;const P=(e.length==1?e[0]:e[a]||e[e.length-1])*.5||0;S+P>C?(S=C*(S/(S+P)),i=C-S):i=void 0;let y=(S<0?0:S)/C;Number.isNaN(y)&&(y=0);const _=(1-y)*l+y*c,m=r.getCurrent(_);m&&s.push([_,m.position,m.rotation])}}s.push(r.timePosRots[o-1]),r.timePosRots=s}}function by(r,e){if(e<0)return[void 0,0];if(e>r.length-1)return[void 0,r.length-1];const t=[...r].slice(0,e+1).reverse().findIndex(i=>!!(i!=null&&i[2]));if(t===-1)return[void 0,0];const n=e-t;return[r[n][2],n]}function Py(r,e){if(e<0)return[void 0,0];if(e>=r.length)return[void 0,r.length-1];const t=r.slice(e).findIndex(([,,i])=>i!==void 0),n=t===-1?r.length-1:e+t;return[r[n][2],n]}function HS(r,e,t="Lerp"){let n,i,s,o;if(r.length!==0){if(e<=r[0][0])n=r[0][1],i=r[0][2],s=0,o=0;else if(e>=r[r.length-1][0]){const[u,l,c]=r[r.length-1];n=l,i=c,s=r.length-2,o=1}else{const u=r.findIndex(([l])=>e<=l);if(u===-1)throw new Error("nextIndex === -1");s=u-1;{const[l,c]=r[s],[h,f]=r[u],p=(e-l)/(h-l),v=zd(c),C=zd(f),S=g.Vector.lerp(v,C,p);n=Xh(S),o=p}{let[l,c]=by(r,s),[h,f]=Py(r,u);if(t==="Lerp")if(l&&h){if(c<0||f>=r.length)throw new Error("Invalid rotation index");const p=(e-r[c][0])/(r[f][0]-r[c][0]);i=Hh(l,h,p)}else l?i=l:h?i=h:i=void 0;else t==="Prev"?l&&(i=l):t==="Next"&&h&&(i=h)}}return{position:n,rotation:i,index:s,ratio:o}}}function qS(r){try{const e=JSON.parse(r);if(Array.isArray(e)&&e.length>0){const t=typeof e[0][0]=="number",n=Array.isArray(e[0][1])&&e[0][1].length===3;return t&&n?e:void 0}throw new Error("解析有问题")}catch{const t=r.split(/\n|\r\n/),n=[],i=t.length;for(let s=0;s<i;++s){const o=t[s],a=o.split(/[^0-9e\.\+\-]+/).filter(u=>u!=="").map(u=>+u);a.length<4?console.warn(`第${s+1}行数据无法解析成路径的数据, 原内容为: ${o}`):a.length<7?n.push([a[0],[a[1],a[2],a[3]],void 0]):n.push([a[0],[a[1],a[2],a[3]],[a[4],a[5],a[6]]])}return n}}function XS(r,e,t){const{timePosRots:n}=r;if(!n)throw new Error("!timePosRots");if(n.length===0)throw new Error("timePosRots.length === 0");e=Math.max(e,n[0][0]),t=Math.min(t,n[n.length-1][0]);const i=r.getCurrent(e),s=r.getCurrent(t);if(!i||!s)return;const o=[];i.ratio<1&&o.push([e,i.position,i.rotation]);for(let a=i.index+1;a<=s.index;++a)o.push(n[a]);return s.ratio>0&&o.push([t,s.position,s.rotation]),o}const YS=`
367
+ `},Bo=class Bo extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([],"通用"),new it([this,"url"],"路径"),new it([this,"poiTypes"],Bo.defaults.poiTypes,Cy.sampleValue),new M([this,"heightOffset"])]}}};d(Bo,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",poiTypes:Qt(Cy.defaultValue),heightOffset:40})),d(Bo,"type",Bo.register("ESPoiTileset",Bo,{chsName:"ESPoiTileset",tags:["ESObjects","_ES_Impl_UE"],description:"ESPoiTileset"}));let Xf=Bo;const fu=class fu extends rt{getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([],"通用","通用"),new X([this,"show"],"是否显示"),new Pt([this,"screenPosition"],[["left","left"],["right","right"]],"定位","right"),new Ae([this,"cssPosition"],"位置")]}}};d(fu,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,screenPosition:"right",cssPosition:[40,30]})),d(fu,"type",fu.register("ESScale",fu,{chsName:"比例尺",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"比例尺"}));let Yf=fu;const ki=class ki extends Xt{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new M([this,"height"],"高度",ki.defaults.height,!0),new M([this,"extrudedHeight"],"拉伸高度",ki.defaults.extrudedHeight,!0),new X([this,"perPositionHeight"],"应用每个位置高度",ki.defaults.perPositionHeight,!0)]}}};d(ki,"createDefaultProps",()=>({...Xt.createDefaultProps(),height:0,extrudedHeight:10,perPositionHeight:!1,collision:!1})),d(ki,"type",ki.register("ESGeoExtrudedPolygon",ki,{chsName:"拉升多边形体",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"拉升多边形体"})),d(ki,"supportEditingModes",[...Xt.supportEditingModes,et.HeightModify]);let Io=ki;const zo=class zo extends Xt{constructor(t){super(t);d(this,"_classification",this.dv(new jc));d(this,"_geoExtrudedPolygon",this.dv(new Io));this.d(this.components.disposableAdd(this._classification)),this.d(this.components.disposableAdd(this._geoExtrudedPolygon,!0));{const{_classification:n,_geoExtrudedPolygon:i}=this;i.perPositionHeight=!0,this.d(B([n,"collision"],[this,"collision"])),this.d(B([i,"collision"],[this,"collision"])),this.d(nt([i,"flyInParam"],[this,"flyInParam"])),this.d(nt([i,"flyToParam"],[this,"flyToParam"])),this.d(nt([i,"points"],[this,"points"])),this.d(nt([i,"extrudedHeight"],[this,"height"])),this.d(nt([n,"fillColor"],[this,"overheightColor"])),this.d(nt([i,"fillColor"],[this,"standardColor"]));{const s=()=>{const{height:o,points:a,maxHeight:u}=this;if(!a)return;const l=a.map(c=>[c[0],c[1],o]);n.points=l,n.height=u-o,u-o<=0?n.show=!1:n.show=this.show&&this.filled};s(),this.d(Ui([this.heightChanged,this.pointsChanged,this.maxHeightChanged],s))}{const s=()=>{const{show:o,filled:a}=this;n.show=o&&a,i.show=o&&a};s(),this.d(Ui([this.showChanged,this.filledChanged],s))}this.d(this.flyInEvent.don(s=>{i.flyIn(s)})),this.d(this.flyToEvent.don(s=>{i.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}}get classification(){return this._classification}get geoExtrudedPolygon(){return this._geoExtrudedPolygon}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new M([this,"height"],"高度",10),new M([this,"maxHeight"],"最高高度",200),new Mt([this,"overheightColor"],"超高颜色",[1,0,0,.5]),new Mt([this,"standardColor"],"标准颜色",[0,1,0,.5])]}}};d(zo,"createDefaultProps",()=>({...Xt.createDefaultProps(),height:10,maxHeight:200,overheightColor:[1,0,0,.5],standardColor:[0,1,0,.5]})),d(zo,"type",zo.register("ESHeightLimitAnalysis",zo,{chsName:"控高分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"控高分析对象"})),d(zo,"supportEditingModes",[...Xt.supportEditingModes,et.HeightModify]);let Jf=zo;const di=class di extends Ht{constructor(t){super(t);d(this,"_widgetEvent",this.dv(new O));d(this,"_data",this.dv(j(void 0)));{const n=()=>{this.url&&(typeof this.url=="object"?this.data=this.url:Wh(this.url)?this.data=JSON.parse(this.url):fetch(rt.context.getStrFromEnv(this.url)).then(i=>i.json()).then(i=>{this.data=i}).catch(i=>{console.warn("ESEntityCluster数据加载失败",i)}))};n(),this.d(this.urlChanged.don(n))}}get widgetEvent(){return this._widgetEvent}get data(){return this._data.value}set data(t){this._data.value=t}get dataChanged(){return this._data.changed}getFeatures(){if(this._data)return this._data;console.log("数据未加载完成,请稍后重试")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new it([this,"url"],"地址",di.defaults.url),new M([this,"pixelRange"],"集合范围",di.defaults.pixelRange),new M([this,"minimumClusterSize"],"最小数量",di.defaults.minimumClusterSize),new Pt([this,"heightReference"],[["None","None"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["CLAMP_TO_TERRAIN","CLAMP_TO_TERRAIN"]],"高度模式","None")],more:[...t.more,new it([this,"style"],"style",di.defaults.style),new X([this,"perspective"],"透视效果",di.defaults.perspective)]}}};d(di,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",pixelRange:200,minimumClusterSize:2,style:Qt({cluster:[{minValue:2,mode:"SquareV02",style:{}}],nonCluster:{mode:"SquareV03",style:{}}}),heightReference:"NONE",perspective:!1})),d(di,"type",di.register("ESEntityCluster",di,{chsName:"Poi聚合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于聚合POI标注,提高性能。"}));let $f=di;class _l extends V{constructor(){super();d(this,"_player",this.disposeVar(new kr));const t=this._player;{const n=()=>{const i=(this.stopTime??0)-(this.startTime??0);t.duration=i>0?i:0};n(),this.d(this.startTimeChanged.don(n)),this.d(this.stopTimeChanged.don(n))}this.d(nt([t,"playing"],[this,"playing"])),this.d(nt([t,"loop"],[this,"loop"])),this.d(nt([t,"speed"],[this,"speed"])),this.d(t.currentTimeChanged.don(()=>{this.startTime!==void 0&&t.currentTime!==void 0&&(this.currentTime=t.currentTime+this.startTime)})),this.d(this.currentTimeChanged.don(()=>{if(this.currentTime===void 0||this.startTime===void 0)return;const n=this.currentTime-this.startTime;t.currentTime=jl(n,0,t.duration)}))}get player(){return this._player}get ratio(){return this._player.ratio}get ratioChanged(){return this._player.ratioChanged}set ratio(t){this._player.ratio=t}}(r=>{r.createDefaultProps=()=>({...rt.createDefaultProps(),currentTime:void 0,startTime:void 0,stopTime:void 0,playing:void 0,loop:void 0,speed:void 0})})(_l||(_l={})),Gi(_l.prototype,_l.createDefaultProps);const pu=class pu extends rt{constructor(t){super(t);d(this,"_absolutePlayer",this.dv(new _l));const n=this.absolutePlayer;this.d(nt([n,"currentTime"],[this,"currentTime"])),this.d(nt([n,"startTime"],[this,"startTime"])),this.d(nt([n,"stopTime"],[this,"stopTime"])),this.d(nt([n,"playing"],[this,"playing"])),this.d(nt([n,"loop"],[this,"loop"])),this.d(nt([n,"speed"],[this,"speed"]))}get absolutePlayer(){return this._absolutePlayer}get ratio(){return this._absolutePlayer.ratio}get ratioChanged(){return this._absolutePlayer.ratioChanged}set ratio(t){this._absolutePlayer.ratio=t}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Hl([this,"playing"],[this,"ratio"],[this,"loop"],"播放器"),new io([this,"currentTime"],"currentTime"),new io([this,"startTime"]),new io([this,"stopTime"]),new X([this,"playing"]),new X([this,"loop"]),new M([this,"speed"])]}}};d(pu,"createDefaultProps",()=>({...rt.createDefaultProps(),currentTime:0,startTime:0,stopTime:0,playing:!1,loop:!1,speed:1})),d(pu,"type",pu.register("ESPlayer",pu,{chsName:"ESPlayer",tags:["ESObjects","_ES_Impl_UE"],description:"ESPlayer"}));let za=pu;function Sy(r,e=!1){const t=r.map(i=>[i[0],[...i[1]],i[2]?[...i[2]]:void 0]),n=t.length;if(n===0)return t;if(n===1)return(!t[0][2]===void 0||e)&&(t[0][2]=void 0),t;for(let i=1;i<n;++i){if(t[i][2]!==void 0&&!e)continue;const s=t[i-1][1],o=t[i][1],a=Vr(s),u=Vr(o),l=g.Vector.distance(a,u);if(l===0){t[i][2]=t[i-1][2];continue}const c=Bu(s,o),h=o[2]-s[2],f=Math.asin(h/l)*180/Math.PI,p=Number.isFinite(c)?c:0,v=Number.isFinite(f)?f:0;t[i][2]=[p,v,0]}return(t[0][2]===void 0||e)&&(t[0][2]=n>1?t[1][2]:void 0),t}function by(r,e=!1){const t=r.map(i=>[i[0],[...i[1]],i[2]?[...i[2]]:void 0]),n=t.length;if(n===0)return t;if(n===1)return(!t[0][2]===void 0||e)&&(t[0][2]=void 0),t;for(let i=n-2;i>=0;--i){if(t[i][2]!==void 0&&!e)continue;const s=t[i][1],o=t[i+1][1],a=Vr(s),u=Vr(o),l=g.Vector.distance(a,u);if(l===0){t[i][2]=t[i+1][2];continue}const c=Bu(s,o),h=o[2]-s[2],f=Math.asin(h/l)*180/Math.PI,p=Number.isFinite(c)?c:0,v=Number.isFinite(f)?f:0;t[i][2]=[p,v,0]}return(t[n-1][2]===void 0||e)&&(t[n-1][2]=n>1?t[n-2][2]:[0,0,0]),t}function GS(r,e=!1){const t=Sy(r,e),n=by(r,e);if(t.length!==n.length)throw new Error("p.length !== n.length");const i=t.length;for(let s=0;s<i;s++){const o=t[s][2],a=n[s][2];o===void 0&&a===void 0?t[s][2]=void 0:o===void 0?t[s][2]=a:a===void 0?t[s][2]=o:t[s][2]=Hh(o,a,.5)}return t}function WS(r,e,t){let i;if(!r.timePosRots)return;const s=[],o=r.timePosRots.length;if(!(o<=2)){s.push(r.timePosRots[0]);for(let a=1;a<o-1;++a){const u=r.timePosRots[a-1][0],l=r.timePosRots[a][0],c=r.timePosRots[a+1][0],h=r.accumDistances[a-1],f=r.accumDistances[a],p=r.accumDistances[a+1],v=f-h;if(v!==0){const S=v-(i??(e.length==1?e[0]:e[a-1]||e[e.length-1])*.5);let P=(S<0?0:S)/v;Number.isNaN(P)&&(P=0);const y=(1-P)*u+P*l,_=r.getCurrent(y);_&&s.push([y,_.position,_.rotation])}t&&s.push(r.timePosRots[a]);const C=p-f;if(C!==0){let S=(e.length==1?e[0]:e[a-1]||e[e.length-1])*.5;const P=(e.length==1?e[0]:e[a]||e[e.length-1])*.5||0;S+P>C?(S=C*(S/(S+P)),i=C-S):i=void 0;let y=(S<0?0:S)/C;Number.isNaN(y)&&(y=0);const _=(1-y)*l+y*c,m=r.getCurrent(_);m&&s.push([_,m.position,m.rotation])}}s.push(r.timePosRots[o-1]),r.timePosRots=s}}function Py(r,e){if(e<0)return[void 0,0];if(e>r.length-1)return[void 0,r.length-1];const t=[...r].slice(0,e+1).reverse().findIndex(i=>!!(i!=null&&i[2]));if(t===-1)return[void 0,0];const n=e-t;return[r[n][2],n]}function Iy(r,e){if(e<0)return[void 0,0];if(e>=r.length)return[void 0,r.length-1];const t=r.slice(e).findIndex(([,,i])=>i!==void 0),n=t===-1?r.length-1:e+t;return[r[n][2],n]}function HS(r,e,t="Lerp"){let n,i,s,o;if(r.length!==0){if(e<=r[0][0])n=r[0][1],i=r[0][2],s=0,o=0;else if(e>=r[r.length-1][0]){const[u,l,c]=r[r.length-1];n=l,i=c,s=r.length-2,o=1}else{const u=r.findIndex(([l])=>e<=l);if(u===-1)throw new Error("nextIndex === -1");s=u-1;{const[l,c]=r[s],[h,f]=r[u],p=(e-l)/(h-l),v=zd(c),C=zd(f),S=g.Vector.lerp(v,C,p);n=Xh(S),o=p}{let[l,c]=Py(r,s),[h,f]=Iy(r,u);if(t==="Lerp")if(l&&h){if(c<0||f>=r.length)throw new Error("Invalid rotation index");const p=(e-r[c][0])/(r[f][0]-r[c][0]);i=Hh(l,h,p)}else l?i=l:h?i=h:i=void 0;else t==="Prev"?l&&(i=l):t==="Next"&&h&&(i=h)}}return{position:n,rotation:i,index:s,ratio:o}}}function qS(r){try{const e=JSON.parse(r);if(Array.isArray(e)&&e.length>0){const t=typeof e[0][0]=="number",n=Array.isArray(e[0][1])&&e[0][1].length===3;return t&&n?e:void 0}throw new Error("解析有问题")}catch{const t=r.split(/\n|\r\n/),n=[],i=t.length;for(let s=0;s<i;++s){const o=t[s],a=o.split(/[^0-9e\.\+\-]+/).filter(u=>u!=="").map(u=>+u);a.length<4?console.warn(`第${s+1}行数据无法解析成路径的数据, 原内容为: ${o}`):a.length<7?n.push([a[0],[a[1],a[2],a[3]],void 0]):n.push([a[0],[a[1],a[2],a[3]],[a[4],a[5],a[6]]])}return n}}function XS(r,e,t){const{timePosRots:n}=r;if(!n)throw new Error("!timePosRots");if(n.length===0)throw new Error("timePosRots.length === 0");e=Math.max(e,n[0][0]),t=Math.min(t,n[n.length-1][0]);const i=r.getCurrent(e),s=r.getCurrent(t);if(!i||!s)return;const o=[];i.ratio<1&&o.push([e,i.position,i.rotation]);for(let a=i.index+1;a<=s.index;++a)o.push(n[a]);return s.ratio>0&&o.push([t,s.position,s.rotation]),o}const YS=`
368
368
  timePosRots是一个内部包含三个元素的数组,第一个表示时间戳,单位毫秒,第二个表示经纬度,第三个表示姿态(偏航、俯仰、翻转)。示例代码如下:
369
369
  \`\`\`
370
370
  [
@@ -409,7 +409,7 @@ timePosRots是一个内部包含三个元素的数组,第一个表示时间戳
409
409
  ]
410
410
  ]
411
411
  \`\`\`
412
- `,Fn=class Fn extends V{constructor(t,n){super();d(this,"_scratchCurrentInfo",{position:[0,0,0],rotation:[0,0,0],index:0});d(this,"_currentInfo",this.disposeVar(j(void 0,(t,n)=>!1)));d(this,"_player");d(this,"_flyToEvent",this.disposeVar(new O));d(this,"_accumDistancesChanged",this.disposeVar(new O));d(this,"_accumDistancesChangedInit",this.dispose(this.timePosRotsChanged.disposableOn(()=>(this._accumDistancesDirty=!0,this._accumDistancesChanged.emit()))));d(this,"_accumDistancesDirty",!1);d(this,"_accumDistances",[]);d(this,"_getCurrentFunc",this.disposeVar(j(void 0)));this._player=this.disposeVar(new kr);const i=()=>{const s=this.getCurrent(this.currentTime??0);if(s===void 0)this._currentInfo.value=void 0;else{const{index:o,position:a,rotation:u,ratio:l}=s;this._scratchCurrentInfo.index=o,this._scratchCurrentInfo.position=a,this._scratchCurrentInfo.rotation=u,this._scratchCurrentInfo.ratio=l,this._currentInfo.value=this._scratchCurrentInfo}};i(),this.currentTimeChanged.disposableOn(i),this.timePosRotsChanged.disposableOn(i),this.rotLerpModeChanged.disposableOn(i),this.dispose(nt([this._player,"loop"],[this,"loop"]));{const s=()=>{if(this.startTime===void 0||this.currentTime===void 0)return;const o=this.currentTime-this.startTime;(this._player.currentTime===void 0||Math.abs(o-this._player.currentTime)>.01)&&(this._player.currentTime=o)};s(),this.dispose(this.currentTimeChanged.disposableOn(s))}{const s=()=>{if(this.startTime===void 0||this._player.currentTime===void 0)return;const o=this._player.currentTime+this.startTime;(this.currentTime===void 0||Math.abs(o-this.currentTime)>.01)&&(this.currentTime=o)};s(),this.dispose(this._player.currentTimeChanged.disposableOn(s))}this.dispose(nt([this._player,"duration"],[this,"duration"])),this.dispose(nt([this._player,"playing"],[this,"playing"])),this.dispose(nt([this._player,"speed"],[this,"speed"]));{const s=()=>{(this.autoComputeTimeFromTimePosRots??!0)&&this.computeTimeFromTimePosRots()};s();const o=this.disposeVar(Ie(this.autoComputeTimeFromTimePosRotsChanged,this.timePosRotsChanged));this.dispose(o.disposableOn(s))}{const s=()=>{const o=this.timePosRots;if(!o)return;let a=0;const u=o.length;for(let l=0;l<u;++l){const c=o[l][0];if(c<0)console.warn("地理路径的时间戳不能小于0!");else if(c<a){console.warn(`地理路径的时间戳需要满足从小到大的数据,元素越靠后,时间越靠后!当前不满足条件的元素是index: ${l} time: ${c}`);break}}};s(),this.dispose(this.timePosRotsChanged.disposableOn(s))}{const s=this.disposeVar(Yn(async o=>{if(!this.dataUri)return;await o.promise(Nu(1e3));const a=await o.promise(fetch(this.dataUri)),u=await o.promise(a.text());this.timePosRots=Fn.parseData(u)}));this.dispose(this.dataUriChanged.disposableOn(()=>{s.restart()})),this.dispose(this.dataTextChanged.disposableOn(()=>{this.dataText&&(this.timePosRots=Fn.parseData(this.dataText))}))}}get currentInfo(){return this._currentInfo.value}get currentInfoChanged(){return this._currentInfo.changed}get currentIndex(){return this._currentInfo.value&&this._currentInfo.value.index}get currentIndexChanged(){return this._currentInfo.changed}get currentPosition(){return this._currentInfo.value&&this._currentInfo.value.position}get currentPositionChanged(){return this._currentInfo.changed}get currentRotation(){return this._currentInfo.value&&this._currentInfo.value.rotation}get currentRotationChanged(){return this._currentInfo.changed}get player(){return this._player}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get accumDistancesChanged(){return this._accumDistancesChanged}get accumDistances(){if(!this._accumDistancesDirty)return this._accumDistances;if(!this.timePosRots||this.timePosRots.length<2)this._accumDistances=[];else{const t=this.timePosRots.length;let n=0;const i=[];let s=Vr(this.timePosRots[0][1]);i.push(n);for(let o=1;o<t;++o){const a=Vr(this.timePosRots[o][1]),u=g.Vector.distance(a,s);s=a,n+=u,i.push(n)}this._accumDistances=i}return this._accumDistances}get totalDistanceChanged(){return this._accumDistancesChanged}get totalDistance(){return this.accumDistances.length>0?this.accumDistances[this.accumDistances.length-1]:0}getCurrent(t){return this.getCurrentFunc?this.getCurrentFunc(t,this):this.timePosRots&&HS(this.timePosRots,t,this.rotLerpMode)}subPath(t,n){return this.timePosRots&&XS(this,t,n)}computeRotIfUndefinedUsingPrevLine(t=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=Fn.computeRotIfUndefinedUsingPrevLine(this.timePosRots,t)}computeRotIfUndefinedUsingNextLine(t=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=Fn.computeRotIfUndefinedUsingNextLine(this.timePosRots,t)}computeRotIfUndefinedUsingLerp(t=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=Fn.computeRotIfUndefinedUsingLerp(this.timePosRots,t)}computeRotIfUndefined(t=!1){this.computeRotIfUndefinedUsingPrevLine(t)}addAroundPoints(t,n){WS(this,t,n)}get getCurrentFunc(){return this._getCurrentFunc.value}set getCurrentFunc(t){this._getCurrentFunc.value=t}get getCurrentFuncChanged(){return this._getCurrentFunc.changed}computeTimeFromTimePosRots(){const t=this.timePosRots;if(!t||t.length<=1){this.startTime=void 0,this.stopTime=void 0,this.duration=void 0;return}this.startTime=t[0][0],this.stopTime=t[t.length-1][0],this.duration=this.stopTime-this.startTime}get ratio(){return this.player.ratio}set ratio(t){this.player.ratio=t}get ratioChanged(){return this.player.ratioChanged}};d(Fn,"computeRotIfUndefinedUsingPrevLine",Cy),d(Fn,"computeRotIfUndefinedUsingNextLine",Sy),d(Fn,"computeRotIfUndefinedUsingLerp",GS),d(Fn,"getLeftRotation",by),d(Fn,"getRightRotation",Py),d(Fn,"parseData",qS),d(Fn,"defaults",{timePosRots:[],startTime:0,stopTime:3e3,loop:!1,duration:3e3,playing:!1,dataText:""}),d(Fn,"timePosRotsMd",YS);let Us=Fn;(r=>{r.createDefaultProps=()=>({show:!1,currentPoiShow:!0,timePosRots:vs(void 0,(e,t)=>e[0]===t[0]&&e[1].every((n,i)=>n===t[1][i])&&e[2]===t[2]===void 0||e[2]!==void 0&&t[2]!==void 0&&e[2].every((n,i)=>t[2][i]),e=>[e[0],[...e[1]],e[2]&&[...e[2]]||void 0]),autoComputeTimeFromTimePosRots:!0,leadTime:0,trailTime:0,startTime:void 0,stopTime:void 0,loop:!1,currentTime:0,duration:void 0,speed:1,playing:!1,polylineShow:!0,width:1,ground:!1,color:dt([1,1,1,1]),hasDash:!1,gapColor:dt([0,0,0,0]),dashLength:16,dashPattern:255,depthTest:!1,arcType:"GEODESIC",allowPicking:!1,dataUri:"",dataText:void 0,rotLerpMode:"Lerp",debug:!1})})(Us||(Us={})),Gi(Us.prototype,Us.createDefaultProps);const gu=class gu extends Ni{constructor(t){super(t);d(this,"_path");d(this,"_currentPositionChanged",this.dv(new O));d(this,"_currentRotationChanged",this.dv(new O));d(this,"_currentChanged",this.dv(new O));d(this,"_deprecated",[]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());this._path=this.dv(new Us),this.d(this._path.currentInfoChanged.don(()=>this._currentPositionChanged.emit(this._path.currentPosition))),this.d(this._path.currentInfoChanged.don(()=>this._currentRotationChanged.emit(this.currentRotation))),this.d(this._path.currentInfoChanged.don(()=>this._currentChanged.emit(this.current))),this._path.show=!0,this._path.polylineShow=!1,this._path.currentPoiShow=!1;{const n=()=>{if(!this.timeStamps||!this.points){this._path.timePosRots=void 0;return}const s=this.timeStamps.length,o=this.points.length,a=Math.min(s,o),u=[];for(let l=0;l<a;++l)u.push([this.timeStamps[l],this.points[l]]);this._path.timePosRots=u,this.rotationRadius.some(l=>l>0)?(this._path.addAroundPoints(this.rotationRadius,!0),this._path.computeRotIfUndefinedUsingLerp(!0),this._path.rotLerpMode="Lerp"):(this._path.computeRotIfUndefinedUsingPrevLine(!0),this._path.rotLerpMode="Next")},i=this.dv(Ie(this.timeStampsChanged,this.pointsChanged,this.rotationRadiusChanged));n(),this.d(i.don(n))}}get path(){return this._path}get currentPosition(){return this._path.currentPosition}get currentPositionChanged(){return this._currentPositionChanged}get currentRotation(){const t=this._path.currentRotation;if(t)return[sa(t[0]-90),t[1],t[2]]}get currentRotationChanged(){return this._currentRotationChanged}get current(){return{position:this.currentPosition,rotation:this.currentRotation}}get currentChanged(){return this._currentChanged}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Lg([this,"timeStamps"],"时间序列",[],!0),new M([this,"speed"],"线条流速",1),new Pt([this,"materialMode"],[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","pureColor"]],"模式","singleArrow"),new it([this,"rotationRadius"],"拐弯半径")],more:[...t.more,new cn([this,"currentPosition"],"当前位置",void 0,!0,!0)]}}};d(gu,"createDefaultProps",()=>({...It.createDefaultProps(),timeStamps:re(void 0),speed:1,materialMode:"singleArrow",stroked:!0,strokeStyle:wt({width:10,widthType:"world",color:[1,0,.73,1],material:"",materialParams:{arrowColor:[1,1,1,1]},ground:!1}),rotationRadius:[5]})),d(gu,"type",gu.register("ESPath",gu,{chsName:"ESPath",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPath"}));let Ua=gu;const Uo=class Uo extends It{constructor(t){super(t);d(this,"_lineString",this.dv(new Ni));this.components.disposableAdd(this._lineString,!1),this.stroked=!0,this.d(Ui([this.pointsChanged,this.resolutionChanged,this.sharpnessChanged],()=>{try{if(this.points&&this.points.length>=2){const n=ty(this.points,this.resolution,this.sharpness);this._lineString.points=n}else this._lineString.points=void 0}catch(n){console.error(n),this._lineString.points=void 0}},{immediate:!0})),this.d(B([this._lineString,"show"],[this,"show"])),this.d(B([this._lineString,"allowPicking"],[this,"allowPicking"])),this.d(B([this._lineString,"collision"],[this,"collision"])),this.d(B([this._lineString,"stroked"],[this,"stroked"])),this.d(B([this._lineString,"strokeStyle"],[this,"strokeStyle"])),this.d(nt([this._lineString,"flyInParam"],[this,"flyInParam"])),this.d(nt([this._lineString,"flyToParam"],[this,"flyToParam"])),this.d(this.flyInEvent.don(n=>{this._lineString.flyIn(n)})),this.d(this.flyToEvent.don(n=>{this._lineString.flyTo(n)})),this.d(this.calcFlyToParamEvent.don(()=>{this._lineString.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{this._lineString.calcFlyInParam()}))}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new M([this,"resolution"],"解析度",1e3),new M([this,"sharpness"],"锐利度",.85)]}}get lineString(){return this._lineString}};d(Uo,"createDefaultProps",()=>({...It.createDefaultProps(),resolution:1e3,sharpness:.85})),d(Uo,"type",Uo.register("ESGeoBezierSpline",Uo,{chsName:"贝塞尔曲线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"贝塞尔曲线"})),d(Uo,"supportEditingModes",[...It.supportEditingModes,et.LineStringAppend,et.LineStringInsert]);let Kf=Uo;const $s=class $s extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([]),new X([this,"textEditingInteraction"],"文本编辑交互"),new X([this,"textEditing"],"文本编辑"),new M([this,"width"],"宽度",$s.defaults.width,!0),new Uh([this,"text"],"内容",$s.defaults.text,void 0,!0),new Ar([this,"originRatioAndOffset"],"原点比例和偏移"),new M([this,"opacity"],"透明度"),new M([this,"fontSize"],"字体大小"),new Mt([this,"color"],"字体颜色"),new Mt([this,"backgroundColor"],"背景颜色"),new Ar([this,"padding"],"内边距"),new Ar([this,"borderRadius"],"边框圆角"),new Mt([this,"borderColor"],"边框颜色"),new M([this,"borderWidth"],"边框宽度"),new Pt([this,"textAlign"],[["center","center"],["left","left"],["right","right"]],"文字位置"),new Pt([this,"borderStyle"],[["none","none"],["hidden","hidden"],["dotted","dotted"],["dashed","dashed"],["solid","solid"],["double","double"],["groove","groove"],["ridge","ridge"],["inset","inset"],["outset","outset"]],"边框类型")]}}};d($s,"createDefaultProps",()=>({...st.createDefaultProps(),text:"请输入文字",width:80,textEditingInteraction:!1,textEditing:!1,originRatioAndOffset:dt([.5,1,0,0]),opacity:1,fontSize:14,textAlign:"left",color:dt([1,1,1,1]),backgroundColor:dt([0,0,0,.8]),padding:dt([5,5,5,5]),borderRadius:dt([6,6,6,6]),borderWidth:0,borderColor:dt([1,1,1,1]),borderStyle:"solid"})),d($s,"type",$s.register("ESGeoDivTextPoi",$s,{chsName:"图标点",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"图标点"}));let Zf=$s;const mu=class mu extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Mt([this,"color"],"颜色",[1,1,0,1])]}}};d(mu,"createDefaultProps",()=>({...st.createDefaultProps(),color:dt([1,1,0,1])})),d(mu,"type",mu.register("ESCityBasePoint",mu,{chsName:"城市基点(Czm)",tags:["ESObjects","CityObjects","_ES_Impl_Cesium"],description:"城市基点(Czm)"}));let Qf=mu;const Iy=`(dataSource) => {
412
+ `,Fn=class Fn extends V{constructor(t,n){super();d(this,"_scratchCurrentInfo",{position:[0,0,0],rotation:[0,0,0],index:0});d(this,"_currentInfo",this.disposeVar(j(void 0,(t,n)=>!1)));d(this,"_player");d(this,"_flyToEvent",this.disposeVar(new O));d(this,"_accumDistancesChanged",this.disposeVar(new O));d(this,"_accumDistancesChangedInit",this.dispose(this.timePosRotsChanged.disposableOn(()=>(this._accumDistancesDirty=!0,this._accumDistancesChanged.emit()))));d(this,"_accumDistancesDirty",!1);d(this,"_accumDistances",[]);d(this,"_getCurrentFunc",this.disposeVar(j(void 0)));this._player=this.disposeVar(new kr);const i=()=>{const s=this.getCurrent(this.currentTime??0);if(s===void 0)this._currentInfo.value=void 0;else{const{index:o,position:a,rotation:u,ratio:l}=s;this._scratchCurrentInfo.index=o,this._scratchCurrentInfo.position=a,this._scratchCurrentInfo.rotation=u,this._scratchCurrentInfo.ratio=l,this._currentInfo.value=this._scratchCurrentInfo}};i(),this.currentTimeChanged.disposableOn(i),this.timePosRotsChanged.disposableOn(i),this.rotLerpModeChanged.disposableOn(i),this.dispose(nt([this._player,"loop"],[this,"loop"]));{const s=()=>{if(this.startTime===void 0||this.currentTime===void 0)return;const o=this.currentTime-this.startTime;(this._player.currentTime===void 0||Math.abs(o-this._player.currentTime)>.01)&&(this._player.currentTime=o)};s(),this.dispose(this.currentTimeChanged.disposableOn(s))}{const s=()=>{if(this.startTime===void 0||this._player.currentTime===void 0)return;const o=this._player.currentTime+this.startTime;(this.currentTime===void 0||Math.abs(o-this.currentTime)>.01)&&(this.currentTime=o)};s(),this.dispose(this._player.currentTimeChanged.disposableOn(s))}this.dispose(nt([this._player,"duration"],[this,"duration"])),this.dispose(nt([this._player,"playing"],[this,"playing"])),this.dispose(nt([this._player,"speed"],[this,"speed"]));{const s=()=>{(this.autoComputeTimeFromTimePosRots??!0)&&this.computeTimeFromTimePosRots()};s();const o=this.disposeVar(Ie(this.autoComputeTimeFromTimePosRotsChanged,this.timePosRotsChanged));this.dispose(o.disposableOn(s))}{const s=()=>{const o=this.timePosRots;if(!o)return;let a=0;const u=o.length;for(let l=0;l<u;++l){const c=o[l][0];if(c<0)console.warn("地理路径的时间戳不能小于0!");else if(c<a){console.warn(`地理路径的时间戳需要满足从小到大的数据,元素越靠后,时间越靠后!当前不满足条件的元素是index: ${l} time: ${c}`);break}}};s(),this.dispose(this.timePosRotsChanged.disposableOn(s))}{const s=this.disposeVar(Yn(async o=>{if(!this.dataUri)return;await o.promise(Nu(1e3));const a=await o.promise(fetch(this.dataUri)),u=await o.promise(a.text());this.timePosRots=Fn.parseData(u)}));this.dispose(this.dataUriChanged.disposableOn(()=>{s.restart()})),this.dispose(this.dataTextChanged.disposableOn(()=>{this.dataText&&(this.timePosRots=Fn.parseData(this.dataText))}))}}get currentInfo(){return this._currentInfo.value}get currentInfoChanged(){return this._currentInfo.changed}get currentIndex(){return this._currentInfo.value&&this._currentInfo.value.index}get currentIndexChanged(){return this._currentInfo.changed}get currentPosition(){return this._currentInfo.value&&this._currentInfo.value.position}get currentPositionChanged(){return this._currentInfo.changed}get currentRotation(){return this._currentInfo.value&&this._currentInfo.value.rotation}get currentRotationChanged(){return this._currentInfo.changed}get player(){return this._player}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get accumDistancesChanged(){return this._accumDistancesChanged}get accumDistances(){if(!this._accumDistancesDirty)return this._accumDistances;if(!this.timePosRots||this.timePosRots.length<2)this._accumDistances=[];else{const t=this.timePosRots.length;let n=0;const i=[];let s=Vr(this.timePosRots[0][1]);i.push(n);for(let o=1;o<t;++o){const a=Vr(this.timePosRots[o][1]),u=g.Vector.distance(a,s);s=a,n+=u,i.push(n)}this._accumDistances=i}return this._accumDistances}get totalDistanceChanged(){return this._accumDistancesChanged}get totalDistance(){return this.accumDistances.length>0?this.accumDistances[this.accumDistances.length-1]:0}getCurrent(t){return this.getCurrentFunc?this.getCurrentFunc(t,this):this.timePosRots&&HS(this.timePosRots,t,this.rotLerpMode)}subPath(t,n){return this.timePosRots&&XS(this,t,n)}computeRotIfUndefinedUsingPrevLine(t=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=Fn.computeRotIfUndefinedUsingPrevLine(this.timePosRots,t)}computeRotIfUndefinedUsingNextLine(t=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=Fn.computeRotIfUndefinedUsingNextLine(this.timePosRots,t)}computeRotIfUndefinedUsingLerp(t=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=Fn.computeRotIfUndefinedUsingLerp(this.timePosRots,t)}computeRotIfUndefined(t=!1){this.computeRotIfUndefinedUsingPrevLine(t)}addAroundPoints(t,n){WS(this,t,n)}get getCurrentFunc(){return this._getCurrentFunc.value}set getCurrentFunc(t){this._getCurrentFunc.value=t}get getCurrentFuncChanged(){return this._getCurrentFunc.changed}computeTimeFromTimePosRots(){const t=this.timePosRots;if(!t||t.length<=1){this.startTime=void 0,this.stopTime=void 0,this.duration=void 0;return}this.startTime=t[0][0],this.stopTime=t[t.length-1][0],this.duration=this.stopTime-this.startTime}get ratio(){return this.player.ratio}set ratio(t){this.player.ratio=t}get ratioChanged(){return this.player.ratioChanged}};d(Fn,"computeRotIfUndefinedUsingPrevLine",Sy),d(Fn,"computeRotIfUndefinedUsingNextLine",by),d(Fn,"computeRotIfUndefinedUsingLerp",GS),d(Fn,"getLeftRotation",Py),d(Fn,"getRightRotation",Iy),d(Fn,"parseData",qS),d(Fn,"defaults",{timePosRots:[],startTime:0,stopTime:3e3,loop:!1,duration:3e3,playing:!1,dataText:""}),d(Fn,"timePosRotsMd",YS);let Us=Fn;(r=>{r.createDefaultProps=()=>({show:!1,currentPoiShow:!0,timePosRots:vs(void 0,(e,t)=>e[0]===t[0]&&e[1].every((n,i)=>n===t[1][i])&&e[2]===t[2]===void 0||e[2]!==void 0&&t[2]!==void 0&&e[2].every((n,i)=>t[2][i]),e=>[e[0],[...e[1]],e[2]&&[...e[2]]||void 0]),autoComputeTimeFromTimePosRots:!0,leadTime:0,trailTime:0,startTime:void 0,stopTime:void 0,loop:!1,currentTime:0,duration:void 0,speed:1,playing:!1,polylineShow:!0,width:1,ground:!1,color:dt([1,1,1,1]),hasDash:!1,gapColor:dt([0,0,0,0]),dashLength:16,dashPattern:255,depthTest:!1,arcType:"GEODESIC",allowPicking:!1,dataUri:"",dataText:void 0,rotLerpMode:"Lerp",debug:!1})})(Us||(Us={})),Gi(Us.prototype,Us.createDefaultProps);const gu=class gu extends Ni{constructor(t){super(t);d(this,"_path");d(this,"_currentPositionChanged",this.dv(new O));d(this,"_currentRotationChanged",this.dv(new O));d(this,"_currentChanged",this.dv(new O));d(this,"_deprecated",[]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());this._path=this.dv(new Us),this.d(this._path.currentInfoChanged.don(()=>this._currentPositionChanged.emit(this._path.currentPosition))),this.d(this._path.currentInfoChanged.don(()=>this._currentRotationChanged.emit(this.currentRotation))),this.d(this._path.currentInfoChanged.don(()=>this._currentChanged.emit(this.current))),this._path.show=!0,this._path.polylineShow=!1,this._path.currentPoiShow=!1;{const n=()=>{if(!this.timeStamps||!this.points){this._path.timePosRots=void 0;return}const s=this.timeStamps.length,o=this.points.length,a=Math.min(s,o),u=[];for(let l=0;l<a;++l)u.push([this.timeStamps[l],this.points[l]]);this._path.timePosRots=u,this.rotationRadius.some(l=>l>0)?(this._path.addAroundPoints(this.rotationRadius,!0),this._path.computeRotIfUndefinedUsingLerp(!0),this._path.rotLerpMode="Lerp"):(this._path.computeRotIfUndefinedUsingPrevLine(!0),this._path.rotLerpMode="Next")},i=this.dv(Ie(this.timeStampsChanged,this.pointsChanged,this.rotationRadiusChanged));n(),this.d(i.don(n))}}get path(){return this._path}get currentPosition(){return this._path.currentPosition}get currentPositionChanged(){return this._currentPositionChanged}get currentRotation(){const t=this._path.currentRotation;if(t)return[sa(t[0]-90),t[1],t[2]]}get currentRotationChanged(){return this._currentRotationChanged}get current(){return{position:this.currentPosition,rotation:this.currentRotation}}get currentChanged(){return this._currentChanged}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Lg([this,"timeStamps"],"时间序列",[],!0),new M([this,"speed"],"线条流速",1),new Pt([this,"materialMode"],[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","pureColor"]],"模式","singleArrow"),new it([this,"rotationRadius"],"拐弯半径")],more:[...t.more,new cn([this,"currentPosition"],"当前位置",void 0,!0,!0)]}}};d(gu,"createDefaultProps",()=>({...It.createDefaultProps(),timeStamps:re(void 0),speed:1,materialMode:"singleArrow",stroked:!0,strokeStyle:wt({width:10,widthType:"world",color:[1,0,.73,1],material:"",materialParams:{arrowColor:[1,1,1,1]},ground:!1}),rotationRadius:[5]})),d(gu,"type",gu.register("ESPath",gu,{chsName:"ESPath",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPath"}));let Ua=gu;const Uo=class Uo extends It{constructor(t){super(t);d(this,"_lineString",this.dv(new Ni));this.components.disposableAdd(this._lineString,!1),this.stroked=!0,this.d(Ui([this.pointsChanged,this.resolutionChanged,this.sharpnessChanged],()=>{try{if(this.points&&this.points.length>=2){const n=ty(this.points,this.resolution,this.sharpness);this._lineString.points=n}else this._lineString.points=void 0}catch(n){console.error(n),this._lineString.points=void 0}},{immediate:!0})),this.d(B([this._lineString,"show"],[this,"show"])),this.d(B([this._lineString,"allowPicking"],[this,"allowPicking"])),this.d(B([this._lineString,"collision"],[this,"collision"])),this.d(B([this._lineString,"stroked"],[this,"stroked"])),this.d(B([this._lineString,"strokeStyle"],[this,"strokeStyle"])),this.d(nt([this._lineString,"flyInParam"],[this,"flyInParam"])),this.d(nt([this._lineString,"flyToParam"],[this,"flyToParam"])),this.d(this.flyInEvent.don(n=>{this._lineString.flyIn(n)})),this.d(this.flyToEvent.don(n=>{this._lineString.flyTo(n)})),this.d(this.calcFlyToParamEvent.don(()=>{this._lineString.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{this._lineString.calcFlyInParam()}))}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new M([this,"resolution"],"解析度",1e3),new M([this,"sharpness"],"锐利度",.85)]}}get lineString(){return this._lineString}};d(Uo,"createDefaultProps",()=>({...It.createDefaultProps(),resolution:1e3,sharpness:.85})),d(Uo,"type",Uo.register("ESGeoBezierSpline",Uo,{chsName:"贝塞尔曲线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"贝塞尔曲线"})),d(Uo,"supportEditingModes",[...It.supportEditingModes,et.LineStringAppend,et.LineStringInsert]);let Kf=Uo;const $s=class $s extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([]),new X([this,"textEditingInteraction"],"文本编辑交互"),new X([this,"textEditing"],"文本编辑"),new M([this,"width"],"宽度",$s.defaults.width,!0),new Uh([this,"text"],"内容",$s.defaults.text,void 0,!0),new Ar([this,"originRatioAndOffset"],"原点比例和偏移"),new M([this,"opacity"],"透明度"),new M([this,"fontSize"],"字体大小"),new Mt([this,"color"],"字体颜色"),new Mt([this,"backgroundColor"],"背景颜色"),new Ar([this,"padding"],"内边距"),new Ar([this,"borderRadius"],"边框圆角"),new Mt([this,"borderColor"],"边框颜色"),new M([this,"borderWidth"],"边框宽度"),new Pt([this,"textAlign"],[["center","center"],["left","left"],["right","right"]],"文字位置"),new Pt([this,"borderStyle"],[["none","none"],["hidden","hidden"],["dotted","dotted"],["dashed","dashed"],["solid","solid"],["double","double"],["groove","groove"],["ridge","ridge"],["inset","inset"],["outset","outset"]],"边框类型")]}}};d($s,"createDefaultProps",()=>({...st.createDefaultProps(),text:"请输入文字",width:80,textEditingInteraction:!1,textEditing:!1,originRatioAndOffset:dt([.5,1,0,0]),opacity:1,fontSize:14,textAlign:"left",color:dt([1,1,1,1]),backgroundColor:dt([0,0,0,.8]),padding:dt([5,5,5,5]),borderRadius:dt([6,6,6,6]),borderWidth:0,borderColor:dt([1,1,1,1]),borderStyle:"solid"})),d($s,"type",$s.register("ESGeoDivTextPoi",$s,{chsName:"图标点",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"图标点"}));let Zf=$s;const mu=class mu extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Mt([this,"color"],"颜色",[1,1,0,1])]}}};d(mu,"createDefaultProps",()=>({...st.createDefaultProps(),color:dt([1,1,0,1])})),d(mu,"type",mu.register("ESCityBasePoint",mu,{chsName:"城市基点(Czm)",tags:["ESObjects","CityObjects","_ES_Impl_Cesium"],description:"城市基点(Czm)"}));let Qf=mu;const xy=`(dataSource) => {
413
413
  var entities = dataSource.entities.values;
414
414
 
415
415
  for (var i = 0; i < entities.length; i++) {
@@ -426,10 +426,10 @@ timePosRots是一个内部包含三个元素的数组,第一个表示时间戳
426
426
  }
427
427
  `,JS=`data 路径都可以使用下面回调函数
428
428
  \`\`\`
429
- ${Iy}
429
+ ${xy}
430
430
  \`\`\`
431
431
 
432
- `,wl=Date.now();new Date(wl).toISOString(),new Date(wl+24*60*60*1e3).toISOString();const Vi=class Vi extends rt{constructor(t){super(t);d(this,"_flyToEvent",this.disposeVar(new O));d(this,"_resetClockEvent",this.disposeVar(new O));this.ad(nt([this,"uri"],[this,"url"]))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new it([this,"url"],"路径","${earthsdk3-assets-script-dir}/assets/misc/simple.czml",void 0,!0),new X([this,"clockEnabled"],"启用",!1),new M([this,"multiplier"],"倍速",Vi.defaults.multiplier),new X([this,"autoResetClock"],"自动设置时钟",!0),new io([this,"startTime"],"开始时间",Vi.defaults.startTime,!0),new io([this,"stopTime"],"结束时间",Vi.defaults.stopTime,!0),new io([this,"currentTime"],"当前时间",Vi.defaults.currentTime,!0),new Pt([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new Pt([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new X([this,"shouldAnimate"],"是否启用动画",!1)],general:[...t.general,new X([this,"show"],"是否显示",!0),new X([this,"collision"],"开启碰撞",!1),new X([this,"allowPicking"],"允许拾取",!1)],more:[...t.more,new lt(["number"],n=>this.flyTo(n),[1e3],"飞入"),new lt([],()=>this.resetClock(),[],"重设时钟"),new Es([this,"loadFuncStr"],"loadFnStr",Iy,JS,!0)]}}};d(Vi,"createDefaultProps",()=>({show:!0,uri:void 0,url:void 0,allowPicking:!1,autoResetClock:!0,clockEnabled:!1,startTime:wl,stopTime:wl+24*60*60*1e3,currentTime:wl,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...rt.createDefaultProps()})),d(Vi,"type",Vi.register("ESCzml",Vi,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let tp=Vi;const vu=class vu extends rt{getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([]),new X([this,"show"],"是否显示"),new M([this,"cssSize"],"尺寸"),new Ae([this,"cssPosition"],"位置"),new Fu([this,"imgUrl"],"图片地址")]}}};d(vu,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:rt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),d(vu,"type",vu.register("ESNavigator",vu,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let ep=vu;const ji=class ji extends rt{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([],"通用","通用"),new X([this,"show"],"是否显示",ji.defaults.show),new M([this,"height"],"高度",ji.defaults.height,!0),new M([this,"fontSize"],"文字大小",ji.defaults.fontSize,!0),new Mt([this,"bgColor"],"背景颜色",ji.defaults.bgColor,!0)]}}};d(ji,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:dt([71/255,71/255,71/255,.8])})),d(ji,"type",ji.register("ESViewerStatusBar",ji,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let np=ji;const Bi=class Bi extends rt{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([],"通用","通用"),new X([this,"show"],"是否显示",Bi.defaults.show),new M([this,"height"],"高度",Bi.defaults.height,!0),new M([this,"fontSize"],"文字大小",Bi.defaults.fontSize,!0),new Mt([this,"bgColor"],"背景颜色",Bi.defaults.bgColor,!0)]}}};d(Bi,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:dt([71/255,71/255,71/255,.8])})),d(Bi,"type",Bi.register("ESViewerStatusBarScale",Bi,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let rp=Bi;const yu=class yu extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"url"],"路径","",!0),new M([this,"progress"],"进度",0,!1,!0)]}}};d(yu,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",progress:0})),d(yu,"type",yu.register("ESGaussianSplatting",yu,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let ip=yu;const Go=class Go extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"mesh"],"mesh地址",Go.defaults.mesh)]}}};d(Go,"createDefaultProps",()=>({...st.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),d(Go,"type",Go.register("ESStaticMesh",Go,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let sp=Go;const _u=class _u extends It{constructor(t){super(t);d(this,"_startEvent",this.dv(new O));d(this,"_clearEvent",this.dv(new O));d(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new Io),this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(B([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(B([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(B([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(B([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(B([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(B([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(B([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new lt([],()=>this.start(),[],"开始分析"),new lt([],()=>this.clear(),[],"清除分析"),new it([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new it([this,"depths"],"深度值",[],void 0,!1,!0),new M([this,"radius"],"半径",1e4,!0)]}}};d(_u,"createDefaultProps",()=>({...It.createDefaultProps(),windowPositions:Hd([]),depths:re([]),radius:j(1e4)})),d(_u,"type",_u.register("ESSkylineAnalysis",_u,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let op=_u;const fs=class fs extends Ht{constructor(e){super(e)}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new it([this,"data"],"数据",[],void 0,!0),new it([this,"gradient"],"渐变",fs.defaults.gradient,void 0,!0),new M([this,"radius"],"半径",fs.defaults.radius,void 0,!0),new M([this,"blur"],"模糊",fs.defaults.blur,!0),new X([this,"is3D"],"is3D",!1,!0)]}}};d(fs,"createDefaultProps",()=>({...Ht.createDefaultProps(),is3D:j(!1),data:Nl([]),gradient:Qt({".5":"green",".7":"yellow",".95":"red"}),radius:j(10),blur:j(.85)})),d(fs,"type",fs.register("ESHeatMap",fs,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let Xc=fs;const Wo=class Wo extends It{constructor(t){super(t);d(this,"editingBindMode","scatter")}};d(Wo,"createDefaultProps",()=>({...It.createDefaultProps(),pointed:!0})),d(Wo,"type",Wo.register("ESGeoPoints",Wo,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),d(Wo,"supportEditingModes",[...It.supportEditingModes,et.ScatterAppend,et.ScatterModify]);let El=Wo;const xy=async(r,e=[],t)=>{const n=[];for(const i of e){const{coordinates:s}=i.geometry;for(const o of s){const a=await Promise.all(o.map(async u=>{let l=u[2]??0;if(t)if(t.type==="absolute")l=t.height??l;else if(t.type==="relative"){const c=await r.getTerrainHeight([u[0],u[1]])??0;l=(t.height??l)+c}else t.type==="terrain"&&(l=await r.getTerrainHeight([u[0],u[1]])??0);return[u[0],u[1],l]}));n.push({...i,points:a})}}return n},Ty=async(r,e=[],t)=>await Promise.all(e.map(async n=>{var u,l,c,h,f,p,v,C,S;const i=((u=n.geometry)==null?void 0:u.x)??((c=(l=n.geometry)==null?void 0:l.coordinates)==null?void 0:c[0]),s=((h=n.geometry)==null?void 0:h.y)??((p=(f=n.geometry)==null?void 0:f.coordinates)==null?void 0:p[1]);let a=((v=n.geometry)==null?void 0:v.z)??((S=(C=n.geometry)==null?void 0:C.coordinates)==null?void 0:S[2])??0;if(t)if(t.type==="absolute")a=t.height??a;else if(t.type==="relative"){const P=await r.getTerrainHeight([i,s])??0;a=(t.height??a)+P}else t.type==="terrain"&&(a=await r.getTerrainHeight([i,s])??0);return{...n,points:[i,s,a]}})),Oy=async(r,e=[],t)=>{const n=[];return await Promise.all(e.map(async i=>{const{coordinates:s}=i.geometry;await Promise.all(s.map(async o=>{const a=await Promise.all(o.map(async u=>{let l=u[2]??0;if(t)if(t.type==="absolute")l=t.height??l;else if(t.type==="relative"){const c=await r.getTerrainHeight([u[0],u[1]])??0;l=(t.height??l)+c}else t.type==="terrain"&&(l=await r.getTerrainHeight([u[0],u[1]])??0);return[u[0],u[1],l]}));n.push({...i,points:a})}))})),n};function $S(r){const e=Qe.lineString(r),t=Qe.length(e),n=Qe.along(e,t/2);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function KS(r,e){const t=Qe.lineString(r),n=Qe.length(t),i=Math.floor(n/e),s=[];if(s.push(r[0]),i<1)return[r[0]];for(let o=1;o<i;o+=1){const a=Qe.along(t,n*(o/i));s.push([a.geometry.coordinates[0],a.geometry.coordinates[1],a.geometry.coordinates[2]||0])}return s}function ZS(r){const e=[...r];JSON.stringify(r[0])!==JSON.stringify(r[r.length-1])&&e.push(r[0]);const t=Qe.polygon([e]),n=Qe.center(t);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function Ny(r,e,t){const n=r.dv(new ja);for(const i in t)i!=="type"&&(n[i]=t[i]);n.position=e,r.d(r.components.disposableAdd(n))}function ap(r,e,t,n){let i=n.textTemplate||n.symbol.text||"";const s=/{{(.*?)}}/;for(;s.test(i);){const c=i.match(s);if(c){const h=c[1].trim(),f=t[`${h}`]||"-";i=i.replace(c[0],f)}}let o=n.symbol;const{minVisibleDistance:a,maxVisibleDistance:u}=n;a&&u&&(o={...o,minVisibleDistance:a,maxVisibleDistance:u});const l={...o,text:i};Ny(r,e,l)}function Ga(r,e){const t={width:null,height:null,color:null,opacity:null,rotation:null};return e.forEach(n=>{n.type==="size"?n.axis==="width"?t.width=r[n.field]||null:n.axis==="height"&&(t.height=r[n.field]||null):n.type==="color"?t.color=r[n.field]||null:n.type==="opacity"?t.opacity=r[n.field]||null:n.type==="rotation"&&(t.rotation=r[n.field]||null)}),t}function up(r,e,t){const i={...e.symbol};if(t&&t.length>0){const s=Ga(r,t);for(let o in s)i[o]!==void 0&&s[o]!==null&&(i[o]=s[o])}return i}function lp(r,e,t){var l,c;const n=e,{uniqueValueInfos:i,field:s,fieldDelimiter:o,defaultSymbol:a}=n;let u={...a};if(Array.isArray(s)){const f=s.map(p=>r[p]??"").join(o);u=((l=i.find(p=>p.value==f))==null?void 0:l.symbol)||a}else u=((c=i.find(h=>h.value==r[s]))==null?void 0:c.symbol)||a;if(t&&t.length>0){const h=Ga(r,t);for(let f in h)u[f]!==void 0&&h[f]!==null&&(u[f]=h[f])}return u}function cp(r,e,t){const n=e,{classBreakInfos:i,field:s,defaultSymbol:o}=n;let a=o;const u=r[s];if(u===void 0||typeof u!="number")a=o;else{const l=i.find(c=>u<=c.maxValue&&u>=c.minValue);l?a=l.symbol:a=o}if(t&&t.length>0){const l=Ga(r,t);for(let c in l)a[c]!==void 0&&l[c]!==null&&(a[c]=l[c])}return a}function QS(r,e){function t(l,c,h,f){const p=w=>w*Math.PI/180,v=w=>w*180/Math.PI,C=p(l),S=p(h),P=p(f-c),y=Math.sin(P)*Math.cos(S),_=Math.cos(C)*Math.sin(S)-Math.sin(C)*Math.cos(S)*Math.cos(P),m=Math.atan2(y,_);return(v(m)+360)%360}function n(l,c,h,f,p){const C=b=>b*Math.PI/180,S=b=>b*180/Math.PI,P=f/6371e3,y=C(p),_=C(l),m=C(c),w=Math.asin(Math.sin(_)*Math.cos(P)+Math.cos(_)*Math.sin(P)*Math.cos(y)),E=m+Math.atan2(Math.sin(y)*Math.sin(P)*Math.cos(_),Math.cos(P)-Math.sin(_)*Math.sin(w));return{lat:S(w),lng:S(E),alt:h}}function i(l){const c=[];l.length>1&&c.push(t(l[0].lat,l[0].lng,l[1].lat,l[1].lng));for(let h=1;h<l.length-1;h++){const f=t(l[h-1].lat,l[h-1].lng,l[h].lat,l[h].lng),p=t(l[h].lat,l[h].lng,l[h+1].lat,l[h+1].lng);let v=(f+p)/2;Math.abs(f-p)>180&&(v=(v+180)%360),c.push(v)}return l.length>1&&c.push(t(l[l.length-2].lat,l[l.length-2].lng,l[l.length-1].lat,l[l.length-1].lng)),l.length===1&&c.push(0),c}if(!r||r.length<2)throw new Error("至少需要两个点才能生成路径");if(e<=0)throw new Error("宽度必须大于0");const s=e/2,o=i(r),a=[],u=[];for(let l=0;l<r.length;l++){const c=(o[l]+90)%360,h=(o[l]+270)%360,f=r[l].alt!==void 0?r[l].alt:0;a.push(n(r[l].lat,r[l].lng,f,s,c)),u.push(n(r[l].lat,r[l].lng,f,s,h))}return a.concat(u.reverse())}function tb(r,e,t,n){function i(C){return C*(Math.PI/180)}const s=6378137,o=i(r),a=i(e),u=i(t),l=i(n),c=u-o,h=l-a,f=Math.sin(c/2)**2+Math.cos(o)*Math.cos(u)*Math.sin(h/2)**2,p=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));return s*p}const Dy=(r,e,t)=>Array.isArray(e)?e.map(s=>r[s]??"").join(t):r[e]??"";function My(r,e){const n={...e.symbol};return{points:r.map(i=>i.points),symbol:n}}function Ry(r,e){const t=e,{uniqueValueInfos:n,field:i,fieldDelimiter:s,defaultSymbol:o}=t,a=[],u=n.reduce((c,h)=>{const f=h.value.toString();return c[f]={points:[],value:h.value,symbol:h.symbol},c},{});for(let c=0;c<r.length;c++){const h=r[c],f=Dy(h,i,s);if(f!==void 0&&f!==""){const p=u[f.toString()];p?p.points.push(h.points):a.push(h.points)}else a.push(h.points)}const l=[];for(let c in u){const{points:h,symbol:f}=u[c];h.length>0&&l.push({points:h,symbol:f})}return a.length>0&&l.push({points:a,symbol:o}),l}function Ly(r,e){const t=e,{classBreakInfos:n,field:i,defaultSymbol:s}=t,o=[],a=n.map(l=>({...l,points:[]}));for(let l=0;l<r.length;l++){const c=r[l],h=c[i];if(h===void 0||typeof h!="number")o.push(c.points);else{const f=a.findIndex(p=>h<=p.maxValue&&h>=p.minValue);f!==-1?a[f].points.push(c.points):o.push(c.points)}}const u=[];return a.forEach(l=>{l.points.length>0&&u.push({points:l.points,symbol:l.symbol})}),o.length>0&&u.push({points:o,symbol:s}),u}function eb(r,e,t=[]){const i={...e.symbol},s=r.map(o=>{const a=Ga(o,t);return{position:o.points,rotation:a.rotation||i.rotation||[0,0,0],scale:i.scale||[1,1,1]}});return{url:i.url,locations:s}}function nb(r,e,t=[]){const n=e,{uniqueValueInfos:i,field:s,fieldDelimiter:o}=n,a=n.defaultSymbol,u=[],l=i.reduce((h,f)=>{const p=f.value.toString();return h[p]={locations:[],value:f.value,symbol:f.symbol},h},{});for(let h=0;h<r.length;h++){const f=r[h],p=Dy(f,s,o);if(p){const v=l[p.toString()];if(v){const C=Ga(f,t);v.locations.push({position:f.points,rotation:C.rotation||a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else u.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else u.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}const c=[];for(let h in l){const{locations:f,symbol:p}=l[h];f.length>0&&c.push({url:p.url,locations:f})}return u.length>0&&c.push({url:a.url,locations:u}),c}function rb(r,e,t=[]){const n=e,{classBreakInfos:i,field:s}=n,o=n.defaultSymbol,a=[],u=i.map(c=>({...c,locations:[]}));for(let c=0;c<r.length;c++){const h=r[c],f=h[s];if(f===void 0||typeof f!="number")a.push({position:h.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const p=u.findIndex(v=>f<=v.maxValue&&f>=v.minValue);if(p!==-1){const v=Ga(h,t);u[p].locations.push({position:h.points,rotation:v.rotation||o.rotation||[0,0,0],scale:u[p].symbol.scale||[1,1,1]})}else a.push({position:h.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const l=[];return u.forEach(c=>{c.locations.length>0&&l.push({url:c.symbol.url,locations:c.locations})}),a.length>0&&l.push({url:o.url,locations:a}),l}class ib extends V{constructor(t,n,i,s){super();d(this,"labelingInfo");this.sceneObject=t;const o=n;if(s&&pi(o,a=>{this.renderLabel(a,s)}),i)if(i.type==="simple"){const{visualVariables:a}=i;if(i.symbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!");const u=My(o,i);this._simplePointAllRender(u.points,u.symbol);return}if(i.symbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!");const u=My(o,i);this._imageAllRender(u.points,u.symbol);return}if(i.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:u,locations:l}=eb(o,i,a);this._modelAllRender(u,l);return}for(let u=0;u<o.length;u++){const l=up(o[u],i,a);this.render(o[u],l)}}else if(i.type==="unique-value"){const{visualVariables:a}=i;if(i.uniqueValueInfos.findIndex(h=>h.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),Ry(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(h=>h.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),Ry(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(h=>h.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),nb(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let h=0;h<o.length;h++){const f=lp(o[h],i,a);this.render(o[h],f)}}else if(i.type==="class-breaks"){const{visualVariables:a}=i;if(i.classBreakInfos.findIndex(h=>h.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),Ly(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.classBreakInfos.findIndex(h=>h.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),Ly(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.classBreakInfos.findIndex(h=>h.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),rb(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let h=0;h<o.length;h++){const f=cp(o[h],i,a);this.render(o[h],f)}}else if(i.type==="heatmap"){const{field:a,fieldValueMax:u,fieldValueMin:l}=i;console.time();const c=o.map(h=>{const{points:f}=h;if(a&&typeof a=="string"){let p=h[a];typeof p=="number"&&(typeof u=="number"&&p>u&&(p=u),typeof l=="number"&&p<l&&(p=l),f[2]=p)}return f});this.renderHeatmap(c,i)}else console.error("PointLayer: renderer type is not supported")}renderLabel(t,n){const{points:i}=t;ap(this.sceneObject,i,t,n)}renderHeatmap(t,n){const{is3D:i,radius:s,blur:o,gradient:a}=n,u=this.dv(new Xc);this.d(this.sceneObject.components.disposableAdd(u)),u.is3D=i,u.radius=s,u.blur=o,a&&(u.gradient={...a}),u.data=t}render(t,n){n.type==="simple-point"?this._simplePointRender(t,n):n.type==="ESImageLabel"?this._simpleImageRender(t,n):n.type==="ESGltfModel"?this._simpleModelRender(t,n):n.type==="ESTextLabel"?Ny(this.sceneObject,t.points,n):n.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(t,n):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(t,n){const{points:i}=t,{size:s,color:o,outlineColor:a,outlineWidth:u}=n,l=this.dv(new El);this.d(this.sceneObject.components.disposableAdd(l)),l.pointed=!0,l.pointOutlineColor=a,l.pointOutlineWidth=u,l.pointSize=s,l.pointColor=o,l.allowPicking=(n==null?void 0:n.allowPicking)??!0,l.extras={selected:!1},l.points=[i]}_simplePointAllRender(t,n){const{size:i,color:s,outlineColor:o,outlineWidth:a}=n,u=this.dv(new El);this.d(this.sceneObject.components.disposableAdd(u)),u.pointed=!0,u.pointOutlineColor=o,u.pointOutlineWidth=a,u.pointSize=i,u.pointColor=s,u.allowPicking=(n==null?void 0:n.allowPicking)??!0,u.points=[...t]}_simpleImageRender(t,n){const{points:i}=t,{rotation:s,offset:o,size:a,url:u,screenRender:l,anchor:c,renderMode:h,rotationType:f}=n,p=this.dv(new zc),v=this.dv(new ja);this.d(this.sceneObject.components.disposableAdd(p)),this.d(this.sceneObject.components.disposableAdd(v)),p.url=u,p.renderMode=h??0,s&&(p.rotation=s),o&&(p.offset=o),p.size=a||[32,32],c&&(p.anchor=c),f&&(p.rotationType=f),p.screenRender=l??!0,p.allowPicking=(n==null?void 0:n.allowPicking)??!0,p.extras={selected:!1},p.position=[...i],p.sizeByContent=!1,v.allowPicking=(n==null?void 0:n.allowPicking)??!0;const C=a?Math.max(...a)+10:Math.max(...p.size)+10;v.sizeByContent=!1,v.screenRender=!0,v.size=[C,C],v.borderRadius=[C,C,C,C],v.padding=[C/2,C/2,C/2,C/2],v.borderWidth=C/10,v.offset=[0,C/10+5],v.text="",v.backgroundColor=[0,0,0,0],v.borderColor=[0,0,0,0]}_imageAllRender(t,n){const i={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:t}}]},s=this.dv(new vl);this.d(this.sceneObject.components.disposableAdd(s));const o=this.dv(new ja);this.d(this.sceneObject.components.disposableAdd(o)),s.textDefaultText="";const{offset:a,size:u,url:l,anchor:c}=n;s.imageUrl=l,c&&(s.imageAnchor=c),a&&(s.imageOffset=a),s.imageSize=u||[32,32],s.url=i,s.allowPicking=(n==null?void 0:n.allowPicking)??!0,s.extras={selected:!1},o.allowPicking=!0;const h=u?Math.max(...u)+10:Math.max(...s.imageSize)+10;o.sizeByContent=!1,o.size=[h,h],o.borderRadius=[h,h,h,h],o.padding=[h/2,h/2,h/2,h/2],o.borderWidth=h/10,o.offset=[0,h/10+5],o.text="",o.backgroundColor=[0,0,0,0],o.borderColor=[0,0,0,0]}_simpleModelRender(t,n){const{points:i}=t,{rotation:s,scale:o,url:a}=n,u=this.dv(new zs);this.d(this.sceneObject.components.disposableAdd(u)),u.url=a,s&&(u.rotation=s),o&&(u.scale=o),u.position=[...i]}_modelAllRender(t,n){const i=this.dv(new zs);this.d(this.sceneObject.components.disposableAdd(i)),i.url=t,i.instances=n}_simpleParticleRender(t,n){const{points:i}=t,s=this.dv(new Uc);this.d(this.sceneObject.components.disposableAdd(s)),s.position=[...i],Object.keys(n).forEach(o=>{s[o]=n[o]})}}class sb extends V{constructor(e,t,n,i){super(),this.sceneObject=e;const s=t;if(i&&pi(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;pi(s,a=>{const u=up(a,n,o);this.render(a,u)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;pi(s,a=>{const u=lp(a,n,o);this.render(a,u)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;pi(s,a=>{const u=cp(a,n,o);this.render(a,u)})}else console.error("PolyLineLayer: renderer type is not supported")}render(e,t){console.log("PolyLineLayer: render",e,t),t.type==="simple-line"?this._simpleLineRender(e,t):t.type==="ESPolygonFence"?this._esPolygonFenceRender(e,t):t.type==="ESPipeFence"?this._esPipeFenceRender(e,t):t.type==="ESPath"?this._esPathRender(e,t):t.type==="ESlineInterpolationModel"?this._eslineInterpolationModelRender(e,t):t.type==="ESlineWall"?this._eslineWallRender(e,t):console.error("PolyLineLayer: symbol type is not supported")}_simpleLineRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new Ni);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.stroked=!0,i.strokeColor=t.color,i.strokeWidth=t.width||1,i.allowPicking=(t==null?void 0:t.allowPicking)??!0,i.extras={selected:!1}}_esPolygonFenceRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new qc);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.height=t.height,i.materialMode=t.materialMode}_esPipeFenceRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new Hc);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.height=t.height,i.width=t.width,i.materialMode=t.materialMode}_esPathRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new Ua),s=this.dv(new za);if(this.d(this.sceneObject.components.disposableAdd(i)),this.d(this.sceneObject.components.disposableAdd(s)),i.points=[...n],i.speed=t.speed,i.strokeColor=t.color,i.materialMode=t.materialMode,i.strokeWidth=t.width||1,t!=null&&t.runModel){const a=t==null?void 0:t.runSpeed,u=t==null?void 0:t.modelSymbol;let l;switch(t==null?void 0:t.runModel){case"ESHuman":l=this.dv(new Po);break;case"ESCar":l=this.dv(new Vc);break;case"ESGltfModel":l=this.dv(new zs)}if(this.d(this.sceneObject.components.disposableAdd(l)),u)for(let h in u)l[h]=u[h];const c=[0];for(var o=0;o<n.length-1;o+=1){const h=n[o],f=n[o+1],p=tb(h[1],h[0],f[1],f[0]);c.push(c[o]+Math.ceil(p/a)*1e3)}i.timeStamps=c,t!=null&&t.runSpeed&&(i.currentPositionChanged.don(h=>{i.currentPosition&&(l.position=i.currentPosition,i.currentRotation&&(l.rotation=i.currentRotation))}),s.startTime=0,s.stopTime=c[c.length-1],s.playing=!0,s.loop=(t==null?void 0:t.runLoop)??!0,s.currentTimeChanged.don(h=>{i.path.currentTime=h}))}}_eslineInterpolationModelRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=(t==null?void 0:t.interpolationDistance)??0;if(!i)return;const s=KS(n,i/1e3),o=this.dv(new zs);this.d(this.sceneObject.components.disposableAdd(o)),o.url=t.url,o.instances=s.map(a=>({position:a,rotation:t.rotation,scale:t.scale}))}_eslineWallRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=t.height??0,s=t.width??0,o=t.extrudedHeight??0,a=n.map(c=>({lng:(c==null?void 0:c[0])??0,lat:(c==null?void 0:c[1])??0,alt:(c==null?void 0:c[2])??0})),u=QS(a,s).map(c=>[(c==null?void 0:c.lng)??0,(c==null?void 0:c.lat)??0,(c==null?void 0:c.alt)??0]),l=this.dv(new Io);this.d(this.sceneObject.components.disposableAdd(l)),l.height=i,l.extrudedHeight=o,l.filled=t.filled??!0,l.fillColor=t.fillColor,l.allowPicking=(t==null?void 0:t.allowPicking)??!0,l.extras={selected:!1},l.points=u}renderLabel(e,t){const{points:n}=e,i=$S(n);ap(this.sceneObject,i,e,t)}}function Fy(r,e){try{JSON.stringify(r[r.length-1])!==JSON.stringify(r[0])&&r.push(r[0]);const t=Qe.featureCollection(r.map(u=>Qe.point(u))),n=Qe.polygon([r]),i={gridType:"point",units:"meters"};return Qe.interpolate(t,e,i).features.map(u=>u.geometry.coordinates)[0][0].filter(u=>Qe.booleanPointInPolygon(Qe.point(u),n))}catch(t){return console.error(t),[]}}class ob extends V{constructor(e,t,n,i){super(),this.sceneObject=e;const s=t;if(i&&pi(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;pi(s,a=>{const u=up(a,n,o);this.render(a,u)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;pi(s,a=>{const u=lp(a,n,o);this.render(a,u)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;pi(s,a=>{const u=cp(a,n,o);this.render(a,u)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(e,t){const{points:n}=e;console.log("PolygonLayer: renderLabel",n);const i=ZS(n);ap(this.sceneObject,i,e,t)}render(e,t){t.type==="simple-fill"?this._simplePolygonRender(e,t):t.type==="ESGeoExtrudedPolygon"?this._esGeoExtrudedPolygonRender(e,t):t.type==="PolygonInterpolateESGltfModel"?this._polygonInterpolateESGltfModelRender(e,t):t.type==="PolygonInterpolateESImageLabel"?this._polygonInterpolateESImageLabelRender(e,t):console.error("PolyLineLayer: symbol type is not supported")}_simplePolygonRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:i,outline:s,filled:o,ground:a}=t,{width:u,color:l,stroked:c}=s,h=this.dv(new Xt);this.d(this.sceneObject.components.disposableAdd(h)),h.stroked=c??!1,h.strokeColor=l??[1,1,1,1],h.strokeWidth=u??1,h.filled=o??!0,h.fillGround=a??!1,h.fillColor=i??[1,1,1,1],h.allowPicking=(t==null?void 0:t.allowPicking)??!0,h.extras={selected:!1},h.points=[...n]}_esGeoExtrudedPolygonRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,extrudedHeight:s,color:o}=t,a=this.dv(new Io);this.d(this.sceneObject.components.disposableAdd(a)),a.height=i,a.extrudedHeight=s,a.filled=!0,a.fillColor=o,a.allowPicking=(t==null?void 0:t.allowPicking)??!0,a.extras={selected:!1},a.points=[...n]}_polygonInterpolateESGltfModelRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:s,url:o,rotation:a,scale:u}=t,l=Fy(n,s??10),c=this.dv(new zs);this.d(this.sceneObject.components.disposableAdd(c)),c.url=o,c.instances=l.map(h=>({position:[...h,i??0],rotation:a??[0,0,0],scale:u??[1,1,1]}))}_polygonInterpolateESImageLabelRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:s,offset:o,size:a,url:u,anchor:l}=t,h={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...Fy(n,s??10).map(p=>[...p,i??0])]}}]},f=this.dv(new vl);this.d(this.sceneObject.components.disposableAdd(f)),f.textDefaultText="",f.imageUrl=u,l&&(f.imageAnchor=l),o&&(f.imageOffset=o),a&&(f.imageSize=a),f.url=h}}class ab extends V{constructor(t,n){super();d(this,"_initEvent",this.dv(new O));const i=this,s=async()=>{try{const a=t.featureProps;if(!a)return;const{heightMode:u,features:l,layerType:c,url:h}=a;let f=[];if(!l&&h){let p=await fetch(h).then(v=>v.json());return p=(p==null?void 0:p.features)??p,c==="polylineVector"?f=await xy(n,p,u):c==="polygonVector"?f=await Oy(n,p,u):c==="pointVector"&&(f=await Ty(n,p,u)),f}else c==="polylineVector"?f=await xy(n,l,u):c==="polygonVector"?f=await Oy(n,l,u):c==="pointVector"&&(f=await Ty(n,l,u));return f}catch(a){console.error(a);return}},o=this.dv(Ie(this._initEvent,t.featurePropsChanged));i.dv(new Ee(o,()=>{if(!t.featureProps)return;const a=t.featureProps;let u;return(async()=>{const{layerType:c,renderer:h,labelingInfo:f}=a,p=await s();!p||p.length===0||(c==="pointVector"?u=new ib(t,p,h,f):c==="polylineVector"?u=new sb(t,p,h,f):c==="polygonVector"&&(u=new ob(t,p,h,f)),console.log("polygonVectorLayer","createLayer",u))})().catch(console.error),{destroy:()=>{var c;(c=u==null?void 0:u.destroy)==null||c.call(u),u=void 0}}}));{const a=(u,l=1)=>{const c=Zv(u);if(!c)return;const{center:h,radius:f}=c;n.flyTo({distance:f*4,heading:0,pitch:-90,flyDuration:l??1,hDelta:0,pDelta:0},h)};i.d(t.flyToEvent.don(async u=>{const{featureProps:l}=t;if(!l)return;const c=await s();if(!c)return;let h=[];l.layerType==="polylineVector"?h=c.map(f=>f.points).flat():l.layerType==="polygonVector"?h=c.map(f=>f.points).flat():l.layerType==="pointVector"&&(h=c.map(f=>f.points)),h.length!==0&&a(h,u)}))}}init(){this._initEvent.emit()}}const wu=class wu extends Ht{constructor(t){super(t);d(this,"featureLayerMap",new Map);const n=this;n.d(n.viewerAttached.don(i=>{if(console.log("ESFeatureLayer","viewerAttached",i.id),n.featureLayerMap.has(i.id))return;const s=new ab(n,i);s.init(),n.featureLayerMap.set(i.id,s)})),n.d(n.viewerDetached.don(i=>{var s;console.log("ESFeatureLayer","viewerDetached",i.id),n.featureLayerMap.has(i.id)&&((s=n.featureLayerMap.get(i.id))==null||s.destroy(),n.featureLayerMap.delete(i.id))})),n.d(()=>{for(const i of n.featureLayerMap.values())i.destroy();n.featureLayerMap.clear()}),n.d(Ui(n.showChanged,()=>{for(const i of n.components.values())Reflect.has(i,"show")&&(i.show=n.show)},{immediate:!0}))}};d(wu,"createDefaultProps",()=>({...Ht.createDefaultProps(),featureProps:Qt(void 0)})),d(wu,"type",wu.register("ESFeatureLayer",wu,{chsName:"矢量图层",tags:["ESObjects"],description:"ESFeatureLayer"}));let hp=wu;const ps=class ps extends V{constructor(){super();d(this,"_loading",!1);d(this,"_loadedEvent",this.disposeVar(new O));d(this,"_loaded",!1);d(this,"_loadedPromiseResolve");d(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));d(this,"_processing",this.disposeVar(Yn(async t=>{if(this._loading=!0,globalThis.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const n=rt.context.getStrFromEnv(ps.path);await t.promise(vh(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})));this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return ps._instance=ps._instance||new ps,ps._instance}};d(ps,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),d(ps,"_instance");let Yc=ps,ub=class extends V{constructor(t,n){super();d(this,"_element");this._complexImage=t,this._videoSrc=n;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden";{const s=()=>{i.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{i.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{i.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}};class lb extends V{constructor(t,n){super();d(this,"_videoDom");d(this,"_processing",this.disposeVar(Yn(async t=>{const{videoSrc:n}=this,i=Yc.instance();await t.promise(i.loadedPromise);const s=globalThis.Hls,o=new s,a=this.element;await to(t,()=>new Promise((u,l)=>{a.xbsjHLS=o,o.attachMedia(a),o.on(s.Events.MEDIA_ATTACHED,()=>{o.loadSource(n),o.on(s.Events.MANIFEST_PARSED,(c,h)=>{a.play(),u()})}),o.on(s.Events.ERROR,(c,h)=>{const{type:f,details:p,fatal:v}=h;v&&(o.destroy(),l(p))})}))})));d(this,"_processingStartup",this._processing.start());this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new ub(this._complexImage,""))}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class Ay extends V{constructor(t,n){super();d(this,"_videoDom");d(this,"_update",this.disposeVar(ea(()=>this.update())));d(this,"_updateStart",this._update.start());this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new lb(this._complexImage,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:i}=this.videoElement;t.size=[n,i],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}const gs=class gs extends V{constructor(){super();d(this,"_loading",!1);d(this,"_loadedEvent",this.disposeVar(new O));d(this,"_loaded",!1);d(this,"_loadedPromiseResolve");d(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));d(this,"_processing",this.disposeVar(Yn(async t=>{if(this._loading=!0,globalThis.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const n=rt.context.getStrFromEnv(gs.path);await t.promise(vh(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})));this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return gs._instance=gs._instance||new gs,gs._instance}};d(gs,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),d(gs,"_instance");let Jc=gs;class cb extends V{constructor(t,n){super();d(this,"_element");this._complexImage=t,this._videoSrc=n;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden";{const s=()=>{i.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{i.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{i.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}}class hb extends V{constructor(t,n){super();d(this,"_videoDom");d(this,"_processing",this.disposeVar(Yn(async t=>{const{videoSrc:n}=this,i=Jc.instance();await t.promise(i.loadedPromise);const s=globalThis.flvjs,o=this.element;await to(t,()=>new Promise((a,u)=>{if(!s.isSupported()){u("flvjs不支持!");return}var l=s.createPlayer({type:"flv",url:n});l.attachMediaElement(o),l.load(),l.play(),o.xbsjFlvPlayer=l}))})));this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new cb(this._complexImage,"")),this._processing.start()}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class ky extends V{constructor(t,n){super();d(this,"_videoDom");d(this,"_update",this.disposeVar(ea(()=>this.update())));d(this,"_updateStart",this._update.start());this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new hb(t,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:i}=this.videoElement;t.size=[n,i],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}function Vy(r){const e=r.substring(r.lastIndexOf(".")+1);return Cl.suffixTypes[e]}class Cl extends V{constructor(){super();d(this,"_enabled",this.disposeVar(j(!1)));d(this,"_uri",this.disposeVar(j("")));d(this,"_type",this.disposeVar(j(void 0)));d(this,"_size",this.disposeVar(re(void 0)));d(this,"_pixelFormat",this.disposeVar(j("RGBA")));d(this,"_flipY",this.disposeVar(j(!0)));d(this,"_crossOriginReact",this.disposeVar(j("")));d(this,"_autoplayReact",this.disposeVar(j(!0)));d(this,"_loopReact",this.disposeVar(j(!0)));d(this,"_copyTextureEvent",this.disposeVar(new O));d(this,"_imageProcessingResettingEvent",this.disposeVar(Ie(this.enabledChanged,this.uriChanged,this.typeChanged)));d(this,"_imageProcessingResetting",this.disposeVar(new Ee(this._imageProcessingResettingEvent,()=>{do{if(!this.enabled||!this.uri)break;let{type:t}=this;if(t||(t=Vy(this.uri)),!t)break;if(t==="img")return new dg(this,this.uri);if(t==="video")return new gg(this,this.uri);if(t==="gif")return new bg(this,this.uri);if(t==="hls")return new Ay(this,this.uri);if(t==="flv")return new ky(this,this.uri)}while(!1)})));d(this,"_createNativeTextureEvent",this.disposeVar(Ie(this.enabledChanged,this.sizeChanged,this.pixelFormatChanged,this.flipYChanged)))}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}get uri(){return this._uri.value}set uri(t){this._uri.value=t}get uriChanged(){return this._uri.changed}get type(){return this._type.value}set type(t){this._type.value=t}get typeChanged(){return this._type.changed}get size(){return this._size.value}set size(t){this._size.value=t}get sizeChanged(){return this._size.changed}get pixelFormat(){return this._pixelFormat.value}set pixelFormat(t){this._pixelFormat.value=t}get pixelFormatChanged(){return this._pixelFormat.changed}get flipY(){return this._flipY.value}set flipY(t){this._flipY.value=t}get flipYChanged(){return this._flipY.changed}get crossOrigin(){return this._crossOriginReact.value}set crossOrigin(t){this._crossOriginReact.value=t}get crossOriginChanged(){return this._crossOriginReact.changed}get autoplay(){return this._autoplayReact.value}set autoplay(t){this._autoplayReact.value=t}get autoplayChanged(){return this._autoplayReact.changed}get loop(){return this._loopReact.value}set loop(t){this._loopReact.value=t}get loopChanged(){return this._loopReact.changed}get copyTextureEvent(){return this._copyTextureEvent}copyTexture(t){this._createNativeTextureEvent.flush(),this._copyTextureEvent.emit(t)}get imageProcessingResetting(){return this._imageProcessingResetting}get createNativeTextureEvent(){return this._createNativeTextureEvent}copyFromCanvas(t){if(t.width<=0||t.height<=0){console.warn("canvas.width <= 0 || canvas.height <= 0");return}this.size=[t.width,t.height],this.pixelFormat="RGBA",this.copyTexture({source:t})}}d(Cl,"types",pg),d(Cl,"czmPixelFormats",fg),d(Cl,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const db=[0,0,0,0];class fb{constructor(){d(this,"_value",[]);d(this,"_valueStr","[]");d(this,"_valueChanged");this.value=[{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}]}get valueChanged(){return this._valueChanged||(this._valueChanged=new O),this._valueChanged}set value(e){if(e.length===0){console.error("value.length === 0");return}let t;if(this._value.length===e.length){const i=[...e].sort((s,o)=>s.ratio-o.ratio);if(t=JSON.stringify(i),this._valueStr===t)return}t=t||JSON.stringify([...e].sort((i,s)=>i.ratio-s.ratio));const n=this._value;if(this._value=JSON.parse(t),this._value.length===0)throw console.error("this._colorStops.length === 0"),new Error("this._colorStops.length === 0");this._valueChanged&&this._valueChanged.emit(this._value,n)}get value(){return JSON.parse(JSON.stringify(this._value))}get valueStr(){return this._valueStr}get minRatio(){return this._value[0].ratio}get maxRatio(){return this._value[this._value.length-1].ratio}_getRatioIndex(e){if(e<this._value[0].ratio||e>this._value[this._value.length-1].ratio)throw console.error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio"),new Error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio");let t=this._value.length;for(let n=0;n<t-1;++n)if(e>=this._value[n].ratio&&e<=this._value[n+1].ratio)return n;throw console.error("shoud not be here!"),new Error("shoud not be here!")}getRatioColor(e,t){e=jl(e,this.minRatio,this.maxRatio);const n=this._getRatioIndex(e),i=this._value[n],s=this._value[n+1],o=(e-i.ratio)/(s.ratio-i.ratio);for(let a=0;a<4;++a)t[a]=i.rgba[a]*(1-o)+s.rgba[a]*o;if(t.some(Number.isNaN)){console.error("result NaN");return}return t}getColorsInUint8(e){if(e.length%4!==0)throw console.error("result.length % 4 !== 0"),new Error("result.length % 4 !== 0");const t=e.length/4,n=1/t;for(let i=0;i<t;++i){const s=db;this.getRatioColor((i+.5)*n,s)||s.splice(0,4,0,0,0,0);for(let o=0;o<4;++o)e[i*4+o]=255*s[o]|0}return e}}class pb extends V{constructor(){super(...arguments);d(this,"registerEngines",{})}register(t,n,i){const s=this.registerEngines[t]||new Map;return s.has(n)&&console.warn(`register warn:${t}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,i),this.registerEngines[t]=s,n}getEngineObjConstructor(t,n){const i=this.registerEngines[n];if(!i)return;let s=t.constructor,o=t.typeName,a=i.get(o);if(a)return a;if(t.components.main)return;const u=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=i.get(o),a)return console.warn(`未找到${u}在${n}中对应的实现类! 使用父类${o}的实现类!`),a}createEngineObject(t,n){const i=this.getEngineObjConstructor(t,n.typeName);if(i){const s=new i(t,n);return s.createdEvent.emit(),s}else{const s=new xo(t,n);return s.createdEvent.emit(),s}}}class gb extends V{constructor(){super(...arguments);d(this,"registerEngines",{})}register(t,n,i){const s=this.registerEngines[t]||new Map;s.has(n)&&console.warn(`register warn:${t}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,i),this.registerEngines[t]=s}getEngineObjConstructor(t,n){const s=(this.registerEngines[n]||new Map).get(t);if(s)return s;console.warn(`未找到${t}在${n}中对应的实现类!`)}createEngineObject(t,n){const i=this.getEngineObjConstructor(t.typeName,n.typeName);if(i){const s=new i(t,n);return s.createdEvent.emit(),s}else{const s=new xo(t,n);return s.createdEvent.emit(),s}}}const Lr=class Lr extends V{constructor(t,n,i=!1){super();d(this,"_createdEvent",this.dv(new O));d(this,"_id",++Lr._accumId);this._sceneObject=t,this._viewer=n;{if(i)return;const s=(o,a)=>{for(let u of o)this._viewer.delete(u);for(let u of a)u.parentID=this.sceneObject.id,this._viewer.add(u)};s([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(s)),this.d(()=>s(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};d(Lr,"context",new pb),d(Lr,"contextEditing",new gb),d(Lr,"register",Lr.context.register.bind(Lr.context)),d(Lr,"registerEditing",Lr.contextEditing.register.bind(Lr.contextEditing)),d(Lr,"_accumId",-1);let xo=Lr;class mb extends V{constructor(){super();d(this,"_tools",new Map);this._tools.set("default",new Map)}_getMcpTool(t){const{description:n,inputSchema:i}=t.params,s=vt.object(i),o=Jy(s);return{name:t.name,description:n,inputSchema:o}}listTools(){return this.groupTools().flatMap(({tools:n})=>n)}groupTools(){return Array.from(this._tools.entries()).map(([n,i])=>({group:n,tools:Array.from(i.values()).map(this._getMcpTool,this)}))}_getGroup(t){return this._tools.has(t)||(console.warn(`group "${t}" does not exist.`),this._tools.set(t,new Map)),this._tools.get(t)}_getTool(t){for(const n of this._tools.values())if(n.has(t))return n.get(t)}_registerTool(t,n="default"){const i=this._getGroup(n);for(const[s,o]of this._tools.entries())if(o.has(t.name)&&s!==n){console.warn(`Tool "${t.name}" is already registered in group "${s}". Tool names must be unique across all groups.`);return}i.has(t.name)&&console.warn(`Tool "${t.name}" is already registered in group "${n}". Now replacing it.`),i.set(t.name,t)}_registerTools(t,n="default"){t.forEach(i=>this._registerTool(i,n))}async callTool(t){try{const{name:n,arguments:i}=t;console.log(`调用工具 ${n},参数:`,i);const s=this._getTool(n);if(!s||!s.func)throw new Error(`Tool "${n}" does not exist.`);const o=await s.func(i);return console.log(`调用工具 ${n} 结果:`,o),o}catch(n){throw console.error(`调用工具 ${t.name} 失败:`,n),n}}}function Ze(r,e){return{content:[{type:"text",text:JSON.stringify({status:"error",msg:e||"执行失败",data:r},null,2)}]}}function Wn(r,e){return{content:[{type:"text",text:JSON.stringify({status:"success",msg:e||"执行成功",data:r},null,2)}]}}const vb=r=>[{name:"flyToGlobalOrChina",params:{description:"相机视角飞行定位到全球视角或中国视角(op=global/china)",inputSchema:{op:vt.enum(["global","china"])}},func:async({op:e})=>{var t;try{let n=[120.363551,28.909792,22191655],i=[.1,-90,0];return e==="china"&&(n=[106.245513,37.209745,9812382],i=[.1,-90,0]),(t=r.activeViewer)==null||t.flyIn(n,i,1),Wn()}catch(n){return Ze(n)}}},{name:"getCurrentCameraInfo",params:{description:"获取当前相机视角下的视角信息",inputSchema:{}},func:async({})=>{var e;try{const t=(e=r.activeViewer)==null?void 0:e.getCurrentCameraInfo();return t?Wn(t):Ze()}catch(t){return Ze(t)}}},{name:"保存或记录当前相机视角信息",params:{description:"保存或记录当前相机视角信息",inputSchema:{}},func:async({})=>{try{return r.cameraViewsManager.addView(),Wn()}catch(e){return Ze(e)}}},{name:"cameraViewsManagerControl",params:{description:"播放(play)或停止(stop)视角播放器(视角控制器/视角轮播)",inputSchema:{op:vt.enum(["play","stop"])}},func:async({op:e})=>{try{return e==="play"?r.cameraViewsManager.playing=!0:r.cameraViewsManager.stop(),Wn()}catch(t){return Ze(t)}}},{name:"flyIn",params:{description:"根据提供的经度、纬度、高度信息(position:[x,y,z]) 、姿态信息(rotation:[h,p,r]) 来改变相机视角位置,实现飞行定位",inputSchema:{position:vt.object({x:vt.number(),y:vt.number(),z:vt.number().optional()}),rotation:vt.object({h:vt.number(),p:vt.number(),r:vt.number()}).optional()}},func:async({position:e,rotation:t})=>{var n;try{const i={position:[e.x,e.y,e.z||100],rotation:[t.h||0,t.p||0,t.r||0]};return(n=r.activeViewer)==null||n.flyIn(i.position,i.rotation),Wn()}catch(i){return Ze(i)}}},{name:"flyToByObjectId",params:{description:"根据提供的对象 id 来改变相机视角位置,实现对象的飞行定位",inputSchema:{id:vt.string()}},func:async({id:e})=>{try{const t=r.getSceneObjectById(e);return t?Reflect.has(t,"flyTo")?(t.flyTo(),Wn()):Ze(`对象 ${t.id} 没有方法 flyTo`):Ze("未查询到该对象")}catch(t){return Ze(t)}}},{name:"changeToMap",params:{description:"漫游模式切换为地图模式(默认方式/正常模式/常规模式/退出漫游模式)",inputSchema:{}},func:async({})=>{var e;try{return(e=r.activeViewer)==null||e.changeToMap(),Wn()}catch(t){return Ze(t)}}},{name:"changeToRotateGlobe",params:{description:"漫游模式切换为全球旋转模式(地球旋转模式), 默认参数:纬度(latitude)38度,高度(height)10000000米,旋转周期(cycleTime)60秒",inputSchema:{latitude:vt.number().optional(),height:vt.number().optional(),cycleTime:vt.number().optional()}},func:async({latitude:e,height:t,cycleTime:n})=>{var i;try{const s={latitude:e||38,height:t||1e7,cycleTime:n||60};return(i=r.activeViewer)==null||i.changeToRotateGlobe(s.latitude,s.height,s.cycleTime),Wn()}catch(s){return Ze(s)}}},{name:"changeToRotatePoint",params:{description:"根据提供的位置点position经纬度高程度坐标([x,y,z],必需),将漫游模式切换为绕点中心旋转模式(绕点旋转模式/点位观察模式),其他参数及默认值:距离(distance)50000米、旋转周期(orbitPeriod)60秒、水平角度(heading)0、俯仰角度(pitch)-30",inputSchema:{position:vt.object({x:vt.number(),y:vt.number(),z:vt.number()}),distance:vt.number().optional(),orbitPeriod:vt.number().optional(),heading:vt.number().optional(),pitch:vt.number().optional()}},func:async({position:e,distance:t,orbitPeriod:n,heading:i,pitch:s})=>{var o;try{const a={position:[e.x,e.y,e.z],distance:t||5e4,orbitPeriod:n||60,heading:i||0,pitch:s||-30};return(o=r.activeViewer)==null||o.changeToRotatePoint(a.position,a.distance,a.orbitPeriod,a.heading,a.pitch),Wn()}catch(a){return Ze(a)}}},{name:"changeToWalk",params:{description:"根据提供的位置点position经纬度高程度坐标([x,y,z],必需),将漫游模式切换为第一人称模式(步行模式/第一人称漫游模式),参数:起始位置经纬度高程(position,必需)、跳跃的 Z 轴速度(jumpZVelocity)、眼睛高度(eyeHeight)",inputSchema:{position:vt.object({x:vt.number(),y:vt.number(),z:vt.number()}),jumpZVelocity:vt.number().optional(),eyeHeight:vt.number().optional()}},func:async({position:e,jumpZVelocity:t,eyeHeight:n})=>{var i;try{const s={position:[e.x,e.y,e.z],jumpZVelocity:t||4.2,eyeHeight:n||1.6};return(i=r.activeViewer)==null||i.changeToWalk(s.position,s.jumpZVelocity,s.eyeHeight),Wn()}catch(s){return Ze(s)}}},{name:"changeToLine",params:{description:"根据提供的线对象id(必需),将漫游模式切换为沿线漫游模式(沿线运动模式), 参数:线条对象id(lineObjectId,必需)、速度(speed)、高度偏移(heightOffset)、是否循环(loop)、转弯速率(turnRateDPS)、线路模式(lineMode)",inputSchema:{lineObjectId:vt.string(),speed:vt.number().optional(),heightOffset:vt.number().optional(),loop:vt.boolean().optional(),turnRateDPS:vt.number().optional(),lineMode:vt.enum(["auto","manual"]).optional()}},func:async({lineObjectId:e,speed:t,heightOffset:n,loop:i,turnRateDPS:s,lineMode:o})=>{var a;try{const u={lineObjectId:e,speed:t||10,heightOffset:n||10,loop:i||!0,turnRateDPS:s||10,lineMode:o||"auto"};return(a=r.activeViewer)==null||a.changeToLine(u.lineObjectId,u.speed,u.heightOffset,u.loop,u.turnRateDPS,u.lineMode),Wn()}catch(u){return Ze(u)}}},{name:"changeToFollow",params:{description:"根据提供的目标对象id(positionObjectId,必需,只能是单点位对象),将漫游模式切换为跟随模式(跟踪模式), 参数: 目标对象id(positionObjectId,必需,只能是单点位对象)、距离(distance)、水平角度(heading)、俯仰角度(pitch)、是否相对旋转(relativeRotation)",inputSchema:{positionObjectId:vt.string(),distance:vt.number().optional(),heading:vt.number().optional(),pitch:vt.number().optional(),relativeRotation:vt.boolean().optional()}},func:async({positionObjectId:e,distance:t,heading:n,pitch:i,relativeRotation:s})=>{var o;try{const a={positionObjectId:e,distance:t||0,heading:n||0,pitch:i||-30,relativeRotation:s||!0};return(o=r.activeViewer)==null||o.changeToFollow(a.positionObjectId,a.distance,a.heading,a.pitch,a.relativeRotation),Wn()}catch(a){return Ze(a)}}},{name:"adjustCamera",params:{description:"相机视角微调,相机拉近(distance=near)、拉远(distance=far)、左移/左转(heading=left)、右移/右转(heading=right)、向上抬(pitch=up)、向下压(pitch=down)、顺时针旋转(roll=clockwise)、逆时针旋转(roll=counterclockwise)",inputSchema:{distance:vt.enum(["far","near"]),heading:vt.enum(["left","right"]),pitch:vt.enum(["up","down"]),roll:vt.enum(["clockwise","counterclockwise"])}},func:async({distance:e,heading:t,pitch:n,roll:i})=>{var s,o;try{const a=(s=r.activeViewer)==null?void 0:s.getCurrentCameraInfo();if(!a)return Ze("Camera info is null");const u={height:e==="near"?a.position[2]-100:a.position[2]+100,heading:t==="left"?a.rotation[0]-10:a.rotation[0]+10,pitch:n==="up"?a.rotation[1]-10:a.rotation[1]+10,roll:i==="clockwise"?a.rotation[2]-10:a.rotation[2]+10},l={position:[a.position[0],a.position[1],u.height],rotation:[u.heading,u.pitch,u.roll]};return(o=r.activeViewer)==null||o.flyIn(l.position,l.rotation),Wn()}catch(a){return Ze(a)}}}],yb=r=>[{name:"getSceneJson",params:{description:"获取整个场景的json数据",inputSchema:{}},func:async()=>({content:[{type:"text",text:JSON.stringify(r.completeJson||"未获取到场景数据",null,2)}]})},{name:"getObjectJsonByName",params:{description:"根据名称来获取某一个对象json数据,查询对象属性名以及属性值",inputSchema:{name:vt.string()}},func:async({name:e})=>{const t=r.getSceneObject();if(Array.isArray(t)){const n=t.filter(i=>i.name.includes(e)).map(i=>i.completeJson);return{content:[{type:"text",text:JSON.stringify(n,null,2)}]}}else return{content:[{type:"text",text:JSON.stringify("未查询到对象",null,2)}]}}},{name:"getObjectJsonById",params:{description:"根据id来获取对象json数据,查询对象属性名以及属性值",inputSchema:{id:vt.string()}},func:async({id:e})=>{var n;const t=((n=r.getSceneObjectById(e))==null?void 0:n.completeJson)||"未查询到对象";return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}},{name:"setObjectProperty",params:{description:"设置对象的属性值,需要对象id,对象属性名,属性值",inputSchema:{id:vt.string(),property:vt.string(),value:vt.any()}},func:async({id:e,property:t,value:n})=>{const i=r.getSceneObjectById(e);if(!i)return{content:[{type:"text",text:JSON.stringify({success:!1,message:`未查询到ID为 ${e} 的对象`},null,2)}]};if(!(t in i))return{content:[{type:"text",text:JSON.stringify({success:!1,message:`对象 ${i.name} 没有属性 ${t}`},null,2)}]};try{return i[t]=n,{content:[{type:"text",text:JSON.stringify({success:!0,message:`成功设置对象 ${i.name} 的 ${t} 属性为 ${JSON.stringify(n)}`,objectId:e,property:t,value:n},null,2)}]}}catch(s){return{content:[{type:"text",text:JSON.stringify({success:!1,message:`设置对象 ${i.name} 的 ${t} 属性时出错`,error:s.message||String(s)},null,2)}]}}}}];function jy(r){return typeof r=="string"?document.getElementById(r):r}function dp(r){if(!r)throw new Error("container is not defined");r.innerHTML="";const e=document.createElement("div");return e.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",r.appendChild(e),e}class By extends V{constructor(t,n){super();d(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=t,this._createSceneObjectListeningFunc=n;const i=this._listeningSceneObjects,s=(o,a)=>{if(o)for(let u of o){const l=i.get(u);l&&(l.destroy(),i.delete(u))}if(a)for(let u of a){if(i.get(u)){console.warn(`listeningSceneObjects已存在某对象:${u.name}`,u);debugger}const c=this.createSceneObjectListeningFunc(u);c&&i.set(u,c)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let o of this._listeningSceneObjects.values())o.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class _b extends V{constructor(e){super(),this._esObjectsManager=e;{const t=this._esObjectsManager;class n extends V{constructor(s){super(),this._esPath=s,this.dv(new Ee(t.activeViewerChanged,()=>{const o=t.activeViewer;if(!o)return;class a extends V{constructor(l){if(super(),this._esPath=l,!o)throw new Error("!viewer");const c=()=>{const h=t.activeViewer;h&&(this._esPath.path.currentTime=h.simulationTime)};c(),this.d(o.simulationTimeChanged.don(c))}}return new a(this._esPath)}))}}this.dv(new By(t.sceneObjectsManager,i=>{if(i instanceof Ua)return new n(i)}))}{const t=this._esObjectsManager;class n extends V{constructor(s){super();const o=()=>{const a=t.activeViewer;a&&(a.simulationTime=s.currentTime??0)};o(),this.d(s.currentTimeChanged.don(o))}}this.dv(new By(t.sceneObjectsManager,i=>{if(i instanceof za)return new n(i)}))}}}class wb extends V{constructor(e){super(),e.forEach(t=>{this.d(t.path.currentPositionChanged.don(n=>{n&&t.sceneObjects.forEach(i=>{Reflect.has(i,"position")&&(i.position=[...n])})})),this.d(t.path.currentRotationChanged.don(n=>{n&&t.sceneObjects.forEach(i=>{Reflect.has(i,"rotation")&&(i.rotation=[...n])})}))})}}class Eb extends V{constructor(t){super();d(this,"_player");d(this,"_channels",this.dv(dt([])));this._objectManager=t,this._player=this._objectManager.player,this.dv(new Ee(this.channelsChanged,()=>{if(this.channels.length===0)return;const n=[];for(let i=0;i<this.channels.length;i++){const s=this.channels[i],o=rt.getSceneObjById(s.pathId);if(!o||!(o instanceof Ua))continue;const u=s.sceneObjectIds.map(l=>rt.getSceneObjById(l)).filter(l=>l!==void 0);u.length!==0&&n.push({path:o,sceneObjects:u})}if(n.length!==0)return new wb(n)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(t){this._channels.value=t}}function $c(r){if(r.data){const{type:e,value:t}=r.data;if(e==="UITreeA"&&t instanceof yn){const{sceneObject:n}=t;if(n)return n.id}}}function Cb(r,e){const{property:t,customEventName:n,otherParams:i}=e,{dragstartDataMananger:s}=r;if(!(t instanceof ia)){if(!(t instanceof Mg)){if(t instanceof pt){const[o,a]=zi(t.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const u=i[0];if(u.preventDefault(),!u.dataTransfer)return;$c(s)?u.dataTransfer.dropEffect="move":u.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");i[0].preventDefault();const l=$c(s);l!==void 0&&a(l)}}else if(t instanceof xg){const[o,a]=zi(t.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const u=i[0];if(u.preventDefault(),!u.dataTransfer)return;$c(s)?u.dataTransfer.dropEffect="move":u.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");const u=i[0].$event,l=i[0].strinsPropDom,c=i[0].index;u.preventDefault();const h=$c(s);if(h!==void 0){l[c].firstChild.value=h;const f=new Event("input",{bubbles:!0,cancelable:!0});l[c].firstChild.dispatchEvent(f)}}}else if(t instanceof Tg){const[o,a]=zi(t.reactVar)}}}}function zy(r,e,t,n){if(t)n.currentActiveEditing=[r,e];else if(n.currentActiveEditing){const[i,s]=n.currentActiveEditing;i===r&&s===e&&(t||(n.currentActiveEditing=void 0))}}const Sb=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class bb extends V{constructor(e,t){super(),this._sceneObject=e;const n=this._sceneObject;for(let i of Sb){const s=i+"Changed",o=n[s];if(o){{const a=n[i];zy(n,i,a,t)}this.dispose(o.disposableOn(a=>zy(n,i,a,t)))}}}get sceneObject(){return this._sceneObject}}class Pb extends V{constructor(){super();d(this,"_currentActiveEditing",this.disposeVar(re(void 0)));d(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((t,n)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),n){const[i,s]=n;i[s]===!0&&(i[s]=!1)}if(t){const[i,s]=t;i[s]=!0}})),rt.context.sceneObjCreatedEvent.don(t=>{t.dv(new bb(t,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(t){this._currentActiveEditing.value=t}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class Ib extends V{constructor(){super();d(this,"_sceneObjects",new Set);d(this,"_sceneObjectsToChange",this.dv(new O));this.d(()=>{const t=ph(this._sceneObjects);t!==0&&console.warn(`场景对象管理器销毁时仍然管理着${t}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(t){return this._sceneObjects.has(t)?(console.warn(`创建失败:对象${t.typeName+":"+t.id}已经存在于场景对象管理器中!}`),!1):(this._sceneObjectsToChange.emit([],[t]),this._sceneObjects.add(t),!0)}deleteSceneObject(t){return this._sceneObjects.has(t)?(this._sceneObjectsToChange.emit([t],[]),this._sceneObjects.delete(t),!0):(console.warn(`删除失败:对象${t.typeName+":"+t.id}不存在于场景对象管理器中!}`),!1)}createSceneObject(t,n){const i=rt.context.createSceneObject(t,n);return i&&this.addSceneObject(i),i}createSceneObjectFromUrl(t,n){const i=rt.context.createSceneObjectFromUrl(t,n);return i&&this.addSceneObject(i),i}createSceneObjectFromClass(t,n){const i=rt.context.createSceneObjectFromClass(t,n);return i&&this.addSceneObject(i),i}createSceneObjectFromJson(t){const n=rt.context.createSceneObjectFromJson(t);return n&&this.addSceneObject(n),n}}class xb extends V{constructor(t){super();d(this,"_enabled",this.dv(j(!1)));d(this,"_cursorPosition",j(void 0));d(this,"quickPickPosition",!0);let n=new V;const i=()=>{n&&(n.destroy(),n=void 0)};this.d(i);const s=()=>{if(i(),!t||!this._enabled.value)return;n=new V;const o=n.dv(j(void 0)),a=n.dv(Ie(o.changed));n.d(t.pointerMoveEvent.don(l=>{l.pointerEvent&&(o.value=ln(l.pointerEvent))}));const u=n.dv(Yn(async l=>{if(o.value)if(this.quickPickPosition){const c=await l.promise(ta(t.quickPickPosition(o.value)));this._cursorPosition.value=c}else{const c=await l.promise(ta(t.pickPosition(o.value)));this._cursorPosition.value=c}}));n.d(a.don(()=>{u.restart()}))};s(),this.d(this._enabled.changed.don(s))}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class Tb extends V{constructor(t){super();d(this,"cursorPositionInfo");this.viewer=t,this.cursorPositionInfo=this.dv(new xb(this.viewer))}}class Ob extends V{constructor(t){super();d(this,"viewer");const n=this.viewer=t;this.ad(new Ee(n.rollerShutterChanged,()=>{const i=n.container;if(!i||!n.rollerShutter)return;const s=new V;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return i.appendChild(o),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(o)}),s}))}getRollerShutterDIV(){let t=document.createElement("div");t.style.position="absolute",t.style.left="50%",t.style.top="0",t.style.backgroundColor="#d3d3d3",t.style.width="5px",t.style.height="100%",t.style.zIndex="9999";const n=i=>{if(!t.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const o=i.x/t.parentElement.offsetWidth;t.style.left=`${100*o}%`,this.viewer.splitPosition=o};return t.addEventListener("mouseenter",i=>{t.style.cursor="ew-resize"}),t.addEventListener("mouseleave",i=>{t.style.cursor="default"}),t.addEventListener("mousedown",i=>{t.style.cursor="ew-resize",document.addEventListener("mousemove",n)}),document.addEventListener("mouseup",i=>{t.style.cursor="default",document.removeEventListener("mousemove",n)}),t}}class Nb extends V{constructor(t){super();d(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new Ob(t))}}function Uy(r,e){return r.length===e.length&&r.every((t,n)=>t===e[n])}class Db extends V{constructor(e){super(),this._viewer=e,this.d(B([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class Mb extends V{constructor(e,t){super(),this._viewer=e,this._activeViewer=t;const n=ri.createCommonProps(),i=[];Object.keys(n).forEach(u=>{const l=this._activeViewer[u+"Changed"];i.push(l)});const s=this.dv(Ie(...i)),o=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(n).forEach(u=>{this._viewer[u]=this._activeViewer[u]})};this.d(s.don(o));const a=this.dv(Ou());a.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const u=this._activeViewer.getCurrentCameraInfo(),l=this._viewer.getCurrentCameraInfo();if(!u)return;const{position:c,rotation:h}=u;l&&Uy(c,l.position)&&Uy(h,l.rotation)||this._viewer.flyIn(c,h,0)}),this.d(()=>a.cancel())}}const Rb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
432
+ `,wl=Date.now();new Date(wl).toISOString(),new Date(wl+24*60*60*1e3).toISOString();const Vi=class Vi extends rt{constructor(t){super(t);d(this,"_flyToEvent",this.disposeVar(new O));d(this,"_resetClockEvent",this.disposeVar(new O));this.ad(nt([this,"uri"],[this,"url"]))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new it([this,"url"],"路径","${earthsdk3-assets-script-dir}/assets/misc/simple.czml",void 0,!0),new X([this,"clockEnabled"],"启用",!1),new M([this,"multiplier"],"倍速",Vi.defaults.multiplier),new X([this,"autoResetClock"],"自动设置时钟",!0),new io([this,"startTime"],"开始时间",Vi.defaults.startTime,!0),new io([this,"stopTime"],"结束时间",Vi.defaults.stopTime,!0),new io([this,"currentTime"],"当前时间",Vi.defaults.currentTime,!0),new Pt([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new Pt([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new X([this,"shouldAnimate"],"是否启用动画",!1)],general:[...t.general,new X([this,"show"],"是否显示",!0),new X([this,"collision"],"开启碰撞",!1),new X([this,"allowPicking"],"允许拾取",!1)],more:[...t.more,new lt(["number"],n=>this.flyTo(n),[1e3],"飞入"),new lt([],()=>this.resetClock(),[],"重设时钟"),new Es([this,"loadFuncStr"],"loadFnStr",xy,JS,!0)]}}};d(Vi,"createDefaultProps",()=>({show:!0,uri:void 0,url:void 0,allowPicking:!1,autoResetClock:!0,clockEnabled:!1,startTime:wl,stopTime:wl+24*60*60*1e3,currentTime:wl,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...rt.createDefaultProps()})),d(Vi,"type",Vi.register("ESCzml",Vi,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let tp=Vi;const vu=class vu extends rt{getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([]),new X([this,"show"],"是否显示"),new M([this,"cssSize"],"尺寸"),new Ae([this,"cssPosition"],"位置"),new Fu([this,"imgUrl"],"图片地址")]}}};d(vu,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:rt.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),d(vu,"type",vu.register("ESNavigator",vu,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let ep=vu;const ji=class ji extends rt{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([],"通用","通用"),new X([this,"show"],"是否显示",ji.defaults.show),new M([this,"height"],"高度",ji.defaults.height,!0),new M([this,"fontSize"],"文字大小",ji.defaults.fontSize,!0),new Mt([this,"bgColor"],"背景颜色",ji.defaults.bgColor,!0)]}}};d(ji,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:dt([71/255,71/255,71/255,.8])})),d(ji,"type",ji.register("ESViewerStatusBar",ji,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let np=ji;const Bi=class Bi extends rt{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([],"通用","通用"),new X([this,"show"],"是否显示",Bi.defaults.show),new M([this,"height"],"高度",Bi.defaults.height,!0),new M([this,"fontSize"],"文字大小",Bi.defaults.fontSize,!0),new Mt([this,"bgColor"],"背景颜色",Bi.defaults.bgColor,!0)]}}};d(Bi,"createDefaultProps",()=>({...rt.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:dt([71/255,71/255,71/255,.8])})),d(Bi,"type",Bi.register("ESViewerStatusBarScale",Bi,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let rp=Bi;const yu=class yu extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"url"],"路径","",!0),new M([this,"progress"],"进度",0,!1,!0)]}}};d(yu,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",progress:0})),d(yu,"type",yu.register("ESGaussianSplatting",yu,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let ip=yu;const Go=class Go extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"mesh"],"mesh地址",Go.defaults.mesh)]}}};d(Go,"createDefaultProps",()=>({...st.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),d(Go,"type",Go.register("ESStaticMesh",Go,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let sp=Go;const _u=class _u extends It{constructor(t){super(t);d(this,"_startEvent",this.dv(new O));d(this,"_clearEvent",this.dv(new O));d(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new Io),this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(B([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(B([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(B([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(B([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(B([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(B([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(B([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new lt([],()=>this.start(),[],"开始分析"),new lt([],()=>this.clear(),[],"清除分析"),new it([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new it([this,"depths"],"深度值",[],void 0,!1,!0),new M([this,"radius"],"半径",1e4,!0)]}}};d(_u,"createDefaultProps",()=>({...It.createDefaultProps(),windowPositions:Hd([]),depths:re([]),radius:j(1e4)})),d(_u,"type",_u.register("ESSkylineAnalysis",_u,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let op=_u;const fs=class fs extends Ht{constructor(e){super(e)}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new it([this,"data"],"数据",[],void 0,!0),new it([this,"gradient"],"渐变",fs.defaults.gradient,void 0,!0),new M([this,"radius"],"半径",fs.defaults.radius,void 0,!0),new M([this,"blur"],"模糊",fs.defaults.blur,!0),new X([this,"is3D"],"is3D",!1,!0)]}}};d(fs,"createDefaultProps",()=>({...Ht.createDefaultProps(),is3D:j(!1),data:Nl([]),gradient:Qt({".5":"green",".7":"yellow",".95":"red"}),radius:j(10),blur:j(.85)})),d(fs,"type",fs.register("ESHeatMap",fs,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let Xc=fs;const Wo=class Wo extends It{constructor(t){super(t);d(this,"editingBindMode","scatter")}};d(Wo,"createDefaultProps",()=>({...It.createDefaultProps(),pointed:!0})),d(Wo,"type",Wo.register("ESGeoPoints",Wo,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),d(Wo,"supportEditingModes",[...It.supportEditingModes,et.ScatterAppend,et.ScatterModify]);let El=Wo;const Ty=async(r,e=[],t)=>{const n=[];for(const i of e){const{coordinates:s}=i.geometry;for(const o of s){const a=await Promise.all(o.map(async u=>{let l=u[2]??0;if(t)if(t.type==="absolute")l=t.height??l;else if(t.type==="relative"){const c=await r.getTerrainHeight([u[0],u[1]])??0;l=(t.height??l)+c}else t.type==="terrain"&&(l=await r.getTerrainHeight([u[0],u[1]])??0);return[u[0],u[1],l]}));n.push({...i,points:a})}}return n},Oy=async(r,e=[],t)=>await Promise.all(e.map(async n=>{var u,l,c,h,f,p,v,C,S;const i=((u=n.geometry)==null?void 0:u.x)??((c=(l=n.geometry)==null?void 0:l.coordinates)==null?void 0:c[0]),s=((h=n.geometry)==null?void 0:h.y)??((p=(f=n.geometry)==null?void 0:f.coordinates)==null?void 0:p[1]);let a=((v=n.geometry)==null?void 0:v.z)??((S=(C=n.geometry)==null?void 0:C.coordinates)==null?void 0:S[2])??0;if(t)if(t.type==="absolute")a=t.height??a;else if(t.type==="relative"){const P=await r.getTerrainHeight([i,s])??0;a=(t.height??a)+P}else t.type==="terrain"&&(a=await r.getTerrainHeight([i,s])??0);return{...n,points:[i,s,a]}})),Ny=async(r,e=[],t)=>{const n=[];return await Promise.all(e.map(async i=>{const{coordinates:s}=i.geometry;await Promise.all(s.map(async o=>{const a=await Promise.all(o.map(async u=>{let l=u[2]??0;if(t)if(t.type==="absolute")l=t.height??l;else if(t.type==="relative"){const c=await r.getTerrainHeight([u[0],u[1]])??0;l=(t.height??l)+c}else t.type==="terrain"&&(l=await r.getTerrainHeight([u[0],u[1]])??0);return[u[0],u[1],l]}));n.push({...i,points:a})}))})),n};function $S(r){const e=Qe.lineString(r),t=Qe.length(e),n=Qe.along(e,t/2);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function KS(r,e){const t=Qe.lineString(r),n=Qe.length(t),i=Math.floor(n/e),s=[];if(s.push(r[0]),i<1)return[r[0]];for(let o=1;o<i;o+=1){const a=Qe.along(t,n*(o/i));s.push([a.geometry.coordinates[0],a.geometry.coordinates[1],a.geometry.coordinates[2]||0])}return s}function ZS(r){const e=[...r];JSON.stringify(r[0])!==JSON.stringify(r[r.length-1])&&e.push(r[0]);const t=Qe.polygon([e]),n=Qe.center(t);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function Dy(r,e,t){const n=r.dv(new ja);for(const i in t)i!=="type"&&(n[i]=t[i]);n.position=e,r.d(r.components.disposableAdd(n))}function ap(r,e,t,n){let i=n.textTemplate||n.symbol.text||"";const s=/{{(.*?)}}/;for(;s.test(i);){const c=i.match(s);if(c){const h=c[1].trim(),f=t[`${h}`]||"-";i=i.replace(c[0],f)}}let o=n.symbol;const{minVisibleDistance:a,maxVisibleDistance:u}=n;a&&u&&(o={...o,minVisibleDistance:a,maxVisibleDistance:u});const l={...o,text:i};Dy(r,e,l)}function Ga(r,e){const t={width:null,height:null,color:null,opacity:null,rotation:null};return e.forEach(n=>{n.type==="size"?n.axis==="width"?t.width=r[n.field]||null:n.axis==="height"&&(t.height=r[n.field]||null):n.type==="color"?t.color=r[n.field]||null:n.type==="opacity"?t.opacity=r[n.field]||null:n.type==="rotation"&&(t.rotation=r[n.field]||null)}),t}function up(r,e,t){const i={...e.symbol};if(t&&t.length>0){const s=Ga(r,t);for(let o in s)i[o]!==void 0&&s[o]!==null&&(i[o]=s[o])}return i}function lp(r,e,t){var l,c;const n=e,{uniqueValueInfos:i,field:s,fieldDelimiter:o,defaultSymbol:a}=n;let u={...a};if(Array.isArray(s)){const f=s.map(p=>r[p]??"").join(o);u=((l=i.find(p=>p.value==f))==null?void 0:l.symbol)||a}else u=((c=i.find(h=>h.value==r[s]))==null?void 0:c.symbol)||a;if(t&&t.length>0){const h=Ga(r,t);for(let f in h)u[f]!==void 0&&h[f]!==null&&(u[f]=h[f])}return u}function cp(r,e,t){const n=e,{classBreakInfos:i,field:s,defaultSymbol:o}=n;let a=o;const u=r[s];if(u===void 0||typeof u!="number")a=o;else{const l=i.find(c=>u<=c.maxValue&&u>=c.minValue);l?a=l.symbol:a=o}if(t&&t.length>0){const l=Ga(r,t);for(let c in l)a[c]!==void 0&&l[c]!==null&&(a[c]=l[c])}return a}function QS(r,e){function t(l,c,h,f){const p=w=>w*Math.PI/180,v=w=>w*180/Math.PI,C=p(l),S=p(h),P=p(f-c),y=Math.sin(P)*Math.cos(S),_=Math.cos(C)*Math.sin(S)-Math.sin(C)*Math.cos(S)*Math.cos(P),m=Math.atan2(y,_);return(v(m)+360)%360}function n(l,c,h,f,p){const C=b=>b*Math.PI/180,S=b=>b*180/Math.PI,P=f/6371e3,y=C(p),_=C(l),m=C(c),w=Math.asin(Math.sin(_)*Math.cos(P)+Math.cos(_)*Math.sin(P)*Math.cos(y)),E=m+Math.atan2(Math.sin(y)*Math.sin(P)*Math.cos(_),Math.cos(P)-Math.sin(_)*Math.sin(w));return{lat:S(w),lng:S(E),alt:h}}function i(l){const c=[];l.length>1&&c.push(t(l[0].lat,l[0].lng,l[1].lat,l[1].lng));for(let h=1;h<l.length-1;h++){const f=t(l[h-1].lat,l[h-1].lng,l[h].lat,l[h].lng),p=t(l[h].lat,l[h].lng,l[h+1].lat,l[h+1].lng);let v=(f+p)/2;Math.abs(f-p)>180&&(v=(v+180)%360),c.push(v)}return l.length>1&&c.push(t(l[l.length-2].lat,l[l.length-2].lng,l[l.length-1].lat,l[l.length-1].lng)),l.length===1&&c.push(0),c}if(!r||r.length<2)throw new Error("至少需要两个点才能生成路径");if(e<=0)throw new Error("宽度必须大于0");const s=e/2,o=i(r),a=[],u=[];for(let l=0;l<r.length;l++){const c=(o[l]+90)%360,h=(o[l]+270)%360,f=r[l].alt!==void 0?r[l].alt:0;a.push(n(r[l].lat,r[l].lng,f,s,c)),u.push(n(r[l].lat,r[l].lng,f,s,h))}return a.concat(u.reverse())}function tb(r,e,t,n){function i(C){return C*(Math.PI/180)}const s=6378137,o=i(r),a=i(e),u=i(t),l=i(n),c=u-o,h=l-a,f=Math.sin(c/2)**2+Math.cos(o)*Math.cos(u)*Math.sin(h/2)**2,p=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));return s*p}const My=(r,e,t)=>Array.isArray(e)?e.map(s=>r[s]??"").join(t):r[e]??"";function Ry(r,e){const n={...e.symbol};return{points:r.map(i=>i.points),symbol:n}}function Ly(r,e){const t=e,{uniqueValueInfos:n,field:i,fieldDelimiter:s,defaultSymbol:o}=t,a=[],u=n.reduce((c,h)=>{const f=h.value.toString();return c[f]={points:[],value:h.value,symbol:h.symbol},c},{});for(let c=0;c<r.length;c++){const h=r[c],f=My(h,i,s);if(f!==void 0&&f!==""){const p=u[f.toString()];p?p.points.push(h.points):a.push(h.points)}else a.push(h.points)}const l=[];for(let c in u){const{points:h,symbol:f}=u[c];h.length>0&&l.push({points:h,symbol:f})}return a.length>0&&l.push({points:a,symbol:o}),l}function Fy(r,e){const t=e,{classBreakInfos:n,field:i,defaultSymbol:s}=t,o=[],a=n.map(l=>({...l,points:[]}));for(let l=0;l<r.length;l++){const c=r[l],h=c[i];if(h===void 0||typeof h!="number")o.push(c.points);else{const f=a.findIndex(p=>h<=p.maxValue&&h>=p.minValue);f!==-1?a[f].points.push(c.points):o.push(c.points)}}const u=[];return a.forEach(l=>{l.points.length>0&&u.push({points:l.points,symbol:l.symbol})}),o.length>0&&u.push({points:o,symbol:s}),u}function eb(r,e,t=[]){const i={...e.symbol},s=r.map(o=>{const a=Ga(o,t);return{position:o.points,rotation:a.rotation||i.rotation||[0,0,0],scale:i.scale||[1,1,1]}});return{url:i.url,locations:s}}function nb(r,e,t=[]){const n=e,{uniqueValueInfos:i,field:s,fieldDelimiter:o}=n,a=n.defaultSymbol,u=[],l=i.reduce((h,f)=>{const p=f.value.toString();return h[p]={locations:[],value:f.value,symbol:f.symbol},h},{});for(let h=0;h<r.length;h++){const f=r[h],p=My(f,s,o);if(p){const v=l[p.toString()];if(v){const C=Ga(f,t);v.locations.push({position:f.points,rotation:C.rotation||a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else u.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else u.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}const c=[];for(let h in l){const{locations:f,symbol:p}=l[h];f.length>0&&c.push({url:p.url,locations:f})}return u.length>0&&c.push({url:a.url,locations:u}),c}function rb(r,e,t=[]){const n=e,{classBreakInfos:i,field:s}=n,o=n.defaultSymbol,a=[],u=i.map(c=>({...c,locations:[]}));for(let c=0;c<r.length;c++){const h=r[c],f=h[s];if(f===void 0||typeof f!="number")a.push({position:h.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const p=u.findIndex(v=>f<=v.maxValue&&f>=v.minValue);if(p!==-1){const v=Ga(h,t);u[p].locations.push({position:h.points,rotation:v.rotation||o.rotation||[0,0,0],scale:u[p].symbol.scale||[1,1,1]})}else a.push({position:h.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const l=[];return u.forEach(c=>{c.locations.length>0&&l.push({url:c.symbol.url,locations:c.locations})}),a.length>0&&l.push({url:o.url,locations:a}),l}class ib extends V{constructor(t,n,i,s){super();d(this,"labelingInfo");this.sceneObject=t;const o=n;if(s&&pi(o,a=>{this.renderLabel(a,s)}),i)if(i.type==="simple"){const{visualVariables:a}=i;if(i.symbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!");const u=Ry(o,i);this._simplePointAllRender(u.points,u.symbol);return}if(i.symbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!");const u=Ry(o,i);this._imageAllRender(u.points,u.symbol);return}if(i.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:u,locations:l}=eb(o,i,a);this._modelAllRender(u,l);return}for(let u=0;u<o.length;u++){const l=up(o[u],i,a);this.render(o[u],l)}}else if(i.type==="unique-value"){const{visualVariables:a}=i;if(i.uniqueValueInfos.findIndex(h=>h.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),Ly(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(h=>h.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),Ly(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(h=>h.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),nb(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let h=0;h<o.length;h++){const f=lp(o[h],i,a);this.render(o[h],f)}}else if(i.type==="class-breaks"){const{visualVariables:a}=i;if(i.classBreakInfos.findIndex(h=>h.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),Fy(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.classBreakInfos.findIndex(h=>h.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),Fy(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.classBreakInfos.findIndex(h=>h.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),rb(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let h=0;h<o.length;h++){const f=cp(o[h],i,a);this.render(o[h],f)}}else if(i.type==="heatmap"){const{field:a,fieldValueMax:u,fieldValueMin:l}=i;console.time();const c=o.map(h=>{const{points:f}=h;if(a&&typeof a=="string"){let p=h[a];typeof p=="number"&&(typeof u=="number"&&p>u&&(p=u),typeof l=="number"&&p<l&&(p=l),f[2]=p)}return f});this.renderHeatmap(c,i)}else console.error("PointLayer: renderer type is not supported")}renderLabel(t,n){const{points:i}=t;ap(this.sceneObject,i,t,n)}renderHeatmap(t,n){const{is3D:i,radius:s,blur:o,gradient:a}=n,u=this.dv(new Xc);this.d(this.sceneObject.components.disposableAdd(u)),u.is3D=i,u.radius=s,u.blur=o,a&&(u.gradient={...a}),u.data=t}render(t,n){n.type==="simple-point"?this._simplePointRender(t,n):n.type==="ESImageLabel"?this._simpleImageRender(t,n):n.type==="ESGltfModel"?this._simpleModelRender(t,n):n.type==="ESTextLabel"?Dy(this.sceneObject,t.points,n):n.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(t,n):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(t,n){const{points:i}=t,{size:s,color:o,outlineColor:a,outlineWidth:u}=n,l=this.dv(new El);this.d(this.sceneObject.components.disposableAdd(l)),l.pointed=!0,l.pointOutlineColor=a,l.pointOutlineWidth=u,l.pointSize=s,l.pointColor=o,l.allowPicking=(n==null?void 0:n.allowPicking)??!0,l.extras={selected:!1},l.points=[i]}_simplePointAllRender(t,n){const{size:i,color:s,outlineColor:o,outlineWidth:a}=n,u=this.dv(new El);this.d(this.sceneObject.components.disposableAdd(u)),u.pointed=!0,u.pointOutlineColor=o,u.pointOutlineWidth=a,u.pointSize=i,u.pointColor=s,u.allowPicking=(n==null?void 0:n.allowPicking)??!0,u.points=[...t]}_simpleImageRender(t,n){const{points:i}=t,{rotation:s,offset:o,size:a,url:u,screenRender:l,anchor:c,renderMode:h,rotationType:f}=n,p=this.dv(new zc),v=this.dv(new ja);this.d(this.sceneObject.components.disposableAdd(p)),this.d(this.sceneObject.components.disposableAdd(v)),p.url=u,p.renderMode=h??0,s&&(p.rotation=s),o&&(p.offset=o),p.size=a||[32,32],c&&(p.anchor=c),f&&(p.rotationType=f),p.screenRender=l??!0,p.allowPicking=(n==null?void 0:n.allowPicking)??!0,p.extras={selected:!1},p.position=[...i],p.sizeByContent=!1,v.allowPicking=(n==null?void 0:n.allowPicking)??!0;const C=a?Math.max(...a)+10:Math.max(...p.size)+10;v.sizeByContent=!1,v.screenRender=!0,v.size=[C,C],v.borderRadius=[C,C,C,C],v.padding=[C/2,C/2,C/2,C/2],v.borderWidth=C/10,v.offset=[0,C/10+5],v.text="",v.backgroundColor=[0,0,0,0],v.borderColor=[0,0,0,0]}_imageAllRender(t,n){const i={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:t}}]},s=this.dv(new vl);this.d(this.sceneObject.components.disposableAdd(s));const o=this.dv(new ja);this.d(this.sceneObject.components.disposableAdd(o)),s.textDefaultText="";const{offset:a,size:u,url:l,anchor:c}=n;s.imageUrl=l,c&&(s.imageAnchor=c),a&&(s.imageOffset=a),s.imageSize=u||[32,32],s.url=i,s.allowPicking=(n==null?void 0:n.allowPicking)??!0,s.extras={selected:!1},o.allowPicking=!0;const h=u?Math.max(...u)+10:Math.max(...s.imageSize)+10;o.sizeByContent=!1,o.size=[h,h],o.borderRadius=[h,h,h,h],o.padding=[h/2,h/2,h/2,h/2],o.borderWidth=h/10,o.offset=[0,h/10+5],o.text="",o.backgroundColor=[0,0,0,0],o.borderColor=[0,0,0,0]}_simpleModelRender(t,n){const{points:i}=t,{rotation:s,scale:o,url:a}=n,u=this.dv(new zs);this.d(this.sceneObject.components.disposableAdd(u)),u.url=a,s&&(u.rotation=s),o&&(u.scale=o),u.position=[...i]}_modelAllRender(t,n){const i=this.dv(new zs);this.d(this.sceneObject.components.disposableAdd(i)),i.url=t,i.instances=n}_simpleParticleRender(t,n){const{points:i}=t,s=this.dv(new Uc);this.d(this.sceneObject.components.disposableAdd(s)),s.position=[...i],Object.keys(n).forEach(o=>{s[o]=n[o]})}}class sb extends V{constructor(e,t,n,i){super(),this.sceneObject=e;const s=t;if(i&&pi(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;pi(s,a=>{const u=up(a,n,o);this.render(a,u)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;pi(s,a=>{const u=lp(a,n,o);this.render(a,u)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;pi(s,a=>{const u=cp(a,n,o);this.render(a,u)})}else console.error("PolyLineLayer: renderer type is not supported")}render(e,t){console.log("PolyLineLayer: render",e,t),t.type==="simple-line"?this._simpleLineRender(e,t):t.type==="ESPolygonFence"?this._esPolygonFenceRender(e,t):t.type==="ESPipeFence"?this._esPipeFenceRender(e,t):t.type==="ESPath"?this._esPathRender(e,t):t.type==="ESlineInterpolationModel"?this._eslineInterpolationModelRender(e,t):t.type==="ESlineWall"?this._eslineWallRender(e,t):console.error("PolyLineLayer: symbol type is not supported")}_simpleLineRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new Ni);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.stroked=!0,i.strokeColor=t.color,i.strokeWidth=t.width||1,i.allowPicking=(t==null?void 0:t.allowPicking)??!0,i.extras={selected:!1}}_esPolygonFenceRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new qc);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.height=t.height,i.materialMode=t.materialMode}_esPipeFenceRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new Hc);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.height=t.height,i.width=t.width,i.materialMode=t.materialMode}_esPathRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new Ua),s=this.dv(new za);if(this.d(this.sceneObject.components.disposableAdd(i)),this.d(this.sceneObject.components.disposableAdd(s)),i.points=[...n],i.speed=t.speed,i.strokeColor=t.color,i.materialMode=t.materialMode,i.strokeWidth=t.width||1,t!=null&&t.runModel){const a=t==null?void 0:t.runSpeed,u=t==null?void 0:t.modelSymbol;let l;switch(t==null?void 0:t.runModel){case"ESHuman":l=this.dv(new Po);break;case"ESCar":l=this.dv(new Vc);break;case"ESGltfModel":l=this.dv(new zs)}if(this.d(this.sceneObject.components.disposableAdd(l)),u)for(let h in u)l[h]=u[h];const c=[0];for(var o=0;o<n.length-1;o+=1){const h=n[o],f=n[o+1],p=tb(h[1],h[0],f[1],f[0]);c.push(c[o]+Math.ceil(p/a)*1e3)}i.timeStamps=c,t!=null&&t.runSpeed&&(i.currentPositionChanged.don(h=>{i.currentPosition&&(l.position=i.currentPosition,i.currentRotation&&(l.rotation=i.currentRotation))}),s.startTime=0,s.stopTime=c[c.length-1],s.playing=!0,s.loop=(t==null?void 0:t.runLoop)??!0,s.currentTimeChanged.don(h=>{i.path.currentTime=h}))}}_eslineInterpolationModelRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=(t==null?void 0:t.interpolationDistance)??0;if(!i)return;const s=KS(n,i/1e3),o=this.dv(new zs);this.d(this.sceneObject.components.disposableAdd(o)),o.url=t.url,o.instances=s.map(a=>({position:a,rotation:t.rotation,scale:t.scale}))}_eslineWallRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=t.height??0,s=t.width??0,o=t.extrudedHeight??0,a=n.map(c=>({lng:(c==null?void 0:c[0])??0,lat:(c==null?void 0:c[1])??0,alt:(c==null?void 0:c[2])??0})),u=QS(a,s).map(c=>[(c==null?void 0:c.lng)??0,(c==null?void 0:c.lat)??0,(c==null?void 0:c.alt)??0]),l=this.dv(new Io);this.d(this.sceneObject.components.disposableAdd(l)),l.height=i,l.extrudedHeight=o,l.filled=t.filled??!0,l.fillColor=t.fillColor,l.allowPicking=(t==null?void 0:t.allowPicking)??!0,l.extras={selected:!1},l.points=u}renderLabel(e,t){const{points:n}=e,i=$S(n);ap(this.sceneObject,i,e,t)}}function Ay(r,e){try{JSON.stringify(r[r.length-1])!==JSON.stringify(r[0])&&r.push(r[0]);const t=Qe.featureCollection(r.map(u=>Qe.point(u))),n=Qe.polygon([r]),i={gridType:"point",units:"meters"};return Qe.interpolate(t,e,i).features.map(u=>u.geometry.coordinates)[0][0].filter(u=>Qe.booleanPointInPolygon(Qe.point(u),n))}catch(t){return console.error(t),[]}}class ob extends V{constructor(e,t,n,i){super(),this.sceneObject=e;const s=t;if(i&&pi(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;pi(s,a=>{const u=up(a,n,o);this.render(a,u)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;pi(s,a=>{const u=lp(a,n,o);this.render(a,u)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;pi(s,a=>{const u=cp(a,n,o);this.render(a,u)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(e,t){const{points:n}=e;console.log("PolygonLayer: renderLabel",n);const i=ZS(n);ap(this.sceneObject,i,e,t)}render(e,t){t.type==="simple-fill"?this._simplePolygonRender(e,t):t.type==="ESGeoExtrudedPolygon"?this._esGeoExtrudedPolygonRender(e,t):t.type==="PolygonInterpolateESGltfModel"?this._polygonInterpolateESGltfModelRender(e,t):t.type==="PolygonInterpolateESImageLabel"?this._polygonInterpolateESImageLabelRender(e,t):console.error("PolyLineLayer: symbol type is not supported")}_simplePolygonRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:i,outline:s,filled:o,ground:a}=t,{width:u,color:l,stroked:c}=s,h=this.dv(new Xt);this.d(this.sceneObject.components.disposableAdd(h)),h.stroked=c??!1,h.strokeColor=l??[1,1,1,1],h.strokeWidth=u??1,h.filled=o??!0,h.fillGround=a??!1,h.fillColor=i??[1,1,1,1],h.allowPicking=(t==null?void 0:t.allowPicking)??!0,h.extras={selected:!1},h.points=[...n]}_esGeoExtrudedPolygonRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,extrudedHeight:s,color:o}=t,a=this.dv(new Io);this.d(this.sceneObject.components.disposableAdd(a)),a.height=i,a.extrudedHeight=s,a.filled=!0,a.fillColor=o,a.allowPicking=(t==null?void 0:t.allowPicking)??!0,a.extras={selected:!1},a.points=[...n]}_polygonInterpolateESGltfModelRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:s,url:o,rotation:a,scale:u}=t,l=Ay(n,s??10),c=this.dv(new zs);this.d(this.sceneObject.components.disposableAdd(c)),c.url=o,c.instances=l.map(h=>({position:[...h,i??0],rotation:a??[0,0,0],scale:u??[1,1,1]}))}_polygonInterpolateESImageLabelRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:s,offset:o,size:a,url:u,anchor:l}=t,h={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...Ay(n,s??10).map(p=>[...p,i??0])]}}]},f=this.dv(new vl);this.d(this.sceneObject.components.disposableAdd(f)),f.textDefaultText="",f.imageUrl=u,l&&(f.imageAnchor=l),o&&(f.imageOffset=o),a&&(f.imageSize=a),f.url=h}}class ab extends V{constructor(t,n){super();d(this,"_initEvent",this.dv(new O));const i=this,s=async()=>{try{const a=t.featureProps;if(!a)return;const{heightMode:u,features:l,layerType:c,url:h}=a;let f=[];if(!l&&h){let p=await fetch(h).then(v=>v.json());return p=(p==null?void 0:p.features)??p,c==="polylineVector"?f=await Ty(n,p,u):c==="polygonVector"?f=await Ny(n,p,u):c==="pointVector"&&(f=await Oy(n,p,u)),f}else c==="polylineVector"?f=await Ty(n,l,u):c==="polygonVector"?f=await Ny(n,l,u):c==="pointVector"&&(f=await Oy(n,l,u));return f}catch(a){console.error(a);return}},o=this.dv(Ie(this._initEvent,t.featurePropsChanged));i.dv(new Ee(o,()=>{if(!t.featureProps)return;const a=t.featureProps;let u;return(async()=>{const{layerType:c,renderer:h,labelingInfo:f}=a,p=await s();!p||p.length===0||(c==="pointVector"?u=new ib(t,p,h,f):c==="polylineVector"?u=new sb(t,p,h,f):c==="polygonVector"&&(u=new ob(t,p,h,f)),console.log("polygonVectorLayer","createLayer",u))})().catch(console.error),{destroy:()=>{var c;(c=u==null?void 0:u.destroy)==null||c.call(u),u=void 0}}}));{const a=(u,l=1)=>{const c=Zv(u);if(!c)return;const{center:h,radius:f}=c;n.flyTo({distance:f*4,heading:0,pitch:-90,flyDuration:l??1,hDelta:0,pDelta:0},h)};i.d(t.flyToEvent.don(async u=>{const{featureProps:l}=t;if(!l)return;const c=await s();if(!c)return;let h=[];l.layerType==="polylineVector"?h=c.map(f=>f.points).flat():l.layerType==="polygonVector"?h=c.map(f=>f.points).flat():l.layerType==="pointVector"&&(h=c.map(f=>f.points)),h.length!==0&&a(h,u)}))}}init(){this._initEvent.emit()}}const wu=class wu extends Ht{constructor(t){super(t);d(this,"featureLayerMap",new Map);const n=this;n.d(n.viewerAttached.don(i=>{if(console.log("ESFeatureLayer","viewerAttached",i.id),n.featureLayerMap.has(i.id))return;const s=new ab(n,i);s.init(),n.featureLayerMap.set(i.id,s)})),n.d(n.viewerDetached.don(i=>{var s;console.log("ESFeatureLayer","viewerDetached",i.id),n.featureLayerMap.has(i.id)&&((s=n.featureLayerMap.get(i.id))==null||s.destroy(),n.featureLayerMap.delete(i.id))})),n.d(()=>{for(const i of n.featureLayerMap.values())i.destroy();n.featureLayerMap.clear()}),n.d(Ui(n.showChanged,()=>{for(const i of n.components.values())Reflect.has(i,"show")&&(i.show=n.show)},{immediate:!0}))}};d(wu,"createDefaultProps",()=>({...Ht.createDefaultProps(),featureProps:Qt(void 0)})),d(wu,"type",wu.register("ESFeatureLayer",wu,{chsName:"矢量图层",tags:["ESObjects"],description:"ESFeatureLayer"}));let hp=wu;const ps=class ps extends V{constructor(){super();d(this,"_loading",!1);d(this,"_loadedEvent",this.disposeVar(new O));d(this,"_loaded",!1);d(this,"_loadedPromiseResolve");d(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));d(this,"_processing",this.disposeVar(Yn(async t=>{if(this._loading=!0,globalThis.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const n=rt.context.getStrFromEnv(ps.path);await t.promise(vh(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})));this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return ps._instance=ps._instance||new ps,ps._instance}};d(ps,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),d(ps,"_instance");let Yc=ps,ub=class extends V{constructor(t,n){super();d(this,"_element");this._complexImage=t,this._videoSrc=n;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden";{const s=()=>{i.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{i.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{i.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}};class lb extends V{constructor(t,n){super();d(this,"_videoDom");d(this,"_processing",this.disposeVar(Yn(async t=>{const{videoSrc:n}=this,i=Yc.instance();await t.promise(i.loadedPromise);const s=globalThis.Hls,o=new s,a=this.element;await to(t,()=>new Promise((u,l)=>{a.xbsjHLS=o,o.attachMedia(a),o.on(s.Events.MEDIA_ATTACHED,()=>{o.loadSource(n),o.on(s.Events.MANIFEST_PARSED,(c,h)=>{a.play(),u()})}),o.on(s.Events.ERROR,(c,h)=>{const{type:f,details:p,fatal:v}=h;v&&(o.destroy(),l(p))})}))})));d(this,"_processingStartup",this._processing.start());this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new ub(this._complexImage,""))}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class ky extends V{constructor(t,n){super();d(this,"_videoDom");d(this,"_update",this.disposeVar(ea(()=>this.update())));d(this,"_updateStart",this._update.start());this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new lb(this._complexImage,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:i}=this.videoElement;t.size=[n,i],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}const gs=class gs extends V{constructor(){super();d(this,"_loading",!1);d(this,"_loadedEvent",this.disposeVar(new O));d(this,"_loaded",!1);d(this,"_loadedPromiseResolve");d(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));d(this,"_processing",this.disposeVar(Yn(async t=>{if(this._loading=!0,globalThis.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const n=rt.context.getStrFromEnv(gs.path);await t.promise(vh(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})));this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return gs._instance=gs._instance||new gs,gs._instance}};d(gs,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),d(gs,"_instance");let Jc=gs;class cb extends V{constructor(t,n){super();d(this,"_element");this._complexImage=t,this._videoSrc=n;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden";{const s=()=>{i.crossOrigin=this._complexImage.crossOrigin};s(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(s))}{const s=()=>{i.autoplay=this._complexImage.autoplay};s(),this.dispose(this._complexImage.autoplayChanged.disposableOn(s))}{const s=()=>{i.loop=this._complexImage.loop};s(),this.dispose(this._complexImage.loopChanged.disposableOn(s))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}}class hb extends V{constructor(t,n){super();d(this,"_videoDom");d(this,"_processing",this.disposeVar(Yn(async t=>{const{videoSrc:n}=this,i=Jc.instance();await t.promise(i.loadedPromise);const s=globalThis.flvjs,o=this.element;await to(t,()=>new Promise((a,u)=>{if(!s.isSupported()){u("flvjs不支持!");return}var l=s.createPlayer({type:"flv",url:n});l.attachMediaElement(o),l.load(),l.play(),o.xbsjFlvPlayer=l}))})));this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new cb(this._complexImage,"")),this._processing.start()}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class Vy extends V{constructor(t,n){super();d(this,"_videoDom");d(this,"_update",this.disposeVar(ea(()=>this.update())));d(this,"_updateStart",this._update.start());this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new hb(t,this._imageUri))}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:i}=this.videoElement;t.size=[n,i],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}function jy(r){const e=r.substring(r.lastIndexOf(".")+1);return Cl.suffixTypes[e]}class Cl extends V{constructor(){super();d(this,"_enabled",this.disposeVar(j(!1)));d(this,"_uri",this.disposeVar(j("")));d(this,"_type",this.disposeVar(j(void 0)));d(this,"_size",this.disposeVar(re(void 0)));d(this,"_pixelFormat",this.disposeVar(j("RGBA")));d(this,"_flipY",this.disposeVar(j(!0)));d(this,"_crossOriginReact",this.disposeVar(j("")));d(this,"_autoplayReact",this.disposeVar(j(!0)));d(this,"_loopReact",this.disposeVar(j(!0)));d(this,"_copyTextureEvent",this.disposeVar(new O));d(this,"_imageProcessingResettingEvent",this.disposeVar(Ie(this.enabledChanged,this.uriChanged,this.typeChanged)));d(this,"_imageProcessingResetting",this.disposeVar(new Ee(this._imageProcessingResettingEvent,()=>{do{if(!this.enabled||!this.uri)break;let{type:t}=this;if(t||(t=jy(this.uri)),!t)break;if(t==="img")return new dg(this,this.uri);if(t==="video")return new gg(this,this.uri);if(t==="gif")return new bg(this,this.uri);if(t==="hls")return new ky(this,this.uri);if(t==="flv")return new Vy(this,this.uri)}while(!1)})));d(this,"_createNativeTextureEvent",this.disposeVar(Ie(this.enabledChanged,this.sizeChanged,this.pixelFormatChanged,this.flipYChanged)))}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}get uri(){return this._uri.value}set uri(t){this._uri.value=t}get uriChanged(){return this._uri.changed}get type(){return this._type.value}set type(t){this._type.value=t}get typeChanged(){return this._type.changed}get size(){return this._size.value}set size(t){this._size.value=t}get sizeChanged(){return this._size.changed}get pixelFormat(){return this._pixelFormat.value}set pixelFormat(t){this._pixelFormat.value=t}get pixelFormatChanged(){return this._pixelFormat.changed}get flipY(){return this._flipY.value}set flipY(t){this._flipY.value=t}get flipYChanged(){return this._flipY.changed}get crossOrigin(){return this._crossOriginReact.value}set crossOrigin(t){this._crossOriginReact.value=t}get crossOriginChanged(){return this._crossOriginReact.changed}get autoplay(){return this._autoplayReact.value}set autoplay(t){this._autoplayReact.value=t}get autoplayChanged(){return this._autoplayReact.changed}get loop(){return this._loopReact.value}set loop(t){this._loopReact.value=t}get loopChanged(){return this._loopReact.changed}get copyTextureEvent(){return this._copyTextureEvent}copyTexture(t){this._createNativeTextureEvent.flush(),this._copyTextureEvent.emit(t)}get imageProcessingResetting(){return this._imageProcessingResetting}get createNativeTextureEvent(){return this._createNativeTextureEvent}copyFromCanvas(t){if(t.width<=0||t.height<=0){console.warn("canvas.width <= 0 || canvas.height <= 0");return}this.size=[t.width,t.height],this.pixelFormat="RGBA",this.copyTexture({source:t})}}d(Cl,"types",pg),d(Cl,"czmPixelFormats",fg),d(Cl,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const db=[0,0,0,0];class fb{constructor(){d(this,"_value",[]);d(this,"_valueStr","[]");d(this,"_valueChanged");this.value=[{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}]}get valueChanged(){return this._valueChanged||(this._valueChanged=new O),this._valueChanged}set value(e){if(e.length===0){console.error("value.length === 0");return}let t;if(this._value.length===e.length){const i=[...e].sort((s,o)=>s.ratio-o.ratio);if(t=JSON.stringify(i),this._valueStr===t)return}t=t||JSON.stringify([...e].sort((i,s)=>i.ratio-s.ratio));const n=this._value;if(this._value=JSON.parse(t),this._value.length===0)throw console.error("this._colorStops.length === 0"),new Error("this._colorStops.length === 0");this._valueChanged&&this._valueChanged.emit(this._value,n)}get value(){return JSON.parse(JSON.stringify(this._value))}get valueStr(){return this._valueStr}get minRatio(){return this._value[0].ratio}get maxRatio(){return this._value[this._value.length-1].ratio}_getRatioIndex(e){if(e<this._value[0].ratio||e>this._value[this._value.length-1].ratio)throw console.error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio"),new Error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio");let t=this._value.length;for(let n=0;n<t-1;++n)if(e>=this._value[n].ratio&&e<=this._value[n+1].ratio)return n;throw console.error("shoud not be here!"),new Error("shoud not be here!")}getRatioColor(e,t){e=jl(e,this.minRatio,this.maxRatio);const n=this._getRatioIndex(e),i=this._value[n],s=this._value[n+1],o=(e-i.ratio)/(s.ratio-i.ratio);for(let a=0;a<4;++a)t[a]=i.rgba[a]*(1-o)+s.rgba[a]*o;if(t.some(Number.isNaN)){console.error("result NaN");return}return t}getColorsInUint8(e){if(e.length%4!==0)throw console.error("result.length % 4 !== 0"),new Error("result.length % 4 !== 0");const t=e.length/4,n=1/t;for(let i=0;i<t;++i){const s=db;this.getRatioColor((i+.5)*n,s)||s.splice(0,4,0,0,0,0);for(let o=0;o<4;++o)e[i*4+o]=255*s[o]|0}return e}}class pb extends V{constructor(){super(...arguments);d(this,"registerEngines",{})}register(t,n,i){const s=this.registerEngines[t]||new Map;return s.has(n)&&console.warn(`register warn:${t}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,i),this.registerEngines[t]=s,n}getEngineObjConstructor(t,n){const i=this.registerEngines[n];if(!i)return;let s=t.constructor,o=t.typeName,a=i.get(o);if(a)return a;if(t.components.main)return;const u=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=i.get(o),a)return console.warn(`未找到${u}在${n}中对应的实现类! 使用父类${o}的实现类!`),a}createEngineObject(t,n){const i=this.getEngineObjConstructor(t,n.typeName);if(i){const s=new i(t,n);return s.createdEvent.emit(),s}else{const s=new xo(t,n);return s.createdEvent.emit(),s}}}class gb extends V{constructor(){super(...arguments);d(this,"registerEngines",{})}register(t,n,i){const s=this.registerEngines[t]||new Map;s.has(n)&&console.warn(`register warn:${t}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,i),this.registerEngines[t]=s}getEngineObjConstructor(t,n){const s=(this.registerEngines[n]||new Map).get(t);if(s)return s;console.warn(`未找到${t}在${n}中对应的实现类!`)}createEngineObject(t,n){const i=this.getEngineObjConstructor(t.typeName,n.typeName);if(i){const s=new i(t,n);return s.createdEvent.emit(),s}else{const s=new xo(t,n);return s.createdEvent.emit(),s}}}const Lr=class Lr extends V{constructor(t,n,i=!1){super();d(this,"_createdEvent",this.dv(new O));d(this,"_id",++Lr._accumId);this._sceneObject=t,this._viewer=n;{if(i)return;const s=(o,a)=>{for(let u of o)this._viewer.delete(u);for(let u of a)u.parentID=this.sceneObject.id,this._viewer.add(u)};s([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(s)),this.d(()=>s(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};d(Lr,"context",new pb),d(Lr,"contextEditing",new gb),d(Lr,"register",Lr.context.register.bind(Lr.context)),d(Lr,"registerEditing",Lr.contextEditing.register.bind(Lr.contextEditing)),d(Lr,"_accumId",-1);let xo=Lr;class mb extends V{constructor(){super();d(this,"_tools",new Map);this._tools.set("default",new Map)}_getMcpTool(t){const{description:n,inputSchema:i}=t.params,s=vt.object(i),o=$y(s);return{name:t.name,description:n,inputSchema:o}}listTools(){return this.groupTools().flatMap(({tools:n})=>n)}groupTools(){return Array.from(this._tools.entries()).map(([n,i])=>({group:n,tools:Array.from(i.values()).map(this._getMcpTool,this)}))}_getGroup(t){return this._tools.has(t)||(console.warn(`group "${t}" does not exist.`),this._tools.set(t,new Map)),this._tools.get(t)}_getTool(t){for(const n of this._tools.values())if(n.has(t))return n.get(t)}_registerTool(t,n="default"){const i=this._getGroup(n);for(const[s,o]of this._tools.entries())if(o.has(t.name)&&s!==n){console.warn(`Tool "${t.name}" is already registered in group "${s}". Tool names must be unique across all groups.`);return}i.has(t.name)&&console.warn(`Tool "${t.name}" is already registered in group "${n}". Now replacing it.`),i.set(t.name,t)}_registerTools(t,n="default"){t.forEach(i=>this._registerTool(i,n))}async callTool(t){try{const{name:n,arguments:i}=t;console.log(`调用工具 ${n},参数:`,i);const s=this._getTool(n);if(!s||!s.func)throw new Error(`Tool "${n}" does not exist.`);const o=await s.func(i);return console.log(`调用工具 ${n} 结果:`,o),o}catch(n){throw console.error(`调用工具 ${t.name} 失败:`,n),n}}}function Ze(r,e){return{content:[{type:"text",text:JSON.stringify({status:"error",msg:e||"执行失败",data:r},null,2)}]}}function Wn(r,e){return{content:[{type:"text",text:JSON.stringify({status:"success",msg:e||"执行成功",data:r},null,2)}]}}const vb=r=>[{name:"flyToGlobalOrChina",params:{description:"相机视角飞行定位到全球视角或中国视角(op=global/china)",inputSchema:{op:vt.enum(["global","china"])}},func:async({op:e})=>{var t;try{let n=[120.363551,28.909792,22191655],i=[.1,-90,0];return e==="china"&&(n=[106.245513,37.209745,9812382],i=[.1,-90,0]),(t=r.activeViewer)==null||t.flyIn(n,i,1),Wn()}catch(n){return Ze(n)}}},{name:"getCurrentCameraInfo",params:{description:"获取当前相机视角下的视角信息",inputSchema:{}},func:async({})=>{var e;try{const t=(e=r.activeViewer)==null?void 0:e.getCurrentCameraInfo();return t?Wn(t):Ze()}catch(t){return Ze(t)}}},{name:"保存或记录当前相机视角信息",params:{description:"保存或记录当前相机视角信息",inputSchema:{}},func:async({})=>{try{return r.cameraViewsManager.addView(),Wn()}catch(e){return Ze(e)}}},{name:"cameraViewsManagerControl",params:{description:"播放(play)或停止(stop)视角播放器(视角控制器/视角轮播)",inputSchema:{op:vt.enum(["play","stop"])}},func:async({op:e})=>{try{return e==="play"?r.cameraViewsManager.playing=!0:r.cameraViewsManager.stop(),Wn()}catch(t){return Ze(t)}}},{name:"flyIn",params:{description:"根据提供的经度、纬度、高度信息(position:[x,y,z]) 、姿态信息(rotation:[h,p,r]) 来改变相机视角位置,实现飞行定位",inputSchema:{position:vt.object({x:vt.number(),y:vt.number(),z:vt.number().optional()}),rotation:vt.object({h:vt.number(),p:vt.number(),r:vt.number()}).optional()}},func:async({position:e,rotation:t})=>{var n;try{const i={position:[e.x,e.y,e.z||100],rotation:[t.h||0,t.p||0,t.r||0]};return(n=r.activeViewer)==null||n.flyIn(i.position,i.rotation),Wn()}catch(i){return Ze(i)}}},{name:"flyToByObjectId",params:{description:"根据提供的对象 id 来改变相机视角位置,实现对象的飞行定位",inputSchema:{id:vt.string()}},func:async({id:e})=>{try{const t=r.getSceneObjectById(e);return t?Reflect.has(t,"flyTo")?(t.flyTo(),Wn()):Ze(`对象 ${t.id} 没有方法 flyTo`):Ze("未查询到该对象")}catch(t){return Ze(t)}}},{name:"changeToMap",params:{description:"漫游模式切换为地图模式(默认方式/正常模式/常规模式/退出漫游模式)",inputSchema:{}},func:async({})=>{var e;try{return(e=r.activeViewer)==null||e.changeToMap(),Wn()}catch(t){return Ze(t)}}},{name:"changeToRotateGlobe",params:{description:"漫游模式切换为全球旋转模式(地球旋转模式), 默认参数:纬度(latitude)38度,高度(height)10000000米,旋转周期(cycleTime)60秒",inputSchema:{latitude:vt.number().optional(),height:vt.number().optional(),cycleTime:vt.number().optional()}},func:async({latitude:e,height:t,cycleTime:n})=>{var i;try{const s={latitude:e||38,height:t||1e7,cycleTime:n||60};return(i=r.activeViewer)==null||i.changeToRotateGlobe(s.latitude,s.height,s.cycleTime),Wn()}catch(s){return Ze(s)}}},{name:"changeToRotatePoint",params:{description:"根据提供的位置点position经纬度高程度坐标([x,y,z],必需),将漫游模式切换为绕点中心旋转模式(绕点旋转模式/点位观察模式),其他参数及默认值:距离(distance)50000米、旋转周期(orbitPeriod)60秒、水平角度(heading)0、俯仰角度(pitch)-30",inputSchema:{position:vt.object({x:vt.number(),y:vt.number(),z:vt.number()}),distance:vt.number().optional(),orbitPeriod:vt.number().optional(),heading:vt.number().optional(),pitch:vt.number().optional()}},func:async({position:e,distance:t,orbitPeriod:n,heading:i,pitch:s})=>{var o;try{const a={position:[e.x,e.y,e.z],distance:t||5e4,orbitPeriod:n||60,heading:i||0,pitch:s||-30};return(o=r.activeViewer)==null||o.changeToRotatePoint(a.position,a.distance,a.orbitPeriod,a.heading,a.pitch),Wn()}catch(a){return Ze(a)}}},{name:"changeToWalk",params:{description:"根据提供的位置点position经纬度高程度坐标([x,y,z],必需),将漫游模式切换为第一人称模式(步行模式/第一人称漫游模式),参数:起始位置经纬度高程(position,必需)、跳跃的 Z 轴速度(jumpZVelocity)、眼睛高度(eyeHeight)",inputSchema:{position:vt.object({x:vt.number(),y:vt.number(),z:vt.number()}),jumpZVelocity:vt.number().optional(),eyeHeight:vt.number().optional()}},func:async({position:e,jumpZVelocity:t,eyeHeight:n})=>{var i;try{const s={position:[e.x,e.y,e.z],jumpZVelocity:t||4.2,eyeHeight:n||1.6};return(i=r.activeViewer)==null||i.changeToWalk(s.position,s.jumpZVelocity,s.eyeHeight),Wn()}catch(s){return Ze(s)}}},{name:"changeToLine",params:{description:"根据提供的线对象id(必需),将漫游模式切换为沿线漫游模式(沿线运动模式), 参数:线条对象id(lineObjectId,必需)、速度(speed)、高度偏移(heightOffset)、是否循环(loop)、转弯速率(turnRateDPS)、线路模式(lineMode)",inputSchema:{lineObjectId:vt.string(),speed:vt.number().optional(),heightOffset:vt.number().optional(),loop:vt.boolean().optional(),turnRateDPS:vt.number().optional(),lineMode:vt.enum(["auto","manual"]).optional()}},func:async({lineObjectId:e,speed:t,heightOffset:n,loop:i,turnRateDPS:s,lineMode:o})=>{var a;try{const u={lineObjectId:e,speed:t||10,heightOffset:n||10,loop:i||!0,turnRateDPS:s||10,lineMode:o||"auto"};return(a=r.activeViewer)==null||a.changeToLine(u.lineObjectId,u.speed,u.heightOffset,u.loop,u.turnRateDPS,u.lineMode),Wn()}catch(u){return Ze(u)}}},{name:"changeToFollow",params:{description:"根据提供的目标对象id(positionObjectId,必需,只能是单点位对象),将漫游模式切换为跟随模式(跟踪模式), 参数: 目标对象id(positionObjectId,必需,只能是单点位对象)、距离(distance)、水平角度(heading)、俯仰角度(pitch)、是否相对旋转(relativeRotation)",inputSchema:{positionObjectId:vt.string(),distance:vt.number().optional(),heading:vt.number().optional(),pitch:vt.number().optional(),relativeRotation:vt.boolean().optional()}},func:async({positionObjectId:e,distance:t,heading:n,pitch:i,relativeRotation:s})=>{var o;try{const a={positionObjectId:e,distance:t||0,heading:n||0,pitch:i||-30,relativeRotation:s||!0};return(o=r.activeViewer)==null||o.changeToFollow(a.positionObjectId,a.distance,a.heading,a.pitch,a.relativeRotation),Wn()}catch(a){return Ze(a)}}},{name:"adjustCamera",params:{description:"相机视角微调,相机拉近(distance=near)、拉远(distance=far)、左移/左转(heading=left)、右移/右转(heading=right)、向上抬(pitch=up)、向下压(pitch=down)、顺时针旋转(roll=clockwise)、逆时针旋转(roll=counterclockwise)",inputSchema:{distance:vt.enum(["far","near"]),heading:vt.enum(["left","right"]),pitch:vt.enum(["up","down"]),roll:vt.enum(["clockwise","counterclockwise"])}},func:async({distance:e,heading:t,pitch:n,roll:i})=>{var s,o;try{const a=(s=r.activeViewer)==null?void 0:s.getCurrentCameraInfo();if(!a)return Ze("Camera info is null");const u={height:e==="near"?a.position[2]-100:a.position[2]+100,heading:t==="left"?a.rotation[0]-10:a.rotation[0]+10,pitch:n==="up"?a.rotation[1]-10:a.rotation[1]+10,roll:i==="clockwise"?a.rotation[2]-10:a.rotation[2]+10},l={position:[a.position[0],a.position[1],u.height],rotation:[u.heading,u.pitch,u.roll]};return(o=r.activeViewer)==null||o.flyIn(l.position,l.rotation),Wn()}catch(a){return Ze(a)}}}],yb=r=>[{name:"getSceneJson",params:{description:"获取整个场景的json数据",inputSchema:{}},func:async()=>({content:[{type:"text",text:JSON.stringify(r.completeJson||"未获取到场景数据",null,2)}]})},{name:"getObjectJsonByName",params:{description:"根据名称来获取某一个对象json数据,查询对象属性名以及属性值",inputSchema:{name:vt.string()}},func:async({name:e})=>{const t=r.getSceneObject();if(Array.isArray(t)){const n=t.filter(i=>i.name.includes(e)).map(i=>i.completeJson);return{content:[{type:"text",text:JSON.stringify(n,null,2)}]}}else return{content:[{type:"text",text:JSON.stringify("未查询到对象",null,2)}]}}},{name:"getObjectJsonById",params:{description:"根据id来获取对象json数据,查询对象属性名以及属性值",inputSchema:{id:vt.string()}},func:async({id:e})=>{var n;const t=((n=r.getSceneObjectById(e))==null?void 0:n.completeJson)||"未查询到对象";return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}},{name:"setObjectProperty",params:{description:"设置对象的属性值,需要对象id,对象属性名,属性值",inputSchema:{id:vt.string(),property:vt.string(),value:vt.any()}},func:async({id:e,property:t,value:n})=>{const i=r.getSceneObjectById(e);if(!i)return{content:[{type:"text",text:JSON.stringify({success:!1,message:`未查询到ID为 ${e} 的对象`},null,2)}]};if(!(t in i))return{content:[{type:"text",text:JSON.stringify({success:!1,message:`对象 ${i.name} 没有属性 ${t}`},null,2)}]};try{return i[t]=n,{content:[{type:"text",text:JSON.stringify({success:!0,message:`成功设置对象 ${i.name} 的 ${t} 属性为 ${JSON.stringify(n)}`,objectId:e,property:t,value:n},null,2)}]}}catch(s){return{content:[{type:"text",text:JSON.stringify({success:!1,message:`设置对象 ${i.name} 的 ${t} 属性时出错`,error:s.message||String(s)},null,2)}]}}}}];function By(r){return typeof r=="string"?document.getElementById(r):r}function dp(r){if(!r)throw new Error("container is not defined");r.innerHTML="";const e=document.createElement("div");return e.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",r.appendChild(e),e}class zy extends V{constructor(t,n){super();d(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=t,this._createSceneObjectListeningFunc=n;const i=this._listeningSceneObjects,s=(o,a)=>{if(o)for(let u of o){const l=i.get(u);l&&(l.destroy(),i.delete(u))}if(a)for(let u of a){if(i.get(u)){console.warn(`listeningSceneObjects已存在某对象:${u.name}`,u);debugger}const c=this.createSceneObjectListeningFunc(u);c&&i.set(u,c)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let o of this._listeningSceneObjects.values())o.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class _b extends V{constructor(e){super(),this._esObjectsManager=e;{const t=this._esObjectsManager;class n extends V{constructor(s){super(),this._esPath=s,this.dv(new Ee(t.activeViewerChanged,()=>{const o=t.activeViewer;if(!o)return;class a extends V{constructor(l){if(super(),this._esPath=l,!o)throw new Error("!viewer");const c=()=>{const h=t.activeViewer;h&&(this._esPath.path.currentTime=h.simulationTime)};c(),this.d(o.simulationTimeChanged.don(c))}}return new a(this._esPath)}))}}this.dv(new zy(t.sceneObjectsManager,i=>{if(i instanceof Ua)return new n(i)}))}{const t=this._esObjectsManager;class n extends V{constructor(s){super();const o=()=>{const a=t.activeViewer;a&&(a.simulationTime=s.currentTime??0)};o(),this.d(s.currentTimeChanged.don(o))}}this.dv(new zy(t.sceneObjectsManager,i=>{if(i instanceof za)return new n(i)}))}}}class wb extends V{constructor(e){super(),e.forEach(t=>{this.d(t.path.currentPositionChanged.don(n=>{n&&t.sceneObjects.forEach(i=>{Reflect.has(i,"position")&&(i.position=[...n])})})),this.d(t.path.currentRotationChanged.don(n=>{n&&t.sceneObjects.forEach(i=>{Reflect.has(i,"rotation")&&(i.rotation=[...n])})}))})}}class Eb extends V{constructor(t){super();d(this,"_player");d(this,"_channels",this.dv(dt([])));this._objectManager=t,this._player=this._objectManager.player,this.dv(new Ee(this.channelsChanged,()=>{if(this.channels.length===0)return;const n=[];for(let i=0;i<this.channels.length;i++){const s=this.channels[i],o=rt.getSceneObjById(s.pathId);if(!o||!(o instanceof Ua))continue;const u=s.sceneObjectIds.map(l=>rt.getSceneObjById(l)).filter(l=>l!==void 0);u.length!==0&&n.push({path:o,sceneObjects:u})}if(n.length!==0)return new wb(n)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(t){this._channels.value=t}}function $c(r){if(r.data){const{type:e,value:t}=r.data;if(e==="UITreeA"&&t instanceof yn){const{sceneObject:n}=t;if(n)return n.id}}}function Cb(r,e){const{property:t,customEventName:n,otherParams:i}=e,{dragstartDataMananger:s}=r;if(!(t instanceof ia)){if(!(t instanceof Mg)){if(t instanceof pt){const[o,a]=zi(t.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const u=i[0];if(u.preventDefault(),!u.dataTransfer)return;$c(s)?u.dataTransfer.dropEffect="move":u.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");i[0].preventDefault();const l=$c(s);l!==void 0&&a(l)}}else if(t instanceof xg){const[o,a]=zi(t.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const u=i[0];if(u.preventDefault(),!u.dataTransfer)return;$c(s)?u.dataTransfer.dropEffect="move":u.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");const u=i[0].$event,l=i[0].strinsPropDom,c=i[0].index;u.preventDefault();const h=$c(s);if(h!==void 0){l[c].firstChild.value=h;const f=new Event("input",{bubbles:!0,cancelable:!0});l[c].firstChild.dispatchEvent(f)}}}else if(t instanceof Tg){const[o,a]=zi(t.reactVar)}}}}function Uy(r,e,t,n){if(t)n.currentActiveEditing=[r,e];else if(n.currentActiveEditing){const[i,s]=n.currentActiveEditing;i===r&&s===e&&(t||(n.currentActiveEditing=void 0))}}const Sb=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class bb extends V{constructor(e,t){super(),this._sceneObject=e;const n=this._sceneObject;for(let i of Sb){const s=i+"Changed",o=n[s];if(o){{const a=n[i];Uy(n,i,a,t)}this.dispose(o.disposableOn(a=>Uy(n,i,a,t)))}}}get sceneObject(){return this._sceneObject}}class Pb extends V{constructor(){super();d(this,"_currentActiveEditing",this.disposeVar(re(void 0)));d(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((t,n)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),n){const[i,s]=n;i[s]===!0&&(i[s]=!1)}if(t){const[i,s]=t;i[s]=!0}})),rt.context.sceneObjCreatedEvent.don(t=>{t.dv(new bb(t,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(t){this._currentActiveEditing.value=t}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class Ib extends V{constructor(){super();d(this,"_sceneObjects",new Set);d(this,"_sceneObjectsToChange",this.dv(new O));this.d(()=>{const t=ph(this._sceneObjects);t!==0&&console.warn(`场景对象管理器销毁时仍然管理着${t}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(t){return this._sceneObjects.has(t)?(console.warn(`创建失败:对象${t.typeName+":"+t.id}已经存在于场景对象管理器中!}`),!1):(this._sceneObjectsToChange.emit([],[t]),this._sceneObjects.add(t),!0)}deleteSceneObject(t){return this._sceneObjects.has(t)?(this._sceneObjectsToChange.emit([t],[]),this._sceneObjects.delete(t),!0):(console.warn(`删除失败:对象${t.typeName+":"+t.id}不存在于场景对象管理器中!}`),!1)}createSceneObject(t,n){const i=rt.context.createSceneObject(t,n);return i&&this.addSceneObject(i),i}createSceneObjectFromUrl(t,n){const i=rt.context.createSceneObjectFromUrl(t,n);return i&&this.addSceneObject(i),i}createSceneObjectFromClass(t,n){const i=rt.context.createSceneObjectFromClass(t,n);return i&&this.addSceneObject(i),i}createSceneObjectFromJson(t){const n=rt.context.createSceneObjectFromJson(t);return n&&this.addSceneObject(n),n}}class xb extends V{constructor(t){super();d(this,"_enabled",this.dv(j(!1)));d(this,"_cursorPosition",j(void 0));d(this,"quickPickPosition",!0);let n=new V;const i=()=>{n&&(n.destroy(),n=void 0)};this.d(i);const s=()=>{if(i(),!t||!this._enabled.value)return;n=new V;const o=n.dv(j(void 0)),a=n.dv(Ie(o.changed));n.d(t.pointerMoveEvent.don(l=>{l.pointerEvent&&(o.value=ln(l.pointerEvent))}));const u=n.dv(Yn(async l=>{if(o.value)if(this.quickPickPosition){const c=await l.promise(ta(t.quickPickPosition(o.value)));this._cursorPosition.value=c}else{const c=await l.promise(ta(t.pickPosition(o.value)));this._cursorPosition.value=c}}));n.d(a.don(()=>{u.restart()}))};s(),this.d(this._enabled.changed.don(s))}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class Tb extends V{constructor(t){super();d(this,"cursorPositionInfo");this.viewer=t,this.cursorPositionInfo=this.dv(new xb(this.viewer))}}class Ob extends V{constructor(t){super();d(this,"viewer");const n=this.viewer=t;this.ad(new Ee(n.rollerShutterChanged,()=>{const i=n.container;if(!i||!n.rollerShutter)return;const s=new V;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return i.appendChild(o),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(o)}),s}))}getRollerShutterDIV(){let t=document.createElement("div");t.style.position="absolute",t.style.left="50%",t.style.top="0",t.style.backgroundColor="#d3d3d3",t.style.width="5px",t.style.height="100%",t.style.zIndex="9999";const n=i=>{if(!t.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const o=i.x/t.parentElement.offsetWidth;t.style.left=`${100*o}%`,this.viewer.splitPosition=o};return t.addEventListener("mouseenter",i=>{t.style.cursor="ew-resize"}),t.addEventListener("mouseleave",i=>{t.style.cursor="default"}),t.addEventListener("mousedown",i=>{t.style.cursor="ew-resize",document.addEventListener("mousemove",n)}),document.addEventListener("mouseup",i=>{t.style.cursor="default",document.removeEventListener("mousemove",n)}),t}}class Nb extends V{constructor(t){super();d(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new Ob(t))}}function Gy(r,e){return r.length===e.length&&r.every((t,n)=>t===e[n])}class Db extends V{constructor(e){super(),this._viewer=e,this.d(B([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class Mb extends V{constructor(e,t){super(),this._viewer=e,this._activeViewer=t;const n=ri.createCommonProps(),i=[];Object.keys(n).forEach(u=>{const l=this._activeViewer[u+"Changed"];i.push(l)});const s=this.dv(Ie(...i)),o=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(n).forEach(u=>{this._viewer[u]=this._activeViewer[u]})};this.d(s.don(o));const a=this.dv(Ou());a.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const u=this._activeViewer.getCurrentCameraInfo(),l=this._viewer.getCurrentCameraInfo();if(!u)return;const{position:c,rotation:h}=u;l&&Gy(c,l.position)&&Gy(h,l.rotation)||this._viewer.flyIn(c,h,0)}),this.d(()=>a.cancel())}}const Rb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
433
433
  <animateTransform values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform>
434
434
  </circle><g></g></g></svg>
435
- `,Lb='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',Fb='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Ho=class Ho extends V{constructor(e){super();const t=()=>{const n=this.dv(new Bc);this.d(B([n,"show"],[e,"useDefaultStatusDiv"]));{const i=()=>{n.show=(e.useDefaultStatusDiv??!0)&&e.status!=="Created"};i(),this.d(e.useDefaultStatusDivChanged.don(i)),this.d(e.statusChanged.don(i)),n.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}e.add(n),this.d(()=>e.delete(n)),n.instanceClass=class extends V{constructor(o,a,u){super();d(this,"_div",document.createElement("div"));if(this._subContainer=o,!u)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const v=()=>{a.show?this._div.style.opacity="1":this._div.style.opacity="0"};v(),this.d(a.showChanged.don(v))}let l,c,h,f,p;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",l=document.createElement("div"),this._div.appendChild(l),l.style.width="auto",l.style.position="absolute",l.style.left="50%",l.style.top="50%",l.style.transform="translate(-50%,-50%)",l.style.background="rgba(120, 120, 0, 0.7)",l.style.color="white",l.style.fontSize="10px",l.style.background="none",l.style.display="flex",l.style.justifyContent="center",l.style.alignItems="center",c=document.createElement("div"),l.appendChild(c),c.style.pointerEvents="none",c.style.display="block",c.style.width="40px",c.innerHTML=Ho.defaultsSvg.loadingSvg,c.style.filter="drop-shadow(0px 0px 1px black)",h=document.createElement("div"),l.appendChild(h),h.style.pointerEvents="none",h.style.marginLeft="10px",h.style.display="flex",h.style.flexFlow="column",h.style.maxWidth="300px",f=document.createElement("div"),h.appendChild(f),f.style.fontSize="14px",f.style.fontWeight="800",f.style.marginBottom="5px",f.style.textShadow="0 0 2px black",p=document.createElement("div"),h.appendChild(p),p.style.fontWeight="400",p.style.textShadow="0 0 2px black";{const v=()=>{let S="Raw";u.status==="Raw"?S="初始状态":u.status==="Creating"?S="正在创建":u.status==="Created"?S="创建完成":u.status==="Error"?S="创建失败":u.status==="Reconnecting"&&(S="重新连接"),f.innerText=`${S}(${u.status})`,p.innerText=`${u.statusLog}`,(u.status==="Creating"||u.status==="Reconnecting")&&(c.innerHTML=Ho.defaultsSvg.loadingSvg),u.status==="Created"&&(c.innerHTML=Ho.defaultsSvg.successSvg),u.status==="Error"&&(c.innerHTML=Ho.defaultsSvg.warnSvg)};v();const C=this.dv(Ie(u.statusLogChanged,u.statusChanged));this.d(C.don(v))}}update(){const o=255*Math.random()|0,a=255*Math.random()|0,u=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${a}, ${u}, 0.8)`}}};this.d(e.containerChanged.don(()=>{t()}))}};d(Ho,"defaultsSvg",{loadingSvg:Rb,successSvg:Lb,warnSvg:Fb});let fp=Ho;class Ab extends V{constructor(e,t,n){super(),this._subContainer=e,this._overlayContainer=t,this._viewer=n;const i=this._subContainer,s=this._overlayContainer,o=this._viewer,a=()=>{const c=o.zIndex??"";i.style.zIndex=c,s.style.zIndex=c};a(),this.d(o.zIndexChanged.don(a));const u=()=>{i.style.display=o.show??!0?"block":"none"};u(),this.d(o.showChanged.don(u));const l=()=>{i.style.opacity=`${o.opacity??1}`};l(),this.d(o.opacityChanged.don(l))}}function Kc(r){let e=Xn(r,"_relativeContainer");return e||(e=document.createElement("div"),e.style.position="relative",e.style.width="100%",e.style.height="100%",e.style.padding="0",e.style.margin="0",r.appendChild(e),fi(r,"_relativeContainer",e)),e}class kb extends V{constructor(t,n){super();d(this,"_subContainer",document.createElement("div"));d(this,"_overlayContainer",document.createElement("div"));d(this,"_containerStyleController");this._container=t,this._viewer=n,this._containerStyleController=this.dv(new Ab(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:s}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),Kc(this._container).appendChild(i),this.d(()=>Kc(this._container).removeChild(i)),Kc(this._container).appendChild(s),this.d(()=>Kc(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class Vb extends V{constructor(){super(...arguments);d(this,"registerObjsMap",new Map)}register(t,n){return this.registerObjsMap.has(t)&&console.warn(`register warn:${t}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(t,n),t}getViewerConstructor(t){const n=this.registerObjsMap.get(t);if(!n){console.warn(`未找到${t}类!`);return}return n}createViewer(t){const n=t.type;console.log(t);const i=this.getViewerConstructor(n);if(!i)throw new Error(`没有找到类型为${n}的Viewer构造器!`);return new i(t)}}class Gy extends V{constructor(e,t,n=!1,i=!1){if(super(),this._viewer=e,!t)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(ue.create(t,"pointerdown")),o=this.dv(ue.create(t,"pointermove")),a=this.dv(ue.create(t,"pointerup")),u=this.dv(ue.create(t,"pointerout")),l=this.dv(ue.create(t,"pointerover")),c=this.dv(new Oh),h=this.dv(new Bp),f=()=>{const m=this._viewer.hoverTime*1e3;h.delayTime=m};this.d(this._viewer.hoverTimeChanged.don(()=>{f()})),this.d(s.don(m=>c.pointerDown(m))),this.d(o.don(m=>c.pointerMove(m))),this.d(a.don(m=>c.pointerUp(m))),this.d(u.don(m=>c.pointerOut(m))),this.d(s.don(m=>h.pointerDown(m))),this.d(o.don(m=>h.pointerMove(m))),this.d(a.don(m=>h.pointerUp(m))),this.d(u.don(m=>h.pointerOut(m)));const{x:p,y:v}=t.getBoundingClientRect(),C=i?p:0,S=i?v:0;this.d(h.hoverEvent.don(m=>{const[w,E]=Ko(m,n);this._viewer.hoverEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(c.clickEvent.don(m=>{const[w,E]=Ko(m,n);this._viewer.clickEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(c.dbclickEvent.don(m=>{const[w,E]=Ko(m,n);m.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(s.don(m=>{const[w,E]=Ko(m,n);m.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(a.don(m=>{const[w,E]=Ko(m,n);m.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(o.don(m=>{const[w,E]=ln(m,n);this._viewer.pointerMoveEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(l.don(m=>{const[w,E]=ln(m,n);this._viewer.pointerOverEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(u.don(m=>{const[w,E]=ln(m,n);this._viewer.pointerOutEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})}));const P=this.dv(ue.create(t,"keydown"));this.d(P.don(m=>this._viewer.keyDownEvent.emit(m)));const y=this.dv(ue.create(t,"keyup"));this.d(y.don(m=>this._viewer.keyUpEvent.emit(m)));const _=this.dv(ue.create(t,"wheel"));this.d(_.don(m=>this._viewer.wheelEvent.emit(m)))}}const ms=class ms extends V{constructor(t){super();d(this,"_forceRecreateEvent",this.dv(new O));d(this,"_container",this.dv(j(void 0)));d(this,"_containerSize",this.dv(j(void 0)));d(this,"_editingEvent",this.disposeVar(new O));d(this,"_esViewerExtensions",this.dv(new Tb(this)));d(this,"_status",this.dv(j("Raw")));d(this,"_statusLog",this.dv(j("")));d(this,"_statusContainer",this.dv(new fp(this)));d(this,"_useCustomInteraction",this.dv(j(!0)));d(this,"_resetInteractionEvent",this.dv(Ie(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));d(this,"_interactionResetting",this.dv(new Ee(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new Gy(this,this.container)})));d(this,"_viewerChanged",this.dv(new O));d(this,"_cameraChanged",this.dv(new O));d(this,"_containerResetEvent",this.dv(Ie(this.containerChanged,this._forceRecreateEvent)));d(this,"_containerResetting",this.dv(new Ee(this._containerResetEvent,()=>{if(this.container)return new kb(this.container,this)})));d(this,"_sceneObjectsMap",new Map);d(this,"_id");d(this,"_typeName");d(this,"_updateFuncReact",this.dv(j(void 0)));d(this,"_toDestroyFuncReact",this.dv(j(void 0)));d(this,"_statusInfo",ms.defaults.statusInfo);d(this,"_navigationMode",this.dv(j("Map")));d(this,"_syncViewer",this.dv(j(void 0)));d(this,"_syncEventDon",this.dv(new Ee(this.syncViewerChanged,()=>{const t=this.syncViewer;if(t)return new Mb(this,t)})));d(this,"_timeSyncdon",this.dv(new Ee(this.timeSyncChanged,()=>{if(this.timeSync)return new Db(this)})));d(this,"_hoverEvent",this.dv(new O));d(this,"_pointerOverEvent",this.dv(new O));d(this,"_pointerMoveEvent",this.dv(new O));d(this,"_pointerDownEvent",this.dv(new O));d(this,"_pointerUpEvent",this.dv(new O));d(this,"_pointerOutEvent",this.dv(new O));d(this,"_clickEvent",this.dv(new O));d(this,"_dblclickEvent",this.dv(new O));d(this,"_keyDownEvent",this.dv(new O));d(this,"_keyUpEvent",this.dv(new O));d(this,"_wheelEvent",this.dv(new O));d(this,"_actived",this.dv(j(!1)));this._id=t.id??Jo();const n=jy(t.container);if(n)this._container.value=dp(n),this._typeName=t.type,this._initName();else throw new Error("container is not defined");{const i=()=>{n&&(this.show??!0?n.style.display="block":n.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,s=()=>{for(let[a,u]of i.entries())if(!u&&a){const l=xo.context.createEngineObject(a,this);l&&i.set(a,l)}},o=()=>{for(let[a,u]of i.entries())u&&!u.isDestroyed()&&u.destroy(),i.set(a,void 0)};this.d(o),this.d(this.viewerChanged.don(a=>{o(),a&&s()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||Ou(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new Nb(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(t){this._container.value=t}set containerOrId(t){if(typeof t=="string"){const n=document.getElementById(t);n&&n instanceof HTMLDivElement?this._container.value=dp(n):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else t instanceof HTMLDivElement?this._container.value=dp(t):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(t){this._containerSize.value=t}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get esViewerExtensions(){return this._esViewerExtensions}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(t){this._status.value=t}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(t){this._statusLog.value=t}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(t){this._useCustomInteraction.value=t}get viewerChanged(){return this._viewerChanged}get cameraChanged(){return this._cameraChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(t){return this.sceneObjectsMap.get(t)}add(...t){for(let n of t)if(!this.has(n)){rt.context.addSceneObject(n);const i=xo.context.createEngineObject(n,this);i&&this._sceneObjectsMap.set(n,i),n.viewerAttached.emit(this)}}delete(...t){for(let n of t)if(this.has(n)){const i=this._sceneObjectsMap.get(n);i&&i.destroy(),rt.context.deleteSceneObject(n),this._sceneObjectsMap.delete(n),n.viewerDetached.emit(this)}}disposableAdd(...t){return this.add(...t),()=>this.delete(...t)}disAdd(...t){return this.disposableAdd(...t)}has(t){return this._sceneObjectsMap.has(t)}clearAllSceneObjects(){for(let t of this.sceneObjects)this.delete(t)}get id(){return this._id}set id(t){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return ms.createDefaultProps()}get completeJson(){return this._getJson(!1)}_getJson(t=!0){const n={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(t){let s,o=this.defaultProps[i];o instanceof ze?s=o.equals(this[i]):s=o===this[i],s||(n[i]=this[i])}else n[i]=this[i];return n}_setJson(t,n,i){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in t)this[a]=t[a]===null?void 0:t[a];else if(!(i??!1)){let u=this.defaultProps[a];u instanceof ze&&(u=u.value),this[a]=u}}get json(){return this._getJson()}set json(t){this._setJson(t,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(t){this._syncViewer.value=t}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(t){t&&t.syncViewer&&(t.syncViewer=void 0),t===this?this._syncViewer.value=void 0:this._syncViewer.value=t}setCurrentTime(t){try{this.currentTime=typeof t=="string"?Date.parse(t):t}catch(n){console.warn(`时间格式不正确! value: ${t} error: ${n}`)}}async getVersion(){return globalThis.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}get actived(){return this._actived.value}set actived(t){this._actived.value=t}get activedChanged(){return this._actived.changed}getESProperties(){return{defaultMenu:"general",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[],more:[]}}getProperties(t){const n={...this.getESProperties()},i=[];return n.general.length>0&&i.push(new ut(n.general,"general")),Object.keys(n).forEach(s=>{s!=="defaultMenu"&&s!=="general"&&n[s].length>0&&i.push(new ut(n[s],s))}),i}};d(ms,"context",new Vb),d(ms,"register",ms.context.register.bind(ms.context)),d(ms,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0,cameraMovableRegion:[0,0,0,0,0,0],depthTestAgainstTerrain:!0,terrainOpacity:1});let ri=ms;(r=>{r.createBaseProps=()=>({name:"未命名场景对象",extras:wt(void 0),devTags:re(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),r.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:re(void 0),editingAuxiliaryPointColor:re(void 0),editingLineWidth:void 0,editingLineColor:re(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:r.defaults.terrainShader,splitPosition:j(void 0),rollerShutter:!1,cameraMovableRegion:re(void 0),depthTestAgainstTerrain:!0,terrainOpacity:1}),r.createDefaultProps=()=>({...(0,r.createBaseProps)(),...(0,r.createCommonProps)()})})(ri||(ri={})),Gi(ri.prototype,ri.createDefaultProps);function Wy(r,e){const t=r._lastCameraInfo;if(t){const n=e.viewerChanged.don(i=>{if(!i||!t)return;const{position:s,rotation:o}=t;e.flyIn(s,o,0),r._lastCameraInfo=void 0,n()})}}const jb=r=>{const e=ri.createCommonProps(),t={};try{Object.keys(e).forEach(n=>{t[n]=r[n]})}catch(n){console.warn(n)}return t},Hy=(r,e)=>{const t=ri.createCommonProps();try{Object.keys(t).forEach(n=>{r[n]=e[n]})}catch(n){console.warn(n)}};class Bb extends V{constructor(t){super();d(this,"_viewersChanged",this.disposeVar(new O));d(this,"_viewers",new Set);d(this,"_viewersToChange",this.dv(new O));this._sceneObjectsManager=t,this.d(()=>{for(const n of this._viewers)this.destroyViewer(n);this._viewers.clear()}),this.viewers.forEach(n=>{const i=this._sceneObjectsManager.sceneObjects;n.add(...i)}),this.d(()=>{const n=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(i=>{i.delete(...n)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((n,i)=>{this.viewers.forEach(s=>{i.forEach(o=>{qi(s.devTags,o.devTags)&&(s.has(o)?console.warn(`${s.typeName}中已存${o.typeName},检查逻辑是否有问题!`):s.add(o))}),n.forEach(o=>{qi(s.devTags,o.devTags)&&(s.has(o)?s.delete(o):console.warn(`${s.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))})}),i.length>0&&i.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(o=>{o.has(s)&&o.delete(s),console.log("sceneObjectsToChange",o.devTags,s.devTags,qi(o.devTags,s.devTags))}),this.viewers.forEach(o=>{qi(o.devTags,s.devTags)&&(o.has(s)?console.warn(`${o.typeName}中已存${s.typeName},检查逻辑是否有问题!`):o.add(s))})}))})})),this.d(this.viewersChanged.don((n,i)=>{const s=this._sceneObjectsManager.sceneObjects;i.forEach(o=>{for(let a of s)qi(o.devTags,a.devTags)&&(o.has(a)?console.warn(`${o.typeName}中已存${a.typeName},检查逻辑是否有问题!`):o.add(a))}),n.forEach(o=>{for(let a of s)qi(o.devTags,a.devTags)&&(o.has(a)?o.delete(a):console.warn(`${o.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))}),i.length>0&&i.forEach(o=>{o.d(o.devTagsChanged.don(()=>{o.clearAllSceneObjects();const a=this._sceneObjectsManager.sceneObjects;for(let u of a)console.log("viewersChanged",o.devTags,u.devTags,qi(o.devTags,u.devTags)),qi(o.devTags,u.devTags)&&(o.has(u)?console.warn(`${o.typeName}中已存${u.typeName},检查逻辑是否有问题!`):o.add(u))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(t){const n=ri.context.createViewer(t);return this._viewers.add(n),this._viewersChanged.emit([],[n]),n}destroyViewer(t){return t.isDestroyed()?!0:(this._viewers.delete(t),this._viewersChanged.emit([t],[]),t.destroy(),t.isDestroyed())}}class Zc extends V{constructor(...t){super();d(this,"_drgm",this.dv(new Ag));d(this,"_sobjm",this.dv(new Ib));d(this,"_vrm",this.dv(new Bb(this._sobjm)));d(this,"_sceneObjectEditingManager",this.disposeVar(new Pb));d(this,"_activeViewer",this.dv(j(void 0)));d(this,"_syncOtherViewersToActived",this.dv(j(!1)));d(this,"_cmrvm",this.createSceneObjectFromClass(kc));d(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));d(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});d(this,"_sceneTree",this.dv(new pl("default",this.dragstartDataMananger,24,this)));d(this,"_propUiTreeManager",this.dv(new ka(24)));d(this,"_sceneTreeMap",new Map);d(this,"_viewerCreatedEvent",this.dv(new O));d(this,"_lastCameraInfo");d(this,"_lastActiveViewerJson");d(this,"_syncEventDonFunc",this.d(Ui([this.activeViewerChanged,this.syncOtherViewersToActivedChanged],()=>{const t=this.syncOtherViewersToActived;this.viewers.forEach(n=>{t?n.syncOtherViewer(this.activeViewer):n.syncOtherViewer(void 0)})})));d(this,"_player",this.createSceneObjectFromClass(za));d(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));d(this,"_esPlyarAndPathTime",this.dv(new _b(this)));d(this,"_pathAnimationManager",this.dv(new Eb(this)))}static get envs(){return rt.context.environmentVariables}getSceneObjectById(t){return rt.getSceneObjectById(t)}getSceneObject(t){return rt.getSceneObject(t)}get $refs(){return rt.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(t){this._activeViewer.value=t,this.viewers.values().forEach(n=>n.actived=n===t)}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(t){this._syncOtherViewersToActived.value=t}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get completeJson(){var h;const t=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:t,modifiedTime:n,name:i},a=this.sceneTree.completeJson,u=this._cmrvm.views,l=[...this._vrm.viewers].map(f=>f.completeJson),c=(h=this.activeViewer)==null?void 0:h.getCurrentCameraInfo();return{asset:o,viewers:l,sceneTree:a,viewCollection:u,lastView:c}}get json(){var h;const t=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:t,modifiedTime:n,name:i},a=this.sceneTree.json,u=this._cmrvm.views,l=[...this._vrm.viewers].map(f=>f.json),c=(h=this.activeViewer)==null?void 0:h.getCurrentCameraInfo();return{asset:o,viewers:l,sceneTree:a,viewCollection:u,lastView:c}}set json(t){try{if(!t.asset)return;if(!t.asset.type||t.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=t.asset&&t.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=t.asset&&t.asset.modifiedTime||"",this._asset.name=t.asset&&t.asset.name||"未命名项目",this._asset.version=t.asset&&t.asset.version||"0.1.0",t.sceneTree&&(this.sceneTree.json=t.sceneTree),t.viewCollection&&(this._cmrvm.views=t.viewCollection),!t.viewers||!Array.isArray(t.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||t.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(n=>{const i=t.viewers.find(s=>s.id===n.id);i&&(n.json=i)})}catch(n){console.error(`ESObjectsManager解析json数据时发生错误! error: ${n}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(t){return Cb(this,t)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(t="default"){if(t==="default")return this._sceneTree;if(!this._sceneTreeMap.has(t)){console.warn(`id为${t}的SceneTree不存在!`);return}return this._sceneTreeMap.get(t)}createSceneTree(t,n=24){if(this._sceneTreeMap.has(t)||t==="default")console.warn(`id为${t}的SceneTree已存在!`);else{const i=this.dv(new pl(t,this.dragstartDataMananger,n,this));this._sceneTreeMap.set(t,i)}return this.getSceneTree(t)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(t){const n=this._vrm.createViewer(t);this.activeViewer||(this.activeViewer=n);const i=this.d(n.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(n),i())}));return n}destroyViewer(t){return this._activeViewer.value===t&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(t)}switchViewer(t,n=!0,i=!0,s=!0){var l;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&n&&(this._lastCameraInfo=(l=this.activeViewer)==null?void 0:l.getCurrentCameraInfo()),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?jb(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=t.id,a=o?[...this.getViewers()].find(c=>c.id===o):[...this.getViewers()].find(c=>c.typeName===t.type&&!c.container);if(a)if(o&&a.typeName!==t.type)console.warn(`id为${o}的viewer的typeName和option.type${t.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(a);else return console.log("ESViewer exists, will be used"),n&&Wy(this,a),i&&this._lastActiveViewerJson&&(Hy(a,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),a.container===jy(t.container)?(a.containerOrId=t.container,a.forceRecreate()):a.containerOrId=t.container,this.activeViewer=a,a;console.log("No ESViewer exists, will be created");const u=this.createViewer(t);return console.log(t),console.log(this),n&&Wy(this,u),i&&this._lastActiveViewerJson&&(Hy(u,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=u,u}switchToCesiumViewer(...t){if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)){const{container:n,viewSync:i,attributeSync:s,destroy:o,id:a}=t[0];return this.switchViewer({type:"ESCesiumViewer",container:n,id:a},i??!0,s??!0,o??!0)}else if(typeof t[0]=="string"||t[0]instanceof HTMLDivElement){const n={container:t[0],viewSync:t[1]??!0,attributeSync:t[2]??!0,destroy:t[3]??!0,id:t[4]},{container:i,viewSync:s,attributeSync:o,destroy:a,id:u}=n;return this.switchViewer({type:"ESCesiumViewer",container:i,id:u},s,o,a)}}switchToUEViewer(...t){let n,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("uri")){const{container:u,uri:l,app:c,token:h,viewSync:f,attributeSync:p,destroy:v,id:C}=t[0];n={type:"ESUeViewer",container:u,id:C,options:{uri:l,app:c,token:h}},i={viewSync:f??!0,attributeSync:p??!0,destroy:v??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("ws")){const{container:u,ws:l,esmsg:c,viewSync:h,attributeSync:f,id:p,destroy:v}=t[0];n={type:"ESUeViewer",container:u,id:p,options:{ws:l,esmsg:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:v??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("project")){const{container:u,project:l,baseUrl:c,viewSync:h,attributeSync:f,id:p,destroy:v}=t[0];n={type:"ESUeViewer",container:u,id:p,options:{project:l,baseUrl:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:v??!0}}else(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?(n={type:"ESUeViewer",container:t[0],id:t[6],options:{ws:t[1],esmsg:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}):typeof t[1]=="string"&&t[1].startsWith("http")?(n={type:"ESUeViewer",container:t[0],id:t[7],options:{uri:t[1],app:t[2],token:t[3]??void 0}},i={viewSync:t[4]??!0,attributeSync:t[5]??!0,destroy:t[6]??!0}):(n={type:"ESUeViewer",container:t[0],id:t[6],options:{project:t[1],baseUrl:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}));if(!n)throw new Error("参数错误");const{viewSync:s,attributeSync:o,destroy:a}=i;return this.switchViewer(n,s,o,a)}createCesiumViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESCesiumViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(n={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESCesiumViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createOpenLayersViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESOlViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(n={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESOlViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createUeViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESUeViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?n={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{ws:t[1],esmsg:t[2]??void 0}}:typeof t[1]=="string"&&t[1].startsWith("http")?n={type:"ESUeViewer",container:t[0],id:t[4]??void 0,options:{uri:t[1],app:t[2],token:t[3]??void 0}}:n={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{project:t[1],baseUrl:t[2]??void 0}}),!n)throw new Error("参数错误");return this.createViewer(n)}createSceneObject(t,n){return this._sobjm.createSceneObject(t,n)}createSceneObjectFromUrl(t,n){return this._sobjm.createSceneObjectFromUrl(t,n)}createSceneObjectFromClass(t,n){return this._sobjm.createSceneObjectFromClass(t,n)}createSceneObjectFromJson(t){return this._sobjm.createSceneObjectFromJson(t)}destroySceneObject(t){const n=this._sobjm.deleteSceneObject(t);return t.destroy(),n}destroyAllSceneObjects(){const t=[...this._sobjm.sceneObjects];for(let n of t)n!=this._player&&n!=this._cmrvm&&this.destroySceneObject(n)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}d(Zc,"getSceneObjById",rt.context.getSceneObjectById.bind(rt.context)),d(Zc,"getEnv",rt.context.getEnv.bind(rt.context)),d(Zc,"setEnv",rt.context.setEnv.bind(rt.context)),g.BasePropTreeItem=Ud,g.Boolean2Property=Y0,g.Boolean2sProperty=K0,g.Boolean3Property=J0,g.Boolean3sProperty=Z0,g.Boolean4Property=$0,g.Boolean4sProperty=Q0,g.BooleanProperty=X,g.BooleansProperty=B0,g.BorderedPosFloatDiv=eg,g.BoxPicker=Ch,g.CancelError=Fr,g.CancelsManager=Ph,g.CanvasImagePoi=l0,g.CanvasPoi=Nh,g.CanvasPointPoi=c0,g.CanvasPrimitive=zp,g.CanvasPrimitivesContext=h0,g.ColorProperty=Mt,g.ColorRgbProperty=nw,g.ColorStops=fb,g.ComplexImage=Cl,g.CursorFloatDiv=m0,g.CursorInfo=v0,g.DashPatternProperty=rw,g.DateProperty=io,g.DatesProperty=Lg,g.Debouncing=B_,g.DebouncingDeprecated=_h,g.DebouncingWithStartValues=z_,g.Destroyable=V,g.DivBoxPicker=k_,g.DivPoi=Zp,g.DivPointerClick=a0,g.DomElementEvent=ue,g.DoublyLinkedList=Sp,g.DragStartDataManager=Ag,g.ES3DTileset=Tr,g.ESAlarm=$d,g.ESApertureEffect=Kd,g.ESAreaMeasurement=Zd,g.ESBlastParticleSystem=Qd,g.ESBoxClipping=tf,g.ESCameraView=Fc,g.ESCameraViewCollection=kc,g.ESCameraVisibleRange=ef,g.ESCar=Vc,g.ESCityBasePoint=Qf,g.ESClassification=jc,g.ESClippingPlane=nf,g.ESCustomDiv=Bc,g.ESCzml=tp,g.ESDataMesh=rf,g.ESDatasmithRuntimeModel=Lf,g.ESDirectionMeasurement=Pf,g.ESDistanceMeasurement=sf,g.ESDynamicWater=Ff,g.ESEntityCluster=$f,g.ESExcavate=gl,g.ESFeatureLayer=hp,g.ESFireParticleSystem=of,g.ESForestTileset=af,g.ESGaussianSplatting=ip,g.ESGeoBezierSpline=Kf,g.ESGeoDiv=uf,g.ESGeoDivTextPoi=Zf,g.ESGeoExtrudedPolygon=Io,g.ESGeoJson=vl,g.ESGeoLineString=Ni,g.ESGeoPoints=El,g.ESGeoPolygon=Xt,g.ESGeoRectangle=lf,g.ESGeoVector=It,g.ESGeoWater=Af,g.ESGltfModel=zs,g.ESHeatMap=Xc,g.ESHeightLimitAnalysis=Jf,g.ESHeightMeasurement=If,g.ESHole=Uf,g.ESHuman=Po,g.ESHumanPoi=zf,g.ESImageLabel=zc,g.ESImageryLayer=hf,g.ESJEditingMode=et,g.ESJLonLatFormat=Fg,g.ESJPickedResult=hw,g.ESLabel=ar,g.ESLevelRuntimeModel=kf,g.ESLocalCircle=xf,g.ESLocalPolygon=yl,g.ESLocalPolygonZ=Tf,g.ESLocalRectangle=Of,g.ESLocalSkyBox=df,g.ESLocalVector=Va,g.ESLocalVector2D=us,g.ESLocationMeasurement=ff,g.ESMCPClient=mb,g.ESMsTileset=qf,g.ESNavigator=ep,g.ESObjectWithLocation=st,g.ESObjectsManager=Zc,g.ESParticleSystemPrimitive=Uc,g.ESPath=Ua,g.ESPathImpl=Us,g.ESPipeFence=Hc,g.ESPipeline=Vf,g.ESPipeserTileset=Nf,g.ESPit=Ba,g.ESPlayer=za,g.ESPoi2D=ml,g.ESPoi3D=pf,g.ESPoiTileset=Xf,g.ESPolygonFence=qc,g.ESPolygonFlattenedPlane=gf,g.ESPolygonWithHole=Mf,g.ESRectangle=Df,g.ESRtsFeatureEditing=Hf,g.ESRtsTileset=Wf,g.ESScale=Yf,g.ESSceneObject=rt,g.ESSceneObjectWithId=zg,g.ESSeparateFoliage=mf,g.ESSkylineAnalysis=op,g.ESStaticMesh=sp,g.ESSubmergingAnalysis=vf,g.ESSunshineAnalysis=yf,g.ESSurfaceAreaMeasurement=Rf,g.ESTerrainLayer=_f,g.ESTestObject=Jd,g.ESTextLabel=ja,g.ESUEWidget=wf,g.ESUnrealActor=Ef,g.ESVideoFusion=Cf,g.ESViewShed=Sf,g.ESViewer=ri,g.ESViewerStatusBar=np,g.ESViewerStatusBarScale=rp,g.ESVisibilityAnalysis=jf,g.ESVisualObject=Ht,g.ESVolumeMeasurement=Bf,g.ESWidget=bf,g.EngineObject=xo,g.EnumProperty=Pt,g.EnumStringsProperty=iw,g.EvalStringProperty=Es,g.Event=O,g.EventListenerHandler=oh,g.Fetching=M_,g.FloatDiv=Rh,g.FlvJsLoading=Jc,g.FlvProcessing=ky,g.FunctionProperty=lt,g.Gif=Sg,g.GifPlayer=Cg,g.GifProcessing=bg,g.GroupPropTreeItem=Wd,g.GroupProperty=ut,g.HasOwner=b_,g.HlsJsLoading=Yc,g.HlsProcessing=Ay,g.IFrameBorderedPosFloatDiv=p0,g.ImageProcessing=dg,g.IntervalDeprecated=Eh,g.JsonProperty=it,g.LeafPropTreeItem=Gd,g.ListenerPipe=sh,g.LocalFileServer=cg,g.LocalRootDir=lg,g.LongStringProperty=Uh,g.MaximumScreenSpaceErrorProperty=V0,g.MinmaxProperty=sw,g.NearFarScalerProperty=ow,g.NextAnimateFrameEvent=Fl,g.NextAnimateFrameWeakEvent=Pp,g.NextMicroTaskEvent=hh,g.NextMicroTaskWeakEvent=g_,g.NonreactiveJsonStringProperty=Dg,g.Number2Property=Ae,g.Number2sProperty=Og,g.Number3Property=cn,g.Number3sProperty=zh,g.Number4Property=Ar,g.Number4WithUndefinedProperty=q0,g.Number4sProperty=X0,g.NumberProperty=M,g.NumberRangeProperty=aw,g.NumberSliderProperty=Ue,g.NumbersProperty=j0,g.ObjPool=Tl,g.ObjResetting=w0,g.ObjResettingWithEvent=Ee,g.ObservableArray=xu,g.ObservableSet=Wl,g.ParamsProperty=Ng,g.PickColorMananger=$p,g.PickedInfo=cw,g.Player=kr,g.PlayerProperty=Hl,g.PointerClick=Oh,g.PointerClickDeprecated=Fp,g.PointerHover=Bp,g.PointerHoverDeprecated=u0,g.PosFloatDiv=Ah,g.PositionProperty=ia,g.PositionsProperty=Mg,g.PositionsSetPropety=lw,g.Processing=Fe,g.PropTree=ey,g.PropUiTreeManager=ka,g.Property=ws,g.ReactVarProperty=Tt,g.ReactiveVariable=ze,g.RotationProperty=Gh,g.SceneObjectFromId=qh,g.SceneTree=pl,g.SceneTreeContextMenu=ay,g.SceneTreeItem=yn,g.SceneTreeItemDragDrop=oy,g.SmartListenerHandler=Eu,g.SmartListenerPipe=s_,g.SmoothMoveController=wS,g.String2Property=z0,g.String2sProperty=Tg,g.String3Property=U0,g.String3sProperty=W0,g.String4Property=G0,g.String4sProperty=H0,g.StringNumberProperty=tw,g.StringNumbersProperty=ew,g.StringProperty=pt,g.StringsProperty=xg,g.Throttling=s0,g.ThrottlingWithStartValues=o0,g.TimingDeprecated=Rp,g.ToolTipDiv=g0,g.Transition=Du,g.TransitionDeprecated=F_,g.Tree=ra,g.TreeItem=na,g.TreeItemDragDrop=kg,g.UiTree=sg,g.UiTreeObject=ig,g.UriProperty=Fu,g.VideoProcessing=gg,g.ViewPlayerProperty=Rg,g.ViewerCustomInteraction=Gy,g.Watcher=Au,g.WatcherTools=Ug,g.WithUndefinedProperty=Bh,g.XrPlayer=Ul,g.Xyzw2Ns=Vl,g.addTreesCallFunc=dy,g.animateFrame=Rl,g.ary2Ns=D_,g.asyncFuncToCancelablePromise=H_,g.bind=nt,g.bindCustomEditing=Bg,g.bindu=f_,g.booleanPointInPolygon=Ow,g.canMoveToTreeItem=Lu,g.canMoveToTreeItems=ng,g.cancelFuncToCancelablePromise=W_,g.cancelPromise=Sh,g.cancelableFetch=xh,g.cancelableFetchDeprecated=Mp,g.cancelableFetchWithProgress=X_,g.cartesianDistance=Qv,g.clamp=jl,g.clamp0_360=sa,g.clampN180_180=jg,g.complexImageTypes=pg,g.createAnimateFrame=Ou,g.createAnimateFrameWithStartValues=ea,g.createBottomTriangleElement=tg,g.createCancelablePromise=ta,g.createCloseDiv=Qp,g.createEventsCallFunc=Ui,g.createFetching=Y_,g.createFetchingWithStartValues=J_,g.createGuid=Jo,g.createInterval=t0,g.createIntervalWithStartValues=e0,g.createNextAnimateFrame=$_,g.createNextAnimateFrameEvent=Ie,g.createNextAnimateFrameEventCallFunc=v_,g.createNextAnimateFrameWeakEvent=y_,g.createNextAnimateFrameWithStartValues=K_,g.createNextMicroTask=Z_,g.createNextMicroTaskEvent=p_,g.createNextMicroTaskWeakEvent=m_,g.createNextMicroTaskWithStartValues=Q_,g.createNumbers=kl,g.createProcessingFromAsyncFunc=Yn,g.createProcessingFromAsyncFuncWithStartValues=q_,g.createProcessingFromPromiseCreateFunc=zl,g.createProcessingFromPromiseCreateFuncWithStartValues=Ih,g.createPropTreeFromSceneObject=ny,g.createSleeping=n0,g.createSleepingWithStartValues=r0,g.createStartFuncFromAsyncFunc=Tu,g.createTimeout=kp,g.createTimeoutWithStartValues=Vp,g.cutDownTreesCallFunc=gy,g.czmPixelFormats=fg,g.debounce=Ml,g.defaultGetLocalFilePath=E0,g.defaultInitSceneObjectOnCreatingFunc=fw,g.defaultLight122FromEnvironmentMapManager=Yd,g.defaultLocalFileServer=hg,g.defaultStartUpdateFunc=Al,g.defaultUpdateSceneObjectOnPickingFunc=dw,g.defineReactiveProp=wh,g.destroyObject=_p,g.downloadLink=C_,g.drawPoint=no,g.drawRoundRectPath=Up,g.drawText=Gp,g.drawTextBlock=Dh,g.equalsN3=qd,g.every=fh,g.extendClassProps=Gi,g.fetchArrayBuffer=I_,g.fetchImage=Op,g.forEach=pi,g.forEachWithBreak=dh,g.geoAlong=Rw,g.geoArea=td,g.geoBuffer=Yv,g.geoCenterOfMass=Kw,g.geoDestination=om,g.geoDifference=Jv,g.geoDistance=Ql,g.geoHeading=Bu,g.geoIntersect=qv,g.geoLineIntersect=sE,g.geoNearestPointOnLine=lE,g.geoPointToLineDistance=fE,g.geoPolygonFromCircle=$v,g.geoPolygonOverlap=Bd,g.geoPolylineToBezierSpline=ty,g.geoRhumbDestination=mE,g.geoRhumbDistance=ym,g.geoRhumbHeading=yE,g.geoUnion=Xv,g.getCameraTools=vb,g.getColorHexStr=Ru,g.getCompleteReactParams=Dl,g.getDefaultValue=vw,g.getDistancesFromPositions=fl,g.getDomEventCurrentTargetPos=ln,g.getDrawRect=eo,g.getElementBounds=Ew,g.getErrorResult=Ze,g.getEventFromPromise=j_,g.getEventPosInCurrentTarget=Ko,g.getExtProp=Xn,g.getFileArrayBuffer=ug,g.getFileJson=ag,g.getFileText=kh,g.getFloatDivPool=Fh,g.getGeoBoundingSphereFromPositions=Zv,g.getIterator=Su,g.getMidpoint=aE,g.getMinMaxCorner=Kv,g.getMinMaxPosition=P_,g.getPromiseCancel=Zo,g.getPromiseFromEvent=V_,g.getPromiseFromProcessing=Th,g.getReactFuncs=zi,g.getSceneObjectTools=yb,g.getSceneObjectTreeItem=pw,g.getSubEntriesFromDir=og,g.getSuccessResult=Wn,g.getTypeFromImageUri=Vy,g.getValueFromProps=Ip,g.getXyzFromPostion=zd,g.growthSimulationCallFunc=my,g.hasSameTags=Vg,g.hasSameViewerTags=qi,g.imageToCanvas=Wp,g.inOrderRunning=yw,g.interval=lh,g.isJSON=Wh,g.isPromiseCancelable=Qo,g.isXML=mw,g.lbhToWebMerc=xw,g.lbhToXyz=Vr,g.length=ph,g.lerpAngle=Xl,g.lerpRotation=Hh,g.loadGifFrames=wg,g.loadJs=vh,g.map=ry,g.max=Wi,g.min=ys,g.moveToTreeItem=Gl,g.moveToTreeItems=rg,g.nextAnimateFrame=$o,g.nextMicroTask=Cu,g.objsIterator=Qs,g.oneTimeWarning=Xo,g.optionsStr=OS,g.pairToPromise=bh,g.pluckProperty=gh,g.react=j,g.reactArray=dt,g.reactArrayCollection=u_,g.reactArrayCollectionWithUndefined=ah,g.reactArrayWithUndefined=re,g.reactDeepArray=Ol,g.reactDeepArrayWithUndefined=vs,g.reactJson=wt,g.reactJsonCollection=l_,g.reactJsonCollectionWithUndefined=c_,g.reactJsonWithUndefined=Qt,g.reactPlainObject=o_,g.reactPlainObjectWithUndefined=a_,g.reactPosition2Ds=Hd,g.reactPosition2DsSet=h_,g.reactPositions=Nl,g.reactPositionsSet=bp,g.reduce=Iu,g.registerCreatedEventUpdate=uS,g.registerEventCtor=wp,g.registerEventUpdate=lS,g.removeAllTreesCallFunc=fy,g.requestAnimationFrameTimeStampTest=S_,g.rpToap=gw,g.saveOnBrowser=E_,g.setCanvasUniformColor=Hp,g.setExtProp=fi,g.setPromiseCancel=_s,g.setSceneObjectTreeItem=ql,g.setValueFromProps=w_,g.sleep=Nu,g.sleepDeprecated=R_,g.step=to,g.stepProcessing=i0,g.throttle=mh,g.timeout=ch,g.toGeoJson=_w,g.track=B,g.uint32ToUint8s=Yp,g.uint8ToHexStr=Mu,g.uint8sToUint32=Jp,g.updateTreeParamsCallFunc=py,g.webMercToLbh=Tw,g.xyz2N2=x_,g.xyz2N3=T_,g.xyzToLbh=Xh,g.xyzw2N4=O_,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
435
+ `,Lb='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',Fb='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Ho=class Ho extends V{constructor(e){super();const t=()=>{const n=this.dv(new Bc);this.d(B([n,"show"],[e,"useDefaultStatusDiv"]));{const i=()=>{n.show=(e.useDefaultStatusDiv??!0)&&e.status!=="Created"};i(),this.d(e.useDefaultStatusDivChanged.don(i)),this.d(e.statusChanged.don(i)),n.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}e.add(n),this.d(()=>e.delete(n)),n.instanceClass=class extends V{constructor(o,a,u){super();d(this,"_div",document.createElement("div"));if(this._subContainer=o,!u)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const v=()=>{a.show?this._div.style.opacity="1":this._div.style.opacity="0"};v(),this.d(a.showChanged.don(v))}let l,c,h,f,p;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",l=document.createElement("div"),this._div.appendChild(l),l.style.width="auto",l.style.position="absolute",l.style.left="50%",l.style.top="50%",l.style.transform="translate(-50%,-50%)",l.style.background="rgba(120, 120, 0, 0.7)",l.style.color="white",l.style.fontSize="10px",l.style.background="none",l.style.display="flex",l.style.justifyContent="center",l.style.alignItems="center",c=document.createElement("div"),l.appendChild(c),c.style.pointerEvents="none",c.style.display="block",c.style.width="40px",c.innerHTML=Ho.defaultsSvg.loadingSvg,c.style.filter="drop-shadow(0px 0px 1px black)",h=document.createElement("div"),l.appendChild(h),h.style.pointerEvents="none",h.style.marginLeft="10px",h.style.display="flex",h.style.flexFlow="column",h.style.maxWidth="300px",f=document.createElement("div"),h.appendChild(f),f.style.fontSize="14px",f.style.fontWeight="800",f.style.marginBottom="5px",f.style.textShadow="0 0 2px black",p=document.createElement("div"),h.appendChild(p),p.style.fontWeight="400",p.style.textShadow="0 0 2px black";{const v=()=>{let S="Raw";u.status==="Raw"?S="初始状态":u.status==="Creating"?S="正在创建":u.status==="Created"?S="创建完成":u.status==="Error"?S="创建失败":u.status==="Reconnecting"&&(S="重新连接"),f.innerText=`${S}(${u.status})`,p.innerText=`${u.statusLog}`,(u.status==="Creating"||u.status==="Reconnecting")&&(c.innerHTML=Ho.defaultsSvg.loadingSvg),u.status==="Created"&&(c.innerHTML=Ho.defaultsSvg.successSvg),u.status==="Error"&&(c.innerHTML=Ho.defaultsSvg.warnSvg)};v();const C=this.dv(Ie(u.statusLogChanged,u.statusChanged));this.d(C.don(v))}}update(){const o=255*Math.random()|0,a=255*Math.random()|0,u=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${a}, ${u}, 0.8)`}}};this.d(e.containerChanged.don(()=>{t()}))}};d(Ho,"defaultsSvg",{loadingSvg:Rb,successSvg:Lb,warnSvg:Fb});let fp=Ho;class Ab extends V{constructor(e,t,n){super(),this._subContainer=e,this._overlayContainer=t,this._viewer=n;const i=this._subContainer,s=this._overlayContainer,o=this._viewer,a=()=>{const c=o.zIndex??"";i.style.zIndex=c,s.style.zIndex=c};a(),this.d(o.zIndexChanged.don(a));const u=()=>{i.style.display=o.show??!0?"block":"none"};u(),this.d(o.showChanged.don(u));const l=()=>{i.style.opacity=`${o.opacity??1}`};l(),this.d(o.opacityChanged.don(l))}}function Kc(r){let e=Xn(r,"_relativeContainer");return e||(e=document.createElement("div"),e.style.position="relative",e.style.width="100%",e.style.height="100%",e.style.padding="0",e.style.margin="0",r.appendChild(e),fi(r,"_relativeContainer",e)),e}class kb extends V{constructor(t,n){super();d(this,"_subContainer",document.createElement("div"));d(this,"_overlayContainer",document.createElement("div"));d(this,"_containerStyleController");this._container=t,this._viewer=n,this._containerStyleController=this.dv(new Ab(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:s}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),Kc(this._container).appendChild(i),this.d(()=>Kc(this._container).removeChild(i)),Kc(this._container).appendChild(s),this.d(()=>Kc(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class Vb extends V{constructor(){super(...arguments);d(this,"registerObjsMap",new Map)}register(t,n){return this.registerObjsMap.has(t)&&console.warn(`register warn:${t}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(t,n),t}getViewerConstructor(t){const n=this.registerObjsMap.get(t);if(!n){console.warn(`未找到${t}类!`);return}return n}createViewer(t){const n=t.type;console.log(t);const i=this.getViewerConstructor(n);if(!i)throw new Error(`没有找到类型为${n}的Viewer构造器!`);return new i(t)}}class Wy extends V{constructor(e,t,n=!1,i=!1){if(super(),this._viewer=e,!t)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(ue.create(t,"pointerdown")),o=this.dv(ue.create(t,"pointermove")),a=this.dv(ue.create(t,"pointerup")),u=this.dv(ue.create(t,"pointerout")),l=this.dv(ue.create(t,"pointerover")),c=this.dv(new Oh),h=this.dv(new Bp),f=()=>{const m=this._viewer.hoverTime*1e3;h.delayTime=m};this.d(this._viewer.hoverTimeChanged.don(()=>{f()})),this.d(s.don(m=>c.pointerDown(m))),this.d(o.don(m=>c.pointerMove(m))),this.d(a.don(m=>c.pointerUp(m))),this.d(u.don(m=>c.pointerOut(m))),this.d(s.don(m=>h.pointerDown(m))),this.d(o.don(m=>h.pointerMove(m))),this.d(a.don(m=>h.pointerUp(m))),this.d(u.don(m=>h.pointerOut(m)));const{x:p,y:v}=t.getBoundingClientRect(),C=i?p:0,S=i?v:0;this.d(h.hoverEvent.don(m=>{const[w,E]=Ko(m,n);this._viewer.hoverEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(c.clickEvent.don(m=>{const[w,E]=Ko(m,n);this._viewer.clickEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(c.dbclickEvent.don(m=>{const[w,E]=Ko(m,n);m.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(s.don(m=>{const[w,E]=Ko(m,n);m.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(a.don(m=>{const[w,E]=Ko(m,n);m.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(o.don(m=>{const[w,E]=ln(m,n);this._viewer.pointerMoveEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(l.don(m=>{const[w,E]=ln(m,n);this._viewer.pointerOverEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})})),this.d(u.don(m=>{const[w,E]=ln(m,n);this._viewer.pointerOutEvent.emit({screenPosition:[w+C,E+S],pointerEvent:m})}));const P=this.dv(ue.create(t,"keydown"));this.d(P.don(m=>this._viewer.keyDownEvent.emit(m)));const y=this.dv(ue.create(t,"keyup"));this.d(y.don(m=>this._viewer.keyUpEvent.emit(m)));const _=this.dv(ue.create(t,"wheel"));this.d(_.don(m=>this._viewer.wheelEvent.emit(m)))}}const ms=class ms extends V{constructor(t){super();d(this,"_forceRecreateEvent",this.dv(new O));d(this,"_container",this.dv(j(void 0)));d(this,"_containerSize",this.dv(j(void 0)));d(this,"_editingEvent",this.disposeVar(new O));d(this,"_esViewerExtensions",this.dv(new Tb(this)));d(this,"_status",this.dv(j("Raw")));d(this,"_statusLog",this.dv(j("")));d(this,"_statusContainer",this.dv(new fp(this)));d(this,"_useCustomInteraction",this.dv(j(!0)));d(this,"_resetInteractionEvent",this.dv(Ie(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));d(this,"_interactionResetting",this.dv(new Ee(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new Wy(this,this.container)})));d(this,"_viewerChanged",this.dv(new O));d(this,"_cameraChanged",this.dv(new O));d(this,"_containerResetEvent",this.dv(Ie(this.containerChanged,this._forceRecreateEvent)));d(this,"_containerResetting",this.dv(new Ee(this._containerResetEvent,()=>{if(this.container)return new kb(this.container,this)})));d(this,"_sceneObjectsMap",new Map);d(this,"_id");d(this,"_typeName");d(this,"_updateFuncReact",this.dv(j(void 0)));d(this,"_toDestroyFuncReact",this.dv(j(void 0)));d(this,"_statusInfo",ms.defaults.statusInfo);d(this,"_navigationMode",this.dv(j("Map")));d(this,"_syncViewer",this.dv(j(void 0)));d(this,"_syncEventDon",this.dv(new Ee(this.syncViewerChanged,()=>{const t=this.syncViewer;if(t)return new Mb(this,t)})));d(this,"_timeSyncdon",this.dv(new Ee(this.timeSyncChanged,()=>{if(this.timeSync)return new Db(this)})));d(this,"_hoverEvent",this.dv(new O));d(this,"_pointerOverEvent",this.dv(new O));d(this,"_pointerMoveEvent",this.dv(new O));d(this,"_pointerDownEvent",this.dv(new O));d(this,"_pointerUpEvent",this.dv(new O));d(this,"_pointerOutEvent",this.dv(new O));d(this,"_clickEvent",this.dv(new O));d(this,"_dblclickEvent",this.dv(new O));d(this,"_keyDownEvent",this.dv(new O));d(this,"_keyUpEvent",this.dv(new O));d(this,"_wheelEvent",this.dv(new O));d(this,"_actived",this.dv(j(!1)));this._id=t.id??Jo();const n=By(t.container);if(n)this._container.value=dp(n),this._typeName=t.type,this._initName();else throw new Error("container is not defined");{const i=()=>{n&&(this.show??!0?n.style.display="block":n.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,s=()=>{for(let[a,u]of i.entries())if(!u&&a){const l=xo.context.createEngineObject(a,this);l&&i.set(a,l)}},o=()=>{for(let[a,u]of i.entries())u&&!u.isDestroyed()&&u.destroy(),i.set(a,void 0)};this.d(o),this.d(this.viewerChanged.don(a=>{o(),a&&s()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||Ou(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new Nb(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(t){this._container.value=t}set containerOrId(t){if(typeof t=="string"){const n=document.getElementById(t);n&&n instanceof HTMLDivElement?this._container.value=dp(n):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else t instanceof HTMLDivElement?this._container.value=dp(t):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(t){this._containerSize.value=t}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get esViewerExtensions(){return this._esViewerExtensions}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(t){this._status.value=t}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(t){this._statusLog.value=t}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(t){this._useCustomInteraction.value=t}get viewerChanged(){return this._viewerChanged}get cameraChanged(){return this._cameraChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(t){return this.sceneObjectsMap.get(t)}add(...t){for(let n of t)if(!this.has(n)){rt.context.addSceneObject(n);const i=xo.context.createEngineObject(n,this);i&&this._sceneObjectsMap.set(n,i),n.viewerAttached.emit(this)}}delete(...t){for(let n of t)if(this.has(n)){const i=this._sceneObjectsMap.get(n);i&&i.destroy(),rt.context.deleteSceneObject(n),this._sceneObjectsMap.delete(n),n.viewerDetached.emit(this)}}disposableAdd(...t){return this.add(...t),()=>this.delete(...t)}disAdd(...t){return this.disposableAdd(...t)}has(t){return this._sceneObjectsMap.has(t)}clearAllSceneObjects(){for(let t of this.sceneObjects)this.delete(t)}get id(){return this._id}set id(t){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return ms.createDefaultProps()}get completeJson(){return this._getJson(!1)}_getJson(t=!0){const n={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(t){let s,o=this.defaultProps[i];o instanceof ze?s=o.equals(this[i]):s=o===this[i],s||(n[i]=this[i])}else n[i]=this[i];return n}_setJson(t,n,i){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in t)this[a]=t[a]===null?void 0:t[a];else if(!(i??!1)){let u=this.defaultProps[a];u instanceof ze&&(u=u.value),this[a]=u}}get json(){return this._getJson()}set json(t){this._setJson(t,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(t){this._syncViewer.value=t}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(t){t&&t.syncViewer&&(t.syncViewer=void 0),t===this?this._syncViewer.value=void 0:this._syncViewer.value=t}setCurrentTime(t){try{this.currentTime=typeof t=="string"?Date.parse(t):t}catch(n){console.warn(`时间格式不正确! value: ${t} error: ${n}`)}}async getVersion(){return globalThis.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}get actived(){return this._actived.value}set actived(t){this._actived.value=t}get activedChanged(){return this._actived.changed}getESProperties(){return{defaultMenu:"general",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[],more:[]}}getProperties(t){const n={...this.getESProperties()},i=[];return n.general.length>0&&i.push(new ut(n.general,"general")),Object.keys(n).forEach(s=>{s!=="defaultMenu"&&s!=="general"&&n[s].length>0&&i.push(new ut(n[s],s))}),i}};d(ms,"context",new Vb),d(ms,"register",ms.context.register.bind(ms.context)),d(ms,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0,cameraMovableRegion:[0,0,0,0,0,0],depthTestAgainstTerrain:!0,terrainOpacity:1});let ri=ms;(r=>{r.createBaseProps=()=>({name:"未命名场景对象",extras:wt(void 0),devTags:re(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),r.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:re(void 0),editingAuxiliaryPointColor:re(void 0),editingLineWidth:void 0,editingLineColor:re(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:r.defaults.terrainShader,splitPosition:j(void 0),rollerShutter:!1,cameraMovableRegion:re(void 0),depthTestAgainstTerrain:!0,terrainOpacity:1}),r.createDefaultProps=()=>({...(0,r.createBaseProps)(),...(0,r.createCommonProps)()})})(ri||(ri={})),Gi(ri.prototype,ri.createDefaultProps);function Hy(r,e){const t=r._lastCameraInfo;if(t){const n=e.viewerChanged.don(i=>{if(!i||!t)return;const{position:s,rotation:o}=t;e.flyIn(s,o,0),r._lastCameraInfo=void 0,n()})}}const jb=r=>{const e=ri.createCommonProps(),t={};try{Object.keys(e).forEach(n=>{t[n]=r[n]})}catch(n){console.warn(n)}return t},qy=(r,e)=>{const t=ri.createCommonProps();try{Object.keys(t).forEach(n=>{r[n]=e[n]})}catch(n){console.warn(n)}};class Bb extends V{constructor(t){super();d(this,"_viewersChanged",this.disposeVar(new O));d(this,"_viewers",new Set);d(this,"_viewersToChange",this.dv(new O));this._sceneObjectsManager=t,this.d(()=>{for(const n of this._viewers)this.destroyViewer(n);this._viewers.clear()}),this.viewers.forEach(n=>{const i=this._sceneObjectsManager.sceneObjects;n.add(...i)}),this.d(()=>{const n=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(i=>{i.delete(...n)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((n,i)=>{this.viewers.forEach(s=>{i.forEach(o=>{qi(s.devTags,o.devTags)&&(s.has(o)?console.warn(`${s.typeName}中已存${o.typeName},检查逻辑是否有问题!`):s.add(o))}),n.forEach(o=>{qi(s.devTags,o.devTags)&&(s.has(o)?s.delete(o):console.warn(`${s.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))})}),i.length>0&&i.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(o=>{o.has(s)&&o.delete(s),console.log("sceneObjectsToChange",o.devTags,s.devTags,qi(o.devTags,s.devTags))}),this.viewers.forEach(o=>{qi(o.devTags,s.devTags)&&(o.has(s)?console.warn(`${o.typeName}中已存${s.typeName},检查逻辑是否有问题!`):o.add(s))})}))})})),this.d(this.viewersChanged.don((n,i)=>{const s=this._sceneObjectsManager.sceneObjects;i.forEach(o=>{for(let a of s)qi(o.devTags,a.devTags)&&(o.has(a)?console.warn(`${o.typeName}中已存${a.typeName},检查逻辑是否有问题!`):o.add(a))}),n.forEach(o=>{for(let a of s)qi(o.devTags,a.devTags)&&(o.has(a)?o.delete(a):console.warn(`${o.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))}),i.length>0&&i.forEach(o=>{o.d(o.devTagsChanged.don(()=>{o.clearAllSceneObjects();const a=this._sceneObjectsManager.sceneObjects;for(let u of a)console.log("viewersChanged",o.devTags,u.devTags,qi(o.devTags,u.devTags)),qi(o.devTags,u.devTags)&&(o.has(u)?console.warn(`${o.typeName}中已存${u.typeName},检查逻辑是否有问题!`):o.add(u))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(t){const n=ri.context.createViewer(t);return this._viewers.add(n),this._viewersChanged.emit([],[n]),n}destroyViewer(t){return t.isDestroyed()?!0:(this._viewers.delete(t),this._viewersChanged.emit([t],[]),t.destroy(),t.isDestroyed())}}class Zc extends V{constructor(...t){super();d(this,"_drgm",this.dv(new Ag));d(this,"_sobjm",this.dv(new Ib));d(this,"_vrm",this.dv(new Bb(this._sobjm)));d(this,"_sceneObjectEditingManager",this.disposeVar(new Pb));d(this,"_activeViewer",this.dv(j(void 0)));d(this,"_syncOtherViewersToActived",this.dv(j(!1)));d(this,"_cmrvm",this.createSceneObjectFromClass(kc));d(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));d(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});d(this,"_sceneTree",this.dv(new pl("default",this.dragstartDataMananger,24,this)));d(this,"_propUiTreeManager",this.dv(new ka(24)));d(this,"_sceneTreeMap",new Map);d(this,"_viewerCreatedEvent",this.dv(new O));d(this,"_lastCameraInfo");d(this,"_lastActiveViewerJson");d(this,"_syncEventDonFunc",this.d(Ui([this.activeViewerChanged,this.syncOtherViewersToActivedChanged],()=>{const t=this.syncOtherViewersToActived;this.viewers.forEach(n=>{t?n.syncOtherViewer(this.activeViewer):n.syncOtherViewer(void 0)})})));d(this,"_player",this.createSceneObjectFromClass(za));d(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));d(this,"_esPlyarAndPathTime",this.dv(new _b(this)));d(this,"_pathAnimationManager",this.dv(new Eb(this)))}static get envs(){return rt.context.environmentVariables}getSceneObjectById(t){return rt.getSceneObjectById(t)}getSceneObject(t){return rt.getSceneObject(t)}get $refs(){return rt.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(t){this._activeViewer.value=t,this.viewers.values().forEach(n=>n.actived=n===t)}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(t){this._syncOtherViewersToActived.value=t}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get completeJson(){var h;const t=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:t,modifiedTime:n,name:i},a=this.sceneTree.completeJson,u=this._cmrvm.views,l=[...this._vrm.viewers].map(f=>f.completeJson),c=(h=this.activeViewer)==null?void 0:h.getCurrentCameraInfo();return{asset:o,viewers:l,sceneTree:a,viewCollection:u,lastView:c}}get json(){var h;const t=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:t,modifiedTime:n,name:i},a=this.sceneTree.json,u=this._cmrvm.views,l=[...this._vrm.viewers].map(f=>f.json),c=(h=this.activeViewer)==null?void 0:h.getCurrentCameraInfo();return{asset:o,viewers:l,sceneTree:a,viewCollection:u,lastView:c}}set json(t){try{if(!t.asset)return;if(!t.asset.type||t.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=t.asset&&t.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=t.asset&&t.asset.modifiedTime||"",this._asset.name=t.asset&&t.asset.name||"未命名项目",this._asset.version=t.asset&&t.asset.version||"0.1.0",t.sceneTree&&(this.sceneTree.json=t.sceneTree),t.viewCollection&&(this._cmrvm.views=t.viewCollection),!t.viewers||!Array.isArray(t.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||t.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(n=>{const i=t.viewers.find(s=>s.id===n.id);i&&(n.json=i)})}catch(n){console.error(`ESObjectsManager解析json数据时发生错误! error: ${n}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(t){return Cb(this,t)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(t="default"){if(t==="default")return this._sceneTree;if(!this._sceneTreeMap.has(t)){console.warn(`id为${t}的SceneTree不存在!`);return}return this._sceneTreeMap.get(t)}createSceneTree(t,n=24){if(this._sceneTreeMap.has(t)||t==="default")console.warn(`id为${t}的SceneTree已存在!`);else{const i=this.dv(new pl(t,this.dragstartDataMananger,n,this));this._sceneTreeMap.set(t,i)}return this.getSceneTree(t)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(t){const n=this._vrm.createViewer(t);this.activeViewer||(this.activeViewer=n);const i=this.d(n.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(n),i())}));return n}destroyViewer(t){return this._activeViewer.value===t&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(t)}switchViewer(t,n=!0,i=!0,s=!0){var l;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&n&&(this._lastCameraInfo=(l=this.activeViewer)==null?void 0:l.getCurrentCameraInfo()),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?jb(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=t.id,a=o?[...this.getViewers()].find(c=>c.id===o):[...this.getViewers()].find(c=>c.typeName===t.type&&!c.container);if(a)if(o&&a.typeName!==t.type)console.warn(`id为${o}的viewer的typeName和option.type${t.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(a);else return console.log("ESViewer exists, will be used"),n&&Hy(this,a),i&&this._lastActiveViewerJson&&(qy(a,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),a.container===By(t.container)?(a.containerOrId=t.container,a.forceRecreate()):a.containerOrId=t.container,this.activeViewer=a,a;console.log("No ESViewer exists, will be created");const u=this.createViewer(t);return console.log(t),console.log(this),n&&Hy(this,u),i&&this._lastActiveViewerJson&&(qy(u,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=u,u}switchToCesiumViewer(...t){if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)){const{container:n,viewSync:i,attributeSync:s,destroy:o,id:a}=t[0];return this.switchViewer({type:"ESCesiumViewer",container:n,id:a},i??!0,s??!0,o??!0)}else if(typeof t[0]=="string"||t[0]instanceof HTMLDivElement){const n={container:t[0],viewSync:t[1]??!0,attributeSync:t[2]??!0,destroy:t[3]??!0,id:t[4]},{container:i,viewSync:s,attributeSync:o,destroy:a,id:u}=n;return this.switchViewer({type:"ESCesiumViewer",container:i,id:u},s,o,a)}}switchToUEViewer(...t){let n,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("uri")){const{container:u,uri:l,app:c,token:h,viewSync:f,attributeSync:p,destroy:v,id:C}=t[0];n={type:"ESUeViewer",container:u,id:C,options:{uri:l,app:c,token:h}},i={viewSync:f??!0,attributeSync:p??!0,destroy:v??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("ws")){const{container:u,ws:l,esmsg:c,viewSync:h,attributeSync:f,id:p,destroy:v}=t[0];n={type:"ESUeViewer",container:u,id:p,options:{ws:l,esmsg:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:v??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("project")){const{container:u,project:l,baseUrl:c,viewSync:h,attributeSync:f,id:p,destroy:v}=t[0];n={type:"ESUeViewer",container:u,id:p,options:{project:l,baseUrl:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:v??!0}}else(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?(n={type:"ESUeViewer",container:t[0],id:t[6],options:{ws:t[1],esmsg:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}):typeof t[1]=="string"&&t[1].startsWith("http")?(n={type:"ESUeViewer",container:t[0],id:t[7],options:{uri:t[1],app:t[2],token:t[3]??void 0}},i={viewSync:t[4]??!0,attributeSync:t[5]??!0,destroy:t[6]??!0}):(n={type:"ESUeViewer",container:t[0],id:t[6],options:{project:t[1],baseUrl:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}));if(!n)throw new Error("参数错误");const{viewSync:s,attributeSync:o,destroy:a}=i;return this.switchViewer(n,s,o,a)}createCesiumViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESCesiumViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(n={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESCesiumViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createOpenLayersViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESOlViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(n={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESOlViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createUeViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESUeViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?n={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{ws:t[1],esmsg:t[2]??void 0}}:typeof t[1]=="string"&&t[1].startsWith("http")?n={type:"ESUeViewer",container:t[0],id:t[4]??void 0,options:{uri:t[1],app:t[2],token:t[3]??void 0}}:n={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{project:t[1],baseUrl:t[2]??void 0}}),!n)throw new Error("参数错误");return this.createViewer(n)}createSceneObject(t,n){return this._sobjm.createSceneObject(t,n)}createSceneObjectFromUrl(t,n){return this._sobjm.createSceneObjectFromUrl(t,n)}createSceneObjectFromClass(t,n){return this._sobjm.createSceneObjectFromClass(t,n)}createSceneObjectFromJson(t){return this._sobjm.createSceneObjectFromJson(t)}destroySceneObject(t){const n=this._sobjm.deleteSceneObject(t);return t.destroy(),n}destroyAllSceneObjects(){const t=[...this._sobjm.sceneObjects];for(let n of t)n!=this._player&&n!=this._cmrvm&&this.destroySceneObject(n)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}d(Zc,"getSceneObjById",rt.context.getSceneObjectById.bind(rt.context)),d(Zc,"getEnv",rt.context.getEnv.bind(rt.context)),d(Zc,"setEnv",rt.context.setEnv.bind(rt.context)),g.BasePropTreeItem=Ud,g.Boolean2Property=J0,g.Boolean2sProperty=Z0,g.Boolean3Property=$0,g.Boolean3sProperty=Q0,g.Boolean4Property=K0,g.Boolean4sProperty=tw,g.BooleanProperty=X,g.BooleansProperty=z0,g.BorderedPosFloatDiv=eg,g.BoxPicker=Ch,g.CancelError=Fr,g.CancelsManager=Ph,g.CanvasImagePoi=c0,g.CanvasPoi=Nh,g.CanvasPointPoi=h0,g.CanvasPrimitive=zp,g.CanvasPrimitivesContext=d0,g.ColorProperty=Mt,g.ColorRgbProperty=rw,g.ColorStops=fb,g.ComplexImage=Cl,g.CursorFloatDiv=v0,g.CursorInfo=y0,g.DashPatternProperty=iw,g.DateProperty=io,g.DatesProperty=Lg,g.Debouncing=z_,g.DebouncingDeprecated=_h,g.DebouncingWithStartValues=U_,g.Destroyable=V,g.DivBoxPicker=V_,g.DivPoi=Zp,g.DivPointerClick=u0,g.DomElementEvent=ue,g.DoublyLinkedList=Sp,g.DragStartDataManager=Ag,g.ES3DTileset=Tr,g.ESAlarm=$d,g.ESApertureEffect=Kd,g.ESAreaMeasurement=Zd,g.ESBlastParticleSystem=Qd,g.ESBoxClipping=tf,g.ESCameraView=Fc,g.ESCameraViewCollection=kc,g.ESCameraVisibleRange=ef,g.ESCar=Vc,g.ESCityBasePoint=Qf,g.ESClassification=jc,g.ESClippingPlane=nf,g.ESCustomDiv=Bc,g.ESCzml=tp,g.ESDataMesh=rf,g.ESDatasmithRuntimeModel=Lf,g.ESDirectionMeasurement=Pf,g.ESDistanceMeasurement=sf,g.ESDynamicWater=Ff,g.ESEntityCluster=$f,g.ESExcavate=gl,g.ESFeatureLayer=hp,g.ESFireParticleSystem=of,g.ESForestTileset=af,g.ESGaussianSplatting=ip,g.ESGeoBezierSpline=Kf,g.ESGeoDiv=uf,g.ESGeoDivTextPoi=Zf,g.ESGeoExtrudedPolygon=Io,g.ESGeoJson=vl,g.ESGeoLineString=Ni,g.ESGeoPoints=El,g.ESGeoPolygon=Xt,g.ESGeoRectangle=lf,g.ESGeoVector=It,g.ESGeoWater=Af,g.ESGltfModel=zs,g.ESHeatMap=Xc,g.ESHeightLimitAnalysis=Jf,g.ESHeightMeasurement=If,g.ESHole=Uf,g.ESHuman=Po,g.ESHumanPoi=zf,g.ESImageLabel=zc,g.ESImageryLayer=hf,g.ESJEditingMode=et,g.ESJLonLatFormat=Fg,g.ESJPickedResult=dw,g.ESLabel=ar,g.ESLevelRuntimeModel=kf,g.ESLocalCircle=xf,g.ESLocalPolygon=yl,g.ESLocalPolygonZ=Tf,g.ESLocalRectangle=Of,g.ESLocalSkyBox=df,g.ESLocalVector=Va,g.ESLocalVector2D=us,g.ESLocationMeasurement=ff,g.ESMCPClient=mb,g.ESMsTileset=qf,g.ESNavigator=ep,g.ESObjectWithLocation=st,g.ESObjectsManager=Zc,g.ESParticleSystemPrimitive=Uc,g.ESPath=Ua,g.ESPathImpl=Us,g.ESPipeFence=Hc,g.ESPipeline=Vf,g.ESPipeserTileset=Nf,g.ESPit=Ba,g.ESPlayer=za,g.ESPoi2D=ml,g.ESPoi3D=pf,g.ESPoiTileset=Xf,g.ESPolygonFence=qc,g.ESPolygonFlattenedPlane=gf,g.ESPolygonWithHole=Mf,g.ESRectangle=Df,g.ESRtsFeatureEditing=Hf,g.ESRtsTileset=Wf,g.ESScale=Yf,g.ESSceneObject=rt,g.ESSceneObjectWithId=zg,g.ESSeparateFoliage=mf,g.ESSkylineAnalysis=op,g.ESStaticMesh=sp,g.ESSubmergingAnalysis=vf,g.ESSunshineAnalysis=yf,g.ESSurfaceAreaMeasurement=Rf,g.ESTerrainLayer=_f,g.ESTestObject=Jd,g.ESTextLabel=ja,g.ESUEWidget=wf,g.ESUnrealActor=Ef,g.ESVideoFusion=Cf,g.ESViewShed=Sf,g.ESViewer=ri,g.ESViewerStatusBar=np,g.ESViewerStatusBarScale=rp,g.ESVisibilityAnalysis=jf,g.ESVisualObject=Ht,g.ESVolumeMeasurement=Bf,g.ESWidget=bf,g.EngineObject=xo,g.EnumProperty=Pt,g.EnumStringsProperty=sw,g.EvalStringProperty=Es,g.Event=O,g.EventListenerHandler=oh,g.Fetching=R_,g.FloatDiv=Rh,g.FlvJsLoading=Jc,g.FlvProcessing=Vy,g.FunctionProperty=lt,g.Gif=Sg,g.GifPlayer=Cg,g.GifProcessing=bg,g.GroupPropTreeItem=Wd,g.GroupProperty=ut,g.HasOwner=P_,g.HlsJsLoading=Yc,g.HlsProcessing=ky,g.IFrameBorderedPosFloatDiv=g0,g.ImageProcessing=dg,g.IntervalDeprecated=Eh,g.JsonProperty=it,g.LeafPropTreeItem=Gd,g.ListenerPipe=sh,g.LocalFileServer=cg,g.LocalRootDir=lg,g.LongStringProperty=Uh,g.MaximumScreenSpaceErrorProperty=j0,g.MinmaxProperty=ow,g.NearFarScalerProperty=aw,g.NextAnimateFrameEvent=Fl,g.NextAnimateFrameWeakEvent=Pp,g.NextMicroTaskEvent=hh,g.NextMicroTaskWeakEvent=m_,g.NonreactiveJsonStringProperty=Dg,g.Number2Property=Ae,g.Number2sProperty=Og,g.Number3Property=cn,g.Number3sProperty=zh,g.Number4Property=Ar,g.Number4WithUndefinedProperty=X0,g.Number4sProperty=Y0,g.NumberProperty=M,g.NumberRangeProperty=uw,g.NumberSliderProperty=Ue,g.NumbersProperty=B0,g.ObjPool=Tl,g.ObjResetting=E0,g.ObjResettingWithEvent=Ee,g.ObservableArray=xu,g.ObservableSet=Wl,g.ParamsProperty=Ng,g.PickColorMananger=$p,g.PickedInfo=hw,g.Player=kr,g.PlayerProperty=Hl,g.PointerClick=Oh,g.PointerClickDeprecated=Fp,g.PointerHover=Bp,g.PointerHoverDeprecated=l0,g.PosFloatDiv=Ah,g.PositionProperty=ia,g.PositionsProperty=Mg,g.PositionsSetPropety=cw,g.Processing=Fe,g.PropTree=ey,g.PropUiTreeManager=ka,g.Property=ws,g.ReactVarProperty=Tt,g.ReactiveVariable=ze,g.RotationProperty=Gh,g.SceneObjectFromId=qh,g.SceneTree=pl,g.SceneTreeContextMenu=uy,g.SceneTreeItem=yn,g.SceneTreeItemDragDrop=ay,g.SmartListenerHandler=Eu,g.SmartListenerPipe=o_,g.SmoothMoveController=wS,g.String2Property=U0,g.String2sProperty=Tg,g.String3Property=G0,g.String3sProperty=H0,g.String4Property=W0,g.String4sProperty=q0,g.StringNumberProperty=ew,g.StringNumbersProperty=nw,g.StringProperty=pt,g.StringsProperty=xg,g.Throttling=o0,g.ThrottlingWithStartValues=a0,g.TimingDeprecated=Rp,g.ToolTipDiv=m0,g.Transition=Du,g.TransitionDeprecated=A_,g.Tree=ra,g.TreeItem=na,g.TreeItemDragDrop=kg,g.UiTree=sg,g.UiTreeObject=ig,g.UriProperty=Fu,g.VideoProcessing=gg,g.ViewPlayerProperty=Rg,g.ViewerCustomInteraction=Wy,g.Watcher=Au,g.WatcherTools=Ug,g.WithUndefinedProperty=Bh,g.XrPlayer=Ul,g.Xyzw2Ns=Vl,g.addTreesCallFunc=fy,g.animateFrame=Rl,g.ary2Ns=M_,g.asyncFuncToCancelablePromise=q_,g.bind=nt,g.bindCustomEditing=Bg,g.bindu=p_,g.booleanPointInPolygon=Nw,g.canMoveToTreeItem=Lu,g.canMoveToTreeItems=ng,g.cancelFuncToCancelablePromise=H_,g.cancelPromise=Sh,g.cancelableFetch=xh,g.cancelableFetchDeprecated=Mp,g.cancelableFetchWithProgress=Y_,g.cartesianDistance=Qv,g.clamp=jl,g.clamp0_360=sa,g.clampN180_180=jg,g.complexImageTypes=pg,g.createAnimateFrame=Ou,g.createAnimateFrameWithStartValues=ea,g.createBottomTriangleElement=tg,g.createCancelablePromise=ta,g.createCloseDiv=Qp,g.createEventsCallFunc=Ui,g.createFetching=J_,g.createFetchingWithStartValues=$_,g.createGuid=Jo,g.createInterval=e0,g.createIntervalWithStartValues=n0,g.createNextAnimateFrame=K_,g.createNextAnimateFrameEvent=Ie,g.createNextAnimateFrameEventCallFunc=y_,g.createNextAnimateFrameWeakEvent=__,g.createNextAnimateFrameWithStartValues=Z_,g.createNextMicroTask=Q_,g.createNextMicroTaskEvent=g_,g.createNextMicroTaskWeakEvent=v_,g.createNextMicroTaskWithStartValues=t0,g.createNumbers=kl,g.createProcessingFromAsyncFunc=Yn,g.createProcessingFromAsyncFuncWithStartValues=X_,g.createProcessingFromPromiseCreateFunc=zl,g.createProcessingFromPromiseCreateFuncWithStartValues=Ih,g.createPropTreeFromSceneObject=ny,g.createSleeping=r0,g.createSleepingWithStartValues=i0,g.createStartFuncFromAsyncFunc=Tu,g.createTimeout=kp,g.createTimeoutWithStartValues=Vp,g.cutDownTreesCallFunc=my,g.czmPixelFormats=fg,g.debounce=Ml,g.defaultGetLocalFilePath=C0,g.defaultInitSceneObjectOnCreatingFunc=pw,g.defaultLight122FromEnvironmentMapManager=Yd,g.defaultLocalFileServer=hg,g.defaultStartUpdateFunc=Al,g.defaultUpdateSceneObjectOnPickingFunc=fw,g.defineReactiveProp=wh,g.destroyObject=_p,g.downloadLink=S_,g.drawPoint=no,g.drawRoundRectPath=Up,g.drawText=Gp,g.drawTextBlock=Dh,g.engineObjectCreatedUpdate=iy,g.equalsN3=qd,g.every=fh,g.extendClassProps=Gi,g.fetchArrayBuffer=x_,g.fetchImage=Op,g.forEach=pi,g.forEachWithBreak=dh,g.geoAlong=Lw,g.geoArea=td,g.geoBuffer=Yv,g.geoCenterOfMass=Zw,g.geoDestination=om,g.geoDifference=Jv,g.geoDistance=Ql,g.geoHeading=Bu,g.geoIntersect=qv,g.geoLineIntersect=oE,g.geoNearestPointOnLine=cE,g.geoPointToLineDistance=pE,g.geoPolygonFromCircle=$v,g.geoPolygonOverlap=Bd,g.geoPolylineToBezierSpline=ty,g.geoRhumbDestination=vE,g.geoRhumbDistance=ym,g.geoRhumbHeading=_E,g.geoUnion=Xv,g.getCameraTools=vb,g.getColorHexStr=Ru,g.getCompleteReactParams=Dl,g.getDefaultValue=yw,g.getDistancesFromPositions=fl,g.getDomEventCurrentTargetPos=ln,g.getDrawRect=eo,g.getElementBounds=Cw,g.getErrorResult=Ze,g.getEventFromPromise=B_,g.getEventPosInCurrentTarget=Ko,g.getExtProp=Xn,g.getFileArrayBuffer=ug,g.getFileJson=ag,g.getFileText=kh,g.getFloatDivPool=Fh,g.getGeoBoundingSphereFromPositions=Zv,g.getIterator=Su,g.getMidpoint=uE,g.getMinMaxCorner=Kv,g.getMinMaxPosition=I_,g.getPromiseCancel=Zo,g.getPromiseFromEvent=j_,g.getPromiseFromProcessing=Th,g.getReactFuncs=zi,g.getSceneObjectTools=yb,g.getSceneObjectTreeItem=gw,g.getSubEntriesFromDir=og,g.getSuccessResult=Wn,g.getTypeFromImageUri=jy,g.getValueFromProps=Ip,g.getXyzFromPostion=zd,g.growthSimulationCallFunc=vy,g.hasSameTags=Vg,g.hasSameViewerTags=qi,g.imageToCanvas=Wp,g.inOrderRunning=_w,g.interval=lh,g.isJSON=Wh,g.isPromiseCancelable=Qo,g.isXML=vw,g.lbhToWebMerc=Tw,g.lbhToXyz=Vr,g.length=ph,g.lerpAngle=Xl,g.lerpRotation=Hh,g.loadGifFrames=wg,g.loadJs=vh,g.map=ry,g.max=Wi,g.min=ys,g.moveToTreeItem=Gl,g.moveToTreeItems=rg,g.nextAnimateFrame=$o,g.nextMicroTask=Cu,g.objsIterator=Qs,g.oneTimeWarning=Xo,g.optionsStr=OS,g.pairToPromise=bh,g.pluckProperty=gh,g.react=j,g.reactArray=dt,g.reactArrayCollection=l_,g.reactArrayCollectionWithUndefined=ah,g.reactArrayWithUndefined=re,g.reactDeepArray=Ol,g.reactDeepArrayWithUndefined=vs,g.reactJson=wt,g.reactJsonCollection=c_,g.reactJsonCollectionWithUndefined=h_,g.reactJsonWithUndefined=Qt,g.reactPlainObject=a_,g.reactPlainObjectWithUndefined=u_,g.reactPosition2Ds=Hd,g.reactPosition2DsSet=d_,g.reactPositions=Nl,g.reactPositionsSet=bp,g.reduce=Iu,g.registerEventCtor=wp,g.registerEventUpdate=lS,g.removeAllTreesCallFunc=py,g.requestAnimationFrameTimeStampTest=b_,g.rpToap=mw,g.saveOnBrowser=C_,g.setCanvasUniformColor=Hp,g.setExtProp=fi,g.setPromiseCancel=_s,g.setSceneObjectTreeItem=ql,g.setValueFromProps=E_,g.sleep=Nu,g.sleepDeprecated=L_,g.step=to,g.stepProcessing=s0,g.throttle=mh,g.timeout=ch,g.toGeoJson=ww,g.track=B,g.uint32ToUint8s=Yp,g.uint8ToHexStr=Mu,g.uint8sToUint32=Jp,g.updateTreeParamsCallFunc=gy,g.webMercToLbh=Ow,g.xyz2N2=T_,g.xyz2N3=O_,g.xyzToLbh=Xh,g.xyzw2N4=N_,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});