earthsdk3 3.11.2-beta.3 → 3.11.3-beta.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
- var EarthSDK3=(function(b){"use strict";var l4=Object.defineProperty;var u4=(b,Xn,Yr)=>Xn in b?l4(b,Xn,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):b[Xn]=Yr;var p=(b,Xn,Yr)=>u4(b,typeof Xn!="symbol"?Xn+"":Xn,Yr);var k_,O_;function Xn(){var n;const i=((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)??"unknown";let e="Unknown";/Windows/.test(i)?e="Windows":/Macintosh/.test(i)?e="MacOS":/Linux/.test(i)?e="Linux":/Android/.test(i)?e="Android":/iOS|iPhone|iPad|iPod/.test(i)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(i)?t="x64":/x86|i686|Win32/.test(i)?t="x86":/arm64|aarch64/.test(i)?t="arm64":/arm/.test(i)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const Yr=Date.now();function rp(i){var l;const{os:e,arch:t}=Xn(),n={version:i.version,commitdate:i.date,commitId:i.commitId,runningTime:(Date.now()-Yr)/1e3/60|0,date:new Date().toLocaleString(),href:((l=window==null?void 0:window.location)==null?void 0:l.href)??"unknown",os:e,arch:t},o={method:"GET",headers:new Headers,redirect:"follow"},h=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${h}`,o).then(d=>d.text()).then(d=>console.log(d)).catch(d=>console.log("error",d))}b.copyright=void 0;try{const i="earthsdk3",e="3.11.2-beta.3",t="2026-08-06T01:37:43.000Z",n="北京西部世界科技有限公司",s="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",o="c2e85afe31d0e17328b94d9b15b73cc60dcbe648",l=((Date.now()-1785980263e3)/36e5).toFixed(1),d=`%c🌏 ${i}%c ${e}.${o.slice(0,8)}.${t} (距今${l}个小时)
1
+ var EarthSDK3=(function(b){"use strict";var l4=Object.defineProperty;var u4=(b,Xn,Yr)=>Xn in b?l4(b,Xn,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):b[Xn]=Yr;var p=(b,Xn,Yr)=>u4(b,typeof Xn!="symbol"?Xn+"":Xn,Yr);var k_,O_;function Xn(){var n;const i=((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)??"unknown";let e="Unknown";/Windows/.test(i)?e="Windows":/Macintosh/.test(i)?e="MacOS":/Linux/.test(i)?e="Linux":/Android/.test(i)?e="Android":/iOS|iPhone|iPad|iPod/.test(i)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(i)?t="x64":/x86|i686|Win32/.test(i)?t="x86":/arm64|aarch64/.test(i)?t="arm64":/arm/.test(i)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const Yr=Date.now();function rp(i){var l;const{os:e,arch:t}=Xn(),n={version:i.version,commitdate:i.date,commitId:i.commitId,runningTime:(Date.now()-Yr)/1e3/60|0,date:new Date().toLocaleString(),href:((l=window==null?void 0:window.location)==null?void 0:l.href)??"unknown",os:e,arch:t},o={method:"GET",headers:new Headers,redirect:"follow"},h=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${h}`,o).then(d=>d.text()).then(d=>console.log(d)).catch(d=>console.log("error",d))}b.copyright=void 0;try{const i="earthsdk3",e="3.11.3-beta.1",t="2026-09-09T06:37:16.000Z",n="北京西部世界科技有限公司",s="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",o="d983ef6edbe46624b3bae491829389ea6120258b",l=((Date.now()-1788935836e3)/36e5).toFixed(1),d=`%c🌏 ${i}%c ${e}.${o.slice(0,8)}.${t} (距今${l}个小时)
2
2
  %c${s?s+`
3
3
  `:""}当前网站正在使用${i},此软件版权归${n}所有
4
- `;b.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","c2e85afe31d0e17328b94d9b15b73cc60dcbe648")},get info(){return d},get date(){return"2026-08-06T01:37:43.000Z"},get author(){return"suplyang"},get version(){return"3.11.2-beta.3"},get name(){return"earthsdk3"},get commitId(){return"c2e85afe31d0e17328b94d9b15b73cc60dcbe648"},print(){console.info(this.info,`
4
+ `;b.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","d983ef6edbe46624b3bae491829389ea6120258b")},get info(){return d},get date(){return"2026-09-09T06:37:16.000Z"},get author(){return"suplyang"},get version(){return"3.11.3-beta.1"},get name(){return"earthsdk3"},get commitId(){return"d983ef6edbe46624b3bae491829389ea6120258b"},print(){console.info(this.info,`
5
5
  font-size: 18px;
6
6
  font-weight: 1000;
7
7
  line-height: 1;
@@ -18,7 +18,7 @@ var EarthSDK3=(function(b){"use strict";var l4=Object.defineProperty;var u4=(b,X
18
18
  color: rgb(0, 120, 215);
19
19
  padding-bottom: 2px;
20
20
  padding-left: 35px;
21
- `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[i]=b.copyright,window.g_XE3SendProductUsageInfo=window.g_XE3SendProductUsageInfo||!0,window.g_XE3SendProductUsageInfo&&(setTimeout(()=>rp(b.copyright),6e4),setInterval(()=>rp(b.copyright),864e5)),window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&b.copyright.print()}catch{console.warn("版本信息有误!")}const ap=new Set;function Jr(i,e=i){ap.has(e)||(ap.add(e),console.warn(i))}function wo(i){const e=$h(i),t=()=>e[0][e[1]],n=o=>{try{e[0][e[1]]=o}catch(h){Jr(`setValue error, obj(${e[0].constructor.name}) prop(${e[1]}) error(${h})`)}},s=e[0][e[2]];return[t,n,s]}function b1(){return!0}function P1(){throw new Error("throwOnDestroyed")}function op(i){for(var e in i)typeof i[e]=="function"&&(i[e]=P1);i.isDestroyed=b1}const Cu=class Cu{constructor(){p(this,"_memId",++Cu._lastMemId);p(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 op(this)}tryDestory(){if(!this.isDestroyed())return this.destroy()}};p(Cu,"_lastMemId",-1);let st=Cu,Uu;function hp(i){Uu=i}Object.defineProperties(st.prototype,{toDestroyEvent:{get(){if(this._toDestroyEvent===void 0){if(!Uu)throw new Error("Destroyable EventCtor not registered yet!");this._toDestroyEvent=this.disposeVar(new Uu)}return this._toDestroyEvent}}});class Vh{constructor(e,t,n=!1){p(this,"_freeElements");p(this,"_usedElementsCount");p(this,"_usedElements");p(this,"_nextCreateID");p(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 C1(){return{item:void 0,previous:void 0,next:void 0}}function I1(i){i.item=void 0,i.previous=void 0,i.next=void 0}const lp=new Vh(C1,I1,!0);function Vu(i,e,t){const n=lp.create();return n.item=i,n.previous=e,n.next=t,n}function up(i){if(!i)throw new Error("node is undefined!");lp.destroy(i)}function qu(i,e){e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=void 0,i.tail=e.previous):e.next?(e.next.previous=void 0,i.head=e.next):(i.head=void 0,i.tail=void 0),e.next=void 0,e.previous=void 0}class cp{constructor(e){p(this,"head");p(this,"tail");p(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!");qu(this,e),this._decrementLength(),up(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){qu(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){qu(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=Vu(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=Vu(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=Vu(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;up(e),e=t}this.head=void 0,this.tail=void 0,this._setLength(0)}}function M1(){return{func:void 0,scope:void 0,_hasRemoved:!1,_once:!1}}function T1(i){i.func=void 0,i.scope=void 0,i._hasRemoved=!1,i._once=!1}const Ys=new Vh(M1,T1,!0);class $u{constructor(){p(this,"__dll");p(this,"__currentListenerStack")}get _dll(){return this.__dll=this.__dll??new cp({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 s=t.next;n._once&&!n._hasRemoved&&(this.remove(t),t=void 0),t&&this._clearHasRemoved(t),t=s}}}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,s=!1){if(e.item._hasRemoved)throw new Error("handler has removed!");const o=Ys.create();return o.func=t,o.scope=n,o._once=s,this._dll.insertBefore(e,o)}insertAfter(e,t,n,s=!1){if(e.item._hasRemoved)throw new Error("handler has removed!");const o=Ys.create();return o.func=t,o.scope=n,o._once=s,this._dll.insertAfter(e,o)}_clearHasRemoved(e){e.item._hasRemoved&&!this._hasCurrentListener(e.item)&&(Ys.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:(Ys.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()}`)),Ys.destroy(n.item),this._dll.remove(n),e=t}this.__dll=void 0,this.__currentListenerStack=void 0}push(e,t,n=!1){const s=Ys.create();return s.func=e,s.scope=t,s._once=n,this._dll.push(s)}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 s=Ys.create();return s.func=e,s.scope=t,s._once=n,this._dll.unshift(s)}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 Eo{constructor(){p(this,"_listenerHandler");p(this,"_cid")}_reset(e,t){this._listenerHandler=e,this._cid=t}clone(e){return e=e??new Eo,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 Wu extends Eo{}let H=class extends st{constructor(){super(...arguments);p(this,"__pipe");p(this,"beforeCallback");p(this,"afterCallback")}get _pipe(){return this.__pipe=this.__pipe??new $u,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,s=!1,o){const h=s?this._pipe.unshift(t,n,!1):this._pipe.push(t,n,!1);return o=o??new Wu,o._reset(h,h._cid),o}disposableOn(t,n,s=!1,o){const h=this.on(t,n,s,o);return()=>{h.valid&&this.off(h)}}don(t,n,s=!1,o){return this.disposableOn(t,n,s,o)}disposableWeakOn(t,n,s=!1,o){const h=new st,l=()=>{!h.isDestroyed()&&h.destroy()};return h.dispose(this.disposableOn(t,n,s,o)),h.dispose(this.toDestroyEvent.disposableOn(l)),l}dwon(t,n,s=!1,o){return this.disposableWeakOn(t,n,s,o)}once(t,n,s=!1,o){const h=s?this._pipe.unshift(t,n,!0):this._pipe.push(t,n,!0);return o=o??new Wu,o._reset(h,h._cid),o}disposableOnce(t,n,s=!1,o){const h=this.once(t,n,s,o);return()=>h.valid&&this.off(h)}donce(t,n,s=!1,o){const h=this.once(t,n,s,o);return()=>h.valid&&this.off(h)}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||(Jr("The event is destroying with listeners!"),this._pipe.removeAll())}};hp(H);function Kr(i,e){return e=e??new Eo,e._reset(i,i._cid),e}class k1{constructor(){p(this,"__pipe")}get _pipe(){return this.__pipe=this.__pipe??new $u,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,s=!1,o){if(!e.valid)throw new Error("handler is not valid!");const h=this._pipe.insertBefore(e._listenerHandler,t,n,s);return Kr(h,o)}insertAfter(e,t,n,s=!1,o){if(!e.valid)throw new Error("handler is not valid!");const h=this._pipe.insertAfter(e._listenerHandler,t,n,s);return Kr(h,o)}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,s){const o=this._pipe.push(e,t,n);return Kr(o,s)}pop(){return this._pipe.pop()}shift(){return this._pipe.shift()}unshift(e,t,n=!1,s){const o=this._pipe.unshift(e,t,n);return Kr(o,s)}getTail(e){const t=this._pipe.tail;if(t)return Kr(t,e)}getHead(e){const t=this._pipe.head;if(t)return Kr(t,e)}}class Ne extends st{constructor(t,n,s){super();p(this,"_changed");p(this,"_value");p(this,"_oldValue");p(this,"toChangeFunc");this._equalsFunc=n,this._assignFunc=s,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 H)),this._changed}forceChange(){this._changed&&this._changed.emit(this._value,this._value)}}function it(i,e,t){return new Ne(i,e,t)}function vt(i){return new Ne(i,(e,t)=>e.length!==t.length?!1:e.every((n,s)=>n===t[s]),(e,t)=>{const n=t||new Array(e.length);return n.length=e.length,e.forEach((s,o)=>n[o]=s),n})}function Wt(i){return it(i,(e,t)=>e===void 0||t===void 0?e===void 0&&t===void 0:e.length!==t.length?!1:e.every((n,s)=>n===t[s]),(e,t)=>{if(!e)return;const n=t||new Array(e.length);return n.length=e.length,e.forEach((s,o)=>n[o]=s),n})}function qh(i,e,t){return it(i,(n,s)=>n.length!==s.length?!1:n.every((o,h)=>e&&e(o,s[h])||o===s[h]),(n,s)=>{const o=s||new Array(n.length);return o.length=n.length,n.forEach((h,l)=>{o[l]=t?t(h):h}),o})}function vs(i,e,t){return it(i,(n,s)=>n===void 0||s===void 0?n===void 0&&s===void 0:n.length!==s.length?!1:n.every((o,h)=>e&&e(o,s[h])||o===s[h]),(n,s)=>{if(!n)return;const o=s||new Array(n.length);return o.length=n.length,n.forEach((h,l)=>{o[l]=t?t(h):h}),o})}function At(i){return new Ne(i,(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 se(i){return new Ne(i,(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 O1(i){return new Ne(i,(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every((o,h)=>o===s[h]&&e[o]===t[o])},(e,t)=>e&&{...e})}function N1(i){return new Ne(i,(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every((o,h)=>o===s[h]&&e[o]===t[o])},(e,t)=>e&&{...e})}function R1(i){return qh(i,(e,t)=>e.every((n,s)=>n===t[s]),e=>[...e])}function Hu(i){return vs(i,(e,t)=>e.every((n,s)=>n===t[s]),e=>[...e])}function A1(i){return qh(i,(e,t)=>JSON.stringify(e)===JSON.stringify(t),e=>JSON.parse(JSON.stringify(e)))}function D1(i){return vs(i,(e,t)=>JSON.stringify(e)===JSON.stringify(t),e=>JSON.parse(JSON.stringify(e)))}function Yn(i){return Hu(i)}function Xu(i){return vs(i,(e,t)=>e.length===t.length&&e.every((n,s)=>n.every((o,h)=>o===t[s][h])),e=>e.map(t=>[...t]))}function L1(i){return vs(i,(e,t)=>e.length===t.length&&e.every((n,s)=>n.every((o,h)=>o===t[s][h])),e=>e.map(t=>[...t]))}function $h(i){const e=i instanceof Ne?[i,"value","changed"]:[...i];return e[2]=e[2]||e[1]+"Changed",e}function Yu(i,e,t,n=!1){e[2]=e[2]||e[1]+"Changed";const s=()=>{const o=e[0][e[1]];t?i[0][i[1]]=t(o):i[0][i[1]]=o};return s(),n?e[0][e[2]].disposableWeakOn(s):e[0][e[2]].disposableOn(s)}function F1(i,e,t,n,s=!1){const o=Yu(i,e,t,s),h=Yu(e,i,n,s);return()=>(o(),h())}function Q(i,e,t,n=!1){const s=i instanceof Ne?[i,"value","changed"]:i,o=e instanceof Ne?[e,"value","changed"]:e;return Yu(s,o,t,n)}function mt(i,e,t,n,s=!1){const o=$h(i),h=$h(e);return F1(o,h,t,n,s)}function G1(i,e,t,n=!1){const[s]=wo(e);return mt(i,e,o=>o??t,o=>{if(!(o===t&&s()===void 0))return o},n)}function Zr(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var e=Math.random()*16|0,t=i==="x"?e:e&3|8;return t.toString(16)})}function Wh(i,e){if(!window||!window.setTimeout||!window.clearTimeout)throw new Error("目前只适合在浏览器中使用!");let t=0;function n(){t>0&&(window.clearTimeout(t),t=0)}function s(...o){n(),t=window.setTimeout(i,e,...o)}return[s,n]}function Ju(i,e,...t){const n=setInterval(i,e,...t);return()=>clearInterval(n)}function Ku(i,e,...t){const n=setTimeout(i,e,...t);return()=>clearTimeout(n)}function Hh(i,...e){let t;const n=()=>{const s=performance.now();i(s,...e),t=requestAnimationFrame(n)};return n(),()=>typeof t<"u"&&(cancelAnimationFrame(t),t=void 0)}function Qr(i,...e){let t;return t=requestAnimationFrame(()=>{const s=performance.now();i(s,...e)}),()=>typeof t<"u"&&(cancelAnimationFrame(t),t=void 0)}function So(i,...e){let t=!1,n;return new Promise((s,o)=>{n=o,s()}).then(()=>{!t&&i(...e)}).catch(s=>{console.error(s)}),()=>(t=!0)&&n&&(n("nextMicroTask cancelled!"),n=void 0)}class Xh extends H{constructor(t,n,...s){super();p(this,"_cancellFunc");this._nextFunc=t,this.dispose(()=>{this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0)}),s.forEach(o=>this.dispose(o[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 Zu extends Xh{constructor(...e){super(So,!1,...e)}}function j1(...i){return new Zu(...i)}class B1 extends Xh{constructor(...e){super(So,!0,...e)}}function z1(...i){return new Zu(...i)}class Yh extends Xh{constructor(...e){super(Qr,!1,...e)}}function we(...i){return new Yh(...i)}function U1(i,e){return new Yh(...i).don(e())}class dp extends Xh{constructor(...e){super(Qr,!0,...e)}}function V1(...i){return new dp(...i)}function Me(i,e,t={time:"don",immediate:!1}){const n=new Yh(...Array.isArray(i)?i:[i]),s=n[t.time??"don"](e);return(t.immediate??!1)&&e(),()=>{s(),n.destroy()}}function xo(i){let e;if(typeof i.next=="function")e=i;else if(typeof i[Symbol.iterator]=="function")e=i[Symbol.iterator]();else throw new Error("iteratorOrIterable error!");return e}function Qu(i,e){let t=!1;const n=xo(i);let s=-1;for(;;){const{done:o,value:h}=n.next();if(o)break;if(e(h,++s)){t=!0;break}}return t}function tc(i,e){return!Qu(i,(n,s)=>!e(n,s))}function bo(i,e,t,n){const s=i;if(!s[e]){const o=n(),h=Object.fromEntries(Object.entries(o).filter(([l,d])=>{const f=Object.getPrototypeOf(t),v=l in f;if(v){const m=d instanceof Ne?d.value:d;i[l]=m}return!v}).map(([l,d])=>d instanceof Ne?[l,d]:[l,Array.isArray(d)?Wt(d):it(d)]));s[e]=h}return s[e]}function ys(i,e){var n;const t=Symbol(`${(n=i==null?void 0:i.constructor)==null?void 0:n.name}-createDefaultProps`);i.constructor.__xbsj_dpSymbol=t,i.constructor.__xbsj_createDefaultProps=e;for(let[s,o]of Object.entries(e()))if(!Reflect.has(i,s)){const h=function(l){var v,m;if(l[t])return;const d=[];let f=Object.getPrototypeOf(l);for(;f;)d.push(f),f=Object.getPrototypeOf(f);d.reverse();for(let y of d){const w=(v=y.constructor)==null?void 0:v.__xbsj_dpSymbol;if(!w)continue;const S=(m=y.constructor)==null?void 0:m.__xbsj_createDefaultProps;S&&bo(l,w,y,S)}};Object.defineProperties(i,{[s]:{get(){return h(this),bo(this,t,i,e)[s].value},set(l){h(this);const d=bo(this,t,i,e)[s];if(!d){console.error("!propObj");debugger}d.value=l}},[`${s}Changed`]:{get(){return h(this),bo(this,t,i,e)[s].changed}},[`${s}React`]:{get(){return h(this),bo(this,t,i,e)[s]}}})}}const Po=new WeakMap;function yn(i,e,t){Po.has(i)||Po.set(i,{});const n=Po.get(i);n[e]=t}function _i(i,e){return Po.has(i)?Po.get(i)[e]:void 0}function _n(i,e){const t=xo(i);let n=0;for(;;){const{done:s,value:o}=t.next();if(s)break;e(o,n++)}}function Co(i,e,t){const n=xo(i);let s=t,o=0;for(;;){const{done:h,value:l}=n.next();if(h)break;s=e(s,l,o++)}return s}const q1=i=>++i;function ec(i){return Co(i,q1,0)}function Jn(i){return Co(i,(e,t)=>e>t?e:t,Number.NEGATIVE_INFINITY)}function _s(i){return Co(i,(e,t)=>e<t?e:t,Number.POSITIVE_INFINITY)}function fp(i,e){let t=i;for(let n of e)t=t[n];return t}function $1(i,e,t){if(e.length===0)throw new Error("props的数量必须大于0");const n=e.length-1,s=e[n];let o=i;for(let h=0;h<n;++h){const l=e[h];typeof o[l]>"u"&&(o[l]={}),o=o[l]}o[s]=t}function*Js(i,e){const t=xo(i);for(;;){const{done:n,value:s}=t.next();if(n)break;yield fp(s,e)}}class Io extends st{constructor(){super();p(this,"_innerObj");p(this,"_toChangeEvent");p(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 H),this._toChangeEvent}get changedEvent(){return this._changedEvent||(this._changedEvent=new H),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 s=0;s<n;++s)this._innerObj[s]=t[s];this._changedEvent&&this._changedEvent.emit(this)}splice(t,n,...s){const{length:o}=this._innerObj;t=t>this._innerObj.length?this._innerObj.length:t,t>o?t=o:t<0&&(t+=o,t<0&&(t=0));const h=this._innerObj.length-t;if(n>h?n=h:n<0&&(n=0),arguments.length===1){this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:this._innerObj.length-t,items:[]}],this);const l=this._innerObj.splice(t);return this._changedEvent&&this._changedEvent.emit(this),l}else if(arguments.length===2){this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:n,items:[]}],this);const l=this._innerObj.splice(t,n);return this._changedEvent&&this._changedEvent.emit(this),l}else{this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:n,items:s}],this);const l=this._innerObj.splice(t,n,...s);return this._changedEvent&&this._changedEvent.emit(this),l}}pop(){if(this._innerObj.length===0)return;if(this._toChangeEvent){const n=this._innerObj.length-1,s=1,o=[];this._toChangeEvent.emit([{start:n,deleteCount:s,items:o}],this)}const t=this._innerObj.pop();return this._changedEvent&&this._changedEvent.emit(this),t}push(...t){if(this._toChangeEvent){const s=this._innerObj.length;this._toChangeEvent.emit([{start:s,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 s,o,h;n>t?(s=t,o=n-t,h=[]):(s=n,o=0,h=new Array(t-n)),this._toChangeEvent.emit([{start:s,deleteCount:o,items:h}],this)}this._innerObj.length=t,this._changedEvent&&this._changedEvent.emit(this)}}get(t){return this._innerObj[t]}set(t,n){const{length:s}=this._innerObj;if(t<0||t>=s)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 ic(i,e,...t){let n=i;for(let s of t){if(!n[s])if(e)n[s]={};else return;n=n[s]}return n}function W1(i,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([i],{type:t||""});let s=URL.createObjectURL(n);var o=document.createElement("a"),h=new MouseEvent("click");o.download=e,o.href=s,o.dispatchEvent(h),URL.revokeObjectURL(s)}function H1(i,e){const t=document.createElement("a"),n=new MouseEvent("click");t.download=e||"下载",t.href=i,t.dispatchEvent(n)}function X1(){return new Promise((i,e)=>{const t=performance.now();requestAnimationFrame(n=>i(n>t))})}const Jh=i=>{let e,t;return t=n=>{n=performance.now(),e=requestAnimationFrame(t),i(n)},e=requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}};function nc(i,e,t=Jh){let n=Number.NEGATIVE_INFINITY,s;function o(d){d-n>e&&s&&(i(...s),s=void 0,n=d)}const h=t&&t(o)||void 0;function l(...d){s=d}return[l,h]}const gp=[];function pp(i,e,t){if(gp.includes(i)){console.warn(`_loadJs ${i} has loaded before!`),e&&e();return}var n=document.getElementsByTagName("head")[0],s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",i),s.onload=s.onreadystatechange=function(){this.readyState&&this.readyState!=="complete"||(gp.push(i),e&&e(),s.onload=s.onreadystatechange=null)},s.onerror=(o,h,l,d,f)=>{t(f)},n.appendChild(s)}function sc(i,e=!0){if(e){const t=window.L;window.L&&(window.L=void 0);const n=window.define;return window.define&&(window.define=void 0),new Promise((s,o)=>{pp(i,s,o)}).then(()=>(window.define=n,window.L=t,Promise.resolve()))}else return new Promise((t,n)=>{pp(i,t,n)})}async function mp(i,e=""){return new Promise((t,n)=>{var s=new Image;s.crossOrigin=e,s.src=i,s.onload=()=>t(s),s.onerror=o=>n(o)})}class Y1 extends st{constructor(e){super(),this._owner=e}get owner(){return this._owner}}function vp(i,e){if(i.length%3!==0)throw new Error("positions.length % 3 !== 0");const t=i.length/3;function*n(h){for(let l=0;l<t;++l)yield i[l*3+h]}const s=(e==null?void 0:e.min)??[NaN,NaN,NaN],o=(e==null?void 0:e.max)??[NaN,NaN,NaN];return s[0]=_s(n(0))??NaN,s[1]=_s(n(1))??NaN,s[2]=_s(n(2))??NaN,o[0]=Jn(n(0))??NaN,o[1]=Jn(n(1))??NaN,o[2]=Jn(n(2))??NaN,{min:s,max:o}}async function J1(i,e=fetch){const t=await e(i);return t.ok?await t.arrayBuffer():void 0}class K1 extends st{constructor(t){super();p(this,"_map",new Map);p(this,"_array",[]);p(this,"_createEvent",this.dv(new H));p(this,"_updateEvent",this.dv(new H));p(this,"_destroyEvent",this.dv(new H));this._idFunc=t,this.d(()=>{this._array.length>0&&console.warn("EventFromArrayUpdating: destroy with non-empty array, will trigger destroy event for all items")})}get createEvent(){return this._createEvent}get updateEvent(){return this._updateEvent}get destroyEvent(){return this._destroyEvent}update(t,n={toDel:!0,toAdd:!0,toUpdate:!0}){const{toDel:s=!0,toAdd:o=!0,toUpdate:h=!0}=n;for(let d of this._array)d.updated=!1;const l=t.length;for(let d=0;d<l;++d){const f=t[d],v=this._idFunc(f,d);if(this._map.has(v)){if(h){const m=this._map.get(v);if(!m)throw new Error("!edwi");m.updated=!0,m.item=f,this._updateEvent.emit(v,f)}}else if(o){const m={item:f,id:v,updated:!0};this._array.push(m),this._map.set(v,m),this._createEvent.emit(v,f)}}if(s){const d=this._array.filter(f=>!f.updated);this._array=this._array.filter(f=>f.updated);for(let f of d)this._map.delete(f.id);for(let f of d)this._destroyEvent.emit(f.id,f.item)}}}function Kh(i,...e){if(i>16)throw new Error("length > 16");const t=new Array(i);for(let n=0;n<i;++n)t[n]=e[n]??0;return t}class Zh{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 Z1(i){return new Zh(i,2)}function Q1(i){return new Zh(i,3)}function tw(i){return new Zh(i,4)}class ew{constructor(e,t,n,s){this._array=e,this._length=t,this._start=n,this._stride=s}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 iw(i,e,t=0,n=1){return new ew(i,e,t,n)}b.Vector=void 0,(i=>{function e(A,...at){if(A=A||Kh(at.length),at.length>A.length)throw new Error("args.length > target.length");return A instanceof Float64Array?A.set(at):G(at,A),A}i.set=e;function t(A,at){const Pt=A.length;for(let It=0;It<Pt;++It)if(!at(A[It],It))return!1;return!0}i.every=t;function n(A,at,Pt){const It=A.length;let re=Pt;for(let le=0;le<It;++le)re=at(re,A[le],le);return re}i.reduce=n;function*s(A){for(let at=0;at<A.length;++at)yield A[at]}i.itr=s;const o=(A,at)=>A+=at*at;function h(A){return n(A,o,0)}i.magnitudeSquared=h;function l(A){const at=h(A);return Math.sqrt(at)}i.magnitude=l;function d(A,at=1e-5){const Pt=h(A);return Math.abs(Pt-1)<at}i.isNormalized=d;let f;const v=(A,at,Pt)=>A+at*f[Pt];function m(A,at){return V(A,at),f=at,n(A,v,0)}i.dot=m;let y;const w=(A,at,Pt)=>A+=(at-y[Pt])*(at-y[Pt]);function S(A,at){return V(A,at),y=at,n(A,w,0)}i.distanceSquared=S;function T(A,at){return Math.sqrt(S(A,at))}i.distance=T;let N;const j=(A,at)=>A===N[at];function C(A,at){return V(A,at),N=at,t(A,j)}i.equals=C;let k,M;const D=(A,at)=>Math.abs(A-k[at])<M;function L(A,at,Pt=0){return V(A,at),k=at,M=Pt,t(A,D)}i.equalsEpsilon=L;function V(A,at){if(A.length!==at.length)throw new Error("left.length !== right.length")}function x(A,at,Pt){const It=A.length;Pt=Pt||Kh(It),V(A,Pt);for(let re=0;re<It;++re)Pt[re]=at(A[re],re);return Pt}i.op1=x;function I(A,at,Pt,It){V(A,at),It&&V(A,It);const re=A.length;It=It||Kh(re);for(let le=0;le<re;++le)It[le]=Pt(A[le],at[le]);return It}i.op2=I;const R=A=>A;function G(A,at){return x(A,R,at)}i.clone=G;let F=0;const U=(A,at)=>A*F;function z(A,at,Pt){return F=at,x(A,U,Pt)}i.multiplyByScalar=z;function $(A,at,Pt=0){const It=h(A);if(It<=Pt)return;const re=Math.sqrt(It);return z(A,1/re,at)}i.normalize=$;function W(A,at){return z(A,-1,at)}i.negate=W;const X=A=>Math.abs(A);function Y(A,at){return x(A,X,at)}i.abs=Y;const et=A=>A-Math.floor(A);function J(A,at){return x(A,et,at)}i.fract=J;const rt=(A,at)=>A-at;function ht(A,at,Pt){return I(A,at,rt,Pt)}i.subtract=ht;const Ot=(A,at)=>A+at;function ct(A,at,Pt){return I(A,at,Ot,Pt)}i.add=ct;const _t=(A,at)=>A*at;function Ct(A,at,Pt){return I(A,at,_t,Pt)}i.multiply=Ct;const Lt=(A,at)=>A/at;function K(A,at,Pt){return I(A,at,Lt,Pt)}i.divide=K;let Qt;const zt=(A,at)=>A*(1-Qt)+at*Qt;function gt(A,at,Pt,It){return Qt=Pt,I(A,at,zt,It)}i.lerp=gt})(b.Vector||(b.Vector={}));function Qh(i,e=0,t=1){return i<e?e:i>t?t:i}class tl extends st{constructor(t,n,s,o,h,l,d,f){super();p(this,"__status");p(this,"_statusChangedEvent");p(this,"_forceCancelFunc");p(this,"_startEvent");p(this,"_progressEvent");p(this,"_completeEvent");p(this,"_cancelEvent");p(this,"_cancelledEvent");p(this,"_errorEvent");p(this,"_finishedEvent");p(this,"_processingID",-1);this._startProcessingFunc=t,this.startFunc=n,this.progressFunc=s,this.completeFunc=o,this.cancelFunc=h,this.cancelledFunc=l,this.errorFunc=d,this.finishedFunc=f,this._status="Initial",this.dispose(()=>{var v;return(v=this._statusChangedEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._startEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._progressEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._completeEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._cancelEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._cancelledEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._errorEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._finishedEvent)==null?void 0:v.destroy()}),this.dispose(()=>this.reset())}get startEvent(){return this._startEvent=this._startEvent||new H,this._startEvent}get progressEvent(){return this._progressEvent=this._progressEvent||new H,this._progressEvent}get completeEvent(){return this._completeEvent=this._completeEvent||new H,this._completeEvent}get cancelEvent(){return this._cancelEvent=this._cancelEvent||new H,this._cancelEvent}get cancelledEvent(){return this._cancelledEvent=this._cancelledEvent||new H,this._cancelledEvent}get errorEvent(){return this._errorEvent=this._errorEvent||new H,this._errorEvent}get finishedEvent(){return this._finishedEvent=this._finishedEvent||new H,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,s={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},o=this._startProcessingFunc(s,...t);return this._forceCancelFunc=o,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 H),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 s=this._forceCancelFunc(n);if(this._forceCancelFunc=void 0,s&&s instanceof Promise)return s.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(s){console.error(`processing restart error: ${s}`)}}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 rc=class extends Error{};function yp(i,e){typeof i=="function"?i(e):i.cancelFunc=e}class ac extends tl{constructor(t=300){super(({progressFunc:n,completeFunc:s,errorFunc:o})=>{const[h,l]=Wh(()=>{if(!this._lastDebounceValue)throw new Error("!this._lastDebounceValue");n([this._lastDebounceValue,this._debouncTimes]),this._debouncTimes=0},this._delayTime);return this._d=h,()=>{l()}});p(this,"_lastDebounceValue");p(this,"_debouncTimes",0);p(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 _p(i,e,...t){const n=new AbortController;let s=n.signal,[o,h]=t;if(h!=null&&h.signal)throw console.error("init?.signal"),new Error("init?.signal");h=h||{},h.signal=s;let l=!1;yp(i,()=>{l=!0,n.abort()});let d=fetch(o,h);return e&&(d=d.then(f=>{if(!f.ok)return f;if(!f.body)throw Error("ReadableStream not yet supported in this browser.");const v=f.headers.get("content-length"),m=v?parseInt(v,10):0;let y=0;return new Response(new ReadableStream({start(w){if(!f.body)throw new Error("!response.body");const S=f.body.getReader();T();function T(){S.read().then(({done:N,value:j})=>{if(N){w.close();return}if(!j)throw new Error("!value");if(!e)throw new Error("!progressFunc");y+=j.byteLength,e(y,m),w.enqueue(j),T()}).catch(N=>{w.error(N)})}}}),{status:f.status,statusText:f.statusText,headers:f.headers})}).catch(f=>{throw l?(f instanceof Error&&f.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new rc("fetching cancelled!")):(f instanceof Error&&f.code===20&&console.error("error.code === 20"),f)})),d}function wp(...i){if(i.length>=1)if(typeof i[0]=="function"||typeof i[0]>"u"){const e={};let t=_p(e,...i);const{cancelFunc:n}=e;if(!n)throw new Error("!cancelResult.cancelFunc");return[n,t]}else return _p(...i);throw new Error("cancelableFetch args error!")}class nw extends tl{constructor(t,...n){super(({progressFunc:s,completeFunc:o,errorFunc:h},...l)=>{const d={};let f={loaded:0,total:0};const v=(w,S)=>{f.loaded=w,f.total=S,s(f)},m=this._fetchArgs||l;if(m.length===0)throw new Error("fetchArgs.length === 0");if(wp(d,v,...m).then(t).then(o).catch(w=>{w instanceof rc||h(w)}),!d.cancelFunc)throw new Error("!cancelResult.cancelFunc");return d.cancelFunc});p(this,"_fetchArgs");n.length>0&&(this._fetchArgs=n)}get fetchArgs(){return this._fetchArgs}}function oc(i,e,t,n){const s="_"+e,o="_"+e+"Changed",h=e+"Changed";Object.defineProperties(i.prototype,{[e]:{get(){return typeof this[s]>"u"&&typeof t<"u"&&(this[s]=t),this[s]},set(l){if(typeof this[s]>"u"&&typeof t<"u"&&(this[s]=t),n?!n(this[s],l):this[s]!==l){const d=this[s];this[s]=l,this[o]&&this[o].emit(l,d)}}},[h]:{get(){return typeof this[o]>"u"&&(this[o]=new H,typeof this.dispose<"u"&&this.dispose(()=>this[o].destroy())),this[o]}}})}class hc extends tl{constructor(t,n=!0){super(({progressFunc:s,completeFunc:o,errorFunc:h})=>(this._intervalFunc=s,this._intervalID&&console.error("this._intervalID should be undefined!"),this.leading&&s(),this._intervalID=setInterval(s,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}));p(this,"_intervalID");p(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))}))}}oc(hc,"leading",!0),oc(hc,"intervalTime",500);function sw(i,e){let t,n;const s=new Promise((h,l)=>{n=l,t=globalThis.setTimeout(()=>{t=void 0,h()},i)}),o=h=>{t&&(clearTimeout(t),t=void 0),n&&n(h??new rc("sleep cancel error!"))};if(typeof e=="boolean"&&e)return[o,s];if(e)return yp(e,o),s}class rw{constructor(e=0,t=0,n=0,s,o){p(this,"_processData");p(this,"_lastUpdateTimeStamp",0);this.startTime=e,this.duration=t,this.delay=n,this.proccessFunc=s,this.completeFunc=o,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 Ep extends tl{constructor(t=1e3,n=0,s=Jh){let o;function h(){o&&o()}super(({progressFunc:d,completeFunc:f,errorFunc:v})=>{const m=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=d,this._base.completeFunc=()=>{m&&m(),f()},this._base.start(),o=m,h});p(this,"_base");p(this,"duration");p(this,"delay");p(this,"startUpdateFunc");this._base=new rw,this.duration=t,this.delay=n,this.startUpdateFunc=s}get startTime(){return this._base.startTime}}class aw extends st{constructor(t){super();p(this,"_target",0);p(this,"_current",0);p(this,"_start",0);p(this,"_timing",new Ep(Number.POSITIVE_INFINITY));p(this,"_currentChanged");this._duration=t,this._timing.progressFunc=({ratio:n})=>{n=n<0?0:n>1?1:n;const s=this._start*(1-n)+this._target*n;this._current=s,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 H),this._currentChanged}}function Sp(i,e){e=e||[];const t=i.parentNode;return t?Sp(t,e.concat(t)):e}function ow(i){const e=i.composedPath&&i.composedPath()||i.path,t=i.target;if(e!=null)return e.indexOf(window)<0?e.concat(window):e;if(t===window)return[window];if(t===null)throw new Error("target === null");return[t].concat(Sp(t),window)}function $e(i,e=!1){const{offsetX:t,offsetY:n}=i;let s=t,o=n;{const h=ow(i);for(let l=0;l<h.length;++l){const d=h[l];if(d!==i.currentTarget&&d instanceof HTMLElement)s+=d.clientLeft,o+=d.clientTop,s+=d.offsetLeft,o+=d.offsetTop;else break}}return e?[s*window.devicePixelRatio,o*window.devicePixelRatio]:[s,o]}function ta(i,e=!1){const t=i.target,n=i.currentTarget||i.__xbsj_lastCurrentTarget__;if(!t||!n)return[i.clientX,i.clientY];const s=t.getBoundingClientRect(),o=n.getBoundingClientRect(),h=s.left+i.offsetX,l=s.top+i.offsetY,d=h-o.left,f=l-o.top;return e?[d*window.devicePixelRatio,f*window.devicePixelRatio]:[d,f]}class xp extends st{constructor(t){super();p(this,"_clickEvent",new H);p(this,"_dbclickEvent",new H);p(this,"_downEvent",new H);p(this,"_upEvent",new H);p(this,"_moveEvent",new H);p(this,"_debouncing",new ac(300));this.dispose(()=>{this._clickEvent.destroy(),this._dbclickEvent.destroy(),this._downEvent.destroy(),this._upEvent.destroy(),this._moveEvent.destroy(),this._debouncing.destroy()});let n=!1,s=[0,0],o=!1;this._debouncing.progressFunc=([[v,m,y],w])=>{w===1?this._clickEvent.emit(v,m,y):w>=2?this._dbclickEvent.emit(v,m,y):console.error("point click should not be here!")},this._debouncing.start(),this.dispose(()=>{this._debouncing.isRunning&&this._debouncing.cancel(),this._debouncing.destroy()});const h=v=>{n=!0;const[m,y]=$e(v);s[0]=m,s[1]=y,this._downEvent.emit(m,y,v)},l=v=>{const[m,y]=$e(v);n&&!o&&this._debouncing.debounce(m,y,v),n=!1,o=!1,this._upEvent.emit(m,y,v)},d=v=>{const[m,y]=$e(v);if(n&&!o){const[w,S]=s;(Math.abs(m-w)>3||Math.abs(y-S)>3)&&(o=!0)}this._moveEvent.emit(m,y,v)},f=()=>{n=!1,o=!1};t.addEventListener("pointerdown",h),t.addEventListener("pointerup",l),t.addEventListener("pointermove",d),t.addEventListener("pointerout",f),this.dispose(()=>{t.removeEventListener("pointerdown",h),t.removeEventListener("pointerup",l),t.removeEventListener("pointermove",d),t.removeEventListener("pointerout",f)})}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 lc extends st{constructor(){super();p(this,"_pickRectEvent",this.disposeVar(new H));p(this,"_updateRectEvent",this.disposeVar(new H));p(this,"_pointerActionEvent",this.disposeVar(new H));p(this,"_active",this.disposeVar(it(!1)));p(this,"_pickRect",{left0:0,top0:0,left1:0,top1:0});let t=0,n=0,s=0,o=0;this.dispose(this._pointerActionEvent.disposableOn(({type:h,left:l,top:d})=>{h==="PointerDown"?(this._active.value=!0,t=l,n=d,s=l,o=d,this._setPickRect({left0:t,top0:n,left1:s,top1:o}),this._updateRectEvent.emit(this._pickRect)):h==="PointerMove"?this._active.value&&(s=l,o=d,this._setPickRect({left0:t,top0:n,left1:s,top1:o}),this._updateRectEvent.emit(this._pickRect)):h==="PointerUp"&&this._active.value&&(this._active.value=!1,s=l,o=d,this._setPickRect({left0:t,top0:n,left1:s,top1:o}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect))}))}_setPickRect({left0:t,left1:n,top0:s,top1:o}){this._pickRect.left0=t,this._pickRect.left1=n,this._pickRect.top0=s,this._pickRect.top1=o}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:s,top0:o,left1:h,top1:l}=t;return n.width=Math.abs(s-h),n.height=Math.abs(o-l),n.left=Math.min(s,h),n.top=Math.min(o,l),n.forward=h>s,n}static contains(t,n,s){const{left:o,top:h,width:l,height:d}=s;return t>o&&t<=o+l&&n>=h&&n<=h+d}}class hw extends lc{constructor(e){super();const t=this.disposeVar(new xp(e));this.dispose(t.downEvent.disposableOn((h,l,d)=>d.altKey&&this.pointerDown(h,l))),this.dispose(t.moveEvent.disposableOn((h,l)=>this.pointerMove(h,l))),this.dispose(t.upEvent.disposableOn((h,l)=>this.pointerUp(h,l)));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(h=>{n.style.display=h?"block":"none"}));const s=()=>{this.reset()};e.addEventListener("contextmenu",s),this.dispose(()=>e.removeEventListener("contextmenu",s));const o={left:0,top:0,width:0,height:0,forward:!1};this.dispose(this.updateRectEvent.disposableOn(h=>{if(lc.getLeftTopAndSize(h,o)){const{left:l,top:d,width:f,height:v}=o;n.style.height=`${v|0}px`,n.style.width=`${f|0}px`,n.style.left=`${l|0}px`,n.style.top=`${d|0}px`}}))}}class tn extends Error{}function ws(i,e){_i(i,"_promise_cancel")&&console.warn("setPromiseCancel warn: promise has cancelFunc!"),yn(i,"_promise_cancel",e)}function ea(i){return _i(i,"_promise_cancel")}function ia(i){return!!ea(i)}function uc(i,e){const t=ea(i);return t?(t(e),!0):!1}function cc(i){const[e,t]=i;return ws(t,e),t}function na(i){let e;const t=new Promise((n,s)=>{e=s,i.then(n).catch(s)});return ws(t,e),t}function lw(i){let e,t;var n=new Promise((s,o)=>{t=i.disposableOn((...h)=>{t&&t(),s(h)}),e=h=>{t&&t(),o(h)}});return[e,n]}function uw(i){const e=new H,t=new H;return i.then(n=>{e.isDestroyed()||e.emit(n)}).catch(n=>{t.isDestroyed()||t.emit(n)}),[e,t]}class dc extends st{constructor(){super();p(this,"_cancelled",!1);p(this,"_cancelError");p(this,"_promiseSet",new Set);p(this,"_disposer")}get disposer(){return this._disposer=this._disposer||new st,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 s of this._promiseSet)uc(s);this._promiseSet.clear()}}get cancelFuncsNum(){return Co(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 tn("cancel from CancelManager!")}promise(t){return this._promiseSet.add(t),t.finally(()=>(this._promiseSet.delete(t),this.check()))}promiseAny(t){const n=[],s=t.map(o=>(this._promiseSet.add(o),ia(o)&&n.push(ea(o)),o.finally(()=>this._promiseSet.delete(o))));return Promise.any(s).finally(()=>(n.forEach((o=>o(new tn("cancel from promiseAny!")))),n.length=0))}promiseAll(t){const n=[],s=t.map(o=>(this._promiseSet.add(o),ia(o)&&n.push(ea(o)),o.finally(()=>this._promiseSet.delete(o))));return Promise.all(s).finally(()=>(n.forEach((o=>o(new tn("cancel from promiseAll!")))),n.length=0))}promiseRace(t){const n=[],s=t.map(o=>(this._promiseSet.add(o),ia(o)&&n.push(ea(o)),o.finally(()=>this._promiseSet.delete(o))));return Promise.race(s).finally(()=>(n.forEach((o=>o(new tn("cancel from promiseRace!")))),n.length=0))}}class Re extends st{constructor(t){super();p(this,"_status","Initial");p(this,"_completeEvent");p(this,"_errorEvent");p(this,"_completeFunc");p(this,"_errorFunc");p(this,"_cancelFunc");p(this,"_runningId",-1);this._startFunc=t,this.dispose(()=>this.isRunning&&this.cancel())}get errorEvent(){return this._errorEvent||(this._errorEvent=new H),this._errorEvent}get completeEvent(){return this._completeEvent||(this._completeEvent=new H),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:s=>{var o;n===this._runningId&&this._status==="Running"&&(this._status="Completed",this._completeFunc&&this._completeFunc(s),(o=this._completeEvent)==null||o.emit(s))},errorFunc:s=>{var o;n===this._runningId&&this._status==="Running"&&(this._status="Error",this._errorFunc&&this._errorFunc(s),(o=this._errorEvent)==null||o.emit(s))},runningingID:n},...t)}cancel(t=new tn("")){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 tn(""),...n){this.isRunning&&this.cancel(t),this.reset(),this.start(...n)}restartIfNotRunning(...t){this.isRunning||(this.reset(),this.start(...t))}}function Mo(i){return(e,...t)=>{const n=new dc,{completeFunc:s,errorFunc:o}=e,h=i(n,...t).then(s).catch(o).finally(()=>n.destroy());return ws(h,n.cancel.bind(n)),l=>uc(h,l)}}class cw extends Re{constructor(){super(({errorFunc:t},n,s)=>{try{const[o,h]=Wh(n,s);return this._doFunc=o,h}catch(o){return t(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class dw extends Re{constructor(t,n){super(({errorFunc:s})=>{try{const[o,h]=Wh(t,n);return this._doFunc=o,h}catch(o){return s(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}function fw(i){return new Re(Mo((e,...t)=>e.promise(i(...t))))}function gw(i,...e){return new Re(Mo(t=>t.promise(i(...e))))}function el(i){return fw((...e)=>{const t=i(...e);return ia(t)?t:na(t)})}function fc(i,...e){return gw(()=>{const t=i(...e);return ia(t)?t:na(t)})}function pw(i){let e;const t=new Promise((n,s)=>{e=()=>{i(),s()}});return ws(t,e),t}function mw(i,...e){const t=new dc,n=i(t,...e).finally(()=>t.destroy());return ws(n,t.cancel.bind(t)),n}function wi(i){return new Re(Mo(i))}function vw(i,...e){return new Re(Mo(t=>i(t,...e)))}function bp(i,...e){const t=new AbortController;let n=t.signal,[s,o]=e;if(o!=null&&o.signal)throw console.error("init?.signal"),new Error("init?.signal");o=o||{},o.signal&&console.warn("revocableFetch error: init.signal would be override!"),o.signal=n;let h=!1;const l=()=>{h=!0,t.abort()};let d=fetch(s,o);return i&&(d=d.then(f=>{if(!f.ok)return f;if(!f.body)throw Error("ReadableStream not yet supported in this browser.");const v=f.headers.get("content-length");v||console.warn("response.headers.get('content-length') is undefined... cannot get contentLength!");const m=v?parseInt(v,10):0;let y=0;return new Response(new ReadableStream({start(w){if(!f.body)throw new Error("!response.body");const S=f.body.getReader();T();function T(){S.read().then(({done:N,value:j})=>{if(N){w.close();return}if(!j)throw new Error("!value");if(!i)throw new Error("!progressFunc");y+=j.byteLength,i(y,m),w.enqueue(j),T()}).catch(N=>{w.error(N)})}}}),{status:f.status,statusText:f.statusText,headers:f.headers})}).catch(f=>{throw h?(f instanceof Error&&f.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new tn(`fetching cancelled! error: ${f}`)):(f instanceof Error&&f.code===20&&console.error("error.code === 20"),f)})),ws(d,l),d}function yw(i,...e){return bp(i,...e)}function gc(...i){return bp(void 0,...i)}function _w(){return el(gc)}function ww(...i){return fc(gc,...i)}function pc(i,...e){let t=-1;var n=new Promise((s,o)=>{i.isRunning&&i.cancel(),i.reset();const h=new st;h.dispose(i.completeEvent.disposableOn(l=>{if(s(l),h.isDestroyed()){debugger;console.error(`disposer is destroyed! ${h}`);return}h.destroy()})),h.dispose(i.errorEvent.disposableOn(l=>{if(o(l),h.isDestroyed()){debugger;console.error(`disposer is destroyed! ${h}`);return}h.destroy()})),i.start(...e),t=i.runningId});return[s=>t===i.runningId&&i.isRunning&&i.cancel(s),n]}function wn(i,e,...t){try{return e(...t)}catch(n){i(n)}}function Ew(){return new Re(({completeFunc:i,errorFunc:e},t)=>Qr(()=>wn(e,()=>{t&&t(),i()})))}function Sw(i){return new Re(({completeFunc:e,errorFunc:t})=>Qr(()=>wn(t,()=>{i&&i(),e()})))}function xw(){return new Re(({completeFunc:i,errorFunc:e},t)=>So(()=>{wn(e,()=>{t&&t(),i()})}))}function bw(i){return new Re(({completeFunc:e,errorFunc:t})=>So(()=>{wn(t,()=>{i&&i(),e()})}))}function Pp(){return new Re(({completeFunc:i,errorFunc:e},t,n)=>Ku(()=>{wn(e,()=>{t&&t(),i()})},n??1e3))}function Cp(i,e){return new Re(({completeFunc:t,errorFunc:n})=>Ku(()=>{wn(n,()=>{i&&i(),t()})},e??1e3))}function Pw(){return new Re(({errorFunc:i},e,t=1e3)=>Ju(()=>wn(i,e),t))}function Cw(i,e=1e3){return new Re(({errorFunc:t})=>Ju(()=>wn(t,i),e))}function To(){return new Re(({errorFunc:i},e)=>Hh(t=>wn(i,e,t)))}function sa(i){return new Re(({errorFunc:e})=>Hh(t=>wn(e,i,t)))}function ko(i,...e){let t,n;const s=new Promise((h,l)=>{n=l,t=globalThis.setTimeout(()=>{t=void 0,h(e)},i)});return ws(s,h=>{t&&(clearTimeout(t),t=void 0),n&&n(h??new tn("sleep cancel error!"))}),s}function Iw(){return el(ko)}function Mw(i,...e){return fc(ko,i,...e)}function Ks(i,e,...t){return i.promise(cc(pc(wi(async(n,...s)=>(i.disposer.dispose(()=>{n.isDestroyed()||n.cancel()}),await e(n,...s))),...t)))}function Tw(i,e,...t){return i.promise(cc(pc(e,...t)))}class kw extends Re{constructor(){super(({errorFunc:t},n,s)=>{try{const[o,h]=nc(n,s);return this._doFunc=o,h}catch(o){return t(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class Ow extends Re{constructor(t,n){super(({errorFunc:s})=>{try{const[o,h]=nc(t,n);return this._doFunc=o,h}catch(o){return s(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class il extends st{constructor(t=1e3,n=Jh){super();p(this,"_speed");p(this,"_speedChangedEvent");p(this,"_duration");p(this,"_durationChangedEvent");p(this,"_loop");p(this,"startUpdateFunc");p(this,"_updateBindThis");p(this,"_cancelStartUpdateFunc");p(this,"_startTimeStamp");p(this,"_playingChangedEvent");p(this,"_startPlayingEvent");p(this,"_stopPlayingEvent");p(this,"_loopChangedEvent");p(this,"_currentTime",this.disposeVar(it(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 H,this._startPlayingEvent}get stopPlayingEvent(){return this._stopPlayingEvent=this._stopPlayingEvent||new H,this._stopPlayingEvent}get currentTimeChangedEvent(){return this._currentTime.changed}get loopChangedEvent(){return this._loopChangedEvent=this._loopChangedEvent||new H,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 H),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 s=this._duration;this._duration=t,this._currentTime.value>this._duration&&(this._currentTime.value=this._duration),(n=this._durationChangedEvent)==null||n.emit(this._duration,s)}}get speedChangedEvent(){return this._speedChangedEvent||(this._speedChangedEvent=new H),this._speedChangedEvent}get speed(){return this._speed}set speed(t){var n;if(this._speed!==t&&t!==0){const s=this._speed;this._speed=t,this._resetStartTime(),(n=this._speedChangedEvent)==null||n.emit(this._speed,s)}}_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 H),this._playingChangedEvent}get playing(){return!!this._cancelStartUpdateFunc}set playing(t){!!this._cancelStartUpdateFunc!==t&&(t?this._startPlaying():this._stopPlaying())}}class Oo extends st{constructor(t){super();p(this,"_stop",this.disposeVar(it(0)));p(this,"_current",this.disposeVar(it(0)));p(this,"_start",this.disposeVar(it(0)));p(this,"_player",this.disposeVar(new il(200)));this.dispose(this._player.currentTimeChangedEvent.disposableOn(n=>{let s=n/this._player.duration;s=s>1?1:s<0?0:s;const o=this._start.value,h=this._stop.value;this._current.value=o+(h-o)*s})),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 Ip=-1;class ce extends H{constructor(e,t,n,s){super(),this._domElement=e,this._type=t,this.callback=s;const o=h=>(h.__xbsj_listenerNo__=++Ip,h.__xbsj_listenerTime__=Date.now(),h.__xbsj_lastCurrentTarget__=h.currentTarget,this.emit(h),this.callback&&this.callback(h));this._domElement.addEventListener(this._type,o,n),this.dispose(()=>this._domElement.removeEventListener(this._type,o,n))}static getLastLisenNo(){return Ip}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=ce.getLastLisenNo();return e.disposableOn(s=>{const o=ce.getListenerNo(s);(o===void 0||o>n)&&t(s)})}get element(){return this._domElement}static create(e,t,n){return new ce(e,t,n)}}class mc extends st{constructor(){super();p(this,"_clickEvent",this.disposeVar(new H));p(this,"_dbclickEvent",this.disposeVar(new H));p(this,"_pointerdownEvent",this.disposeVar(new H));p(this,"_pointerupEvent",this.disposeVar(new H));p(this,"_pointermoveEvent",this.disposeVar(new H));p(this,"_pointeroutEvent",this.disposeVar(new H));p(this,"dbClickDelayTime",300);p(this,"nativeClickDelayTime",500);p(this,"clickMovementTolerantPixelSize",3);p(this,"debugging",!1);p(this,"_enabled",this.disposeVar(it(!0)));const t=this.disposeVar(wi(async s=>{do{const o=await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v),d.disposer.dispose(ce.on(this._pointerdownEvent,f))})),h=$e(o);if(this.debugging&&console.log(`鼠标按下 ${h.toString()}`),!await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v);const m=setTimeout(()=>f(!0),this.nativeClickDelayTime);d.disposer.dispose(()=>clearTimeout(m)),d.disposer.dispose(ce.on(this._pointermoveEvent,y=>{const[w,S]=$e(y),[T,N]=h;(Math.abs(w-T)>3||Math.abs(S-N)>3)&&f(!1)})),d.disposer.dispose(ce.on(this._pointeroutEvent,()=>f(!1))),d.disposer.dispose(ce.on(this._pointerupEvent,()=>f(!0)))}))){this.debugging&&console.log("取消1");continue}const l=await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v);const m=setTimeout(()=>f("timeout"),this.dbClickDelayTime);d.disposer.dispose(()=>clearTimeout(m)),d.disposer.dispose(ce.on(this._pointermoveEvent,y=>{const[w,S]=$e(y),[T,N]=h;(Math.abs(w-T)>3||Math.abs(S-N)>3)&&f("moved")})),d.disposer.dispose(ce.on(this._pointerdownEvent,f)),d.disposer.dispose(ce.on(this._pointeroutEvent,()=>f("pointouted"))),d.disposer.dispose(ce.on(this._pointerupEvent,()=>f("pointuped")))}));if(typeof l=="string"){this.debugging&&console.log(`触发单击事件!取消双击监听!error: ${l}`),this._clickEvent.emit(o);continue}if(!await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v);const m=setTimeout(()=>f(!1),this.nativeClickDelayTime);d.disposer.dispose(()=>clearTimeout(m)),d.disposer.dispose(ce.on(this._pointermoveEvent,y=>{const[w,S]=$e(y),[T,N]=h;(Math.abs(w-T)>3||Math.abs(S-N)>3)&&f(!1)})),d.disposer.dispose(ce.on(this._pointeroutEvent,()=>f(!1))),d.disposer.dispose(ce.on(this._pointerupEvent,()=>f(!0)))}))){this.debugging&&console.log("取消2");continue}this.debugging&&console.log("触发双击事件!"),this._dbclickEvent.emit(l)}while(!0)})),n=s=>{s?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 Nw extends st{constructor(t,n){super();p(this,"_pointerClick",this.disposeVar(new mc));this._div=t;const{div:s,pointerClick:o}=this,h=v=>o.pointerDown(v),l=v=>o.pointerMove(v),d=v=>o.pointerOut(v),f=v=>o.pointerUp(v);s.addEventListener("pointerdown",h,n),s.addEventListener("pointermove",l,n),s.addEventListener("pointerout",d,n),s.addEventListener("pointerup",f,n),this.dispose(()=>{s.removeEventListener("pointerdown",h,n),s.removeEventListener("pointermove",l,n),s.removeEventListener("pointerout",d,n),s.removeEventListener("pointerup",f,n)})}get div(){return this._div}get pointerClick(){return this._pointerClick}get clickEvent(){return this.pointerClick.clickEvent}get dbclickEvent(){return this.pointerClick.dbclickEvent}}class Mp extends st{constructor(){super();p(this,"_hoverEvent",this.disposeVar(new H));p(this,"_hoverOutEvent",this.disposeVar(new H));p(this,"_pointerdownEvent",this.disposeVar(new H));p(this,"_pointerupEvent",this.disposeVar(new H));p(this,"_pointermoveEvent",this.disposeVar(new H));p(this,"_pointeroutEvent",this.disposeVar(new H));p(this,"delayTime",800);const t=this.disposeVar(Pp()),n=f=>{this._hoverOutEvent.emit()},s=f=>{this._hoverOutEvent.emit()};let o;const h=()=>{if(!o){console.warn("!lastPointerEvent");return}this._hoverEvent.emit(o)},l=f=>{o=f,t.restart(void 0,h,this.delayTime),this._hoverOutEvent.emit()},d=f=>{t.cancel(),this._hoverOutEvent.emit()};this.dispose(this._pointerdownEvent.disposableOn(n)),this.dispose(this._pointerupEvent.disposableOn(s)),this.dispose(this._pointermoveEvent.disposableOn(l)),this.dispose(this._pointeroutEvent.disposableOn(d))}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 Rw extends st{constructor(t,n=1500){super();p(this,"_hoverEvent",new H);p(this,"_hoverOutEvent",new H);const s=new ac(n);this.dispose(()=>s.destroy());let o=0,h=0,l;s.progressFunc=()=>this._hoverEvent.emit(o,h,l);const d=y=>{!s.isRunning&&s.restart(),l=y,[o,h]=$e(y),s.debounce(),this._hoverOutEvent.emit()},f=y=>{!s.isRunning&&s.restart(),l=y,[o,h]=$e(l),s.debounce(),this._hoverOutEvent.emit()},v=y=>{!s.isRunning&&s.restart(),l=y,[o,h]=$e(l),s.debounce(),this._hoverOutEvent.emit()},m=y=>{s.isRunning&&s.cancel(),this._hoverOutEvent.emit()};t.addEventListener("pointerdown",d),t.addEventListener("pointerup",f),t.addEventListener("pointermove",v),t.addEventListener("pointerout",m),this.dispose(()=>{t.removeEventListener("pointerdown",d),t.removeEventListener("pointerup",f),t.removeEventListener("pointermove",v),t.removeEventListener("pointerout",m)})}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}}class Tp extends st{constructor(t,n={}){super();p(this,"_needRedrawEvent");p(this,"_needPickRedrawEvent");p(this,"_id",Zr());p(this,"_clickEvent");p(this,"_clickOutEvent");p(this,"_dbclickEvent");p(this,"_dbclickOutEvent");p(this,"_actived",!1);p(this,"_activedChanged");p(this,"_hovered",!1);p(this,"_hoveredChanged");p(this,"_selected",!1);p(this,"_selectedChanged");p(this,"_opacity",1);p(this,"_opacityChanged");p(this,"_show",!0);p(this,"_showChanged");this._canvasPrimitivesContext=t;const{needRedraw:s=!0,needPickRedraw:o=!0}=n;s&&(this._needRedrawEvent=new H),o&&(this._needPickRedrawEvent=new H),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}set id(t){this._id=t}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 H,this._clickEvent}hasClickOutEvent(){return!!this._clickOutEvent}get clickOutEvent(){return this._clickOutEvent=this._clickOutEvent||new H,this._clickOutEvent}hasDbclickEvent(){return!!this._dbclickEvent}get dbclickEvent(){return this._dbclickEvent=this._dbclickEvent||new H,this._dbclickEvent}hasDbclickOutEvent(){return!!this._dbclickOutEvent}get dbclickOutEvent(){return this._dbclickOutEvent=this._dbclickOutEvent||new H,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 H,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 H,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 H,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 H,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 H,this._showChanged}}class vc extends Tp{constructor(t,n=[0,0],s=0){super(t);p(this,"_winPosAndDepthChanged");this._winPos=n,this._depth=s,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 H),this._winPosAndDepthChanged}}function Zs(i,e,t,n){const[s,o]=i,[h,l,d,f]=n,v=e[0]*t[0],m=e[1]*t[1],y=s-(v*h+d),w=o-(m*l+f);return{left:y,top:w,right:y+v,bottom:w+m}}function Qs(i,e,t,n,s){i.beginPath(),i.moveTo(e,t),i.lineTo(e-n*.5,t-n*.5),i.arc(e,t-n,n*.7071067811865475,Math.PI*.75,Math.PI*.25),i.lineTo(e,t),i.fillStyle=s,i.fill()}function Aw(i,e,t,n,s,o){if(i.beginPath(),i.moveTo(e+n,t),i.arc(e,t,n,0,2*Math.PI),o){const h=i.createRadialGradient(e,t,0,e,t,n);h.addColorStop(0,s),h.addColorStop(1,s.replace(/[\d\.]+\)$/,"0)")),i.fillStyle=h}else i.fillStyle=s;i.fill()}function kp(i,e,t,n,s,o){i.beginPath(),i.moveTo(e+o,t),i.lineTo(e+n-o,t),i.arcTo(e+n,t,e+n,t+o,o),i.lineTo(e+n,t+s-o),i.arcTo(e+n,t+s,e+n-o,t+s,o),i.lineTo(e+o,t+s),i.arcTo(e,t+s,e,t+s-o,o),i.lineTo(e,t+o),i.arcTo(e,t,e+o,t,o)}function Op(i,e,t,n,s,o){i.font=s;const h=i.measureText(n),l=h.actualBoundingBoxLeft+h.actualBoundingBoxRight,d=Number.isFinite(h.fontBoundingBoxAscent)?h.fontBoundingBoxAscent:h.actualBoundingBoxAscent,f=Number.isFinite(h.fontBoundingBoxDescent)?h.fontBoundingBoxDescent:h.actualBoundingBoxDescent;let v=d+f;i.fillStyle=o,i.fillText(n,e-l*.5,t+v*.5-f)}function Np(i){const{width:e,height:t}=i,n=e instanceof SVGAnimatedLength?e.baseVal.SVG_LENGTHTYPE_PX:e,s=t instanceof SVGAnimatedLength?t.baseVal.SVG_LENGTHTYPE_PX:t,o=document.createElement("canvas");o.width=n,o.height=s;const h=o.getContext("2d");if(!h)throw new Error("!cavnasCtx");return h.drawImage(i,0,0,n,s),o}function Rp(i,e){const{width:t,height:n}=i,s=i.getContext("2d");if(!s)throw new Error("!cavnasCtx");const[o,h,l]=e.map(m=>m*255|0),d=s.getImageData(0,0,t,n),f=d.data;for(var v=0;v<f.length;v+=4)f[v]=o,f[v+1]=h,f[v+2]=l;s.putImageData(d,0,0)}function yc(i,e,t,n=[.5,1,0,0],s,o="12px Arial",h=2,l="#FFF",d="#000A"){i.font=o;const f=i.measureText(s),v=f.actualBoundingBoxLeft+f.actualBoundingBoxRight,m=f.fontBoundingBoxAscent+f.fontBoundingBoxDescent,y=e,w=t,S=v+h*2,T=m+h*2,{left:N,top:j,bottom:C}=Zs([y,w],[S,T],[1,1],n);i.fillStyle=d,kp(i,N,j,S,T,h),i.fill(),i.fillStyle=l,i.fillText(s,N+h,C-h-f.fontBoundingBoxDescent)}function No(i){return("00"+i.toString(16).toUpperCase()).substr(-2)}function Ro(i){const[e,t,n,s]=i.map(o=>o*255|0);return`#${No(e)}${No(t)}${No(n)}${No(s)}`}function _c(i,e){const[t,n,s]=e,o=`${t}-${n}-${s}`;let h=_i(i,o);return h||(h=Np(i),Rp(h,e),yn(i,o,h)),h}class Dw extends vc{constructor(t,n,s=[32,32],o=[.5,1,0,0],h="#F00F"){super(t);p(this,"_tooltip","");p(this,"_title","");p(this,"__scale",[1,1]);p(this,"_tooltipAlpha",0);p(this,"_bgColor",[.3,.3,.3,.8]);p(this,"_bgColorHexStr",Ro(this._bgColor));p(this,"_fgColor",[1,1,1,1]);p(this,"_fgColorHexStr",Ro(this._fgColor));this._image=n,this._size=s,this._originRatioAndOffset=o,this._defaultColorStr=h;const l=new Oo(100),d=new Oo(100);this.dispose(()=>{l.destroy(),d.destroy()});const f=()=>{if(this._clickEvent&&!this._clickEvent.empty){const v=(1+.08*d.current)*(1+.08*l.current);this._scale=[v,v],this._tooltipAlpha=l.current}};this.dispose(this.activedChanged.disposableOn(v=>{d.target=v?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(v=>{l.target=v?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(()=>{this.needRedraw()})),this.dispose(d.currentChanged.disposableOn(f)),this.dispose(l.currentChanged.disposableOn(f))}set size(t){const[n,s]=t,[o,h]=this._size;(o!==n||h!==s)&&(this._size[0]=n,this._size[1]=s,this.needRedraw(),this.needPickRedraw())}get size(){return this._size}set _scale(t){const[n,s]=t,[o,h]=this.__scale;(o!==n||h!==s)&&(this.__scale[0]=n,this.__scale[1]=s,this.needRedraw(),this.needPickRedraw())}get _scale(){return this.__scale}set fgColor(t){if(!this._fgColor.every((n,s)=>t[s]===n)){const[n,s,o,h]=t;this._fgColor.splice(0,4,n,s,o,h),this._fgColorHexStr=Ro(this._fgColor),this.needRedraw()}}get fgColor(){return this._fgColor}set bgColor(t){if(!this._bgColor.every((n,s)=>t[s]===n)){const[n,s,o,h]=t;this._bgColor.splice(0,4,n,s,o,h),this._bgColorHexStr=Ro(this._bgColor),this.needRedraw()}}get bgColor(){return this._bgColor}set originRatioAndOffset(t){const[n,s,o,h]=this._originRatioAndOffset,[l,d,f,v]=t;(n!==l||s!==d||o!==f||h!==v)&&(this._originRatioAndOffset.splice(0,4,l,d,f,v),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,s]=this._winPos,o=this._size[0]*this.__scale[0],h=this._size[1]*this.__scale[1],{left:l,top:d}=Zs([n,s],this._size,this.__scale,this._originRatioAndOffset),f=t.globalAlpha;if(t.globalAlpha=this.opacity,this._image){if(this.selected){const v=_c(this._image,[1,0,0]),{left:m,top:y}=Zs([n,s+3],[o+6,h+6],[1,1],this._originRatioAndOffset);t.drawImage(v,m,y,o+6,h+6)}if(this.actived){const[v,m,y,w]=this._fgColor,S=_c(this._image,[v,m,y]),{left:T,top:N}=Zs([n,s+4],[o+8,h+8],[1,1],this._originRatioAndOffset);t.drawImage(S,T,N,o+8,h+8)}if(this.hovered){const[v,m,y,w]=this._bgColor,S=_c(this._image,[v,m,y]),{left:T,top:N}=Zs([n,s+2],[o+4,h+4],[1,1],this._originRatioAndOffset);t.drawImage(S,T,N,o+4,h+4)}t.drawImage(this._image,l,d,o,h)}else t.fillStyle=this._fgColorHexStr,t.fillRect(l,d,o,h);if(this._title!==""&&yc(t,n+20,s-16,[0,.5,0,0],this._title,"14px Arial",4,this._fgColorHexStr,this._bgColorHexStr),t.globalAlpha=f,this._hovered&&this._tooltip!==""){const v=t.globalAlpha;t.globalAlpha=this._tooltipAlpha,yc(t,n,s-42,[.5,1,0,0],this._tooltip,"12px Arial",4,this._fgColorHexStr,this._bgColorHexStr),t.globalAlpha=v}}drawForPick(t,n){if(!this._show)return;const[s,o]=this._winPos,h=n("default"),l=this._size[0]*this.__scale[0],d=this._size[1]*this.__scale[1],{left:f,top:v}=Zs([s,o],this._size,this.__scale,this._originRatioAndOffset);t.fillStyle=h,t.fillRect(f,v,l,d)}}class Lw extends vc{constructor(t){super(t);p(this,"_width",16);p(this,"_text","");p(this,"_fillStyle","#0F0");p(this,"_scale",1);p(this,"_scaleChanged");this.dispose(this.scaleChanged.disposableOn(h=>{this.needRedraw(),this.needPickRedraw()}));const n=this.disposeVar(new Oo(100)),s=this.disposeVar(new Oo(100)),o=()=>{this._clickEvent&&!this._clickEvent.empty&&(this.scale=(1+.1*s.current)*(1+.2*n.current))};this.dispose(s.currentChanged.disposableOn(o)),this.dispose(n.currentChanged.disposableOn(o)),this.dispose(this.activedChanged.disposableOn(h=>{s.target=h?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(h=>{n.target=h?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(h=>{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 H),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,s]=this._winPos,o=t.globalAlpha;t.globalAlpha=this.opacity;const h=this._width*this._scale;this.selected&&Qs(t,n,s+3,h+3,"#F00"),this.actived&&this._clickEvent&&!this._clickEvent.empty&&Qs(t,n,s+5,h+5,"#FFF"),this.hovered?Qs(t,n,s+3,h+3,"#000A"):Qs(t,n,s+1,h+1,"#000A"),Qs(t,n,s,h,this._fillStyle);const l=this._scale>1.2?"bold 14px Arial":"bold 10px Arial";Op(t,n,s-h,this._text,l,"#000"),t.globalAlpha=o}drawForPick(t,n){if(!this._show)return;const[s,o]=this._winPos,h=this._width*this._scale,l=n("default");Qs(t,s,o,h,l)}}const Ap=new ArrayBuffer(4),Dp=new Uint32Array(Ap),tr=new Uint8Array(Ap);function Lp(i){if(i>=16777215)throw new Error("uint32 > 0xFFFFFF");return Dp[0]=i,[tr[0],tr[1],tr[2]]}function Fp(i,e,t){return tr[0]=i,tr[1]=e,tr[2]=t,tr[3]=0,Dp[0]}class Gp extends st{constructor(){super(...arguments);p(this,"_pickColors",new Array(16777215));p(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 s=this._pickColorIndex;++this._pickColorIndex;const o=this._pickColors[s];o?(o.poi=t,o.tag=n):this._pickColors[s]={poi:t,tag:n};const[h,l,d]=Lp(s);return[h,l,d]}getPickInfoFromColor(t,n,s){const o=Fp(t,n,s);if(o>=this._pickColorIndex){console.error("index >= this._pickColorIndex");return}const h=this._pickColors[o];if(!h){console.error("!this._pickColors[index]");return}return h}destroyImp(){this.reset()}}const jp=(i,e)=>e.depth-i.depth;class Fw extends st{constructor(){super();p(this,"_pois",[]);p(this,"_canvasElement");p(this,"_ctx");p(this,"_offscreenCanvasElement");p(this,"_offscreenCanvasElement2");p(this,"_offscreenCtx");p(this,"_offscreenCtx2");p(this,"_size",[0,0]);p(this,"_needRedraw",!1);p(this,"_needPickRedraw",!1);p(this,"_pickColorManager",new Gp);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(sa(()=>{const[o,h]=this._size,{clientWidth:l,clientHeight:d}=this._canvasElement;(o!==l||h!==d)&&(this._size[0]=l,this._size[1]=d,this._canvasElement.width=l,this._canvasElement.height=d,this._offscreenCanvasElement.width=l,this._offscreenCanvasElement.height=d,this._offscreenCanvasElement2.width=l,this._offscreenCanvasElement2.height=d,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 _i(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 o=n.on(()=>{this._needRedraw=!0});yn(t,"needRedrawEventHandler",o)}const s=t._needPickRedrawEvent;if(s){const o=s.on(()=>{this._needPickRedraw=!0});yn(t,"needPickRedrawEventHandler",o)}}removePoi(t){const n=this._pois.indexOf(t);if(n===-1){console.error("删除一个不存在的poi!");return}this._pois.splice(n,1),this._dirty();const s=t._needRedrawEvent;if(s){const h=_i(t,"needRedrawEventHandler");h?s.off(h):console.error("poi没有listenHandler!")}const o=t._needPickRedrawEvent;if(o){const h=_i(t,"needPickRedrawEventHandler");h?o.off(h):console.error("poi没有listenHandler!")}}_draw(){this._pois.sort(jp);const[t,n]=this._size;this._ctx.clearRect(0,0,t,n),this._pois.forEach(s=>s.draw(this._ctx))}pick(t,n,s,o){return this._needPickRedraw&&(this._needPickRedraw=!1,this._pickDraw()),this._getPickInfo(t,n,s,o)}_pickDraw(){this._pickColorManager.reset(),this._pois.sort(jp);const[t,n]=this._size;this._offscreenCtx.clearRect(0,0,t,n),this._pois.forEach(s=>{const o=h=>{const[l,d,f]=this._pickColorManager.createPickColor(s,h);return`rgb(${l}, ${d}, ${f})`};s.drawForPick(this._offscreenCtx,o)})}_getPickInfo(t,n,s,o){const h=this._offscreenCtx.getImageData(t,n,s,o),l=[],d=h.data.length/4;for(let f=0;f<d;++f){const v=h.data[f*4+0],m=h.data[f*4+1],y=h.data[f*4+2];if(h.data[f*4+3]===255){const S=this._pickColorManager.getPickInfoFromColor(v,m,y);if(S&&S.poi&&!l.includes(S)){let T=!0;{const[N,j]=this._size;this._offscreenCtx2.clearRect(0,0,N,j);const C=V=>"rgb(255, 255, 255)";S.poi.drawForPick(this._offscreenCtx2,C);const k=this._offscreenCtx2.getImageData(t,n,s,o),M=k.data[f*4+0],D=k.data[f*4+1],L=k.data[f*4+2];k.data[f*4+3],M===255&&D===255&&L===255||(T=!1)}T&&l.push(S)}}}return l}}class wc extends st{constructor(){super(...arguments);p(this,"_closeEvent");p(this,"_show",!0);p(this,"_showChanged");p(this,"_opacity",1);p(this,"_opacityChanged");p(this,"_winPos",[0,0]);p(this,"_winPosChanged")}set winPos(t){const[n,s]=t,[o,h]=this._winPos;(n!==o||s!==h)&&(this._winPos[0]=n,this._winPos[1]=s,this._winPosChanged&&this._winPosChanged.emit(this._winPos))}get winPos(){return this._winPos}get winPosChanged(){return this._winPosChanged=this._winPosChanged||new H,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 H,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 H,this._showChanged}get closeEvent(){return this._closeEvent||(this._closeEvent=new H),this._closeEvent}}const Ec=new WeakMap;function Sc(i){if(!Ec.has(i)){const e=new Vh(()=>new i,t=>t.reset());Ec.set(i,e)}return Ec.get(i)}class xc extends wc{constructor(){super();p(this,"_div");p(this,"_contentDiv");p(this,"_originOffsetX",0);p(this,"_originOffsetY",0);p(this,"_originRatioX",.5);p(this,"_originRatioY",1);p(this,"_divChanged",new H);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 s=document.createElement("div");this._contentDiv=s,n.appendChild(s),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(([o,h])=>{this._div.style.left=`${o}px`,this._div.style.top=`${h}px`})),this.dispose(this.opacityChanged.disposableOn(o=>{this._div.style.opacity=`${o}`})),this.dispose(this.showChanged.disposableOn(o=>{this._div.style.visibility=o?"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 Bp extends st{constructor(t,n){super();p(this,"_floatDiv");p(this,"_show",!1);p(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=Sc(this._customDivClass).create();this.dispose(()=>{Sc(this._customDivClass).destroy(t)}),this._floatDiv=t}return this._floatDiv}get showChanged(){return this._showChanged||(this._showChanged=new H),this._showChanged}}const Gw=["top","bottom","left","right"];function jw(i){return Object.entries(i).map(([e,t])=>Gw.includes(e)?`${e}: ${t}px; `:"").join("")}function zp(i,e,t){const n=document.createElement("div");n.style.cssText=`position: absolute; ${jw(t)} background-color: ${i}; border-radius: ${e}px;`;const s='<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=s,n}function Up(i,e,t="rgba(0,0,0,0.7)"){const n=document.createElement("div");n.style.cssText=`margin: 0 auto; width: ${i}px; height: ${e}px; position: relative; pointer-events: none;`;const s=document.createElement("div");return s.style.cssText=`position: absolute; left: 0px; top: 0px; width: 0; height: 0; border-left: ${i*.5}px solid transparent; border-right: ${i*.5}px solid transparent; border-top: ${e}px solid ${t};`,n.appendChild(s),[n,s]}class Vp extends xc{constructor(){super();p(this,"_borderDiv");p(this,"_closeDiv");p(this,"_innerContentDiv");p(this,"_colorStr","rgba(0, 0, 0, 0.7)");p(this,"_divColorChanged",new H);p(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=zp(this._colorStr,10,{top:3,right:3}),[s,o]=Up(2*this._borderRadius,2*this._borderRadius,this._colorStr),h=document.createElement("div");this._innerContentDiv=h,t.appendChild(h),t.appendChild(n),this.contentDiv.appendChild(t),this.contentDiv.appendChild(s),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(()=>{o.style.borderTopColor=this._colorStr,t.style.backgroundColor=this._colorStr,s.style.width=`${this._borderRadius*2}px`,s.style.height=`${this._borderRadius*2}px`,o.style.borderLeft=`${this._borderRadius}px`,o.style.borderRight=`${this._borderRadius}px`,o.style.borderTop=`${this._borderRadius*2}px`}));const l=d=>{d.key==="Escape"&&this._closeEvent&&this._closeEvent.emit()};document.body.addEventListener("keydown",l,!0),this.dispose(()=>{document.removeEventListener("keydown",l,!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 Bw extends Vp{constructor(){super();p(this,"_iframe");p(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=s=>{s.source===this._iframe.contentWindow&&(this._iframeMessageEvent?this._iframeMessageEvent.emit(s):console.warn(`iframe消息接收到未处理!data: ${s.data}`))};window.addEventListener("message",n),this.dispose(()=>{window.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 H,this._iframeMessageEvent}}class zw extends wc{constructor(){super();p(this,"_div");p(this,"_contentContainer");p(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 s=document.createElement("div");s.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;",s.innerText=this._text,this._div.appendChild(n),n.appendChild(s),this._contentContainer=s,this._div=t,this.dispose(this.winPosChanged.disposableOn(([o,h])=>{this._div.style.left=`${o}px`,this._div.style.top=`${h-50}px`})),this.dispose(this.opacityChanged.disposableOn(o=>{this._div.style.opacity=`${o}`})),this.dispose(this.showChanged.disposableOn(o=>{this._div.style.visibility=o?"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 Uw extends xc{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 Vw extends st{constructor(t,n){super();p(this,"_cursorDiv");p(this,"_pointerOut",this.disposeVar(it(!1)));p(this,"_show",this.disposeVar(it(!0)));this._cursorDiv=new Bp(n,t),this.dispose(()=>this._cursorDiv.destroy());const s=h=>{const[l,d]=$e(h);this._cursorDiv.floatDiv.winPos=[l,d]};t.addEventListener("pointermove",s),this.dispose(()=>t.removeEventListener("pointermove",s));const o=()=>{this._cursorDiv.show=this.show&&this._pointerOut.value};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this._pointerOut.changed.disposableOn(o))}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 Ao(i,e,t){if(!(i.tree===e.tree&&i!==e&&!i.isAncestorOf(e))||i.tree!==e.tree||!i.parent)return!1;if(!i.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");return!(e===i||i.isAncestorOf(e)||t!=="inner"&&!e.parent||t==="inner"&&!e.children)}function nl(i,e,t){if(!i.tree||!e.tree||i.tree!==e.tree)return;if(!i.parent){console.warn("当前节点没有父节点,那么该节点无法被移动!");return}if(!i.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");if(e===i){console.warn("自身不能拖放到自身!");return}if(i.isAncestorOf(e)){console.warn("当前节点不能拖放到它自身的后代节点之上!");return}if(t!=="inner"&&!e.parent){console.warn("目标节点没有父节点,无法拖放!");return}if(t==="inner"&&!e.children){console.warn("无法移动到目标节点的子节点中,因为目标节点不是组节点!");return}i.tree._startTransaction();const n=i.parent.children.indexOf(i);if(i.parent.children.splice(n,1),t!=="inner"){const{parent:s}=e;if(!s||!s.children)throw new Error("!parent");const o=s.children.indexOf(e);t==="before"?s.children.splice(o,0,i):t==="after"&&s.children.splice(o+1,0,i)}else e.children.push(i);i.tree._stopTransaction()}function qp(i,e,t){return tc(i,n=>Ao(n,e,t))}function $p(i,e,t){for(let n of i)Ao(n,e,t)?nl(n,e,t):console.warn(`treeItem(id: ${n.id}) cannot move...`)}const qw={checked:1,unchecked:2,indeterminate:3},$w=["checked","unchecked","indeterminate"];class Wp extends st{constructor(t){super();p(this,"_collapsed",this.disposeVar(it(!1)));p(this,"_checkedStatus",this.disposeVar(it("unchecked")));p(this,"_selected",this.disposeVar(it(!1)));p(this,"_moveToPositionMode",this.disposeVar(it("none")));p(this,"_updateCheckedStatusFromChildrenEvent",this.disposeVar(new H));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 s=this.disposeVar(we(this._updateCheckedStatusFromChildrenEvent));this.dispose(s.disposableOn(()=>{if(!this._treeItem.children)return;let o=0;Qu(this._treeItem.children,h=>(o|=qw[h.uiTreeObject.checkedStatus],o===3)),o>0&&(this._checkedStatus.value=$w[o-1])})),this.dispose(this._treeItem.childrenResetedEvent.disposableOn(o=>{!o&&this.checkedStatus==="indeterminate"&&(this._checkedStatus.value="unchecked")}));{const o=(h,l,d=!0)=>{if(l)h.selectedItems.push(this._treeItem);else{const f=h.selectedItems.indexOf(this._treeItem);f===-1?d&&console.error("selectedItems index -1"):h.selectedItems.splice(f,1)}};this.dispose(this._selected.changed.disposableOn(h=>{const{tree:l}=this._treeItem;l&&o(l,h)})),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 s of this._treeItem.children)s.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 hn=class hn extends st{constructor(t,n=!1,s){super();p(this,"_children");p(this,"_childrenResetedEvent");p(this,"_childrenToChangeEvent");p(this,"_childrenChangedEvent");p(this,"_parent",this.disposeVar(it(void 0)));p(this,"_level",this.disposeVar(it(0)));p(this,"_id");p(this,"_uiTreeObject",this.disposeVar(new Wp(this)));this._tree=t,this._hasChildren=n,this._id=s??Zr(),this._id!=="_ROOT"&&hn.wm.has(this._id)&&console.warn(`创建了id(${this._id})相同的树节点,会导致之前的树节点无法索引!`),hn.wm.set(this._id,this),this.dispose(()=>{if(this._id!=="_ROOT"&&!hn.wm.has(this._id)){console.warn(`树节点(${this._id})不在wm树上!`);return}hn.wm.delete(this._id)}),this.dispose(this._parent.changed.disposableOn(()=>{this._updateLevel()})),this.dispose(this._level.changed.disposableOn(()=>{if(this.children)for(let o of this.children)o._updateLevel()})),hn.allTreeItems.set(this._id,this),this.dispose(()=>{hn.allTreeItems.delete(this._id)})}static getFromId(t){return hn.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 Io);this._children=t,this.dispose(t.toChangeEvent.disposableOn((o,h)=>{for(let l of o){const{start:d,deleteCount:f,items:v}=l;for(let m=d;m<d+f;++m)h.get(m)._parent.value=void 0;for(let m of v){if(m.parent)throw console.error("请检查新增的treeItem是否正在使用!"),new Error("item.parent should not exist!");m._parent.value=this}}}));const n=new Set,s=new Set;this.dispose(t.toChangeEvent.disposableOn((o,h)=>{var l;if(this.tree){n.clear(),s.clear();for(let d of o){const{start:f,deleteCount:v,items:m}=d;for(let y=f;y<f+v;++y)n.add(h.get(y));for(let y of m)s.add(y)}for(let d of n)s.has(d)&&(n.delete(d),s.delete(d));(l=this.tree)==null||l.itemChildrenToChange.emit(this,o,n,s)}})),this.dispose(t.changedEvent.disposableOn(()=>{var o;(o=this.tree)==null||o.itemChildrenChanged.emit(this)})),this.dispose(t.toChangeEvent.disposableOn((...o)=>this._childrenToChangeEvent&&this._childrenToChangeEvent.emit(...o))),this.dispose(t.changedEvent.disposableOn((...o)=>this._childrenChangedEvent&&this._childrenChangedEvent.emit(...o)))}return this._children}else return}get childrenResetedEvent(){return this._childrenResetedEvent||(this._childrenResetedEvent=new H),this._childrenResetedEvent}get childrenToChangeEvent(){return this._childrenToChangeEvent||(this._childrenToChangeEvent=new H),this._childrenToChangeEvent}get childrenChangedEvent(){return this._childrenChangedEvent||(this._childrenChangedEvent=new H),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,s=[],o=[];for(n.children&&n.children.length>0&&(!t||t(n))&&(s.push(0),o.push(n.children));s.length>0;){const h=s[s.length-1],l=o[o.length-1],d=l.get(h);yield d,h<l.length-1?++s[s.length-1]:(o.pop(),s.pop()),d.children&&d.children.length>0&&(!t||t(d))&&(s.push(0),o.push(d.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 Ao(this,t,n)}moveTo(t,n){nl(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 s=this.parent;if(!s||!s.children)return!1;const o=s.children.indexOf(this);return t.endsWith("Before")?n&&s.children.splice(o,0,n):t.endsWith("After")&&n&&s.children.splice(o+1,0,n),!0}};p(hn,"wm",new Map),p(hn,"allTreeItems",new Map);let Do=hn;class Hp extends st{constructor(t){super();p(this,"_redrawEvent",this.disposeVar(new H));p(this,"_containerScrollTop",this.disposeVar(it(0)));p(this,"_containerClientHeight",this.disposeVar(it(-1)));p(this,"_container",this.disposeVar(it(void 0)));p(this,"_redrawInfo",{topFreeSpaceHeight:0,topUnvisibleItemNum:0,middleTreeItems:[],bottomFreeSpaceHeight:0,bottomUnvisibleItemNum:0});this._tree=t;const n=this._containerClientHeight,s=this._containerScrollTop,o=this._tree._forceRedrawEvent,h=this.disposeVar(we(this._tree.itemDivHeightChanged,this._tree.itemChildrenChanged,this._tree.itemsChanged,n.changed,s.changed,o)),{redrawInfo:l}=this,d=v=>{const m=v.uiTreeObject;return!!v.children&&(!m||!m.collapsed)};this.dispose(h.disposableOn(()=>{if(l.topFreeSpaceHeight=0,l.topUnvisibleItemNum=0,l.middleTreeItems.length=0,l.bottomFreeSpaceHeight=0,l.bottomUnvisibleItemNum=0,this._containerClientHeight.value>=0){const v=ec(this._tree.getDescendants(d)),m=this._tree.itemDivHeight,y=m*v,w=Jn([_s([Jn([y-n.value,0]),s.value]),0]),S=w/m|0,T=Math.ceil((w-S*m+n.value)/m)|0;S>0&&(l.topUnvisibleItemNum=S,l.topFreeSpaceHeight=S*this._tree.itemDivHeight);const N=S+T;let j=0;for(let k of this._tree.getDescendants(d)){if(j>=N)break;j>=S&&l.middleTreeItems.push(k),++j}const C=v-S-T;C>0&&(l.bottomUnvisibleItemNum=C,l.bottomFreeSpaceHeight=C*this._tree.itemDivHeight)}else for(let v of this._tree.getDescendants(d))l.middleTreeItems.push(v);this._redrawEvent.emit(l)}));let f;this.dispose(()=>f&&(f.destroy(),f=void 0)),this.dispose(this.containerChanged.disposableOn(v=>{f&&(f.destroy(),f=void 0),v&&(f=To(),f.start(()=>{const{scrollTop:m,clientHeight:y}=v;typeof m>"u"||typeof y>"u"?Jr("createUiTreeWithContainer error: conainter has no scrollTop or clientHeight property!"):(this.containerScrollTop=m,this.containerClientHeight=y)}))}))}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=h=>{const l=h.uiTreeObject;return!!h.children&&(!l||!l.collapsed)};let s=0,o=!1;for(let h of this._tree.getDescendants(n)){if(h===t){o=!0;break}++s}if(o)return[s,s*this._tree.itemDivHeight]}collapseAll(){console.log("collapseAll");for(let t of this.tree.root.getDescendants()){const n=t.uiTreeObject;n.collapsed=!0}}expandAll(){console.log("expandAll");for(let t of this.tree.root.getDescendants()){const n=t.uiTreeObject;n.collapsed=!1}}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)}getAllCheckedItems(){return this.getAllItems(t=>t.uiTreeObject.checkedStatus==="checked")}getAllCheckedLeafItems(){return this.getAllItems(t=>!t.children&&t.uiTreeObject.checkedStatus==="checked")}selectAllItems(t){for(let n of this.getAllItems())(!t||!t.includes(n))&&(n.uiTreeObject.selected=!0)}clearAllSelectedItems(t){for(let n of this.getAllSelectedItems())(!t||!t.includes(n))&&(n.uiTreeObject.selected=!1)}checkAllItems(t){for(let n of this.getAllItems())(!t||!t.includes(n))&&n.uiTreeObject.check(!0)}clearAllCheckedItems(t){for(let n of this.getAllCheckedItems())(!t||!t.includes(n))&&n.uiTreeObject.check(!1)}}const As=class As extends st{constructor(t){super();p(this,"_root",this.disposeVar(new Do(this,!0,"_ROOT")));p(this,"_itemChildrenChanged",this.disposeVar(new H));p(this,"_itemChildrenToChange",this.disposeVar(new H));p(this,"_itemsAdded",this.disposeVar(new H));p(this,"_itemsDeleted",this.disposeVar(new H));p(this,"_itemsChanged",this.disposeVar(new H));p(this,"_transactionStack",0);p(this,"_addedItems",new Set);p(this,"_deletedItems",new Set);p(this,"_selectedItems",this.disposeVar(new Io));p(this,"_itemDivHeight",this.disposeVar(it(As.defaultItemDivHeight)));p(this,"_forceRedrawEvent",this.disposeVar(new H));p(this,"_uiTree",this.disposeVar(new Hp(this)));this._root._tree.value=this,this.dispose(this._itemChildrenToChange.disposableOn((n,s)=>{if(!n.children){console.error("!item.children");return}for(let o of s){const{start:h,deleteCount:l,items:d}=o;for(let f=h;f<h+l;++f){const v=n.children.get(f);this._deletedItems.has(v)?console.error(`this._deletedItems.has(currentItem(${v.id}))`):this._deletedItems.add(v)}for(let f of d)this._deletedItems.has(f)?this._deletedItems.delete(f):this._addedItems.add(f)}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 s of this.getDescendants())if(s.id===t){n=s;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}};p(As,"defaultItemDivHeight",24),p(As,"canMoveToTreeItem",Ao),p(As,"moveToTreeItem",nl),p(As,"canMoveToTreeItems",qp),p(As,"moveToTreeItems",$p);let er=As;class xe extends st{constructor(t,n,s=!0,o){super();p(this,"_obj",this.disposeVar(it(void 0)));this._resetEvent=t,this._createFunc=n;const h=this._resetEvent,l=this._createFunc,d=()=>{this._obj.value&&(this._obj.value.destroy(),this._obj.value=void 0)};this.dispose(d);const f=(...v)=>{d(),this._obj.value=l(...v)};s&&(o?this._obj.value=l(...o):this._obj.value=l()),this.dispose(h.disposableOn(f))}get obj(){return this._obj.value}get objChanged(){return this._obj.changed}}class Ww extends st{constructor(t,n=!0,s){super();p(this,"_event",this.disposeVar(new H));p(this,"_objResettingWithEvent");this._createFunc=t,this._execOnInit=n,this._initParams=s,this._objResettingWithEvent=this.disposeVar(new xe(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 Iu=class Iu extends st{constructor(){super();p(this,"_set",new Set);p(this,"_toChangeEvent",this.dv(new H));p(this,"_changedEvent",this.dv(new H));p(this,"main");this.dispose(()=>{this._set.size!==0&&(Iu.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()}};p(Iu,"warnOnDestroying",!0);let sl=Iu;async function Xp(i){const e=[],t=[],n=i.entries();for await(const[s,o]of n){const h=o;h.kind==="file"?e.push(s):h.kind==="directory"&&t.push(s)}return{files:e,dirs:t}}async function bc(i){return await(await i.getFile()).text()}async function Yp(i){const e=await bc(i);try{return JSON.parse(e)}catch{return}}async function Jp(i){return await(await i.getFile()).arrayBuffer()}class Kp extends st{constructor(e){super(),this._rootDirHandle=e}get rootDirHandle(){return this._rootDirHandle}async getSubFilesAndDirs(){return await Xp(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(s){console.error(`未能获取当前文件 ${e.join("/")}/${t} error: ${s}`,s);return}}}class Zp extends st{constructor(t){super();p(this,"_startRootDirId",0);p(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 window.showDirectoryPicker({id:t,mode:"read"}),console.log("window.showDirectoryPicker end",n)}catch(s){console.error(`LocalFileServer getRootDirId failed: ${s}`,s);return}if(n){const s=++this._startRootDirId,o=`${this._prefix}${s}`;return this._dirMap.set(o,new Kp(n)),o}}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 s=n[0],o=this._dirMap.get(s);if(!o){console.warn(`LocalFileServer getFile failed: ${t}`);return}const h=n.slice(1,n.length-1),l=n[n.length-1],d=await o.getFile(h,l);if(!d){console.warn(`LocalFileServer getFile failed: ${t}`);return}return d}async getText(t){const n=await this.getFile(t);if(n)return await bc(n)}async getArrayBuffer(t){const n=await this.getFile(t);if(n)return await Jp(n)}async getJson(t){const n=await this.getFile(t);if(n)return await Yp(n)}async getLocalFilePath(t,n,s){const o=await this.getRootDirId(n);if(!o){console.warn("getRootDirId error!");return}const h=this.getRootDir(o);if(!h){console.warn("getRootDir error!");return}const l=await h.getSubFilesAndDirs();if(!l.files){console.warn("getSubFilesAndDirs error! 找不到符合要求的文件!");return}const d=t?l.files.filter(f=>t.some(v=>f.endsWith(v))):l.files;if(d.length===0){console.warn("找不到符合要求的文件!");return}return`https://${o}/${d[0]}`}}const Qp=new Zp("xe2_local");async function Hw(i,e,t){return await Qp.getLocalFilePath(i,e,t)}class tm extends st{constructor(t,n){super();p(this,"_processing");this._complexImage=t,this._imageUri=n,this._processing=this.disposeVar(wi(async s=>{const o=this._complexImage,h=await s.promise(mp(this._imageUri,this._complexImage.crossOrigin));h&&h instanceof HTMLImageElement&&(o.size=[h.naturalWidth,h.naturalHeight],o.pixelFormat="RGBA",o.copyTexture({source:h}))})),this._processing.start()}get processing(){return this._processing}}const em=["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"],im=["img","gif","video","flv","hls"];let Xw=class extends st{constructor(t,n){super();p(this,"_element");this._complexImage=t,this._videoSrc=n;var s=document.createElement("video");s.src=this._videoSrc,s.style.position="absolute",s.style.top="0px",s.style.left="0px",s.style.zIndex="-100",s.style.visibility="hidden",s.style.width="0px",s.style.height="0px";{const o=()=>{s.crossOrigin=this._complexImage.crossOrigin};o(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(o))}{const o=()=>{s.autoplay=this._complexImage.autoplay};o(),this.dispose(this._complexImage.autoplayChanged.disposableOn(o))}{const o=()=>{s.loop=this._complexImage.loop};o(),this.dispose(this._complexImage.loopChanged.disposableOn(o))}s.muted=!0,document.body.appendChild(s),this._element=s,this.dispose(()=>document.body.removeChild(s))}get element(){return this._element}};class nm extends st{constructor(t,n){super();p(this,"_videoDom");p(this,"_update");this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new Xw(this._complexImage,this._imageUri)),this._update=this.disposeVar(sa(()=>this.update())),this._update.start()}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:s}=this.videoElement;t.size=[n,s],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}function Pc(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Yw(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.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(i).forEach(function(n){var s=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return i[n]}})}),t}var Cc={},Kn={},sm;function rm(){if(sm)return Kn;sm=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.loop=Kn.conditional=Kn.parse=void 0;var i=function n(s,o){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:h;if(Array.isArray(o))o.forEach(function(f){return n(s,f,h,l)});else if(typeof o=="function")o(s,h,l,n);else{var d=Object.keys(o)[0];Array.isArray(o[d])?(l[d]={},n(s,o[d],h,l[d])):l[d]=o[d](s,h,l,n)}return h};Kn.parse=i;var e=function(s,o){return function(h,l,d,f){o(h,l,d)&&f(h,s,l,d)}};Kn.conditional=e;var t=function(s,o){return function(h,l,d,f){for(var v=[],m=h.pos;o(h,l,d);){var y={};if(f(h,s,l,y),h.pos===m)break;m=h.pos,v.push(y)}return v}};return Kn.loop=t,Kn}var be={},am;function om(){if(am)return be;am=1,Object.defineProperty(be,"__esModule",{value:!0}),be.readBits=be.readArray=be.readUnsigned=be.readString=be.peekBytes=be.readBytes=be.peekByte=be.readByte=be.buildStream=void 0;var i=function(m){return{data:m,pos:0}};be.buildStream=i;var e=function(){return function(m){return m.data[m.pos++]}};be.readByte=e;var t=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(y){return y.data[y.pos+m]}};be.peekByte=t;var n=function(m){return function(y){return y.data.subarray(y.pos,y.pos+=m)}};be.readBytes=n;var s=function(m){return function(y){return y.data.subarray(y.pos,y.pos+m)}};be.peekBytes=s;var o=function(m){return function(y){return Array.from(n(m)(y)).map(function(w){return String.fromCharCode(w)}).join("")}};be.readString=o;var h=function(m){return function(y){var w=n(2)(y);return m?(w[1]<<8)+w[0]:(w[0]<<8)+w[1]}};be.readUnsigned=h;var l=function(m,y){return function(w,S,T){for(var N=typeof y=="function"?y(w,S,T):y,j=n(m),C=new Array(N),k=0;k<N;k++)C[k]=j(w);return C}};be.readArray=l;var d=function(m,y,w){for(var S=0,T=0;T<w;T++)S+=m[y+T]&&Math.pow(2,w-T-1);return S},f=function(m){return function(y){for(var w=e()(y),S=new Array(8),T=0;T<8;T++)S[7-T]=!!(w&1<<T);return Object.keys(m).reduce(function(N,j){var C=m[j];return C.length?N[j]=d(S,C.index,C.length):N[j]=S[C.index],N},{})}};return be.readBits=f,be}var hm;function Jw(){return hm||(hm=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var e=rm(),t=om(),n={blocks:function(y){for(var w=0,S=[],T=y.data.length,N=0,j=(0,t.readByte)()(y);j!==w&&j;j=(0,t.readByte)()(y)){if(y.pos+j>=T){var C=T-y.pos;S.push((0,t.readBytes)(C)(y)),N+=C;break}S.push((0,t.readBytes)(j)(y)),N+=j}for(var k=new Uint8Array(N),M=0,D=0;D<S.length;D++)k.set(S[D],M),M+=S[D].length;return k}},s=(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(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===249}),o=(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(m,y,w){return Math.pow(2,w.descriptor.lct.size+1)})},function(m,y,w){return w.descriptor.lct.exists}),{data:[{minCodeSize:(0,t.readByte)()},n]}]},function(m){return(0,t.peekByte)()(m)===44}),h=(0,e.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(y,w,S){return(0,t.readBytes)(S.text.blockSize)(y)}},n]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===1}),l=(0,e.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(y,w,S){return(0,t.readString)(S.blockSize)(y)}},n]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===255}),d=(0,e.conditional)({comment:[{codes:(0,t.readBytes)(2)},n]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===254}),f=[{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(m,y){return Math.pow(2,y.lsd.gct.size+1)})},function(m,y){return y.lsd.gct.exists}),{frames:(0,e.loop)([s,l,d,o,h],function(m){var y=(0,t.peekByte)()(m);return y===33||y===44})}],v=f;i.default=v})(Cc)),Cc}var Kw=Jw();const Zw=Pc(Kw);var Qw=rm(),tE=om();const eE=(i,e)=>{const t=new Array(i.length),n=i.length/e,s=function(v,m){const y=i.slice(m*e,(m+1)*e);t.splice.apply(t,[v*e,e].concat(y))},o=[0,4,2,1],h=[8,8,4,2];for(var l=0,d=0;d<4;d++)for(var f=o[d];f<n;f+=h[d])s(f,l),l++;return t},iE=(i,e,t)=>{const o=t;var h,l,d,f,v,m,y,D,w,S,M,T,L,V,I,x;const N=new Array(t),j=new Array(4096),C=new Array(4096),k=new Array(4097);for(T=i,l=1<<T,v=l+1,h=l+2,y=-1,f=T+1,d=(1<<f)-1,w=0;w<l;w++)j[w]=0,C[w]=w;var M,D,L,V,x,I;for(M=D=L=V=x=I=0,S=0;S<o;){if(V===0){if(D<f){M+=e[I]<<D,D+=8,I++;continue}if(w=M&d,M>>=f,D-=f,w>h||w==v)break;if(w==l){f=T+1,d=(1<<f)-1,h=l+2,y=-1;continue}if(y==-1){k[V++]=C[w],y=w,L=w;continue}for(m=w,w==h&&(k[V++]=L,w=y);w>l;)k[V++]=C[w],w=j[w];L=C[w]&255,k[V++]=L,h<4096&&(j[h]=y,C[h]=L,h++,(h&d)===0&&h<4096&&(f++,d+=h)),y=m}V--,N[x++]=k[V],S++}for(S=x;S<o;S++)N[S]=0;return N},nE=i=>{const e=new Uint8Array(i);return Qw.parse(tE.buildStream(e),Zw)},sE=i=>{const e=i.pixels.length,t=new Uint8ClampedArray(e*4);for(var n=0;n<e;n++){const s=n*4,o=i.pixels[n],h=i.colorTable[o]||[0,0,0];t[s]=h[0],t[s+1]=h[1],t[s+2]=h[2],t[s+3]=o!==i.transparentIndex?255:0}return t},rE=(i,e,t)=>{if(!i.image){console.warn("gif frame does not have associated image.");return}const{image:n}=i,s=n.descriptor.width*n.descriptor.height;var o=iE(n.data.minCodeSize,n.data.blocks,s);n.descriptor.lct.interlaced&&(o=eE(o,n.descriptor.width));const h={pixels:o,dims:{top:i.image.descriptor.top,left:i.image.descriptor.left,width:i.image.descriptor.width,height:i.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?h.colorTable=n.lct:h.colorTable=e,i.gce&&(h.delay=(i.gce.delay||10)*10,h.disposalType=i.gce.extras.disposal,i.gce.extras.transparentColorGiven&&(h.transparentIndex=i.gce.transparentColorIndex)),h.patch=sE(h),h},aE=(i,e)=>i.frames.filter(t=>t.image).map(t=>rE(t,i.gct));async function lm(i){const t=await(await fetch(i)).arrayBuffer(),n=nE(t),s=aE(n);return{gif:n,gifFrames:s,arrayBuffer:t}}function um(i,e,t){return i<e?e:i>t?t:i}class cm extends il{constructor(t,n=!0,s){super();p(this,"_gifFrames",this.disposeVar(it(void 0)));p(this,"_gifDurations",[]);p(this,"_gifDuration",this.disposeVar(it(0)));p(this,"_gifSize",this.disposeVar(it([0,0],(t,n)=>t.every((s,o)=>s===n[o]),t=>[...t])));p(this,"_autoPlayOnLoad",this.disposeVar(it(!0)));p(this,"_gifCanvas");this._container=t,this.loop=!0;const o=document.createElement("canvas");this._gifCanvas=o,o.style.width="100%",o.style.height="100%";const h=o.getContext("2d");this._container&&this._container.appendChild(o),this.dispose(()=>this._container&&this._container.removeChild(o));let l;this.dispose(this._gifFrames.changed.disposableOn(f=>{if(!f||f.length===0){o.width=0,o.height=0;return}const{width:v,height:m}=f[0].dims;this._gifSize.value=[v,m];const y=f.length;let w=0;this._gifDurations.length=0;for(let S=0;S<y;++S)w+=f[S].delay,this._gifDurations.push(w);this._gifDuration.value=this._gifDurations[this._gifDurations.length-1],o.width=v,o.height=m,l=h.createImageData(v,m),this.currentTimeChangedEvent.emit(this.currentTime,this.currentTime),this._autoPlayOnLoad.value&&(this.currentTime=0,this.playing=!0)}));let d=-1;this.dispose(this.currentTimeChangedEvent.disposableOn(f=>{const v=um(f/this.duration,0,1),m=this.gifDuration*v,y=this._gifFrames.value;if(y&&y.length>0){const w=this._getFrame(m);if(w===d)return;d=w;const S=y[w];if(S.disposalType!==0&&S.disposalType!==1&&S.disposalType!==2&&Jr(`gif parsed get disposalType ${S.disposalType}... frame: ${w} size: ${JSON.stringify(S.dims)}`,`gif parsed get disposalType ${S.disposalType}...`),l&&(w===0||S.disposalType===2)&&l.data.fill(0),l){const[T,N]=this._gifSize.value,{width:j,height:C,left:k,top:M}=S.dims;if(C>N)throw new Error("height > canvasHeight");for(let D=0;D<C;++D)for(let L=0;L<j;++L){const V=D*j+L,x=M+D,I=k+L,R=x*T+I,G=l.data,F=S.patch,U=F[V*4+3]/255;G[R*4+0]=G[R*4+0]*(1-U)+F[V*4+0]*U|0,G[R*4+1]=G[R*4+1]*(1-U)+F[V*4+1]*U|0,G[R*4+2]=G[R*4+2]*(1-U)+F[V*4+2]*U|0,G[R*4+3]=um(G[R*4+3]+F[V*4+3],0,255)|0}h.putImageData(l,0,0)}}else Jr("gif资源未加载!无法播放!")})),this.dispose(this._gifDuration.changed.disposableOn(()=>{this.duration=this.gifDuration})),this._autoPlayOnLoad.value=n,this._gifFrames.value=s}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 s=0;s<n;++s)if(t<=this._gifDurations[s])return s;throw new Error("should not be here")}}class dm extends st{constructor(t){super();p(this,"_player");p(this,"_url",this.disposeVar(it("")));p(this,"_loadGifFramesProcessing",this.disposeVar(el(t=>na(lm(t)))));this._player=this.disposeVar(new cm(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 tn(`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 fm extends st{constructor(t,n){super();p(this,"_gif",this.disposeVar(new dm));p(this,"_update");this._complexImage=t,this._imageUri=n,this._gif.url=this._imageUri,this._update=this.disposeVar(sa(()=>this.update())),this._update.start()}get gif(){return this._gif}update(){const{player:t}=this._gif;if(!t.gifFrames)return;const n=this._complexImage,{width:s,height:o}=t.gifCanvas;n.size=[s,o],n.pixelFormat="RGBA",n.copyTexture({source:t.gifCanvas});{const h=()=>{t.autoPlayOnLoad=this._complexImage.autoplay};h(),this.dispose(this._complexImage.autoplayChanged.disposableOn(h))}{const h=()=>{t.loop=this._complexImage.loop};h(),this.dispose(this._complexImage.loopChanged.disposableOn(h))}}}function gm(i,e){const[t,n,s]=wo(i),o=it(void 0),h=()=>{const l=t()??e;o.value=l&&St.context.getStrFromEnv(l)};return h(),s&&o.d(s.don(h)),o.d(St.context.environmentVariablesChanged.don(h)),o}function pm(i){const e=/\${(.*?)\}/g;if(!e.test(i))return i;const t=i.replace(e,(n,s)=>{const o=St.context.getEnv(s);return o===void 0?(console.warn(`环境变量(${s})不存在,无法进行转换`),"{env-error}"):o});return pm(t)}class oE extends st{constructor(t){super();p(this,"_sceneObjRefs",new Map);p(this,"_refs",{});p(this,"_refsChanged",this.dv(new H));const n=(s,o,h)=>{if(h){const l=this.getLastSceneObject(h),d=this._sceneObjRefs.get(h);if(!d)console.warn(`this._sceneObjRefs中不存在ref(${h}), 可能系统存在逻辑问题`);else{const v=d.indexOf(s);v===-1?console.warn(`this._sceneObjRefs中不存在当前对象(id: ${s.id} type: ${s.typeName})!可能系统存在逻辑问题`):(d.splice(v,1),d.length===0&&this._sceneObjRefs.delete(h))}const f=this.getLastSceneObject(h);this._refs[h]=f,this._refsChanged.emit(f,l)}if(o){const l=this.getLastSceneObject(o),d=this._sceneObjRefs.get(o);d?(d.push(s),d.length>0&&console.warn(`同时存在多个ref${o}相同的场景对象!
21
+ `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[i]=b.copyright,window.g_XE3SendProductUsageInfo=window.g_XE3SendProductUsageInfo||!0,window.g_XE3SendProductUsageInfo&&(setTimeout(()=>rp(b.copyright),6e4),setInterval(()=>rp(b.copyright),864e5)),window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&b.copyright.print()}catch{console.warn("版本信息有误!")}const ap=new Set;function Jr(i,e=i){ap.has(e)||(ap.add(e),console.warn(i))}function wo(i){const e=$h(i),t=()=>e[0][e[1]],n=o=>{try{e[0][e[1]]=o}catch(h){Jr(`setValue error, obj(${e[0].constructor.name}) prop(${e[1]}) error(${h})`)}},s=e[0][e[2]];return[t,n,s]}function b1(){return!0}function P1(){throw new Error("throwOnDestroyed")}function op(i){for(var e in i)typeof i[e]=="function"&&(i[e]=P1);i.isDestroyed=b1}const Cu=class Cu{constructor(){p(this,"_memId",++Cu._lastMemId);p(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 op(this)}tryDestory(){if(!this.isDestroyed())return this.destroy()}};p(Cu,"_lastMemId",-1);let st=Cu,Uu;function hp(i){Uu=i}Object.defineProperties(st.prototype,{toDestroyEvent:{get(){if(this._toDestroyEvent===void 0){if(!Uu)throw new Error("Destroyable EventCtor not registered yet!");this._toDestroyEvent=this.disposeVar(new Uu)}return this._toDestroyEvent}}});class Vh{constructor(e,t,n=!1){p(this,"_freeElements");p(this,"_usedElementsCount");p(this,"_usedElements");p(this,"_nextCreateID");p(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 C1(){return{item:void 0,previous:void 0,next:void 0}}function I1(i){i.item=void 0,i.previous=void 0,i.next=void 0}const lp=new Vh(C1,I1,!0);function Vu(i,e,t){const n=lp.create();return n.item=i,n.previous=e,n.next=t,n}function up(i){if(!i)throw new Error("node is undefined!");lp.destroy(i)}function qu(i,e){e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=void 0,i.tail=e.previous):e.next?(e.next.previous=void 0,i.head=e.next):(i.head=void 0,i.tail=void 0),e.next=void 0,e.previous=void 0}class cp{constructor(e){p(this,"head");p(this,"tail");p(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!");qu(this,e),this._decrementLength(),up(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){qu(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){qu(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=Vu(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=Vu(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=Vu(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;up(e),e=t}this.head=void 0,this.tail=void 0,this._setLength(0)}}function M1(){return{func:void 0,scope:void 0,_hasRemoved:!1,_once:!1}}function T1(i){i.func=void 0,i.scope=void 0,i._hasRemoved=!1,i._once=!1}const Ys=new Vh(M1,T1,!0);class $u{constructor(){p(this,"__dll");p(this,"__currentListenerStack")}get _dll(){return this.__dll=this.__dll??new cp({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 s=t.next;n._once&&!n._hasRemoved&&(this.remove(t),t=void 0),t&&this._clearHasRemoved(t),t=s}}}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,s=!1){if(e.item._hasRemoved)throw new Error("handler has removed!");const o=Ys.create();return o.func=t,o.scope=n,o._once=s,this._dll.insertBefore(e,o)}insertAfter(e,t,n,s=!1){if(e.item._hasRemoved)throw new Error("handler has removed!");const o=Ys.create();return o.func=t,o.scope=n,o._once=s,this._dll.insertAfter(e,o)}_clearHasRemoved(e){e.item._hasRemoved&&!this._hasCurrentListener(e.item)&&(Ys.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:(Ys.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()}`)),Ys.destroy(n.item),this._dll.remove(n),e=t}this.__dll=void 0,this.__currentListenerStack=void 0}push(e,t,n=!1){const s=Ys.create();return s.func=e,s.scope=t,s._once=n,this._dll.push(s)}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 s=Ys.create();return s.func=e,s.scope=t,s._once=n,this._dll.unshift(s)}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 Eo{constructor(){p(this,"_listenerHandler");p(this,"_cid")}_reset(e,t){this._listenerHandler=e,this._cid=t}clone(e){return e=e??new Eo,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 Wu extends Eo{}let H=class extends st{constructor(){super(...arguments);p(this,"__pipe");p(this,"beforeCallback");p(this,"afterCallback")}get _pipe(){return this.__pipe=this.__pipe??new $u,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,s=!1,o){const h=s?this._pipe.unshift(t,n,!1):this._pipe.push(t,n,!1);return o=o??new Wu,o._reset(h,h._cid),o}disposableOn(t,n,s=!1,o){const h=this.on(t,n,s,o);return()=>{h.valid&&this.off(h)}}don(t,n,s=!1,o){return this.disposableOn(t,n,s,o)}disposableWeakOn(t,n,s=!1,o){const h=new st,l=()=>{!h.isDestroyed()&&h.destroy()};return h.dispose(this.disposableOn(t,n,s,o)),h.dispose(this.toDestroyEvent.disposableOn(l)),l}dwon(t,n,s=!1,o){return this.disposableWeakOn(t,n,s,o)}once(t,n,s=!1,o){const h=s?this._pipe.unshift(t,n,!0):this._pipe.push(t,n,!0);return o=o??new Wu,o._reset(h,h._cid),o}disposableOnce(t,n,s=!1,o){const h=this.once(t,n,s,o);return()=>h.valid&&this.off(h)}donce(t,n,s=!1,o){const h=this.once(t,n,s,o);return()=>h.valid&&this.off(h)}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||(Jr("The event is destroying with listeners!"),this._pipe.removeAll())}};hp(H);function Kr(i,e){return e=e??new Eo,e._reset(i,i._cid),e}class k1{constructor(){p(this,"__pipe")}get _pipe(){return this.__pipe=this.__pipe??new $u,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,s=!1,o){if(!e.valid)throw new Error("handler is not valid!");const h=this._pipe.insertBefore(e._listenerHandler,t,n,s);return Kr(h,o)}insertAfter(e,t,n,s=!1,o){if(!e.valid)throw new Error("handler is not valid!");const h=this._pipe.insertAfter(e._listenerHandler,t,n,s);return Kr(h,o)}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,s){const o=this._pipe.push(e,t,n);return Kr(o,s)}pop(){return this._pipe.pop()}shift(){return this._pipe.shift()}unshift(e,t,n=!1,s){const o=this._pipe.unshift(e,t,n);return Kr(o,s)}getTail(e){const t=this._pipe.tail;if(t)return Kr(t,e)}getHead(e){const t=this._pipe.head;if(t)return Kr(t,e)}}class Ne extends st{constructor(t,n,s){super();p(this,"_changed");p(this,"_value");p(this,"_oldValue");p(this,"toChangeFunc");this._equalsFunc=n,this._assignFunc=s,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 H)),this._changed}forceChange(){this._changed&&this._changed.emit(this._value,this._value)}}function it(i,e,t){return new Ne(i,e,t)}function vt(i){return new Ne(i,(e,t)=>e.length!==t.length?!1:e.every((n,s)=>n===t[s]),(e,t)=>{const n=t||new Array(e.length);return n.length=e.length,e.forEach((s,o)=>n[o]=s),n})}function Wt(i){return it(i,(e,t)=>e===void 0||t===void 0?e===void 0&&t===void 0:e.length!==t.length?!1:e.every((n,s)=>n===t[s]),(e,t)=>{if(!e)return;const n=t||new Array(e.length);return n.length=e.length,e.forEach((s,o)=>n[o]=s),n})}function qh(i,e,t){return it(i,(n,s)=>n.length!==s.length?!1:n.every((o,h)=>e&&e(o,s[h])||o===s[h]),(n,s)=>{const o=s||new Array(n.length);return o.length=n.length,n.forEach((h,l)=>{o[l]=t?t(h):h}),o})}function vs(i,e,t){return it(i,(n,s)=>n===void 0||s===void 0?n===void 0&&s===void 0:n.length!==s.length?!1:n.every((o,h)=>e&&e(o,s[h])||o===s[h]),(n,s)=>{if(!n)return;const o=s||new Array(n.length);return o.length=n.length,n.forEach((h,l)=>{o[l]=t?t(h):h}),o})}function At(i){return new Ne(i,(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 se(i){return new Ne(i,(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 O1(i){return new Ne(i,(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every((o,h)=>o===s[h]&&e[o]===t[o])},(e,t)=>e&&{...e})}function N1(i){return new Ne(i,(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every((o,h)=>o===s[h]&&e[o]===t[o])},(e,t)=>e&&{...e})}function R1(i){return qh(i,(e,t)=>e.every((n,s)=>n===t[s]),e=>[...e])}function Hu(i){return vs(i,(e,t)=>e.every((n,s)=>n===t[s]),e=>[...e])}function A1(i){return qh(i,(e,t)=>JSON.stringify(e)===JSON.stringify(t),e=>JSON.parse(JSON.stringify(e)))}function D1(i){return vs(i,(e,t)=>JSON.stringify(e)===JSON.stringify(t),e=>JSON.parse(JSON.stringify(e)))}function Yn(i){return Hu(i)}function Xu(i){return vs(i,(e,t)=>e.length===t.length&&e.every((n,s)=>n.every((o,h)=>o===t[s][h])),e=>e.map(t=>[...t]))}function L1(i){return vs(i,(e,t)=>e.length===t.length&&e.every((n,s)=>n.every((o,h)=>o===t[s][h])),e=>e.map(t=>[...t]))}function $h(i){const e=i instanceof Ne?[i,"value","changed"]:[...i];return e[2]=e[2]||e[1]+"Changed",e}function Yu(i,e,t,n=!1){e[2]=e[2]||e[1]+"Changed";const s=()=>{const o=e[0][e[1]];t?i[0][i[1]]=t(o):i[0][i[1]]=o};return s(),n?e[0][e[2]].disposableWeakOn(s):e[0][e[2]].disposableOn(s)}function F1(i,e,t,n,s=!1){const o=Yu(i,e,t,s),h=Yu(e,i,n,s);return()=>(o(),h())}function Q(i,e,t,n=!1){const s=i instanceof Ne?[i,"value","changed"]:i,o=e instanceof Ne?[e,"value","changed"]:e;return Yu(s,o,t,n)}function mt(i,e,t,n,s=!1){const o=$h(i),h=$h(e);return F1(o,h,t,n,s)}function G1(i,e,t,n=!1){const[s]=wo(e);return mt(i,e,o=>o??t,o=>{if(!(o===t&&s()===void 0))return o},n)}function Zr(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var e=Math.random()*16|0,t=i==="x"?e:e&3|8;return t.toString(16)})}function Wh(i,e){if(!window||!window.setTimeout||!window.clearTimeout)throw new Error("目前只适合在浏览器中使用!");let t=0;function n(){t>0&&(window.clearTimeout(t),t=0)}function s(...o){n(),t=window.setTimeout(i,e,...o)}return[s,n]}function Ju(i,e,...t){const n=setInterval(i,e,...t);return()=>clearInterval(n)}function Ku(i,e,...t){const n=setTimeout(i,e,...t);return()=>clearTimeout(n)}function Hh(i,...e){let t;const n=()=>{const s=performance.now();i(s,...e),t=requestAnimationFrame(n)};return n(),()=>typeof t<"u"&&(cancelAnimationFrame(t),t=void 0)}function Qr(i,...e){let t;return t=requestAnimationFrame(()=>{const s=performance.now();i(s,...e)}),()=>typeof t<"u"&&(cancelAnimationFrame(t),t=void 0)}function So(i,...e){let t=!1,n;return new Promise((s,o)=>{n=o,s()}).then(()=>{!t&&i(...e)}).catch(s=>{console.error(s)}),()=>(t=!0)&&n&&(n("nextMicroTask cancelled!"),n=void 0)}class Xh extends H{constructor(t,n,...s){super();p(this,"_cancellFunc");this._nextFunc=t,this.dispose(()=>{this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0)}),s.forEach(o=>this.dispose(o[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 Zu extends Xh{constructor(...e){super(So,!1,...e)}}function j1(...i){return new Zu(...i)}class B1 extends Xh{constructor(...e){super(So,!0,...e)}}function z1(...i){return new Zu(...i)}class Yh extends Xh{constructor(...e){super(Qr,!1,...e)}}function we(...i){return new Yh(...i)}function U1(i,e){return new Yh(...i).don(e())}class dp extends Xh{constructor(...e){super(Qr,!0,...e)}}function V1(...i){return new dp(...i)}function Me(i,e,t={time:"don",immediate:!1}){const n=new Yh(...Array.isArray(i)?i:[i]),s=n[t.time??"don"](e);return(t.immediate??!1)&&e(),()=>{s(),n.destroy()}}function xo(i){let e;if(typeof i.next=="function")e=i;else if(typeof i[Symbol.iterator]=="function")e=i[Symbol.iterator]();else throw new Error("iteratorOrIterable error!");return e}function Qu(i,e){let t=!1;const n=xo(i);let s=-1;for(;;){const{done:o,value:h}=n.next();if(o)break;if(e(h,++s)){t=!0;break}}return t}function tc(i,e){return!Qu(i,(n,s)=>!e(n,s))}function bo(i,e,t,n){const s=i;if(!s[e]){const o=n(),h=Object.fromEntries(Object.entries(o).filter(([l,d])=>{const f=Object.getPrototypeOf(t),v=l in f;if(v){const m=d instanceof Ne?d.value:d;i[l]=m}return!v}).map(([l,d])=>d instanceof Ne?[l,d]:[l,Array.isArray(d)?Wt(d):it(d)]));s[e]=h}return s[e]}function ys(i,e){var n;const t=Symbol(`${(n=i==null?void 0:i.constructor)==null?void 0:n.name}-createDefaultProps`);i.constructor.__xbsj_dpSymbol=t,i.constructor.__xbsj_createDefaultProps=e;for(let[s,o]of Object.entries(e()))if(!Reflect.has(i,s)){const h=function(l){var v,m;if(l[t])return;const d=[];let f=Object.getPrototypeOf(l);for(;f;)d.push(f),f=Object.getPrototypeOf(f);d.reverse();for(let y of d){const w=(v=y.constructor)==null?void 0:v.__xbsj_dpSymbol;if(!w)continue;const S=(m=y.constructor)==null?void 0:m.__xbsj_createDefaultProps;S&&bo(l,w,y,S)}};Object.defineProperties(i,{[s]:{get(){return h(this),bo(this,t,i,e)[s].value},set(l){h(this);const d=bo(this,t,i,e)[s];if(!d){console.error("!propObj");debugger}d.value=l}},[`${s}Changed`]:{get(){return h(this),bo(this,t,i,e)[s].changed}},[`${s}React`]:{get(){return h(this),bo(this,t,i,e)[s]}}})}}const Po=new WeakMap;function yn(i,e,t){Po.has(i)||Po.set(i,{});const n=Po.get(i);n[e]=t}function _i(i,e){return Po.has(i)?Po.get(i)[e]:void 0}function _n(i,e){const t=xo(i);let n=0;for(;;){const{done:s,value:o}=t.next();if(s)break;e(o,n++)}}function Co(i,e,t){const n=xo(i);let s=t,o=0;for(;;){const{done:h,value:l}=n.next();if(h)break;s=e(s,l,o++)}return s}const q1=i=>++i;function ec(i){return Co(i,q1,0)}function Jn(i){return Co(i,(e,t)=>e>t?e:t,Number.NEGATIVE_INFINITY)}function _s(i){return Co(i,(e,t)=>e<t?e:t,Number.POSITIVE_INFINITY)}function fp(i,e){let t=i;for(let n of e)t=t[n];return t}function $1(i,e,t){if(e.length===0)throw new Error("props的数量必须大于0");const n=e.length-1,s=e[n];let o=i;for(let h=0;h<n;++h){const l=e[h];typeof o[l]>"u"&&(o[l]={}),o=o[l]}o[s]=t}function*Js(i,e){const t=xo(i);for(;;){const{done:n,value:s}=t.next();if(n)break;yield fp(s,e)}}class Io extends st{constructor(){super();p(this,"_innerObj");p(this,"_toChangeEvent");p(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 H),this._toChangeEvent}get changedEvent(){return this._changedEvent||(this._changedEvent=new H),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 s=0;s<n;++s)this._innerObj[s]=t[s];this._changedEvent&&this._changedEvent.emit(this)}splice(t,n,...s){const{length:o}=this._innerObj;t=t>this._innerObj.length?this._innerObj.length:t,t>o?t=o:t<0&&(t+=o,t<0&&(t=0));const h=this._innerObj.length-t;if(n>h?n=h:n<0&&(n=0),arguments.length===1){this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:this._innerObj.length-t,items:[]}],this);const l=this._innerObj.splice(t);return this._changedEvent&&this._changedEvent.emit(this),l}else if(arguments.length===2){this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:n,items:[]}],this);const l=this._innerObj.splice(t,n);return this._changedEvent&&this._changedEvent.emit(this),l}else{this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:n,items:s}],this);const l=this._innerObj.splice(t,n,...s);return this._changedEvent&&this._changedEvent.emit(this),l}}pop(){if(this._innerObj.length===0)return;if(this._toChangeEvent){const n=this._innerObj.length-1,s=1,o=[];this._toChangeEvent.emit([{start:n,deleteCount:s,items:o}],this)}const t=this._innerObj.pop();return this._changedEvent&&this._changedEvent.emit(this),t}push(...t){if(this._toChangeEvent){const s=this._innerObj.length;this._toChangeEvent.emit([{start:s,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 s,o,h;n>t?(s=t,o=n-t,h=[]):(s=n,o=0,h=new Array(t-n)),this._toChangeEvent.emit([{start:s,deleteCount:o,items:h}],this)}this._innerObj.length=t,this._changedEvent&&this._changedEvent.emit(this)}}get(t){return this._innerObj[t]}set(t,n){const{length:s}=this._innerObj;if(t<0||t>=s)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 ic(i,e,...t){let n=i;for(let s of t){if(!n[s])if(e)n[s]={};else return;n=n[s]}return n}function W1(i,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([i],{type:t||""});let s=URL.createObjectURL(n);var o=document.createElement("a"),h=new MouseEvent("click");o.download=e,o.href=s,o.dispatchEvent(h),URL.revokeObjectURL(s)}function H1(i,e){const t=document.createElement("a"),n=new MouseEvent("click");t.download=e||"下载",t.href=i,t.dispatchEvent(n)}function X1(){return new Promise((i,e)=>{const t=performance.now();requestAnimationFrame(n=>i(n>t))})}const Jh=i=>{let e,t;return t=n=>{n=performance.now(),e=requestAnimationFrame(t),i(n)},e=requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}};function nc(i,e,t=Jh){let n=Number.NEGATIVE_INFINITY,s;function o(d){d-n>e&&s&&(i(...s),s=void 0,n=d)}const h=t&&t(o)||void 0;function l(...d){s=d}return[l,h]}const gp=[];function pp(i,e,t){if(gp.includes(i)){console.warn(`_loadJs ${i} has loaded before!`),e&&e();return}var n=document.getElementsByTagName("head")[0],s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",i),s.onload=s.onreadystatechange=function(){this.readyState&&this.readyState!=="complete"||(gp.push(i),e&&e(),s.onload=s.onreadystatechange=null)},s.onerror=(o,h,l,d,f)=>{t(f)},n.appendChild(s)}function sc(i,e=!0){if(e){const t=window.L;window.L&&(window.L=void 0);const n=window.define;return window.define&&(window.define=void 0),new Promise((s,o)=>{pp(i,s,o)}).then(()=>(window.define=n,window.L=t,Promise.resolve()))}else return new Promise((t,n)=>{pp(i,t,n)})}async function mp(i,e=""){return new Promise((t,n)=>{var s=new Image;s.crossOrigin=e,s.src=i,s.onload=()=>t(s),s.onerror=o=>n(o)})}class Y1 extends st{constructor(e){super(),this._owner=e}get owner(){return this._owner}}function vp(i,e){if(i.length%3!==0)throw new Error("positions.length % 3 !== 0");const t=i.length/3;function*n(h){for(let l=0;l<t;++l)yield i[l*3+h]}const s=(e==null?void 0:e.min)??[NaN,NaN,NaN],o=(e==null?void 0:e.max)??[NaN,NaN,NaN];return s[0]=_s(n(0))??NaN,s[1]=_s(n(1))??NaN,s[2]=_s(n(2))??NaN,o[0]=Jn(n(0))??NaN,o[1]=Jn(n(1))??NaN,o[2]=Jn(n(2))??NaN,{min:s,max:o}}async function J1(i,e=fetch){const t=await e(i);return t.ok?await t.arrayBuffer():void 0}class K1 extends st{constructor(t){super();p(this,"_map",new Map);p(this,"_array",[]);p(this,"_createEvent",this.dv(new H));p(this,"_updateEvent",this.dv(new H));p(this,"_destroyEvent",this.dv(new H));this._idFunc=t,this.d(()=>{this._array.length>0&&console.warn("EventFromArrayUpdating: destroy with non-empty array, will trigger destroy event for all items")})}get createEvent(){return this._createEvent}get updateEvent(){return this._updateEvent}get destroyEvent(){return this._destroyEvent}update(t,n={toDel:!0,toAdd:!0,toUpdate:!0}){const{toDel:s=!0,toAdd:o=!0,toUpdate:h=!0}=n;for(let d of this._array)d.updated=!1;const l=t.length;for(let d=0;d<l;++d){const f=t[d],v=this._idFunc(f,d);if(this._map.has(v)){if(h){const m=this._map.get(v);if(!m)throw new Error("!edwi");m.updated=!0,m.item=f,this._updateEvent.emit(v,f)}}else if(o){const m={item:f,id:v,updated:!0};this._array.push(m),this._map.set(v,m),this._createEvent.emit(v,f)}}if(s){const d=this._array.filter(f=>!f.updated);this._array=this._array.filter(f=>f.updated);for(let f of d)this._map.delete(f.id);for(let f of d)this._destroyEvent.emit(f.id,f.item)}}}function Kh(i,...e){if(i>16)throw new Error("length > 16");const t=new Array(i);for(let n=0;n<i;++n)t[n]=e[n]??0;return t}class Zh{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 Z1(i){return new Zh(i,2)}function Q1(i){return new Zh(i,3)}function tw(i){return new Zh(i,4)}class ew{constructor(e,t,n,s){this._array=e,this._length=t,this._start=n,this._stride=s}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 iw(i,e,t=0,n=1){return new ew(i,e,t,n)}b.Vector=void 0,(i=>{function e(A,...at){if(A=A||Kh(at.length),at.length>A.length)throw new Error("args.length > target.length");return A instanceof Float64Array?A.set(at):G(at,A),A}i.set=e;function t(A,at){const Pt=A.length;for(let It=0;It<Pt;++It)if(!at(A[It],It))return!1;return!0}i.every=t;function n(A,at,Pt){const It=A.length;let re=Pt;for(let le=0;le<It;++le)re=at(re,A[le],le);return re}i.reduce=n;function*s(A){for(let at=0;at<A.length;++at)yield A[at]}i.itr=s;const o=(A,at)=>A+=at*at;function h(A){return n(A,o,0)}i.magnitudeSquared=h;function l(A){const at=h(A);return Math.sqrt(at)}i.magnitude=l;function d(A,at=1e-5){const Pt=h(A);return Math.abs(Pt-1)<at}i.isNormalized=d;let f;const v=(A,at,Pt)=>A+at*f[Pt];function m(A,at){return V(A,at),f=at,n(A,v,0)}i.dot=m;let y;const w=(A,at,Pt)=>A+=(at-y[Pt])*(at-y[Pt]);function S(A,at){return V(A,at),y=at,n(A,w,0)}i.distanceSquared=S;function T(A,at){return Math.sqrt(S(A,at))}i.distance=T;let N;const j=(A,at)=>A===N[at];function C(A,at){return V(A,at),N=at,t(A,j)}i.equals=C;let k,M;const D=(A,at)=>Math.abs(A-k[at])<M;function L(A,at,Pt=0){return V(A,at),k=at,M=Pt,t(A,D)}i.equalsEpsilon=L;function V(A,at){if(A.length!==at.length)throw new Error("left.length !== right.length")}function x(A,at,Pt){const It=A.length;Pt=Pt||Kh(It),V(A,Pt);for(let re=0;re<It;++re)Pt[re]=at(A[re],re);return Pt}i.op1=x;function I(A,at,Pt,It){V(A,at),It&&V(A,It);const re=A.length;It=It||Kh(re);for(let le=0;le<re;++le)It[le]=Pt(A[le],at[le]);return It}i.op2=I;const R=A=>A;function G(A,at){return x(A,R,at)}i.clone=G;let F=0;const U=(A,at)=>A*F;function z(A,at,Pt){return F=at,x(A,U,Pt)}i.multiplyByScalar=z;function $(A,at,Pt=0){const It=h(A);if(It<=Pt)return;const re=Math.sqrt(It);return z(A,1/re,at)}i.normalize=$;function W(A,at){return z(A,-1,at)}i.negate=W;const X=A=>Math.abs(A);function Y(A,at){return x(A,X,at)}i.abs=Y;const et=A=>A-Math.floor(A);function J(A,at){return x(A,et,at)}i.fract=J;const rt=(A,at)=>A-at;function ht(A,at,Pt){return I(A,at,rt,Pt)}i.subtract=ht;const Ot=(A,at)=>A+at;function ct(A,at,Pt){return I(A,at,Ot,Pt)}i.add=ct;const _t=(A,at)=>A*at;function Ct(A,at,Pt){return I(A,at,_t,Pt)}i.multiply=Ct;const Lt=(A,at)=>A/at;function K(A,at,Pt){return I(A,at,Lt,Pt)}i.divide=K;let Qt;const zt=(A,at)=>A*(1-Qt)+at*Qt;function gt(A,at,Pt,It){return Qt=Pt,I(A,at,zt,It)}i.lerp=gt})(b.Vector||(b.Vector={}));function Qh(i,e=0,t=1){return i<e?e:i>t?t:i}class tl extends st{constructor(t,n,s,o,h,l,d,f){super();p(this,"__status");p(this,"_statusChangedEvent");p(this,"_forceCancelFunc");p(this,"_startEvent");p(this,"_progressEvent");p(this,"_completeEvent");p(this,"_cancelEvent");p(this,"_cancelledEvent");p(this,"_errorEvent");p(this,"_finishedEvent");p(this,"_processingID",-1);this._startProcessingFunc=t,this.startFunc=n,this.progressFunc=s,this.completeFunc=o,this.cancelFunc=h,this.cancelledFunc=l,this.errorFunc=d,this.finishedFunc=f,this._status="Initial",this.dispose(()=>{var v;return(v=this._statusChangedEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._startEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._progressEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._completeEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._cancelEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._cancelledEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._errorEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._finishedEvent)==null?void 0:v.destroy()}),this.dispose(()=>this.reset())}get startEvent(){return this._startEvent=this._startEvent||new H,this._startEvent}get progressEvent(){return this._progressEvent=this._progressEvent||new H,this._progressEvent}get completeEvent(){return this._completeEvent=this._completeEvent||new H,this._completeEvent}get cancelEvent(){return this._cancelEvent=this._cancelEvent||new H,this._cancelEvent}get cancelledEvent(){return this._cancelledEvent=this._cancelledEvent||new H,this._cancelledEvent}get errorEvent(){return this._errorEvent=this._errorEvent||new H,this._errorEvent}get finishedEvent(){return this._finishedEvent=this._finishedEvent||new H,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,s={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},o=this._startProcessingFunc(s,...t);return this._forceCancelFunc=o,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 H),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 s=this._forceCancelFunc(n);if(this._forceCancelFunc=void 0,s&&s instanceof Promise)return s.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(s){console.error(`processing restart error: ${s}`)}}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 rc=class extends Error{};function yp(i,e){typeof i=="function"?i(e):i.cancelFunc=e}class ac extends tl{constructor(t=300){super(({progressFunc:n,completeFunc:s,errorFunc:o})=>{const[h,l]=Wh(()=>{if(!this._lastDebounceValue)throw new Error("!this._lastDebounceValue");n([this._lastDebounceValue,this._debouncTimes]),this._debouncTimes=0},this._delayTime);return this._d=h,()=>{l()}});p(this,"_lastDebounceValue");p(this,"_debouncTimes",0);p(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 _p(i,e,...t){const n=new AbortController;let s=n.signal,[o,h]=t;if(h!=null&&h.signal)throw console.error("init?.signal"),new Error("init?.signal");h=h||{},h.signal=s;let l=!1;yp(i,()=>{l=!0,n.abort()});let d=fetch(o,h);return e&&(d=d.then(f=>{if(!f.ok)return f;if(!f.body)throw Error("ReadableStream not yet supported in this browser.");const v=f.headers.get("content-length"),m=v?parseInt(v,10):0;let y=0;return new Response(new ReadableStream({start(w){if(!f.body)throw new Error("!response.body");const S=f.body.getReader();T();function T(){S.read().then(({done:N,value:j})=>{if(N){w.close();return}if(!j)throw new Error("!value");if(!e)throw new Error("!progressFunc");y+=j.byteLength,e(y,m),w.enqueue(j),T()}).catch(N=>{w.error(N)})}}}),{status:f.status,statusText:f.statusText,headers:f.headers})}).catch(f=>{throw l?(f instanceof Error&&f.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new rc("fetching cancelled!")):(f instanceof Error&&f.code===20&&console.error("error.code === 20"),f)})),d}function wp(...i){if(i.length>=1)if(typeof i[0]=="function"||typeof i[0]>"u"){const e={};let t=_p(e,...i);const{cancelFunc:n}=e;if(!n)throw new Error("!cancelResult.cancelFunc");return[n,t]}else return _p(...i);throw new Error("cancelableFetch args error!")}class nw extends tl{constructor(t,...n){super(({progressFunc:s,completeFunc:o,errorFunc:h},...l)=>{const d={};let f={loaded:0,total:0};const v=(w,S)=>{f.loaded=w,f.total=S,s(f)},m=this._fetchArgs||l;if(m.length===0)throw new Error("fetchArgs.length === 0");if(wp(d,v,...m).then(t).then(o).catch(w=>{w instanceof rc||h(w)}),!d.cancelFunc)throw new Error("!cancelResult.cancelFunc");return d.cancelFunc});p(this,"_fetchArgs");n.length>0&&(this._fetchArgs=n)}get fetchArgs(){return this._fetchArgs}}function oc(i,e,t,n){const s="_"+e,o="_"+e+"Changed",h=e+"Changed";Object.defineProperties(i.prototype,{[e]:{get(){return typeof this[s]>"u"&&typeof t<"u"&&(this[s]=t),this[s]},set(l){if(typeof this[s]>"u"&&typeof t<"u"&&(this[s]=t),n?!n(this[s],l):this[s]!==l){const d=this[s];this[s]=l,this[o]&&this[o].emit(l,d)}}},[h]:{get(){return typeof this[o]>"u"&&(this[o]=new H,typeof this.dispose<"u"&&this.dispose(()=>this[o].destroy())),this[o]}}})}class hc extends tl{constructor(t,n=!0){super(({progressFunc:s,completeFunc:o,errorFunc:h})=>(this._intervalFunc=s,this._intervalID&&console.error("this._intervalID should be undefined!"),this.leading&&s(),this._intervalID=setInterval(s,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}));p(this,"_intervalID");p(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))}))}}oc(hc,"leading",!0),oc(hc,"intervalTime",500);function sw(i,e){let t,n;const s=new Promise((h,l)=>{n=l,t=globalThis.setTimeout(()=>{t=void 0,h()},i)}),o=h=>{t&&(clearTimeout(t),t=void 0),n&&n(h??new rc("sleep cancel error!"))};if(typeof e=="boolean"&&e)return[o,s];if(e)return yp(e,o),s}class rw{constructor(e=0,t=0,n=0,s,o){p(this,"_processData");p(this,"_lastUpdateTimeStamp",0);this.startTime=e,this.duration=t,this.delay=n,this.proccessFunc=s,this.completeFunc=o,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 Ep extends tl{constructor(t=1e3,n=0,s=Jh){let o;function h(){o&&o()}super(({progressFunc:d,completeFunc:f,errorFunc:v})=>{const m=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=d,this._base.completeFunc=()=>{m&&m(),f()},this._base.start(),o=m,h});p(this,"_base");p(this,"duration");p(this,"delay");p(this,"startUpdateFunc");this._base=new rw,this.duration=t,this.delay=n,this.startUpdateFunc=s}get startTime(){return this._base.startTime}}class aw extends st{constructor(t){super();p(this,"_target",0);p(this,"_current",0);p(this,"_start",0);p(this,"_timing",new Ep(Number.POSITIVE_INFINITY));p(this,"_currentChanged");this._duration=t,this._timing.progressFunc=({ratio:n})=>{n=n<0?0:n>1?1:n;const s=this._start*(1-n)+this._target*n;this._current=s,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 H),this._currentChanged}}function Sp(i,e){e=e||[];const t=i.parentNode;return t?Sp(t,e.concat(t)):e}function ow(i){const e=i.composedPath&&i.composedPath()||i.path,t=i.target;if(e!=null)return e.indexOf(window)<0?e.concat(window):e;if(t===window)return[window];if(t===null)throw new Error("target === null");return[t].concat(Sp(t),window)}function $e(i,e=!1){const{offsetX:t,offsetY:n}=i;let s=t,o=n;{const h=ow(i);for(let l=0;l<h.length;++l){const d=h[l];if(d!==i.currentTarget&&d instanceof HTMLElement)s+=d.clientLeft,o+=d.clientTop,s+=d.offsetLeft,o+=d.offsetTop;else break}}return e?[s*window.devicePixelRatio,o*window.devicePixelRatio]:[s,o]}function ta(i,e=!1){const t=i.target,n=i.currentTarget||i.__xbsj_lastCurrentTarget__;if(!t||!n)return[i.clientX,i.clientY];const s=t.getBoundingClientRect(),o=n.getBoundingClientRect(),h=s.left+i.offsetX,l=s.top+i.offsetY,d=h-o.left,f=l-o.top;return e?[d*window.devicePixelRatio,f*window.devicePixelRatio]:[d,f]}class xp extends st{constructor(t){super();p(this,"_clickEvent",new H);p(this,"_dbclickEvent",new H);p(this,"_downEvent",new H);p(this,"_upEvent",new H);p(this,"_moveEvent",new H);p(this,"_debouncing",new ac(300));this.dispose(()=>{this._clickEvent.destroy(),this._dbclickEvent.destroy(),this._downEvent.destroy(),this._upEvent.destroy(),this._moveEvent.destroy(),this._debouncing.destroy()});let n=!1,s=[0,0],o=!1;this._debouncing.progressFunc=([[v,m,y],w])=>{w===1?this._clickEvent.emit(v,m,y):w>=2?this._dbclickEvent.emit(v,m,y):console.error("point click should not be here!")},this._debouncing.start(),this.dispose(()=>{this._debouncing.isRunning&&this._debouncing.cancel(),this._debouncing.destroy()});const h=v=>{n=!0;const[m,y]=$e(v);s[0]=m,s[1]=y,this._downEvent.emit(m,y,v)},l=v=>{const[m,y]=$e(v);n&&!o&&this._debouncing.debounce(m,y,v),n=!1,o=!1,this._upEvent.emit(m,y,v)},d=v=>{const[m,y]=$e(v);if(n&&!o){const[w,S]=s;(Math.abs(m-w)>3||Math.abs(y-S)>3)&&(o=!0)}this._moveEvent.emit(m,y,v)},f=()=>{n=!1,o=!1};t.addEventListener("pointerdown",h),t.addEventListener("pointerup",l),t.addEventListener("pointermove",d),t.addEventListener("pointerout",f),this.dispose(()=>{t.removeEventListener("pointerdown",h),t.removeEventListener("pointerup",l),t.removeEventListener("pointermove",d),t.removeEventListener("pointerout",f)})}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 lc extends st{constructor(){super();p(this,"_pickRectEvent",this.disposeVar(new H));p(this,"_updateRectEvent",this.disposeVar(new H));p(this,"_pointerActionEvent",this.disposeVar(new H));p(this,"_active",this.disposeVar(it(!1)));p(this,"_pickRect",{left0:0,top0:0,left1:0,top1:0});let t=0,n=0,s=0,o=0;this.dispose(this._pointerActionEvent.disposableOn(({type:h,left:l,top:d})=>{h==="PointerDown"?(this._active.value=!0,t=l,n=d,s=l,o=d,this._setPickRect({left0:t,top0:n,left1:s,top1:o}),this._updateRectEvent.emit(this._pickRect)):h==="PointerMove"?this._active.value&&(s=l,o=d,this._setPickRect({left0:t,top0:n,left1:s,top1:o}),this._updateRectEvent.emit(this._pickRect)):h==="PointerUp"&&this._active.value&&(this._active.value=!1,s=l,o=d,this._setPickRect({left0:t,top0:n,left1:s,top1:o}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect))}))}_setPickRect({left0:t,left1:n,top0:s,top1:o}){this._pickRect.left0=t,this._pickRect.left1=n,this._pickRect.top0=s,this._pickRect.top1=o}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:s,top0:o,left1:h,top1:l}=t;return n.width=Math.abs(s-h),n.height=Math.abs(o-l),n.left=Math.min(s,h),n.top=Math.min(o,l),n.forward=h>s,n}static contains(t,n,s){const{left:o,top:h,width:l,height:d}=s;return t>o&&t<=o+l&&n>=h&&n<=h+d}}class hw extends lc{constructor(e){super();const t=this.disposeVar(new xp(e));this.dispose(t.downEvent.disposableOn((h,l,d)=>d.altKey&&this.pointerDown(h,l))),this.dispose(t.moveEvent.disposableOn((h,l)=>this.pointerMove(h,l))),this.dispose(t.upEvent.disposableOn((h,l)=>this.pointerUp(h,l)));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(h=>{n.style.display=h?"block":"none"}));const s=()=>{this.reset()};e.addEventListener("contextmenu",s),this.dispose(()=>e.removeEventListener("contextmenu",s));const o={left:0,top:0,width:0,height:0,forward:!1};this.dispose(this.updateRectEvent.disposableOn(h=>{if(lc.getLeftTopAndSize(h,o)){const{left:l,top:d,width:f,height:v}=o;n.style.height=`${v|0}px`,n.style.width=`${f|0}px`,n.style.left=`${l|0}px`,n.style.top=`${d|0}px`}}))}}class tn extends Error{}function ws(i,e){_i(i,"_promise_cancel")&&console.warn("setPromiseCancel warn: promise has cancelFunc!"),yn(i,"_promise_cancel",e)}function ea(i){return _i(i,"_promise_cancel")}function ia(i){return!!ea(i)}function uc(i,e){const t=ea(i);return t?(t(e),!0):!1}function cc(i){const[e,t]=i;return ws(t,e),t}function na(i){let e;const t=new Promise((n,s)=>{e=s,i.then(n).catch(s)});return ws(t,e),t}function lw(i){let e,t;var n=new Promise((s,o)=>{t=i.disposableOn((...h)=>{t&&t(),s(h)}),e=h=>{t&&t(),o(h)}});return[e,n]}function uw(i){const e=new H,t=new H;return i.then(n=>{e.isDestroyed()||e.emit(n)}).catch(n=>{t.isDestroyed()||t.emit(n)}),[e,t]}class dc extends st{constructor(){super();p(this,"_cancelled",!1);p(this,"_cancelError");p(this,"_promiseSet",new Set);p(this,"_disposer")}get disposer(){return this._disposer=this._disposer||new st,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 s of this._promiseSet)uc(s);this._promiseSet.clear()}}get cancelFuncsNum(){return Co(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 tn("cancel from CancelManager!")}promise(t){return this._promiseSet.add(t),t.finally(()=>(this._promiseSet.delete(t),this.check()))}promiseAny(t){const n=[],s=t.map(o=>(this._promiseSet.add(o),ia(o)&&n.push(ea(o)),o.finally(()=>this._promiseSet.delete(o))));return Promise.any(s).finally(()=>(n.forEach((o=>o(new tn("cancel from promiseAny!")))),n.length=0))}promiseAll(t){const n=[],s=t.map(o=>(this._promiseSet.add(o),ia(o)&&n.push(ea(o)),o.finally(()=>this._promiseSet.delete(o))));return Promise.all(s).finally(()=>(n.forEach((o=>o(new tn("cancel from promiseAll!")))),n.length=0))}promiseRace(t){const n=[],s=t.map(o=>(this._promiseSet.add(o),ia(o)&&n.push(ea(o)),o.finally(()=>this._promiseSet.delete(o))));return Promise.race(s).finally(()=>(n.forEach((o=>o(new tn("cancel from promiseRace!")))),n.length=0))}}class Re extends st{constructor(t){super();p(this,"_status","Initial");p(this,"_completeEvent");p(this,"_errorEvent");p(this,"_completeFunc");p(this,"_errorFunc");p(this,"_cancelFunc");p(this,"_runningId",-1);this._startFunc=t,this.dispose(()=>this.isRunning&&this.cancel())}get errorEvent(){return this._errorEvent||(this._errorEvent=new H),this._errorEvent}get completeEvent(){return this._completeEvent||(this._completeEvent=new H),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:s=>{var o;n===this._runningId&&this._status==="Running"&&(this._status="Completed",this._completeFunc&&this._completeFunc(s),(o=this._completeEvent)==null||o.emit(s))},errorFunc:s=>{var o;n===this._runningId&&this._status==="Running"&&(this._status="Error",this._errorFunc&&this._errorFunc(s),(o=this._errorEvent)==null||o.emit(s))},runningingID:n},...t)}cancel(t=new tn("")){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 tn(""),...n){this.isRunning&&this.cancel(t),this.reset(),this.start(...n)}restartIfNotRunning(...t){this.isRunning||(this.reset(),this.start(...t))}}function Mo(i){return(e,...t)=>{const n=new dc,{completeFunc:s,errorFunc:o}=e,h=i(n,...t).then(s).catch(o).finally(()=>n.destroy());return ws(h,n.cancel.bind(n)),l=>uc(h,l)}}class cw extends Re{constructor(){super(({errorFunc:t},n,s)=>{try{const[o,h]=Wh(n,s);return this._doFunc=o,h}catch(o){return t(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class dw extends Re{constructor(t,n){super(({errorFunc:s})=>{try{const[o,h]=Wh(t,n);return this._doFunc=o,h}catch(o){return s(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}function fw(i){return new Re(Mo((e,...t)=>e.promise(i(...t))))}function gw(i,...e){return new Re(Mo(t=>t.promise(i(...e))))}function el(i){return fw((...e)=>{const t=i(...e);return ia(t)?t:na(t)})}function fc(i,...e){return gw(()=>{const t=i(...e);return ia(t)?t:na(t)})}function pw(i){let e;const t=new Promise((n,s)=>{e=()=>{i(),s()}});return ws(t,e),t}function mw(i,...e){const t=new dc,n=i(t,...e).finally(()=>t.destroy());return ws(n,t.cancel.bind(t)),n}function wi(i){return new Re(Mo(i))}function vw(i,...e){return new Re(Mo(t=>i(t,...e)))}function bp(i,...e){const t=new AbortController;let n=t.signal,[s,o]=e;if(o!=null&&o.signal)throw console.error("init?.signal"),new Error("init?.signal");o=o||{},o.signal&&console.warn("revocableFetch error: init.signal would be override!"),o.signal=n;let h=!1;const l=()=>{h=!0,t.abort()};let d=fetch(s,o);return i&&(d=d.then(f=>{if(!f.ok)return f;if(!f.body)throw Error("ReadableStream not yet supported in this browser.");const v=f.headers.get("content-length");v||console.warn("response.headers.get('content-length') is undefined... cannot get contentLength!");const m=v?parseInt(v,10):0;let y=0;return new Response(new ReadableStream({start(w){if(!f.body)throw new Error("!response.body");const S=f.body.getReader();T();function T(){S.read().then(({done:N,value:j})=>{if(N){w.close();return}if(!j)throw new Error("!value");if(!i)throw new Error("!progressFunc");y+=j.byteLength,i(y,m),w.enqueue(j),T()}).catch(N=>{w.error(N)})}}}),{status:f.status,statusText:f.statusText,headers:f.headers})}).catch(f=>{throw h?(f instanceof Error&&f.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new tn(`fetching cancelled! error: ${f}`)):(f instanceof Error&&f.code===20&&console.error("error.code === 20"),f)})),ws(d,l),d}function yw(i,...e){return bp(i,...e)}function gc(...i){return bp(void 0,...i)}function _w(){return el(gc)}function ww(...i){return fc(gc,...i)}function pc(i,...e){let t=-1;var n=new Promise((s,o)=>{i.isRunning&&i.cancel(),i.reset();const h=new st;h.dispose(i.completeEvent.disposableOn(l=>{if(s(l),h.isDestroyed()){debugger;console.error(`disposer is destroyed! ${h}`);return}h.destroy()})),h.dispose(i.errorEvent.disposableOn(l=>{if(o(l),h.isDestroyed()){debugger;console.error(`disposer is destroyed! ${h}`);return}h.destroy()})),i.start(...e),t=i.runningId});return[s=>t===i.runningId&&i.isRunning&&i.cancel(s),n]}function wn(i,e,...t){try{return e(...t)}catch(n){i(n)}}function Ew(){return new Re(({completeFunc:i,errorFunc:e},t)=>Qr(()=>wn(e,()=>{t&&t(),i()})))}function Sw(i){return new Re(({completeFunc:e,errorFunc:t})=>Qr(()=>wn(t,()=>{i&&i(),e()})))}function xw(){return new Re(({completeFunc:i,errorFunc:e},t)=>So(()=>{wn(e,()=>{t&&t(),i()})}))}function bw(i){return new Re(({completeFunc:e,errorFunc:t})=>So(()=>{wn(t,()=>{i&&i(),e()})}))}function Pp(){return new Re(({completeFunc:i,errorFunc:e},t,n)=>Ku(()=>{wn(e,()=>{t&&t(),i()})},n??1e3))}function Cp(i,e){return new Re(({completeFunc:t,errorFunc:n})=>Ku(()=>{wn(n,()=>{i&&i(),t()})},e??1e3))}function Pw(){return new Re(({errorFunc:i},e,t=1e3)=>Ju(()=>wn(i,e),t))}function Cw(i,e=1e3){return new Re(({errorFunc:t})=>Ju(()=>wn(t,i),e))}function To(){return new Re(({errorFunc:i},e)=>Hh(t=>wn(i,e,t)))}function sa(i){return new Re(({errorFunc:e})=>Hh(t=>wn(e,i,t)))}function ko(i,...e){let t,n;const s=new Promise((h,l)=>{n=l,t=globalThis.setTimeout(()=>{t=void 0,h(e)},i)});return ws(s,h=>{t&&(clearTimeout(t),t=void 0),n&&n(h??new tn("sleep cancel error!"))}),s}function Iw(){return el(ko)}function Mw(i,...e){return fc(ko,i,...e)}function Ks(i,e,...t){return i.promise(cc(pc(wi(async(n,...s)=>(i.disposer.dispose(()=>{n.isDestroyed()||n.cancel()}),await e(n,...s))),...t)))}function Tw(i,e,...t){return i.promise(cc(pc(e,...t)))}class kw extends Re{constructor(){super(({errorFunc:t},n,s)=>{try{const[o,h]=nc(n,s);return this._doFunc=o,h}catch(o){return t(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class Ow extends Re{constructor(t,n){super(({errorFunc:s})=>{try{const[o,h]=nc(t,n);return this._doFunc=o,h}catch(o){return s(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class il extends st{constructor(t=1e3,n=Jh){super();p(this,"_speed");p(this,"_speedChangedEvent");p(this,"_duration");p(this,"_durationChangedEvent");p(this,"_loop");p(this,"startUpdateFunc");p(this,"_updateBindThis");p(this,"_cancelStartUpdateFunc");p(this,"_startTimeStamp");p(this,"_playingChangedEvent");p(this,"_startPlayingEvent");p(this,"_stopPlayingEvent");p(this,"_loopChangedEvent");p(this,"_currentTime",this.disposeVar(it(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 H,this._startPlayingEvent}get stopPlayingEvent(){return this._stopPlayingEvent=this._stopPlayingEvent||new H,this._stopPlayingEvent}get currentTimeChangedEvent(){return this._currentTime.changed}get loopChangedEvent(){return this._loopChangedEvent=this._loopChangedEvent||new H,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 H),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 s=this._duration;this._duration=t,this._currentTime.value>this._duration&&(this._currentTime.value=this._duration),(n=this._durationChangedEvent)==null||n.emit(this._duration,s)}}get speedChangedEvent(){return this._speedChangedEvent||(this._speedChangedEvent=new H),this._speedChangedEvent}get speed(){return this._speed}set speed(t){var n;if(this._speed!==t&&t!==0){const s=this._speed;this._speed=t,this._resetStartTime(),(n=this._speedChangedEvent)==null||n.emit(this._speed,s)}}_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 H),this._playingChangedEvent}get playing(){return!!this._cancelStartUpdateFunc}set playing(t){!!this._cancelStartUpdateFunc!==t&&(t?this._startPlaying():this._stopPlaying())}}class Oo extends st{constructor(t){super();p(this,"_stop",this.disposeVar(it(0)));p(this,"_current",this.disposeVar(it(0)));p(this,"_start",this.disposeVar(it(0)));p(this,"_player",this.disposeVar(new il(200)));this.dispose(this._player.currentTimeChangedEvent.disposableOn(n=>{let s=n/this._player.duration;s=s>1?1:s<0?0:s;const o=this._start.value,h=this._stop.value;this._current.value=o+(h-o)*s})),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 Ip=-1;class ce extends H{constructor(e,t,n,s){super(),this._domElement=e,this._type=t,this.callback=s;const o=h=>(h.__xbsj_listenerNo__=++Ip,h.__xbsj_listenerTime__=Date.now(),h.__xbsj_lastCurrentTarget__=h.currentTarget,this.emit(h),this.callback&&this.callback(h));this._domElement.addEventListener(this._type,o,n),this.dispose(()=>this._domElement.removeEventListener(this._type,o,n))}static getLastLisenNo(){return Ip}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=ce.getLastLisenNo();return e.disposableOn(s=>{const o=ce.getListenerNo(s);(o===void 0||o>n)&&t(s)})}get element(){return this._domElement}static create(e,t,n){return new ce(e,t,n)}}class mc extends st{constructor(){super();p(this,"_clickEvent",this.disposeVar(new H));p(this,"_dbclickEvent",this.disposeVar(new H));p(this,"_pointerdownEvent",this.disposeVar(new H));p(this,"_pointerupEvent",this.disposeVar(new H));p(this,"_pointermoveEvent",this.disposeVar(new H));p(this,"_pointeroutEvent",this.disposeVar(new H));p(this,"dbClickDelayTime",300);p(this,"nativeClickDelayTime",500);p(this,"clickMovementTolerantPixelSize",3);p(this,"debugging",!1);p(this,"_enabled",this.disposeVar(it(!0)));const t=this.disposeVar(wi(async s=>{do{const o=await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v),d.disposer.dispose(ce.on(this._pointerdownEvent,f))})),h=$e(o);if(this.debugging&&console.log(`鼠标按下 ${h.toString()}`),!await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v);const m=setTimeout(()=>f(!0),this.nativeClickDelayTime);d.disposer.dispose(()=>clearTimeout(m)),d.disposer.dispose(ce.on(this._pointermoveEvent,y=>{const[w,S]=$e(y),[T,N]=h;(Math.abs(w-T)>3||Math.abs(S-N)>3)&&f(!1)})),d.disposer.dispose(ce.on(this._pointeroutEvent,()=>f(!1))),d.disposer.dispose(ce.on(this._pointerupEvent,()=>f(!0)))}))){this.debugging&&console.log("取消1");continue}const l=await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v);const m=setTimeout(()=>f("timeout"),this.dbClickDelayTime);d.disposer.dispose(()=>clearTimeout(m)),d.disposer.dispose(ce.on(this._pointermoveEvent,y=>{const[w,S]=$e(y),[T,N]=h;(Math.abs(w-T)>3||Math.abs(S-N)>3)&&f("moved")})),d.disposer.dispose(ce.on(this._pointerdownEvent,f)),d.disposer.dispose(ce.on(this._pointeroutEvent,()=>f("pointouted"))),d.disposer.dispose(ce.on(this._pointerupEvent,()=>f("pointuped")))}));if(typeof l=="string"){this.debugging&&console.log(`触发单击事件!取消双击监听!error: ${l}`),this._clickEvent.emit(o);continue}if(!await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v);const m=setTimeout(()=>f(!1),this.nativeClickDelayTime);d.disposer.dispose(()=>clearTimeout(m)),d.disposer.dispose(ce.on(this._pointermoveEvent,y=>{const[w,S]=$e(y),[T,N]=h;(Math.abs(w-T)>3||Math.abs(S-N)>3)&&f(!1)})),d.disposer.dispose(ce.on(this._pointeroutEvent,()=>f(!1))),d.disposer.dispose(ce.on(this._pointerupEvent,()=>f(!0)))}))){this.debugging&&console.log("取消2");continue}this.debugging&&console.log("触发双击事件!"),this._dbclickEvent.emit(l)}while(!0)})),n=s=>{s?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 Nw extends st{constructor(t,n){super();p(this,"_pointerClick",this.disposeVar(new mc));this._div=t;const{div:s,pointerClick:o}=this,h=v=>o.pointerDown(v),l=v=>o.pointerMove(v),d=v=>o.pointerOut(v),f=v=>o.pointerUp(v);s.addEventListener("pointerdown",h,n),s.addEventListener("pointermove",l,n),s.addEventListener("pointerout",d,n),s.addEventListener("pointerup",f,n),this.dispose(()=>{s.removeEventListener("pointerdown",h,n),s.removeEventListener("pointermove",l,n),s.removeEventListener("pointerout",d,n),s.removeEventListener("pointerup",f,n)})}get div(){return this._div}get pointerClick(){return this._pointerClick}get clickEvent(){return this.pointerClick.clickEvent}get dbclickEvent(){return this.pointerClick.dbclickEvent}}class Mp extends st{constructor(){super();p(this,"_hoverEvent",this.disposeVar(new H));p(this,"_hoverOutEvent",this.disposeVar(new H));p(this,"_pointerdownEvent",this.disposeVar(new H));p(this,"_pointerupEvent",this.disposeVar(new H));p(this,"_pointermoveEvent",this.disposeVar(new H));p(this,"_pointeroutEvent",this.disposeVar(new H));p(this,"delayTime",800);const t=this.disposeVar(Pp()),n=f=>{this._hoverOutEvent.emit()},s=f=>{this._hoverOutEvent.emit()};let o;const h=()=>{if(!o){console.warn("!lastPointerEvent");return}this._hoverEvent.emit(o)},l=f=>{o=f,t.restart(void 0,h,this.delayTime),this._hoverOutEvent.emit()},d=f=>{t.cancel(),this._hoverOutEvent.emit()};this.dispose(this._pointerdownEvent.disposableOn(n)),this.dispose(this._pointerupEvent.disposableOn(s)),this.dispose(this._pointermoveEvent.disposableOn(l)),this.dispose(this._pointeroutEvent.disposableOn(d))}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 Rw extends st{constructor(t,n=1500){super();p(this,"_hoverEvent",new H);p(this,"_hoverOutEvent",new H);const s=new ac(n);this.dispose(()=>s.destroy());let o=0,h=0,l;s.progressFunc=()=>this._hoverEvent.emit(o,h,l);const d=y=>{!s.isRunning&&s.restart(),l=y,[o,h]=$e(y),s.debounce(),this._hoverOutEvent.emit()},f=y=>{!s.isRunning&&s.restart(),l=y,[o,h]=$e(l),s.debounce(),this._hoverOutEvent.emit()},v=y=>{!s.isRunning&&s.restart(),l=y,[o,h]=$e(l),s.debounce(),this._hoverOutEvent.emit()},m=y=>{s.isRunning&&s.cancel(),this._hoverOutEvent.emit()};t.addEventListener("pointerdown",d),t.addEventListener("pointerup",f),t.addEventListener("pointermove",v),t.addEventListener("pointerout",m),this.dispose(()=>{t.removeEventListener("pointerdown",d),t.removeEventListener("pointerup",f),t.removeEventListener("pointermove",v),t.removeEventListener("pointerout",m)})}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}}class Tp extends st{constructor(t,n={}){super();p(this,"_needRedrawEvent");p(this,"_needPickRedrawEvent");p(this,"_id",Zr());p(this,"_clickEvent");p(this,"_clickOutEvent");p(this,"_dbclickEvent");p(this,"_dbclickOutEvent");p(this,"_actived",!1);p(this,"_activedChanged");p(this,"_hovered",!1);p(this,"_hoveredChanged");p(this,"_selected",!1);p(this,"_selectedChanged");p(this,"_opacity",1);p(this,"_opacityChanged");p(this,"_show",!0);p(this,"_showChanged");this._canvasPrimitivesContext=t;const{needRedraw:s=!0,needPickRedraw:o=!0}=n;s&&(this._needRedrawEvent=new H),o&&(this._needPickRedrawEvent=new H),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}set id(t){this._id=t}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 H,this._clickEvent}hasClickOutEvent(){return!!this._clickOutEvent}get clickOutEvent(){return this._clickOutEvent=this._clickOutEvent||new H,this._clickOutEvent}hasDbclickEvent(){return!!this._dbclickEvent}get dbclickEvent(){return this._dbclickEvent=this._dbclickEvent||new H,this._dbclickEvent}hasDbclickOutEvent(){return!!this._dbclickOutEvent}get dbclickOutEvent(){return this._dbclickOutEvent=this._dbclickOutEvent||new H,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 H,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 H,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 H,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 H,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 H,this._showChanged}}class vc extends Tp{constructor(t,n=[0,0],s=0){super(t);p(this,"_winPosAndDepthChanged");this._winPos=n,this._depth=s,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 H),this._winPosAndDepthChanged}}function Zs(i,e,t,n){const[s,o]=i,[h,l,d,f]=n,v=e[0]*t[0],m=e[1]*t[1],y=s-(v*h+d),w=o-(m*l+f);return{left:y,top:w,right:y+v,bottom:w+m}}function Qs(i,e,t,n,s){i.beginPath(),i.moveTo(e,t),i.lineTo(e-n*.5,t-n*.5),i.arc(e,t-n,n*.7071067811865475,Math.PI*.75,Math.PI*.25),i.lineTo(e,t),i.fillStyle=s,i.fill()}function Aw(i,e,t,n,s,o){if(i.beginPath(),i.moveTo(e+n,t),i.arc(e,t,n,0,2*Math.PI),o){const h=i.createRadialGradient(e,t,0,e,t,n);h.addColorStop(0,s),h.addColorStop(1,s.replace(/[\d\.]+\)$/,"0)")),i.fillStyle=h}else i.fillStyle=s;i.fill()}function kp(i,e,t,n,s,o){i.beginPath(),i.moveTo(e+o,t),i.lineTo(e+n-o,t),i.arcTo(e+n,t,e+n,t+o,o),i.lineTo(e+n,t+s-o),i.arcTo(e+n,t+s,e+n-o,t+s,o),i.lineTo(e+o,t+s),i.arcTo(e,t+s,e,t+s-o,o),i.lineTo(e,t+o),i.arcTo(e,t,e+o,t,o)}function Op(i,e,t,n,s,o){i.font=s;const h=i.measureText(n),l=h.actualBoundingBoxLeft+h.actualBoundingBoxRight,d=Number.isFinite(h.fontBoundingBoxAscent)?h.fontBoundingBoxAscent:h.actualBoundingBoxAscent,f=Number.isFinite(h.fontBoundingBoxDescent)?h.fontBoundingBoxDescent:h.actualBoundingBoxDescent;let v=d+f;i.fillStyle=o,i.fillText(n,e-l*.5,t+v*.5-f)}function Np(i){const{width:e,height:t}=i,n=e instanceof SVGAnimatedLength?e.baseVal.SVG_LENGTHTYPE_PX:e,s=t instanceof SVGAnimatedLength?t.baseVal.SVG_LENGTHTYPE_PX:t,o=document.createElement("canvas");o.width=n,o.height=s;const h=o.getContext("2d");if(!h)throw new Error("!cavnasCtx");return h.drawImage(i,0,0,n,s),o}function Rp(i,e){const{width:t,height:n}=i,s=i.getContext("2d");if(!s)throw new Error("!cavnasCtx");const[o,h,l]=e.map(m=>m*255|0),d=s.getImageData(0,0,t,n),f=d.data;for(var v=0;v<f.length;v+=4)f[v]=o,f[v+1]=h,f[v+2]=l;s.putImageData(d,0,0)}function yc(i,e,t,n=[.5,1,0,0],s,o="12px Arial",h=2,l="#FFF",d="#000A"){i.font=o;const f=i.measureText(s),v=f.actualBoundingBoxLeft+f.actualBoundingBoxRight,m=f.fontBoundingBoxAscent+f.fontBoundingBoxDescent,y=e,w=t,S=v+h*2,T=m+h*2,{left:N,top:j,bottom:C}=Zs([y,w],[S,T],[1,1],n);i.fillStyle=d,kp(i,N,j,S,T,h),i.fill(),i.fillStyle=l,i.fillText(s,N+h,C-h-f.fontBoundingBoxDescent)}function No(i){return("00"+i.toString(16).toUpperCase()).substr(-2)}function Ro(i){const[e,t,n,s]=i.map(o=>o*255|0);return`#${No(e)}${No(t)}${No(n)}${No(s)}`}function _c(i,e){const[t,n,s]=e,o=`${t}-${n}-${s}`;let h=_i(i,o);return h||(h=Np(i),Rp(h,e),yn(i,o,h)),h}class Dw extends vc{constructor(t,n,s=[32,32],o=[.5,1,0,0],h="#F00F"){super(t);p(this,"_tooltip","");p(this,"_title","");p(this,"__scale",[1,1]);p(this,"_tooltipAlpha",0);p(this,"_bgColor",[.3,.3,.3,.8]);p(this,"_bgColorHexStr",Ro(this._bgColor));p(this,"_fgColor",[1,1,1,1]);p(this,"_fgColorHexStr",Ro(this._fgColor));this._image=n,this._size=s,this._originRatioAndOffset=o,this._defaultColorStr=h;const l=new Oo(100),d=new Oo(100);this.dispose(()=>{l.destroy(),d.destroy()});const f=()=>{if(this._clickEvent&&!this._clickEvent.empty){const v=(1+.08*d.current)*(1+.08*l.current);this._scale=[v,v],this._tooltipAlpha=l.current}};this.dispose(this.activedChanged.disposableOn(v=>{d.target=v?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(v=>{l.target=v?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(()=>{this.needRedraw()})),this.dispose(d.currentChanged.disposableOn(f)),this.dispose(l.currentChanged.disposableOn(f))}set size(t){const[n,s]=t,[o,h]=this._size;(o!==n||h!==s)&&(this._size[0]=n,this._size[1]=s,this.needRedraw(),this.needPickRedraw())}get size(){return this._size}set _scale(t){const[n,s]=t,[o,h]=this.__scale;(o!==n||h!==s)&&(this.__scale[0]=n,this.__scale[1]=s,this.needRedraw(),this.needPickRedraw())}get _scale(){return this.__scale}set fgColor(t){if(!this._fgColor.every((n,s)=>t[s]===n)){const[n,s,o,h]=t;this._fgColor.splice(0,4,n,s,o,h),this._fgColorHexStr=Ro(this._fgColor),this.needRedraw()}}get fgColor(){return this._fgColor}set bgColor(t){if(!this._bgColor.every((n,s)=>t[s]===n)){const[n,s,o,h]=t;this._bgColor.splice(0,4,n,s,o,h),this._bgColorHexStr=Ro(this._bgColor),this.needRedraw()}}get bgColor(){return this._bgColor}set originRatioAndOffset(t){const[n,s,o,h]=this._originRatioAndOffset,[l,d,f,v]=t;(n!==l||s!==d||o!==f||h!==v)&&(this._originRatioAndOffset.splice(0,4,l,d,f,v),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,s]=this._winPos,o=this._size[0]*this.__scale[0],h=this._size[1]*this.__scale[1],{left:l,top:d}=Zs([n,s],this._size,this.__scale,this._originRatioAndOffset),f=t.globalAlpha;if(t.globalAlpha=this.opacity,this._image){if(this.selected){const v=_c(this._image,[1,0,0]),{left:m,top:y}=Zs([n,s+3],[o+6,h+6],[1,1],this._originRatioAndOffset);t.drawImage(v,m,y,o+6,h+6)}if(this.actived){const[v,m,y,w]=this._fgColor,S=_c(this._image,[v,m,y]),{left:T,top:N}=Zs([n,s+4],[o+8,h+8],[1,1],this._originRatioAndOffset);t.drawImage(S,T,N,o+8,h+8)}if(this.hovered){const[v,m,y,w]=this._bgColor,S=_c(this._image,[v,m,y]),{left:T,top:N}=Zs([n,s+2],[o+4,h+4],[1,1],this._originRatioAndOffset);t.drawImage(S,T,N,o+4,h+4)}t.drawImage(this._image,l,d,o,h)}else t.fillStyle=this._fgColorHexStr,t.fillRect(l,d,o,h);if(this._title!==""&&yc(t,n+20,s-16,[0,.5,0,0],this._title,"14px Arial",4,this._fgColorHexStr,this._bgColorHexStr),t.globalAlpha=f,this._hovered&&this._tooltip!==""){const v=t.globalAlpha;t.globalAlpha=this._tooltipAlpha,yc(t,n,s-42,[.5,1,0,0],this._tooltip,"12px Arial",4,this._fgColorHexStr,this._bgColorHexStr),t.globalAlpha=v}}drawForPick(t,n){if(!this._show)return;const[s,o]=this._winPos,h=n("default"),l=this._size[0]*this.__scale[0],d=this._size[1]*this.__scale[1],{left:f,top:v}=Zs([s,o],this._size,this.__scale,this._originRatioAndOffset);t.fillStyle=h,t.fillRect(f,v,l,d)}}class Lw extends vc{constructor(t){super(t);p(this,"_width",16);p(this,"_text","");p(this,"_fillStyle","#0F0");p(this,"_scale",1);p(this,"_scaleChanged");this.dispose(this.scaleChanged.disposableOn(h=>{this.needRedraw(),this.needPickRedraw()}));const n=this.disposeVar(new Oo(100)),s=this.disposeVar(new Oo(100)),o=()=>{this._clickEvent&&!this._clickEvent.empty&&(this.scale=(1+.1*s.current)*(1+.2*n.current))};this.dispose(s.currentChanged.disposableOn(o)),this.dispose(n.currentChanged.disposableOn(o)),this.dispose(this.activedChanged.disposableOn(h=>{s.target=h?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(h=>{n.target=h?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(h=>{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 H),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,s]=this._winPos,o=t.globalAlpha;t.globalAlpha=this.opacity;const h=this._width*this._scale;this.selected&&Qs(t,n,s+3,h+3,"#F00"),this.actived&&this._clickEvent&&!this._clickEvent.empty&&Qs(t,n,s+5,h+5,"#FFF"),this.hovered?Qs(t,n,s+3,h+3,"#000A"):Qs(t,n,s+1,h+1,"#000A"),Qs(t,n,s,h,this._fillStyle);const l=this._scale>1.2?"bold 14px Arial":"bold 10px Arial";Op(t,n,s-h,this._text,l,"#000"),t.globalAlpha=o}drawForPick(t,n){if(!this._show)return;const[s,o]=this._winPos,h=this._width*this._scale,l=n("default");Qs(t,s,o,h,l)}}const Ap=new ArrayBuffer(4),Dp=new Uint32Array(Ap),tr=new Uint8Array(Ap);function Lp(i){if(i>=16777215)throw new Error("uint32 > 0xFFFFFF");return Dp[0]=i,[tr[0],tr[1],tr[2]]}function Fp(i,e,t){return tr[0]=i,tr[1]=e,tr[2]=t,tr[3]=0,Dp[0]}class Gp extends st{constructor(){super(...arguments);p(this,"_pickColors",new Array(16777215));p(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 s=this._pickColorIndex;++this._pickColorIndex;const o=this._pickColors[s];o?(o.poi=t,o.tag=n):this._pickColors[s]={poi:t,tag:n};const[h,l,d]=Lp(s);return[h,l,d]}getPickInfoFromColor(t,n,s){const o=Fp(t,n,s);if(o>=this._pickColorIndex){console.error("index >= this._pickColorIndex");return}const h=this._pickColors[o];if(!h){console.error("!this._pickColors[index]");return}return h}destroyImp(){this.reset()}}const jp=(i,e)=>e.depth-i.depth;class Fw extends st{constructor(){super();p(this,"_pois",[]);p(this,"_canvasElement");p(this,"_ctx");p(this,"_offscreenCanvasElement");p(this,"_offscreenCanvasElement2");p(this,"_offscreenCtx");p(this,"_offscreenCtx2");p(this,"_size",[0,0]);p(this,"_needRedraw",!1);p(this,"_needPickRedraw",!1);p(this,"_pickColorManager",new Gp);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(sa(()=>{const[o,h]=this._size,{clientWidth:l,clientHeight:d}=this._canvasElement;(o!==l||h!==d)&&(this._size[0]=l,this._size[1]=d,this._canvasElement.width=l,this._canvasElement.height=d,this._offscreenCanvasElement.width=l,this._offscreenCanvasElement.height=d,this._offscreenCanvasElement2.width=l,this._offscreenCanvasElement2.height=d,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 _i(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 o=n.on(()=>{this._needRedraw=!0});yn(t,"needRedrawEventHandler",o)}const s=t._needPickRedrawEvent;if(s){const o=s.on(()=>{this._needPickRedraw=!0});yn(t,"needPickRedrawEventHandler",o)}}removePoi(t){const n=this._pois.indexOf(t);if(n===-1){console.error("删除一个不存在的poi!");return}this._pois.splice(n,1),this._dirty();const s=t._needRedrawEvent;if(s){const h=_i(t,"needRedrawEventHandler");h?s.off(h):console.error("poi没有listenHandler!")}const o=t._needPickRedrawEvent;if(o){const h=_i(t,"needPickRedrawEventHandler");h?o.off(h):console.error("poi没有listenHandler!")}}_draw(){this._pois.sort(jp);const[t,n]=this._size;this._ctx.clearRect(0,0,t,n),this._pois.forEach(s=>s.draw(this._ctx))}pick(t,n,s,o){return this._needPickRedraw&&(this._needPickRedraw=!1,this._pickDraw()),this._getPickInfo(t,n,s,o)}_pickDraw(){this._pickColorManager.reset(),this._pois.sort(jp);const[t,n]=this._size;this._offscreenCtx.clearRect(0,0,t,n),this._pois.forEach(s=>{const o=h=>{const[l,d,f]=this._pickColorManager.createPickColor(s,h);return`rgb(${l}, ${d}, ${f})`};s.drawForPick(this._offscreenCtx,o)})}_getPickInfo(t,n,s,o){const h=this._offscreenCtx.getImageData(t,n,s,o),l=[],d=h.data.length/4;for(let f=0;f<d;++f){const v=h.data[f*4+0],m=h.data[f*4+1],y=h.data[f*4+2];if(h.data[f*4+3]===255){const S=this._pickColorManager.getPickInfoFromColor(v,m,y);if(S&&S.poi&&!l.includes(S)){let T=!0;{const[N,j]=this._size;this._offscreenCtx2.clearRect(0,0,N,j);const C=V=>"rgb(255, 255, 255)";S.poi.drawForPick(this._offscreenCtx2,C);const k=this._offscreenCtx2.getImageData(t,n,s,o),M=k.data[f*4+0],D=k.data[f*4+1],L=k.data[f*4+2];k.data[f*4+3],M===255&&D===255&&L===255||(T=!1)}T&&l.push(S)}}}return l}}class wc extends st{constructor(){super(...arguments);p(this,"_closeEvent");p(this,"_show",!0);p(this,"_showChanged");p(this,"_opacity",1);p(this,"_opacityChanged");p(this,"_winPos",[0,0]);p(this,"_winPosChanged")}set winPos(t){const[n,s]=t,[o,h]=this._winPos;(n!==o||s!==h)&&(this._winPos[0]=n,this._winPos[1]=s,this._winPosChanged&&this._winPosChanged.emit(this._winPos))}get winPos(){return this._winPos}get winPosChanged(){return this._winPosChanged=this._winPosChanged||new H,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 H,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 H,this._showChanged}get closeEvent(){return this._closeEvent||(this._closeEvent=new H),this._closeEvent}}const Ec=new WeakMap;function Sc(i){if(!Ec.has(i)){const e=new Vh(()=>new i,t=>t.reset());Ec.set(i,e)}return Ec.get(i)}class xc extends wc{constructor(){super();p(this,"_div");p(this,"_contentDiv");p(this,"_originOffsetX",0);p(this,"_originOffsetY",0);p(this,"_originRatioX",.5);p(this,"_originRatioY",1);p(this,"_divChanged",new H);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 s=document.createElement("div");this._contentDiv=s,n.appendChild(s),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(([o,h])=>{this._div.style.left=`${o}px`,this._div.style.top=`${h}px`})),this.dispose(this.opacityChanged.disposableOn(o=>{this._div.style.opacity=`${o}`})),this.dispose(this.showChanged.disposableOn(o=>{this._div.style.visibility=o?"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 Bp extends st{constructor(t,n){super();p(this,"_floatDiv");p(this,"_show",!1);p(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=Sc(this._customDivClass).create();this.dispose(()=>{Sc(this._customDivClass).destroy(t)}),this._floatDiv=t}return this._floatDiv}get showChanged(){return this._showChanged||(this._showChanged=new H),this._showChanged}}const Gw=["top","bottom","left","right"];function jw(i){return Object.entries(i).map(([e,t])=>Gw.includes(e)?`${e}: ${t}px; `:"").join("")}function zp(i,e,t){const n=document.createElement("div");n.style.cssText=`position: absolute; ${jw(t)} background-color: ${i}; border-radius: ${e}px;`;const s='<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=s,n}function Up(i,e,t="rgba(0,0,0,0.7)"){const n=document.createElement("div");n.style.cssText=`margin: 0 auto; width: ${i}px; height: ${e}px; position: relative; pointer-events: none;`;const s=document.createElement("div");return s.style.cssText=`position: absolute; left: 0px; top: 0px; width: 0; height: 0; border-left: ${i*.5}px solid transparent; border-right: ${i*.5}px solid transparent; border-top: ${e}px solid ${t};`,n.appendChild(s),[n,s]}class Vp extends xc{constructor(){super();p(this,"_borderDiv");p(this,"_closeDiv");p(this,"_innerContentDiv");p(this,"_colorStr","rgba(0, 0, 0, 0.7)");p(this,"_divColorChanged",new H);p(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=zp(this._colorStr,10,{top:3,right:3}),[s,o]=Up(2*this._borderRadius,2*this._borderRadius,this._colorStr),h=document.createElement("div");this._innerContentDiv=h,t.appendChild(h),t.appendChild(n),this.contentDiv.appendChild(t),this.contentDiv.appendChild(s),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(()=>{o.style.borderTopColor=this._colorStr,t.style.backgroundColor=this._colorStr,s.style.width=`${this._borderRadius*2}px`,s.style.height=`${this._borderRadius*2}px`,o.style.borderLeft=`${this._borderRadius}px`,o.style.borderRight=`${this._borderRadius}px`,o.style.borderTop=`${this._borderRadius*2}px`}));const l=d=>{d.key==="Escape"&&this._closeEvent&&this._closeEvent.emit()};document.body.addEventListener("keydown",l,!0),this.dispose(()=>{document.removeEventListener("keydown",l,!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 Bw extends Vp{constructor(){super();p(this,"_iframe");p(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=s=>{s.source===this._iframe.contentWindow&&(this._iframeMessageEvent?this._iframeMessageEvent.emit(s):console.warn(`iframe消息接收到未处理!data: ${s.data}`))};window.addEventListener("message",n),this.dispose(()=>{window.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 H,this._iframeMessageEvent}}class zw extends wc{constructor(){super();p(this,"_div");p(this,"_contentContainer");p(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 s=document.createElement("div");s.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;",s.innerText=this._text,this._div.appendChild(n),n.appendChild(s),this._contentContainer=s,this._div=t,this.dispose(this.winPosChanged.disposableOn(([o,h])=>{this._div.style.left=`${o}px`,this._div.style.top=`${h-50}px`})),this.dispose(this.opacityChanged.disposableOn(o=>{this._div.style.opacity=`${o}`})),this.dispose(this.showChanged.disposableOn(o=>{this._div.style.visibility=o?"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 Uw extends xc{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 Vw extends st{constructor(t,n){super();p(this,"_cursorDiv");p(this,"_pointerOut",this.disposeVar(it(!1)));p(this,"_show",this.disposeVar(it(!0)));this._cursorDiv=new Bp(n,t),this.dispose(()=>this._cursorDiv.destroy());const s=h=>{const[l,d]=$e(h);this._cursorDiv.floatDiv.winPos=[l,d]};t.addEventListener("pointermove",s),this.dispose(()=>t.removeEventListener("pointermove",s));const o=()=>{this._cursorDiv.show=this.show&&this._pointerOut.value};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this._pointerOut.changed.disposableOn(o))}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 Ao(i,e,t){if(!(i.tree===e.tree&&i!==e&&!i.isAncestorOf(e))||i.tree!==e.tree||!i.parent)return!1;if(!i.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");return!(e===i||i.isAncestorOf(e)||t!=="inner"&&!e.parent||t==="inner"&&!e.children)}function nl(i,e,t){if(!i.tree||!e.tree||i.tree!==e.tree)return;if(!i.parent){console.warn("当前节点没有父节点,那么该节点无法被移动!");return}if(!i.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");if(e===i){console.warn("自身不能拖放到自身!");return}if(i.isAncestorOf(e)){console.warn("当前节点不能拖放到它自身的后代节点之上!");return}if(t!=="inner"&&!e.parent){console.warn("目标节点没有父节点,无法拖放!");return}if(t==="inner"&&!e.children){console.warn("无法移动到目标节点的子节点中,因为目标节点不是组节点!");return}i.tree._startTransaction();const n=i.parent.children.indexOf(i);if(i.parent.children.splice(n,1),t!=="inner"){const{parent:s}=e;if(!s||!s.children)throw new Error("!parent");const o=s.children.indexOf(e);t==="before"?s.children.splice(o,0,i):t==="after"&&s.children.splice(o+1,0,i)}else e.children.push(i);i.tree._stopTransaction()}function qp(i,e,t){return tc(i,n=>Ao(n,e,t))}function $p(i,e,t){for(let n of i)Ao(n,e,t)?nl(n,e,t):console.warn(`treeItem(id: ${n.id}) cannot move...`)}const qw={checked:1,unchecked:2,indeterminate:3},$w=["checked","unchecked","indeterminate"];class Wp extends st{constructor(t){super();p(this,"_collapsed",this.disposeVar(it(!1)));p(this,"_checkedStatus",this.disposeVar(it("unchecked")));p(this,"_selected",this.disposeVar(it(!1)));p(this,"_moveToPositionMode",this.disposeVar(it("none")));p(this,"_updateCheckedStatusFromChildrenEvent",this.disposeVar(new H));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 s=this.disposeVar(we(this._updateCheckedStatusFromChildrenEvent));this.dispose(s.disposableOn(()=>{if(!this._treeItem.children)return;let o=0;Qu(this._treeItem.children,h=>(o|=qw[h.uiTreeObject.checkedStatus],o===3)),o>0&&(this._checkedStatus.value=$w[o-1])})),this.dispose(this._treeItem.childrenResetedEvent.disposableOn(o=>{!o&&this.checkedStatus==="indeterminate"&&(this._checkedStatus.value="unchecked")}));{const o=(h,l,d=!0)=>{if(l)h.selectedItems.push(this._treeItem);else{const f=h.selectedItems.indexOf(this._treeItem);f===-1?d&&console.error("selectedItems index -1"):h.selectedItems.splice(f,1)}};this.dispose(this._selected.changed.disposableOn(h=>{const{tree:l}=this._treeItem;l&&o(l,h)})),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 s of this._treeItem.children)s.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 hn=class hn extends st{constructor(t,n=!1,s){super();p(this,"_children");p(this,"_childrenResetedEvent");p(this,"_childrenToChangeEvent");p(this,"_childrenChangedEvent");p(this,"_parent",this.disposeVar(it(void 0)));p(this,"_level",this.disposeVar(it(0)));p(this,"_id");p(this,"_uiTreeObject",this.disposeVar(new Wp(this)));this._tree=t,this._hasChildren=n,this._id=s??Zr(),this._id!=="_ROOT"&&hn.wm.has(this._id)&&console.warn(`创建了id(${this._id})相同的树节点,会导致之前的树节点无法索引!`),hn.wm.set(this._id,this),this.dispose(()=>{if(this._id!=="_ROOT"&&!hn.wm.has(this._id)){console.warn(`树节点(${this._id})不在wm树上!`);return}hn.wm.delete(this._id)}),this.dispose(this._parent.changed.disposableOn(()=>{this._updateLevel()})),this.dispose(this._level.changed.disposableOn(()=>{if(this.children)for(let o of this.children)o._updateLevel()})),hn.allTreeItems.set(this._id,this),this.dispose(()=>{hn.allTreeItems.delete(this._id)})}static getFromId(t){return hn.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 Io);this._children=t,this.dispose(t.toChangeEvent.disposableOn((o,h)=>{for(let l of o){const{start:d,deleteCount:f,items:v}=l;for(let m=d;m<d+f;++m)h.get(m)._parent.value=void 0;for(let m of v){if(m.parent)throw console.error("请检查新增的treeItem是否正在使用!"),new Error("item.parent should not exist!");m._parent.value=this}}}));const n=new Set,s=new Set;this.dispose(t.toChangeEvent.disposableOn((o,h)=>{var l;if(this.tree){n.clear(),s.clear();for(let d of o){const{start:f,deleteCount:v,items:m}=d;for(let y=f;y<f+v;++y)n.add(h.get(y));for(let y of m)s.add(y)}for(let d of n)s.has(d)&&(n.delete(d),s.delete(d));(l=this.tree)==null||l.itemChildrenToChange.emit(this,o,n,s)}})),this.dispose(t.changedEvent.disposableOn(()=>{var o;(o=this.tree)==null||o.itemChildrenChanged.emit(this)})),this.dispose(t.toChangeEvent.disposableOn((...o)=>this._childrenToChangeEvent&&this._childrenToChangeEvent.emit(...o))),this.dispose(t.changedEvent.disposableOn((...o)=>this._childrenChangedEvent&&this._childrenChangedEvent.emit(...o)))}return this._children}else return}get childrenResetedEvent(){return this._childrenResetedEvent||(this._childrenResetedEvent=new H),this._childrenResetedEvent}get childrenToChangeEvent(){return this._childrenToChangeEvent||(this._childrenToChangeEvent=new H),this._childrenToChangeEvent}get childrenChangedEvent(){return this._childrenChangedEvent||(this._childrenChangedEvent=new H),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,s=[],o=[];for(n.children&&n.children.length>0&&(!t||t(n))&&(s.push(0),o.push(n.children));s.length>0;){const h=s[s.length-1],l=o[o.length-1],d=l.get(h);yield d,h<l.length-1?++s[s.length-1]:(o.pop(),s.pop()),d.children&&d.children.length>0&&(!t||t(d))&&(s.push(0),o.push(d.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 Ao(this,t,n)}moveTo(t,n){nl(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 s=this.parent;if(!s||!s.children)return!1;const o=s.children.indexOf(this);return t.endsWith("Before")?n&&s.children.splice(o,0,n):t.endsWith("After")&&n&&s.children.splice(o+1,0,n),!0}};p(hn,"wm",new Map),p(hn,"allTreeItems",new Map);let Do=hn;class Hp extends st{constructor(t){super();p(this,"_redrawEvent",this.disposeVar(new H));p(this,"_containerScrollTop",this.disposeVar(it(0)));p(this,"_containerClientHeight",this.disposeVar(it(-1)));p(this,"_filterFunc",this.disposeVar(it(void 0)));p(this,"_container",this.disposeVar(it(void 0)));p(this,"_redrawInfo",{topFreeSpaceHeight:0,topUnvisibleItemNum:0,middleTreeItems:[],bottomFreeSpaceHeight:0,bottomUnvisibleItemNum:0});this._tree=t;const n=this._containerClientHeight,s=this._containerScrollTop,o=this._tree._forceRedrawEvent,h=this.disposeVar(we(this._tree.itemDivHeightChanged,this._tree.itemChildrenChanged,this._tree.itemsChanged,n.changed,s.changed,o,this._filterFunc.changed)),{redrawInfo:l}=this;this.dispose(h.disposableOn(()=>{const f=this._createTraverseFunc();if(l.topFreeSpaceHeight=0,l.topUnvisibleItemNum=0,l.middleTreeItems.length=0,l.bottomFreeSpaceHeight=0,l.bottomUnvisibleItemNum=0,this._containerClientHeight.value>=0){const v=ec(this._tree.getDescendants(f)),m=this._tree.itemDivHeight,y=m*v,w=Jn([_s([Jn([y-n.value,0]),s.value]),0]),S=w/m|0,T=Math.ceil((w-S*m+n.value)/m)|0;S>0&&(l.topUnvisibleItemNum=S,l.topFreeSpaceHeight=S*this._tree.itemDivHeight);const N=S+T;let j=0;for(let k of this._tree.getDescendants(f)){if(j>=N)break;j>=S&&l.middleTreeItems.push(k),++j}const C=v-S-T;C>0&&(l.bottomUnvisibleItemNum=C,l.bottomFreeSpaceHeight=C*this._tree.itemDivHeight)}else for(let v of this._tree.getDescendants(f))l.middleTreeItems.push(v);this._redrawEvent.emit(l)}));let d;this.dispose(()=>d&&(d.destroy(),d=void 0)),this.dispose(this.containerChanged.disposableOn(f=>{d&&(d.destroy(),d=void 0),f&&(d=To(),d.start(()=>{const{scrollTop:v,clientHeight:m}=f;typeof v>"u"||typeof m>"u"?Jr("createUiTreeWithContainer error: conainter has no scrollTop or clientHeight property!"):(this.containerScrollTop=v,this.containerClientHeight=m)}))}))}get filterFunc(){return this._filterFunc.value}set filterFunc(t){this._filterFunc.value=t}get filterFuncChanged(){return this._filterFunc.changed}get container(){return this._container.value}set container(t){this._container.value=t}get containerChanged(){return this._container.changed}get redrawInfo(){return this._redrawInfo}_createTraverseFunc(){const t=this._filterFunc.value;if(!t)return o=>{const h=o.uiTreeObject;return!!o.children&&(!h||!h.collapsed)};const n=new Set,s=o=>{let h=!1;if(o.children)for(let d of o.children)s(d)&&(h=!0);const l=!!t(o)||h;return l&&h&&n.add(o),l};return s(this._tree.root),o=>!!o.children&&n.has(o)}getTreeItemPos(t){const n=this._createTraverseFunc();let s=0,o=!1;for(let h of this._tree.getDescendants(n)){if(h===t){o=!0;break}++s}if(o)return[s,s*this._tree.itemDivHeight]}collapseAll(){console.log("collapseAll");for(let t of this.tree.root.getDescendants()){const n=t.uiTreeObject;n.collapsed=!0}}expandAll(){console.log("expandAll");for(let t of this.tree.root.getDescendants()){const n=t.uiTreeObject;n.collapsed=!1}}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)}getAllCheckedItems(){return this.getAllItems(t=>t.uiTreeObject.checkedStatus==="checked")}getAllCheckedLeafItems(){return this.getAllItems(t=>!t.children&&t.uiTreeObject.checkedStatus==="checked")}selectAllItems(t){for(let n of this.getAllItems())(!t||!t.includes(n))&&(n.uiTreeObject.selected=!0)}clearAllSelectedItems(t){for(let n of this.getAllSelectedItems())(!t||!t.includes(n))&&(n.uiTreeObject.selected=!1)}checkAllItems(t){for(let n of this.getAllItems())(!t||!t.includes(n))&&n.uiTreeObject.check(!0)}clearAllCheckedItems(t){for(let n of this.getAllCheckedItems())(!t||!t.includes(n))&&n.uiTreeObject.check(!1)}}const As=class As extends st{constructor(t){super();p(this,"_root",this.disposeVar(new Do(this,!0,"_ROOT")));p(this,"_itemChildrenChanged",this.disposeVar(new H));p(this,"_itemChildrenToChange",this.disposeVar(new H));p(this,"_itemsAdded",this.disposeVar(new H));p(this,"_itemsDeleted",this.disposeVar(new H));p(this,"_itemsChanged",this.disposeVar(new H));p(this,"_transactionStack",0);p(this,"_addedItems",new Set);p(this,"_deletedItems",new Set);p(this,"_selectedItems",this.disposeVar(new Io));p(this,"_itemDivHeight",this.disposeVar(it(As.defaultItemDivHeight)));p(this,"_forceRedrawEvent",this.disposeVar(new H));p(this,"_uiTree",this.disposeVar(new Hp(this)));this._root._tree.value=this,this.dispose(this._itemChildrenToChange.disposableOn((n,s)=>{if(!n.children){console.error("!item.children");return}for(let o of s){const{start:h,deleteCount:l,items:d}=o;for(let f=h;f<h+l;++f){const v=n.children.get(f);this._deletedItems.has(v)?console.error(`this._deletedItems.has(currentItem(${v.id}))`):this._deletedItems.add(v)}for(let f of d)this._deletedItems.has(f)?this._deletedItems.delete(f):this._addedItems.add(f)}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 s of this.getDescendants())if(s.id===t){n=s;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}};p(As,"defaultItemDivHeight",24),p(As,"canMoveToTreeItem",Ao),p(As,"moveToTreeItem",nl),p(As,"canMoveToTreeItems",qp),p(As,"moveToTreeItems",$p);let er=As;class xe extends st{constructor(t,n,s=!0,o){super();p(this,"_obj",this.disposeVar(it(void 0)));this._resetEvent=t,this._createFunc=n;const h=this._resetEvent,l=this._createFunc,d=()=>{this._obj.value&&(this._obj.value.destroy(),this._obj.value=void 0)};this.dispose(d);const f=(...v)=>{d(),this._obj.value=l(...v)};s&&(o?this._obj.value=l(...o):this._obj.value=l()),this.dispose(h.disposableOn(f))}get obj(){return this._obj.value}get objChanged(){return this._obj.changed}}class Ww extends st{constructor(t,n=!0,s){super();p(this,"_event",this.disposeVar(new H));p(this,"_objResettingWithEvent");this._createFunc=t,this._execOnInit=n,this._initParams=s,this._objResettingWithEvent=this.disposeVar(new xe(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 Iu=class Iu extends st{constructor(){super();p(this,"_set",new Set);p(this,"_toChangeEvent",this.dv(new H));p(this,"_changedEvent",this.dv(new H));p(this,"main");this.dispose(()=>{this._set.size!==0&&(Iu.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()}};p(Iu,"warnOnDestroying",!0);let sl=Iu;async function Xp(i){const e=[],t=[],n=i.entries();for await(const[s,o]of n){const h=o;h.kind==="file"?e.push(s):h.kind==="directory"&&t.push(s)}return{files:e,dirs:t}}async function bc(i){return await(await i.getFile()).text()}async function Yp(i){const e=await bc(i);try{return JSON.parse(e)}catch{return}}async function Jp(i){return await(await i.getFile()).arrayBuffer()}class Kp extends st{constructor(e){super(),this._rootDirHandle=e}get rootDirHandle(){return this._rootDirHandle}async getSubFilesAndDirs(){return await Xp(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(s){console.error(`未能获取当前文件 ${e.join("/")}/${t} error: ${s}`,s);return}}}class Zp extends st{constructor(t){super();p(this,"_startRootDirId",0);p(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 window.showDirectoryPicker({id:t,mode:"read"}),console.log("window.showDirectoryPicker end",n)}catch(s){console.error(`LocalFileServer getRootDirId failed: ${s}`,s);return}if(n){const s=++this._startRootDirId,o=`${this._prefix}${s}`;return this._dirMap.set(o,new Kp(n)),o}}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 s=n[0],o=this._dirMap.get(s);if(!o){console.warn(`LocalFileServer getFile failed: ${t}`);return}const h=n.slice(1,n.length-1),l=n[n.length-1],d=await o.getFile(h,l);if(!d){console.warn(`LocalFileServer getFile failed: ${t}`);return}return d}async getText(t){const n=await this.getFile(t);if(n)return await bc(n)}async getArrayBuffer(t){const n=await this.getFile(t);if(n)return await Jp(n)}async getJson(t){const n=await this.getFile(t);if(n)return await Yp(n)}async getLocalFilePath(t,n,s){const o=await this.getRootDirId(n);if(!o){console.warn("getRootDirId error!");return}const h=this.getRootDir(o);if(!h){console.warn("getRootDir error!");return}const l=await h.getSubFilesAndDirs();if(!l.files){console.warn("getSubFilesAndDirs error! 找不到符合要求的文件!");return}const d=t?l.files.filter(f=>t.some(v=>f.endsWith(v))):l.files;if(d.length===0){console.warn("找不到符合要求的文件!");return}return`https://${o}/${d[0]}`}}const Qp=new Zp("xe2_local");async function Hw(i,e,t){return await Qp.getLocalFilePath(i,e,t)}class tm extends st{constructor(t,n){super();p(this,"_processing");this._complexImage=t,this._imageUri=n,this._processing=this.disposeVar(wi(async s=>{const o=this._complexImage,h=await s.promise(mp(this._imageUri,this._complexImage.crossOrigin));h&&h instanceof HTMLImageElement&&(o.size=[h.naturalWidth,h.naturalHeight],o.pixelFormat="RGBA",o.copyTexture({source:h}))})),this._processing.start()}get processing(){return this._processing}}const em=["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"],im=["img","gif","video","flv","hls"];let Xw=class extends st{constructor(t,n){super();p(this,"_element");this._complexImage=t,this._videoSrc=n;var s=document.createElement("video");s.src=this._videoSrc,s.style.position="absolute",s.style.top="0px",s.style.left="0px",s.style.zIndex="-100",s.style.visibility="hidden",s.style.width="0px",s.style.height="0px";{const o=()=>{s.crossOrigin=this._complexImage.crossOrigin};o(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(o))}{const o=()=>{s.autoplay=this._complexImage.autoplay};o(),this.dispose(this._complexImage.autoplayChanged.disposableOn(o))}{const o=()=>{s.loop=this._complexImage.loop};o(),this.dispose(this._complexImage.loopChanged.disposableOn(o))}s.muted=!0,document.body.appendChild(s),this._element=s,this.dispose(()=>document.body.removeChild(s))}get element(){return this._element}};class nm extends st{constructor(t,n){super();p(this,"_videoDom");p(this,"_update");this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new Xw(this._complexImage,this._imageUri)),this._update=this.disposeVar(sa(()=>this.update())),this._update.start()}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:s}=this.videoElement;t.size=[n,s],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}function Pc(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Yw(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.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(i).forEach(function(n){var s=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return i[n]}})}),t}var Cc={},Kn={},sm;function rm(){if(sm)return Kn;sm=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.loop=Kn.conditional=Kn.parse=void 0;var i=function n(s,o){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:h;if(Array.isArray(o))o.forEach(function(f){return n(s,f,h,l)});else if(typeof o=="function")o(s,h,l,n);else{var d=Object.keys(o)[0];Array.isArray(o[d])?(l[d]={},n(s,o[d],h,l[d])):l[d]=o[d](s,h,l,n)}return h};Kn.parse=i;var e=function(s,o){return function(h,l,d,f){o(h,l,d)&&f(h,s,l,d)}};Kn.conditional=e;var t=function(s,o){return function(h,l,d,f){for(var v=[],m=h.pos;o(h,l,d);){var y={};if(f(h,s,l,y),h.pos===m)break;m=h.pos,v.push(y)}return v}};return Kn.loop=t,Kn}var be={},am;function om(){if(am)return be;am=1,Object.defineProperty(be,"__esModule",{value:!0}),be.readBits=be.readArray=be.readUnsigned=be.readString=be.peekBytes=be.readBytes=be.peekByte=be.readByte=be.buildStream=void 0;var i=function(m){return{data:m,pos:0}};be.buildStream=i;var e=function(){return function(m){return m.data[m.pos++]}};be.readByte=e;var t=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(y){return y.data[y.pos+m]}};be.peekByte=t;var n=function(m){return function(y){return y.data.subarray(y.pos,y.pos+=m)}};be.readBytes=n;var s=function(m){return function(y){return y.data.subarray(y.pos,y.pos+m)}};be.peekBytes=s;var o=function(m){return function(y){return Array.from(n(m)(y)).map(function(w){return String.fromCharCode(w)}).join("")}};be.readString=o;var h=function(m){return function(y){var w=n(2)(y);return m?(w[1]<<8)+w[0]:(w[0]<<8)+w[1]}};be.readUnsigned=h;var l=function(m,y){return function(w,S,T){for(var N=typeof y=="function"?y(w,S,T):y,j=n(m),C=new Array(N),k=0;k<N;k++)C[k]=j(w);return C}};be.readArray=l;var d=function(m,y,w){for(var S=0,T=0;T<w;T++)S+=m[y+T]&&Math.pow(2,w-T-1);return S},f=function(m){return function(y){for(var w=e()(y),S=new Array(8),T=0;T<8;T++)S[7-T]=!!(w&1<<T);return Object.keys(m).reduce(function(N,j){var C=m[j];return C.length?N[j]=d(S,C.index,C.length):N[j]=S[C.index],N},{})}};return be.readBits=f,be}var hm;function Jw(){return hm||(hm=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var e=rm(),t=om(),n={blocks:function(y){for(var w=0,S=[],T=y.data.length,N=0,j=(0,t.readByte)()(y);j!==w&&j;j=(0,t.readByte)()(y)){if(y.pos+j>=T){var C=T-y.pos;S.push((0,t.readBytes)(C)(y)),N+=C;break}S.push((0,t.readBytes)(j)(y)),N+=j}for(var k=new Uint8Array(N),M=0,D=0;D<S.length;D++)k.set(S[D],M),M+=S[D].length;return k}},s=(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(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===249}),o=(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(m,y,w){return Math.pow(2,w.descriptor.lct.size+1)})},function(m,y,w){return w.descriptor.lct.exists}),{data:[{minCodeSize:(0,t.readByte)()},n]}]},function(m){return(0,t.peekByte)()(m)===44}),h=(0,e.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(y,w,S){return(0,t.readBytes)(S.text.blockSize)(y)}},n]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===1}),l=(0,e.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(y,w,S){return(0,t.readString)(S.blockSize)(y)}},n]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===255}),d=(0,e.conditional)({comment:[{codes:(0,t.readBytes)(2)},n]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===254}),f=[{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(m,y){return Math.pow(2,y.lsd.gct.size+1)})},function(m,y){return y.lsd.gct.exists}),{frames:(0,e.loop)([s,l,d,o,h],function(m){var y=(0,t.peekByte)()(m);return y===33||y===44})}],v=f;i.default=v})(Cc)),Cc}var Kw=Jw();const Zw=Pc(Kw);var Qw=rm(),tE=om();const eE=(i,e)=>{const t=new Array(i.length),n=i.length/e,s=function(v,m){const y=i.slice(m*e,(m+1)*e);t.splice.apply(t,[v*e,e].concat(y))},o=[0,4,2,1],h=[8,8,4,2];for(var l=0,d=0;d<4;d++)for(var f=o[d];f<n;f+=h[d])s(f,l),l++;return t},iE=(i,e,t)=>{const o=t;var h,l,d,f,v,m,y,D,w,S,M,T,L,V,I,x;const N=new Array(t),j=new Array(4096),C=new Array(4096),k=new Array(4097);for(T=i,l=1<<T,v=l+1,h=l+2,y=-1,f=T+1,d=(1<<f)-1,w=0;w<l;w++)j[w]=0,C[w]=w;var M,D,L,V,x,I;for(M=D=L=V=x=I=0,S=0;S<o;){if(V===0){if(D<f){M+=e[I]<<D,D+=8,I++;continue}if(w=M&d,M>>=f,D-=f,w>h||w==v)break;if(w==l){f=T+1,d=(1<<f)-1,h=l+2,y=-1;continue}if(y==-1){k[V++]=C[w],y=w,L=w;continue}for(m=w,w==h&&(k[V++]=L,w=y);w>l;)k[V++]=C[w],w=j[w];L=C[w]&255,k[V++]=L,h<4096&&(j[h]=y,C[h]=L,h++,(h&d)===0&&h<4096&&(f++,d+=h)),y=m}V--,N[x++]=k[V],S++}for(S=x;S<o;S++)N[S]=0;return N},nE=i=>{const e=new Uint8Array(i);return Qw.parse(tE.buildStream(e),Zw)},sE=i=>{const e=i.pixels.length,t=new Uint8ClampedArray(e*4);for(var n=0;n<e;n++){const s=n*4,o=i.pixels[n],h=i.colorTable[o]||[0,0,0];t[s]=h[0],t[s+1]=h[1],t[s+2]=h[2],t[s+3]=o!==i.transparentIndex?255:0}return t},rE=(i,e,t)=>{if(!i.image){console.warn("gif frame does not have associated image.");return}const{image:n}=i,s=n.descriptor.width*n.descriptor.height;var o=iE(n.data.minCodeSize,n.data.blocks,s);n.descriptor.lct.interlaced&&(o=eE(o,n.descriptor.width));const h={pixels:o,dims:{top:i.image.descriptor.top,left:i.image.descriptor.left,width:i.image.descriptor.width,height:i.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?h.colorTable=n.lct:h.colorTable=e,i.gce&&(h.delay=(i.gce.delay||10)*10,h.disposalType=i.gce.extras.disposal,i.gce.extras.transparentColorGiven&&(h.transparentIndex=i.gce.transparentColorIndex)),h.patch=sE(h),h},aE=(i,e)=>i.frames.filter(t=>t.image).map(t=>rE(t,i.gct));async function lm(i){const t=await(await fetch(i)).arrayBuffer(),n=nE(t),s=aE(n);return{gif:n,gifFrames:s,arrayBuffer:t}}function um(i,e,t){return i<e?e:i>t?t:i}class cm extends il{constructor(t,n=!0,s){super();p(this,"_gifFrames",this.disposeVar(it(void 0)));p(this,"_gifDurations",[]);p(this,"_gifDuration",this.disposeVar(it(0)));p(this,"_gifSize",this.disposeVar(it([0,0],(t,n)=>t.every((s,o)=>s===n[o]),t=>[...t])));p(this,"_autoPlayOnLoad",this.disposeVar(it(!0)));p(this,"_gifCanvas");this._container=t,this.loop=!0;const o=document.createElement("canvas");this._gifCanvas=o,o.style.width="100%",o.style.height="100%";const h=o.getContext("2d");this._container&&this._container.appendChild(o),this.dispose(()=>this._container&&this._container.removeChild(o));let l;this.dispose(this._gifFrames.changed.disposableOn(f=>{if(!f||f.length===0){o.width=0,o.height=0;return}const{width:v,height:m}=f[0].dims;this._gifSize.value=[v,m];const y=f.length;let w=0;this._gifDurations.length=0;for(let S=0;S<y;++S)w+=f[S].delay,this._gifDurations.push(w);this._gifDuration.value=this._gifDurations[this._gifDurations.length-1],o.width=v,o.height=m,l=h.createImageData(v,m),this.currentTimeChangedEvent.emit(this.currentTime,this.currentTime),this._autoPlayOnLoad.value&&(this.currentTime=0,this.playing=!0)}));let d=-1;this.dispose(this.currentTimeChangedEvent.disposableOn(f=>{const v=um(f/this.duration,0,1),m=this.gifDuration*v,y=this._gifFrames.value;if(y&&y.length>0){const w=this._getFrame(m);if(w===d)return;d=w;const S=y[w];if(S.disposalType!==0&&S.disposalType!==1&&S.disposalType!==2&&Jr(`gif parsed get disposalType ${S.disposalType}... frame: ${w} size: ${JSON.stringify(S.dims)}`,`gif parsed get disposalType ${S.disposalType}...`),l&&(w===0||S.disposalType===2)&&l.data.fill(0),l){const[T,N]=this._gifSize.value,{width:j,height:C,left:k,top:M}=S.dims;if(C>N)throw new Error("height > canvasHeight");for(let D=0;D<C;++D)for(let L=0;L<j;++L){const V=D*j+L,x=M+D,I=k+L,R=x*T+I,G=l.data,F=S.patch,U=F[V*4+3]/255;G[R*4+0]=G[R*4+0]*(1-U)+F[V*4+0]*U|0,G[R*4+1]=G[R*4+1]*(1-U)+F[V*4+1]*U|0,G[R*4+2]=G[R*4+2]*(1-U)+F[V*4+2]*U|0,G[R*4+3]=um(G[R*4+3]+F[V*4+3],0,255)|0}h.putImageData(l,0,0)}}else Jr("gif资源未加载!无法播放!")})),this.dispose(this._gifDuration.changed.disposableOn(()=>{this.duration=this.gifDuration})),this._autoPlayOnLoad.value=n,this._gifFrames.value=s}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 s=0;s<n;++s)if(t<=this._gifDurations[s])return s;throw new Error("should not be here")}}class dm extends st{constructor(t){super();p(this,"_player");p(this,"_url",this.disposeVar(it("")));p(this,"_loadGifFramesProcessing",this.disposeVar(el(t=>na(lm(t)))));this._player=this.disposeVar(new cm(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 tn(`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 fm extends st{constructor(t,n){super();p(this,"_gif",this.disposeVar(new dm));p(this,"_update");this._complexImage=t,this._imageUri=n,this._gif.url=this._imageUri,this._update=this.disposeVar(sa(()=>this.update())),this._update.start()}get gif(){return this._gif}update(){const{player:t}=this._gif;if(!t.gifFrames)return;const n=this._complexImage,{width:s,height:o}=t.gifCanvas;n.size=[s,o],n.pixelFormat="RGBA",n.copyTexture({source:t.gifCanvas});{const h=()=>{t.autoPlayOnLoad=this._complexImage.autoplay};h(),this.dispose(this._complexImage.autoplayChanged.disposableOn(h))}{const h=()=>{t.loop=this._complexImage.loop};h(),this.dispose(this._complexImage.loopChanged.disposableOn(h))}}}function gm(i,e){const[t,n,s]=wo(i),o=it(void 0),h=()=>{const l=t()??e;o.value=l&&St.context.getStrFromEnv(l)};return h(),s&&o.d(s.don(h)),o.d(St.context.environmentVariablesChanged.don(h)),o}function pm(i){const e=/\${(.*?)\}/g;if(!e.test(i))return i;const t=i.replace(e,(n,s)=>{const o=St.context.getEnv(s);return o===void 0?(console.warn(`环境变量(${s})不存在,无法进行转换`),"{env-error}"):o});return pm(t)}class oE extends st{constructor(t){super();p(this,"_sceneObjRefs",new Map);p(this,"_refs",{});p(this,"_refsChanged",this.dv(new H));const n=(s,o,h)=>{if(h){const l=this.getLastSceneObject(h),d=this._sceneObjRefs.get(h);if(!d)console.warn(`this._sceneObjRefs中不存在ref(${h}), 可能系统存在逻辑问题`);else{const v=d.indexOf(s);v===-1?console.warn(`this._sceneObjRefs中不存在当前对象(id: ${s.id} type: ${s.typeName})!可能系统存在逻辑问题`):(d.splice(v,1),d.length===0&&this._sceneObjRefs.delete(h))}const f=this.getLastSceneObject(h);this._refs[h]=f,this._refsChanged.emit(f,l)}if(o){const l=this.getLastSceneObject(o),d=this._sceneObjRefs.get(o);d?(d.push(s),d.length>0&&console.warn(`同时存在多个ref${o}相同的场景对象!
22
22
  ${d.map(v=>`${v.id} ${v.typeName}
23
23
  `).join(" ")}`)):this._sceneObjRefs.set(o,[s]);const f=this.getLastSceneObject(o);this._refs[o]=f,this._refsChanged.emit(f,l)}};this.d(t.sceneObjCreatedEvent.don(s=>{const o=(h,l)=>n(s,h,l);s.ref&&o(s.ref,void 0),s.refChanged.don(o)})),this.d(t.sceneObjToDestroyEvent.don(s=>{s.ref&&n(s,void 0,s.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 hE extends st{constructor(){super();p(this,"_esObjConstructors",new Map);p(this,"_sceneObjs",new Map);p(this,"_sceneObjCreatedEvent",new H);p(this,"_sceneObjToDestroyEvent",new H);p(this,"_refsManager",this.dv(new oE(this)));p(this,"_environmentVariables",window.ESSDK_ENV||{});p(this,"_environmentVariablesChanged",this.dv(new H))}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,s){return this._esObjConstructors.has(t)&&console.warn(`register warn: ${t} has registered ! will be override!`),this._esObjConstructors.set(t,n),s&&yn(n,"__sceneObjExtraInfo",s),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 o=Zr();n&&console.warn(`已存在相同id的对象!id自动变更!${n} -> ${o} 请注意:id变更可能导致引用失效!`),n=o}if(!n)throw new Error("id不能为空!");const s=new t(n);return s.id!==n&&(console.warn(`sceneObj.id(${s.id}) !== id(${n}) sceneObjectType: ${s.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(s),s}createSceneObject(t,n){if(typeof t=="string"){const s=this._getSceneObjConstructor(t);if(!s){console.warn(`Cannot find SceneObjectType: ${t}`);return}return this.createSceneObjectFromClass(s,n)}else return this.createSceneObjectFromClass(t,n)}createSceneObjectFromUrl(t,n){let s;const o=t.toLowerCase();if(o.includes(".gltf")||o.includes(".glb")?s="ESGltfModel":o.includes("tileset.json")?s="ES3DTileset":o.includes("layer.json")||o.includes("ion://1")?s="ESTerrainLayer":o.includes(".jpg")||o.includes(".png")||o.includes(".jpeg")||o.includes(".webp")||o.includes("image/jpg")||o.includes("image/png")||o.includes("image/jpeg")||o.includes("image/webp")?s="ESImageLabel":(o.includes("/tilemapresource.xml")||o.includes("ion://")||o.includes("wms")||o.includes("wmts")||o.includes("{x}")||o.includes("{y}")||o.includes("{z}"))&&(s="ESImageryLayer"),!!s)return this.createSceneObjectFromJson({type:s,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,n=!1){if(!t&&t!="")return Array.from(this._sceneObjs.values());if(typeof t=="function"){const s=[],o=t.type;for(const h of this._sceneObjs.values())h instanceof t&&(n&&o&&h.typeName!==o||s.push(h));return s}if(t.startsWith("ES")){const s=[];for(const o of this._sceneObjs.values())o.typeName===t&&s.push(o);return s}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 _i(n,"__sceneObjExtraInfo")}setProps(t,n){const s=this._getSceneObjConstructor(t);if(!s){console.warn(`cannot get constructor from type: ${t}`);return}let o=_i(s,"__sceneObjExtraInfo");o||(o={},yn(s,"__sceneObjExtraInfo",o)),Object.assign(o,n)}getProp(t,n){const s=this.getProps(t);return s&&s[n]}setProp(t,n,s){this.setProps(t,{[n]:s})}get environmentVariables(){return this._environmentVariables}set environmentVariables(t){for(let[n,s]of Object.entries(t))this.setEnv(n,s)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(t,n){if(this._environmentVariables[t]!==n){const s=this._environmentVariables[t];this._environmentVariables[t]=n,this._environmentVariablesChanged.emit(t,n,s)}window.ESSDK_ENV={...this._environmentVariables}}getEnv(t){return this._environmentVariables[t]}getStrFromEnv(t){return pm(t)}createEnvStrReact(t,n){return gm(t,n)}createEvnStrReact(t,n){return gm(t,n)}}const Ft=class Ft extends st{constructor(t){super();p(this,"_components",this.dv(new sl));p(this,"_viewerAttached",this.dv(new H));p(this,"_viewerDetached",this.dv(new H));p(this,"_attachedViewers",(()=>{const t=new Set;return this.d(this._viewerAttached.don(n=>{n.actived&&(this.activeViewer=n),n.ad(n.activedChanged.don(s=>{s&&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})());p(this,"_activeViewer",this.dv(it(void 0)));p(this,"_reloadEvent",this.dv(new H));p(this,"_readyEvent",this.dv(new H));p(this,"_createdEvent",this.dv(new H));p(this,"_flushEvent",this.dv(new H));p(this,"_id");p(this,"_updateFuncReact",this.dv(it(void 0)));p(this,"_toDestroyFuncReact",this.dv(it(void 0)));p(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??Zr(),this._initName();{const n=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};n(),this.d(this.execOnceFuncStrChanged.don(n))}{const n=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};n(),this.d(this.updateFuncStrChanged.don(n));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||To(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const n=()=>{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}};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,s){ys(n.prototype,n.createDefaultProps);const o=n.createDefaultProps();n.defaults&&(n.defaults={});for(const h of Object.keys(o))n.defaults[h]=o[h]instanceof Ne?o[h].value:o[h];return this.innerRegister(t,n,s),t}static get envs(){return Ft.context.environmentVariables}static get $refs(){return Ft.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)}get reloadEvent(){return this._reloadEvent}reload(){this._reloadEvent.emit()}get readyEvent(){return this._readyEvent}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(s=>{const o=t(s);o&&n.set(s,o)})),this.d(this._viewerDetached.don(s=>{if(!n.has(s))return;const o=n.get(s);o&&(o.destroy(),n.delete(s))}))}createAttachedObject(t){const n=new Map,s=(()=>{for(let[d,f]of n.entries())f.destroy();n.clear()}),o=d=>{const f=t(d);f&&n.set(d,f)};for(let d of this.attachedViewers)o(d);const h=this._viewerAttached.don(o),l=this._viewerDetached.don(d=>{if(!n.has(d))return;const f=n.get(d);f&&(f.destroy(),n.delete(d))});return()=>{l(),h(),s()}}registerAttachedObjectForContainer(t){this.registerAttachedObject(n=>new lE(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 s of Object.keys(this.defaultProps))if(t){let o,h=this.defaultProps[s];h instanceof Ne?o=h.equals(this[s]):o=h===this[s],o||(n[s]=this[s])}else n[s]=this[s];return n}_innerSetJson(t,n,s){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 o=n||[];o.push("id","type");const h=Object.keys(this.defaultProps).filter(l=>!o.includes(l));for(let l of h)if(l in t)this[l]=t[l]===null?void 0:t[l];else if(!(s??!1)){let d=this.defaultProps[l];d instanceof Ne&&(d=d.value),this[l]=d}}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}getESProperties(){return{defaultMenu:"general",basic:[],general:[new Tt([this,"typeName"],"类型",void 0,!1,!0),new Tt([this,"id"],"id",void 0,!1,!0),new Tt([this,"name"],"名称"),new Tc("JSON",()=>this._jsonStr,t=>t&&(this._jsonStr=t))],dataSource:[],location:[],coordinate:[],style:[],more:[new Tt([this,"ref"],"ref",void 0,!0),new Mt([this,"extras"],"extras",{},void 0,!0)]}}};p(Ft,"context",new hE),p(Ft,"innerRegister",Ft.context.register.bind(Ft.context)),p(Ft,"defaults",{}),p(Ft,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:At(void 0),devTags:Wt(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),p(Ft,"type",Ft.register("ESSceneObject",Ft,{chsName:"场景类",tags:["ESObjects","base"],description:""})),p(Ft,"create",Ft.context.createSceneObject.bind(Ft.context)),p(Ft,"createFromUrl",Ft.context.createSceneObjectFromUrl.bind(Ft.context)),p(Ft,"createFromClass",Ft.context.createSceneObjectFromClass.bind(Ft.context)),p(Ft,"createFromJson",Ft.context.createSceneObjectFromJson.bind(Ft.context)),p(Ft,"destroySceneObject",Ft.context.destroySceneObject.bind(Ft.context)),p(Ft,"getSceneObjById",Ft.context.getSceneObjectById.bind(Ft.context)),p(Ft,"getSceneObj",Ft.context.getSceneObject.bind(Ft.context)),p(Ft,"getEnv",Ft.context.getEnv.bind(Ft.context)),p(Ft,"setEnv",Ft.context.setEnv.bind(Ft.context)),p(Ft,"getStrFromEnv",Ft.context.getStrFromEnv.bind(Ft.context)),p(Ft,"getSceneObjectById",Ft.context.getSceneObjectById.bind(Ft.context)),p(Ft,"getSceneObject",Ft.context.getSceneObject.bind(Ft.context));let St=Ft;class lE extends st{constructor(e,t){super(),this.dv(new xe(e.subContainerChanged,()=>{if(e.subContainer)return t(e,e.subContainer)}))}}const Mu=class Mu extends st{constructor(t,n,s){super();p(this,"_id",++Mu._accumId);this._name=t,this._description=n,this._callFunction=s}get id(){return this._id}get name(){return this._name}get description(){return this._description}get callFunction(){return this._callFunction}};p(Mu,"_accumId",-1);let Es=Mu;class Ic extends Es{constructor(e,t,n,s,o,h){super(e,t,h??(()=>{})),this._withUndefined=n,this._readonly=s,this._defaultValue=o}get withUndefined(){return this._withUndefined}get readonly(){return this._readonly}get defaultValue(){return this._defaultValue instanceof Function?this._defaultValue():this._defaultValue}}class ei extends Ic{constructor(t,n,s,o,h,l,d){var v;const f=t instanceof Ne?"未获取到属性名":t[1].toString();super(n??f,l??f,o??!1,h??!1,s,d);p(this,"_propName");p(this,"_typeName");this._reactVar=t,this._propName=f;try{this._typeName=t instanceof Ne?"未获取到对象类型":(v=t[0])==null?void 0:v.typeName}catch{this._typeName="未获取到对象类型"}}get reactVar(){return this._reactVar}get propName(){return this._propName}get typeName(){return this._typeName}}class nt extends ei{get type(){return"BooleanProperty"}}class Tt extends ei{get type(){return"StringProperty"}}class q extends ei{get type(){return"NumberProperty"}}class ge extends ei{get type(){return"Number2Property"}}class Te extends ei{get type(){return"Number3Property"}}class ui extends ei{get type(){return"Number4Property"}}class jt extends ui{get type(){return"ColorProperty"}}class rl extends q{get type(){return"DashPatternProperty"}}class Ei extends ei{get type(){return"DateProperty"}}class Mc extends ei{get type(){return"DatesProperty"}}class yt extends Es{constructor(t,n,s){super(t??"",s??"");p(this,"_placement");this._placement=n}get type(){return"DivideProperty"}get placement(){return this._placement}}class xt extends ei{constructor(e,t,n,s,o,h,l){super(e,n,s,o,h,l),this._enums=t}get type(){return"EnumProperty"}get enums(){return this._enums}}class Ai extends ei{constructor(e,t,n,s,o,h,l){super(e,t,n,o,h,l),this._sampleValue=s}get sampleValue(){return this._sampleValue}get type(){return"EvalStringProperty"}}class Lo extends ei{constructor(e,t,n,s,o,h,l){super(e,t,n,o,h,l),this._sampleValue=s}get sampleValue(){return this._sampleValue}get type(){return"LongStringProperty"}}class kt extends Es{constructor(t,n,s,o){const h=t??"Unnamed Function";super(h,o??h);p(this,"_paramsLength");this._func=n,this._defaultParams=s,this._paramsLength=this._func.length??0}get paramsLength(){return this._paramsLength}get defaultParams(){return this._defaultParams}get isOpen(){return this._defaultParams.length!==this._paramsLength}get func(){return this._func}run(...t){this._func(...t)}get type(){return"MethodProperty"}}class ke extends ei{constructor(e,t,n,s,o,h,l,d){super(e,s,o,h,l,d),this._step=t,this._minMax=n}get type(){return"NumberSliderProperty"}get minMax(){return this._minMax}get step(){return this._step}}class en extends Te{get type(){return"PositionProperty"}}class ra extends Te{get type(){return"RotationProperty"}}function uE(i,e){const[t,n,s]=wo(i),[o,h,l]=wo(e),d=it((t()??0)/(o()??3e3)),f=()=>{const v=d.value,m=o()??3e3,y=t()??0;if(!Number.isFinite(m)||!Number.isFinite(y)){console.warn(`duration || currentTime error: duration: ${m} currentTime: ${y}`);return}Math.abs(v*m-y)<.001||(m<=0?d.value=0:d.value=y/m)};return d.dispose(s.disposableOn(f)),d.dispose(l.disposableOn(f)),d.dispose(d.changed.disposableOn(()=>{const v=d.value,m=o()??3e3,y=t()??0;if(!Number.isFinite(m)||!Number.isFinite(y)){console.warn(`duration || currentTime error: duration: ${m} currentTime: ${y}`);return}Math.abs(v*m-y)<.001||n(v*m)})),d}class aa extends Es{constructor(t,n,s,o,h,l){super(o??"播放器",l??"播放器");p(this,"_defaults",{playing:!1,ratio:0,loop:!1});this._playingReact=t,this._ratioReact=n,this._loopReact=s,h&&(this._defaults.playing=h.playing??this._defaults.playing,this._defaults.ratio=h.ratio??this._defaults.ratio,this._defaults.loop=h.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}}p(aa,"createPlayingRatio",uE);class mm extends Es{constructor(t,n,s,o,h,l){const d=o??"视角播放器";super(d,l??d);p(this,"_defaults",{playing:!1,loop:!1});this._playingReact=t,this._stopFn=n,this._loopReact=s,h&&(this._defaults.playing=h.playing??this._defaults.playing,this._defaults.loop=h.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 ue extends ei{constructor(e,t,n,s,o,h,l){super(e,t,n,o,h,l),this._sampleValue=s}get sampleValue(){return this._sampleValue}get type(){return"JsonArrayProperty"}}class Mt extends ei{constructor(e,t,n,s,o,h,l){super(e,t,n,o,h,l),this._sampleValue=s}get sampleValue(){return this._sampleValue}get type(){return"JsonProperty"}}class Tc extends Ic{constructor(e,t,n,s,o,h){super(e,h??e,s??!1,o??!1),this._getFunc=t,this._setFunc=n}get getFunc(){return this._getFunc}get setFunc(){return this._setFunc}get type(){return"GetSetProperty"}}var dt=(i=>(i.Place="place",i.BrushErase="brushErase",i.Translation="translation",i.Rotation="rotation",i.Scale="scale",i.DoublePointsAppend="doublePointsAppend",i.DoublePointsModify="doublePointsModify",i.CircularAppend="circularAppend",i.CircularInsert="circularInsert",i.LineStringAppend="lineStringAppend",i.LineStringInsert="lineStringInsert",i.ScatterAppend="scatterAppend",i.ScatterModify="scatterModify",i.VisibilityAppend="visibilityAppend",i.VisibilityModify="visibilityModify",i.HeightModify="heightModify",i.SinglePoint="singlePoint",i.DoublePoints="doublePoints",i))(dt||{});const kc=[["地形","TERRAIN"],["3D Tiles","CESIUM_3D_TILE"],["地形和3D Tiles","BOTH"]],Oc=[["直箭头","straightArrow"],["燕尾箭头","swallowTailArrow"]];var vm=(i=>(i.DECIMAL_DEGREE="DECIMAL_DEGREE",i.DEGREES_DECIMAL_MINUTES="DEGREES_DECIMAL_MINUTES",i.SEXAGESIMAL_DEGREE="SEXAGESIMAL_DEGREE",i))(vm||{});class cE{constructor(e){this.childPickedInfo=e}}class dE{constructor(e,t,n,s,o,h){this.pickResult=e,this.sceneObject=t,this.tilesetPickInfo=n,this.geojsonPickInfo=s,this.attachedInfo=o,this.screenPosition=h}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 Se=class Se extends St{constructor(t){super(t);p(this,"_editing",this.dv(it(!1)));p(this,"editingID");p(this,"editingBindMode","singlePoint");p(this,"_deprecated",[]);p(this,"_flyInEvent",this.dv(new H));p(this,"_flyToEvent",this.dv(new H));p(this,"_flyOverEvent",this.disposeVar(new H));p(this,"_pickedEvent",this.dv(new H));p(this,"_calcFlyToParamEvent",this.dv(new H));p(this,"_calcFlyInParamEvent",this.dv(new H));p(this,"useCalcFlyToParamInESObjectWithLocation",!1);Sm(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 s=t[n];typeof s=="string"?Reflect.has(this,s+"Changed")&&this.d(this[s+"Changed"].don(()=>{console.warn(`注意:${this.typeName} 的 ${s} 属性下版本将会被移除!`)})):Object.keys(s).forEach(o=>{Reflect.has(this,o+"Changed")&&this.d(this[o+"Changed"].don(l=>{const d=s[o];typeof d=="string"?console.warn(`注意:${this.typeName} 的 ${o} 属性下版本将会被移除!`):Object.keys(d).forEach((f=>{l===f&&console.warn(`注意:${this.typeName} 的 ${o} 属性值 ${f} 下版本将会被移除,推荐使用属性值 ${d[f]}`)}))}))})}}get flyInEvent(){return this._flyInEvent}flyIn(t=1){this._flyInEvent.emit(t,Se._lastFlyInId)}get flyToEvent(){return this._flyToEvent}flyTo(t=1){this._flyToEvent.emit(t,Se._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 nt([this,"show"],"是否显示",Se.defaults.show),new nt([this,"collision"],"开启碰撞",Se.defaults.collision),new nt([this,"allowPicking"],"允许拾取",Se.defaults.allowPicking),new kt("保存观察视角",()=>this.calcFlyToParam(),[]),new kt("清空飞向参数",()=>this.emptyFlyToParam(),[]),new kt("保存飞入参数",()=>this.calcFlyInParam(),[]),new kt("清空飞入参数",()=>this.emptyFlyInParam(),[])],more:[...t.more,new yt("飞行定位"),new kt("飞向",n=>this.flyTo(n),[1],"flyTo"),new Mt([this,"flyToParam"],"飞行参数",void 0,void 0,!0),new q([this,"flyToDistance"],"flyToDistance",void 0,!0),new q([this,"flyToHeading"],"flyToHeading",void 0,!0),new q([this,"flyToPitch"],"flyToPitch",void 0,!0),new q([this,"flyToFlyDuration"],"flyToFlyDuration",void 0,!0),new q([this,"flyToHDelta"],"flyToHDelta",void 0,!0),new q([this,"flyToPDelta"],"flyToPDelta",void 0,!0),new yt("飞入参数"),new kt("飞入",n=>this.flyIn(n),[1],"flyIn"),new Mt([this,"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??Se.defaultFlyToParam,distance:t}:void 0}set flyToHeading(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,heading:t}:void 0}set flyToPitch(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,pitch:t}:void 0}set flyToFlyDuration(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,flyDuration:t}:void 0}set flyToHDelta(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,hDelta:t}:void 0}set flyToPDelta(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,pDelta:t}:void 0}};p(Se,"createDefaultProps",()=>({...St.createDefaultProps(),show:!0,collision:!0,allowPicking:!1,flyToParam:se(void 0),flyInParam:se(void 0)})),p(Se,"type",Se.register("ESVisualObject",Se,{chsName:"可视化对象",tags:["ESObjects","base"],description:"可视化对象"})),p(Se,"supportEditingModes",[]),p(Se,"defaultFlyToParam",{distance:0,heading:0,pitch:0,flyDuration:1,hDelta:0,pDelta:0}),p(Se,"defaultFlyInParam",{position:[0,0,0],rotation:[0,0,0],flyDuration:1}),p(Se,"_lastFlyInId",0),p(Se,"_lastFlyToId",0);let Ht=Se;class ym extends st{constructor(){super();p(this,"_data",this.dv(it(void 0)))}set data(t){this._data.value=t}get data(){return this._data.value}get dataChanged(){return this._data.changed}}class _m extends st{constructor(){super(...arguments);p(this,"_dragStartEvent",this.dv(new H));p(this,"_dragOverEvent",this.dv(new H));p(this,"_dragLeaveEvent",this.dv(new H));p(this,"_dropEvent",this.dv(new H))}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 fE(i,e){e&&(Reflect.has(e,"editing")?e.editing=!0:Reflect.has(e,"positionEditing")&&(e.positionEditing=!0))}function gE(i){["Czm3DTiles","View","ESCameraView","OlView","GeoCameraController"].includes(i.typeName)||(Reflect.has(i,"editing")?i.editing=!0:Reflect.has(i,"positionEditing")&&(i.positionEditing=!0)),typeof i.execOnCreating=="function"&&i.execOnCreating()}function al(i,e){_i(i,"__treeItem")&&console.error("setSceneObjectTreeItem error!"),yn(i,"__treeItem",e)}function pE(i){return _i(i,"__treeItem")}function mE(i){if(!(i.startsWith("./")||i.startsWith("../")||i.startsWith("/")))return i;const e=document.createElement("a");e.href=i;const t=e.href;return e.remove(),t}function Nc(i){if(typeof i!="string")return!1;try{const e=JSON.parse(i);return typeof e=="object"&&e!==null}catch{return!1}}function vE(i){try{return new DOMParser().parseFromString(i,"application/xml").getElementsByTagName("parsererror").length===0}catch{return!1}}function yE(i){return i instanceof Function?i():i}function wm(i,e){for(let t of i)if(e.includes(t))return!0;return!1}function Fo(i,e){const t=i,n=e;return t===void 0||t.length===0||n===void 0||n.length===0?!0:wm(t,n)}function _E(i){const e=setTimeout(()=>{i(),clearTimeout(e)})}function oa(i){let e=i%360;return e=e<0?360+e:e,e}function Em(i){return oa(i+180)-180}function ol(i,e,t){let n=oa(i),s=oa(e);Math.abs(n-s)>180&&(n<s?n+=360:s+=360);const o=n*(1-t)+s*t;return Em(o)}function Rc(i,e,t,n){return n=n||[0,0,0],n[0]=ol(i[0],e[0],t),n[1]=ol(i[1],e[1],t),n[2]=ol(i[2],e[2],t),n}function Sm(i,e,t="editing"){const n=new st;i.ad(n);const s=e.bind(i);return n.ad(new xe(i.activeViewerChanged,()=>{const o=new st;let h=i.activeViewer;return h?(o.ad(i[`${t}Changed`].don(()=>{var l;i[`${t}`]?s():(l=(i.components.main??i).editingID)!=null&&l.includes("inner")&&i.activeViewer&&i.activeViewer.stopEditing()})),o.ad(h.editingEvent.don(l=>{if(l.objectIDs.includes(i.id)&&l.type==="end"){const d=i.components.main??i;d.editingID&&(l.editingID.includes(d.editingID)?(d.editingID=void 0,i[t]=!1):i[t]=!d.editingID.includes("outer"))}}))):o.ad(i[`${t}Changed`].don(()=>{i[`${t}`]=!1})),o})),i[`${t}`]&&s(),n}function wE(i){return i}function EE(i){if(i==null)return wE;var e,t,n=i.scale[0],s=i.scale[1],o=i.translate[0],h=i.translate[1];return function(l,d){d||(e=t=0);var f=2,v=l.length,m=new Array(v);for(m[0]=(e+=l[0])*n+o,m[1]=(t+=l[1])*s+h;f<v;)m[f]=l[f],++f;return m}}function SE(i,e){for(var t,n=i.length,s=n-e;s<--n;)t=i[s],i[s++]=i[n],i[n]=t}function xE(i,e){return typeof e=="string"&&(e=i.objects[e]),e.type==="GeometryCollection"?{type:"FeatureCollection",features:e.geometries.map(function(t){return xm(i,t)})}:xm(i,e)}function xm(i,e){var t=e.id,n=e.bbox,s=e.properties==null?{}:e.properties,o=bE(i,e);return t==null&&n==null?{type:"Feature",properties:s,geometry:o}:n==null?{type:"Feature",id:t,properties:s,geometry:o}:{type:"Feature",id:t,bbox:n,properties:s,geometry:o}}function bE(i,e){var t=EE(i.transform),n=i.arcs;function s(v,m){m.length&&m.pop();for(var y=n[v<0?~v:v],w=0,S=y.length;w<S;++w)m.push(t(y[w],w));v<0&&SE(m,S)}function o(v){return t(v)}function h(v){for(var m=[],y=0,w=v.length;y<w;++y)s(v[y],m);return m.length<2&&m.push(m[0]),m}function l(v){for(var m=h(v);m.length<4;)m.push(m[0]);return m}function d(v){return v.map(l)}function f(v){var m=v.type,y;switch(m){case"GeometryCollection":return{type:m,geometries:v.geometries.map(f)};case"Point":y=o(v.coordinates);break;case"MultiPoint":y=v.coordinates.map(o);break;case"LineString":y=h(v.arcs);break;case"MultiLineString":y=v.arcs.map(h);break;case"Polygon":y=d(v.arcs);break;case"MultiPolygon":y=v.arcs.map(d);break;default:return null}return{type:m,coordinates:y}}return f(e)}function bm(i){var t;const e=Array.isArray(i)?"feature":((t=i.type)==null?void 0:t.toLowerCase())??"";switch(e){case"geometrycollection":return PE(i);case"topology":const n=i.objects,s=[];for(const o in n){const h=xE(i,n[o]);s.push(...h.features)}return{type:"FeatureCollection",features:s};case"feature":return{type:"FeatureCollection",features:Array.isArray(i)?i:[i]};case"featurecollection":return i;default:return console.warn(`GeoJson数据转换可能有误,数据类型${e}`),{type:"FeatureCollection",features:Array.isArray(i.features)?i.features:[]}}}function PE(i,e){const t=[],n=i.geometries||[];function s(o,h={}){!o||!o.type||(o.type==="GeometryCollection"&&Array.isArray(o.geometries)?o.geometries.forEach(l=>s(l,h)):t.push({type:"Feature",geometry:o,properties:{...o.properties||{},...h}}))}return n.forEach(o=>s(o,{})),{type:"FeatureCollection",features:t}}function CE(i){const e=i.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}}function IE(i,e,t=!1){var m,y,w,S,T,N;const n=[],s=[],o=[],h=[],l=[],d=new Set,f=new Map;if(e!=null&&e.features)for(const j of e.features){const C=((m=j.id)==null?void 0:m.toString())||((w=(y=j.properties)==null?void 0:y.id)==null?void 0:w.toString());C&&(d.add(C),f.set(C,j))}if(i!=null&&i.features)for(const j of i.features){const C=((S=j.id)==null?void 0:S.toString())||((N=(T=j.properties)==null?void 0:T.id)==null?void 0:N.toString());if(C)if(d.has(C)){if(t){const k=f.get(C);k&&Pm(k,j)?h.push(C):l.push(C)}n.push(C)}else s.push(C)}for(const j of d)n.includes(j)||o.push(j);const v={unchangedIds:n,newIds:s,removedIds:o};return t&&(v.contentUnchangedIds=h,v.contentUpdatedIds=l),v}function Pm(i,e){return Cm(i.geometry,e.geometry)?JSON.stringify(i.properties)===JSON.stringify(e.properties):!1}function Cm(i,e){if(i===e)return!0;if(!i||!e||i.type!==e.type)return!1;const t=i.coordinates,n=e.coordinates;if(i.type==="Point")return ME(t,n);if(i.type==="LineString"||i.type==="MultiPoint")return hl(t,n);if(i.type==="Polygon"){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(!hl(t[s],n[s]))return!1;return!0}if(i.type==="MultiLineString"){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(!hl(t[s],n[s]))return!1;return!0}if(i.type==="MultiPolygon"){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++){const o=t[s],h=n[s];if(o.length!==h.length)return!1;for(let l=0;l<o.length;l++)if(!hl(o[l],h[l]))return!1}return!0}return JSON.stringify(i)===JSON.stringify(e)}function ME(i,e){if(!i||!e)return i===e;if(i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(Math.abs(i[t]-e[t])>1e-10)return!1;return!0}function hl(i,e){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let t=0;t<i.length;t++){const n=i[t],s=e[t];if(n.length!==s.length)return!1;for(let o=0;o<n.length;o++)if(Math.abs(n[o]-s[o])>1e-10)return!1}return!0}class Ac extends st{constructor(t){super();p(this,"_sceneObject",this.dv(it(void 0)));this._id=t,this.d(()=>{this._sceneObject.value=void 0});const n=St.getSceneObjById(this._id);n&&(this._sceneObject.value=n),this.d(St.context.sceneObjCreatedEvent.don(s=>{s.id===this._id&&(this._sceneObject.value=s)})),this.d(St.context.sceneObjToDestroyEvent.don(s=>{s.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 TE extends st{constructor(t,n){super();p(this,"_sofi");this._id=t,this._sofi=this.dv(new Ac(this._id));{const s=()=>{n.sceneObject=this._sofi.sceneObject};s(),this.d(this._sofi.sceneObjectChanged.don(s))}}}class Im extends st{constructor(){super();p(this,"_id",this.dv(it(void 0)));p(this,"_sceneObject",this.dv(it(void 0)));p(this,"_resetting",this.dv(new xe(this.idChanged,()=>{const{id:t}=this;if(t===void 0||t===""){this.sceneObject=void 0;return}return new TE(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 kE extends st{constructor(t,n,s,o){super();p(this,"_sceneObjectId",this.dv(new Im));this._id=t,this._startTimeStamp=n,this._duration=s,this._parent=o,this._sceneObjectId.id=this._id;const h=()=>{if(!this.player)return;const{currentTime:l=0}=this._parent,d=l-this._startTimeStamp;this.player.currentTime=Qh(d,0,this._duration)*(this.player.speed??1)};h(),this.d(this._parent.currentTimeChanged.don(h)),this.d(this.playerChanged.don(h))}get player(){return this._sceneObjectId.sceneObject instanceof Di?this._sceneObjectId.sceneObject:void 0}get playerChanged(){return this._sceneObjectId.sceneObjectChanged}}const OE=`
24
24
  用来配置子播放器,它是一个数组形式,数组的每个元素仍然是一个数组,形式是[子播放器的ID, 起始时间, 持续时间]。