@visactor/vrender 0.13.10 → 0.13.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VRender={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(r=n.key,s=void 0,"symbol"==typeof(s=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r,"string"))?s:String(s)),n)}var r,s}function a(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}function c(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function l(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=o(t);if(e){var r=o(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return c(this,i)}}var u=function(t){return t&&t.Math==Math&&t},d=u("object"==("undefined"==typeof globalThis?"undefined":n(globalThis))&&globalThis)||u("object"==("undefined"==typeof window?"undefined":n(window))&&window)||u("object"==("undefined"==typeof self?"undefined":n(self))&&self)||u("object"==n(e)&&e)||function(){return this}()||e||Function("return this")(),p={},f=function(t){try{return!!t()}catch(t){return!0}},g=!f((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),y=!f((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),m=y,v=Function.prototype.call,b=m?v.bind(v):function(){return v.apply(v,arguments)},x={},w={}.propertyIsEnumerable,S=Object.getOwnPropertyDescriptor,A=S&&!w.call({1:2},1);x.f=A?function(t){var e=S(this,t);return!!e&&e.enumerable}:w;var _,C,T=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},B=y,P=Function.prototype,E=P.call,M=B&&P.bind.bind(E,E),R=B?M:function(t){return function(){return E.apply(t,arguments)}},k=R,D=k({}.toString),I=k("".slice),O=function(t){return I(D(t),8,-1)},L=f,U=O,W=Object,F=R("".split),N=L((function(){return!W("z").propertyIsEnumerable(0)}))?function(t){return"String"==U(t)?F(t,""):W(t)}:W,z=function(t){return null==t},j=z,H=TypeError,G=function(t){if(j(t))throw H("Can't call method on "+t);return t},V=N,X=G,Y=function(t){return V(X(t))},q="object"==("undefined"==typeof document?"undefined":n(document))&&document.all,K={all:q,IS_HTMLDDA:void 0===q&&void 0!==q},$=K.all,Z=K.IS_HTMLDDA?function(t){return"function"==typeof t||t===$}:function(t){return"function"==typeof t},J=Z,Q=K.all,et=K.IS_HTMLDDA?function(t){return"object"==n(t)?null!==t:J(t)||t===Q}:function(t){return"object"==n(t)?null!==t:J(t)},it=d,nt=Z,rt=function(t,e){return arguments.length<2?(i=it[t],nt(i)?i:void 0):it[t]&&it[t][e];var i},st=R({}.isPrototypeOf),at=d,ot="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ht=at.process,ct=at.Deno,lt=ht&&ht.versions||ct&&ct.version,ut=lt&&lt.v8;ut&&(C=(_=ut.split("."))[0]>0&&_[0]<4?1:+(_[0]+_[1])),!C&&ot&&(!(_=ot.match(/Edge\/(\d+)/))||_[1]>=74)&&(_=ot.match(/Chrome\/(\d+)/))&&(C=+_[1]);var dt=C,pt=f,ft=d.String,gt=!!Object.getOwnPropertySymbols&&!pt((function(){var t=Symbol();return!ft(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&dt&&dt<41})),yt=gt&&!Symbol.sham&&"symbol"==n(Symbol.iterator),mt=rt,vt=Z,bt=st,xt=Object,wt=yt?function(t){return"symbol"==n(t)}:function(t){var e=mt("Symbol");return vt(e)&&bt(e.prototype,xt(t))},St=String,At=function(t){try{return St(t)}catch(t){return"Object"}},_t=Z,Ct=At,Tt=TypeError,Bt=function(t){if(_t(t))return t;throw Tt(Ct(t)+" is not a function")},Pt=Bt,Et=z,Mt=function(t,e){var i=t[e];return Et(i)?void 0:Pt(i)},Rt=b,kt=Z,Dt=et,It=TypeError,Ot={exports:{}},Lt=d,Ut=Object.defineProperty,Wt=function(t,e){try{Ut(Lt,t,{value:e,configurable:!0,writable:!0})}catch(i){Lt[t]=e}return e},Ft=Wt,Nt="__core-js_shared__",zt=d[Nt]||Ft(Nt,{}),jt=zt;(Ot.exports=function(t,e){return jt[t]||(jt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.31.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ht=Ot.exports,Gt=G,Vt=Object,Xt=function(t){return Vt(Gt(t))},Yt=Xt,qt=R({}.hasOwnProperty),Kt=Object.hasOwn||function(t,e){return qt(Yt(t),e)},$t=R,Zt=0,Jt=Math.random(),Qt=$t(1..toString),te=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Qt(++Zt+Jt,36)},ee=Ht,ie=Kt,ne=te,re=gt,se=yt,ae=d.Symbol,oe=ee("wks"),he=se?ae.for||ae:ae&&ae.withoutSetter||ne,ce=function(t){return ie(oe,t)||(oe[t]=re&&ie(ae,t)?ae[t]:he("Symbol."+t)),oe[t]},le=b,ue=et,de=wt,pe=Mt,fe=function(t,e){var i,n;if("string"===e&&kt(i=t.toString)&&!Dt(n=Rt(i,t)))return n;if(kt(i=t.valueOf)&&!Dt(n=Rt(i,t)))return n;if("string"!==e&&kt(i=t.toString)&&!Dt(n=Rt(i,t)))return n;throw It("Can't convert object to primitive value")},ge=TypeError,ye=ce("toPrimitive"),me=function(t,e){if(!ue(t)||de(t))return t;var i,n=pe(t,ye);if(n){if(void 0===e&&(e="default"),i=le(n,t,e),!ue(i)||de(i))return i;throw ge("Can't convert object to primitive value")}return void 0===e&&(e="number"),fe(t,e)},ve=wt,be=function(t){var e=me(t,"string");return ve(e)?e:e+""},xe=et,we=d.document,Se=xe(we)&&xe(we.createElement),Ae=function(t){return Se?we.createElement(t):{}},_e=Ae,Ce=!g&&!f((function(){return 7!=Object.defineProperty(_e("div"),"a",{get:function(){return 7}}).a})),Te=g,Be=b,Pe=x,Ee=T,Me=Y,Re=be,ke=Kt,De=Ce,Ie=Object.getOwnPropertyDescriptor;p.f=Te?Ie:function(t,e){if(t=Me(t),e=Re(e),De)try{return Ie(t,e)}catch(t){}if(ke(t,e))return Ee(!Be(Pe.f,t,e),t[e])};var Oe={},Le=g&&f((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ue=et,We=String,Fe=TypeError,Ne=function(t){if(Ue(t))return t;throw Fe(We(t)+" is not an object")},ze=g,je=Ce,He=Le,Ge=Ne,Ve=be,Xe=TypeError,Ye=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,Ke="enumerable",$e="configurable",Ze="writable";Oe.f=ze?He?function(t,e,i){if(Ge(t),e=Ve(e),Ge(i),"function"==typeof t&&"prototype"===e&&"value"in i&&Ze in i&&!i[Ze]){var n=qe(t,e);n&&n[Ze]&&(t[e]=i.value,i={configurable:$e in i?i[$e]:n[$e],enumerable:Ke in i?i[Ke]:n[Ke],writable:!1})}return Ye(t,e,i)}:Ye:function(t,e,i){if(Ge(t),e=Ve(e),Ge(i),je)try{return Ye(t,e,i)}catch(t){}if("get"in i||"set"in i)throw Xe("Accessors not supported");return"value"in i&&(t[e]=i.value),t};var Je=Oe,Qe=T,ti=g?function(t,e,i){return Je.f(t,e,Qe(1,i))}:function(t,e,i){return t[e]=i,t},ei={exports:{}},ii=g,ni=Kt,ri=Function.prototype,si=ii&&Object.getOwnPropertyDescriptor,ai=ni(ri,"name"),oi={EXISTS:ai,PROPER:ai&&"something"===function(){}.name,CONFIGURABLE:ai&&(!ii||ii&&si(ri,"name").configurable)},hi=Z,ci=zt,li=R(Function.toString);hi(ci.inspectSource)||(ci.inspectSource=function(t){return li(t)});var ui,di,pi,fi=ci.inspectSource,gi=Z,yi=d.WeakMap,mi=gi(yi)&&/native code/.test(String(yi)),vi=te,bi=Ht("keys"),xi=function(t){return bi[t]||(bi[t]=vi(t))},wi={},Si=mi,Ai=d,_i=et,Ci=ti,Ti=Kt,Bi=zt,Pi=xi,Ei=wi,Mi="Object already initialized",Ri=Ai.TypeError,ki=Ai.WeakMap;if(Si||Bi.state){var Di=Bi.state||(Bi.state=new ki);Di.get=Di.get,Di.has=Di.has,Di.set=Di.set,ui=function(t,e){if(Di.has(t))throw Ri(Mi);return e.facade=t,Di.set(t,e),e},di=function(t){return Di.get(t)||{}},pi=function(t){return Di.has(t)}}else{var Ii=Pi("state");Ei[Ii]=!0,ui=function(t,e){if(Ti(t,Ii))throw Ri(Mi);return e.facade=t,Ci(t,Ii,e),e},di=function(t){return Ti(t,Ii)?t[Ii]:{}},pi=function(t){return Ti(t,Ii)}}var Oi={set:ui,get:di,has:pi,enforce:function(t){return pi(t)?di(t):ui(t,{})},getterFor:function(t){return function(e){var i;if(!_i(e)||(i=di(e)).type!==t)throw Ri("Incompatible receiver, "+t+" required");return i}}},Li=R,Ui=f,Wi=Z,Fi=Kt,Ni=g,zi=oi.CONFIGURABLE,ji=fi,Hi=Oi.enforce,Gi=Oi.get,Vi=String,Xi=Object.defineProperty,Yi=Li("".slice),qi=Li("".replace),Ki=Li([].join),$i=Ni&&!Ui((function(){return 8!==Xi((function(){}),"length",{value:8}).length})),Zi=String(String).split("String"),Ji=ei.exports=function(t,e,i){"Symbol("===Yi(Vi(e),0,7)&&(e="["+qi(Vi(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!Fi(t,"name")||zi&&t.name!==e)&&(Ni?Xi(t,"name",{value:e,configurable:!0}):t.name=e),$i&&i&&Fi(i,"arity")&&t.length!==i.arity&&Xi(t,"length",{value:i.arity});try{i&&Fi(i,"constructor")&&i.constructor?Ni&&Xi(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=Hi(t);return Fi(n,"source")||(n.source=Ki(Zi,"string"==typeof e?e:"")),t};Function.prototype.toString=Ji((function(){return Wi(this)&&Gi(this).source||ji(this)}),"toString");var Qi=ei.exports,tn=Z,en=Oe,nn=Qi,rn=Wt,sn=function(t,e,i,n){n||(n={});var r=n.enumerable,s=void 0!==n.name?n.name:e;if(tn(i)&&nn(i,s,n),n.global)r?t[e]=i:rn(e,i);else{try{n.unsafe?t[e]&&(r=!0):delete t[e]}catch(t){}r?t[e]=i:en.f(t,e,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},an={},on=Math.ceil,hn=Math.floor,cn=Math.trunc||function(t){var e=+t;return(e>0?hn:on)(e)},ln=function(t){var e=+t;return e!=e||0===e?0:cn(e)},un=ln,dn=Math.max,pn=Math.min,fn=function(t,e){var i=un(t);return i<0?dn(i+e,0):pn(i,e)},gn=ln,yn=Math.min,mn=function(t){return t>0?yn(gn(t),9007199254740991):0},vn=function(t){return mn(t.length)},bn=Y,xn=fn,wn=vn,Sn=function(t){return function(e,i,n){var r,s=bn(e),a=wn(s),o=xn(n,a);if(t&&i!=i){for(;a>o;)if((r=s[o++])!=r)return!0}else for(;a>o;o++)if((t||o in s)&&s[o]===i)return t||o||0;return!t&&-1}},An={includes:Sn(!0),indexOf:Sn(!1)},_n=Kt,Cn=Y,Tn=An.indexOf,Bn=wi,Pn=R([].push),En=function(t,e){var i,n=Cn(t),r=0,s=[];for(i in n)!_n(Bn,i)&&_n(n,i)&&Pn(s,i);for(;e.length>r;)_n(n,i=e[r++])&&(~Tn(s,i)||Pn(s,i));return s},Mn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Rn=En,kn=Mn.concat("length","prototype");an.f=Object.getOwnPropertyNames||function(t){return Rn(t,kn)};var Dn={};Dn.f=Object.getOwnPropertySymbols;var In=rt,On=an,Ln=Dn,Un=Ne,Wn=R([].concat),Fn=In("Reflect","ownKeys")||function(t){var e=On.f(Un(t)),i=Ln.f;return i?Wn(e,i(t)):e},Nn=Kt,zn=Fn,jn=p,Hn=Oe,Gn=f,Vn=Z,Xn=/#|\.prototype\./,Yn=function(t,e){var i=Kn[qn(t)];return i==Zn||i!=$n&&(Vn(e)?Gn(e):!!e)},qn=Yn.normalize=function(t){return String(t).replace(Xn,".").toLowerCase()},Kn=Yn.data={},$n=Yn.NATIVE="N",Zn=Yn.POLYFILL="P",Jn=Yn,Qn=d,tr=p.f,er=ti,ir=sn,nr=Wt,rr=function(t,e,i){for(var n=zn(e),r=Hn.f,s=jn.f,a=0;a<n.length;a++){var o=n[a];Nn(t,o)||i&&Nn(i,o)||r(t,o,s(e,o))}},sr=Jn,ar=function(t,e){var i,r,s,a,o,h=t.target,c=t.global,l=t.stat;if(i=c?Qn:l?Qn[h]||nr(h,{}):(Qn[h]||{}).prototype)for(r in e){if(a=e[r],s=t.dontCallGetSet?(o=tr(i,r))&&o.value:i[r],!sr(c?r:h+(l?".":"#")+r,t.forced)&&void 0!==s){if(n(a)==n(s))continue;rr(a,s)}(t.sham||s&&s.sham)&&er(a,"sham",!0),ir(i,r,a,t)}},or={exports:{}},hr={},cr=be,lr=Oe,ur=T,dr=fn,pr=vn,fr=function(t,e,i){var n=cr(e);n in t?lr.f(t,n,ur(0,i)):t[n]=i},gr=Array,yr=Math.max,mr=O,vr=Y,br=an.f,xr=function(t,e,i){for(var n=pr(t),r=dr(e,n),s=dr(void 0===i?n:i,n),a=gr(yr(s-r,0)),o=0;r<s;r++,o++)fr(a,o,t[r]);return a.length=o,a},wr="object"==("undefined"==typeof window?"undefined":n(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];hr.f=function(t){return wr&&"Window"==mr(t)?function(t){try{return br(t)}catch(t){return xr(wr)}}(t):br(vr(t))};var Sr=f((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Ar=f,_r=et,Cr=O,Tr=Sr,Br=Object.isExtensible,Pr=Ar((function(){Br(1)}))||Tr?function(t){return!!_r(t)&&((!Tr||"ArrayBuffer"!=Cr(t))&&(!Br||Br(t)))}:Br,Er=!f((function(){return Object.isExtensible(Object.preventExtensions({}))})),Mr=ar,Rr=R,kr=wi,Dr=et,Ir=Kt,Or=Oe.f,Lr=an,Ur=hr,Wr=Pr,Fr=Er,Nr=!1,zr=te("meta"),jr=0,Hr=function(t){Or(t,zr,{value:{objectID:"O"+jr++,weakData:{}}})},Gr=or.exports={enable:function(){Gr.enable=function(){},Nr=!0;var t=Lr.f,e=Rr([].splice),i={};i[zr]=1,t(i).length&&(Lr.f=function(i){for(var n=t(i),r=0,s=n.length;r<s;r++)if(n[r]===zr){e(n,r,1);break}return n},Mr({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Ur.f}))},fastKey:function(t,e){if(!Dr(t))return"symbol"==n(t)?t:("string"==typeof t?"S":"P")+t;if(!Ir(t,zr)){if(!Wr(t))return"F";if(!e)return"E";Hr(t)}return t[zr].objectID},getWeakData:function(t,e){if(!Ir(t,zr)){if(!Wr(t))return!0;if(!e)return!1;Hr(t)}return t[zr].weakData},onFreeze:function(t){return Fr&&Nr&&Wr(t)&&!Ir(t,zr)&&Hr(t),t}};kr[zr]=!0;var Vr=or.exports,Xr=O,Yr=R,qr=function(t){if("Function"===Xr(t))return Yr(t)},Kr=Bt,$r=y,Zr=qr(qr.bind),Jr=function(t,e){return Kr(t),void 0===e?t:$r?Zr(t,e):function(){return t.apply(e,arguments)}},Qr={},ts=Qr,es=ce("iterator"),is=Array.prototype,ns={};ns[ce("toStringTag")]="z";var rs="[object z]"===String(ns),ss=Z,as=O,os=ce("toStringTag"),hs=Object,cs="Arguments"==as(function(){return arguments}()),ls=rs?as:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=hs(t),os))?i:cs?as(e):"Object"==(n=as(e))&&ss(e.callee)?"Arguments":n},us=ls,ds=Mt,ps=z,fs=Qr,gs=ce("iterator"),ys=function(t){if(!ps(t))return ds(t,gs)||ds(t,"@@iterator")||fs[us(t)]},ms=b,vs=Bt,bs=Ne,xs=At,ws=ys,Ss=TypeError,As=b,_s=Ne,Cs=Mt,Ts=Jr,Bs=b,Ps=Ne,Es=At,Ms=function(t){return void 0!==t&&(ts.Array===t||is[es]===t)},Rs=vn,ks=st,Ds=function(t,e){var i=arguments.length<2?ws(t):e;if(vs(i))return bs(ms(i,t));throw Ss(xs(t)+" is not iterable")},Is=ys,Os=function(t,e,i){var n,r;_s(t);try{if(!(n=Cs(t,"return"))){if("throw"===e)throw i;return i}n=As(n,t)}catch(t){r=!0,n=t}if("throw"===e)throw i;if(r)throw n;return _s(n),i},Ls=TypeError,Us=function(t,e){this.stopped=t,this.result=e},Ws=Us.prototype,Fs=function(t,e,i){var r,s,a,o,h,c,l,u=i&&i.that,d=!(!i||!i.AS_ENTRIES),p=!(!i||!i.IS_RECORD),f=!(!i||!i.IS_ITERATOR),g=!(!i||!i.INTERRUPTED),y=Ts(e,u),m=function(t){return r&&Os(r,"normal",t),new Us(!0,t)},v=function(t){return d?(Ps(t),g?y(t[0],t[1],m):y(t[0],t[1])):g?y(t,m):y(t)};if(p)r=t.iterator;else if(f)r=t;else{if(!(s=Is(t)))throw Ls(Es(t)+" is not iterable");if(Ms(s)){for(a=0,o=Rs(t);o>a;a++)if((h=v(t[a]))&&ks(Ws,h))return h;return new Us(!1)}r=Ds(t,s)}for(c=p?t.next:r.next;!(l=Bs(c,r)).done;){try{h=v(l.value)}catch(t){Os(r,"throw",t)}if("object"==n(h)&&h&&ks(Ws,h))return h}return new Us(!1)},Ns=st,zs=TypeError,js=function(t,e){if(Ns(e,t))return t;throw zs("Incorrect invocation")},Hs=ce("iterator"),Gs=!1;try{var Vs=0,Xs={next:function(){return{done:!!Vs++}},return:function(){Gs=!0}};Xs[Hs]=function(){return this},Array.from(Xs,(function(){throw 2}))}catch(t){}var Ys=Oe.f,qs=Kt,Ks=ce("toStringTag"),$s=function(t,e,i){t&&!i&&(t=t.prototype),t&&!qs(t,Ks)&&Ys(t,Ks,{configurable:!0,value:e})},Zs=R,Js=Bt,Qs=Z,ta=String,ea=TypeError,ia=function(t,e,i){try{return Zs(Js(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}},na=Ne,ra=function(t){if("object"==n(t)||Qs(t))return t;throw ea("Can't set "+ta(t)+" as a prototype")},sa=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=ia(Object.prototype,"__proto__","set"))(i,[]),e=i instanceof Array}catch(t){}return function(i,n){return na(i),ra(n),e?t(i,n):i.__proto__=n,i}}():void 0),aa=Z,oa=et,ha=sa,ca=ar,la=d,ua=R,da=Jn,pa=sn,fa=Vr,ga=Fs,ya=js,ma=Z,va=z,ba=et,xa=f,wa=function(t,e){if(!e&&!Gs)return!1;var i=!1;try{var n={};n[Hs]=function(){return{next:function(){return{done:i=!0}}}},t(n)}catch(t){}return i},Sa=$s,Aa=function(t,e,i){var n,r;return ha&&aa(n=e.constructor)&&n!==i&&oa(r=n.prototype)&&r!==i.prototype&&ha(t,r),t},_a=function(t,e,i){var n=-1!==t.indexOf("Map"),r=-1!==t.indexOf("Weak"),s=n?"set":"add",a=la[t],o=a&&a.prototype,h=a,c={},l=function(t){var e=ua(o[t]);pa(o,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(r&&!ba(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return r&&!ba(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(r&&!ba(t))&&e(this,0===t?0:t)}:function(t,i){return e(this,0===t?0:t,i),this})};if(da(t,!ma(a)||!(r||o.forEach&&!xa((function(){(new a).entries().next()})))))h=i.getConstructor(e,t,n,s),fa.enable();else if(da(t,!0)){var u=new h,d=u[s](r?{}:-0,1)!=u,p=xa((function(){u.has(1)})),f=wa((function(t){new a(t)})),g=!r&&xa((function(){for(var t=new a,e=5;e--;)t[s](e,e);return!t.has(-0)}));f||((h=e((function(t,e){ya(t,o);var i=Aa(new a,t,h);return va(e)||ga(e,i[s],{that:i,AS_ENTRIES:n}),i}))).prototype=o,o.constructor=h),(p||g)&&(l("delete"),l("has"),n&&l("get")),(g||d)&&l(s),r&&o.clear&&delete o.clear}return c[t]=h,ca({global:!0,constructor:!0,forced:h!=a},c),Sa(h,t),r||i.setStrong(h,t,n),h},Ca={},Ta=En,Ba=Mn,Pa=Object.keys||function(t){return Ta(t,Ba)},Ea=g,Ma=Le,Ra=Oe,ka=Ne,Da=Y,Ia=Pa;Ca.f=Ea&&!Ma?Object.defineProperties:function(t,e){ka(t);for(var i,n=Da(e),r=Ia(e),s=r.length,a=0;s>a;)Ra.f(t,i=r[a++],n[i]);return t};var Oa,La=rt("document","documentElement"),Ua=Ne,Wa=Ca,Fa=Mn,Na=wi,za=La,ja=Ae,Ha="prototype",Ga="script",Va=xi("IE_PROTO"),Xa=function(){},Ya=function(t){return"<"+Ga+">"+t+"</"+Ga+">"},qa=function(t){t.write(Ya("")),t.close();var e=t.parentWindow.Object;return t=null,e},Ka=function(){try{Oa=new ActiveXObject("htmlfile")}catch(t){}var t,e,i;Ka="undefined"!=typeof document?document.domain&&Oa?qa(Oa):(e=ja("iframe"),i="java"+Ga+":",e.style.display="none",za.appendChild(e),e.src=String(i),(t=e.contentWindow.document).open(),t.write(Ya("document.F=Object")),t.close(),t.F):qa(Oa);for(var n=Fa.length;n--;)delete Ka[Ha][Fa[n]];return Ka()};Na[Va]=!0;var $a,Za,Ja,Qa=Object.create||function(t,e){var i;return null!==t?(Xa[Ha]=Ua(t),i=new Xa,Xa[Ha]=null,i[Va]=t):i=Ka(),void 0===e?i:Wa.f(i,e)},to=Qi,eo=Oe,io=function(t,e,i){return i.get&&to(i.get,e,{getter:!0}),i.set&&to(i.set,e,{setter:!0}),eo.f(t,e,i)},no=sn,ro=function(t,e,i){for(var n in e)no(t,n,e[n],i);return t},so=!f((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),ao=Kt,oo=Z,ho=Xt,co=so,lo=xi("IE_PROTO"),uo=Object,po=uo.prototype,fo=co?uo.getPrototypeOf:function(t){var e=ho(t);if(ao(e,lo))return e[lo];var i=e.constructor;return oo(i)&&e instanceof i?i.prototype:e instanceof uo?po:null},go=f,yo=Z,mo=et,vo=fo,bo=sn,xo=ce("iterator"),wo=!1;[].keys&&("next"in(Ja=[].keys())?(Za=vo(vo(Ja)))!==Object.prototype&&($a=Za):wo=!0);var So=!mo($a)||go((function(){var t={};return $a[xo].call(t)!==t}));So&&($a={}),yo($a[xo])||bo($a,xo,(function(){return this}));var Ao={IteratorPrototype:$a,BUGGY_SAFARI_ITERATORS:wo},_o=Ao.IteratorPrototype,Co=Qa,To=T,Bo=$s,Po=Qr,Eo=function(){return this},Mo=ar,Ro=b,ko=Z,Do=function(t,e,i,n){var r=e+" Iterator";return t.prototype=Co(_o,{next:To(+!n,i)}),Bo(t,r,!1),Po[r]=Eo,t},Io=fo,Oo=sa,Lo=$s,Uo=ti,Wo=sn,Fo=Qr,No=oi.PROPER,zo=oi.CONFIGURABLE,jo=Ao.IteratorPrototype,Ho=Ao.BUGGY_SAFARI_ITERATORS,Go=ce("iterator"),Vo="keys",Xo="values",Yo="entries",qo=function(){return this},Ko=rt,$o=io,Zo=g,Jo=ce("species"),Qo=Qa,th=io,eh=ro,ih=Jr,nh=js,rh=z,sh=Fs,ah=function(t,e,i,n,r,s,a){Do(i,e,n);var o,h,c,l=function(t){if(t===r&&g)return g;if(!Ho&&t in p)return p[t];switch(t){case Vo:case Xo:case Yo:return function(){return new i(this,t)}}return function(){return new i(this)}},u=e+" Iterator",d=!1,p=t.prototype,f=p[Go]||p["@@iterator"]||r&&p[r],g=!Ho&&f||l(r),y="Array"==e&&p.entries||f;if(y&&(o=Io(y.call(new t)))!==Object.prototype&&o.next&&(Io(o)!==jo&&(Oo?Oo(o,jo):ko(o[Go])||Wo(o,Go,qo)),Lo(o,u,!0)),No&&r==Xo&&f&&f.name!==Xo&&(zo?Uo(p,"name",Xo):(d=!0,g=function(){return Ro(f,this)})),r)if(h={values:l(Xo),keys:s?g:l(Vo),entries:l(Yo)},a)for(c in h)(Ho||d||!(c in p))&&Wo(p,c,h[c]);else Mo({target:e,proto:!0,forced:Ho||d},h);return p[Go]!==g&&Wo(p,Go,g,{name:r}),Fo[e]=g,h},oh=function(t,e){return{value:t,done:e}},hh=function(t){var e=Ko(t);Zo&&e&&!e[Jo]&&$o(e,Jo,{configurable:!0,get:function(){return this}})},ch=g,lh=Vr.fastKey,uh=Oi.set,dh=Oi.getterFor,ph={getConstructor:function(t,e,i,n){var r=t((function(t,r){nh(t,s),uh(t,{type:e,index:Qo(null),first:void 0,last:void 0,size:0}),ch||(t.size=0),rh(r)||sh(r,t[n],{that:t,AS_ENTRIES:i})})),s=r.prototype,a=dh(e),o=function(t,e,i){var n,r,s=a(t),o=h(t,e);return o?o.value=i:(s.last=o={index:r=lh(e,!0),key:e,value:i,previous:n=s.last,next:void 0,removed:!1},s.first||(s.first=o),n&&(n.next=o),ch?s.size++:t.size++,"F"!==r&&(s.index[r]=o)),t},h=function(t,e){var i,n=a(t),r=lh(e);if("F"!==r)return n.index[r];for(i=n.first;i;i=i.next)if(i.key==e)return i};return eh(s,{clear:function(){for(var t=a(this),e=t.index,i=t.first;i;)i.removed=!0,i.previous&&(i.previous=i.previous.next=void 0),delete e[i.index],i=i.next;t.first=t.last=void 0,ch?t.size=0:this.size=0},delete:function(t){var e=this,i=a(e),n=h(e,t);if(n){var r=n.next,s=n.previous;delete i.index[n.index],n.removed=!0,s&&(s.next=r),r&&(r.previous=s),i.first==n&&(i.first=r),i.last==n&&(i.last=s),ch?i.size--:e.size--}return!!n},forEach:function(t){for(var e,i=a(this),n=ih(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:i.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!h(this,t)}}),eh(s,i?{get:function(t){var e=h(this,t);return e&&e.value},set:function(t,e){return o(this,0===t?0:t,e)}}:{add:function(t){return o(this,t=0===t?0:t,t)}}),ch&&th(s,"size",{configurable:!0,get:function(){return a(this).size}}),r},setStrong:function(t,e,i){var n=e+" Iterator",r=dh(e),s=dh(n);ah(t,e,(function(t,e){uh(this,{type:n,target:t,state:r(t),kind:e,last:void 0})}),(function(){for(var t=s(this),e=t.kind,i=t.last;i&&i.removed;)i=i.previous;return t.target&&(t.last=i=i?i.next:t.state.first)?oh("keys"==e?i.key:"values"==e?i.value:[i.key,i.value],!1):(t.target=void 0,oh(void 0,!0))}),i?"entries":"values",!i,!0),hh(e)}};_a("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),ph);var fh=O,gh=Array.isArray||function(t){return"Array"==fh(t)},yh=R,mh=f,vh=Z,bh=ls,xh=fi,wh=function(){},Sh=[],Ah=rt("Reflect","construct"),_h=/^\s*(?:class|function)\b/,Ch=yh(_h.exec),Th=!_h.exec(wh),Bh=function(t){if(!vh(t))return!1;try{return Ah(wh,Sh,t),!0}catch(t){return!1}},Ph=function(t){if(!vh(t))return!1;switch(bh(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Th||!!Ch(_h,xh(t))}catch(t){return!0}};Ph.sham=!0;var Eh=!Ah||mh((function(){var t;return Bh(Bh.call)||!Bh(Object)||!Bh((function(){t=!0}))||t}))?Ph:Bh,Mh=gh,Rh=Eh,kh=et,Dh=ce("species"),Ih=Array,Oh=function(t){var e;return Mh(t)&&(e=t.constructor,(Rh(e)&&(e===Ih||Mh(e.prototype))||kh(e)&&null===(e=e[Dh]))&&(e=void 0)),void 0===e?Ih:e},Lh=Jr,Uh=N,Wh=Xt,Fh=vn,Nh=function(t,e){return new(Oh(t))(0===e?0:e)},zh=R([].push),jh=function(t){var e=1==t,i=2==t,n=3==t,r=4==t,s=6==t,a=7==t,o=5==t||s;return function(h,c,l,u){for(var d,p,f=Wh(h),g=Uh(f),y=Lh(c,l),m=Fh(g),v=0,b=u||Nh,x=e?b(h,m):i||a?b(h,0):void 0;m>v;v++)if((o||v in g)&&(p=y(d=g[v],v,f),t))if(e)x[v]=p;else if(p)switch(t){case 3:return!0;case 5:return d;case 6:return v;case 2:zh(x,d)}else switch(t){case 4:return!1;case 7:zh(x,d)}return s?-1:n||r?r:x}},Hh={forEach:jh(0),map:jh(1),filter:jh(2),some:jh(3),every:jh(4),find:jh(5),findIndex:jh(6),filterReject:jh(7)},Gh=R,Vh=ro,Xh=Vr.getWeakData,Yh=js,qh=Ne,Kh=z,$h=et,Zh=Fs,Jh=Kt,Qh=Oi.set,tc=Oi.getterFor,ec=Hh.find,ic=Hh.findIndex,nc=Gh([].splice),rc=0,sc=function(t){return t.frozen||(t.frozen=new ac)},ac=function(){this.entries=[]},oc=function(t,e){return ec(t.entries,(function(t){return t[0]===e}))};ac.prototype={get:function(t){var e=oc(this,t);if(e)return e[1]},has:function(t){return!!oc(this,t)},set:function(t,e){var i=oc(this,t);i?i[1]=e:this.entries.push([t,e])},delete:function(t){var e=ic(this.entries,(function(e){return e[0]===t}));return~e&&nc(this.entries,e,1),!!~e}};var hc,cc={getConstructor:function(t,e,i,n){var r=t((function(t,r){Yh(t,s),Qh(t,{type:e,id:rc++,frozen:void 0}),Kh(r)||Zh(r,t[n],{that:t,AS_ENTRIES:i})})),s=r.prototype,a=tc(e),o=function(t,e,i){var n=a(t),r=Xh(qh(e),!0);return!0===r?sc(n).set(e,i):r[n.id]=i,t};return Vh(s,{delete:function(t){var e=a(this);if(!$h(t))return!1;var i=Xh(t);return!0===i?sc(e).delete(t):i&&Jh(i,e.id)&&delete i[e.id]},has:function(t){var e=a(this);if(!$h(t))return!1;var i=Xh(t);return!0===i?sc(e).has(t):i&&Jh(i,e.id)}}),Vh(s,i?{get:function(t){var e=a(this);if($h(t)){var i=Xh(t);return!0===i?sc(e).get(t):i?i[e.id]:void 0}},set:function(t,e){return o(this,t,e)}}:{add:function(t){return o(this,t,!0)}}),r}},lc=Er,uc=d,dc=R,pc=ro,fc=Vr,gc=_a,yc=cc,mc=et,vc=Oi.enforce,bc=f,xc=mi,wc=Object,Sc=Array.isArray,Ac=wc.isExtensible,_c=wc.isFrozen,Cc=wc.isSealed,Tc=wc.freeze,Bc=wc.seal,Pc={},Ec={},Mc=!uc.ActiveXObject&&"ActiveXObject"in uc,Rc=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},kc=gc("WeakMap",Rc,yc),Dc=kc.prototype,Ic=dc(Dc.set);if(xc)if(Mc){hc=yc.getConstructor(Rc,"WeakMap",!0),fc.enable();var Oc=dc(Dc.delete),Lc=dc(Dc.has),Uc=dc(Dc.get);pc(Dc,{delete:function(t){if(mc(t)&&!Ac(t)){var e=vc(this);return e.frozen||(e.frozen=new hc),Oc(this,t)||e.frozen.delete(t)}return Oc(this,t)},has:function(t){if(mc(t)&&!Ac(t)){var e=vc(this);return e.frozen||(e.frozen=new hc),Lc(this,t)||e.frozen.has(t)}return Lc(this,t)},get:function(t){if(mc(t)&&!Ac(t)){var e=vc(this);return e.frozen||(e.frozen=new hc),Lc(this,t)?Uc(this,t):e.frozen.get(t)}return Uc(this,t)},set:function(t,e){if(mc(t)&&!Ac(t)){var i=vc(this);i.frozen||(i.frozen=new hc),Lc(this,t)?Ic(this,t,e):i.frozen.set(t,e)}else Ic(this,t,e);return this}})}else lc&&bc((function(){var t=Tc([]);return Ic(new kc,t,1),!_c(t)}))&&pc(Dc,{set:function(t,e){var i;return Sc(t)&&(_c(t)?i=Pc:Cc(t)&&(i=Ec)),Ic(this,t,e),i==Pc&&Tc(t),i==Ec&&Bc(t),this}});var Wc=rt,Fc=R,Nc=Ht,zc=Wc("Map"),jc=Wc("WeakMap"),Hc=Fc([].push),Gc=Nc("metadata"),Vc=Gc.store||(Gc.store=new jc),Xc=function(t,e,i){var n=Vc.get(t);if(!n){if(!i)return;Vc.set(t,n=new zc)}var r=n.get(e);if(!r){if(!i)return;n.set(e,r=new zc)}return r},Yc={store:Vc,getMap:Xc,has:function(t,e,i){var n=Xc(e,i,!1);return void 0!==n&&n.has(t)},get:function(t,e,i){var n=Xc(e,i,!1);return void 0===n?void 0:n.get(t)},set:function(t,e,i,n){Xc(i,n,!0).set(t,e)},keys:function(t,e){var i=Xc(t,e,!1),n=[];return i&&i.forEach((function(t,e){Hc(n,e)})),n},toKey:function(t){return void 0===t||"symbol"==n(t)?t:String(t)}},qc=Ne,Kc=Yc.toKey,$c=Yc.set;ar({target:"Reflect",stat:!0},{defineMetadata:function(t,e,i){var n=arguments.length<4?void 0:Kc(arguments[3]);$c(t,e,qc(i),n)}});var Zc=Ne,Jc=Yc.toKey,Qc=Yc.getMap,tl=Yc.store;ar({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var i=arguments.length<3?void 0:Jc(arguments[2]),n=Qc(Zc(e),i,!1);if(void 0===n||!n.delete(t))return!1;if(n.size)return!0;var r=tl.get(e);return r.delete(i),!!r.size||tl.delete(e)}});var el=Ne,il=fo,nl=Yc.has,rl=Yc.get,sl=Yc.toKey,al=function t(e,i,n){if(nl(e,i,n))return rl(e,i,n);var r=il(i);return null!==r?t(e,r,n):void 0};ar({target:"Reflect",stat:!0},{getMetadata:function(t,e){var i=arguments.length<3?void 0:sl(arguments[2]);return al(t,el(e),i)}});var ol=R,hl=Map.prototype,cl={Map:Map,set:ol(hl.set),get:ol(hl.get),has:ol(hl.has),remove:ol(hl.delete),proto:hl},ll=b,ul=R,dl=function(t,e,i){for(var n,r,s=i||t.next;!(n=ll(s,t)).done;)if(void 0!==(r=e(n.value)))return r},pl=cl.Map,fl=cl.proto,gl=ul(fl.forEach),yl=ul(fl.entries),ml=yl(new pl).next,vl=Bt,bl=z,xl=vn,wl=Xt,Sl=function(t,e,i){return i?dl(yl(t),(function(t){return e(t[1],t[0])}),ml):gl(t,e)},Al=cl.Map,_l=cl.has,Cl=cl.set,Tl=R([].push),Bl=ar,Pl=R,El=Yc,Ml=Ne,Rl=fo,kl=Pl((function(t){var e,i,n,r=wl(this),s=xl(r),a=[],o=new Al,h=bl(t)?function(t){return t}:vl(t);for(e=0;e<s;e++)n=h(i=r[e]),_l(o,n)||Cl(o,n,i);return Sl(o,(function(t){Tl(a,t)})),a})),Dl=Pl([].concat),Il=El.keys,Ol=El.toKey,Ll=function t(e,i){var n=Il(e,i),r=Rl(e);if(null===r)return n;var s=t(r,i);return s.length?n.length?kl(Dl(n,s)):s:n};Bl({target:"Reflect",stat:!0},{getMetadataKeys:function(t){var e=arguments.length<2?void 0:Ol(arguments[1]);return Ll(Ml(t),e)}});var Ul=Ne,Wl=Yc.get,Fl=Yc.toKey;ar({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var i=arguments.length<3?void 0:Fl(arguments[2]);return Wl(t,Ul(e),i)}});var Nl=Ne,zl=Yc.keys,jl=Yc.toKey;ar({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:jl(arguments[1]);return zl(Nl(t),e)}});var Hl=Ne,Gl=fo,Vl=Yc.has,Xl=Yc.toKey,Yl=function t(e,i,n){if(Vl(e,i,n))return!0;var r=Gl(i);return null!==r&&t(e,r,n)};ar({target:"Reflect",stat:!0},{hasMetadata:function(t,e){var i=arguments.length<3?void 0:Xl(arguments[2]);return Yl(t,Hl(e),i)}});var ql=Ne,Kl=Yc.has,$l=Yc.toKey;ar({target:"Reflect",stat:!0},{hasOwnMetadata:function(t,e){var i=arguments.length<3?void 0:$l(arguments[2]);return Kl(t,ql(e),i)}});var Zl=Ne,Jl=Yc.toKey,Ql=Yc.set;ar({target:"Reflect",stat:!0},{metadata:function(t,e){return function(i,n){Ql(t,e,Zl(i),Jl(n))}}});var tu="named",eu="name",iu="unmanaged",nu="optional",ru="inject",su="multi_inject",au="inversify:tagged",ou="inversify:tagged_props",hu="inversify:paramtypes",cu="post_construct",lu="pre_destroy";var uu=[ru,su,eu,iu,tu,nu],du={Request:"Request",Singleton:"Singleton",Transient:"Transient"},pu={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},fu={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},gu=0;function yu(){return gu++}var mu=function(){function t(t,e){this.id=yu(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=pu.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===du.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.onDeactivation=this.onDeactivation,e.cache=this.cache,e},t}(),vu="Metadata key was used more than once in a parameter:",bu="NULL argument",xu="Key Not Found",wu="Ambiguous match found for serviceIdentifier:",Su="No matching bindings found for serviceIdentifier:",Au="Missing required @injectable annotation in:",_u="Missing required @inject or @multiInject annotation in:",Cu="Circular dependency found:",Tu="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",Bu=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},Pu=function(t,e){return"@postConstruct error in class "+t+": "+e},Eu=function(t,e){return"@preDestroy error in class "+t+": "+e},Mu=function(t,e){return"onDeactivation() error in class "+t+": "+e},Ru="Maximum call stack size exceeded",ku=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(hu,t),userGeneratedMetadata:Reflect.getMetadata(au,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(ou,t)||[]},t}(),Du={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function Iu(t){return t instanceof RangeError||t.message===Ru}function Ou(t){return"function"==typeof t?t.name:"symbol"===n(t)?t.toString():t}function Lu(t,e,i){var n="",r=i(t,e);return 0!==r.length&&(n="\nRegistered bindings:",r.forEach((function(t){var e="Object";null!==t.implementationType&&(e=Fu(t.implementationType)),n=n+"\n "+e,t.constraint.metaData&&(n=n+" - "+t.constraint.metaData)}))),n}function Uu(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||Uu(t.parentRequest,e))}function Wu(t){t.childRequests.forEach((function(t){if(Uu(t,t.serviceIdentifier)){var e=function(t){var e=function t(e,i){void 0===i&&(i=[]);var n=Ou(e.serviceIdentifier);return i.push(n),null!==e.parentRequest?t(e.parentRequest,i):i}(t);return e.reverse().join(" --\x3e ")}(t);throw new Error(Cu+" "+e)}Wu(t)}))}function Fu(t){if(t.name)return t.name;var e=t.toString(),i=e.match(/^function\s*([^\s(]+)/);return i?i[1]:"Anonymous function: "+e}var Nu=function(){function t(t){this.id=yu(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}(),zu=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===tu?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},t}(),ju=function(t,e){this.parentContext=t,this.rootRequest=e},Hu=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}(),Gu=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,i=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},i)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}(),Vu=function(){function t(t,e,i,r){this.id=yu(),this.type=t,this.serviceIdentifier=i;var s="symbol"===n(e)?e.toString().slice(7,-1):e;this.name=new Gu(s||""),this.identifier=e,this.metadata=new Array;var a=null;"string"==typeof r?a=new zu(tu,r):r instanceof zu&&(a=r),null!==a&&this.metadata.push(a)}return t.prototype.hasTag=function(t){for(var e=0,i=this.metadata;e<i.length;e++){if(i[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(su)},t.prototype.matchesArray=function(t){return this.matchesTag(su)(t)},t.prototype.isNamed=function(){return this.hasTag(tu)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return uu.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(nu)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===tu}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return uu.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(tu)(t)},t.prototype.matchesTag=function(t){var e=this;return function(i){for(var n=0,r=e.metadata;n<r.length;n++){var s=r[n];if(s.key===t&&s.value===i)return!0}return!1}},t}(),Xu=function(t,e,i){if(i||2===arguments.length)for(var n,r=0,s=e.length;r<s;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))};function Yu(t,e,i,n){var r=t.getConstructorMetadata(i),s=r.compilerGeneratedMetadata;if(void 0===s)throw new Error(Au+" "+e+".");var a=r.userGeneratedMetadata,o=Object.keys(a),h=0===i.length&&o.length>0,c=o.length>i.length,l=function(t,e,i,n,r){for(var s=[],a=0;a<r;a++){var o=qu(a,t,e,i,n);null!==o&&s.push(o)}return s}(n,e,s,a,h||c?o.length:i.length),u=$u(t,i,e);return Xu(Xu([],l,!0),u,!0)}function qu(t,e,i,n,r){var s=r[t.toString()]||[],a=Ju(s),o=!0!==a.unmanaged,h=n[t],c=a.inject||a.multiInject;if((h=c||h)instanceof Hu&&(h=h.unwrap()),o){if(!e&&(h===Object||h===Function||void 0===h))throw new Error(_u+" argument "+t+" in class "+i+".");var l=new Vu(fu.ConstructorArgument,a.targetName,h);return l.metadata=s,l}return null}function Ku(t,e,i,n){var r=t||e;if(void 0===r){var s=Au+" for property "+String(i)+" in class "+n+".";throw new Error(s)}return r}function $u(t,e,i){for(var n=t.getPropertiesMetadata(e),r=[],s=Object.getOwnPropertySymbols(n),a=0,o=Object.keys(n).concat(s);a<o.length;a++){var h=o[a],c=n[h],l=Ju(c),u=l.targetName||h,d=Ku(l.inject,l.multiInject,h,i),p=new Vu(fu.ClassProperty,u,d);p.metadata=c,r.push(p)}var f=Object.getPrototypeOf(e.prototype).constructor;if(f!==Object){var g=$u(t,f,i);r=Xu(Xu([],r,!0),g,!0)}return r}function Zu(t,e){var i=Object.getPrototypeOf(e.prototype).constructor;if(i!==Object){var n=Yu(t,Fu(i),i,!0),r=n.map((function(t){return t.metadata.filter((function(t){return t.key===iu}))})),s=[].concat.apply([],r).length,a=n.length-s;return a>0?a:Zu(t,i)}return 0}function Ju(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[ru],multiInject:e[su],targetName:e[eu],unmanaged:e[iu]}}var Qu=function(){function t(t,e,i,n,r){this.id=yu(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=i,this.target=r,this.childRequests=[],this.bindings=Array.isArray(n)?n:[n],this.requestScope=null===i?new Map:null}return t.prototype.addChildRequest=function(e,i,n){var r=new t(e,this.parentContext,this,i,n);return this.childRequests.push(r),r},t}();function td(t){return t._bindingDictionary}function ed(t,e,i,n,r){var s=nd(i.container,r.serviceIdentifier),a=[];return s.length===Du.NoBindingsAvailable&&i.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(i.container.bind(r.serviceIdentifier).toSelf(),s=nd(i.container,r.serviceIdentifier)),a=e?s:s.filter((function(t){var e=new Qu(t.serviceIdentifier,i,n,t,r);return t.constraint(e)})),function(t,e,i,n){switch(e.length){case Du.NoBindingsAvailable:if(i.isOptional())return e;var r=Ou(t),s=Su;throw s+=function(t,e){if(e.isTagged()||e.isNamed()){var i="",n=e.getNamedTag(),r=e.getCustomTags();return null!==n&&(i+=n.toString()+"\n"),null!==r&&r.forEach((function(t){i+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+i}return" "+t}(r,i),s+=Lu(n,r,nd),new Error(s);case Du.OnlyOneBindingAvailable:return e;case Du.MultipleBindingsAvailable:default:if(i.isArray())return e;r=Ou(t),s=wu+" "+r;throw s+=Lu(n,r,nd),new Error(s)}}(r.serviceIdentifier,a,r,i.container),a}function id(t,e,i,n,r,s){var a,o;if(null===r){a=ed(t,e,n,null,s),o=new Qu(i,n,null,a,s);var h=new ju(n,o);n.addPlan(h)}else a=ed(t,e,n,r,s),o=r.addChildRequest(s.serviceIdentifier,a,s);a.forEach((function(e){var i=null;if(s.isArray())i=o.addChildRequest(e.serviceIdentifier,e,s);else{if(e.cache)return;i=o}if(e.type===pu.Instance&&null!==e.implementationType){var r=function(t,e){return Yu(t,Fu(e),e,!1)}(t,e.implementationType);if(!n.container.options.skipBaseClassChecks){var a=Zu(t,e.implementationType);if(r.length<a){var h=Bu(Fu(e.implementationType));throw new Error(h)}}r.forEach((function(e){id(t,!1,e.serviceIdentifier,n,i,e)}))}}))}function nd(t,e){var i=[],n=td(t);return n.hasKey(e)?i=n.get(e):null!==t.parent&&(i=nd(t.parent,e)),i}function rd(t,e,i,n,r,s,a,o){void 0===o&&(o=!1);var h=new Nu(e),c=function(t,e,i,n,r,s){var a=new zu(t?su:ru,i),o=new Vu(e,n,i,a);if(void 0!==r){var h=new zu(r,s);o.metadata.push(h)}return o}(i,n,r,"",s,a);try{return id(t,o,r,h,null,c),h}catch(t){throw Iu(t)&&Wu(h.plan.rootRequest),t}}function sd(t){return("object"===n(t)&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function ad(t){return!!sd(t)||Array.isArray(t)&&t.some(sd)}var od,hd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))},cd=function(t,e){var i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},ld=function(t,e,i){t.has(e.id)||t.set(e.id,i)},ud=function(t,e){t.cache=e,t.activated=!0,sd(e)&&dd(t,e)},dd=function(t,e){return hd(void 0,void 0,void 0,(function(){var i,n;return cd(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e];case 1:return i=r.sent(),t.cache=i,[3,3];case 2:throw n=r.sent(),t.cache=null,t.activated=!1,n;case 3:return[2]}}))}))};!function(t){t.DynamicValue="toDynamicValue",t.Factory="toFactory",t.Provider="toProvider"}(od||(od={}));var pd=function(){return pd=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},pd.apply(this,arguments)},fd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))},gd=function(t,e){var i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},yd=function(t,e,i){if(i||2===arguments.length)for(var n,r=0,s=e.length;r<s;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))};function md(t,e,i){var n;if(e.length>0){var r=function(t,e){return t.reduce((function(t,i){var n=e(i);return i.target.type===fu.ConstructorArgument?t.constructorInjections.push(n):(t.propertyRequests.push(i),t.propertyInjections.push(n)),t.isAsync||(t.isAsync=ad(n)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,i),s=pd(pd({},r),{constr:t});n=r.isAsync?function(t){return fd(this,void 0,void 0,(function(){var e,i;return gd(this,(function(n){switch(n.label){case 0:return[4,bd(t.constructorInjections)];case 1:return e=n.sent(),[4,bd(t.propertyInjections)];case 2:return i=n.sent(),[2,vd(pd(pd({},t),{constructorInjections:e,propertyInjections:i}))]}}))}))}(s):vd(s)}else n=new t;return n}function vd(t){var e,i=new((e=t.constr).bind.apply(e,yd([void 0],t.constructorInjections,!1)));return t.propertyRequests.forEach((function(e,n){var r=e.target.identifier,s=t.propertyInjections[n];i[r]=s})),i}function bd(t){return fd(this,void 0,void 0,(function(){var e,i,n,r;return gd(this,(function(s){for(e=[],i=0,n=t;i<n.length;i++)r=n[i],Array.isArray(r)?e.push(Promise.all(r)):e.push(r);return[2,Promise.all(e)]}))}))}function xd(t,e){var i=function(t,e){var i,n;if(Reflect.hasMetadata(cu,t)){var r=Reflect.getMetadata(cu,t);try{return null===(n=(i=e)[r.value])||void 0===n?void 0:n.call(i)}catch(e){throw new Error(Pu(t.name,e.message))}}}(t,e);return sd(i)?i.then((function(){return e})):e}function wd(t,e){t.scope!==du.Singleton&&function(t,e){var i="Class cannot be instantiated in "+(t.scope===du.Request?"request":"transient")+" scope.";if("function"==typeof t.onDeactivation)throw new Error(Mu(e.name,i));if(Reflect.hasMetadata(lu,e))throw new Error(Eu(e.name,i))}(t,e)}var Sd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))},Ad=function(t,e){var i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},_d=function t(e){return function(i){i.parentContext.setCurrentRequest(i);var n=i.bindings,r=i.childRequests,s=i.target&&i.target.isArray(),a=!(i.parentRequest&&i.parentRequest.target&&i.target&&i.parentRequest.target.matchesArray(i.target.serviceIdentifier));if(s&&a)return r.map((function(i){return t(e)(i)}));if(!i.target.isOptional()||0!==n.length){var o=n[0];return Pd(e,i,o)}}},Cd=function(t,e){var i=function(t){switch(t.type){case pu.Factory:return{factory:t.factory,factoryType:od.Factory};case pu.Provider:return{factory:t.provider,factoryType:od.Provider};case pu.DynamicValue:return{factory:t.dynamicValue,factoryType:od.DynamicValue};default:throw new Error("Unexpected factory type "+t.type)}}(t);return function(t,e){try{return t()}catch(t){throw Iu(t)&&(t=e()),t}}((function(){return i.factory.bind(t)(e)}),(function(){return new Error((t=i.factoryType,n=e.currentRequest.serviceIdentifier.toString(),"It looks like there is a circular dependency in one of the '"+t+"' bindings. Please investigate bindings withservice identifier '"+n+"'."));var t,n}))},Td=function(t,e,i){var n,r=e.childRequests;switch(function(t){var e=null;switch(t.type){case pu.ConstantValue:case pu.Function:e=t.cache;break;case pu.Constructor:case pu.Instance:e=t.implementationType;break;case pu.DynamicValue:e=t.dynamicValue;break;case pu.Provider:e=t.provider;break;case pu.Factory:e=t.factory}if(null===e){var i=Ou(t.serviceIdentifier);throw new Error("Invalid binding type: "+i)}}(i),i.type){case pu.ConstantValue:case pu.Function:n=i.cache;break;case pu.Constructor:n=i.implementationType;break;case pu.Instance:n=function(t,e,i,n){wd(t,e);var r=md(e,i,n);return sd(r)?r.then((function(t){return xd(e,t)})):xd(e,r)}(i,i.implementationType,r,_d(t));break;default:n=Cd(i,e.parentContext)}return n},Bd=function(t,e,i){var n=function(t,e){return e.scope===du.Singleton&&e.activated?e.cache:e.scope===du.Request&&t.has(e.id)?t.get(e.id):null}(t,e);return null!==n||function(t,e,i){e.scope===du.Singleton&&ud(e,i),e.scope===du.Request&&ld(t,e,i)}(t,e,n=i()),n},Pd=function(t,e,i){return Bd(t,i,(function(){var n=Td(t,e,i);return n=sd(n)?n.then((function(t){return Ed(e,i,t)})):Ed(e,i,n)}))};function Ed(t,e,i){var n,r=Md(t.parentContext,e,i),s=Id(t.parentContext.container),a=s.next();do{n=a.value;var o=t.parentContext,h=t.serviceIdentifier,c=Dd(n,h);r=sd(r)?kd(c,o,r):Rd(c,o,r),a=s.next()}while(!0!==a.done&&!td(n).hasKey(t.serviceIdentifier));return r}var Md=function(t,e,i){return"function"==typeof e.onActivation?e.onActivation(t,i):i},Rd=function(t,e,i){for(var n=t.next();!n.done;){if(sd(i=n.value(e,i)))return kd(t,e,i);n=t.next()}return i},kd=function(t,e,i){return Sd(void 0,void 0,void 0,(function(){var n,r;return Ad(this,(function(s){switch(s.label){case 0:return[4,i];case 1:n=s.sent(),r=t.next(),s.label=2;case 2:return r.done?[3,4]:[4,r.value(e,n)];case 3:return n=s.sent(),r=t.next(),[3,2];case 4:return[2,n]}}))}))},Dd=function(t,e){var i=t._activations;return i.hasKey(e)?i.get(e).values():[].values()},Id=function(t){for(var e=[t],i=t.parent;null!==i;)e.push(i),i=i.parent;return{next:function(){var t=e.pop();return void 0!==t?{done:!1,value:t}:{done:!0,value:void 0}}}};var Od=function t(e,i){var n=e.parentRequest;return null!==n&&(!!i(n)||t(n,i))},Ld=function(t){return function(e){var i=function(i){return null!==i&&null!==i.target&&i.target.matchesTag(t)(e)};return i.metaData=new zu(t,e),i}},Ud=Ld(tu),Wd=function(t){return function(e){var i=null;if(null!==e){if(i=e.bindings[0],"string"==typeof t)return i.serviceIdentifier===t;var n=e.bindings[0].implementationType;return t===n}return!1}},Fd=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new Nd(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=Ud(t),new Nd(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t&&(null!==t.target&&!t.target.isNamed()&&!t.target.isTagged())},new Nd(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=Ld(t)(e),new Nd(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return null!==e&&Wd(t)(e.parentRequest)},new Nd(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Ud(t)(e.parentRequest)},new Nd(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&Ld(t)(e)(i.parentRequest)},new Nd(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&Od(e,Wd(t))},new Nd(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&!Od(e,Wd(t))},new Nd(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Od(e,Ud(t))},new Nd(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&!Od(e,Ud(t))},new Nd(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&Od(i,Ld(t)(e))},new Nd(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&!Od(i,Ld(t)(e))},new Nd(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&Od(e,t)},new Nd(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&!Od(e,t)},new Nd(this._binding)},t}(),Nd=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new Fd(this._binding)},t.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new Fd(this._binding)},t}(),zd=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Fd(this._binding),this._bindingOnSyntax=new Nd(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),jd=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=du.Request,new zd(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=du.Transient,new zd(this._binding)},t}(),Hd=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Fd(this._binding),this._bindingOnSyntax=new Nd(this._binding),this._bindingInSyntax=new jd(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),Gd=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=pu.Instance,this._binding.implementationType=t,new Hd(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=pu.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=pu.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Hd(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=pu.Constructor,this._binding.implementationType=t,this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=pu.Factory,this._binding.factory=t,this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error("Value provided to function binding must be a function!");var e=this.toConstantValue(t);return this._binding.type=pu.Function,this._binding.scope=du.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=pu.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toAutoNamedFactory=function(t){return this._binding.type=pu.Factory,this._binding.factory=function(e){return function(i){return e.container.getNamed(t,i)}},new zd(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=pu.Provider,this._binding.provider=t,this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}(),Vd=function(){function t(){}return t.of=function(e,i,n,r,s){var a=new t;return a.bindings=e,a.middleware=i,a.deactivations=r,a.activations=n,a.moduleActivationStore=s,a},t}();var Xd=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(bu);if(null==e)throw new Error(bu);var i=this._map.get(t);void 0!==i?i.push(e):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(bu);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(xu)},t.prototype.remove=function(t){if(null==t)throw new Error(bu);if(!this._map.delete(t))throw new Error(xu)},t.prototype.removeIntersection=function(t){var e=this;this.traverse((function(i,n){var r=t.hasKey(i)?t.get(i):void 0;if(void 0!==r){var s=n.filter((function(t){return!r.some((function(e){return t===e}))}));e._setValue(i,s)}}))},t.prototype.removeByCondition=function(t){var e=this,i=[];return this._map.forEach((function(n,r){for(var s=[],a=0,o=n;a<o.length;a++){var h=o[a];t(h)?i.push(h):s.push(h)}e._setValue(r,s)})),i},t.prototype.hasKey=function(t){if(null==t)throw new Error(bu);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,i){t.forEach((function(t){return e.add(i,"object"===n(r=t)&&null!==r&&"clone"in r&&"function"==typeof r.clone?t.clone():t);var r}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,i){t(i,e)}))},t.prototype._setValue=function(t,e){e.length>0?this._map.set(t,e):this._map.delete(t)},t}(),Yd=function(){function t(){this._map=new Map}return t.prototype.remove=function(t){if(this._map.has(t)){var e=this._map.get(t);return this._map.delete(t),e}return this._getEmptyHandlersStore()},t.prototype.addDeactivation=function(t,e,i){this._getModuleActivationHandlers(t).onDeactivations.add(e,i)},t.prototype.addActivation=function(t,e,i){this._getModuleActivationHandlers(t).onActivations.add(e,i)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,i){e._map.set(i,{onActivations:t.onActivations.clone(),onDeactivations:t.onDeactivations.clone()})})),e},t.prototype._getModuleActivationHandlers=function(t){var e=this._map.get(t);return void 0===e&&(e=this._getEmptyHandlersStore(),this._map.set(t,e)),e},t.prototype._getEmptyHandlersStore=function(){return{onActivations:new Xd,onDeactivations:new Xd}},t}(),qd=function(){return qd=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},qd.apply(this,arguments)},Kd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))},$d=function(t,e){var i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},Zd=function(t,e,i){if(i||2===arguments.length)for(var n,r=0,s=e.length;r<s;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))},Jd=function(){function t(t){var e=t||{};if("object"!==n(e))throw new Error("Invalid Container constructor argument. Container options must be an object.");if(void 0===e.defaultScope)e.defaultScope=du.Transient;else if(e.defaultScope!==du.Singleton&&e.defaultScope!==du.Transient&&e.defaultScope!==du.Request)throw new Error("Invalid Container option. Default scope must be a string ('singleton' or 'transient').");if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error("Invalid Container option. Auto bind injectable must be a boolean");if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error("Invalid Container option. Skip base check must be a boolean");this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=yu(),this._bindingDictionary=new Xd,this._snapshots=[],this._middleware=null,this._activations=new Xd,this._deactivations=new Xd,this.parent=null,this._metadataReader=new ku,this._moduleActivationStore=new Yd}return t.merge=function(e,i){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=new t,a=Zd([e,i],n,!0).map((function(t){return td(t)})),o=td(s);return a.forEach((function(t){var e;e=o,t.traverse((function(t,i){i.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))})),s},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=this._getContainerModuleHelpersFactory(),n=0,r=t;n<r.length;n++){var s=r[n],a=i(s.id);s.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction,a.unbindAsyncFunction,a.onActivationFunction,a.onDeactivationFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Kd(this,void 0,void 0,(function(){var e,i,n,r,s;return $d(this,(function(a){switch(a.label){case 0:e=this._getContainerModuleHelpersFactory(),i=0,n=t,a.label=1;case 1:return i<n.length?(r=n[i],s=e(r.id),[4,r.registry(s.bindFunction,s.unbindFunction,s.isboundFunction,s.rebindFunction,s.unbindAsyncFunction,s.onActivationFunction,s.onDeactivationFunction)]):[3,4];case 2:a.sent(),a.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];e.forEach((function(e){var i=t._removeModuleBindings(e.id);t._deactivateSingletons(i),t._removeModuleHandlers(e.id)}))},t.prototype.unloadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Kd(this,void 0,void 0,(function(){var e,i,n,r;return $d(this,(function(s){switch(s.label){case 0:e=0,i=t,s.label=1;case 1:return e<i.length?(n=i[e],r=this._removeModuleBindings(n.id),[4,this._deactivateSingletonsAsync(r)]):[3,4];case 2:s.sent(),this._removeModuleHandlers(n.id),s.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},t.prototype.bind=function(t){var e=this.options.defaultScope||du.Transient,i=new mu(t,e);return this._bindingDictionary.add(t,i),new Gd(i)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.rebindAsync=function(t){return Kd(this,void 0,void 0,(function(){return $d(this,(function(e){switch(e.label){case 0:return[4,this.unbindAsync(t)];case 1:return e.sent(),[2,this.bind(t)]}}))}))},t.prototype.unbind=function(t){if(this._bindingDictionary.hasKey(t)){var e=this._bindingDictionary.get(t);this._deactivateSingletons(e)}this._removeServiceFromDictionary(t)},t.prototype.unbindAsync=function(t){return Kd(this,void 0,void 0,(function(){var e;return $d(this,(function(i){switch(i.label){case 0:return this._bindingDictionary.hasKey(t)?(e=this._bindingDictionary.get(t),[4,this._deactivateSingletonsAsync(e)]):[3,2];case 1:i.sent(),i.label=2;case 2:return this._removeServiceFromDictionary(t),[2]}}))}))},t.prototype.unbindAll=function(){var t=this;this._bindingDictionary.traverse((function(e,i){t._deactivateSingletons(i)})),this._bindingDictionary=new Xd},t.prototype.unbindAllAsync=function(){return Kd(this,void 0,void 0,(function(){var t,e=this;return $d(this,(function(i){switch(i.label){case 0:return t=[],this._bindingDictionary.traverse((function(i,n){t.push(e._deactivateSingletonsAsync(n))})),[4,Promise.all(t)];case 1:return i.sent(),this._bindingDictionary=new Xd,[2]}}))}))},t.prototype.onActivation=function(t,e){this._activations.add(t,e)},t.prototype.onDeactivation=function(t,e){this._deactivations.add(t,e)},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isCurrentBound=function(t){return this._bindingDictionary.hasKey(t)},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,tu,e)},t.prototype.isBoundTagged=function(t,e,i){var n=!1;if(this._bindingDictionary.hasKey(t)){var r=this._bindingDictionary.get(t),s=function(t,e,i,n){var r=new Vu(fu.Variable,"",e,new zu(i,n)),s=new Nu(t);return new Qu(e,s,null,[],r)}(this,t,e,i);n=r.some((function(t){return t.constraint(s)}))}return!n&&this.parent&&(n=this.parent.isBoundTagged(t,e,i)),n},t.prototype.snapshot=function(){this._snapshots.push(Vd.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error("No snapshot available to restore.");this._bindingDictionary=t.bindings,this._activations=t.activations,this._deactivations=t.deactivations,this._middleware=t.middleware,this._moduleActivationStore=t.moduleActivationStore},t.prototype.createChild=function(e){var i=new t(e||this.options);return i.parent=this,i},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),i)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){var e=this._getNotAllArgs(t,!1);return this._getButThrowIfAsync(e)},t.prototype.getAsync=function(t){return Kd(this,void 0,void 0,(function(){var e;return $d(this,(function(i){return e=this._getNotAllArgs(t,!1),[2,this._get(e)]}))}))},t.prototype.getTagged=function(t,e,i){var n=this._getNotAllArgs(t,!1,e,i);return this._getButThrowIfAsync(n)},t.prototype.getTaggedAsync=function(t,e,i){return Kd(this,void 0,void 0,(function(){var n;return $d(this,(function(r){return n=this._getNotAllArgs(t,!1,e,i),[2,this._get(n)]}))}))},t.prototype.getNamed=function(t,e){return this.getTagged(t,tu,e)},t.prototype.getNamedAsync=function(t,e){return this.getTaggedAsync(t,tu,e)},t.prototype.getAll=function(t){var e=this._getAllArgs(t);return this._getButThrowIfAsync(e)},t.prototype.getAllAsync=function(t){var e=this._getAllArgs(t);return this._getAll(e)},t.prototype.getAllTagged=function(t,e,i){var n=this._getNotAllArgs(t,!0,e,i);return this._getButThrowIfAsync(n)},t.prototype.getAllTaggedAsync=function(t,e,i){var n=this._getNotAllArgs(t,!0,e,i);return this._getAll(n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,tu,e)},t.prototype.getAllNamedAsync=function(t,e){return this.getAllTaggedAsync(t,tu,e)},t.prototype.resolve=function(t){var e=this.isBound(t);e||this.bind(t).toSelf();var i=this.get(t);return e||this.unbind(t),i},t.prototype._preDestroy=function(t,e){if(Reflect.hasMetadata(lu,t))return e[Reflect.getMetadata(lu,t).value]()},t.prototype._removeModuleHandlers=function(t){var e=this._moduleActivationStore.remove(t);this._activations.removeIntersection(e.onActivations),this._deactivations.removeIntersection(e.onDeactivations)},t.prototype._removeModuleBindings=function(t){return this._bindingDictionary.removeByCondition((function(e){return e.moduleId===t}))},t.prototype._deactivate=function(t,e){var i=this,n=Object.getPrototypeOf(e).constructor;try{if(this._deactivations.hasKey(t.serviceIdentifier)){var r=this._deactivateContainer(e,this._deactivations.get(t.serviceIdentifier).values());if(sd(r))return this._handleDeactivationError(r.then((function(){return i._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,e,n)})),n)}var s=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,e,n);if(sd(s))return this._handleDeactivationError(s,n)}catch(t){throw new Error(Mu(n.name,t.message))}},t.prototype._handleDeactivationError=function(t,e){return Kd(this,void 0,void 0,(function(){var i;return $d(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t];case 1:return n.sent(),[3,3];case 2:throw i=n.sent(),new Error(Mu(e.name,i.message));case 3:return[2]}}))}))},t.prototype._deactivateContainer=function(t,e){for(var i=this,n=e.next();n.value;){var r=n.value(t);if(sd(r))return r.then((function(){return i._deactivateContainerAsync(t,e)}));n=e.next()}},t.prototype._deactivateContainerAsync=function(t,e){return Kd(this,void 0,void 0,(function(){var i;return $d(this,(function(n){switch(n.label){case 0:i=e.next(),n.label=1;case 1:return i.value?[4,i.value(t)]:[3,3];case 2:return n.sent(),i=e.next(),[3,1];case 3:return[2]}}))}))},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},i=function(i){return function(n){var r=t.rebind(n);return e(r,i),r}},n=function(e){return function(i,n){t._moduleActivationStore.addActivation(e,i,n),t.onActivation(i,n)}},r=function(e){return function(i,n){t._moduleActivationStore.addDeactivation(e,i,n),t.onDeactivation(i,n)}};return function(s){return{bindFunction:(a=s,function(i){var n=t.bind(i);return e(n,a),n}),isboundFunction:function(e){return t.isBound(e)},onActivationFunction:n(s),onDeactivationFunction:r(s),rebindFunction:i(s),unbindFunction:function(e){return t.unbind(e)},unbindAsyncFunction:function(e){return t.unbindAsync(e)}};var a}},t.prototype._getAll=function(t){return Promise.all(this._get(t))},t.prototype._get=function(t){var e=qd(qd({},t),{contextInterceptor:function(t){return t},targetType:fu.Variable});if(this._middleware){var i=this._middleware(e);if(null==i)throw new Error("Invalid return type in middleware. Middleware must return!");return i}return this._planAndResolve()(e)},t.prototype._getButThrowIfAsync=function(t){var e=this._get(t);if(ad(e))throw new Error("You are attempting to construct '"+t.serviceIdentifier+"' in a synchronous way\n but it has asynchronous dependencies.");return e},t.prototype._getAllArgs=function(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}},t.prototype._getNotAllArgs=function(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}},t.prototype._planAndResolve=function(){var t=this;return function(e){var i=rd(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return function(t){return _d(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}(i=e.contextInterceptor(i))}},t.prototype._deactivateIfSingleton=function(t){var e=this;if(t.activated)return sd(t.cache)?t.cache.then((function(i){return e._deactivate(t,i)})):this._deactivate(t,t.cache)},t.prototype._deactivateSingletons=function(t){for(var e=0,i=t;e<i.length;e++){var n=i[e];if(sd(this._deactivateIfSingleton(n)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}},t.prototype._deactivateSingletonsAsync=function(t){return Kd(this,void 0,void 0,(function(){var e=this;return $d(this,(function(i){switch(i.label){case 0:return[4,Promise.all(t.map((function(t){return e._deactivateIfSingleton(t)})))];case 1:return i.sent(),[2]}}))}))},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(t,e,i){return this.parent?this._deactivate.bind(this.parent)(t,e):this._bindingDeactivationAndPreDestroy(t,e,i)},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(t,e,i){return Kd(this,void 0,void 0,(function(){return $d(this,(function(n){switch(n.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(t,e)]:[3,2];case 1:return n.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(t,e,i)];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},t.prototype._removeServiceFromDictionary=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error("Could not unbind serviceIdentifier: "+Ou(t))}},t.prototype._bindingDeactivationAndPreDestroy=function(t,e,i){var n=this;if("function"==typeof t.onDeactivation){var r=t.onDeactivation(e);if(sd(r))return r.then((function(){return n._preDestroy(i,e)}))}return this._preDestroy(i,e)},t.prototype._bindingDeactivationAndPreDestroyAsync=function(t,e,i){return Kd(this,void 0,void 0,(function(){return $d(this,(function(n){switch(n.label){case 0:return"function"!=typeof t.onDeactivation?[3,2]:[4,t.onDeactivation(e)];case 1:n.sent(),n.label=2;case 2:return[4,this._preDestroy(i,e)];case 3:return n.sent(),[2]}}))}))},t}(),Qd=function(t){this.id=yu(),this.registry=t};function tp(t,e,i,n){!function(t){if(void 0!==t)throw new Error(Tu)}(e),ip(au,t,i.toString(),n)}function ep(t){var e=[];if(Array.isArray(t)){var i=function(t){for(var e=new Set,i=0,n=t;i<n.length;i++){var r=n[i];if(e.has(r))return r;e.add(r)}}((e=t).map((function(t){return t.key})));if(void 0!==i)throw new Error(vu+" "+i.toString())}else e=[t];return e}function ip(t,e,i,n){var r=ep(n),s={};Reflect.hasOwnMetadata(t,e)&&(s=Reflect.getMetadata(t,e));var a=s[i];if(void 0===a)a=[];else for(var o=function(t){if(r.some((function(e){return e.key===t.key})))throw new Error(vu+" "+t.key.toString())},h=0,c=a;h<c.length;h++){o(c[h])}a.push.apply(a,r),s[i]=a,Reflect.defineMetadata(t,s,e)}function np(t){return function(e,i,n){"number"==typeof n?tp(e,i,n,t):function(t,e,i){if(void 0!==t.prototype)throw new Error(Tu);ip(ou,t.constructor,e,i)}(e,i,t)}}function rp(){return function(t){if(Reflect.hasOwnMetadata(hu,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(hu,e,t),t}}function sp(t){return np(new zu(tu,t))}function ap(t){return function(e){return function(i,n,r){if(void 0===e){var s="function"==typeof i?i.name:i.constructor.name;throw new Error("@inject called with undefined this could mean that the class "+s+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation.")}return np(new zu(t,e))(i,n,r)}}}var op=ap(ru),hp=ap(su);var cp,lp,up=(cp=cu,lp="Cannot apply @postConstruct decorator multiple times in the same class",function(){return function(t,e){var i=new zu(cp,e);if(Reflect.hasOwnMetadata(cp,t.constructor))throw new Error(lp);Reflect.defineMetadata(cp,i,t.constructor)}});function dp(t,e,i,r){var s,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,r);else for(var h=t.length-1;h>=0;h--)(s=t[h])&&(o=(a<3?s(o):a>3?s(e,i,o):s(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o}function pp(t,e){return function(i,n){e(i,n,t)}}function fp(t,e){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}"function"==typeof SuppressedError&&SuppressedError;const gp=Symbol("ContributionProvider");class yp{caches;serviceIdentifier;container;constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function mp(t,e){t(gp).toDynamicValue((({container:t})=>new yp(e,t))).inSingletonScope().whenTargetNamed(e)}class vp{_args;name;taps;constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>t.name!==i&&(!e||t.fn===e))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>i)){n++;break}}this.taps[n]=t}}class bp extends vp{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const xp=Symbol.for("EnvContribution"),wp=Symbol.for("Global"),Sp="browser";t.DefaultGlobal=class{contributions;_env;get env(){return this._env}envContribution;get devicePixelRatio(){return this._env||this.setEnv(Sp),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv(Sp),this.envContribution.supportEvent}get supportsTouchEvents(){return this._env||this.setEnv(Sp),this.envContribution.supportsTouchEvents}get supportsPointerEvents(){return this._env||this.setEnv(Sp),this.envContribution.supportsPointerEvents}get supportsMouseEvents(){return this._env||this.setEnv(Sp),this.envContribution.supportsMouseEvents}get applyStyles(){return this._env||this.setEnv(Sp),this.envContribution.applyStyles}envParams;constructor(t){this.contributions=t,this.hooks={onSetEnv:new bp(["lastEnv","env","global"])},this.measureTextMethod="native"}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const n=i.configure(this,t);n&&n.then&&e.push(n)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv(Sp),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv(Sp),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const n=this.bindContribution(e);if(n&&n.then)return n.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv(Sp),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv(Sp),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv(Sp),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv(Sp),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv(Sp),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv(Sp),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv(Sp),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv(Sp),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv(Sp),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv(Sp),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv(Sp),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv(Sp),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}},t.DefaultGlobal=dp([rp(),pp(0,op(gp)),pp(0,sp(xp)),fp("design:paramtypes",[Object])],t.DefaultGlobal);var Ap={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,a=new Array(s);r<s;r++)a[r]=n[r].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},o.prototype.emit=function(t,e,n,r,s,a){var o=i?i+t:t;if(!this._events[o])return!1;var h,c,l=this._events[o],u=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),u){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,s),!0;case 6:return l.fn.call(l.context,e,n,r,s,a),!0}for(c=1,h=new Array(u-1);c<u;c++)h[c-1]=arguments[c];l.fn.apply(l.context,h)}else{var d,p=l.length;for(c=0;c<p;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),u){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,n);break;case 4:l[c].fn.call(l[c].context,e,n,r);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];l[c].fn.apply(l[c].context,h)}}return!0},o.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||r&&!o.once||n&&o.context!==n||a(this,s);else{for(var h=0,c=[],l=o.length;h<l;h++)(o[h].fn!==e||r&&!o[h].once||n&&o[h].context!==n)&&c.push(o[h]);c.length?this._events[s]=1===c.length?c[0]:c:a(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(Ap);var _p=i(Ap.exports),Cp=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},Tp=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||Cp(t,"Boolean")},Bp=function(t){return"function"==typeof t},Pp=function(t){return null==t},Ep=function(t){return null!=t},Mp=function(t){var e=n(t);return null!==t&&"object"===e||"function"===e},Rp=function(t){return void 0===t},kp=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n(t);return e?"string"===i:"string"===i||Cp(t,"String")},Dp=function(t){return Array.isArray?Array.isArray(t):Cp(t,"Array")},Ip=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n(t);return e?"number"===i:"number"===i||Cp(t,"Number")},Op=function(t){return Ip(t)&&Number.isFinite(t)},Lp=function(t,e,i){for(var n=kp(e)?e.split("."):e,r=0;r<n.length;r++)t=t?t[n[r]]:void 0;return void 0===t?i:t},Up=Object.prototype.hasOwnProperty,Wp=function(t,e){return null!=t&&Up.call(t,e)};function Fp(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,s=[],a=[];return void 0===e&&(e=!0),void 0===i&&(i=1/0),function t(i,o){if(null===i)return null;if(0===o)return i;var h,c,l;if("object"!=n(i))return i;if(Dp(i)?h=[]:Cp(i,"RegExp")?(h=new RegExp(i.source,(l="",(c=i).global&&(l+="g"),c.ignoreCase&&(l+="i"),c.multiline&&(l+="m"),l)),i.lastIndex&&(h.lastIndex=i.lastIndex)):h=function(t){return Cp(t,"Date")}(i)?new Date(i.getTime()):void 0===r?Object.create(Object.getPrototypeOf(i)):Object.create(r),e){var u=s.indexOf(i);if(-1!==u)return a[u];s.push(i),a.push(h)}for(var d in i)h[d]=t(i[d],o-1);return h}(t,i)}function Np(t,e){if(!Dp(t)||!Dp(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}var zp=1e-10,jp=1e-10;function Hp(t,e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zp,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:jp)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}try{"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){!1}var Gp=1e-12,Vp=Math.PI,Xp=Vp/2,Yp=2*Vp,qp=2*Math.PI,Kp=Math.abs,$p=Math.atan2,Zp=Math.cos,Jp=Math.max,Qp=Math.min,tf=Math.sin,ef=Math.sqrt,nf=Math.pow;function rf(t){return t>1?0:t<-1?Vp:Math.acos(t)}function sf(t){return t>=1?Xp:t<=-1?-Xp:Math.asin(t)}function af(t,e,i,n,r){var s,a;return"number"==typeof t&&"number"==typeof i&&(s=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(a=(1-r)*e+r*n),{x:s,y:a}}function of(t,e){return t[0]*e[1]-t[1]*e[0]}var hf=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;r(this,t),this.x=0,this.y=0,this.x=e,this.y=i,this.x1=n,this.y1=s}return a(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"add",value:function(t){return Ip(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return Ip(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}},{key:"multi",value:function(t){throw new Error("暂不支持")}},{key:"div",value:function(t){throw new Error("暂不支持")}}]),t}(),cf=function(){function t(){r(this,t)}return a(t,null,[{key:"distancePP",value:function(t,e){return ef(nf(t.x-e.x,2)+nf(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,i,n){return ef(nf(t-i,2)+nf(e-n,2))}},{key:"distancePN",value:function(t,e,i){return ef(nf(e-t.x,2)+nf(i-t.y,2))}},{key:"pointAtPP",value:function(t,e,i){return new hf((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}]),t}();function lf(t,e,i){var n=e.x1,r=e.y1,s=e.x2,a=e.y2;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*r+i.e,i.b*n+i.d*r+i.f),t.add(i.a*s+i.c*r+i.e,i.b*s+i.d*r+i.f),t.add(i.a*s+i.c*a+i.e,i.b*s+i.d*a+i.f),t.add(i.a*n+i.c*a+i.e,i.b*n+i.d*a+i.f),e)}var uf=function(){function t(e){r(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return a(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Dp(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}},{key:"round",value:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}},{key:"translate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}},{key:"scale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}},{key:"intersect",value:function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return lf(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,i){var n=this.x1,r=this.y1,s=this.x2,a=this.y2,o=Math.cos(t),h=Math.sin(t),c=e-e*o+i*h,l=i-e*h-i*o;return[o*n-h*r+c,h*n+o*r+l,o*n-h*a+c,h*n+o*a+l,o*s-h*r+c,h*s+o*r+l,o*s-h*a+c,h*s+o*a+l]}},{key:"scalePoints",value:function(t,e,i,n){return[t*this.x1+(1-t)*i,e*this.y1+(1-e)*n,t*this.x2+(1-t)*i,e*this.y2+(1-e)*n]}}]),t}(),df=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(i,t);var e=l(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i)}(uf);var pf=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Yp;)t+=Yp;else if(t>0)for(;t>Yp;)t-=Yp;return t};function ff(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}var gf,yf,mf,vf,bf,xf,wf,Sf,Af,_f=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;r(this,t),this.a=e,this.b=i,this.c=n,this.d=s,this.e=a,this.f=o}return a(t,[{key:"equalToMatrix",value:function(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}},{key:"equalTo",value:function(t,e,i,n,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}},{key:"setValue",value:function(t,e,i,n,r,s){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s,this}},{key:"reset",value:function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}},{key:"getInverse",value:function(){var e=this.a,i=this.b,n=this.c,r=this.d,s=this.e,a=this.f,o=new t,h=e*r-i*n;return o.a=r/h,o.b=-i/h,o.c=-n/h,o.d=e/h,o.e=(n*a-r*s)/h,o.f=-(e*a-i*s)/h,o}},{key:"rotate",value:function(t){var e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,r=this.b*e+this.d*i,s=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=n,this.b=r,this.c=s,this.d=a,this}},{key:"rotateByCenter",value:function(t,e,i){var n=Math.cos(t),r=Math.sin(t),s=(1-n)*e+r*i,a=(1-n)*i-r*e,o=n*this.a-r*this.b,h=r*this.a+n*this.b,c=n*this.c-r*this.d,l=r*this.c+n*this.d,u=n*this.e-r*this.f+s,d=r*this.e+n*this.f+a;return this.a=o,this.b=h,this.c=c,this.d=l,this.e=u,this.f=d,this}},{key:"scale",value:function(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}},{key:"setScale",value:function(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}},{key:"transform",value:function(t,e,i,n,r,s){return this.multiply(t,e,i,n,r,s),this}},{key:"translate",value:function(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}},{key:"transpose",value:function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=this.e,s=this.f;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=s,this.f=r,this}},{key:"multiply",value:function(t,e,i,n,r,s){var a=this.a,o=this.b,h=this.c,c=this.d,l=a*t+h*e,u=o*t+c*e,d=a*i+h*n,p=o*i+c*n,f=a*r+h*s+this.e,g=o*r+c*s+this.f;return this.a=l,this.b=u,this.c=d,this.d=p,this.e=f,this.f=g,this}},{key:"interpolate",value:function(e,i){var n=new t;return n.a=this.a+(e.a-this.a)*i,n.b=this.b+(e.b-this.b)*i,n.c=this.c+(e.c-this.c)*i,n.d=this.d+(e.d-this.d)*i,n.e=this.e+(e.e-this.e)*i,n.f=this.f+(e.f-this.f)*i,n}},{key:"transformPoint",value:function(t,e){var i=this.a,n=this.b,r=this.c,s=this.d,a=this.e,o=this.f,h=i*s-n*r,c=s/h,l=-n/h,u=-r/h,d=i/h,p=(r*o-s*a)/h,f=-(i*o-n*a)/h,g=t.x,y=t.y;e.x=g*c+y*u+p,e.y=g*l+y*d+f}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}},{key:"clone",value:function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)}},{key:"toTransformAttrs",value:function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=t*n-e*i,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){var a=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),s.scaleX=a,s.scaleY=r/a,s.skewX=(t*i+e*n)/r,s.skewY=0}else if(0!==i||0!==n){var o=Math.sqrt(i*i+n*n);s.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/o):-Math.acos(i/o)),s.scaleX=r/o,s.scaleY=o,s.skewX=0,s.skewY=(t*i+e*n)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}]),t}();function Cf(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function Tf(t,e,i,n){if(!function(t,e,i,n){var r,s=t[0],a=e[0],o=i[0],h=n[0];return a<s&&(r=a,a=s,s=r),h<o&&(r=h,h=o,o=r),!(a<o||h<s||(s=t[1],a=e[1],o=i[1],h=n[1],a<s&&(r=a,a=s,s=r),h<o&&(r=h,h=o,o=r),a<o||h<s))}(t,e,i,n))return!1;var r,s,a=[0,0],o=[0,0],h=[0,0];if(Cf(a,e,t),Cf(o,n,i),Kp((r=a)[0]-(s=o)[0])+Kp(r[1]-s[1])<1e-12)return!0;Cf(h,i,t);var c=of(h,o)/of(a,o);return c>=0&&c<=1&&[t[0]+a[0]*c,t[1]+a[1]*c]}function Bf(t,e,i){var n,r,s,a;return!(t&&e&&(i?(gf=t.x1,yf=t.x2,mf=t.y1,vf=t.y2,bf=e.x1,xf=e.x2,wf=e.y1,Sf=e.y2,gf>yf&&(n=[yf,gf],gf=n[0],yf=n[1]),mf>vf&&(r=[vf,mf],mf=r[0],vf=r[1]),bf>xf&&(s=[xf,bf],bf=s[0],xf=s[1]),wf>Sf&&(a=[Sf,wf],wf=a[0],Sf=a[1]),gf>xf||yf<bf||mf>Sf||vf<wf):t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1))}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Af||(Af={}));var Pf=function(t){var e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(n=(e&=1023)<<10|(i&=1023),n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};var Ef,Mf=function(){function t(e,i){r(this,t),this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=e,this._userSpec=null!=i?i:{},this.textSpec=this._initSpec(),Ep(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=Ep(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return a(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(Pp(this._canvas)&&(Ep(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),Pp(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&Ep(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),Pp(this._context)&&Ep(this._canvas)){var t=this._canvas.getContext("2d");Ep(t)&&(t.save(),t.font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.fontStyle,n=void 0===i?e.fontStyle:i,r=t.fontVariant,s=void 0===r?e.fontVariant:r,a=t.fontWeight,o=void 0===a?e.fontWeight:a,h=t.fontSize,c=void 0===h?e.fontSize:h,l=t.fontFamily;return(n?n+" ":"")+(s?s+" ":"")+(o?o+" ":"")+c+"px "+((void 0===l?e.fontFamily:l)||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!Pp(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,i,n=this._option.defaultFontParams,r=void 0===n?{}:n,s=this._userSpec,a=s.fontStyle,o=void 0===a?r.fontStyle:a,h=s.fontVariant,c=void 0===h?r.fontVariant:h,l=s.fontWeight,u=void 0===l?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":l,d=s.fontSize,p=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,f=s.fontFamily,g=void 0===f?null!==(i=r.fontFamily)&&void 0!==i?i:"sans-serif":f,y=s.align,m=s.textAlign,v=void 0===m?null!=y?y:"center":m,b=s.baseline,x=s.textBaseline,w=void 0===x?null!=b?b:"middle":x,S=s.ellipsis,A=s.limit,_=s.lineHeight;return{fontStyle:o,fontVariant:c,fontFamily:g,fontSize:p,fontWeight:u,textAlign:v,textBaseline:w,ellipsis:S,limit:A,lineHeight:void 0===_?p:_}}},{key:"measure",value:function(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}},{key:"fullMeasure",value:function(t){if(Pp(t))return{width:0,height:0};if(Pp(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);var e,i=this.textSpec,n=i.fontFamily,r=i.fontSize,s=i.fontWeight,a=i.textAlign,o=i.textBaseline,h=i.ellipsis,c=i.limit,l=i.lineHeight;try{var u=this._option.getTextBounds({text:t,fontFamily:n,fontSize:r,fontWeight:s,textAlign:a,textBaseline:o,ellipsis:!!h,maxLineWidth:c||1/0,lineHeight:l});e={width:u.width(),height:u.height()}}catch(i){this._notSupportVRender=!0,e=this.measureWithNaiveCanvas(t)}return e}},{key:"measureWithNaiveCanvas",value:function(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}},{key:"_measureWithNaiveCanvas",value:function(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);var e=this._context.measureText(t),i=this.textSpec,n=i.fontSize,r=i.lineHeight;return{width:e.width,height:null!=r?r:n}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var i={width:0,height:0},n=0;n<e.length;n++){var r=e[n],s=this._measureSpecialChar(r);Pp(s)&&t.NUMBERS_CHAR_SET.includes(r)&&(s=this._measureNumberChar()),Pp(s)&&["F","W"].includes(Pf(r))&&(s=this._measureFullSizeChar()),Pp(s)&&(s=this._measureLetterChar()),i.width+=s.width,i.height=Math.max(i.height,s.height)}return i}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e={width:0,height:0},i=this.textSpec,n=i.fontSize,r=i.lineHeight,s=0;s<t.length;s++){var a=t[s],o=["F","W"].includes(Pf(a))?1:.53;e.width+=o*n}return e.height=null!=r?r:n,e}},{key:"_measureReduce",value:function(t,e){var i=this.textSpec,n=i.fontSize,r=i.lineHeight,s={width:0,height:0};if(Pp(t))return s;if(Dp(t)){var a=t.filter(Ep).map((function(t){return t.toString()}));return 0===a.length?s:1===a.length?e(a[0]):{width:a.reduce((function(t,i){return Math.max(t,e(i).width)}),0),height:a.length*((null!=r?r:n)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(Pp(this._numberCharSize)){var e=this._standardMethod(t.NUMBERS_CHAR_SET);this._numberCharSize={width:e.width/t.NUMBERS_CHAR_SET.length,height:e.height}}return this._numberCharSize}},{key:"_measureFullSizeChar",value:function(){return Pp(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(Pp(this._letterCharSize)){var e=this._standardMethod(t.ALPHABET_CHAR_SET);this._letterCharSize={width:e.width/t.ALPHABET_CHAR_SET.length,height:e.height}}return this._letterCharSize}},{key:"_measureSpecialChar",value:function(t){return Ep(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){Ep(this._canvas)&&(this._canvas=null),Ep(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}]),t}();Mf.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Mf.NUMBERS_CHAR_SET="0123456789",Mf.FULL_SIZE_CHAR="字",function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(Ef||(Ef={}));const Rf=Yp-1e-8;class kf{bounds;constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,s){if(Math.abs(r-n)>Rf)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,h,c,l=1/0,u=-1/0,d=1/0,p=-1/0;function f(t){h=i*Math.cos(t),c=i*Math.sin(t),h<l&&(l=h),h>u&&(u=h),c<d&&(d=c),c>p&&(p=c)}if(f(n),f(r),r!==n)if((n%=Yp)<0&&(n+=Yp),(r%=Yp)<0&&(r+=Yp),r<n&&(s=!s,a=n,n=r,r=a),s)for(r-=Yp,a=n-n%Xp,o=0;o<4&&a>r;++o,a-=Xp)f(a);else for(a=n-n%Xp+Xp,o=0;o<4&&a<r;++o,a+=Xp)f(a);this.bounds.add(t+l,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,n,r){throw new Error("不支持arcTo")}bezierCurveTo(t,e,i,n,r,s){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(...t){}}class Df{curves;bounds;constructor(){this.curves=[],this.bounds=new df}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const If=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Of={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},Lf={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Uf,Wf,Ff,Nf,zf,jf;function Hf(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const r=[];for(let t=0,s=e.length;t<s;t++)if(Uf=e[t],Wf=Uf.slice(1),Ff=Uf[0],i=[Ff],n=Wf.match(If),null!==n){for(let t=0,e=n.length;t<e;t++)Nf=n[t],zf=parseFloat(Nf),Number.isNaN(zf)||i.push(zf);if(jf=Of[Ff],i.length-1>jf){let t;for(let e=1,n=i.length;e<n;e+=jf){t=[Ff];for(let n=e,r=e+jf;n<r;n++)t.push(i[n]);r.push(t)}}else r.push(i)}else r.push(i);return r}var Gf,Vf,Xf,Yf,qf,Kf,$f,Zf;function Jf(t,e,i,n,r,s,a,o,h){const c=a*(Math.PI/180);const l=Math.sin(c),u=Math.cos(c),d=u*(o-t)*.5+l*(h-e)*.5,p=u*(h-e)*.5-l*(o-t)*.5;let f=d*d/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);f>1&&(f=Math.sqrt(f),i*=f,n*=f);const g=u/i,y=l/i,m=-l/n,v=u/n,b=g*o+y*h,x=m*o+v*h,w=g*t+y*e,S=m*t+v*e;let A=1/((w-b)*(w-b)+(S-x)*(S-x))-.25;A<0&&(A=0);let _=Math.sqrt(A);s===r&&(_=-_);const C=.5*(b+w)-_*(S-x),T=.5*(x+S)+_*(w-b),B=Math.atan2(x-T,b-C);let P=Math.atan2(S-T,w-C)-B;P<0&&1===s?P+=Yp:P>0&&0===s&&(P-=Yp);const E=Math.ceil(Math.abs(P/(Xp+.001))),M=[];for(let t=0;t<E;++t){const e=B+t*P/E,r=B+(t+1)*P/E;M[t]=[C,T,e,r,i,n,l,u]}return M}function Qf(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],c=h*s,l=-o*a,u=o*s,d=h*a,p=Math.cos(n),f=Math.sin(n),g=Math.cos(r),y=Math.sin(r),m=.5*(r-n),v=Math.sin(.5*m),b=8/3*v*v/Math.sin(m),x=e+p-b*f,w=i+f+b*p,S=e+g,A=i+y,_=S+b*y,C=A-b*g;return[c*x+l*w,u*x+d*w,c*_+l*C,u*_+d*C,c*S+l*A,u*S+d*A]}function tg(t,e,i,n){const r=Jf(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<r.length;++e){const i=Qf(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(Gf=t.UpdateTag||(t.UpdateTag={}))[Gf.NONE=0]="NONE",Gf[Gf.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",Gf[Gf.UPDATE_SHAPE=2]="UPDATE_SHAPE",Gf[Gf.CLEAR_SHAPE=253]="CLEAR_SHAPE",Gf[Gf.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",Gf[Gf.INIT=51]="INIT",Gf[Gf.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",Gf[Gf.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",Gf[Gf.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",Gf[Gf.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",Gf[Gf.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",Gf[Gf.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t.IContainPointMode=void 0,(Vf=t.IContainPointMode||(t.IContainPointMode={}))[Vf.GLOBAL=1]="GLOBAL",Vf[Vf.LOCAL=16]="LOCAL",Vf[Vf.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",Vf[Vf.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(Xf=t.AttributeUpdateType||(t.AttributeUpdateType={}))[Xf.INIT=0]="INIT",Xf[Xf.DEFAULT=1]="DEFAULT",Xf[Xf.STATE=2]="STATE",Xf[Xf.ANIMATE_BIND=10]="ANIMATE_BIND",Xf[Xf.ANIMATE_PLAY=11]="ANIMATE_PLAY",Xf[Xf.ANIMATE_START=12]="ANIMATE_START",Xf[Xf.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",Xf[Xf.ANIMATE_END=14]="ANIMATE_END",Xf[Xf.TRANSLATE=20]="TRANSLATE",Xf[Xf.TRANSLATE_TO=21]="TRANSLATE_TO",Xf[Xf.SCALE=22]="SCALE",Xf[Xf.SCALE_TO=23]="SCALE_TO",Xf[Xf.ROTATE=24]="ROTATE",Xf[Xf.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(Yf=t.AnimateStatus||(t.AnimateStatus={}))[Yf.INITIAL=0]="INITIAL",Yf[Yf.RUNNING=1]="RUNNING",Yf[Yf.PAUSED=2]="PAUSED",Yf[Yf.END=3]="END",t.AnimateMode=void 0,(qf=t.AnimateMode||(t.AnimateMode={}))[qf.NORMAL=0]="NORMAL",qf[qf.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(Kf=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",Kf.from="from",Kf.to="to",Kf.customAnimate="customAnimate",t.Direction=void 0,function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(t.Direction||(t.Direction={})),t.CurveTypeEnum=void 0,($f=t.CurveTypeEnum||(t.CurveTypeEnum={}))[$f.CubicBezierCurve=0]="CubicBezierCurve",$f[$f.QuadraticBezierCurve=1]="QuadraticBezierCurve",$f[$f.ArcCurve=2]="ArcCurve",$f[$f.LineCurve=3]="LineCurve",$f[$f.EllipseCurve=4]="EllipseCurve",$f[$f.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(Zf=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[Zf.beforeFillStroke=0]="beforeFillStroke",Zf[Zf.afterFillStroke=1]="afterFillStroke";const eg=(t,e,i,n,r,s,a)=>{const o=Math.abs(i-e),h=4*Math.tan(o/4)/3,c=i<e?-1:1,l=Math.cos(e),u=Math.sin(e),d=Math.cos(i),p=Math.sin(i),f=l*s+n,g=u*a+r,y=d*s+n,m=p*a+r,v=s*h*c,b=a*h*c;t.push(f-v*u,g+b*l,y+v*p,m-b*d,y,m)},ig=[(t,e,i,n,r,s,a)=>e.arc(t[1]*r+i,t[2]*s+n,t[3]*(r+s)/2,t[4],t[5],t[6],a),(t,e,i,n,r,s,a)=>e.arcTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*(r+s)/2,a),(t,e,i,n,r,s,a)=>e.bezierCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*r+i,t[6]*s+n,a),(t,e,i,n)=>e.closePath(),(t,e,i,n,r,s)=>e.ellipse(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,i,n,r,s,a)=>e.lineTo(t[1]*r+i,t[2]*s+n,a),(t,e,i,n,r,s,a)=>e.moveTo(t[1]*r+i,t[2]*s+n,a),(t,e,i,n,r,s,a)=>e.quadraticCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,a),(t,e,i,n,r,s,a)=>e.rect(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,a)];function ng(t,e,i=0,n=0,r=1,s=1,a){for(let o=0;o<t.length;o++){const h=t[o];ig[h[0]](h,e,i,n,r,s,a)}}class rg{type;p0;defined;length;getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function sg(t,e){let i=0;const n=t.length;for(let r=0;r<n;r++){const s=t[r],a=e[r],o=t[(r+1)%n],h=e[(r+1)%n];i+=cf.distanceNN(s,a,o,h)}return i/2}function ag(t,e,i,n,r){return sg([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function og(t,e,i,n,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*i*r*r*s+n*r*r*r}function hg(t,e,i,n,r){const s=og(t.x,e.x,i.x,n.x,r),a=og(t.y,e.y,i.y,n.y,r);return new hf(s,a)}function cg(t,e){const{p0:i,p1:n,p2:r,p3:s}=t,a=hg(i,n,r,s,e),o=cf.pointAtPP(i,n,e),h=cf.pointAtPP(n,r,e),c=cf.pointAtPP(r,s,e),l=cf.pointAtPP(o,h,e),u=cf.pointAtPP(h,c,e);return[new lg(i,o,l,a),new lg(a,u,c,s)]}class lg extends rg{type=t.CurveTypeEnum.CubicBezierCurve;constructor(t,e,i,n){super(),this.p0=t,this.p1=e,this.p2=i,this.p3=n}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return hg(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?ag(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(e){return e===t.Direction.ROW?Kp(this.p0.x-this.p3.x):e===t.Direction.COLUMN?Kp(this.p0.y-this.p3.y):0}getAngleAt(t){const e=Jp(t-.01,0),i=Qp(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return $p(r.y-n.y,r.x-n.x)}}function ug(t,e){const{p0:i,p1:n}=t,r=cf.pointAtPP(i,n,e);return[new dg(i,r),new dg(r,n)]}class dg extends rg{type=t.CurveTypeEnum.LineCurve;constructor(t,e){super(),this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return cf.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=$p(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?cf.distancePP(this.p0,this.p1):60}calcProjLength(e){return e===t.Direction.ROW?Kp(this.p0.x-this.p1.x):e===t.Direction.COLUMN?Kp(this.p0.y-this.p1.y):0}}class pg{_lastX;_lastY;_startX;_startY;get endX(){return this._lastX}get endY(){return this._lastY}curves;direction;curveType;length;constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,r,s,a){const o=new lg(new hf(this._lastX,this._lastY),new hf(t,e),new hf(i,n),new hf(r,s));o.defined=a,this.curves.push(o),this._lastX=r,this._lastY=s}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i){const n=this.addLinearCurve(t,e,i);this.curves.push(n),this._lastX=t,this._lastY=e}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i){const n=new dg(new hf(this._lastX,this._lastY),new hf(t,e));return n.defined=i,n}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(e){if(e===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Kp(t.p0.y-e.p1.y)}if(e===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Kp(t.p0.x-e.p1.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class fg extends pg{bezierCurveTo(t,e,i,n,r,s,a){return super.bezierCurveTo(e,t,n,i,s,r,a)}lineTo(t,e,i){return super.lineTo(e,t,i)}moveTo(t,e){return super.moveTo(e,t)}clear(){return super.clear()}}function gg(t,e,i=1){let n=!1;for(let i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}class yg{_lastDefined;startPoint;constructor(t,e){this.context=t,e&&(this.startPoint=e)}_x;_y;_x0;_x1;_y0;_y1;_line;_point;areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(e,i);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function mg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new pg("linear",n??(Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN));return vg(new yg(s,r),e),s}function vg(t,e){return gg(t,e,1)}function bg(t,e,i,n){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n)}class xg{_lastDefined1;_lastDefined2;startPoint;constructor(t,e){this.context=t,this.startPoint=e}_x;_y;_x0;_x1;_y0;_y1;_line;_point;areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){if(2===this._point)bg(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2);(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;default:bg(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function wg(t,e){return gg(t,e,2)}function Sg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mg(e,i);const s=new pg("basis",n??(Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN));return wg(new xg(s,r),e),s}function Ag(t){return t<0?-1:1}function _g(t,e,i){const n=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(n||Number(r<0&&-0)),a=(i-t._y1)/(r||Number(n<0&&-0)),o=(s*r+a*n)/(n+r);return(Ag(s)+Ag(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Cg(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Tg(t,e,i,n){const r=t._x0,s=t._y0,a=t._x1,o=t._y1,h=(a-r)/3;t.context.bezierCurveTo(r+h,s+h*e,a-h,o-h*i,a,o,n)}class Bg{_lastDefined1;_lastDefined2;startPoint;constructor(t,e){this.context=t,this.startPoint=e}_x;_y;_x0;_x1;_y0;_y1;_line;_point;areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined2);break;case 3:Tg(this,this._t0,Cg(this,this._t0),!1!==this._lastDefined2)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;if(i!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(i,n);break;case 1:this._point=2;break;case 2:this._point=3,Tg(this,Cg(this,e=_g(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Tg(this,this._t0,e=_g(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined}}tryUpdateLength(){return this.context.tryUpdateLength()}}class Pg extends Bg{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Eg(t,e){return gg(t,e,2)}function Mg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mg(e,i);const s=new pg("monotoneX",n??(Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN));return Eg(new Bg(s,r),e),s}function Rg(t,e){return gg(t,e,2)}function kg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mg(e,i);const s=new fg("monotoneY",n??(Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN));return Rg(new Pg(s,r),e),s}let Dg=class{_lastDefined;startPoint;constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}_x;_y;_x0;_x1;_y0;_y1;_line;_point;areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(e,i);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined);else{const n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined)}}this._lastDefined=t.defined,this._x=e,this._y=i}tryUpdateLength(){return this.context.tryUpdateLength()}};function Ig(e,i,n={}){const{direction:r,startPoint:s}=n;if(e.length<2-Number(!!s))return null;const a=new pg("step",r??(Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN));return Og(new Dg(a,i,s),e),a}function Og(t,e){return gg(t,e,1)}class Lg{_lastDefined;startPoint;constructor(t,e){this.context=t,e&&(this.startPoint=e)}_x;_y;_x0;_x1;_y0;_y1;_line;_point;areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){this.context.closePath()}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(e,i);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Ug(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new pg("linear",n??(Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN));return Wg(new Lg(s,r),e),s}function Wg(t,e){return gg(t,e,1)}function Fg(t,e,i){switch(e){case"linear":default:return mg(t,i);case"basis":return Sg(t,i);case"monotoneX":return Mg(t,i);case"monotoneY":return kg(t,i);case"step":return Ig(t,.5,i);case"stepBefore":return Ig(t,0,i);case"stepAfter":return Ig(t,1,i);case"linearClosed":return Ug(t,i)}}class Ng extends Df{commandList=[];_boundsContext;_ctx;direction;transformCbList;toStringCbList;constructor(t){super(),t&&(this._ctx=t),this._boundsContext=new kf(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Lf.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Lf.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Lf.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,s){return this.commandList.push([Lf.C,t,e,i,n,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,s),this}arcTo(t,e,i,n,r){return this.commandList.push([Lf.AT,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}ellipse(t,e,i,n,r,s,a,o){return this.commandList.push([Lf.E,t,e,i,n,r,s,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,s,a,o),this}rect(t,e,i,n){return this.commandList.push([Lf.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,r,s){return this.commandList.push([Lf.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([Lf.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}toString(){if(!this.toStringCbList){const t=[];t[Lf.M]=t=>`M${t[1]} ${t[2]}`,t[Lf.L]=t=>`L${t[1]} ${t[2]}`,t[Lf.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Lf.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Lf.A]=t=>{const e=[];eg(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[Lf.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,r){this.clear();const s=Hf(t);return this._runCommandStrList(s,e,i,n,r),this._updateBounds(),this}fromLine(e){const{points:i,curveType:n,clipRangeByDimension:r}=e.attribute;if(!i)return;const s=Fg(i,n);"x"===r?this.direction=t.Direction.ROW:"y"===r?this.direction=t.Direction.COLUMN:"auto"===r&&(this.direction=s.direction),this.curves=s.curves}fromCustomPath2D(t,e,i,n,r){return this.clear(),this._runCommandList(t.commandList,e,i,n,r),this._updateBounds(),this}transform(t,e,i,n){const r=this.commandList;if(!this.transformCbList){const t=[];t[Lf.M]=this.moveToTransform,t[Lf.L]=this.lineToTransform,t[Lf.Q]=this.quadraticCurveToTransform,t[Lf.C]=this.bezierCurveToTransform,t[Lf.AT]=this.arcToTransform,t[Lf.E]=this.ellipseTransform,t[Lf.R]=this.rectTransform,t[Lf.A]=this.arcTransform,t[Lf.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}ellipseTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}rectTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}arcTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,n=1,r=1){let s,a,o,h,c,l=null,u=0,d=0,p=0,f=0;for(let g=0,y=t.length;g<y;++g){switch(s=t[g],1===n&&1===r||(s=jg(s,n,r)),s[0]){case"l":u+=s[1],d+=s[2],this.lineTo(u+e,d+i);break;case"L":u=s[1],d=s[2],this.lineTo(u+e,d+i);break;case"h":u+=s[1],this.lineTo(u+e,d+i);break;case"H":u=s[1],this.lineTo(u+e,d+i);break;case"v":d+=s[1],this.lineTo(u+e,d+i);break;case"V":d=s[1],this.lineTo(u+e,d+i);break;case"m":u+=s[1],d+=s[2],this.moveTo(u+e,d+i);break;case"M":u=s[1],d=s[2],this.moveTo(u+e,d+i);break;case"c":a=u+s[5],o=d+s[6],p=u+s[3],f=d+s[4],this.bezierCurveTo(u+s[1]+e,d+s[2]+i,p+e,f+i,a+e,o+i),u=a,d=o;break;case"C":u=s[5],d=s[6],p=s[3],f=s[4],this.bezierCurveTo(s[1]+e,s[2]+i,p+e,f+i,u+e,d+i);break;case"s":a=u+s[3],o=d+s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,u+s[1]+e,d+s[2]+i,a+e,o+i),p=u+s[1],f=d+s[2],u=a,d=o;break;case"S":a=s[3],o=s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,s[1]+e,s[2]+i,a+e,o+i),u=a,d=o,p=s[1],f=s[2];break;case"q":a=u+s[3],o=d+s[4],p=u+s[1],f=d+s[2],this.quadraticCurveTo(p+e,f+i,a+e,o+i),u=a,d=o;break;case"Q":a=s[3],o=s[4],this.quadraticCurveTo(s[1]+e,s[2]+i,a+e,o+i),u=a,d=o,p=s[1],f=s[2];break;case"t":a=u+s[1],o=d+s[2],null===l[0].match(/[QqTt]/)?(p=u,f=d):"t"===l[0]?(p=2*u-h,f=2*d-c):"q"===l[0]&&(p=2*u-p,f=2*d-f),h=p,c=f,this.quadraticCurveTo(p+e,f+i,a+e,o+i),u=a,d=o,p=u+s[1],f=d+s[2];break;case"T":a=s[1],o=s[2],p=2*u-p,f=2*d-f,this.quadraticCurveTo(p+e,f+i,a+e,o+i),u=a,d=o;break;case"a":tg(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+u+e,s[7]+d+i]),u+=s[6],d+=s[7];break;case"A":tg(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+e,s[7]+i]),u=s[6],d=s[7];break;case"z":case"Z":this.closePath()}l=s}}_runCommandList(t,e=0,i=0,n=1,r=1){if(0!==e||0!==i||1!==n||1!==r)for(let s=0,a=t.length;s<a;++s){const a=t[s].slice();switch(a[0]){case Lf.L:this.lineToTransform(a,e,i,n,r);break;case Lf.M:this.moveToTransform(a,e,i,n,r);break;case Lf.C:this.bezierCurveToTransform(a,e,i,n,r);break;case Lf.Q:this.quadraticCurveToTransform(a,e,i,n,r);break;case Lf.A:this.arcToTransform(a,e,i,n,r);break;case Lf.E:this.ellipseTransform(a,e,i,n,r);break;case Lf.R:this.rectTransform(a,e,i,n,r);break;case Lf.AT:this.arcToTransform(a,e,i,n,r);break;case Lf.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),ng(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Kp(t.p0.y-e.p1.y)}if(this.direction===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Kp(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this.curves.length;n++){e=this.curves[n];const r=e.getLength(this.direction);if(i+r>=t)break;i+=r}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}}const zg=["l",0,0,0,0,0,0,0];function jg(t,e,i){const n=zg[0]=t[0];if("a"===n||"A"===n)zg[1]=e*t[1],zg[2]=i*t[2],zg[3]=t[3],zg[4]=t[4],zg[5]=t[5],zg[6]=e*t[6],zg[7]=i*t[7];else if("h"===n||"H"===n)zg[1]=e*t[1];else if("v"===n||"V"===n)zg[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)zg[n]=(n%2==1?e:i)*t[n];return zg}const Hg={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,anchor:[0,0],anchor3d:[0,0],postMatrix:new _f},Gg={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Vg={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Xg={outerBorder:{...Vg,distance:0},innerBorder:{...Vg,distance:0},...Vg},Yg={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1},qg={opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:0,blur:0,cursor:null,...Gg,...Xg},Kg={strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,...qg,...Hg};const $g={...Kg,startAngle:0,endAngle:qp,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1},Zg={...Kg,points:[],segments:[],curveType:"linear",clipRange:1},Jg={...Kg,radius:1,startAngle:0,endAngle:qp},Qg={...Kg,width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0},ty={...Kg,path:"",width:0,height:0,cornerRadius:0,clip:!1},ey={...Kg,points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default"},iy={...Kg,path:new Ng,customPath:()=>{console.warn("空函数")}},ny={...Kg,points:[],cornerRadius:0},ry={...Kg,width:0,height:0,strokeBoundsBuffer:0,cornerRadius:0},sy={...Kg,width:0,height:0,cornerRadius:0,length:0},ay={...Kg,symbolType:"circle",size:10,keepDirIn3d:!0},oy={...Kg,...Yg,strokeBoundsBuffer:0,keepDirIn3d:!0},hy={...Kg,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],maxHeight:void 0,maxWidth:void 0,singleLine:!1},cy={repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,...Kg,fill:!0},ly={...cy,backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1};let uy=class{release;canvas;context;configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){if(!this.context)return this.estimate(t,e).width;this.context.setTextStyleWithoutAlignBaseline(e);return this.context.measureText(t).width}estimate(t,{fontSize:e=oy.fontSize}){let i=0,n=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?i++:n++;return{width:~~(.8*i*e+n*e),height:e}}measureTextPixelHeight(t,e){if(!this.context)return e.fontSize??Yg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const i=this.context.measureText(t);return Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){if(!this.context)return e.fontSize??Yg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const i=this.context.measureText(t);return Math.abs(i.fontBoundingBoxAscent-i.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipText(t,e,i){if(0===t.length)return{str:"",width:0};let n=this.measureTextWidth(t,e);return n<=i?{str:t,width:n}:(n=this.measureTextWidth(t[0],e),n>i?{str:"",width:0}:this._clipText(t,e,i,0,t.length-1))}_clipText(t,e,i,n,r){const s=Math.floor((n+r)/2),a=t.substring(0,s+1),o=this.measureTextWidth(a,e);let h;if(o>i){if(a.length<=1)return{str:"",width:0};const r=t.substring(0,s);return h=this.measureTextWidth(r,e),h<=i?{str:r,width:h}:this._clipText(t,e,i,n,s)}if(o<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(0,s+2);return h=this.measureTextWidth(n,e),h>=i?{str:a,width:o}:this._clipText(t,e,i,s,r)}return{str:a,width:o}}clipTextWithSuffix(t,e,i,n){if(""===n)return this.clipText(t,e,i);if(0===t.length)return{str:"",width:0};const r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};const s=this.measureTextWidth(n,e);if(s>i)return{str:"",width:0};i-=s;const a=this._clipText(t,e,i,0,t.length-1);return a.str+=n,a.width+=s,a}};uy=dp([rp()],uy);const dy=Symbol.for("TextMeasureContribution");let py=class extends uy{};py=dp([rp()],py);const fy=new Jd;const gy=new class{global;graphicUtil;graphicService;transformUtil;layerService},yy=Symbol.for("CanvasFactory"),my=Symbol.for("Context2dFactory");function vy(t){return fy.getNamed(yy,gy.global.env)(t)}const by=1e-4,xy=Math.sqrt(3),wy=1/3;function Sy(t){return t>-Ly&&t<Ly}function Ay(t){return t>Ly||t<-Ly}const _y=[0,0],Cy=[0,0],Ty=[0,0];function By(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Py(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function Ey(t,e,i,n,r){const s=1-r;return s*s*(s*t+3*r*e)+r*r*(r*n+3*s*i)}function My(t){return(t%=qp)<0&&(t+=qp),t}function Ry(t,e,i,n,r,s){if(s>e&&s>n||s<e&&s<n)return 0;if(n===e)return 0;const a=(s-e)/(n-e);let o=n<e?1:-1;1!==a&&0!==a||(o=n<e?.5:-.5);const h=a*(i-t)+t;return h===r?1/0:h>r?o:0}function ky(t,e,i,n,r,s,a,o,h){if(0===a)return!1;const c=a;if(h>e+c&&h>n+c&&h>s+c||h<e-c&&h<n-c&&h<s-c||o>t+c&&o>i+c&&o>r+c||o<t-c&&o<i-c&&o<r-c)return!1;const l=function(t,e,i,n,r,s,a,o,h){let c=0,l=.005,u=1/0;_y[0]=a,_y[1]=o;for(let a=0;a<1;a+=.05){Cy[0]=Py(t,i,r,a),Cy[1]=Py(e,n,s,a);const o=By(_y,Cy);o<u&&(c=a,u=o)}u=1/0;for(let a=0;a<32&&!(l<by);a++){const a=c-l,o=c+l;Cy[0]=Py(t,i,r,a),Cy[1]=Py(e,n,s,a);const h=By(Cy,_y);if(a>=0&&h<u)c=a,u=h;else{Ty[0]=Py(t,i,r,o),Ty[1]=Py(e,n,s,o);const a=By(Ty,_y);o<=1&&a<u?(c=o,u=a):l*=.5}}return h&&(h[0]=Py(t,i,r,c),h[1]=Py(e,n,s,c)),Math.sqrt(u)}(t,e,i,n,r,s,o,h,null);return l<=c/2}function Dy(t,e,i,n,r,s,a,o,h,c,l){if(0===h)return!1;const u=h;if(l>e+u&&l>n+u&&l>s+u&&l>o+u||l<e-u&&l<n-u&&l<s-u&&l<o-u||c>t+u&&c>i+u&&c>r+u&&c>a+u||c<t-u&&c<i-u&&c<r-u&&c<a-u)return!1;const d=function(t,e,i,n,r,s,a,o,h,c,l){let u,d,p,f,g=0,y=.005,m=1/0;_y[0]=h,_y[1]=c;for(let h=0;h<1;h+=.05)Cy[0]=Ey(t,i,r,a,h),Cy[1]=Ey(e,n,s,o,h),p=By(_y,Cy),p<m&&(g=h,m=p);m=1/0;for(let h=0;h<32&&!(y<by);h++)u=g-y,d=g+y,Cy[0]=Ey(t,i,r,a,u),Cy[1]=Ey(e,n,s,o,u),p=By(Cy,_y),u>=0&&p<m?(g=u,m=p):(Ty[0]=Ey(t,i,r,a,d),Ty[1]=Ey(e,n,s,o,d),f=By(Ty,_y),d<=1&&f<m?(g=d,m=f):y*=.5);return l&&(l[0]=Ey(t,i,r,a,g),l[1]=Ey(e,n,s,o,g)),Math.sqrt(m)}(t,e,i,n,r,s,a,o,c,l,null);return d<=u/2}function Iy(t,e,i,n,r,s,a,o,h){if(0===a)return!1;const c=a;o-=t,h-=e;const l=Math.sqrt(o*o+h*h);if(l-c>i||l+c<i)return!1;if(Math.abs(n-r)%qp<1e-4)return!0;if(s){const t=n;n=My(r),r=My(t)}else n=My(n),r=My(r);n>r&&(r+=qp);let u=Math.atan2(h,o);return u<0&&(u+=qp),u>=n&&u<=r||u+qp>=n&&u+qp<=r}function Oy(t,e,i,n,r,s,a){if(0===r)return!1;const o=r,h=r/2;let c=0,l=t;if(a>e+h&&a>n+h||a<e-h&&a<n-h||s>t+h&&s>i+h||s<t-h&&s<i-h)return!1;if(t===i)return Math.abs(s-t)<=o/2;c=(e-n)/(t-i),l=(t*n-i*e)/(t-i);const u=c*s-a+l;return u*u/(c*c+1)<=o/2*o/2}const Ly=1e-4;function Uy(t,e,i,n,r){const s=6*i-12*e+6*t,a=9*e+3*n-3*t-9*i,o=3*e-3*t;let h=0;if(Sy(a)){if(Ay(s)){const t=-o/s;t>=0&&t<=1&&(r[h++]=t)}}else{const t=s*s-4*a*o;if(Sy(t))r[0]=-s/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-s+e)/(2*a),n=(-s-e)/(2*a);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}const Wy=[-1,-1,-1],Fy=[-1,-1];function Ny(){const t=Fy[0];Fy[0]=Fy[1],Fy[1]=t}function zy(t,e,i,n,r,s,a,o,h,c){if(c>e&&c>n&&c>s&&c>o||c<e&&c<n&&c<s&&c<o)return 0;const l=function(t,e,i,n,r,s){const a=n+3*(e-i)-t,o=3*(i-2*e+t),h=3*(e-t),c=t-r,l=o*o-3*a*h,u=o*h-9*a*c,d=h*h-3*o*c;let p=0;if(Sy(l)&&Sy(u))if(Sy(o))s[0]=0;else{const t=-h/o;t>=0&&t<=1&&(s[p++]=t)}else{const t=u*u-4*l*d;if(Sy(t)){const t=u/l,e=-o/a+t,i=-t/2;e>=0&&e<=1&&(s[p++]=e),i>=0&&i<=1&&(s[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=l*o+1.5*a*(-u+e),n=l*o+1.5*a*(-u-e);i=i<0?-Math.pow(-i,wy):Math.pow(i,wy),n=n<0?-Math.pow(-n,wy):Math.pow(n,wy);const r=(-o-(i+n))/(3*a);r>=0&&r<=1&&(s[p++]=r)}else{const t=(2*l*o-3*a*u)/(2*Math.sqrt(l*l*l)),e=Math.acos(t)/3,i=Math.sqrt(l),n=Math.cos(e),r=(-o-2*i*n)/(3*a),h=(-o+i*(n+xy*Math.sin(e)))/(3*a),c=(-o+i*(n-xy*Math.sin(e)))/(3*a);r>=0&&r<=1&&(s[p++]=r),h>=0&&h<=1&&(s[p++]=h),c>=0&&c<=1&&(s[p++]=c)}}return p}(e,n,s,o,c,Wy);if(0===l)return 0;let u=0,d=-1,p=0,f=0;for(let c=0;c<l;c++){const l=Wy[c],g=0===l||1===l?.5:1;Ey(t,i,r,a,l)<h||(d<0&&(d=Uy(e,n,s,o,Fy),Fy[1]<Fy[0]&&d>1&&Ny(),p=Ey(e,n,s,o,Fy[0]),d>1&&(f=Ey(e,n,s,o,Fy[1]))),2===d?l<Fy[0]?u+=p<e?g:-g:l<Fy[1]?u+=f<p?g:-g:u+=o<f?g:-g:l<Fy[0]?u+=p<e?g:-g:u+=o<p?g:-g)}return u}function jy(t,e,i,n,r,s,a,o){if(o>e&&o>n&&o>s||o<e&&o<n&&o<s)return 0;const h=function(t,e,i,n,r){const s=t-2*e+i,a=2*(e-t),o=t-n;let h=0;if(Sy(s)){if(Ay(a)){const t=-o/a;t>=0&&t<=1&&(r[h++]=t)}}else{const t=a*a-4*s*o;if(Sy(t)){const t=-a/(2*s);t>=0&&t<=1&&(r[h++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*s),n=(-a-e)/(2*s);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}(e,n,s,o,Wy);if(0===h)return 0;const c=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,s);if(c>=0&&c<=1){let o=0;const l=Py(e,n,s,c);for(let n=0;n<h;n++){const h=0===Wy[n]||1===Wy[n]?.5:1;Py(t,i,r,Wy[n])<a||(Wy[n]<c?o+=l<e?h:-h:o+=s<l?h:-h)}return o}const l=0===Wy[0]||1===Wy[0]?.5:1;return Py(t,i,r,Wy[0])<a?0:s<e?l:-l}function Hy(t,e,i,n,r,s,a,o){if((o-=e)>i||o<-i)return 0;const h=Math.sqrt(i*i-o*o);Wy[0]=-h,Wy[1]=h;const c=Math.abs(n-r);if(c<1e-4)return 0;if(c>=qp-1e-4){n=0,r=qp;const e=s?1:-1;return a>=Wy[0]+t&&a<=Wy[1]+t?e:0}if(n>r){const t=n;n=r,r=t}n<0&&(n+=qp,r+=qp);let l=0;for(let e=0;e<2;e++){const i=Wy[e];if(i+t>a){let t=Math.atan2(o,i),e=s?1:-1;t<0&&(t=qp+t),(t>=n&&t<=r||t+qp>=n&&t+qp<=r)&&(t>Vp/2&&t<1.5*Vp&&(e=-e),l+=e)}}return l}function Gy(t){return Math.round(t/Vp*1e8)/1e8%2*Vp}function Vy(t,e){let i=Gy(t[0]);i<0&&(i+=qp);const n=i-t[0];let r=t[1];r+=n,!e&&r-i>=qp?r=i+qp:e&&i-r>=qp?r=i-qp:!e&&i>r?r=i+(qp-Gy(i-r)):e&&i<r&&(r=i-(qp-Gy(r-i))),t[0]=i,t[1]=r}const Xy=[0,0];function Yy(t,e,i,n,r){const s=t,a=t.length;let o,h,c=0,l=0,u=0,d=0,p=0;for(let t=0;t<a;t++){const a=s[t],f=0===t;a[0]===Lf.M&&t>1&&(i||(c+=Ry(l,u,d,p,n,r))),f&&(l=a[1],u=a[2],d=l,p=u);const g=a[0],y=a[1],m=a[2],v=a[3],b=a[4],x=a[5],w=a[6];let S=b,A=x;Xy[0]=S,Xy[1]=A,Vy(Xy,Boolean(a[6])),S=Xy[0],A=Xy[1];const _=S,C=A-S,T=!!(1-(a[6]?0:1)),B=(n-y)*v/v+y;switch(g){case Lf.M:d=y,p=m,l=d,u=p;break;case Lf.L:if(i){if(Oy(l,u,y,m,e,n,r))return!0}else c+=Ry(l,u,y,m,n,r)||0;l=y,u=m;break;case Lf.C:if(i){if(Dy(l,u,y,m,v,b,x,w,e,n,r))return!0}else c+=zy(l,u,y,m,v,b,x,w,n,r)||0;l=x,u=w;break;case Lf.Q:if(i){if(ky(l,u,y,m,v,b,e,n,r))return!0}else c+=jy(l,u,y,m,v,b,n,r)||0;l=v,u=b;break;case Lf.A:if(o=Math.cos(_)*v+y,h=Math.sin(_)*v+m,f?(d=o,p=h):c+=Ry(l,u,o,h,n,r),i){if(Iy(y,m,v,_,_+C,T,e,B,r))return!0}else c+=Hy(y,m,v,_,_+C,T,B,r);l=Math.cos(_+C)*v+y,u=Math.sin(_+C)*v+m;break;case Lf.R:if(d=l=y,p=u=m,o=d+v,h=p+b,i){if(Oy(d,p,o,p,e,n,r)||Oy(o,p,o,h,e,n,r)||Oy(o,h,d,h,e,n,r)||Oy(d,h,d,p,e,n,r))return!0}else c+=Ry(o,p,o,h,n,r),c+=Ry(d,h,d,p,n,r);break;case Lf.Z:if(i){if(Oy(l,u,d,p,e,n,r))return!0}else c+=Ry(l,u,d,p,n,r);l=d,u=p}}var f,g;return i||(f=u,g=p,Math.abs(f-g)<Ly)||(c+=Ry(l,u,d,p,n,r)||0),0!==c}var qy;t.DefaultGraphicUtil=class{contributions;global;canvas;context;_textMeasure;configured;constructor(t,e){this.contributions=t,this.global=e,this.configured=!1,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){if(this.configured)return;const i=vy({nativeCanvas:t.createCanvas({width:100,height:100})});this.canvas=i,this.context=i.getContext("2d"),this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0}bindTextMeasure(t){this._textMeasure=t}measureText(t,e,i="native"){this.configure(this.global,this.global.env);const n=this.global.measureTextMethod;this.global.measureTextMethod=i;const r={width:this._textMeasure.measureTextWidth(t,e),height:e.fontSize??Yg.fontSize};return this.global.measureTextMethod=n,r}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new Mf({defaultFontParams:{fontFamily:Yg.fontFamily,fontSize:Yg.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Mf.ALPHABET_CHAR_SET+Mf.ALPHABET_CHAR_SET.toUpperCase(),...e??{}},t)}},t.DefaultGraphicUtil=dp([rp(),pp(0,op(gp)),pp(0,sp(dy)),pp(1,op(wp)),fp("design:paramtypes",[Object,Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(qy||(qy={}));const Ky=new _f;t.DefaultTransformUtil=class{matrix;originTransform;outSourceMatrix;outTargetMatrix;mode;constructor(){this.matrix=new _f}init(t){return this.mode=qy.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=qy.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(Ky.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){const{x:n,y:r}=i;this.outTargetMatrix.translate(n,r),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-n,-r)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Ky.a,Ky.b,Ky.c,Ky.d,Ky.e,Ky.f),this}scale(t,e,i){return this.mode===qy.matrix?this.scaleMatrix(t,e,i):this}translateMatrix(t,e){const i=this.outSourceMatrix;return Ky.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Ky.a,Ky.b,Ky.c,Ky.d,Ky.e,Ky.f),this}translate(t,e){return this.mode===qy.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===qy.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=dp([rp(),fp("design:paramtypes",[])],t.DefaultTransformUtil);const $y={arc:$g,area:Zg,circle:Jg,line:ey,path:iy,symbol:ay,text:oy,rect:ry,rect3d:sy,polygon:ny,richtext:hy,richtextIcon:ly,image:cy,group:Qg,glyph:ty},Zy=Object.keys($y);function Jy(){return{arc:Object.assign({},$y.arc),area:Object.assign({},$y.area),circle:Object.assign({},$y.circle),line:Object.assign({},$y.line),path:Object.assign({},$y.path),symbol:Object.assign({},$y.symbol),text:Object.assign({},$y.text),rect:Object.assign({},$y.rect),rect3d:Object.assign({},$y.rect3d),polygon:Object.assign({},$y.polygon),richtext:Object.assign({},$y.richtext),richtextIcon:Object.assign({},$y.richtextIcon),image:Object.assign({},$y.image),group:Object.assign({},$y.group),glyph:Object.assign({},$y.glyph)}}function Qy(t,e,i=!0){e&&(i?Object.keys(e).forEach((i=>{t[i]?Object.assign(t[i],e[i]):t[i]=e[i]})):Object.keys(e).forEach((i=>{if(t[i]){const n=t[i],r=e[i];Object.keys(e[i]).forEach((t=>{void 0===n[t]&&(n[t]=r[t])}))}else t[i]=e[i]})))}const tm=new Array(60).fill(0).map((()=>Jy()));class em{combinedTheme;userTheme;commonTheme;_defaultTheme;dirty;constructor(){this._defaultTheme=tm.pop()||Jy(),this.combinedTheme=this._defaultTheme,this.dirty=!1}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0),this.userTheme?Qy(this.userTheme,t.userTheme,!1):this.userTheme=Fp(t.userTheme),Qy(e,t.userTheme)}this.userTheme?this.doCombine(e):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,console.warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this._defaultTheme,n=this.combinedTheme,r=t.common||{},s=Object.assign(r,this.commonTheme);Zy.forEach((r=>{e[r]||s||t[r]?n[r]=Object.assign({},i[r],s??{},t[r]??{},e[r]??{}):n[r]=i[r]})),this.dirty=!1}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,t.common&&(this.commonTheme?Object.assign(this.commonTheme,t.common):this.commonTheme=t.common),this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const im=new em;function nm(t,e){return t.glyphHost?nm(t.glyphHost):e?(t.isContainer,e):rm(t)||im.getTheme()}function rm(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):im.getTheme()}return null}class sm{static auto_increment_id=0;static GenAutoIncrementId(){return sm.auto_increment_id++}}class am extends _p{parent;_prev;_next;_firstChild;_lastChild;_idMap;_count;_structEdit;_nodeList;get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=sm.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}async forEachChildrenAsync(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=await n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=await n),n)return;e=e._next}}}forEach(t){return this.forEachChildren(t)}appendChild(t){if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&console.warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(){if(!this._idMap)return;let t=this._firstChild;for(;t;)t.parent=null,t._prev=null,t._next=null,t=t._next;this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n))&&(i=e,!0))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;t?.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=Tp(i,!0)&&i||Mp(i)&&i.capture,r=Mp(i)&&i.once,s=Bp(e)?void 0:e;return t=n?`${t}capture`:t,e=Bp(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=Tp(i,!0)&&i||Mp(i)&&i.capture,r=Bp(e)?void 0:e;t=n?`${t}capture`:t,e=Bp(e)?e:e.handleEvent;const s=Mp(i)&&i.once;return super.off(t,e,r,s),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return Mp(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class om{bubbles=!0;cancelBubble=!0;cancelable=!1;composed=!1;currentTarget;defaultPrevented=!1;eventPhase=om.prototype.NONE;isTrusted;returnValue;srcElement;target;timeStamp;type;nativeEvent;originalEvent;propagationStopped=!1;propagationImmediatelyStopped=!1;path;manager;detail;view;layer=new hf;get layerX(){return this.layer.x}get layerY(){return this.layer.y}page=new hf;get pageX(){return this.page.x}get pageY(){return this.page.y}canvas=new hf;get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}viewport=new hf;get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}which;NONE=0;CAPTURING_PHASE=1;AT_TARGET=2;BUBBLING_PHASE=3}class hm extends om{altKey;button;buttons;ctrlKey;metaKey;relatedTarget;shiftKey;client=new hf;get clientX(){return this.client.x}get clientY(){return this.client.y}movement=new hf;get movementX(){return this.movement.x}get movementY(){return this.movement.y}offset=new hf;get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}global=new hf;get globalX(){return this.global.x}get globalY(){return this.global.y}screen=new hf;get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,n,r,s,a,o,h,c,l,u,d,p,f){throw new Error("Method not implemented.")}}class cm extends hm{pointerId;width=0;height=0;isPrimary=!1;pointerType;pressure;tangentialPressure;tiltX;tiltY;twist;getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){const t=new cm(this.manager);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t.nativeEvent=this.nativeEvent,t.originalEvent=this.originalEvent,this.manager?.copyPointerData(this,t),this.manager?.copyMouseData(this,t),this.manager?.copyData(this,t),t.target=this.target,t.path=this.composedPath().slice(),t.type=this.type,t}}class lm extends hm{deltaMode;deltaX;deltaY;deltaZ;static DOM_DELTA_PIXEL=0;DOM_DELTA_PIXEL=0;static DOM_DELTA_LINE=1;DOM_DELTA_LINE=1;static DOM_DELTA_PAGE=2;DOM_DELTA_PAGE=2;clone(){const t=new lm(this.manager);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t.nativeEvent=this.nativeEvent,t.originalEvent=this.originalEvent,this.manager?.copyWheelData(this,t),this.manager?.copyMouseData(this,t),this.manager?.copyData(this,t),t.target=this.target,t.path=this.composedPath().slice(),t.type=this.type,t}}class um extends om{constructor(t,e){super(),this.type=t,this.detail=e}}const dm="object"==typeof performance&&performance.now?performance:Date;function pm(t){return"mouse"===t||"pen"===t}class fm{rootTarget;dispatch=new _p;cursor;mappingTable;mappingState={trackingData:{}};eventPool=new Map;_prePointTargetCache;constructor(t){this.rootTarget=t,this.mappingTable={},this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];let i;const n=`${t.canvasX}-${t.canvasY}`;if(this._prePointTargetCache?.[n]?i=this._prePointTargetCache[n]:(i=this.pickTarget(t.canvasX,t.canvasY),this._prePointTargetCache={[n]:i}),e)for(let n=0,r=e.length;n<r;n++)e[n].fn(t,i);else console.warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let n=0,r=i.length-1;n<r;n++)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){e=e??t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}onPointerDown=(t,e)=>{if(!(t instanceof cm))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(pm(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)};onPointerMove=(t,e)=>{if(!(t instanceof cm))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e),n=pm(i.pointerType),r=this.trackingData(t.pointerId),s=this.findMountedTarget(r.overTargets);if(r.overTargets&&s&&s!==this.rootTarget&&s!==i.target){const e="mousemove"===t.type?"mouseout":"pointerout",r=this.createPointerEvent(t,e,s||void 0);if(this.dispatchEvent(r,"pointerout"),n&&this.dispatchEvent(r,"mouseout"),!i.composedPath().includes(s)){const e=this.createPointerEvent(t,"pointerleave",s||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!i.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),n&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(r)}if(s!==i.target){const e="mousemove"===t.type?"mouseover":"pointerover",r=this.clonePointerEvent(i,e);this.dispatchEvent(r,"pointerover"),n&&this.dispatchEvent(r,"mouseover");let a=s?.parent;for(;a&&a!==this.rootTarget.parent&&a!==i.target;)a=a.parent;if(!a||a===this.rootTarget.parent){const t=this.clonePointerEvent(i,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==s&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),n&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(r)}const a="dispatchEvent";this[a](i,"pointermove"),"touch"===i.pointerType&&this[a](i,"touchmove"),n&&(this[a](i,"mousemove"),this.cursor=i.target?.attribute?.cursor||this.rootTarget.getCursor()),r.overTargets=i.composedPath(),this.freeEvent(i)};onPointerOver=(t,e)=>{if(!(t instanceof cm))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),n=this.createPointerEvent(t,t.type,e),r=pm(n.pointerType);this.dispatchEvent(n,"pointerover"),r&&this.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(this.cursor=n.target?.attribute?.cursor||this.rootTarget.getCursor());const s=this.clonePointerEvent(n,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),r&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;i.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(s)};onPointerOut=(t,e)=>{if(!(t instanceof cm))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=pm(t.pointerType),n=this.findMountedTarget(i.overTargets),r=this.createPointerEvent(t,"pointerout",n||void 0);this.dispatchEvent(r),e&&this.dispatchEvent(r,"mouseout");const s=this.createPointerEvent(t,"pointerleave",n||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),e&&this.notifyTarget(s,"mouseleave"),s.target=s.target.parent;i.overTargets=[],this.freeEvent(r),this.freeEvent(s)}this.cursor=""};onPointerUp=(t,e)=>{if(!(t instanceof cm))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=dm.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(pm(n.pointerType)){const t=2===n.button;this.dispatchEvent(n,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),s=this.findMountedTarget(r.pressTargetsByButton[t.button]);let a=s;if(s&&!n.composedPath().includes(s)){let e=s;for(;e&&!n.composedPath().includes(e);){if(n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)this.notifyTarget(n,"touchendoutside");else if(pm(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],a=e}if(a){const e=this.clonePointerEvent(n,"click");e.target=a,e.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:i});const s=r.clicksByButton[t.button];s.target===e.target&&i-s.timeStamp<200?++s.clickCount:s.clickCount=1,s.target=e.target,s.timeStamp=i,e.detail=s.clickCount,pm(e.pointerType)?(this.dispatchEvent(e,"click"),2===s.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&this.dispatchEvent(e,"tap"),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)};onPointerUpOutside=(t,e)=>{if(!(t instanceof cm))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.pressTargetsByButton[t.button]),r=this.createPointerEvent(t,t.type,e);if(n){let e=n;for(;e;)r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):pm(r.pointerType)&&this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)};onWheel=(t,e)=>{if(!(t instanceof lm))return void console.warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)};findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){const n=this.allocateEvent(cm);return this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,n.target=i||this.pickTarget(n.global.x,n.global.y),"string"==typeof e&&(n.type=e),n}createWheelEvent(t,e){const i=this.allocateEvent(lm);return this.copyWheelData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=e||this.pickTarget(i.global.x,i.global.y),i}clonePointerEvent(t,e){const i=this.allocateEvent(cm);return i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice(),i.type=e??i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof cm&&e instanceof cm&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof hm&&e instanceof hm&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset),e.viewport.copyFrom(t.viewport))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=dm.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t)?.pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e)?.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].once&&t.currentTarget.removeEventListener(e,i[n].fn,{once:!0}),i[n].fn.call(i[n].context,t);else this.emitDelegation(t,e)}emitDelegation(t,e){const i=t.currentTarget._events["*"];if(i)if("fn"in i)i.fn.call(i.context,t,e);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,t,e)}pickTarget(t,e){let i;const n=this.rootTarget.pick(t,e);return i=n&&n.graphic?n.graphic:n&&n.group?n.group:t>=0&&t<=Lp(this.rootTarget,"width")&&e>=0&&e<=Lp(this.rootTarget,"height")?this.rootTarget:null,i}}const gm={pickable:!0,visible:!0,dispatchEvent(t){if(!(t instanceof om))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.target=this,t?.manager?.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new um(t,e))}},ym={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class mm{globalObj;manager;supportsTouchEvents;supportsPointerEvents;supportsMouseEvents;applyStyles;viewport;autoPreventDefault;cursorStyles;domElement;resolution=1;currentCursor;rootPointerEvent;rootWheelEvent;eventsAdded;constructor(t){const{targetElement:e,resolution:i,rootNode:n,global:r,viewport:s,autoPreventDefault:a=!1}=t;this.manager=new fm(n),this.globalObj=r,this.supportsPointerEvents=r.supportsPointerEvents,this.supportsTouchEvents=r.supportsTouchEvents,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=a,this.eventsAdded=!1,this.viewport=s,this.rootPointerEvent=new cm,this.rootWheelEvent=new lm,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.setTargetElement(null)}setCursor(t="default"){const{applyStyles:e,domElement:i}=this;if(this.currentCursor===t)return;this.currentCursor=t;const n=this.cursorStyles[t];n?"string"==typeof n&&e?i.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&e&&Object.assign(i.style,n):e&&kp(t)&&!Wp(this.cursorStyles,t)&&(i.style.cursor=t)}onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized){(t.cancelable||!("cancelable"in t))&&t.preventDefault()}for(let t=0,i=e.length;t<i;t++){const i=e[t],n=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(n)}this.setCursor(this.manager.cursor)};onPointerMove=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor)};onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetElement(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,n=i.length;t<n;t++){const n=this.bootstrapEvent(this.rootPointerEvent,i[t]);n.type+=e,this.manager.mapEvent(n)}this.setCursor(this.manager.cursor)};onPointerOverOut=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor)};onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){const e=this.viewport,{x:i,y:n}=t;return{x:i-e.x,y:n-e.y}}mapToCanvasPoint(t){const e=this.globalObj?.mapToCanvasPoint(t,this.domElement);if(e)return e;const{clientX:i,clientY:n}=t,r=this.domElement.getBoundingClientRect();return{x:i-r.left,y:n-r.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,n=t.changedTouches.length;i<n;i++){const n=t.changedTouches[i];Rp(n.button)&&(n.button=0),Rp(n.buttons)&&(n.buttons=1),Rp(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),Rp(n.width)&&(n.width=n.radiusX||1),Rp(n.height)&&(n.height=n.radiusY||1),Rp(n.tiltX)&&(n.tiltX=0),Rp(n.tiltY)&&(n.tiltY=0),Rp(n.pointerType)&&(n.pointerType="touch"),Rp(n.pointerId)&&(n.pointerId=n.identifier||0),Rp(n.pressure)&&(n.pressure=n.force||.5),Rp(n.twist)&&(n.twist=0),Rp(n.tangentialPressure)&&(n.tangentialPressure=0),Rp(n.layerX)&&(n.layerX=n.offsetX=n.clientX),Rp(n.layerY)&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=t.type,e.push(n)}else if(this.globalObj.supportsMouseEvents&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof PointerEvent))e.push(t);else{const i=t;Rp(i.isPrimary)&&(i.isPrimary=!0),Rp(i.width)&&(i.width=1),Rp(i.height)&&(i.height=1),Rp(i.tiltX)&&(i.tiltX=0),Rp(i.tiltY)&&(i.tiltY=0),Rp(i.pointerType)&&(i.pointerType="mouse"),Rp(i.pointerId)&&(i.pointerId=1),Rp(i.pressure)&&(i.pressure=.5),Rp(i.twist)&&(i.twist=0),Rp(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:i,y:n}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=n,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas);const{x:r,y:s}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:i,y:n}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=n,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas);const{x:r,y:s}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=ym[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=dm.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetElement(t){let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);return e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}}const vm=(t,e)=>{const i=e.x-t.x,n=e.y-t.y;return Math.abs(i)>Math.abs(n)?i>0?"right":"left":n>0?"down":"up"},bm=(t,e)=>{const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return Math.sqrt(i*i+n*n)};class xm{timerId;time=0;static Avaliable(){return!0}avaliable(){return xm.Avaliable()}tick(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}tickTo(t,e){this.time=Math.max(0,t),e(this,{once:!0})}release(){this.timerId>0&&(this.timerId=-1)}getTime(){return this.time}}class wm{timerId;static Avaliable(){return!0}avaliable(){return wm.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class Sm{released;static Avaliable(){return!!gy.global.getRequestAnimationFrame()}avaliable(){return Sm.Avaliable()}tick(t,e){gy.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var Am;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Am||(Am={}));class _m{interval;tickerHandler;_mode;status;lastFrameTime;tickCounts;timelines;autoStop;set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=Am.INITIAL,gy.global.hooks.onSetEnv.tap("window",(()=>{this.initHandler()})),gy.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:Sm},{mode:"timeout",cons:wm},{mode:"manual",cons:xm}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new Sm;break;case"timeout":t=new wm;break;case"manual":t=new xm;break;default:console.warn("非法的计时器模式"),t=new Sm}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==Am.INITIAL&&(this.status=Am.PAUSE,!0)}resume(){return this.status!==Am.INITIAL&&(this.status=Am.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(t=!1){if(this.status===Am.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Am.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=Am.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=Am.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}handleTick=(t,e)=>{const{once:i=!1}=e??{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))};_handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===Am.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(i)})))}}class Cm{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static quadIn=Cm.getPowIn(2);static quadOut=Cm.getPowOut(2);static quadInOut=Cm.getPowInOut(2);static cubicIn=Cm.getPowIn(3);static cubicOut=Cm.getPowOut(3);static cubicInOut=Cm.getPowInOut(3);static quartIn=Cm.getPowIn(4);static quartOut=Cm.getPowOut(4);static quartInOut=Cm.getPowInOut(4);static quintIn=Cm.getPowIn(5);static quintOut=Cm.getPowOut(5);static quintInOut=Cm.getPowInOut(5);static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static backIn=Cm.getBackIn(1.7);static backOut=Cm.getBackOut(1.7);static backInOut=Cm.getBackInOut(1.7);static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-Cm.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Cm.bounceIn(2*t):.5*Cm.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/qp*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*qp/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/qp*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*qp/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/qp*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*qp/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*qp/e)*.5+1}}static elasticIn=Cm.getElasticIn(1,.3);static elasticOut=Cm.getElasticOut(1,.3);static elasticInOut=Cm.getElasticInOut(1,.3*1.5)}class Tm{constructor(){this.id=sm.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(e){if(this.paused)return;let i=this.animateHead;for(this.animateCount=0;i;)i.status===t.AnimateStatus.END?this.removeAnimate(i):i.status===t.AnimateStatus.RUNNING||i.status===t.AnimateStatus.INITIAL?(this.animateCount++,i.advance(e)):i.status===t.AnimateStatus.PAUSED&&this.animateCount++,i=i.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),t.release()}}const Bm=new Tm;class Pm{constructor(t,e,i,n,r){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){}getFromProps(){return this.from}getMergedEndProps(){const t=this.getEndProps();return t?this._endProps===t?this._mergedEndProps:(this._endProps=t,void(this._mergedEndProps=Object.assign({},this.step.prev.getLastProps()??{},t))):this.step.prev?this.step.prev.getLastProps():t}update(t,e,i){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1,Object.assign(i,this.step.getLastProps()),this.onUpdate(t,e,i),t&&this.onEnd()}}class Em extends Pm{cb;constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Mm{static mode=t.AnimateMode.NORMAL;static interpolateMap=new Map;constructor(e=sm.GenAutoIncrementId(),i=Bm){this.id=e,this.timeline=i,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new Rm(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=Jp(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Mm.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(e,i=Mm.mode){e&&i&t.AnimateMode.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_PLAY})}runCb(t){const e=new Em((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const a=Mm.interpolateMap.get(t)||Mm.interpolateMap.get("");return!!a&&a(t,e,i,n,r,s)}pause(){this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.PAUSED)}resume(){this.status===t.AnimateStatus.PAUSED&&(this.status=t.AnimateStatus.RUNNING)}to(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new Rm(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(e){if(this._duringTime<this._startTime){if(this._duringTime+e*this.timeScale<this._startTime)return void(this._duringTime+=e*this.timeScale);e=this._duringTime+e*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===t.AnimateStatus.INITIAL&&(this.status=t.AnimateStatus.RUNNING,this._onStart&&this._onStart.forEach((t=>t())));this.setPosition(this.rawPosition+e*this.timeScale)&&this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const n=this.rawPosition,r=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const s=t>=r;if(s&&(t=r),t===n)return s;for(let n=0;n<this.subAnimates.length&&(e=this.subAnimates[n],!(i+e.totalDuration>=t));n++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=t.AnimateStatus.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}class Rm{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new km(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(e){let i=e.duration;(null==i||i<0)&&(i=0);const n=e.easing,r="string"==typeof n?Cm[n]:n,s=this._addStep(i,null,r);return s.type=t.AnimateStepType.customAnimate,this._appendProps(e.getEndProps(),s,!1),this._appendCustomAnimate(e,s),this}to(e,i,n,r){(null==i||i<0)&&(i=0);const s="string"==typeof n?Cm[n]:n,a=this._addStep(i,null,s);return a.type=t.AnimateStepType.to,this._appendProps(e,a,!!r&&r.tempProps),a.propKeys||(a.propKeys=Object.keys(a.props)),r&&r.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(a.propKeys)})),this}from(e,i,n,r){this.to(e,0,n,r);const s={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{s[t]=this.getLastPropByName(t,this.stepTail)})),this.to(s,i,n,r),this.stepTail.type=t.AnimateStepType.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){return this.stepHead?.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(e){if(e>0){const i=this._addStep(+e,null);i.type=t.AnimateStepType.wait,i.prev.customAnimate?i.props=i.prev.customAnimate.getEndProps():i.props=i.prev.props,this.target.onAddStep&&this.target.onAddStep(i)}return this}_addStep(t,e,i){const n=new km(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=n.props[t])}))),n=n.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach((t=>{if(void 0===s[t]){const e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){const e=this.duration,i=this.loop,n=this.rawPosition;let r,s,a=!1;const o=this._startAt??0;if(t<0&&(t=0),t<o)return this.rawPosition=t,!1;if(t-=o,e<=0)return a=!0,a;if(r=Math.floor(t/e),s=t-r*e,a=t>=i*e+e,a&&(s=e,r=i,t=s*r+e),t===n)return a;const h=!this.reversed!=!(this.bounce&&r%2);return h&&(s=e-s),this._deltaPosition=s-this.position,this.position=s,this.rawPosition=t+o,this.updatePosition(a,h),a}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,r=this.duration;if(this.target&&i){let s=i.next;for(;s&&s.position<=n;)i=s,s=i.next;let a=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,a)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return console.warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class km{type;constructor(t,e,i,n){this.duration=e,this.position=t,this.props=i,this.easing=n}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const Dm={duration:200,easing:"cubicOut"},Im={duration:1e3,easing:"quadInOut"};var Om;t.Edge=void 0,(Om=t.Edge||(t.Edge={}))[Om.Top=1]="Top",Om[Om.Right=2]="Right",Om[Om.Bottom=4]="Bottom",Om[Om.Left=8]="Left",Om[Om.ALL=15]="ALL";const Lm=[!1,!1,!1,!1],Um=t=>{let e=!0;if(Tp(t,!0)){for(let i=0;i<4;i++)Lm[i]=t,e&&=!!(Lm[i]??1);e=t}else if(Array.isArray(t))for(let i=0;i<4;i++)Lm[i]=!!t[i],e&&=!!Lm[i];else Lm[0]=!1,Lm[1]=!1,Lm[2]=!1,Lm[3]=!1;return{isFullStroke:e,stroke:Lm}},Wm=[0,0,0,0],Fm=t=>t?Dp(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Wm[0]=t[0],Wm[2]=t[0],Wm[1]=t[1],Wm[3]=t[1],Wm):t:t:0,Nm=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],zm=[1,2,3,0,1,2,3,0];function jm(t,e,i,n){for(;t>=qp;)t-=qp;for(;t<0;)t+=qp;for(;t>e;)e+=qp;Nm[0].x=i,Nm[1].y=i,Nm[2].x=-i,Nm[3].y=-i;const r=Math.ceil(t/Xp)%4,s=Math.ceil(e/Xp)%4;if(n.add(Zp(t)*i,tf(t)*i),n.add(Zp(e)*i,tf(e)*i),r!==s||e-t>Vp){let t=!1;for(let e=0;e<zm.length;e++)if(t||r!==zm[e]){if(t&&s===zm[e])break;if(t){const t=Nm[zm[e]];n.add(t.x,t.y)}}else{t=!0;const e=Nm[r];n.add(e.x,e.y)}}}function Hm(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function Gm(t,e,i){const{x:n,y:r}=af(t.x,t.y,e.x,e.y,i),{x:s,y:a}=af(t.x1,t.y1,e.x1,e.y1,i),o=new hf(n,r,s,a);return o.defined=e.defined,o}function Vm(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let n=[];if(t.length>e.length){n=e.map((t=>{const e=new hf(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)n[r]=Gm(t[r],e[r],i)}else{n=e.map((t=>{const e=new hf(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)n[r]=Gm(t[r],e[r],i)}return n}const Xm=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],Ym=t=>Xm.includes(t);function qm(t,e){if(Dp(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}class Km{static TimeOut=1e3/60;durations;timeout;lastDate;durationsListThreshold;constructor(){this.durations=[],this.timeout=Km.TimeOut,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout((()=>{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}const $m=new Km;var Zm;!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(Zm||(Zm={}));class Jm extends Pm{_group;_clipGraphic;clipFromAttribute;clipToAttribute;_lastClip;_lastPath;constructor(t,e,i,n,r){super(null,null,i,n,r),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=r?.group,this._clipGraphic=r?.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:t.AttributeUpdateType.ANIMATE_END})}onUpdate(e,i,n){if(!this._clipGraphic)return;const r={};Object.keys(this.clipFromAttribute).forEach((t=>{r[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*i})),this._clipGraphic.setAttributes(r,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:i,end:e}})}}function Qm(t,e,i,n,r,s){const a=(e-t)*r+t,o=(i-e)*r+e,h=(n-i)*r+i,c=(o-a)*r+a,l=(h-o)*r+o,u=(l-c)*r+c;s[0]=t,s[1]=a,s[2]=c,s[3]=u,s[4]=u,s[5]=l,s[6]=h,s[7]=n}function tv(t,e){const i=t.length,n=e.length;if(i===n)return[t,e];const r=[],s=[],a=i<n?t:e,o=Math.min(i,n),h=Math.abs(n-i)/6,c=(o-2)/6,l=Math.ceil(h/c),u=[a[0],a[1]];let d=h;for(let t=2;t<o;t+=6){let e=a[t-2],i=a[t-1],n=a[t],o=a[t+1],h=a[t+2],c=a[t+3];const p=a[t+4],f=a[t+5];if(d<=0){u.push(n,o,h,c,p,f);continue}const g=Math.min(d,l)+1;for(let t=1;t<=g;t++){const a=t/g;Qm(e,n,h,p,a,r),Qm(i,o,c,f,a,s),e=r[3],i=s[3],u.push(r[1],s[1],r[2],s[2],e,i),n=r[5],o=s[5],h=r[6],c=s[6]}d-=g-1}return a===t?[u,e]:[t,u]}function ev(t,e){const i=t||e,n=i.length,r=i[n-2],s=i[n-1],a=[];for(let t=0;t<e.length;t+=2)a[t]=r,a[t+1]=s;return a}function iv(t){const e=[],i=t.length;for(let n=0;n<i;n+=2)e[n]=t[i-n-2],e[n+1]=t[i-n-1];return e}function nv(t){let e=0,i=0,n=0;const r=t.length;for(let s=0,a=r-2;s<r;a=s,s+=2){const r=t[a],o=t[a+1],h=t[s],c=t[s+1],l=r*c-h*o;e+=l,i+=(r+h)*l,n+=(o+c)*l}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,n/e/3,e]}function rv(t,e,i,n){const r=(t.length-2)/6;let s=1/0,a=0;const o=t.length,h=o-2;for(let c=0;c<r;c++){const r=6*c;let l=0;for(let s=0;s<o;s+=2){const a=0===s?r:(r+s-2)%h+2,o=t[a]-i[0],c=t[a+1]-i[1],u=e[s]-n[0]-o,d=e[s+1]-n[1]-c;l+=u*u+d*d}l<s&&(s=l,a=c)}return a}function sv(t,e,i,n){const r=[];let s;for(let a=0;a<t.length;a++){let o=t[a];const h=e[a],c=nv(o),l=nv(h);null==s&&(s=c[2]<0!=l[2]<0);const u=[],d=[];let p=0,f=1/0;const g=[],y=o.length;s&&(o=iv(o));const m=6*rv(o,h,c,l),v=y-2;for(let t=0;t<v;t+=2){const e=(m+t)%v+2;u[t+2]=o[e]-c[0],u[t+3]=o[e+1]-c[1]}if(u[0]=o[m]-c[0],u[1]=o[m+1]-c[1],i>0){const t=n/i;for(let e=-n/2;e<=n/2;e+=t){const t=Math.sin(e),i=Math.cos(e);let n=0;for(let e=0;e<o.length;e+=2){const r=u[e],s=u[e+1],a=h[e]-l[0],o=h[e+1]-l[1],c=a*i-o*t,d=a*t+o*i;g[e]=c,g[e+1]=d;const p=c-r,f=d-s;n+=p*p+f*f}if(n<f){f=n,p=e;for(let t=0;t<g.length;t++)d[t]=g[t]}}}else for(let t=0;t<y;t+=2)d[t]=h[t]-l[0],d[t+1]=h[t+1]-l[1];r.push({from:u,to:d,fromCp:c,toCp:l,rotation:-p})}return r}function av(t,e){let i,n;const r=[],s=[];for(let a=0;a<Math.max(t.length,e.length);a++){const o=t[a],h=e[a];let c,l;o?h?([c,l]=tv(o,h),i=c,n=l):(l=ev(n,o),c=o):(c=ev(i,h),l=h),r.push(c),s.push(l)}return[r,s]}const ov=(t,e,i,n,r)=>{Hp(e,n)&&Hp(i,r)||t.push(e,i,n,r,n,r)};function hv(t){const e=t.commandList,i=[];let n,r=0,s=0,a=0,o=0;const h=(t,e)=>{n&&n.length>2&&i.push(n),n=[t,e]};let c,l,u,d;for(let t=0,i=e.length;t<i;t++){const i=e[t],p=0===t;switch(p&&(a=r=i[1],o=s=i[2],[Lf.L,Lf.C,Lf.Q].includes(i[0])&&(n=[a,o])),i[0]){case Lf.M:r=a=i[1],s=o=i[2],h(a,o);break;case Lf.L:c=i[1],l=i[2],ov(n,r,s,c,l),r=c,s=l;break;case Lf.C:n.push(i[1],i[2],i[3],i[4],r=i[5],s=i[6]);break;case Lf.Q:c=i[1],l=i[2],u=i[3],d=i[4],n.push(r+2/3*(c-r),s+2/3*(l-s),u+2/3*(c-u),d+2/3*(l-d),u,d),r=u,s=d;break;case Lf.A:{const t=i[1],e=i[2],u=i[3],d=u,f=i[4],g=i[5],y=!!i[6];c=Math.cos(f)*u+t,l=Math.sin(f)*u+e,p?(a=c,o=l,h(a,o)):ov(n,r,s,c,l),r=Math.cos(g)*u+t,s=Math.sin(g)*u+e;const m=(y?-1:1)*Math.PI/2;for(let i=f;y?i>g:i<g;i+=m){const r=y?Math.max(i+m,g):Math.min(i+m,g);eg(n,i,r,t,e,u,d)}break}case Lf.E:{const t=i[1],e=i[2],u=i[3],d=i[4],f=i[5],g=i[6],y=i[7]+g,m=!!i[8],v=!Hp(f,0),b=Math.cos(f),x=Math.sin(f);let w=Math.cos(g)*u,S=Math.sin(g)*d;v?(c=w*b-S*x+t,l=w*x+S*b+e):(c=w+t,l=S+e),p?(a=c,o=l,h(a,o)):ov(n,r,s,c,l),w=Math.cos(y)*u,S=Math.sin(y)*d,v?(r=w*b-S*x+t,s=w*x+S*b+e):(r=w+t,s=S+e);const A=(m?-1:1)*Math.PI/2;for(let i=g;m?i>y:i<y;i+=A){const r=m?Math.max(i+A,y):Math.min(i+A,y);if(eg(n,i,r,t,e,u,d),v){const i=n.length;for(let r=i-6;r<=i-1;r+=2)w=n[r],S=n[r+1],n[r]=(w-t)*b-(S-e)*x+t,n[r+1]=(w-t)*x+(S-e)*b+e}}break}case Lf.R:a=r=i[1],o=s=i[2],c=a+i[3],l=o+i[4],h(c,o),ov(n,c,o,c,l),ov(n,c,l,a,l),ov(n,a,l,a,o),ov(n,a,o,c,o);break;case Lf.AT:{const t=i[1],e=i[2],h=i[3],c=i[4],l=i[5],u=cf.distancePP({x:r,y:s},{x:t,y:e}),d=cf.distancePP({x:h,y:c},{x:t,y:e}),p=((r-t)*(h-t)+(s-e)*(c-e))/(u*d),f=l/Math.sin(p/2),g=(r+h-2*t)/2,y=(s+c-2*e)/2,m=cf.distancePP({x:g,y:y},{x:0,y:0}),v=t+f*g/m,b=h+f*y/m,x=Math.sqrt(f*f-l*l);a=t+x*(r-t)/u,o=e+x*(s-e)/u,ov(n,r,s,a,o),r=t+x*(h-t)/d,s=e+x*(c-e)/d;const w=ff({x:v,y:b},{x:a,y:o}),S=ff({x:v,y:b},{x:r,y:s});eg(n,w,S,v,b,l,l);break}case Lf.Z:n&&ov(n,r,s,a,o),r=a,s=o}}return n&&n.length>2&&i.push(n),i}function cv(t,e){for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<n.length;t+=2){const i=n[t],r=n[t+1],s={x:i,y:r};e.transformPoint({x:i,y:r},s),n[t]=s.x,n[t+1]=s.y}}}function lv(t){const e=new Ng;for(let i=0;i<t.length;i++){const n=t[i];if(n.length>2){e.moveTo(n[0],n[1]);for(let t=2;t<n.length;t+=6)e.bezierCurveTo(n[t],n[t+1],n[t+2],n[t+3],n[t+4],n[t+5])}}return e}function uv(t,e,i){const n=t/e;let r,s;t>=e?(s=Math.ceil(Math.sqrt(i*n)),r=Math.floor(i/s),0===r&&(r=1,s=i)):(r=Math.ceil(Math.sqrt(i/n)),s=Math.floor(i/r),0===s&&(s=1,r=i));const a=[];for(let t=0;t<r;t++)a.push(s);const o=i-r*s;if(o>0)for(let t=0;t<o;t+=s)t+s<o?a.push(s):a.push(o-t);return a}const dv=(t,e)=>{const i=t.getComputedAttribute("width"),n=t.getComputedAttribute("height"),r=uv(i,n,e),s=[],a=n/r.length;for(let t=0,e=r.length;t<e;t++){const e=r[t],n=i/e;for(let i=0;i<e;i++)s.push({x:0+i*n,y:0+t*a,width:n,height:a})}return s},pv=(t,e)=>{const i=t.getParsedAngle(),n=i.startAngle,r=i.endAngle,s=t.getComputedAttribute("innerRadius"),a=t.getComputedAttribute("outerRadius"),o=Math.abs(n-r),h=Math.abs(a-s),c=uv(o*(s+a)/2,h,e),l=[],u=h/c.length,d=a>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=c.length;t<e;t++){const e=c[t],i=o/e;for(let r=0;r<e;r++)l.push({innerRadius:a-u*t*d,outerRadius:a-u*(t+1)*d,startAngle:n+i*r*p,endAngle:n+i*(r+1)*p})}return l},fv=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),a=uv(s*r,r,e),o=[],h=s/a[0],c=r/a.length,l=n>=i?1:-1;for(let t=0,e=a.length;t<e;t++)for(let e=0,n=a[t];e<n;e++)o.push({innerRadius:c*t,outerRadius:c*(t+1),startAngle:i+h*e*l,endAngle:i+h*(e+1)*l});return o},gv=(t,e)=>{const i=t.filter((t=>!1!==t.defined&&Ip(t.x)&&Ip(t.y)));if(0===i.length)return[];if(1===i.length)return new Array(e).fill(0).map((t=>i[0]));const n=[];if(e<=i.length){const t=i.length/e;let r=0,s=0;for(;r<e;)n.push(i[Math.floor(s)]),s+=t,r++;return n}const r=e-i.length,s=1/(r/(i.length-1)+1);let a=0;for(let e=0,i=t.length;e<i;e++)if(n.push(t[e]),e<i-1){let i=s;const o=t[e].x,h=t[e].y,c=t[e+1].x,l=t[e+1].y;for(;i<1&&a<r;)n.push({x:o+(c-o)*i,y:h+(l-h)*i}),i+=s,a+=1}return n},yv=(t,e)=>{const i=t.attribute;let n=i.points;const r=i.segments;n||(n=r.reduce(((t,e)=>t.concat(e.points??[])),[]));const s=n.filter((t=>!1!==t.defined&&Ip(t.x)&&Ip(t.y)));if(!s.length)return[];const a=[];s.forEach((t=>{a.push({x:t.x,y:t.y})}));for(let t=s.length-1;t>=0;t--){const e=s[t];a.push({x:e.x1??e.x,y:e.y1??e.y})}const o=[];return wv(n,e,o),o},mv=(t,e)=>{const i=t.attribute,n=i.points;if(n)return gv(n,e);if(i.segments){const t=i.segments.reduce(((t,e)=>t.concat(e.points??[])),[]);return gv(t,e)}return[]};const vv=t=>t.map((t=>({x:t.x,y:t.y}))),bv=(t,e,i)=>{const n=t.length,r=[];for(let o=0;o<n;o++){const h=t[o],c=o===n-1?t[0]:t[o+1],l=Tf([e.x,e.y],[i.x,i.y],[h.x,h.y],[c.x,c.y]);l&&"boolean"!=typeof l&&r.push({dot:(s=[l[0]-e.x,l[1]-e.x],a=[i.x-e.x,i.y-e.x],s[0]*a[1]-s[1]*a[0]),point:{x:l[0],y:l[1]},edgeIndex:o})}var s,a;if(r.length<2)return[vv(t),vv(t)];r.sort(((t,e)=>t.dot-e.dot));let o=r[0],h=r[r.length-1];o.edgeIndex>h.edgeIndex&&([o,h]=[h,o]);const c=o.point,l=h.point,u=[{x:c.x,y:c.y}];for(let e=o.edgeIndex+1;e<=h.edgeIndex;e++)u.push({x:t[e].x,y:t[e].y});u.push({x:l.x,y:l.y});const d=[{x:l.x,y:l.y}];for(let e=h.edgeIndex+1,i=o.edgeIndex+n;e<=i;e++){const i=t[e%n];d.push({x:i.x,y:i.y})}return d.push({x:c.x,y:c.y}),[u,d]},xv=t=>{const e=new uf;t.forEach((t=>{e.add(t.x,t.y)}));const i=e.width(),n=e.height();if(i>=n){const n=e.x1+i/2;return bv(t,{x:n,y:e.y1},{x:n,y:e.y2})}const r=e.y1+n/2;return bv(t,{x:e.x1,y:r},{x:e.x2,y:r})},wv=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=xv(t);wv(r[0],n,i),wv(r[1],e-n,i)}},Sv=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:vv(i)}];const n=[];return wv(i,e,n),n},Av=(t,e)=>{const i=hv(t.getParsedPathShape());if(!i.length||e<0)return[];const n=i.length;if(i.length>=e){const t=[],r=Math.floor(i.length/e);for(let s=0;s<e;s++){const a=i.slice(s*r,s===e-1?n:(s+1)*r);t.push({path:lv(a)})}return t}const r=[],s=Math.floor(e/n);let a=e;for(let t=0;t<n;t++){const e=[];for(let n=2,r=i[t].length;n<r;n+=2)e.push({x:i[0][n],y:i[0][n+1]});wv(e,t===n-1?a:s,r),a-=s}return r};var _v={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const Cv={};for(const t in _v)Wp(_v,t)&&(Cv[_v[t]]=t);const Tv={to:{},get:{}};function Bv(t,e,i){return Math.min(Math.max(e,t),i)}function Pv(t){const e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}Tv.get=function(t,e=[0,0,0,1]){let i,n;switch(t.substring(0,3).toLowerCase()){case"hsl":i=Tv.get.hsl(t,e),n="hsl";break;case"hwb":i=Tv.get.hwb(t,e),n="hwb";break;default:i=Tv.get.rgb(t,e),n="rgb"}return i?{model:n,value:i}:null},Tv.get.rgb=function(t,e=[0,0,0,1]){if(!t)return null;const i=e;let n,r,s;if(n=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(s=n[2],n=n[1],r=0;r<3;r++){const t=2*r;i[r]=parseInt(n.slice(t,t+2),16)}s&&(i[3]=Math.round(parseInt(s,16)/255*100)/100)}else if(n=t.match(/^#([a-f0-9]{3,4})$/i)){for(n=n[1],s=n[3],r=0;r<3;r++)i[r]=parseInt(n[r]+n[r],16);s&&(i[3]=Math.round(parseInt(s+s,16)/255*100)/100)}else if(n=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/)){for(r=0;r<3;r++)i[r]=parseInt(n[r+1],10);n[4]&&(i[3]=parseFloat(n[4]))}else{if(!(n=t.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/))){if(n=t.match(/(\D+)/)){if("transparent"===n[1])return[0,0,0,0];const t=_v[n[1]];return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i?(i[3]=1,i):null}return null}for(r=0;r<3;r++)i[r]=Math.round(2.55*parseFloat(n[r+1]));n[4]&&(i[3]=parseFloat(n[4]))}for(r=0;r<3;r++)i[r]=Bv(i[r],0,255);return i[3]=Bv(i[3],0,1),i},Tv.get.hsl=function(t,e=[0,0,0,1]){if(!t)return null;const i=t.match(/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(i){const t=parseFloat(i[4]);return e[0]=(parseFloat(i[1])+360)%360,e[1]=Bv(parseFloat(i[2]),0,100),e[2]=Bv(parseFloat(i[3]),0,100),e[3]=Bv(isNaN(t)?1:t,0,1),e}return null},Tv.get.hwb=function(t,e=[0,0,0,1]){if(!t)return null;const i=t.match(/^hwb\(\s*([+-]?\d*[.]?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(i){const t=parseFloat(i[4]);return e[0]=(parseFloat(i[1])%360+360)%360,e[1]=Bv(parseFloat(i[2]),0,100),e[2]=Bv(parseFloat(i[3]),0,100),e[3]=Bv(isNaN(t)?1:t,0,1),e}return null},Tv.to.hex=function(...t){const e=t;return"#"+Pv(e[0])+Pv(e[1])+Pv(e[2])+(e[3]<1?Pv(Math.round(255*e[3])):"")},Tv.to.rgb=function(...t){const e=t;return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},Tv.to.rgb.percent=function(...t){const e=t,i=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+i+"%, "+n+"%, "+r+"%)":"rgba("+i+"%, "+n+"%, "+r+"%, "+e[3]+")"},Tv.to.hsl=function(...t){const e=t;return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},Tv.to.hwb=function(...t){const e=t;let i="";return e.length>=4&&1!==e[3]&&(i=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+i+")"},Tv.to.keyword=function(t){return Cv[t.slice(0,3)]};const Ev=Tv;var Mv;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Mv||(Mv={}));class Rv{static store255={};static store1={};static Get(t,e=Mv.Color1,i=[0,0,0,1]){if(e===Mv.Color1){let e=Rv.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;if(e=Tv.get(t),e&&e.value){const n=e.value,r=[n[0]/255,n[1]/255,n[2]/255,n[3]];Rv.store1[t]=r,Rv.store255[t]=n,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3]}return i}let n=Rv.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;if(n=Tv.get(t),n&&n.value){const e=n.value;Rv.store1[t]=[e[0]/255,e[1]/255,e[2]/255,e[3]],Rv.store255[t]=e,i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}static Set(t,e,i){if(e===Mv.Color1){if(Rv.store1[t])return;Rv.store1[t]=i,Rv.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Rv.store255[t])return;Rv.store255[t]=i,Rv.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function kv(t,e=!1){return Array.isArray(t)?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function Dv(t,e,i,n,r){if(!t||!e)return t&&kv(t)||e&&kv(e)||!1;let s,a,o=!1,h=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=Rv.Get(t,Mv.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=Rv.Get(e,Mv.Color255):h=!0,o!==h){const s=o?t:e,a=o?e:t,h={...s,stops:s.stops.map((t=>({...t,color:kv(a)})))};return o?Dv(s,h,i,n,r):Dv(h,s,i,n,r)}if(o){if(t.gradient===e.gradient){const n=t,r=e,s=n.stops,a=r.stops;if(s.length!==a.length)return!1;if("linear"===n.gradient)return function(t,e,i){const n=t.stops,r=e.stops,s={gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Lv(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))};return s}(n,r,i);if("radial"===n.gradient)return function(t,e,i){const n=t.stops,r=e.stops,s={gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Lv(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))};return s}(n,r,i);if("conical"===n.gradient)return function(t,e,i){const n=t.stops,r=e.stops,s={gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Lv(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))};return s}(n,r,i)}return!1}r&&r(s,a);const c=function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(s,a,i);return kv(c,n)}const Iv=[0,0,0,0],Ov=[0,0,0,0];function Lv(t,e,i){return Rv.Get(t,Mv.Color255,Iv),Rv.Get(e,Mv.Color255,Ov),`rgba(${Math.round(Iv[0]+(Ov[0]-Iv[0])*i)},${Math.round(Iv[1]+(Ov[1]-Iv[1])*i)},${Math.round(Iv[2]+(Ov[2]-Iv[2])*i)},${Iv[3]+(Ov[3]-Iv[3])*i})`}const Uv=(t,e,i)=>{t.forEach((t=>{if(Number.isFinite(t.to))e[t.key]=t.from+(t.to-t.from)*i;else if("fill"===t.key||"stroke"===t.key){const n=Dv(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},Wv=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const a=t[s],o=a.from,h=a.to,c=a.rotation*i,l=a.fromCp,u=a.toCp,d=Math.sin(c),p=Math.cos(c);r[0]=l[0]+(u[0]-l[0])*i,r[1]=l[1]+(u[1]-l[1])*i;for(let t=0;t<o.length;t+=2){const e=o[t],s=o[t+1],a=e*(1-i)+h[t]*i,c=s*(1-i)+h[t+1]*i;n[t]=a*p-c*d+r[0],n[t+1]=a*d+c*p+r[1]}let f=n[0],g=n[1];e.moveTo(f,g);for(let t=2;t<o.length;t+=6){const i=n[t],r=n[t+1],s=n[t+2],a=n[t+3],o=n[t+4],h=n[t+5];f===i&&g===r&&s===o&&a===h?e.lineTo(o,h):e.bezierCurveTo(i,r,s,a,o,h),f=o,g=h}}},Fv=(t,e,i)=>{const n=t?hv(t):[],r=hv(e);i&&n&&(i.fromTransform&&cv(n,i.fromTransform.clone().getInverse()),cv(n,i.toTransfrom));const[s,a]=av(n,r);return t?sv(s,a,10,Math.PI):a.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},Nv=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],zv=(t,e)=>{if(!t||!e)return null;const i=[];let n=!1;return Object.keys(t).forEach((r=>{if(!Nv.includes(r))return;const s=e[r];Pp(s)||Pp(t[r])||s===t[r]||("fill"===r||"stroke"===r?i.push({from:"string"==typeof t[r]?Rv.Get(t[r],Mv.Color255):t[r],to:"string"==typeof s?Rv.Get(s,Mv.Color255):s,key:r}):i.push({from:t[r],to:s,key:r}),n=!0)})),n?i:null};class jv extends Pm{saveOnEnd;otherAttrs;constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}morphingData;getEndProps(){return{}}onBind(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}onEnd(){}onUpdate(t,e,i){const n=this.target,r="function"==typeof n.pathProxy?n.pathProxy(n.attribute):n.pathProxy;Wv(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&Uv(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const Hv=(t,e,i,n)=>{if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;let r=t?.globalTransMatrix;n&&r&&(r=n.clone().multiply(r.a,r.b,r.c,r.d,r.e,r.f));const s=Fv(t?.toCustomPath?.(),e.toCustomPath(),{fromTransform:r,toTransfrom:e.globalTransMatrix}),a=zv(t?.attribute,e.attribute),o=e.animate(i);return i?.delay&&o.wait(i.delay),o.play(new jv({morphingData:s,otherAttrs:a},i?.duration??Im.duration,i?.easing??Im.easing)),o};class Gv extends Pm{otherAttrs;constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}morphingData;getEndProps(){return{}}onBind(){this.addPathProxy()}addPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.createPathProxy()})),this.onUpdate(!1,0,this.target.attribute)}clearPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.pathProxy=null}))}onEnd(){}onUpdate(t,e,i){this.target.shadowRoot.forEachChildren(((t,i)=>{Wv(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),this.otherAttrs?.[i]&&this.otherAttrs[i].length&&Uv(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const Vv=t=>{const e={};return Object.keys(t).forEach((i=>{Ym(i)||(e[i]=t[i])})),e},Xv=(t,e,i)=>{const n=Vv(t.attribute),r=t.attachShadow();if(e.length)r.setTheme({[e[0].type]:n}),e.forEach((t=>{r.appendChild(t)}));else{const s=t.AABBBounds,a=s.width(),o=s.height();r.setTheme({rect:n}),new Array(i).fill(0).forEach((t=>{const i=gy.graphicService.creator.rect({x:0,y:0,width:a,height:o});r.appendChild(i),e.push(i)}))}},Yv=(t,e,i)=>{const n=[],r=i?null:Vv(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new Ng).fromCustomPath2D(s)};n.push(gy.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&Xv(t,n,e),n},qv=(t,e,i)=>{const n=[],r=i?null:Vv(t.attribute);if("rect"===t.type){dv(t,e).forEach((t=>{n.push(gy.graphicService.creator.rect(i?t:Object.assign({},r,t)))}))}else if("arc"===t.type){pv(t,e).forEach((t=>{n.push(gy.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("circle"===t.type){fv(t,e).forEach((t=>{n.push(gy.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("line"===t.type){const s=mv(t,e),a={size:10,symbolType:"circle"};s.forEach((t=>{n.push(gy.graphicService.creator.symbol(i?Object.assign({},t,a):Object.assign({},r,t,a)))}))}else if("polygon"===t.type){Sv(t,e).forEach((t=>{n.push(gy.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("area"===t.type){yv(t,e).forEach((t=>{n.push(gy.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("path"===t.type){Av(t,e).forEach((t=>{"path"in t?n.push(gy.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(gy.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}return i&&Xv(t,n,e),n};class Kv{static cache=new Map;static GetImage(t,e){let i=Kv.cache.get(t);i?"fail"===i.loadState?gy.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?i.waitingMark?.push(e):e&&gy.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,i.data)})):(i={type:"image",loadState:"init"},Kv.cache.set(t,i),i.dataPromise=gy.global.loadImage(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{i.loadState=e?.data?"success":"fail",i.data=e?.data,i.waitingMark?.map(((n,r)=>{e?.data?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))}))}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetSvg(t,e){let i=Kv.cache.get(t);i?"fail"===i.loadState?gy.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?i.waitingMark?.push(e):e&&gy.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,i.data)})):(i={type:"image",loadState:"init"},Kv.cache.set(t,i),i.dataPromise=gy.global.loadSvg(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{i.loadState=e?.data?"success":"fail",i.data=e?.data,i.waitingMark?.map(((n,r)=>{e?.data?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))}))}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Kv.cache.get(t);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Kv.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=gy.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=gy.global.loadBlob(t):"json"===e&&(i.dataPromise=gy.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}}const $v=new _f,Zv=["lineWidth","lineCap","lineJoin","miterLimit","scaleX","scaleY","angle","anchor"],Jv=["x","y"],Qv=["scaleX","scaleY"],tb=["angle"],eb=new hf;class ib extends am{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(ib.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(e={}){super(),this._AABBBounds=new df,this._updateTag=t.UpdateTag.INIT,this.attribute=e,this.valid=this.isValid(),e.background&&this.loadImage(e.background,!0)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){const{dx:i=t.dx,dy:n=t.dy}=this.attribute;if(e&&this.parent){const t=nm(this.parent).group,{scrollX:e=t.scrollX,scrollY:r=t.scrollY}=this.parent.attribute;eb.x=i+e,eb.y=n+r}else eb.x=i,eb.y=n;return eb}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;gy.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return gy.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this.AABBBounds.clone(),this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new _f),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_LOCAL_MATRIX)}isValid(){const t=this.attribute;return Number.isFinite((t.x??0)+(t.y??0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&t.UpdateTag.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=t.UpdateTag.CLEAR_SHAPE}containsPoint(e,i,n,r){if(!r)return!1;if(n===t.IContainPointMode.GLOBAL){const t=new hf(e,i);this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),e=t.x,i=t.y}return r.containsPoint(this,{x:e,y:i})}setAttributes(t,e=!1,i){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,i)}_setAttributes(t,e=!1,i){const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);r?this._setAttributes(r,i,n):Pp(this.normalAttrs?.[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t&&this.loadImage(e,!0)}needUpdateTags(t){for(let e=0;e<Zv.length;e++){const i=Zv[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Zv.length;e++){if(t===Zv[e])return!0}return!1}initAttributes(e){const i={type:t.AttributeUpdateType.INIT};e=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,null,i)||e,this.attribute=e,e.background&&this.loadImage(e.background,!0),this._updateTag=t.UpdateTag.INIT,this.onAttributeUpdate(i)}translate(e,i){if(0===e&&0===i)return this;const n={type:t.AttributeUpdateType.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,Jv,n);r&&(e=r.x,i=r.y,delete r.x,delete r.y,this._setAttributes(r));const s=this.attribute,a=s.postMatrix;return a?gy.transformUtil.fromMatrix(a,a).translate(e,i):(s.x=(s.x??Hg.x)+e,s.y=(s.y??Hg.y)+i),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(n),this}translateTo(e,i){const n=this.attribute;if(n.x===e&&n.y===i)return this;const r={type:t.AttributeUpdateType.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,Jv,r);return s?(this._setAttributes(s,!1,r),this):(n.x=e,n.y=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(r),this)}scale(e,i,n){if(1===e&&1===i)return this;const r={type:t.AttributeUpdateType.SCALE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i,scaleCenter:n},this.attribute,Qv,r);s&&(e=s.scaleX,i=s.scaleY,delete s.scaleX,delete s.scaleY,this._setAttributes(s));const a=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new _f,a.postMatrix=t),gy.transformUtil.fromMatrix(t,t).scale(e,i,n)}else a.scaleX=(a.scaleX??Hg.scaleX)*e,a.scaleY=(a.scaleY??Hg.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(r),this}scaleTo(e,i){const n=this.attribute;if(n.scaleX===e&&n.scaleY===i)return this;const r={type:t.AttributeUpdateType.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i},this.attribute,Qv,r);return s?(this._setAttributes(s,!1,r),this):(n.scaleX=e,n.scaleY=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(r),this)}rotate(e){if(0===e)return this;const i={type:t.AttributeUpdateType.ROTATE},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,tb,i);if(n)return this._setAttributes(n,!1,i),this;const r=this.attribute;return r.angle=(r.angle??Hg.angle)+e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(i),this}rotateTo(e){const i=this.attribute;if(i.angle===e)return this;const n={type:t.AttributeUpdateType.ROTATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,tb,n);return r?(this._setAttributes(r,!1,n),this):(i.angle=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new Mm(t?.id).bind(this);if(t){const{onStart:i,onFrame:n,onEnd:r,onRemove:s}=t;null!=i&&e.onStart(i),null!=n&&e.onFrame(n),null!=r&&e.onEnd(r),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){gy.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t)}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!Pp(t)||this.currentStates.includes(t))}getState(t){return this.states?.[t]}applyStateAttrs(e,i,n,r){if(n){const t=Object.keys(e),n=r?t.reduce(((t,i)=>(t[i]=void 0===e[i]?this.getDefaultAttribute(i):e[i],t)),{}):e,s=this.animate();s.stateNames=i,s.to(n,this.stateAnimateConfig?.duration??Dm.duration,this.stateAnimateConfig?.easing??Dm.easing)}else this.setAttributes(e,!1,{type:t.AttributeUpdateType.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const n=i.getEndProps();Wp(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs&&this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[]}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else{if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}}addState(t,e,i){if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const n=e&&this.currentStates?.length?this.currentStates.concat([t]):[t];this.useStates(n,i)}useStates(t,e){if(!t.length)return void this.clearStates(e);if(!(this.currentStates?.length!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const i={};t.forEach((e=>{const n=this.stateProxy?this.stateProxy(e,t):this.states?.[e];n&&Object.assign(i,n)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS)===t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_GLOBAL_MATRIX}doUpdateLocalMatrix(){const{x:t=Hg.x,y:e=Hg.y,scaleX:i=Hg.scaleX,scaleY:n=Hg.scaleY,angle:r=Hg.angle,anchor:s,postMatrix:a}=this.attribute,o=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=this.AABBBounds;o[0]=e.x1+(e.x2-e.x1)*t}else o[0]=s[0];if("string"==typeof s[1]){const t=parseFloat(s[1])/100,e=this.AABBBounds;o[1]=e.x1+(e.x2-e.x1)*t}else o[1]=s[1]}!function(t,e,i,n,r,s,a,o){var h,c,l=e.a,u=e.b,d=e.c,p=e.d,f=e.e,g=e.f,y=Zp(a),m=tf(a);o?(h=o[0],c=o[1]):(h=i,c=n);var v=h-i,b=c-n,x=l*y+d*m,w=u*y+p*m,S=d*y-l*m,A=p*y-u*m;t.a=r*x,t.b=r*w,t.c=s*S,t.d=s*A,t.e=f+l*h+d*c-x*v-S*b,t.f=g+u*h+p*c-w*v-A*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,s&&o);const h=this.getOffsetXY(Hg);if(this._transMatrix.e+=h.x,this._transMatrix.f+=h.y,a){const t=$v.setValue(a.a,a.b,a.c,a.d,a.e,a.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),gy.graphicService.onSetStage(this,t))}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(e){e&&this.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_END})}onStep(e,i,n,r,s){const a={};if(n.customAnimate)n.customAnimate.update(s,r,a);else{const t=n.props,o=n.parsedProps,h=n.propKeys;this.stepInterpolate(e,i,a,n,r,s,t,void 0,o,h)}this.setAttributes(a,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:r,end:s,step:n,isFirstFrameOfStep:e.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,r,s,a,o,h,c){c||(c=Object.keys(a),n.propKeys=c),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):c.forEach((s=>{if(!e.validAttr(s))return;const c=a[s],l=(o&&o[s])??t.getLastPropByName(s,n);let u;u=e.interpolateFunc&&e.interpolateFunc(s,r,l,c,i),u||(u=e.customInterpolate(s,r,l,c,this,i),u||this.defaultInterpolate(c,l,s,i,h,r)||this._interpolate(s,r,l,c,i))})),n.parsedProps=h}defaultInterpolate(t,e,i,n,r,s){if(Number.isFinite(t))return n[i]=e+(t-e)*s,!0;if("fill"===i){r||(r={});const a=Dv(e,r.fillColorArray??t,s,!1,((t,e)=>{r.fillColorArray=e}));return a&&(n[i]=a),!0}if("stroke"===i){r||(r={});const a=Dv(e,r.strokeColorArray??t,s,!1,((t,e)=>{r.strokeColorArray=e}));return a&&(n[i]=a),!0}if("shadowColor"===i){r||(r={});const a=Dv(e,r.shadowColorArray??t,s,!0,((t,e)=>{r.shadowColorArray=e}));return a&&(n[i]=a),!0}return!1}_interpolate(t,e,i,n,r){}getDefaultAttribute(t){return nm(this)[this.type][t]}getComputedAttribute(t){return this.attribute[t]??this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=t??gy.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return kp(t,!0)?this.pathProxy=(new Ng).fromString(t):this.pathProxy=new Ng,this.pathProxy}loadImage(t,e=!1){if(!t)return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};var r;this.resources.set(i,n),"string"==typeof t?(n.state="loading",r=t,new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(r)||function(t){return new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t)}(t)?(Kv.GetImage(t,this),this.backgroundImg=this.backgroundImg||e):t.startsWith("<svg")&&(Kv.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e)):(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e)}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released"}_emitCustomEvent(t,e){if(this._events&&t in this._events){const i=new um(t,e);i.bubbles=!1,i.manager=this.stage?.eventSystem?.manager,this.dispatchEvent(i)}}}function nb(t,e,i,n=0){return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}ib.mixin(gm);let rb=0;function sb(){return rb++}const ab=sb(),ob=sb(),hb=sb(),cb=sb(),lb=sb(),ub=sb(),db=sb(),pb=sb(),fb=sb(),gb=sb(),yb=sb(),mb=sb(),vb=sb(),bb=sb(),xb=sb(),wb=sb(),Sb=Symbol.for("GraphicService"),Ab=Symbol.for("GraphicCreator");var _b;t.GroupUpdateAABBBoundsMode=void 0,(_b=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[_b.LESS_GROUP=0]="LESS_GROUP",_b[_b.MORE_GROUP=1]="MORE_GROUP";class Cb extends ib{type="group";parent=null;isContainer=!0;constructor(e){super(e),this.numberType=ub,this._childUpdateTag=t.UpdateTag.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new em),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new em)}hideAll(){this.setAttribute("visible",!1),this.forEachChildren((t=>{t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)}))}showAll(){this.setAttribute("visible",!0),this.forEachChildren((t=>{t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)}))}containsPoint(e,i,n){if(n===t.IContainPointMode.GLOBAL){const t=new hf(e,i);return this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),this.AABBBounds.contains(t.x,t.y)}return this.AABBBounds.contains(e,i)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;gy.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return gy.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateAABBBounds(){const t=this.attribute,e=nm(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=gy.graphicService.updateGroupAABBBounds(t,nm(this).group,this._AABBBounds,this),{boundsPadding:n=e.boundsPadding}=t,r=Fm(n);return r&&i.expand(r),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),i}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS,this._childUpdateTag&=t.UpdateTag.CLEAR_BOUNDS}tryUpdateOBBBounds(){throw new Error("暂不支持")}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS||(this._childUpdateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),gy.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),gy.graphicService.onClearIncremental(this,this.stage)}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){const i=super.insertBefore(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertAfter(t,e){const i=super.insertAfter(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertInto(t,e){const i=super.insertInto(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}removeChild(t){const e=super.removeChild(t);return t.stage=null,gy.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){this.forEachChildren((t=>{gy.graphicService.onRemove(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),gy.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=gy.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new Cb({...this.attribute})}}const Tb=Symbol.for("LayerHandlerContribution");class Bb extends Cb{get offscreen(){return this.layerHandler.offscreen}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,n){super({}),this.stage=t,this.global=e,this.window=i,this.main=n.main,this.layerHandler=fy.get(Tb),this.layerHandler.init(this,i,{main:n.main,canvasId:n.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:n.zIndex??0}),this.layer=this,this.subLayers=new Map,this.theme=new em,this.background="rgba(0, 0, 0, 0)",this.virtual=!!n.virtual,this.afterDrawCbs=[]}combineSubLayer(t=!0){const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{gy.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}render(t,e){const i=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:i.x,y:i.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:t.background??this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this)))}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){throw new Error("暂不支持")}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}combineTo(t,e){this.offscreen&&(this.layerHandler.drawTo(t,[this],{background:e.background??this.background,renderService:e.renderService,x:this.stage.x,y:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,...e}),this.afterDrawCbs.forEach((t=>t(this))))}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{gy.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){this.layerHandler.drawTo(t,[this],{background:e.background??this.background,renderService:e.renderService,x:this.stage.x,y:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,...e}),this.afterDrawCbs.forEach((t=>t(this)))}}t.DefaultLayerService=class{global;constructor(t){this.global=t,this.layerMap=new Map}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}createLayer(t,e={main:!1}){this.tryInit();const i=new Bb(t,this.global,t.window,{...e,virtual:0===this.staticLayerCountInEnv}),n=this.layerMap.get(t)||[];return n.push(i),this.layerMap.set(t,n),this.staticLayerCountInEnv--,i}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}},t.DefaultLayerService=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],t.DefaultLayerService);const Pb=Symbol.for("Window"),Eb=Symbol.for("WindowHandlerContribution");t.DefaultWindow=class{global;_width;_height;_handler;hooks={onChange:new bp(["x","y","width","height"])};get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(t){this.global=t,this._uid=sm.GenAutoIncrementId()}postInit(){this.global.hooks.onSetEnv.tap("window",(()=>{this.active()})),this.active()}active(){const t=this.global;if(!t.env||this.actived)return;fy.getNamed(Eb,t.env).configure(this,t),this.actived=!0}get style(){return this._handler.getStyle()}set style(t){this._handler.setStyle(t)}create(t){this._handler.createWindow(t);const e=this._handler.getWH();this._width=e.width,this._height=e.height,this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t,e){this._handler.clearViewBox(t,e)}},dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],t.DefaultWindow.prototype,"postInit",null),t.DefaultWindow=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],t.DefaultWindow);const Mb=Symbol.for("TransformUtil"),Rb=Symbol.for("GraphicUtil"),kb=Symbol.for("LayerService");var Db=new Qd((e=>{e(t.DefaultGlobal).toSelf().inSingletonScope(),e(wp).toService(t.DefaultGlobal),e(t.DefaultWindow).to(t.DefaultWindow),e(Pb).toService(t.DefaultWindow),e(t.DefaultGraphicUtil).toSelf().inSingletonScope(),e(Rb).toService(t.DefaultGraphicUtil),e(t.DefaultTransformUtil).toSelf().inSingletonScope(),e(Mb).toService(t.DefaultTransformUtil),e(t.DefaultLayerService).toSelf().inSingletonScope(),e(kb).toService(t.DefaultLayerService)}));function Ib(t,e){return!(!t&&!e)}function Ob(t,e){let i;return i=Dp(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Lb(t,e,i){return i&&t*e>0}function Ub(t,e,i,n,r){return r&&t*e>0&&i>0&&n>0}function Wb(t,e){return t*e>0}function Fb(t,e,i,n){return t*e>0&&i>0&&n>0}function Nb(t,e,i,n,r,s,a,o){if(!t.pathProxy)return!1;const h=nm(t,s?.theme)[t.type],{fill:c=h.fill,stroke:l=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:g=h.visible}=t.attribute,y=Lb(u,d,c),m=Wb(u,f),v=Ib(c),b=Ob(l,p);if(!g)return!0;if(!v&&!b)return!0;if(!(y||m||a||o))return!0;e.beginPath();return ng(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),b&&(o?o(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),v&&(a?a(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fill())),!0}function zb(t,e,i,n,r,s,a,o){const h=i-t,c=n-e,l=a-r,u=o-s;let d=u*h-l*c;return d*d<Gp?[]:(d=(l*(e-s)-u*(t-r))/d,[t+d*h,e+d*c])}function jb(t,e,i,n,r,s,a){const o=t-i,h=e-n,c=(a?s:-s)/Math.sqrt(o*o+h*h),l=c*h,u=-c*o,d=t+l,p=e+u,f=i+l,g=n+u,y=(d+f)/2,m=(p+g)/2,v=f-d,b=g-p,x=v*v+b*b,w=r-s,S=d*g-f*p,A=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-S*S));let _=(S*b-v*A)/x,C=(-S*v-b*A)/x;const T=(S*b+v*A)/x,B=(-S*v+b*A)/x,P=_-y,E=C-m,M=T-y,R=B-m;return P*P+E*E>M*M+R*R&&(_=T,C=B),{cx:_,cy:C,x01:-l,y01:-u,x11:_*(r/w-1),y11:C*(r/w-1)}}function Hb(t,e,i,n,r,s,a){const{startAngle:o,endAngle:h}=t.getParsedAngle(),c=Kp(h-o),l=h>o;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=Gp)e.moveTo(i,n);else if(c>=qp-Gp)e.moveTo(i+r*Zp(o),n+r*tf(o)),e.arc(i,n,r,o,h,!l),s>Gp&&(e.moveTo(i+s*Zp(h),n+s*tf(h)),e.arc(i,n,s,h,o,l));else{const d=t.getParsedCornerRadius(),{outerDeltaAngle:p,innerDeltaAngle:f,outerStartAngle:g,outerEndAngle:y,innerEndAngle:m,innerStartAngle:v}=t.getParsePadAngle(o,h),b=d,x=d,w=d,S=d,A=Math.max(x,b),_=Math.max(w,S);let C=A,T=_;const B=r*Zp(g),P=r*tf(g),E=s*Zp(m),M=s*tf(m);let R,k,D,I;if((_>Gp||A>Gp)&&(R=r*Zp(y),k=r*tf(y),D=s*Zp(v),I=s*tf(v),c<Vp)){const t=zb(B,P,D,I,R,k,E,M);if(t){const e=B-t[0],i=P-t[1],n=R-t[0],a=k-t[1],o=1/tf(rf((e*n+i*a)/(ef(e*e+i*i)*ef(n*n+a*a)))/2),h=ef(t[0]*t[0]+t[1]*t[1]);T=Qp(_,(s-h)/(o-1)),C=Qp(A,(r-h)/(o+1))}}if(p<.001)a&&(a[3]||a[1])&&e.moveTo(i+B,n+P),u=!0;else if(C>Gp){const t=Qp(b,C),s=Qp(x,C),o=jb(D,I,B,P,r,t,Number(l)),h=jb(R,k,E,M,r,s,Number(l));C<A&&t===s?!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,C,$p(o.y01,o.x01),$p(h.y01,h.x01),!l)):e.moveTo(i+o.cx+C*Zp($p(h.y01,h.x01)),n+o.cy+C*tf($p(h.y01,h.x01))):!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),t>0&&e.arc(i+o.cx,n+o.cy,t,$p(o.y01,o.x01),$p(o.y11,o.x11),!l),e.arc(i,n,r,$p(o.cy+o.y11,o.cx+o.x11),$p(h.cy+h.y11,h.cx+h.x11),!l),s>0&&e.arc(i+h.cx,n+h.cy,s,$p(h.y11,h.x11),$p(h.y01,h.x01),!l)):s>0?e.moveTo(i+h.cx+s*Zp($p(h.y01,h.x01)),n+h.cy+s*tf($p(h.y01,h.x01))):e.moveTo(i+R,n+r*tf(y))}else a&&!a[0]||(e.moveTo(i+B,n+P),e.arc(i,n,r,g,y,!l));if(!(s>Gp)||f<.001)!a||a[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),u=!0;else if(T>Gp){const t=Qp(S,T),r=Qp(w,T),o=jb(E,M,R,k,s,-r,Number(l)),h=jb(B,P,D,I,s,-t,Number(l));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),T<_&&t===r){const t=$p(h.y01,h.x01);!a||a[2]?e.arc(i+o.cx,n+o.cy,T,$p(o.y01,o.x01),t,!l):e.moveTo(i+o.cx+Zp(t),n+o.cy+tf(t))}else!a||a[2]?(r>0&&e.arc(i+o.cx,n+o.cy,r,$p(o.y01,o.x01),$p(o.y11,o.x11),!l),e.arc(i,n,s,$p(o.cy+o.y11,o.cx+o.x11),$p(h.cy+h.y11,h.cx+h.x11),l),t>0&&e.arc(i+h.cx,n+h.cy,t,$p(h.y11,h.x11),$p(h.y01,h.x01),!l)):t>0?e.moveTo(i+h.cx+t*Zp($p(h.y01,h.x01)),n+h.cy+t*tf($p(h.y01,h.x01))):e.moveTo(i+D,n+I)}else!a||a[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),!a||a[2]?e.arc(i,n,s,m,v,l):e.moveTo(i+s*Zp(v),n+s*tf(v))}return a?a[3]&&e.lineTo(i+r*Zp(h),n+r*Zp(h)):e.closePath(),u}class Gb{static canvas;static ctx;static GetCanvas(){try{return Gb.canvas||(Gb.canvas=gy.global.createCanvas({})),Gb.canvas}catch(t){return null}}static GetCtx(){if(!Gb.ctx){const t=Gb.GetCanvas();Gb.ctx=t.getContext("2d")}return Gb.ctx}}class Vb{rgbaSet;constructor(t=[],e=100){const i=Gb.GetCanvas(),n=Gb.GetCtx();if(i.width=e,i.height=1,!n)return;if(n.translate(0,0),!n)throw new Error("获取ctx发生错误");const r=n.createLinearGradient(0,0,e,0);t.forEach((t=>{r.addColorStop(t[0],t[1])})),n.fillStyle=r,n.fillRect(0,0,e,1),this.rgbaSet=n.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}static dataMap=new Map;static GetOrCreate(t=[],e=100){let i="";t.forEach((t=>i+=t.join())),i+=e;let n=Vb.dataMap.get(i);return n||(n=new Vb(t,e),Vb.dataMap.set(i,n)),n}static SetColorInterpolateInstance(t,e){Vb.dataMap.set(t,e)}static GetColorInterpolateInstance(t){return Vb.dataMap.get(t)}}class Xb{static cache={};static ImageSize=[20,40,80,160,320,640,1280,2560];static GetSize(t){for(let e=0;e<Xb.ImageSize.length;e++)if(Xb.ImageSize[e]>=t)return Xb.ImageSize[e];return t}static Get(t,e,i,n,r,s,a){const o=Xb.GenKey(t,e,i,n,r),h=Xb.cache[o];if(!h||0===h.length)return null;for(let t=0;t<h.length;t++)if(h[t].width>=s&&h[t].height>=a)return h[t].pattern;return null}static Set(t,e,i,n,r,s,a,o){const h=Xb.GenKey(t,e,i,n,r);Xb.cache[h]?Xb.cache[h].push({width:a,height:o,pattern:s}):Xb.cache[h]=[{width:a,height:o,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function Yb(t,e,i,n){const{stops:r,startAngle:s,endAngle:a}=n;for(;i<0;)i+=qp;for(;i>qp;)i-=qp;if(i<s)return r[0].color;if(i>a)return r[0].color;let o,h,c=(i-s)/(a-s);for(let t=0;t<r.length;t++)if(r[t].offset>=c){o=r[t-1],h=r[t];break}return c=(c-o.offset)/(h.offset-o.offset),Dv(o.color,h.color,c,!1)}function qb(t,e,i,n,r,s,a,o,h){const c=Math.floor(180*r/Math.PI),l=Gb.GetCanvas(),u=Gb.GetCtx();if(!u)return null;const d=Xb.GetSize(o),p=Xb.GetSize(h);let f=Xb.Get(e,i,n,s,a,d,p);if(f)return f;const g=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(n,2),Math.pow(d-i,2)+Math.pow(n,2)),Math.max(Math.pow(d-i,2)+Math.pow(p-n,2),Math.pow(i,2)+Math.pow(p-n,2)))),y=c+1,m=r/Math.max(1,y-1),v=Vb.GetOrCreate(e,y),b=2*Math.PI*g/360;l.width=d,l.height=p,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,d,p),u.translate(i,n),u.rotate(s);for(let t=0,e=y-1;t<e&&!(s+t*m>a);t++){const e=v.getColor(t);u.beginPath(),u.rotate(m),u.moveTo(0,0),u.lineTo(g,-2*b),u.lineTo(g,0),u.fillStyle=e,u.closePath(),u.fill()}const x=u.getImageData(0,0,d,p);return l.width=x.width,l.height=x.height,u.putImageData(x,0,0),f=t.createPattern(l,"no-repeat"),f&&Xb.Set(e,i,n,s,a,f,d,p),f}const Kb=Symbol.for("ArcRenderContribution"),$b=Symbol.for("AreaRenderContribution"),Zb=Symbol.for("CircleRenderContribution"),Jb=Symbol.for("GroupRenderContribution"),Qb=Symbol.for("ImageRenderContribution"),tx=Symbol.for("PathRenderContribution"),ex=Symbol.for("PolygonRenderContribution"),ix=Symbol.for("RectRenderContribution"),nx=Symbol.for("SymbolRenderContribution"),rx=Symbol.for("TextRenderContribution"),sx=Symbol.for("InteractiveSubRenderContribution");t.DefaultCanvasArcRender=class{arcRenderContribitions;type;numberType=ab;_arcBeforeRenderContribitions;_arcAfterRenderContribitions;constructor(t){this.arcRenderContribitions=t}drawArcTailCapPath(t,e,i,n,r,s,a,o){const h=o-a,c=t.getParsedAngle(),l=c.startAngle;let u=c.endAngle;u=o;const d=Kp(u-l),p=u>l;let f=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),{outerDeltaAngle:y,innerDeltaAngle:m,outerStartAngle:v,outerEndAngle:b,innerEndAngle:x,innerStartAngle:w}=t.getParsePadAngle(l,u),S=g,A=g,_=g,C=g,T=Math.max(A,S),B=Math.max(_,C);let P=T,E=B;const M=r*Zp(v),R=r*tf(v),k=s*Zp(x),D=s*tf(x);let I,O,L,U;if((B>Gp||T>Gp)&&(I=r*Zp(b),O=r*tf(b),L=s*Zp(w),U=s*tf(w),d<Vp)){const t=zb(M,R,L,U,I,O,k,D);if(t){const e=M-t[0],i=R-t[1],n=I-t[0],a=O-t[1],o=1/tf(rf((e*n+i*a)/(ef(e*e+i*i)*ef(n*n+a*a)))/2),h=ef(t[0]*t[0]+t[1]*t[1]);E=Qp(B,(s-h)/(o-1)),P=Qp(T,(r-h)/(o+1))}}if(P>Gp){const t=Qp(S,P),s=Qp(A,P),a=jb(L,U,M,R,r,t,Number(p)),o=jb(I,O,k,D,r,s,Number(p));if(P<T&&t===s)e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),e.arc(i+a.cx,n+a.cy,P,$p(a.y01,a.x01),$p(o.y01,o.x01),!p);else{const t=u-h-.03,a=$p(o.y11,o.x11);e.arc(i,n,r,t,a,!p),s>0&&e.arc(i+o.cx,n+o.cy,s,$p(o.y11,o.x11),$p(o.y01,o.x01),!p)}}else e.moveTo(i+M,n+R);if(!(s>Gp)||m<.001)e.lineTo(i+k,n+D),f=!0;else if(E>Gp){const t=Qp(C,E),r=Qp(_,E),a=jb(k,D,I,O,s,-r,Number(p)),o=jb(M,R,L,U,s,-t,Number(p));if(e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01),E<B&&t===r){const t=$p(o.y01,o.x01);e.arc(i+a.cx,n+a.cy,E,$p(a.y01,a.x01),t,!p)}else{r>0&&e.arc(i+a.cx,n+a.cy,r,$p(a.y01,a.x01),$p(a.y11,a.x11),!p);const t=$p(a.cy+a.y11,a.cx+a.x11),o=u-h-.03;e.arc(i,n,s,t,o,p)}}else e.lineTo(i+s*Zp(w),n+s*tf(w));return f}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).arc,{fill:l=c.fill,background:u,stroke:d=c.stroke,opacity:p=c.opacity,fillOpacity:f=c.fillOpacity,lineWidth:g=c.lineWidth,strokeOpacity:y=c.strokeOpacity,visible:m=c.visible,x:v=c.x,y:b=c.y}=e.attribute,x=Lb(p,f,l),w=Wb(p,y),S=Ib(l,u),A=Ob(d,g);if(!e.valid||!m)return;if(!S&&!A)return;if(!(x||w||o||h||u))return;const{outerRadius:_=c.outerRadius,innerRadius:C=c.innerRadius,cap:T=c.cap,forceShowCap:B=c.forceShowCap}=e.attribute;let P=!1;const{isFullStroke:E,stroke:M}=Um(d);if(S||E){if(i.beginPath(),Hb(e,i,n,r,_,C),!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const e=this.arcRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._arcBeforeRenderContribitions.push(e):this._arcAfterRenderContribitions.push(e)}))}P=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,c,s,o,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),S&&(o?o(i,e.attribute,c):x&&(i.setCommonStyle(e,e.attribute,v-n,b-r,c),i.fill())),A&&E&&(h?h(i,e.attribute,c):w&&(i.setStrokeStyle(e,e.attribute,v-n,b-r,c),i.stroke()))}if(!E&&A){if(i.beginPath(),Hb(e,i,n,r,_,C,M),!P){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const e=this.arcRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._arcBeforeRenderContribitions.push(e):this._arcAfterRenderContribitions.push(e)}))}P=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,c,s,o,h)}))}h?h(i,e.attribute,c):w&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke())}if(T&&B){const{startAngle:a,endAngle:l}=e.getParsedAngle();if(Kp(l-a)>=qp-Gp){i.beginPath();const a=Math.abs(_-C)/2/_,{endAngle:l=c.endAngle,fill:u=c.fill}=e.attribute,d=l;if(this.drawArcTailCapPath(e,i,n,r,_,C,d,d+a),!P){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const e=this.arcRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._arcBeforeRenderContribitions.push(e):this._arcAfterRenderContribitions.push(e)}))}P=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,c,s,o,h)}))}if(S){const t=u;if("conical"===t.gradient){const s=Yb(0,0,l,t);o||Lb&&(i.setCommonStyle(e,e.attribute,n,r,c),i.fillStyle=s,i.fill())}}A&&(h||w&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke()))}}this._arcAfterRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,c,s,o,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=nm(t,n?.theme).arc;r.highPerformanceSave();let{x:a=s.x,y:o=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);a+=e.x,o+=e.y,r.setTransformForCurrent()}else a=0,o=0,r.transformFromMatrix(t.transMatrix,!0);Nb(t,r,a,o,0,n)||this.drawShape(t,r,a,o,i,n),r.highPerformanceRestore()}},t.DefaultCanvasArcRender=dp([rp(),pp(0,op(gp)),pp(0,sp(Kb)),fp("design:paramtypes",[Object])],t.DefaultCanvasArcRender),t.DefaultCanvasCircleRender=class{circleRenderContribitions;type;numberType=cb;_circleRenderContribitions;constructor(t){this.circleRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).circle,{fill:l=c.fill,background:u,stroke:d=c.stroke,radius:p=c.radius,startAngle:f=c.startAngle,endAngle:g=c.endAngle,fillOpacity:y=c.fillOpacity,strokeOpacity:m=c.strokeOpacity,opacity:v=c.opacity,lineWidth:b=c.lineWidth,visible:x=c.visible,x:w=c.x,y:S=c.y}=e.attribute,A=Lb(v,y,l),_=Wb(v,m),C=Ib(l,u),T=Ob(d,b);e.valid&&x&&(C||T)&&(A||_||o||h||u)&&(i.beginPath(),i.arc(n,r,p,f,g),i.closePath(),this._circleRenderContribitions||(this._circleRenderContribitions=this.circleRenderContribitions.getContributions()||[],this._circleRenderContribitions.sort(((t,e)=>e.order-t.order))),this._circleRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),C&&(o?o(i,e.attribute,c):A&&(i.setCommonStyle(e,e.attribute,w-n,S-r,c),i.fill())),T&&(h?h(i,e.attribute,c):_&&(i.setStrokeStyle(e,e.attribute,w-n,S-r,c),i.stroke())),this._circleRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h)})))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=nm(t,n?.theme).circle;let{x:a=s.x,y:o=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);a+=e.x,o+=e.y,r.setTransformForCurrent()}else a=0,o=0,r.transformFromMatrix(t.transMatrix,!0);Nb(t,r,a,o,0,n)||this.drawShape(t,r,a,o,i,n),r.highPerformanceRestore()}},t.DefaultCanvasCircleRender=dp([rp(),pp(0,op(gp)),pp(0,sp(Zb)),fp("design:paramtypes",[Object])],t.DefaultCanvasCircleRender);const ax=["radius","startAngle","endAngle",...Zv];class ox extends ib{type="circle";constructor(t={radius:1}){super(t),this.numberType=cb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}doUpdateAABBBounds(t){const e=nm(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=gy.graphicService.updateCircleAABBBounds(i,nm(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Fm(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return nm(this).circle[t]}needUpdateTags(t){for(let e=0;e<ax.length;e++){const i=ax[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<ax.length;e++){if(t===ax[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=t.radius??this.getDefaultAttribute("radius"),i=t.startAngle??this.getDefaultAttribute("startAngle"),n=t.endAngle??this.getDefaultAttribute("endAngle"),r=new Ng;return r.arc(0,0,e,i,n),r}clone(){return new ox({...this.attribute})}}function hx(t,e={},i){i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(s?s+" ":"")+a*i+"px "+(o||"sans-serif")}function cx(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function lx(t,e,i,n=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?n-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}class ux{fontFamily;textOptions;textMeasure;constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,n,r,s,a,o){const h=[],c=[e,i],l=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,a);h.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===n||"start"===n||("center"===n?l[0]=c[0]/-2:"right"!==n&&"end"!==n||(l[0]=-c[0])),"top"===r||("middle"===r?l[1]=c[1]/-2:"bottom"===r&&(l[1]=-c[1]));const u={xOffset:l[0],yOffset:l[1],width:c[0],height:c[1]};return this.layoutWithBBox(u,h,n,r,s)}GetLayoutByLines(t,e,i,n,r="",s){t=t.map((t=>t.toString()));const a=[],o=[0,0];if("number"==typeof s&&s!==1/0){let e;for(let i=0,n=t.length;i<n;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),s),a.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,r).str,width:e});o[0]=s}else{let e,i;s=0;for(let n=0,r=t.length;n<r;n++)i=t[n],e=this.textMeasure.measureTextWidth(i,this.textOptions),s=Math.max(s,e),a.push({str:i,width:e});o[0]=s}o[1]=a.length*n;const h={xOffset:0,yOffset:0,width:o[0],height:o[1]};return this.LayoutBBox(h,e,i),this.layoutWithBBox(h,a,e,i,n)}layoutWithBBox(t,e,i,n,r){const s=[0,0],a=e.length*r;"top"===n||("middle"===n?s[1]=(t.height-a)/2:"bottom"===n&&(s[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,n,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,r,s){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=r,e}}const dx=["text","maxLineWidth","fontSize","fontFamily","fontWeight","ellipsis","lineHeight",...Zv];class px extends ib{type="text";cache;_font;get font(){const t=nm(this).text;return this._font||(this._font=hx(this.attribute,t)),this._font}get clipedText(){const t=this.attribute,e=nm(this).text;if(Array.isArray(t.text))return;const{maxLineWidth:i=e.maxLineWidth}=t;return Number.isFinite(i)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(t.text??e.text).toString()}get clipedWidth(){if(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=nm(this).text,e=this.attribute;if(Array.isArray(e.text))return;const{maxLineWidth:i=t.maxLineWidth}=e;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),this.clipedText!==e.text)}get multilineLayout(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}constructor(t={text:"",fontSize:16}){super(t),this.numberType=wb,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return null!=t&&""!==t}doUpdateAABBBounds(){const t=nm(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=this.attribute,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}updateSingallineAABBBounds(t){const e=nm(this).text,i=gy.graphicUtil.textMeasure;let n,r;const s=this.attribute,{maxLineWidth:a=e.maxLineWidth,ellipsis:o=e.ellipsis,textAlign:h=e.textAlign,textBaseline:c=e.textBaseline,fontSize:l=e.fontSize,fontWeight:u=e.fontWeight,stroke:d=e.stroke,lineWidth:p=e.lineWidth}=s,f=Math.max(2,.075*l),{lineHeight:g=s.lineHeight??(s.fontSize||e.fontSize)+f}=s;if(!this.shouldUpdateShape()&&this.cache){n=this.cache.clipedWidth;const t=cx(h,n),e=lx(c,g,l);return this._AABBBounds.set(t,e,t+n,e+g),d&&this._AABBBounds.expand(p/2),this._AABBBounds}if(Number.isFinite(a)){if(o){const s=!0===o?e.ellipsis:o,h=i.clipTextWithSuffix(t.toString(),{fontSize:l,fontWeight:u},a,s);r=h.str,n=h.width}else{const e=i.clipText(t.toString(),{fontSize:l,fontWeight:u},a);r=e.str,n=e.width}this.cache.clipedText=r,this.cache.clipedWidth=n}else n=i.measureTextWidth(t.toString(),{fontSize:l,fontWeight:u}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=n;this.clearUpdateShapeTag();const y=cx(h,n),m=lx(c,g,l,0);return this._AABBBounds.set(y,m,y+n,m+g),d&&this._AABBBounds.expand(p/2),this._AABBBounds}updateMultilineAABBBounds(t){const e=nm(this).text,i=this.attribute,{fontFamily:n=e.fontFamily,textAlign:r=e.textAlign,textBaseline:s=e.textBaseline,fontSize:a=e.fontSize,fontWeight:o=e.fontWeight,lineHeight:h=i.lineHeight||i.fontSize||e.fontSize,ellipsis:c=e.ellipsis,maxLineWidth:l,stroke:u=e.stroke,lineWidth:d=e.lineWidth}=i;if(!this.shouldUpdateShape()&&this.cache?.layoutData){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}const p=gy.graphicUtil.textMeasure,f=new ux(n,{fontSize:a,fontWeight:o},p).GetLayoutByLines(t,r,s,h,!0===c?e.ellipsis:c||void 0,l),{bbox:g}=f;return this.cache.layoutData=f,this.clearUpdateShapeTag(),this._AABBBounds.set(g.xOffset,g.yOffset,g.xOffset+g.width,g.yOffset+g.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return nm(this).text[t]}needUpdateTags(t){for(let e=0;e<dx.length;e++){const i=dx[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<dx.length;e++){if(t===dx[e])return!0}return!1}clone(){return new px({...this.attribute})}}function fx(t,e,i,n,r){return r?t.arc(i,n,e,0,Yp,!1,r):t.arc(i,n,e,0,Yp),!1}var gx=new class{type="circle";pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0";draw(t,e,i,n,r){return fx(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return fx(t,e/2+r,i,n,s)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var yx=new class{type="cross";pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z";draw(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-3*e+i,-e+n,r),t.lineTo(-e+i,-e+n,r),t.lineTo(-e+i,-3*e+n,r),t.lineTo(e+i,-3*e+n,r),t.lineTo(e+i,-e+n,r),t.lineTo(3*e+i,-e+n,r),t.lineTo(3*e+i,e+n,r),t.lineTo(e+i,e+n,r),t.lineTo(e+i,3*e+n,r),t.lineTo(-e+i,3*e+n,r),t.lineTo(-e+i,e+n,r),t.lineTo(-3*e+i,e+n,r),t.closePath(),!0}(t,e/6,i,n,r)}drawOffset(t,e,i,n,r,s){return function(t,e,i,n,r,s){return t.moveTo(-3*e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-3*e+n-r,s),t.lineTo(e+i+r,-3*e+n-r,s),t.lineTo(e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,e+n+r,s),t.lineTo(e+i+r,e+n+r,s),t.lineTo(e+i+r,3*e+n+r,s),t.lineTo(-e+i-r,3*e+n+r,s),t.lineTo(-e+i-r,e+n+r,s),t.lineTo(-3*e+i-r,e+n+r,s),t.closePath(),!0}(t,e/6,i,n,r,s)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function mx(t,e,i,n,r){return t.moveTo(i,n-e,r),t.lineTo(e+i,n,r),t.lineTo(i,n+e,r),t.lineTo(i-e,n,r),t.closePath(),!0}var vx=new class{type="diamond";pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z";draw(t,e,i,n,r){return mx(t,e/2,i,n,r)}drawFitDir(t,e,i,n,r){return mx(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return mx(t,e/2+r,i,n,s)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function bx(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var xx=new class{type="square";pathStr="M-0.5,-0.5h1v1h-1Z";draw(t,e,i,n){return bx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return bx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};class Sx{type="triangleUp";pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z";draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i+e,e+n),t.lineTo(i-e,e+n),t.lineTo(i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i+e+2*r,e+n+r),t.lineTo(i-e-2*r,e+n+r),t.lineTo(i,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}}var Ax=new Sx;var _x=new class extends Sx{type="triangle"};const Cx=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Tx=Math.sin(Yp/10)*Cx,Bx=-Math.cos(Yp/10)*Cx;function Px(t,e,i,n){const r=Tx*e,s=Bx*e;t.moveTo(i,-e+n),t.lineTo(r+i,s+n);for(let a=1;a<5;++a){const o=Yp*a/5,h=Math.cos(o),c=Math.sin(o);t.lineTo(c*e+i,-h*e+n),t.lineTo(h*r-c*s+i,c*r+h*s+n)}return t.closePath(),!0}var Ex=new class{type="star";pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0";draw(t,e,i,n){return Px(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Px(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};const Mx=ef(3);function Rx(t,e,i,n){const r=e,s=r/Mx,a=s/5,o=e;return t.moveTo(0+i,-r+n),t.lineTo(s/2+i,n),t.lineTo(a/2+i,n),t.lineTo(a/2+i,o+n),t.lineTo(-a/2+i,o+n),t.lineTo(-a/2+i,n),t.lineTo(-s/2+i,n),t.closePath(),!0}var kx=new class{type="arrow";pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z";draw(t,e,i,n){return Rx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Rx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function Dx(t,e,i,n){const r=2*e;return t.moveTo(i,-e+n),t.lineTo(r/3/2+i,e+n),t.lineTo(-r/3/2+i,e+n),t.closePath(),!0}var Ix=new class{type="wedge";pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z";draw(t,e,i,n){return Dx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Dx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function Ox(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Lx=new class{type="stroke";pathStr="";draw(t,e,i,n){return Ox(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Ox(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};const Ux=-.5,Wx=ef(3)/2,Fx=1/ef(12);function Nx(t,e,i,n){const r=e/2,s=e*Fx,a=r,o=e*Fx+e,h=-a,c=o;return t.moveTo(r+i,s+n),t.lineTo(a+i,o+n),t.lineTo(h+i,c+n),t.lineTo(Ux*r-Wx*s+i,Wx*r+Ux*s+n),t.lineTo(Ux*a-Wx*o+i,Wx*a+Ux*o+n),t.lineTo(Ux*h-Wx*c+i,Wx*h+Ux*c+n),t.lineTo(Ux*r+Wx*s+i,Ux*s-Wx*r+n),t.lineTo(Ux*a+Wx*o+i,Ux*o-Wx*a+n),t.lineTo(Ux*h+Wx*c+i,Ux*c-Wx*h+n),t.closePath(),!1}var zx=new class{type="wye";pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0";draw(t,e,i,n){return Nx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Nx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var jx=new class{type="triangleLeft";pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z";draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(e+i,e+n),t.lineTo(e+i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-e+i-2*r,n),t.lineTo(e+i+r,e+n+2*r),t.lineTo(e+i+r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var Hx=new class{type="triangleRight";pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z";draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,e+n),t.lineTo(e+i,n),t.lineTo(i-e,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-r,e+n+2*r),t.lineTo(e+i+2*r,n),t.lineTo(i-e-r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var Gx=new class{type="triangleDown";pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z";draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,n-e),t.lineTo(i+e,n-e),t.lineTo(i,n+e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-2*r,n-e-r),t.lineTo(i+e+2*r,n-e-r),t.lineTo(i,n+e+2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};const Vx=ef(3);function Xx(t,e,i,n){const r=e*Vx;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var Yx=new class extends Sx{type="thinTriangle";pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z";draw(t,e,i,n){return Xx(t,e/2/Vx,i,n)}drawOffset(t,e,i,n,r){return Xx(t,e/2/Vx+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function qx(t,e,i,n){const r=2*e;return t.moveTo(e+i,n-r),t.lineTo(i-e,n),t.lineTo(e+i,r+n),!0}var Kx=new class{type="arrow2Left";pathStr="M 0.25 -0.5 L -0.25 0 l 0.5 0.5";draw(t,e,i,n){return qx(t,e/4,i,n)}drawOffset(t,e,i,n,r){return qx(t,e/4+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function $x(t,e,i,n){const r=2*e;return t.moveTo(i-e,n-r),t.lineTo(i+e,n),t.lineTo(i-e,r+n),!0}var Zx=new class{type="arrow2Right";pathStr="M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5";draw(t,e,i,n){return $x(t,e/4,i,n)}drawOffset(t,e,i,n,r){return $x(t,e/4+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function Jx(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}var Qx=new class{type="rect";pathStr="M-0.5,-0.5h1v1h-1Z";draw(t,e,i,n){return Jx(t,Ip(e)?[e,e]:e,i,n)}drawOffset(t,e,i,n,r){return Jx(t,Ip(e)?[e+2*r,e+2*r]:[e[0]+2*r,e[1]+2*r],i,n)}bounds(t,e){const i=Ip(t)?[t,t]:t;e.x1=-i[0]/2,e.x2=i[0]/2,e.y1=-i[1]/2,e.y2=i[1]/2}};class tw{type;path;pathStr="";constructor(t,e){this.type=t,this.path=e}drawOffset(t,e,i,n,r){return ng(this.path.commandList,t,i,n,e+r,e+r),!1}draw(t,e,i,n){return ng(this.path.commandList,t,i,n,e,e),!1}bounds(t,e){this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const ew=[gx,yx,vx,xx,Yx,_x,Ex,kx,Ix,Lx,zx,jx,Hx,Ax,Gx,Kx,Zx,Qx],iw={};ew.forEach((t=>{iw[t.type]=t}));const nw=["symbolType","size",...Zv];let rw=class t extends ib{type="symbol";static userSymbolMap={};constructor(t={symbolType:"circle"}){super(t),this.numberType=xb}_parsedPath;getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return Dp(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=nm(this).symbol,{symbolType:i=e.symbolType}=this.attribute;let n=iw[i];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[i],n)return this._parsedPath=n,n;const r=(new Ng).fromString(i),s=r.bounds.width(),a=r.bounds.height(),o=1/Jp(s,a);return r.transform(0,0,o,o),this._parsedPath=new tw(i,r),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=nm(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=gy.graphicService.updateSymbolAABBBounds(i,nm(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Fm(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return nm(this).symbol[t]}needUpdateTags(t){for(let e=0;e<nw.length;e++){const i=nw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<nw.length;e++){if(t===nw[e])return!0}return!1}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=Dp(e)?e:[e,e];return t.path?(new Ng).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Ng).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t({...this.attribute})}};const sw=["segments","points","curveType",...Zv];let aw=class t extends ib{type="line";constructor(t={}){super(t),this.numberType=pb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&!(t.length<=1)}_interpolate(t,e,i,n,r){"points"===t&&(r.points=Vm(i,n,e))}doUpdateAABBBounds(){const t=nm(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateLineAABBBounds(e,nm(this).line,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return nm(this).line[t]}needUpdateTags(t){for(let e=0;e<sw.length;e++){const i=sw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<sw.length;e++){if(t===sw[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=new Ng,i=t.segments,n=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):t.points&&n(t.points),e}clone(){return new t({...this.attribute})}};const ow=["width","height","cornerRadius",...Zv];class hw extends ib{type="rect";constructor(t){super(t),this.numberType=mb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{width:t,height:e}=this.attribute;return this._validNumber(t)&&this._validNumber(e)}doUpdateAABBBounds(){const t=nm(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateRectAABBBounds(e,nm(this).rect,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return nm(this).rect[t]}needUpdateTags(t){for(let e=0;e<ow.length;e++){const i=ow[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<ow.length;e++){if(t===ow[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=t.width,i=t.height,n=new Ng;return n.moveTo(0,0),n.rect(0,0,e,i),n}clone(){return new hw({...this.attribute})}}const cw=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class lw extends hw{type="rect3d";constructor(t){super(t),this.numberType=vb}findFace(){const t={polygons:[],vertices:[],edges:[]},e=nm(this).rect3d,{width:i=e.width,height:n=e.width,length:r=Qp(e.width,e.height)}=this.attribute;for(let e=0;e<cw.length;e++){const s=cw[e];t.vertices.push([s[0]*i,s[1]*n,s[2]*r])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}}class uw extends ib{type="glyph";constructor(t){super(t),this.numberType=lb,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,n){super.setAttribute(t,e,i,n),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t,e=!1,i){super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}doUpdateAABBBounds(){this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const t=gy.graphicService.updateGlyphAABBBounds(this.attribute,nm(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){if(!t.length)return void this.clearStates(e);if(!(this.currentStates?.length!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const i={},n=this.subGraphic.map((()=>({})));t.forEach((e=>{const r=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];r&&(Object.assign(i,r.attributes),r.subAttributes?.length&&n.forEach(((t,e)=>{Object.assign(t,r.subAttributes[e])})))})),this.subGraphic.forEach(((i,r)=>{i.updateNormalAttrs(n[r]),i.applyStateAttrs(n[r],t,e)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}clearStates(t){this.hasState()&&this.normalAttrs&&(this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[])}clone(){const t=new uw({...this.attribute});return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}}const dw={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},pw=!0,fw=!1,gw=/\w|\(|\)/,yw=/[.?!,;:/,。?!、;:]/,mw=/\S/;function vw(t,e,i,n,r){if(!e||e<=0)return 0;const s=gy.graphicUtil.textMeasure;let a=n,o=t.slice(0,a),h=Math.floor(s.measureText(o,i).width),c=t.slice(0,a+1),l=Math.floor(s.measureText(c,i).width);for(;h>e||l<=e;){if(h>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),h=Math.floor(s.measureText(o,i).width),c=t.slice(0,a+1),l=Math.floor(s.measureText(c,i).width)}return r&&(a=function(t,e){let i=e;for(;gw.test(t[i-1])&&gw.test(t[i])||yw.test(t[i]);)if(i--,i<=0)return e;return i}(t,a)),a}function bw(t,e){const i=gy.graphicUtil.textMeasure.measureText(t,e),n={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(n.width=Math.floor(i.width),n.height=e.fontSize||0,n.ascent=n.height,n.descent=0):(n.width=Math.floor(i.width),n.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),n.ascent=Math.floor(i.actualBoundingBoxAscent),n.descent=n.height-n.ascent),n}class xw{left;top;bottom;right;width;height;actualHeight;ellipsis;wordBreak;verticalDirection;lines;globalAlign;globalBaseline;layoutDirection;directionKey;isWidthMax;isHeightMax;singleLine;icons;constructor(t,e,i,n,r,s,a,o,h,c,l,u,d,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=h,this.layoutDirection=c,this.directionKey=dw[this.layoutDirection],this.isWidthMax=l,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let s=this.isHeightMax?Math.min(this.height,n):this.height||n||0;s=Math.min(s,n);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-s/2;break;case"bottom":a=-s}let o=0;switch(this.globalAlign){case"left":o=0;break;case"center":o=-r/2;break;case"right":o=-r}let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let c=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=h&&0!==h)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return c;let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(s=!0,c=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e)}else{const i=Math.floor((h-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],s=h-this.lines[i].top-this.lines[i].height;if(0===h)this.lines[i].draw(t,!1,o,s+a,e);else{if(s+r>this[this.directionKey.top]+h||s<this[this.directionKey.top])return c;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,c=!0),this.lines[i].draw(t,n,o,s+a,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[i].height+this.lines[i].top);const{top:n,height:r}=this.lines[i];if(0===h)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return c;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(n=!0,c=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e)}}}}return c}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],a=r-this.lines[i].top-this.lines[i].height;if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+s>this[this.directionKey.top]+r||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class ww{text;ascent;descent;width;height;lineHeight;fontSize;length;newLine;character;left;top;direction;widthOrigin;heightOrigin;textBaseline;ellipsis;ellipsisWidth;ellipsisOtherParagraphWidth;verticalEllipsis;constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic","number"==typeof i.lineHeight?this.lineHeight=i.lineHeight>this.fontSize?i.lineHeight:this.fontSize:this.lineHeight=Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:n,height:r,descent:s,width:a}=bw(t,i);let o=0,h=0,c=0;this.height>r&&(o=(this.height-r)/2,h=Math.ceil(o),c=Math.floor(o)),"top"===this.textBaseline?(this.ascent=o,this.descent=r-o):"bottom"===this.textBaseline?(this.ascent=r-o,this.descent=o):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=s+c),this.length=t.length,this.width=a||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height)}updateWidth(){const{width:t}=bw(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,n,r){let s=this.text,a=this.left+i;e+=this.top;let o=this.direction;if(this.verticalEllipsis)s="...",o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+="...","right"===r&&(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=vw(s,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+="...","right"===r){const{width:e}=bw(this.text.slice(t),this.character);"vertical"===o||(a-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0),this.character.stroke&&(!function(t,e){const i=e&&e.stroke||fw;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.lineWidth=1,t.strokeStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,a,e)),function(t,e){const i=e&&e.fill||pw;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.fillStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),this.character.fill&&t.fillText(s,a,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=vw(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+="...";const{width:n}=bw(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const Sw=["width","height","image",...Zv];class Aw extends ib{type="image";successCallback;failCallback;constructor(t){super(t),this.numberType=db,this.loadImage(this.attribute.image)}get width(){return this.attribute.width??0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){return this.attribute.height??0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){return this.attribute.repeatX??"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){return this.attribute.repeatY??"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}doUpdateAABBBounds(){const t=nm(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateImageAABBBounds(e,nm(this).image,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return cy[t]}needUpdateTags(t){for(let e=0;e<Sw.length;e++){const i=Sw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Sw.length;e++){if(t===Sw[e])return!0}return!1}clone(){return new Aw({...this.attribute})}}class _w extends Aw{richtextId;globalX;globalY;_x=0;_y=0;_hovered=!1;_marginArray=[0,0,0,0];constructor(t){if(super(t),"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=Fm(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(Dp(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Fm(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}animationBackUps;incrementalAt;toCustomPath;get width(){return(this.attribute.width??0)+this._marginArray[1]+this._marginArray[3]}get height(){return(this.attribute.height??0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=cy.width,height:e=cy.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,r=(i-t)/2,s=(n-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class Cw{left;top;width;height;baseline;ascent;descent;paragraphs;actualWidth;blankWidth;textAlign;direction;directionKey;constructor(t,e,i,n,r,s,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=r,this.top=i-n,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof _w?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=dw[this.direction];const h=this.directionKey;this.actualWidth=0;let c=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof ww){const e=mw.exec(t.text);0!==e?.index&&(t.text=t.text.slice(e?.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],c=Math.max(t[this.directionKey.height],c)})),this.height=c,this.blankWidth=o?0:this.width-this.actualWidth;let l=this.left,u=0;if(this.actualWidth<e&&!o)switch(this.textAlign){case"right":l=e-this.actualWidth;break;case"center":l=(e-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?l=(e-this.actualWidth)/2:u=(e-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof _w?(t["_"+h.x]=l,l+=t[h.width]+u,t["_"+h.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?c-t.height:(c-t.height)/2):(t[h.left]=l,l+=t[h.width]+u)}))}draw(t,e,i,n,r){if(e){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof _w)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const{width:n}=bw("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add";break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}}this.paragraphs.map(((e,s)=>{if(e instanceof _w)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,this.ascent);e.draw(t,n+this.ascent,i,0===s,this.textAlign)}))}getWidthWithEllips(){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof _w)break;const{width:n}=bw("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add",i.ellipsisWidth=r;break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}let e=0;return this.paragraphs.map(((t,i)=>{e+=t instanceof _w?t.width:t.getWidthWithEllips(this.direction)})),e}}class Tw{frame;lineWidth;width;height;y;maxAscent;maxDescent;maxAscentForBlank;maxDescentForBlank;lineBuffer;direction;directionKey;constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=dw[this.direction]}store(t){if(t instanceof _w){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new Cw(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){t instanceof _w?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t)))}cut(t){const e=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(e/t[this.directionKey.width]*t.length)||0,n=vw(t.text,e,t.character,i,"break-word"===this.frame.wordBreak);if(0!==n){const[e,i]=function(t,e){const i=t.text.slice(0,e),n=t.text.slice(e);return[new ww(i,t.newLine,t.character),new ww(n,!0,t.character)]}(t,n);this.store(e),this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const Bw=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...Zv];class Pw extends ib{type="richtext";_frameCache;_currentHoverIcon=null;constructor(t){super(t),this.numberType=bb}get width(){return this.attribute.width??hy.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){return this.attribute.height??hy.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){return this.attribute.ellipsis??hy.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){return this.attribute.wordBreak??hy.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){return this.attribute.verticalDirection??hy.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){return this.attribute.textAlign??hy.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){return this.attribute.textBaseline??hy.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){return this.attribute.textConfig??hy.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=nm(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateRichTextAABBBounds(e,nm(this).richtext,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return hy[t]}needUpdateTags(t){for(let e=0;e<Bw.length;e++){const i=Bw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Bw.length;e++){if(t===Bw[e])return!0}return!1}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}doUpdateFrameCache(){const{textConfig:t,maxWidth:e,maxHeight:i,width:n,height:r,ellipsis:s,wordBreak:a,verticalDirection:o,textAlign:h,textBaseline:c,layoutDirection:l,singleLine:u}=this.attribute,d=[];for(let e=0;e<t.length;e++)if("image"in t[e]){const i=t[e],n=i.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(i.id);if(n)d.push(n);else{const t=new _w(i);t.successCallback=()=>{this.addUpdateBoundTag(),this.stage?.renderNextFrame()},t.richtextId=i.id,d.push(t)}}else if(t[e].text.includes("\n")){const i=t[e].text.split("\n");for(let n=0;n<i.length;n++)d.push(new ww(i[n],0!==n,t[e]))}else d.push(new ww(t[e].text,!1,t[e]));const p=new xw(0,0,("number"==typeof e&&(!n||n>e)?e:n)||0,("number"==typeof i&&(!r||r>i)?i:r)||0,s,a,o,h,c,l||"horizontal","number"==typeof e&&(!n||n>e),"number"==typeof i&&(!r||r>i),u||!1,this._frameCache?.icons),f=new Tw(p);for(let t=0;t<d.length;t++)f.deal(d[t]);f.send(),this._frameCache=p}clone(){return new Pw({...this.attribute})}setStage(t,e){super.setStage(t,e);this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?(this._currentHoverIcon?.setHoverState(!1),this._currentHoverIcon=e,this._currentHoverIcon.setHoverState(!0),this.stage?.setCursor(e.attribute.cursor),this.stage?.renderNextFrame()):!e&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,this.stage?.setCursor(),this.stage?.renderNextFrame()))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,this.stage?.setCursor(),this.stage?.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let r;return e.icons.forEach((e=>{e.AABBBounds.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(r.attribute.x??0)+i,r.globalY=(r.attribute.y??0)+n)})),r}}const Ew=["path","customPath",...Zv];class Mw extends ib{type="path";cache;constructor(t){super(t),this.numberType=fb}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=nm(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof Ng?e.path:(Pp(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Ng?this.cache:t.path)}doUpdateAABBBounds(){const t=nm(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updatePathAABBBounds(e,nm(this).path,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;kp(t.path,!0)?this.cache=(new Ng).fromString(t.path):t.customPath&&(this.cache=new Ng,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return nm(this).path[t]}needUpdateTags(t){for(let e=0;e<Ew.length;e++){const i=Ew[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Ew.length;e++){if(t===Ew[e])return!0}return!1}toCustomPath(){return(new Ng).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Mw({...this.attribute})}}const Rw=["segments","points","curveType",...Zv];class kw extends ib{type="area";cache;constructor(t){super(t),this.numberType=hb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}doUpdateAABBBounds(){const t=nm(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateAreaAABBBounds(e,nm(this).area,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=Vm(i,n,e))}getDefaultAttribute(t){return nm(this).area[t]}needUpdateTags(t){for(let e=0;e<Rw.length;e++){const i=Rw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Rw.length;e++){if(t===Rw[e])return!0}return!1}toCustomPath(){const t=new Ng,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:e.x1??e.x,y:e.y1??e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new kw({...this.attribute})}}const Dw=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...Zv];class Iw extends ib{type="arc";constructor(t){super(t),this.numberType=ab}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=nm(this).arc,{cornerRadius:e=t.cornerRadius,outerRadius:i=t.outerRadius,innerRadius:n=t.innerRadius}=this.attribute;if(0===e||"0%"===e)return 0;const r=Math.abs(i-n);return Math.min(Ip(e,!0)?e:r*parseFloat(e)/100,r/2)}getParsedAngle(){const t=nm(this).arc;let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:n=t.cap}=this.attribute,r=i-e>=0?1:-1,s=i-e;if(e=pf(e),i=e+s,n&&Kp(s)<qp-Gp){let s=1,a=1;n.length&&(s=Number(n[0]),a=Number(n[1]));const{outerRadius:o=t.outerRadius,innerRadius:h=t.innerRadius}=this.attribute,c=Math.abs(o-h)/2,l=c/o;if(c>Gp&&o>Gp)return{startAngle:e-r*l*s,endAngle:i+r*l*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=nm(this).arc,{outerRadius:n=i.outerRadius,innerRadius:r=i.innerRadius,padAngle:s=i.padAngle}=this.attribute,{padRadius:a=ef(n*n+r*r)}=this.attribute,o=Kp(e-t);let h=t,c=e,l=t,u=e;const d=s/2;let p=o,f=o;if(d>Gp&&a>Gp){const i=e>t?1:-1;let s=sf(Number(a)/r*tf(d)),o=sf(Number(a)/n*tf(d));return(p-=2*s)>Gp?(s*=i,l+=s,u-=s):(p=0,l=u=(t+e)/2),(f-=2*o)>Gp?(o*=i,h+=o,c-=o):(f=0,h=c=(t+e)/2),{outerStartAngle:h,outerEndAngle:c,innerStartAngle:l,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}return{outerStartAngle:h,outerEndAngle:c,innerStartAngle:l,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}doUpdateAABBBounds(t){const e=nm(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=gy.graphicService.updateArcAABBBounds(i,nm(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Fm(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){for(let e=0;e<Dw.length;e++){const i=Dw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Dw.length;e++){if(t===Dw[e])return!0}return!1}getDefaultAttribute(t){return nm(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let n=t.innerRadius,r=t.outerRadius;const s=Kp(i-e),a=i>e;if(r<n){const t=r;r=n,n=t}const o=new Ng;if(r<=Gp)o.moveTo(0,0);else if(s>=qp-Gp)o.moveTo(0+r*Zp(e),0+r*tf(e)),o.arc(0,0,r,e,i,!a),n>Gp&&(o.moveTo(0+n*Zp(i),0+n*tf(i)),o.arc(0,0,n,i,e,a));else{const t=r*Zp(e),s=r*tf(e),h=n*Zp(i),c=n*tf(i);o.moveTo(0+t,0+s),o.arc(0,0,r,e,i,!a),o.lineTo(0+h,0+c),o.arc(0,0,n,i,e,a),o.closePath()}return o}clone(){return new Iw({...this.attribute})}}class Ow extends Iw{type="arc3d";constructor(t){super(t),this.numberType=ob}doUpdateAABBBounds(){const t=nm(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateArc3dAABBBounds(e,nm(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}}const Lw=["points","cornerRadius",...Zv];class Uw extends ib{type="polygon";constructor(t){super(t),this.numberType=gb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=nm(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updatePolygonAABBBounds(e,nm(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=Vm(i,n,e))}getDefaultAttribute(t){return nm(this).polygon[t]}needUpdateTags(t){for(let e=0;e<Lw.length;e++){const i=Lw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Lw.length;e++){if(t===Lw[e])return!0}return!1}toCustomPath(){const t=this.attribute.points,e=new Ng;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new Uw({...this.attribute})}}class Ww extends Uw{type="pyramid3d";constructor(t){super(t),this.numberType=yb}doUpdateAABBBounds(){const t=nm(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updatePyramid3dAABBBounds(e,nm(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const n=3===i?t[0]:t[i+1],r=e.x-n.x;return 0===r?0:(e.y-n.y)/r})),i=t.map((t=>({p:t,d:0})));let n=!1,r=0;for(let t=0;t<e.length-1;t++){for(let s=t+1;s<e.length;s++){if(e[t]===e[s]){n=!0;const e=cf.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,r=Jp(r,e);const a=cf.distancePP(i[s].p,i[s+1].p);i[s].d=a,i[s+1].d=a,r=Jp(r,a)}if(n)break}if(n)break}for(let e=t.length-1;e>=0;e--){const n=t[e];i.unshift({p:n,d:0})}for(let e=0;e<t.length;e++){const n=(r-i[e+t.length].d)/2;i[e].d+=n,i[e+t.length].d+=n}const s={polygons:[],vertices:[],edges:[]};return i.forEach((t=>{s.vertices.push([t.p.x,t.p.y,t.d])})),s.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),s.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),s.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),s.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),s.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),s.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),s.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],s}_isValid(){return super._isValid()&&4===this.attribute.points.length}}let Fw=class{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:a=t.lineWidth}=r;i.expand(n+s+a/2)}return i}};Fw=dp([rp()],Fw);const Nw=Symbol.for("RectBoundsContribution");let zw=class extends Fw{};zw=dp([rp()],zw);const jw=Symbol.for("SymbolBoundsContribution");let Hw=class extends Fw{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:a=e.strokeBoundsBuffer}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:o=t.lineWidth}=r;nb(i,n+s+o/2,!0,a)}return i}};Hw=dp([rp()],Hw);const Gw=Symbol.for("CircleBoundsContribution");let Vw=class extends Fw{};Vw=dp([rp()],Vw);const Xw=Symbol.for("ArcBoundsContribution");let Yw=class extends Fw{};Yw=dp([rp()],Yw);const qw=Symbol.for("PathBoundsContribution");let Kw=class extends Fw{};Kw=dp([rp()],Kw);class $w{pools=[];static identity(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return $w.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const Zw=new class{pools=[];allocate(t,e,i,n,r,s){if(!this.pools.length)return new _f(t,e,i,n,r,s);const a=this.pools.pop();return a.a=t,a.b=e,a.c=i,a.d=n,a.e=r,a.f=s,a}allocateByObj(t){if(!this.pools.length)return new _f(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},Jw=new $w;function Qw(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],a=e[5],o=e[6],h=e[7],c=e[8],l=e[9],u=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+c*n,t[5]=a*r+l*n,t[6]=o*r+u*n,t[7]=h*r+d*n,t[8]=c*r-s*n,t[9]=l*r-a*n,t[10]=u*r-o*n,t[11]=d*r-h*n,t}function tS(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],a=e[1],o=e[2],h=e[3],c=e[8],l=e[9],u=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-c*n,t[1]=a*r-l*n,t[2]=o*r-u*n,t[3]=h*r-d*n,t[8]=s*n+c*r,t[9]=a*n+l*r,t[10]=o*n+u*r,t[11]=h*n+d*r,t}function eS(t,e,i){const n=i[0],r=i[1],s=i[2];let a,o,h,c,l,u,d,p,f,g,y,m;return e===t?(t[12]=e[0]*n+e[4]*r+e[8]*s+e[12],t[13]=e[1]*n+e[5]*r+e[9]*s+e[13],t[14]=e[2]*n+e[6]*r+e[10]*s+e[14],t[15]=e[3]*n+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],h=e[2],c=e[3],l=e[4],u=e[5],d=e[6],p=e[7],f=e[8],g=e[9],y=e[10],m=e[11],t[0]=a,t[1]=o,t[2]=h,t[3]=c,t[4]=l,t[5]=u,t[6]=d,t[7]=p,t[8]=f,t[9]=g,t[10]=y,t[11]=m,t[12]=a*n+l*r+f*s+e[12],t[13]=o*n+u*r+g*s+e[13],t[14]=h*n+d*r+y*s+e[14],t[15]=c*n+p*r+m*s+e[15]),t}function iS(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function nS(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],y=e[13],m=e[14],v=e[15];let b=i[0],x=i[1],w=i[2],S=i[3];return t[0]=b*n+x*o+w*u+S*g,t[1]=b*r+x*h+w*d+S*y,t[2]=b*s+x*c+w*p+S*m,t[3]=b*a+x*l+w*f+S*v,b=i[4],x=i[5],w=i[6],S=i[7],t[4]=b*n+x*o+w*u+S*g,t[5]=b*r+x*h+w*d+S*y,t[6]=b*s+x*c+w*p+S*m,t[7]=b*a+x*l+w*f+S*v,b=i[8],x=i[9],w=i[10],S=i[11],t[8]=b*n+x*o+w*u+S*g,t[9]=b*r+x*h+w*d+S*y,t[10]=b*s+x*c+w*p+S*m,t[11]=b*a+x*l+w*f+S*v,b=i[12],x=i[13],w=i[14],S=i[15],t[12]=b*n+x*o+w*u+S*g,t[13]=b*r+x*h+w*d+S*y,t[14]=b*s+x*c+w*p+S*m,t[15]=b*a+x*l+w*f+S*v,t}function rS(t,e,i){const{x:n=i.x,y:r=i.y,z:s=i.z,dx:a=i.dx,dy:o=i.dy,dz:h=i.dz,scaleX:c=i.scaleX,scaleY:l=i.scaleY,scaleZ:u=i.scaleZ,alpha:d=i.alpha,beta:p=i.beta,angle:f=i.angle,anchor3d:g=e.attribute.anchor,anchor:y}=e.attribute,m=[0,0,0];if(g){if("string"==typeof g[0]){const t=parseFloat(g[0])/100,i=e.AABBBounds;m[0]=i.x1+(i.x2-i.x1)*t}else m[0]=g[0];if("string"==typeof g[1]){const t=parseFloat(g[1])/100,i=e.AABBBounds;m[1]=i.x1+(i.x2-i.x1)*t}else m[1]=g[1];m[2]=g[2]??0}if(function(t){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(t),eS(t,t,[n+a,r+o,s+h]),eS(t,t,[m[0],m[1],m[2]]),Qw(t,t,p),tS(t,t,d),eS(t,t,[-m[0],-m[1],m[2]]),function(t,e,i){const n=i[0],r=i[1],s=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,l,u]),f){const i=Jw.allocate(),n=[0,0];if(y){if("string"==typeof g[0]){const t=parseFloat(g[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=g[0];if("string"==typeof g[1]){const t=parseFloat(g[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=g[1]}eS(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],a=e[1],o=e[2],h=e[3],c=e[4],l=e[5],u=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+c*n,t[1]=a*r+l*n,t[2]=o*r+u*n,t[3]=h*r+d*n,t[4]=c*r-s*n,t[5]=l*r-a*n,t[6]=u*r-o*n,t[7]=d*r-h*n}(i,i,f),eS(i,i,[-n[0],-n[1],0]),nS(t,t,i)}}function sS(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{creator;rectBoundsContribitions;symbolBoundsContribitions;circleBoundsContribitions;arcBoundsContribitions;pathBoundsContribitions;_rectBoundsContribitions;_symbolBoundsContribitions;_circleBoundsContribitions;_arcBoundsContribitions;_pathBoundsContribitions;tempAABBBounds1;tempAABBBounds2;constructor(t,e,i,n,r,s){this.creator=t,this.rectBoundsContribitions=e,this.symbolBoundsContribitions=i,this.circleBoundsContribitions=n,this.arcBoundsContribitions=r,this.pathBoundsContribitions=s,this.hooks={onAttributeUpdate:new bp(["graphic"]),onSetStage:new bp(["graphic","stage"]),onRemove:new bp(["graphic"]),onAddIncremental:new bp(["graphic","group","stage"]),onClearIncremental:new bp(["graphic","group","stage"]),beforeUpdateAABBBounds:new bp(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new bp(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new df,this.tempAABBBounds2=new df}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new kf(t);return ng(i.commandList,n,0,0),!0}updateRectAABBBounds(t,e,i,n){if(!this.updatePathProxyAABBBounds(i,n)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._rectBoundsContribitions||(this._rectBoundsContribitions=this.rectBoundsContribitions.getContributions()||[]),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((a=>{a.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,i,e,!1,n),i}updateGroupAABBBounds(t,e,i,n){const{width:r,height:s,path:a,clip:o=e.clip}=t;a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=r&&null!=s&&i.set(0,0,r,s),o||n.forEachChildren((t=>{i.union(t.AABBBounds)}));const h=this.tempAABBBounds1,c=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),c.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateGlyphAABBBounds(t,e,i,n){return n.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i}updateRichTextAABBBounds(t,e,i,n){if(!n)return i;const{width:r=e.width,height:s=e.height,maxWidth:a=e.maxWidth,maxHeight:o=e.maxHeight,textAlign:h=e.textAlign,textBaseline:c=e.textBaseline}=t;if(r>0&&s>0)i.set(0,0,r,s);else{const t=n.getFrameCache(),{width:e,height:h}=t.getActualSize();let c=r||e||0,l=s||h||0;l="number"==typeof o&&l>o?o:l||0,c="number"==typeof a&&c>a?a:c||0,i.set(0,0,c,l)}let l=0;switch(c){case"top":l=0;break;case"middle":l=-i.height()/2;break;case"bottom":l=-i.height()}let u=0;switch(h){case"left":u=0;break;case"center":u=-i.width()/2;break;case"right":u=-i.width()}i.translate(u,l);const d=this.tempAABBBounds1,p=this.tempAABBBounds2;return d.setValue(i.x1,i.y1,i.x2,i.y2),p.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateTextAABBBounds(t,e,i,n){if(!n)return i;const{text:r=e.text}=n.attribute;Array.isArray(r)?n.updateMultilineAABBBounds(r):n.updateSingallineAABBBounds(r);const s=this.tempAABBBounds1,a=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2);const{scaleX:o=e.scaleX,scaleY:h=e.scaleY,shadowBlur:c=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(c){nb(s,c/Math.abs(o+h),!0,l),i.union(s)}return this.combindShadowAABBBounds(i,n),lf(i,i,n.transMatrix),i}updatePathAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||this.updatePathAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._pathBoundsContribitions||(this._pathBoundsContribitions=this.pathBoundsContribitions.getContributions()||[]),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((a=>{a.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,n),i}updatePathAABBBoundsImprecise(t,e,i,n){if(!n)return i;const r=n.getParsedPathShape();return i.union(r.getBounds()),i}updatePyramid3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;n.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)}));const s=this.tempAABBBounds1,a=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateArc3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;const{outerRadius:s=e.outerRadius,height:a=0}=t,o=s+a;i.setValue(-o,-o,o,o);const h=this.tempAABBBounds1,c=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),c.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updatePolygonAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||this.updatePolygonAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,n),i}updatePolygonAABBBoundsImprecise(t,e,i,n){const{points:r=e.points}=t;return r.forEach((t=>{i.add(t.x,t.y)})),i}updateLineAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i,n):this.updateLineAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,n),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{s.add(t.x,t.y)})),s}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y)}))})),s}updateAreaAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i,n):this.updateAreaAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,n),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{s.add(t.x,t.y),s.add(t.x1??t.x,t.y1??t.y)})),s}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y),s.add(t.x1??t.x,t.y1??t.y)}))})),s}updateCircleAABBBounds(t,e,i,n,r){this.updatePathProxyAABBBounds(i,r)||(n?this.updateCircleAABBBoundsImprecise(t,e,i,r):this.updateCircleAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,a=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._circleBoundsContribitions||(this._circleBoundsContribitions=this.circleBoundsContribitions.getContributions()||[]),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(a.x1,a.y1,a.x2,a.y2)})),this.transformAABBBounds(t,i,e,!1,r),i}updateCircleAABBBoundsImprecise(t,e,i,n){const{radius:r=e.radius}=t;return i.set(-r,-r,r,r),i}updateCircleAABBBoundsAccurate(t,e,i,n){const{startAngle:r=e.startAngle,endAngle:s=e.endAngle,radius:a=e.radius}=t;return s-r>qp-Gp?i.set(-a,-a,a,a):jm(r,s,a,i),i}updateArcAABBBounds(t,e,i,n,r){this.updatePathProxyAABBBounds(i,r)||(n?this.updateArcAABBBoundsImprecise(t,e,i,r):this.updateArcAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,a=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._arcBoundsContribitions||(this._arcBoundsContribitions=this.arcBoundsContribitions.getContributions()||[]),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(a.x1,a.y1,a.x2,a.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,r),i}updateArcAABBBoundsImprecise(t,e,i,n){const{outerRadius:r=e.outerRadius}=t;return i.set(-r,-r,r,r),i}updateArcAABBBoundsAccurate(t,e,i,n){let{outerRadius:r=e.outerRadius,innerRadius:s=e.innerRadius}=t;if(r<s){const t=r;r=s,s=t}let{endAngle:a=e.endAngle,startAngle:o=e.startAngle}=t;if(o>a){const t=o;o=a,a=t}return r<=Gp?i.set(0,0,0,0):Math.abs(a-o)>qp-Gp?i.set(-r,-r,r,r):(jm(o,a,r,i),jm(o,a,s,i)),i}updateSymbolAABBBounds(t,e,i,n,r){this.updatePathProxyAABBBounds(i,r)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i,r):this.updateSymbolAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,a=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._symbolBoundsContribitions||(this._symbolBoundsContribitions=this.symbolBoundsContribitions.getContributions()||[]),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(a.x1,a.y1,a.x2,a.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,r),i}updateSymbolAABBBoundsImprecise(t,e,i,n){const{size:r=e.size}=t;if(Dp(r))i.set(-r[0]/2,-r[1]/2,r[0]/2,r[1]/2);else{const t=r/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i,n){if(!n)return i;const{size:r=e.size}=t;return n.getParsedPath().bounds(r,i),i}updateImageAABBBounds(t,e,i,n){if(!this.updatePathProxyAABBBounds(i,n)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,r){const{scaleX:s=i.scaleX,scaleY:a=i.scaleY,stroke:o=i.stroke,shadowBlur:h=i.shadowBlur,lineWidth:c=i.lineWidth,strokeBoundsBuffer:l=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(o){nb(u,c/Math.abs(s+a),n,l),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(h){nb(u,h/Math.abs(s+a),n,l),e.union(u)}this.combindShadowAABBBounds(e,r),lf(e,e,r.transMatrix)}},t.DefaultGraphicService=dp([rp(),pp(0,op(Ab)),pp(1,op(gp)),pp(1,sp(Nw)),pp(2,op(gp)),pp(2,sp(jw)),pp(3,op(gp)),pp(3,sp(Gw)),pp(4,op(gp)),pp(4,sp(Xw)),pp(5,op(gp)),pp(5,sp(qw)),fp("design:paramtypes",[Object,Object,Object,Object,Object,Object])],t.DefaultGraphicService);class aS extends Cb{type="shadowroot";constructor(t){super({x:0,y:0}),this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}const oS=["heightLimit","lineClamp"];class hS extends px{_isValid(){const{text:t}=this.attribute;return Dp(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){const e=nm(this).text,{fontFamily:i=e.fontFamily,textAlign:n=e.textAlign,textBaseline:r=e.textBaseline,fontSize:s=e.fontSize,lineHeight:a=this.attribute.lineHeight||this.attribute.fontSize||e.fontSize,ellipsis:o=e.ellipsis,maxLineWidth:h,stroke:c=e.stroke,lineWidth:l=e.lineWidth,heightLimit:u=0,lineClamp:d}=this.attribute;if(!this.shouldUpdateShape()&&this.cache?.layoutData){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),c&&this._AABBBounds.expand(l/2),this._AABBBounds}const p=gy.graphicUtil.textMeasure,f=new ux(i,{fontSize:s},p),g=t.map((t=>t.toString())),y=[],m=[0,0];let v=1/0;if(u>0&&(v=Math.max(Math.floor(u/a),1)),d&&(v=Math.min(v,d)),"number"==typeof h&&h!==1/0){if(h>0)for(let t=0;t<g.length;t++){const e=g[t];if(t===v-1){const t=f.textMeasure.clipTextWithSuffix(e,f.textOptions,h,o);y.push({str:t.str,width:t.width});break}const i=f.textMeasure.clipText(e,f.textOptions,h);if(""!==e&&""===i.str)if(o){const t=f.textMeasure.clipTextWithSuffix(e,f.textOptions,h,o);i.str=t.str??"",i.width=t.width??0}else i.str="",i.width=0;if(y.push({str:i.str,width:i.width}),i.str.length===e.length);else{const n=e.substring(i.str.length);g.splice(t+1,0,n)}}let t=0;y.forEach((e=>{t=Math.max(t,e.width)})),m[0]=t}else{let t,e,i=0;for(let n=0,r=g.length;n<r;n++){if(n===v-1){const t=f.textMeasure.clipTextWithSuffix(g[n],f.textOptions,h,o);y.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=g[n],t=f.textMeasure.measureTextWidth(e,f.textOptions),i=Math.max(i,t),y.push({str:e,width:t})}m[0]=i}m[1]=y.length*(a+2);const b={xOffset:0,yOffset:0,width:m[0],height:m[1]};f.LayoutBBox(b,n,r);const x=f.layoutWithBBox(b,y,n,r,a);return this.cache.layoutData=x,this.clearUpdateShapeTag(),this._AABBBounds.set(b.xOffset,b.yOffset,b.xOffset+b.width,b.yOffset+b.height),c&&this._AABBBounds.expand(l/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<oS.length;e++){const i=oS[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<oS.length;e++){if(t===oS[e])return!0}return super.needUpdateTag(t)}}function cS(t){return new Iw(t)}function lS(t){return new kw(t)}function uS(t){return new ox(t)}function dS(t){return new Cb(t)}function pS(t){return new aw(t)}function fS(t){return new Mw(t)}function gS(t){return new hw(t)}function yS(t){return new lw(t)}function mS(t){return new px(t)}function vS(t){return new hS(t)}function bS(t){return new rw(t)}function xS(t){return new Aw(t)}function wS(t){return new Uw(t)}function SS(t){return new aS(t)}function AS(t){return new Pw(t)}const _S={arc:cS,area:lS,circle:uS,group:dS,image:xS,line:pS,path:fS,rect:gS,rect3d:yS,symbol:bS,text:mS,richtext:AS,polygon:wS,shadowRoot:SS,wrapText:vS},CS=mS({text:""});const TS=AS({});function BS(e,i,n,r,s){if(!i)return;const{offsetX:a=0,offsetY:o=0,offsetZ:h=0}=s||{};let c=!0;const{curves:l}=i;if(n>=1)return void l.forEach((t=>{t.defined?(c&&e.moveTo(t.p0.x+a,t.p0.y+o,h),MS(e,t,1,s),c=!1):c=!0}));if(n<=0)return;let u;"x"===r?u=t.Direction.ROW:"y"===r?u=t.Direction.COLUMN:"auto"===r&&(u=i.direction);const d=n*i.tryUpdateLength(u);let p=0;for(let t=0,i=l.length;t<i;t++){const i=l[t],n=i.getLength(u),r=(d-p)/n;if(p+=n,r<0)break;i.defined?(c&&e.moveTo(i.p0.x+a,i.p0.y+o,h),MS(e,i,Qp(r,1),s),c=!1):c=!0}}function PS(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+r,a.y+s),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}))}function ES(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},{points:a}=i,o=[];for(let t=0;t<a.length;t++)a[t].defined;o.push(a),o.forEach(((i,n)=>{const a=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(a.x+r,a.y+s),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}));for(let e=i.length-1;e>=0;e--){const n=i[e];t.lineTo(n.x1??n.x,n.y1??n.y)}t.lineTo(a.x1??a.x,a.y1??a.y),t.closePath()}))}function MS(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,s+e.p1.y,r+e.p2.x,s+e.p2.y,r+e.p3.x,s+e.p3.y,a):t.lineTo(r+e.p1.x,s+e.p1.y,a);else if(e.p2&&e.p3){const[n]=cg(e,i);t.bezierCurveTo(r+n.p1.x,s+n.p1.y,r+n.p2.x,s+n.p2.y,r+n.p3.x,s+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,a)}}function RS(e,i,n,r){const{top:s,bottom:a}=i;if(n>=1){const t=[],i=[];let n=!0;for(let o=0,h=s.curves.length;o<h;o++){const c=s.curves[o];n!==c.defined?(n?(kS(e,t,i,r),t.length=0,i.length=0):(t.push(c),i.push(a.curves[h-o-1])),n=!n):n&&(t.push(c),i.push(a.curves[h-o-1]))}return void kS(e,t,i,r)}if(n<=0)return;let{direction:o}=r||{};const{curves:h}=s,c=h[h.length-1].p3??h[h.length-1].p1,l=Kp(c.x-h[0].p0.x),u=Kp(c.y-h[0].p0.y);o=o??(l>u?t.Direction.ROW:t.Direction.COLUMN),Number.isFinite(l)||(o=t.Direction.COLUMN),Number.isFinite(u)||(o=t.Direction.ROW);const d=n*(o===t.Direction.ROW?l:u);let p=0,f=!0;const g=[],y=[];for(let t=0,i=s.curves.length;t<i;t++){const n=s.curves[t],h=n.getLength(o),c=(d-p)/h;if(c<0)break;p+=h;let l=null,u=null;f!==n.defined?(f?(kS(e,g,y,r),g.length=0,y.length=0):(l=n,u=a.curves[i-t-1]),f=!f):f&&(l=n,u=a.curves[i-t-1]),l&&u&&(c<1&&(l=l.p2&&l.p3?cg(l,c)[0]:ug(l,c)[0],u=u.p2&&u.p3?cg(u,1-c)[1]:ug(u,1-c)[1]),l.defined=f,u.defined=f,g.push(l),y.push(u)),l=null,u=null}kS(e,g,y,r)}function kS(t,e,i,n){const{offsetX:r=0,offsetY:s=0,offsetZ:a=0}=n||{};let o=!0;e.forEach((e=>{e.defined?(o&&t.moveTo(e.p0.x+r,e.p0.y+s,a),DS(t,e,1,n),o=!1):o=!0})),o=!0;for(let e=i.length-1;e>=0;e--){const h=i[e];h.defined?(o&&t.lineTo(h.p0.x+r,h.p0.y+s,a),DS(t,h,1,n),o=!1):o=!0}t.closePath()}function DS(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,s+e.p1.y,r+e.p2.x,s+e.p2.y,r+e.p3.x,s+e.p3.y,a):t.lineTo(r+e.p1.x,s+e.p1.y,a);else if(e.p2&&e.p3){const[n]=cg(e,i);t.bezierCurveTo(r+n.p1.x,s+n.p1.y,r+n.p2.x,s+n.p2.y,r+n.p3.x,s+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,a)}}function IS(t,e,i){switch(e){case"linear":default:return mg(t,i);case"basis":return Sg(t,i);case"monotoneX":return Mg(t,i);case"monotoneY":return kg(t,i);case"step":return Ig(t,.5,i);case"stepBefore":return Ig(t,0,i);case"stepAfter":return Ig(t,1,i);case"linearClosed":return Ug(t,i)}}t.BaseRender=class{camera;transform(t,e,i,n=!1){const r=t.transMatrix,{x:s=e.x,y:a=e.y,z:o=e.z,scaleX:h=e.scaleX,scaleY:c=e.scaleY,angle:l=e.angle,postMatrix:u}=t.attribute,d=r.onlyTranslate()&&!u,p=i.modelMatrix,f=i.camera,g={x:s,y:a,z:o,lastModelMatrix:p},y=f&&(n||sS(t));if(y){const n=Jw.allocate(),r=Jw.allocate();rS(r,t,e),nS(n,p||n,r),g.x=0,g.y=0,g.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),Jw.free(r)}if(d&&!p){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,g.z=o,i.setTransformForCurrent()}else if(y)g.x=0,g.y=0,g.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(f&&i.project){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,this.transformWithoutTranslate(i,g.x,g.y,g.z,h,c,l)}else i.transformFromMatrix(t.transMatrix,!0),g.x=0,g.y=0,g.z=0;return g}transformUseContext2d(t,e,i,n){const r=n.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,a=n.project(0,0,i),o=n.project(r,0,i),h=n.project(r,s,i),c={x:0,y:0},l={x:r,y:0},u={x:r,y:s};n.camera=null;const d=1/(c.x*(u.y-l.y)-l.x*u.y+u.x*l.y+(l.x-u.x)*c.y),p=-(c.y*(h.x-o.x)-l.y*h.x+u.y*o.x+(l.y-u.y)*a.x)*d,f=(l.y*h.y+c.y*(o.y-h.y)-u.y*o.y+(u.y-l.y)*a.y)*d,g=(c.x*(h.x-o.x)-l.x*h.x+u.x*o.x+(l.x-u.x)*a.x)*d,y=-(l.x*h.y+c.x*(o.y-h.y)-u.x*o.y+(u.x-l.x)*a.y)*d,m=(c.x*(u.y*o.x-l.y*h.x)+c.y*(l.x*h.x-u.x*o.x)+(u.x*l.y-l.x*u.y)*a.x)*d,v=(c.x*(u.y*o.y-l.y*h.y)+c.y*(l.x*h.y-u.x*o.y)+(u.x*l.y-l.x*u.y)*a.y)*d;n.setTransform(p,f,g,y,m,v,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,r,s,a){const o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(r,s,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}},t.BaseRender=dp([rp()],t.BaseRender),t.DefaultCanvasLineRender=class extends t.BaseRender{type;numberType=pb;draw(t,e,i,n){const{context:r}=i;r.highPerformanceSave();const s=nm(t,n?.theme).line,a=this.transform(t,s,r),{x:o,y:h,z:c,lastModelMatrix:l}=a;this.z=c,Nb(t,r,o,h)||(this.drawShape(t,r,o,h,i,n),this.z=0,r.modelMatrix!==l&&Jw.free(r.modelMatrix),r.modelMatrix=l),r.highPerformanceRestore()}drawSegmentItem(t,e,i,n,r,s,a,o,h,c,l,u,d,p,f){if(!e)return;t.beginPath();const g=this.z??0;BS(t.camera?t:t.nativeContext,e,h,c,{offsetX:l,offsetY:u,offsetZ:g}),d.cache&&!Dp(d.cache)&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowStyle&&t.setShadowStyle(d,a,o);const{x:y=0,x:m=0}=a;return!1!==i&&(p?p(t,a,o):r&&(t.setCommonStyle(d,a,y-l,m-u,o),t.fill())),!1!==n&&(f?f(t,a,o):s&&(t.setStrokeStyle(d,a,y-l,m-u,o),t.stroke())),!1}drawShape(t,e,i,n,r,s,a,o){const h=nm(t,s?.theme).line,{fill:c=h.fill,stroke:l=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:g=h.visible}=t.attribute,y=Lb(u,d,c),m=Wb(u,p),v=Ib(c),b=Ob(l,f);if(!t.valid||!g)return;if(!v&&!b)return;if(!(y||m||a||o))return;if(t.shouldUpdateShape()){const{points:e,segments:i,curveType:n=h.curveType}=t.attribute,r=e;if(i&&i.length){let e,r;t.cache=i.map(((t,i)=>(1===i?e={x:r.endX,y:r.endY,defined:r.curves[r.curves.length-1].defined}:i>1&&(e.x=r.endX,e.y=r.endY,e.defined=r.curves[r.curves.length-1].defined),r=Fg(t.points,n,{startPoint:e}),r)))}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Fg(r,n)}t.clearUpdateShapeTag()}const{clipRange:x=h.clipRange,clipRangeByDimension:w=h.clipRangeByDimension}=t.attribute;if(Array.isArray(t.cache))if(1===x){let r=!1;t.cache.forEach(((s,u)=>{r||(r=this.drawSegmentItem(e,s,!!c,!!l,d,p,t.attribute.segments[u],[h,t.attribute],x,w,i,n,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),s=x*r;let u=0,f=!1;t.cache.forEach(((r,g)=>{if(f)return;const y=r.getLength(),m=(s-u)/y;u+=y,m>0&&(f=this.drawSegmentItem(e,r,!!c,!!l,d,p,t.attribute.segments[g],[h,t.attribute],Qp(m,1),w,i,n,t,a,o))}))}else this.drawSegmentItem(e,t.cache,!!c,!!l,d,p,t.attribute,h,x,w,i,n,t,a,o)}},t.DefaultCanvasLineRender=dp([rp()],t.DefaultCanvasLineRender),t.DefaultCanvasAreaRender=class{areaRenderContribitions;type;numberType=hb;_areaRenderContribitions;constructor(t){this.areaRenderContribitions=t}drawShape(t,e,i,n,r,s,a,o){const h=nm(t,s?.theme).area,{fill:c=h.fill,fillOpacity:l=h.fillOpacity,opacity:u=h.opacity,visible:d=h.visible,z:p=h.z,background:f,stroke:g=t.attribute.stroke,lineWidth:y=h.lineWidth,strokeOpacity:m=h.strokeOpacity}=t.attribute,v=Lb(u,l,c),b=Ib(c,f),x=Ob(g,y),w=Wb(u,m);if(!t.valid||!d)return;if(!b&&!x)return;if(!(v||a||w||o))return;const{clipRange:S=h.clipRange}=t.attribute;if(t.shouldUpdateShape()){const{points:e,segments:i,curveType:n=h.curveType}=t.attribute;if(i&&i.length){let e,r;const s=i.map(((t,i)=>(1===i?e={x:r.endX,y:r.endY}:i>1&&(e.x=r.endX,e.y=r.endY),r=IS(t.points,n,{startPoint:e}),r)));let a;const o=[];for(let t=i.length-1;t>=0;t--){const e=i[t].points,r=[];for(let t=e.length-1;t>=0;t--)r.push({x:e[t].x1??e[t].x,y:e[t].y1??e[t].y});if(0!==t){const e=i[t-1].points,n=e[e.length-1];n&&r.push({x:n.x1??n.x,y:n.y1??n.y})}a=IS(r,n),o.unshift(a)}t.cacheArea=o.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();{const i=e,r=[];for(let t=e.length-1;t>=0;t--)r.push({x:e[t].x1??e[t].x,y:e[t].y1??e[t].y});const s=IS(i,n),a=IS(r,"stepBefore"===n?"stepAfter":"stepAfter"===n?"stepBefore":n);t.cacheArea={top:s,bottom:a}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea))if(1===S){let s=!1;t.cacheArea.forEach(((c,u)=>{s||(s=this.drawSegmentItem(e,c,b,l,x,m,t.attribute.segments[u],[h,t.attribute],S,i,n,p,t,r,a,o))}))}else{const s=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),c=S*s;let u=0,d=!1;t.cacheArea.forEach(((s,f)=>{if(d)return;const g=s.top.getLength(),y=(c-u)/g;u+=g,y>0&&(d=this.drawSegmentItem(e,s,b,l,x,m,t.attribute.segments[f],[h,t.attribute],Qp(y,1),i,n,p,t,r,a,o))}))}else this.drawSegmentItem(e,t.cacheArea,b,l,x,m,t.attribute,h,S,i,n,p,t,r,a,o)}draw(t,e,i,n){const{context:r}=i,s=nm(t,n?.theme).area;let{x:a=s.x,y:o=s.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);a+=e.x,o+=e.y,r.setTransformForCurrent()}else a=0,o=0,r.transformFromMatrix(t.transMatrix,!0);Nb(t,r,a,o,0,n)||this.drawShape(t,r,a,o,i,n),r.highPerformanceRestore()}drawSegmentItem(e,i,n,r,s,a,o,h,c,l,u,d,p,f,g,y){if(!i)return;e.beginPath();RS(e.camera?e:e.nativeContext,i,c,{offsetX:l,offsetY:u,offsetZ:d}),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[],this._areaRenderContribitions.sort(((t,e)=>e.order-t.order))),this._areaRenderContribitions.forEach((i=>{i.time===t.BaseRenderContributionTime.beforeFillStroke&&i.drawShape(p,e,l,u,!!r,!1,n,!1,h,f,g,null,{attribute:o})})),e.setShadowStyle&&e.setShadowStyle(p,o,h);const{x:m=0,x:v=0}=o;if(!1!==n&&(g?g(e,o,h):r&&(e.setCommonStyle(p,o,m-l,v-u,h),e.fill())),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[]),this._areaRenderContribitions.forEach((i=>{i.time===t.BaseRenderContributionTime.afterFillStroke&&i.drawShape(p,e,l,u,!!r,!1,n,!1,h,f,g,null,{attribute:o})})),!1!==s)if(y)y(e,o,h);else{const{stroke:t}=o;Dp(t)&&(t[0]||t[2])&&!1===t[1]&&(e.beginPath(),BS(e.camera?e:e.nativeContext,t[0]?i.top:i.bottom,c,"auto",{offsetX:l,offsetY:u,offsetZ:d})),e.setStrokeStyle(p,o,m-l,v-u,h),e.stroke()}return!1}},t.DefaultCanvasAreaRender=dp([rp(),pp(0,op(gp)),pp(0,sp($b)),fp("design:paramtypes",[Object])],t.DefaultCanvasAreaRender),t.DefaultCanvasPathRender=class extends t.BaseRender{pathRenderContribitions;type;numberType=fb;_pathRenderContribitions;constructor(t){super(),this.pathRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).path,{fill:l=c.fill,stroke:u=c.stroke,fillOpacity:d=c.fillOpacity,strokeOpacity:p=c.strokeOpacity,opacity:f=c.opacity,background:g,lineWidth:y=c.lineWidth,visible:m=c.visible,x:v=c.x,y:b=c.y}=e.attribute,x=this.z??0,w=Lb(f,d,l),S=Wb(f,p),A=Ib(l,g),_=Ob(u,y);if(e.valid&&m&&(A||_)&&(w||S||o||h||g)){if(i.beginPath(),e.pathShape)ng(e.pathShape.commandList,i,n,r,1,1,x);else{ng((e.attribute.path??c.path).commandList,i,n,r,1,1,x)}this._pathRenderContribitions||(this._pathRenderContribitions=this.pathRenderContribitions.getContributions()||[],this._pathRenderContribitions.sort(((t,e)=>e.order-t.order))),this._pathRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,A,_,w,S,c,s,o,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),_&&(h?h(i,e.attribute,c):S&&(i.setStrokeStyle(e,e.attribute,v-n,b-r,c),i.stroke())),A&&(o?o(i,e.attribute,c):w&&(i.setCommonStyle(e,e.attribute,v-n,b-r,c),i.fill())),this._pathRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,A,_,w,S,c,s,o,h)}))}}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=nm(t,n?.theme).path,a=this.transform(t,s,r),{x:o,y:h,z:c,lastModelMatrix:l}=a;this.z=c,Nb(t,r,o,h,0,n)||(this.drawShape(t,r,o,h,i,n),this.z=0,r.modelMatrix!==l&&Jw.free(r.modelMatrix),r.modelMatrix=l),r.highPerformanceRestore()}},t.DefaultCanvasPathRender=dp([rp(),pp(0,op(gp)),pp(0,sp(tx)),fp("design:paramtypes",[Object])],t.DefaultCanvasPathRender);const OS=Vp/2;function LS(t,e,i,n,r,s){let a;if(Ip(s,!0))a=[s,s,s,s];else if(Array.isArray(s)){const t=s;switch(t.length){case 0:a=[0,0,0,0];break;case 1:a=[t[0],t[0],t[0],t[0]];break;case 2:case 3:a=[t[0],t[1],t[0],t[1]];break;default:a=t.slice(0,5)}}else a=[0,0,0,0];if(n<0||Math.abs(a[0])+Math.abs(a[1])+Math.abs(a[2])+Math.abs(a[3])<1e-12)return t.rect(e,i,n,r);const[o,h,c,l]=[[e,i],[e+n,i],[e+n,i+r],[e,i+r]],u=Math.min(n/2,r/2),d=[Math.min(u,a[0]),Math.min(u,a[1]),Math.min(u,a[2]),Math.min(u,a[3])],p=[o[0]+d[0],o[1]],f=[o[0],o[1]+d[0]],g=[h[0]-d[1],h[1]],y=[h[0],h[1]+d[1]],m=[c[0]-d[2],c[1]],v=[c[0],c[1]-d[2]],b=[l[0]+d[3],l[1]],x=[l[0],l[1]-d[3]];if(t.moveTo(p[0],p[1]),t.lineTo(g[0],g[1]),!Np(g,y)){const e=g[0],i=g[1]+d[1];t.arc(e,i,d[1],-OS,0,!1)}if(t.lineTo(v[0],v[1]),!Np(m,v)){const e=v[0]-d[2],i=v[1];t.arc(e,i,d[2],0,OS,!1)}if(t.lineTo(b[0],b[1]),!Np(b,x)){const e=b[0],i=b[1]-d[3];t.arc(e,i,d[3],OS,Vp,!1)}if(t.lineTo(f[0],f[1]),!Np(p,f)){const e=p[0],i=p[1]+d[0];t.arc(e,i,d[0],Vp,Vp+OS,!1)}return t.closePath(),t}function US(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(let r=1;r<e.length;r++)t.lineTo(e[r].x+i,e[r].y+n)}function WS(t,e){return Math.sqrt(t*t+e*e)}function FS(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.DefaultCanvasRectRender=class{rectRenderContribitions;type="rect";numberType=mb;_rectRenderContribitions;constructor(t){this.rectRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).rect,{fill:l=c.fill,background:u,stroke:d=c.stroke,width:p=c.width,height:f=c.height,cornerRadius:g=c.cornerRadius,opacity:y=c.opacity,fillOpacity:m=c.fillOpacity,lineWidth:v=c.lineWidth,strokeOpacity:b=c.strokeOpacity,visible:x=c.visible,x:w=c.x,y:S=c.y}=e.attribute,A=Ub(y,m,p,f,l),_=Fb(y,b,p,f),C=Ib(l,u),T=Ob(d,v);if(!e.valid||!x)return;if(!C&&!T)return;if(!(A||_||o||h||u))return;0===g||Dp(g)&&g.every((t=>0===t))?(i.beginPath(),i.rect(n,r,p,f)):(i.beginPath(),LS(i,n,r,p,f,g)),this._rectRenderContribitions||(this._rectRenderContribitions=this.rectRenderContribitions.getContributions()||[],this._rectRenderContribitions.sort(((t,e)=>e.order-t.order)));const B={doFill:C,doStroke:T};this._rectRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h,B)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),B.doFill&&(o?o(i,e.attribute,c):A&&(i.setCommonStyle(e,e.attribute,w-n,S-r,c),i.fill())),B.doStroke&&(h?h(i,e.attribute,c):_&&(i.setStrokeStyle(e,e.attribute,w-n,S-r,c),i.stroke())),this._rectRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=nm(t,n?.theme).rect;let{x:a=s.x,y:o=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);a+=e.x,o+=e.y,r.setTransformForCurrent()}else a=0,o=0,r.transformFromMatrix(t.transMatrix,!0);Nb(t,r,a,o,0,n)||this.drawShape(t,r,a,o,i,n),r.highPerformanceRestore()}},t.DefaultCanvasRectRender=dp([rp(),pp(0,op(gp)),pp(0,sp(ix)),fp("design:paramtypes",[Object])],t.DefaultCanvasRectRender),t.DefaultCanvasSymbolRender=class extends t.BaseRender{symbolRenderContribitions;type;numberType=xb;_symbolRenderContribitions;constructor(t){super(),this.symbolRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).symbol,{size:l=c.size,fill:u=c.fill,background:d,fillOpacity:p=c.fillOpacity,strokeOpacity:f=c.strokeOpacity,opacity:g=c.opacity,lineWidth:y=c.lineWidth,stroke:m=c.stroke,visible:v=c.visible,x:b=c.x,y:x=c.y,scaleX:w=c.scaleX,scaleY:S=c.scaleY}=e.attribute,A=Lb(g,p,u),_=Wb(g,f),C=Ib(u,d),T=Ob(m,y);if(!e.valid||!v)return;if(!C&&!T)return;if(!(A||_||o||h||d))return;const B=e.getParsedPath();if(!B)return;const{keepDirIn3d:P=c.keepDirIn3d}=e.attribute,E=this.z??0;if(i.beginPath(),P&&i.camera&&i.project){const t=i.project(n,r,E),e=i.camera;i.camera=null,!1===B.draw(i,l,t.x,t.y)&&i.closePath(),i.camera=e}else!1===B.draw(i,l,n,r,E)&&i.closePath();this._symbolRenderContribitions||(this._symbolRenderContribitions=this.symbolRenderContribitions.getContributions()||[],this._symbolRenderContribitions.sort(((t,e)=>e.order-t.order))),this._symbolRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),C&&(o?o(i,e.attribute,c):A&&(i.setCommonStyle(e,e.attribute,b-n,x-r,c),i.fill())),T&&(h?h(i,e.attribute,c):_&&(i.setStrokeStyle(e,e.attribute,(b-n)/w,(x-r)/S,c),i.stroke())),this._symbolRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=nm(t,n?.theme).symbol,a=this.transform(t,s,r),{x:o,y:h,z:c,lastModelMatrix:l}=a;this.z=c,Nb(t,r,o,h,0,n)||(this.drawShape(t,r,o,h,i,n),this.z=0,r.modelMatrix!==l&&Jw.free(r.modelMatrix),r.modelMatrix=l),r.highPerformanceRestore()}},t.DefaultCanvasSymbolRender=dp([rp(),pp(0,op(gp)),pp(0,sp(nx)),fp("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender),t.DefaultCanvasTextRender=class extends t.BaseRender{textRenderContribitions;type;numberType=wb;z;_textBeforeRenderContribitions;_textAfterRenderContribitions;constructor(t){super(),this.textRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).text,{text:l,fill:u=c.fill,stroke:d=c.stroke,fillOpacity:p=c.fillOpacity,strokeOpacity:f=c.strokeOpacity,opacity:g=c.opacity,lineWidth:y=c.lineWidth,visible:m=c.visible,underline:v=c.underline,lineThrough:b=c.lineThrough,keepDirIn3d:x=c.keepDirIn3d,fontSize:w=c.fontSize,textBaseline:S=c.textBaseline,x:A=c.x,y:_=c.y}=e.attribute,C=e.attribute.lineHeight??w,T=Lb(g,p,u),B=Wb(g,f),P=Ib(u),E=Ob(d,y);if(!e.valid||!m)return;if(!(P||E||T||B))return;const M=!x,R=this.z||0;if(i.beginPath(),!this._textBeforeRenderContribitions){const e=this.textRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),this._textBeforeRenderContribitions=[],this._textAfterRenderContribitions=[],e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._textBeforeRenderContribitions.push(e):this._textAfterRenderContribitions.push(e)}))}if(this._textBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,P,E,T,B,c,s,o,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),M&&this.transformUseContext2d(e,c,R,i),Array.isArray(l)){i.setTextStyleWithoutAlignBaseline(e.attribute,c,R);const{multilineLayout:t}=e;if(!t)return void i.highPerformanceRestore();const{xOffset:s,yOffset:a}=t.bbox;E&&(h?h(i,e.attribute,c):B&&(i.setStrokeStyle(e,e.attribute,A-n,_-r,c),t.lines.forEach((t=>{i.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+a+r,R)})))),P&&(o?o(i,e.attribute,c):T&&(i.setCommonStyle(e,e.attribute,A-n,_-r,c),t.lines.forEach((t=>{i.fillText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+a+r,R),this.drawMultiUnderLine(v,b,e,(t.leftOffset||0)+n,(t.topOffset||0)+a+r,R,t.width,c,i)}))))}else{i.setTextStyle(e.attribute,c,R);const t=e.clipedText;let s=0;C!==w&&("top"===S?s=(C-w)/2:"middle"===S||"bottom"===S&&(s=-(C-w)/2)),E&&(h?h(i,e.attribute,c):B&&(i.setStrokeStyle(e,e.attribute,A-n,_-r,c),i.strokeText(t,n,r+s,R))),P&&(o?o(i,e.attribute,c):T&&(i.setCommonStyle(e,e.attribute,A-n,_-r,c),i.fillText(t,n,r+s,R),this.drawUnderLine(v,b,e,n,r+s,R,c,i)))}M&&this.restoreTransformUseContext2d(e,c,R,i),this._textAfterRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,P,E,T,B,c,s,o,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=nm(t,n?.theme).text,{keepDirIn3d:a=s.keepDirIn3d}=t.attribute,o=!a,h=this.transform(t,s,r,o),{x:c,y:l,z:u,lastModelMatrix:d}=h;this.z=u,this.drawShape(t,r,c,l,i,n),this.z=0,r.modelMatrix=d,r.highPerformanceRestore()}drawUnderLine(t,e,i,n,r,s,a,o){if(e+t<=0)return;const{textAlign:h=a.textAlign,textBaseline:c=a.textBaseline,fontSize:l=a.fontSize,fill:u=a.fill,opacity:d=a.opacity,fillOpacity:p=a.fillOpacity}=i.attribute,f=i.clipedWidth,g=cx(h,f),y=lx(c,l,l),m={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};if(t){m.lineWidth=t,o.setStrokeStyle(i,m,n,r,a),o.beginPath();const e=r+y+l;o.moveTo(n+g,e,s),o.lineTo(n+g+f,e,s),o.stroke()}if(e){m.lineWidth=e,o.setStrokeStyle(i,m,n,r,a),o.beginPath();const t=r+y+l/2;o.moveTo(n+g,t,s),o.lineTo(n+g+f,t,s),o.stroke()}}drawMultiUnderLine(t,e,i,n,r,s,a,o,h){if(e+t<=0)return;const{textAlign:c=o.textAlign,fontSize:l=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,fillOpacity:p=o.fillOpacity}=i.attribute,f=cx(c,a),g=lx("alphabetic",l,l),y={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};let m=-3;if(t){y.lineWidth=t,h.setStrokeStyle(i,y,n,r,o),h.beginPath();const e=r+g+l+m;h.moveTo(n+f,e,s),h.lineTo(n+f+a,e,s),h.stroke()}if(m=-1,e){y.lineWidth=e,h.setStrokeStyle(i,y,n,r,o),h.beginPath();const t=r+g+l/2+m;h.moveTo(n+f,t,s),h.lineTo(n+f+a,t,s),h.stroke()}}},t.DefaultCanvasTextRender=dp([rp(),pp(0,op(gp)),pp(0,sp(rx)),fp("design:paramtypes",[Object])],t.DefaultCanvasTextRender),t.AbstractGraphicRender=class{type;numberType},t.AbstractGraphicRender=dp([rp()],t.AbstractGraphicRender),t.DefaultCanvasPolygonRender=class{polygonRenderContribitions;type;numberType=gb;_polygonRenderContribitions;constructor(t){this.polygonRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).polygon,{points:l=c.points,fill:u=c.fill,stroke:d=c.stroke,cornerRadius:p=c.cornerRadius,fillOpacity:f=c.fillOpacity,background:g,strokeOpacity:y=c.strokeOpacity,lineWidth:m=c.lineWidth,opacity:v=c.opacity,visible:b=c.visible,x:x=c.x,y:w=c.y}=e.attribute,S=Lb(v,f,u),A=Wb(v,y),_=Ib(u,g),C=Ob(d,m);e.valid&&b&&(_||C)&&(S||A||o||h||g)&&(i.beginPath(),p<=0||Dp(p)&&p.every((t=>0===t))?US(i.camera?i:i.nativeContext,l,n,r):function(t,e,i,n,r){if(e.length<3)US(t,e,i,n);else for(let s=0;s<e.length;s++){const a=e[s],o=e[(s+1)%e.length],h=e[(s+2)%e.length],c=o.x-a.x,l=o.y-a.y,u=o.x-h.x,d=o.y-h.y,p=(Math.atan2(l,c)-Math.atan2(d,u))/2,f=Math.abs(Math.tan(p));let g=Array.isArray(r)?r[(s+1)%e.length]??0:r,y=g/f;const m=WS(c,l),v=WS(u,d),b=Math.min(m,v);y>b&&(y=b,g=b*f);const x=FS(o,y,m,c,l),w=FS(o,y,v,u,d),S=2*o.x-x.x-w.x,A=2*o.y-x.y-w.y,_=WS(S,A),C=FS(o,WS(y,g),_,S,A);let T=Math.atan2(x.y-C.y,x.x-C.x);const B=Math.atan2(w.y-C.y,w.x-C.x);let P=B-T;P<0&&(T=B,P=-P),P>Math.PI&&(P-=Math.PI),0===s?t.moveTo(x.x+i,x.y+n):t.lineTo(x.x+i,x.y+n),P&&t.arcTo(o.x+i,o.y+n,w.x+i,w.y+n,g),t.lineTo(w.x+i,w.y+n)}}(i.camera?i:i.nativeContext,l,n,r,p),i.closePath(),this._polygonRenderContribitions||(this._polygonRenderContribitions=this.polygonRenderContribitions.getContributions()||[],this._polygonRenderContribitions.sort(((t,e)=>e.order-t.order))),this._polygonRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,_,C,S,A,c,s,o,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),_&&(o?o(i,e.attribute,c):f&&(i.setCommonStyle(e,e.attribute,x-n,w-r,c),i.fill())),C&&(h?h(i,e.attribute,c):y&&(i.setStrokeStyle(e,e.attribute,x-n,w-r,c),i.stroke())),this._polygonRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,_,C,S,A,c,s,o,h)})))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=nm(t,n?.theme).polygon;let{x:a=s.x,y:o=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);a+=e.x,o+=e.y,r.setTransformForCurrent()}else a=0,o=0,r.transformFromMatrix(t.transMatrix,!0);Nb(t,r,a,o,0,n)||this.drawShape(t,r,a,o,i,n),r.highPerformanceRestore()}},t.DefaultCanvasPolygonRender=dp([rp(),pp(0,op(gp)),pp(0,sp(ex)),fp("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);const NS=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class{imageRenderContribitions;type;numberType=db;_imageRenderContribitions;constructor(t){this.imageRenderContribitions=t}drawShape(e,i,n,r,s,a,o){const h=nm(e).image,{fill:c=h.fill,width:l=h.width,height:u=h.height,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,visible:f=h.visible,repeatX:g=h.repeatX,repeatY:y=h.repeatY,image:m}=e.attribute,v=Lb(d,p,c),b=Ib(c);if(e.valid&&f&&b&&(v||o)){if(this._imageRenderContribitions||(this._imageRenderContribitions=this.imageRenderContribitions.getContributions()||[]),this._imageRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,b,!1,v,!1,h,s,o)})),i.setShadowStyle&&i.setShadowStyle(e,h),b)if(o)o(i,e.attribute,h);else if(v){if(!m||!e.resources)return;const t=e.resources.get(m);if("success"!==t.state)return;i.setCommonStyle(e,e.attribute,n,r,h);let s=0;if("repeat"===g&&(s|=1),"repeat"===y&&(s|=2),s){const e=i.createPattern(t.data,NS[s]);i.fillStyle=e,i.fillRect(n,r,l,u)}else i.drawImage(t.data,n,r,l,u)}this._imageRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,b,!1,v,!1,h,s,o)}))}}draw(t,e,i){const{context:n}=e.drawParams;if(!n)return;const r=nm(t).image;let{x:s=r.x,y:a=r.y}=t.attribute;const{image:o}=t.attribute;if(!o||!t.resources)return;if("success"===t.resources.get(o).state){if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,n,s,a,i),n.highPerformanceRestore()}}},t.DefaultCanvasImageRender=dp([rp(),pp(0,op(gp)),pp(0,sp(Qb)),fp("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const zS=Symbol.for("IncrementalDrawContribution"),jS=Symbol.for("ArcRender"),HS=Symbol.for("Arc3dRender"),GS=Symbol.for("AreaRender"),VS=Symbol.for("CircleRender"),XS=Symbol.for("GraphicRender"),YS=Symbol.for("GroupRender"),qS=Symbol.for("LineRender"),KS=Symbol.for("PathRender"),$S=Symbol.for("PolygonRender"),ZS=Symbol.for("RectRender"),JS=Symbol.for("Rect3DRender"),QS=Symbol.for("SymbolRender"),tA=Symbol.for("TextRender"),eA=Symbol.for("RichTextRender"),iA=Symbol.for("Pyramid3dRender"),nA=Symbol.for("GlyphRender"),rA=Symbol.for("ImageRender"),sA=Symbol.for("RenderSelector"),aA=Symbol.for("DrawContribution");function oA(t,e,i){let n=e;const{a:r,b:s,c:a,d:o}=t.currentMatrix,h=Math.sign(r)*Math.sqrt(r*r+s*s),c=Math.sign(o)*Math.sqrt(a*a+o*o);return h+c===0?0:(n=n/Math.abs(h+c)*2*i,n)}function hA(t,e,i,n,r){if(!e||!0===e)return"black";let s,a;if(Dp(e))for(let t=0;t<e.length&&(a=e[t],!a);t++);else a=e;return"string"==typeof a?a:("linear"===a.gradient?s=function(t,e,i,n=0,r=0){const s=i.AABBBounds;if(!s)return;let a=s.x2-s.x1,o=s.y2-s.y1,h=s.x1-n,c=s.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;a/=t,o/=e,h/=t,c/=e}const l=t.createLinearGradient(h+(e.x0??0)*a,c+(e.y0??0)*o,h+(e.x1??1)*a,c+(e.y1??0)*o);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l}(t,a,i,n,r):"conical"===a.gradient?s=function(t,e,i,n=0,r=0){const s=i.AABBBounds;if(!s)return;let a=s.x2-s.x1,o=s.y2-s.y1,h=s.x1-n,c=s.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;a/=t,o/=e,h/=t,c/=e}const l=t.createConicGradient(h+(e.x??0)*a,c+(e.y??0)*o,e.startAngle,e.endAngle);let u;return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern(a+h,o+c,u)}(t,a,i,n,r):"radial"===a.gradient&&(s=function(t,e,i,n=0,r=0){const s=i.AABBBounds;if(!s)return;let a=s.x2-s.x1,o=s.y2-s.y1,h=s.x1-n,c=s.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;h/=t,c/=e,a/=t,o/=e}const l=t.createRadialGradient(h+(e.x0??.5)*a,c+(e.y0??.5)*o,Math.max(a,o)*(e.r0??0),h+(e.x1??.5)*a,c+(e.y1??.5)*o,Math.max(a,o)*(e.r1??.5));return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l}(t,a,i,n,r)),s||"orange")}const cA=new class{pools=[];allocate(t){if(!this.pools.length)return vy({nativeCanvas:gy.global.createCanvas(t),...t});const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr};return vy({nativeCanvas:gy.global.createCanvas(e),...e})}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};t.DefaultBaseBackgroundRenderContribution=class{time=t.BaseRenderContributionTime.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u,d){const{background:p}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const r=t.resources.get(p);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=nm(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,h),e.drawImage(r.data,s.x1,s.y1,s.width(),s.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=p,e.fill(),e.highPerformanceRestore()}},t.DefaultBaseBackgroundRenderContribution=dp([rp()],t.DefaultBaseBackgroundRenderContribution),t.DefaultBaseInteractiveRenderContribution=class{subRenderContribitions;time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;order=0;_subRenderContribitions;constructor(t){this.subRenderContribitions=t}drawShape(t,e,i,n,r,s,a,o,h,c,l,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,a,o,h,c,l,u,d)}))}},t.DefaultBaseInteractiveRenderContribution=dp([rp(),pp(0,op(gp)),pp(0,sp(sx)),fp("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution),t.DefaultBaseTextureRenderContribution=class{time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;textureMap;order=10;createCommonPattern(t,e,i,n,r){const s=(t-2*e)/2,a=cA.allocate({width:t,height:t,dpr:1}),o=a.getContext("2d");if(!o)return null;o.clearRect(0,0,t,t),r(s,o);const h=n.createPattern(a.nativeCanvas,"repeat");return cA.free(a),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,qp),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const r=t/2,s=r;n.fillStyle=i,n.moveTo(r,s-e),n.lineTo(e+r,s),n.lineTo(r,s+e),n.lineTo(r-e,s),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(s,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(0,s,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const r=t/2,s=-r;n.moveTo(r,s),n.lineTo(r+t,s+t),n.moveTo(-r,-s),n.lineTo(-r+t,-s+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const r=t/2,s=r;n.moveTo(t+r,s),n.lineTo(r,s+t),n.moveTo(t-r,-s),n.lineTo(-r,-s+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,t,t),n.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,r,s,a,o,h,c,l,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:f=h.textureColor,textureSize:g=h.textureSize,texturePadding:y=h.texturePadding}=t.attribute;if(!p)return;let m=this.textureMap.get(p);if(!m)switch(p){case"circle":m=this.createCirclePattern(g,y,f,e);break;case"diamond":m=this.createDiamondPattern(g,y,f,e);break;case"rect":m=this.createRectPattern(g,y,f,e);break;case"vertical-line":m=this.createVerticalLinePattern(g,y,f,e);break;case"horizontal-line":m=this.createHorizontalLinePattern(g,y,f,e);break;case"bias-lr":m=this.createBiasLRLinePattern(g,y,f,e);break;case"bias-rl":m=this.createBiasRLLinePattern(g,y,f,e);break;case"grid":m=this.createGridPattern(g,y,f,e)}m&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=m,e.fill(),e.highPerformanceRestore())}},t.DefaultBaseTextureRenderContribution=dp([rp()],t.DefaultBaseTextureRenderContribution),t.DefaultArcRenderContribution=class{time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{innerRadius:d=h.innerRadius,outerRadius:p=h.outerRadius,startAngle:f=h.startAngle,endAngle:g=h.endAngle,opacity:y=h.opacity,outerBorder:m,innerBorder:v}=t.attribute;if(m){const{distance:r=h.outerBorder.distance}=m,s=oA(e,r,e.dpr),a=r/p;if(t.setAttributes({outerRadius:p+s,innerRadius:d-s,startAngle:f-a,endAngle:g+a}),e.beginPath(),Hb(t,e,i,n,p+s,d-s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,m,h.outerBorder);else if(o){const r=h.outerBorder.opacity;h.outerBorder.opacity=y,e.setStrokeStyle(t,m,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(v){const{distance:r=h.innerBorder.distance}=v,s=oA(e,r,e.dpr),a=r/p;if(t.setAttributes({outerRadius:p-s,innerRadius:d+s,startAngle:f+a,endAngle:g-a}),e.beginPath(),Hb(t,e,i,n,p-s,d+s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,v,h.innerBorder);else if(o){const r=h.innerBorder.opacity;h.innerBorder.opacity=y,e.setStrokeStyle(t,v,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:p,innerRadius:d,startAngle:f,endAngle:g})}},t.DefaultArcRenderContribution=dp([rp()],t.DefaultArcRenderContribution),t.DefaultArcBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke},t.DefaultArcBackgroundRenderContribution=dp([rp()],t.DefaultArcBackgroundRenderContribution),t.DefaultArcTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke},t.DefaultArcTextureRenderContribution=dp([rp()],t.DefaultArcTextureRenderContribution),t.DefaultCircleRenderContribution=class{time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{radius:d=h.radius,startAngle:p=h.startAngle,endAngle:f=h.endAngle,opacity:g=h.opacity,outerBorder:y,innerBorder:m}=t.attribute;if(y){const{distance:r=h.outerBorder.distance}=y,s=oA(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,d+s,p,f),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,y,h.outerBorder);else if(o){const r=h.outerBorder.opacity;h.outerBorder.opacity=g,e.setStrokeStyle(t,y,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(m){const{distance:r=h.innerBorder.distance}=m,s=oA(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,d-s,p,f),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,m,h.innerBorder);else if(o){const r=h.innerBorder.opacity;h.innerBorder.opacity=g,e.setStrokeStyle(t,m,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultCircleRenderContribution=dp([rp()],t.DefaultCircleRenderContribution),t.DefaultCircleBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke},t.DefaultCircleBackgroundRenderContribution=dp([rp()],t.DefaultCircleBackgroundRenderContribution),t.DefaultCircleTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke},t.DefaultCircleTextureRenderContribution=dp([rp()],t.DefaultCircleTextureRenderContribution),t.DefaultGroupBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{background:d}=t.attribute;if(d)if(t.backgroundImg&&t.resources){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const n=t.AABBBounds;e.drawImage(i.data,n.x1,n.y1,n.width(),n.height()),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}},t.DefaultGroupBackgroundRenderContribution=dp([rp()],t.DefaultGroupBackgroundRenderContribution),t.DefaultImageBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{background:d,width:p,height:f}=t.attribute;if(d)if(t.backgroundImg){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=nm(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}const n=t.AABBBounds;e.drawImage(i.data,n.x1,n.y1,n.width(),n.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else{e.beginPath();const r=t.AABBBounds;e.rect(i,n,r.width(),r.height()),e.fillStyle=d,e.globalAlpha=1,e.fill()}}},t.DefaultImageBackgroundRenderContribution=dp([rp()],t.DefaultImageBackgroundRenderContribution),t.DefaultRectRenderContribution=class{time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{width:d=h.width,height:p=h.height,cornerRadius:f=h.cornerRadius,opacity:g=h.opacity,outerBorder:y,innerBorder:m}=t.attribute;if(y){const{distance:r=h.outerBorder.distance}=y,s=oA(e,r,e.dpr),a=i-s,c=n-s,l=2*s;if(0===f||Dp(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(a,c,d+l,p+l)):(e.beginPath(),LS(e,a,c,d+l,p+l,f)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,y,h.outerBorder);else if(o){const r=h.outerBorder.opacity;h.outerBorder.opacity=g,e.setStrokeStyle(t,y,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(m){const{distance:r=h.innerBorder.distance}=m,s=oA(e,r,e.dpr),a=i+s,c=n+s,l=2*s;if(0===f||Dp(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(a,c,d-l,p-l)):(e.beginPath(),LS(e,a,c,d-l,p-l,f)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,m,h.innerBorder);else if(o){const r=h.innerBorder.opacity;h.innerBorder.opacity=g,e.setStrokeStyle(t,m,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultRectRenderContribution=dp([rp()],t.DefaultRectRenderContribution),t.DefaultRectBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke},t.DefaultRectBackgroundRenderContribution=dp([rp()],t.DefaultRectBackgroundRenderContribution),t.DefaultRectTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke},t.DefaultRectTextureRenderContribution=dp([rp()],t.DefaultRectTextureRenderContribution),t.SplitRectBeforeRenderContribution=class{time=t.BaseRenderContributionTime.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u,d){const{stroke:p=h.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}},t.SplitRectBeforeRenderContribution=dp([rp()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=class{time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{width:d=h.width,height:p=h.height,stroke:f=h.stroke}=t.attribute;if(Array.isArray(f)&&f.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,h),e.beginPath(),e.moveTo(i,n),f[0]?e.lineTo(i+d,n):e.moveTo(i+d,n),f[1]?e.lineTo(i+d,n+p):e.moveTo(i+d,n+p),f[2]?e.lineTo(i,n+p):e.moveTo(i,n+p),f[3]){const t=f[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}},t.SplitRectAfterRenderContribution=dp([rp()],t.SplitRectAfterRenderContribution),t.DefaultSymbolRenderContribution=class{time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{size:d=h.size,opacity:p=h.opacity,outerBorder:f,innerBorder:g}=t.attribute,y=t.getParsedPath();if(y){if(f){const{distance:r=h.outerBorder.distance}=f,s=oA(e,r,e.dpr);if(e.beginPath(),!1===y.drawOffset(e,d,i,n,s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,f,h.outerBorder);else if(o){const r=h.outerBorder.opacity;h.outerBorder.opacity=p,e.setStrokeStyle(t,f,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=g,s=oA(e,r,e.dpr);if(e.beginPath(),!1===y.drawOffset(e,d,i,n,-s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,g,h.innerBorder);else if(o){const r=h.innerBorder.opacity;h.innerBorder.opacity=p,e.setStrokeStyle(t,g,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}}},t.DefaultSymbolRenderContribution=dp([rp()],t.DefaultSymbolRenderContribution);class lA extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke}class uA extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke}const dA=Symbol.for("RenderService"),pA=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{drawContribution;dirtyBounds;renderTreeRoots;renderLists;drawParams;constructor(t){this.drawContribution=t}prepare(t){this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,{...this.drawParams})}afterDraw(t){}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}},t.DefaultRenderService=dp([rp(),pp(0,op(aA)),fp("design:paramtypes",[Object])],t.DefaultRenderService);var fA=new Qd((e=>{e(t.DefaultRenderService).toSelf(),e(dA).toService(t.DefaultRenderService)}));function gA(t,e,i,n=!1,r=!1){const s={},a=[];let o=!1;if(r)o=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:r=e}=t.attribute;if(0===n)i=r;else if(i!==r)return o=!0,!0;return!1}),n)}if(o){t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],a.push(i))}),n),a.sort(((t,e)=>n?e-t:t-e));let o=!1;for(let t=0;t<a.length&&!o;t++){const e=a[t],h=s[e];r&&h.sort(((t,e)=>(n?-1:1)*((e.attribute.z??0)-(t.attribute.z??0))));for(let t=0;t<h.length;t++)if(i(h[t],t)){o=!0;break}}}else t.forEachChildren(i,n)}async function yA(t,e,i,n=!1){await t.forEachChildrenAsync(i,n)}function mA(t,e,i,n=!1){const r={},s=[];let a=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(undefined!==n)return a=!0,!0;return!1}),n);let o=null,h=!1;if(a){t.forEachChildren((t=>{const{zIndex:e=i}=t.attribute;r[e]?r[e].push(t):(r[e]=[t],s.push(e))}),n),s.sort(((t,e)=>n?e-t:t-e));let a=!1;for(let t=0;t<s.length&&!a;t++){const i=s[t],n=r[i];for(let t=0;t<n.length;t++){if(h){a=!0,o=n[t];break}n[t]._uid!==e||(h=!0)}}}else t.forEachChildren((t=>h?(o=t,!0):(t._uid===e&&(h=!0),!1)),n);return o}const vA=Symbol.for("PickItemInterceptor");let bA=class{order=1;beforePickItem(t,e,i,n,r){if(!t.in3dMode||n.in3dInterceptor)return null;const s=e.pickContext,a=t.stage;if(!s||!a)return null;if(n.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=a.camera,t.isContainer){let a,o=!1,h=!1;if(t.forEachChildren((t=>(o=t.numberType===ob,!o))),t.forEachChildren((t=>(h=!!t.findFace,!h))),o){const s=t.getChildren(),o=[...s];o.sort(((t,e)=>{let i=(t.attribute.startAngle??0+t.attribute.endAngle??0)/2,n=(e.attribute.startAngle??0+e.attribute.endAngle??0)/2;for(;i<0;)i+=qp;for(;n<0;)n+=qp;return n-i})),o.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),o.forEach((e=>{t.appendChild(e)})),n.hack_pieFace="outside",a=e.pickGroup(t,i,r.parentMatrix,n),a.graphic||(n.hack_pieFace="inside",a=e.pickGroup(t,i,r.parentMatrix,n)),a.graphic||(n.hack_pieFace="top",a=e.pickGroup(t,i,r.parentMatrix,n)),t.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),s.forEach((e=>{t.appendChild(e)}))}else if(h){const o=t.getChildren(),h=o.map((t=>({ave_z:t.findFace().vertices.map((e=>s.view(e[0],e[1],e[2]+t.attribute.z??0)[2])).reduce(((t,e)=>t+e),0),g:t})));h.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),h.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),h.forEach((e=>{t.add(e.g)})),a=e.pickGroup(t,i,r.parentMatrix,n),t.removeAllChild(),o.forEach((t=>{t._next=null,t._prev=null})),t.update(),o.forEach((e=>{t.add(e)}))}else a=e.pickGroup(t,i,r.parentMatrix,n);return s.camera=null,s.restore(),n.in3dInterceptor=!1,a}return null}initCanvasCtx(t){t.setTransformForCurrent()}};bA=dp([rp()],bA);const xA=Symbol.for("GraphicPicker"),wA=Symbol.for("PickerService");t.DefaultPickService=class{global;pickItemInterceptorContributions;type="default";constructor(t,e){this.global=t,this.pickItemInterceptorContributions=e}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let n={graphic:null,group:null};i.pickerService=this;let r=0,s=0;if(i&&i.bounds){if(!i.bounds.contains(e.x,e.y))return n;r=i.bounds.x1,s=i.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const a=new _f(1,0,0,1,r,s);let o;for(let r=t.length-1;r>=0&&(t[r].isContainer?n=this.pickGroup(t[r],e,a,i):n.graphic=this.pickItem(t[r],e,i),!n.graphic);r--)o||(o=n.group);return n.graphic||(n.group=o),this.pickContext&&(this.pickContext.inuse=!1),n}containsPoint(t,e,i){return!!this.pickItem(t,e,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=n.pickContext,a=s.modelMatrix;if(s.camera){const e=t.transMatrix,i=Jw.allocate();if(iS(i,e),a){if(i){const t=Jw.allocate();s.modelMatrix=nS(t,a,i),Jw.free(i)}}else iS(i,t.globalTransMatrix),s.modelMatrix=i}if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const o=this.InterceptorContributions[r];if(o.beforePickItem){const r=o.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return s.modelMatrix!==a&&Jw.free(s.modelMatrix),s.modelMatrix=a,r}}const o=t.transMatrix,h=Zw.allocateByObj(i),c=new hf(e.x,e.y);h.transformPoint(c,c);const l=t.AABBBounds.containsPoint(c);if(!l&&!t.stage.camera)return r;const u=!1!==t.attribute.pickable&&l;return h.multiply(o.a,o.b,o.c,o.d,o.e,o.f),!1!==t.attribute.childrenPickable&&gA(t,Kg.zIndex,(i=>{if(i.isContainer){const s=new hf(e.x,e.y),a=nm(t).group,{scrollX:o=a.scrollX,scrollY:c=a.scrollY}=t.attribute;s.x-=o,s.y-=c,r=this.pickGroup(i,s,h,n)}else{const s=new hf(e.x,e.y);h.transformPoint(s,s);const a=nm(t).group,{scrollX:o=a.scrollX,scrollY:c=a.scrollY}=t.attribute;s.x-=o,s.y-=c;const l=this.pickItem(i,s,n);r.graphic=l}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==a&&Jw.free(s.modelMatrix),s.modelMatrix=a,r.graphic||r.group||!u||t.stage.camera||(r.group=t),Zw.free(h),r}selectPicker(t){const e=this.pickerMap.get(t.numberType);return e||null}},t.DefaultPickService=dp([rp(),pp(0,op(wp)),pp(1,op(gp)),pp(1,sp(vA)),fp("design:paramtypes",[Object,Object])],t.DefaultPickService);const SA=Symbol.for("BoundsPicker"),AA=Symbol.for("GlobalPickerService");function _A(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],y=e[13],m=e[14],v=e[15];let b=i[0],x=i[1],w=i[2],S=i[3];return t[0]=b*n+x*o+w*u+S*g,t[1]=b*r+x*h+w*d+S*y,t[2]=b*s+x*c+w*p+S*m,t[3]=b*a+x*l+w*f+S*v,b=i[4],x=i[5],w=i[6],S=i[7],t[4]=b*n+x*o+w*u+S*g,t[5]=b*r+x*h+w*d+S*y,t[6]=b*s+x*c+w*p+S*m,t[7]=b*a+x*l+w*f+S*v,b=i[8],x=i[9],w=i[10],S=i[11],t[8]=b*n+x*o+w*u+S*g,t[9]=b*r+x*h+w*d+S*y,t[10]=b*s+x*c+w*p+S*m,t[11]=b*a+x*l+w*f+S*v,b=i[12],x=i[13],w=i[14],S=i[15],t[12]=b*n+x*o+w*u+S*g,t[13]=b*r+x*h+w*d+S*y,t[14]=b*s+x*c+w*p+S*m,t[15]=b*a+x*l+w*f+S*v,t}function CA(t,e,i){const n=e[0],r=e[1],s=e[2];let a=i[3]*n+i[7]*r+i[11]*s+i[15];return a=a||1,t[0]=(i[0]*n+i[4]*r+i[8]*s+i[12])/a,t[1]=(i[1]*n+i[5]*r+i[9]*s+i[13])/a,t[2]=(i[2]*n+i[6]*r+i[10]*s+i[14])/a,t}t.DefaultGlobalPickerService=class{global;type;constructor(t){this.global=t,this.global.hooks.onSetEnv.tap("global-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env)}configure(t,e){}pick(t,e,i){let n={graphic:null,group:null};const r=new _f(1,0,0,1,0,0);let s;for(let a=0;a<t.length&&(t[a].isContainer?n=this.pickGroup(t[a],e,r,i):n.graphic=this.pickItem(t[a],e,i),!n.graphic);a++)s||(s=n.group);return n.graphic||(n.group=s),n}containsPoint(t,e,i){return!!this.pickItem(t,e,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=t.transMatrix,a=new hf(e.x,e.y);i.transformPoint(a,a);const o=t.AABBBounds.containsPoint(a);if(!o)return r;const h=!1!==t.attribute.pickable&&o;return i.multiply(s.a,s.b,s.c,s.d,s.e,s.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((t=>{if(t.isContainer)r=this.pickGroup(t,e,i,n);else{const s=new hf(e.x,e.y);i.transformPoint(s,s),r.graphic=this.pickItem(t,s,n)}return!!r.graphic||!!r.group})),r.graphic||r.group||!h||(r.group=t),r}pickItem(t,e,i){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?t:null}},t.DefaultGlobalPickerService=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],t.DefaultGlobalPickerService);class TA{_params;_projectionMatrixCached;_viewMatrixCached;_vp;set params(t){this._params={...t},this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return{...this._params}}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=Jw.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Jw.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,n){let r,s,a,o,h,c,l,u,d,p;const f=e[0],g=e[1],y=e[2],m=n[0],v=n[1],b=n[2],x=i[0],w=i[1],S=i[2];Math.abs(f-x)<Gp&&Math.abs(g-w)<Gp&&Math.abs(y-S)<Gp?$w.identity(t):(l=f-x,u=g-w,d=y-S,p=1/Math.hypot(l,u,d),l*=p,u*=p,d*=p,r=v*d-b*u,s=b*l-m*d,a=m*u-v*l,p=Math.hypot(r,s,a),p?(p=1/p,r*=p,s*=p,a*=p):(r=0,s=0,a=0),o=u*a-d*s,h=d*r-l*a,c=l*s-u*r,p=Math.hypot(o,h,c),p?(p=1/p,o*=p,h*=p,c*=p):(o=0,h=0,c=0),t[0]=r,t[1]=o,t[2]=l,t[3]=0,t[4]=s,t[5]=h,t[6]=u,t[7]=0,t[8]=a,t[9]=c,t[10]=d,t[11]=0,t[12]=-(r*f+s*g+a*y),t[13]=-(o*f+h*g+c*y),t[14]=-(l*f+u*g+d*y),t[15]=1)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=Jw.allocate()),this._vp=_A(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=Jw.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=Jw.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return function(t,e,i,n,r,s,a){const o=1/(e-i),h=1/(n-r),c=1/(s-a);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*o,t[13]=(r+n)*h,t[14]=(a+s)*c,t[15]=1}(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=Jw.allocate()),this._vp=_A(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(e??n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return CA(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;CA(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const s=this.getProjectionScale(i);return{x:t*s+r[0],y:e*s+r[1]}}}const BA=[0,0,0],PA=new _f(1,0,0,1,0,0);t.BrowserContext2d=class{static env="browser";drawPromise;modelMatrix;matrix;applyedMatrix;set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}dpr;constructor(t,e){const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new _f(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new _f(1,0,0,1,0,0)}reset(){this.stack.length&&console.warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new _f(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Zw.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(Zw.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(Zw.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n,r=!0){this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*n,o*r,o*s),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s,a=!0){this.matrix.multiply(t,e,i,n,r,s),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,n,r,s,a){if(a=a||0,this.camera){const o=[];((t,e,i,n,r,s,a,o)=>{if(o)for(;i>e;)i-=qp;else for(;i<e;)i+=qp;const h=Vp/3*(i>e?1:-1);let c=e,l=c;for(;l!==i;){l=h>0?Math.min(l+h,i):Math.max(l+h,i);const e=Math.abs(l-c),o=4*Math.tan(e/4)/3,u=l<c?-1:1,d=Math.cos(c),p=Math.sin(c),f=Math.cos(l),g=Math.sin(l),y=d*s+n,m=p*a+r,v=f*s+n,b=g*a+r,x=s*o*u,w=a*o*u;t.push([y-x*p,m+w*d,v+x*g,b-w*f,v,b]),c=l}})(o,n,r,t,e,i,i,s);for(let t=0;t<o.length;++t){const e=o[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],a)}}else this.nativeContext.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.nativeContext.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s,a){if(a=a||0,this.camera){let o=a,h=a;this.modelMatrix&&(CA(BA,[t,e,a],this.modelMatrix),t=BA[0],e=BA[1],o=BA[2],CA(BA,[i,n,a],this.modelMatrix),i=BA[0],n=BA[1],h=BA[2],CA(BA,[r,s,a],this.modelMatrix),r=BA[0],s=BA[1],a=BA[2]);let c=this.camera.vp(r,s,a);r=c.x,s=c.y,c=this.camera.vp(t,e,o),t=c.x,e=c.y,c=this.camera.vp(i,n,h),i=c.x,n=c.y}this.nativeContext.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.nativeContext.closePath()}ellipse(t,e,i,n,r,s,a,o){null==o?this.nativeContext.ellipse(t,e,i,n,r,s,a):this.nativeContext.ellipse(t,e,i,n,r,s,a,o)}lineTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(CA(BA,[t,e,i],this.modelMatrix),t=BA[0],e=BA[1],i=BA[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(CA(BA,[t,e,i],this.modelMatrix),t=BA[0],e=BA[1],i=BA[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,i,n,r){if(r=r||0,this.camera){let s=r;this.modelMatrix&&(CA(BA,[t,e,r],this.modelMatrix),t=BA[0],e=BA[1],s=BA[2],CA(BA,[i,n,r],this.modelMatrix),i=BA[0],n=BA[1],r=BA[2]);let a=this.camera.vp(i,n,r);i=a.x,n=a.y,a=this.camera.vp(t,e,s),t=a.x,e=a.y}this.nativeContext.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+i,e,r),this.lineTo(t+i,e+n,r),this.lineTo(t,e+n,r),this.closePath()):this.nativeContext.rect(t,e,i,n)}createImageData(){const t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}createLinearGradient(t,e,i,n){return this.nativeContext.createLinearGradient(t,e,i,n)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,i,n,r,s){return this.nativeContext.createRadialGradient(t,e,i,n,r,s)}createConicGradient(t,e,i,n){let r,s=!1;const a=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),s=!0},GetPattern(o,h,c){return s&&(c||(c=n-i),r=qb(a,this.stops,t,e,c,i,n,o,h),s=!1),r}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,n){this.nativeContext.fillRect(t,e,i,n)}clearRect(t,e,i,n){this.nativeContext.clearRect(t,e,i,n)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(CA(BA,[t,e,i],this.modelMatrix),t=BA[0],e=BA[1],i=BA[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(CA(BA,[t,e,i],this.modelMatrix),t=BA[0],e=BA[1],i=BA[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(CA(BA,[e,i,n],this.modelMatrix),e=BA[0],i=BA[1],n=BA[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,n){return this.nativeContext.getImageData(t,e,i,n)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t,e=gy.global.measureTextMethod){return e&&"native"!==e?(this.mathTextMeasure||(this.mathTextMeasure=gy.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas))),this.mathTextMeasure.textSpec.fontFamily=this.fontFamily??Yg.fontFamily,this.mathTextMeasure.textSpec.fontSize=this.fontSize??Yg.fontSize,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={},this.mathTextMeasure.measure(t,e)):this.nativeContext.measureText(t)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,n){this.nativeContext.strokeRect(t,e,i,n)}strokeText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(CA(BA,[e,i,n],this.modelMatrix),e=BA[0],i=BA[1],n=BA[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}fillAttributes={...Gg,opacity:1};strokeAttributes={...Xg,opacity:1};textAttributes={...Yg,opacity:1};setCommonStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,i,n,r[0]);const s={};return r.forEach((t=>{Object.assign(s,t)})),this._setCommonStyle(t,e,i,n,s)}return this._setCommonStyle(t,e,i,n,r)}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:a=r.fillOpacity,opacity:o=r.opacity,fill:h=r.fill}=e;a>1e-12&&o>1e-12?(s.globalAlpha=a*o,s.fillStyle=hA(this,h,t,i,n)):s.globalAlpha=a*o}setShadowStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowStyle(t,i[0]);const n={};return i.forEach((t=>{Object.assign(n,t)})),this._setShadowStyle(t,e,n)}return this._setShadowStyle(t,e,i)}_clearShadowStyle=!1;_clearFilterStyle=!1;_setShadowStyle(t,e,i){const n=this.nativeContext;i||(i=this.fillAttributes);const{opacity:r=i.opacity,shadowBlur:s=i.shadowBlur,shadowColor:a=i.shadowColor,shadowOffsetX:o=i.shadowOffsetX,shadowOffsetY:h=i.shadowOffsetY,blur:c=i.blur}=e;r<=1e-12||(s||o||h?(n.shadowBlur=s,n.shadowColor=a,n.shadowOffsetX=o,n.shadowOffsetY=h,this._clearShadowStyle=!0):this._clearShadowStyle&&(n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0),c?(n.filter=`blur(${c}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(n.filter="blur(0px)",this._clearFilterStyle=!1))}setStrokeStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,i,n,r[0]);const s={};return r.forEach((t=>{Object.assign(s,t)})),this._setStrokeStyle(t,e,i,n,s)}return this._setStrokeStyle(t,e,i,n,r)}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(a>1e-12&&o>1e-12){const{lineWidth:h=r.lineWidth,stroke:c=r.stroke,lineJoin:l=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=a*o,s.lineWidth=oA(this,h,this.dpr),s.strokeStyle=hA(this,c,t,i,n),s.lineJoin=l,s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}setTextStyleWithoutAlignBaseline(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;t.font?n.font=t.font:n.font=hx(t,e,r&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:s=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=s,this.fontSize=a,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes),t.font?n.font=t.font:n.font=hx(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:r=e.fontFamily,fontSize:s=e.fontSize}=t;this.fontFamily=r,this.fontSize=s,n.textAlign=t.textAlign??e.textAlign,n.textBaseline=t.textBaseline??e.textBaseline}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(PA,t,e)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Zw.free(t))),this.stack.length=0}},t.BrowserContext2d=dp([rp(),fp("design:paramtypes",[Object,Number])],t.BrowserContext2d);const EA={WIDTH:500,HEIGHT:500,DPR:1};t.BrowserCanvas=class{static env="browser";_displayWidth;_displayHeight;_id;_pixelWidth;_pixelHeight;_x;_y;_dpr;_container;_nativeCanvas;_context;_visiable;controled;get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this.width,this.height)}constructor(e){const{nativeCanvas:i,width:n=EA.WIDTH,height:r=EA.HEIGHT,dpr:s=EA.DPR,container:a,x:o,y:h,canvasControled:c=!0}=e;if(this._x=o??0,this._y=h??0,this._pixelWidth=n*s,this._pixelHeight=r*s,this._visiable=!1!==e.visiable,this.controled=c,"string"==typeof a){const t=gy.global.getElementById(a);t&&(this._container=t)}else this._container=a;this._displayWidth=n,this._displayHeight=r,this._dpr=s,this._nativeCanvas=i,this._context=new t.BrowserContext2d(this,this._dpr),this._id=i.id,this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight;!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),null!=this.id&&(t.id=this.id.toString()),this._container&&this._container.appendChild(t),this.visiable||this.hide()}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:i=this._displayHeight,dpr:n=this._dpr,x:r=this._x,y:s=this._y}=t,{nativeCanvas:a}=this;a.width=e*n,a.height=i*n;!a.style||this.setCanvasStyle(a,r,s,e,i),t.id&&(a.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,n,r){this.controled&&(t.style.padding="0",t.style.margin="0",t.style.border="0",t.style.background="transparent",t.style.width=`${n}px`,t.style.height=`${r}px`)}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}resize(t,e){if(!this.controled)return;this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight;this._context.dpr=this._dpr}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}},t.BrowserCanvas=dp([rp(),fp("design:paramtypes",[Object])],t.BrowserCanvas);const MA=Symbol.for("CanvasArcPicker"),RA=Symbol.for("CanvasArc3dPicker"),kA=Symbol.for("CanvasAreaPicker"),DA=Symbol.for("CanvasCirclePicker"),IA=Symbol.for("CanvasImagePicker"),OA=Symbol.for("CanvasLinePicker"),LA=Symbol.for("CanvasPathPicker"),UA=Symbol.for("CanvasRectPicker"),WA=Symbol.for("CanvasRect3dPicker"),FA=Symbol.for("CanvasSymbolPicker"),NA=Symbol.for("CanvasTextPicker"),zA=Symbol.for("CanvasPolygonPicker"),jA=Symbol.for("CanvasPyramid3dPicker"),HA=Symbol.for("CanvasRichTextPicker"),GA=Symbol.for("CanvasGlyphPicker"),VA=Symbol.for("CanvasPickerContribution"),XA=Symbol.for("MathArcPicker"),YA=Symbol.for("MathAreaPicker"),qA=Symbol.for("MathCirclePicker"),KA=Symbol.for("MathLinePicker"),$A=Symbol.for("MathPathPicker"),ZA=Symbol.for("MathRectPicker"),JA=Symbol.for("MathSymbolPicker"),QA=Symbol.for("MathTextPicker"),t_=Symbol.for("MathPolygonPicker"),e_=Symbol.for("MathGlyphPicker"),i_=Symbol.for("MathPickerContribution");t.DefaultCanvasPickerService=class extends t.DefaultPickService{contributions;circlePicker;rectPicker;arcPicker;areaPicker;imagePicker;linePicker;pathPicker;symbolPicker;textPicker;polygonPicker;richtextPicker;drawContribution;global;pickItemInterceptorContributions;constructor(t,e,i,n,r,s,a,o,h,c,l,u,d,p,f){super(p,f),this.contributions=t,this.circlePicker=e,this.rectPicker=i,this.arcPicker=n,this.areaPicker=r,this.imagePicker=s,this.linePicker=a,this.pathPicker=o,this.symbolPicker=h,this.textPicker=c,this.polygonPicker=l,this.richtextPicker=u,this.drawContribution=d,this.global=p,this.pickItemInterceptorContributions=f,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(e,i){const n={width:100,height:100,nativeCanvas:e.createCanvas({width:100,height:100}),id:"for-pick"};this.pickCanvas=new t.BrowserCanvas(n),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforePickItem&&r.beforePickItem(t,this,e,i))return t}const n=this.pickerMap.get(t.numberType);return n&&n.contains(t,e,i)?t:null}},dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],t.DefaultCanvasPickerService.prototype,"init",null),t.DefaultCanvasPickerService=dp([rp(),pp(0,op(gp)),pp(0,sp(VA)),pp(1,op(DA)),pp(2,op(UA)),pp(3,op(MA)),pp(4,op(kA)),pp(5,op(IA)),pp(6,op(OA)),pp(7,op(LA)),pp(8,op(FA)),pp(9,op(NA)),pp(10,op(zA)),pp(11,op(HA)),pp(12,op(aA)),pp(13,op(wp)),pp(14,op(gp)),pp(14,sp(vA)),fp("design:paramtypes",[Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object])],t.DefaultCanvasPickerService);const n_=new _f(1,0,0,1,0,0),r_={x:0,y:0};t.EmptyContext2d=class{path;canvas;stack;matrix;applyedMatrix;fillStyle;font;globalAlpha;lineCap;lineDashOffset;lineJoin;lineWidth;miterLimit;shadowBlur;shadowColor;shadowOffsetX;shadowOffsetY;strokeStyle;textAlign;textBaseline;dpr;get nativeContext(){return this.path}constructor(t,e){this.matrix=new _f(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new _f(1,0,0,1,0,0),this.path=new Ng}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Zw.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(Zw.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(Zw.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n,r=!0){this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*n,o*r,o*s),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s,a=!0){this.matrix.multiply(t,e,i,n,r,s),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,r,s){this.path.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.path.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s){this.path.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.path.closePath()}ellipse(t,e,i,n,r,s,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},r_),function(t,e,i){return Yy(t,0,!1,e,i)}(this.path.commandList,r_.x,r_.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},r_);const i=oA(this,this.lineWidth,this.dpr);return function(t,e,i,n){return Yy(t,e,!0,i,n)}(this.path.commandList,i,r_.x,r_.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,r){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,r){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(n_,t,e)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Zw.free(t))),this.stack.length=0}},t.EmptyContext2d=dp([rp(),fp("design:paramtypes",[Object,Number])],t.EmptyContext2d),t.DefaultMathPickerService=class extends t.DefaultPickService{contributions;global;pickItemInterceptorContributions;constructor(t,e,i){super(e,i),this.contributions=t,this.global=e,this.pickItemInterceptorContributions=i,this.global.hooks.onSetEnv.tap("math-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(e,i){this.pickContext=new t.EmptyContext2d(null,1)}pickItem(t,e,i){if(!1===t.attribute.pickable)return null;const n=this.pickerMap.get(t.numberType);return n&&n.contains(t,e,i)?t:null}},dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],t.DefaultMathPickerService.prototype,"init",null),t.DefaultMathPickerService=dp([rp(),pp(0,op(gp)),pp(0,sp(i_)),pp(1,op(wp)),pp(2,op(gp)),pp(2,sp(vA)),fp("design:paramtypes",[Object,Object,Object])],t.DefaultMathPickerService);var s_=new Qd((e=>{e(t.DefaultCanvasPickerService).toSelf().inSingletonScope(),e(t.DefaultMathPickerService).toSelf().inSingletonScope(),e(wA).toService(t.DefaultCanvasPickerService),e(t.DefaultGlobalPickerService).toSelf().inSingletonScope(),e(AA).toService(t.DefaultGlobalPickerService),e(bA).toSelf().inSingletonScope(),e(vA).toService(bA),mp(e,vA)})),a_=new Qd((e=>{e(t.DefaultGraphicService).toSelf().inSingletonScope(),e(Sb).toService(t.DefaultGraphicService),e(zw).toSelf().inSingletonScope(),e(Nw).toService(zw),mp(e,Nw),e(Hw).toSelf().inSingletonScope(),e(jw).toService(Hw),mp(e,jw),e(Vw).toSelf().inSingletonScope(),e(Gw).toService(Vw),mp(e,Gw),e(Yw).toSelf().inSingletonScope(),e(Xw).toService(Yw),mp(e,Xw),e(Kw).toSelf().inSingletonScope(),e(qw).toService(Kw),mp(e,qw),e(Ab).toConstantValue(_S)}));const o_=Symbol.for("AutoEnablePlugins"),h_=Symbol.for("PluginService");let c_=class{autoEnablePlugins;constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&fy.isBound(o_)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}release(...t){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};c_=dp([rp(),pp(0,op(gp)),pp(0,sp(o_)),fp("design:paramtypes",[Object])],c_);var l_=new Qd((t=>{t(c_).toSelf(),t(h_).toService(c_),mp(t,o_)}));function u_(t,e=!1){const i=document.createElement("img");if(i.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}if(i.src=t,i.complete)return Promise.resolve(i);const n=new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}));return n}t.BaseEnvContribution=class{type;supportsTouchEvents;supportsPointerEvents;supportsMouseEvents;applyStyles;supportEvent;configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){const e=fetch(t).then((t=>t.arrayBuffer()));return e.then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){const e=fetch(t).then((t=>t.blob()));return e.then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}},t.BaseEnvContribution=dp([rp()],t.BaseEnvContribution);let d_=class extends t.BaseEnvContribution{type="browser";supportEvent=!0;constructor(){super();try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){if(e){const{clientX:i,clientY:n}=t,r=e.getBoundingClientRect(),s=e.getNativeHandler?.().nativeCanvas;let a,o;return s&&(a=r.width/s.offsetWidth,o=r.height/s.offsetHeight),{x:(i-r.left)/(Op(a)?a:1),y:(n-r.top)/(Op(o)?a:1)}}return{x:t.offsetX,y:t.offsetY}}loadImage(t){return u_(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return u_(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){const e=document.createElement("canvas");t.id&&(e.id=t.id??sm.GenAutoIncrementId().toString());const i=t.dpr??window.devicePixelRatio;return t.width&&t.height&&(e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,e.width=t.width*i,e.height=t.height*i),e}createOffscreenCanvas(t){const e=t.dpr??window.devicePixelRatio;return new OffscreenCanvas(t.width*e,t.height*e)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(...t){}};function p_(){fy.rebind(wA).toService(t.DefaultMathPickerService)}function f_(){fy.rebind(wA).toService(t.DefaultMathPickerService)}d_=dp([rp(),fp("design:paramtypes",[])],d_);let g_=class extends t.BaseEnvContribution{type="feishu";supportEvent=!0;canvasMap=new Map;freeCanvasList=[];canvasIdx=0;constructor(){super(),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r){const s=tt.getSystemInfoSync().pixelRatio;e.forEach(((e,a)=>{const o=tt.createCanvasContext(e);o.canvas={width:t.width*s,height:t.height*s};const h={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:e??"",getContext:()=>o,getBoundingClientRect:()=>({height:t.height,width:t.width})};i.set(e,h),a>=n&&r.push(h)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),p_())}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return tt.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return $m.call(t)}}getCancelAnimationFrame(){return t=>{$m.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(...t){}mapToCanvasPoint(t){return t?.type?.startsWith("mouse")?t:null}};g_=dp([rp(),fp("design:paramtypes",[])],g_);let y_=class extends t.BaseEnvContribution{type="taro";supportEvent=!0;canvasMap=new Map;freeCanvasList=[];canvasIdx=0;taro;pixelRatio;constructor(){super(),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}configure(t,e){var i,n,r,s,a,o,h;t.env===this.type&&(t.setActiveEnvContribution(this),i=e.domref,n=e.canvasIdLists,r=this.canvasMap,s=e.freeCanvasIdx,a=this.freeCanvasList,o=e.taro,h=e.pixelRatio,n.forEach(((t,e)=>{const n=o.createCanvasContext(t);n.canvas={width:i.width*h,height:i.height*h},n.createRadialGradient||(n.createRadialGradient=(...t)=>n.createCircularGradient(...t)),!n.getImageData&&o.canvasGetImageData&&(n.getImageData=(e,i,n,r)=>new Promise(((s,a)=>{try{o.canvasGetImageData({canvasId:t,x:e,y:i,width:n,height:r,success(t){s(t)}})}catch(t){a(t)}})));const c={id:t,width:i.width*h,height:i.height*h,offsetWidth:i.width,offsetHeight:i.height,getContext:()=>n,getBoundingClientRect:()=>({height:i.height,width:i.width})};return r.set(t,c),e>=s&&a.push(c),c})),this.taro=e.taro,this.pixelRatio=e.pixelRatio,f_())}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){const e=window||globalThis;if(e.DOMParser){const i=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],n=(new XMLSerializer).serializeToString(i),r=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`;return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){const i=new e.Blob([t],{type:"image/svg+xml"}),n=e.URL.createObjectURL(i);return Promise.resolve({data:n,loadState:"success"})}return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return this.pixelRatio}getRequestAnimationFrame(){return requestAnimationFrame}getCancelAnimationFrame(){return cancelAnimationFrame}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(...t){}};y_=dp([rp(),fp("design:paramtypes",[])],y_);let m_=!1;try{m_=!!lynx.createCanvasNG}catch(t){}let v_=class extends t.BaseEnvContribution{type="lynx";supportEvent=!0;canvasMap=new Map;freeCanvasList=[];canvasIdx=0;constructor(){super(),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r){const s=SystemInfo.pixelRatio;e.forEach(((e,a)=>{const o=m_?lynx.createCanvasNG(e):lynx.createCanvas(e);o.width=t.width*s,o.height=t.height*s,m_&&o.attachToCanvasView(e);const h=o.getContext("2d");h.draw=(t,e)=>{e()};const c={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:e??"",getContext:()=>h,getBoundingClientRect:()=>({height:t.height,width:t.width})};i.set(e,c),a>=n&&r.push(c)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),p_())}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}loadImage(t){const e=function(t,e=!1){if(e)return Promise.reject();const i=lynx.createImage(t),n=new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}));return n}(t,!1);return e.then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return SystemInfo.pixelRatio}getRequestAnimationFrame(){return function(t){return $m.call(t)}}getCancelAnimationFrame(){return t=>{$m.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(...t){}};v_=dp([rp(),fp("design:paramtypes",[])],v_);let b_=class extends t.BaseEnvContribution{type="node";pkg;_lastTime=0;supportEvent=!1;configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 1}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){const e=fetch(t).then((t=>t.arrayBuffer()));return e.then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return $m.call(t)}}getCancelAnimationFrame(){return t=>{$m.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(...t){}createOffscreenCanvas(t){}};b_=dp([rp()],b_);let x_=class extends t.BaseEnvContribution{type="wx";supportEvent=!0;canvasMap=new Map;freeCanvasList=[];canvasIdx=0;constructor(){super(),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),async function(t,e,i,n,r){const s=wx.getSystemInfoSync().pixelRatio;for(let t=0;t<e.length;t++){const a=e[t];await new Promise((e=>{wx.createSelectorQuery().select(`#${a}`).fields({node:!0,size:!0}).exec((o=>{const h=o[0].node,c=o[0].width,l=o[0].height;h.width=c*s,h.height=l*s,i.set(a,h),t>=n&&r.push(h),e(null)}))}))}}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList).then((()=>{p_()}))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return wx.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return $m.call(t)}}getCancelAnimationFrame(){return t=>{$m.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(...t){}mapToCanvasPoint(t){return t?.type?.startsWith("mouse")?t:null}};x_=dp([rp(),fp("design:paramtypes",[])],x_);var w_=new Qd((t=>{t(d_).toSelf().inSingletonScope(),t(xp).toService(d_),t(g_).toSelf().inSingletonScope(),t(xp).toService(g_),t(y_).toSelf().inSingletonScope(),t(xp).toService(y_),t(v_).toSelf().inSingletonScope(),t(xp).toService(v_),t(x_).toSelf().inSingletonScope(),t(xp).toService(x_),t(b_).toSelf().inSingletonScope(),t(xp).toService(b_),mp(t,xp)}));t.BaseWindowHandlerContribution=class{constructor(){this._uid=sm.GenAutoIncrementId()}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}},t.BaseWindowHandlerContribution=dp([rp(),fp("design:paramtypes",[])],t.BaseWindowHandlerContribution);let S_=class extends t.BaseWindowHandlerContribution{global;static env="browser";type="browser";canvas;observer;get container(){return this.canvas.nativeCanvas.parentElement}constructor(t){super(),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(e){const i=this.global.createCanvas({width:e.width,height:e.height});let n;if(n="string"==typeof e.container?this.global.getElementById(e.container):e.container?e.container:this.global.getRootElement(),!n)throw new Error("发生错误,containerId可能传入有误");e.offscreen?n=null:n.appendChild(i);const r={width:e.width,height:e.height,dpr:e.dpr,nativeCanvas:i,container:n,id:sm.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new t.BrowserCanvas(r)}createWindowByCanvas(e){let i;if("string"==typeof e.canvas){if(i=this.global.getElementById(e.canvas),!i)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=e.canvas;if(!i)throw new Error("发生错误,传入的canvas不正确");let n=e.width,r=e.height;if(null==n||null==r||!e.canvasControled){const t=i.getBoundingClientRect();n=t.width,r=t.height}let s=e.dpr;if(!1===e.canvasControled&&(s&&console.warn("canvasControled为false后,dpr参数将无效"),s=null),null==s){s=i.getContext("2d").pixelRatio??i.width/n}this.canvas=new t.BrowserCanvas({width:n,height:r,dpr:s,nativeCanvas:i,canvasControled:e.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){return this.canvas.nativeCanvas.style}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};S_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],S_);let A_=class extends t.BrowserContext2d{static env="feishu";_globalAlpha;get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}getImageData(t,e,i,n){return new Promise(((r,s)=>{try{tt.canvasGetImageData({canvasId:this.canvas.nativeCanvas.id??this.canvas.id,x:t,y:e,width:i,height:n,success(t){r(t)}})}catch(t){s(t)}}))}draw(){const t=this.nativeContext;this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))}))}createPattern(t,e){return null}};A_=dp([rp()],A_);const __={WIDTH:500,HEIGHT:500,DPR:1};let C_=class{static env="feishu";_displayWidth;_displayHeight;_id;_pixelWidth;_pixelHeight;_x;_y;_dpr;_container;_nativeCanvas;_context;_visiable;get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t}constructor(t){const{nativeCanvas:e,width:i=__.WIDTH,height:n=__.HEIGHT,dpr:r=__.DPR}=t,{x:s,y:a}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=a,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new A_(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};C_=dp([rp(),fp("design:paramtypes",[Object])],C_);let T_=class extends t.BaseWindowHandlerContribution{global;static env="feishu";type="feishu";eventManager=new class{addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}cache={}};canvas;get container(){return null}constructor(t){super(),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:sm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new C_(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new C_({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};T_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],T_);let B_=class extends t.BrowserContext2d{static env="taro";get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}draw(){this.nativeContext.draw()}strokeText(t,e,i){}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:a=r.fillOpacity,opacity:o=r.opacity,fill:h=r.fill}=e;a>1e-12&&o>1e-12&&(s.setGlobalAlpha(a*o),s.setFillStyle(hA(this,h,t,i,n)))}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(a>1e-12&&o>1e-12){const{lineWidth:h=r.lineWidth,stroke:c=r.stroke,lineJoin:l=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.setGlobalAlpha(a*o),s.setLineWidth(oA(this,h,this.dpr)),s.setStrokeStyle(hA(this,c,t,i,n)),s.setLineJoin(l),s.setLineDash(u),s.setLineCap(d),s.setMiterLimit(p)}}setTextStyleWithoutAlignBaseline(t,e){const i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=hx(t,e),i.setFontSize(t.fontSize??e.fontSize)}setTextStyle(t,e){const i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=hx(t,e),i.setTextAlign(t.textAlign??e.textAlign),i.setTextBaseline(t.textBaseline??e.textBaseline)}createConicGradient(t,e,i,n){return null}createPattern(t,e){return null}};B_=dp([rp()],B_);const P_={WIDTH:500,HEIGHT:500,DPR:1};let E_=class{static env="taro";_displayWidth;_displayHeight;_id;_pixelWidth;_pixelHeight;_x;_y;_dpr;_nativeCanvas;_context;_visiable;get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t}constructor(t){const{nativeCanvas:e,width:i=P_.WIDTH,height:n=P_.HEIGHT,dpr:r=P_.DPR}=t,{x:s,y:a}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=a,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new B_(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};E_=dp([rp(),fp("design:paramtypes",[Object])],E_);let M_=class extends t.BaseWindowHandlerContribution{global;static env="taro";type="taro";eventManager=new class{addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}cache={}};canvas;get container(){return null}constructor(t){super(),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:sm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new E_(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new E_({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches.length>0&&(t.changedTouches.forEach(((e,i)=>{t.changedTouches[i]={...t.changedTouches[i],offsetX:e.x,offsetY:e.y}})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach(((e,i)=>{t.touches[i]={...t.touches[i],offsetX:e.x,offsetY:e.y}})),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};M_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],M_);let R_=class extends t.BrowserContext2d{static env="lynx";get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;i.setLineDash(t)}}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(a>1e-12&&o>1e-12){const{lineWidth:h=r.lineWidth,stroke:c=r.stroke,lineJoin:l=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=a*o,s.lineWidth=oA(this,h,this.dpr),s.strokeStyle=hA(this,c,t,i,n),s.lineJoin=l,0===u[0]&&0===u[1]||s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}createPattern(t,e){return null}draw(){const t=this.nativeContext;this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))}))}};R_=dp([rp()],R_);const k_={WIDTH:500,HEIGHT:500,DPR:1};let D_=class{static env="lynx";_displayWidth;_displayHeight;_id;_pixelWidth;_pixelHeight;_x;_y;_dpr;_container;_nativeCanvas;_context;_visiable;get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t}constructor(t){const{nativeCanvas:e,width:i=k_.WIDTH,height:n=k_.HEIGHT,dpr:r=k_.DPR}=t,{x:s,y:a}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=a,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new R_(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};D_=dp([rp(),fp("design:paramtypes",[Object])],D_);let I_=class extends t.BaseWindowHandlerContribution{global;static env="lynx";type="lynx";eventManager=new class{addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}cache={}};canvas;get container(){return null}constructor(t){super(),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:sm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new D_(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new D_({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};I_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],I_),new _f(1,0,0,1,0,0);let O_=class extends t.BrowserContext2d{static env="node";constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new _f(1,0,0,1,0,0),this.stack=[],this.dpr=e??1}release(...t){}};O_=dp([rp(),fp("design:paramtypes",[Object,Number])],O_);const L_={WIDTH:500,HEIGHT:500,DPR:1};let U_=class{static env="node";_id;_displayWidth;_displayHeight;_pixelWidth;_pixelHeight;_nativeCanvas;_context;_visiable;controled;_dpr;get id(){return this._id}get x(){return 0}set x(t){}get y(){return 0}set y(t){}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this.width,this.height)}constructor(t){const{nativeCanvas:e,width:i=L_.WIDTH,height:n=L_.HEIGHT,canvasControled:r=!0,dpr:s=L_.DPR}=t;this._visiable=!1!==t.visiable,this.controled=r,this._pixelWidth=i*s,this._pixelHeight=n*s,this._displayWidth=i,this._displayHeight=n,this._nativeCanvas=e,this._context=new O_(this,t.dpr),this._id=e.id,this._dpr=s}applyPosition(){}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}hide(){}show(){}resize(t,e){this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas&&(this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight)}toDataURL(t,e){return""}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this._nativeCanvas.release&&Bp(this._nativeCanvas.release)&&this._nativeCanvas.release()}};U_=dp([rp(),fp("design:paramtypes",[Object])],U_);let W_=class extends t.BaseWindowHandlerContribution{global;static env="node";type="node";canvas;get container(){return null}constructor(t){super(),this.global=t}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:sm.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new U_(i)}createWindowByCanvas(t){const e=t.canvas;let i=t.width,n=t.height;null!=i&&null!=n&&t.canvasControled||(i=e.width,n=e.height),this.canvas=new U_({width:i,height:n,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(t="image/png"){return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t,e){}};W_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],W_);let F_=class extends t.BrowserContext2d{static env="wx";draw(){}createPattern(t,e){return null}};F_=dp([rp()],F_);const N_={WIDTH:500,HEIGHT:500,DPR:1};let z_=class{static env="wx";_displayWidth;_displayHeight;_id;_pixelWidth;_pixelHeight;_x;_y;_dpr;_container;_nativeCanvas;_context;_visiable;get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t}constructor(t){const{nativeCanvas:e,width:i=N_.WIDTH,height:n=N_.HEIGHT,dpr:r=N_.DPR}=t,{x:s,y:a}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=a,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new F_(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};z_=dp([rp(),fp("design:paramtypes",[Object])],z_);class j_{addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}cache={}}let H_=class extends t.BaseWindowHandlerContribution{global;static env="wx";type="wx";eventManager=new j_;canvas;get container(){return null}constructor(t){super(),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:sm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new z_(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new z_({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x??t.changedTouches[0].pageX,t.changedTouches[0].clientX=t.changedTouches[0].x??t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y??t.changedTouches[0].pageY,t.changedTouches[0].clientY=t.changedTouches[0].y??t.changedTouches[0].pageY),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};H_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],H_);var G_=new Qd((t=>{t(S_).toSelf(),t(Eb).toDynamicValue((t=>t.container.get(S_))).whenTargetNamed(S_.env),t(T_).toSelf(),t(Eb).toDynamicValue((t=>t.container.get(T_))).whenTargetNamed(T_.env),t(M_).toSelf(),t(Eb).toDynamicValue((t=>t.container.get(M_))).whenTargetNamed(M_.env),t(I_).toSelf(),t(Eb).toDynamicValue((t=>t.container.get(I_))).whenTargetNamed(I_.env),t(H_).toSelf(),t(Eb).toDynamicValue((t=>t.container.get(H_))).whenTargetNamed(H_.env),t(W_).toSelf(),t(Eb).toDynamicValue((t=>t.container.get(W_))).whenTargetNamed(W_.env)})),V_=new Qd((t=>{t(py).toSelf().inSingletonScope(),t(dy).toService(py),mp(t,dy)}));let X_=class{global;layer;canvas;context;offscreen;main;window;constructor(t){this.global=t,this.offscreen=!1}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,t=i.canvasId?this.global.getElementById(i.canvasId):this.global.createCanvas({width:e.width,height:e.height}),t.style&&(t.style["pointer-events"]="none");const n=e.getContext().getCanvas().nativeCanvas,r=vy({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,canvasControled:!0,container:e.getContainer(),x:n.offsetLeft,y:n.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,{context:this.context,clear:e.background??"#ffffff",...e,...i})}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){const n=t.getContext();i.renderService.render(e,{context:n,...i,clear:i.clear?i.background??"#fff":void 0})}getContext(){return this.context}release(){this.canvas.release()}};X_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],X_);let Y_=class{global;layer;canvas;context;offscreen;constructor(t){this.global=t,this.offscreen=!0}init(t,e,i){this.layer=t;const n=vy({nativeCanvas:this.global.createOffscreenCanvas({width:i.width,height:i.height,dpr:e.dpr}),width:i.width,height:i.height,dpr:e.dpr,canvasControled:!0});this.canvas=n,this.context=n.getContext()}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){this.canvas.resize(t,e)}render(t,e){e.renderService.render(t,{context:this.context,...e,x:0,y:0,clear:e.background??"#ffffff"})}prepare(t,e){}release(){this.canvas.release()}getContext(){return this.context}drawTo(t,e,i){const n=t.getContext(),r=t.dpr,{x:s=0,y:a=0,width:o=this.layer.viewWidth,height:h=this.layer.viewHeight}=i;n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(s,a,o,h),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,a,o,h),n.nativeContext.restore()}merge(t){}};Y_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],Y_);var q_=new Qd((t=>{t(X_).toSelf(),t(Y_).toSelf(),t(Tb).toService(X_)}));const K_=Symbol.for("DrawItemInterceptor"),$_=new df;let Z_=class{order=1;afterDrawItem(t,e,i,n,r){if(!t.shadowRoot)return!1;const{context:s}=i;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){$_.copy(n.dirtyBounds);const e=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(e)}return n.renderGroup(t.shadowRoot,i),s.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&n.dirtyBounds.copy($_),!0}};Z_=dp([rp()],Z_);let J_=class{order=1;beforeDrawItem(t,e,i,n,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:s,stage:a}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=a.camera;const o=s.currentMatrix;o.a/=s.dpr,o.b/=s.dpr,o.c/=s.dpr,o.d/=s.dpr,o.e/=s.dpr,o.f/=s.dpr;const h=Jw.allocate();iS(h,o);const c=s.modelMatrix;if(c){if(h){const t=Jw.allocate();s.modelMatrix=nS(t,c,h)}}else s.modelMatrix=h;if(s.setTransform(1,0,0,1,0,0,!0),t.isContainer){let e=!1,r=!1;if(t.forEachChildren((t=>(e=t.numberType===ob,!e))),t.forEachChildren((t=>(r=!!t.findFace,!r))),e){const e=t.getChildren(),r=[...e];r.sort(((t,e)=>{let i=((t.attribute.startAngle??0)+(t.attribute.endAngle??0))/2,n=((e.attribute.startAngle??0)+(e.attribute.endAngle??0))/2;for(;i<0;)i+=qp;for(;n<0;)n+=qp;return n-i})),r.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),r.forEach((e=>{t.appendChild(e)})),i.hack_pieFace="outside",n.renderGroup(t,i),i.hack_pieFace="inside",n.renderGroup(t,i),i.hack_pieFace="top",n.renderGroup(t,i),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),e.forEach((e=>{t.appendChild(e)}))}else if(r){const e=t.getChildren(),r=e.map((t=>({ave_z:t.findFace().vertices.map((e=>s.view(e[0],e[1],e[2]+t.attribute.z??0)[2])).reduce(((t,e)=>t+e),0),g:t})));r.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),r.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),r.forEach((e=>{t.add(e.g)})),n.renderGroup(t,i,!0),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),t.update(),e.forEach((e=>{t.add(e)}))}else n.renderGroup(t,i)}else n.renderItem(t,i);return s.camera=null,s.restore(),s.modelMatrix!==c&&Jw.free(s.modelMatrix),s.modelMatrix=c,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}};J_=dp([rp()],J_);let Q_=class{contributions;renderSelector;layerService;drawItemInterceptorContributions;constructor(t,e,i,n){this.contributions=t,this.renderSelector=e,this.layerService=i,this.drawItemInterceptorContributions=n,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new uf,this.backupDirtyBounds=new uf}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}draw(t,e){e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:n,x:r=0,y:s=0,width:a,height:o}=e;if(!i)return;const h=this.dirtyBounds.setValue(0,0,a,o);if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=(c=h,l=n.dirtyBounds,u=!1,null===c?l:null===l?c:(gf=c.x1,yf=c.x2,mf=c.y1,vf=c.y2,bf=l.x1,xf=l.x2,wf=l.y1,Sf=l.y2,u&&(gf>yf&&(gf=(d=[yf,gf])[0],yf=d[1]),mf>vf&&(mf=(p=[vf,mf])[0],vf=p[1]),bf>xf&&(bf=(f=[xf,bf])[0],xf=f[1]),wf>Sf&&(wf=(g=[Sf,wf])[0],Sf=g[1])),gf>=xf||yf<=bf||mf>=Sf||vf<=wf?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(gf,bf),y1:Math.max(mf,wf),x2:Math.min(yf,xf),y2:Math.min(vf,Sf)}));h.x1=Math.floor(t.x1),h.y1=Math.floor(t.y1),h.x2=Math.ceil(t.x2),h.y2=Math.ceil(t.y2)}var c,l,u,d,p,f,g;this.backupDirtyBounds.copy(h),i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0);const y=h.width()*i.dpr!==i.canvas.width||h.height()*i.dpr!==i.canvas.height;i.save(),i.translate(r,s,!0),y&&(i.beginPath(),i.rect(h.x1,h.y1,h.width(),h.height()),i.clip()),n.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>(t.attribute.zIndex??Kg.zIndex)-(e.attribute.zIndex??Kg.zIndex))).forEach((t=>{this.renderGroup(t,e)})),i.restore(),i.restore(),i.draw(),i.inuse=!1}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=mA(e,i,Kg.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(!Bf(t.AABBBounds,this.dirtyBounds,!1))return;const n=this.dirtyBounds.clone(),r=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r),this.renderItem(t,e,{drawingCb:()=>{i?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))})):gA(t,Kg.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))}),!1,!!e.context?.camera)}}),this.dirtyBounds.copy(n)}_increaseRender(t,e){const{layer:i,stage:n}=e,{subLayers:r}=i;let s=r.get(t._uid);s||(s={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,s));const a=s.layer.getNativeHandler().getContext(),o=s.drawContribution||fy.get(zS);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,{...e,drawContribution:o,clear:"transparent",layer:s.layer,context:a,startAtId:t._uid,break:!1}),s.drawContribution=o;const h=this._findNextGraphic(t);if(h)if(h.isContainer&&h.incremental)this._increaseRender(h,e);else{let t=r.get(h._uid);t||(t={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(h._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,{...e,drawContribution:o,clear:"transparent",layer:t.layer,context:i,startAtId:h._uid,break:!1})}}getRenderContribution(t){let e=this.renderSelector.selector(t);return e||(e=this.selectRenderByNumberType(t.numberType)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,i))return}const n=this.getRenderContribution(t);if(!n)return;if(!t.isContainer&&!Bf(t.AABBBounds,this.dirtyBounds,!1))return;const r=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=r),r?t.isContainer&&n.draw(t,this.currentRenderService,e,i):n.draw(t,this.currentRenderService,e,i),this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const n=this.InterceptorContributions[i];if(n.afterDrawItem&&n.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return console.warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t){return this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){const{clear:n}=i;if(n){const t=e.getCanvas(),{width:r=t.width,height:s=t.height}=i,a=0,o=0;e.clearRect(a,o,r,s),e.fillStyle=hA(e,n,{AABBBounds:{x1:a,y1:o,x2:a+r,y2:o+s}},0,0),e.fillRect(a,o,r,s)}}};dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],Q_.prototype,"init",null),Q_=dp([rp(),pp(0,hp(XS)),pp(1,op(sA)),pp(2,op(kb)),pp(3,op(gp)),pp(3,sp(K_)),fp("design:paramtypes",[Array,Object,Object,Object])],Q_);let tC=class{selector(t){return null}};tC=dp([rp()],tC);let eC=class{groupRenderContribitions;type;numberType=ub;_groupRenderContribitions;constructor(t){this.groupRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).group,{fill:l=c.fill,background:u,stroke:d=c.stroke,opacity:p=c.opacity,width:f=c.width,height:g=c.height,clip:y=c.clip,fillOpacity:m=c.fillOpacity,strokeOpacity:v=c.strokeOpacity,cornerRadius:b=c.cornerRadius,path:x=c.path,lineWidth:w=c.lineWidth,visible:S=c.visible}=e.attribute,A=Ub(p,m,f,g,l),_=Fb(p,v,f,g),C=Ib(l,u),T=Ob(d,w);if(!e.valid||!S)return;if(!y){if(!C&&!T)return;if(!(A||_||o||h||u))return}if(x&&x.length&&s.drawContribution){const t=i.disableFill,e=i.disableStroke,n=i.disableBeginPath;i.disableFill=!0,i.disableStroke=!0,i.disableBeginPath=!0,x.forEach((t=>{s.drawContribution.getRenderContribution(t).draw(t,s.renderService,s,a)})),i.disableFill=t,i.disableStroke=e,i.disableBeginPath=n}else 0===b||Dp(b)&&b.every((t=>0===t))?(i.beginPath(),i.rect(n,r,f,g)):(i.beginPath(),LS(i,n,r,f,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[]);const B={doFill:C,doStroke:T};this._groupRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h,B)})),y&&i.clip(),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),B.doFill&&(o?o(i,e.attribute,c):A&&(i.setCommonStyle(e,e.attribute,n,r,c),i.fill())),B.doStroke&&(h?h(i,e.attribute,c):_&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke())),this._groupRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s}=t.attribute;s?r.save():r.highPerformanceSave();const a=nm(t,n?.theme).group,o=r.modelMatrix;if(r.camera){const e=Jw.allocate(),i=Jw.allocate();rS(i,t,a),nS(e,o||e,i),r.modelMatrix=e,Jw.free(i),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),n.skipDraw?this.drawShape(t,r,0,0,i,n,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,i);const{scrollX:h=a.scrollX,scrollY:c=a.scrollY}=t.attribute;let l;(h||c)&&r.translate(h,c),n&&n.drawingCb&&(l=n.drawingCb()),r.modelMatrix!==o&&Jw.free(r.modelMatrix),r.modelMatrix=o,l&&l.then?l.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}};eC=dp([rp(),pp(0,op(gp)),pp(0,sp(Jb)),fp("design:paramtypes",[Object])],eC);let iC=class extends t.DefaultCanvasLineRender{numberType=pb;drawShape(t,e,i,n,r,s,a,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(e>h.length)return;const c=nm(t).line,{fill:l=c.fill,stroke:u=c.stroke,opacity:d=c.opacity,fillOpacity:p=c.fillOpacity,strokeOpacity:f=c.strokeOpacity,lineWidth:g=c.lineWidth,visible:y=c.visible}=t.attribute,m=Lb(d,p,l),v=Wb(d,f),b=Ib(l),x=Ob(u,g);if(!t.valid||!y)return;if(!b&&!x)return;if(!(m||v||a||o))return;const{context:w}=r;for(let r=e;r<e+s;r++)this.drawIncreaseSegment(t,w,h[r-1],h[r],t.attribute.segments[r],[c,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,a,o)}drawIncreaseSegment(t,e,i,n,r,s,a,o){n&&(e.beginPath(),PS(e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setStrokeStyle(t,r,a,o,s),e.stroke())}};iC=dp([rp()],iC);let nC=class extends t.DefaultCanvasAreaRender{numberType=hb;drawShape(t,e,i,n,r,s,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:o}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(s>h.length)return;const c=nm(t).area,{fill:l=c.fill,fillOpacity:u=c.fillOpacity,opacity:d=c.opacity,visible:p=c.visible}=t.attribute,f=Lb(d,u,l),g=Ib(l);if(!t.valid||!p)return;if(!g)return;if(!f&&!a)return;for(let r=s;r<s+o;r++)this.drawIncreaseSegment(t,e,h[r-1],h[r],t.attribute.segments[r],[c,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,a)}drawIncreaseSegment(t,e,i,n,r,s,a,o){n&&(e.beginPath(),ES(e.camera?e:e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setCommonStyle(t,r,a,o,s),e.fill())}};var rC;nC=dp([rp()],nC),function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(rC||(rC={}));let sC=class extends Q_{contributions;renderSelector;lineRender;areaRender;layerService;drawItemInterceptorContributions;rendering=!1;currFrameStartAt=0;currentIdx=0;status=rC.NORMAL;checkingForDrawPromise=null;hooks={completeDraw:new bp([])};lastRenderService;lastDrawContext;count;global;constructor(t,e,i,n,r,s){super(t,e,r,s),this.contributions=t,this.renderSelector=e,this.lineRender=i,this.areaRender=n,this.layerService=r,this.drawItemInterceptorContributions=s}init(){super.init(),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}async draw(t,e){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=await this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:n,x:r=0,y:s=0}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(r,s,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>(t.attribute.zIndex??Kg.zIndex)-(e.attribute.zIndex??Kg.zIndex))).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{n.restore(),n.restore(),n.draw(),n.inuse=!1,this.rendering=!1})))}async _increaseRender(t,e){this.rendering=!0,await this._renderIncrementalGroup(t,e)}async _renderIncrementalGroup(t,e){this.count=t.count,await new Promise((i=>{this.renderItem(t,e,{drawingCb:async()=>{if(2!==t.count)await yA(t,Kg.zIndex,((i,n)=>{if(this.status===rC.STOP)return!0;if(i.isContainer)return!1;if(n<this.currentIdx)return!1;const r=this.currFrameStartAt+t.incremental;return n<r&&(this.currentIdx=n+1,this.renderItem(i,e)),n===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),i(!1);else{const n=t.getChildAt(0);if(n.incremental&&n.attribute.segments)for(n.incrementalAt||(n.incrementalAt=0);n.incrementalAt<n.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:n.incrementalAt,length:n.incremental},this.renderItem(n,e),n.incrementalAt+=n.incremental,await this.waitToNextFrame();else this.renderItem(n,e);i(!1)}}})})),this.hooks.completeDraw.call()}async waitToNextFrame(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}async checkForDraw(t){let e=this.rendering;return t.restartIncremental&&(e=!1,await this.forceStop(),this.resetToInit()),e}async forceStop(){this.rendering&&(this.status=rC.STOP,await new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=rC.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}async renderGroup(t,e){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(await this._increaseRender(t,e),void(e.break=!0)):void await new Promise((i=>{this.renderItem(t,e,{drawingCb:async()=>{await yA(t,Kg.zIndex,(async t=>{e.break||t.isContainer&&await this.renderGroup(t,e)})),i(!1)}})}))}};dp([op(wp),fp("design:type",Object)],sC.prototype,"global",void 0),sC=dp([rp(),pp(0,hp(XS)),pp(1,op(sA)),pp(2,op(iC)),pp(3,op(nC)),pp(4,op(kb)),pp(5,op(gp)),pp(5,sp(K_)),fp("design:paramtypes",[Array,Object,Object,Object,Object,Object])],sC);let aC=class extends t.BaseRender{type="rect3d";numberType=vb;drawShape(t,e,i,n,r,s,a,o){const h=nm(t,s?.theme).rect3d,{fill:c=h.fill,stroke:l=h.stroke,width:u=h.width,height:d=h.height,opacity:p=h.opacity,fillOpacity:f=h.fillOpacity,lineWidth:g=h.lineWidth,strokeOpacity:y=h.strokeOpacity,visible:m=h.visible}=t.attribute,v=this.z??0,b=Ub(p,f,u,d,c),x=Fb(p,y,u,d),w=Ib(c),S=Ob(l,g);if(!t.valid||!m)return;if(!w&&!S)return;if(!(b||x||a||o))return;const{light:A,camera:_}=r.stage||{},C=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,v,C,r,e,A,a)}!1!==l&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,v,C,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const a=s[n[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},h=s[n[1]],c={x:t+h[0],y:e+h[1],z:i+h[2]};r.beginPath(),r.moveTo(o.x,o.y,o.z),r.lineTo(c.x,c.y,c.z),r.stroke()}))}fill(t,e,i,n,r,s,a,o){const h=Ev.get(r).value,c=n.vertices,l=c.map((t=>s.view(t[0],t[1],t[2])[2])),u=[];n.polygons.forEach(((t,e)=>{u.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=l[i[0]],s=l[i[1]],a=l[i[2]],o=l[i[3]];t.ave_z=r+s+a+o})),u.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),u.forEach((n=>{const{polygon:l,normal:u}=n.polygon,d=c[l[0]],p=c[l[1]],f=c[l[2]],g=c[l[3]],y={x:t+d[0],y:e+d[1],z:i+d[2]},m={x:t+p[0],y:e+p[1],z:i+p[2]},v={x:t+f[0],y:e+f[1],z:i+f[2]},b={x:t+g[0],y:e+g[1],z:i+g[2]};s.beginPath(),s.moveTo(y.x,y.y,y.z),s.lineTo(m.x,m.y,m.z),s.lineTo(v.x,v.y,v.z),s.lineTo(b.x,b.y,b.z),s.closePath(),o?o(s,null,null):(s.fillStyle=a?a.computeColor(u,h):r,s.fill())}))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=nm(t).rect,s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;this.z=h,this.drawShape(t,n,a,o,i),this.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore()}};aC=dp([rp()],aC);let oC=class{type;numberType=bb;drawShape(t,e,i,n,r){const s=nm(t).richtext,{width:a=s.width,height:o=s.height,opacity:h=s.opacity,fillOpacity:c=s.fillOpacity,visible:l=s.visible}=t.attribute;if(!t.valid||!l)return;if(!Lb(h,c,!0))return;e.translate(i,n);t.getFrameCache().draw(e,this.drawIcon)}drawIcon(t,e,i,n,r){const s=nm(t).richtextIcon,{width:a=s.width,height:o=s.height,opacity:h=s.opacity,image:c,backgroundFill:l=s.backgroundFill,backgroundFillOpacity:u=s.backgroundFillOpacity,backgroundStroke:d=s.backgroundStroke,backgroundStrokeOpacity:p=s.backgroundStrokeOpacity,backgroundRadius:f=s.backgroundRadius,margin:g}=t.attribute,{backgroundWidth:y=a,backgroundHeight:m=o}=t.attribute;if(g&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(y-a)/2,r=(m-o)/2;0===f?(e.beginPath(),e.rect(i-t,n-r,y,m)):(e.beginPath(),LS(e,i-t,n-r,y,m,f)),l&&(e.globalAlpha=u,e.fillStyle=l,e.fill()),d&&(e.globalAlpha=p,e.strokeStyle=d,e.stroke())}const v=c&&t?.resources?.get(c);v&&"success"===v.state&&(e.globalAlpha=h,e.drawImage(v.data,i,n,a,o))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=nm(t).richtext;let{x:s=r.x,y:a=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,n,s,a,i),n.highPerformanceRestore()}};oC=dp([rp()],oC);let hC=class{type;numberType=lb;drawShape(t,e,i,n,r,s,a,o){r.drawContribution&&t.getSubGraphic().forEach((t=>{const h=r.drawContribution.getRenderContribution(t);h&&h.drawShape&&h.drawShape(t,e,i,n,r,s,a,o)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;if(r.highPerformanceSave(),!i.drawContribution)return;const s=nm(t),a=t.getSubGraphic();a.length&&a.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:s})})),r.highPerformanceRestore()}};hC=dp([rp()],hC);let cC=class extends t.BaseRender{type;numberType=ob;drawShape(t,e,i,n,r,s,a,o){const h=nm(t,s?.theme).arc,{fill:c=h.fill,background:l,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,lineWidth:f=h.lineWidth,strokeOpacity:g=h.strokeOpacity,visible:y=h.visible}=t.attribute,m=Lb(d,p,c),v=Wb(d,g),b=Ib(c,l),x=Ob(u,f),w=this.z??0;if(!t.valid||!y)return;if(!b&&!x)return;if(!(m||v||a||o||l))return;const{outerRadius:S=h.outerRadius,innerRadius:A=h.innerRadius,height:_=10}=t.attribute,C=Ev.get(c).value,{light:T}=r.stage||{},B=r.hack_pieFace,P={top:w,bottom:w+_},E={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===B||"top"===B?(e.beginPath(),function(t,e,i,n,r,s,a){const{startAngle:o,endAngle:h}=t.getParsedAngle(),c=Kp(h-o),l=h>o;let u=!1;if(s<a){const t=s;s=a,a=t}if(s<=Gp)e.moveTo(i,n,r);else if(c>=qp-Gp)e.moveTo(i+s*Zp(o),n+s*tf(o),r),e.arc(i,n,s,o,h,!l,r),a>Gp&&(e.moveTo(i+a*Zp(h),n+a*tf(h),r),e.arc(i,n,a,h,o,l,r));else{const{outerDeltaAngle:c,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:f,innerEndAngle:g,innerStartAngle:y}=t.getParsePadAngle(o,h),m=s*Zp(p),v=s*tf(p),b=a*Zp(g),x=a*tf(g);c<.001?u=!0:(e.moveTo(i+m,n+v,r),e.arc(i,n,s,p,f,!l,r)),!(a>Gp)||d<.001?(e.lineTo(i+b,n+x,r),u=!0):(e.lineTo(i+b,n+x,r),e.arc(i,n,a,g,y,l,r))}e.closePath()}(t,e,i,n,P[B],S,A),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),b&&(a?a(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=T?T.computeColor(E[B],C):c,e.fill())),x&&(o?o(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke()))):"outside"!==B&&"inside"!==B||("inside"===B&&(e.save(),e.beginPath(),e.arc(i,n,A,0,qp,!0,P.top),e.clip()),e.beginPath(),function(t,e,i,n,r,s,a,o){const{startAngle:h,endAngle:c}=t.getParsedAngle(),l=Kp(c-h),u=c>h;let d=!1;if(a<=Gp)e.moveTo(i,n,r);else if(l>=qp-Gp)e.moveTo(i+a*Zp(h),n+a*tf(h),r),e.arc(i,n,a,h,c,!u,r),e.lineTo(i+a*Zp(c),n+a*tf(c),s),e.arc(i,n,a,c,h,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:l,innerouterEndAngle:p}=o(h,c),f=a*Zp(l),g=a*tf(l),y=a*Zp(p),m=a*tf(p);t<.001?d=!0:(e.moveTo(i+f,n+g,r),e.arc(i,n,a,l,p,!u,r),e.lineTo(i+y,n+m,s),e.arc(i,n,a,p,l,u,s))}e.closePath()}(t,e,i,n,P.top,P.bottom,"outside"===B?S:A,((e,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:a,innerEndAngle:o,innerStartAngle:h}=t.getParsePadAngle(e,i);return"outside"===B?{innerouterDeltaAngle:n,innerouterEndAngle:a,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:o,innerouterStartAngle:h}})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),b&&(a?a(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=T?T.computeColor(E[B],C):c,e.fill())),x&&(o?o(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),"inside"===B&&e.restore())}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=nm(t,n?.theme).arc;r.save();const a=this.transform(t,s,r),{x:o,y:h,z:c,lastModelMatrix:l}=a;this.z=c,Nb(t,r,o,h,0,n)||(this.drawShape(t,r,o,h,i,n),this.z=0,r.modelMatrix!==l&&Jw.free(r.modelMatrix),r.modelMatrix=l),r.restore()}};cC=dp([rp()],cC);let lC=class extends t.BaseRender{type="pyramid3d";numberType=yb;drawShape(t,e,i,n,r,s,a,o){const h=nm(t,s?.theme).polygon,{fill:c=h.fill,stroke:l=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:g=h.visible,points:y,face:m=[!0,!0,!0,!0,!0,!0]}=t.attribute,v=this.z??0,b=Lb(u,d,c),x=Wb(u,f),w=Ib(c),S=Ob(l,p);if(!t.valid||!g||4!==y.length)return;if(!w&&!S)return;if(!(b||x||a||o))return;const{light:A,camera:_}=r.stage||{},C=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,v,C,m,r,e,A,_,t,h,a)}!1!==l&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,v,C,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const a=s[n[0]],o=s[n[1]],h={x:t+a[0],y:e+a[1],z:i+a[2]},c={x:t+o[0],y:e+o[1],z:i+o[2]};r.beginPath(),r.moveTo(h.x,h.y,h.z),r.lineTo(c.x,c.y,c.z),r.stroke()}))}fill(t,e,i,n,r,s,a,o,h,c,l,u){const d=Ev.get(s).value,p=n.vertices,f=p.map((t=>a.view(t[0],t[1],t[2])[2])),g=[];n.polygons.forEach(((t,e)=>{if(!r[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,s=f[i[0]],a=f[i[1]],o=f[i[2]],h=f[i[3]];t.ave_z=s+a+o+h})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((n=>{const{polygon:r,normal:h}=n.polygon,f=p[r[0]],g=p[r[1]],y=p[r[2]],m=p[r[3]],v={x:t+f[0],y:e+f[1],z:i+f[2]},b={x:t+g[0],y:e+g[1],z:i+g[2]},x={x:t+y[0],y:e+y[1],z:i+y[2]},w={x:t+m[0],y:e+m[1],z:i+m[2]};a.beginPath(),a.moveTo(v.x,v.y,v.z),a.lineTo(b.x,b.y,b.z),a.lineTo(x.x,x.y,x.z),a.lineTo(w.x,w.y,w.z),a.closePath(),u?u(a,c.attribute,l):(a.fillStyle=o?o.computeColor(h,d):s,a.fill())}))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=nm(t).polygon,s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;this.z=h,this.drawShape(t,n,a,o,i),this.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore()}};lC=dp([rp()],lC);let uC=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke};uC=dp([rp()],uC);let dC=class extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke};dC=dp([rp()],dC);let pC=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke};pC=dp([rp()],pC);let fC=class extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke};fC=dp([rp()],fC);let gC=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke};gC=dp([rp()],gC);let yC=class extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke;drawShape(t,e,i,n,r,s,a,o,h,c,l,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{attribute:p=t.attribute}=d||{},{texture:f=t.attribute.texture??qm(h,"texture"),textureColor:g=t.attribute.textureColor??qm(h,"textureColor"),textureSize:y=t.attribute.textureSize??qm(h,"textureSize"),texturePadding:m=t.attribute.texturePadding??qm(h,"texturePadding")}=p;if(!f)return;let v=this.textureMap.get(f);if(!v)switch(f){case"circle":v=this.createCirclePattern(y,m,g,e);break;case"diamond":v=this.createDiamondPattern(y,m,g,e);break;case"rect":v=this.createRectPattern(y,m,g,e);break;case"vertical-line":v=this.createVerticalLinePattern(y,m,g,e);break;case"horizontal-line":v=this.createHorizontalLinePattern(y,m,g,e);break;case"bias-lr":v=this.createBiasLRLinePattern(y,m,g,e);break;case"bias-rl":v=this.createBiasRLLinePattern(y,m,g,e);break;case"grid":v=this.createGridPattern(y,m,g,e)}v&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=v,e.fill(),e.highPerformanceRestore())}};yC=dp([rp()],yC);var mC=new Qd((e=>{e(Q_).toSelf(),e(aA).toService(Q_),e(sC).toSelf(),e(zS).toService(sC),e(tC).toSelf(),e(sA).toService(tC),e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(VS).to(t.DefaultCanvasCircleRender),e(XS).to(t.DefaultCanvasCircleRender),e(t.DefaultCircleRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleTextureRenderContribution).toSelf().inSingletonScope(),e(Zb).toService(t.DefaultCircleRenderContribution),e(Zb).toService(t.DefaultCircleBackgroundRenderContribution),e(Zb).toService(t.DefaultCircleTextureRenderContribution),mp(e,Zb),e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(ZS).to(t.DefaultCanvasRectRender),e(XS).to(t.DefaultCanvasRectRender),e(aC).toSelf().inSingletonScope(),e(JS).toService(aC),e(XS).toService(JS),e(t.DefaultRectRenderContribution).toSelf().inSingletonScope(),e(t.DefaultRectBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultRectTextureRenderContribution).toSelf().inSingletonScope(),e(t.SplitRectBeforeRenderContribution).toSelf().inSingletonScope(),e(t.SplitRectAfterRenderContribution).toSelf().inSingletonScope(),e(ix).toService(t.DefaultRectRenderContribution),e(ix).toService(t.DefaultRectBackgroundRenderContribution),e(ix).toService(t.DefaultRectTextureRenderContribution),e(ix).toService(t.SplitRectBeforeRenderContribution),e(ix).toService(t.SplitRectAfterRenderContribution),mp(e,ix),e(t.DefaultCanvasTextRender).toSelf().inSingletonScope(),e(tA).to(t.DefaultCanvasTextRender),e(XS).to(t.DefaultCanvasTextRender),mp(e,rx),e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(KS).to(t.DefaultCanvasPathRender),e(XS).to(t.DefaultCanvasPathRender),e(pC).toSelf().inSingletonScope(),e(fC).toSelf().inSingletonScope(),e(tx).toService(pC),e(tx).toService(fC),mp(e,tx),e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(QS).to(t.DefaultCanvasSymbolRender),e(XS).to(t.DefaultCanvasSymbolRender),e(t.DefaultSymbolRenderContribution).toSelf().inSingletonScope(),e(lA).toSelf().inSingletonScope(),e(uA).toSelf().inSingletonScope(),e(nx).toService(t.DefaultSymbolRenderContribution),e(nx).toService(lA),e(nx).toService(uA),mp(e,nx),e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(jS).to(t.DefaultCanvasArcRender),e(XS).to(t.DefaultCanvasArcRender),e(cC).toSelf().inSingletonScope(),e(HS).toService(cC),e(XS).toService(HS),e(t.DefaultArcRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcTextureRenderContribution).toSelf().inSingletonScope(),e(Kb).toService(t.DefaultArcRenderContribution),e(Kb).toService(t.DefaultArcBackgroundRenderContribution),e(Kb).toService(t.DefaultArcTextureRenderContribution),mp(e,Kb),e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(qS).to(t.DefaultCanvasLineRender),e(XS).to(t.DefaultCanvasLineRender),e(iC).toSelf().inSingletonScope(),e(nC).toSelf().inSingletonScope(),e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(GS).to(t.DefaultCanvasAreaRender),e(XS).to(t.DefaultCanvasAreaRender),e(gC).toSelf().inSingletonScope(),e(yC).toSelf().inSingletonScope(),e($b).toService(gC),e($b).toService(yC),mp(e,$b),e(eC).toSelf().inSingletonScope(),e(YS).to(eC),e(XS).to(eC),e(t.DefaultGroupBackgroundRenderContribution).toSelf().inSingletonScope(),e(Jb).toService(t.DefaultGroupBackgroundRenderContribution),mp(e,Jb),e(t.DefaultCanvasPolygonRender).toSelf().inSingletonScope(),e($S).to(t.DefaultCanvasPolygonRender),e(XS).to(t.DefaultCanvasPolygonRender),e(uC).toSelf().inSingletonScope(),e(dC).toSelf().inSingletonScope(),e(ex).toService(uC),e(ex).toService(dC),mp(e,ex),e(hC).toSelf().inSingletonScope(),e(nA).toService(hC),e(XS).toService(nA),e(t.DefaultCanvasImageRender).toSelf().inSingletonScope(),e(rA).toService(t.DefaultCanvasImageRender),e(XS).toService(rA),e(t.DefaultImageBackgroundRenderContribution).toSelf().inSingletonScope(),e(Qb).toService(t.DefaultImageBackgroundRenderContribution),mp(e,Qb),e(oC).toSelf().inSingletonScope(),e(eA).toService(oC),e(XS).toService(eA),e(lC).toSelf().inSingletonScope(),e(iA).toService(lC),e(XS).toService(iA),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),e(rx).toService(t.DefaultBaseInteractiveRenderContribution),e(Kb).toService(t.DefaultBaseInteractiveRenderContribution),e(tx).toService(t.DefaultBaseInteractiveRenderContribution),e(nx).toService(t.DefaultBaseInteractiveRenderContribution),e(ix).toService(t.DefaultBaseInteractiveRenderContribution),e(Qb).toService(t.DefaultBaseInteractiveRenderContribution),e(Zb).toService(t.DefaultBaseInteractiveRenderContribution),e($b).toService(t.DefaultBaseInteractiveRenderContribution),e(ex).toService(t.DefaultBaseInteractiveRenderContribution),mp(e,sx),mp(e,XS),e(Z_).toSelf().inSingletonScope(),e(K_).toService(Z_),e(J_).toSelf().inSingletonScope(),e(K_).toService(J_),mp(e,K_)}));let vC=class{canvasRenderer;type="circle";numberType=cb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).circle;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=oA(n,s,n.dpr),o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};vC=dp([rp(),pp(0,op(VS)),fp("design:paramtypes",[Object])],vC);const bC=new df;let xC=class{canvasRenderer;type="rect";numberType=mb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:a=r.x,y:o=r.y}=t.attribute;n.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);a+=e.x,o+=e.y,n.setTransformForCurrent()}else a=0,o=0,h=!1,n.transformFromMatrix(t.transMatrix,!0);let c=!0;if(!h||Ip(s,!0)&&0!==s||Dp(s)&&s.some((t=>0!==t)))c=!1,this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,i,n)=>!!c||(c=t.isPointInPath(e.x,e.y),c)),((t,i,r)=>{if(c)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=oA(n,s,n.dpr),c=t.isPointInStroke(e.x,e.y),c}));else if(c){const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)c=!0;else if(n){const i=t.AABBBounds;bC.setValue(i.x1,i.y1,i.x2,i.y2),bC.expand(-s/2),c=!bC.containsPoint(e)}}return n.highPerformanceRestore(),c}};xC=dp([rp(),pp(0,op(ZS)),fp("design:paramtypes",[Object])],xC);let wC=class{canvasRenderer;type="arc";numberType=ab;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).arc;n.highPerformanceSave();let{x:s=r.x,y:a=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=oA(n,s,n.dpr),o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};wC=dp([rp(),pp(0,op(jS)),fp("design:paramtypes",[Object])],wC);let SC=class{canvasRenderer;type="area";numberType=hb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).area;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,(t=>!!o||(o=t.isPointInPath(e.x,e.y),o))),n.highPerformanceRestore(),o}};SC=dp([rp(),pp(0,op(GS)),fp("design:paramtypes",[Object])],SC);let AC=class{type="image";numberType=db;contains(t,e,i){const{pickContext:n}=i??{};return!!n&&!!t.AABBBounds.containsPoint(e)}};AC=dp([rp()],AC);let _C=class extends t.BaseRender{};_C=dp([rp()],_C);let CC=class extends _C{canvasRenderer;type="line";numberType=pb;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;n.highPerformanceSave();const r=nm(t).line,s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;let l=e;if(n.camera){l=e.clone();const i=t.parent.globalTransMatrix;l.x=i.a*e.x+i.c*e.y+i.e,l.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,(t=>!!u||(u=t.isPointInPath(l.x,l.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=oA(n,r,n.dpr),u=t.isPointInStroke(l.x,l.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};CC=dp([rp(),pp(0,op(qS)),fp("design:paramtypes",[Object])],CC);let TC=class extends _C{canvasRenderer;type="path";numberType=fb;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).path;n.highPerformanceSave();const s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;let l=e;if(n.camera){l=e.clone();const i=t.parent.globalTransMatrix;l.x=i.a*e.x+i.c*e.y+i.e,l.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(l.x,l.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=oA(n,r,n.dpr),u=t.isPointInStroke(l.x,l.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};TC=dp([rp(),pp(0,op(KS)),fp("design:paramtypes",[Object])],TC);let BC=class extends _C{canvasRenderer;type="symbol";numberType=xb;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const r=nm(t).symbol,s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;let l=e;if(n.camera){l=e.clone();const i=t.parent.globalTransMatrix;l.x=i.a*e.x+i.c*e.y+i.e,l.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(l.x,l.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=oA(n,r,n.dpr),u=t.isPointInStroke(l.x,l.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};BC=dp([rp(),pp(0,op(QS)),fp("design:paramtypes",[Object])],BC);let PC=class extends _C{canvasRenderer;type="text";numberType=wb;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;const r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();const s=nm(t).text,{keepDirIn3d:a=s.keepDirIn3d}=t.attribute,o=!a,h=this.transform(t,s,n,o),{x:c,y:l,z:u,lastModelMatrix:d}=h;this.canvasRenderer.z=u;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let f=!1;return this.canvasRenderer.drawShape(t,n,c,l,{},null,((e,i,n)=>{if(f)return!0;const{fontSize:r=s.fontSize,textBaseline:a=s.textBaseline,textAlign:o=s.textAlign}=t.attribute,h=t.AABBBounds,d=h.height(),g=h.width(),y=lx(a,d,r),m=cx(o,g);return e.rect(m+c,y+l,g,d,u),f=e.isPointInPath(p.x,p.y),f}),((t,e,i)=>f)),this.canvasRenderer.z=0,n.modelMatrix!==d&&Jw.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),f}};PC=dp([rp(),pp(0,op(tA)),fp("design:paramtypes",[Object])],PC);let EC=class{canvasRenderer;type="polygon";numberType=gb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).polygon;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};EC=dp([rp(),pp(0,op($S)),fp("design:paramtypes",[Object])],EC),new df;let MC=class{canvasRenderer;type="richtext";numberType=bb;constructor(t){this.canvasRenderer=t}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};MC=dp([rp(),pp(0,op(eA)),fp("design:paramtypes",[Object])],MC);let RC=class{canvasRenderer;type="glyph";numberType=lb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=i?.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{n||(n=!!r.pickItem(t,e,i))})),n}return!1}};RC=dp([rp(),pp(0,op(nA)),fp("design:paramtypes",[Object])],RC),new df;let kC=class extends _C{canvasRenderer;type="rect3d";numberType=vb;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).rect;n.highPerformanceSave();const s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;let l=e;if(n.camera){l=e.clone();const i=t.parent.globalTransMatrix;l.x=i.a*e.x+i.c*e.y+i.e,l.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(l.x,l.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};kC=dp([rp(),pp(0,op(JS)),fp("design:paramtypes",[Object])],kC),new df;let DC=class extends _C{canvasRenderer;type="pyramid3d";numberType=yb;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).polygon;n.highPerformanceSave();const s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;let l=e;if(n.camera){l=e.clone();const i=t.parent.globalTransMatrix;l.x=i.a*e.x+i.c*e.y+i.e,l.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(l.x,l.y),u)),((t,e,i)=>!1)),this.canvasRenderer.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};DC=dp([rp(),pp(0,op(iA)),fp("design:paramtypes",[Object])],DC),new df;let IC=class extends _C{canvasRenderer;type="arc3d";numberType=ob;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).arc;n.highPerformanceSave();const s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;let l=e;if(n.camera){l=e.clone();const i=t.parent.globalTransMatrix;l.x=i.a*e.x+i.c*e.y+i.e,l.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(l.x,l.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};IC=dp([rp(),pp(0,op(HS)),fp("design:paramtypes",[Object])],IC);var OC=new Qd(((t,e,i,n)=>{t(vC).toSelf().inSingletonScope(),t(DA).toService(vC),t(VA).toService(DA),t(xC).toSelf().inSingletonScope(),t(UA).toService(xC),t(VA).toService(UA),t(kC).toSelf().inSingletonScope(),t(WA).toService(kC),t(VA).toService(WA),t(wC).toSelf().inSingletonScope(),t(MA).toService(wC),t(VA).toService(MA),t(SC).toSelf().inSingletonScope(),t(kA).toService(SC),t(VA).toService(kA),t(AC).toSelf().inSingletonScope(),t(IA).toService(AC),t(VA).toService(IA),t(CC).toSelf().inSingletonScope(),t(OA).toService(CC),t(VA).toService(OA),t(TC).toSelf().inSingletonScope(),t(LA).toService(TC),t(VA).toService(LA),t(BC).toSelf().inSingletonScope(),t(FA).toService(BC),t(VA).toService(FA),t(PC).toSelf().inSingletonScope(),t(NA).toService(PC),t(VA).toService(NA),t(EC).toSelf().inSingletonScope(),t(zA).toService(EC),t(VA).toService(zA),t(DC).toSelf().inSingletonScope(),t(jA).toService(DC),t(VA).toService(jA),t(IC).toSelf().inSingletonScope(),t(RA).toService(IC),t(VA).toService(RA),t(MC).toSelf().inSingletonScope(),t(HA).toService(MC),t(VA).toService(HA),t(RC).toSelf().inSingletonScope(),t(GA).toService(RC),t(VA).toService(GA),mp(t,VA)}));let LC=class{canvasRenderer;type="path";numberType=fb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).path;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};LC=dp([rp(),pp(0,op(KS)),fp("design:paramtypes",[Object])],LC);let UC=class{canvasRenderer;type="circle";numberType=cb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).circle;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};UC=dp([rp(),pp(0,op(VS)),fp("design:paramtypes",[Object])],UC);const WC=new df;let FC=class{canvasRenderer;type="rect";numberType=mb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:a=r.x,y:o=r.y}=t.attribute;n.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);a+=e.x,o+=e.y,n.setTransformForCurrent()}else a=0,o=0,h=!1,n.transformFromMatrix(t.transMatrix,!0);let c=!0;if(!h||Ip(s,!0)&&0!==s||Dp(s)&&s.some((t=>0!==t)))c=!1,this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,i,n)=>!!c||(c=t.isPointInPath(e.x,e.y),c)),((t,i,r)=>{if(c)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,c=t.isPointInStroke(e.x,e.y),c}));else if(c){const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)c=!0;else if(n){const i=t.AABBBounds;WC.setValue(i.x1,i.y1,i.x2,i.y2),WC.expand(-s/2),c=!WC.containsPoint(e)}}return n.highPerformanceRestore(),c}};FC=dp([rp(),pp(0,op(ZS)),fp("design:paramtypes",[Object])],FC);let NC=class{canvasRenderer;type="arc";numberType=ab;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).arc;n.highPerformanceSave();let{x:s=r.x,y:a=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};NC=dp([rp(),pp(0,op(jS)),fp("design:paramtypes",[Object])],NC);let zC=class{canvasRenderer;type="area";numberType=hb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).area;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,(t=>!!o||(o=t.isPointInPath(e.x,e.y),o))),n.highPerformanceRestore(),o}};zC=dp([rp(),pp(0,op(GS)),fp("design:paramtypes",[Object])],zC);let jC=class{canvasRenderer;type="line";numberType=pb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).line;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,(t=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};jC=dp([rp(),pp(0,op(qS)),fp("design:paramtypes",[Object])],jC);let HC=class{canvasRenderer;type="symbol";numberType=xb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).symbol;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};HC=dp([rp(),pp(0,op(QS)),fp("design:paramtypes",[Object])],HC);let GC=class{type="text";numberType=wb;contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};GC=dp([rp()],GC);let VC=class{canvasRenderer;type="polygon";numberType=gb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).polygon;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};VC=dp([rp(),pp(0,op($S)),fp("design:paramtypes",[Object])],VC);let XC=class{canvasRenderer;type="glyph";numberType=lb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=i?.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{n||(n=!!r.pickItem(t,e,i))})),n}return!1}};XC=dp([rp(),pp(0,op(nA)),fp("design:paramtypes",[Object])],XC);var YC=new Qd((t=>{t(UC).toSelf().inSingletonScope(),t(qA).toService(UC),t(i_).toService(qA),t(FC).toSelf().inSingletonScope(),t(ZA).toService(FC),t(i_).toService(ZA),t(NC).toSelf().inSingletonScope(),t(XA).toService(NC),t(i_).toService(XA),t(zC).toSelf().inSingletonScope(),t(YA).toService(zC),t(i_).toService(YA),t(jC).toSelf().inSingletonScope(),t(KA).toService(jC),t(i_).toService(KA),t(LC).toSelf().inSingletonScope(),t($A).toService(LC),t(i_).toService($A),t(HC).toSelf().inSingletonScope(),t(JA).toService(HC),t(i_).toService(JA),t(GC).toSelf().inSingletonScope(),t(QA).toService(GC),t(i_).toService(QA),t(VC).toSelf().inSingletonScope(),t(t_).toService(VC),t(i_).toService(t_),t(XC).toSelf().inSingletonScope(),t(e_).toService(XC),t(XC).toService(e_),mp(t,i_)}));var qC=new Qd((e=>{e(yy).toDynamicValue((()=>e=>new t.BrowserCanvas(e))).whenTargetNamed(t.BrowserCanvas.env),e(my).toDynamicValue((()=>(e,i)=>new t.BrowserContext2d(e,i))).whenTargetNamed(t.BrowserContext2d.env)})),KC=new Qd((t=>{t(yy).toDynamicValue((()=>t=>new E_(t))).whenTargetNamed(E_.env),t(my).toDynamicValue((()=>(t,e)=>new B_(t,e))).whenTargetNamed(B_.env)})),$C=new Qd((t=>{t(yy).toDynamicValue((()=>t=>new C_(t))).whenTargetNamed(C_.env),t(my).toDynamicValue((()=>(t,e)=>new A_(t,e))).whenTargetNamed(A_.env)})),ZC=new Qd((t=>{t(yy).toDynamicValue((()=>t=>new D_(t))).whenTargetNamed(D_.env),t(my).toDynamicValue((()=>(t,e)=>new R_(t,e))).whenTargetNamed(R_.env)})),JC=new Qd((t=>{t(yy).toDynamicValue((()=>t=>new z_(t))).whenTargetNamed(z_.env),t(my).toDynamicValue((()=>(t,e)=>new F_(t,e))).whenTargetNamed(F_.env)})),QC=new Qd((t=>{t(yy).toDynamicValue((()=>t=>new U_(t))).whenTargetNamed(U_.env),t(my).toDynamicValue((()=>(t,e)=>new O_(t,e))).whenTargetNamed(O_.env)}));fy.load(Db),fy.load(a_),fy.load(fA),fy.load(s_),fy.load(l_),function(t){t.load(w_),t.load(G_),t.load(V_),t.load(q_)}(fy),function(t){t.load(mC)}(fy),function(t){t.load(OC),t.load(YC)}(fy),function(t){t.load(qC),t.load($C),t.load(KC),t.load(ZC),t.load(JC),t.load(QC)}(fy);const tT=fy.get(wp);gy.global=tT;const eT=fy.get(Rb);gy.graphicUtil=eT;const iT=fy.get(Mb);gy.transformUtil=iT;const nT=fy.get(Sb);gy.graphicService=nT;const rT=fy.get(AA),sT=fy.get(kb);gy.layerService=sT;class aT{name="AutoRenderPlugin";activeEvent="onRegister";pluginService;_uid=sm.GenAutoIncrementId();key=this.name+this._uid;activate(t){this.pluginService=t,gy.graphicService.hooks.onAttributeUpdate.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),gy.graphicService.hooks.onSetStage.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}deactivate(t){gy.graphicService.hooks.onAttributeUpdate.taps=gy.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),gy.graphicService.hooks.onSetStage.taps=gy.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}class oT{name="ViewTransform3dPlugin";activeEvent="onRegister";pluginService;_uid=sm.GenAutoIncrementId();key=this.name+this._uid;mousedown;pageX;pageY;option3d;onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)};onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)};onMouseMove=t=>{const e=this.pluginService.stage;if(this.option3d||(this.option3d=e.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const i=t.page.x-this.pageX,n=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const r=i/100,s=n/100;this.option3d.alpha=(this.option3d.alpha??0)+r,this.option3d.beta=(this.option3d.beta??0)+s,e.set3dOptions(this.option3d),e.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y};activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}class hT{name="IncrementalAutoRenderPlugin";activeEvent="onRegister";pluginService;nextFrameRenderGroupSet=new Set;willNextFrameRender=!1;nextUserParams={};_uid=sm.GenAutoIncrementId();key=this.name+this._uid;activate(t){this.pluginService=t,gy.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,n)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),gy.graphicService.hooks.onClearIncremental.tap(this.key,((e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))}))}deactivate(t){gy.graphicService.hooks.onAddIncremental.taps=gy.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),gy.graphicService.hooks.onClearIncremental.taps=gy.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,gy.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const n=e.layer.subLayers.get(e._uid);n&&n.drawContribution&&n.drawContribution.draw(t.renderService,{x:t.x,y:t.y,width:i.viewWidth,height:i.viewHeight,stage:t,layer:i,clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:n.layer.getNativeHandler().getContext(),...this.nextUserParams})})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}const cT=new df;class lT{name="DirtyBoundsPlugin";activeEvent="onRegister";pluginService;_uid=sm.GenAutoIncrementId();key=this.name+this._uid;activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),gy.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(cT.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(cT,t.parent&&t.parent.globalTransMatrix)))})),gy.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!r||e.dirty(n.globalAABBBounds))})),gy.graphicService.hooks.onRemove.tap(this.key,(t=>{const e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){gy.graphicService.hooks.beforeUpdateAABBBounds.taps=gy.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),gy.graphicService.hooks.afterUpdateAABBBounds.taps=gy.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),gy.graphicService.hooks.onRemove.taps=gy.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}const uT=new _m;uT.addTimeline(Bm);uT.setFPS(60);class dT{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=Ev.get(e).value,this.colorRgb[0]/=255,this.colorRgb[1]/=255,this.colorRgb[2]/=255,this.ambient=i;const n=ef(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/n,t[1]/n,t[2]/n]}computeColor(t,e){const i=this.formatedDir,n=Qp(Jp((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let r;if(kp(e)){r=Ev.get(e).value}else r=e;const s=this.colorRgb;return Ev.to.rgb(s[0]*r[0]*n,s[1]*r[1]*n,s[2]*r[2]*n)}}const pT="white";class fT extends Cb{_viewBox;_background;_subView;nextFrameRenderLayerSet;willNextFrameRender;_cursor;renderCount;dirtyBounds;option3d;set viewBox(t){this._viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}get viewBox(){return this._viewBox}get x(){return this._viewBox.x1}set x(t){this._viewBox.translate(t-this._viewBox.x1,0)}get y(){return this._viewBox.y1}set y(t){this._viewBox.translate(0,t-this._viewBox.y1)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this._viewBox.width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this._viewBox.height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){return this._background??pT}set background(t){this._background=t}get defaultLayer(){return this.at(0)}ticker;autoRender;increaseAutoRender;view3dTranform;window;global;renderService;pickerService;pluginService;layerService;eventSystem;_beforeRender;_afterRender;_afterNextRenderCbs;lastRenderparams;interactiveLayer;supportInteractiveLayer;constructor(t){super({}),this.theme=new em,this.hooks={beforeRender:new bp(["stage"]),afterRender:new bp(["stage"])},this.global=fy.get(wp),this.window=fy.get(Pb),this.renderService=fy.get(dA),this.pickerService=fy.get(wA),this.pluginService=fy.get(h_),this.layerService=fy.get(kb),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this._viewBox=new df,t.viewBox?this._viewBox.setValue(t.viewBox.x1,t.viewBox.y1,t.viewBox.x2,t.viewBox.y2):this._viewBox.setValue(0,0,this.width,this.height),this.renderCount=0,this._subView=!(this._viewBox.width()===this.width&&this._viewBox.height()===this.height),this._background=t.background??pT,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,this.global.supportEvent&&(this.eventSystem=new mm({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,viewport:{viewBox:this._viewBox,get x(){return this.viewBox.x1},get y(){return this.viewBox.y1},get width(){return this.viewBox.width()},get height(){return this.viewBox.height()}}})),t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||uT,this.supportInteractiveLayer=!1!==t.interactiveLayer}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:n=0,beta:r=0,camera:s,fieldRatio:a=1,fieldDepth:o}=t;return{...t,center:e,light:i,alpha:n,beta:r,camera:s,fieldRatio:a,fieldDepth:o}}set3dOptions(t){this.option3d=t;const e=this.get3dOptions(t),{light:i,center:n,camera:r,alpha:s,beta:a,fieldRatio:o,fieldDepth:h}=e,{dir:c=[1,1,-1],color:l="white",ambient:u}=i,d=(n.x??this.width/2)+(n.dx??0),p=(n.y??this.height/2)+(n.dy??0),f=[d,p,(n.z??0)+(n.dz??0)];let g=0,y=0,m=0;r||(g=Math.sin(s)+d,y=Math.sin(a)+p,m=Math.cos(s)*Math.cos(a)*1),this.light=new dT(c,l,u);const v={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:o,fieldDepth:h,viewParams:{pos:[g,y,m],center:f,up:[0,1,0]}};this.camera?this.camera.params=v:this.camera=new TA(v),t.enableView3dTransform&&this.enableView3dTransform()}beforeRender=t=>{this._beforeRender&&this._beforeRender(t)};afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null};setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new oT))}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new aT))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new hT))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new uf;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t||(t=new lT,this.pluginService.register(t)),t.activate(this.pluginService)}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}tryUpdateAABBBounds(){const t=this._viewBox;return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t){const e=this.layerService.createLayer(this,{main:!1,canvasId:t});return this.appendChild(e),e}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive")}clearViewBox(t){this.window.clearViewBox(this._viewBox,t)}render(t,e){this.ticker.start(),this.lastRenderparams=e,this.hooks.beforeRender.call(this),(t||this).forEach(((t,i)=>{t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds},{renderStyle:this.renderStyle,...e})})),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear(),this.hooks.afterRender.call(this)}combineLayersToWindow(){this.forEach(((t,e)=>{t.combineTo(this.window,{clear:0===e,x:this.x,y:this.y,width:this.viewWidth,height:this.viewHeight,renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds})}))}renderNextFrame(t){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){this.nextFrameRenderLayerSet.size&&(this.ticker.start(),this.hooks.beforeRender.call(this),this.forEach((t=>{this.nextFrameRenderLayerSet.has(t)&&t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds},{renderStyle:this.renderStyle,...this.lastRenderparams||{}})})),this.combineLayersToWindow(),this.hooks.afterRender.call(this),this.nextFrameRenderLayerSet.clear())}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this._subView||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render()}resizeView(t,e,i=!0){this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params={...this.camera.params,right:this.width,bottom:this.height}),i&&this.render()}setViewBox(t,e,i,n,r){let s=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(s=!1)):(this.viewBox.setValue(t,e,t+i,e+n),!1===r&&(s=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),s&&this.render()}setDpr(t){this.forEachChildren((e=>{e.setDpr(t)}))}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){const i=this.pickerService.pick(this.children,new hf(t,e),{bounds:this.AABBBounds});return!(!i?.graphic&&!i?.group)&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.eventSystem&&this.eventSystem.release(),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release()}setStage(t){}dirty(t,e){e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t)}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t,e){this.forEachChildren(((i,n)=>{i.drawTo(t,{...e,renderService:this.renderService,background:i===this.defaultLayer?this.background:void 0,clear:0===n,updateBounds:!!this.dirtyBounds})}))}renderToNewWindow(t=!0){const e=fy.get(Pb);return t?e.create({width:this.viewWidth,height:this.viewHeight,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}):e.create({width:Math.min(this.viewWidth,this.window.width-this.x),height:Math.min(this.viewHeight,this.window.height-this.y),dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e,{x:0,y:0,width:e.width,height:e.height}),e}toCanvas(t=!0){const e=this.renderToNewWindow(t).getNativeHandler();return e.nativeCanvas?e.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t)}getCursor(){return this._cursor}}var gT;!function(t){t[t.W=1]="W",t[t.H=2]="H",t[t.WH=3]="WH"}(gT||(gT={}));t.ACustomAnimate=Pm,t.ARC3D_NUMBER_TYPE=ob,t.ARC_NUMBER_TYPE=ab,t.AREA_NUMBER_TYPE=hb,t.Animate=Mm,t.AnimateGroup=class extends Pm{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Cm[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends Pm{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Cm[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Arc=Iw,t.Arc3d=Ow,t.Arc3dRender=HS,t.ArcRender=jS,t.ArcRenderContribution=Kb,t.Area=kw,t.AreaRender=GS,t.AreaRenderContribution=$b,t.AttributeAnimate=class extends Pm{constructor(t,e,i){super({},t,e,i)}getEndProps(){return this.to}onBind(){Object.keys(this.to).forEach((t=>{this.from[t]=this.target.getComputedAttribute(t)}))}onEnd(){}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this.to,this.from)}},t.AutoEnablePlugins=o_,t.Basis=xg,t.BeforeRenderConstribution=pA,t.BoundsContext=kf,t.BoundsPicker=SA,t.CIRCLE_NUMBER_TYPE=cb,t.CanvasFactory=yy,t.CanvasTextLayout=ux,t.CbAnimate=Em,t.Circle=ox,t.CircleRender=VS,t.CircleRenderContribution=Zb,t.ClipAngleAnimate=class extends Jm{constructor(t,e,i,n,r){const s=r?.group?.attribute??{},a=s.width??0,o=s.height??0,h=r?.animationType??"in",c=r?.startAngle??0,l=r?.orient??"clockwise";let u=0,d=0;"anticlockwise"===l?(d="in"===h?c+2*Math.PI:c,d=c+2*Math.PI):(u=c,d="out"===h?c+2*Math.PI:c);const p=gy.graphicService.creator.arc({x:r?.center?.x??a/2,y:r?.center?.y??o/2,outerRadius:r?.radius??(a+o)/2,innerRadius:0,startAngle:u,endAngle:d,fill:!0});let f,g;"anticlockwise"===l?(f={startAngle:c+2*Math.PI},g={startAngle:c}):(f={endAngle:c},g={endAngle:c+2*Math.PI}),super("in"===h?f:g,"in"===h?g:f,i,n,{group:r?.group,clipGraphic:p})}},t.ClipDirectionAnimate=class extends Jm{constructor(t,e,i,n,r){const s=r?.group?.attribute??{},a=r?.width??s.width??0,o=r?.height??s.height??0,h=r?.animationType??"in",c=r?.direction??"x",l=r?.orient??"positive",u=gy.graphicService.creator.rect({x:0,y:0,width:"in"===h&&"x"===c?0:a,height:"in"===h&&"y"===c?0:o,fill:!0});let d={},p={};"y"===c?"negative"===l?(d={y:o,height:0},p={y:0,height:o}):(d={height:0},p={height:o}):"negative"===l?(d={x:a,width:0},p={x:0,width:a}):(d={width:0},p={width:a}),super("in"===h?d:p,"in"===h?p:d,i,n,{group:r?.group,clipGraphic:u})}},t.ClipGraphicAnimate=Jm,t.ClipRadiusAnimate=class extends Jm{constructor(t,e,i,n,r){const s=r?.group?.attribute??{},a=s.width??0,o=s.height??0,h=r?.animationType??"in",c=r?.startRadius??0,l=r?.endRadius??Math.sqrt((a/2)**2+(o/2)**2),u=gy.graphicService.creator.arc({x:r?.center?.x??a/2,y:r?.center?.y??o/2,outerRadius:"out"===h?l:c,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),d={outerRadius:c},p={outerRadius:l};super("in"===h?d:p,"in"===h?p:d,i,n,{group:r?.group,clipGraphic:u})}},t.ColorInterpolate=Vb,t.Context2dFactory=my,t.ContributionProvider=gp,t.CurveContext=class{_lastX;_lastY;_startX;_startY;constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.curves.push(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new dg(new hf(this._lastX,this._lastY),new hf(t,e))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,e,i,n,r,s){const a=new lg(new hf(this._lastX,this._lastY),new hf(t,e),new hf(i,n),new hf(r,s));this.path.curves.push(a),this._lastX=r,this._lastY=s}arcTo(t,e,i,n,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,r,s,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,r,s){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}},t.CustomEvent=um,t.CustomPath2D=Ng,t.CustomSymbolClass=tw,t.DefaultArcAttribute=$g,t.DefaultAreaAttribute=Zg,t.DefaultAttribute=Kg,t.DefaultCircleAttribute=Jg,t.DefaultFillStyle=Gg,t.DefaultGlyphAttribute=ty,t.DefaultGroupAttribute=Qg,t.DefaultImageAttribute=cy,t.DefaultLineAttribute=ey,t.DefaultMorphingAnimateConfig=Im,t.DefaultPathAttribute=iy,t.DefaultPolygonAttribute=ny,t.DefaultRect3dAttribute=sy,t.DefaultRectAttribute=ry,t.DefaultRichTextAttribute=hy,t.DefaultRichTextIconAttribute=ly,t.DefaultStateAnimateConfig=Dm,t.DefaultStrokeStyle=Xg,t.DefaultStyle=qg,t.DefaultSymbolAttribute=ay,t.DefaultSymbolBackgroundRenderContribution=lA,t.DefaultSymbolTextureRenderContribution=uA,t.DefaultTextAttribute=oy,t.DefaultTextStyle=Yg,t.DefaultTicker=_m,t.DefaultTimeline=Tm,t.DefaultTransform=Hg,t.DragNDrop=class{rootNode;constructor(t){this.rootNode=t,this.initEvents()}initEvents(){this.rootNode?.addEventListener("pointerdown",this.onPointerDown)}removeEvents(){this.rootNode?.removeEventListener("pointerdown",this.onPointerDown)}release(){this.removeEvents(),this.rootNode=null}onPointerDown=t=>{const e=t.target,i=this.rootNode,n=e===i;if(e&&!n){let r,s=!1;function a(t){if(s||(t.type="dragstart",e?.dispatchEvent(t),s=!0),t.type="drag",e?.dispatchEvent(t),!n){e.pickable=!1;const n=i?.pick(t.global.x,t.global.y),s=n.graphic;e.pickable=!0,r!==s&&(r&&(t.type="dragleave",t.target=r,r.dispatchEvent(t)),s&&(t.type="dragenter",t.target=s,s.dispatchEvent(t)),r=s,r&&(t.type="dragover",t.target=r,r.dispatchEvent(t)))}}i?.addEventListener("pointermove",a);const o=function(){s&&(r&&(t.type="drop",t.target=r,r.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),s=!1),i?.removeEventListener("pointermove",a)};e.addEventListener("pointerup",o,{once:!0}),e.addEventListener("pointerupoutside",o,{once:!0})}}},t.DrawContribution=aA,t.EventManager=fm,t.EventSystem=mm,t.EventTarget=gm,t.FadeInPlus=class extends Pm{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=Zm.LEFT_TO_RIGHT,fill:a=!0,stroke:o=!0}=r||{};this.direction=s,this.fill=a,this.stroke=o,this.fillGradient={gradient:"linear",stops:[]},this.strokeGradient={gradient:"linear",stops:[]}}getEndProps(){return{fill:this.toFill,stroke:this.toStroke}}onBind(){this.toFill=this.target.getComputedAttribute("fill"),this.toStroke=this.target.getComputedAttribute("stroke")}onEnd(){}onUpdate(t,e,i){if(this.toFill&&this.toStroke)switch(this.direction){case Zm.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case Zm.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case Zm.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case Zm.STROKE:this.strokePath(t,e,i);break;default:this.leftToRight(t,e,i)}}leftToRight(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=this.toStroke;this.strokeGradient.x0=0,this.strokeGradient.y0=0,this.strokeGradient.x1=1,this.strokeGradient.y1=0,this.strokeGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,6*e),color:"transparent"}],i.stroke=this.strokeGradient}}strokePath(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=300,n=e*t;i.lineDash=[n,t-n]}}rightToLeft(t,e,i){}topToBottom(t,e,i){}bottomToTop(t,e,i){}},t.FederatedEvent=om,t.FederatedMouseEvent=hm,t.FederatedPointerEvent=cm,t.FederatedWheelEvent=lm,t.GLYPH_NUMBER_TYPE=lb,t.GRAPHIC_UPDATE_TAG_KEY=Zv,t.GROUP_NUMBER_TYPE=ub,t.Generator=sm,t.Gesture=class extends _p{element;cachedEvents=[];startTime;pressTimeout;startPoints=[];processEvent={};startDistance;center;eventType;direction;lastMoveTime;prevMoveTime;prevMovePoint;lastMovePoint;throttleTimer=0;emitThrottles=[];config;constructor(t,e={}){super(),this.element=t,this.config={press:{time:e?.press?.time??251,threshold:e?.press?.threshold??9},swipe:{threshold:e?.swipe?.threshold??10,velocity:e?.swipe?.velocity??.3}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}onStart=t=>{this.reset(),this.startTime=dm.now();const{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t<e.length;t++){const{x:n,y:r}=e[t],s={x:n,y:r};i[t]=s}if(1!==i.length)this.startDistance=bm(i[0],i[1]),this.center=(t=>{const e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,n=0,r=0;for(;r<e;)i+=t[r].x,n+=t[r].y,r++;return{x:Math.round(i/e),y:Math.round(n/e)}})([i[0],i[1]]);else{const t=e[0];this.pressTimeout=setTimeout((()=>{const e="press",n="none";t.direction=n,t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent(e,t),this.triggerEvent(e,t),this.eventType=e,this.direction=n}),this.config.press.time)}};onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const n=t.clone(),{x:r,y:s,pointerId:a}=n;for(let t=0,e=i.length;t<e;t++)if(a===i[t].pointerId){i[t]=n;break}const o={x:r,y:s},h=i.map((t=>({x:t.x,y:t.y}))),c=dm.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=c,this.lastMovePoint=o,1===e.length){const t=e[0],i=r-t.x,a=s-t.y,c=this.direction||vm(t,o);this.direction=c;const l=this.getEventType(o);return n.direction=c,n.deltaX=i,n.deltaY=a,n.points=h,this.triggerStartEvent(l,n),void this.triggerEvent(l,n)}const{startDistance:l}=this,u=bm(h[0],h[1]);n.scale=u/l,n.center=this.center,n.points=h,this.triggerStartEvent("pinch",n),this.triggerEvent("pinch",n)};onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:n}=this,r=i.map((t=>({x:t.x,y:t.y})));if(e.points=r,this.triggerEndEvent(e),1===i.length){const t=dm.now(),i=this.lastMoveTime;if(t-i<100){const t=i-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||n[0],r=this.lastMovePoint||n[0],s=bm(i,r),a=s/t;a>this.config.swipe.velocity&&s>this.config.swipe.threshold&&(e.velocity=a,e.direction=vm(i,r),this.triggerEvent("swipe",e))}}}for(let t=0,r=i.length;t<r;t++)if(i[t].pointerId===e.pointerId){i.splice(t,1),n.splice(t,1);break}this.reset(),i.length>0&&this.onStart()};getEventType(t){const{eventType:e,startTime:i,startPoints:n}=this;if(e)return e;let r;return r=dm.now()-i>this.config.press.time&&bm(n[0],t)<this.config.press.threshold?"press":"pan",this.eventType=r,r}enable(t){this.processEvent[t]=!0}isProcess(t){return this.processEvent[t]}pushEvent(t,e){const{emitThrottles:i}=this,n={type:t,ev:e};for(let e=0,r=i.length;e<r;e++)if(i[e].type===t)return void i.splice(e,1,n);i.push(n)}clearPressTimeout(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}reset(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}triggerEvent(t,e){this.pushEvent(t,e);const{throttleTimer:i,emitThrottles:n}=this;i||(this.throttleTimer=gy.global.getRequestAnimationFrame()((()=>{for(let t=0,e=n.length;t<e;t++){const{type:e,ev:i}=n[t];this.emitEvent(e,i)}this.throttleTimer=0,this.emitThrottles.length=0})))}triggerStartEvent(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent(`${t}start`,e))}triggerEndEvent(t){const e=this.processEvent;Object.keys(e).forEach((i=>{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]}))}emitEvent(t,e){const i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let n=0,r=i.length;n<r&&!e.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,e,t);this.emit(t,e)}},t.GlobalPickerService=AA,t.Glyph=uw,t.GlyphRender=nA,t.Graphic=ib,t.GraphicAnimate=class extends Pm{graphic;constructor(t,e,i,n,r){super(t,e,i,n,r),this.graphic=r?.graphic}onUpdate(t,e,i){this.graphic&&Object.keys(this.from).forEach((t=>{i[t]=this.from[t]+(this.to[t]-this.from[t])*e}))}},t.GraphicCreator=Ab,t.GraphicPicker=xA,t.GraphicRender=XS,t.GraphicService=Sb,t.GraphicUtil=Rb,t.Group=Cb,t.GroupFadeIn=class extends Pm{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:0}})}onEnd(){this.target.setTheme({common:{opacity:1}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:e}})}},t.GroupFadeOut=class extends Pm{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:1}})}onEnd(){this.target.setTheme({common:{opacity:0}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:1-e}})}},t.GroupRender=YS,t.GroupRenderContribution=Jb,t.IMAGE_NUMBER_TYPE=db,t.Image=Aw,t.ImageRender=rA,t.ImageRenderContribution=Qb,t.IncreaseCount=class extends Pm{fromNumber;toNumber;constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){this.fromNumber=Ip(this.from?.text)?this.from?.text:Number.parseFloat(this.from?.text),this.toNumber=Ip(this.to?.text)?this.to?.text:Number.parseFloat(this.to?.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1)}onEnd(){}onUpdate(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber.toFixed():(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.params?.fixed??0))}},t.IncrementalDrawContribution=zS,t.InputText=class extends Pm{fromText="";toText="";getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){if(this.fromText=this.from?.text??"",this.toText=this.to?.text??"",!this.toText||Dp(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=gy.graphicService.creator.line({x:0,y:0,points:[{x:0,y:0},{x:0,y:this.target.getComputedAttribute("fontSize")}],stroke:"black",lineWidth:1});t.add(e)}}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){if(!1===this.valid)return;const n=this.fromText.length,r=this.toText.length,s=Math.ceil(n+(r-n)*e);i.text=this.toText.substr(0,s);const a=this.target.shadowRoot?.at(0),o=this.target.clipedWidth+2;a.setAttribute("x",o)}},t.InteractiveSubRenderContribution=sx,t.LINE_NUMBER_TYPE=pb,t.Layer=Bb,t.LayerHandlerContribution=Tb,t.LayerService=kb,t.Line=aw,t.LineRender=qS,t.Linear=yg,t.LinearClosed=Lg,t.ManualTickHandler=xm,t.ManualTicker=class extends _m{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new xm;return this._mode="manual",this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}tickAt(t){this.tickerHandler.tick(t-this.lastFrameTime,(t=>{this.handleTick(t,{once:!0})}))}ifCanStop(){return!1}},t.Meteor=class extends Pm{get lastPos(){return this.posList[this.posList.length-1]}constructor(t,e,i,n){super(null,null,e,i,n),this.size=t,this.posList=[]}onBind(){const e=this.target.attachShadow();this.root=e;for(let i=0;i<this.size;i++){const n=this.target.clone(),r=Math.min((this.size-i)/this.size*3,1),s=Math.min(.2+.7/this.size);n.setAttributes({x:0,y:0,dx:0,dy:0,scaleX:r,scaleY:r,opacity:s},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}),e.add(n)}}onUpdate(t,e,i){if(t)return this.target.detachShadow(),void(this.posList.length=0);const n=this.target.getComputedAttribute("x"),r=this.target.getComputedAttribute("y"),s=new hf(n,r);this.posList.length?(this.target.shadowRoot.forEachChildren(((t,e)=>{const i=this.posList[Math.max(this.posList.length-e-1,0)];t.setAttributes({x:i.x-n,y:i.y-r},!1)})),this.posList.push(s)):this.posList.push(s)}},t.MonotoneX=Bg,t.MonotoneY=Pg,t.MorphingPath=jv,t.MotionPath=class extends Pm{constructor(t,e,i,n,r){super(t,e,i,n,r),r&&(this.pathLength=r.path.getLength(),this.path=r.path,this.distance=r.distance,this.to=r.distance*this.pathLength,this.initAngle=r.initAngle??0,this.changeAngle=!!r.changeAngle,this.cb=r.cb)}onUpdate(t,e,i){const n=this.to*e,{pos:r,angle:s}=this.path.getAttrAt(n);i.x=r.x,i.y=r.y,this.changeAngle&&(i.angle=s+this.initAngle),this.cb&&this.cb(this.from,this.to,e,this.target)}},t.MultiToOneMorphingPath=Gv,t.Node=am,t.PATH_NUMBER_TYPE=fb,t.POLYGON_NUMBER_TYPE=gb,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=yb,t.Path=Mw,t.PathRender=KS,t.PathRenderContribution=tx,t.PickerService=wA,t.PluginService=h_,t.Polygon=Uw,t.PolygonRender=$S,t.PolygonRenderContribution=ex,t.Pyramid3d=Ww,t.Pyramid3dRender=iA,t.RAFTickHandler=Sm,t.RECT3D_NUMBER_TYPE=vb,t.RECT_NUMBER_TYPE=mb,t.RICHTEXT_NUMBER_TYPE=bb,t.RafBasedSTO=Km,t.Rect=hw,t.Rect3DRender=JS,t.Rect3d=lw,t.RectRender=ZS,t.RectRenderContribution=ix,t.ReflectSegContext=fg,t.RenderSelector=sA,t.RenderService=dA,t.ResourceLoader=Kv,t.RichText=Pw,t.RichTextRender=eA,t.RotateBySphereAnimate=class extends Pm{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.getComputedAttribute("x"),n=this.target.getComputedAttribute("y"),r=this.target.getComputedAttribute("z"),s=Math.acos((n-t.y)/e);let a=Math.acos((i-t.x)/e/Math.sin(s));r-t.z<0&&(a=qp-a),this.theta=a,this.phi=s}onBind(){}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:n,r:r}="function"==typeof this.params?this.params():this.params,s=2*Math.PI*e,a=this.theta+s,o=this.phi,h=r*Math.sin(o)*Math.cos(a)+n.x,c=r*Math.cos(o)+n.y,l=r*Math.sin(o)*Math.sin(a)+n.z;for(i.x=h,i.y=c,i.z=l,i.alpha=a+Vp/2;i.alpha>qp;)i.alpha-=qp;i.alpha=qp-i.alpha,i.zIndex=-1e4*i.z}},t.SYMBOL_NUMBER_TYPE=xb,t.SegContext=pg,t.Stage=fT,t.Step=Dg,t.StreamLight=class extends Pm{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){const t=this.target.attachShadow(),e=this.target.AABBBounds.height(),i=gy.graphicService.creator.rect({height:e,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff",...this.params?.attribute,x:0,y:0,width:0});this.rect=i,t.add(i)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(e,i,n){const r=this.target.attribute.width??250,s=this.params?.streamLength??r,a=this.params?.attribute?.width??60,o=-a,h=o+(s-o)*i,c=Math.max(h,0),l=Math.min(Math.min(h+a,a),s-h),u=l+c>r?Math.max(r-c,0):l;this.rect.setAttributes({x:c,width:u},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}},t.SubAnimate=Rm,t.Symbol=rw,t.SymbolRender=QS,t.SymbolRenderContribution=nx,t.TEXT_NUMBER_TYPE=wb,t.TagPointsUpdate=class extends Pm{fromPoints;toPoints;points;interpolatePoints;newPointAnimateType;constructor(t,e,i,n,r){super(t,e,i,n,r),this.newPointAnimateType="appear"===r?.newPointAnimateType?"appear":"grow"}onBind(){const t=this.from?.points,e=this.to?.points;this.fromPoints=t?Array.isArray(t)?t:[t]:[],this.toPoints=e?Array.isArray(e)?e:[e]:[];const i=new Map;this.fromPoints.forEach((t=>{t.context&&i.set(t.context,t)}));let n,r,s=1/0,a=-1/0;for(let t=0;t<this.toPoints.length;t+=1)if(i.has(this.toPoints[t].context)){s=t,n=i.get(this.toPoints[t].context);break}for(let t=this.toPoints.length-1;t>=0;t-=1)if(i.has(this.toPoints[t].context)){a=t,r=i.get(this.toPoints[t].context);break}let o=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const h=i.get(t.context);return h?(o=h,[h,t]):"appear"===this.newPointAnimateType?[t,t]:e<s&&n?[n,t]:e>a&&r?[r,t]:[o,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],n=new hf(e.x,e.y,e.x1,e.y1);return n.defined=i.defined,n.context=i.context,n}))}onUpdate(t,e,i){this.points=this.points.map(((t,i)=>{const n=Gm(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),i.points=this.points}},t.Text=px,t.TextRender=tA,t.TextRenderContribution=rx,t.Theme=em,t.TimeOutTickHandler=wm,t.TransformUtil=Mb,t.Window=Pb,t.WindowHandlerContribution=Eb,t.addArcToBezierPath=eg,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=av,t.alignSubpath=tv,t.applyTransformOnBezierCurves=cv,t.bezier=Qf,t.bezierCurversToPath=lv,t.binarySplitPolygon=xv,t.bindContributionProvider=mp,t.boundStroke=nb,t.builtinSymbols=ew,t.builtinSymbolsMap=iw,t.calcLineCache=Fg,t.centroidOfSubpath=nv,t.circleBounds=jm,t.cloneGraphic=Yv,t.container=fy,t.cornerTangents=jb,t.createArc=cS,t.createArc3d=function(t){return new Ow(t)},t.createArea=lS,t.createCircle=uS,t.createColor=hA,t.createConicalGradient=qb,t.createGlyph=function(t){return new uw(t)},t.createGroup=dS,t.createImage=xS,t.createLine=pS,t.createPath=fS,t.createPolygon=wS,t.createPyramid3d=function(t){return new Ww(t)},t.createRect=gS,t.createRect3d=yS,t.createRectPath=LS,t.createRichText=AS,t.createShadowRoot=SS,t.createStage=function(t){return new fT(t)},t.createSymbol=bS,t.createText=mS,t.createWrapText=vS,t.cubicCalc=og,t.cubicLength=ag,t.cubicPointAt=hg,t.cubicSubdivide=Qm,t.defaultTicker=uT,t.defaultTimeline=Bm,t.drawArc=tg,t.drawArcPath=Hb,t.drawAreaSegments=RS,t.drawIncrementalAreaSegments=ES,t.drawIncrementalSegments=PS,t.drawPathProxy=Nb,t.drawSegments=BS,t.enumCommandMap=Lf,t.fillVisible=Lb,t.findBestMorphingRotation=sv,t.findNextGraphic=mA,t.foreach=gA,t.foreachAsync=yA,t.genBasisSegments=Sg,t.genBasisTypeSegments=wg,t.genLinearClosedSegments=Ug,t.genLinearClosedTypeSegments=Wg,t.genLinearSegments=mg,t.genLinearTypeSegments=vg,t.genMonotoneXSegments=Mg,t.genMonotoneYSegments=kg,t.genMonotpneXTypeSegments=Eg,t.genMonotpneYTypeSegments=Rg,t.genNumberType=sb,t.genStepSegments=Ig,t.genStepTypeSegments=Og,t.getAttributeFromDefaultAttrList=qm,t.getConicGradientAt=Yb,t.getContextFont=hx,t.getExtraModelMatrix=function(t,e,i){const{alpha:n,beta:r}=i.attribute;if(!n&&!r)return null;const{anchor3d:s=i.attribute.anchor}=i.attribute,a=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=i.AABBBounds;a[0]=e.x1+(e.x2-e.x1)*t}else a[0]=s[0];if("string"==typeof s[1]){const t=parseFloat(s[1])/100,e=i.AABBBounds;a[1]=e.x1+(e.x2-e.x1)*t}else a[1]=s[1]}if("text"===i.type){const{textAlign:t}=i.attribute;a[0]+=cx(t,i.clipedWidth)}a[0]+=t,a[1]+=e;const o=Jw.allocate();return eS(o,o,[a[0],a[1],0]),r&&Qw(o,o,r),n&&tS(o,o,n),eS(o,o,[-a[0],-a[1],0]),o},t.getModelMatrix=rS,t.getRichTextBounds=function(t){return TS.setAttributes(t),TS.AABBBounds},t.getScaledStroke=oA,t.getTextBounds=function(t){return CS.setAttributes(t),CS.AABBBounds},t.getTheme=nm,t.getThemeFromGroup=rm,t.global=tT,t.globalTheme=im,t.graphicCreator=_S,t.graphicService=nT,t.graphicUtil=eT,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.intersect=zb,t.isTransformKey=Ym,t.layerService=sT,t.loadFeishuContributions=p_,t.loadTaroContributions=f_,t.mat3Tomat4=iS,t.morphPath=Hv,t.multiToOneMorph=(e,i,n)=>{const r=e.filter((t=>t.toCustomPath&&t.valid));r.length||__DEV__&&console.error(e," is not validate"),i.valid&&i.toCustomPath||__DEV__&&console.error(i," is not validate");const s=("clone"===n?.splitPath?Yv:n?.splitPath??qv)(i,r.length,!0),a=i.attribute;i.setAttribute("visible",!1);const o=r.map(((t,e)=>Fv(t.toCustomPath(),s[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:s[e].globalTransMatrix}))),h=r.map(((t,e)=>zv(t.attribute,a)));if(n?.individualDelay){const a=n.onEnd;let c=r.length;const l=()=>{c--,0===c&&(i.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),a&&a())};s.forEach(((t,i)=>{const s=(n.delay??0)+n.individualDelay(i,r.length,e[i],t),a=t.animate(Object.assign({},n,{onEnd:l}));a.wait(s),a.play(new jv({morphingData:o[i],saveOnEnd:!0,otherAttrs:h[i]},n.duration??Im.duration,n.easing??Im.easing))}))}else{const e=n?.onEnd,r=n?Object.assign({},n):{};r.onEnd=()=>{i.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),e&&e()};const s=i.animate(r);n?.delay&&s.wait(n.delay),s.play(new Gv({morphingData:o,otherAttrs:h},n?.duration??Im.duration,n?.easing??Im.easing))}},t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],y=e[13],m=e[14],v=e[15];let b=i.a,x=i.b,w=0,S=0;return t[0]=b*n+x*o+w*u+S*g,t[1]=b*r+x*h+w*d+S*y,t[2]=b*s+x*c+w*p+S*m,t[3]=b*a+x*l+w*f+S*v,b=i.c,x=i.d,w=0,S=0,t[4]=b*n+x*o+w*u+S*g,t[5]=b*r+x*h+w*d+S*y,t[6]=b*s+x*c+w*p+S*m,t[7]=b*a+x*l+w*f+S*v,b=0,x=0,w=1,S=0,t[8]=b*n+x*o+w*u+S*g,t[9]=b*r+x*h+w*d+S*y,t[10]=b*s+x*c+w*p+S*m,t[11]=b*a+x*l+w*f+S*v,b=i.e,x=i.f,w=0,S=1,t[12]=b*n+x*o+w*u+S*g,t[13]=b*r+x*h+w*d+S*y,t[14]=b*s+x*c+w*p+S*m,t[15]=b*a+x*l+w*f+S*v,t},t.multiplyMat4Mat4=nS,t.newThemeObj=Jy,t.oneToMultiMorph=(t,e,i)=>{const n=e.filter((t=>t&&t.toCustomPath&&t.valid));n.length||__DEV__&&console.error(n," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");const r=("clone"===i?.splitPath?Yv:i?.splitPath??qv)(t,n.length,!1),s=i?.onEnd;let a=n.length;const o=()=>{a--,0===a&&s&&s()};n.forEach(((e,s)=>{const a=r[s],h=(i?.delay??0)+(i?.individualDelay?i.individualDelay(s,n.length,a,e):0);Hv(a,e,Object.assign({},i,{onEnd:o,delay:h}),t.globalTransMatrix)}))},t.parsePadding=Fm,t.parseStroke=Um,t.parseSvgPath=Hf,t.pathToBezierCurves=hv,t.pickerService=rT,t.point=bg,t.pointEqual=Hm,t.pointInterpolation=Gm,t.pointInterpolationHighPerformance=function(t,e,i,n){const{x:r,y:s}=af(t.x,t.y,e.x,e.y,i),{x:a,y:o}=af(t.x1,t.y1,e.x1,e.y1,i);return n.x=r,n.y=s,n.x1=a,n.y1=o,n.defined=e.defined,n},t.pointsEqual=function(t,e){return!(!t||!e)&&(Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every(((t,i)=>Hm(t,e[i]))):!Number.isNaN(t.x+t.y)&&Hm(t,e))},t.pointsInterpolation=Vm,t.rafBasedSto=$m,t.rectFillVisible=Ub,t.rectStrokeVisible=Fb,t.recursiveCallBinarySplit=wv,t.renderCommandList=ng,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.rotateX=Qw,t.rotateY=tS,t.runFill=Ib,t.runStroke=Ob,t.segments=Jf,t.shouldUseMat4=sS,t.snapLength=sg,t.splitArc=pv,t.splitArea=yv,t.splitCircle=fv,t.splitGraphic=qv,t.splitLine=mv,t.splitPath=Av,t.splitPolygon=Sv,t.splitRect=dv,t.splitToGrids=uv,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=Wb,t.textDrawOffsetX=cx,t.textDrawOffsetY=function(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0},t.textLayoutOffsetY=lx,t.transformKeys=Xm,t.transformUtil=iT,t.translate=eS,t.version="0.13.10",t.waitForAllSubLayers=async function(t){const e=[],i=t.getChildren();await new Promise((t=>{gy.global.getRequestAnimationFrame()((()=>{t(null)}))})),i.forEach((t=>{t.subLayers.size&&t.subLayers.forEach((t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise((e=>{t.drawContribution.hooks.completeDraw.tap("outWait",(()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((t=>"outWait"!==t.name)),e(null)}))})))}))})),await Promise.all(e)},t.wrapCanvas=vy,t.wrapContext=function(t,e){return fy.getNamed(my,gy.global.env)(t,e)}}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VRender={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(r=n.key,s=void 0,"symbol"==typeof(s=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r,"string"))?s:String(s)),n)}var r,s}function a(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}function c(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function l(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=o(t);if(e){var r=o(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return c(this,i)}}var u=function(t){return t&&t.Math==Math&&t},d=u("object"==("undefined"==typeof globalThis?"undefined":n(globalThis))&&globalThis)||u("object"==("undefined"==typeof window?"undefined":n(window))&&window)||u("object"==("undefined"==typeof self?"undefined":n(self))&&self)||u("object"==n(e)&&e)||function(){return this}()||e||Function("return this")(),p={},f=function(t){try{return!!t()}catch(t){return!0}},g=!f((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),y=!f((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),m=y,v=Function.prototype.call,b=m?v.bind(v):function(){return v.apply(v,arguments)},x={},w={}.propertyIsEnumerable,S=Object.getOwnPropertyDescriptor,A=S&&!w.call({1:2},1);x.f=A?function(t){var e=S(this,t);return!!e&&e.enumerable}:w;var _,C,T=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},B=y,P=Function.prototype,E=P.call,M=B&&P.bind.bind(E,E),R=B?M:function(t){return function(){return E.apply(t,arguments)}},k=R,D=k({}.toString),I=k("".slice),O=function(t){return I(D(t),8,-1)},L=f,U=O,W=Object,F=R("".split),N=L((function(){return!W("z").propertyIsEnumerable(0)}))?function(t){return"String"==U(t)?F(t,""):W(t)}:W,z=function(t){return null==t},j=z,H=TypeError,G=function(t){if(j(t))throw H("Can't call method on "+t);return t},V=N,X=G,Y=function(t){return V(X(t))},q="object"==("undefined"==typeof document?"undefined":n(document))&&document.all,K={all:q,IS_HTMLDDA:void 0===q&&void 0!==q},$=K.all,Z=K.IS_HTMLDDA?function(t){return"function"==typeof t||t===$}:function(t){return"function"==typeof t},J=Z,Q=K.all,et=K.IS_HTMLDDA?function(t){return"object"==n(t)?null!==t:J(t)||t===Q}:function(t){return"object"==n(t)?null!==t:J(t)},it=d,nt=Z,rt=function(t,e){return arguments.length<2?(i=it[t],nt(i)?i:void 0):it[t]&&it[t][e];var i},st=R({}.isPrototypeOf),at=d,ot="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ht=at.process,ct=at.Deno,lt=ht&&ht.versions||ct&&ct.version,ut=lt&&lt.v8;ut&&(C=(_=ut.split("."))[0]>0&&_[0]<4?1:+(_[0]+_[1])),!C&&ot&&(!(_=ot.match(/Edge\/(\d+)/))||_[1]>=74)&&(_=ot.match(/Chrome\/(\d+)/))&&(C=+_[1]);var dt=C,pt=f,ft=d.String,gt=!!Object.getOwnPropertySymbols&&!pt((function(){var t=Symbol();return!ft(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&dt&&dt<41})),yt=gt&&!Symbol.sham&&"symbol"==n(Symbol.iterator),mt=rt,vt=Z,bt=st,xt=Object,wt=yt?function(t){return"symbol"==n(t)}:function(t){var e=mt("Symbol");return vt(e)&&bt(e.prototype,xt(t))},St=String,At=function(t){try{return St(t)}catch(t){return"Object"}},_t=Z,Ct=At,Tt=TypeError,Bt=function(t){if(_t(t))return t;throw Tt(Ct(t)+" is not a function")},Pt=Bt,Et=z,Mt=function(t,e){var i=t[e];return Et(i)?void 0:Pt(i)},Rt=b,kt=Z,Dt=et,It=TypeError,Ot={exports:{}},Lt=d,Ut=Object.defineProperty,Wt=function(t,e){try{Ut(Lt,t,{value:e,configurable:!0,writable:!0})}catch(i){Lt[t]=e}return e},Ft=Wt,Nt="__core-js_shared__",zt=d[Nt]||Ft(Nt,{}),jt=zt;(Ot.exports=function(t,e){return jt[t]||(jt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.31.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ht=Ot.exports,Gt=G,Vt=Object,Xt=function(t){return Vt(Gt(t))},Yt=Xt,qt=R({}.hasOwnProperty),Kt=Object.hasOwn||function(t,e){return qt(Yt(t),e)},$t=R,Zt=0,Jt=Math.random(),Qt=$t(1..toString),te=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Qt(++Zt+Jt,36)},ee=Ht,ie=Kt,ne=te,re=gt,se=yt,ae=d.Symbol,oe=ee("wks"),he=se?ae.for||ae:ae&&ae.withoutSetter||ne,ce=function(t){return ie(oe,t)||(oe[t]=re&&ie(ae,t)?ae[t]:he("Symbol."+t)),oe[t]},le=b,ue=et,de=wt,pe=Mt,fe=function(t,e){var i,n;if("string"===e&&kt(i=t.toString)&&!Dt(n=Rt(i,t)))return n;if(kt(i=t.valueOf)&&!Dt(n=Rt(i,t)))return n;if("string"!==e&&kt(i=t.toString)&&!Dt(n=Rt(i,t)))return n;throw It("Can't convert object to primitive value")},ge=TypeError,ye=ce("toPrimitive"),me=function(t,e){if(!ue(t)||de(t))return t;var i,n=pe(t,ye);if(n){if(void 0===e&&(e="default"),i=le(n,t,e),!ue(i)||de(i))return i;throw ge("Can't convert object to primitive value")}return void 0===e&&(e="number"),fe(t,e)},ve=wt,be=function(t){var e=me(t,"string");return ve(e)?e:e+""},xe=et,we=d.document,Se=xe(we)&&xe(we.createElement),Ae=function(t){return Se?we.createElement(t):{}},_e=Ae,Ce=!g&&!f((function(){return 7!=Object.defineProperty(_e("div"),"a",{get:function(){return 7}}).a})),Te=g,Be=b,Pe=x,Ee=T,Me=Y,Re=be,ke=Kt,De=Ce,Ie=Object.getOwnPropertyDescriptor;p.f=Te?Ie:function(t,e){if(t=Me(t),e=Re(e),De)try{return Ie(t,e)}catch(t){}if(ke(t,e))return Ee(!Be(Pe.f,t,e),t[e])};var Oe={},Le=g&&f((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ue=et,We=String,Fe=TypeError,Ne=function(t){if(Ue(t))return t;throw Fe(We(t)+" is not an object")},ze=g,je=Ce,He=Le,Ge=Ne,Ve=be,Xe=TypeError,Ye=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,Ke="enumerable",$e="configurable",Ze="writable";Oe.f=ze?He?function(t,e,i){if(Ge(t),e=Ve(e),Ge(i),"function"==typeof t&&"prototype"===e&&"value"in i&&Ze in i&&!i[Ze]){var n=qe(t,e);n&&n[Ze]&&(t[e]=i.value,i={configurable:$e in i?i[$e]:n[$e],enumerable:Ke in i?i[Ke]:n[Ke],writable:!1})}return Ye(t,e,i)}:Ye:function(t,e,i){if(Ge(t),e=Ve(e),Ge(i),je)try{return Ye(t,e,i)}catch(t){}if("get"in i||"set"in i)throw Xe("Accessors not supported");return"value"in i&&(t[e]=i.value),t};var Je=Oe,Qe=T,ti=g?function(t,e,i){return Je.f(t,e,Qe(1,i))}:function(t,e,i){return t[e]=i,t},ei={exports:{}},ii=g,ni=Kt,ri=Function.prototype,si=ii&&Object.getOwnPropertyDescriptor,ai=ni(ri,"name"),oi={EXISTS:ai,PROPER:ai&&"something"===function(){}.name,CONFIGURABLE:ai&&(!ii||ii&&si(ri,"name").configurable)},hi=Z,ci=zt,li=R(Function.toString);hi(ci.inspectSource)||(ci.inspectSource=function(t){return li(t)});var ui,di,pi,fi=ci.inspectSource,gi=Z,yi=d.WeakMap,mi=gi(yi)&&/native code/.test(String(yi)),vi=te,bi=Ht("keys"),xi=function(t){return bi[t]||(bi[t]=vi(t))},wi={},Si=mi,Ai=d,_i=et,Ci=ti,Ti=Kt,Bi=zt,Pi=xi,Ei=wi,Mi="Object already initialized",Ri=Ai.TypeError,ki=Ai.WeakMap;if(Si||Bi.state){var Di=Bi.state||(Bi.state=new ki);Di.get=Di.get,Di.has=Di.has,Di.set=Di.set,ui=function(t,e){if(Di.has(t))throw Ri(Mi);return e.facade=t,Di.set(t,e),e},di=function(t){return Di.get(t)||{}},pi=function(t){return Di.has(t)}}else{var Ii=Pi("state");Ei[Ii]=!0,ui=function(t,e){if(Ti(t,Ii))throw Ri(Mi);return e.facade=t,Ci(t,Ii,e),e},di=function(t){return Ti(t,Ii)?t[Ii]:{}},pi=function(t){return Ti(t,Ii)}}var Oi={set:ui,get:di,has:pi,enforce:function(t){return pi(t)?di(t):ui(t,{})},getterFor:function(t){return function(e){var i;if(!_i(e)||(i=di(e)).type!==t)throw Ri("Incompatible receiver, "+t+" required");return i}}},Li=R,Ui=f,Wi=Z,Fi=Kt,Ni=g,zi=oi.CONFIGURABLE,ji=fi,Hi=Oi.enforce,Gi=Oi.get,Vi=String,Xi=Object.defineProperty,Yi=Li("".slice),qi=Li("".replace),Ki=Li([].join),$i=Ni&&!Ui((function(){return 8!==Xi((function(){}),"length",{value:8}).length})),Zi=String(String).split("String"),Ji=ei.exports=function(t,e,i){"Symbol("===Yi(Vi(e),0,7)&&(e="["+qi(Vi(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!Fi(t,"name")||zi&&t.name!==e)&&(Ni?Xi(t,"name",{value:e,configurable:!0}):t.name=e),$i&&i&&Fi(i,"arity")&&t.length!==i.arity&&Xi(t,"length",{value:i.arity});try{i&&Fi(i,"constructor")&&i.constructor?Ni&&Xi(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=Hi(t);return Fi(n,"source")||(n.source=Ki(Zi,"string"==typeof e?e:"")),t};Function.prototype.toString=Ji((function(){return Wi(this)&&Gi(this).source||ji(this)}),"toString");var Qi=ei.exports,tn=Z,en=Oe,nn=Qi,rn=Wt,sn=function(t,e,i,n){n||(n={});var r=n.enumerable,s=void 0!==n.name?n.name:e;if(tn(i)&&nn(i,s,n),n.global)r?t[e]=i:rn(e,i);else{try{n.unsafe?t[e]&&(r=!0):delete t[e]}catch(t){}r?t[e]=i:en.f(t,e,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},an={},on=Math.ceil,hn=Math.floor,cn=Math.trunc||function(t){var e=+t;return(e>0?hn:on)(e)},ln=function(t){var e=+t;return e!=e||0===e?0:cn(e)},un=ln,dn=Math.max,pn=Math.min,fn=function(t,e){var i=un(t);return i<0?dn(i+e,0):pn(i,e)},gn=ln,yn=Math.min,mn=function(t){return t>0?yn(gn(t),9007199254740991):0},vn=function(t){return mn(t.length)},bn=Y,xn=fn,wn=vn,Sn=function(t){return function(e,i,n){var r,s=bn(e),a=wn(s),o=xn(n,a);if(t&&i!=i){for(;a>o;)if((r=s[o++])!=r)return!0}else for(;a>o;o++)if((t||o in s)&&s[o]===i)return t||o||0;return!t&&-1}},An={includes:Sn(!0),indexOf:Sn(!1)},_n=Kt,Cn=Y,Tn=An.indexOf,Bn=wi,Pn=R([].push),En=function(t,e){var i,n=Cn(t),r=0,s=[];for(i in n)!_n(Bn,i)&&_n(n,i)&&Pn(s,i);for(;e.length>r;)_n(n,i=e[r++])&&(~Tn(s,i)||Pn(s,i));return s},Mn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Rn=En,kn=Mn.concat("length","prototype");an.f=Object.getOwnPropertyNames||function(t){return Rn(t,kn)};var Dn={};Dn.f=Object.getOwnPropertySymbols;var In=rt,On=an,Ln=Dn,Un=Ne,Wn=R([].concat),Fn=In("Reflect","ownKeys")||function(t){var e=On.f(Un(t)),i=Ln.f;return i?Wn(e,i(t)):e},Nn=Kt,zn=Fn,jn=p,Hn=Oe,Gn=f,Vn=Z,Xn=/#|\.prototype\./,Yn=function(t,e){var i=Kn[qn(t)];return i==Zn||i!=$n&&(Vn(e)?Gn(e):!!e)},qn=Yn.normalize=function(t){return String(t).replace(Xn,".").toLowerCase()},Kn=Yn.data={},$n=Yn.NATIVE="N",Zn=Yn.POLYFILL="P",Jn=Yn,Qn=d,tr=p.f,er=ti,ir=sn,nr=Wt,rr=function(t,e,i){for(var n=zn(e),r=Hn.f,s=jn.f,a=0;a<n.length;a++){var o=n[a];Nn(t,o)||i&&Nn(i,o)||r(t,o,s(e,o))}},sr=Jn,ar=function(t,e){var i,r,s,a,o,h=t.target,c=t.global,l=t.stat;if(i=c?Qn:l?Qn[h]||nr(h,{}):(Qn[h]||{}).prototype)for(r in e){if(a=e[r],s=t.dontCallGetSet?(o=tr(i,r))&&o.value:i[r],!sr(c?r:h+(l?".":"#")+r,t.forced)&&void 0!==s){if(n(a)==n(s))continue;rr(a,s)}(t.sham||s&&s.sham)&&er(a,"sham",!0),ir(i,r,a,t)}},or={exports:{}},hr={},cr=be,lr=Oe,ur=T,dr=fn,pr=vn,fr=function(t,e,i){var n=cr(e);n in t?lr.f(t,n,ur(0,i)):t[n]=i},gr=Array,yr=Math.max,mr=O,vr=Y,br=an.f,xr=function(t,e,i){for(var n=pr(t),r=dr(e,n),s=dr(void 0===i?n:i,n),a=gr(yr(s-r,0)),o=0;r<s;r++,o++)fr(a,o,t[r]);return a.length=o,a},wr="object"==("undefined"==typeof window?"undefined":n(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];hr.f=function(t){return wr&&"Window"==mr(t)?function(t){try{return br(t)}catch(t){return xr(wr)}}(t):br(vr(t))};var Sr=f((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Ar=f,_r=et,Cr=O,Tr=Sr,Br=Object.isExtensible,Pr=Ar((function(){Br(1)}))||Tr?function(t){return!!_r(t)&&((!Tr||"ArrayBuffer"!=Cr(t))&&(!Br||Br(t)))}:Br,Er=!f((function(){return Object.isExtensible(Object.preventExtensions({}))})),Mr=ar,Rr=R,kr=wi,Dr=et,Ir=Kt,Or=Oe.f,Lr=an,Ur=hr,Wr=Pr,Fr=Er,Nr=!1,zr=te("meta"),jr=0,Hr=function(t){Or(t,zr,{value:{objectID:"O"+jr++,weakData:{}}})},Gr=or.exports={enable:function(){Gr.enable=function(){},Nr=!0;var t=Lr.f,e=Rr([].splice),i={};i[zr]=1,t(i).length&&(Lr.f=function(i){for(var n=t(i),r=0,s=n.length;r<s;r++)if(n[r]===zr){e(n,r,1);break}return n},Mr({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Ur.f}))},fastKey:function(t,e){if(!Dr(t))return"symbol"==n(t)?t:("string"==typeof t?"S":"P")+t;if(!Ir(t,zr)){if(!Wr(t))return"F";if(!e)return"E";Hr(t)}return t[zr].objectID},getWeakData:function(t,e){if(!Ir(t,zr)){if(!Wr(t))return!0;if(!e)return!1;Hr(t)}return t[zr].weakData},onFreeze:function(t){return Fr&&Nr&&Wr(t)&&!Ir(t,zr)&&Hr(t),t}};kr[zr]=!0;var Vr=or.exports,Xr=O,Yr=R,qr=function(t){if("Function"===Xr(t))return Yr(t)},Kr=Bt,$r=y,Zr=qr(qr.bind),Jr=function(t,e){return Kr(t),void 0===e?t:$r?Zr(t,e):function(){return t.apply(e,arguments)}},Qr={},ts=Qr,es=ce("iterator"),is=Array.prototype,ns={};ns[ce("toStringTag")]="z";var rs="[object z]"===String(ns),ss=Z,as=O,os=ce("toStringTag"),hs=Object,cs="Arguments"==as(function(){return arguments}()),ls=rs?as:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=hs(t),os))?i:cs?as(e):"Object"==(n=as(e))&&ss(e.callee)?"Arguments":n},us=ls,ds=Mt,ps=z,fs=Qr,gs=ce("iterator"),ys=function(t){if(!ps(t))return ds(t,gs)||ds(t,"@@iterator")||fs[us(t)]},ms=b,vs=Bt,bs=Ne,xs=At,ws=ys,Ss=TypeError,As=b,_s=Ne,Cs=Mt,Ts=Jr,Bs=b,Ps=Ne,Es=At,Ms=function(t){return void 0!==t&&(ts.Array===t||is[es]===t)},Rs=vn,ks=st,Ds=function(t,e){var i=arguments.length<2?ws(t):e;if(vs(i))return bs(ms(i,t));throw Ss(xs(t)+" is not iterable")},Is=ys,Os=function(t,e,i){var n,r;_s(t);try{if(!(n=Cs(t,"return"))){if("throw"===e)throw i;return i}n=As(n,t)}catch(t){r=!0,n=t}if("throw"===e)throw i;if(r)throw n;return _s(n),i},Ls=TypeError,Us=function(t,e){this.stopped=t,this.result=e},Ws=Us.prototype,Fs=function(t,e,i){var r,s,a,o,h,c,l,u=i&&i.that,d=!(!i||!i.AS_ENTRIES),p=!(!i||!i.IS_RECORD),f=!(!i||!i.IS_ITERATOR),g=!(!i||!i.INTERRUPTED),y=Ts(e,u),m=function(t){return r&&Os(r,"normal",t),new Us(!0,t)},v=function(t){return d?(Ps(t),g?y(t[0],t[1],m):y(t[0],t[1])):g?y(t,m):y(t)};if(p)r=t.iterator;else if(f)r=t;else{if(!(s=Is(t)))throw Ls(Es(t)+" is not iterable");if(Ms(s)){for(a=0,o=Rs(t);o>a;a++)if((h=v(t[a]))&&ks(Ws,h))return h;return new Us(!1)}r=Ds(t,s)}for(c=p?t.next:r.next;!(l=Bs(c,r)).done;){try{h=v(l.value)}catch(t){Os(r,"throw",t)}if("object"==n(h)&&h&&ks(Ws,h))return h}return new Us(!1)},Ns=st,zs=TypeError,js=function(t,e){if(Ns(e,t))return t;throw zs("Incorrect invocation")},Hs=ce("iterator"),Gs=!1;try{var Vs=0,Xs={next:function(){return{done:!!Vs++}},return:function(){Gs=!0}};Xs[Hs]=function(){return this},Array.from(Xs,(function(){throw 2}))}catch(t){}var Ys=Oe.f,qs=Kt,Ks=ce("toStringTag"),$s=function(t,e,i){t&&!i&&(t=t.prototype),t&&!qs(t,Ks)&&Ys(t,Ks,{configurable:!0,value:e})},Zs=R,Js=Bt,Qs=Z,ta=String,ea=TypeError,ia=function(t,e,i){try{return Zs(Js(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}},na=Ne,ra=function(t){if("object"==n(t)||Qs(t))return t;throw ea("Can't set "+ta(t)+" as a prototype")},sa=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=ia(Object.prototype,"__proto__","set"))(i,[]),e=i instanceof Array}catch(t){}return function(i,n){return na(i),ra(n),e?t(i,n):i.__proto__=n,i}}():void 0),aa=Z,oa=et,ha=sa,ca=ar,la=d,ua=R,da=Jn,pa=sn,fa=Vr,ga=Fs,ya=js,ma=Z,va=z,ba=et,xa=f,wa=function(t,e){if(!e&&!Gs)return!1;var i=!1;try{var n={};n[Hs]=function(){return{next:function(){return{done:i=!0}}}},t(n)}catch(t){}return i},Sa=$s,Aa=function(t,e,i){var n,r;return ha&&aa(n=e.constructor)&&n!==i&&oa(r=n.prototype)&&r!==i.prototype&&ha(t,r),t},_a=function(t,e,i){var n=-1!==t.indexOf("Map"),r=-1!==t.indexOf("Weak"),s=n?"set":"add",a=la[t],o=a&&a.prototype,h=a,c={},l=function(t){var e=ua(o[t]);pa(o,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(r&&!ba(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return r&&!ba(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(r&&!ba(t))&&e(this,0===t?0:t)}:function(t,i){return e(this,0===t?0:t,i),this})};if(da(t,!ma(a)||!(r||o.forEach&&!xa((function(){(new a).entries().next()})))))h=i.getConstructor(e,t,n,s),fa.enable();else if(da(t,!0)){var u=new h,d=u[s](r?{}:-0,1)!=u,p=xa((function(){u.has(1)})),f=wa((function(t){new a(t)})),g=!r&&xa((function(){for(var t=new a,e=5;e--;)t[s](e,e);return!t.has(-0)}));f||((h=e((function(t,e){ya(t,o);var i=Aa(new a,t,h);return va(e)||ga(e,i[s],{that:i,AS_ENTRIES:n}),i}))).prototype=o,o.constructor=h),(p||g)&&(l("delete"),l("has"),n&&l("get")),(g||d)&&l(s),r&&o.clear&&delete o.clear}return c[t]=h,ca({global:!0,constructor:!0,forced:h!=a},c),Sa(h,t),r||i.setStrong(h,t,n),h},Ca={},Ta=En,Ba=Mn,Pa=Object.keys||function(t){return Ta(t,Ba)},Ea=g,Ma=Le,Ra=Oe,ka=Ne,Da=Y,Ia=Pa;Ca.f=Ea&&!Ma?Object.defineProperties:function(t,e){ka(t);for(var i,n=Da(e),r=Ia(e),s=r.length,a=0;s>a;)Ra.f(t,i=r[a++],n[i]);return t};var Oa,La=rt("document","documentElement"),Ua=Ne,Wa=Ca,Fa=Mn,Na=wi,za=La,ja=Ae,Ha="prototype",Ga="script",Va=xi("IE_PROTO"),Xa=function(){},Ya=function(t){return"<"+Ga+">"+t+"</"+Ga+">"},qa=function(t){t.write(Ya("")),t.close();var e=t.parentWindow.Object;return t=null,e},Ka=function(){try{Oa=new ActiveXObject("htmlfile")}catch(t){}var t,e,i;Ka="undefined"!=typeof document?document.domain&&Oa?qa(Oa):(e=ja("iframe"),i="java"+Ga+":",e.style.display="none",za.appendChild(e),e.src=String(i),(t=e.contentWindow.document).open(),t.write(Ya("document.F=Object")),t.close(),t.F):qa(Oa);for(var n=Fa.length;n--;)delete Ka[Ha][Fa[n]];return Ka()};Na[Va]=!0;var $a,Za,Ja,Qa=Object.create||function(t,e){var i;return null!==t?(Xa[Ha]=Ua(t),i=new Xa,Xa[Ha]=null,i[Va]=t):i=Ka(),void 0===e?i:Wa.f(i,e)},to=Qi,eo=Oe,io=function(t,e,i){return i.get&&to(i.get,e,{getter:!0}),i.set&&to(i.set,e,{setter:!0}),eo.f(t,e,i)},no=sn,ro=function(t,e,i){for(var n in e)no(t,n,e[n],i);return t},so=!f((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),ao=Kt,oo=Z,ho=Xt,co=so,lo=xi("IE_PROTO"),uo=Object,po=uo.prototype,fo=co?uo.getPrototypeOf:function(t){var e=ho(t);if(ao(e,lo))return e[lo];var i=e.constructor;return oo(i)&&e instanceof i?i.prototype:e instanceof uo?po:null},go=f,yo=Z,mo=et,vo=fo,bo=sn,xo=ce("iterator"),wo=!1;[].keys&&("next"in(Ja=[].keys())?(Za=vo(vo(Ja)))!==Object.prototype&&($a=Za):wo=!0);var So=!mo($a)||go((function(){var t={};return $a[xo].call(t)!==t}));So&&($a={}),yo($a[xo])||bo($a,xo,(function(){return this}));var Ao={IteratorPrototype:$a,BUGGY_SAFARI_ITERATORS:wo},_o=Ao.IteratorPrototype,Co=Qa,To=T,Bo=$s,Po=Qr,Eo=function(){return this},Mo=ar,Ro=b,ko=Z,Do=function(t,e,i,n){var r=e+" Iterator";return t.prototype=Co(_o,{next:To(+!n,i)}),Bo(t,r,!1),Po[r]=Eo,t},Io=fo,Oo=sa,Lo=$s,Uo=ti,Wo=sn,Fo=Qr,No=oi.PROPER,zo=oi.CONFIGURABLE,jo=Ao.IteratorPrototype,Ho=Ao.BUGGY_SAFARI_ITERATORS,Go=ce("iterator"),Vo="keys",Xo="values",Yo="entries",qo=function(){return this},Ko=rt,$o=io,Zo=g,Jo=ce("species"),Qo=Qa,th=io,eh=ro,ih=Jr,nh=js,rh=z,sh=Fs,ah=function(t,e,i,n,r,s,a){Do(i,e,n);var o,h,c,l=function(t){if(t===r&&g)return g;if(!Ho&&t in p)return p[t];switch(t){case Vo:case Xo:case Yo:return function(){return new i(this,t)}}return function(){return new i(this)}},u=e+" Iterator",d=!1,p=t.prototype,f=p[Go]||p["@@iterator"]||r&&p[r],g=!Ho&&f||l(r),y="Array"==e&&p.entries||f;if(y&&(o=Io(y.call(new t)))!==Object.prototype&&o.next&&(Io(o)!==jo&&(Oo?Oo(o,jo):ko(o[Go])||Wo(o,Go,qo)),Lo(o,u,!0)),No&&r==Xo&&f&&f.name!==Xo&&(zo?Uo(p,"name",Xo):(d=!0,g=function(){return Ro(f,this)})),r)if(h={values:l(Xo),keys:s?g:l(Vo),entries:l(Yo)},a)for(c in h)(Ho||d||!(c in p))&&Wo(p,c,h[c]);else Mo({target:e,proto:!0,forced:Ho||d},h);return p[Go]!==g&&Wo(p,Go,g,{name:r}),Fo[e]=g,h},oh=function(t,e){return{value:t,done:e}},hh=function(t){var e=Ko(t);Zo&&e&&!e[Jo]&&$o(e,Jo,{configurable:!0,get:function(){return this}})},ch=g,lh=Vr.fastKey,uh=Oi.set,dh=Oi.getterFor,ph={getConstructor:function(t,e,i,n){var r=t((function(t,r){nh(t,s),uh(t,{type:e,index:Qo(null),first:void 0,last:void 0,size:0}),ch||(t.size=0),rh(r)||sh(r,t[n],{that:t,AS_ENTRIES:i})})),s=r.prototype,a=dh(e),o=function(t,e,i){var n,r,s=a(t),o=h(t,e);return o?o.value=i:(s.last=o={index:r=lh(e,!0),key:e,value:i,previous:n=s.last,next:void 0,removed:!1},s.first||(s.first=o),n&&(n.next=o),ch?s.size++:t.size++,"F"!==r&&(s.index[r]=o)),t},h=function(t,e){var i,n=a(t),r=lh(e);if("F"!==r)return n.index[r];for(i=n.first;i;i=i.next)if(i.key==e)return i};return eh(s,{clear:function(){for(var t=a(this),e=t.index,i=t.first;i;)i.removed=!0,i.previous&&(i.previous=i.previous.next=void 0),delete e[i.index],i=i.next;t.first=t.last=void 0,ch?t.size=0:this.size=0},delete:function(t){var e=this,i=a(e),n=h(e,t);if(n){var r=n.next,s=n.previous;delete i.index[n.index],n.removed=!0,s&&(s.next=r),r&&(r.previous=s),i.first==n&&(i.first=r),i.last==n&&(i.last=s),ch?i.size--:e.size--}return!!n},forEach:function(t){for(var e,i=a(this),n=ih(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:i.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!h(this,t)}}),eh(s,i?{get:function(t){var e=h(this,t);return e&&e.value},set:function(t,e){return o(this,0===t?0:t,e)}}:{add:function(t){return o(this,t=0===t?0:t,t)}}),ch&&th(s,"size",{configurable:!0,get:function(){return a(this).size}}),r},setStrong:function(t,e,i){var n=e+" Iterator",r=dh(e),s=dh(n);ah(t,e,(function(t,e){uh(this,{type:n,target:t,state:r(t),kind:e,last:void 0})}),(function(){for(var t=s(this),e=t.kind,i=t.last;i&&i.removed;)i=i.previous;return t.target&&(t.last=i=i?i.next:t.state.first)?oh("keys"==e?i.key:"values"==e?i.value:[i.key,i.value],!1):(t.target=void 0,oh(void 0,!0))}),i?"entries":"values",!i,!0),hh(e)}};_a("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),ph);var fh=O,gh=Array.isArray||function(t){return"Array"==fh(t)},yh=R,mh=f,vh=Z,bh=ls,xh=fi,wh=function(){},Sh=[],Ah=rt("Reflect","construct"),_h=/^\s*(?:class|function)\b/,Ch=yh(_h.exec),Th=!_h.exec(wh),Bh=function(t){if(!vh(t))return!1;try{return Ah(wh,Sh,t),!0}catch(t){return!1}},Ph=function(t){if(!vh(t))return!1;switch(bh(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Th||!!Ch(_h,xh(t))}catch(t){return!0}};Ph.sham=!0;var Eh=!Ah||mh((function(){var t;return Bh(Bh.call)||!Bh(Object)||!Bh((function(){t=!0}))||t}))?Ph:Bh,Mh=gh,Rh=Eh,kh=et,Dh=ce("species"),Ih=Array,Oh=function(t){var e;return Mh(t)&&(e=t.constructor,(Rh(e)&&(e===Ih||Mh(e.prototype))||kh(e)&&null===(e=e[Dh]))&&(e=void 0)),void 0===e?Ih:e},Lh=Jr,Uh=N,Wh=Xt,Fh=vn,Nh=function(t,e){return new(Oh(t))(0===e?0:e)},zh=R([].push),jh=function(t){var e=1==t,i=2==t,n=3==t,r=4==t,s=6==t,a=7==t,o=5==t||s;return function(h,c,l,u){for(var d,p,f=Wh(h),g=Uh(f),y=Lh(c,l),m=Fh(g),v=0,b=u||Nh,x=e?b(h,m):i||a?b(h,0):void 0;m>v;v++)if((o||v in g)&&(p=y(d=g[v],v,f),t))if(e)x[v]=p;else if(p)switch(t){case 3:return!0;case 5:return d;case 6:return v;case 2:zh(x,d)}else switch(t){case 4:return!1;case 7:zh(x,d)}return s?-1:n||r?r:x}},Hh={forEach:jh(0),map:jh(1),filter:jh(2),some:jh(3),every:jh(4),find:jh(5),findIndex:jh(6),filterReject:jh(7)},Gh=R,Vh=ro,Xh=Vr.getWeakData,Yh=js,qh=Ne,Kh=z,$h=et,Zh=Fs,Jh=Kt,Qh=Oi.set,tc=Oi.getterFor,ec=Hh.find,ic=Hh.findIndex,nc=Gh([].splice),rc=0,sc=function(t){return t.frozen||(t.frozen=new ac)},ac=function(){this.entries=[]},oc=function(t,e){return ec(t.entries,(function(t){return t[0]===e}))};ac.prototype={get:function(t){var e=oc(this,t);if(e)return e[1]},has:function(t){return!!oc(this,t)},set:function(t,e){var i=oc(this,t);i?i[1]=e:this.entries.push([t,e])},delete:function(t){var e=ic(this.entries,(function(e){return e[0]===t}));return~e&&nc(this.entries,e,1),!!~e}};var hc,cc={getConstructor:function(t,e,i,n){var r=t((function(t,r){Yh(t,s),Qh(t,{type:e,id:rc++,frozen:void 0}),Kh(r)||Zh(r,t[n],{that:t,AS_ENTRIES:i})})),s=r.prototype,a=tc(e),o=function(t,e,i){var n=a(t),r=Xh(qh(e),!0);return!0===r?sc(n).set(e,i):r[n.id]=i,t};return Vh(s,{delete:function(t){var e=a(this);if(!$h(t))return!1;var i=Xh(t);return!0===i?sc(e).delete(t):i&&Jh(i,e.id)&&delete i[e.id]},has:function(t){var e=a(this);if(!$h(t))return!1;var i=Xh(t);return!0===i?sc(e).has(t):i&&Jh(i,e.id)}}),Vh(s,i?{get:function(t){var e=a(this);if($h(t)){var i=Xh(t);return!0===i?sc(e).get(t):i?i[e.id]:void 0}},set:function(t,e){return o(this,t,e)}}:{add:function(t){return o(this,t,!0)}}),r}},lc=Er,uc=d,dc=R,pc=ro,fc=Vr,gc=_a,yc=cc,mc=et,vc=Oi.enforce,bc=f,xc=mi,wc=Object,Sc=Array.isArray,Ac=wc.isExtensible,_c=wc.isFrozen,Cc=wc.isSealed,Tc=wc.freeze,Bc=wc.seal,Pc={},Ec={},Mc=!uc.ActiveXObject&&"ActiveXObject"in uc,Rc=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},kc=gc("WeakMap",Rc,yc),Dc=kc.prototype,Ic=dc(Dc.set);if(xc)if(Mc){hc=yc.getConstructor(Rc,"WeakMap",!0),fc.enable();var Oc=dc(Dc.delete),Lc=dc(Dc.has),Uc=dc(Dc.get);pc(Dc,{delete:function(t){if(mc(t)&&!Ac(t)){var e=vc(this);return e.frozen||(e.frozen=new hc),Oc(this,t)||e.frozen.delete(t)}return Oc(this,t)},has:function(t){if(mc(t)&&!Ac(t)){var e=vc(this);return e.frozen||(e.frozen=new hc),Lc(this,t)||e.frozen.has(t)}return Lc(this,t)},get:function(t){if(mc(t)&&!Ac(t)){var e=vc(this);return e.frozen||(e.frozen=new hc),Lc(this,t)?Uc(this,t):e.frozen.get(t)}return Uc(this,t)},set:function(t,e){if(mc(t)&&!Ac(t)){var i=vc(this);i.frozen||(i.frozen=new hc),Lc(this,t)?Ic(this,t,e):i.frozen.set(t,e)}else Ic(this,t,e);return this}})}else lc&&bc((function(){var t=Tc([]);return Ic(new kc,t,1),!_c(t)}))&&pc(Dc,{set:function(t,e){var i;return Sc(t)&&(_c(t)?i=Pc:Cc(t)&&(i=Ec)),Ic(this,t,e),i==Pc&&Tc(t),i==Ec&&Bc(t),this}});var Wc=rt,Fc=R,Nc=Ht,zc=Wc("Map"),jc=Wc("WeakMap"),Hc=Fc([].push),Gc=Nc("metadata"),Vc=Gc.store||(Gc.store=new jc),Xc=function(t,e,i){var n=Vc.get(t);if(!n){if(!i)return;Vc.set(t,n=new zc)}var r=n.get(e);if(!r){if(!i)return;n.set(e,r=new zc)}return r},Yc={store:Vc,getMap:Xc,has:function(t,e,i){var n=Xc(e,i,!1);return void 0!==n&&n.has(t)},get:function(t,e,i){var n=Xc(e,i,!1);return void 0===n?void 0:n.get(t)},set:function(t,e,i,n){Xc(i,n,!0).set(t,e)},keys:function(t,e){var i=Xc(t,e,!1),n=[];return i&&i.forEach((function(t,e){Hc(n,e)})),n},toKey:function(t){return void 0===t||"symbol"==n(t)?t:String(t)}},qc=Ne,Kc=Yc.toKey,$c=Yc.set;ar({target:"Reflect",stat:!0},{defineMetadata:function(t,e,i){var n=arguments.length<4?void 0:Kc(arguments[3]);$c(t,e,qc(i),n)}});var Zc=Ne,Jc=Yc.toKey,Qc=Yc.getMap,tl=Yc.store;ar({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var i=arguments.length<3?void 0:Jc(arguments[2]),n=Qc(Zc(e),i,!1);if(void 0===n||!n.delete(t))return!1;if(n.size)return!0;var r=tl.get(e);return r.delete(i),!!r.size||tl.delete(e)}});var el=Ne,il=fo,nl=Yc.has,rl=Yc.get,sl=Yc.toKey,al=function t(e,i,n){if(nl(e,i,n))return rl(e,i,n);var r=il(i);return null!==r?t(e,r,n):void 0};ar({target:"Reflect",stat:!0},{getMetadata:function(t,e){var i=arguments.length<3?void 0:sl(arguments[2]);return al(t,el(e),i)}});var ol=R,hl=Map.prototype,cl={Map:Map,set:ol(hl.set),get:ol(hl.get),has:ol(hl.has),remove:ol(hl.delete),proto:hl},ll=b,ul=R,dl=function(t,e,i){for(var n,r,s=i||t.next;!(n=ll(s,t)).done;)if(void 0!==(r=e(n.value)))return r},pl=cl.Map,fl=cl.proto,gl=ul(fl.forEach),yl=ul(fl.entries),ml=yl(new pl).next,vl=Bt,bl=z,xl=vn,wl=Xt,Sl=function(t,e,i){return i?dl(yl(t),(function(t){return e(t[1],t[0])}),ml):gl(t,e)},Al=cl.Map,_l=cl.has,Cl=cl.set,Tl=R([].push),Bl=ar,Pl=R,El=Yc,Ml=Ne,Rl=fo,kl=Pl((function(t){var e,i,n,r=wl(this),s=xl(r),a=[],o=new Al,h=bl(t)?function(t){return t}:vl(t);for(e=0;e<s;e++)n=h(i=r[e]),_l(o,n)||Cl(o,n,i);return Sl(o,(function(t){Tl(a,t)})),a})),Dl=Pl([].concat),Il=El.keys,Ol=El.toKey,Ll=function t(e,i){var n=Il(e,i),r=Rl(e);if(null===r)return n;var s=t(r,i);return s.length?n.length?kl(Dl(n,s)):s:n};Bl({target:"Reflect",stat:!0},{getMetadataKeys:function(t){var e=arguments.length<2?void 0:Ol(arguments[1]);return Ll(Ml(t),e)}});var Ul=Ne,Wl=Yc.get,Fl=Yc.toKey;ar({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var i=arguments.length<3?void 0:Fl(arguments[2]);return Wl(t,Ul(e),i)}});var Nl=Ne,zl=Yc.keys,jl=Yc.toKey;ar({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:jl(arguments[1]);return zl(Nl(t),e)}});var Hl=Ne,Gl=fo,Vl=Yc.has,Xl=Yc.toKey,Yl=function t(e,i,n){if(Vl(e,i,n))return!0;var r=Gl(i);return null!==r&&t(e,r,n)};ar({target:"Reflect",stat:!0},{hasMetadata:function(t,e){var i=arguments.length<3?void 0:Xl(arguments[2]);return Yl(t,Hl(e),i)}});var ql=Ne,Kl=Yc.has,$l=Yc.toKey;ar({target:"Reflect",stat:!0},{hasOwnMetadata:function(t,e){var i=arguments.length<3?void 0:$l(arguments[2]);return Kl(t,ql(e),i)}});var Zl=Ne,Jl=Yc.toKey,Ql=Yc.set;ar({target:"Reflect",stat:!0},{metadata:function(t,e){return function(i,n){Ql(t,e,Zl(i),Jl(n))}}});var tu="named",eu="name",iu="unmanaged",nu="optional",ru="inject",su="multi_inject",au="inversify:tagged",ou="inversify:tagged_props",hu="inversify:paramtypes",cu="post_construct",lu="pre_destroy";var uu=[ru,su,eu,iu,tu,nu],du={Request:"Request",Singleton:"Singleton",Transient:"Transient"},pu={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},fu={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},gu=0;function yu(){return gu++}var mu=function(){function t(t,e){this.id=yu(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=pu.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===du.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.onDeactivation=this.onDeactivation,e.cache=this.cache,e},t}(),vu="Metadata key was used more than once in a parameter:",bu="NULL argument",xu="Key Not Found",wu="Ambiguous match found for serviceIdentifier:",Su="No matching bindings found for serviceIdentifier:",Au="Missing required @injectable annotation in:",_u="Missing required @inject or @multiInject annotation in:",Cu="Circular dependency found:",Tu="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",Bu=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},Pu=function(t,e){return"@postConstruct error in class "+t+": "+e},Eu=function(t,e){return"@preDestroy error in class "+t+": "+e},Mu=function(t,e){return"onDeactivation() error in class "+t+": "+e},Ru="Maximum call stack size exceeded",ku=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(hu,t),userGeneratedMetadata:Reflect.getMetadata(au,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(ou,t)||[]},t}(),Du={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function Iu(t){return t instanceof RangeError||t.message===Ru}function Ou(t){return"function"==typeof t?t.name:"symbol"===n(t)?t.toString():t}function Lu(t,e,i){var n="",r=i(t,e);return 0!==r.length&&(n="\nRegistered bindings:",r.forEach((function(t){var e="Object";null!==t.implementationType&&(e=Fu(t.implementationType)),n=n+"\n "+e,t.constraint.metaData&&(n=n+" - "+t.constraint.metaData)}))),n}function Uu(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||Uu(t.parentRequest,e))}function Wu(t){t.childRequests.forEach((function(t){if(Uu(t,t.serviceIdentifier)){var e=function(t){var e=function t(e,i){void 0===i&&(i=[]);var n=Ou(e.serviceIdentifier);return i.push(n),null!==e.parentRequest?t(e.parentRequest,i):i}(t);return e.reverse().join(" --\x3e ")}(t);throw new Error(Cu+" "+e)}Wu(t)}))}function Fu(t){if(t.name)return t.name;var e=t.toString(),i=e.match(/^function\s*([^\s(]+)/);return i?i[1]:"Anonymous function: "+e}var Nu=function(){function t(t){this.id=yu(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}(),zu=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===tu?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},t}(),ju=function(t,e){this.parentContext=t,this.rootRequest=e},Hu=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}(),Gu=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,i=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},i)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}(),Vu=function(){function t(t,e,i,r){this.id=yu(),this.type=t,this.serviceIdentifier=i;var s="symbol"===n(e)?e.toString().slice(7,-1):e;this.name=new Gu(s||""),this.identifier=e,this.metadata=new Array;var a=null;"string"==typeof r?a=new zu(tu,r):r instanceof zu&&(a=r),null!==a&&this.metadata.push(a)}return t.prototype.hasTag=function(t){for(var e=0,i=this.metadata;e<i.length;e++){if(i[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(su)},t.prototype.matchesArray=function(t){return this.matchesTag(su)(t)},t.prototype.isNamed=function(){return this.hasTag(tu)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return uu.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(nu)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===tu}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return uu.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(tu)(t)},t.prototype.matchesTag=function(t){var e=this;return function(i){for(var n=0,r=e.metadata;n<r.length;n++){var s=r[n];if(s.key===t&&s.value===i)return!0}return!1}},t}(),Xu=function(t,e,i){if(i||2===arguments.length)for(var n,r=0,s=e.length;r<s;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))};function Yu(t,e,i,n){var r=t.getConstructorMetadata(i),s=r.compilerGeneratedMetadata;if(void 0===s)throw new Error(Au+" "+e+".");var a=r.userGeneratedMetadata,o=Object.keys(a),h=0===i.length&&o.length>0,c=o.length>i.length,l=function(t,e,i,n,r){for(var s=[],a=0;a<r;a++){var o=qu(a,t,e,i,n);null!==o&&s.push(o)}return s}(n,e,s,a,h||c?o.length:i.length),u=$u(t,i,e);return Xu(Xu([],l,!0),u,!0)}function qu(t,e,i,n,r){var s=r[t.toString()]||[],a=Ju(s),o=!0!==a.unmanaged,h=n[t],c=a.inject||a.multiInject;if((h=c||h)instanceof Hu&&(h=h.unwrap()),o){if(!e&&(h===Object||h===Function||void 0===h))throw new Error(_u+" argument "+t+" in class "+i+".");var l=new Vu(fu.ConstructorArgument,a.targetName,h);return l.metadata=s,l}return null}function Ku(t,e,i,n){var r=t||e;if(void 0===r){var s=Au+" for property "+String(i)+" in class "+n+".";throw new Error(s)}return r}function $u(t,e,i){for(var n=t.getPropertiesMetadata(e),r=[],s=Object.getOwnPropertySymbols(n),a=0,o=Object.keys(n).concat(s);a<o.length;a++){var h=o[a],c=n[h],l=Ju(c),u=l.targetName||h,d=Ku(l.inject,l.multiInject,h,i),p=new Vu(fu.ClassProperty,u,d);p.metadata=c,r.push(p)}var f=Object.getPrototypeOf(e.prototype).constructor;if(f!==Object){var g=$u(t,f,i);r=Xu(Xu([],r,!0),g,!0)}return r}function Zu(t,e){var i=Object.getPrototypeOf(e.prototype).constructor;if(i!==Object){var n=Yu(t,Fu(i),i,!0),r=n.map((function(t){return t.metadata.filter((function(t){return t.key===iu}))})),s=[].concat.apply([],r).length,a=n.length-s;return a>0?a:Zu(t,i)}return 0}function Ju(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[ru],multiInject:e[su],targetName:e[eu],unmanaged:e[iu]}}var Qu=function(){function t(t,e,i,n,r){this.id=yu(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=i,this.target=r,this.childRequests=[],this.bindings=Array.isArray(n)?n:[n],this.requestScope=null===i?new Map:null}return t.prototype.addChildRequest=function(e,i,n){var r=new t(e,this.parentContext,this,i,n);return this.childRequests.push(r),r},t}();function td(t){return t._bindingDictionary}function ed(t,e,i,n,r){var s=nd(i.container,r.serviceIdentifier),a=[];return s.length===Du.NoBindingsAvailable&&i.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(i.container.bind(r.serviceIdentifier).toSelf(),s=nd(i.container,r.serviceIdentifier)),a=e?s:s.filter((function(t){var e=new Qu(t.serviceIdentifier,i,n,t,r);return t.constraint(e)})),function(t,e,i,n){switch(e.length){case Du.NoBindingsAvailable:if(i.isOptional())return e;var r=Ou(t),s=Su;throw s+=function(t,e){if(e.isTagged()||e.isNamed()){var i="",n=e.getNamedTag(),r=e.getCustomTags();return null!==n&&(i+=n.toString()+"\n"),null!==r&&r.forEach((function(t){i+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+i}return" "+t}(r,i),s+=Lu(n,r,nd),new Error(s);case Du.OnlyOneBindingAvailable:return e;case Du.MultipleBindingsAvailable:default:if(i.isArray())return e;r=Ou(t),s=wu+" "+r;throw s+=Lu(n,r,nd),new Error(s)}}(r.serviceIdentifier,a,r,i.container),a}function id(t,e,i,n,r,s){var a,o;if(null===r){a=ed(t,e,n,null,s),o=new Qu(i,n,null,a,s);var h=new ju(n,o);n.addPlan(h)}else a=ed(t,e,n,r,s),o=r.addChildRequest(s.serviceIdentifier,a,s);a.forEach((function(e){var i=null;if(s.isArray())i=o.addChildRequest(e.serviceIdentifier,e,s);else{if(e.cache)return;i=o}if(e.type===pu.Instance&&null!==e.implementationType){var r=function(t,e){return Yu(t,Fu(e),e,!1)}(t,e.implementationType);if(!n.container.options.skipBaseClassChecks){var a=Zu(t,e.implementationType);if(r.length<a){var h=Bu(Fu(e.implementationType));throw new Error(h)}}r.forEach((function(e){id(t,!1,e.serviceIdentifier,n,i,e)}))}}))}function nd(t,e){var i=[],n=td(t);return n.hasKey(e)?i=n.get(e):null!==t.parent&&(i=nd(t.parent,e)),i}function rd(t,e,i,n,r,s,a,o){void 0===o&&(o=!1);var h=new Nu(e),c=function(t,e,i,n,r,s){var a=new zu(t?su:ru,i),o=new Vu(e,n,i,a);if(void 0!==r){var h=new zu(r,s);o.metadata.push(h)}return o}(i,n,r,"",s,a);try{return id(t,o,r,h,null,c),h}catch(t){throw Iu(t)&&Wu(h.plan.rootRequest),t}}function sd(t){return("object"===n(t)&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function ad(t){return!!sd(t)||Array.isArray(t)&&t.some(sd)}var od,hd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))},cd=function(t,e){var i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},ld=function(t,e,i){t.has(e.id)||t.set(e.id,i)},ud=function(t,e){t.cache=e,t.activated=!0,sd(e)&&dd(t,e)},dd=function(t,e){return hd(void 0,void 0,void 0,(function(){var i,n;return cd(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e];case 1:return i=r.sent(),t.cache=i,[3,3];case 2:throw n=r.sent(),t.cache=null,t.activated=!1,n;case 3:return[2]}}))}))};!function(t){t.DynamicValue="toDynamicValue",t.Factory="toFactory",t.Provider="toProvider"}(od||(od={}));var pd=function(){return pd=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},pd.apply(this,arguments)},fd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))},gd=function(t,e){var i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},yd=function(t,e,i){if(i||2===arguments.length)for(var n,r=0,s=e.length;r<s;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))};function md(t,e,i){var n;if(e.length>0){var r=function(t,e){return t.reduce((function(t,i){var n=e(i);return i.target.type===fu.ConstructorArgument?t.constructorInjections.push(n):(t.propertyRequests.push(i),t.propertyInjections.push(n)),t.isAsync||(t.isAsync=ad(n)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,i),s=pd(pd({},r),{constr:t});n=r.isAsync?function(t){return fd(this,void 0,void 0,(function(){var e,i;return gd(this,(function(n){switch(n.label){case 0:return[4,bd(t.constructorInjections)];case 1:return e=n.sent(),[4,bd(t.propertyInjections)];case 2:return i=n.sent(),[2,vd(pd(pd({},t),{constructorInjections:e,propertyInjections:i}))]}}))}))}(s):vd(s)}else n=new t;return n}function vd(t){var e,i=new((e=t.constr).bind.apply(e,yd([void 0],t.constructorInjections,!1)));return t.propertyRequests.forEach((function(e,n){var r=e.target.identifier,s=t.propertyInjections[n];i[r]=s})),i}function bd(t){return fd(this,void 0,void 0,(function(){var e,i,n,r;return gd(this,(function(s){for(e=[],i=0,n=t;i<n.length;i++)r=n[i],Array.isArray(r)?e.push(Promise.all(r)):e.push(r);return[2,Promise.all(e)]}))}))}function xd(t,e){var i=function(t,e){var i,n;if(Reflect.hasMetadata(cu,t)){var r=Reflect.getMetadata(cu,t);try{return null===(n=(i=e)[r.value])||void 0===n?void 0:n.call(i)}catch(e){throw new Error(Pu(t.name,e.message))}}}(t,e);return sd(i)?i.then((function(){return e})):e}function wd(t,e){t.scope!==du.Singleton&&function(t,e){var i="Class cannot be instantiated in "+(t.scope===du.Request?"request":"transient")+" scope.";if("function"==typeof t.onDeactivation)throw new Error(Mu(e.name,i));if(Reflect.hasMetadata(lu,e))throw new Error(Eu(e.name,i))}(t,e)}var Sd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))},Ad=function(t,e){var i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},_d=function t(e){return function(i){i.parentContext.setCurrentRequest(i);var n=i.bindings,r=i.childRequests,s=i.target&&i.target.isArray(),a=!(i.parentRequest&&i.parentRequest.target&&i.target&&i.parentRequest.target.matchesArray(i.target.serviceIdentifier));if(s&&a)return r.map((function(i){return t(e)(i)}));if(!i.target.isOptional()||0!==n.length){var o=n[0];return Pd(e,i,o)}}},Cd=function(t,e){var i=function(t){switch(t.type){case pu.Factory:return{factory:t.factory,factoryType:od.Factory};case pu.Provider:return{factory:t.provider,factoryType:od.Provider};case pu.DynamicValue:return{factory:t.dynamicValue,factoryType:od.DynamicValue};default:throw new Error("Unexpected factory type "+t.type)}}(t);return function(t,e){try{return t()}catch(t){throw Iu(t)&&(t=e()),t}}((function(){return i.factory.bind(t)(e)}),(function(){return new Error((t=i.factoryType,n=e.currentRequest.serviceIdentifier.toString(),"It looks like there is a circular dependency in one of the '"+t+"' bindings. Please investigate bindings withservice identifier '"+n+"'."));var t,n}))},Td=function(t,e,i){var n,r=e.childRequests;switch(function(t){var e=null;switch(t.type){case pu.ConstantValue:case pu.Function:e=t.cache;break;case pu.Constructor:case pu.Instance:e=t.implementationType;break;case pu.DynamicValue:e=t.dynamicValue;break;case pu.Provider:e=t.provider;break;case pu.Factory:e=t.factory}if(null===e){var i=Ou(t.serviceIdentifier);throw new Error("Invalid binding type: "+i)}}(i),i.type){case pu.ConstantValue:case pu.Function:n=i.cache;break;case pu.Constructor:n=i.implementationType;break;case pu.Instance:n=function(t,e,i,n){wd(t,e);var r=md(e,i,n);return sd(r)?r.then((function(t){return xd(e,t)})):xd(e,r)}(i,i.implementationType,r,_d(t));break;default:n=Cd(i,e.parentContext)}return n},Bd=function(t,e,i){var n=function(t,e){return e.scope===du.Singleton&&e.activated?e.cache:e.scope===du.Request&&t.has(e.id)?t.get(e.id):null}(t,e);return null!==n||function(t,e,i){e.scope===du.Singleton&&ud(e,i),e.scope===du.Request&&ld(t,e,i)}(t,e,n=i()),n},Pd=function(t,e,i){return Bd(t,i,(function(){var n=Td(t,e,i);return n=sd(n)?n.then((function(t){return Ed(e,i,t)})):Ed(e,i,n)}))};function Ed(t,e,i){var n,r=Md(t.parentContext,e,i),s=Id(t.parentContext.container),a=s.next();do{n=a.value;var o=t.parentContext,h=t.serviceIdentifier,c=Dd(n,h);r=sd(r)?kd(c,o,r):Rd(c,o,r),a=s.next()}while(!0!==a.done&&!td(n).hasKey(t.serviceIdentifier));return r}var Md=function(t,e,i){return"function"==typeof e.onActivation?e.onActivation(t,i):i},Rd=function(t,e,i){for(var n=t.next();!n.done;){if(sd(i=n.value(e,i)))return kd(t,e,i);n=t.next()}return i},kd=function(t,e,i){return Sd(void 0,void 0,void 0,(function(){var n,r;return Ad(this,(function(s){switch(s.label){case 0:return[4,i];case 1:n=s.sent(),r=t.next(),s.label=2;case 2:return r.done?[3,4]:[4,r.value(e,n)];case 3:return n=s.sent(),r=t.next(),[3,2];case 4:return[2,n]}}))}))},Dd=function(t,e){var i=t._activations;return i.hasKey(e)?i.get(e).values():[].values()},Id=function(t){for(var e=[t],i=t.parent;null!==i;)e.push(i),i=i.parent;return{next:function(){var t=e.pop();return void 0!==t?{done:!1,value:t}:{done:!0,value:void 0}}}};var Od=function t(e,i){var n=e.parentRequest;return null!==n&&(!!i(n)||t(n,i))},Ld=function(t){return function(e){var i=function(i){return null!==i&&null!==i.target&&i.target.matchesTag(t)(e)};return i.metaData=new zu(t,e),i}},Ud=Ld(tu),Wd=function(t){return function(e){var i=null;if(null!==e){if(i=e.bindings[0],"string"==typeof t)return i.serviceIdentifier===t;var n=e.bindings[0].implementationType;return t===n}return!1}},Fd=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new Nd(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=Ud(t),new Nd(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t&&(null!==t.target&&!t.target.isNamed()&&!t.target.isTagged())},new Nd(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=Ld(t)(e),new Nd(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return null!==e&&Wd(t)(e.parentRequest)},new Nd(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Ud(t)(e.parentRequest)},new Nd(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&Ld(t)(e)(i.parentRequest)},new Nd(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&Od(e,Wd(t))},new Nd(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&!Od(e,Wd(t))},new Nd(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Od(e,Ud(t))},new Nd(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&!Od(e,Ud(t))},new Nd(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&Od(i,Ld(t)(e))},new Nd(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&!Od(i,Ld(t)(e))},new Nd(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&Od(e,t)},new Nd(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&!Od(e,t)},new Nd(this._binding)},t}(),Nd=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new Fd(this._binding)},t.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new Fd(this._binding)},t}(),zd=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Fd(this._binding),this._bindingOnSyntax=new Nd(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),jd=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=du.Request,new zd(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=du.Transient,new zd(this._binding)},t}(),Hd=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Fd(this._binding),this._bindingOnSyntax=new Nd(this._binding),this._bindingInSyntax=new jd(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),Gd=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=pu.Instance,this._binding.implementationType=t,new Hd(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=pu.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=pu.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Hd(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=pu.Constructor,this._binding.implementationType=t,this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=pu.Factory,this._binding.factory=t,this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error("Value provided to function binding must be a function!");var e=this.toConstantValue(t);return this._binding.type=pu.Function,this._binding.scope=du.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=pu.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toAutoNamedFactory=function(t){return this._binding.type=pu.Factory,this._binding.factory=function(e){return function(i){return e.container.getNamed(t,i)}},new zd(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=pu.Provider,this._binding.provider=t,this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}(),Vd=function(){function t(){}return t.of=function(e,i,n,r,s){var a=new t;return a.bindings=e,a.middleware=i,a.deactivations=r,a.activations=n,a.moduleActivationStore=s,a},t}();var Xd=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(bu);if(null==e)throw new Error(bu);var i=this._map.get(t);void 0!==i?i.push(e):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(bu);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(xu)},t.prototype.remove=function(t){if(null==t)throw new Error(bu);if(!this._map.delete(t))throw new Error(xu)},t.prototype.removeIntersection=function(t){var e=this;this.traverse((function(i,n){var r=t.hasKey(i)?t.get(i):void 0;if(void 0!==r){var s=n.filter((function(t){return!r.some((function(e){return t===e}))}));e._setValue(i,s)}}))},t.prototype.removeByCondition=function(t){var e=this,i=[];return this._map.forEach((function(n,r){for(var s=[],a=0,o=n;a<o.length;a++){var h=o[a];t(h)?i.push(h):s.push(h)}e._setValue(r,s)})),i},t.prototype.hasKey=function(t){if(null==t)throw new Error(bu);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,i){t.forEach((function(t){return e.add(i,"object"===n(r=t)&&null!==r&&"clone"in r&&"function"==typeof r.clone?t.clone():t);var r}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,i){t(i,e)}))},t.prototype._setValue=function(t,e){e.length>0?this._map.set(t,e):this._map.delete(t)},t}(),Yd=function(){function t(){this._map=new Map}return t.prototype.remove=function(t){if(this._map.has(t)){var e=this._map.get(t);return this._map.delete(t),e}return this._getEmptyHandlersStore()},t.prototype.addDeactivation=function(t,e,i){this._getModuleActivationHandlers(t).onDeactivations.add(e,i)},t.prototype.addActivation=function(t,e,i){this._getModuleActivationHandlers(t).onActivations.add(e,i)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,i){e._map.set(i,{onActivations:t.onActivations.clone(),onDeactivations:t.onDeactivations.clone()})})),e},t.prototype._getModuleActivationHandlers=function(t){var e=this._map.get(t);return void 0===e&&(e=this._getEmptyHandlersStore(),this._map.set(t,e)),e},t.prototype._getEmptyHandlersStore=function(){return{onActivations:new Xd,onDeactivations:new Xd}},t}(),qd=function(){return qd=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},qd.apply(this,arguments)},Kd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))},$d=function(t,e){var i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},Zd=function(t,e,i){if(i||2===arguments.length)for(var n,r=0,s=e.length;r<s;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))},Jd=function(){function t(t){var e=t||{};if("object"!==n(e))throw new Error("Invalid Container constructor argument. Container options must be an object.");if(void 0===e.defaultScope)e.defaultScope=du.Transient;else if(e.defaultScope!==du.Singleton&&e.defaultScope!==du.Transient&&e.defaultScope!==du.Request)throw new Error("Invalid Container option. Default scope must be a string ('singleton' or 'transient').");if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error("Invalid Container option. Auto bind injectable must be a boolean");if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error("Invalid Container option. Skip base check must be a boolean");this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=yu(),this._bindingDictionary=new Xd,this._snapshots=[],this._middleware=null,this._activations=new Xd,this._deactivations=new Xd,this.parent=null,this._metadataReader=new ku,this._moduleActivationStore=new Yd}return t.merge=function(e,i){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=new t,a=Zd([e,i],n,!0).map((function(t){return td(t)})),o=td(s);return a.forEach((function(t){var e;e=o,t.traverse((function(t,i){i.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))})),s},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=this._getContainerModuleHelpersFactory(),n=0,r=t;n<r.length;n++){var s=r[n],a=i(s.id);s.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction,a.unbindAsyncFunction,a.onActivationFunction,a.onDeactivationFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Kd(this,void 0,void 0,(function(){var e,i,n,r,s;return $d(this,(function(a){switch(a.label){case 0:e=this._getContainerModuleHelpersFactory(),i=0,n=t,a.label=1;case 1:return i<n.length?(r=n[i],s=e(r.id),[4,r.registry(s.bindFunction,s.unbindFunction,s.isboundFunction,s.rebindFunction,s.unbindAsyncFunction,s.onActivationFunction,s.onDeactivationFunction)]):[3,4];case 2:a.sent(),a.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];e.forEach((function(e){var i=t._removeModuleBindings(e.id);t._deactivateSingletons(i),t._removeModuleHandlers(e.id)}))},t.prototype.unloadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Kd(this,void 0,void 0,(function(){var e,i,n,r;return $d(this,(function(s){switch(s.label){case 0:e=0,i=t,s.label=1;case 1:return e<i.length?(n=i[e],r=this._removeModuleBindings(n.id),[4,this._deactivateSingletonsAsync(r)]):[3,4];case 2:s.sent(),this._removeModuleHandlers(n.id),s.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},t.prototype.bind=function(t){var e=this.options.defaultScope||du.Transient,i=new mu(t,e);return this._bindingDictionary.add(t,i),new Gd(i)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.rebindAsync=function(t){return Kd(this,void 0,void 0,(function(){return $d(this,(function(e){switch(e.label){case 0:return[4,this.unbindAsync(t)];case 1:return e.sent(),[2,this.bind(t)]}}))}))},t.prototype.unbind=function(t){if(this._bindingDictionary.hasKey(t)){var e=this._bindingDictionary.get(t);this._deactivateSingletons(e)}this._removeServiceFromDictionary(t)},t.prototype.unbindAsync=function(t){return Kd(this,void 0,void 0,(function(){var e;return $d(this,(function(i){switch(i.label){case 0:return this._bindingDictionary.hasKey(t)?(e=this._bindingDictionary.get(t),[4,this._deactivateSingletonsAsync(e)]):[3,2];case 1:i.sent(),i.label=2;case 2:return this._removeServiceFromDictionary(t),[2]}}))}))},t.prototype.unbindAll=function(){var t=this;this._bindingDictionary.traverse((function(e,i){t._deactivateSingletons(i)})),this._bindingDictionary=new Xd},t.prototype.unbindAllAsync=function(){return Kd(this,void 0,void 0,(function(){var t,e=this;return $d(this,(function(i){switch(i.label){case 0:return t=[],this._bindingDictionary.traverse((function(i,n){t.push(e._deactivateSingletonsAsync(n))})),[4,Promise.all(t)];case 1:return i.sent(),this._bindingDictionary=new Xd,[2]}}))}))},t.prototype.onActivation=function(t,e){this._activations.add(t,e)},t.prototype.onDeactivation=function(t,e){this._deactivations.add(t,e)},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isCurrentBound=function(t){return this._bindingDictionary.hasKey(t)},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,tu,e)},t.prototype.isBoundTagged=function(t,e,i){var n=!1;if(this._bindingDictionary.hasKey(t)){var r=this._bindingDictionary.get(t),s=function(t,e,i,n){var r=new Vu(fu.Variable,"",e,new zu(i,n)),s=new Nu(t);return new Qu(e,s,null,[],r)}(this,t,e,i);n=r.some((function(t){return t.constraint(s)}))}return!n&&this.parent&&(n=this.parent.isBoundTagged(t,e,i)),n},t.prototype.snapshot=function(){this._snapshots.push(Vd.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error("No snapshot available to restore.");this._bindingDictionary=t.bindings,this._activations=t.activations,this._deactivations=t.deactivations,this._middleware=t.middleware,this._moduleActivationStore=t.moduleActivationStore},t.prototype.createChild=function(e){var i=new t(e||this.options);return i.parent=this,i},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),i)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){var e=this._getNotAllArgs(t,!1);return this._getButThrowIfAsync(e)},t.prototype.getAsync=function(t){return Kd(this,void 0,void 0,(function(){var e;return $d(this,(function(i){return e=this._getNotAllArgs(t,!1),[2,this._get(e)]}))}))},t.prototype.getTagged=function(t,e,i){var n=this._getNotAllArgs(t,!1,e,i);return this._getButThrowIfAsync(n)},t.prototype.getTaggedAsync=function(t,e,i){return Kd(this,void 0,void 0,(function(){var n;return $d(this,(function(r){return n=this._getNotAllArgs(t,!1,e,i),[2,this._get(n)]}))}))},t.prototype.getNamed=function(t,e){return this.getTagged(t,tu,e)},t.prototype.getNamedAsync=function(t,e){return this.getTaggedAsync(t,tu,e)},t.prototype.getAll=function(t){var e=this._getAllArgs(t);return this._getButThrowIfAsync(e)},t.prototype.getAllAsync=function(t){var e=this._getAllArgs(t);return this._getAll(e)},t.prototype.getAllTagged=function(t,e,i){var n=this._getNotAllArgs(t,!0,e,i);return this._getButThrowIfAsync(n)},t.prototype.getAllTaggedAsync=function(t,e,i){var n=this._getNotAllArgs(t,!0,e,i);return this._getAll(n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,tu,e)},t.prototype.getAllNamedAsync=function(t,e){return this.getAllTaggedAsync(t,tu,e)},t.prototype.resolve=function(t){var e=this.isBound(t);e||this.bind(t).toSelf();var i=this.get(t);return e||this.unbind(t),i},t.prototype._preDestroy=function(t,e){if(Reflect.hasMetadata(lu,t))return e[Reflect.getMetadata(lu,t).value]()},t.prototype._removeModuleHandlers=function(t){var e=this._moduleActivationStore.remove(t);this._activations.removeIntersection(e.onActivations),this._deactivations.removeIntersection(e.onDeactivations)},t.prototype._removeModuleBindings=function(t){return this._bindingDictionary.removeByCondition((function(e){return e.moduleId===t}))},t.prototype._deactivate=function(t,e){var i=this,n=Object.getPrototypeOf(e).constructor;try{if(this._deactivations.hasKey(t.serviceIdentifier)){var r=this._deactivateContainer(e,this._deactivations.get(t.serviceIdentifier).values());if(sd(r))return this._handleDeactivationError(r.then((function(){return i._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,e,n)})),n)}var s=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,e,n);if(sd(s))return this._handleDeactivationError(s,n)}catch(t){throw new Error(Mu(n.name,t.message))}},t.prototype._handleDeactivationError=function(t,e){return Kd(this,void 0,void 0,(function(){var i;return $d(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t];case 1:return n.sent(),[3,3];case 2:throw i=n.sent(),new Error(Mu(e.name,i.message));case 3:return[2]}}))}))},t.prototype._deactivateContainer=function(t,e){for(var i=this,n=e.next();n.value;){var r=n.value(t);if(sd(r))return r.then((function(){return i._deactivateContainerAsync(t,e)}));n=e.next()}},t.prototype._deactivateContainerAsync=function(t,e){return Kd(this,void 0,void 0,(function(){var i;return $d(this,(function(n){switch(n.label){case 0:i=e.next(),n.label=1;case 1:return i.value?[4,i.value(t)]:[3,3];case 2:return n.sent(),i=e.next(),[3,1];case 3:return[2]}}))}))},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},i=function(i){return function(n){var r=t.rebind(n);return e(r,i),r}},n=function(e){return function(i,n){t._moduleActivationStore.addActivation(e,i,n),t.onActivation(i,n)}},r=function(e){return function(i,n){t._moduleActivationStore.addDeactivation(e,i,n),t.onDeactivation(i,n)}};return function(s){return{bindFunction:(a=s,function(i){var n=t.bind(i);return e(n,a),n}),isboundFunction:function(e){return t.isBound(e)},onActivationFunction:n(s),onDeactivationFunction:r(s),rebindFunction:i(s),unbindFunction:function(e){return t.unbind(e)},unbindAsyncFunction:function(e){return t.unbindAsync(e)}};var a}},t.prototype._getAll=function(t){return Promise.all(this._get(t))},t.prototype._get=function(t){var e=qd(qd({},t),{contextInterceptor:function(t){return t},targetType:fu.Variable});if(this._middleware){var i=this._middleware(e);if(null==i)throw new Error("Invalid return type in middleware. Middleware must return!");return i}return this._planAndResolve()(e)},t.prototype._getButThrowIfAsync=function(t){var e=this._get(t);if(ad(e))throw new Error("You are attempting to construct '"+t.serviceIdentifier+"' in a synchronous way\n but it has asynchronous dependencies.");return e},t.prototype._getAllArgs=function(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}},t.prototype._getNotAllArgs=function(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}},t.prototype._planAndResolve=function(){var t=this;return function(e){var i=rd(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return function(t){return _d(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}(i=e.contextInterceptor(i))}},t.prototype._deactivateIfSingleton=function(t){var e=this;if(t.activated)return sd(t.cache)?t.cache.then((function(i){return e._deactivate(t,i)})):this._deactivate(t,t.cache)},t.prototype._deactivateSingletons=function(t){for(var e=0,i=t;e<i.length;e++){var n=i[e];if(sd(this._deactivateIfSingleton(n)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}},t.prototype._deactivateSingletonsAsync=function(t){return Kd(this,void 0,void 0,(function(){var e=this;return $d(this,(function(i){switch(i.label){case 0:return[4,Promise.all(t.map((function(t){return e._deactivateIfSingleton(t)})))];case 1:return i.sent(),[2]}}))}))},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(t,e,i){return this.parent?this._deactivate.bind(this.parent)(t,e):this._bindingDeactivationAndPreDestroy(t,e,i)},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(t,e,i){return Kd(this,void 0,void 0,(function(){return $d(this,(function(n){switch(n.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(t,e)]:[3,2];case 1:return n.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(t,e,i)];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},t.prototype._removeServiceFromDictionary=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error("Could not unbind serviceIdentifier: "+Ou(t))}},t.prototype._bindingDeactivationAndPreDestroy=function(t,e,i){var n=this;if("function"==typeof t.onDeactivation){var r=t.onDeactivation(e);if(sd(r))return r.then((function(){return n._preDestroy(i,e)}))}return this._preDestroy(i,e)},t.prototype._bindingDeactivationAndPreDestroyAsync=function(t,e,i){return Kd(this,void 0,void 0,(function(){return $d(this,(function(n){switch(n.label){case 0:return"function"!=typeof t.onDeactivation?[3,2]:[4,t.onDeactivation(e)];case 1:n.sent(),n.label=2;case 2:return[4,this._preDestroy(i,e)];case 3:return n.sent(),[2]}}))}))},t}(),Qd=function(t){this.id=yu(),this.registry=t};function tp(t,e,i,n){!function(t){if(void 0!==t)throw new Error(Tu)}(e),ip(au,t,i.toString(),n)}function ep(t){var e=[];if(Array.isArray(t)){var i=function(t){for(var e=new Set,i=0,n=t;i<n.length;i++){var r=n[i];if(e.has(r))return r;e.add(r)}}((e=t).map((function(t){return t.key})));if(void 0!==i)throw new Error(vu+" "+i.toString())}else e=[t];return e}function ip(t,e,i,n){var r=ep(n),s={};Reflect.hasOwnMetadata(t,e)&&(s=Reflect.getMetadata(t,e));var a=s[i];if(void 0===a)a=[];else for(var o=function(t){if(r.some((function(e){return e.key===t.key})))throw new Error(vu+" "+t.key.toString())},h=0,c=a;h<c.length;h++){o(c[h])}a.push.apply(a,r),s[i]=a,Reflect.defineMetadata(t,s,e)}function np(t){return function(e,i,n){"number"==typeof n?tp(e,i,n,t):function(t,e,i){if(void 0!==t.prototype)throw new Error(Tu);ip(ou,t.constructor,e,i)}(e,i,t)}}function rp(){return function(t){if(Reflect.hasOwnMetadata(hu,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(hu,e,t),t}}function sp(t){return np(new zu(tu,t))}function ap(t){return function(e){return function(i,n,r){if(void 0===e){var s="function"==typeof i?i.name:i.constructor.name;throw new Error("@inject called with undefined this could mean that the class "+s+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation.")}return np(new zu(t,e))(i,n,r)}}}var op=ap(ru),hp=ap(su);var cp,lp,up=(cp=cu,lp="Cannot apply @postConstruct decorator multiple times in the same class",function(){return function(t,e){var i=new zu(cp,e);if(Reflect.hasOwnMetadata(cp,t.constructor))throw new Error(lp);Reflect.defineMetadata(cp,i,t.constructor)}});function dp(t,e,i,r){var s,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,r);else for(var h=t.length-1;h>=0;h--)(s=t[h])&&(o=(a<3?s(o):a>3?s(e,i,o):s(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o}function pp(t,e){return function(i,n){e(i,n,t)}}function fp(t,e){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}"function"==typeof SuppressedError&&SuppressedError;const gp=Symbol("ContributionProvider");class yp{caches;serviceIdentifier;container;constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function mp(t,e){t(gp).toDynamicValue((({container:t})=>new yp(e,t))).inSingletonScope().whenTargetNamed(e)}class vp{_args;name;taps;constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>t.name!==i&&(!e||t.fn===e))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>i)){n++;break}}this.taps[n]=t}}class bp extends vp{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const xp=Symbol.for("EnvContribution"),wp=Symbol.for("Global"),Sp="browser";t.DefaultGlobal=class{contributions;_env;get env(){return this._env}envContribution;get devicePixelRatio(){return this._env||this.setEnv(Sp),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv(Sp),this.envContribution.supportEvent}get supportsTouchEvents(){return this._env||this.setEnv(Sp),this.envContribution.supportsTouchEvents}get supportsPointerEvents(){return this._env||this.setEnv(Sp),this.envContribution.supportsPointerEvents}get supportsMouseEvents(){return this._env||this.setEnv(Sp),this.envContribution.supportsMouseEvents}get applyStyles(){return this._env||this.setEnv(Sp),this.envContribution.applyStyles}envParams;constructor(t){this.contributions=t,this.hooks={onSetEnv:new bp(["lastEnv","env","global"])},this.measureTextMethod="native"}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const n=i.configure(this,t);n&&n.then&&e.push(n)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv(Sp),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv(Sp),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const n=this.bindContribution(e);if(n&&n.then)return n.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv(Sp),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv(Sp),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv(Sp),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv(Sp),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv(Sp),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv(Sp),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv(Sp),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv(Sp),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv(Sp),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv(Sp),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv(Sp),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv(Sp),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}},t.DefaultGlobal=dp([rp(),pp(0,op(gp)),pp(0,sp(xp)),fp("design:paramtypes",[Object])],t.DefaultGlobal);var Ap={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,a=new Array(s);r<s;r++)a[r]=n[r].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},o.prototype.emit=function(t,e,n,r,s,a){var o=i?i+t:t;if(!this._events[o])return!1;var h,c,l=this._events[o],u=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),u){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,s),!0;case 6:return l.fn.call(l.context,e,n,r,s,a),!0}for(c=1,h=new Array(u-1);c<u;c++)h[c-1]=arguments[c];l.fn.apply(l.context,h)}else{var d,p=l.length;for(c=0;c<p;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),u){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,n);break;case 4:l[c].fn.call(l[c].context,e,n,r);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];l[c].fn.apply(l[c].context,h)}}return!0},o.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||r&&!o.once||n&&o.context!==n||a(this,s);else{for(var h=0,c=[],l=o.length;h<l;h++)(o[h].fn!==e||r&&!o[h].once||n&&o[h].context!==n)&&c.push(o[h]);c.length?this._events[s]=1===c.length?c[0]:c:a(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(Ap);var _p=i(Ap.exports),Cp=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},Tp=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||Cp(t,"Boolean")},Bp=function(t){return"function"==typeof t},Pp=function(t){return null==t},Ep=function(t){return null!=t},Mp=function(t){var e=n(t);return null!==t&&"object"===e||"function"===e},Rp=function(t){return void 0===t},kp=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n(t);return e?"string"===i:"string"===i||Cp(t,"String")},Dp=function(t){return Array.isArray?Array.isArray(t):Cp(t,"Array")},Ip=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n(t);return e?"number"===i:"number"===i||Cp(t,"Number")},Op=function(t){return Ip(t)&&Number.isFinite(t)},Lp=function(t,e,i){for(var n=kp(e)?e.split("."):e,r=0;r<n.length;r++)t=t?t[n[r]]:void 0;return void 0===t?i:t},Up=Object.prototype.hasOwnProperty,Wp=function(t,e){return null!=t&&Up.call(t,e)};function Fp(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,s=[],a=[];return void 0===e&&(e=!0),void 0===i&&(i=1/0),function t(i,o){if(null===i)return null;if(0===o)return i;var h,c,l;if("object"!=n(i))return i;if(Dp(i)?h=[]:Cp(i,"RegExp")?(h=new RegExp(i.source,(l="",(c=i).global&&(l+="g"),c.ignoreCase&&(l+="i"),c.multiline&&(l+="m"),l)),i.lastIndex&&(h.lastIndex=i.lastIndex)):h=function(t){return Cp(t,"Date")}(i)?new Date(i.getTime()):void 0===r?Object.create(Object.getPrototypeOf(i)):Object.create(r),e){var u=s.indexOf(i);if(-1!==u)return a[u];s.push(i),a.push(h)}for(var d in i)h[d]=t(i[d],o-1);return h}(t,i)}function Np(t,e){if(!Dp(t)||!Dp(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}var zp=1e-10,jp=1e-10;function Hp(t,e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zp,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:jp)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}try{"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){!1}var Gp=1e-12,Vp=Math.PI,Xp=Vp/2,Yp=2*Vp,qp=2*Math.PI,Kp=Math.abs,$p=Math.atan2,Zp=Math.cos,Jp=Math.max,Qp=Math.min,tf=Math.sin,ef=Math.sqrt,nf=Math.pow;function rf(t){return t>1?0:t<-1?Vp:Math.acos(t)}function sf(t){return t>=1?Xp:t<=-1?-Xp:Math.asin(t)}function af(t,e,i,n,r){var s,a;return"number"==typeof t&&"number"==typeof i&&(s=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(a=(1-r)*e+r*n),{x:s,y:a}}function of(t,e){return t[0]*e[1]-t[1]*e[0]}var hf=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;r(this,t),this.x=0,this.y=0,this.x=e,this.y=i,this.x1=n,this.y1=s}return a(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"add",value:function(t){return Ip(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return Ip(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}},{key:"multi",value:function(t){throw new Error("暂不支持")}},{key:"div",value:function(t){throw new Error("暂不支持")}}]),t}(),cf=function(){function t(){r(this,t)}return a(t,null,[{key:"distancePP",value:function(t,e){return ef(nf(t.x-e.x,2)+nf(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,i,n){return ef(nf(t-i,2)+nf(e-n,2))}},{key:"distancePN",value:function(t,e,i){return ef(nf(e-t.x,2)+nf(i-t.y,2))}},{key:"pointAtPP",value:function(t,e,i){return new hf((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}]),t}();function lf(t,e,i){var n=e.x1,r=e.y1,s=e.x2,a=e.y2;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*r+i.e,i.b*n+i.d*r+i.f),t.add(i.a*s+i.c*r+i.e,i.b*s+i.d*r+i.f),t.add(i.a*s+i.c*a+i.e,i.b*s+i.d*a+i.f),t.add(i.a*n+i.c*a+i.e,i.b*n+i.d*a+i.f),e)}var uf=function(){function t(e){r(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return a(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Dp(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}},{key:"round",value:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}},{key:"translate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}},{key:"scale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}},{key:"intersect",value:function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return lf(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,i){var n=this.x1,r=this.y1,s=this.x2,a=this.y2,o=Math.cos(t),h=Math.sin(t),c=e-e*o+i*h,l=i-e*h-i*o;return[o*n-h*r+c,h*n+o*r+l,o*n-h*a+c,h*n+o*a+l,o*s-h*r+c,h*s+o*r+l,o*s-h*a+c,h*s+o*a+l]}},{key:"scalePoints",value:function(t,e,i,n){return[t*this.x1+(1-t)*i,e*this.y1+(1-e)*n,t*this.x2+(1-t)*i,e*this.y2+(1-e)*n]}}]),t}(),df=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(i,t);var e=l(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i)}(uf);var pf=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Yp;)t+=Yp;else if(t>0)for(;t>Yp;)t-=Yp;return t};function ff(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}var gf,yf,mf,vf,bf,xf,wf,Sf,Af,_f=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;r(this,t),this.a=e,this.b=i,this.c=n,this.d=s,this.e=a,this.f=o}return a(t,[{key:"equalToMatrix",value:function(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}},{key:"equalTo",value:function(t,e,i,n,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}},{key:"setValue",value:function(t,e,i,n,r,s){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s,this}},{key:"reset",value:function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}},{key:"getInverse",value:function(){var e=this.a,i=this.b,n=this.c,r=this.d,s=this.e,a=this.f,o=new t,h=e*r-i*n;return o.a=r/h,o.b=-i/h,o.c=-n/h,o.d=e/h,o.e=(n*a-r*s)/h,o.f=-(e*a-i*s)/h,o}},{key:"rotate",value:function(t){var e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,r=this.b*e+this.d*i,s=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=n,this.b=r,this.c=s,this.d=a,this}},{key:"rotateByCenter",value:function(t,e,i){var n=Math.cos(t),r=Math.sin(t),s=(1-n)*e+r*i,a=(1-n)*i-r*e,o=n*this.a-r*this.b,h=r*this.a+n*this.b,c=n*this.c-r*this.d,l=r*this.c+n*this.d,u=n*this.e-r*this.f+s,d=r*this.e+n*this.f+a;return this.a=o,this.b=h,this.c=c,this.d=l,this.e=u,this.f=d,this}},{key:"scale",value:function(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}},{key:"setScale",value:function(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}},{key:"transform",value:function(t,e,i,n,r,s){return this.multiply(t,e,i,n,r,s),this}},{key:"translate",value:function(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}},{key:"transpose",value:function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=this.e,s=this.f;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=s,this.f=r,this}},{key:"multiply",value:function(t,e,i,n,r,s){var a=this.a,o=this.b,h=this.c,c=this.d,l=a*t+h*e,u=o*t+c*e,d=a*i+h*n,p=o*i+c*n,f=a*r+h*s+this.e,g=o*r+c*s+this.f;return this.a=l,this.b=u,this.c=d,this.d=p,this.e=f,this.f=g,this}},{key:"interpolate",value:function(e,i){var n=new t;return n.a=this.a+(e.a-this.a)*i,n.b=this.b+(e.b-this.b)*i,n.c=this.c+(e.c-this.c)*i,n.d=this.d+(e.d-this.d)*i,n.e=this.e+(e.e-this.e)*i,n.f=this.f+(e.f-this.f)*i,n}},{key:"transformPoint",value:function(t,e){var i=this.a,n=this.b,r=this.c,s=this.d,a=this.e,o=this.f,h=i*s-n*r,c=s/h,l=-n/h,u=-r/h,d=i/h,p=(r*o-s*a)/h,f=-(i*o-n*a)/h,g=t.x,y=t.y;e.x=g*c+y*u+p,e.y=g*l+y*d+f}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}},{key:"clone",value:function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)}},{key:"toTransformAttrs",value:function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=t*n-e*i,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){var a=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),s.scaleX=a,s.scaleY=r/a,s.skewX=(t*i+e*n)/r,s.skewY=0}else if(0!==i||0!==n){var o=Math.sqrt(i*i+n*n);s.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/o):-Math.acos(i/o)),s.scaleX=r/o,s.scaleY=o,s.skewX=0,s.skewY=(t*i+e*n)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}]),t}();function Cf(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function Tf(t,e,i,n){if(!function(t,e,i,n){var r,s=t[0],a=e[0],o=i[0],h=n[0];return a<s&&(r=a,a=s,s=r),h<o&&(r=h,h=o,o=r),!(a<o||h<s||(s=t[1],a=e[1],o=i[1],h=n[1],a<s&&(r=a,a=s,s=r),h<o&&(r=h,h=o,o=r),a<o||h<s))}(t,e,i,n))return!1;var r,s,a=[0,0],o=[0,0],h=[0,0];if(Cf(a,e,t),Cf(o,n,i),Kp((r=a)[0]-(s=o)[0])+Kp(r[1]-s[1])<1e-12)return!0;Cf(h,i,t);var c=of(h,o)/of(a,o);return c>=0&&c<=1&&[t[0]+a[0]*c,t[1]+a[1]*c]}function Bf(t,e,i){var n,r,s,a;return!(t&&e&&(i?(gf=t.x1,yf=t.x2,mf=t.y1,vf=t.y2,bf=e.x1,xf=e.x2,wf=e.y1,Sf=e.y2,gf>yf&&(n=[yf,gf],gf=n[0],yf=n[1]),mf>vf&&(r=[vf,mf],mf=r[0],vf=r[1]),bf>xf&&(s=[xf,bf],bf=s[0],xf=s[1]),wf>Sf&&(a=[Sf,wf],wf=a[0],Sf=a[1]),gf>xf||yf<bf||mf>Sf||vf<wf):t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1))}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Af||(Af={}));var Pf=function(t){var e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(n=(e&=1023)<<10|(i&=1023),n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};var Ef,Mf=function(){function t(e,i){r(this,t),this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=e,this._userSpec=null!=i?i:{},this.textSpec=this._initSpec(),Ep(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=Ep(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return a(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(Pp(this._canvas)&&(Ep(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),Pp(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&Ep(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),Pp(this._context)&&Ep(this._canvas)){var t=this._canvas.getContext("2d");Ep(t)&&(t.save(),t.font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.fontStyle,n=void 0===i?e.fontStyle:i,r=t.fontVariant,s=void 0===r?e.fontVariant:r,a=t.fontWeight,o=void 0===a?e.fontWeight:a,h=t.fontSize,c=void 0===h?e.fontSize:h,l=t.fontFamily;return(n?n+" ":"")+(s?s+" ":"")+(o?o+" ":"")+c+"px "+((void 0===l?e.fontFamily:l)||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!Pp(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,i,n=this._option.defaultFontParams,r=void 0===n?{}:n,s=this._userSpec,a=s.fontStyle,o=void 0===a?r.fontStyle:a,h=s.fontVariant,c=void 0===h?r.fontVariant:h,l=s.fontWeight,u=void 0===l?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":l,d=s.fontSize,p=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,f=s.fontFamily,g=void 0===f?null!==(i=r.fontFamily)&&void 0!==i?i:"sans-serif":f,y=s.align,m=s.textAlign,v=void 0===m?null!=y?y:"center":m,b=s.baseline,x=s.textBaseline,w=void 0===x?null!=b?b:"middle":x,S=s.ellipsis,A=s.limit,_=s.lineHeight;return{fontStyle:o,fontVariant:c,fontFamily:g,fontSize:p,fontWeight:u,textAlign:v,textBaseline:w,ellipsis:S,limit:A,lineHeight:void 0===_?p:_}}},{key:"measure",value:function(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}},{key:"fullMeasure",value:function(t){if(Pp(t))return{width:0,height:0};if(Pp(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);var e,i=this.textSpec,n=i.fontFamily,r=i.fontSize,s=i.fontWeight,a=i.textAlign,o=i.textBaseline,h=i.ellipsis,c=i.limit,l=i.lineHeight;try{var u=this._option.getTextBounds({text:t,fontFamily:n,fontSize:r,fontWeight:s,textAlign:a,textBaseline:o,ellipsis:!!h,maxLineWidth:c||1/0,lineHeight:l});e={width:u.width(),height:u.height()}}catch(i){this._notSupportVRender=!0,e=this.measureWithNaiveCanvas(t)}return e}},{key:"measureWithNaiveCanvas",value:function(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}},{key:"_measureWithNaiveCanvas",value:function(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);var e=this._context.measureText(t),i=this.textSpec,n=i.fontSize,r=i.lineHeight;return{width:e.width,height:null!=r?r:n}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var i={width:0,height:0},n=0;n<e.length;n++){var r=e[n],s=this._measureSpecialChar(r);Pp(s)&&t.NUMBERS_CHAR_SET.includes(r)&&(s=this._measureNumberChar()),Pp(s)&&["F","W"].includes(Pf(r))&&(s=this._measureFullSizeChar()),Pp(s)&&(s=this._measureLetterChar()),i.width+=s.width,i.height=Math.max(i.height,s.height)}return i}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e={width:0,height:0},i=this.textSpec,n=i.fontSize,r=i.lineHeight,s=0;s<t.length;s++){var a=t[s],o=["F","W"].includes(Pf(a))?1:.53;e.width+=o*n}return e.height=null!=r?r:n,e}},{key:"_measureReduce",value:function(t,e){var i=this.textSpec,n=i.fontSize,r=i.lineHeight,s={width:0,height:0};if(Pp(t))return s;if(Dp(t)){var a=t.filter(Ep).map((function(t){return t.toString()}));return 0===a.length?s:1===a.length?e(a[0]):{width:a.reduce((function(t,i){return Math.max(t,e(i).width)}),0),height:a.length*((null!=r?r:n)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(Pp(this._numberCharSize)){var e=this._standardMethod(t.NUMBERS_CHAR_SET);this._numberCharSize={width:e.width/t.NUMBERS_CHAR_SET.length,height:e.height}}return this._numberCharSize}},{key:"_measureFullSizeChar",value:function(){return Pp(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(Pp(this._letterCharSize)){var e=this._standardMethod(t.ALPHABET_CHAR_SET);this._letterCharSize={width:e.width/t.ALPHABET_CHAR_SET.length,height:e.height}}return this._letterCharSize}},{key:"_measureSpecialChar",value:function(t){return Ep(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){Ep(this._canvas)&&(this._canvas=null),Ep(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}]),t}();Mf.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Mf.NUMBERS_CHAR_SET="0123456789",Mf.FULL_SIZE_CHAR="字",function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(Ef||(Ef={}));const Rf=Yp-1e-8;class kf{bounds;constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,s){if(Math.abs(r-n)>Rf)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,h,c,l=1/0,u=-1/0,d=1/0,p=-1/0;function f(t){h=i*Math.cos(t),c=i*Math.sin(t),h<l&&(l=h),h>u&&(u=h),c<d&&(d=c),c>p&&(p=c)}if(f(n),f(r),r!==n)if((n%=Yp)<0&&(n+=Yp),(r%=Yp)<0&&(r+=Yp),r<n&&(s=!s,a=n,n=r,r=a),s)for(r-=Yp,a=n-n%Xp,o=0;o<4&&a>r;++o,a-=Xp)f(a);else for(a=n-n%Xp+Xp,o=0;o<4&&a<r;++o,a+=Xp)f(a);this.bounds.add(t+l,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,n,r){throw new Error("不支持arcTo")}bezierCurveTo(t,e,i,n,r,s){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(...t){}}class Df{curves;bounds;constructor(){this.curves=[],this.bounds=new df}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const If=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Of={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},Lf={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Uf,Wf,Ff,Nf,zf,jf;function Hf(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const r=[];for(let t=0,s=e.length;t<s;t++)if(Uf=e[t],Wf=Uf.slice(1),Ff=Uf[0],i=[Ff],n=Wf.match(If),null!==n){for(let t=0,e=n.length;t<e;t++)Nf=n[t],zf=parseFloat(Nf),Number.isNaN(zf)||i.push(zf);if(jf=Of[Ff],i.length-1>jf){let t;for(let e=1,n=i.length;e<n;e+=jf){t=[Ff];for(let n=e,r=e+jf;n<r;n++)t.push(i[n]);r.push(t)}}else r.push(i)}else r.push(i);return r}var Gf,Vf,Xf,Yf,qf,Kf,$f,Zf;function Jf(t,e,i,n,r,s,a,o,h){const c=a*(Math.PI/180);const l=Math.sin(c),u=Math.cos(c),d=u*(o-t)*.5+l*(h-e)*.5,p=u*(h-e)*.5-l*(o-t)*.5;let f=d*d/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);f>1&&(f=Math.sqrt(f),i*=f,n*=f);const g=u/i,y=l/i,m=-l/n,v=u/n,b=g*o+y*h,x=m*o+v*h,w=g*t+y*e,S=m*t+v*e;let A=1/((w-b)*(w-b)+(S-x)*(S-x))-.25;A<0&&(A=0);let _=Math.sqrt(A);s===r&&(_=-_);const C=.5*(b+w)-_*(S-x),T=.5*(x+S)+_*(w-b),B=Math.atan2(x-T,b-C);let P=Math.atan2(S-T,w-C)-B;P<0&&1===s?P+=Yp:P>0&&0===s&&(P-=Yp);const E=Math.ceil(Math.abs(P/(Xp+.001))),M=[];for(let t=0;t<E;++t){const e=B+t*P/E,r=B+(t+1)*P/E;M[t]=[C,T,e,r,i,n,l,u]}return M}function Qf(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],c=h*s,l=-o*a,u=o*s,d=h*a,p=Math.cos(n),f=Math.sin(n),g=Math.cos(r),y=Math.sin(r),m=.5*(r-n),v=Math.sin(.5*m),b=8/3*v*v/Math.sin(m),x=e+p-b*f,w=i+f+b*p,S=e+g,A=i+y,_=S+b*y,C=A-b*g;return[c*x+l*w,u*x+d*w,c*_+l*C,u*_+d*C,c*S+l*A,u*S+d*A]}function tg(t,e,i,n){const r=Jf(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<r.length;++e){const i=Qf(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(Gf=t.UpdateTag||(t.UpdateTag={}))[Gf.NONE=0]="NONE",Gf[Gf.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",Gf[Gf.UPDATE_SHAPE=2]="UPDATE_SHAPE",Gf[Gf.CLEAR_SHAPE=253]="CLEAR_SHAPE",Gf[Gf.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",Gf[Gf.INIT=51]="INIT",Gf[Gf.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",Gf[Gf.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",Gf[Gf.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",Gf[Gf.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",Gf[Gf.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",Gf[Gf.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t.IContainPointMode=void 0,(Vf=t.IContainPointMode||(t.IContainPointMode={}))[Vf.GLOBAL=1]="GLOBAL",Vf[Vf.LOCAL=16]="LOCAL",Vf[Vf.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",Vf[Vf.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(Xf=t.AttributeUpdateType||(t.AttributeUpdateType={}))[Xf.INIT=0]="INIT",Xf[Xf.DEFAULT=1]="DEFAULT",Xf[Xf.STATE=2]="STATE",Xf[Xf.ANIMATE_BIND=10]="ANIMATE_BIND",Xf[Xf.ANIMATE_PLAY=11]="ANIMATE_PLAY",Xf[Xf.ANIMATE_START=12]="ANIMATE_START",Xf[Xf.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",Xf[Xf.ANIMATE_END=14]="ANIMATE_END",Xf[Xf.TRANSLATE=20]="TRANSLATE",Xf[Xf.TRANSLATE_TO=21]="TRANSLATE_TO",Xf[Xf.SCALE=22]="SCALE",Xf[Xf.SCALE_TO=23]="SCALE_TO",Xf[Xf.ROTATE=24]="ROTATE",Xf[Xf.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(Yf=t.AnimateStatus||(t.AnimateStatus={}))[Yf.INITIAL=0]="INITIAL",Yf[Yf.RUNNING=1]="RUNNING",Yf[Yf.PAUSED=2]="PAUSED",Yf[Yf.END=3]="END",t.AnimateMode=void 0,(qf=t.AnimateMode||(t.AnimateMode={}))[qf.NORMAL=0]="NORMAL",qf[qf.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(Kf=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",Kf.from="from",Kf.to="to",Kf.customAnimate="customAnimate",t.Direction=void 0,function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(t.Direction||(t.Direction={})),t.CurveTypeEnum=void 0,($f=t.CurveTypeEnum||(t.CurveTypeEnum={}))[$f.CubicBezierCurve=0]="CubicBezierCurve",$f[$f.QuadraticBezierCurve=1]="QuadraticBezierCurve",$f[$f.ArcCurve=2]="ArcCurve",$f[$f.LineCurve=3]="LineCurve",$f[$f.EllipseCurve=4]="EllipseCurve",$f[$f.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(Zf=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[Zf.beforeFillStroke=0]="beforeFillStroke",Zf[Zf.afterFillStroke=1]="afterFillStroke";const eg=(t,e,i,n,r,s,a)=>{const o=Math.abs(i-e),h=4*Math.tan(o/4)/3,c=i<e?-1:1,l=Math.cos(e),u=Math.sin(e),d=Math.cos(i),p=Math.sin(i),f=l*s+n,g=u*a+r,y=d*s+n,m=p*a+r,v=s*h*c,b=a*h*c;t.push(f-v*u,g+b*l,y+v*p,m-b*d,y,m)},ig=[(t,e,i,n,r,s,a)=>e.arc(t[1]*r+i,t[2]*s+n,t[3]*(r+s)/2,t[4],t[5],t[6],a),(t,e,i,n,r,s,a)=>e.arcTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*(r+s)/2,a),(t,e,i,n,r,s,a)=>e.bezierCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*r+i,t[6]*s+n,a),(t,e,i,n)=>e.closePath(),(t,e,i,n,r,s)=>e.ellipse(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,i,n,r,s,a)=>e.lineTo(t[1]*r+i,t[2]*s+n,a),(t,e,i,n,r,s,a)=>e.moveTo(t[1]*r+i,t[2]*s+n,a),(t,e,i,n,r,s,a)=>e.quadraticCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,a),(t,e,i,n,r,s,a)=>e.rect(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,a)];function ng(t,e,i=0,n=0,r=1,s=1,a){for(let o=0;o<t.length;o++){const h=t[o];ig[h[0]](h,e,i,n,r,s,a)}}class rg{type;p0;defined;length;getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function sg(t,e){let i=0;const n=t.length;for(let r=0;r<n;r++){const s=t[r],a=e[r],o=t[(r+1)%n],h=e[(r+1)%n];i+=cf.distanceNN(s,a,o,h)}return i/2}function ag(t,e,i,n,r){return sg([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function og(t,e,i,n,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*i*r*r*s+n*r*r*r}function hg(t,e,i,n,r){const s=og(t.x,e.x,i.x,n.x,r),a=og(t.y,e.y,i.y,n.y,r);return new hf(s,a)}function cg(t,e){const{p0:i,p1:n,p2:r,p3:s}=t,a=hg(i,n,r,s,e),o=cf.pointAtPP(i,n,e),h=cf.pointAtPP(n,r,e),c=cf.pointAtPP(r,s,e),l=cf.pointAtPP(o,h,e),u=cf.pointAtPP(h,c,e);return[new lg(i,o,l,a),new lg(a,u,c,s)]}class lg extends rg{type=t.CurveTypeEnum.CubicBezierCurve;constructor(t,e,i,n){super(),this.p0=t,this.p1=e,this.p2=i,this.p3=n}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return hg(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?ag(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(e){return e===t.Direction.ROW?Kp(this.p0.x-this.p3.x):e===t.Direction.COLUMN?Kp(this.p0.y-this.p3.y):0}getAngleAt(t){const e=Jp(t-.01,0),i=Qp(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return $p(r.y-n.y,r.x-n.x)}}function ug(t,e){const{p0:i,p1:n}=t,r=cf.pointAtPP(i,n,e);return[new dg(i,r),new dg(r,n)]}class dg extends rg{type=t.CurveTypeEnum.LineCurve;constructor(t,e){super(),this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return cf.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=$p(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?cf.distancePP(this.p0,this.p1):60}calcProjLength(e){return e===t.Direction.ROW?Kp(this.p0.x-this.p1.x):e===t.Direction.COLUMN?Kp(this.p0.y-this.p1.y):0}}class pg{_lastX;_lastY;_startX;_startY;get endX(){return this._lastX}get endY(){return this._lastY}curves;direction;curveType;length;constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,r,s,a){const o=new lg(new hf(this._lastX,this._lastY),new hf(t,e),new hf(i,n),new hf(r,s));o.defined=a,this.curves.push(o),this._lastX=r,this._lastY=s}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i){const n=this.addLinearCurve(t,e,i);this.curves.push(n),this._lastX=t,this._lastY=e}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i){const n=new dg(new hf(this._lastX,this._lastY),new hf(t,e));return n.defined=i,n}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(e){if(e===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Kp(t.p0.y-e.p1.y)}if(e===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Kp(t.p0.x-e.p1.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class fg extends pg{bezierCurveTo(t,e,i,n,r,s,a){return super.bezierCurveTo(e,t,n,i,s,r,a)}lineTo(t,e,i){return super.lineTo(e,t,i)}moveTo(t,e){return super.moveTo(e,t)}clear(){return super.clear()}}function gg(t,e,i=1){let n=!1;for(let i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}class yg{_lastDefined;startPoint;constructor(t,e){this.context=t,e&&(this.startPoint=e)}_x;_y;_x0;_x1;_y0;_y1;_line;_point;areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(e,i);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function mg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new pg("linear",n??(Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN));return vg(new yg(s,r),e),s}function vg(t,e){return gg(t,e,1)}function bg(t,e,i,n){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n)}class xg{_lastDefined1;_lastDefined2;startPoint;constructor(t,e){this.context=t,this.startPoint=e}_x;_y;_x0;_x1;_y0;_y1;_line;_point;areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){if(2===this._point)bg(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2);(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;default:bg(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function wg(t,e){return gg(t,e,2)}function Sg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mg(e,i);const s=new pg("basis",n??(Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN));return wg(new xg(s,r),e),s}function Ag(t){return t<0?-1:1}function _g(t,e,i){const n=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(n||Number(r<0&&-0)),a=(i-t._y1)/(r||Number(n<0&&-0)),o=(s*r+a*n)/(n+r);return(Ag(s)+Ag(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Cg(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Tg(t,e,i,n){const r=t._x0,s=t._y0,a=t._x1,o=t._y1,h=(a-r)/3;t.context.bezierCurveTo(r+h,s+h*e,a-h,o-h*i,a,o,n)}class Bg{_lastDefined1;_lastDefined2;startPoint;constructor(t,e){this.context=t,this.startPoint=e}_x;_y;_x0;_x1;_y0;_y1;_line;_point;areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined2);break;case 3:Tg(this,this._t0,Cg(this,this._t0),!1!==this._lastDefined2)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;if(i!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(i,n);break;case 1:this._point=2;break;case 2:this._point=3,Tg(this,Cg(this,e=_g(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Tg(this,this._t0,e=_g(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined}}tryUpdateLength(){return this.context.tryUpdateLength()}}class Pg extends Bg{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Eg(t,e){return gg(t,e,2)}function Mg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mg(e,i);const s=new pg("monotoneX",n??(Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN));return Eg(new Bg(s,r),e),s}function Rg(t,e){return gg(t,e,2)}function kg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mg(e,i);const s=new fg("monotoneY",n??(Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN));return Rg(new Pg(s,r),e),s}let Dg=class{_lastDefined;startPoint;constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}_x;_y;_x0;_x1;_y0;_y1;_line;_point;areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(e,i);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined);else{const n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined)}}this._lastDefined=t.defined,this._x=e,this._y=i}tryUpdateLength(){return this.context.tryUpdateLength()}};function Ig(e,i,n={}){const{direction:r,startPoint:s}=n;if(e.length<2-Number(!!s))return null;const a=new pg("step",r??(Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN));return Og(new Dg(a,i,s),e),a}function Og(t,e){return gg(t,e,1)}class Lg{_lastDefined;startPoint;constructor(t,e){this.context=t,e&&(this.startPoint=e)}_x;_y;_x0;_x1;_y0;_y1;_line;_point;areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){this.context.closePath()}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(e,i);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Ug(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new pg("linear",n??(Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN));return Wg(new Lg(s,r),e),s}function Wg(t,e){return gg(t,e,1)}function Fg(t,e,i){switch(e){case"linear":default:return mg(t,i);case"basis":return Sg(t,i);case"monotoneX":return Mg(t,i);case"monotoneY":return kg(t,i);case"step":return Ig(t,.5,i);case"stepBefore":return Ig(t,0,i);case"stepAfter":return Ig(t,1,i);case"linearClosed":return Ug(t,i)}}class Ng extends Df{commandList=[];_boundsContext;_ctx;direction;transformCbList;toStringCbList;constructor(t){super(),t&&(this._ctx=t),this._boundsContext=new kf(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Lf.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Lf.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Lf.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,s){return this.commandList.push([Lf.C,t,e,i,n,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,s),this}arcTo(t,e,i,n,r){return this.commandList.push([Lf.AT,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}ellipse(t,e,i,n,r,s,a,o){return this.commandList.push([Lf.E,t,e,i,n,r,s,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,s,a,o),this}rect(t,e,i,n){return this.commandList.push([Lf.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,r,s){return this.commandList.push([Lf.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([Lf.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}toString(){if(!this.toStringCbList){const t=[];t[Lf.M]=t=>`M${t[1]} ${t[2]}`,t[Lf.L]=t=>`L${t[1]} ${t[2]}`,t[Lf.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Lf.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Lf.A]=t=>{const e=[];eg(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[Lf.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,r){this.clear();const s=Hf(t);return this._runCommandStrList(s,e,i,n,r),this._updateBounds(),this}fromLine(e){const{points:i,curveType:n,clipRangeByDimension:r}=e.attribute;if(!i)return;const s=Fg(i,n);"x"===r?this.direction=t.Direction.ROW:"y"===r?this.direction=t.Direction.COLUMN:"auto"===r&&(this.direction=s.direction),this.curves=s.curves}fromCustomPath2D(t,e,i,n,r){return this.clear(),this._runCommandList(t.commandList,e,i,n,r),this._updateBounds(),this}transform(t,e,i,n){const r=this.commandList;if(!this.transformCbList){const t=[];t[Lf.M]=this.moveToTransform,t[Lf.L]=this.lineToTransform,t[Lf.Q]=this.quadraticCurveToTransform,t[Lf.C]=this.bezierCurveToTransform,t[Lf.AT]=this.arcToTransform,t[Lf.E]=this.ellipseTransform,t[Lf.R]=this.rectTransform,t[Lf.A]=this.arcTransform,t[Lf.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}ellipseTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}rectTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}arcTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,n=1,r=1){let s,a,o,h,c,l=null,u=0,d=0,p=0,f=0;for(let g=0,y=t.length;g<y;++g){switch(s=t[g],1===n&&1===r||(s=jg(s,n,r)),s[0]){case"l":u+=s[1],d+=s[2],this.lineTo(u+e,d+i);break;case"L":u=s[1],d=s[2],this.lineTo(u+e,d+i);break;case"h":u+=s[1],this.lineTo(u+e,d+i);break;case"H":u=s[1],this.lineTo(u+e,d+i);break;case"v":d+=s[1],this.lineTo(u+e,d+i);break;case"V":d=s[1],this.lineTo(u+e,d+i);break;case"m":u+=s[1],d+=s[2],this.moveTo(u+e,d+i);break;case"M":u=s[1],d=s[2],this.moveTo(u+e,d+i);break;case"c":a=u+s[5],o=d+s[6],p=u+s[3],f=d+s[4],this.bezierCurveTo(u+s[1]+e,d+s[2]+i,p+e,f+i,a+e,o+i),u=a,d=o;break;case"C":u=s[5],d=s[6],p=s[3],f=s[4],this.bezierCurveTo(s[1]+e,s[2]+i,p+e,f+i,u+e,d+i);break;case"s":a=u+s[3],o=d+s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,u+s[1]+e,d+s[2]+i,a+e,o+i),p=u+s[1],f=d+s[2],u=a,d=o;break;case"S":a=s[3],o=s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,s[1]+e,s[2]+i,a+e,o+i),u=a,d=o,p=s[1],f=s[2];break;case"q":a=u+s[3],o=d+s[4],p=u+s[1],f=d+s[2],this.quadraticCurveTo(p+e,f+i,a+e,o+i),u=a,d=o;break;case"Q":a=s[3],o=s[4],this.quadraticCurveTo(s[1]+e,s[2]+i,a+e,o+i),u=a,d=o,p=s[1],f=s[2];break;case"t":a=u+s[1],o=d+s[2],null===l[0].match(/[QqTt]/)?(p=u,f=d):"t"===l[0]?(p=2*u-h,f=2*d-c):"q"===l[0]&&(p=2*u-p,f=2*d-f),h=p,c=f,this.quadraticCurveTo(p+e,f+i,a+e,o+i),u=a,d=o,p=u+s[1],f=d+s[2];break;case"T":a=s[1],o=s[2],p=2*u-p,f=2*d-f,this.quadraticCurveTo(p+e,f+i,a+e,o+i),u=a,d=o;break;case"a":tg(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+u+e,s[7]+d+i]),u+=s[6],d+=s[7];break;case"A":tg(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+e,s[7]+i]),u=s[6],d=s[7];break;case"z":case"Z":this.closePath()}l=s}}_runCommandList(t,e=0,i=0,n=1,r=1){if(0!==e||0!==i||1!==n||1!==r)for(let s=0,a=t.length;s<a;++s){const a=t[s].slice();switch(a[0]){case Lf.L:this.lineToTransform(a,e,i,n,r);break;case Lf.M:this.moveToTransform(a,e,i,n,r);break;case Lf.C:this.bezierCurveToTransform(a,e,i,n,r);break;case Lf.Q:this.quadraticCurveToTransform(a,e,i,n,r);break;case Lf.A:this.arcToTransform(a,e,i,n,r);break;case Lf.E:this.ellipseTransform(a,e,i,n,r);break;case Lf.R:this.rectTransform(a,e,i,n,r);break;case Lf.AT:this.arcToTransform(a,e,i,n,r);break;case Lf.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),ng(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Kp(t.p0.y-e.p1.y)}if(this.direction===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Kp(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this.curves.length;n++){e=this.curves[n];const r=e.getLength(this.direction);if(i+r>=t)break;i+=r}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}}const zg=["l",0,0,0,0,0,0,0];function jg(t,e,i){const n=zg[0]=t[0];if("a"===n||"A"===n)zg[1]=e*t[1],zg[2]=i*t[2],zg[3]=t[3],zg[4]=t[4],zg[5]=t[5],zg[6]=e*t[6],zg[7]=i*t[7];else if("h"===n||"H"===n)zg[1]=e*t[1];else if("v"===n||"V"===n)zg[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)zg[n]=(n%2==1?e:i)*t[n];return zg}const Hg={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,anchor:[0,0],anchor3d:[0,0],postMatrix:new _f},Gg={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Vg={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Xg={outerBorder:{...Vg,distance:0},innerBorder:{...Vg,distance:0},...Vg},Yg={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1},qg={opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:0,blur:0,cursor:null,...Gg,...Xg},Kg={strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,...qg,...Hg};const $g={...Kg,startAngle:0,endAngle:qp,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1},Zg={...Kg,points:[],segments:[],curveType:"linear",clipRange:1},Jg={...Kg,radius:1,startAngle:0,endAngle:qp},Qg={...Kg,width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0},ty={...Kg,path:"",width:0,height:0,cornerRadius:0,clip:!1},ey={...Kg,points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default"},iy={...Kg,path:new Ng,customPath:()=>{console.warn("空函数")}},ny={...Kg,points:[],cornerRadius:0},ry={...Kg,width:0,height:0,strokeBoundsBuffer:0,cornerRadius:0},sy={...Kg,width:0,height:0,cornerRadius:0,length:0},ay={...Kg,symbolType:"circle",size:10,keepDirIn3d:!0},oy={...Kg,...Yg,strokeBoundsBuffer:0,keepDirIn3d:!0},hy={...Kg,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],maxHeight:void 0,maxWidth:void 0,singleLine:!1},cy={repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,...Kg,fill:!0},ly={...cy,backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1};let uy=class{release;canvas;context;configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){if(!this.context)return this.estimate(t,e).width;this.context.setTextStyleWithoutAlignBaseline(e);return this.context.measureText(t).width}estimate(t,{fontSize:e=oy.fontSize}){let i=0,n=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?i++:n++;return{width:~~(.8*i*e+n*e),height:e}}measureTextPixelHeight(t,e){if(!this.context)return e.fontSize??Yg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const i=this.context.measureText(t);return Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){if(!this.context)return e.fontSize??Yg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const i=this.context.measureText(t);return Math.abs(i.fontBoundingBoxAscent-i.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipText(t,e,i){if(0===t.length)return{str:"",width:0};let n=this.measureTextWidth(t,e);return n<=i?{str:t,width:n}:(n=this.measureTextWidth(t[0],e),n>i?{str:"",width:0}:this._clipText(t,e,i,0,t.length-1))}_clipText(t,e,i,n,r){const s=Math.floor((n+r)/2),a=t.substring(0,s+1),o=this.measureTextWidth(a,e);let h;if(o>i){if(a.length<=1)return{str:"",width:0};const r=t.substring(0,s);return h=this.measureTextWidth(r,e),h<=i?{str:r,width:h}:this._clipText(t,e,i,n,s)}if(o<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(0,s+2);return h=this.measureTextWidth(n,e),h>=i?{str:a,width:o}:this._clipText(t,e,i,s,r)}return{str:a,width:o}}clipTextWithSuffix(t,e,i,n){if(""===n)return this.clipText(t,e,i);if(0===t.length)return{str:"",width:0};const r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};const s=this.measureTextWidth(n,e);if(s>i)return{str:"",width:0};i-=s;const a=this._clipText(t,e,i,0,t.length-1);return a.str+=n,a.width+=s,a}};uy=dp([rp()],uy);const dy=Symbol.for("TextMeasureContribution");let py=class extends uy{};py=dp([rp()],py);const fy=new Jd;const gy=new class{global;graphicUtil;graphicService;transformUtil;layerService},yy=Symbol.for("CanvasFactory"),my=Symbol.for("Context2dFactory");function vy(t){return fy.getNamed(yy,gy.global.env)(t)}const by=1e-4,xy=Math.sqrt(3),wy=1/3;function Sy(t){return t>-Ly&&t<Ly}function Ay(t){return t>Ly||t<-Ly}const _y=[0,0],Cy=[0,0],Ty=[0,0];function By(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Py(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function Ey(t,e,i,n,r){const s=1-r;return s*s*(s*t+3*r*e)+r*r*(r*n+3*s*i)}function My(t){return(t%=qp)<0&&(t+=qp),t}function Ry(t,e,i,n,r,s){if(s>e&&s>n||s<e&&s<n)return 0;if(n===e)return 0;const a=(s-e)/(n-e);let o=n<e?1:-1;1!==a&&0!==a||(o=n<e?.5:-.5);const h=a*(i-t)+t;return h===r?1/0:h>r?o:0}function ky(t,e,i,n,r,s,a,o,h){if(0===a)return!1;const c=a;if(h>e+c&&h>n+c&&h>s+c||h<e-c&&h<n-c&&h<s-c||o>t+c&&o>i+c&&o>r+c||o<t-c&&o<i-c&&o<r-c)return!1;const l=function(t,e,i,n,r,s,a,o,h){let c=0,l=.005,u=1/0;_y[0]=a,_y[1]=o;for(let a=0;a<1;a+=.05){Cy[0]=Py(t,i,r,a),Cy[1]=Py(e,n,s,a);const o=By(_y,Cy);o<u&&(c=a,u=o)}u=1/0;for(let a=0;a<32&&!(l<by);a++){const a=c-l,o=c+l;Cy[0]=Py(t,i,r,a),Cy[1]=Py(e,n,s,a);const h=By(Cy,_y);if(a>=0&&h<u)c=a,u=h;else{Ty[0]=Py(t,i,r,o),Ty[1]=Py(e,n,s,o);const a=By(Ty,_y);o<=1&&a<u?(c=o,u=a):l*=.5}}return h&&(h[0]=Py(t,i,r,c),h[1]=Py(e,n,s,c)),Math.sqrt(u)}(t,e,i,n,r,s,o,h,null);return l<=c/2}function Dy(t,e,i,n,r,s,a,o,h,c,l){if(0===h)return!1;const u=h;if(l>e+u&&l>n+u&&l>s+u&&l>o+u||l<e-u&&l<n-u&&l<s-u&&l<o-u||c>t+u&&c>i+u&&c>r+u&&c>a+u||c<t-u&&c<i-u&&c<r-u&&c<a-u)return!1;const d=function(t,e,i,n,r,s,a,o,h,c,l){let u,d,p,f,g=0,y=.005,m=1/0;_y[0]=h,_y[1]=c;for(let h=0;h<1;h+=.05)Cy[0]=Ey(t,i,r,a,h),Cy[1]=Ey(e,n,s,o,h),p=By(_y,Cy),p<m&&(g=h,m=p);m=1/0;for(let h=0;h<32&&!(y<by);h++)u=g-y,d=g+y,Cy[0]=Ey(t,i,r,a,u),Cy[1]=Ey(e,n,s,o,u),p=By(Cy,_y),u>=0&&p<m?(g=u,m=p):(Ty[0]=Ey(t,i,r,a,d),Ty[1]=Ey(e,n,s,o,d),f=By(Ty,_y),d<=1&&f<m?(g=d,m=f):y*=.5);return l&&(l[0]=Ey(t,i,r,a,g),l[1]=Ey(e,n,s,o,g)),Math.sqrt(m)}(t,e,i,n,r,s,a,o,c,l,null);return d<=u/2}function Iy(t,e,i,n,r,s,a,o,h){if(0===a)return!1;const c=a;o-=t,h-=e;const l=Math.sqrt(o*o+h*h);if(l-c>i||l+c<i)return!1;if(Math.abs(n-r)%qp<1e-4)return!0;if(s){const t=n;n=My(r),r=My(t)}else n=My(n),r=My(r);n>r&&(r+=qp);let u=Math.atan2(h,o);return u<0&&(u+=qp),u>=n&&u<=r||u+qp>=n&&u+qp<=r}function Oy(t,e,i,n,r,s,a){if(0===r)return!1;const o=r,h=r/2;let c=0,l=t;if(a>e+h&&a>n+h||a<e-h&&a<n-h||s>t+h&&s>i+h||s<t-h&&s<i-h)return!1;if(t===i)return Math.abs(s-t)<=o/2;c=(e-n)/(t-i),l=(t*n-i*e)/(t-i);const u=c*s-a+l;return u*u/(c*c+1)<=o/2*o/2}const Ly=1e-4;function Uy(t,e,i,n,r){const s=6*i-12*e+6*t,a=9*e+3*n-3*t-9*i,o=3*e-3*t;let h=0;if(Sy(a)){if(Ay(s)){const t=-o/s;t>=0&&t<=1&&(r[h++]=t)}}else{const t=s*s-4*a*o;if(Sy(t))r[0]=-s/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-s+e)/(2*a),n=(-s-e)/(2*a);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}const Wy=[-1,-1,-1],Fy=[-1,-1];function Ny(){const t=Fy[0];Fy[0]=Fy[1],Fy[1]=t}function zy(t,e,i,n,r,s,a,o,h,c){if(c>e&&c>n&&c>s&&c>o||c<e&&c<n&&c<s&&c<o)return 0;const l=function(t,e,i,n,r,s){const a=n+3*(e-i)-t,o=3*(i-2*e+t),h=3*(e-t),c=t-r,l=o*o-3*a*h,u=o*h-9*a*c,d=h*h-3*o*c;let p=0;if(Sy(l)&&Sy(u))if(Sy(o))s[0]=0;else{const t=-h/o;t>=0&&t<=1&&(s[p++]=t)}else{const t=u*u-4*l*d;if(Sy(t)){const t=u/l,e=-o/a+t,i=-t/2;e>=0&&e<=1&&(s[p++]=e),i>=0&&i<=1&&(s[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=l*o+1.5*a*(-u+e),n=l*o+1.5*a*(-u-e);i=i<0?-Math.pow(-i,wy):Math.pow(i,wy),n=n<0?-Math.pow(-n,wy):Math.pow(n,wy);const r=(-o-(i+n))/(3*a);r>=0&&r<=1&&(s[p++]=r)}else{const t=(2*l*o-3*a*u)/(2*Math.sqrt(l*l*l)),e=Math.acos(t)/3,i=Math.sqrt(l),n=Math.cos(e),r=(-o-2*i*n)/(3*a),h=(-o+i*(n+xy*Math.sin(e)))/(3*a),c=(-o+i*(n-xy*Math.sin(e)))/(3*a);r>=0&&r<=1&&(s[p++]=r),h>=0&&h<=1&&(s[p++]=h),c>=0&&c<=1&&(s[p++]=c)}}return p}(e,n,s,o,c,Wy);if(0===l)return 0;let u=0,d=-1,p=0,f=0;for(let c=0;c<l;c++){const l=Wy[c],g=0===l||1===l?.5:1;Ey(t,i,r,a,l)<h||(d<0&&(d=Uy(e,n,s,o,Fy),Fy[1]<Fy[0]&&d>1&&Ny(),p=Ey(e,n,s,o,Fy[0]),d>1&&(f=Ey(e,n,s,o,Fy[1]))),2===d?l<Fy[0]?u+=p<e?g:-g:l<Fy[1]?u+=f<p?g:-g:u+=o<f?g:-g:l<Fy[0]?u+=p<e?g:-g:u+=o<p?g:-g)}return u}function jy(t,e,i,n,r,s,a,o){if(o>e&&o>n&&o>s||o<e&&o<n&&o<s)return 0;const h=function(t,e,i,n,r){const s=t-2*e+i,a=2*(e-t),o=t-n;let h=0;if(Sy(s)){if(Ay(a)){const t=-o/a;t>=0&&t<=1&&(r[h++]=t)}}else{const t=a*a-4*s*o;if(Sy(t)){const t=-a/(2*s);t>=0&&t<=1&&(r[h++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*s),n=(-a-e)/(2*s);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}(e,n,s,o,Wy);if(0===h)return 0;const c=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,s);if(c>=0&&c<=1){let o=0;const l=Py(e,n,s,c);for(let n=0;n<h;n++){const h=0===Wy[n]||1===Wy[n]?.5:1;Py(t,i,r,Wy[n])<a||(Wy[n]<c?o+=l<e?h:-h:o+=s<l?h:-h)}return o}const l=0===Wy[0]||1===Wy[0]?.5:1;return Py(t,i,r,Wy[0])<a?0:s<e?l:-l}function Hy(t,e,i,n,r,s,a,o){if((o-=e)>i||o<-i)return 0;const h=Math.sqrt(i*i-o*o);Wy[0]=-h,Wy[1]=h;const c=Math.abs(n-r);if(c<1e-4)return 0;if(c>=qp-1e-4){n=0,r=qp;const e=s?1:-1;return a>=Wy[0]+t&&a<=Wy[1]+t?e:0}if(n>r){const t=n;n=r,r=t}n<0&&(n+=qp,r+=qp);let l=0;for(let e=0;e<2;e++){const i=Wy[e];if(i+t>a){let t=Math.atan2(o,i),e=s?1:-1;t<0&&(t=qp+t),(t>=n&&t<=r||t+qp>=n&&t+qp<=r)&&(t>Vp/2&&t<1.5*Vp&&(e=-e),l+=e)}}return l}function Gy(t){return Math.round(t/Vp*1e8)/1e8%2*Vp}function Vy(t,e){let i=Gy(t[0]);i<0&&(i+=qp);const n=i-t[0];let r=t[1];r+=n,!e&&r-i>=qp?r=i+qp:e&&i-r>=qp?r=i-qp:!e&&i>r?r=i+(qp-Gy(i-r)):e&&i<r&&(r=i-(qp-Gy(r-i))),t[0]=i,t[1]=r}const Xy=[0,0];function Yy(t,e,i,n,r){const s=t,a=t.length;let o,h,c=0,l=0,u=0,d=0,p=0;for(let t=0;t<a;t++){const a=s[t],f=0===t;a[0]===Lf.M&&t>1&&(i||(c+=Ry(l,u,d,p,n,r))),f&&(l=a[1],u=a[2],d=l,p=u);const g=a[0],y=a[1],m=a[2],v=a[3],b=a[4],x=a[5],w=a[6];let S=b,A=x;Xy[0]=S,Xy[1]=A,Vy(Xy,Boolean(a[6])),S=Xy[0],A=Xy[1];const _=S,C=A-S,T=!!(1-(a[6]?0:1)),B=(n-y)*v/v+y;switch(g){case Lf.M:d=y,p=m,l=d,u=p;break;case Lf.L:if(i){if(Oy(l,u,y,m,e,n,r))return!0}else c+=Ry(l,u,y,m,n,r)||0;l=y,u=m;break;case Lf.C:if(i){if(Dy(l,u,y,m,v,b,x,w,e,n,r))return!0}else c+=zy(l,u,y,m,v,b,x,w,n,r)||0;l=x,u=w;break;case Lf.Q:if(i){if(ky(l,u,y,m,v,b,e,n,r))return!0}else c+=jy(l,u,y,m,v,b,n,r)||0;l=v,u=b;break;case Lf.A:if(o=Math.cos(_)*v+y,h=Math.sin(_)*v+m,f?(d=o,p=h):c+=Ry(l,u,o,h,n,r),i){if(Iy(y,m,v,_,_+C,T,e,B,r))return!0}else c+=Hy(y,m,v,_,_+C,T,B,r);l=Math.cos(_+C)*v+y,u=Math.sin(_+C)*v+m;break;case Lf.R:if(d=l=y,p=u=m,o=d+v,h=p+b,i){if(Oy(d,p,o,p,e,n,r)||Oy(o,p,o,h,e,n,r)||Oy(o,h,d,h,e,n,r)||Oy(d,h,d,p,e,n,r))return!0}else c+=Ry(o,p,o,h,n,r),c+=Ry(d,h,d,p,n,r);break;case Lf.Z:if(i){if(Oy(l,u,d,p,e,n,r))return!0}else c+=Ry(l,u,d,p,n,r);l=d,u=p}}var f,g;return i||(f=u,g=p,Math.abs(f-g)<Ly)||(c+=Ry(l,u,d,p,n,r)||0),0!==c}var qy;t.DefaultGraphicUtil=class{contributions;global;canvas;context;_textMeasure;configured;constructor(t,e){this.contributions=t,this.global=e,this.configured=!1,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){if(this.configured)return;const i=vy({nativeCanvas:t.createCanvas({width:100,height:100})});this.canvas=i,this.context=i.getContext("2d"),this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0}bindTextMeasure(t){this._textMeasure=t}measureText(t,e,i="native"){this.configure(this.global,this.global.env);const n=this.global.measureTextMethod;this.global.measureTextMethod=i;const r={width:this._textMeasure.measureTextWidth(t,e),height:e.fontSize??Yg.fontSize};return this.global.measureTextMethod=n,r}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new Mf({defaultFontParams:{fontFamily:Yg.fontFamily,fontSize:Yg.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Mf.ALPHABET_CHAR_SET+Mf.ALPHABET_CHAR_SET.toUpperCase(),...e??{}},t)}},t.DefaultGraphicUtil=dp([rp(),pp(0,op(gp)),pp(0,sp(dy)),pp(1,op(wp)),fp("design:paramtypes",[Object,Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(qy||(qy={}));const Ky=new _f;t.DefaultTransformUtil=class{matrix;originTransform;outSourceMatrix;outTargetMatrix;mode;constructor(){this.matrix=new _f}init(t){return this.mode=qy.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=qy.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(Ky.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){const{x:n,y:r}=i;this.outTargetMatrix.translate(n,r),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-n,-r)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Ky.a,Ky.b,Ky.c,Ky.d,Ky.e,Ky.f),this}scale(t,e,i){return this.mode===qy.matrix?this.scaleMatrix(t,e,i):this}translateMatrix(t,e){const i=this.outSourceMatrix;return Ky.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Ky.a,Ky.b,Ky.c,Ky.d,Ky.e,Ky.f),this}translate(t,e){return this.mode===qy.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===qy.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=dp([rp(),fp("design:paramtypes",[])],t.DefaultTransformUtil);const $y={arc:$g,area:Zg,circle:Jg,line:ey,path:iy,symbol:ay,text:oy,rect:ry,rect3d:sy,polygon:ny,richtext:hy,richtextIcon:ly,image:cy,group:Qg,glyph:ty},Zy=Object.keys($y);function Jy(){return{arc:Object.assign({},$y.arc),area:Object.assign({},$y.area),circle:Object.assign({},$y.circle),line:Object.assign({},$y.line),path:Object.assign({},$y.path),symbol:Object.assign({},$y.symbol),text:Object.assign({},$y.text),rect:Object.assign({},$y.rect),rect3d:Object.assign({},$y.rect3d),polygon:Object.assign({},$y.polygon),richtext:Object.assign({},$y.richtext),richtextIcon:Object.assign({},$y.richtextIcon),image:Object.assign({},$y.image),group:Object.assign({},$y.group),glyph:Object.assign({},$y.glyph)}}function Qy(t,e,i=!0){e&&(i?Object.keys(e).forEach((i=>{t[i]?Object.assign(t[i],e[i]):t[i]=e[i]})):Object.keys(e).forEach((i=>{if(t[i]){const n=t[i],r=e[i];Object.keys(e[i]).forEach((t=>{void 0===n[t]&&(n[t]=r[t])}))}else t[i]=e[i]})))}const tm=new Array(60).fill(0).map((()=>Jy()));class em{combinedTheme;userTheme;commonTheme;_defaultTheme;dirty;constructor(){this._defaultTheme=tm.pop()||Jy(),this.combinedTheme=this._defaultTheme,this.dirty=!1}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0),this.userTheme?Qy(this.userTheme,t.userTheme,!1):this.userTheme=Fp(t.userTheme),Qy(e,t.userTheme)}this.userTheme?this.doCombine(e):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,console.warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this._defaultTheme,n=this.combinedTheme,r=t.common||{},s=Object.assign(r,this.commonTheme);Zy.forEach((r=>{e[r]||s||t[r]?n[r]=Object.assign({},i[r],s??{},t[r]??{},e[r]??{}):n[r]=i[r]})),this.dirty=!1}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,t.common&&(this.commonTheme?Object.assign(this.commonTheme,t.common):this.commonTheme=t.common),this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const im=new em;function nm(t,e){return t.glyphHost?nm(t.glyphHost):e?(t.isContainer,e):rm(t)||im.getTheme()}function rm(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):im.getTheme()}return null}class sm{static auto_increment_id=0;static GenAutoIncrementId(){return sm.auto_increment_id++}}class am extends _p{parent;_prev;_next;_firstChild;_lastChild;_idMap;_count;_structEdit;_nodeList;get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=sm.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}async forEachChildrenAsync(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=await n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=await n),n)return;e=e._next}}}forEach(t){return this.forEachChildren(t)}appendChild(t){if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&console.warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(){if(!this._idMap)return;let t=this._firstChild;for(;t;)t.parent=null,t._prev=null,t._next=null,t=t._next;this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n))&&(i=e,!0))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;t?.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=Tp(i,!0)&&i||Mp(i)&&i.capture,r=Mp(i)&&i.once,s=Bp(e)?void 0:e;return t=n?`${t}capture`:t,e=Bp(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=Tp(i,!0)&&i||Mp(i)&&i.capture,r=Bp(e)?void 0:e;t=n?`${t}capture`:t,e=Bp(e)?e:e.handleEvent;const s=Mp(i)&&i.once;return super.off(t,e,r,s),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return Mp(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class om{bubbles=!0;cancelBubble=!0;cancelable=!1;composed=!1;currentTarget;defaultPrevented=!1;eventPhase=om.prototype.NONE;isTrusted;returnValue;srcElement;target;timeStamp;type;nativeEvent;originalEvent;propagationStopped=!1;propagationImmediatelyStopped=!1;path;manager;detail;view;layer=new hf;get layerX(){return this.layer.x}get layerY(){return this.layer.y}page=new hf;get pageX(){return this.page.x}get pageY(){return this.page.y}canvas=new hf;get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}viewport=new hf;get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}which;NONE=0;CAPTURING_PHASE=1;AT_TARGET=2;BUBBLING_PHASE=3}class hm extends om{altKey;button;buttons;ctrlKey;metaKey;relatedTarget;shiftKey;client=new hf;get clientX(){return this.client.x}get clientY(){return this.client.y}movement=new hf;get movementX(){return this.movement.x}get movementY(){return this.movement.y}offset=new hf;get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}global=new hf;get globalX(){return this.global.x}get globalY(){return this.global.y}screen=new hf;get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,n,r,s,a,o,h,c,l,u,d,p,f){throw new Error("Method not implemented.")}}class cm extends hm{pointerId;width=0;height=0;isPrimary=!1;pointerType;pressure;tangentialPressure;tiltX;tiltY;twist;getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){const t=new cm(this.manager);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t.nativeEvent=this.nativeEvent,t.originalEvent=this.originalEvent,this.manager?.copyPointerData(this,t),this.manager?.copyMouseData(this,t),this.manager?.copyData(this,t),t.target=this.target,t.path=this.composedPath().slice(),t.type=this.type,t}}class lm extends hm{deltaMode;deltaX;deltaY;deltaZ;static DOM_DELTA_PIXEL=0;DOM_DELTA_PIXEL=0;static DOM_DELTA_LINE=1;DOM_DELTA_LINE=1;static DOM_DELTA_PAGE=2;DOM_DELTA_PAGE=2;clone(){const t=new lm(this.manager);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t.nativeEvent=this.nativeEvent,t.originalEvent=this.originalEvent,this.manager?.copyWheelData(this,t),this.manager?.copyMouseData(this,t),this.manager?.copyData(this,t),t.target=this.target,t.path=this.composedPath().slice(),t.type=this.type,t}}class um extends om{constructor(t,e){super(),this.type=t,this.detail=e}}const dm="object"==typeof performance&&performance.now?performance:Date;function pm(t){return"mouse"===t||"pen"===t}class fm{rootTarget;dispatch=new _p;cursor;mappingTable;mappingState={trackingData:{}};eventPool=new Map;_prePointTargetCache;constructor(t){this.rootTarget=t,this.mappingTable={},this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];let i;const n=`${t.canvasX}-${t.canvasY}`;if(this._prePointTargetCache?.[n]?i=this._prePointTargetCache[n]:(i=this.pickTarget(t.canvasX,t.canvasY),this._prePointTargetCache={[n]:i}),e)for(let n=0,r=e.length;n<r;n++)e[n].fn(t,i);else console.warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let n=0,r=i.length-1;n<r;n++)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){e=e??t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}onPointerDown=(t,e)=>{if(!(t instanceof cm))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(pm(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)};onPointerMove=(t,e)=>{if(!(t instanceof cm))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e),n=pm(i.pointerType),r=this.trackingData(t.pointerId),s=this.findMountedTarget(r.overTargets);if(r.overTargets&&s&&s!==this.rootTarget&&s!==i.target){const e="mousemove"===t.type?"mouseout":"pointerout",r=this.createPointerEvent(t,e,s||void 0);if(this.dispatchEvent(r,"pointerout"),n&&this.dispatchEvent(r,"mouseout"),!i.composedPath().includes(s)){const e=this.createPointerEvent(t,"pointerleave",s||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!i.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),n&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(r)}if(s!==i.target){const e="mousemove"===t.type?"mouseover":"pointerover",r=this.clonePointerEvent(i,e);this.dispatchEvent(r,"pointerover"),n&&this.dispatchEvent(r,"mouseover");let a=s?.parent;for(;a&&a!==this.rootTarget.parent&&a!==i.target;)a=a.parent;if(!a||a===this.rootTarget.parent){const t=this.clonePointerEvent(i,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==s&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),n&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(r)}const a="dispatchEvent";this[a](i,"pointermove"),"touch"===i.pointerType&&this[a](i,"touchmove"),n&&(this[a](i,"mousemove"),this.cursor=i.target?.attribute?.cursor||this.rootTarget.getCursor()),r.overTargets=i.composedPath(),this.freeEvent(i)};onPointerOver=(t,e)=>{if(!(t instanceof cm))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),n=this.createPointerEvent(t,t.type,e),r=pm(n.pointerType);this.dispatchEvent(n,"pointerover"),r&&this.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(this.cursor=n.target?.attribute?.cursor||this.rootTarget.getCursor());const s=this.clonePointerEvent(n,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),r&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;i.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(s)};onPointerOut=(t,e)=>{if(!(t instanceof cm))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=pm(t.pointerType),n=this.findMountedTarget(i.overTargets),r=this.createPointerEvent(t,"pointerout",n||void 0);this.dispatchEvent(r),e&&this.dispatchEvent(r,"mouseout");const s=this.createPointerEvent(t,"pointerleave",n||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),e&&this.notifyTarget(s,"mouseleave"),s.target=s.target.parent;i.overTargets=[],this.freeEvent(r),this.freeEvent(s)}this.cursor=""};onPointerUp=(t,e)=>{if(!(t instanceof cm))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=dm.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(pm(n.pointerType)){const t=2===n.button;this.dispatchEvent(n,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),s=this.findMountedTarget(r.pressTargetsByButton[t.button]);let a=s;if(s&&!n.composedPath().includes(s)){let e=s;for(;e&&!n.composedPath().includes(e);){if(n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)this.notifyTarget(n,"touchendoutside");else if(pm(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],a=e}if(a){const e=this.clonePointerEvent(n,"click");e.target=a,e.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:i});const s=r.clicksByButton[t.button];s.target===e.target&&i-s.timeStamp<200?++s.clickCount:s.clickCount=1,s.target=e.target,s.timeStamp=i,e.detail=s.clickCount,pm(e.pointerType)?(this.dispatchEvent(e,"click"),2===s.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&this.dispatchEvent(e,"tap"),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)};onPointerUpOutside=(t,e)=>{if(!(t instanceof cm))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.pressTargetsByButton[t.button]),r=this.createPointerEvent(t,t.type,e);if(n){let e=n;for(;e;)r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):pm(r.pointerType)&&this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)};onWheel=(t,e)=>{if(!(t instanceof lm))return void console.warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)};findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){const n=this.allocateEvent(cm);return this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,n.target=i||this.pickTarget(n.global.x,n.global.y),"string"==typeof e&&(n.type=e),n}createWheelEvent(t,e){const i=this.allocateEvent(lm);return this.copyWheelData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=e||this.pickTarget(i.global.x,i.global.y),i}clonePointerEvent(t,e){const i=this.allocateEvent(cm);return i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice(),i.type=e??i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof cm&&e instanceof cm&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof hm&&e instanceof hm&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset),e.viewport.copyFrom(t.viewport))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=dm.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t)?.pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e)?.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].once&&t.currentTarget.removeEventListener(e,i[n].fn,{once:!0}),i[n].fn.call(i[n].context,t);else this.emitDelegation(t,e)}emitDelegation(t,e){const i=t.currentTarget._events["*"];if(i)if("fn"in i)i.fn.call(i.context,t,e);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,t,e)}pickTarget(t,e){let i;const n=this.rootTarget.pick(t,e);return i=n&&n.graphic?n.graphic:n&&n.group?n.group:t>=0&&t<=Lp(this.rootTarget,"width")&&e>=0&&e<=Lp(this.rootTarget,"height")?this.rootTarget:null,i}}const gm={pickable:!0,visible:!0,dispatchEvent(t){if(!(t instanceof om))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.target=this,t?.manager?.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new um(t,e))}},ym={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class mm{globalObj;manager;supportsTouchEvents;supportsPointerEvents;supportsMouseEvents;applyStyles;viewport;autoPreventDefault;cursorStyles;domElement;resolution=1;currentCursor;rootPointerEvent;rootWheelEvent;eventsAdded;constructor(t){const{targetElement:e,resolution:i,rootNode:n,global:r,viewport:s,autoPreventDefault:a=!1}=t;this.manager=new fm(n),this.globalObj=r,this.supportsPointerEvents=r.supportsPointerEvents,this.supportsTouchEvents=r.supportsTouchEvents,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=a,this.eventsAdded=!1,this.viewport=s,this.rootPointerEvent=new cm,this.rootWheelEvent=new lm,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.setTargetElement(null)}setCursor(t="default"){const{applyStyles:e,domElement:i}=this;if(this.currentCursor===t)return;this.currentCursor=t;const n=this.cursorStyles[t];n?"string"==typeof n&&e?i.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&e&&Object.assign(i.style,n):e&&kp(t)&&!Wp(this.cursorStyles,t)&&(i.style.cursor=t)}onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized){(t.cancelable||!("cancelable"in t))&&t.preventDefault()}for(let t=0,i=e.length;t<i;t++){const i=e[t],n=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(n)}this.setCursor(this.manager.cursor)};onPointerMove=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor)};onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetElement(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,n=i.length;t<n;t++){const n=this.bootstrapEvent(this.rootPointerEvent,i[t]);n.type+=e,this.manager.mapEvent(n)}this.setCursor(this.manager.cursor)};onPointerOverOut=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor)};onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){const e=this.viewport,{x:i,y:n}=t;return{x:i-e.x,y:n-e.y}}mapToCanvasPoint(t){const e=this.globalObj?.mapToCanvasPoint(t,this.domElement);if(e)return e;const{clientX:i,clientY:n}=t,r=this.domElement.getBoundingClientRect();return{x:i-r.left,y:n-r.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,n=t.changedTouches.length;i<n;i++){const n=t.changedTouches[i];Rp(n.button)&&(n.button=0),Rp(n.buttons)&&(n.buttons=1),Rp(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),Rp(n.width)&&(n.width=n.radiusX||1),Rp(n.height)&&(n.height=n.radiusY||1),Rp(n.tiltX)&&(n.tiltX=0),Rp(n.tiltY)&&(n.tiltY=0),Rp(n.pointerType)&&(n.pointerType="touch"),Rp(n.pointerId)&&(n.pointerId=n.identifier||0),Rp(n.pressure)&&(n.pressure=n.force||.5),Rp(n.twist)&&(n.twist=0),Rp(n.tangentialPressure)&&(n.tangentialPressure=0),Rp(n.layerX)&&(n.layerX=n.offsetX=n.clientX),Rp(n.layerY)&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=t.type,e.push(n)}else if(this.globalObj.supportsMouseEvents&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof PointerEvent))e.push(t);else{const i=t;Rp(i.isPrimary)&&(i.isPrimary=!0),Rp(i.width)&&(i.width=1),Rp(i.height)&&(i.height=1),Rp(i.tiltX)&&(i.tiltX=0),Rp(i.tiltY)&&(i.tiltY=0),Rp(i.pointerType)&&(i.pointerType="mouse"),Rp(i.pointerId)&&(i.pointerId=1),Rp(i.pressure)&&(i.pressure=.5),Rp(i.twist)&&(i.twist=0),Rp(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:i,y:n}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=n,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas);const{x:r,y:s}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:i,y:n}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=n,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas);const{x:r,y:s}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=ym[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=dm.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetElement(t){let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);return e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}}const vm=(t,e)=>{const i=e.x-t.x,n=e.y-t.y;return Math.abs(i)>Math.abs(n)?i>0?"right":"left":n>0?"down":"up"},bm=(t,e)=>{const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return Math.sqrt(i*i+n*n)};class xm{timerId;time=0;static Avaliable(){return!0}avaliable(){return xm.Avaliable()}tick(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}tickTo(t,e){this.time=Math.max(0,t),e(this,{once:!0})}release(){this.timerId>0&&(this.timerId=-1)}getTime(){return this.time}}class wm{timerId;static Avaliable(){return!0}avaliable(){return wm.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class Sm{released;static Avaliable(){return!!gy.global.getRequestAnimationFrame()}avaliable(){return Sm.Avaliable()}tick(t,e){gy.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var Am;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Am||(Am={}));class _m{interval;tickerHandler;_mode;status;lastFrameTime;tickCounts;timelines;autoStop;set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=Am.INITIAL,gy.global.hooks.onSetEnv.tap("window",(()=>{this.initHandler()})),gy.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:Sm},{mode:"timeout",cons:wm},{mode:"manual",cons:xm}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new Sm;break;case"timeout":t=new wm;break;case"manual":t=new xm;break;default:console.warn("非法的计时器模式"),t=new Sm}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==Am.INITIAL&&(this.status=Am.PAUSE,!0)}resume(){return this.status!==Am.INITIAL&&(this.status=Am.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(t=!1){if(this.status===Am.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Am.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=Am.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=Am.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}handleTick=(t,e)=>{const{once:i=!1}=e??{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))};_handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===Am.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(i)})))}}class Cm{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static quadIn=Cm.getPowIn(2);static quadOut=Cm.getPowOut(2);static quadInOut=Cm.getPowInOut(2);static cubicIn=Cm.getPowIn(3);static cubicOut=Cm.getPowOut(3);static cubicInOut=Cm.getPowInOut(3);static quartIn=Cm.getPowIn(4);static quartOut=Cm.getPowOut(4);static quartInOut=Cm.getPowInOut(4);static quintIn=Cm.getPowIn(5);static quintOut=Cm.getPowOut(5);static quintInOut=Cm.getPowInOut(5);static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static backIn=Cm.getBackIn(1.7);static backOut=Cm.getBackOut(1.7);static backInOut=Cm.getBackInOut(1.7);static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-Cm.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Cm.bounceIn(2*t):.5*Cm.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/qp*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*qp/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/qp*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*qp/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/qp*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*qp/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*qp/e)*.5+1}}static elasticIn=Cm.getElasticIn(1,.3);static elasticOut=Cm.getElasticOut(1,.3);static elasticInOut=Cm.getElasticInOut(1,.3*1.5)}class Tm{constructor(){this.id=sm.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(e){if(this.paused)return;let i=this.animateHead;for(this.animateCount=0;i;)i.status===t.AnimateStatus.END?this.removeAnimate(i):i.status===t.AnimateStatus.RUNNING||i.status===t.AnimateStatus.INITIAL?(this.animateCount++,i.advance(e)):i.status===t.AnimateStatus.PAUSED&&this.animateCount++,i=i.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),t.release()}}const Bm=new Tm;class Pm{constructor(t,e,i,n,r){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){}getFromProps(){return this.from}getMergedEndProps(){const t=this.getEndProps();return t?this._endProps===t?this._mergedEndProps:(this._endProps=t,void(this._mergedEndProps=Object.assign({},this.step.prev.getLastProps()??{},t))):this.step.prev?this.step.prev.getLastProps():t}update(t,e,i){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1,Object.assign(i,this.step.getLastProps()),this.onUpdate(t,e,i),t&&this.onEnd()}}class Em extends Pm{cb;constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Mm{static mode=t.AnimateMode.NORMAL;static interpolateMap=new Map;constructor(e=sm.GenAutoIncrementId(),i=Bm){this.id=e,this.timeline=i,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new Rm(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=Jp(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Mm.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(e,i=Mm.mode){e&&i&t.AnimateMode.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_PLAY})}runCb(t){const e=new Em((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const a=Mm.interpolateMap.get(t)||Mm.interpolateMap.get("");return!!a&&a(t,e,i,n,r,s)}pause(){this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.PAUSED)}resume(){this.status===t.AnimateStatus.PAUSED&&(this.status=t.AnimateStatus.RUNNING)}to(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new Rm(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(e){if(this._duringTime<this._startTime){if(this._duringTime+e*this.timeScale<this._startTime)return void(this._duringTime+=e*this.timeScale);e=this._duringTime+e*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===t.AnimateStatus.INITIAL&&(this.status=t.AnimateStatus.RUNNING,this._onStart&&this._onStart.forEach((t=>t())));this.setPosition(this.rawPosition+e*this.timeScale)&&this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const n=this.rawPosition,r=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const s=t>=r;if(s&&(t=r),t===n)return s;for(let n=0;n<this.subAnimates.length&&(e=this.subAnimates[n],!(i+e.totalDuration>=t));n++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=t.AnimateStatus.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}class Rm{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new km(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(e){let i=e.duration;(null==i||i<0)&&(i=0);const n=e.easing,r="string"==typeof n?Cm[n]:n,s=this._addStep(i,null,r);return s.type=t.AnimateStepType.customAnimate,this._appendProps(e.getEndProps(),s,!1),this._appendCustomAnimate(e,s),this}to(e,i,n,r){(null==i||i<0)&&(i=0);const s="string"==typeof n?Cm[n]:n,a=this._addStep(i,null,s);return a.type=t.AnimateStepType.to,this._appendProps(e,a,!!r&&r.tempProps),a.propKeys||(a.propKeys=Object.keys(a.props)),r&&r.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(a.propKeys)})),this}from(e,i,n,r){this.to(e,0,n,r);const s={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{s[t]=this.getLastPropByName(t,this.stepTail)})),this.to(s,i,n,r),this.stepTail.type=t.AnimateStepType.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){return this.stepHead?.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(e){if(e>0){const i=this._addStep(+e,null);i.type=t.AnimateStepType.wait,i.prev.customAnimate?i.props=i.prev.customAnimate.getEndProps():i.props=i.prev.props,this.target.onAddStep&&this.target.onAddStep(i)}return this}_addStep(t,e,i){const n=new km(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=n.props[t])}))),n=n.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach((t=>{if(void 0===s[t]){const e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){const e=this.duration,i=this.loop,n=this.rawPosition;let r,s,a=!1;const o=this._startAt??0;if(t<0&&(t=0),t<o)return this.rawPosition=t,!1;if(t-=o,e<=0)return a=!0,a;if(r=Math.floor(t/e),s=t-r*e,a=t>=i*e+e,a&&(s=e,r=i,t=s*r+e),t===n)return a;const h=!this.reversed!=!(this.bounce&&r%2);return h&&(s=e-s),this._deltaPosition=s-this.position,this.position=s,this.rawPosition=t+o,this.updatePosition(a,h),a}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,r=this.duration;if(this.target&&i){let s=i.next;for(;s&&s.position<=n;)i=s,s=i.next;let a=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,a)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return console.warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class km{type;constructor(t,e,i,n){this.duration=e,this.position=t,this.props=i,this.easing=n}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const Dm={duration:200,easing:"cubicOut"},Im={duration:1e3,easing:"quadInOut"};var Om;t.Edge=void 0,(Om=t.Edge||(t.Edge={}))[Om.Top=1]="Top",Om[Om.Right=2]="Right",Om[Om.Bottom=4]="Bottom",Om[Om.Left=8]="Left",Om[Om.ALL=15]="ALL";const Lm=[!1,!1,!1,!1],Um=t=>{let e=!0;if(Tp(t,!0)){for(let i=0;i<4;i++)Lm[i]=t,e&&=!!(Lm[i]??1);e=t}else if(Array.isArray(t))for(let i=0;i<4;i++)Lm[i]=!!t[i],e&&=!!Lm[i];else Lm[0]=!1,Lm[1]=!1,Lm[2]=!1,Lm[3]=!1;return{isFullStroke:e,stroke:Lm}},Wm=[0,0,0,0],Fm=t=>t?Dp(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Wm[0]=t[0],Wm[2]=t[0],Wm[1]=t[1],Wm[3]=t[1],Wm):t:t:0,Nm=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],zm=[1,2,3,0,1,2,3,0];function jm(t,e,i,n){for(;t>=qp;)t-=qp;for(;t<0;)t+=qp;for(;t>e;)e+=qp;Nm[0].x=i,Nm[1].y=i,Nm[2].x=-i,Nm[3].y=-i;const r=Math.ceil(t/Xp)%4,s=Math.ceil(e/Xp)%4;if(n.add(Zp(t)*i,tf(t)*i),n.add(Zp(e)*i,tf(e)*i),r!==s||e-t>Vp){let t=!1;for(let e=0;e<zm.length;e++)if(t||r!==zm[e]){if(t&&s===zm[e])break;if(t){const t=Nm[zm[e]];n.add(t.x,t.y)}}else{t=!0;const e=Nm[r];n.add(e.x,e.y)}}}function Hm(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function Gm(t,e,i){const{x:n,y:r}=af(t.x,t.y,e.x,e.y,i),{x:s,y:a}=af(t.x1,t.y1,e.x1,e.y1,i),o=new hf(n,r,s,a);return o.defined=e.defined,o}function Vm(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let n=[];if(t.length>e.length){n=e.map((t=>{const e=new hf(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)n[r]=Gm(t[r],e[r],i)}else{n=e.map((t=>{const e=new hf(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)n[r]=Gm(t[r],e[r],i)}return n}const Xm=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],Ym=t=>Xm.includes(t);function qm(t,e){if(Dp(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}class Km{static TimeOut=1e3/60;durations;timeout;lastDate;durationsListThreshold;constructor(){this.durations=[],this.timeout=Km.TimeOut,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout((()=>{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}const $m=new Km;var Zm;!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(Zm||(Zm={}));class Jm extends Pm{_group;_clipGraphic;clipFromAttribute;clipToAttribute;_lastClip;_lastPath;constructor(t,e,i,n,r){super(null,null,i,n,r),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=r?.group,this._clipGraphic=r?.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:t.AttributeUpdateType.ANIMATE_END})}onUpdate(e,i,n){if(!this._clipGraphic)return;const r={};Object.keys(this.clipFromAttribute).forEach((t=>{r[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*i})),this._clipGraphic.setAttributes(r,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:i,end:e}})}}function Qm(t,e,i,n,r,s){const a=(e-t)*r+t,o=(i-e)*r+e,h=(n-i)*r+i,c=(o-a)*r+a,l=(h-o)*r+o,u=(l-c)*r+c;s[0]=t,s[1]=a,s[2]=c,s[3]=u,s[4]=u,s[5]=l,s[6]=h,s[7]=n}function tv(t,e){const i=t.length,n=e.length;if(i===n)return[t,e];const r=[],s=[],a=i<n?t:e,o=Math.min(i,n),h=Math.abs(n-i)/6,c=(o-2)/6,l=Math.ceil(h/c),u=[a[0],a[1]];let d=h;for(let t=2;t<o;t+=6){let e=a[t-2],i=a[t-1],n=a[t],o=a[t+1],h=a[t+2],c=a[t+3];const p=a[t+4],f=a[t+5];if(d<=0){u.push(n,o,h,c,p,f);continue}const g=Math.min(d,l)+1;for(let t=1;t<=g;t++){const a=t/g;Qm(e,n,h,p,a,r),Qm(i,o,c,f,a,s),e=r[3],i=s[3],u.push(r[1],s[1],r[2],s[2],e,i),n=r[5],o=s[5],h=r[6],c=s[6]}d-=g-1}return a===t?[u,e]:[t,u]}function ev(t,e){const i=t||e,n=i.length,r=i[n-2],s=i[n-1],a=[];for(let t=0;t<e.length;t+=2)a[t]=r,a[t+1]=s;return a}function iv(t){const e=[],i=t.length;for(let n=0;n<i;n+=2)e[n]=t[i-n-2],e[n+1]=t[i-n-1];return e}function nv(t){let e=0,i=0,n=0;const r=t.length;for(let s=0,a=r-2;s<r;a=s,s+=2){const r=t[a],o=t[a+1],h=t[s],c=t[s+1],l=r*c-h*o;e+=l,i+=(r+h)*l,n+=(o+c)*l}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,n/e/3,e]}function rv(t,e,i,n){const r=(t.length-2)/6;let s=1/0,a=0;const o=t.length,h=o-2;for(let c=0;c<r;c++){const r=6*c;let l=0;for(let s=0;s<o;s+=2){const a=0===s?r:(r+s-2)%h+2,o=t[a]-i[0],c=t[a+1]-i[1],u=e[s]-n[0]-o,d=e[s+1]-n[1]-c;l+=u*u+d*d}l<s&&(s=l,a=c)}return a}function sv(t,e,i,n){const r=[];let s;for(let a=0;a<t.length;a++){let o=t[a];const h=e[a],c=nv(o),l=nv(h);null==s&&(s=c[2]<0!=l[2]<0);const u=[],d=[];let p=0,f=1/0;const g=[],y=o.length;s&&(o=iv(o));const m=6*rv(o,h,c,l),v=y-2;for(let t=0;t<v;t+=2){const e=(m+t)%v+2;u[t+2]=o[e]-c[0],u[t+3]=o[e+1]-c[1]}if(u[0]=o[m]-c[0],u[1]=o[m+1]-c[1],i>0){const t=n/i;for(let e=-n/2;e<=n/2;e+=t){const t=Math.sin(e),i=Math.cos(e);let n=0;for(let e=0;e<o.length;e+=2){const r=u[e],s=u[e+1],a=h[e]-l[0],o=h[e+1]-l[1],c=a*i-o*t,d=a*t+o*i;g[e]=c,g[e+1]=d;const p=c-r,f=d-s;n+=p*p+f*f}if(n<f){f=n,p=e;for(let t=0;t<g.length;t++)d[t]=g[t]}}}else for(let t=0;t<y;t+=2)d[t]=h[t]-l[0],d[t+1]=h[t+1]-l[1];r.push({from:u,to:d,fromCp:c,toCp:l,rotation:-p})}return r}function av(t,e){let i,n;const r=[],s=[];for(let a=0;a<Math.max(t.length,e.length);a++){const o=t[a],h=e[a];let c,l;o?h?([c,l]=tv(o,h),i=c,n=l):(l=ev(n,o),c=o):(c=ev(i,h),l=h),r.push(c),s.push(l)}return[r,s]}const ov=(t,e,i,n,r)=>{Hp(e,n)&&Hp(i,r)||t.push(e,i,n,r,n,r)};function hv(t){const e=t.commandList,i=[];let n,r=0,s=0,a=0,o=0;const h=(t,e)=>{n&&n.length>2&&i.push(n),n=[t,e]};let c,l,u,d;for(let t=0,i=e.length;t<i;t++){const i=e[t],p=0===t;switch(p&&(a=r=i[1],o=s=i[2],[Lf.L,Lf.C,Lf.Q].includes(i[0])&&(n=[a,o])),i[0]){case Lf.M:r=a=i[1],s=o=i[2],h(a,o);break;case Lf.L:c=i[1],l=i[2],ov(n,r,s,c,l),r=c,s=l;break;case Lf.C:n.push(i[1],i[2],i[3],i[4],r=i[5],s=i[6]);break;case Lf.Q:c=i[1],l=i[2],u=i[3],d=i[4],n.push(r+2/3*(c-r),s+2/3*(l-s),u+2/3*(c-u),d+2/3*(l-d),u,d),r=u,s=d;break;case Lf.A:{const t=i[1],e=i[2],u=i[3],d=u,f=i[4],g=i[5],y=!!i[6];c=Math.cos(f)*u+t,l=Math.sin(f)*u+e,p?(a=c,o=l,h(a,o)):ov(n,r,s,c,l),r=Math.cos(g)*u+t,s=Math.sin(g)*u+e;const m=(y?-1:1)*Math.PI/2;for(let i=f;y?i>g:i<g;i+=m){const r=y?Math.max(i+m,g):Math.min(i+m,g);eg(n,i,r,t,e,u,d)}break}case Lf.E:{const t=i[1],e=i[2],u=i[3],d=i[4],f=i[5],g=i[6],y=i[7]+g,m=!!i[8],v=!Hp(f,0),b=Math.cos(f),x=Math.sin(f);let w=Math.cos(g)*u,S=Math.sin(g)*d;v?(c=w*b-S*x+t,l=w*x+S*b+e):(c=w+t,l=S+e),p?(a=c,o=l,h(a,o)):ov(n,r,s,c,l),w=Math.cos(y)*u,S=Math.sin(y)*d,v?(r=w*b-S*x+t,s=w*x+S*b+e):(r=w+t,s=S+e);const A=(m?-1:1)*Math.PI/2;for(let i=g;m?i>y:i<y;i+=A){const r=m?Math.max(i+A,y):Math.min(i+A,y);if(eg(n,i,r,t,e,u,d),v){const i=n.length;for(let r=i-6;r<=i-1;r+=2)w=n[r],S=n[r+1],n[r]=(w-t)*b-(S-e)*x+t,n[r+1]=(w-t)*x+(S-e)*b+e}}break}case Lf.R:a=r=i[1],o=s=i[2],c=a+i[3],l=o+i[4],h(c,o),ov(n,c,o,c,l),ov(n,c,l,a,l),ov(n,a,l,a,o),ov(n,a,o,c,o);break;case Lf.AT:{const t=i[1],e=i[2],h=i[3],c=i[4],l=i[5],u=cf.distancePP({x:r,y:s},{x:t,y:e}),d=cf.distancePP({x:h,y:c},{x:t,y:e}),p=((r-t)*(h-t)+(s-e)*(c-e))/(u*d),f=l/Math.sin(p/2),g=(r+h-2*t)/2,y=(s+c-2*e)/2,m=cf.distancePP({x:g,y:y},{x:0,y:0}),v=t+f*g/m,b=h+f*y/m,x=Math.sqrt(f*f-l*l);a=t+x*(r-t)/u,o=e+x*(s-e)/u,ov(n,r,s,a,o),r=t+x*(h-t)/d,s=e+x*(c-e)/d;const w=ff({x:v,y:b},{x:a,y:o}),S=ff({x:v,y:b},{x:r,y:s});eg(n,w,S,v,b,l,l);break}case Lf.Z:n&&ov(n,r,s,a,o),r=a,s=o}}return n&&n.length>2&&i.push(n),i}function cv(t,e){for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<n.length;t+=2){const i=n[t],r=n[t+1],s={x:i,y:r};e.transformPoint({x:i,y:r},s),n[t]=s.x,n[t+1]=s.y}}}function lv(t){const e=new Ng;for(let i=0;i<t.length;i++){const n=t[i];if(n.length>2){e.moveTo(n[0],n[1]);for(let t=2;t<n.length;t+=6)e.bezierCurveTo(n[t],n[t+1],n[t+2],n[t+3],n[t+4],n[t+5])}}return e}function uv(t,e,i){const n=t/e;let r,s;t>=e?(s=Math.ceil(Math.sqrt(i*n)),r=Math.floor(i/s),0===r&&(r=1,s=i)):(r=Math.ceil(Math.sqrt(i/n)),s=Math.floor(i/r),0===s&&(s=1,r=i));const a=[];for(let t=0;t<r;t++)a.push(s);const o=i-r*s;if(o>0)for(let t=0;t<o;t+=s)t+s<o?a.push(s):a.push(o-t);return a}const dv=(t,e)=>{const i=t.getComputedAttribute("width"),n=t.getComputedAttribute("height"),r=uv(i,n,e),s=[],a=n/r.length;for(let t=0,e=r.length;t<e;t++){const e=r[t],n=i/e;for(let i=0;i<e;i++)s.push({x:0+i*n,y:0+t*a,width:n,height:a})}return s},pv=(t,e)=>{const i=t.getParsedAngle(),n=i.startAngle,r=i.endAngle,s=t.getComputedAttribute("innerRadius"),a=t.getComputedAttribute("outerRadius"),o=Math.abs(n-r),h=Math.abs(a-s),c=uv(o*(s+a)/2,h,e),l=[],u=h/c.length,d=a>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=c.length;t<e;t++){const e=c[t],i=o/e;for(let r=0;r<e;r++)l.push({innerRadius:a-u*t*d,outerRadius:a-u*(t+1)*d,startAngle:n+i*r*p,endAngle:n+i*(r+1)*p})}return l},fv=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),a=uv(s*r,r,e),o=[],h=s/a[0],c=r/a.length,l=n>=i?1:-1;for(let t=0,e=a.length;t<e;t++)for(let e=0,n=a[t];e<n;e++)o.push({innerRadius:c*t,outerRadius:c*(t+1),startAngle:i+h*e*l,endAngle:i+h*(e+1)*l});return o},gv=(t,e)=>{const i=t.filter((t=>!1!==t.defined&&Ip(t.x)&&Ip(t.y)));if(0===i.length)return[];if(1===i.length)return new Array(e).fill(0).map((t=>i[0]));const n=[];if(e<=i.length){const t=i.length/e;let r=0,s=0;for(;r<e;)n.push(i[Math.floor(s)]),s+=t,r++;return n}const r=e-i.length,s=1/(r/(i.length-1)+1);let a=0;for(let e=0,i=t.length;e<i;e++)if(n.push(t[e]),e<i-1){let i=s;const o=t[e].x,h=t[e].y,c=t[e+1].x,l=t[e+1].y;for(;i<1&&a<r;)n.push({x:o+(c-o)*i,y:h+(l-h)*i}),i+=s,a+=1}return n},yv=(t,e)=>{const i=t.attribute;let n=i.points;const r=i.segments;n||(n=r.reduce(((t,e)=>t.concat(e.points??[])),[]));const s=n.filter((t=>!1!==t.defined&&Ip(t.x)&&Ip(t.y)));if(!s.length)return[];const a=[];s.forEach((t=>{a.push({x:t.x,y:t.y})}));for(let t=s.length-1;t>=0;t--){const e=s[t];a.push({x:e.x1??e.x,y:e.y1??e.y})}const o=[];return wv(n,e,o),o},mv=(t,e)=>{const i=t.attribute,n=i.points;if(n)return gv(n,e);if(i.segments){const t=i.segments.reduce(((t,e)=>t.concat(e.points??[])),[]);return gv(t,e)}return[]};const vv=t=>t.map((t=>({x:t.x,y:t.y}))),bv=(t,e,i)=>{const n=t.length,r=[];for(let o=0;o<n;o++){const h=t[o],c=o===n-1?t[0]:t[o+1],l=Tf([e.x,e.y],[i.x,i.y],[h.x,h.y],[c.x,c.y]);l&&"boolean"!=typeof l&&r.push({dot:(s=[l[0]-e.x,l[1]-e.x],a=[i.x-e.x,i.y-e.x],s[0]*a[1]-s[1]*a[0]),point:{x:l[0],y:l[1]},edgeIndex:o})}var s,a;if(r.length<2)return[vv(t),vv(t)];r.sort(((t,e)=>t.dot-e.dot));let o=r[0],h=r[r.length-1];o.edgeIndex>h.edgeIndex&&([o,h]=[h,o]);const c=o.point,l=h.point,u=[{x:c.x,y:c.y}];for(let e=o.edgeIndex+1;e<=h.edgeIndex;e++)u.push({x:t[e].x,y:t[e].y});u.push({x:l.x,y:l.y});const d=[{x:l.x,y:l.y}];for(let e=h.edgeIndex+1,i=o.edgeIndex+n;e<=i;e++){const i=t[e%n];d.push({x:i.x,y:i.y})}return d.push({x:c.x,y:c.y}),[u,d]},xv=t=>{const e=new uf;t.forEach((t=>{e.add(t.x,t.y)}));const i=e.width(),n=e.height();if(i>=n){const n=e.x1+i/2;return bv(t,{x:n,y:e.y1},{x:n,y:e.y2})}const r=e.y1+n/2;return bv(t,{x:e.x1,y:r},{x:e.x2,y:r})},wv=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=xv(t);wv(r[0],n,i),wv(r[1],e-n,i)}},Sv=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:vv(i)}];const n=[];return wv(i,e,n),n},Av=(t,e)=>{const i=hv(t.getParsedPathShape());if(!i.length||e<0)return[];const n=i.length;if(i.length>=e){const t=[],r=Math.floor(i.length/e);for(let s=0;s<e;s++){const a=i.slice(s*r,s===e-1?n:(s+1)*r);t.push({path:lv(a)})}return t}const r=[],s=Math.floor(e/n);let a=e;for(let t=0;t<n;t++){const e=[];for(let n=2,r=i[t].length;n<r;n+=2)e.push({x:i[0][n],y:i[0][n+1]});wv(e,t===n-1?a:s,r),a-=s}return r};var _v={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const Cv={};for(const t in _v)Wp(_v,t)&&(Cv[_v[t]]=t);const Tv={to:{},get:{}};function Bv(t,e,i){return Math.min(Math.max(e,t),i)}function Pv(t){const e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}Tv.get=function(t,e=[0,0,0,1]){let i,n;switch(t.substring(0,3).toLowerCase()){case"hsl":i=Tv.get.hsl(t,e),n="hsl";break;case"hwb":i=Tv.get.hwb(t,e),n="hwb";break;default:i=Tv.get.rgb(t,e),n="rgb"}return i?{model:n,value:i}:null},Tv.get.rgb=function(t,e=[0,0,0,1]){if(!t)return null;const i=e;let n,r,s;if(n=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(s=n[2],n=n[1],r=0;r<3;r++){const t=2*r;i[r]=parseInt(n.slice(t,t+2),16)}s&&(i[3]=Math.round(parseInt(s,16)/255*100)/100)}else if(n=t.match(/^#([a-f0-9]{3,4})$/i)){for(n=n[1],s=n[3],r=0;r<3;r++)i[r]=parseInt(n[r]+n[r],16);s&&(i[3]=Math.round(parseInt(s+s,16)/255*100)/100)}else if(n=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/)){for(r=0;r<3;r++)i[r]=parseInt(n[r+1],10);n[4]&&(i[3]=parseFloat(n[4]))}else{if(!(n=t.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/))){if(n=t.match(/(\D+)/)){if("transparent"===n[1])return[0,0,0,0];const t=_v[n[1]];return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i?(i[3]=1,i):null}return null}for(r=0;r<3;r++)i[r]=Math.round(2.55*parseFloat(n[r+1]));n[4]&&(i[3]=parseFloat(n[4]))}for(r=0;r<3;r++)i[r]=Bv(i[r],0,255);return i[3]=Bv(i[3],0,1),i},Tv.get.hsl=function(t,e=[0,0,0,1]){if(!t)return null;const i=t.match(/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(i){const t=parseFloat(i[4]);return e[0]=(parseFloat(i[1])+360)%360,e[1]=Bv(parseFloat(i[2]),0,100),e[2]=Bv(parseFloat(i[3]),0,100),e[3]=Bv(isNaN(t)?1:t,0,1),e}return null},Tv.get.hwb=function(t,e=[0,0,0,1]){if(!t)return null;const i=t.match(/^hwb\(\s*([+-]?\d*[.]?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(i){const t=parseFloat(i[4]);return e[0]=(parseFloat(i[1])%360+360)%360,e[1]=Bv(parseFloat(i[2]),0,100),e[2]=Bv(parseFloat(i[3]),0,100),e[3]=Bv(isNaN(t)?1:t,0,1),e}return null},Tv.to.hex=function(...t){const e=t;return"#"+Pv(e[0])+Pv(e[1])+Pv(e[2])+(e[3]<1?Pv(Math.round(255*e[3])):"")},Tv.to.rgb=function(...t){const e=t;return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},Tv.to.rgb.percent=function(...t){const e=t,i=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+i+"%, "+n+"%, "+r+"%)":"rgba("+i+"%, "+n+"%, "+r+"%, "+e[3]+")"},Tv.to.hsl=function(...t){const e=t;return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},Tv.to.hwb=function(...t){const e=t;let i="";return e.length>=4&&1!==e[3]&&(i=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+i+")"},Tv.to.keyword=function(t){return Cv[t.slice(0,3)]};const Ev=Tv;var Mv;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Mv||(Mv={}));class Rv{static store255={};static store1={};static Get(t,e=Mv.Color1,i=[0,0,0,1]){if(e===Mv.Color1){let e=Rv.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;if(e=Tv.get(t),e&&e.value){const n=e.value,r=[n[0]/255,n[1]/255,n[2]/255,n[3]];Rv.store1[t]=r,Rv.store255[t]=n,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3]}return i}let n=Rv.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;if(n=Tv.get(t),n&&n.value){const e=n.value;Rv.store1[t]=[e[0]/255,e[1]/255,e[2]/255,e[3]],Rv.store255[t]=e,i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}static Set(t,e,i){if(e===Mv.Color1){if(Rv.store1[t])return;Rv.store1[t]=i,Rv.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Rv.store255[t])return;Rv.store255[t]=i,Rv.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function kv(t,e=!1){return Array.isArray(t)?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function Dv(t,e,i,n,r){if(!t||!e)return t&&kv(t)||e&&kv(e)||!1;let s,a,o=!1,h=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=Rv.Get(t,Mv.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=Rv.Get(e,Mv.Color255):h=!0,o!==h){const s=o?t:e,a=o?e:t,h={...s,stops:s.stops.map((t=>({...t,color:kv(a)})))};return o?Dv(s,h,i,n,r):Dv(h,s,i,n,r)}if(o){if(t.gradient===e.gradient){const n=t,r=e,s=n.stops,a=r.stops;if(s.length!==a.length)return!1;if("linear"===n.gradient)return function(t,e,i){const n=t.stops,r=e.stops,s={gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Lv(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))};return s}(n,r,i);if("radial"===n.gradient)return function(t,e,i){const n=t.stops,r=e.stops,s={gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Lv(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))};return s}(n,r,i);if("conical"===n.gradient)return function(t,e,i){const n=t.stops,r=e.stops,s={gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Lv(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))};return s}(n,r,i)}return!1}r&&r(s,a);const c=function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(s,a,i);return kv(c,n)}const Iv=[0,0,0,0],Ov=[0,0,0,0];function Lv(t,e,i){return Rv.Get(t,Mv.Color255,Iv),Rv.Get(e,Mv.Color255,Ov),`rgba(${Math.round(Iv[0]+(Ov[0]-Iv[0])*i)},${Math.round(Iv[1]+(Ov[1]-Iv[1])*i)},${Math.round(Iv[2]+(Ov[2]-Iv[2])*i)},${Iv[3]+(Ov[3]-Iv[3])*i})`}const Uv=(t,e,i)=>{t.forEach((t=>{if(Number.isFinite(t.to))e[t.key]=t.from+(t.to-t.from)*i;else if("fill"===t.key||"stroke"===t.key){const n=Dv(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},Wv=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const a=t[s],o=a.from,h=a.to,c=a.rotation*i,l=a.fromCp,u=a.toCp,d=Math.sin(c),p=Math.cos(c);r[0]=l[0]+(u[0]-l[0])*i,r[1]=l[1]+(u[1]-l[1])*i;for(let t=0;t<o.length;t+=2){const e=o[t],s=o[t+1],a=e*(1-i)+h[t]*i,c=s*(1-i)+h[t+1]*i;n[t]=a*p-c*d+r[0],n[t+1]=a*d+c*p+r[1]}let f=n[0],g=n[1];e.moveTo(f,g);for(let t=2;t<o.length;t+=6){const i=n[t],r=n[t+1],s=n[t+2],a=n[t+3],o=n[t+4],h=n[t+5];f===i&&g===r&&s===o&&a===h?e.lineTo(o,h):e.bezierCurveTo(i,r,s,a,o,h),f=o,g=h}}},Fv=(t,e,i)=>{const n=t?hv(t):[],r=hv(e);i&&n&&(i.fromTransform&&cv(n,i.fromTransform.clone().getInverse()),cv(n,i.toTransfrom));const[s,a]=av(n,r);return t?sv(s,a,10,Math.PI):a.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},Nv=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],zv=(t,e)=>{if(!t||!e)return null;const i=[];let n=!1;return Object.keys(t).forEach((r=>{if(!Nv.includes(r))return;const s=e[r];Pp(s)||Pp(t[r])||s===t[r]||("fill"===r||"stroke"===r?i.push({from:"string"==typeof t[r]?Rv.Get(t[r],Mv.Color255):t[r],to:"string"==typeof s?Rv.Get(s,Mv.Color255):s,key:r}):i.push({from:t[r],to:s,key:r}),n=!0)})),n?i:null};class jv extends Pm{saveOnEnd;otherAttrs;constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}morphingData;getEndProps(){return{}}onBind(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}onEnd(){}onUpdate(t,e,i){const n=this.target,r="function"==typeof n.pathProxy?n.pathProxy(n.attribute):n.pathProxy;Wv(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&Uv(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const Hv=(t,e,i,n)=>{if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;let r=t?.globalTransMatrix;n&&r&&(r=n.clone().multiply(r.a,r.b,r.c,r.d,r.e,r.f));const s=Fv(t?.toCustomPath?.(),e.toCustomPath(),{fromTransform:r,toTransfrom:e.globalTransMatrix}),a=zv(t?.attribute,e.attribute),o=e.animate(i);return i?.delay&&o.wait(i.delay),o.play(new jv({morphingData:s,otherAttrs:a},i?.duration??Im.duration,i?.easing??Im.easing)),o};class Gv extends Pm{otherAttrs;constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}morphingData;getEndProps(){return{}}onBind(){this.addPathProxy()}addPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.createPathProxy()})),this.onUpdate(!1,0,this.target.attribute)}clearPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.pathProxy=null}))}onEnd(){}onUpdate(t,e,i){this.target.shadowRoot.forEachChildren(((t,i)=>{Wv(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),this.otherAttrs?.[i]&&this.otherAttrs[i].length&&Uv(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const Vv=t=>{const e={};return Object.keys(t).forEach((i=>{Ym(i)||(e[i]=t[i])})),e},Xv=(t,e,i)=>{const n=Vv(t.attribute),r=t.attachShadow();if(e.length)r.setTheme({[e[0].type]:n}),e.forEach((t=>{r.appendChild(t)}));else{const s=t.AABBBounds,a=s.width(),o=s.height();r.setTheme({rect:n}),new Array(i).fill(0).forEach((t=>{const i=gy.graphicService.creator.rect({x:0,y:0,width:a,height:o});r.appendChild(i),e.push(i)}))}},Yv=(t,e,i)=>{const n=[],r=i?null:Vv(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new Ng).fromCustomPath2D(s)};n.push(gy.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&Xv(t,n,e),n},qv=(t,e,i)=>{const n=[],r=i?null:Vv(t.attribute);if("rect"===t.type){dv(t,e).forEach((t=>{n.push(gy.graphicService.creator.rect(i?t:Object.assign({},r,t)))}))}else if("arc"===t.type){pv(t,e).forEach((t=>{n.push(gy.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("circle"===t.type){fv(t,e).forEach((t=>{n.push(gy.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("line"===t.type){const s=mv(t,e),a={size:10,symbolType:"circle"};s.forEach((t=>{n.push(gy.graphicService.creator.symbol(i?Object.assign({},t,a):Object.assign({},r,t,a)))}))}else if("polygon"===t.type){Sv(t,e).forEach((t=>{n.push(gy.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("area"===t.type){yv(t,e).forEach((t=>{n.push(gy.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("path"===t.type){Av(t,e).forEach((t=>{"path"in t?n.push(gy.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(gy.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}return i&&Xv(t,n,e),n};class Kv{static cache=new Map;static GetImage(t,e){let i=Kv.cache.get(t);i?"fail"===i.loadState?gy.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?i.waitingMark?.push(e):e&&gy.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,i.data)})):(i={type:"image",loadState:"init"},Kv.cache.set(t,i),i.dataPromise=gy.global.loadImage(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{i.loadState=e?.data?"success":"fail",i.data=e?.data,i.waitingMark?.map(((n,r)=>{e?.data?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))}))}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetSvg(t,e){let i=Kv.cache.get(t);i?"fail"===i.loadState?gy.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?i.waitingMark?.push(e):e&&gy.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,i.data)})):(i={type:"image",loadState:"init"},Kv.cache.set(t,i),i.dataPromise=gy.global.loadSvg(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{i.loadState=e?.data?"success":"fail",i.data=e?.data,i.waitingMark?.map(((n,r)=>{e?.data?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))}))}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Kv.cache.get(t);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Kv.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=gy.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=gy.global.loadBlob(t):"json"===e&&(i.dataPromise=gy.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}}const $v=new _f,Zv=["lineWidth","lineCap","lineJoin","miterLimit","scaleX","scaleY","angle","anchor"],Jv=["x","y"],Qv=["scaleX","scaleY"],tb=["angle"],eb=new hf;class ib extends am{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(ib.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(e={}){super(),this._AABBBounds=new df,this._updateTag=t.UpdateTag.INIT,this.attribute=e,this.valid=this.isValid(),e.background&&this.loadImage(e.background,!0)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){const{dx:i=t.dx,dy:n=t.dy}=this.attribute;if(e&&this.parent){const t=nm(this.parent).group,{scrollX:e=t.scrollX,scrollY:r=t.scrollY}=this.parent.attribute;eb.x=i+e,eb.y=n+r}else eb.x=i,eb.y=n;return eb}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;gy.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return gy.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this.AABBBounds.clone(),this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new _f),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_LOCAL_MATRIX)}isValid(){const t=this.attribute;return Number.isFinite((t.x??0)+(t.y??0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&t.UpdateTag.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=t.UpdateTag.CLEAR_SHAPE}containsPoint(e,i,n,r){if(!r)return!1;if(n===t.IContainPointMode.GLOBAL){const t=new hf(e,i);this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),e=t.x,i=t.y}return r.containsPoint(this,{x:e,y:i})}setAttributes(t,e=!1,i){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,i)}_setAttributes(t,e=!1,i){const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);r?this._setAttributes(r,i,n):Pp(this.normalAttrs?.[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t&&this.loadImage(e,!0)}needUpdateTags(t){for(let e=0;e<Zv.length;e++){const i=Zv[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Zv.length;e++){if(t===Zv[e])return!0}return!1}initAttributes(e){const i={type:t.AttributeUpdateType.INIT};e=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,null,i)||e,this.attribute=e,e.background&&this.loadImage(e.background,!0),this._updateTag=t.UpdateTag.INIT,this.onAttributeUpdate(i)}translate(e,i){if(0===e&&0===i)return this;const n={type:t.AttributeUpdateType.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,Jv,n);r&&(e=r.x,i=r.y,delete r.x,delete r.y,this._setAttributes(r));const s=this.attribute,a=s.postMatrix;return a?gy.transformUtil.fromMatrix(a,a).translate(e,i):(s.x=(s.x??Hg.x)+e,s.y=(s.y??Hg.y)+i),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(n),this}translateTo(e,i){const n=this.attribute;if(n.x===e&&n.y===i)return this;const r={type:t.AttributeUpdateType.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,Jv,r);return s?(this._setAttributes(s,!1,r),this):(n.x=e,n.y=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(r),this)}scale(e,i,n){if(1===e&&1===i)return this;const r={type:t.AttributeUpdateType.SCALE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i,scaleCenter:n},this.attribute,Qv,r);s&&(e=s.scaleX,i=s.scaleY,delete s.scaleX,delete s.scaleY,this._setAttributes(s));const a=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new _f,a.postMatrix=t),gy.transformUtil.fromMatrix(t,t).scale(e,i,n)}else a.scaleX=(a.scaleX??Hg.scaleX)*e,a.scaleY=(a.scaleY??Hg.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(r),this}scaleTo(e,i){const n=this.attribute;if(n.scaleX===e&&n.scaleY===i)return this;const r={type:t.AttributeUpdateType.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i},this.attribute,Qv,r);return s?(this._setAttributes(s,!1,r),this):(n.scaleX=e,n.scaleY=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(r),this)}rotate(e){if(0===e)return this;const i={type:t.AttributeUpdateType.ROTATE},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,tb,i);if(n)return this._setAttributes(n,!1,i),this;const r=this.attribute;return r.angle=(r.angle??Hg.angle)+e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(i),this}rotateTo(e){const i=this.attribute;if(i.angle===e)return this;const n={type:t.AttributeUpdateType.ROTATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,tb,n);return r?(this._setAttributes(r,!1,n),this):(i.angle=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new Mm(t?.id).bind(this);if(t){const{onStart:i,onFrame:n,onEnd:r,onRemove:s}=t;null!=i&&e.onStart(i),null!=n&&e.onFrame(n),null!=r&&e.onEnd(r),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){gy.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t)}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!Pp(t)||this.currentStates.includes(t))}getState(t){return this.states?.[t]}applyStateAttrs(e,i,n,r){if(n){const t=Object.keys(e),n=r?t.reduce(((t,i)=>(t[i]=void 0===e[i]?this.getDefaultAttribute(i):e[i],t)),{}):e,s=this.animate();s.stateNames=i,s.to(n,this.stateAnimateConfig?.duration??Dm.duration,this.stateAnimateConfig?.easing??Dm.easing)}else this.setAttributes(e,!1,{type:t.AttributeUpdateType.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const n=i.getEndProps();Wp(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs&&this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[]}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else{if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}}addState(t,e,i){if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const n=e&&this.currentStates?.length?this.currentStates.concat([t]):[t];this.useStates(n,i)}useStates(t,e){if(!t.length)return void this.clearStates(e);if(!(this.currentStates?.length!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const i={};t.forEach((e=>{const n=this.stateProxy?this.stateProxy(e,t):this.states?.[e];n&&Object.assign(i,n)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS)===t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_GLOBAL_MATRIX}doUpdateLocalMatrix(){const{x:t=Hg.x,y:e=Hg.y,scaleX:i=Hg.scaleX,scaleY:n=Hg.scaleY,angle:r=Hg.angle,anchor:s,postMatrix:a}=this.attribute,o=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=this.AABBBounds;o[0]=e.x1+(e.x2-e.x1)*t}else o[0]=s[0];if("string"==typeof s[1]){const t=parseFloat(s[1])/100,e=this.AABBBounds;o[1]=e.x1+(e.x2-e.x1)*t}else o[1]=s[1]}!function(t,e,i,n,r,s,a,o){var h,c,l=e.a,u=e.b,d=e.c,p=e.d,f=e.e,g=e.f,y=Zp(a),m=tf(a);o?(h=o[0],c=o[1]):(h=i,c=n);var v=h-i,b=c-n,x=l*y+d*m,w=u*y+p*m,S=d*y-l*m,A=p*y-u*m;t.a=r*x,t.b=r*w,t.c=s*S,t.d=s*A,t.e=f+l*h+d*c-x*v-S*b,t.f=g+u*h+p*c-w*v-A*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,s&&o);const h=this.getOffsetXY(Hg);if(this._transMatrix.e+=h.x,this._transMatrix.f+=h.y,a){const t=$v.setValue(a.a,a.b,a.c,a.d,a.e,a.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),gy.graphicService.onSetStage(this,t))}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(e){e&&this.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_END})}onStep(e,i,n,r,s){const a={};if(n.customAnimate)n.customAnimate.update(s,r,a);else{const t=n.props,o=n.parsedProps,h=n.propKeys;this.stepInterpolate(e,i,a,n,r,s,t,void 0,o,h)}this.setAttributes(a,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:r,end:s,step:n,isFirstFrameOfStep:e.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,r,s,a,o,h,c){c||(c=Object.keys(a),n.propKeys=c),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):c.forEach((s=>{if(!e.validAttr(s))return;const c=a[s],l=(o&&o[s])??t.getLastPropByName(s,n);let u;u=e.interpolateFunc&&e.interpolateFunc(s,r,l,c,i),u||(u=e.customInterpolate(s,r,l,c,this,i),u||this.defaultInterpolate(c,l,s,i,h,r)||this._interpolate(s,r,l,c,i))})),n.parsedProps=h}defaultInterpolate(t,e,i,n,r,s){if(Number.isFinite(t))return n[i]=e+(t-e)*s,!0;if("fill"===i){r||(r={});const a=Dv(e,r.fillColorArray??t,s,!1,((t,e)=>{r.fillColorArray=e}));return a&&(n[i]=a),!0}if("stroke"===i){r||(r={});const a=Dv(e,r.strokeColorArray??t,s,!1,((t,e)=>{r.strokeColorArray=e}));return a&&(n[i]=a),!0}if("shadowColor"===i){r||(r={});const a=Dv(e,r.shadowColorArray??t,s,!0,((t,e)=>{r.shadowColorArray=e}));return a&&(n[i]=a),!0}return!1}_interpolate(t,e,i,n,r){}getDefaultAttribute(t){return nm(this)[this.type][t]}getComputedAttribute(t){return this.attribute[t]??this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=t??gy.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return kp(t,!0)?this.pathProxy=(new Ng).fromString(t):this.pathProxy=new Ng,this.pathProxy}loadImage(t,e=!1){if(!t)return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};var r;this.resources.set(i,n),"string"==typeof t?(n.state="loading",r=t,new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(r)||function(t){return new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t)}(t)?(Kv.GetImage(t,this),this.backgroundImg=this.backgroundImg||e):t.startsWith("<svg")&&(Kv.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e)):(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e)}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released"}_emitCustomEvent(t,e){if(this._events&&t in this._events){const i=new um(t,e);i.bubbles=!1,i.manager=this.stage?.eventSystem?.manager,this.dispatchEvent(i)}}}function nb(t,e,i,n=0){return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}ib.mixin(gm);let rb=0;function sb(){return rb++}const ab=sb(),ob=sb(),hb=sb(),cb=sb(),lb=sb(),ub=sb(),db=sb(),pb=sb(),fb=sb(),gb=sb(),yb=sb(),mb=sb(),vb=sb(),bb=sb(),xb=sb(),wb=sb(),Sb=Symbol.for("GraphicService"),Ab=Symbol.for("GraphicCreator");var _b;t.GroupUpdateAABBBoundsMode=void 0,(_b=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[_b.LESS_GROUP=0]="LESS_GROUP",_b[_b.MORE_GROUP=1]="MORE_GROUP";class Cb extends ib{type="group";parent=null;isContainer=!0;constructor(e){super(e),this.numberType=ub,this._childUpdateTag=t.UpdateTag.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new em),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new em)}hideAll(){this.setAttribute("visible",!1),this.forEachChildren((t=>{t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)}))}showAll(){this.setAttribute("visible",!0),this.forEachChildren((t=>{t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)}))}containsPoint(e,i,n){if(n===t.IContainPointMode.GLOBAL){const t=new hf(e,i);return this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),this.AABBBounds.contains(t.x,t.y)}return this.AABBBounds.contains(e,i)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;gy.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return gy.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateAABBBounds(){const t=this.attribute,e=nm(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=gy.graphicService.updateGroupAABBBounds(t,nm(this).group,this._AABBBounds,this),{boundsPadding:n=e.boundsPadding}=t,r=Fm(n);return r&&i.expand(r),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),i}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS,this._childUpdateTag&=t.UpdateTag.CLEAR_BOUNDS}tryUpdateOBBBounds(){throw new Error("暂不支持")}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS||(this._childUpdateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),gy.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),gy.graphicService.onClearIncremental(this,this.stage)}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){const i=super.insertBefore(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertAfter(t,e){const i=super.insertAfter(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertInto(t,e){const i=super.insertInto(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}removeChild(t){const e=super.removeChild(t);return t.stage=null,gy.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){this.forEachChildren((t=>{gy.graphicService.onRemove(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),gy.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=gy.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new Cb({...this.attribute})}}const Tb=Symbol.for("LayerHandlerContribution");class Bb extends Cb{get offscreen(){return this.layerHandler.offscreen}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,n){super({}),this.stage=t,this.global=e,this.window=i,this.main=n.main,this.layerHandler=fy.get(Tb),this.layerHandler.init(this,i,{main:n.main,canvasId:n.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:n.zIndex??0}),this.layer=this,this.subLayers=new Map,this.theme=new em,this.background="rgba(0, 0, 0, 0)",this.virtual=!!n.virtual,this.afterDrawCbs=[]}combineSubLayer(t=!0){const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{gy.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}render(t,e){const i=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:i.x,y:i.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:t.background??this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this)))}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){throw new Error("暂不支持")}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}combineTo(t,e){this.offscreen&&(this.layerHandler.drawTo(t,[this],{background:e.background??this.background,renderService:e.renderService,x:this.stage.x,y:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,...e}),this.afterDrawCbs.forEach((t=>t(this))))}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{gy.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){this.layerHandler.drawTo(t,[this],{background:e.background??this.background,renderService:e.renderService,x:this.stage.x,y:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,...e}),this.afterDrawCbs.forEach((t=>t(this)))}}t.DefaultLayerService=class{global;constructor(t){this.global=t,this.layerMap=new Map}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}createLayer(t,e={main:!1}){this.tryInit();const i=new Bb(t,this.global,t.window,{...e,virtual:0===this.staticLayerCountInEnv}),n=this.layerMap.get(t)||[];return n.push(i),this.layerMap.set(t,n),this.staticLayerCountInEnv--,i}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}},t.DefaultLayerService=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],t.DefaultLayerService);const Pb=Symbol.for("Window"),Eb=Symbol.for("WindowHandlerContribution");t.DefaultWindow=class{global;_width;_height;_handler;hooks={onChange:new bp(["x","y","width","height"])};get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(t){this.global=t,this._uid=sm.GenAutoIncrementId()}postInit(){this.global.hooks.onSetEnv.tap("window",(()=>{this.active()})),this.active()}active(){const t=this.global;if(!t.env||this.actived)return;fy.getNamed(Eb,t.env).configure(this,t),this.actived=!0}get style(){return this._handler.getStyle()}set style(t){this._handler.setStyle(t)}create(t){this._handler.createWindow(t);const e=this._handler.getWH();this._width=e.width,this._height=e.height,this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t,e){this._handler.clearViewBox(t,e)}},dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],t.DefaultWindow.prototype,"postInit",null),t.DefaultWindow=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],t.DefaultWindow);const Mb=Symbol.for("TransformUtil"),Rb=Symbol.for("GraphicUtil"),kb=Symbol.for("LayerService");var Db=new Qd((e=>{e(t.DefaultGlobal).toSelf().inSingletonScope(),e(wp).toService(t.DefaultGlobal),e(t.DefaultWindow).to(t.DefaultWindow),e(Pb).toService(t.DefaultWindow),e(t.DefaultGraphicUtil).toSelf().inSingletonScope(),e(Rb).toService(t.DefaultGraphicUtil),e(t.DefaultTransformUtil).toSelf().inSingletonScope(),e(Mb).toService(t.DefaultTransformUtil),e(t.DefaultLayerService).toSelf().inSingletonScope(),e(kb).toService(t.DefaultLayerService)}));function Ib(t,e){return!(!t&&!e)}function Ob(t,e){let i;return i=Dp(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Lb(t,e,i){return i&&t*e>0}function Ub(t,e,i,n,r){return r&&t*e>0&&i>0&&n>0}function Wb(t,e){return t*e>0}function Fb(t,e,i,n){return t*e>0&&i>0&&n>0}function Nb(t,e,i,n,r,s,a,o){if(!t.pathProxy)return!1;const h=nm(t,s?.theme)[t.type],{fill:c=h.fill,stroke:l=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:g=h.visible}=t.attribute,y=Lb(u,d,c),m=Wb(u,f),v=Ib(c),b=Ob(l,p);if(!g)return!0;if(!v&&!b)return!0;if(!(y||m||a||o))return!0;e.beginPath();return ng(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),b&&(o?o(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),v&&(a?a(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fill())),!0}function zb(t,e,i,n,r,s,a,o){const h=i-t,c=n-e,l=a-r,u=o-s;let d=u*h-l*c;return d*d<Gp?[]:(d=(l*(e-s)-u*(t-r))/d,[t+d*h,e+d*c])}function jb(t,e,i,n,r,s,a){const o=t-i,h=e-n,c=(a?s:-s)/Math.sqrt(o*o+h*h),l=c*h,u=-c*o,d=t+l,p=e+u,f=i+l,g=n+u,y=(d+f)/2,m=(p+g)/2,v=f-d,b=g-p,x=v*v+b*b,w=r-s,S=d*g-f*p,A=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-S*S));let _=(S*b-v*A)/x,C=(-S*v-b*A)/x;const T=(S*b+v*A)/x,B=(-S*v+b*A)/x,P=_-y,E=C-m,M=T-y,R=B-m;return P*P+E*E>M*M+R*R&&(_=T,C=B),{cx:_,cy:C,x01:-l,y01:-u,x11:_*(r/w-1),y11:C*(r/w-1)}}function Hb(t,e,i,n,r,s,a){const{startAngle:o,endAngle:h}=t.getParsedAngle(),c=Kp(h-o),l=h>o;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=Gp)e.moveTo(i,n);else if(c>=qp-Gp)e.moveTo(i+r*Zp(o),n+r*tf(o)),e.arc(i,n,r,o,h,!l),s>Gp&&(e.moveTo(i+s*Zp(h),n+s*tf(h)),e.arc(i,n,s,h,o,l));else{const d=t.getParsedCornerRadius(),{outerDeltaAngle:p,innerDeltaAngle:f,outerStartAngle:g,outerEndAngle:y,innerEndAngle:m,innerStartAngle:v}=t.getParsePadAngle(o,h),b=d,x=d,w=d,S=d,A=Math.max(x,b),_=Math.max(w,S);let C=A,T=_;const B=r*Zp(g),P=r*tf(g),E=s*Zp(m),M=s*tf(m);let R,k,D,I;if((_>Gp||A>Gp)&&(R=r*Zp(y),k=r*tf(y),D=s*Zp(v),I=s*tf(v),c<Vp)){const t=zb(B,P,D,I,R,k,E,M);if(t){const e=B-t[0],i=P-t[1],n=R-t[0],a=k-t[1],o=1/tf(rf((e*n+i*a)/(ef(e*e+i*i)*ef(n*n+a*a)))/2),h=ef(t[0]*t[0]+t[1]*t[1]);T=Qp(_,(s-h)/(o-1)),C=Qp(A,(r-h)/(o+1))}}if(p<.001)a&&(a[3]||a[1])&&e.moveTo(i+B,n+P),u=!0;else if(C>Gp){const t=Qp(b,C),s=Qp(x,C),o=jb(D,I,B,P,r,t,Number(l)),h=jb(R,k,E,M,r,s,Number(l));C<A&&t===s?!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,C,$p(o.y01,o.x01),$p(h.y01,h.x01),!l)):e.moveTo(i+o.cx+C*Zp($p(h.y01,h.x01)),n+o.cy+C*tf($p(h.y01,h.x01))):!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),t>0&&e.arc(i+o.cx,n+o.cy,t,$p(o.y01,o.x01),$p(o.y11,o.x11),!l),e.arc(i,n,r,$p(o.cy+o.y11,o.cx+o.x11),$p(h.cy+h.y11,h.cx+h.x11),!l),s>0&&e.arc(i+h.cx,n+h.cy,s,$p(h.y11,h.x11),$p(h.y01,h.x01),!l)):s>0?e.moveTo(i+h.cx+s*Zp($p(h.y01,h.x01)),n+h.cy+s*tf($p(h.y01,h.x01))):e.moveTo(i+R,n+r*tf(y))}else a&&!a[0]||(e.moveTo(i+B,n+P),e.arc(i,n,r,g,y,!l));if(!(s>Gp)||f<.001)!a||a[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),u=!0;else if(T>Gp){const t=Qp(S,T),r=Qp(w,T),o=jb(E,M,R,k,s,-r,Number(l)),h=jb(B,P,D,I,s,-t,Number(l));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),T<_&&t===r){const t=$p(h.y01,h.x01);!a||a[2]?e.arc(i+o.cx,n+o.cy,T,$p(o.y01,o.x01),t,!l):e.moveTo(i+o.cx+Zp(t),n+o.cy+tf(t))}else!a||a[2]?(r>0&&e.arc(i+o.cx,n+o.cy,r,$p(o.y01,o.x01),$p(o.y11,o.x11),!l),e.arc(i,n,s,$p(o.cy+o.y11,o.cx+o.x11),$p(h.cy+h.y11,h.cx+h.x11),l),t>0&&e.arc(i+h.cx,n+h.cy,t,$p(h.y11,h.x11),$p(h.y01,h.x01),!l)):t>0?e.moveTo(i+h.cx+t*Zp($p(h.y01,h.x01)),n+h.cy+t*tf($p(h.y01,h.x01))):e.moveTo(i+D,n+I)}else!a||a[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),!a||a[2]?e.arc(i,n,s,m,v,l):e.moveTo(i+s*Zp(v),n+s*tf(v))}return a?a[3]&&e.lineTo(i+r*Zp(h),n+r*Zp(h)):e.closePath(),u}class Gb{static canvas;static ctx;static GetCanvas(){try{return Gb.canvas||(Gb.canvas=gy.global.createCanvas({})),Gb.canvas}catch(t){return null}}static GetCtx(){if(!Gb.ctx){const t=Gb.GetCanvas();Gb.ctx=t.getContext("2d")}return Gb.ctx}}class Vb{rgbaSet;constructor(t=[],e=100){const i=Gb.GetCanvas(),n=Gb.GetCtx();if(i.width=e,i.height=1,!n)return;if(n.translate(0,0),!n)throw new Error("获取ctx发生错误");const r=n.createLinearGradient(0,0,e,0);t.forEach((t=>{r.addColorStop(t[0],t[1])})),n.fillStyle=r,n.fillRect(0,0,e,1),this.rgbaSet=n.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}static dataMap=new Map;static GetOrCreate(t=[],e=100){let i="";t.forEach((t=>i+=t.join())),i+=e;let n=Vb.dataMap.get(i);return n||(n=new Vb(t,e),Vb.dataMap.set(i,n)),n}static SetColorInterpolateInstance(t,e){Vb.dataMap.set(t,e)}static GetColorInterpolateInstance(t){return Vb.dataMap.get(t)}}class Xb{static cache={};static ImageSize=[20,40,80,160,320,640,1280,2560];static GetSize(t){for(let e=0;e<Xb.ImageSize.length;e++)if(Xb.ImageSize[e]>=t)return Xb.ImageSize[e];return t}static Get(t,e,i,n,r,s,a){const o=Xb.GenKey(t,e,i,n,r),h=Xb.cache[o];if(!h||0===h.length)return null;for(let t=0;t<h.length;t++)if(h[t].width>=s&&h[t].height>=a)return h[t].pattern;return null}static Set(t,e,i,n,r,s,a,o){const h=Xb.GenKey(t,e,i,n,r);Xb.cache[h]?Xb.cache[h].push({width:a,height:o,pattern:s}):Xb.cache[h]=[{width:a,height:o,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function Yb(t,e,i,n){const{stops:r,startAngle:s,endAngle:a}=n;for(;i<0;)i+=qp;for(;i>qp;)i-=qp;if(i<s)return r[0].color;if(i>a)return r[0].color;let o,h,c=(i-s)/(a-s);for(let t=0;t<r.length;t++)if(r[t].offset>=c){o=r[t-1],h=r[t];break}return c=(c-o.offset)/(h.offset-o.offset),Dv(o.color,h.color,c,!1)}function qb(t,e,i,n,r,s,a,o,h){const c=Math.floor(180*r/Math.PI),l=Gb.GetCanvas(),u=Gb.GetCtx();if(!u)return null;const d=Xb.GetSize(o),p=Xb.GetSize(h);let f=Xb.Get(e,i,n,s,a,d,p);if(f)return f;const g=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(n,2),Math.pow(d-i,2)+Math.pow(n,2)),Math.max(Math.pow(d-i,2)+Math.pow(p-n,2),Math.pow(i,2)+Math.pow(p-n,2)))),y=c+1,m=r/Math.max(1,y-1),v=Vb.GetOrCreate(e,y),b=2*Math.PI*g/360;l.width=d,l.height=p,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,d,p),u.translate(i,n),u.rotate(s);for(let t=0,e=y-1;t<e&&!(s+t*m>a);t++){const e=v.getColor(t);u.beginPath(),u.rotate(m),u.moveTo(0,0),u.lineTo(g,-2*b),u.lineTo(g,0),u.fillStyle=e,u.closePath(),u.fill()}const x=u.getImageData(0,0,d,p);return l.width=x.width,l.height=x.height,u.putImageData(x,0,0),f=t.createPattern(l,"no-repeat"),f&&Xb.Set(e,i,n,s,a,f,d,p),f}const Kb=Symbol.for("ArcRenderContribution"),$b=Symbol.for("AreaRenderContribution"),Zb=Symbol.for("CircleRenderContribution"),Jb=Symbol.for("GroupRenderContribution"),Qb=Symbol.for("ImageRenderContribution"),tx=Symbol.for("PathRenderContribution"),ex=Symbol.for("PolygonRenderContribution"),ix=Symbol.for("RectRenderContribution"),nx=Symbol.for("SymbolRenderContribution"),rx=Symbol.for("TextRenderContribution"),sx=Symbol.for("InteractiveSubRenderContribution");t.DefaultCanvasArcRender=class{arcRenderContribitions;type;numberType=ab;_arcBeforeRenderContribitions;_arcAfterRenderContribitions;constructor(t){this.arcRenderContribitions=t}drawArcTailCapPath(t,e,i,n,r,s,a,o){const h=o-a,c=t.getParsedAngle(),l=c.startAngle;let u=c.endAngle;u=o;const d=Kp(u-l),p=u>l;let f=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),{outerDeltaAngle:y,innerDeltaAngle:m,outerStartAngle:v,outerEndAngle:b,innerEndAngle:x,innerStartAngle:w}=t.getParsePadAngle(l,u),S=g,A=g,_=g,C=g,T=Math.max(A,S),B=Math.max(_,C);let P=T,E=B;const M=r*Zp(v),R=r*tf(v),k=s*Zp(x),D=s*tf(x);let I,O,L,U;if((B>Gp||T>Gp)&&(I=r*Zp(b),O=r*tf(b),L=s*Zp(w),U=s*tf(w),d<Vp)){const t=zb(M,R,L,U,I,O,k,D);if(t){const e=M-t[0],i=R-t[1],n=I-t[0],a=O-t[1],o=1/tf(rf((e*n+i*a)/(ef(e*e+i*i)*ef(n*n+a*a)))/2),h=ef(t[0]*t[0]+t[1]*t[1]);E=Qp(B,(s-h)/(o-1)),P=Qp(T,(r-h)/(o+1))}}if(P>Gp){const t=Qp(S,P),s=Qp(A,P),a=jb(L,U,M,R,r,t,Number(p)),o=jb(I,O,k,D,r,s,Number(p));if(P<T&&t===s)e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),e.arc(i+a.cx,n+a.cy,P,$p(a.y01,a.x01),$p(o.y01,o.x01),!p);else{const t=u-h-.03,a=$p(o.y11,o.x11);e.arc(i,n,r,t,a,!p),s>0&&e.arc(i+o.cx,n+o.cy,s,$p(o.y11,o.x11),$p(o.y01,o.x01),!p)}}else e.moveTo(i+M,n+R);if(!(s>Gp)||m<.001)e.lineTo(i+k,n+D),f=!0;else if(E>Gp){const t=Qp(C,E),r=Qp(_,E),a=jb(k,D,I,O,s,-r,Number(p)),o=jb(M,R,L,U,s,-t,Number(p));if(e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01),E<B&&t===r){const t=$p(o.y01,o.x01);e.arc(i+a.cx,n+a.cy,E,$p(a.y01,a.x01),t,!p)}else{r>0&&e.arc(i+a.cx,n+a.cy,r,$p(a.y01,a.x01),$p(a.y11,a.x11),!p);const t=$p(a.cy+a.y11,a.cx+a.x11),o=u-h-.03;e.arc(i,n,s,t,o,p)}}else e.lineTo(i+s*Zp(w),n+s*tf(w));return f}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).arc,{fill:l=c.fill,background:u,stroke:d=c.stroke,opacity:p=c.opacity,fillOpacity:f=c.fillOpacity,lineWidth:g=c.lineWidth,strokeOpacity:y=c.strokeOpacity,visible:m=c.visible,x:v=c.x,y:b=c.y}=e.attribute,x=Lb(p,f,l),w=Wb(p,y),S=Ib(l,u),A=Ob(d,g);if(!e.valid||!m)return;if(!S&&!A)return;if(!(x||w||o||h||u))return;const{outerRadius:_=c.outerRadius,innerRadius:C=c.innerRadius,cap:T=c.cap,forceShowCap:B=c.forceShowCap}=e.attribute;let P=!1;const{isFullStroke:E,stroke:M}=Um(d);if(S||E){if(i.beginPath(),Hb(e,i,n,r,_,C),!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const e=this.arcRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._arcBeforeRenderContribitions.push(e):this._arcAfterRenderContribitions.push(e)}))}P=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,c,s,o,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),S&&(o?o(i,e.attribute,c):x&&(i.setCommonStyle(e,e.attribute,v-n,b-r,c),i.fill())),A&&E&&(h?h(i,e.attribute,c):w&&(i.setStrokeStyle(e,e.attribute,v-n,b-r,c),i.stroke()))}if(!E&&A){if(i.beginPath(),Hb(e,i,n,r,_,C,M),!P){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const e=this.arcRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._arcBeforeRenderContribitions.push(e):this._arcAfterRenderContribitions.push(e)}))}P=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,c,s,o,h)}))}h?h(i,e.attribute,c):w&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke())}if(T&&B){const{startAngle:a,endAngle:l}=e.getParsedAngle();if(Kp(l-a)>=qp-Gp){i.beginPath();const a=Math.abs(_-C)/2/_,{endAngle:l=c.endAngle,fill:u=c.fill}=e.attribute,d=l;if(this.drawArcTailCapPath(e,i,n,r,_,C,d,d+a),!P){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const e=this.arcRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._arcBeforeRenderContribitions.push(e):this._arcAfterRenderContribitions.push(e)}))}P=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,c,s,o,h)}))}if(S){const t=u;if("conical"===t.gradient){const s=Yb(0,0,l,t);o||Lb&&(i.setCommonStyle(e,e.attribute,n,r,c),i.fillStyle=s,i.fill())}}A&&(h||w&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke()))}}this._arcAfterRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,c,s,o,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=nm(t,n?.theme).arc;r.highPerformanceSave();let{x:a=s.x,y:o=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);a+=e.x,o+=e.y,r.setTransformForCurrent()}else a=0,o=0,r.transformFromMatrix(t.transMatrix,!0);Nb(t,r,a,o,0,n)||this.drawShape(t,r,a,o,i,n),r.highPerformanceRestore()}},t.DefaultCanvasArcRender=dp([rp(),pp(0,op(gp)),pp(0,sp(Kb)),fp("design:paramtypes",[Object])],t.DefaultCanvasArcRender),t.DefaultCanvasCircleRender=class{circleRenderContribitions;type;numberType=cb;_circleRenderContribitions;constructor(t){this.circleRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).circle,{fill:l=c.fill,background:u,stroke:d=c.stroke,radius:p=c.radius,startAngle:f=c.startAngle,endAngle:g=c.endAngle,fillOpacity:y=c.fillOpacity,strokeOpacity:m=c.strokeOpacity,opacity:v=c.opacity,lineWidth:b=c.lineWidth,visible:x=c.visible,x:w=c.x,y:S=c.y}=e.attribute,A=Lb(v,y,l),_=Wb(v,m),C=Ib(l,u),T=Ob(d,b);e.valid&&x&&(C||T)&&(A||_||o||h||u)&&(i.beginPath(),i.arc(n,r,p,f,g),i.closePath(),this._circleRenderContribitions||(this._circleRenderContribitions=this.circleRenderContribitions.getContributions()||[],this._circleRenderContribitions.sort(((t,e)=>e.order-t.order))),this._circleRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),C&&(o?o(i,e.attribute,c):A&&(i.setCommonStyle(e,e.attribute,w-n,S-r,c),i.fill())),T&&(h?h(i,e.attribute,c):_&&(i.setStrokeStyle(e,e.attribute,w-n,S-r,c),i.stroke())),this._circleRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h)})))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=nm(t,n?.theme).circle;let{x:a=s.x,y:o=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);a+=e.x,o+=e.y,r.setTransformForCurrent()}else a=0,o=0,r.transformFromMatrix(t.transMatrix,!0);Nb(t,r,a,o,0,n)||this.drawShape(t,r,a,o,i,n),r.highPerformanceRestore()}},t.DefaultCanvasCircleRender=dp([rp(),pp(0,op(gp)),pp(0,sp(Zb)),fp("design:paramtypes",[Object])],t.DefaultCanvasCircleRender);const ax=["radius","startAngle","endAngle",...Zv];class ox extends ib{type="circle";constructor(t={radius:1}){super(t),this.numberType=cb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}doUpdateAABBBounds(t){const e=nm(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=gy.graphicService.updateCircleAABBBounds(i,nm(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Fm(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return nm(this).circle[t]}needUpdateTags(t){for(let e=0;e<ax.length;e++){const i=ax[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<ax.length;e++){if(t===ax[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=t.radius??this.getDefaultAttribute("radius"),i=t.startAngle??this.getDefaultAttribute("startAngle"),n=t.endAngle??this.getDefaultAttribute("endAngle"),r=new Ng;return r.arc(0,0,e,i,n),r}clone(){return new ox({...this.attribute})}}function hx(t,e={},i){i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(s?s+" ":"")+a*i+"px "+(o||"sans-serif")}function cx(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function lx(t,e,i,n=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?n-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}class ux{fontFamily;textOptions;textMeasure;constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,n,r,s,a,o){const h=[],c=[e,i],l=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,a);h.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===n||"start"===n||("center"===n?l[0]=c[0]/-2:"right"!==n&&"end"!==n||(l[0]=-c[0])),"top"===r||("middle"===r?l[1]=c[1]/-2:"bottom"===r&&(l[1]=-c[1]));const u={xOffset:l[0],yOffset:l[1],width:c[0],height:c[1]};return this.layoutWithBBox(u,h,n,r,s)}GetLayoutByLines(t,e,i,n,r="",s){t=t.map((t=>t.toString()));const a=[],o=[0,0];if("number"==typeof s&&s!==1/0){let e;for(let i=0,n=t.length;i<n;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),s),a.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,r).str,width:e});o[0]=s}else{let e,i;s=0;for(let n=0,r=t.length;n<r;n++)i=t[n],e=this.textMeasure.measureTextWidth(i,this.textOptions),s=Math.max(s,e),a.push({str:i,width:e});o[0]=s}o[1]=a.length*n;const h={xOffset:0,yOffset:0,width:o[0],height:o[1]};return this.LayoutBBox(h,e,i),this.layoutWithBBox(h,a,e,i,n)}layoutWithBBox(t,e,i,n,r){const s=[0,0],a=e.length*r;"top"===n||("middle"===n?s[1]=(t.height-a)/2:"bottom"===n&&(s[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,n,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,r,s){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=r,e}}const dx=["text","maxLineWidth","fontSize","fontFamily","fontWeight","ellipsis","lineHeight",...Zv];class px extends ib{type="text";cache;_font;get font(){const t=nm(this).text;return this._font||(this._font=hx(this.attribute,t)),this._font}get clipedText(){const t=this.attribute,e=nm(this).text;if(Array.isArray(t.text))return;const{maxLineWidth:i=e.maxLineWidth}=t;return Number.isFinite(i)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(t.text??e.text).toString()}get clipedWidth(){if(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=nm(this).text,e=this.attribute;if(Array.isArray(e.text))return;const{maxLineWidth:i=t.maxLineWidth}=e;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),this.clipedText!==e.text)}get multilineLayout(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}constructor(t={text:"",fontSize:16}){super(t),this.numberType=wb,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return null!=t&&""!==t}doUpdateAABBBounds(){const t=nm(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=this.attribute,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}updateSingallineAABBBounds(t){const e=nm(this).text,i=gy.graphicUtil.textMeasure;let n,r;const s=this.attribute,{maxLineWidth:a=e.maxLineWidth,ellipsis:o=e.ellipsis,textAlign:h=e.textAlign,textBaseline:c=e.textBaseline,fontSize:l=e.fontSize,fontWeight:u=e.fontWeight,stroke:d=e.stroke,lineWidth:p=e.lineWidth}=s,f=Math.max(2,.075*l),{lineHeight:g=s.lineHeight??(s.fontSize||e.fontSize)+f}=s;if(!this.shouldUpdateShape()&&this.cache){n=this.cache.clipedWidth;const t=cx(h,n),e=lx(c,g,l);return this._AABBBounds.set(t,e,t+n,e+g),d&&this._AABBBounds.expand(p/2),this._AABBBounds}if(Number.isFinite(a)){if(o){const s=!0===o?e.ellipsis:o,h=i.clipTextWithSuffix(t.toString(),{fontSize:l,fontWeight:u},a,s);r=h.str,n=h.width}else{const e=i.clipText(t.toString(),{fontSize:l,fontWeight:u},a);r=e.str,n=e.width}this.cache.clipedText=r,this.cache.clipedWidth=n}else n=i.measureTextWidth(t.toString(),{fontSize:l,fontWeight:u}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=n;this.clearUpdateShapeTag();const y=cx(h,n),m=lx(c,g,l,0);return this._AABBBounds.set(y,m,y+n,m+g),d&&this._AABBBounds.expand(p/2),this._AABBBounds}updateMultilineAABBBounds(t){const e=nm(this).text,i=this.attribute,{fontFamily:n=e.fontFamily,textAlign:r=e.textAlign,textBaseline:s=e.textBaseline,fontSize:a=e.fontSize,fontWeight:o=e.fontWeight,lineHeight:h=i.lineHeight||i.fontSize||e.fontSize,ellipsis:c=e.ellipsis,maxLineWidth:l,stroke:u=e.stroke,lineWidth:d=e.lineWidth}=i;if(!this.shouldUpdateShape()&&this.cache?.layoutData){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}const p=gy.graphicUtil.textMeasure,f=new ux(n,{fontSize:a,fontWeight:o},p).GetLayoutByLines(t,r,s,h,!0===c?e.ellipsis:c||void 0,l),{bbox:g}=f;return this.cache.layoutData=f,this.clearUpdateShapeTag(),this._AABBBounds.set(g.xOffset,g.yOffset,g.xOffset+g.width,g.yOffset+g.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return nm(this).text[t]}needUpdateTags(t){for(let e=0;e<dx.length;e++){const i=dx[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<dx.length;e++){if(t===dx[e])return!0}return!1}clone(){return new px({...this.attribute})}}function fx(t,e,i,n,r){return r?t.arc(i,n,e,0,Yp,!1,r):t.arc(i,n,e,0,Yp),!1}var gx=new class{type="circle";pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0";draw(t,e,i,n,r){return fx(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return fx(t,e/2+r,i,n,s)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var yx=new class{type="cross";pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z";draw(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-3*e+i,-e+n,r),t.lineTo(-e+i,-e+n,r),t.lineTo(-e+i,-3*e+n,r),t.lineTo(e+i,-3*e+n,r),t.lineTo(e+i,-e+n,r),t.lineTo(3*e+i,-e+n,r),t.lineTo(3*e+i,e+n,r),t.lineTo(e+i,e+n,r),t.lineTo(e+i,3*e+n,r),t.lineTo(-e+i,3*e+n,r),t.lineTo(-e+i,e+n,r),t.lineTo(-3*e+i,e+n,r),t.closePath(),!0}(t,e/6,i,n,r)}drawOffset(t,e,i,n,r,s){return function(t,e,i,n,r,s){return t.moveTo(-3*e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-3*e+n-r,s),t.lineTo(e+i+r,-3*e+n-r,s),t.lineTo(e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,e+n+r,s),t.lineTo(e+i+r,e+n+r,s),t.lineTo(e+i+r,3*e+n+r,s),t.lineTo(-e+i-r,3*e+n+r,s),t.lineTo(-e+i-r,e+n+r,s),t.lineTo(-3*e+i-r,e+n+r,s),t.closePath(),!0}(t,e/6,i,n,r,s)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function mx(t,e,i,n,r){return t.moveTo(i,n-e,r),t.lineTo(e+i,n,r),t.lineTo(i,n+e,r),t.lineTo(i-e,n,r),t.closePath(),!0}var vx=new class{type="diamond";pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z";draw(t,e,i,n,r){return mx(t,e/2,i,n,r)}drawFitDir(t,e,i,n,r){return mx(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return mx(t,e/2+r,i,n,s)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function bx(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var xx=new class{type="square";pathStr="M-0.5,-0.5h1v1h-1Z";draw(t,e,i,n){return bx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return bx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};class Sx{type="triangleUp";pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z";draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i+e,e+n),t.lineTo(i-e,e+n),t.lineTo(i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i+e+2*r,e+n+r),t.lineTo(i-e-2*r,e+n+r),t.lineTo(i,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}}var Ax=new Sx;var _x=new class extends Sx{type="triangle"};const Cx=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Tx=Math.sin(Yp/10)*Cx,Bx=-Math.cos(Yp/10)*Cx;function Px(t,e,i,n){const r=Tx*e,s=Bx*e;t.moveTo(i,-e+n),t.lineTo(r+i,s+n);for(let a=1;a<5;++a){const o=Yp*a/5,h=Math.cos(o),c=Math.sin(o);t.lineTo(c*e+i,-h*e+n),t.lineTo(h*r-c*s+i,c*r+h*s+n)}return t.closePath(),!0}var Ex=new class{type="star";pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0";draw(t,e,i,n){return Px(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Px(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};const Mx=ef(3);function Rx(t,e,i,n){const r=e,s=r/Mx,a=s/5,o=e;return t.moveTo(0+i,-r+n),t.lineTo(s/2+i,n),t.lineTo(a/2+i,n),t.lineTo(a/2+i,o+n),t.lineTo(-a/2+i,o+n),t.lineTo(-a/2+i,n),t.lineTo(-s/2+i,n),t.closePath(),!0}var kx=new class{type="arrow";pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z";draw(t,e,i,n){return Rx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Rx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function Dx(t,e,i,n){const r=2*e;return t.moveTo(i,-e+n),t.lineTo(r/3/2+i,e+n),t.lineTo(-r/3/2+i,e+n),t.closePath(),!0}var Ix=new class{type="wedge";pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z";draw(t,e,i,n){return Dx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Dx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function Ox(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Lx=new class{type="stroke";pathStr="";draw(t,e,i,n){return Ox(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Ox(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};const Ux=-.5,Wx=ef(3)/2,Fx=1/ef(12);function Nx(t,e,i,n){const r=e/2,s=e*Fx,a=r,o=e*Fx+e,h=-a,c=o;return t.moveTo(r+i,s+n),t.lineTo(a+i,o+n),t.lineTo(h+i,c+n),t.lineTo(Ux*r-Wx*s+i,Wx*r+Ux*s+n),t.lineTo(Ux*a-Wx*o+i,Wx*a+Ux*o+n),t.lineTo(Ux*h-Wx*c+i,Wx*h+Ux*c+n),t.lineTo(Ux*r+Wx*s+i,Ux*s-Wx*r+n),t.lineTo(Ux*a+Wx*o+i,Ux*o-Wx*a+n),t.lineTo(Ux*h+Wx*c+i,Ux*c-Wx*h+n),t.closePath(),!1}var zx=new class{type="wye";pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0";draw(t,e,i,n){return Nx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Nx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var jx=new class{type="triangleLeft";pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z";draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(e+i,e+n),t.lineTo(e+i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-e+i-2*r,n),t.lineTo(e+i+r,e+n+2*r),t.lineTo(e+i+r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var Hx=new class{type="triangleRight";pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z";draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,e+n),t.lineTo(e+i,n),t.lineTo(i-e,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-r,e+n+2*r),t.lineTo(e+i+2*r,n),t.lineTo(i-e-r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var Gx=new class{type="triangleDown";pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z";draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,n-e),t.lineTo(i+e,n-e),t.lineTo(i,n+e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-2*r,n-e-r),t.lineTo(i+e+2*r,n-e-r),t.lineTo(i,n+e+2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};const Vx=ef(3);function Xx(t,e,i,n){const r=e*Vx;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var Yx=new class extends Sx{type="thinTriangle";pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z";draw(t,e,i,n){return Xx(t,e/2/Vx,i,n)}drawOffset(t,e,i,n,r){return Xx(t,e/2/Vx+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function qx(t,e,i,n){const r=2*e;return t.moveTo(e+i,n-r),t.lineTo(i-e,n),t.lineTo(e+i,r+n),!0}var Kx=new class{type="arrow2Left";pathStr="M 0.25 -0.5 L -0.25 0 l 0.5 0.5";draw(t,e,i,n){return qx(t,e/4,i,n)}drawOffset(t,e,i,n,r){return qx(t,e/4+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function $x(t,e,i,n){const r=2*e;return t.moveTo(i-e,n-r),t.lineTo(i+e,n),t.lineTo(i-e,r+n),!0}var Zx=new class{type="arrow2Right";pathStr="M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5";draw(t,e,i,n){return $x(t,e/4,i,n)}drawOffset(t,e,i,n,r){return $x(t,e/4+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function Jx(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}var Qx=new class{type="rect";pathStr="M-0.5,-0.5h1v1h-1Z";draw(t,e,i,n){return Jx(t,Ip(e)?[e,e]:e,i,n)}drawOffset(t,e,i,n,r){return Jx(t,Ip(e)?[e+2*r,e+2*r]:[e[0]+2*r,e[1]+2*r],i,n)}bounds(t,e){const i=Ip(t)?[t,t]:t;e.x1=-i[0]/2,e.x2=i[0]/2,e.y1=-i[1]/2,e.y2=i[1]/2}};class tw{type;path;pathStr="";constructor(t,e){this.type=t,this.path=e}drawOffset(t,e,i,n,r){return ng(this.path.commandList,t,i,n,e+r,e+r),!1}draw(t,e,i,n){return ng(this.path.commandList,t,i,n,e,e),!1}bounds(t,e){this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const ew=[gx,yx,vx,xx,Yx,_x,Ex,kx,Ix,Lx,zx,jx,Hx,Ax,Gx,Kx,Zx,Qx],iw={};ew.forEach((t=>{iw[t.type]=t}));const nw=["symbolType","size",...Zv];let rw=class t extends ib{type="symbol";static userSymbolMap={};constructor(t={symbolType:"circle"}){super(t),this.numberType=xb}_parsedPath;getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return Dp(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=nm(this).symbol,{symbolType:i=e.symbolType}=this.attribute;let n=iw[i];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[i],n)return this._parsedPath=n,n;const r=(new Ng).fromString(i),s=r.bounds.width(),a=r.bounds.height(),o=1/Jp(s,a);return r.transform(0,0,o,o),this._parsedPath=new tw(i,r),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=nm(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=gy.graphicService.updateSymbolAABBBounds(i,nm(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Fm(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return nm(this).symbol[t]}needUpdateTags(t){for(let e=0;e<nw.length;e++){const i=nw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<nw.length;e++){if(t===nw[e])return!0}return!1}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=Dp(e)?e:[e,e];return t.path?(new Ng).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Ng).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t({...this.attribute})}};const sw=["segments","points","curveType",...Zv];let aw=class t extends ib{type="line";constructor(t={}){super(t),this.numberType=pb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&!(t.length<=1)}_interpolate(t,e,i,n,r){"points"===t&&(r.points=Vm(i,n,e))}doUpdateAABBBounds(){const t=nm(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateLineAABBBounds(e,nm(this).line,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return nm(this).line[t]}needUpdateTags(t){for(let e=0;e<sw.length;e++){const i=sw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<sw.length;e++){if(t===sw[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=new Ng,i=t.segments,n=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):t.points&&n(t.points),e}clone(){return new t({...this.attribute})}};const ow=["width","height","cornerRadius",...Zv];class hw extends ib{type="rect";constructor(t){super(t),this.numberType=mb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{width:t,height:e}=this.attribute;return this._validNumber(t)&&this._validNumber(e)}doUpdateAABBBounds(){const t=nm(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateRectAABBBounds(e,nm(this).rect,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return nm(this).rect[t]}needUpdateTags(t){for(let e=0;e<ow.length;e++){const i=ow[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<ow.length;e++){if(t===ow[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=t.width,i=t.height,n=new Ng;return n.moveTo(0,0),n.rect(0,0,e,i),n}clone(){return new hw({...this.attribute})}}const cw=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class lw extends hw{type="rect3d";constructor(t){super(t),this.numberType=vb}findFace(){const t={polygons:[],vertices:[],edges:[]},e=nm(this).rect3d,{width:i=e.width,height:n=e.width,length:r=Qp(e.width,e.height)}=this.attribute;for(let e=0;e<cw.length;e++){const s=cw[e];t.vertices.push([s[0]*i,s[1]*n,s[2]*r])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}}class uw extends ib{type="glyph";constructor(t){super(t),this.numberType=lb,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,n){super.setAttribute(t,e,i,n),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t,e=!1,i){super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}doUpdateAABBBounds(){this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const t=gy.graphicService.updateGlyphAABBBounds(this.attribute,nm(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){if(!t.length)return void this.clearStates(e);if(!(this.currentStates?.length!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const i={},n=this.subGraphic.map((()=>({})));t.forEach((e=>{const r=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];r&&(Object.assign(i,r.attributes),r.subAttributes?.length&&n.forEach(((t,e)=>{Object.assign(t,r.subAttributes[e])})))})),this.subGraphic.forEach(((i,r)=>{i.updateNormalAttrs(n[r]),i.applyStateAttrs(n[r],t,e)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}clearStates(t){this.hasState()&&this.normalAttrs&&(this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[])}clone(){const t=new uw({...this.attribute});return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}}const dw={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},pw=!0,fw=!1,gw=/\w|\(|\)/,yw=/[.?!,;:/,。?!、;:]/,mw=/\S/;function vw(t,e,i,n,r){if(!e||e<=0)return 0;const s=gy.graphicUtil.textMeasure;let a=n,o=t.slice(0,a),h=Math.floor(s.measureText(o,i).width),c=t.slice(0,a+1),l=Math.floor(s.measureText(c,i).width);for(;h>e||l<=e;){if(h>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),h=Math.floor(s.measureText(o,i).width),c=t.slice(0,a+1),l=Math.floor(s.measureText(c,i).width)}return r&&(a=function(t,e){let i=e;for(;gw.test(t[i-1])&&gw.test(t[i])||yw.test(t[i]);)if(i--,i<=0)return e;return i}(t,a)),a}function bw(t,e){const i=gy.graphicUtil.textMeasure.measureText(t,e),n={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(n.width=Math.floor(i.width),n.height=e.fontSize||0,n.ascent=n.height,n.descent=0):(n.width=Math.floor(i.width),n.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),n.ascent=Math.floor(i.actualBoundingBoxAscent),n.descent=n.height-n.ascent),n}class xw{left;top;bottom;right;width;height;actualHeight;ellipsis;wordBreak;verticalDirection;lines;globalAlign;globalBaseline;layoutDirection;directionKey;isWidthMax;isHeightMax;singleLine;icons;constructor(t,e,i,n,r,s,a,o,h,c,l,u,d,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=h,this.layoutDirection=c,this.directionKey=dw[this.layoutDirection],this.isWidthMax=l,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let s=this.isHeightMax?Math.min(this.height,n):this.height||n||0;s=Math.min(s,n);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-s/2;break;case"bottom":a=-s}let o=0;switch(this.globalAlign){case"left":o=0;break;case"center":o=-r/2;break;case"right":o=-r}let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let c=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=h&&0!==h)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return c;let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(s=!0,c=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e)}else{const i=Math.floor((h-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],s=h-this.lines[i].top-this.lines[i].height;if(0===h)this.lines[i].draw(t,!1,o,s+a,e);else{if(s+r>this[this.directionKey.top]+h||s<this[this.directionKey.top])return c;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,c=!0),this.lines[i].draw(t,n,o,s+a,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[i].height+this.lines[i].top);const{top:n,height:r}=this.lines[i];if(0===h)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return c;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(n=!0,c=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e)}}}}return c}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],a=r-this.lines[i].top-this.lines[i].height;if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+s>this[this.directionKey.top]+r||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class ww{text;ascent;descent;width;height;lineHeight;fontSize;length;newLine;character;left;top;direction;widthOrigin;heightOrigin;textBaseline;ellipsis;ellipsisWidth;ellipsisOtherParagraphWidth;verticalEllipsis;constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic","number"==typeof i.lineHeight?this.lineHeight=i.lineHeight>this.fontSize?i.lineHeight:this.fontSize:this.lineHeight=Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:n,height:r,descent:s,width:a}=bw(t,i);let o=0,h=0,c=0;this.height>r&&(o=(this.height-r)/2,h=Math.ceil(o),c=Math.floor(o)),"top"===this.textBaseline?(this.ascent=o,this.descent=r-o):"bottom"===this.textBaseline?(this.ascent=r-o,this.descent=o):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=s+c),this.length=t.length,this.width=a||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height)}updateWidth(){const{width:t}=bw(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,n,r){let s=this.text,a=this.left+i;e+=this.top;let o=this.direction;if(this.verticalEllipsis)s="...",o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+="...","right"===r&&(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=vw(s,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+="...","right"===r){const{width:e}=bw(this.text.slice(t),this.character);"vertical"===o||(a-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0),this.character.stroke&&(!function(t,e){const i=e&&e.stroke||fw;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.lineWidth=1,t.strokeStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,a,e)),function(t,e){const i=e&&e.fill||pw;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.fillStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),this.character.fill&&t.fillText(s,a,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=vw(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+="...";const{width:n}=bw(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const Sw=["width","height","image",...Zv];class Aw extends ib{type="image";successCallback;failCallback;constructor(t){super(t),this.numberType=db,this.loadImage(this.attribute.image)}get width(){return this.attribute.width??0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){return this.attribute.height??0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){return this.attribute.repeatX??"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){return this.attribute.repeatY??"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}doUpdateAABBBounds(){const t=nm(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateImageAABBBounds(e,nm(this).image,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return cy[t]}needUpdateTags(t){for(let e=0;e<Sw.length;e++){const i=Sw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Sw.length;e++){if(t===Sw[e])return!0}return!1}clone(){return new Aw({...this.attribute})}}class _w extends Aw{richtextId;globalX;globalY;_x=0;_y=0;_hovered=!1;_marginArray=[0,0,0,0];constructor(t){if(super(t),"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=Fm(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(Dp(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Fm(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}animationBackUps;incrementalAt;toCustomPath;get width(){return(this.attribute.width??0)+this._marginArray[1]+this._marginArray[3]}get height(){return(this.attribute.height??0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=cy.width,height:e=cy.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,r=(i-t)/2,s=(n-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class Cw{left;top;width;height;baseline;ascent;descent;paragraphs;actualWidth;blankWidth;textAlign;direction;directionKey;constructor(t,e,i,n,r,s,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=r,this.top=i-n,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof _w?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=dw[this.direction];const h=this.directionKey;this.actualWidth=0;let c=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof ww){const e=mw.exec(t.text);0!==e?.index&&(t.text=t.text.slice(e?.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],c=Math.max(t[this.directionKey.height],c)})),this.height=c,this.blankWidth=o?0:this.width-this.actualWidth;let l=this.left,u=0;if(this.actualWidth<e&&!o)switch(this.textAlign){case"right":l=e-this.actualWidth;break;case"center":l=(e-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?l=(e-this.actualWidth)/2:u=(e-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof _w?(t["_"+h.x]=l,l+=t[h.width]+u,t["_"+h.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?c-t.height:(c-t.height)/2):(t[h.left]=l,l+=t[h.width]+u)}))}draw(t,e,i,n,r){if(e){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof _w)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const{width:n}=bw("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add";break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}}this.paragraphs.map(((e,s)=>{if(e instanceof _w)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,this.ascent);e.draw(t,n+this.ascent,i,0===s,this.textAlign)}))}getWidthWithEllips(){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof _w)break;const{width:n}=bw("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add",i.ellipsisWidth=r;break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}let e=0;return this.paragraphs.map(((t,i)=>{e+=t instanceof _w?t.width:t.getWidthWithEllips(this.direction)})),e}}class Tw{frame;lineWidth;width;height;y;maxAscent;maxDescent;maxAscentForBlank;maxDescentForBlank;lineBuffer;direction;directionKey;constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=dw[this.direction]}store(t){if(t instanceof _w){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new Cw(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){t instanceof _w?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t)))}cut(t){const e=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(e/t[this.directionKey.width]*t.length)||0,n=vw(t.text,e,t.character,i,"break-word"===this.frame.wordBreak);if(0!==n){const[e,i]=function(t,e){const i=t.text.slice(0,e),n=t.text.slice(e);return[new ww(i,t.newLine,t.character),new ww(n,!0,t.character)]}(t,n);this.store(e),this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const Bw=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...Zv];class Pw extends ib{type="richtext";_frameCache;_currentHoverIcon=null;constructor(t){super(t),this.numberType=bb}get width(){return this.attribute.width??hy.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){return this.attribute.height??hy.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){return this.attribute.ellipsis??hy.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){return this.attribute.wordBreak??hy.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){return this.attribute.verticalDirection??hy.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){return this.attribute.textAlign??hy.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){return this.attribute.textBaseline??hy.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){return this.attribute.textConfig??hy.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=nm(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateRichTextAABBBounds(e,nm(this).richtext,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return hy[t]}needUpdateTags(t){for(let e=0;e<Bw.length;e++){const i=Bw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Bw.length;e++){if(t===Bw[e])return!0}return!1}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}doUpdateFrameCache(){const{textConfig:t,maxWidth:e,maxHeight:i,width:n,height:r,ellipsis:s,wordBreak:a,verticalDirection:o,textAlign:h,textBaseline:c,layoutDirection:l,singleLine:u}=this.attribute,d=[];for(let e=0;e<t.length;e++)if("image"in t[e]){const i=t[e],n=i.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(i.id);if(n)d.push(n);else{const t=new _w(i);t.successCallback=()=>{this.addUpdateBoundTag(),this.stage?.renderNextFrame()},t.richtextId=i.id,d.push(t)}}else if(t[e].text.includes("\n")){const i=t[e].text.split("\n");for(let n=0;n<i.length;n++)d.push(new ww(i[n],0!==n,t[e]))}else d.push(new ww(t[e].text,!1,t[e]));const p=new xw(0,0,("number"==typeof e&&(!n||n>e)?e:n)||0,("number"==typeof i&&(!r||r>i)?i:r)||0,s,a,o,h,c,l||"horizontal","number"==typeof e&&(!n||n>e),"number"==typeof i&&(!r||r>i),u||!1,this._frameCache?.icons),f=new Tw(p);for(let t=0;t<d.length;t++)f.deal(d[t]);f.send(),this._frameCache=p}clone(){return new Pw({...this.attribute})}setStage(t,e){super.setStage(t,e);this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?(this._currentHoverIcon?.setHoverState(!1),this._currentHoverIcon=e,this._currentHoverIcon.setHoverState(!0),this.stage?.setCursor(e.attribute.cursor),this.stage?.renderNextFrame()):!e&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,this.stage?.setCursor(),this.stage?.renderNextFrame()))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,this.stage?.setCursor(),this.stage?.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let r;return e.icons.forEach((e=>{e.AABBBounds.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(r.attribute.x??0)+i,r.globalY=(r.attribute.y??0)+n)})),r}}const Ew=["path","customPath",...Zv];class Mw extends ib{type="path";cache;constructor(t){super(t),this.numberType=fb}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=nm(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof Ng?e.path:(Pp(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Ng?this.cache:t.path)}doUpdateAABBBounds(){const t=nm(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updatePathAABBBounds(e,nm(this).path,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;kp(t.path,!0)?this.cache=(new Ng).fromString(t.path):t.customPath&&(this.cache=new Ng,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return nm(this).path[t]}needUpdateTags(t){for(let e=0;e<Ew.length;e++){const i=Ew[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Ew.length;e++){if(t===Ew[e])return!0}return!1}toCustomPath(){return(new Ng).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Mw({...this.attribute})}}const Rw=["segments","points","curveType",...Zv];class kw extends ib{type="area";cache;constructor(t){super(t),this.numberType=hb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}doUpdateAABBBounds(){const t=nm(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateAreaAABBBounds(e,nm(this).area,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=Vm(i,n,e))}getDefaultAttribute(t){return nm(this).area[t]}needUpdateTags(t){for(let e=0;e<Rw.length;e++){const i=Rw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Rw.length;e++){if(t===Rw[e])return!0}return!1}toCustomPath(){const t=new Ng,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:e.x1??e.x,y:e.y1??e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new kw({...this.attribute})}}const Dw=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...Zv];class Iw extends ib{type="arc";constructor(t){super(t),this.numberType=ab}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=nm(this).arc,{cornerRadius:e=t.cornerRadius,outerRadius:i=t.outerRadius,innerRadius:n=t.innerRadius}=this.attribute;if(0===e||"0%"===e)return 0;const r=Math.abs(i-n);return Math.min(Ip(e,!0)?e:r*parseFloat(e)/100,r/2)}getParsedAngle(){const t=nm(this).arc;let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:n=t.cap}=this.attribute,r=i-e>=0?1:-1,s=i-e;if(e=pf(e),i=e+s,n&&Kp(s)<qp-Gp){let s=1,a=1;n.length&&(s=Number(n[0]),a=Number(n[1]));const{outerRadius:o=t.outerRadius,innerRadius:h=t.innerRadius}=this.attribute,c=Math.abs(o-h)/2,l=c/o;if(c>Gp&&o>Gp)return{startAngle:e-r*l*s,endAngle:i+r*l*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=nm(this).arc,{outerRadius:n=i.outerRadius,innerRadius:r=i.innerRadius,padAngle:s=i.padAngle}=this.attribute,{padRadius:a=ef(n*n+r*r)}=this.attribute,o=Kp(e-t);let h=t,c=e,l=t,u=e;const d=s/2;let p=o,f=o;if(d>Gp&&a>Gp){const i=e>t?1:-1;let s=sf(Number(a)/r*tf(d)),o=sf(Number(a)/n*tf(d));return(p-=2*s)>Gp?(s*=i,l+=s,u-=s):(p=0,l=u=(t+e)/2),(f-=2*o)>Gp?(o*=i,h+=o,c-=o):(f=0,h=c=(t+e)/2),{outerStartAngle:h,outerEndAngle:c,innerStartAngle:l,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}return{outerStartAngle:h,outerEndAngle:c,innerStartAngle:l,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}doUpdateAABBBounds(t){const e=nm(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=gy.graphicService.updateArcAABBBounds(i,nm(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Fm(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){for(let e=0;e<Dw.length;e++){const i=Dw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Dw.length;e++){if(t===Dw[e])return!0}return!1}getDefaultAttribute(t){return nm(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let n=t.innerRadius,r=t.outerRadius;const s=Kp(i-e),a=i>e;if(r<n){const t=r;r=n,n=t}const o=new Ng;if(r<=Gp)o.moveTo(0,0);else if(s>=qp-Gp)o.moveTo(0+r*Zp(e),0+r*tf(e)),o.arc(0,0,r,e,i,!a),n>Gp&&(o.moveTo(0+n*Zp(i),0+n*tf(i)),o.arc(0,0,n,i,e,a));else{const t=r*Zp(e),s=r*tf(e),h=n*Zp(i),c=n*tf(i);o.moveTo(0+t,0+s),o.arc(0,0,r,e,i,!a),o.lineTo(0+h,0+c),o.arc(0,0,n,i,e,a),o.closePath()}return o}clone(){return new Iw({...this.attribute})}}class Ow extends Iw{type="arc3d";constructor(t){super(t),this.numberType=ob}doUpdateAABBBounds(){const t=nm(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updateArc3dAABBBounds(e,nm(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}}const Lw=["points","cornerRadius",...Zv];class Uw extends ib{type="polygon";constructor(t){super(t),this.numberType=gb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=nm(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updatePolygonAABBBounds(e,nm(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=Vm(i,n,e))}getDefaultAttribute(t){return nm(this).polygon[t]}needUpdateTags(t){for(let e=0;e<Lw.length;e++){const i=Lw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Lw.length;e++){if(t===Lw[e])return!0}return!1}toCustomPath(){const t=this.attribute.points,e=new Ng;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new Uw({...this.attribute})}}class Ww extends Uw{type="pyramid3d";constructor(t){super(t),this.numberType=yb}doUpdateAABBBounds(){const t=nm(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=gy.graphicService.updatePyramid3dAABBBounds(e,nm(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Fm(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const n=3===i?t[0]:t[i+1],r=e.x-n.x;return 0===r?0:(e.y-n.y)/r})),i=t.map((t=>({p:t,d:0})));let n=!1,r=0;for(let t=0;t<e.length-1;t++){for(let s=t+1;s<e.length;s++){if(e[t]===e[s]){n=!0;const e=cf.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,r=Jp(r,e);const a=cf.distancePP(i[s].p,i[s+1].p);i[s].d=a,i[s+1].d=a,r=Jp(r,a)}if(n)break}if(n)break}for(let e=t.length-1;e>=0;e--){const n=t[e];i.unshift({p:n,d:0})}for(let e=0;e<t.length;e++){const n=(r-i[e+t.length].d)/2;i[e].d+=n,i[e+t.length].d+=n}const s={polygons:[],vertices:[],edges:[]};return i.forEach((t=>{s.vertices.push([t.p.x,t.p.y,t.d])})),s.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),s.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),s.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),s.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),s.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),s.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),s.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],s}_isValid(){return super._isValid()&&4===this.attribute.points.length}}let Fw=class{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:a=t.lineWidth}=r;i.expand(n+s+a/2)}return i}};Fw=dp([rp()],Fw);const Nw=Symbol.for("RectBoundsContribution");let zw=class extends Fw{};zw=dp([rp()],zw);const jw=Symbol.for("SymbolBoundsContribution");let Hw=class extends Fw{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:a=e.strokeBoundsBuffer}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:o=t.lineWidth}=r;nb(i,n+s+o/2,!0,a)}return i}};Hw=dp([rp()],Hw);const Gw=Symbol.for("CircleBoundsContribution");let Vw=class extends Fw{};Vw=dp([rp()],Vw);const Xw=Symbol.for("ArcBoundsContribution");let Yw=class extends Fw{};Yw=dp([rp()],Yw);const qw=Symbol.for("PathBoundsContribution");let Kw=class extends Fw{};Kw=dp([rp()],Kw);class $w{pools=[];static identity(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return $w.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const Zw=new class{pools=[];allocate(t,e,i,n,r,s){if(!this.pools.length)return new _f(t,e,i,n,r,s);const a=this.pools.pop();return a.a=t,a.b=e,a.c=i,a.d=n,a.e=r,a.f=s,a}allocateByObj(t){if(!this.pools.length)return new _f(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},Jw=new $w;function Qw(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],a=e[5],o=e[6],h=e[7],c=e[8],l=e[9],u=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+c*n,t[5]=a*r+l*n,t[6]=o*r+u*n,t[7]=h*r+d*n,t[8]=c*r-s*n,t[9]=l*r-a*n,t[10]=u*r-o*n,t[11]=d*r-h*n,t}function tS(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],a=e[1],o=e[2],h=e[3],c=e[8],l=e[9],u=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-c*n,t[1]=a*r-l*n,t[2]=o*r-u*n,t[3]=h*r-d*n,t[8]=s*n+c*r,t[9]=a*n+l*r,t[10]=o*n+u*r,t[11]=h*n+d*r,t}function eS(t,e,i){const n=i[0],r=i[1],s=i[2];let a,o,h,c,l,u,d,p,f,g,y,m;return e===t?(t[12]=e[0]*n+e[4]*r+e[8]*s+e[12],t[13]=e[1]*n+e[5]*r+e[9]*s+e[13],t[14]=e[2]*n+e[6]*r+e[10]*s+e[14],t[15]=e[3]*n+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],h=e[2],c=e[3],l=e[4],u=e[5],d=e[6],p=e[7],f=e[8],g=e[9],y=e[10],m=e[11],t[0]=a,t[1]=o,t[2]=h,t[3]=c,t[4]=l,t[5]=u,t[6]=d,t[7]=p,t[8]=f,t[9]=g,t[10]=y,t[11]=m,t[12]=a*n+l*r+f*s+e[12],t[13]=o*n+u*r+g*s+e[13],t[14]=h*n+d*r+y*s+e[14],t[15]=c*n+p*r+m*s+e[15]),t}function iS(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function nS(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],y=e[13],m=e[14],v=e[15];let b=i[0],x=i[1],w=i[2],S=i[3];return t[0]=b*n+x*o+w*u+S*g,t[1]=b*r+x*h+w*d+S*y,t[2]=b*s+x*c+w*p+S*m,t[3]=b*a+x*l+w*f+S*v,b=i[4],x=i[5],w=i[6],S=i[7],t[4]=b*n+x*o+w*u+S*g,t[5]=b*r+x*h+w*d+S*y,t[6]=b*s+x*c+w*p+S*m,t[7]=b*a+x*l+w*f+S*v,b=i[8],x=i[9],w=i[10],S=i[11],t[8]=b*n+x*o+w*u+S*g,t[9]=b*r+x*h+w*d+S*y,t[10]=b*s+x*c+w*p+S*m,t[11]=b*a+x*l+w*f+S*v,b=i[12],x=i[13],w=i[14],S=i[15],t[12]=b*n+x*o+w*u+S*g,t[13]=b*r+x*h+w*d+S*y,t[14]=b*s+x*c+w*p+S*m,t[15]=b*a+x*l+w*f+S*v,t}function rS(t,e,i){const{x:n=i.x,y:r=i.y,z:s=i.z,dx:a=i.dx,dy:o=i.dy,dz:h=i.dz,scaleX:c=i.scaleX,scaleY:l=i.scaleY,scaleZ:u=i.scaleZ,alpha:d=i.alpha,beta:p=i.beta,angle:f=i.angle,anchor3d:g=e.attribute.anchor,anchor:y}=e.attribute,m=[0,0,0];if(g){if("string"==typeof g[0]){const t=parseFloat(g[0])/100,i=e.AABBBounds;m[0]=i.x1+(i.x2-i.x1)*t}else m[0]=g[0];if("string"==typeof g[1]){const t=parseFloat(g[1])/100,i=e.AABBBounds;m[1]=i.x1+(i.x2-i.x1)*t}else m[1]=g[1];m[2]=g[2]??0}if(function(t){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(t),eS(t,t,[n+a,r+o,s+h]),eS(t,t,[m[0],m[1],m[2]]),Qw(t,t,p),tS(t,t,d),eS(t,t,[-m[0],-m[1],m[2]]),function(t,e,i){const n=i[0],r=i[1],s=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,l,u]),f){const i=Jw.allocate(),n=[0,0];if(y){if("string"==typeof g[0]){const t=parseFloat(g[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=g[0];if("string"==typeof g[1]){const t=parseFloat(g[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=g[1]}eS(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],a=e[1],o=e[2],h=e[3],c=e[4],l=e[5],u=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+c*n,t[1]=a*r+l*n,t[2]=o*r+u*n,t[3]=h*r+d*n,t[4]=c*r-s*n,t[5]=l*r-a*n,t[6]=u*r-o*n,t[7]=d*r-h*n}(i,i,f),eS(i,i,[-n[0],-n[1],0]),nS(t,t,i)}}function sS(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{creator;rectBoundsContribitions;symbolBoundsContribitions;circleBoundsContribitions;arcBoundsContribitions;pathBoundsContribitions;_rectBoundsContribitions;_symbolBoundsContribitions;_circleBoundsContribitions;_arcBoundsContribitions;_pathBoundsContribitions;tempAABBBounds1;tempAABBBounds2;constructor(t,e,i,n,r,s){this.creator=t,this.rectBoundsContribitions=e,this.symbolBoundsContribitions=i,this.circleBoundsContribitions=n,this.arcBoundsContribitions=r,this.pathBoundsContribitions=s,this.hooks={onAttributeUpdate:new bp(["graphic"]),onSetStage:new bp(["graphic","stage"]),onRemove:new bp(["graphic"]),onAddIncremental:new bp(["graphic","group","stage"]),onClearIncremental:new bp(["graphic","group","stage"]),beforeUpdateAABBBounds:new bp(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new bp(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new df,this.tempAABBBounds2=new df}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new kf(t);return ng(i.commandList,n,0,0),!0}updateRectAABBBounds(t,e,i,n){if(!this.updatePathProxyAABBBounds(i,n)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._rectBoundsContribitions||(this._rectBoundsContribitions=this.rectBoundsContribitions.getContributions()||[]),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((a=>{a.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,i,e,!1,n),i}updateGroupAABBBounds(t,e,i,n){const{width:r,height:s,path:a,clip:o=e.clip}=t;a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=r&&null!=s&&i.set(0,0,r,s),o||n.forEachChildren((t=>{i.union(t.AABBBounds)}));const h=this.tempAABBBounds1,c=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),c.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateGlyphAABBBounds(t,e,i,n){return n.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i}updateRichTextAABBBounds(t,e,i,n){if(!n)return i;const{width:r=e.width,height:s=e.height,maxWidth:a=e.maxWidth,maxHeight:o=e.maxHeight,textAlign:h=e.textAlign,textBaseline:c=e.textBaseline}=t;if(r>0&&s>0)i.set(0,0,r,s);else{const t=n.getFrameCache(),{width:e,height:h}=t.getActualSize();let c=r||e||0,l=s||h||0;l="number"==typeof o&&l>o?o:l||0,c="number"==typeof a&&c>a?a:c||0,i.set(0,0,c,l)}let l=0;switch(c){case"top":l=0;break;case"middle":l=-i.height()/2;break;case"bottom":l=-i.height()}let u=0;switch(h){case"left":u=0;break;case"center":u=-i.width()/2;break;case"right":u=-i.width()}i.translate(u,l);const d=this.tempAABBBounds1,p=this.tempAABBBounds2;return d.setValue(i.x1,i.y1,i.x2,i.y2),p.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateTextAABBBounds(t,e,i,n){if(!n)return i;const{text:r=e.text}=n.attribute;Array.isArray(r)?n.updateMultilineAABBBounds(r):n.updateSingallineAABBBounds(r);const s=this.tempAABBBounds1,a=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2);const{scaleX:o=e.scaleX,scaleY:h=e.scaleY,shadowBlur:c=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(c){nb(s,c/Math.abs(o+h),!0,l),i.union(s)}return this.combindShadowAABBBounds(i,n),lf(i,i,n.transMatrix),i}updatePathAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||this.updatePathAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._pathBoundsContribitions||(this._pathBoundsContribitions=this.pathBoundsContribitions.getContributions()||[]),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((a=>{a.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,n),i}updatePathAABBBoundsImprecise(t,e,i,n){if(!n)return i;const r=n.getParsedPathShape();return i.union(r.getBounds()),i}updatePyramid3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;n.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)}));const s=this.tempAABBBounds1,a=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateArc3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;const{outerRadius:s=e.outerRadius,height:a=0}=t,o=s+a;i.setValue(-o,-o,o,o);const h=this.tempAABBBounds1,c=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),c.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updatePolygonAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||this.updatePolygonAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,n),i}updatePolygonAABBBoundsImprecise(t,e,i,n){const{points:r=e.points}=t;return r.forEach((t=>{i.add(t.x,t.y)})),i}updateLineAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i,n):this.updateLineAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,n),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{s.add(t.x,t.y)})),s}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y)}))})),s}updateAreaAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i,n):this.updateAreaAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,n),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{s.add(t.x,t.y),s.add(t.x1??t.x,t.y1??t.y)})),s}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y),s.add(t.x1??t.x,t.y1??t.y)}))})),s}updateCircleAABBBounds(t,e,i,n,r){this.updatePathProxyAABBBounds(i,r)||(n?this.updateCircleAABBBoundsImprecise(t,e,i,r):this.updateCircleAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,a=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._circleBoundsContribitions||(this._circleBoundsContribitions=this.circleBoundsContribitions.getContributions()||[]),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(a.x1,a.y1,a.x2,a.y2)})),this.transformAABBBounds(t,i,e,!1,r),i}updateCircleAABBBoundsImprecise(t,e,i,n){const{radius:r=e.radius}=t;return i.set(-r,-r,r,r),i}updateCircleAABBBoundsAccurate(t,e,i,n){const{startAngle:r=e.startAngle,endAngle:s=e.endAngle,radius:a=e.radius}=t;return s-r>qp-Gp?i.set(-a,-a,a,a):jm(r,s,a,i),i}updateArcAABBBounds(t,e,i,n,r){this.updatePathProxyAABBBounds(i,r)||(n?this.updateArcAABBBoundsImprecise(t,e,i,r):this.updateArcAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,a=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._arcBoundsContribitions||(this._arcBoundsContribitions=this.arcBoundsContribitions.getContributions()||[]),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(a.x1,a.y1,a.x2,a.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,r),i}updateArcAABBBoundsImprecise(t,e,i,n){const{outerRadius:r=e.outerRadius}=t;return i.set(-r,-r,r,r),i}updateArcAABBBoundsAccurate(t,e,i,n){let{outerRadius:r=e.outerRadius,innerRadius:s=e.innerRadius}=t;if(r<s){const t=r;r=s,s=t}let{endAngle:a=e.endAngle,startAngle:o=e.startAngle}=t;if(o>a){const t=o;o=a,a=t}return r<=Gp?i.set(0,0,0,0):Math.abs(a-o)>qp-Gp?i.set(-r,-r,r,r):(jm(o,a,r,i),jm(o,a,s,i)),i}updateSymbolAABBBounds(t,e,i,n,r){this.updatePathProxyAABBBounds(i,r)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i,r):this.updateSymbolAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,a=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._symbolBoundsContribitions||(this._symbolBoundsContribitions=this.symbolBoundsContribitions.getContributions()||[]),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(a.x1,a.y1,a.x2,a.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,r),i}updateSymbolAABBBoundsImprecise(t,e,i,n){const{size:r=e.size}=t;if(Dp(r))i.set(-r[0]/2,-r[1]/2,r[0]/2,r[1]/2);else{const t=r/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i,n){if(!n)return i;const{size:r=e.size}=t;return n.getParsedPath().bounds(r,i),i}updateImageAABBBounds(t,e,i,n){if(!this.updatePathProxyAABBBounds(i,n)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,r){const{scaleX:s=i.scaleX,scaleY:a=i.scaleY,stroke:o=i.stroke,shadowBlur:h=i.shadowBlur,lineWidth:c=i.lineWidth,strokeBoundsBuffer:l=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(o){nb(u,c/Math.abs(s+a),n,l),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(h){nb(u,h/Math.abs(s+a),n,l),e.union(u)}this.combindShadowAABBBounds(e,r),lf(e,e,r.transMatrix)}},t.DefaultGraphicService=dp([rp(),pp(0,op(Ab)),pp(1,op(gp)),pp(1,sp(Nw)),pp(2,op(gp)),pp(2,sp(jw)),pp(3,op(gp)),pp(3,sp(Gw)),pp(4,op(gp)),pp(4,sp(Xw)),pp(5,op(gp)),pp(5,sp(qw)),fp("design:paramtypes",[Object,Object,Object,Object,Object,Object])],t.DefaultGraphicService);class aS extends Cb{type="shadowroot";constructor(t){super({x:0,y:0}),this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}const oS=["heightLimit","lineClamp"];class hS extends px{_isValid(){const{text:t}=this.attribute;return Dp(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){const e=nm(this).text,{fontFamily:i=e.fontFamily,textAlign:n=e.textAlign,textBaseline:r=e.textBaseline,fontSize:s=e.fontSize,lineHeight:a=this.attribute.lineHeight||this.attribute.fontSize||e.fontSize,ellipsis:o=e.ellipsis,maxLineWidth:h,stroke:c=e.stroke,lineWidth:l=e.lineWidth,heightLimit:u=0,lineClamp:d}=this.attribute;if(!this.shouldUpdateShape()&&this.cache?.layoutData){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),c&&this._AABBBounds.expand(l/2),this._AABBBounds}const p=gy.graphicUtil.textMeasure,f=new ux(i,{fontSize:s},p),g=t.map((t=>t.toString())),y=[],m=[0,0];let v=1/0;if(u>0&&(v=Math.max(Math.floor(u/a),1)),d&&(v=Math.min(v,d)),"number"==typeof h&&h!==1/0){if(h>0)for(let t=0;t<g.length;t++){const e=g[t];let i=!0;if(t===v-1){const t=f.textMeasure.clipTextWithSuffix(e,f.textOptions,h,o);y.push({str:t.str,width:t.width});break}const n=f.textMeasure.clipText(e,f.textOptions,h);if(""!==e&&""===n.str){if(o){const t=f.textMeasure.clipTextWithSuffix(e,f.textOptions,h,o);n.str=t.str??"",n.width=t.width??0}else n.str="",n.width=0;i=!1}if(y.push({str:n.str,width:n.width}),n.str.length===e.length);else if(i){const i=e.substring(n.str.length);g.splice(t+1,0,i)}}let t=0;y.forEach((e=>{t=Math.max(t,e.width)})),m[0]=t}else{let t,e,i=0;for(let n=0,r=g.length;n<r;n++){if(n===v-1){const t=f.textMeasure.clipTextWithSuffix(g[n],f.textOptions,h,o);y.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=g[n],t=f.textMeasure.measureTextWidth(e,f.textOptions),i=Math.max(i,t),y.push({str:e,width:t})}m[0]=i}m[1]=y.length*(a+2);const b={xOffset:0,yOffset:0,width:m[0],height:m[1]};f.LayoutBBox(b,n,r);const x=f.layoutWithBBox(b,y,n,r,a);return this.cache.layoutData=x,this.clearUpdateShapeTag(),this._AABBBounds.set(b.xOffset,b.yOffset,b.xOffset+b.width,b.yOffset+b.height),c&&this._AABBBounds.expand(l/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<oS.length;e++){const i=oS[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<oS.length;e++){if(t===oS[e])return!0}return super.needUpdateTag(t)}}function cS(t){return new Iw(t)}function lS(t){return new kw(t)}function uS(t){return new ox(t)}function dS(t){return new Cb(t)}function pS(t){return new aw(t)}function fS(t){return new Mw(t)}function gS(t){return new hw(t)}function yS(t){return new lw(t)}function mS(t){return new px(t)}function vS(t){return new hS(t)}function bS(t){return new rw(t)}function xS(t){return new Aw(t)}function wS(t){return new Uw(t)}function SS(t){return new aS(t)}function AS(t){return new Pw(t)}const _S={arc:cS,area:lS,circle:uS,group:dS,image:xS,line:pS,path:fS,rect:gS,rect3d:yS,symbol:bS,text:mS,richtext:AS,polygon:wS,shadowRoot:SS,wrapText:vS},CS=mS({text:""});const TS=AS({});function BS(e,i,n,r,s){if(!i)return;const{offsetX:a=0,offsetY:o=0,offsetZ:h=0}=s||{};let c=!0;const{curves:l}=i;if(n>=1)return void l.forEach((t=>{t.defined?(c&&e.moveTo(t.p0.x+a,t.p0.y+o,h),MS(e,t,1,s),c=!1):c=!0}));if(n<=0)return;let u;"x"===r?u=t.Direction.ROW:"y"===r?u=t.Direction.COLUMN:"auto"===r&&(u=i.direction);const d=n*i.tryUpdateLength(u);let p=0;for(let t=0,i=l.length;t<i;t++){const i=l[t],n=i.getLength(u),r=(d-p)/n;if(p+=n,r<0)break;i.defined?(c&&e.moveTo(i.p0.x+a,i.p0.y+o,h),MS(e,i,Qp(r,1),s),c=!1):c=!0}}function PS(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+r,a.y+s),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}))}function ES(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},{points:a}=i,o=[];for(let t=0;t<a.length;t++)a[t].defined;o.push(a),o.forEach(((i,n)=>{const a=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(a.x+r,a.y+s),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}));for(let e=i.length-1;e>=0;e--){const n=i[e];t.lineTo(n.x1??n.x,n.y1??n.y)}t.lineTo(a.x1??a.x,a.y1??a.y),t.closePath()}))}function MS(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,s+e.p1.y,r+e.p2.x,s+e.p2.y,r+e.p3.x,s+e.p3.y,a):t.lineTo(r+e.p1.x,s+e.p1.y,a);else if(e.p2&&e.p3){const[n]=cg(e,i);t.bezierCurveTo(r+n.p1.x,s+n.p1.y,r+n.p2.x,s+n.p2.y,r+n.p3.x,s+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,a)}}function RS(e,i,n,r){const{top:s,bottom:a}=i;if(n>=1){const t=[],i=[];let n=!0;for(let o=0,h=s.curves.length;o<h;o++){const c=s.curves[o];n!==c.defined?(n?(kS(e,t,i,r),t.length=0,i.length=0):(t.push(c),i.push(a.curves[h-o-1])),n=!n):n&&(t.push(c),i.push(a.curves[h-o-1]))}return void kS(e,t,i,r)}if(n<=0)return;let{direction:o}=r||{};const{curves:h}=s,c=h[h.length-1].p3??h[h.length-1].p1,l=Kp(c.x-h[0].p0.x),u=Kp(c.y-h[0].p0.y);o=o??(l>u?t.Direction.ROW:t.Direction.COLUMN),Number.isFinite(l)||(o=t.Direction.COLUMN),Number.isFinite(u)||(o=t.Direction.ROW);const d=n*(o===t.Direction.ROW?l:u);let p=0,f=!0;const g=[],y=[];for(let t=0,i=s.curves.length;t<i;t++){const n=s.curves[t],h=n.getLength(o),c=(d-p)/h;if(c<0)break;p+=h;let l=null,u=null;f!==n.defined?(f?(kS(e,g,y,r),g.length=0,y.length=0):(l=n,u=a.curves[i-t-1]),f=!f):f&&(l=n,u=a.curves[i-t-1]),l&&u&&(c<1&&(l=l.p2&&l.p3?cg(l,c)[0]:ug(l,c)[0],u=u.p2&&u.p3?cg(u,1-c)[1]:ug(u,1-c)[1]),l.defined=f,u.defined=f,g.push(l),y.push(u)),l=null,u=null}kS(e,g,y,r)}function kS(t,e,i,n){const{offsetX:r=0,offsetY:s=0,offsetZ:a=0}=n||{};let o=!0;e.forEach((e=>{e.defined?(o&&t.moveTo(e.p0.x+r,e.p0.y+s,a),DS(t,e,1,n),o=!1):o=!0})),o=!0;for(let e=i.length-1;e>=0;e--){const h=i[e];h.defined?(o&&t.lineTo(h.p0.x+r,h.p0.y+s,a),DS(t,h,1,n),o=!1):o=!0}t.closePath()}function DS(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,s+e.p1.y,r+e.p2.x,s+e.p2.y,r+e.p3.x,s+e.p3.y,a):t.lineTo(r+e.p1.x,s+e.p1.y,a);else if(e.p2&&e.p3){const[n]=cg(e,i);t.bezierCurveTo(r+n.p1.x,s+n.p1.y,r+n.p2.x,s+n.p2.y,r+n.p3.x,s+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,a)}}function IS(t,e,i){switch(e){case"linear":default:return mg(t,i);case"basis":return Sg(t,i);case"monotoneX":return Mg(t,i);case"monotoneY":return kg(t,i);case"step":return Ig(t,.5,i);case"stepBefore":return Ig(t,0,i);case"stepAfter":return Ig(t,1,i);case"linearClosed":return Ug(t,i)}}t.BaseRender=class{camera;transform(t,e,i,n=!1){const r=t.transMatrix,{x:s=e.x,y:a=e.y,z:o=e.z,scaleX:h=e.scaleX,scaleY:c=e.scaleY,angle:l=e.angle,postMatrix:u}=t.attribute,d=r.onlyTranslate()&&!u,p=i.modelMatrix,f=i.camera,g={x:s,y:a,z:o,lastModelMatrix:p},y=f&&(n||sS(t));if(y){const n=Jw.allocate(),r=Jw.allocate();rS(r,t,e),nS(n,p||n,r),g.x=0,g.y=0,g.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),Jw.free(r)}if(d&&!p){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,g.z=o,i.setTransformForCurrent()}else if(y)g.x=0,g.y=0,g.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(f&&i.project){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,this.transformWithoutTranslate(i,g.x,g.y,g.z,h,c,l)}else i.transformFromMatrix(t.transMatrix,!0),g.x=0,g.y=0,g.z=0;return g}transformUseContext2d(t,e,i,n){const r=n.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,a=n.project(0,0,i),o=n.project(r,0,i),h=n.project(r,s,i),c={x:0,y:0},l={x:r,y:0},u={x:r,y:s};n.camera=null;const d=1/(c.x*(u.y-l.y)-l.x*u.y+u.x*l.y+(l.x-u.x)*c.y),p=-(c.y*(h.x-o.x)-l.y*h.x+u.y*o.x+(l.y-u.y)*a.x)*d,f=(l.y*h.y+c.y*(o.y-h.y)-u.y*o.y+(u.y-l.y)*a.y)*d,g=(c.x*(h.x-o.x)-l.x*h.x+u.x*o.x+(l.x-u.x)*a.x)*d,y=-(l.x*h.y+c.x*(o.y-h.y)-u.x*o.y+(u.x-l.x)*a.y)*d,m=(c.x*(u.y*o.x-l.y*h.x)+c.y*(l.x*h.x-u.x*o.x)+(u.x*l.y-l.x*u.y)*a.x)*d,v=(c.x*(u.y*o.y-l.y*h.y)+c.y*(l.x*h.y-u.x*o.y)+(u.x*l.y-l.x*u.y)*a.y)*d;n.setTransform(p,f,g,y,m,v,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,r,s,a){const o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(r,s,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}},t.BaseRender=dp([rp()],t.BaseRender),t.DefaultCanvasLineRender=class extends t.BaseRender{type;numberType=pb;draw(t,e,i,n){const{context:r}=i;r.highPerformanceSave();const s=nm(t,n?.theme).line,a=this.transform(t,s,r),{x:o,y:h,z:c,lastModelMatrix:l}=a;this.z=c,Nb(t,r,o,h)||(this.drawShape(t,r,o,h,i,n),this.z=0,r.modelMatrix!==l&&Jw.free(r.modelMatrix),r.modelMatrix=l),r.highPerformanceRestore()}drawSegmentItem(t,e,i,n,r,s,a,o,h,c,l,u,d,p,f){if(!e)return;t.beginPath();const g=this.z??0;BS(t.camera?t:t.nativeContext,e,h,c,{offsetX:l,offsetY:u,offsetZ:g}),d.cache&&!Dp(d.cache)&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowStyle&&t.setShadowStyle(d,a,o);const{x:y=0,x:m=0}=a;return!1!==i&&(p?p(t,a,o):r&&(t.setCommonStyle(d,a,y-l,m-u,o),t.fill())),!1!==n&&(f?f(t,a,o):s&&(t.setStrokeStyle(d,a,y-l,m-u,o),t.stroke())),!1}drawShape(t,e,i,n,r,s,a,o){const h=nm(t,s?.theme).line,{fill:c=h.fill,stroke:l=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:g=h.visible}=t.attribute,y=Lb(u,d,c),m=Wb(u,p),v=Ib(c),b=Ob(l,f);if(!t.valid||!g)return;if(!v&&!b)return;if(!(y||m||a||o))return;if(t.shouldUpdateShape()){const{points:e,segments:i,curveType:n=h.curveType}=t.attribute,r=e;if(i&&i.length){let e,r;t.cache=i.map(((t,i)=>(1===i?e={x:r.endX,y:r.endY,defined:r.curves[r.curves.length-1].defined}:i>1&&(e.x=r.endX,e.y=r.endY,e.defined=r.curves[r.curves.length-1].defined),r=Fg(t.points,n,{startPoint:e}),r)))}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Fg(r,n)}t.clearUpdateShapeTag()}const{clipRange:x=h.clipRange,clipRangeByDimension:w=h.clipRangeByDimension}=t.attribute;if(Array.isArray(t.cache))if(1===x){let r=!1;t.cache.forEach(((s,u)=>{r||(r=this.drawSegmentItem(e,s,!!c,!!l,d,p,t.attribute.segments[u],[h,t.attribute],x,w,i,n,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),s=x*r;let u=0,f=!1;t.cache.forEach(((r,g)=>{if(f)return;const y=r.getLength(),m=(s-u)/y;u+=y,m>0&&(f=this.drawSegmentItem(e,r,!!c,!!l,d,p,t.attribute.segments[g],[h,t.attribute],Qp(m,1),w,i,n,t,a,o))}))}else this.drawSegmentItem(e,t.cache,!!c,!!l,d,p,t.attribute,h,x,w,i,n,t,a,o)}},t.DefaultCanvasLineRender=dp([rp()],t.DefaultCanvasLineRender),t.DefaultCanvasAreaRender=class{areaRenderContribitions;type;numberType=hb;_areaRenderContribitions;constructor(t){this.areaRenderContribitions=t}drawShape(t,e,i,n,r,s,a,o){const h=nm(t,s?.theme).area,{fill:c=h.fill,fillOpacity:l=h.fillOpacity,opacity:u=h.opacity,visible:d=h.visible,z:p=h.z,background:f,stroke:g=t.attribute.stroke,lineWidth:y=h.lineWidth,strokeOpacity:m=h.strokeOpacity}=t.attribute,v=Lb(u,l,c),b=Ib(c,f),x=Ob(g,y),w=Wb(u,m);if(!t.valid||!d)return;if(!b&&!x)return;if(!(v||a||w||o))return;const{clipRange:S=h.clipRange}=t.attribute;if(t.shouldUpdateShape()){const{points:e,segments:i,curveType:n=h.curveType}=t.attribute;if(i&&i.length){let e,r;const s=i.map(((t,i)=>(1===i?e={x:r.endX,y:r.endY}:i>1&&(e.x=r.endX,e.y=r.endY),r=IS(t.points,n,{startPoint:e}),r)));let a;const o=[];for(let t=i.length-1;t>=0;t--){const e=i[t].points,r=[];for(let t=e.length-1;t>=0;t--)r.push({x:e[t].x1??e[t].x,y:e[t].y1??e[t].y});if(0!==t){const e=i[t-1].points,n=e[e.length-1];n&&r.push({x:n.x1??n.x,y:n.y1??n.y})}a=IS(r,n),o.unshift(a)}t.cacheArea=o.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();{const i=e,r=[];for(let t=e.length-1;t>=0;t--)r.push({x:e[t].x1??e[t].x,y:e[t].y1??e[t].y});const s=IS(i,n),a=IS(r,"stepBefore"===n?"stepAfter":"stepAfter"===n?"stepBefore":n);t.cacheArea={top:s,bottom:a}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea))if(1===S){let s=!1;t.cacheArea.forEach(((c,u)=>{s||(s=this.drawSegmentItem(e,c,b,l,x,m,t.attribute.segments[u],[h,t.attribute],S,i,n,p,t,r,a,o))}))}else{const s=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),c=S*s;let u=0,d=!1;t.cacheArea.forEach(((s,f)=>{if(d)return;const g=s.top.getLength(),y=(c-u)/g;u+=g,y>0&&(d=this.drawSegmentItem(e,s,b,l,x,m,t.attribute.segments[f],[h,t.attribute],Qp(y,1),i,n,p,t,r,a,o))}))}else this.drawSegmentItem(e,t.cacheArea,b,l,x,m,t.attribute,h,S,i,n,p,t,r,a,o)}draw(t,e,i,n){const{context:r}=i,s=nm(t,n?.theme).area;let{x:a=s.x,y:o=s.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);a+=e.x,o+=e.y,r.setTransformForCurrent()}else a=0,o=0,r.transformFromMatrix(t.transMatrix,!0);Nb(t,r,a,o,0,n)||this.drawShape(t,r,a,o,i,n),r.highPerformanceRestore()}drawSegmentItem(e,i,n,r,s,a,o,h,c,l,u,d,p,f,g,y){if(!i)return;e.beginPath();RS(e.camera?e:e.nativeContext,i,c,{offsetX:l,offsetY:u,offsetZ:d}),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[],this._areaRenderContribitions.sort(((t,e)=>e.order-t.order))),this._areaRenderContribitions.forEach((i=>{i.time===t.BaseRenderContributionTime.beforeFillStroke&&i.drawShape(p,e,l,u,!!r,!1,n,!1,h,f,g,null,{attribute:o})})),e.setShadowStyle&&e.setShadowStyle(p,o,h);const{x:m=0,x:v=0}=o;if(!1!==n&&(g?g(e,o,h):r&&(e.setCommonStyle(p,o,m-l,v-u,h),e.fill())),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[]),this._areaRenderContribitions.forEach((i=>{i.time===t.BaseRenderContributionTime.afterFillStroke&&i.drawShape(p,e,l,u,!!r,!1,n,!1,h,f,g,null,{attribute:o})})),!1!==s)if(y)y(e,o,h);else{const{stroke:t}=o;Dp(t)&&(t[0]||t[2])&&!1===t[1]&&(e.beginPath(),BS(e.camera?e:e.nativeContext,t[0]?i.top:i.bottom,c,"auto",{offsetX:l,offsetY:u,offsetZ:d})),e.setStrokeStyle(p,o,m-l,v-u,h),e.stroke()}return!1}},t.DefaultCanvasAreaRender=dp([rp(),pp(0,op(gp)),pp(0,sp($b)),fp("design:paramtypes",[Object])],t.DefaultCanvasAreaRender),t.DefaultCanvasPathRender=class extends t.BaseRender{pathRenderContribitions;type;numberType=fb;_pathRenderContribitions;constructor(t){super(),this.pathRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).path,{fill:l=c.fill,stroke:u=c.stroke,fillOpacity:d=c.fillOpacity,strokeOpacity:p=c.strokeOpacity,opacity:f=c.opacity,background:g,lineWidth:y=c.lineWidth,visible:m=c.visible,x:v=c.x,y:b=c.y}=e.attribute,x=this.z??0,w=Lb(f,d,l),S=Wb(f,p),A=Ib(l,g),_=Ob(u,y);if(e.valid&&m&&(A||_)&&(w||S||o||h||g)){if(i.beginPath(),e.pathShape)ng(e.pathShape.commandList,i,n,r,1,1,x);else{ng((e.attribute.path??c.path).commandList,i,n,r,1,1,x)}this._pathRenderContribitions||(this._pathRenderContribitions=this.pathRenderContribitions.getContributions()||[],this._pathRenderContribitions.sort(((t,e)=>e.order-t.order))),this._pathRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,A,_,w,S,c,s,o,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),_&&(h?h(i,e.attribute,c):S&&(i.setStrokeStyle(e,e.attribute,v-n,b-r,c),i.stroke())),A&&(o?o(i,e.attribute,c):w&&(i.setCommonStyle(e,e.attribute,v-n,b-r,c),i.fill())),this._pathRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,A,_,w,S,c,s,o,h)}))}}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=nm(t,n?.theme).path,a=this.transform(t,s,r),{x:o,y:h,z:c,lastModelMatrix:l}=a;this.z=c,Nb(t,r,o,h,0,n)||(this.drawShape(t,r,o,h,i,n),this.z=0,r.modelMatrix!==l&&Jw.free(r.modelMatrix),r.modelMatrix=l),r.highPerformanceRestore()}},t.DefaultCanvasPathRender=dp([rp(),pp(0,op(gp)),pp(0,sp(tx)),fp("design:paramtypes",[Object])],t.DefaultCanvasPathRender);const OS=Vp/2;function LS(t,e,i,n,r,s){let a;if(Ip(s,!0))a=[s,s,s,s];else if(Array.isArray(s)){const t=s;switch(t.length){case 0:a=[0,0,0,0];break;case 1:a=[t[0],t[0],t[0],t[0]];break;case 2:case 3:a=[t[0],t[1],t[0],t[1]];break;default:a=t.slice(0,5)}}else a=[0,0,0,0];if(n<0||Math.abs(a[0])+Math.abs(a[1])+Math.abs(a[2])+Math.abs(a[3])<1e-12)return t.rect(e,i,n,r);const[o,h,c,l]=[[e,i],[e+n,i],[e+n,i+r],[e,i+r]],u=Math.min(n/2,r/2),d=[Math.min(u,a[0]),Math.min(u,a[1]),Math.min(u,a[2]),Math.min(u,a[3])],p=[o[0]+d[0],o[1]],f=[o[0],o[1]+d[0]],g=[h[0]-d[1],h[1]],y=[h[0],h[1]+d[1]],m=[c[0]-d[2],c[1]],v=[c[0],c[1]-d[2]],b=[l[0]+d[3],l[1]],x=[l[0],l[1]-d[3]];if(t.moveTo(p[0],p[1]),t.lineTo(g[0],g[1]),!Np(g,y)){const e=g[0],i=g[1]+d[1];t.arc(e,i,d[1],-OS,0,!1)}if(t.lineTo(v[0],v[1]),!Np(m,v)){const e=v[0]-d[2],i=v[1];t.arc(e,i,d[2],0,OS,!1)}if(t.lineTo(b[0],b[1]),!Np(b,x)){const e=b[0],i=b[1]-d[3];t.arc(e,i,d[3],OS,Vp,!1)}if(t.lineTo(f[0],f[1]),!Np(p,f)){const e=p[0],i=p[1]+d[0];t.arc(e,i,d[0],Vp,Vp+OS,!1)}return t.closePath(),t}function US(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(let r=1;r<e.length;r++)t.lineTo(e[r].x+i,e[r].y+n)}function WS(t,e){return Math.sqrt(t*t+e*e)}function FS(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.DefaultCanvasRectRender=class{rectRenderContribitions;type="rect";numberType=mb;_rectRenderContribitions;constructor(t){this.rectRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).rect,{fill:l=c.fill,background:u,stroke:d=c.stroke,width:p=c.width,height:f=c.height,cornerRadius:g=c.cornerRadius,opacity:y=c.opacity,fillOpacity:m=c.fillOpacity,lineWidth:v=c.lineWidth,strokeOpacity:b=c.strokeOpacity,visible:x=c.visible,x:w=c.x,y:S=c.y}=e.attribute,A=Ub(y,m,p,f,l),_=Fb(y,b,p,f),C=Ib(l,u),T=Ob(d,v);if(!e.valid||!x)return;if(!C&&!T)return;if(!(A||_||o||h||u))return;0===g||Dp(g)&&g.every((t=>0===t))?(i.beginPath(),i.rect(n,r,p,f)):(i.beginPath(),LS(i,n,r,p,f,g)),this._rectRenderContribitions||(this._rectRenderContribitions=this.rectRenderContribitions.getContributions()||[],this._rectRenderContribitions.sort(((t,e)=>e.order-t.order)));const B={doFill:C,doStroke:T};this._rectRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h,B)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),B.doFill&&(o?o(i,e.attribute,c):A&&(i.setCommonStyle(e,e.attribute,w-n,S-r,c),i.fill())),B.doStroke&&(h?h(i,e.attribute,c):_&&(i.setStrokeStyle(e,e.attribute,w-n,S-r,c),i.stroke())),this._rectRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=nm(t,n?.theme).rect;let{x:a=s.x,y:o=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);a+=e.x,o+=e.y,r.setTransformForCurrent()}else a=0,o=0,r.transformFromMatrix(t.transMatrix,!0);Nb(t,r,a,o,0,n)||this.drawShape(t,r,a,o,i,n),r.highPerformanceRestore()}},t.DefaultCanvasRectRender=dp([rp(),pp(0,op(gp)),pp(0,sp(ix)),fp("design:paramtypes",[Object])],t.DefaultCanvasRectRender),t.DefaultCanvasSymbolRender=class extends t.BaseRender{symbolRenderContribitions;type;numberType=xb;_symbolRenderContribitions;constructor(t){super(),this.symbolRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).symbol,{size:l=c.size,fill:u=c.fill,background:d,fillOpacity:p=c.fillOpacity,strokeOpacity:f=c.strokeOpacity,opacity:g=c.opacity,lineWidth:y=c.lineWidth,stroke:m=c.stroke,visible:v=c.visible,x:b=c.x,y:x=c.y,scaleX:w=c.scaleX,scaleY:S=c.scaleY}=e.attribute,A=Lb(g,p,u),_=Wb(g,f),C=Ib(u,d),T=Ob(m,y);if(!e.valid||!v)return;if(!C&&!T)return;if(!(A||_||o||h||d))return;const B=e.getParsedPath();if(!B)return;const{keepDirIn3d:P=c.keepDirIn3d}=e.attribute,E=this.z??0;if(i.beginPath(),P&&i.camera&&i.project){const t=i.project(n,r,E),e=i.camera;i.camera=null,!1===B.draw(i,l,t.x,t.y)&&i.closePath(),i.camera=e}else!1===B.draw(i,l,n,r,E)&&i.closePath();this._symbolRenderContribitions||(this._symbolRenderContribitions=this.symbolRenderContribitions.getContributions()||[],this._symbolRenderContribitions.sort(((t,e)=>e.order-t.order))),this._symbolRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),C&&(o?o(i,e.attribute,c):A&&(i.setCommonStyle(e,e.attribute,b-n,x-r,c),i.fill())),T&&(h?h(i,e.attribute,c):_&&(i.setStrokeStyle(e,e.attribute,(b-n)/w,(x-r)/S,c),i.stroke())),this._symbolRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=nm(t,n?.theme).symbol,a=this.transform(t,s,r),{x:o,y:h,z:c,lastModelMatrix:l}=a;this.z=c,Nb(t,r,o,h,0,n)||(this.drawShape(t,r,o,h,i,n),this.z=0,r.modelMatrix!==l&&Jw.free(r.modelMatrix),r.modelMatrix=l),r.highPerformanceRestore()}},t.DefaultCanvasSymbolRender=dp([rp(),pp(0,op(gp)),pp(0,sp(nx)),fp("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender),t.DefaultCanvasTextRender=class extends t.BaseRender{textRenderContribitions;type;numberType=wb;z;_textBeforeRenderContribitions;_textAfterRenderContribitions;constructor(t){super(),this.textRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).text,{text:l,fill:u=c.fill,stroke:d=c.stroke,fillOpacity:p=c.fillOpacity,strokeOpacity:f=c.strokeOpacity,opacity:g=c.opacity,lineWidth:y=c.lineWidth,visible:m=c.visible,underline:v=c.underline,lineThrough:b=c.lineThrough,keepDirIn3d:x=c.keepDirIn3d,fontSize:w=c.fontSize,textBaseline:S=c.textBaseline,x:A=c.x,y:_=c.y}=e.attribute,C=e.attribute.lineHeight??w,T=Lb(g,p,u),B=Wb(g,f),P=Ib(u),E=Ob(d,y);if(!e.valid||!m)return;if(!(P||E||T||B))return;const M=!x,R=this.z||0;if(i.beginPath(),!this._textBeforeRenderContribitions){const e=this.textRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),this._textBeforeRenderContribitions=[],this._textAfterRenderContribitions=[],e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._textBeforeRenderContribitions.push(e):this._textAfterRenderContribitions.push(e)}))}if(this._textBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,P,E,T,B,c,s,o,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),M&&this.transformUseContext2d(e,c,R,i),Array.isArray(l)){i.setTextStyleWithoutAlignBaseline(e.attribute,c,R);const{multilineLayout:t}=e;if(!t)return void i.highPerformanceRestore();const{xOffset:s,yOffset:a}=t.bbox;E&&(h?h(i,e.attribute,c):B&&(i.setStrokeStyle(e,e.attribute,A-n,_-r,c),t.lines.forEach((t=>{i.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+a+r,R)})))),P&&(o?o(i,e.attribute,c):T&&(i.setCommonStyle(e,e.attribute,A-n,_-r,c),t.lines.forEach((t=>{i.fillText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+a+r,R),this.drawMultiUnderLine(v,b,e,(t.leftOffset||0)+n,(t.topOffset||0)+a+r,R,t.width,c,i)}))))}else{i.setTextStyle(e.attribute,c,R);const t=e.clipedText;let s=0;C!==w&&("top"===S?s=(C-w)/2:"middle"===S||"bottom"===S&&(s=-(C-w)/2)),E&&(h?h(i,e.attribute,c):B&&(i.setStrokeStyle(e,e.attribute,A-n,_-r,c),i.strokeText(t,n,r+s,R))),P&&(o?o(i,e.attribute,c):T&&(i.setCommonStyle(e,e.attribute,A-n,_-r,c),i.fillText(t,n,r+s,R),this.drawUnderLine(v,b,e,n,r+s,R,c,i)))}M&&this.restoreTransformUseContext2d(e,c,R,i),this._textAfterRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,P,E,T,B,c,s,o,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=nm(t,n?.theme).text,{keepDirIn3d:a=s.keepDirIn3d}=t.attribute,o=!a,h=this.transform(t,s,r,o),{x:c,y:l,z:u,lastModelMatrix:d}=h;this.z=u,this.drawShape(t,r,c,l,i,n),this.z=0,r.modelMatrix=d,r.highPerformanceRestore()}drawUnderLine(t,e,i,n,r,s,a,o){if(e+t<=0)return;const{textAlign:h=a.textAlign,textBaseline:c=a.textBaseline,fontSize:l=a.fontSize,fill:u=a.fill,opacity:d=a.opacity,fillOpacity:p=a.fillOpacity}=i.attribute,f=i.clipedWidth,g=cx(h,f),y=lx(c,l,l),m={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};if(t){m.lineWidth=t,o.setStrokeStyle(i,m,n,r,a),o.beginPath();const e=r+y+l;o.moveTo(n+g,e,s),o.lineTo(n+g+f,e,s),o.stroke()}if(e){m.lineWidth=e,o.setStrokeStyle(i,m,n,r,a),o.beginPath();const t=r+y+l/2;o.moveTo(n+g,t,s),o.lineTo(n+g+f,t,s),o.stroke()}}drawMultiUnderLine(t,e,i,n,r,s,a,o,h){if(e+t<=0)return;const{textAlign:c=o.textAlign,fontSize:l=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,fillOpacity:p=o.fillOpacity}=i.attribute,f=cx(c,a),g=lx("alphabetic",l,l),y={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};let m=-3;if(t){y.lineWidth=t,h.setStrokeStyle(i,y,n,r,o),h.beginPath();const e=r+g+l+m;h.moveTo(n+f,e,s),h.lineTo(n+f+a,e,s),h.stroke()}if(m=-1,e){y.lineWidth=e,h.setStrokeStyle(i,y,n,r,o),h.beginPath();const t=r+g+l/2+m;h.moveTo(n+f,t,s),h.lineTo(n+f+a,t,s),h.stroke()}}},t.DefaultCanvasTextRender=dp([rp(),pp(0,op(gp)),pp(0,sp(rx)),fp("design:paramtypes",[Object])],t.DefaultCanvasTextRender),t.AbstractGraphicRender=class{type;numberType},t.AbstractGraphicRender=dp([rp()],t.AbstractGraphicRender),t.DefaultCanvasPolygonRender=class{polygonRenderContribitions;type;numberType=gb;_polygonRenderContribitions;constructor(t){this.polygonRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).polygon,{points:l=c.points,fill:u=c.fill,stroke:d=c.stroke,cornerRadius:p=c.cornerRadius,fillOpacity:f=c.fillOpacity,background:g,strokeOpacity:y=c.strokeOpacity,lineWidth:m=c.lineWidth,opacity:v=c.opacity,visible:b=c.visible,x:x=c.x,y:w=c.y}=e.attribute,S=Lb(v,f,u),A=Wb(v,y),_=Ib(u,g),C=Ob(d,m);e.valid&&b&&(_||C)&&(S||A||o||h||g)&&(i.beginPath(),p<=0||Dp(p)&&p.every((t=>0===t))?US(i.camera?i:i.nativeContext,l,n,r):function(t,e,i,n,r){if(e.length<3)US(t,e,i,n);else for(let s=0;s<e.length;s++){const a=e[s],o=e[(s+1)%e.length],h=e[(s+2)%e.length],c=o.x-a.x,l=o.y-a.y,u=o.x-h.x,d=o.y-h.y,p=(Math.atan2(l,c)-Math.atan2(d,u))/2,f=Math.abs(Math.tan(p));let g=Array.isArray(r)?r[(s+1)%e.length]??0:r,y=g/f;const m=WS(c,l),v=WS(u,d),b=Math.min(m,v);y>b&&(y=b,g=b*f);const x=FS(o,y,m,c,l),w=FS(o,y,v,u,d),S=2*o.x-x.x-w.x,A=2*o.y-x.y-w.y,_=WS(S,A),C=FS(o,WS(y,g),_,S,A);let T=Math.atan2(x.y-C.y,x.x-C.x);const B=Math.atan2(w.y-C.y,w.x-C.x);let P=B-T;P<0&&(T=B,P=-P),P>Math.PI&&(P-=Math.PI),0===s?t.moveTo(x.x+i,x.y+n):t.lineTo(x.x+i,x.y+n),P&&t.arcTo(o.x+i,o.y+n,w.x+i,w.y+n,g),t.lineTo(w.x+i,w.y+n)}}(i.camera?i:i.nativeContext,l,n,r,p),i.closePath(),this._polygonRenderContribitions||(this._polygonRenderContribitions=this.polygonRenderContribitions.getContributions()||[],this._polygonRenderContribitions.sort(((t,e)=>e.order-t.order))),this._polygonRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,_,C,S,A,c,s,o,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),_&&(o?o(i,e.attribute,c):f&&(i.setCommonStyle(e,e.attribute,x-n,w-r,c),i.fill())),C&&(h?h(i,e.attribute,c):y&&(i.setStrokeStyle(e,e.attribute,x-n,w-r,c),i.stroke())),this._polygonRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,_,C,S,A,c,s,o,h)})))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=nm(t,n?.theme).polygon;let{x:a=s.x,y:o=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);a+=e.x,o+=e.y,r.setTransformForCurrent()}else a=0,o=0,r.transformFromMatrix(t.transMatrix,!0);Nb(t,r,a,o,0,n)||this.drawShape(t,r,a,o,i,n),r.highPerformanceRestore()}},t.DefaultCanvasPolygonRender=dp([rp(),pp(0,op(gp)),pp(0,sp(ex)),fp("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);const NS=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class{imageRenderContribitions;type;numberType=db;_imageRenderContribitions;constructor(t){this.imageRenderContribitions=t}drawShape(e,i,n,r,s,a,o){const h=nm(e).image,{fill:c=h.fill,width:l=h.width,height:u=h.height,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,visible:f=h.visible,repeatX:g=h.repeatX,repeatY:y=h.repeatY,image:m}=e.attribute,v=Lb(d,p,c),b=Ib(c);if(e.valid&&f&&b&&(v||o)){if(this._imageRenderContribitions||(this._imageRenderContribitions=this.imageRenderContribitions.getContributions()||[]),this._imageRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,b,!1,v,!1,h,s,o)})),i.setShadowStyle&&i.setShadowStyle(e,h),b)if(o)o(i,e.attribute,h);else if(v){if(!m||!e.resources)return;const t=e.resources.get(m);if("success"!==t.state)return;i.setCommonStyle(e,e.attribute,n,r,h);let s=0;if("repeat"===g&&(s|=1),"repeat"===y&&(s|=2),s){const e=i.createPattern(t.data,NS[s]);i.fillStyle=e,i.fillRect(n,r,l,u)}else i.drawImage(t.data,n,r,l,u)}this._imageRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,b,!1,v,!1,h,s,o)}))}}draw(t,e,i){const{context:n}=e.drawParams;if(!n)return;const r=nm(t).image;let{x:s=r.x,y:a=r.y}=t.attribute;const{image:o}=t.attribute;if(!o||!t.resources)return;if("success"===t.resources.get(o).state){if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,n,s,a,i),n.highPerformanceRestore()}}},t.DefaultCanvasImageRender=dp([rp(),pp(0,op(gp)),pp(0,sp(Qb)),fp("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const zS=Symbol.for("IncrementalDrawContribution"),jS=Symbol.for("ArcRender"),HS=Symbol.for("Arc3dRender"),GS=Symbol.for("AreaRender"),VS=Symbol.for("CircleRender"),XS=Symbol.for("GraphicRender"),YS=Symbol.for("GroupRender"),qS=Symbol.for("LineRender"),KS=Symbol.for("PathRender"),$S=Symbol.for("PolygonRender"),ZS=Symbol.for("RectRender"),JS=Symbol.for("Rect3DRender"),QS=Symbol.for("SymbolRender"),tA=Symbol.for("TextRender"),eA=Symbol.for("RichTextRender"),iA=Symbol.for("Pyramid3dRender"),nA=Symbol.for("GlyphRender"),rA=Symbol.for("ImageRender"),sA=Symbol.for("RenderSelector"),aA=Symbol.for("DrawContribution");function oA(t,e,i){let n=e;const{a:r,b:s,c:a,d:o}=t.currentMatrix,h=Math.sign(r)*Math.sqrt(r*r+s*s),c=Math.sign(o)*Math.sqrt(a*a+o*o);return h+c===0?0:(n=n/Math.abs(h+c)*2*i,n)}function hA(t,e,i,n,r){if(!e||!0===e)return"black";let s,a;if(Dp(e))for(let t=0;t<e.length&&(a=e[t],!a);t++);else a=e;return"string"==typeof a?a:("linear"===a.gradient?s=function(t,e,i,n=0,r=0){const s=i.AABBBounds;if(!s)return;let a=s.x2-s.x1,o=s.y2-s.y1,h=s.x1-n,c=s.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;a/=t,o/=e,h/=t,c/=e}const l=t.createLinearGradient(h+(e.x0??0)*a,c+(e.y0??0)*o,h+(e.x1??1)*a,c+(e.y1??0)*o);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l}(t,a,i,n,r):"conical"===a.gradient?s=function(t,e,i,n=0,r=0){const s=i.AABBBounds;if(!s)return;let a=s.x2-s.x1,o=s.y2-s.y1,h=s.x1-n,c=s.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;a/=t,o/=e,h/=t,c/=e}const l=t.createConicGradient(h+(e.x??0)*a,c+(e.y??0)*o,e.startAngle,e.endAngle);let u;return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern(a+h,o+c,u)}(t,a,i,n,r):"radial"===a.gradient&&(s=function(t,e,i,n=0,r=0){const s=i.AABBBounds;if(!s)return;let a=s.x2-s.x1,o=s.y2-s.y1,h=s.x1-n,c=s.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;h/=t,c/=e,a/=t,o/=e}const l=t.createRadialGradient(h+(e.x0??.5)*a,c+(e.y0??.5)*o,Math.max(a,o)*(e.r0??0),h+(e.x1??.5)*a,c+(e.y1??.5)*o,Math.max(a,o)*(e.r1??.5));return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l}(t,a,i,n,r)),s||"orange")}const cA=new class{pools=[];allocate(t){if(!this.pools.length)return vy({nativeCanvas:gy.global.createCanvas(t),...t});const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr};return vy({nativeCanvas:gy.global.createCanvas(e),...e})}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};t.DefaultBaseBackgroundRenderContribution=class{time=t.BaseRenderContributionTime.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u,d){const{background:p}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const r=t.resources.get(p);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=nm(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,h),e.drawImage(r.data,s.x1,s.y1,s.width(),s.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=p,e.fill(),e.highPerformanceRestore()}},t.DefaultBaseBackgroundRenderContribution=dp([rp()],t.DefaultBaseBackgroundRenderContribution),t.DefaultBaseInteractiveRenderContribution=class{subRenderContribitions;time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;order=0;_subRenderContribitions;constructor(t){this.subRenderContribitions=t}drawShape(t,e,i,n,r,s,a,o,h,c,l,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,a,o,h,c,l,u,d)}))}},t.DefaultBaseInteractiveRenderContribution=dp([rp(),pp(0,op(gp)),pp(0,sp(sx)),fp("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution),t.DefaultBaseTextureRenderContribution=class{time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;textureMap;order=10;createCommonPattern(t,e,i,n,r){const s=(t-2*e)/2,a=cA.allocate({width:t,height:t,dpr:1}),o=a.getContext("2d");if(!o)return null;o.clearRect(0,0,t,t),r(s,o);const h=n.createPattern(a.nativeCanvas,"repeat");return cA.free(a),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,qp),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const r=t/2,s=r;n.fillStyle=i,n.moveTo(r,s-e),n.lineTo(e+r,s),n.lineTo(r,s+e),n.lineTo(r-e,s),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(s,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(0,s,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const r=t/2,s=-r;n.moveTo(r,s),n.lineTo(r+t,s+t),n.moveTo(-r,-s),n.lineTo(-r+t,-s+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const r=t/2,s=r;n.moveTo(t+r,s),n.lineTo(r,s+t),n.moveTo(t-r,-s),n.lineTo(-r,-s+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,t,t),n.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,r,s,a,o,h,c,l,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:f=h.textureColor,textureSize:g=h.textureSize,texturePadding:y=h.texturePadding}=t.attribute;if(!p)return;let m=this.textureMap.get(p);if(!m)switch(p){case"circle":m=this.createCirclePattern(g,y,f,e);break;case"diamond":m=this.createDiamondPattern(g,y,f,e);break;case"rect":m=this.createRectPattern(g,y,f,e);break;case"vertical-line":m=this.createVerticalLinePattern(g,y,f,e);break;case"horizontal-line":m=this.createHorizontalLinePattern(g,y,f,e);break;case"bias-lr":m=this.createBiasLRLinePattern(g,y,f,e);break;case"bias-rl":m=this.createBiasRLLinePattern(g,y,f,e);break;case"grid":m=this.createGridPattern(g,y,f,e)}m&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=m,e.fill(),e.highPerformanceRestore())}},t.DefaultBaseTextureRenderContribution=dp([rp()],t.DefaultBaseTextureRenderContribution),t.DefaultArcRenderContribution=class{time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{innerRadius:d=h.innerRadius,outerRadius:p=h.outerRadius,startAngle:f=h.startAngle,endAngle:g=h.endAngle,opacity:y=h.opacity,outerBorder:m,innerBorder:v}=t.attribute;if(m){const{distance:r=h.outerBorder.distance}=m,s=oA(e,r,e.dpr),a=r/p;if(t.setAttributes({outerRadius:p+s,innerRadius:d-s,startAngle:f-a,endAngle:g+a}),e.beginPath(),Hb(t,e,i,n,p+s,d-s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,m,h.outerBorder);else if(o){const r=h.outerBorder.opacity;h.outerBorder.opacity=y,e.setStrokeStyle(t,m,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(v){const{distance:r=h.innerBorder.distance}=v,s=oA(e,r,e.dpr),a=r/p;if(t.setAttributes({outerRadius:p-s,innerRadius:d+s,startAngle:f+a,endAngle:g-a}),e.beginPath(),Hb(t,e,i,n,p-s,d+s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,v,h.innerBorder);else if(o){const r=h.innerBorder.opacity;h.innerBorder.opacity=y,e.setStrokeStyle(t,v,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:p,innerRadius:d,startAngle:f,endAngle:g})}},t.DefaultArcRenderContribution=dp([rp()],t.DefaultArcRenderContribution),t.DefaultArcBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke},t.DefaultArcBackgroundRenderContribution=dp([rp()],t.DefaultArcBackgroundRenderContribution),t.DefaultArcTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke},t.DefaultArcTextureRenderContribution=dp([rp()],t.DefaultArcTextureRenderContribution),t.DefaultCircleRenderContribution=class{time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{radius:d=h.radius,startAngle:p=h.startAngle,endAngle:f=h.endAngle,opacity:g=h.opacity,outerBorder:y,innerBorder:m}=t.attribute;if(y){const{distance:r=h.outerBorder.distance}=y,s=oA(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,d+s,p,f),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,y,h.outerBorder);else if(o){const r=h.outerBorder.opacity;h.outerBorder.opacity=g,e.setStrokeStyle(t,y,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(m){const{distance:r=h.innerBorder.distance}=m,s=oA(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,d-s,p,f),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,m,h.innerBorder);else if(o){const r=h.innerBorder.opacity;h.innerBorder.opacity=g,e.setStrokeStyle(t,m,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultCircleRenderContribution=dp([rp()],t.DefaultCircleRenderContribution),t.DefaultCircleBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke},t.DefaultCircleBackgroundRenderContribution=dp([rp()],t.DefaultCircleBackgroundRenderContribution),t.DefaultCircleTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke},t.DefaultCircleTextureRenderContribution=dp([rp()],t.DefaultCircleTextureRenderContribution),t.DefaultGroupBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{background:d}=t.attribute;if(d)if(t.backgroundImg&&t.resources){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const n=t.AABBBounds;e.drawImage(i.data,n.x1,n.y1,n.width(),n.height()),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}},t.DefaultGroupBackgroundRenderContribution=dp([rp()],t.DefaultGroupBackgroundRenderContribution),t.DefaultImageBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{background:d,width:p,height:f}=t.attribute;if(d)if(t.backgroundImg){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=nm(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}const n=t.AABBBounds;e.drawImage(i.data,n.x1,n.y1,n.width(),n.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else{e.beginPath();const r=t.AABBBounds;e.rect(i,n,r.width(),r.height()),e.fillStyle=d,e.globalAlpha=1,e.fill()}}},t.DefaultImageBackgroundRenderContribution=dp([rp()],t.DefaultImageBackgroundRenderContribution),t.DefaultRectRenderContribution=class{time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{width:d=h.width,height:p=h.height,cornerRadius:f=h.cornerRadius,opacity:g=h.opacity,outerBorder:y,innerBorder:m}=t.attribute;if(y){const{distance:r=h.outerBorder.distance}=y,s=oA(e,r,e.dpr),a=i-s,c=n-s,l=2*s;if(0===f||Dp(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(a,c,d+l,p+l)):(e.beginPath(),LS(e,a,c,d+l,p+l,f)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,y,h.outerBorder);else if(o){const r=h.outerBorder.opacity;h.outerBorder.opacity=g,e.setStrokeStyle(t,y,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(m){const{distance:r=h.innerBorder.distance}=m,s=oA(e,r,e.dpr),a=i+s,c=n+s,l=2*s;if(0===f||Dp(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(a,c,d-l,p-l)):(e.beginPath(),LS(e,a,c,d-l,p-l,f)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,m,h.innerBorder);else if(o){const r=h.innerBorder.opacity;h.innerBorder.opacity=g,e.setStrokeStyle(t,m,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultRectRenderContribution=dp([rp()],t.DefaultRectRenderContribution),t.DefaultRectBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke},t.DefaultRectBackgroundRenderContribution=dp([rp()],t.DefaultRectBackgroundRenderContribution),t.DefaultRectTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke},t.DefaultRectTextureRenderContribution=dp([rp()],t.DefaultRectTextureRenderContribution),t.SplitRectBeforeRenderContribution=class{time=t.BaseRenderContributionTime.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u,d){const{stroke:p=h.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}},t.SplitRectBeforeRenderContribution=dp([rp()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=class{time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{width:d=h.width,height:p=h.height,stroke:f=h.stroke}=t.attribute;if(Array.isArray(f)&&f.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,h),e.beginPath(),e.moveTo(i,n),f[0]?e.lineTo(i+d,n):e.moveTo(i+d,n),f[1]?e.lineTo(i+d,n+p):e.moveTo(i+d,n+p),f[2]?e.lineTo(i,n+p):e.moveTo(i,n+p),f[3]){const t=f[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}},t.SplitRectAfterRenderContribution=dp([rp()],t.SplitRectAfterRenderContribution),t.DefaultSymbolRenderContribution=class{time=t.BaseRenderContributionTime.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,i,n,r,s,a,o,h,c,l,u){const{size:d=h.size,opacity:p=h.opacity,outerBorder:f,innerBorder:g}=t.attribute,y=t.getParsedPath();if(y){if(f){const{distance:r=h.outerBorder.distance}=f,s=oA(e,r,e.dpr);if(e.beginPath(),!1===y.drawOffset(e,d,i,n,s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,f,h.outerBorder);else if(o){const r=h.outerBorder.opacity;h.outerBorder.opacity=p,e.setStrokeStyle(t,f,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=g,s=oA(e,r,e.dpr);if(e.beginPath(),!1===y.drawOffset(e,d,i,n,-s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,g,h.innerBorder);else if(o){const r=h.innerBorder.opacity;h.innerBorder.opacity=p,e.setStrokeStyle(t,g,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}}},t.DefaultSymbolRenderContribution=dp([rp()],t.DefaultSymbolRenderContribution);class lA extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke}class uA extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke}const dA=Symbol.for("RenderService"),pA=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{drawContribution;dirtyBounds;renderTreeRoots;renderLists;drawParams;constructor(t){this.drawContribution=t}prepare(t){this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,{...this.drawParams})}afterDraw(t){}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}},t.DefaultRenderService=dp([rp(),pp(0,op(aA)),fp("design:paramtypes",[Object])],t.DefaultRenderService);var fA=new Qd((e=>{e(t.DefaultRenderService).toSelf(),e(dA).toService(t.DefaultRenderService)}));function gA(t,e,i,n=!1,r=!1){const s={},a=[];let o=!1;if(r)o=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:r=e}=t.attribute;if(0===n)i=r;else if(i!==r)return o=!0,!0;return!1}),n)}if(o){t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],a.push(i))}),n),a.sort(((t,e)=>n?e-t:t-e));let o=!1;for(let t=0;t<a.length&&!o;t++){const e=a[t],h=s[e];r&&h.sort(((t,e)=>(n?-1:1)*((e.attribute.z??0)-(t.attribute.z??0))));for(let t=0;t<h.length;t++)if(i(h[t],t)){o=!0;break}}}else t.forEachChildren(i,n)}async function yA(t,e,i,n=!1){await t.forEachChildrenAsync(i,n)}function mA(t,e,i,n=!1){const r={},s=[];let a=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(undefined!==n)return a=!0,!0;return!1}),n);let o=null,h=!1;if(a){t.forEachChildren((t=>{const{zIndex:e=i}=t.attribute;r[e]?r[e].push(t):(r[e]=[t],s.push(e))}),n),s.sort(((t,e)=>n?e-t:t-e));let a=!1;for(let t=0;t<s.length&&!a;t++){const i=s[t],n=r[i];for(let t=0;t<n.length;t++){if(h){a=!0,o=n[t];break}n[t]._uid!==e||(h=!0)}}}else t.forEachChildren((t=>h?(o=t,!0):(t._uid===e&&(h=!0),!1)),n);return o}const vA=Symbol.for("PickItemInterceptor");let bA=class{order=1;beforePickItem(t,e,i,n,r){if(!t.in3dMode||n.in3dInterceptor)return null;const s=e.pickContext,a=t.stage;if(!s||!a)return null;if(n.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=a.camera,t.isContainer){let a,o=!1,h=!1;if(t.forEachChildren((t=>(o=t.numberType===ob,!o))),t.forEachChildren((t=>(h=!!t.findFace,!h))),o){const s=t.getChildren(),o=[...s];o.sort(((t,e)=>{let i=(t.attribute.startAngle??0+t.attribute.endAngle??0)/2,n=(e.attribute.startAngle??0+e.attribute.endAngle??0)/2;for(;i<0;)i+=qp;for(;n<0;)n+=qp;return n-i})),o.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),o.forEach((e=>{t.appendChild(e)})),n.hack_pieFace="outside",a=e.pickGroup(t,i,r.parentMatrix,n),a.graphic||(n.hack_pieFace="inside",a=e.pickGroup(t,i,r.parentMatrix,n)),a.graphic||(n.hack_pieFace="top",a=e.pickGroup(t,i,r.parentMatrix,n)),t.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),s.forEach((e=>{t.appendChild(e)}))}else if(h){const o=t.getChildren(),h=o.map((t=>({ave_z:t.findFace().vertices.map((e=>s.view(e[0],e[1],e[2]+t.attribute.z??0)[2])).reduce(((t,e)=>t+e),0),g:t})));h.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),h.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),h.forEach((e=>{t.add(e.g)})),a=e.pickGroup(t,i,r.parentMatrix,n),t.removeAllChild(),o.forEach((t=>{t._next=null,t._prev=null})),t.update(),o.forEach((e=>{t.add(e)}))}else a=e.pickGroup(t,i,r.parentMatrix,n);return s.camera=null,s.restore(),n.in3dInterceptor=!1,a}return null}initCanvasCtx(t){t.setTransformForCurrent()}};bA=dp([rp()],bA);const xA=Symbol.for("GraphicPicker"),wA=Symbol.for("PickerService");t.DefaultPickService=class{global;pickItemInterceptorContributions;type="default";constructor(t,e){this.global=t,this.pickItemInterceptorContributions=e}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let n={graphic:null,group:null};i.pickerService=this;let r=0,s=0;if(i&&i.bounds){if(!i.bounds.contains(e.x,e.y))return n;r=i.bounds.x1,s=i.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const a=new _f(1,0,0,1,r,s);let o;for(let r=t.length-1;r>=0&&(t[r].isContainer?n=this.pickGroup(t[r],e,a,i):n.graphic=this.pickItem(t[r],e,i),!n.graphic);r--)o||(o=n.group);return n.graphic||(n.group=o),this.pickContext&&(this.pickContext.inuse=!1),n}containsPoint(t,e,i){return!!this.pickItem(t,e,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=n.pickContext,a=s.modelMatrix;if(s.camera){const e=t.transMatrix,i=Jw.allocate();if(iS(i,e),a){if(i){const t=Jw.allocate();s.modelMatrix=nS(t,a,i),Jw.free(i)}}else iS(i,t.globalTransMatrix),s.modelMatrix=i}if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const o=this.InterceptorContributions[r];if(o.beforePickItem){const r=o.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return s.modelMatrix!==a&&Jw.free(s.modelMatrix),s.modelMatrix=a,r}}const o=t.transMatrix,h=Zw.allocateByObj(i),c=new hf(e.x,e.y);h.transformPoint(c,c);const l=t.AABBBounds.containsPoint(c);if(!l&&!t.stage.camera)return r;const u=!1!==t.attribute.pickable&&l;return h.multiply(o.a,o.b,o.c,o.d,o.e,o.f),!1!==t.attribute.childrenPickable&&gA(t,Kg.zIndex,(i=>{if(i.isContainer){const s=new hf(e.x,e.y),a=nm(t).group,{scrollX:o=a.scrollX,scrollY:c=a.scrollY}=t.attribute;s.x-=o,s.y-=c,r=this.pickGroup(i,s,h,n)}else{const s=new hf(e.x,e.y);h.transformPoint(s,s);const a=nm(t).group,{scrollX:o=a.scrollX,scrollY:c=a.scrollY}=t.attribute;s.x-=o,s.y-=c;const l=this.pickItem(i,s,n);r.graphic=l}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==a&&Jw.free(s.modelMatrix),s.modelMatrix=a,r.graphic||r.group||!u||t.stage.camera||(r.group=t),Zw.free(h),r}selectPicker(t){const e=this.pickerMap.get(t.numberType);return e||null}},t.DefaultPickService=dp([rp(),pp(0,op(wp)),pp(1,op(gp)),pp(1,sp(vA)),fp("design:paramtypes",[Object,Object])],t.DefaultPickService);const SA=Symbol.for("BoundsPicker"),AA=Symbol.for("GlobalPickerService");function _A(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],y=e[13],m=e[14],v=e[15];let b=i[0],x=i[1],w=i[2],S=i[3];return t[0]=b*n+x*o+w*u+S*g,t[1]=b*r+x*h+w*d+S*y,t[2]=b*s+x*c+w*p+S*m,t[3]=b*a+x*l+w*f+S*v,b=i[4],x=i[5],w=i[6],S=i[7],t[4]=b*n+x*o+w*u+S*g,t[5]=b*r+x*h+w*d+S*y,t[6]=b*s+x*c+w*p+S*m,t[7]=b*a+x*l+w*f+S*v,b=i[8],x=i[9],w=i[10],S=i[11],t[8]=b*n+x*o+w*u+S*g,t[9]=b*r+x*h+w*d+S*y,t[10]=b*s+x*c+w*p+S*m,t[11]=b*a+x*l+w*f+S*v,b=i[12],x=i[13],w=i[14],S=i[15],t[12]=b*n+x*o+w*u+S*g,t[13]=b*r+x*h+w*d+S*y,t[14]=b*s+x*c+w*p+S*m,t[15]=b*a+x*l+w*f+S*v,t}function CA(t,e,i){const n=e[0],r=e[1],s=e[2];let a=i[3]*n+i[7]*r+i[11]*s+i[15];return a=a||1,t[0]=(i[0]*n+i[4]*r+i[8]*s+i[12])/a,t[1]=(i[1]*n+i[5]*r+i[9]*s+i[13])/a,t[2]=(i[2]*n+i[6]*r+i[10]*s+i[14])/a,t}t.DefaultGlobalPickerService=class{global;type;constructor(t){this.global=t,this.global.hooks.onSetEnv.tap("global-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env)}configure(t,e){}pick(t,e,i){let n={graphic:null,group:null};const r=new _f(1,0,0,1,0,0);let s;for(let a=0;a<t.length&&(t[a].isContainer?n=this.pickGroup(t[a],e,r,i):n.graphic=this.pickItem(t[a],e,i),!n.graphic);a++)s||(s=n.group);return n.graphic||(n.group=s),n}containsPoint(t,e,i){return!!this.pickItem(t,e,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=t.transMatrix,a=new hf(e.x,e.y);i.transformPoint(a,a);const o=t.AABBBounds.containsPoint(a);if(!o)return r;const h=!1!==t.attribute.pickable&&o;return i.multiply(s.a,s.b,s.c,s.d,s.e,s.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((t=>{if(t.isContainer)r=this.pickGroup(t,e,i,n);else{const s=new hf(e.x,e.y);i.transformPoint(s,s),r.graphic=this.pickItem(t,s,n)}return!!r.graphic||!!r.group})),r.graphic||r.group||!h||(r.group=t),r}pickItem(t,e,i){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?t:null}},t.DefaultGlobalPickerService=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],t.DefaultGlobalPickerService);class TA{_params;_projectionMatrixCached;_viewMatrixCached;_vp;set params(t){this._params={...t},this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return{...this._params}}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=Jw.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Jw.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,n){let r,s,a,o,h,c,l,u,d,p;const f=e[0],g=e[1],y=e[2],m=n[0],v=n[1],b=n[2],x=i[0],w=i[1],S=i[2];Math.abs(f-x)<Gp&&Math.abs(g-w)<Gp&&Math.abs(y-S)<Gp?$w.identity(t):(l=f-x,u=g-w,d=y-S,p=1/Math.hypot(l,u,d),l*=p,u*=p,d*=p,r=v*d-b*u,s=b*l-m*d,a=m*u-v*l,p=Math.hypot(r,s,a),p?(p=1/p,r*=p,s*=p,a*=p):(r=0,s=0,a=0),o=u*a-d*s,h=d*r-l*a,c=l*s-u*r,p=Math.hypot(o,h,c),p?(p=1/p,o*=p,h*=p,c*=p):(o=0,h=0,c=0),t[0]=r,t[1]=o,t[2]=l,t[3]=0,t[4]=s,t[5]=h,t[6]=u,t[7]=0,t[8]=a,t[9]=c,t[10]=d,t[11]=0,t[12]=-(r*f+s*g+a*y),t[13]=-(o*f+h*g+c*y),t[14]=-(l*f+u*g+d*y),t[15]=1)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=Jw.allocate()),this._vp=_A(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=Jw.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=Jw.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return function(t,e,i,n,r,s,a){const o=1/(e-i),h=1/(n-r),c=1/(s-a);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*o,t[13]=(r+n)*h,t[14]=(a+s)*c,t[15]=1}(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=Jw.allocate()),this._vp=_A(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(e??n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return CA(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;CA(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const s=this.getProjectionScale(i);return{x:t*s+r[0],y:e*s+r[1]}}}const BA=[0,0,0],PA=new _f(1,0,0,1,0,0);t.BrowserContext2d=class{static env="browser";drawPromise;modelMatrix;matrix;applyedMatrix;set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}dpr;constructor(t,e){const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new _f(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new _f(1,0,0,1,0,0)}reset(){this.stack.length&&console.warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new _f(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Zw.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(Zw.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(Zw.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n,r=!0){this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*n,o*r,o*s),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s,a=!0){this.matrix.multiply(t,e,i,n,r,s),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,n,r,s,a){if(a=a||0,this.camera){const o=[];((t,e,i,n,r,s,a,o)=>{if(o)for(;i>e;)i-=qp;else for(;i<e;)i+=qp;const h=Vp/3*(i>e?1:-1);let c=e,l=c;for(;l!==i;){l=h>0?Math.min(l+h,i):Math.max(l+h,i);const e=Math.abs(l-c),o=4*Math.tan(e/4)/3,u=l<c?-1:1,d=Math.cos(c),p=Math.sin(c),f=Math.cos(l),g=Math.sin(l),y=d*s+n,m=p*a+r,v=f*s+n,b=g*a+r,x=s*o*u,w=a*o*u;t.push([y-x*p,m+w*d,v+x*g,b-w*f,v,b]),c=l}})(o,n,r,t,e,i,i,s);for(let t=0;t<o.length;++t){const e=o[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],a)}}else this.nativeContext.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.nativeContext.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s,a){if(a=a||0,this.camera){let o=a,h=a;this.modelMatrix&&(CA(BA,[t,e,a],this.modelMatrix),t=BA[0],e=BA[1],o=BA[2],CA(BA,[i,n,a],this.modelMatrix),i=BA[0],n=BA[1],h=BA[2],CA(BA,[r,s,a],this.modelMatrix),r=BA[0],s=BA[1],a=BA[2]);let c=this.camera.vp(r,s,a);r=c.x,s=c.y,c=this.camera.vp(t,e,o),t=c.x,e=c.y,c=this.camera.vp(i,n,h),i=c.x,n=c.y}this.nativeContext.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.nativeContext.closePath()}ellipse(t,e,i,n,r,s,a,o){null==o?this.nativeContext.ellipse(t,e,i,n,r,s,a):this.nativeContext.ellipse(t,e,i,n,r,s,a,o)}lineTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(CA(BA,[t,e,i],this.modelMatrix),t=BA[0],e=BA[1],i=BA[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(CA(BA,[t,e,i],this.modelMatrix),t=BA[0],e=BA[1],i=BA[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,i,n,r){if(r=r||0,this.camera){let s=r;this.modelMatrix&&(CA(BA,[t,e,r],this.modelMatrix),t=BA[0],e=BA[1],s=BA[2],CA(BA,[i,n,r],this.modelMatrix),i=BA[0],n=BA[1],r=BA[2]);let a=this.camera.vp(i,n,r);i=a.x,n=a.y,a=this.camera.vp(t,e,s),t=a.x,e=a.y}this.nativeContext.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+i,e,r),this.lineTo(t+i,e+n,r),this.lineTo(t,e+n,r),this.closePath()):this.nativeContext.rect(t,e,i,n)}createImageData(){const t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}createLinearGradient(t,e,i,n){return this.nativeContext.createLinearGradient(t,e,i,n)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,i,n,r,s){return this.nativeContext.createRadialGradient(t,e,i,n,r,s)}createConicGradient(t,e,i,n){let r,s=!1;const a=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),s=!0},GetPattern(o,h,c){return s&&(c||(c=n-i),r=qb(a,this.stops,t,e,c,i,n,o,h),s=!1),r}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,n){this.nativeContext.fillRect(t,e,i,n)}clearRect(t,e,i,n){this.nativeContext.clearRect(t,e,i,n)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(CA(BA,[t,e,i],this.modelMatrix),t=BA[0],e=BA[1],i=BA[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(CA(BA,[t,e,i],this.modelMatrix),t=BA[0],e=BA[1],i=BA[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(CA(BA,[e,i,n],this.modelMatrix),e=BA[0],i=BA[1],n=BA[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,n){return this.nativeContext.getImageData(t,e,i,n)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t,e=gy.global.measureTextMethod){return e&&"native"!==e?(this.mathTextMeasure||(this.mathTextMeasure=gy.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas))),this.mathTextMeasure.textSpec.fontFamily=this.fontFamily??Yg.fontFamily,this.mathTextMeasure.textSpec.fontSize=this.fontSize??Yg.fontSize,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={},this.mathTextMeasure.measure(t,e)):this.nativeContext.measureText(t)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,n){this.nativeContext.strokeRect(t,e,i,n)}strokeText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(CA(BA,[e,i,n],this.modelMatrix),e=BA[0],i=BA[1],n=BA[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}fillAttributes={...Gg,opacity:1};strokeAttributes={...Xg,opacity:1};textAttributes={...Yg,opacity:1};setCommonStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,i,n,r[0]);const s={};return r.forEach((t=>{Object.assign(s,t)})),this._setCommonStyle(t,e,i,n,s)}return this._setCommonStyle(t,e,i,n,r)}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:a=r.fillOpacity,opacity:o=r.opacity,fill:h=r.fill}=e;a>1e-12&&o>1e-12?(s.globalAlpha=a*o,s.fillStyle=hA(this,h,t,i,n)):s.globalAlpha=a*o}setShadowStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowStyle(t,i[0]);const n={};return i.forEach((t=>{Object.assign(n,t)})),this._setShadowStyle(t,e,n)}return this._setShadowStyle(t,e,i)}_clearShadowStyle=!1;_clearFilterStyle=!1;_setShadowStyle(t,e,i){const n=this.nativeContext;i||(i=this.fillAttributes);const{opacity:r=i.opacity,shadowBlur:s=i.shadowBlur,shadowColor:a=i.shadowColor,shadowOffsetX:o=i.shadowOffsetX,shadowOffsetY:h=i.shadowOffsetY,blur:c=i.blur}=e;r<=1e-12||(s||o||h?(n.shadowBlur=s,n.shadowColor=a,n.shadowOffsetX=o,n.shadowOffsetY=h,this._clearShadowStyle=!0):this._clearShadowStyle&&(n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0),c?(n.filter=`blur(${c}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(n.filter="blur(0px)",this._clearFilterStyle=!1))}setStrokeStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,i,n,r[0]);const s={};return r.forEach((t=>{Object.assign(s,t)})),this._setStrokeStyle(t,e,i,n,s)}return this._setStrokeStyle(t,e,i,n,r)}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(a>1e-12&&o>1e-12){const{lineWidth:h=r.lineWidth,stroke:c=r.stroke,lineJoin:l=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=a*o,s.lineWidth=oA(this,h,this.dpr),s.strokeStyle=hA(this,c,t,i,n),s.lineJoin=l,s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}setTextStyleWithoutAlignBaseline(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;t.font?n.font=t.font:n.font=hx(t,e,r&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:s=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=s,this.fontSize=a,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes),t.font?n.font=t.font:n.font=hx(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:r=e.fontFamily,fontSize:s=e.fontSize}=t;this.fontFamily=r,this.fontSize=s,n.textAlign=t.textAlign??e.textAlign,n.textBaseline=t.textBaseline??e.textBaseline}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(PA,t,e)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Zw.free(t))),this.stack.length=0}},t.BrowserContext2d=dp([rp(),fp("design:paramtypes",[Object,Number])],t.BrowserContext2d);const EA={WIDTH:500,HEIGHT:500,DPR:1};t.BrowserCanvas=class{static env="browser";_displayWidth;_displayHeight;_id;_pixelWidth;_pixelHeight;_x;_y;_dpr;_container;_nativeCanvas;_context;_visiable;controled;get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this.width,this.height)}constructor(e){const{nativeCanvas:i,width:n=EA.WIDTH,height:r=EA.HEIGHT,dpr:s=EA.DPR,container:a,x:o,y:h,canvasControled:c=!0}=e;if(this._x=o??0,this._y=h??0,this._pixelWidth=n*s,this._pixelHeight=r*s,this._visiable=!1!==e.visiable,this.controled=c,"string"==typeof a){const t=gy.global.getElementById(a);t&&(this._container=t)}else this._container=a;this._displayWidth=n,this._displayHeight=r,this._dpr=s,this._nativeCanvas=i,this._context=new t.BrowserContext2d(this,this._dpr),this._id=i.id,this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight;!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),null!=this.id&&(t.id=this.id.toString()),this._container&&this._container.appendChild(t),this.visiable||this.hide()}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:i=this._displayHeight,dpr:n=this._dpr,x:r=this._x,y:s=this._y}=t,{nativeCanvas:a}=this;a.width=e*n,a.height=i*n;!a.style||this.setCanvasStyle(a,r,s,e,i),t.id&&(a.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,n,r){this.controled&&(t.style.padding="0",t.style.margin="0",t.style.border="0",t.style.background="transparent",t.style.width=`${n}px`,t.style.height=`${r}px`)}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}resize(t,e){if(!this.controled)return;this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight;this._context.dpr=this._dpr}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}},t.BrowserCanvas=dp([rp(),fp("design:paramtypes",[Object])],t.BrowserCanvas);const MA=Symbol.for("CanvasArcPicker"),RA=Symbol.for("CanvasArc3dPicker"),kA=Symbol.for("CanvasAreaPicker"),DA=Symbol.for("CanvasCirclePicker"),IA=Symbol.for("CanvasImagePicker"),OA=Symbol.for("CanvasLinePicker"),LA=Symbol.for("CanvasPathPicker"),UA=Symbol.for("CanvasRectPicker"),WA=Symbol.for("CanvasRect3dPicker"),FA=Symbol.for("CanvasSymbolPicker"),NA=Symbol.for("CanvasTextPicker"),zA=Symbol.for("CanvasPolygonPicker"),jA=Symbol.for("CanvasPyramid3dPicker"),HA=Symbol.for("CanvasRichTextPicker"),GA=Symbol.for("CanvasGlyphPicker"),VA=Symbol.for("CanvasPickerContribution"),XA=Symbol.for("MathArcPicker"),YA=Symbol.for("MathAreaPicker"),qA=Symbol.for("MathCirclePicker"),KA=Symbol.for("MathLinePicker"),$A=Symbol.for("MathPathPicker"),ZA=Symbol.for("MathRectPicker"),JA=Symbol.for("MathSymbolPicker"),QA=Symbol.for("MathTextPicker"),t_=Symbol.for("MathPolygonPicker"),e_=Symbol.for("MathGlyphPicker"),i_=Symbol.for("MathPickerContribution");t.DefaultCanvasPickerService=class extends t.DefaultPickService{contributions;circlePicker;rectPicker;arcPicker;areaPicker;imagePicker;linePicker;pathPicker;symbolPicker;textPicker;polygonPicker;richtextPicker;drawContribution;global;pickItemInterceptorContributions;constructor(t,e,i,n,r,s,a,o,h,c,l,u,d,p,f){super(p,f),this.contributions=t,this.circlePicker=e,this.rectPicker=i,this.arcPicker=n,this.areaPicker=r,this.imagePicker=s,this.linePicker=a,this.pathPicker=o,this.symbolPicker=h,this.textPicker=c,this.polygonPicker=l,this.richtextPicker=u,this.drawContribution=d,this.global=p,this.pickItemInterceptorContributions=f,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(e,i){const n={width:100,height:100,nativeCanvas:e.createCanvas({width:100,height:100}),id:"for-pick"};this.pickCanvas=new t.BrowserCanvas(n),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforePickItem&&r.beforePickItem(t,this,e,i))return t}const n=this.pickerMap.get(t.numberType);return n&&n.contains(t,e,i)?t:null}},dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],t.DefaultCanvasPickerService.prototype,"init",null),t.DefaultCanvasPickerService=dp([rp(),pp(0,op(gp)),pp(0,sp(VA)),pp(1,op(DA)),pp(2,op(UA)),pp(3,op(MA)),pp(4,op(kA)),pp(5,op(IA)),pp(6,op(OA)),pp(7,op(LA)),pp(8,op(FA)),pp(9,op(NA)),pp(10,op(zA)),pp(11,op(HA)),pp(12,op(aA)),pp(13,op(wp)),pp(14,op(gp)),pp(14,sp(vA)),fp("design:paramtypes",[Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object])],t.DefaultCanvasPickerService);const n_=new _f(1,0,0,1,0,0),r_={x:0,y:0};t.EmptyContext2d=class{path;canvas;stack;matrix;applyedMatrix;fillStyle;font;globalAlpha;lineCap;lineDashOffset;lineJoin;lineWidth;miterLimit;shadowBlur;shadowColor;shadowOffsetX;shadowOffsetY;strokeStyle;textAlign;textBaseline;dpr;get nativeContext(){return this.path}constructor(t,e){this.matrix=new _f(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new _f(1,0,0,1,0,0),this.path=new Ng}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Zw.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(Zw.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(Zw.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n,r=!0){this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*n,o*r,o*s),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s,a=!0){this.matrix.multiply(t,e,i,n,r,s),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,r,s){this.path.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.path.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s){this.path.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.path.closePath()}ellipse(t,e,i,n,r,s,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},r_),function(t,e,i){return Yy(t,0,!1,e,i)}(this.path.commandList,r_.x,r_.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},r_);const i=oA(this,this.lineWidth,this.dpr);return function(t,e,i,n){return Yy(t,e,!0,i,n)}(this.path.commandList,i,r_.x,r_.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,r){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,r){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(n_,t,e)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Zw.free(t))),this.stack.length=0}},t.EmptyContext2d=dp([rp(),fp("design:paramtypes",[Object,Number])],t.EmptyContext2d),t.DefaultMathPickerService=class extends t.DefaultPickService{contributions;global;pickItemInterceptorContributions;constructor(t,e,i){super(e,i),this.contributions=t,this.global=e,this.pickItemInterceptorContributions=i,this.global.hooks.onSetEnv.tap("math-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(e,i){this.pickContext=new t.EmptyContext2d(null,1)}pickItem(t,e,i){if(!1===t.attribute.pickable)return null;const n=this.pickerMap.get(t.numberType);return n&&n.contains(t,e,i)?t:null}},dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],t.DefaultMathPickerService.prototype,"init",null),t.DefaultMathPickerService=dp([rp(),pp(0,op(gp)),pp(0,sp(i_)),pp(1,op(wp)),pp(2,op(gp)),pp(2,sp(vA)),fp("design:paramtypes",[Object,Object,Object])],t.DefaultMathPickerService);var s_=new Qd((e=>{e(t.DefaultCanvasPickerService).toSelf().inSingletonScope(),e(t.DefaultMathPickerService).toSelf().inSingletonScope(),e(wA).toService(t.DefaultCanvasPickerService),e(t.DefaultGlobalPickerService).toSelf().inSingletonScope(),e(AA).toService(t.DefaultGlobalPickerService),e(bA).toSelf().inSingletonScope(),e(vA).toService(bA),mp(e,vA)})),a_=new Qd((e=>{e(t.DefaultGraphicService).toSelf().inSingletonScope(),e(Sb).toService(t.DefaultGraphicService),e(zw).toSelf().inSingletonScope(),e(Nw).toService(zw),mp(e,Nw),e(Hw).toSelf().inSingletonScope(),e(jw).toService(Hw),mp(e,jw),e(Vw).toSelf().inSingletonScope(),e(Gw).toService(Vw),mp(e,Gw),e(Yw).toSelf().inSingletonScope(),e(Xw).toService(Yw),mp(e,Xw),e(Kw).toSelf().inSingletonScope(),e(qw).toService(Kw),mp(e,qw),e(Ab).toConstantValue(_S)}));const o_=Symbol.for("AutoEnablePlugins"),h_=Symbol.for("PluginService");let c_=class{autoEnablePlugins;constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&fy.isBound(o_)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}release(...t){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};c_=dp([rp(),pp(0,op(gp)),pp(0,sp(o_)),fp("design:paramtypes",[Object])],c_);var l_=new Qd((t=>{t(c_).toSelf(),t(h_).toService(c_),mp(t,o_)}));function u_(t,e=!1){const i=document.createElement("img");if(i.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}if(i.src=t,i.complete)return Promise.resolve(i);const n=new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}));return n}t.BaseEnvContribution=class{type;supportsTouchEvents;supportsPointerEvents;supportsMouseEvents;applyStyles;supportEvent;configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){const e=fetch(t).then((t=>t.arrayBuffer()));return e.then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){const e=fetch(t).then((t=>t.blob()));return e.then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}},t.BaseEnvContribution=dp([rp()],t.BaseEnvContribution);let d_=class extends t.BaseEnvContribution{type="browser";supportEvent=!0;constructor(){super();try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){if(e){const{clientX:i,clientY:n}=t,r=e.getBoundingClientRect(),s=e.getNativeHandler?.().nativeCanvas;let a,o;return s&&(a=r.width/s.offsetWidth,o=r.height/s.offsetHeight),{x:(i-r.left)/(Op(a)?a:1),y:(n-r.top)/(Op(o)?a:1)}}return{x:t.offsetX,y:t.offsetY}}loadImage(t){return u_(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return u_(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){const e=document.createElement("canvas");t.id&&(e.id=t.id??sm.GenAutoIncrementId().toString());const i=t.dpr??window.devicePixelRatio;return t.width&&t.height&&(e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,e.width=t.width*i,e.height=t.height*i),e}createOffscreenCanvas(t){const e=t.dpr??window.devicePixelRatio;return new OffscreenCanvas(t.width*e,t.height*e)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(...t){}};function p_(){fy.rebind(wA).toService(t.DefaultMathPickerService)}function f_(){fy.rebind(wA).toService(t.DefaultMathPickerService)}d_=dp([rp(),fp("design:paramtypes",[])],d_);let g_=class extends t.BaseEnvContribution{type="feishu";supportEvent=!0;canvasMap=new Map;freeCanvasList=[];canvasIdx=0;constructor(){super(),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r){const s=tt.getSystemInfoSync().pixelRatio;e.forEach(((e,a)=>{const o=tt.createCanvasContext(e);o.canvas={width:t.width*s,height:t.height*s};const h={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:e??"",getContext:()=>o,getBoundingClientRect:()=>({height:t.height,width:t.width})};i.set(e,h),a>=n&&r.push(h)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),p_())}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return tt.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return $m.call(t)}}getCancelAnimationFrame(){return t=>{$m.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(...t){}mapToCanvasPoint(t){return t?.type?.startsWith("mouse")?t:null}};g_=dp([rp(),fp("design:paramtypes",[])],g_);let y_=class extends t.BaseEnvContribution{type="taro";supportEvent=!0;canvasMap=new Map;freeCanvasList=[];canvasIdx=0;taro;pixelRatio;constructor(){super(),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}configure(t,e){var i,n,r,s,a,o,h;t.env===this.type&&(t.setActiveEnvContribution(this),i=e.domref,n=e.canvasIdLists,r=this.canvasMap,s=e.freeCanvasIdx,a=this.freeCanvasList,o=e.taro,h=e.pixelRatio,n.forEach(((t,e)=>{const n=o.createCanvasContext(t);n.canvas={width:i.width*h,height:i.height*h},n.createRadialGradient||(n.createRadialGradient=(...t)=>n.createCircularGradient(...t)),!n.getImageData&&o.canvasGetImageData&&(n.getImageData=(e,i,n,r)=>new Promise(((s,a)=>{try{o.canvasGetImageData({canvasId:t,x:e,y:i,width:n,height:r,success(t){s(t)}})}catch(t){a(t)}})));const c={id:t,width:i.width*h,height:i.height*h,offsetWidth:i.width,offsetHeight:i.height,getContext:()=>n,getBoundingClientRect:()=>({height:i.height,width:i.width})};return r.set(t,c),e>=s&&a.push(c),c})),this.taro=e.taro,this.pixelRatio=e.pixelRatio,f_())}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){const e=window||globalThis;if(e.DOMParser){const i=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],n=(new XMLSerializer).serializeToString(i),r=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`;return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){const i=new e.Blob([t],{type:"image/svg+xml"}),n=e.URL.createObjectURL(i);return Promise.resolve({data:n,loadState:"success"})}return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return this.pixelRatio}getRequestAnimationFrame(){return requestAnimationFrame}getCancelAnimationFrame(){return cancelAnimationFrame}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(...t){}};y_=dp([rp(),fp("design:paramtypes",[])],y_);let m_=!1;try{m_=!!lynx.createCanvasNG}catch(t){}let v_=class extends t.BaseEnvContribution{type="lynx";supportEvent=!0;canvasMap=new Map;freeCanvasList=[];canvasIdx=0;constructor(){super(),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r){const s=SystemInfo.pixelRatio;e.forEach(((e,a)=>{const o=m_?lynx.createCanvasNG(e):lynx.createCanvas(e);o.width=t.width*s,o.height=t.height*s,m_&&o.attachToCanvasView(e);const h=o.getContext("2d");h.draw=(t,e)=>{e()};const c={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:e??"",getContext:()=>h,getBoundingClientRect:()=>({height:t.height,width:t.width})};i.set(e,c),a>=n&&r.push(c)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),p_())}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}loadImage(t){const e=function(t,e=!1){if(e)return Promise.reject();const i=lynx.createImage(t),n=new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}));return n}(t,!1);return e.then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return SystemInfo.pixelRatio}getRequestAnimationFrame(){return function(t){return $m.call(t)}}getCancelAnimationFrame(){return t=>{$m.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(...t){}};v_=dp([rp(),fp("design:paramtypes",[])],v_);let b_=class extends t.BaseEnvContribution{type="node";pkg;_lastTime=0;supportEvent=!1;configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 1}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){const e=fetch(t).then((t=>t.arrayBuffer()));return e.then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return $m.call(t)}}getCancelAnimationFrame(){return t=>{$m.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(...t){}createOffscreenCanvas(t){}};b_=dp([rp()],b_);let x_=class extends t.BaseEnvContribution{type="wx";supportEvent=!0;canvasMap=new Map;freeCanvasList=[];canvasIdx=0;constructor(){super(),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),async function(t,e,i,n,r){const s=wx.getSystemInfoSync().pixelRatio;for(let t=0;t<e.length;t++){const a=e[t];await new Promise((e=>{wx.createSelectorQuery().select(`#${a}`).fields({node:!0,size:!0}).exec((o=>{const h=o[0].node,c=o[0].width,l=o[0].height;h.width=c*s,h.height=l*s,i.set(a,h),t>=n&&r.push(h),e(null)}))}))}}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList).then((()=>{p_()}))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return wx.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return $m.call(t)}}getCancelAnimationFrame(){return t=>{$m.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(...t){}mapToCanvasPoint(t){return t?.type?.startsWith("mouse")?t:null}};x_=dp([rp(),fp("design:paramtypes",[])],x_);var w_=new Qd((t=>{t(d_).toSelf().inSingletonScope(),t(xp).toService(d_),t(g_).toSelf().inSingletonScope(),t(xp).toService(g_),t(y_).toSelf().inSingletonScope(),t(xp).toService(y_),t(v_).toSelf().inSingletonScope(),t(xp).toService(v_),t(x_).toSelf().inSingletonScope(),t(xp).toService(x_),t(b_).toSelf().inSingletonScope(),t(xp).toService(b_),mp(t,xp)}));t.BaseWindowHandlerContribution=class{constructor(){this._uid=sm.GenAutoIncrementId()}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}},t.BaseWindowHandlerContribution=dp([rp(),fp("design:paramtypes",[])],t.BaseWindowHandlerContribution);let S_=class extends t.BaseWindowHandlerContribution{global;static env="browser";type="browser";canvas;observer;get container(){return this.canvas.nativeCanvas.parentElement}constructor(t){super(),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(e){const i=this.global.createCanvas({width:e.width,height:e.height});let n;if(n="string"==typeof e.container?this.global.getElementById(e.container):e.container?e.container:this.global.getRootElement(),!n)throw new Error("发生错误,containerId可能传入有误");e.offscreen?n=null:n.appendChild(i);const r={width:e.width,height:e.height,dpr:e.dpr,nativeCanvas:i,container:n,id:sm.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new t.BrowserCanvas(r)}createWindowByCanvas(e){let i;if("string"==typeof e.canvas){if(i=this.global.getElementById(e.canvas),!i)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=e.canvas;if(!i)throw new Error("发生错误,传入的canvas不正确");let n=e.width,r=e.height;if(null==n||null==r||!e.canvasControled){const t=i.getBoundingClientRect();n=t.width,r=t.height}let s=e.dpr;if(!1===e.canvasControled&&(s&&console.warn("canvasControled为false后,dpr参数将无效"),s=null),null==s){s=i.getContext("2d").pixelRatio??i.width/n}this.canvas=new t.BrowserCanvas({width:n,height:r,dpr:s,nativeCanvas:i,canvasControled:e.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){return this.canvas.nativeCanvas.style}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};S_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],S_);let A_=class extends t.BrowserContext2d{static env="feishu";_globalAlpha;get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}getImageData(t,e,i,n){return new Promise(((r,s)=>{try{tt.canvasGetImageData({canvasId:this.canvas.nativeCanvas.id??this.canvas.id,x:t,y:e,width:i,height:n,success(t){r(t)}})}catch(t){s(t)}}))}draw(){const t=this.nativeContext;this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))}))}createPattern(t,e){return null}};A_=dp([rp()],A_);const __={WIDTH:500,HEIGHT:500,DPR:1};let C_=class{static env="feishu";_displayWidth;_displayHeight;_id;_pixelWidth;_pixelHeight;_x;_y;_dpr;_container;_nativeCanvas;_context;_visiable;get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t}constructor(t){const{nativeCanvas:e,width:i=__.WIDTH,height:n=__.HEIGHT,dpr:r=__.DPR}=t,{x:s,y:a}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=a,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new A_(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};C_=dp([rp(),fp("design:paramtypes",[Object])],C_);let T_=class extends t.BaseWindowHandlerContribution{global;static env="feishu";type="feishu";eventManager=new class{addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}cache={}};canvas;get container(){return null}constructor(t){super(),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:sm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new C_(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new C_({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};T_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],T_);let B_=class extends t.BrowserContext2d{static env="taro";get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}draw(){this.nativeContext.draw()}strokeText(t,e,i){}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:a=r.fillOpacity,opacity:o=r.opacity,fill:h=r.fill}=e;a>1e-12&&o>1e-12&&(s.setGlobalAlpha(a*o),s.setFillStyle(hA(this,h,t,i,n)))}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(a>1e-12&&o>1e-12){const{lineWidth:h=r.lineWidth,stroke:c=r.stroke,lineJoin:l=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.setGlobalAlpha(a*o),s.setLineWidth(oA(this,h,this.dpr)),s.setStrokeStyle(hA(this,c,t,i,n)),s.setLineJoin(l),s.setLineDash(u),s.setLineCap(d),s.setMiterLimit(p)}}setTextStyleWithoutAlignBaseline(t,e){const i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=hx(t,e),i.setFontSize(t.fontSize??e.fontSize)}setTextStyle(t,e){const i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=hx(t,e),i.setTextAlign(t.textAlign??e.textAlign),i.setTextBaseline(t.textBaseline??e.textBaseline)}createConicGradient(t,e,i,n){return null}createPattern(t,e){return null}};B_=dp([rp()],B_);const P_={WIDTH:500,HEIGHT:500,DPR:1};let E_=class{static env="taro";_displayWidth;_displayHeight;_id;_pixelWidth;_pixelHeight;_x;_y;_dpr;_nativeCanvas;_context;_visiable;get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t}constructor(t){const{nativeCanvas:e,width:i=P_.WIDTH,height:n=P_.HEIGHT,dpr:r=P_.DPR}=t,{x:s,y:a}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=a,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new B_(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};E_=dp([rp(),fp("design:paramtypes",[Object])],E_);let M_=class extends t.BaseWindowHandlerContribution{global;static env="taro";type="taro";eventManager=new class{addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}cache={}};canvas;get container(){return null}constructor(t){super(),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:sm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new E_(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new E_({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches.length>0&&(t.changedTouches.forEach(((e,i)=>{t.changedTouches[i]={...t.changedTouches[i],offsetX:e.x,offsetY:e.y}})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach(((e,i)=>{t.touches[i]={...t.touches[i],offsetX:e.x,offsetY:e.y}})),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};M_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],M_);let R_=class extends t.BrowserContext2d{static env="lynx";get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;i.setLineDash(t)}}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(a>1e-12&&o>1e-12){const{lineWidth:h=r.lineWidth,stroke:c=r.stroke,lineJoin:l=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=a*o,s.lineWidth=oA(this,h,this.dpr),s.strokeStyle=hA(this,c,t,i,n),s.lineJoin=l,0===u[0]&&0===u[1]||s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}createPattern(t,e){return null}draw(){const t=this.nativeContext;this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))}))}};R_=dp([rp()],R_);const k_={WIDTH:500,HEIGHT:500,DPR:1};let D_=class{static env="lynx";_displayWidth;_displayHeight;_id;_pixelWidth;_pixelHeight;_x;_y;_dpr;_container;_nativeCanvas;_context;_visiable;get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t}constructor(t){const{nativeCanvas:e,width:i=k_.WIDTH,height:n=k_.HEIGHT,dpr:r=k_.DPR}=t,{x:s,y:a}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=a,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new R_(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};D_=dp([rp(),fp("design:paramtypes",[Object])],D_);let I_=class extends t.BaseWindowHandlerContribution{global;static env="lynx";type="lynx";eventManager=new class{addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}cache={}};canvas;get container(){return null}constructor(t){super(),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:sm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new D_(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new D_({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};I_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],I_),new _f(1,0,0,1,0,0);let O_=class extends t.BrowserContext2d{static env="node";constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new _f(1,0,0,1,0,0),this.stack=[],this.dpr=e??1}release(...t){}};O_=dp([rp(),fp("design:paramtypes",[Object,Number])],O_);const L_={WIDTH:500,HEIGHT:500,DPR:1};let U_=class{static env="node";_id;_displayWidth;_displayHeight;_pixelWidth;_pixelHeight;_nativeCanvas;_context;_visiable;controled;_dpr;get id(){return this._id}get x(){return 0}set x(t){}get y(){return 0}set y(t){}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this.width,this.height)}constructor(t){const{nativeCanvas:e,width:i=L_.WIDTH,height:n=L_.HEIGHT,canvasControled:r=!0,dpr:s=L_.DPR}=t;this._visiable=!1!==t.visiable,this.controled=r,this._pixelWidth=i*s,this._pixelHeight=n*s,this._displayWidth=i,this._displayHeight=n,this._nativeCanvas=e,this._context=new O_(this,t.dpr),this._id=e.id,this._dpr=s}applyPosition(){}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}hide(){}show(){}resize(t,e){this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas&&(this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight)}toDataURL(t,e){return""}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this._nativeCanvas.release&&Bp(this._nativeCanvas.release)&&this._nativeCanvas.release()}};U_=dp([rp(),fp("design:paramtypes",[Object])],U_);let W_=class extends t.BaseWindowHandlerContribution{global;static env="node";type="node";canvas;get container(){return null}constructor(t){super(),this.global=t}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:sm.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new U_(i)}createWindowByCanvas(t){const e=t.canvas;let i=t.width,n=t.height;null!=i&&null!=n&&t.canvasControled||(i=e.width,n=e.height),this.canvas=new U_({width:i,height:n,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(t="image/png"){return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t,e){}};W_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],W_);let F_=class extends t.BrowserContext2d{static env="wx";draw(){}createPattern(t,e){return null}};F_=dp([rp()],F_);const N_={WIDTH:500,HEIGHT:500,DPR:1};let z_=class{static env="wx";_displayWidth;_displayHeight;_id;_pixelWidth;_pixelHeight;_x;_y;_dpr;_container;_nativeCanvas;_context;_visiable;get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t}constructor(t){const{nativeCanvas:e,width:i=N_.WIDTH,height:n=N_.HEIGHT,dpr:r=N_.DPR}=t,{x:s,y:a}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=a,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new F_(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};z_=dp([rp(),fp("design:paramtypes",[Object])],z_);class j_{addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}cache={}}let H_=class extends t.BaseWindowHandlerContribution{global;static env="wx";type="wx";eventManager=new j_;canvas;get container(){return null}constructor(t){super(),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:sm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new z_(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new z_({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x??t.changedTouches[0].pageX,t.changedTouches[0].clientX=t.changedTouches[0].x??t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y??t.changedTouches[0].pageY,t.changedTouches[0].clientY=t.changedTouches[0].y??t.changedTouches[0].pageY),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};H_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],H_);var G_=new Qd((t=>{t(S_).toSelf(),t(Eb).toDynamicValue((t=>t.container.get(S_))).whenTargetNamed(S_.env),t(T_).toSelf(),t(Eb).toDynamicValue((t=>t.container.get(T_))).whenTargetNamed(T_.env),t(M_).toSelf(),t(Eb).toDynamicValue((t=>t.container.get(M_))).whenTargetNamed(M_.env),t(I_).toSelf(),t(Eb).toDynamicValue((t=>t.container.get(I_))).whenTargetNamed(I_.env),t(H_).toSelf(),t(Eb).toDynamicValue((t=>t.container.get(H_))).whenTargetNamed(H_.env),t(W_).toSelf(),t(Eb).toDynamicValue((t=>t.container.get(W_))).whenTargetNamed(W_.env)})),V_=new Qd((t=>{t(py).toSelf().inSingletonScope(),t(dy).toService(py),mp(t,dy)}));let X_=class{global;layer;canvas;context;offscreen;main;window;constructor(t){this.global=t,this.offscreen=!1}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,t=i.canvasId?this.global.getElementById(i.canvasId):this.global.createCanvas({width:e.width,height:e.height}),t.style&&(t.style["pointer-events"]="none");const n=e.getContext().getCanvas().nativeCanvas,r=vy({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,canvasControled:!0,container:e.getContainer(),x:n.offsetLeft,y:n.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,{context:this.context,clear:e.background??"#ffffff",...e,...i})}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){const n=t.getContext();i.renderService.render(e,{context:n,...i,clear:i.clear?i.background??"#fff":void 0})}getContext(){return this.context}release(){this.canvas.release()}};X_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],X_);let Y_=class{global;layer;canvas;context;offscreen;constructor(t){this.global=t,this.offscreen=!0}init(t,e,i){this.layer=t;const n=vy({nativeCanvas:this.global.createOffscreenCanvas({width:i.width,height:i.height,dpr:e.dpr}),width:i.width,height:i.height,dpr:e.dpr,canvasControled:!0});this.canvas=n,this.context=n.getContext()}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){this.canvas.resize(t,e)}render(t,e){e.renderService.render(t,{context:this.context,...e,x:0,y:0,clear:e.background??"#ffffff"})}prepare(t,e){}release(){this.canvas.release()}getContext(){return this.context}drawTo(t,e,i){const n=t.getContext(),r=t.dpr,{x:s=0,y:a=0,width:o=this.layer.viewWidth,height:h=this.layer.viewHeight}=i;n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(s,a,o,h),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,a,o,h),n.nativeContext.restore()}merge(t){}};Y_=dp([rp(),pp(0,op(wp)),fp("design:paramtypes",[Object])],Y_);var q_=new Qd((t=>{t(X_).toSelf(),t(Y_).toSelf(),t(Tb).toService(X_)}));const K_=Symbol.for("DrawItemInterceptor"),$_=new df;let Z_=class{order=1;afterDrawItem(t,e,i,n,r){if(!t.shadowRoot)return!1;const{context:s}=i;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){$_.copy(n.dirtyBounds);const e=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(e)}return n.renderGroup(t.shadowRoot,i),s.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&n.dirtyBounds.copy($_),!0}};Z_=dp([rp()],Z_);let J_=class{order=1;beforeDrawItem(t,e,i,n,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:s,stage:a}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=a.camera;const o=s.currentMatrix;o.a/=s.dpr,o.b/=s.dpr,o.c/=s.dpr,o.d/=s.dpr,o.e/=s.dpr,o.f/=s.dpr;const h=Jw.allocate();iS(h,o);const c=s.modelMatrix;if(c){if(h){const t=Jw.allocate();s.modelMatrix=nS(t,c,h)}}else s.modelMatrix=h;if(s.setTransform(1,0,0,1,0,0,!0),t.isContainer){let e=!1,r=!1;if(t.forEachChildren((t=>(e=t.numberType===ob,!e))),t.forEachChildren((t=>(r=!!t.findFace,!r))),e){const e=t.getChildren(),r=[...e];r.sort(((t,e)=>{let i=((t.attribute.startAngle??0)+(t.attribute.endAngle??0))/2,n=((e.attribute.startAngle??0)+(e.attribute.endAngle??0))/2;for(;i<0;)i+=qp;for(;n<0;)n+=qp;return n-i})),r.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),r.forEach((e=>{t.appendChild(e)})),i.hack_pieFace="outside",n.renderGroup(t,i),i.hack_pieFace="inside",n.renderGroup(t,i),i.hack_pieFace="top",n.renderGroup(t,i),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),e.forEach((e=>{t.appendChild(e)}))}else if(r){const e=t.getChildren(),r=e.map((t=>({ave_z:t.findFace().vertices.map((e=>s.view(e[0],e[1],e[2]+t.attribute.z??0)[2])).reduce(((t,e)=>t+e),0),g:t})));r.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),r.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),r.forEach((e=>{t.add(e.g)})),n.renderGroup(t,i,!0),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),t.update(),e.forEach((e=>{t.add(e)}))}else n.renderGroup(t,i)}else n.renderItem(t,i);return s.camera=null,s.restore(),s.modelMatrix!==c&&Jw.free(s.modelMatrix),s.modelMatrix=c,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}};J_=dp([rp()],J_);let Q_=class{contributions;renderSelector;layerService;drawItemInterceptorContributions;constructor(t,e,i,n){this.contributions=t,this.renderSelector=e,this.layerService=i,this.drawItemInterceptorContributions=n,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new uf,this.backupDirtyBounds=new uf}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}draw(t,e){e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:n,x:r=0,y:s=0,width:a,height:o}=e;if(!i)return;const h=this.dirtyBounds.setValue(0,0,a,o);if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=(c=h,l=n.dirtyBounds,u=!1,null===c?l:null===l?c:(gf=c.x1,yf=c.x2,mf=c.y1,vf=c.y2,bf=l.x1,xf=l.x2,wf=l.y1,Sf=l.y2,u&&(gf>yf&&(gf=(d=[yf,gf])[0],yf=d[1]),mf>vf&&(mf=(p=[vf,mf])[0],vf=p[1]),bf>xf&&(bf=(f=[xf,bf])[0],xf=f[1]),wf>Sf&&(wf=(g=[Sf,wf])[0],Sf=g[1])),gf>=xf||yf<=bf||mf>=Sf||vf<=wf?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(gf,bf),y1:Math.max(mf,wf),x2:Math.min(yf,xf),y2:Math.min(vf,Sf)}));h.x1=Math.floor(t.x1),h.y1=Math.floor(t.y1),h.x2=Math.ceil(t.x2),h.y2=Math.ceil(t.y2)}var c,l,u,d,p,f,g;this.backupDirtyBounds.copy(h),i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0);const y=h.width()*i.dpr!==i.canvas.width||h.height()*i.dpr!==i.canvas.height;i.save(),i.translate(r,s,!0),y&&(i.beginPath(),i.rect(h.x1,h.y1,h.width(),h.height()),i.clip()),n.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>(t.attribute.zIndex??Kg.zIndex)-(e.attribute.zIndex??Kg.zIndex))).forEach((t=>{this.renderGroup(t,e)})),i.restore(),i.restore(),i.draw(),i.inuse=!1}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=mA(e,i,Kg.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(!Bf(t.AABBBounds,this.dirtyBounds,!1))return;const n=this.dirtyBounds.clone(),r=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r),this.renderItem(t,e,{drawingCb:()=>{i?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))})):gA(t,Kg.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))}),!1,!!e.context?.camera)}}),this.dirtyBounds.copy(n)}_increaseRender(t,e){const{layer:i,stage:n}=e,{subLayers:r}=i;let s=r.get(t._uid);s||(s={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,s));const a=s.layer.getNativeHandler().getContext(),o=s.drawContribution||fy.get(zS);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,{...e,drawContribution:o,clear:"transparent",layer:s.layer,context:a,startAtId:t._uid,break:!1}),s.drawContribution=o;const h=this._findNextGraphic(t);if(h)if(h.isContainer&&h.incremental)this._increaseRender(h,e);else{let t=r.get(h._uid);t||(t={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(h._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,{...e,drawContribution:o,clear:"transparent",layer:t.layer,context:i,startAtId:h._uid,break:!1})}}getRenderContribution(t){let e=this.renderSelector.selector(t);return e||(e=this.selectRenderByNumberType(t.numberType)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,i))return}const n=this.getRenderContribution(t);if(!n)return;if(!t.isContainer&&!Bf(t.AABBBounds,this.dirtyBounds,!1))return;const r=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=r),r?t.isContainer&&n.draw(t,this.currentRenderService,e,i):n.draw(t,this.currentRenderService,e,i),this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const n=this.InterceptorContributions[i];if(n.afterDrawItem&&n.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return console.warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t){return this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){const{clear:n}=i;if(n){const t=e.getCanvas(),{width:r=t.width,height:s=t.height}=i,a=0,o=0;e.clearRect(a,o,r,s),e.fillStyle=hA(e,n,{AABBBounds:{x1:a,y1:o,x2:a+r,y2:o+s}},0,0),e.fillRect(a,o,r,s)}}};dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],Q_.prototype,"init",null),Q_=dp([rp(),pp(0,hp(XS)),pp(1,op(sA)),pp(2,op(kb)),pp(3,op(gp)),pp(3,sp(K_)),fp("design:paramtypes",[Array,Object,Object,Object])],Q_);let tC=class{selector(t){return null}};tC=dp([rp()],tC);let eC=class{groupRenderContribitions;type;numberType=ub;_groupRenderContribitions;constructor(t){this.groupRenderContribitions=t}drawShape(e,i,n,r,s,a,o,h){const c=nm(e,a?.theme).group,{fill:l=c.fill,background:u,stroke:d=c.stroke,opacity:p=c.opacity,width:f=c.width,height:g=c.height,clip:y=c.clip,fillOpacity:m=c.fillOpacity,strokeOpacity:v=c.strokeOpacity,cornerRadius:b=c.cornerRadius,path:x=c.path,lineWidth:w=c.lineWidth,visible:S=c.visible}=e.attribute,A=Ub(p,m,f,g,l),_=Fb(p,v,f,g),C=Ib(l,u),T=Ob(d,w);if(!e.valid||!S)return;if(!y){if(!C&&!T)return;if(!(A||_||o||h||u))return}if(x&&x.length&&s.drawContribution){const t=i.disableFill,e=i.disableStroke,n=i.disableBeginPath;i.disableFill=!0,i.disableStroke=!0,i.disableBeginPath=!0,x.forEach((t=>{s.drawContribution.getRenderContribution(t).draw(t,s.renderService,s,a)})),i.disableFill=t,i.disableStroke=e,i.disableBeginPath=n}else 0===b||Dp(b)&&b.every((t=>0===t))?(i.beginPath(),i.rect(n,r,f,g)):(i.beginPath(),LS(i,n,r,f,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[]);const B={doFill:C,doStroke:T};this._groupRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h,B)})),y&&i.clip(),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),B.doFill&&(o?o(i,e.attribute,c):A&&(i.setCommonStyle(e,e.attribute,n,r,c),i.fill())),B.doStroke&&(h?h(i,e.attribute,c):_&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke())),this._groupRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,C,T,A,_,c,s,o,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s}=t.attribute;s?r.save():r.highPerformanceSave();const a=nm(t,n?.theme).group,o=r.modelMatrix;if(r.camera){const e=Jw.allocate(),i=Jw.allocate();rS(i,t,a),nS(e,o||e,i),r.modelMatrix=e,Jw.free(i),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),n.skipDraw?this.drawShape(t,r,0,0,i,n,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,i);const{scrollX:h=a.scrollX,scrollY:c=a.scrollY}=t.attribute;let l;(h||c)&&r.translate(h,c),n&&n.drawingCb&&(l=n.drawingCb()),r.modelMatrix!==o&&Jw.free(r.modelMatrix),r.modelMatrix=o,l&&l.then?l.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}};eC=dp([rp(),pp(0,op(gp)),pp(0,sp(Jb)),fp("design:paramtypes",[Object])],eC);let iC=class extends t.DefaultCanvasLineRender{numberType=pb;drawShape(t,e,i,n,r,s,a,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(e>h.length)return;const c=nm(t).line,{fill:l=c.fill,stroke:u=c.stroke,opacity:d=c.opacity,fillOpacity:p=c.fillOpacity,strokeOpacity:f=c.strokeOpacity,lineWidth:g=c.lineWidth,visible:y=c.visible}=t.attribute,m=Lb(d,p,l),v=Wb(d,f),b=Ib(l),x=Ob(u,g);if(!t.valid||!y)return;if(!b&&!x)return;if(!(m||v||a||o))return;const{context:w}=r;for(let r=e;r<e+s;r++)this.drawIncreaseSegment(t,w,h[r-1],h[r],t.attribute.segments[r],[c,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,a,o)}drawIncreaseSegment(t,e,i,n,r,s,a,o){n&&(e.beginPath(),PS(e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setStrokeStyle(t,r,a,o,s),e.stroke())}};iC=dp([rp()],iC);let nC=class extends t.DefaultCanvasAreaRender{numberType=hb;drawShape(t,e,i,n,r,s,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:o}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(s>h.length)return;const c=nm(t).area,{fill:l=c.fill,fillOpacity:u=c.fillOpacity,opacity:d=c.opacity,visible:p=c.visible}=t.attribute,f=Lb(d,u,l),g=Ib(l);if(!t.valid||!p)return;if(!g)return;if(!f&&!a)return;for(let r=s;r<s+o;r++)this.drawIncreaseSegment(t,e,h[r-1],h[r],t.attribute.segments[r],[c,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,a)}drawIncreaseSegment(t,e,i,n,r,s,a,o){n&&(e.beginPath(),ES(e.camera?e:e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setCommonStyle(t,r,a,o,s),e.fill())}};var rC;nC=dp([rp()],nC),function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(rC||(rC={}));let sC=class extends Q_{contributions;renderSelector;lineRender;areaRender;layerService;drawItemInterceptorContributions;rendering=!1;currFrameStartAt=0;currentIdx=0;status=rC.NORMAL;checkingForDrawPromise=null;hooks={completeDraw:new bp([])};lastRenderService;lastDrawContext;count;global;constructor(t,e,i,n,r,s){super(t,e,r,s),this.contributions=t,this.renderSelector=e,this.lineRender=i,this.areaRender=n,this.layerService=r,this.drawItemInterceptorContributions=s}init(){super.init(),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}async draw(t,e){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=await this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:n,x:r=0,y:s=0}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(r,s,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>(t.attribute.zIndex??Kg.zIndex)-(e.attribute.zIndex??Kg.zIndex))).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{n.restore(),n.restore(),n.draw(),n.inuse=!1,this.rendering=!1})))}async _increaseRender(t,e){this.rendering=!0,await this._renderIncrementalGroup(t,e)}async _renderIncrementalGroup(t,e){this.count=t.count,await new Promise((i=>{this.renderItem(t,e,{drawingCb:async()=>{if(2!==t.count)await yA(t,Kg.zIndex,((i,n)=>{if(this.status===rC.STOP)return!0;if(i.isContainer)return!1;if(n<this.currentIdx)return!1;const r=this.currFrameStartAt+t.incremental;return n<r&&(this.currentIdx=n+1,this.renderItem(i,e)),n===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),i(!1);else{const n=t.getChildAt(0);if(n.incremental&&n.attribute.segments)for(n.incrementalAt||(n.incrementalAt=0);n.incrementalAt<n.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:n.incrementalAt,length:n.incremental},this.renderItem(n,e),n.incrementalAt+=n.incremental,await this.waitToNextFrame();else this.renderItem(n,e);i(!1)}}})})),this.hooks.completeDraw.call()}async waitToNextFrame(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}async checkForDraw(t){let e=this.rendering;return t.restartIncremental&&(e=!1,await this.forceStop(),this.resetToInit()),e}async forceStop(){this.rendering&&(this.status=rC.STOP,await new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=rC.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}async renderGroup(t,e){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(await this._increaseRender(t,e),void(e.break=!0)):void await new Promise((i=>{this.renderItem(t,e,{drawingCb:async()=>{await yA(t,Kg.zIndex,(async t=>{e.break||t.isContainer&&await this.renderGroup(t,e)})),i(!1)}})}))}};dp([op(wp),fp("design:type",Object)],sC.prototype,"global",void 0),sC=dp([rp(),pp(0,hp(XS)),pp(1,op(sA)),pp(2,op(iC)),pp(3,op(nC)),pp(4,op(kb)),pp(5,op(gp)),pp(5,sp(K_)),fp("design:paramtypes",[Array,Object,Object,Object,Object,Object])],sC);let aC=class extends t.BaseRender{type="rect3d";numberType=vb;drawShape(t,e,i,n,r,s,a,o){const h=nm(t,s?.theme).rect3d,{fill:c=h.fill,stroke:l=h.stroke,width:u=h.width,height:d=h.height,opacity:p=h.opacity,fillOpacity:f=h.fillOpacity,lineWidth:g=h.lineWidth,strokeOpacity:y=h.strokeOpacity,visible:m=h.visible}=t.attribute,v=this.z??0,b=Ub(p,f,u,d,c),x=Fb(p,y,u,d),w=Ib(c),S=Ob(l,g);if(!t.valid||!m)return;if(!w&&!S)return;if(!(b||x||a||o))return;const{light:A,camera:_}=r.stage||{},C=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,v,C,r,e,A,a)}!1!==l&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,v,C,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const a=s[n[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},h=s[n[1]],c={x:t+h[0],y:e+h[1],z:i+h[2]};r.beginPath(),r.moveTo(o.x,o.y,o.z),r.lineTo(c.x,c.y,c.z),r.stroke()}))}fill(t,e,i,n,r,s,a,o){const h=Ev.get(r).value,c=n.vertices,l=c.map((t=>s.view(t[0],t[1],t[2])[2])),u=[];n.polygons.forEach(((t,e)=>{u.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=l[i[0]],s=l[i[1]],a=l[i[2]],o=l[i[3]];t.ave_z=r+s+a+o})),u.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),u.forEach((n=>{const{polygon:l,normal:u}=n.polygon,d=c[l[0]],p=c[l[1]],f=c[l[2]],g=c[l[3]],y={x:t+d[0],y:e+d[1],z:i+d[2]},m={x:t+p[0],y:e+p[1],z:i+p[2]},v={x:t+f[0],y:e+f[1],z:i+f[2]},b={x:t+g[0],y:e+g[1],z:i+g[2]};s.beginPath(),s.moveTo(y.x,y.y,y.z),s.lineTo(m.x,m.y,m.z),s.lineTo(v.x,v.y,v.z),s.lineTo(b.x,b.y,b.z),s.closePath(),o?o(s,null,null):(s.fillStyle=a?a.computeColor(u,h):r,s.fill())}))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=nm(t).rect,s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;this.z=h,this.drawShape(t,n,a,o,i),this.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore()}};aC=dp([rp()],aC);let oC=class{type;numberType=bb;drawShape(t,e,i,n,r){const s=nm(t).richtext,{width:a=s.width,height:o=s.height,opacity:h=s.opacity,fillOpacity:c=s.fillOpacity,visible:l=s.visible}=t.attribute;if(!t.valid||!l)return;if(!Lb(h,c,!0))return;e.translate(i,n);t.getFrameCache().draw(e,this.drawIcon)}drawIcon(t,e,i,n,r){const s=nm(t).richtextIcon,{width:a=s.width,height:o=s.height,opacity:h=s.opacity,image:c,backgroundFill:l=s.backgroundFill,backgroundFillOpacity:u=s.backgroundFillOpacity,backgroundStroke:d=s.backgroundStroke,backgroundStrokeOpacity:p=s.backgroundStrokeOpacity,backgroundRadius:f=s.backgroundRadius,margin:g}=t.attribute,{backgroundWidth:y=a,backgroundHeight:m=o}=t.attribute;if(g&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(y-a)/2,r=(m-o)/2;0===f?(e.beginPath(),e.rect(i-t,n-r,y,m)):(e.beginPath(),LS(e,i-t,n-r,y,m,f)),l&&(e.globalAlpha=u,e.fillStyle=l,e.fill()),d&&(e.globalAlpha=p,e.strokeStyle=d,e.stroke())}const v=c&&t?.resources?.get(c);v&&"success"===v.state&&(e.globalAlpha=h,e.drawImage(v.data,i,n,a,o))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=nm(t).richtext;let{x:s=r.x,y:a=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,n,s,a,i),n.highPerformanceRestore()}};oC=dp([rp()],oC);let hC=class{type;numberType=lb;drawShape(t,e,i,n,r,s,a,o){r.drawContribution&&t.getSubGraphic().forEach((t=>{const h=r.drawContribution.getRenderContribution(t);h&&h.drawShape&&h.drawShape(t,e,i,n,r,s,a,o)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;if(r.highPerformanceSave(),!i.drawContribution)return;const s=nm(t),a=t.getSubGraphic();a.length&&a.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:s})})),r.highPerformanceRestore()}};hC=dp([rp()],hC);let cC=class extends t.BaseRender{type;numberType=ob;drawShape(t,e,i,n,r,s,a,o){const h=nm(t,s?.theme).arc,{fill:c=h.fill,background:l,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,lineWidth:f=h.lineWidth,strokeOpacity:g=h.strokeOpacity,visible:y=h.visible}=t.attribute,m=Lb(d,p,c),v=Wb(d,g),b=Ib(c,l),x=Ob(u,f),w=this.z??0;if(!t.valid||!y)return;if(!b&&!x)return;if(!(m||v||a||o||l))return;const{outerRadius:S=h.outerRadius,innerRadius:A=h.innerRadius,height:_=10}=t.attribute,C=Ev.get(c).value,{light:T}=r.stage||{},B=r.hack_pieFace,P={top:w,bottom:w+_},E={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===B||"top"===B?(e.beginPath(),function(t,e,i,n,r,s,a){const{startAngle:o,endAngle:h}=t.getParsedAngle(),c=Kp(h-o),l=h>o;let u=!1;if(s<a){const t=s;s=a,a=t}if(s<=Gp)e.moveTo(i,n,r);else if(c>=qp-Gp)e.moveTo(i+s*Zp(o),n+s*tf(o),r),e.arc(i,n,s,o,h,!l,r),a>Gp&&(e.moveTo(i+a*Zp(h),n+a*tf(h),r),e.arc(i,n,a,h,o,l,r));else{const{outerDeltaAngle:c,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:f,innerEndAngle:g,innerStartAngle:y}=t.getParsePadAngle(o,h),m=s*Zp(p),v=s*tf(p),b=a*Zp(g),x=a*tf(g);c<.001?u=!0:(e.moveTo(i+m,n+v,r),e.arc(i,n,s,p,f,!l,r)),!(a>Gp)||d<.001?(e.lineTo(i+b,n+x,r),u=!0):(e.lineTo(i+b,n+x,r),e.arc(i,n,a,g,y,l,r))}e.closePath()}(t,e,i,n,P[B],S,A),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),b&&(a?a(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=T?T.computeColor(E[B],C):c,e.fill())),x&&(o?o(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke()))):"outside"!==B&&"inside"!==B||("inside"===B&&(e.save(),e.beginPath(),e.arc(i,n,A,0,qp,!0,P.top),e.clip()),e.beginPath(),function(t,e,i,n,r,s,a,o){const{startAngle:h,endAngle:c}=t.getParsedAngle(),l=Kp(c-h),u=c>h;let d=!1;if(a<=Gp)e.moveTo(i,n,r);else if(l>=qp-Gp)e.moveTo(i+a*Zp(h),n+a*tf(h),r),e.arc(i,n,a,h,c,!u,r),e.lineTo(i+a*Zp(c),n+a*tf(c),s),e.arc(i,n,a,c,h,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:l,innerouterEndAngle:p}=o(h,c),f=a*Zp(l),g=a*tf(l),y=a*Zp(p),m=a*tf(p);t<.001?d=!0:(e.moveTo(i+f,n+g,r),e.arc(i,n,a,l,p,!u,r),e.lineTo(i+y,n+m,s),e.arc(i,n,a,p,l,u,s))}e.closePath()}(t,e,i,n,P.top,P.bottom,"outside"===B?S:A,((e,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:a,innerEndAngle:o,innerStartAngle:h}=t.getParsePadAngle(e,i);return"outside"===B?{innerouterDeltaAngle:n,innerouterEndAngle:a,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:o,innerouterStartAngle:h}})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),b&&(a?a(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=T?T.computeColor(E[B],C):c,e.fill())),x&&(o?o(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),"inside"===B&&e.restore())}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=nm(t,n?.theme).arc;r.save();const a=this.transform(t,s,r),{x:o,y:h,z:c,lastModelMatrix:l}=a;this.z=c,Nb(t,r,o,h,0,n)||(this.drawShape(t,r,o,h,i,n),this.z=0,r.modelMatrix!==l&&Jw.free(r.modelMatrix),r.modelMatrix=l),r.restore()}};cC=dp([rp()],cC);let lC=class extends t.BaseRender{type="pyramid3d";numberType=yb;drawShape(t,e,i,n,r,s,a,o){const h=nm(t,s?.theme).polygon,{fill:c=h.fill,stroke:l=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:g=h.visible,points:y,face:m=[!0,!0,!0,!0,!0,!0]}=t.attribute,v=this.z??0,b=Lb(u,d,c),x=Wb(u,f),w=Ib(c),S=Ob(l,p);if(!t.valid||!g||4!==y.length)return;if(!w&&!S)return;if(!(b||x||a||o))return;const{light:A,camera:_}=r.stage||{},C=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,v,C,m,r,e,A,_,t,h,a)}!1!==l&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,v,C,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const a=s[n[0]],o=s[n[1]],h={x:t+a[0],y:e+a[1],z:i+a[2]},c={x:t+o[0],y:e+o[1],z:i+o[2]};r.beginPath(),r.moveTo(h.x,h.y,h.z),r.lineTo(c.x,c.y,c.z),r.stroke()}))}fill(t,e,i,n,r,s,a,o,h,c,l,u){const d=Ev.get(s).value,p=n.vertices,f=p.map((t=>a.view(t[0],t[1],t[2])[2])),g=[];n.polygons.forEach(((t,e)=>{if(!r[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,s=f[i[0]],a=f[i[1]],o=f[i[2]],h=f[i[3]];t.ave_z=s+a+o+h})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((n=>{const{polygon:r,normal:h}=n.polygon,f=p[r[0]],g=p[r[1]],y=p[r[2]],m=p[r[3]],v={x:t+f[0],y:e+f[1],z:i+f[2]},b={x:t+g[0],y:e+g[1],z:i+g[2]},x={x:t+y[0],y:e+y[1],z:i+y[2]},w={x:t+m[0],y:e+m[1],z:i+m[2]};a.beginPath(),a.moveTo(v.x,v.y,v.z),a.lineTo(b.x,b.y,b.z),a.lineTo(x.x,x.y,x.z),a.lineTo(w.x,w.y,w.z),a.closePath(),u?u(a,c.attribute,l):(a.fillStyle=o?o.computeColor(h,d):s,a.fill())}))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=nm(t).polygon,s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;this.z=h,this.drawShape(t,n,a,o,i),this.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore()}};lC=dp([rp()],lC);let uC=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke};uC=dp([rp()],uC);let dC=class extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke};dC=dp([rp()],dC);let pC=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke};pC=dp([rp()],pC);let fC=class extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke};fC=dp([rp()],fC);let gC=class extends t.DefaultBaseBackgroundRenderContribution{time=t.BaseRenderContributionTime.beforeFillStroke};gC=dp([rp()],gC);let yC=class extends t.DefaultBaseTextureRenderContribution{time=t.BaseRenderContributionTime.afterFillStroke;drawShape(t,e,i,n,r,s,a,o,h,c,l,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{attribute:p=t.attribute}=d||{},{texture:f=t.attribute.texture??qm(h,"texture"),textureColor:g=t.attribute.textureColor??qm(h,"textureColor"),textureSize:y=t.attribute.textureSize??qm(h,"textureSize"),texturePadding:m=t.attribute.texturePadding??qm(h,"texturePadding")}=p;if(!f)return;let v=this.textureMap.get(f);if(!v)switch(f){case"circle":v=this.createCirclePattern(y,m,g,e);break;case"diamond":v=this.createDiamondPattern(y,m,g,e);break;case"rect":v=this.createRectPattern(y,m,g,e);break;case"vertical-line":v=this.createVerticalLinePattern(y,m,g,e);break;case"horizontal-line":v=this.createHorizontalLinePattern(y,m,g,e);break;case"bias-lr":v=this.createBiasLRLinePattern(y,m,g,e);break;case"bias-rl":v=this.createBiasRLLinePattern(y,m,g,e);break;case"grid":v=this.createGridPattern(y,m,g,e)}v&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=v,e.fill(),e.highPerformanceRestore())}};yC=dp([rp()],yC);var mC=new Qd((e=>{e(Q_).toSelf(),e(aA).toService(Q_),e(sC).toSelf(),e(zS).toService(sC),e(tC).toSelf(),e(sA).toService(tC),e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(VS).to(t.DefaultCanvasCircleRender),e(XS).to(t.DefaultCanvasCircleRender),e(t.DefaultCircleRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleTextureRenderContribution).toSelf().inSingletonScope(),e(Zb).toService(t.DefaultCircleRenderContribution),e(Zb).toService(t.DefaultCircleBackgroundRenderContribution),e(Zb).toService(t.DefaultCircleTextureRenderContribution),mp(e,Zb),e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(ZS).to(t.DefaultCanvasRectRender),e(XS).to(t.DefaultCanvasRectRender),e(aC).toSelf().inSingletonScope(),e(JS).toService(aC),e(XS).toService(JS),e(t.DefaultRectRenderContribution).toSelf().inSingletonScope(),e(t.DefaultRectBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultRectTextureRenderContribution).toSelf().inSingletonScope(),e(t.SplitRectBeforeRenderContribution).toSelf().inSingletonScope(),e(t.SplitRectAfterRenderContribution).toSelf().inSingletonScope(),e(ix).toService(t.DefaultRectRenderContribution),e(ix).toService(t.DefaultRectBackgroundRenderContribution),e(ix).toService(t.DefaultRectTextureRenderContribution),e(ix).toService(t.SplitRectBeforeRenderContribution),e(ix).toService(t.SplitRectAfterRenderContribution),mp(e,ix),e(t.DefaultCanvasTextRender).toSelf().inSingletonScope(),e(tA).to(t.DefaultCanvasTextRender),e(XS).to(t.DefaultCanvasTextRender),mp(e,rx),e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(KS).to(t.DefaultCanvasPathRender),e(XS).to(t.DefaultCanvasPathRender),e(pC).toSelf().inSingletonScope(),e(fC).toSelf().inSingletonScope(),e(tx).toService(pC),e(tx).toService(fC),mp(e,tx),e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(QS).to(t.DefaultCanvasSymbolRender),e(XS).to(t.DefaultCanvasSymbolRender),e(t.DefaultSymbolRenderContribution).toSelf().inSingletonScope(),e(lA).toSelf().inSingletonScope(),e(uA).toSelf().inSingletonScope(),e(nx).toService(t.DefaultSymbolRenderContribution),e(nx).toService(lA),e(nx).toService(uA),mp(e,nx),e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(jS).to(t.DefaultCanvasArcRender),e(XS).to(t.DefaultCanvasArcRender),e(cC).toSelf().inSingletonScope(),e(HS).toService(cC),e(XS).toService(HS),e(t.DefaultArcRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcTextureRenderContribution).toSelf().inSingletonScope(),e(Kb).toService(t.DefaultArcRenderContribution),e(Kb).toService(t.DefaultArcBackgroundRenderContribution),e(Kb).toService(t.DefaultArcTextureRenderContribution),mp(e,Kb),e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(qS).to(t.DefaultCanvasLineRender),e(XS).to(t.DefaultCanvasLineRender),e(iC).toSelf().inSingletonScope(),e(nC).toSelf().inSingletonScope(),e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(GS).to(t.DefaultCanvasAreaRender),e(XS).to(t.DefaultCanvasAreaRender),e(gC).toSelf().inSingletonScope(),e(yC).toSelf().inSingletonScope(),e($b).toService(gC),e($b).toService(yC),mp(e,$b),e(eC).toSelf().inSingletonScope(),e(YS).to(eC),e(XS).to(eC),e(t.DefaultGroupBackgroundRenderContribution).toSelf().inSingletonScope(),e(Jb).toService(t.DefaultGroupBackgroundRenderContribution),mp(e,Jb),e(t.DefaultCanvasPolygonRender).toSelf().inSingletonScope(),e($S).to(t.DefaultCanvasPolygonRender),e(XS).to(t.DefaultCanvasPolygonRender),e(uC).toSelf().inSingletonScope(),e(dC).toSelf().inSingletonScope(),e(ex).toService(uC),e(ex).toService(dC),mp(e,ex),e(hC).toSelf().inSingletonScope(),e(nA).toService(hC),e(XS).toService(nA),e(t.DefaultCanvasImageRender).toSelf().inSingletonScope(),e(rA).toService(t.DefaultCanvasImageRender),e(XS).toService(rA),e(t.DefaultImageBackgroundRenderContribution).toSelf().inSingletonScope(),e(Qb).toService(t.DefaultImageBackgroundRenderContribution),mp(e,Qb),e(oC).toSelf().inSingletonScope(),e(eA).toService(oC),e(XS).toService(eA),e(lC).toSelf().inSingletonScope(),e(iA).toService(lC),e(XS).toService(iA),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),e(rx).toService(t.DefaultBaseInteractiveRenderContribution),e(Kb).toService(t.DefaultBaseInteractiveRenderContribution),e(tx).toService(t.DefaultBaseInteractiveRenderContribution),e(nx).toService(t.DefaultBaseInteractiveRenderContribution),e(ix).toService(t.DefaultBaseInteractiveRenderContribution),e(Qb).toService(t.DefaultBaseInteractiveRenderContribution),e(Zb).toService(t.DefaultBaseInteractiveRenderContribution),e($b).toService(t.DefaultBaseInteractiveRenderContribution),e(ex).toService(t.DefaultBaseInteractiveRenderContribution),mp(e,sx),mp(e,XS),e(Z_).toSelf().inSingletonScope(),e(K_).toService(Z_),e(J_).toSelf().inSingletonScope(),e(K_).toService(J_),mp(e,K_)}));let vC=class{canvasRenderer;type="circle";numberType=cb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).circle;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=oA(n,s,n.dpr),o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};vC=dp([rp(),pp(0,op(VS)),fp("design:paramtypes",[Object])],vC);const bC=new df;let xC=class{canvasRenderer;type="rect";numberType=mb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:a=r.x,y:o=r.y}=t.attribute;n.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);a+=e.x,o+=e.y,n.setTransformForCurrent()}else a=0,o=0,h=!1,n.transformFromMatrix(t.transMatrix,!0);let c=!0;if(!h||Ip(s,!0)&&0!==s||Dp(s)&&s.some((t=>0!==t)))c=!1,this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,i,n)=>!!c||(c=t.isPointInPath(e.x,e.y),c)),((t,i,r)=>{if(c)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=oA(n,s,n.dpr),c=t.isPointInStroke(e.x,e.y),c}));else if(c){const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)c=!0;else if(n){const i=t.AABBBounds;bC.setValue(i.x1,i.y1,i.x2,i.y2),bC.expand(-s/2),c=!bC.containsPoint(e)}}return n.highPerformanceRestore(),c}};xC=dp([rp(),pp(0,op(ZS)),fp("design:paramtypes",[Object])],xC);let wC=class{canvasRenderer;type="arc";numberType=ab;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).arc;n.highPerformanceSave();let{x:s=r.x,y:a=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=oA(n,s,n.dpr),o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};wC=dp([rp(),pp(0,op(jS)),fp("design:paramtypes",[Object])],wC);let SC=class{canvasRenderer;type="area";numberType=hb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).area;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,(t=>!!o||(o=t.isPointInPath(e.x,e.y),o))),n.highPerformanceRestore(),o}};SC=dp([rp(),pp(0,op(GS)),fp("design:paramtypes",[Object])],SC);let AC=class{type="image";numberType=db;contains(t,e,i){const{pickContext:n}=i??{};return!!n&&!!t.AABBBounds.containsPoint(e)}};AC=dp([rp()],AC);let _C=class extends t.BaseRender{};_C=dp([rp()],_C);let CC=class extends _C{canvasRenderer;type="line";numberType=pb;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;n.highPerformanceSave();const r=nm(t).line,s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;let l=e;if(n.camera){l=e.clone();const i=t.parent.globalTransMatrix;l.x=i.a*e.x+i.c*e.y+i.e,l.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,(t=>!!u||(u=t.isPointInPath(l.x,l.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=oA(n,r,n.dpr),u=t.isPointInStroke(l.x,l.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};CC=dp([rp(),pp(0,op(qS)),fp("design:paramtypes",[Object])],CC);let TC=class extends _C{canvasRenderer;type="path";numberType=fb;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).path;n.highPerformanceSave();const s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;let l=e;if(n.camera){l=e.clone();const i=t.parent.globalTransMatrix;l.x=i.a*e.x+i.c*e.y+i.e,l.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(l.x,l.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=oA(n,r,n.dpr),u=t.isPointInStroke(l.x,l.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};TC=dp([rp(),pp(0,op(KS)),fp("design:paramtypes",[Object])],TC);let BC=class extends _C{canvasRenderer;type="symbol";numberType=xb;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const r=nm(t).symbol,s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;let l=e;if(n.camera){l=e.clone();const i=t.parent.globalTransMatrix;l.x=i.a*e.x+i.c*e.y+i.e,l.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(l.x,l.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=oA(n,r,n.dpr),u=t.isPointInStroke(l.x,l.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};BC=dp([rp(),pp(0,op(QS)),fp("design:paramtypes",[Object])],BC);let PC=class extends _C{canvasRenderer;type="text";numberType=wb;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;const r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();const s=nm(t).text,{keepDirIn3d:a=s.keepDirIn3d}=t.attribute,o=!a,h=this.transform(t,s,n,o),{x:c,y:l,z:u,lastModelMatrix:d}=h;this.canvasRenderer.z=u;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let f=!1;return this.canvasRenderer.drawShape(t,n,c,l,{},null,((e,i,n)=>{if(f)return!0;const{fontSize:r=s.fontSize,textBaseline:a=s.textBaseline,textAlign:o=s.textAlign}=t.attribute,h=t.AABBBounds,d=h.height(),g=h.width(),y=lx(a,d,r),m=cx(o,g);return e.rect(m+c,y+l,g,d,u),f=e.isPointInPath(p.x,p.y),f}),((t,e,i)=>f)),this.canvasRenderer.z=0,n.modelMatrix!==d&&Jw.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),f}};PC=dp([rp(),pp(0,op(tA)),fp("design:paramtypes",[Object])],PC);let EC=class{canvasRenderer;type="polygon";numberType=gb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).polygon;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};EC=dp([rp(),pp(0,op($S)),fp("design:paramtypes",[Object])],EC),new df;let MC=class{canvasRenderer;type="richtext";numberType=bb;constructor(t){this.canvasRenderer=t}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};MC=dp([rp(),pp(0,op(eA)),fp("design:paramtypes",[Object])],MC);let RC=class{canvasRenderer;type="glyph";numberType=lb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=i?.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{n||(n=!!r.pickItem(t,e,i))})),n}return!1}};RC=dp([rp(),pp(0,op(nA)),fp("design:paramtypes",[Object])],RC),new df;let kC=class extends _C{canvasRenderer;type="rect3d";numberType=vb;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).rect;n.highPerformanceSave();const s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;let l=e;if(n.camera){l=e.clone();const i=t.parent.globalTransMatrix;l.x=i.a*e.x+i.c*e.y+i.e,l.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(l.x,l.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};kC=dp([rp(),pp(0,op(JS)),fp("design:paramtypes",[Object])],kC),new df;let DC=class extends _C{canvasRenderer;type="pyramid3d";numberType=yb;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).polygon;n.highPerformanceSave();const s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;let l=e;if(n.camera){l=e.clone();const i=t.parent.globalTransMatrix;l.x=i.a*e.x+i.c*e.y+i.e,l.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(l.x,l.y),u)),((t,e,i)=>!1)),this.canvasRenderer.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};DC=dp([rp(),pp(0,op(iA)),fp("design:paramtypes",[Object])],DC),new df;let IC=class extends _C{canvasRenderer;type="arc3d";numberType=ob;constructor(t){super(),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).arc;n.highPerformanceSave();const s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:c}=s;let l=e;if(n.camera){l=e.clone();const i=t.parent.globalTransMatrix;l.x=i.a*e.x+i.c*e.y+i.e,l.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(l.x,l.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==c&&Jw.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};IC=dp([rp(),pp(0,op(HS)),fp("design:paramtypes",[Object])],IC);var OC=new Qd(((t,e,i,n)=>{t(vC).toSelf().inSingletonScope(),t(DA).toService(vC),t(VA).toService(DA),t(xC).toSelf().inSingletonScope(),t(UA).toService(xC),t(VA).toService(UA),t(kC).toSelf().inSingletonScope(),t(WA).toService(kC),t(VA).toService(WA),t(wC).toSelf().inSingletonScope(),t(MA).toService(wC),t(VA).toService(MA),t(SC).toSelf().inSingletonScope(),t(kA).toService(SC),t(VA).toService(kA),t(AC).toSelf().inSingletonScope(),t(IA).toService(AC),t(VA).toService(IA),t(CC).toSelf().inSingletonScope(),t(OA).toService(CC),t(VA).toService(OA),t(TC).toSelf().inSingletonScope(),t(LA).toService(TC),t(VA).toService(LA),t(BC).toSelf().inSingletonScope(),t(FA).toService(BC),t(VA).toService(FA),t(PC).toSelf().inSingletonScope(),t(NA).toService(PC),t(VA).toService(NA),t(EC).toSelf().inSingletonScope(),t(zA).toService(EC),t(VA).toService(zA),t(DC).toSelf().inSingletonScope(),t(jA).toService(DC),t(VA).toService(jA),t(IC).toSelf().inSingletonScope(),t(RA).toService(IC),t(VA).toService(RA),t(MC).toSelf().inSingletonScope(),t(HA).toService(MC),t(VA).toService(HA),t(RC).toSelf().inSingletonScope(),t(GA).toService(RC),t(VA).toService(GA),mp(t,VA)}));let LC=class{canvasRenderer;type="path";numberType=fb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).path;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};LC=dp([rp(),pp(0,op(KS)),fp("design:paramtypes",[Object])],LC);let UC=class{canvasRenderer;type="circle";numberType=cb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).circle;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};UC=dp([rp(),pp(0,op(VS)),fp("design:paramtypes",[Object])],UC);const WC=new df;let FC=class{canvasRenderer;type="rect";numberType=mb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:a=r.x,y:o=r.y}=t.attribute;n.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);a+=e.x,o+=e.y,n.setTransformForCurrent()}else a=0,o=0,h=!1,n.transformFromMatrix(t.transMatrix,!0);let c=!0;if(!h||Ip(s,!0)&&0!==s||Dp(s)&&s.some((t=>0!==t)))c=!1,this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,i,n)=>!!c||(c=t.isPointInPath(e.x,e.y),c)),((t,i,r)=>{if(c)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,c=t.isPointInStroke(e.x,e.y),c}));else if(c){const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)c=!0;else if(n){const i=t.AABBBounds;WC.setValue(i.x1,i.y1,i.x2,i.y2),WC.expand(-s/2),c=!WC.containsPoint(e)}}return n.highPerformanceRestore(),c}};FC=dp([rp(),pp(0,op(ZS)),fp("design:paramtypes",[Object])],FC);let NC=class{canvasRenderer;type="arc";numberType=ab;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).arc;n.highPerformanceSave();let{x:s=r.x,y:a=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};NC=dp([rp(),pp(0,op(jS)),fp("design:paramtypes",[Object])],NC);let zC=class{canvasRenderer;type="area";numberType=hb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).area;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,(t=>!!o||(o=t.isPointInPath(e.x,e.y),o))),n.highPerformanceRestore(),o}};zC=dp([rp(),pp(0,op(GS)),fp("design:paramtypes",[Object])],zC);let jC=class{canvasRenderer;type="line";numberType=pb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).line;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,(t=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};jC=dp([rp(),pp(0,op(qS)),fp("design:paramtypes",[Object])],jC);let HC=class{canvasRenderer;type="symbol";numberType=xb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).symbol;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};HC=dp([rp(),pp(0,op(QS)),fp("design:paramtypes",[Object])],HC);let GC=class{type="text";numberType=wb;contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};GC=dp([rp()],GC);let VC=class{canvasRenderer;type="polygon";numberType=gb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=i??{};if(!n)return!1;const r=nm(t).polygon;let{x:s=r.x,y:a=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}};VC=dp([rp(),pp(0,op($S)),fp("design:paramtypes",[Object])],VC);let XC=class{canvasRenderer;type="glyph";numberType=lb;constructor(t){this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=i?.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{n||(n=!!r.pickItem(t,e,i))})),n}return!1}};XC=dp([rp(),pp(0,op(nA)),fp("design:paramtypes",[Object])],XC);var YC=new Qd((t=>{t(UC).toSelf().inSingletonScope(),t(qA).toService(UC),t(i_).toService(qA),t(FC).toSelf().inSingletonScope(),t(ZA).toService(FC),t(i_).toService(ZA),t(NC).toSelf().inSingletonScope(),t(XA).toService(NC),t(i_).toService(XA),t(zC).toSelf().inSingletonScope(),t(YA).toService(zC),t(i_).toService(YA),t(jC).toSelf().inSingletonScope(),t(KA).toService(jC),t(i_).toService(KA),t(LC).toSelf().inSingletonScope(),t($A).toService(LC),t(i_).toService($A),t(HC).toSelf().inSingletonScope(),t(JA).toService(HC),t(i_).toService(JA),t(GC).toSelf().inSingletonScope(),t(QA).toService(GC),t(i_).toService(QA),t(VC).toSelf().inSingletonScope(),t(t_).toService(VC),t(i_).toService(t_),t(XC).toSelf().inSingletonScope(),t(e_).toService(XC),t(XC).toService(e_),mp(t,i_)}));var qC=new Qd((e=>{e(yy).toDynamicValue((()=>e=>new t.BrowserCanvas(e))).whenTargetNamed(t.BrowserCanvas.env),e(my).toDynamicValue((()=>(e,i)=>new t.BrowserContext2d(e,i))).whenTargetNamed(t.BrowserContext2d.env)})),KC=new Qd((t=>{t(yy).toDynamicValue((()=>t=>new E_(t))).whenTargetNamed(E_.env),t(my).toDynamicValue((()=>(t,e)=>new B_(t,e))).whenTargetNamed(B_.env)})),$C=new Qd((t=>{t(yy).toDynamicValue((()=>t=>new C_(t))).whenTargetNamed(C_.env),t(my).toDynamicValue((()=>(t,e)=>new A_(t,e))).whenTargetNamed(A_.env)})),ZC=new Qd((t=>{t(yy).toDynamicValue((()=>t=>new D_(t))).whenTargetNamed(D_.env),t(my).toDynamicValue((()=>(t,e)=>new R_(t,e))).whenTargetNamed(R_.env)})),JC=new Qd((t=>{t(yy).toDynamicValue((()=>t=>new z_(t))).whenTargetNamed(z_.env),t(my).toDynamicValue((()=>(t,e)=>new F_(t,e))).whenTargetNamed(F_.env)})),QC=new Qd((t=>{t(yy).toDynamicValue((()=>t=>new U_(t))).whenTargetNamed(U_.env),t(my).toDynamicValue((()=>(t,e)=>new O_(t,e))).whenTargetNamed(O_.env)}));fy.load(Db),fy.load(a_),fy.load(fA),fy.load(s_),fy.load(l_),function(t){t.load(w_),t.load(G_),t.load(V_),t.load(q_)}(fy),function(t){t.load(mC)}(fy),function(t){t.load(OC),t.load(YC)}(fy),function(t){t.load(qC),t.load($C),t.load(KC),t.load(ZC),t.load(JC),t.load(QC)}(fy);const tT=fy.get(wp);gy.global=tT;const eT=fy.get(Rb);gy.graphicUtil=eT;const iT=fy.get(Mb);gy.transformUtil=iT;const nT=fy.get(Sb);gy.graphicService=nT;const rT=fy.get(AA),sT=fy.get(kb);gy.layerService=sT;class aT{name="AutoRenderPlugin";activeEvent="onRegister";pluginService;_uid=sm.GenAutoIncrementId();key=this.name+this._uid;activate(t){this.pluginService=t,gy.graphicService.hooks.onAttributeUpdate.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),gy.graphicService.hooks.onSetStage.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}deactivate(t){gy.graphicService.hooks.onAttributeUpdate.taps=gy.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),gy.graphicService.hooks.onSetStage.taps=gy.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}class oT{name="ViewTransform3dPlugin";activeEvent="onRegister";pluginService;_uid=sm.GenAutoIncrementId();key=this.name+this._uid;mousedown;pageX;pageY;option3d;onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)};onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)};onMouseMove=t=>{const e=this.pluginService.stage;if(this.option3d||(this.option3d=e.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const i=t.page.x-this.pageX,n=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const r=i/100,s=n/100;this.option3d.alpha=(this.option3d.alpha??0)+r,this.option3d.beta=(this.option3d.beta??0)+s,e.set3dOptions(this.option3d),e.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y};activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}class hT{name="IncrementalAutoRenderPlugin";activeEvent="onRegister";pluginService;nextFrameRenderGroupSet=new Set;willNextFrameRender=!1;nextUserParams={};_uid=sm.GenAutoIncrementId();key=this.name+this._uid;activate(t){this.pluginService=t,gy.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,n)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),gy.graphicService.hooks.onClearIncremental.tap(this.key,((e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))}))}deactivate(t){gy.graphicService.hooks.onAddIncremental.taps=gy.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),gy.graphicService.hooks.onClearIncremental.taps=gy.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,gy.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const n=e.layer.subLayers.get(e._uid);n&&n.drawContribution&&n.drawContribution.draw(t.renderService,{x:t.x,y:t.y,width:i.viewWidth,height:i.viewHeight,stage:t,layer:i,clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:n.layer.getNativeHandler().getContext(),...this.nextUserParams})})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}const cT=new df;class lT{name="DirtyBoundsPlugin";activeEvent="onRegister";pluginService;_uid=sm.GenAutoIncrementId();key=this.name+this._uid;activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),gy.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(cT.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(cT,t.parent&&t.parent.globalTransMatrix)))})),gy.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!r||e.dirty(n.globalAABBBounds))})),gy.graphicService.hooks.onRemove.tap(this.key,(t=>{const e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){gy.graphicService.hooks.beforeUpdateAABBBounds.taps=gy.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),gy.graphicService.hooks.afterUpdateAABBBounds.taps=gy.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),gy.graphicService.hooks.onRemove.taps=gy.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}const uT=new _m;uT.addTimeline(Bm);uT.setFPS(60);class dT{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=Ev.get(e).value,this.colorRgb[0]/=255,this.colorRgb[1]/=255,this.colorRgb[2]/=255,this.ambient=i;const n=ef(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/n,t[1]/n,t[2]/n]}computeColor(t,e){const i=this.formatedDir,n=Qp(Jp((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let r;if(kp(e)){r=Ev.get(e).value}else r=e;const s=this.colorRgb;return Ev.to.rgb(s[0]*r[0]*n,s[1]*r[1]*n,s[2]*r[2]*n)}}const pT="white";class fT extends Cb{_viewBox;_background;_subView;nextFrameRenderLayerSet;willNextFrameRender;_cursor;renderCount;dirtyBounds;option3d;set viewBox(t){this._viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}get viewBox(){return this._viewBox}get x(){return this._viewBox.x1}set x(t){this._viewBox.translate(t-this._viewBox.x1,0)}get y(){return this._viewBox.y1}set y(t){this._viewBox.translate(0,t-this._viewBox.y1)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this._viewBox.width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this._viewBox.height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){return this._background??pT}set background(t){this._background=t}get defaultLayer(){return this.at(0)}ticker;autoRender;increaseAutoRender;view3dTranform;window;global;renderService;pickerService;pluginService;layerService;eventSystem;_beforeRender;_afterRender;_afterNextRenderCbs;lastRenderparams;interactiveLayer;supportInteractiveLayer;constructor(t){super({}),this.theme=new em,this.hooks={beforeRender:new bp(["stage"]),afterRender:new bp(["stage"])},this.global=fy.get(wp),this.window=fy.get(Pb),this.renderService=fy.get(dA),this.pickerService=fy.get(wA),this.pluginService=fy.get(h_),this.layerService=fy.get(kb),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this._viewBox=new df,t.viewBox?this._viewBox.setValue(t.viewBox.x1,t.viewBox.y1,t.viewBox.x2,t.viewBox.y2):this._viewBox.setValue(0,0,this.width,this.height),this.renderCount=0,this._subView=!(this._viewBox.width()===this.width&&this._viewBox.height()===this.height),this._background=t.background??pT,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,this.global.supportEvent&&(this.eventSystem=new mm({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,viewport:{viewBox:this._viewBox,get x(){return this.viewBox.x1},get y(){return this.viewBox.y1},get width(){return this.viewBox.width()},get height(){return this.viewBox.height()}}})),t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||uT,this.supportInteractiveLayer=!1!==t.interactiveLayer}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:n=0,beta:r=0,camera:s,fieldRatio:a=1,fieldDepth:o}=t;return{...t,center:e,light:i,alpha:n,beta:r,camera:s,fieldRatio:a,fieldDepth:o}}set3dOptions(t){this.option3d=t;const e=this.get3dOptions(t),{light:i,center:n,camera:r,alpha:s,beta:a,fieldRatio:o,fieldDepth:h}=e,{dir:c=[1,1,-1],color:l="white",ambient:u}=i,d=(n.x??this.width/2)+(n.dx??0),p=(n.y??this.height/2)+(n.dy??0),f=[d,p,(n.z??0)+(n.dz??0)];let g=0,y=0,m=0;r||(g=Math.sin(s)+d,y=Math.sin(a)+p,m=Math.cos(s)*Math.cos(a)*1),this.light=new dT(c,l,u);const v={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:o,fieldDepth:h,viewParams:{pos:[g,y,m],center:f,up:[0,1,0]}};this.camera?this.camera.params=v:this.camera=new TA(v),t.enableView3dTransform&&this.enableView3dTransform()}beforeRender=t=>{this._beforeRender&&this._beforeRender(t)};afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null};setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new oT))}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new aT))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new hT))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new uf;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t||(t=new lT,this.pluginService.register(t)),t.activate(this.pluginService)}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}tryUpdateAABBBounds(){const t=this._viewBox;return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t){const e=this.layerService.createLayer(this,{main:!1,canvasId:t});return this.appendChild(e),e}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive")}clearViewBox(t){this.window.clearViewBox(this._viewBox,t)}render(t,e){this.ticker.start(),this.lastRenderparams=e,this.hooks.beforeRender.call(this),(t||this).forEach(((t,i)=>{t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds},{renderStyle:this.renderStyle,...e})})),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear(),this.hooks.afterRender.call(this)}combineLayersToWindow(){this.forEach(((t,e)=>{t.combineTo(this.window,{clear:0===e,x:this.x,y:this.y,width:this.viewWidth,height:this.viewHeight,renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds})}))}renderNextFrame(t){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){this.nextFrameRenderLayerSet.size&&(this.ticker.start(),this.hooks.beforeRender.call(this),this.forEach((t=>{this.nextFrameRenderLayerSet.has(t)&&t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds},{renderStyle:this.renderStyle,...this.lastRenderparams||{}})})),this.combineLayersToWindow(),this.hooks.afterRender.call(this),this.nextFrameRenderLayerSet.clear())}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this._subView||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render()}resizeView(t,e,i=!0){this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params={...this.camera.params,right:this.width,bottom:this.height}),i&&this.render()}setViewBox(t,e,i,n,r){let s=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(s=!1)):(this.viewBox.setValue(t,e,t+i,e+n),!1===r&&(s=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),s&&this.render()}setDpr(t){this.forEachChildren((e=>{e.setDpr(t)}))}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){const i=this.pickerService.pick(this.children,new hf(t,e),{bounds:this.AABBBounds});return!(!i?.graphic&&!i?.group)&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.eventSystem&&this.eventSystem.release(),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release()}setStage(t){}dirty(t,e){e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t)}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t,e){this.forEachChildren(((i,n)=>{i.drawTo(t,{...e,renderService:this.renderService,background:i===this.defaultLayer?this.background:void 0,clear:0===n,updateBounds:!!this.dirtyBounds})}))}renderToNewWindow(t=!0){const e=fy.get(Pb);return t?e.create({width:this.viewWidth,height:this.viewHeight,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}):e.create({width:Math.min(this.viewWidth,this.window.width-this.x),height:Math.min(this.viewHeight,this.window.height-this.y),dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e,{x:0,y:0,width:e.width,height:e.height}),e}toCanvas(t=!0){const e=this.renderToNewWindow(t).getNativeHandler();return e.nativeCanvas?e.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t)}getCursor(){return this._cursor}}var gT;!function(t){t[t.W=1]="W",t[t.H=2]="H",t[t.WH=3]="WH"}(gT||(gT={}));t.ACustomAnimate=Pm,t.ARC3D_NUMBER_TYPE=ob,t.ARC_NUMBER_TYPE=ab,t.AREA_NUMBER_TYPE=hb,t.Animate=Mm,t.AnimateGroup=class extends Pm{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Cm[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends Pm{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Cm[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Arc=Iw,t.Arc3d=Ow,t.Arc3dRender=HS,t.ArcRender=jS,t.ArcRenderContribution=Kb,t.Area=kw,t.AreaRender=GS,t.AreaRenderContribution=$b,t.AttributeAnimate=class extends Pm{constructor(t,e,i){super({},t,e,i)}getEndProps(){return this.to}onBind(){Object.keys(this.to).forEach((t=>{this.from[t]=this.target.getComputedAttribute(t)}))}onEnd(){}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this.to,this.from)}},t.AutoEnablePlugins=o_,t.Basis=xg,t.BeforeRenderConstribution=pA,t.BoundsContext=kf,t.BoundsPicker=SA,t.CIRCLE_NUMBER_TYPE=cb,t.CanvasFactory=yy,t.CanvasTextLayout=ux,t.CbAnimate=Em,t.Circle=ox,t.CircleRender=VS,t.CircleRenderContribution=Zb,t.ClipAngleAnimate=class extends Jm{constructor(t,e,i,n,r){const s=r?.group?.attribute??{},a=s.width??0,o=s.height??0,h=r?.animationType??"in",c=r?.startAngle??0,l=r?.orient??"clockwise";let u=0,d=0;"anticlockwise"===l?(d="in"===h?c+2*Math.PI:c,d=c+2*Math.PI):(u=c,d="out"===h?c+2*Math.PI:c);const p=gy.graphicService.creator.arc({x:r?.center?.x??a/2,y:r?.center?.y??o/2,outerRadius:r?.radius??(a+o)/2,innerRadius:0,startAngle:u,endAngle:d,fill:!0});let f,g;"anticlockwise"===l?(f={startAngle:c+2*Math.PI},g={startAngle:c}):(f={endAngle:c},g={endAngle:c+2*Math.PI}),super("in"===h?f:g,"in"===h?g:f,i,n,{group:r?.group,clipGraphic:p})}},t.ClipDirectionAnimate=class extends Jm{constructor(t,e,i,n,r){const s=r?.group?.attribute??{},a=r?.width??s.width??0,o=r?.height??s.height??0,h=r?.animationType??"in",c=r?.direction??"x",l=r?.orient??"positive",u=gy.graphicService.creator.rect({x:0,y:0,width:"in"===h&&"x"===c?0:a,height:"in"===h&&"y"===c?0:o,fill:!0});let d={},p={};"y"===c?"negative"===l?(d={y:o,height:0},p={y:0,height:o}):(d={height:0},p={height:o}):"negative"===l?(d={x:a,width:0},p={x:0,width:a}):(d={width:0},p={width:a}),super("in"===h?d:p,"in"===h?p:d,i,n,{group:r?.group,clipGraphic:u})}},t.ClipGraphicAnimate=Jm,t.ClipRadiusAnimate=class extends Jm{constructor(t,e,i,n,r){const s=r?.group?.attribute??{},a=s.width??0,o=s.height??0,h=r?.animationType??"in",c=r?.startRadius??0,l=r?.endRadius??Math.sqrt((a/2)**2+(o/2)**2),u=gy.graphicService.creator.arc({x:r?.center?.x??a/2,y:r?.center?.y??o/2,outerRadius:"out"===h?l:c,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),d={outerRadius:c},p={outerRadius:l};super("in"===h?d:p,"in"===h?p:d,i,n,{group:r?.group,clipGraphic:u})}},t.ColorInterpolate=Vb,t.Context2dFactory=my,t.ContributionProvider=gp,t.CurveContext=class{_lastX;_lastY;_startX;_startY;constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.curves.push(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new dg(new hf(this._lastX,this._lastY),new hf(t,e))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,e,i,n,r,s){const a=new lg(new hf(this._lastX,this._lastY),new hf(t,e),new hf(i,n),new hf(r,s));this.path.curves.push(a),this._lastX=r,this._lastY=s}arcTo(t,e,i,n,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,r,s,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,r,s){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}},t.CustomEvent=um,t.CustomPath2D=Ng,t.CustomSymbolClass=tw,t.DefaultArcAttribute=$g,t.DefaultAreaAttribute=Zg,t.DefaultAttribute=Kg,t.DefaultCircleAttribute=Jg,t.DefaultFillStyle=Gg,t.DefaultGlyphAttribute=ty,t.DefaultGroupAttribute=Qg,t.DefaultImageAttribute=cy,t.DefaultLineAttribute=ey,t.DefaultMorphingAnimateConfig=Im,t.DefaultPathAttribute=iy,t.DefaultPolygonAttribute=ny,t.DefaultRect3dAttribute=sy,t.DefaultRectAttribute=ry,t.DefaultRichTextAttribute=hy,t.DefaultRichTextIconAttribute=ly,t.DefaultStateAnimateConfig=Dm,t.DefaultStrokeStyle=Xg,t.DefaultStyle=qg,t.DefaultSymbolAttribute=ay,t.DefaultSymbolBackgroundRenderContribution=lA,t.DefaultSymbolTextureRenderContribution=uA,t.DefaultTextAttribute=oy,t.DefaultTextStyle=Yg,t.DefaultTicker=_m,t.DefaultTimeline=Tm,t.DefaultTransform=Hg,t.DragNDrop=class{rootNode;constructor(t){this.rootNode=t,this.initEvents()}initEvents(){this.rootNode?.addEventListener("pointerdown",this.onPointerDown)}removeEvents(){this.rootNode?.removeEventListener("pointerdown",this.onPointerDown)}release(){this.removeEvents(),this.rootNode=null}onPointerDown=t=>{const e=t.target,i=this.rootNode,n=e===i;if(e&&!n){let r,s=!1;function a(t){if(s||(t.type="dragstart",e?.dispatchEvent(t),s=!0),t.type="drag",e?.dispatchEvent(t),!n){e.pickable=!1;const n=i?.pick(t.global.x,t.global.y),s=n.graphic;e.pickable=!0,r!==s&&(r&&(t.type="dragleave",t.target=r,r.dispatchEvent(t)),s&&(t.type="dragenter",t.target=s,s.dispatchEvent(t)),r=s,r&&(t.type="dragover",t.target=r,r.dispatchEvent(t)))}}i?.addEventListener("pointermove",a);const o=function(){s&&(r&&(t.type="drop",t.target=r,r.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),s=!1),i?.removeEventListener("pointermove",a)};e.addEventListener("pointerup",o,{once:!0}),e.addEventListener("pointerupoutside",o,{once:!0})}}},t.DrawContribution=aA,t.EventManager=fm,t.EventSystem=mm,t.EventTarget=gm,t.FadeInPlus=class extends Pm{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=Zm.LEFT_TO_RIGHT,fill:a=!0,stroke:o=!0}=r||{};this.direction=s,this.fill=a,this.stroke=o,this.fillGradient={gradient:"linear",stops:[]},this.strokeGradient={gradient:"linear",stops:[]}}getEndProps(){return{fill:this.toFill,stroke:this.toStroke}}onBind(){this.toFill=this.target.getComputedAttribute("fill"),this.toStroke=this.target.getComputedAttribute("stroke")}onEnd(){}onUpdate(t,e,i){if(this.toFill&&this.toStroke)switch(this.direction){case Zm.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case Zm.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case Zm.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case Zm.STROKE:this.strokePath(t,e,i);break;default:this.leftToRight(t,e,i)}}leftToRight(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=this.toStroke;this.strokeGradient.x0=0,this.strokeGradient.y0=0,this.strokeGradient.x1=1,this.strokeGradient.y1=0,this.strokeGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,6*e),color:"transparent"}],i.stroke=this.strokeGradient}}strokePath(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=300,n=e*t;i.lineDash=[n,t-n]}}rightToLeft(t,e,i){}topToBottom(t,e,i){}bottomToTop(t,e,i){}},t.FederatedEvent=om,t.FederatedMouseEvent=hm,t.FederatedPointerEvent=cm,t.FederatedWheelEvent=lm,t.GLYPH_NUMBER_TYPE=lb,t.GRAPHIC_UPDATE_TAG_KEY=Zv,t.GROUP_NUMBER_TYPE=ub,t.Generator=sm,t.Gesture=class extends _p{element;cachedEvents=[];startTime;pressTimeout;startPoints=[];processEvent={};startDistance;center;eventType;direction;lastMoveTime;prevMoveTime;prevMovePoint;lastMovePoint;throttleTimer=0;emitThrottles=[];config;constructor(t,e={}){super(),this.element=t,this.config={press:{time:e?.press?.time??251,threshold:e?.press?.threshold??9},swipe:{threshold:e?.swipe?.threshold??10,velocity:e?.swipe?.velocity??.3}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}onStart=t=>{this.reset(),this.startTime=dm.now();const{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t<e.length;t++){const{x:n,y:r}=e[t],s={x:n,y:r};i[t]=s}if(1!==i.length)this.startDistance=bm(i[0],i[1]),this.center=(t=>{const e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,n=0,r=0;for(;r<e;)i+=t[r].x,n+=t[r].y,r++;return{x:Math.round(i/e),y:Math.round(n/e)}})([i[0],i[1]]);else{const t=e[0];this.pressTimeout=setTimeout((()=>{const e="press",n="none";t.direction=n,t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent(e,t),this.triggerEvent(e,t),this.eventType=e,this.direction=n}),this.config.press.time)}};onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const n=t.clone(),{x:r,y:s,pointerId:a}=n;for(let t=0,e=i.length;t<e;t++)if(a===i[t].pointerId){i[t]=n;break}const o={x:r,y:s},h=i.map((t=>({x:t.x,y:t.y}))),c=dm.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=c,this.lastMovePoint=o,1===e.length){const t=e[0],i=r-t.x,a=s-t.y,c=this.direction||vm(t,o);this.direction=c;const l=this.getEventType(o);return n.direction=c,n.deltaX=i,n.deltaY=a,n.points=h,this.triggerStartEvent(l,n),void this.triggerEvent(l,n)}const{startDistance:l}=this,u=bm(h[0],h[1]);n.scale=u/l,n.center=this.center,n.points=h,this.triggerStartEvent("pinch",n),this.triggerEvent("pinch",n)};onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:n}=this,r=i.map((t=>({x:t.x,y:t.y})));if(e.points=r,this.triggerEndEvent(e),1===i.length){const t=dm.now(),i=this.lastMoveTime;if(t-i<100){const t=i-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||n[0],r=this.lastMovePoint||n[0],s=bm(i,r),a=s/t;a>this.config.swipe.velocity&&s>this.config.swipe.threshold&&(e.velocity=a,e.direction=vm(i,r),this.triggerEvent("swipe",e))}}}for(let t=0,r=i.length;t<r;t++)if(i[t].pointerId===e.pointerId){i.splice(t,1),n.splice(t,1);break}this.reset(),i.length>0&&this.onStart()};getEventType(t){const{eventType:e,startTime:i,startPoints:n}=this;if(e)return e;let r;return r=dm.now()-i>this.config.press.time&&bm(n[0],t)<this.config.press.threshold?"press":"pan",this.eventType=r,r}enable(t){this.processEvent[t]=!0}isProcess(t){return this.processEvent[t]}pushEvent(t,e){const{emitThrottles:i}=this,n={type:t,ev:e};for(let e=0,r=i.length;e<r;e++)if(i[e].type===t)return void i.splice(e,1,n);i.push(n)}clearPressTimeout(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}reset(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}triggerEvent(t,e){this.pushEvent(t,e);const{throttleTimer:i,emitThrottles:n}=this;i||(this.throttleTimer=gy.global.getRequestAnimationFrame()((()=>{for(let t=0,e=n.length;t<e;t++){const{type:e,ev:i}=n[t];this.emitEvent(e,i)}this.throttleTimer=0,this.emitThrottles.length=0})))}triggerStartEvent(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent(`${t}start`,e))}triggerEndEvent(t){const e=this.processEvent;Object.keys(e).forEach((i=>{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]}))}emitEvent(t,e){const i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let n=0,r=i.length;n<r&&!e.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,e,t);this.emit(t,e)}},t.GlobalPickerService=AA,t.Glyph=uw,t.GlyphRender=nA,t.Graphic=ib,t.GraphicAnimate=class extends Pm{graphic;constructor(t,e,i,n,r){super(t,e,i,n,r),this.graphic=r?.graphic}onUpdate(t,e,i){this.graphic&&Object.keys(this.from).forEach((t=>{i[t]=this.from[t]+(this.to[t]-this.from[t])*e}))}},t.GraphicCreator=Ab,t.GraphicPicker=xA,t.GraphicRender=XS,t.GraphicService=Sb,t.GraphicUtil=Rb,t.Group=Cb,t.GroupFadeIn=class extends Pm{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:0}})}onEnd(){this.target.setTheme({common:{opacity:1}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:e}})}},t.GroupFadeOut=class extends Pm{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:1}})}onEnd(){this.target.setTheme({common:{opacity:0}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:1-e}})}},t.GroupRender=YS,t.GroupRenderContribution=Jb,t.IMAGE_NUMBER_TYPE=db,t.Image=Aw,t.ImageRender=rA,t.ImageRenderContribution=Qb,t.IncreaseCount=class extends Pm{fromNumber;toNumber;constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){this.fromNumber=Ip(this.from?.text)?this.from?.text:Number.parseFloat(this.from?.text),this.toNumber=Ip(this.to?.text)?this.to?.text:Number.parseFloat(this.to?.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1)}onEnd(){}onUpdate(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber.toFixed():(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.params?.fixed??0))}},t.IncrementalDrawContribution=zS,t.InputText=class extends Pm{fromText="";toText="";getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){if(this.fromText=this.from?.text??"",this.toText=this.to?.text??"",!this.toText||Dp(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=gy.graphicService.creator.line({x:0,y:0,points:[{x:0,y:0},{x:0,y:this.target.getComputedAttribute("fontSize")}],stroke:"black",lineWidth:1});t.add(e)}}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){if(!1===this.valid)return;const n=this.fromText.length,r=this.toText.length,s=Math.ceil(n+(r-n)*e);i.text=this.toText.substr(0,s);const a=this.target.shadowRoot?.at(0),o=this.target.clipedWidth+2;a.setAttribute("x",o)}},t.InteractiveSubRenderContribution=sx,t.LINE_NUMBER_TYPE=pb,t.Layer=Bb,t.LayerHandlerContribution=Tb,t.LayerService=kb,t.Line=aw,t.LineRender=qS,t.Linear=yg,t.LinearClosed=Lg,t.ManualTickHandler=xm,t.ManualTicker=class extends _m{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new xm;return this._mode="manual",this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}tickAt(t){this.tickerHandler.tick(t-this.lastFrameTime,(t=>{this.handleTick(t,{once:!0})}))}ifCanStop(){return!1}},t.Meteor=class extends Pm{get lastPos(){return this.posList[this.posList.length-1]}constructor(t,e,i,n){super(null,null,e,i,n),this.size=t,this.posList=[]}onBind(){const e=this.target.attachShadow();this.root=e;for(let i=0;i<this.size;i++){const n=this.target.clone(),r=Math.min((this.size-i)/this.size*3,1),s=Math.min(.2+.7/this.size);n.setAttributes({x:0,y:0,dx:0,dy:0,scaleX:r,scaleY:r,opacity:s},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}),e.add(n)}}onUpdate(t,e,i){if(t)return this.target.detachShadow(),void(this.posList.length=0);const n=this.target.getComputedAttribute("x"),r=this.target.getComputedAttribute("y"),s=new hf(n,r);this.posList.length?(this.target.shadowRoot.forEachChildren(((t,e)=>{const i=this.posList[Math.max(this.posList.length-e-1,0)];t.setAttributes({x:i.x-n,y:i.y-r},!1)})),this.posList.push(s)):this.posList.push(s)}},t.MonotoneX=Bg,t.MonotoneY=Pg,t.MorphingPath=jv,t.MotionPath=class extends Pm{constructor(t,e,i,n,r){super(t,e,i,n,r),r&&(this.pathLength=r.path.getLength(),this.path=r.path,this.distance=r.distance,this.to=r.distance*this.pathLength,this.initAngle=r.initAngle??0,this.changeAngle=!!r.changeAngle,this.cb=r.cb)}onUpdate(t,e,i){const n=this.to*e,{pos:r,angle:s}=this.path.getAttrAt(n);i.x=r.x,i.y=r.y,this.changeAngle&&(i.angle=s+this.initAngle),this.cb&&this.cb(this.from,this.to,e,this.target)}},t.MultiToOneMorphingPath=Gv,t.Node=am,t.PATH_NUMBER_TYPE=fb,t.POLYGON_NUMBER_TYPE=gb,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=yb,t.Path=Mw,t.PathRender=KS,t.PathRenderContribution=tx,t.PickerService=wA,t.PluginService=h_,t.Polygon=Uw,t.PolygonRender=$S,t.PolygonRenderContribution=ex,t.Pyramid3d=Ww,t.Pyramid3dRender=iA,t.RAFTickHandler=Sm,t.RECT3D_NUMBER_TYPE=vb,t.RECT_NUMBER_TYPE=mb,t.RICHTEXT_NUMBER_TYPE=bb,t.RafBasedSTO=Km,t.Rect=hw,t.Rect3DRender=JS,t.Rect3d=lw,t.RectRender=ZS,t.RectRenderContribution=ix,t.ReflectSegContext=fg,t.RenderSelector=sA,t.RenderService=dA,t.ResourceLoader=Kv,t.RichText=Pw,t.RichTextRender=eA,t.RotateBySphereAnimate=class extends Pm{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.getComputedAttribute("x"),n=this.target.getComputedAttribute("y"),r=this.target.getComputedAttribute("z"),s=Math.acos((n-t.y)/e);let a=Math.acos((i-t.x)/e/Math.sin(s));r-t.z<0&&(a=qp-a),this.theta=a,this.phi=s}onBind(){}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:n,r:r}="function"==typeof this.params?this.params():this.params,s=2*Math.PI*e,a=this.theta+s,o=this.phi,h=r*Math.sin(o)*Math.cos(a)+n.x,c=r*Math.cos(o)+n.y,l=r*Math.sin(o)*Math.sin(a)+n.z;for(i.x=h,i.y=c,i.z=l,i.alpha=a+Vp/2;i.alpha>qp;)i.alpha-=qp;i.alpha=qp-i.alpha,i.zIndex=-1e4*i.z}},t.SYMBOL_NUMBER_TYPE=xb,t.SegContext=pg,t.Stage=fT,t.Step=Dg,t.StreamLight=class extends Pm{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){const t=this.target.attachShadow(),e=this.target.AABBBounds.height(),i=gy.graphicService.creator.rect({height:e,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff",...this.params?.attribute,x:0,y:0,width:0});this.rect=i,t.add(i)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(e,i,n){const r=this.target.attribute.width??250,s=this.params?.streamLength??r,a=this.params?.attribute?.width??60,o=-a,h=o+(s-o)*i,c=Math.max(h,0),l=Math.min(Math.min(h+a,a),s-h),u=l+c>r?Math.max(r-c,0):l;this.rect.setAttributes({x:c,width:u},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}},t.SubAnimate=Rm,t.Symbol=rw,t.SymbolRender=QS,t.SymbolRenderContribution=nx,t.TEXT_NUMBER_TYPE=wb,t.TagPointsUpdate=class extends Pm{fromPoints;toPoints;points;interpolatePoints;newPointAnimateType;constructor(t,e,i,n,r){super(t,e,i,n,r),this.newPointAnimateType="appear"===r?.newPointAnimateType?"appear":"grow"}onBind(){const t=this.from?.points,e=this.to?.points;this.fromPoints=t?Array.isArray(t)?t:[t]:[],this.toPoints=e?Array.isArray(e)?e:[e]:[];const i=new Map;this.fromPoints.forEach((t=>{t.context&&i.set(t.context,t)}));let n,r,s=1/0,a=-1/0;for(let t=0;t<this.toPoints.length;t+=1)if(i.has(this.toPoints[t].context)){s=t,n=i.get(this.toPoints[t].context);break}for(let t=this.toPoints.length-1;t>=0;t-=1)if(i.has(this.toPoints[t].context)){a=t,r=i.get(this.toPoints[t].context);break}let o=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const h=i.get(t.context);return h?(o=h,[h,t]):"appear"===this.newPointAnimateType?[t,t]:e<s&&n?[n,t]:e>a&&r?[r,t]:[o,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],n=new hf(e.x,e.y,e.x1,e.y1);return n.defined=i.defined,n.context=i.context,n}))}onUpdate(t,e,i){this.points=this.points.map(((t,i)=>{const n=Gm(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),i.points=this.points}},t.Text=px,t.TextRender=tA,t.TextRenderContribution=rx,t.Theme=em,t.TimeOutTickHandler=wm,t.TransformUtil=Mb,t.Window=Pb,t.WindowHandlerContribution=Eb,t.addArcToBezierPath=eg,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=av,t.alignSubpath=tv,t.applyTransformOnBezierCurves=cv,t.bezier=Qf,t.bezierCurversToPath=lv,t.binarySplitPolygon=xv,t.bindContributionProvider=mp,t.boundStroke=nb,t.builtinSymbols=ew,t.builtinSymbolsMap=iw,t.calcLineCache=Fg,t.centroidOfSubpath=nv,t.circleBounds=jm,t.cloneGraphic=Yv,t.container=fy,t.cornerTangents=jb,t.createArc=cS,t.createArc3d=function(t){return new Ow(t)},t.createArea=lS,t.createCircle=uS,t.createColor=hA,t.createConicalGradient=qb,t.createGlyph=function(t){return new uw(t)},t.createGroup=dS,t.createImage=xS,t.createLine=pS,t.createPath=fS,t.createPolygon=wS,t.createPyramid3d=function(t){return new Ww(t)},t.createRect=gS,t.createRect3d=yS,t.createRectPath=LS,t.createRichText=AS,t.createShadowRoot=SS,t.createStage=function(t){return new fT(t)},t.createSymbol=bS,t.createText=mS,t.createWrapText=vS,t.cubicCalc=og,t.cubicLength=ag,t.cubicPointAt=hg,t.cubicSubdivide=Qm,t.defaultTicker=uT,t.defaultTimeline=Bm,t.drawArc=tg,t.drawArcPath=Hb,t.drawAreaSegments=RS,t.drawIncrementalAreaSegments=ES,t.drawIncrementalSegments=PS,t.drawPathProxy=Nb,t.drawSegments=BS,t.enumCommandMap=Lf,t.fillVisible=Lb,t.findBestMorphingRotation=sv,t.findNextGraphic=mA,t.foreach=gA,t.foreachAsync=yA,t.genBasisSegments=Sg,t.genBasisTypeSegments=wg,t.genLinearClosedSegments=Ug,t.genLinearClosedTypeSegments=Wg,t.genLinearSegments=mg,t.genLinearTypeSegments=vg,t.genMonotoneXSegments=Mg,t.genMonotoneYSegments=kg,t.genMonotpneXTypeSegments=Eg,t.genMonotpneYTypeSegments=Rg,t.genNumberType=sb,t.genStepSegments=Ig,t.genStepTypeSegments=Og,t.getAttributeFromDefaultAttrList=qm,t.getConicGradientAt=Yb,t.getContextFont=hx,t.getExtraModelMatrix=function(t,e,i){const{alpha:n,beta:r}=i.attribute;if(!n&&!r)return null;const{anchor3d:s=i.attribute.anchor}=i.attribute,a=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=i.AABBBounds;a[0]=e.x1+(e.x2-e.x1)*t}else a[0]=s[0];if("string"==typeof s[1]){const t=parseFloat(s[1])/100,e=i.AABBBounds;a[1]=e.x1+(e.x2-e.x1)*t}else a[1]=s[1]}if("text"===i.type){const{textAlign:t}=i.attribute;a[0]+=cx(t,i.clipedWidth)}a[0]+=t,a[1]+=e;const o=Jw.allocate();return eS(o,o,[a[0],a[1],0]),r&&Qw(o,o,r),n&&tS(o,o,n),eS(o,o,[-a[0],-a[1],0]),o},t.getModelMatrix=rS,t.getRichTextBounds=function(t){return TS.setAttributes(t),TS.AABBBounds},t.getScaledStroke=oA,t.getTextBounds=function(t){return CS.setAttributes(t),CS.AABBBounds},t.getTheme=nm,t.getThemeFromGroup=rm,t.global=tT,t.globalTheme=im,t.graphicCreator=_S,t.graphicService=nT,t.graphicUtil=eT,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.intersect=zb,t.isTransformKey=Ym,t.layerService=sT,t.loadFeishuContributions=p_,t.loadTaroContributions=f_,t.mat3Tomat4=iS,t.morphPath=Hv,t.multiToOneMorph=(e,i,n)=>{const r=e.filter((t=>t.toCustomPath&&t.valid));r.length||__DEV__&&console.error(e," is not validate"),i.valid&&i.toCustomPath||__DEV__&&console.error(i," is not validate");const s=("clone"===n?.splitPath?Yv:n?.splitPath??qv)(i,r.length,!0),a=i.attribute;i.setAttribute("visible",!1);const o=r.map(((t,e)=>Fv(t.toCustomPath(),s[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:s[e].globalTransMatrix}))),h=r.map(((t,e)=>zv(t.attribute,a)));if(n?.individualDelay){const a=n.onEnd;let c=r.length;const l=()=>{c--,0===c&&(i.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),a&&a())};s.forEach(((t,i)=>{const s=(n.delay??0)+n.individualDelay(i,r.length,e[i],t),a=t.animate(Object.assign({},n,{onEnd:l}));a.wait(s),a.play(new jv({morphingData:o[i],saveOnEnd:!0,otherAttrs:h[i]},n.duration??Im.duration,n.easing??Im.easing))}))}else{const e=n?.onEnd,r=n?Object.assign({},n):{};r.onEnd=()=>{i.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),e&&e()};const s=i.animate(r);n?.delay&&s.wait(n.delay),s.play(new Gv({morphingData:o,otherAttrs:h},n?.duration??Im.duration,n?.easing??Im.easing))}},t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],y=e[13],m=e[14],v=e[15];let b=i.a,x=i.b,w=0,S=0;return t[0]=b*n+x*o+w*u+S*g,t[1]=b*r+x*h+w*d+S*y,t[2]=b*s+x*c+w*p+S*m,t[3]=b*a+x*l+w*f+S*v,b=i.c,x=i.d,w=0,S=0,t[4]=b*n+x*o+w*u+S*g,t[5]=b*r+x*h+w*d+S*y,t[6]=b*s+x*c+w*p+S*m,t[7]=b*a+x*l+w*f+S*v,b=0,x=0,w=1,S=0,t[8]=b*n+x*o+w*u+S*g,t[9]=b*r+x*h+w*d+S*y,t[10]=b*s+x*c+w*p+S*m,t[11]=b*a+x*l+w*f+S*v,b=i.e,x=i.f,w=0,S=1,t[12]=b*n+x*o+w*u+S*g,t[13]=b*r+x*h+w*d+S*y,t[14]=b*s+x*c+w*p+S*m,t[15]=b*a+x*l+w*f+S*v,t},t.multiplyMat4Mat4=nS,t.newThemeObj=Jy,t.oneToMultiMorph=(t,e,i)=>{const n=e.filter((t=>t&&t.toCustomPath&&t.valid));n.length||__DEV__&&console.error(n," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");const r=("clone"===i?.splitPath?Yv:i?.splitPath??qv)(t,n.length,!1),s=i?.onEnd;let a=n.length;const o=()=>{a--,0===a&&s&&s()};n.forEach(((e,s)=>{const a=r[s],h=(i?.delay??0)+(i?.individualDelay?i.individualDelay(s,n.length,a,e):0);Hv(a,e,Object.assign({},i,{onEnd:o,delay:h}),t.globalTransMatrix)}))},t.parsePadding=Fm,t.parseStroke=Um,t.parseSvgPath=Hf,t.pathToBezierCurves=hv,t.pickerService=rT,t.point=bg,t.pointEqual=Hm,t.pointInterpolation=Gm,t.pointInterpolationHighPerformance=function(t,e,i,n){const{x:r,y:s}=af(t.x,t.y,e.x,e.y,i),{x:a,y:o}=af(t.x1,t.y1,e.x1,e.y1,i);return n.x=r,n.y=s,n.x1=a,n.y1=o,n.defined=e.defined,n},t.pointsEqual=function(t,e){return!(!t||!e)&&(Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every(((t,i)=>Hm(t,e[i]))):!Number.isNaN(t.x+t.y)&&Hm(t,e))},t.pointsInterpolation=Vm,t.rafBasedSto=$m,t.rectFillVisible=Ub,t.rectStrokeVisible=Fb,t.recursiveCallBinarySplit=wv,t.renderCommandList=ng,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.rotateX=Qw,t.rotateY=tS,t.runFill=Ib,t.runStroke=Ob,t.segments=Jf,t.shouldUseMat4=sS,t.snapLength=sg,t.splitArc=pv,t.splitArea=yv,t.splitCircle=fv,t.splitGraphic=qv,t.splitLine=mv,t.splitPath=Av,t.splitPolygon=Sv,t.splitRect=dv,t.splitToGrids=uv,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=Wb,t.textDrawOffsetX=cx,t.textDrawOffsetY=function(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0},t.textLayoutOffsetY=lx,t.transformKeys=Xm,t.transformUtil=iT,t.translate=eS,t.version="0.13.12",t.waitForAllSubLayers=async function(t){const e=[],i=t.getChildren();await new Promise((t=>{gy.global.getRequestAnimationFrame()((()=>{t(null)}))})),i.forEach((t=>{t.subLayers.size&&t.subLayers.forEach((t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise((e=>{t.drawContribution.hooks.completeDraw.tap("outWait",(()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((t=>"outWait"!==t.name)),e(null)}))})))}))})),await Promise.all(e)},t.wrapCanvas=vy,t.wrapContext=function(t,e){return fy.getNamed(my,gy.global.env)(t,e)}}));