@visactor/vrender 0.15.5 → 0.15.7

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,f(n.key),n)}}function o(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t,e,i){return(e=f(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(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 u(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=h(t);if(e){var r=h(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return c(this,i)}}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,s,o,a=[],h=!0,l=!1;try{if(s=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;h=!1}else for(;!(h=(n=s.call(i)).done)&&(a.push(n.value),a.length!==e);h=!0);}catch(t){l=!0,r=t}finally{try{if(!h&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(l)throw r}}return a}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return p(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return p(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function f(t){var e=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)}(t,"string");return"symbol"==typeof e?e:String(e)}var g=function(t){return t&&t.Math==Math&&t},v=g("object"==("undefined"==typeof globalThis?"undefined":n(globalThis))&&globalThis)||g("object"==("undefined"==typeof window?"undefined":n(window))&&window)||g("object"==("undefined"==typeof self?"undefined":n(self))&&self)||g("object"==n(e)&&e)||function(){return this}()||e||Function("return this")(),m={},y=function(t){try{return!!t()}catch(t){return!0}},b=!y((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),x=!y((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),w=x,A=Function.prototype.call,S=w?A.bind(A):function(){return A.apply(A,arguments)},T={},C={}.propertyIsEnumerable,B=Object.getOwnPropertyDescriptor,_=B&&!C.call({1:2},1);T.f=_?function(t){var e=B(this,t);return!!e&&e.enumerable}:C;var P,E,M=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},k=x,R=Function.prototype,O=R.call,I=k&&R.bind.bind(O,O),D=k?I:function(t){return function(){return O.apply(t,arguments)}},L=D,N=L({}.toString),U=L("".slice),W=function(t){return U(N(t),8,-1)},F=y,j=W,z=Object,H=D("".split),G=F((function(){return!z("z").propertyIsEnumerable(0)}))?function(t){return"String"==j(t)?H(t,""):z(t)}:z,V=function(t){return null==t},X=V,Y=TypeError,q=function(t){if(X(t))throw Y("Can't call method on "+t);return t},K=G,$=q,Z=function(t){return K($(t))},J="object"==("undefined"==typeof document?"undefined":n(document))&&document.all,Q={all:J,IS_HTMLDDA:void 0===J&&void 0!==J},et=Q.all,it=Q.IS_HTMLDDA?function(t){return"function"==typeof t||t===et}:function(t){return"function"==typeof t},nt=it,rt=Q.all,st=Q.IS_HTMLDDA?function(t){return"object"==n(t)?null!==t:nt(t)||t===rt}:function(t){return"object"==n(t)?null!==t:nt(t)},ot=v,at=it,ht=function(t,e){return arguments.length<2?(i=ot[t],at(i)?i:void 0):ot[t]&&ot[t][e];var i},lt=D({}.isPrototypeOf),ct=v,ut="undefined"!=typeof navigator&&String(navigator.userAgent)||"",dt=ct.process,pt=ct.Deno,ft=dt&&dt.versions||pt&&pt.version,gt=ft&&ft.v8;gt&&(E=(P=gt.split("."))[0]>0&&P[0]<4?1:+(P[0]+P[1])),!E&&ut&&(!(P=ut.match(/Edge\/(\d+)/))||P[1]>=74)&&(P=ut.match(/Chrome\/(\d+)/))&&(E=+P[1]);var vt=E,mt=y,yt=v.String,bt=!!Object.getOwnPropertySymbols&&!mt((function(){var t=Symbol();return!yt(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&vt&&vt<41})),xt=bt&&!Symbol.sham&&"symbol"==n(Symbol.iterator),wt=ht,At=it,St=lt,Tt=Object,Ct=xt?function(t){return"symbol"==n(t)}:function(t){var e=wt("Symbol");return At(e)&&St(e.prototype,Tt(t))},Bt=String,_t=function(t){try{return Bt(t)}catch(t){return"Object"}},Pt=it,Et=_t,Mt=TypeError,kt=function(t){if(Pt(t))return t;throw Mt(Et(t)+" is not a function")},Rt=kt,Ot=V,It=function(t,e){var i=t[e];return Ot(i)?void 0:Rt(i)},Dt=S,Lt=it,Nt=st,Ut=TypeError,Wt={exports:{}},Ft=v,jt=Object.defineProperty,zt=function(t,e){try{jt(Ft,t,{value:e,configurable:!0,writable:!0})}catch(i){Ft[t]=e}return e},Ht=zt,Gt="__core-js_shared__",Vt=v[Gt]||Ht(Gt,{}),Xt=Vt;(Wt.exports=function(t,e){return Xt[t]||(Xt[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 Yt=Wt.exports,qt=q,Kt=Object,$t=function(t){return Kt(qt(t))},Zt=$t,Jt=D({}.hasOwnProperty),Qt=Object.hasOwn||function(t,e){return Jt(Zt(t),e)},te=D,ee=0,ie=Math.random(),ne=te(1..toString),re=function(t){return"Symbol("+(void 0===t?"":t)+")_"+ne(++ee+ie,36)},se=Yt,oe=Qt,ae=re,he=bt,le=xt,ce=v.Symbol,ue=se("wks"),de=le?ce.for||ce:ce&&ce.withoutSetter||ae,pe=function(t){return oe(ue,t)||(ue[t]=he&&oe(ce,t)?ce[t]:de("Symbol."+t)),ue[t]},fe=S,ge=st,ve=Ct,me=It,ye=function(t,e){var i,n;if("string"===e&&Lt(i=t.toString)&&!Nt(n=Dt(i,t)))return n;if(Lt(i=t.valueOf)&&!Nt(n=Dt(i,t)))return n;if("string"!==e&&Lt(i=t.toString)&&!Nt(n=Dt(i,t)))return n;throw Ut("Can't convert object to primitive value")},be=TypeError,xe=pe("toPrimitive"),we=function(t,e){if(!ge(t)||ve(t))return t;var i,n=me(t,xe);if(n){if(void 0===e&&(e="default"),i=fe(n,t,e),!ge(i)||ve(i))return i;throw be("Can't convert object to primitive value")}return void 0===e&&(e="number"),ye(t,e)},Ae=Ct,Se=function(t){var e=we(t,"string");return Ae(e)?e:e+""},Te=st,Ce=v.document,Be=Te(Ce)&&Te(Ce.createElement),_e=function(t){return Be?Ce.createElement(t):{}},Pe=_e,Ee=!b&&!y((function(){return 7!=Object.defineProperty(Pe("div"),"a",{get:function(){return 7}}).a})),Me=b,ke=S,Re=T,Oe=M,Ie=Z,De=Se,Le=Qt,Ne=Ee,Ue=Object.getOwnPropertyDescriptor;m.f=Me?Ue:function(t,e){if(t=Ie(t),e=De(e),Ne)try{return Ue(t,e)}catch(t){}if(Le(t,e))return Oe(!ke(Re.f,t,e),t[e])};var We={},Fe=b&&y((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),je=st,ze=String,He=TypeError,Ge=function(t){if(je(t))return t;throw He(ze(t)+" is not an object")},Ve=b,Xe=Ee,Ye=Fe,qe=Ge,Ke=Se,$e=TypeError,Ze=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,Qe="enumerable",ti="configurable",ei="writable";We.f=Ve?Ye?function(t,e,i){if(qe(t),e=Ke(e),qe(i),"function"==typeof t&&"prototype"===e&&"value"in i&&ei in i&&!i[ei]){var n=Je(t,e);n&&n[ei]&&(t[e]=i.value,i={configurable:ti in i?i[ti]:n[ti],enumerable:Qe in i?i[Qe]:n[Qe],writable:!1})}return Ze(t,e,i)}:Ze:function(t,e,i){if(qe(t),e=Ke(e),qe(i),Xe)try{return Ze(t,e,i)}catch(t){}if("get"in i||"set"in i)throw $e("Accessors not supported");return"value"in i&&(t[e]=i.value),t};var ii=We,ni=M,ri=b?function(t,e,i){return ii.f(t,e,ni(1,i))}:function(t,e,i){return t[e]=i,t},si={exports:{}},oi=b,ai=Qt,hi=Function.prototype,li=oi&&Object.getOwnPropertyDescriptor,ci=ai(hi,"name"),ui={EXISTS:ci,PROPER:ci&&"something"===function(){}.name,CONFIGURABLE:ci&&(!oi||oi&&li(hi,"name").configurable)},di=it,pi=Vt,fi=D(Function.toString);di(pi.inspectSource)||(pi.inspectSource=function(t){return fi(t)});var gi,vi,mi,yi=pi.inspectSource,bi=it,xi=v.WeakMap,wi=bi(xi)&&/native code/.test(String(xi)),Ai=re,Si=Yt("keys"),Ti=function(t){return Si[t]||(Si[t]=Ai(t))},Ci={},Bi=wi,_i=v,Pi=st,Ei=ri,Mi=Qt,ki=Vt,Ri=Ti,Oi=Ci,Ii="Object already initialized",Di=_i.TypeError,Li=_i.WeakMap;if(Bi||ki.state){var Ni=ki.state||(ki.state=new Li);Ni.get=Ni.get,Ni.has=Ni.has,Ni.set=Ni.set,gi=function(t,e){if(Ni.has(t))throw Di(Ii);return e.facade=t,Ni.set(t,e),e},vi=function(t){return Ni.get(t)||{}},mi=function(t){return Ni.has(t)}}else{var Ui=Ri("state");Oi[Ui]=!0,gi=function(t,e){if(Mi(t,Ui))throw Di(Ii);return e.facade=t,Ei(t,Ui,e),e},vi=function(t){return Mi(t,Ui)?t[Ui]:{}},mi=function(t){return Mi(t,Ui)}}var Wi={set:gi,get:vi,has:mi,enforce:function(t){return mi(t)?vi(t):gi(t,{})},getterFor:function(t){return function(e){var i;if(!Pi(e)||(i=vi(e)).type!==t)throw Di("Incompatible receiver, "+t+" required");return i}}},Fi=D,ji=y,zi=it,Hi=Qt,Gi=b,Vi=ui.CONFIGURABLE,Xi=yi,Yi=Wi.enforce,qi=Wi.get,Ki=String,$i=Object.defineProperty,Zi=Fi("".slice),Ji=Fi("".replace),Qi=Fi([].join),tn=Gi&&!ji((function(){return 8!==$i((function(){}),"length",{value:8}).length})),en=String(String).split("String"),nn=si.exports=function(t,e,i){"Symbol("===Zi(Ki(e),0,7)&&(e="["+Ji(Ki(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!Hi(t,"name")||Vi&&t.name!==e)&&(Gi?$i(t,"name",{value:e,configurable:!0}):t.name=e),tn&&i&&Hi(i,"arity")&&t.length!==i.arity&&$i(t,"length",{value:i.arity});try{i&&Hi(i,"constructor")&&i.constructor?Gi&&$i(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=Yi(t);return Hi(n,"source")||(n.source=Qi(en,"string"==typeof e?e:"")),t};Function.prototype.toString=nn((function(){return zi(this)&&qi(this).source||Xi(this)}),"toString");var rn=si.exports,sn=it,on=We,an=rn,hn=zt,ln=function(t,e,i,n){n||(n={});var r=n.enumerable,s=void 0!==n.name?n.name:e;if(sn(i)&&an(i,s,n),n.global)r?t[e]=i:hn(e,i);else{try{n.unsafe?t[e]&&(r=!0):delete t[e]}catch(t){}r?t[e]=i:on.f(t,e,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},cn={},un=Math.ceil,dn=Math.floor,pn=Math.trunc||function(t){var e=+t;return(e>0?dn:un)(e)},fn=function(t){var e=+t;return e!=e||0===e?0:pn(e)},gn=fn,vn=Math.max,mn=Math.min,yn=function(t,e){var i=gn(t);return i<0?vn(i+e,0):mn(i,e)},bn=fn,xn=Math.min,wn=function(t){return t>0?xn(bn(t),9007199254740991):0},An=function(t){return wn(t.length)},Sn=Z,Tn=yn,Cn=An,Bn=function(t){return function(e,i,n){var r,s=Sn(e),o=Cn(s),a=Tn(n,o);if(t&&i!=i){for(;o>a;)if((r=s[a++])!=r)return!0}else for(;o>a;a++)if((t||a in s)&&s[a]===i)return t||a||0;return!t&&-1}},_n={includes:Bn(!0),indexOf:Bn(!1)},Pn=Qt,En=Z,Mn=_n.indexOf,kn=Ci,Rn=D([].push),On=function(t,e){var i,n=En(t),r=0,s=[];for(i in n)!Pn(kn,i)&&Pn(n,i)&&Rn(s,i);for(;e.length>r;)Pn(n,i=e[r++])&&(~Mn(s,i)||Rn(s,i));return s},In=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Dn=On,Ln=In.concat("length","prototype");cn.f=Object.getOwnPropertyNames||function(t){return Dn(t,Ln)};var Nn={};Nn.f=Object.getOwnPropertySymbols;var Un=ht,Wn=cn,Fn=Nn,jn=Ge,zn=D([].concat),Hn=Un("Reflect","ownKeys")||function(t){var e=Wn.f(jn(t)),i=Fn.f;return i?zn(e,i(t)):e},Gn=Qt,Vn=Hn,Xn=m,Yn=We,qn=y,Kn=it,$n=/#|\.prototype\./,Zn=function(t,e){var i=Qn[Jn(t)];return i==er||i!=tr&&(Kn(e)?qn(e):!!e)},Jn=Zn.normalize=function(t){return String(t).replace($n,".").toLowerCase()},Qn=Zn.data={},tr=Zn.NATIVE="N",er=Zn.POLYFILL="P",ir=Zn,nr=v,rr=m.f,sr=ri,or=ln,ar=zt,hr=function(t,e,i){for(var n=Vn(e),r=Yn.f,s=Xn.f,o=0;o<n.length;o++){var a=n[o];Gn(t,a)||i&&Gn(i,a)||r(t,a,s(e,a))}},lr=ir,cr=function(t,e){var i,r,s,o,a,h=t.target,l=t.global,c=t.stat;if(i=l?nr:c?nr[h]||ar(h,{}):(nr[h]||{}).prototype)for(r in e){if(o=e[r],s=t.dontCallGetSet?(a=rr(i,r))&&a.value:i[r],!lr(l?r:h+(c?".":"#")+r,t.forced)&&void 0!==s){if(n(o)==n(s))continue;hr(o,s)}(t.sham||s&&s.sham)&&sr(o,"sham",!0),or(i,r,o,t)}},ur={exports:{}},dr={},pr=Se,fr=We,gr=M,vr=yn,mr=An,yr=function(t,e,i){var n=pr(e);n in t?fr.f(t,n,gr(0,i)):t[n]=i},br=Array,xr=Math.max,wr=W,Ar=Z,Sr=cn.f,Tr=function(t,e,i){for(var n=mr(t),r=vr(e,n),s=vr(void 0===i?n:i,n),o=br(xr(s-r,0)),a=0;r<s;r++,a++)yr(o,a,t[r]);return o.length=a,o},Cr="object"==("undefined"==typeof window?"undefined":n(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];dr.f=function(t){return Cr&&"Window"==wr(t)?function(t){try{return Sr(t)}catch(t){return Tr(Cr)}}(t):Sr(Ar(t))};var Br=y((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),_r=y,Pr=st,Er=W,Mr=Br,kr=Object.isExtensible,Rr=_r((function(){kr(1)}))||Mr?function(t){return!!Pr(t)&&((!Mr||"ArrayBuffer"!=Er(t))&&(!kr||kr(t)))}:kr,Or=!y((function(){return Object.isExtensible(Object.preventExtensions({}))})),Ir=cr,Dr=D,Lr=Ci,Nr=st,Ur=Qt,Wr=We.f,Fr=cn,jr=dr,zr=Rr,Hr=Or,Gr=!1,Vr=re("meta"),Xr=0,Yr=function(t){Wr(t,Vr,{value:{objectID:"O"+Xr++,weakData:{}}})},qr=ur.exports={enable:function(){qr.enable=function(){},Gr=!0;var t=Fr.f,e=Dr([].splice),i={};i[Vr]=1,t(i).length&&(Fr.f=function(i){for(var n=t(i),r=0,s=n.length;r<s;r++)if(n[r]===Vr){e(n,r,1);break}return n},Ir({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:jr.f}))},fastKey:function(t,e){if(!Nr(t))return"symbol"==n(t)?t:("string"==typeof t?"S":"P")+t;if(!Ur(t,Vr)){if(!zr(t))return"F";if(!e)return"E";Yr(t)}return t[Vr].objectID},getWeakData:function(t,e){if(!Ur(t,Vr)){if(!zr(t))return!0;if(!e)return!1;Yr(t)}return t[Vr].weakData},onFreeze:function(t){return Hr&&Gr&&zr(t)&&!Ur(t,Vr)&&Yr(t),t}};Lr[Vr]=!0;var Kr=ur.exports,$r=W,Zr=D,Jr=function(t){if("Function"===$r(t))return Zr(t)},Qr=kt,ts=x,es=Jr(Jr.bind),is=function(t,e){return Qr(t),void 0===e?t:ts?es(t,e):function(){return t.apply(e,arguments)}},ns={},rs=ns,ss=pe("iterator"),os=Array.prototype,as={};as[pe("toStringTag")]="z";var hs="[object z]"===String(as),ls=it,cs=W,us=pe("toStringTag"),ds=Object,ps="Arguments"==cs(function(){return arguments}()),fs=hs?cs: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=ds(t),us))?i:ps?cs(e):"Object"==(n=cs(e))&&ls(e.callee)?"Arguments":n},gs=fs,vs=It,ms=V,ys=ns,bs=pe("iterator"),xs=function(t){if(!ms(t))return vs(t,bs)||vs(t,"@@iterator")||ys[gs(t)]},ws=S,As=kt,Ss=Ge,Ts=_t,Cs=xs,Bs=TypeError,_s=S,Ps=Ge,Es=It,Ms=is,ks=S,Rs=Ge,Os=_t,Is=function(t){return void 0!==t&&(rs.Array===t||os[ss]===t)},Ds=An,Ls=lt,Ns=function(t,e){var i=arguments.length<2?Cs(t):e;if(As(i))return Ss(ws(i,t));throw Bs(Ts(t)+" is not iterable")},Us=xs,Ws=function(t,e,i){var n,r;Ps(t);try{if(!(n=Es(t,"return"))){if("throw"===e)throw i;return i}n=_s(n,t)}catch(t){r=!0,n=t}if("throw"===e)throw i;if(r)throw n;return Ps(n),i},Fs=TypeError,js=function(t,e){this.stopped=t,this.result=e},zs=js.prototype,Hs=function(t,e,i){var r,s,o,a,h,l,c,u=i&&i.that,d=!(!i||!i.AS_ENTRIES),p=!(!i||!i.IS_RECORD),f=!(!i||!i.IS_ITERATOR),g=!(!i||!i.INTERRUPTED),v=Ms(e,u),m=function(t){return r&&Ws(r,"normal",t),new js(!0,t)},y=function(t){return d?(Rs(t),g?v(t[0],t[1],m):v(t[0],t[1])):g?v(t,m):v(t)};if(p)r=t.iterator;else if(f)r=t;else{if(!(s=Us(t)))throw Fs(Os(t)+" is not iterable");if(Is(s)){for(o=0,a=Ds(t);a>o;o++)if((h=y(t[o]))&&Ls(zs,h))return h;return new js(!1)}r=Ns(t,s)}for(l=p?t.next:r.next;!(c=ks(l,r)).done;){try{h=y(c.value)}catch(t){Ws(r,"throw",t)}if("object"==n(h)&&h&&Ls(zs,h))return h}return new js(!1)},Gs=lt,Vs=TypeError,Xs=function(t,e){if(Gs(e,t))return t;throw Vs("Incorrect invocation")},Ys=pe("iterator"),qs=!1;try{var Ks=0,$s={next:function(){return{done:!!Ks++}},return:function(){qs=!0}};$s[Ys]=function(){return this},Array.from($s,(function(){throw 2}))}catch(t){}var Zs=We.f,Js=Qt,Qs=pe("toStringTag"),to=function(t,e,i){t&&!i&&(t=t.prototype),t&&!Js(t,Qs)&&Zs(t,Qs,{configurable:!0,value:e})},eo=D,io=kt,no=it,ro=String,so=TypeError,oo=function(t,e,i){try{return eo(io(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}},ao=Ge,ho=function(t){if("object"==n(t)||no(t))return t;throw so("Can't set "+ro(t)+" as a prototype")},lo=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=oo(Object.prototype,"__proto__","set"))(i,[]),e=i instanceof Array}catch(t){}return function(i,n){return ao(i),ho(n),e?t(i,n):i.__proto__=n,i}}():void 0),co=it,uo=st,po=lo,fo=cr,go=v,vo=D,mo=ir,yo=ln,bo=Kr,xo=Hs,wo=Xs,Ao=it,So=V,To=st,Co=y,Bo=function(t,e){if(!e&&!qs)return!1;var i=!1;try{var n={};n[Ys]=function(){return{next:function(){return{done:i=!0}}}},t(n)}catch(t){}return i},_o=to,Po=function(t,e,i){var n,r;return po&&co(n=e.constructor)&&n!==i&&uo(r=n.prototype)&&r!==i.prototype&&po(t,r),t},Eo=function(t,e,i){var n=-1!==t.indexOf("Map"),r=-1!==t.indexOf("Weak"),s=n?"set":"add",o=go[t],a=o&&o.prototype,h=o,l={},c=function(t){var e=vo(a[t]);yo(a,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(r&&!To(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return r&&!To(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(r&&!To(t))&&e(this,0===t?0:t)}:function(t,i){return e(this,0===t?0:t,i),this})};if(mo(t,!Ao(o)||!(r||a.forEach&&!Co((function(){(new o).entries().next()})))))h=i.getConstructor(e,t,n,s),bo.enable();else if(mo(t,!0)){var u=new h,d=u[s](r?{}:-0,1)!=u,p=Co((function(){u.has(1)})),f=Bo((function(t){new o(t)})),g=!r&&Co((function(){for(var t=new o,e=5;e--;)t[s](e,e);return!t.has(-0)}));f||((h=e((function(t,e){wo(t,a);var i=Po(new o,t,h);return So(e)||xo(e,i[s],{that:i,AS_ENTRIES:n}),i}))).prototype=a,a.constructor=h),(p||g)&&(c("delete"),c("has"),n&&c("get")),(g||d)&&c(s),r&&a.clear&&delete a.clear}return l[t]=h,fo({global:!0,constructor:!0,forced:h!=o},l),_o(h,t),r||i.setStrong(h,t,n),h},Mo={},ko=On,Ro=In,Oo=Object.keys||function(t){return ko(t,Ro)},Io=b,Do=Fe,Lo=We,No=Ge,Uo=Z,Wo=Oo;Mo.f=Io&&!Do?Object.defineProperties:function(t,e){No(t);for(var i,n=Uo(e),r=Wo(e),s=r.length,o=0;s>o;)Lo.f(t,i=r[o++],n[i]);return t};var Fo,jo=ht("document","documentElement"),zo=Ge,Ho=Mo,Go=In,Vo=Ci,Xo=jo,Yo=_e,qo="prototype",Ko="script",$o=Ti("IE_PROTO"),Zo=function(){},Jo=function(t){return"<"+Ko+">"+t+"</"+Ko+">"},Qo=function(t){t.write(Jo("")),t.close();var e=t.parentWindow.Object;return t=null,e},ta=function(){try{Fo=new ActiveXObject("htmlfile")}catch(t){}var t,e,i;ta="undefined"!=typeof document?document.domain&&Fo?Qo(Fo):(e=Yo("iframe"),i="java"+Ko+":",e.style.display="none",Xo.appendChild(e),e.src=String(i),(t=e.contentWindow.document).open(),t.write(Jo("document.F=Object")),t.close(),t.F):Qo(Fo);for(var n=Go.length;n--;)delete ta[qo][Go[n]];return ta()};Vo[$o]=!0;var ea,ia,na,ra=Object.create||function(t,e){var i;return null!==t?(Zo[qo]=zo(t),i=new Zo,Zo[qo]=null,i[$o]=t):i=ta(),void 0===e?i:Ho.f(i,e)},sa=rn,oa=We,aa=function(t,e,i){return i.get&&sa(i.get,e,{getter:!0}),i.set&&sa(i.set,e,{setter:!0}),oa.f(t,e,i)},ha=ln,la=function(t,e,i){for(var n in e)ha(t,n,e[n],i);return t},ca=!y((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),ua=Qt,da=it,pa=$t,fa=ca,ga=Ti("IE_PROTO"),va=Object,ma=va.prototype,ya=fa?va.getPrototypeOf:function(t){var e=pa(t);if(ua(e,ga))return e[ga];var i=e.constructor;return da(i)&&e instanceof i?i.prototype:e instanceof va?ma:null},ba=y,xa=it,wa=st,Aa=ya,Sa=ln,Ta=pe("iterator"),Ca=!1;[].keys&&("next"in(na=[].keys())?(ia=Aa(Aa(na)))!==Object.prototype&&(ea=ia):Ca=!0);var Ba=!wa(ea)||ba((function(){var t={};return ea[Ta].call(t)!==t}));Ba&&(ea={}),xa(ea[Ta])||Sa(ea,Ta,(function(){return this}));var _a={IteratorPrototype:ea,BUGGY_SAFARI_ITERATORS:Ca},Pa=_a.IteratorPrototype,Ea=ra,Ma=M,ka=to,Ra=ns,Oa=function(){return this},Ia=cr,Da=S,La=it,Na=function(t,e,i,n){var r=e+" Iterator";return t.prototype=Ea(Pa,{next:Ma(+!n,i)}),ka(t,r,!1),Ra[r]=Oa,t},Ua=ya,Wa=lo,Fa=to,ja=ri,za=ln,Ha=ns,Ga=ui.PROPER,Va=ui.CONFIGURABLE,Xa=_a.IteratorPrototype,Ya=_a.BUGGY_SAFARI_ITERATORS,qa=pe("iterator"),Ka="keys",$a="values",Za="entries",Ja=function(){return this},Qa=ht,th=aa,eh=b,ih=pe("species"),nh=ra,rh=aa,sh=la,oh=is,ah=Xs,hh=V,lh=Hs,ch=function(t,e,i,n,r,s,o){Na(i,e,n);var a,h,l,c=function(t){if(t===r&&g)return g;if(!Ya&&t in p)return p[t];switch(t){case Ka:case $a:case Za:return function(){return new i(this,t)}}return function(){return new i(this)}},u=e+" Iterator",d=!1,p=t.prototype,f=p[qa]||p["@@iterator"]||r&&p[r],g=!Ya&&f||c(r),v="Array"==e&&p.entries||f;if(v&&(a=Ua(v.call(new t)))!==Object.prototype&&a.next&&(Ua(a)!==Xa&&(Wa?Wa(a,Xa):La(a[qa])||za(a,qa,Ja)),Fa(a,u,!0)),Ga&&r==$a&&f&&f.name!==$a&&(Va?ja(p,"name",$a):(d=!0,g=function(){return Da(f,this)})),r)if(h={values:c($a),keys:s?g:c(Ka),entries:c(Za)},o)for(l in h)(Ya||d||!(l in p))&&za(p,l,h[l]);else Ia({target:e,proto:!0,forced:Ya||d},h);return p[qa]!==g&&za(p,qa,g,{name:r}),Ha[e]=g,h},uh=function(t,e){return{value:t,done:e}},dh=function(t){var e=Qa(t);eh&&e&&!e[ih]&&th(e,ih,{configurable:!0,get:function(){return this}})},ph=b,fh=Kr.fastKey,gh=Wi.set,vh=Wi.getterFor,mh={getConstructor:function(t,e,i,n){var r=t((function(t,r){ah(t,s),gh(t,{type:e,index:nh(null),first:void 0,last:void 0,size:0}),ph||(t.size=0),hh(r)||lh(r,t[n],{that:t,AS_ENTRIES:i})})),s=r.prototype,o=vh(e),a=function(t,e,i){var n,r,s=o(t),a=h(t,e);return a?a.value=i:(s.last=a={index:r=fh(e,!0),key:e,value:i,previous:n=s.last,next:void 0,removed:!1},s.first||(s.first=a),n&&(n.next=a),ph?s.size++:t.size++,"F"!==r&&(s.index[r]=a)),t},h=function(t,e){var i,n=o(t),r=fh(e);if("F"!==r)return n.index[r];for(i=n.first;i;i=i.next)if(i.key==e)return i};return sh(s,{clear:function(){for(var t=o(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,ph?t.size=0:this.size=0},delete:function(t){var e=this,i=o(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),ph?i.size--:e.size--}return!!n},forEach:function(t){for(var e,i=o(this),n=oh(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)}}),sh(s,i?{get:function(t){var e=h(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),ph&&rh(s,"size",{configurable:!0,get:function(){return o(this).size}}),r},setStrong:function(t,e,i){var n=e+" Iterator",r=vh(e),s=vh(n);ch(t,e,(function(t,e){gh(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)?uh("keys"==e?i.key:"values"==e?i.value:[i.key,i.value],!1):(t.target=void 0,uh(void 0,!0))}),i?"entries":"values",!i,!0),dh(e)}};Eo("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),mh);var yh=W,bh=Array.isArray||function(t){return"Array"==yh(t)},xh=D,wh=y,Ah=it,Sh=fs,Th=yi,Ch=function(){},Bh=[],_h=ht("Reflect","construct"),Ph=/^\s*(?:class|function)\b/,Eh=xh(Ph.exec),Mh=!Ph.exec(Ch),kh=function(t){if(!Ah(t))return!1;try{return _h(Ch,Bh,t),!0}catch(t){return!1}},Rh=function(t){if(!Ah(t))return!1;switch(Sh(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Mh||!!Eh(Ph,Th(t))}catch(t){return!0}};Rh.sham=!0;var Oh=!_h||wh((function(){var t;return kh(kh.call)||!kh(Object)||!kh((function(){t=!0}))||t}))?Rh:kh,Ih=bh,Dh=Oh,Lh=st,Nh=pe("species"),Uh=Array,Wh=function(t){var e;return Ih(t)&&(e=t.constructor,(Dh(e)&&(e===Uh||Ih(e.prototype))||Lh(e)&&null===(e=e[Nh]))&&(e=void 0)),void 0===e?Uh:e},Fh=is,jh=G,zh=$t,Hh=An,Gh=function(t,e){return new(Wh(t))(0===e?0:e)},Vh=D([].push),Xh=function(t){var e=1==t,i=2==t,n=3==t,r=4==t,s=6==t,o=7==t,a=5==t||s;return function(h,l,c,u){for(var d,p,f=zh(h),g=jh(f),v=Fh(l,c),m=Hh(g),y=0,b=u||Gh,x=e?b(h,m):i||o?b(h,0):void 0;m>y;y++)if((a||y in g)&&(p=v(d=g[y],y,f),t))if(e)x[y]=p;else if(p)switch(t){case 3:return!0;case 5:return d;case 6:return y;case 2:Vh(x,d)}else switch(t){case 4:return!1;case 7:Vh(x,d)}return s?-1:n||r?r:x}},Yh={forEach:Xh(0),map:Xh(1),filter:Xh(2),some:Xh(3),every:Xh(4),find:Xh(5),findIndex:Xh(6),filterReject:Xh(7)},qh=D,Kh=la,$h=Kr.getWeakData,Zh=Xs,Jh=Ge,Qh=V,tl=st,el=Hs,il=Qt,nl=Wi.set,rl=Wi.getterFor,sl=Yh.find,ol=Yh.findIndex,al=qh([].splice),hl=0,ll=function(t){return t.frozen||(t.frozen=new cl)},cl=function(){this.entries=[]},ul=function(t,e){return sl(t.entries,(function(t){return t[0]===e}))};cl.prototype={get:function(t){var e=ul(this,t);if(e)return e[1]},has:function(t){return!!ul(this,t)},set:function(t,e){var i=ul(this,t);i?i[1]=e:this.entries.push([t,e])},delete:function(t){var e=ol(this.entries,(function(e){return e[0]===t}));return~e&&al(this.entries,e,1),!!~e}};var dl,pl={getConstructor:function(t,e,i,n){var r=t((function(t,r){Zh(t,s),nl(t,{type:e,id:hl++,frozen:void 0}),Qh(r)||el(r,t[n],{that:t,AS_ENTRIES:i})})),s=r.prototype,o=rl(e),a=function(t,e,i){var n=o(t),r=$h(Jh(e),!0);return!0===r?ll(n).set(e,i):r[n.id]=i,t};return Kh(s,{delete:function(t){var e=o(this);if(!tl(t))return!1;var i=$h(t);return!0===i?ll(e).delete(t):i&&il(i,e.id)&&delete i[e.id]},has:function(t){var e=o(this);if(!tl(t))return!1;var i=$h(t);return!0===i?ll(e).has(t):i&&il(i,e.id)}}),Kh(s,i?{get:function(t){var e=o(this);if(tl(t)){var i=$h(t);return!0===i?ll(e).get(t):i?i[e.id]:void 0}},set:function(t,e){return a(this,t,e)}}:{add:function(t){return a(this,t,!0)}}),r}},fl=Or,gl=v,vl=D,ml=la,yl=Kr,bl=Eo,xl=pl,wl=st,Al=Wi.enforce,Sl=y,Tl=wi,Cl=Object,Bl=Array.isArray,_l=Cl.isExtensible,Pl=Cl.isFrozen,El=Cl.isSealed,Ml=Cl.freeze,kl=Cl.seal,Rl={},Ol={},Il=!gl.ActiveXObject&&"ActiveXObject"in gl,Dl=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Ll=bl("WeakMap",Dl,xl),Nl=Ll.prototype,Ul=vl(Nl.set);if(Tl)if(Il){dl=xl.getConstructor(Dl,"WeakMap",!0),yl.enable();var Wl=vl(Nl.delete),Fl=vl(Nl.has),jl=vl(Nl.get);ml(Nl,{delete:function(t){if(wl(t)&&!_l(t)){var e=Al(this);return e.frozen||(e.frozen=new dl),Wl(this,t)||e.frozen.delete(t)}return Wl(this,t)},has:function(t){if(wl(t)&&!_l(t)){var e=Al(this);return e.frozen||(e.frozen=new dl),Fl(this,t)||e.frozen.has(t)}return Fl(this,t)},get:function(t){if(wl(t)&&!_l(t)){var e=Al(this);return e.frozen||(e.frozen=new dl),Fl(this,t)?jl(this,t):e.frozen.get(t)}return jl(this,t)},set:function(t,e){if(wl(t)&&!_l(t)){var i=Al(this);i.frozen||(i.frozen=new dl),Fl(this,t)?Ul(this,t,e):i.frozen.set(t,e)}else Ul(this,t,e);return this}})}else fl&&Sl((function(){var t=Ml([]);return Ul(new Ll,t,1),!Pl(t)}))&&ml(Nl,{set:function(t,e){var i;return Bl(t)&&(Pl(t)?i=Rl:El(t)&&(i=Ol)),Ul(this,t,e),i==Rl&&Ml(t),i==Ol&&kl(t),this}});var zl=ht,Hl=D,Gl=Yt,Vl=zl("Map"),Xl=zl("WeakMap"),Yl=Hl([].push),ql=Gl("metadata"),Kl=ql.store||(ql.store=new Xl),$l=function(t,e,i){var n=Kl.get(t);if(!n){if(!i)return;Kl.set(t,n=new Vl)}var r=n.get(e);if(!r){if(!i)return;n.set(e,r=new Vl)}return r},Zl={store:Kl,getMap:$l,has:function(t,e,i){var n=$l(e,i,!1);return void 0!==n&&n.has(t)},get:function(t,e,i){var n=$l(e,i,!1);return void 0===n?void 0:n.get(t)},set:function(t,e,i,n){$l(i,n,!0).set(t,e)},keys:function(t,e){var i=$l(t,e,!1),n=[];return i&&i.forEach((function(t,e){Yl(n,e)})),n},toKey:function(t){return void 0===t||"symbol"==n(t)?t:String(t)}},Jl=Ge,Ql=Zl.toKey,tc=Zl.set;cr({target:"Reflect",stat:!0},{defineMetadata:function(t,e,i){var n=arguments.length<4?void 0:Ql(arguments[3]);tc(t,e,Jl(i),n)}});var ec=Ge,ic=Zl.toKey,nc=Zl.getMap,rc=Zl.store;cr({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var i=arguments.length<3?void 0:ic(arguments[2]),n=nc(ec(e),i,!1);if(void 0===n||!n.delete(t))return!1;if(n.size)return!0;var r=rc.get(e);return r.delete(i),!!r.size||rc.delete(e)}});var sc=Ge,oc=ya,ac=Zl.has,hc=Zl.get,lc=Zl.toKey,cc=function t(e,i,n){if(ac(e,i,n))return hc(e,i,n);var r=oc(i);return null!==r?t(e,r,n):void 0};cr({target:"Reflect",stat:!0},{getMetadata:function(t,e){var i=arguments.length<3?void 0:lc(arguments[2]);return cc(t,sc(e),i)}});var uc=D,dc=Map.prototype,pc={Map:Map,set:uc(dc.set),get:uc(dc.get),has:uc(dc.has),remove:uc(dc.delete),proto:dc},fc=S,gc=D,vc=function(t,e,i){for(var n,r,s=i||t.next;!(n=fc(s,t)).done;)if(void 0!==(r=e(n.value)))return r},mc=pc.Map,yc=pc.proto,bc=gc(yc.forEach),xc=gc(yc.entries),wc=xc(new mc).next,Ac=kt,Sc=V,Tc=An,Cc=$t,Bc=function(t,e,i){return i?vc(xc(t),(function(t){return e(t[1],t[0])}),wc):bc(t,e)},_c=pc.Map,Pc=pc.has,Ec=pc.set,Mc=D([].push),kc=cr,Rc=D,Oc=Zl,Ic=Ge,Dc=ya,Lc=Rc((function(t){var e,i,n,r=Cc(this),s=Tc(r),o=[],a=new _c,h=Sc(t)?function(t){return t}:Ac(t);for(e=0;e<s;e++)n=h(i=r[e]),Pc(a,n)||Ec(a,n,i);return Bc(a,(function(t){Mc(o,t)})),o})),Nc=Rc([].concat),Uc=Oc.keys,Wc=Oc.toKey,Fc=function t(e,i){var n=Uc(e,i),r=Dc(e);if(null===r)return n;var s=t(r,i);return s.length?n.length?Lc(Nc(n,s)):s:n};kc({target:"Reflect",stat:!0},{getMetadataKeys:function(t){var e=arguments.length<2?void 0:Wc(arguments[1]);return Fc(Ic(t),e)}});var jc=Ge,zc=Zl.get,Hc=Zl.toKey;cr({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var i=arguments.length<3?void 0:Hc(arguments[2]);return zc(t,jc(e),i)}});var Gc=Ge,Vc=Zl.keys,Xc=Zl.toKey;cr({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:Xc(arguments[1]);return Vc(Gc(t),e)}});var Yc=Ge,qc=ya,Kc=Zl.has,$c=Zl.toKey,Zc=function t(e,i,n){if(Kc(e,i,n))return!0;var r=qc(i);return null!==r&&t(e,r,n)};cr({target:"Reflect",stat:!0},{hasMetadata:function(t,e){var i=arguments.length<3?void 0:$c(arguments[2]);return Zc(t,Yc(e),i)}});var Jc=Ge,Qc=Zl.has,tu=Zl.toKey;cr({target:"Reflect",stat:!0},{hasOwnMetadata:function(t,e){var i=arguments.length<3?void 0:tu(arguments[2]);return Qc(t,Jc(e),i)}});var eu=Ge,iu=Zl.toKey,nu=Zl.set;cr({target:"Reflect",stat:!0},{metadata:function(t,e){return function(i,n){nu(t,e,eu(i),iu(n))}}});var ru="named",su="name",ou="unmanaged",au="optional",hu="inject",lu="multi_inject",cu="inversify:tagged",uu="inversify:tagged_props",du="inversify:paramtypes",pu="post_construct",fu="pre_destroy";var gu=[hu,lu,su,ou,ru,au],vu={Request:"Request",Singleton:"Singleton",Transient:"Transient"},mu={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},yu={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},bu=0;function xu(){return bu++}var wu=function(){function t(t,e){this.id=xu(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=mu.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===vu.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}(),Au="Metadata key was used more than once in a parameter:",Su="NULL argument",Tu="Key Not Found",Cu="Ambiguous match found for serviceIdentifier:",Bu="No matching bindings found for serviceIdentifier:",_u="Missing required @injectable annotation in:",Pu="Missing required @inject or @multiInject annotation in:",Eu="Circular dependency found:",Mu="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",ku=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."},Ru=function(t,e){return"@postConstruct error in class "+t+": "+e},Ou=function(t,e){return"@preDestroy error in class "+t+": "+e},Iu=function(t,e){return"onDeactivation() error in class "+t+": "+e},Du="Maximum call stack size exceeded",Lu=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(du,t),userGeneratedMetadata:Reflect.getMetadata(cu,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(uu,t)||[]},t}(),Nu={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function Uu(t){return t instanceof RangeError||t.message===Du}function Wu(t){return"function"==typeof t?t.name:"symbol"===n(t)?t.toString():t}function Fu(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=Hu(t.implementationType)),n=n+"\n "+e,t.constraint.metaData&&(n=n+" - "+t.constraint.metaData)}))),n}function ju(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||ju(t.parentRequest,e))}function zu(t){t.childRequests.forEach((function(t){if(ju(t,t.serviceIdentifier)){var e=function(t){var e=function t(e,i){void 0===i&&(i=[]);var n=Wu(e.serviceIdentifier);return i.push(n),null!==e.parentRequest?t(e.parentRequest,i):i}(t);return e.reverse().join(" --\x3e ")}(t);throw new Error(Eu+" "+e)}zu(t)}))}function Hu(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 Gu=function(){function t(t){this.id=xu(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}(),Vu=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===ru?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},t}(),Xu=function(t,e){this.parentContext=t,this.rootRequest=e},Yu=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}(),qu=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}(),Ku=function(){function t(t,e,i,r){this.id=xu(),this.type=t,this.serviceIdentifier=i;var s="symbol"===n(e)?e.toString().slice(7,-1):e;this.name=new qu(s||""),this.identifier=e,this.metadata=new Array;var o=null;"string"==typeof r?o=new Vu(ru,r):r instanceof Vu&&(o=r),null!==o&&this.metadata.push(o)}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(lu)},t.prototype.matchesArray=function(t){return this.matchesTag(lu)(t)},t.prototype.isNamed=function(){return this.hasTag(ru)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return gu.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(au)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===ru}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return gu.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(ru)(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}(),$u=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 Zu(t,e,i,n){var r=t.getConstructorMetadata(i),s=r.compilerGeneratedMetadata;if(void 0===s)throw new Error(_u+" "+e+".");var o=r.userGeneratedMetadata,a=Object.keys(o),h=0===i.length&&a.length>0,l=a.length>i.length,c=function(t,e,i,n,r){for(var s=[],o=0;o<r;o++){var a=Ju(o,t,e,i,n);null!==a&&s.push(a)}return s}(n,e,s,o,h||l?a.length:i.length),u=td(t,i,e);return $u($u([],c,!0),u,!0)}function Ju(t,e,i,n,r){var s=r[t.toString()]||[],o=id(s),a=!0!==o.unmanaged,h=n[t],l=o.inject||o.multiInject;if((h=l||h)instanceof Yu&&(h=h.unwrap()),a){if(!e&&(h===Object||h===Function||void 0===h))throw new Error(Pu+" argument "+t+" in class "+i+".");var c=new Ku(yu.ConstructorArgument,o.targetName,h);return c.metadata=s,c}return null}function Qu(t,e,i,n){var r=t||e;if(void 0===r){var s=_u+" for property "+String(i)+" in class "+n+".";throw new Error(s)}return r}function td(t,e,i){for(var n=t.getPropertiesMetadata(e),r=[],s=Object.getOwnPropertySymbols(n),o=0,a=Object.keys(n).concat(s);o<a.length;o++){var h=a[o],l=n[h],c=id(l),u=c.targetName||h,d=Qu(c.inject,c.multiInject,h,i),p=new Ku(yu.ClassProperty,u,d);p.metadata=l,r.push(p)}var f=Object.getPrototypeOf(e.prototype).constructor;if(f!==Object){var g=td(t,f,i);r=$u($u([],r,!0),g,!0)}return r}function ed(t,e){var i=Object.getPrototypeOf(e.prototype).constructor;if(i!==Object){var n=Zu(t,Hu(i),i,!0),r=n.map((function(t){return t.metadata.filter((function(t){return t.key===ou}))})),s=[].concat.apply([],r).length,o=n.length-s;return o>0?o:ed(t,i)}return 0}function id(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[hu],multiInject:e[lu],targetName:e[su],unmanaged:e[ou]}}var nd=function(){function t(t,e,i,n,r){this.id=xu(),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 rd(t){return t._bindingDictionary}function sd(t,e,i,n,r){var s=ad(i.container,r.serviceIdentifier),o=[];return s.length===Nu.NoBindingsAvailable&&i.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(i.container.bind(r.serviceIdentifier).toSelf(),s=ad(i.container,r.serviceIdentifier)),o=e?s:s.filter((function(t){var e=new nd(t.serviceIdentifier,i,n,t,r);return t.constraint(e)})),function(t,e,i,n){switch(e.length){case Nu.NoBindingsAvailable:if(i.isOptional())return e;var r=Wu(t),s=Bu;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+=Fu(n,r,ad),new Error(s);case Nu.OnlyOneBindingAvailable:return e;case Nu.MultipleBindingsAvailable:default:if(i.isArray())return e;r=Wu(t),s=Cu+" "+r;throw s+=Fu(n,r,ad),new Error(s)}}(r.serviceIdentifier,o,r,i.container),o}function od(t,e,i,n,r,s){var o,a;if(null===r){o=sd(t,e,n,null,s),a=new nd(i,n,null,o,s);var h=new Xu(n,a);n.addPlan(h)}else o=sd(t,e,n,r,s),a=r.addChildRequest(s.serviceIdentifier,o,s);o.forEach((function(e){var i=null;if(s.isArray())i=a.addChildRequest(e.serviceIdentifier,e,s);else{if(e.cache)return;i=a}if(e.type===mu.Instance&&null!==e.implementationType){var r=function(t,e){return Zu(t,Hu(e),e,!1)}(t,e.implementationType);if(!n.container.options.skipBaseClassChecks){var o=ed(t,e.implementationType);if(r.length<o){var h=ku(Hu(e.implementationType));throw new Error(h)}}r.forEach((function(e){od(t,!1,e.serviceIdentifier,n,i,e)}))}}))}function ad(t,e){var i=[],n=rd(t);return n.hasKey(e)?i=n.get(e):null!==t.parent&&(i=ad(t.parent,e)),i}function hd(t,e,i,n,r,s,o,a){void 0===a&&(a=!1);var h=new Gu(e),l=function(t,e,i,n,r,s){var o=new Vu(t?lu:hu,i),a=new Ku(e,n,i,o);if(void 0!==r){var h=new Vu(r,s);a.metadata.push(h)}return a}(i,n,r,"",s,o);try{return od(t,a,r,h,null,l),h}catch(t){throw Uu(t)&&zu(h.plan.rootRequest),t}}function ld(t){return("object"===n(t)&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function cd(t){return!!ld(t)||Array.isArray(t)&&t.some(ld)}var ud,dd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(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(o,a)}h((n=n.apply(t,e||[])).next())}))},pd=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)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 o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}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,a])}}},fd=function(t,e,i){t.has(e.id)||t.set(e.id,i)},gd=function(t,e){t.cache=e,t.activated=!0,ld(e)&&vd(t,e)},vd=function(t,e){return dd(void 0,void 0,void 0,(function(){var i,n;return pd(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"}(ud||(ud={}));var md=function(){return md=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},md.apply(this,arguments)},yd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(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(o,a)}h((n=n.apply(t,e||[])).next())}))},bd=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)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 o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}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,a])}}},xd=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 wd(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===yu.ConstructorArgument?t.constructorInjections.push(n):(t.propertyRequests.push(i),t.propertyInjections.push(n)),t.isAsync||(t.isAsync=cd(n)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,i),s=md(md({},r),{constr:t});n=r.isAsync?function(t){return yd(this,void 0,void 0,(function(){var e,i;return bd(this,(function(n){switch(n.label){case 0:return[4,Sd(t.constructorInjections)];case 1:return e=n.sent(),[4,Sd(t.propertyInjections)];case 2:return i=n.sent(),[2,Ad(md(md({},t),{constructorInjections:e,propertyInjections:i}))]}}))}))}(s):Ad(s)}else n=new t;return n}function Ad(t){var e,i=new((e=t.constr).bind.apply(e,xd([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 Sd(t){return yd(this,void 0,void 0,(function(){var e,i,n,r;return bd(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 Td(t,e){var i=function(t,e){var i,n;if(Reflect.hasMetadata(pu,t)){var r=Reflect.getMetadata(pu,t);try{return null===(n=(i=e)[r.value])||void 0===n?void 0:n.call(i)}catch(e){throw new Error(Ru(t.name,e.message))}}}(t,e);return ld(i)?i.then((function(){return e})):e}function Cd(t,e){t.scope!==vu.Singleton&&function(t,e){var i="Class cannot be instantiated in "+(t.scope===vu.Request?"request":"transient")+" scope.";if("function"==typeof t.onDeactivation)throw new Error(Iu(e.name,i));if(Reflect.hasMetadata(fu,e))throw new Error(Ou(e.name,i))}(t,e)}var Bd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(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(o,a)}h((n=n.apply(t,e||[])).next())}))},_d=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)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 o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}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,a])}}},Pd=function t(e){return function(i){i.parentContext.setCurrentRequest(i);var n=i.bindings,r=i.childRequests,s=i.target&&i.target.isArray(),o=!(i.parentRequest&&i.parentRequest.target&&i.target&&i.parentRequest.target.matchesArray(i.target.serviceIdentifier));if(s&&o)return r.map((function(i){return t(e)(i)}));if(!i.target.isOptional()||0!==n.length){var a=n[0];return Rd(e,i,a)}}},Ed=function(t,e){var i=function(t){switch(t.type){case mu.Factory:return{factory:t.factory,factoryType:ud.Factory};case mu.Provider:return{factory:t.provider,factoryType:ud.Provider};case mu.DynamicValue:return{factory:t.dynamicValue,factoryType:ud.DynamicValue};default:throw new Error("Unexpected factory type "+t.type)}}(t);return function(t,e){try{return t()}catch(t){throw Uu(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}))},Md=function(t,e,i){var n,r=e.childRequests;switch(function(t){var e=null;switch(t.type){case mu.ConstantValue:case mu.Function:e=t.cache;break;case mu.Constructor:case mu.Instance:e=t.implementationType;break;case mu.DynamicValue:e=t.dynamicValue;break;case mu.Provider:e=t.provider;break;case mu.Factory:e=t.factory}if(null===e){var i=Wu(t.serviceIdentifier);throw new Error("Invalid binding type: "+i)}}(i),i.type){case mu.ConstantValue:case mu.Function:n=i.cache;break;case mu.Constructor:n=i.implementationType;break;case mu.Instance:n=function(t,e,i,n){Cd(t,e);var r=wd(e,i,n);return ld(r)?r.then((function(t){return Td(e,t)})):Td(e,r)}(i,i.implementationType,r,Pd(t));break;default:n=Ed(i,e.parentContext)}return n},kd=function(t,e,i){var n=function(t,e){return e.scope===vu.Singleton&&e.activated?e.cache:e.scope===vu.Request&&t.has(e.id)?t.get(e.id):null}(t,e);return null!==n||function(t,e,i){e.scope===vu.Singleton&&gd(e,i),e.scope===vu.Request&&fd(t,e,i)}(t,e,n=i()),n},Rd=function(t,e,i){return kd(t,i,(function(){var n=Md(t,e,i);return n=ld(n)?n.then((function(t){return Od(e,i,t)})):Od(e,i,n)}))};function Od(t,e,i){var n,r=Id(t.parentContext,e,i),s=Ud(t.parentContext.container),o=s.next();do{n=o.value;var a=t.parentContext,h=t.serviceIdentifier,l=Nd(n,h);r=ld(r)?Ld(l,a,r):Dd(l,a,r),o=s.next()}while(!0!==o.done&&!rd(n).hasKey(t.serviceIdentifier));return r}var Id=function(t,e,i){return"function"==typeof e.onActivation?e.onActivation(t,i):i},Dd=function(t,e,i){for(var n=t.next();!n.done;){if(ld(i=n.value(e,i)))return Ld(t,e,i);n=t.next()}return i},Ld=function(t,e,i){return Bd(void 0,void 0,void 0,(function(){var n,r;return _d(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]}}))}))},Nd=function(t,e){var i=t._activations;return i.hasKey(e)?i.get(e).values():[].values()},Ud=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 Wd=function t(e,i){var n=e.parentRequest;return null!==n&&(!!i(n)||t(n,i))},Fd=function(t){return function(e){var i=function(i){return null!==i&&null!==i.target&&i.target.matchesTag(t)(e)};return i.metaData=new Vu(t,e),i}},jd=Fd(ru),zd=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}},Hd=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new Gd(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=jd(t),new Gd(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 Gd(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=Fd(t)(e),new Gd(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return null!==e&&zd(t)(e.parentRequest)},new Gd(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return null!==e&&jd(t)(e.parentRequest)},new Gd(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&Fd(t)(e)(i.parentRequest)},new Gd(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&Wd(e,zd(t))},new Gd(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&!Wd(e,zd(t))},new Gd(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Wd(e,jd(t))},new Gd(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&!Wd(e,jd(t))},new Gd(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&Wd(i,Fd(t)(e))},new Gd(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&!Wd(i,Fd(t)(e))},new Gd(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&Wd(e,t)},new Gd(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&!Wd(e,t)},new Gd(this._binding)},t}(),Gd=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new Hd(this._binding)},t.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new Hd(this._binding)},t}(),Vd=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Hd(this._binding),this._bindingOnSyntax=new Gd(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}(),Xd=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=vu.Request,new Vd(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=vu.Singleton,new Vd(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=vu.Transient,new Vd(this._binding)},t}(),Yd=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Hd(this._binding),this._bindingOnSyntax=new Gd(this._binding),this._bindingInSyntax=new Xd(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}(),qd=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=mu.Instance,this._binding.implementationType=t,new Yd(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=mu.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=vu.Singleton,new Vd(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=mu.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Yd(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=mu.Constructor,this._binding.implementationType=t,this._binding.scope=vu.Singleton,new Vd(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=mu.Factory,this._binding.factory=t,this._binding.scope=vu.Singleton,new Vd(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=mu.Function,this._binding.scope=vu.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=mu.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=vu.Singleton,new Vd(this._binding)},t.prototype.toAutoNamedFactory=function(t){return this._binding.type=mu.Factory,this._binding.factory=function(e){return function(i){return e.container.getNamed(t,i)}},new Vd(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=mu.Provider,this._binding.provider=t,this._binding.scope=vu.Singleton,new Vd(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}(),Kd=function(){function t(){}return t.of=function(e,i,n,r,s){var o=new t;return o.bindings=e,o.middleware=i,o.deactivations=r,o.activations=n,o.moduleActivationStore=s,o},t}();var $d=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(Su);if(null==e)throw new Error(Su);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(Su);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(Tu)},t.prototype.remove=function(t){if(null==t)throw new Error(Su);if(!this._map.delete(t))throw new Error(Tu)},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=[],o=0,a=n;o<a.length;o++){var h=a[o];t(h)?i.push(h):s.push(h)}e._setValue(r,s)})),i},t.prototype.hasKey=function(t){if(null==t)throw new Error(Su);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}(),Zd=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 $d,onDeactivations:new $d}},t}(),Jd=function(){return Jd=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},Jd.apply(this,arguments)},Qd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(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(o,a)}h((n=n.apply(t,e||[])).next())}))},tp=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)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 o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}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,a])}}},ep=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))},ip=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=vu.Transient;else if(e.defaultScope!==vu.Singleton&&e.defaultScope!==vu.Transient&&e.defaultScope!==vu.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=xu(),this._bindingDictionary=new $d,this._snapshots=[],this._middleware=null,this._activations=new $d,this._deactivations=new $d,this.parent=null,this._metadataReader=new Lu,this._moduleActivationStore=new Zd}return t.merge=function(e,i){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=new t,o=ep([e,i],n,!0).map((function(t){return rd(t)})),a=rd(s);return o.forEach((function(t){var e;e=a,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],o=i(s.id);s.registry(o.bindFunction,o.unbindFunction,o.isboundFunction,o.rebindFunction,o.unbindAsyncFunction,o.onActivationFunction,o.onDeactivationFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Qd(this,void 0,void 0,(function(){var e,i,n,r,s;return tp(this,(function(o){switch(o.label){case 0:e=this._getContainerModuleHelpersFactory(),i=0,n=t,o.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:o.sent(),o.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 Qd(this,void 0,void 0,(function(){var e,i,n,r;return tp(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||vu.Transient,i=new wu(t,e);return this._bindingDictionary.add(t,i),new qd(i)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.rebindAsync=function(t){return Qd(this,void 0,void 0,(function(){return tp(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 Qd(this,void 0,void 0,(function(){var e;return tp(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 $d},t.prototype.unbindAllAsync=function(){return Qd(this,void 0,void 0,(function(){var t,e=this;return tp(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 $d,[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,ru,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 Ku(yu.Variable,"",e,new Vu(i,n)),s=new Gu(t);return new nd(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(Kd.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 Qd(this,void 0,void 0,(function(){var e;return tp(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 Qd(this,void 0,void 0,(function(){var n;return tp(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,ru,e)},t.prototype.getNamedAsync=function(t,e){return this.getTaggedAsync(t,ru,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,ru,e)},t.prototype.getAllNamedAsync=function(t,e){return this.getAllTaggedAsync(t,ru,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(fu,t))return e[Reflect.getMetadata(fu,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(ld(r))return this._handleDeactivationError(r.then((function(){return i._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,e,n)})),n)}var s=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,e,n);if(ld(s))return this._handleDeactivationError(s,n)}catch(t){throw new Error(Iu(n.name,t.message))}},t.prototype._handleDeactivationError=function(t,e){return Qd(this,void 0,void 0,(function(){var i;return tp(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(Iu(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(ld(r))return r.then((function(){return i._deactivateContainerAsync(t,e)}));n=e.next()}},t.prototype._deactivateContainerAsync=function(t,e){return Qd(this,void 0,void 0,(function(){var i;return tp(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:(o=s,function(i){var n=t.bind(i);return e(n,o),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 o}},t.prototype._getAll=function(t){return Promise.all(this._get(t))},t.prototype._get=function(t){var e=Jd(Jd({},t),{contextInterceptor:function(t){return t},targetType:yu.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(cd(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=hd(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return function(t){return Pd(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}(i=e.contextInterceptor(i))}},t.prototype._deactivateIfSingleton=function(t){var e=this;if(t.activated)return ld(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(ld(this._deactivateIfSingleton(n)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}},t.prototype._deactivateSingletonsAsync=function(t){return Qd(this,void 0,void 0,(function(){var e=this;return tp(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 Qd(this,void 0,void 0,(function(){return tp(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: "+Wu(t))}},t.prototype._bindingDeactivationAndPreDestroy=function(t,e,i){var n=this;if("function"==typeof t.onDeactivation){var r=t.onDeactivation(e);if(ld(r))return r.then((function(){return n._preDestroy(i,e)}))}return this._preDestroy(i,e)},t.prototype._bindingDeactivationAndPreDestroyAsync=function(t,e,i){return Qd(this,void 0,void 0,(function(){return tp(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}(),np=function(t){this.id=xu(),this.registry=t};function rp(t,e,i,n){!function(t){if(void 0!==t)throw new Error(Mu)}(e),op(cu,t,i.toString(),n)}function sp(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(Au+" "+i.toString())}else e=[t];return e}function op(t,e,i,n){var r=sp(n),s={};Reflect.hasOwnMetadata(t,e)&&(s=Reflect.getMetadata(t,e));var o=s[i];if(void 0===o)o=[];else for(var a=function(t){if(r.some((function(e){return e.key===t.key})))throw new Error(Au+" "+t.key.toString())},h=0,l=o;h<l.length;h++){a(l[h])}o.push.apply(o,r),s[i]=o,Reflect.defineMetadata(t,s,e)}function ap(t){return function(e,i,n){"number"==typeof n?rp(e,i,n,t):function(t,e,i){if(void 0!==t.prototype)throw new Error(Mu);op(uu,t.constructor,e,i)}(e,i,t)}}function hp(){return function(t){if(Reflect.hasOwnMetadata(du,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(du,e,t),t}}function lp(t){return ap(new Vu(ru,t))}function cp(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 ap(new Vu(t,e))(i,n,r)}}}var up=cp(hu),dp=cp(lu);var pp,fp,gp=(pp=pu,fp="Cannot apply @postConstruct decorator multiple times in the same class",function(){return function(t,e){var i=new Vu(pp,e);if(Reflect.hasOwnMetadata(pp,t.constructor))throw new Error(fp);Reflect.defineMetadata(pp,i,t.constructor)}});function vp(t,e,i,r){var s,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var h=t.length-1;h>=0;h--)(s=t[h])&&(a=(o<3?s(a):o>3?s(e,i,a):s(e,i))||a);return o>3&&a&&Object.defineProperty(e,i,a),a}function mp(t,e){return function(i,n){e(i,n,t)}}function yp(t,e){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function bp(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(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(o,a)}h((n=n.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const xp=Symbol("ContributionProvider");class wp{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 Ap(t,e){t(xp).toDynamicValue((({container:t})=>new wp(e,t))).inSingletonScope().whenTargetNamed(e)}function Sp(t,e){t(xp).toDynamicValue((({container:t})=>new wp(e,t))).whenTargetNamed(e)}class Tp{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 Cp extends Tp{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const Bp=Symbol.for("EnvContribution"),_p=Symbol.for("VGlobal"),Pp="browser";t.DefaultGlobal=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv(Pp),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv(Pp),this.envContribution.supportEvent}get supportsTouchEvents(){return this._env||this.setEnv(Pp),this.envContribution.supportsTouchEvents}get supportsPointerEvents(){return this._env||this.setEnv(Pp),this.envContribution.supportsPointerEvents}get supportsMouseEvents(){return this._env||this.setEnv(Pp),this.envContribution.supportsMouseEvents}get applyStyles(){return this._env||this.setEnv(Pp),this.envContribution.applyStyles}constructor(t){this.contributions=t,this.hooks={onSetEnv:new Cp(["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(Pp),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv(Pp),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(Pp),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv(Pp),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv(Pp),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv(Pp),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv(Pp),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv(Pp),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv(Pp),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv(Pp),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv(Pp),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv(Pp),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv(Pp),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv(Pp),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)}isChrome(){return this._env||this.setEnv("browser"),"browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1}isSafari(){return this._env||this.setEnv("browser"),"browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}getElementTop(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}},t.DefaultGlobal=vp([hp(),mp(0,up(xp)),mp(0,lp(Bp)),yp("design:paramtypes",[Object])],t.DefaultGlobal);var Ep={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,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.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},a.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,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,r,s,o){var a=i?i+t:t;if(!this._events[a])return!1;var h,l,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,r),!0;case 5:return c.fn.call(c.context,e,n,r,s),!0;case 6:return c.fn.call(c.context,e,n,r,s,o),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,n);break;case 4:c[l].fn.call(c[l].context,e,n,r);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},a.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var h=0,l=[],c=a.length;h<c;h++)(a[h].fn!==e||r&&!a[h].once||n&&a[h].context!==n)&&l.push(a[h]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(Ep);var Mp=i(Ep.exports),kp=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},Rp=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||kp(t,"Boolean")},Op=function(t){return"function"==typeof t},Ip=function(t){return null==t},Dp=function(t){return null!=t},Lp=function(t){var e=n(t);return null!==t&&"object"===e||"function"===e},Np=function(t){return void 0===t},Up=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n(t);return e?"string"===i:"string"===i||kp(t,"String")},Wp=function(t){return Array.isArray?Array.isArray(t):kp(t,"Array")},Fp=function(t){return kp(t,"Date")},jp=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n(t);return e?"number"===i:"number"===i||kp(t,"Number")},zp=function(t){return jp(t)&&Number.isFinite(t)},Hp=function(t){return new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t)},Gp=function(t){return kp(t,"RegExp")},Vp=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)},Xp=function(t,e,i){for(var n=Up(e)?e.split("."):e,r=0;r<n.length;r++)t=t?t[n[r]]:void 0;return void 0===t?i:t},Yp=Object.prototype.hasOwnProperty,qp=function(t,e){return null!=t&&Yp.call(t,e)};function Kp(t,e){if(!Wp(t)||!Wp(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 $p=1e-10,Zp=1e-10;function Jp(t,e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$p,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zp)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}var Qp=1e-12,tf=Math.PI,ef=tf/2,nf=2*tf,rf=2*Math.PI,sf=Math.abs,of=Math.atan2,af=Math.cos,hf=Math.max,lf=Math.min,cf=Math.sin,uf=Math.sqrt,df=Math.pow;function pf(t){return t>1?0:t<-1?tf:Math.acos(t)}function ff(t){return t>=1?ef:t<=-1?-ef:Math.asin(t)}function gf(t,e,i,n,r){var s,o;return"number"==typeof t&&"number"==typeof i&&(s=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(o=(1-r)*e+r*n),{x:s,y:o}}function vf(t,e){return t[0]*e[1]-t[1]*e[0]}var mf=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 o(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 jp(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return jp(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}(),yf=function(){function t(){r(this,t)}return o(t,null,[{key:"distancePP",value:function(t,e){return uf(df(t.x-e.x,2)+df(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,i,n){return uf(df(t-i,2)+df(e-n,2))}},{key:"distancePN",value:function(t,e,i){return uf(df(e-t.x,2)+df(i-t.y,2))}},{key:"pointAtPP",value:function(t,e,i){return new mf((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}]),t}();function bf(t,e,i){var n=e.x1,r=e.y1,s=e.x2,o=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*o+i.e,i.b*s+i.d*o+i.f),t.add(i.a*n+i.c*o+i.e,i.b*n+i.d*o+i.f),e)}var xf=function(){function t(e){r(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return o(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 Wp(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 bf(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,o=this.y2,a=Math.cos(t),h=Math.sin(t),l=e-e*a+i*h,c=i-e*h-i*a;return[a*n-h*r+l,h*n+a*r+c,a*n-h*o+l,h*n+a*o+c,a*s-h*r+l,h*s+a*r+c,a*s-h*o+l,h*s+a*o+c]}},{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}(),wf=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&&l(t,e)}(i,t);var e=u(i);function i(){return r(this,i),e.apply(this,arguments)}return o(i)}(xf);var Af=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-nf;)t+=nf;else if(t>0)for(;t>nf;)t-=nf;return t};function Sf(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}var Tf,Cf,Bf,_f,Pf,Ef,Mf,kf,Rf,Of=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,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=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=o,this.f=a}return o(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,o=this.f,a=new t,h=e*r-i*n;return a.a=r/h,a.b=-i/h,a.c=-n/h,a.d=e/h,a.e=(n*o-r*s)/h,a.f=-(e*o-i*s)/h,a}},{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,o=this.b*-i+this.d*e;return this.a=n,this.b=r,this.c=s,this.d=o,this}},{key:"rotateByCenter",value:function(t,e,i){var n=Math.cos(t),r=Math.sin(t),s=(1-n)*e+r*i,o=(1-n)*i-r*e,a=n*this.a-r*this.b,h=r*this.a+n*this.b,l=n*this.c-r*this.d,c=r*this.c+n*this.d,u=n*this.e-r*this.f+s,d=r*this.e+n*this.f+o;return this.a=a,this.b=h,this.c=l,this.d=c,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 o=this.a,a=this.b,h=this.c,l=this.d,c=o*t+h*e,u=a*t+l*e,d=o*i+h*n,p=a*i+l*n,f=o*r+h*s+this.e,g=a*r+l*s+this.f;return this.a=c,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,o=this.e,a=this.f,h=i*s-n*r,l=s/h,c=-n/h,u=-r/h,d=i/h,p=(r*a-s*o)/h,f=-(i*a-n*o)/h,g=t.x,v=t.y;e.x=g*l+v*u+p,e.y=g*c+v*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 o=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),s.scaleX=o,s.scaleY=r/o,s.skewX=(t*i+e*n)/r,s.skewY=0}else if(0!==i||0!==n){var a=Math.sqrt(i*i+n*n);s.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/a):-Math.acos(i/a)),s.scaleX=r/a,s.scaleY=a,s.skewX=0,s.skewY=(t*i+e*n)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}]),t}();function If(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function Df(t,e,i,n){if(!function(t,e,i,n){var r,s=t[0],o=e[0],a=i[0],h=n[0];return o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),!(o<a||h<s||(s=t[1],o=e[1],a=i[1],h=n[1],o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),o<a||h<s))}(t,e,i,n))return!1;var r,s,o=[0,0],a=[0,0],h=[0,0];if(If(o,e,t),If(a,n,i),sf((r=o)[0]-(s=a)[0])+sf(r[1]-s[1])<1e-12)return!0;If(h,i,t);var l=vf(h,a)/vf(o,a);return l>=0&&l<=1&&[t[0]+o[0]*l,t[1]+o[1]*l]}function Lf(t,e,i){var n,r,s,o;return!(t&&e&&(i?(Tf=t.x1,Cf=t.x2,Bf=t.y1,_f=t.y2,Pf=e.x1,Ef=e.x2,Mf=e.y1,kf=e.y2,Tf>Cf&&(n=[Cf,Tf],Tf=n[0],Cf=n[1]),Bf>_f&&(r=[_f,Bf],Bf=r[0],_f=r[1]),Pf>Ef&&(s=[Ef,Pf],Pf=s[0],Ef=s[1]),Mf>kf&&(o=[kf,Mf],Mf=o[0],kf=o[1]),Tf>Ef||Cf<Pf||Bf>kf||_f<Mf):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"}(Rf||(Rf={}));var Nf=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 Uf=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(),Dp(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=Dp(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return o(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(Ip(this._canvas)&&(Dp(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),Ip(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&Dp(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),Ip(this._context)&&Dp(this._canvas)){var t=this._canvas.getContext("2d");Dp(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,o=t.fontWeight,a=void 0===o?e.fontWeight:o,h=t.fontSize,l=void 0===h?e.fontSize:h,c=t.fontFamily;return(n?n+" ":"")+(s?s+" ":"")+(a?a+" ":"")+l+"px "+((void 0===c?e.fontFamily:c)||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!Ip(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,o=s.fontStyle,a=void 0===o?r.fontStyle:o,h=s.fontVariant,l=void 0===h?r.fontVariant:h,c=s.fontWeight,u=void 0===c?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":c,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,v=s.align,m=s.textAlign,y=void 0===m?null!=v?v:"center":m,b=s.baseline,x=s.textBaseline,w=void 0===x?null!=b?b:"middle":x,A=s.ellipsis,S=s.limit,T=s.lineHeight;return{fontStyle:a,fontVariant:l,fontFamily:g,fontSize:p,fontWeight:u,textAlign:y,textBaseline:w,ellipsis:A,limit:S,lineHeight:void 0===T?p:T}}},{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(Ip(t))return{width:0,height:0};if(Ip(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);var e,i=this.textSpec,n=i.fontFamily,r=i.fontSize,s=i.fontWeight,o=i.textAlign,a=i.textBaseline,h=i.ellipsis,l=i.limit,c=i.lineHeight;try{var u=this._option.getTextBounds({text:t,fontFamily:n,fontSize:r,fontWeight:s,textAlign:o,textBaseline:a,ellipsis:!!h,maxLineWidth:l||1/0,lineHeight:c});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);Ip(s)&&t.NUMBERS_CHAR_SET.includes(r)&&(s=this._measureNumberChar()),Ip(s)&&["F","W"].includes(Nf(r))&&(s=this._measureFullSizeChar()),Ip(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 o=t[s],a=["F","W"].includes(Nf(o))?1:.53;e.width+=a*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(Ip(t))return s;if(Wp(t)){var o=t.filter(Dp).map((function(t){return t.toString()}));return 0===o.length?s:1===o.length?e(o[0]):{width:o.reduce((function(t,i){return Math.max(t,e(i).width)}),0),height:o.length*((null!=r?r:n)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(Ip(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 Ip(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(Ip(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 Dp(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){Dp(this._canvas)&&(this._canvas=null),Dp(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}]),t}();Uf.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Uf.NUMBERS_CHAR_SET="0123456789",Uf.FULL_SIZE_CHAR="字";const Wf=nf-1e-8;class Ff{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,s){if(Math.abs(r-n)>Wf)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let o,a,h,l,c=1/0,u=-1/0,d=1/0,p=-1/0;function f(t){h=i*Math.cos(t),l=i*Math.sin(t),h<c&&(c=h),h>u&&(u=h),l<d&&(d=l),l>p&&(p=l)}if(f(n),f(r),r!==n)if((n%=nf)<0&&(n+=nf),(r%=nf)<0&&(r+=nf),r<n&&(s=!s,o=n,n=r,r=o),s)for(r-=nf,o=n-n%ef,a=0;a<4&&o>r;++a,o-=ef)f(o);else for(o=n-n%ef+ef,a=0;a<4&&o<r;++a,o+=ef)f(o);this.bounds.add(t+c,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 jf{constructor(){this.curves=[],this.bounds=new wf}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const zf=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Hf={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},Gf={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Vf,Xf,Yf,qf,Kf,$f;function Zf(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(Vf=e[t],Xf=Vf.slice(1),Yf=Vf[0],i=[Yf],n=Xf.match(zf),null!==n){for(let t=0,e=n.length;t<e;t++)qf=n[t],Kf=parseFloat(qf),Number.isNaN(Kf)||i.push(Kf);if($f=Hf[Yf],i.length-1>$f){let t;for(let e=1,n=i.length;e<n;e+=$f){t=[Yf];for(let n=e,r=e+$f;n<r;n++)t.push(i[n]);r.push(t)}}else r.push(i)}else r.push(i);return r}var Jf,Qf,tg,eg,ig,ng,rg,sg;function og(t,e,i,n,r,s,o,a,h){const l=o*(Math.PI/180);const c=Math.sin(l),u=Math.cos(l),d=u*(a-t)*.5+c*(h-e)*.5,p=u*(h-e)*.5-c*(a-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,v=c/i,m=-c/n,y=u/n,b=g*a+v*h,x=m*a+y*h,w=g*t+v*e,A=m*t+y*e;let S=1/((w-b)*(w-b)+(A-x)*(A-x))-.25;S<0&&(S=0);let T=Math.sqrt(S);s===r&&(T=-T);const C=.5*(b+w)-T*(A-x),B=.5*(x+A)+T*(w-b),_=Math.atan2(x-B,b-C);let P=Math.atan2(A-B,w-C)-_;P<0&&1===s?P+=nf:P>0&&0===s&&(P-=nf);const E=Math.ceil(Math.abs(P/(ef+.001))),M=[];for(let t=0;t<E;++t){const e=_+t*P/E,r=_+(t+1)*P/E;M[t]=[C,B,e,r,i,n,c,u]}return M}function ag(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=h*s,c=-a*o,u=a*s,d=h*o,p=Math.cos(n),f=Math.sin(n),g=Math.cos(r),v=Math.sin(r),m=.5*(r-n),y=Math.sin(.5*m),b=8/3*y*y/Math.sin(m),x=e+p-b*f,w=i+f+b*p,A=e+g,S=i+v,T=A+b*v,C=S-b*g;return[l*x+c*w,u*x+d*w,l*T+c*C,u*T+d*C,l*A+c*S,u*A+d*S]}function hg(t,e,i,n){const r=og(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=ag(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(Jf=t.UpdateTag||(t.UpdateTag={}))[Jf.NONE=0]="NONE",Jf[Jf.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",Jf[Jf.UPDATE_SHAPE=2]="UPDATE_SHAPE",Jf[Jf.CLEAR_SHAPE=253]="CLEAR_SHAPE",Jf[Jf.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",Jf[Jf.INIT=179]="INIT",Jf[Jf.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",Jf[Jf.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",Jf[Jf.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",Jf[Jf.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",Jf[Jf.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",Jf[Jf.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",Jf[Jf.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",Jf[Jf.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",t.IContainPointMode=void 0,(Qf=t.IContainPointMode||(t.IContainPointMode={}))[Qf.GLOBAL=1]="GLOBAL",Qf[Qf.LOCAL=16]="LOCAL",Qf[Qf.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",Qf[Qf.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(tg=t.AttributeUpdateType||(t.AttributeUpdateType={}))[tg.INIT=0]="INIT",tg[tg.DEFAULT=1]="DEFAULT",tg[tg.STATE=2]="STATE",tg[tg.ANIMATE_BIND=10]="ANIMATE_BIND",tg[tg.ANIMATE_PLAY=11]="ANIMATE_PLAY",tg[tg.ANIMATE_START=12]="ANIMATE_START",tg[tg.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",tg[tg.ANIMATE_END=14]="ANIMATE_END",tg[tg.TRANSLATE=20]="TRANSLATE",tg[tg.TRANSLATE_TO=21]="TRANSLATE_TO",tg[tg.SCALE=22]="SCALE",tg[tg.SCALE_TO=23]="SCALE_TO",tg[tg.ROTATE=24]="ROTATE",tg[tg.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(eg=t.AnimateStatus||(t.AnimateStatus={}))[eg.INITIAL=0]="INITIAL",eg[eg.RUNNING=1]="RUNNING",eg[eg.PAUSED=2]="PAUSED",eg[eg.END=3]="END",t.AnimateMode=void 0,(ig=t.AnimateMode||(t.AnimateMode={}))[ig.NORMAL=0]="NORMAL",ig[ig.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(ng=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",ng.from="from",ng.to="to",ng.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,(rg=t.CurveTypeEnum||(t.CurveTypeEnum={}))[rg.CubicBezierCurve=0]="CubicBezierCurve",rg[rg.QuadraticBezierCurve=1]="QuadraticBezierCurve",rg[rg.ArcCurve=2]="ArcCurve",rg[rg.LineCurve=3]="LineCurve",rg[rg.EllipseCurve=4]="EllipseCurve",rg[rg.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(sg=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[sg.beforeFillStroke=0]="beforeFillStroke",sg[sg.afterFillStroke=1]="afterFillStroke";const lg=(t,e,i,n,r,s,o)=>{const a=Math.abs(i-e),h=4*Math.tan(a/4)/3,l=i<e?-1:1,c=Math.cos(e),u=Math.sin(e),d=Math.cos(i),p=Math.sin(i),f=c*s+n,g=u*o+r,v=d*s+n,m=p*o+r,y=s*h*l,b=o*h*l;t.push(f-y*u,g+b*c,v+y*p,m-b*d,v,m)},cg=[(t,e,i,n,r,s,o)=>e.arc(t[1]*r+i,t[2]*s+n,t[3]*(r+s)/2,t[4],t[5],t[6],o),(t,e,i,n,r,s,o)=>e.arcTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*(r+s)/2,o),(t,e,i,n,r,s,o)=>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,o),(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,o)=>e.lineTo(t[1]*r+i,t[2]*s+n,o),(t,e,i,n,r,s,o)=>e.moveTo(t[1]*r+i,t[2]*s+n,o),(t,e,i,n,r,s,o)=>e.quadraticCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,o),(t,e,i,n,r,s,o)=>e.rect(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,o)];function ug(t,e,i=0,n=0,r=1,s=1,o){for(let a=0;a<t.length;a++){const h=t[a];cg[h[0]](h,e,i,n,r,s,o)}}class dg{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function pg(t,e){let i=0;const n=t.length;for(let r=0;r<n;r++){const s=t[r],o=e[r],a=t[(r+1)%n],h=e[(r+1)%n];i+=yf.distanceNN(s,o,a,h)}return i/2}function fg(t,e,i,n,r){return pg([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function gg(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 vg(t,e,i,n,r){const s=gg(t.x,e.x,i.x,n.x,r),o=gg(t.y,e.y,i.y,n.y,r);return new mf(s,o)}function mg(t,e){const{p0:i,p1:n,p2:r,p3:s}=t,o=vg(i,n,r,s,e),a=yf.pointAtPP(i,n,e),h=yf.pointAtPP(n,r,e),l=yf.pointAtPP(r,s,e),c=yf.pointAtPP(a,h,e),u=yf.pointAtPP(h,l,e);return[new yg(i,a,c,o),new yg(o,u,l,s)]}class yg extends dg{constructor(e,i,n,r){super(),this.type=t.CurveTypeEnum.CubicBezierCurve,this.p0=e,this.p1=i,this.p2=n,this.p3=r}_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 vg(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?fg(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(e){return e===t.Direction.ROW?sf(this.p0.x-this.p3.x):e===t.Direction.COLUMN?sf(this.p0.y-this.p3.y):0}getAngleAt(t){const e=hf(t-.01,0),i=lf(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return of(r.y-n.y,r.x-n.x)}}function bg(t,e){const{p0:i,p1:n}=t,r=yf.pointAtPP(i,n,e);return[new xg(i,r),new xg(r,n)]}class xg extends dg{constructor(e,i){super(),this.type=t.CurveTypeEnum.LineCurve,this.p0=e,this.p1=i}getPointAt(t){if(!1!==this.defined)return yf.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=of(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()?yf.distancePP(this.p0,this.p1):60}calcProjLength(e){return e===t.Direction.ROW?sf(this.p0.x-this.p1.x):e===t.Direction.COLUMN?sf(this.p0.y-this.p1.y):0}}class wg{get endX(){return this._lastX}get endY(){return this._lastY}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,o,a){const h=new yg(new mf(this._lastX,this._lastY),new mf(t,e),new mf(i,n),new mf(r,s));h.originP1=this._lastOriginP,h.originP2=a,h.defined=o,this.curves.push(h),this._lastX=r,this._lastY=s,this._lastOriginP=a}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const r=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,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,n,r){const s=new xg(new mf(this._lastX,this._lastY),new mf(t,e));return s.originP1=n,s.originP2=r,s.defined=i,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(e){var i,n;if(e===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(i=e.p3)&&void 0!==i?i:e.p1;return sf(t.p0.y-n.y)}if(e===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return sf(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Ag extends wg{bezierCurveTo(t,e,i,n,r,s,o,a){return super.bezierCurveTo(e,t,n,i,s,r,o,a)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function Sg(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 Tg{constructor(t,e){this.context=t,e&&(this.startPoint=e)}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,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Cg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new wg("linear",null!=n?n:sf(e[e.length-1].x-e[0].x)>sf(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Bg(new Tg(s,r),e),s}function Bg(t,e){return Sg(t,e,1)}function _g(t,e,i,n,r){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,t.lastPoint1)}class Pg{constructor(t,e){this.context=t,this.startPoint=e}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)_g(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);(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,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:_g(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,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Eg(t,e){return Sg(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 Cg(e,i);const s=new wg("basis",null!=n?n:sf(e[e.length-1].x-e[0].x)>sf(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Eg(new Pg(s,r),e),s}function kg(t){return t<0?-1:1}function Rg(t,e,i){const n=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(n||Number(r<0&&-0)),o=(i-t._y1)/(r||Number(n<0&&-0)),a=(s*r+o*n)/(n+r);return(kg(s)+kg(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function Og(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Ig(t,e,i,n,r){const s=t._x0,o=t._y0,a=t._x1,h=t._y1,l=(a-s)/3;t.context.bezierCurveTo(s+l,o+l*e,a-l,h-l*i,a,h,n,t.lastPoint1)}class Dg{constructor(t,e){this.context=t,this.startPoint=e}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,this.lastPoint1);break;case 3:Ig(this,this._t0,Og(this,this._t0),!1!==this._lastDefined2,this.lastPoint1)}(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,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,Ig(this,Og(this,e=Rg(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Ig(this,this._t0,e=Rg(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,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}}tryUpdateLength(){return this.context.tryUpdateLength()}}class Lg extends Dg{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Ng(t,e){return Sg(t,e,2)}function Ug(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return Cg(e,i);const s=new wg("monotoneX",null!=n?n:sf(e[e.length-1].x-e[0].x)>sf(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Ng(new Dg(s,r),e),s}function Wg(t,e){return Sg(t,e,2)}function Fg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return Cg(e,i);const s=new Ag("monotoneY",null!=n?n:sf(e[e.length-1].x-e[0].x)>sf(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Wg(new Lg(s,r),e),s}let jg=class{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}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.lastPoint),(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,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function zg(e,i,n={}){const{direction:r,startPoint:s}=n;if(e.length<2-Number(!!s))return null;const o=new wg("step",null!=r?r:sf(e[e.length-1].x-e[0].x)>sf(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Hg(new jg(o,i,s),e),o}function Hg(t,e){return Sg(t,e,1)}class Gg{constructor(t,e){this.context=t,e&&(this.startPoint=e)}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,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Vg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new wg("linear",null!=n?n:sf(e[e.length-1].x-e[0].x)>sf(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Xg(new Gg(s,r),e),s}function Xg(t,e){return Sg(t,e,1)}function Yg(t,e,i){switch(e){case"linear":default:return Cg(t,i);case"basis":return Mg(t,i);case"monotoneX":return Ug(t,i);case"monotoneY":return Fg(t,i);case"step":return zg(t,.5,i);case"stepBefore":return zg(t,0,i);case"stepAfter":return zg(t,1,i);case"linearClosed":return Vg(t,i)}}class qg extends jf{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Ff(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Gf.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Gf.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Gf.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([Gf.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([Gf.AT,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}ellipse(t,e,i,n,r,s,o,a){return this.commandList.push([Gf.E,t,e,i,n,r,s,o,a]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,s,o,a),this}rect(t,e,i,n){return this.commandList.push([Gf.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([Gf.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([Gf.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[Gf.M]=t=>`M${t[1]} ${t[2]}`,t[Gf.L]=t=>`L${t[1]} ${t[2]}`,t[Gf.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Gf.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Gf.A]=t=>{const e=[];lg(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[Gf.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=Zf(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=Yg(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[Gf.M]=this.moveToTransform,t[Gf.L]=this.lineToTransform,t[Gf.Q]=this.quadraticCurveToTransform,t[Gf.C]=this.bezierCurveToTransform,t[Gf.AT]=this.arcToTransform,t[Gf.E]=this.ellipseTransform,t[Gf.R]=this.rectTransform,t[Gf.A]=this.arcTransform,t[Gf.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,o,a,h,l,c=null,u=0,d=0,p=0,f=0;for(let g=0,v=t.length;g<v;++g){switch(s=t[g],1===n&&1===r||(s=$g(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":o=u+s[5],a=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,o+e,a+i),u=o,d=a;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":o=u+s[3],a=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,o+e,a+i),p=u+s[1],f=d+s[2],u=o,d=a;break;case"S":o=s[3],a=s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,s[1]+e,s[2]+i,o+e,a+i),u=o,d=a,p=s[1],f=s[2];break;case"q":o=u+s[3],a=d+s[4],p=u+s[1],f=d+s[2],this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a;break;case"Q":o=s[3],a=s[4],this.quadraticCurveTo(s[1]+e,s[2]+i,o+e,a+i),u=o,d=a,p=s[1],f=s[2];break;case"t":o=u+s[1],a=d+s[2],null===c[0].match(/[QqTt]/)?(p=u,f=d):"t"===c[0]?(p=2*u-h,f=2*d-l):"q"===c[0]&&(p=2*u-p,f=2*d-f),h=p,l=f,this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a,p=u+s[1],f=d+s[2];break;case"T":o=s[1],a=s[2],p=2*u-p,f=2*d-f,this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a;break;case"a":hg(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":hg(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()}c=s}}_runCommandList(t,e=0,i=0,n=1,r=1){if(0!==e||0!==i||1!==n||1!==r)for(let s=0,o=t.length;s<o;++s){const o=t[s].slice();switch(o[0]){case Gf.L:this.lineToTransform(o,e,i,n,r);break;case Gf.M:this.moveToTransform(o,e,i,n,r);break;case Gf.C:this.bezierCurveToTransform(o,e,i,n,r);break;case Gf.Q:this.quadraticCurveToTransform(o,e,i,n,r);break;case Gf.A:this.arcToTransform(o,e,i,n,r);break;case Gf.E:this.ellipseTransform(o,e,i,n,r);break;case Gf.R:this.rectTransform(o,e,i,n,r);break;case Gf.AT:this.arcToTransform(o,e,i,n,r);break;case Gf.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),ug(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 sf(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 sf(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 Kg=["l",0,0,0,0,0,0,0];function $g(t,e,i){const n=Kg[0]=t[0];if("a"===n||"A"===n)Kg[1]=e*t[1],Kg[2]=i*t[2],Kg[3]=t[3],Kg[4]=t[4],Kg[5]=t[5],Kg[6]=e*t[6],Kg[7]=i*t[7];else if("h"===n||"H"===n)Kg[1]=e*t[1];else if("v"===n||"V"===n)Kg[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)Kg[n]=(n%2==1?e:i)*t[n];return Kg}const Zg={alignSelf:"auto"},Jg={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,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new Of},Qg={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},tv={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},ev=Object.assign({outerBorder:Object.assign(Object.assign({},tv),{distance:0}),innerBorder:Object.assign(Object.assign({},tv),{distance:0})},tv),iv={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,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0},nv=Object.assign(Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:0,blur:0,cursor:null,html:null},Qg),ev),Zg),rv={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},sv={_debug_bounds:!1},ov=Object.assign(Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1},sv),nv),Jg);const av=Object.assign(Object.assign({},ov),{startAngle:0,endAngle:rf,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),hv=Object.assign(Object.assign(Object.assign({},ov),rv),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),lv=Object.assign(Object.assign({},ov),{radius:1,startAngle:0,endAngle:rf}),cv=Object.assign(Object.assign({},ov),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start"}),uv=Object.assign(Object.assign({},ov),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),dv=Object.assign(Object.assign(Object.assign({},ov),rv),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),pv=Object.assign(Object.assign({},ov),{path:new qg,customPath:()=>{console.warn("空函数")}}),fv=Object.assign(Object.assign({},ov),{points:[],cornerRadius:0,closePath:!0}),gv=Object.assign(Object.assign({},ov),{width:0,height:0,strokeBoundsBuffer:0,cornerRadius:0}),vv=Object.assign(Object.assign({},ov),{width:0,height:0,cornerRadius:0,length:0}),mv=Object.assign(Object.assign({},ov),{symbolType:"circle",size:10,keepDirIn3d:!0}),yv=Object.assign(Object.assign(Object.assign({},ov),iv),{strokeBoundsBuffer:0,keepDirIn3d:!0}),bv=Object.assign(Object.assign({},ov),{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}),xv=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},ov),{fill:!0,cornerRadius:0}),wv=Object.assign(Object.assign({},xv),{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});const Av=new class{},Sv={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"}},Tv=!0,Cv=!1,Bv=/\w|\(|\)|-/,_v=/[.?!,;:/,。?!、;:]/,Pv=/\S/;function Ev(t,e,i,n,r){if(!e||e<=0)return 0;const s=Av.graphicUtil.textMeasure;let o=n,a=t.slice(0,o),h=Math.floor(s.measureText(a,i).width),l=t.slice(0,o+1),c=Math.floor(s.measureText(l,i).width);for(;h>e||c<=e;){if(h>e?o--:o++,o>t.length){o=t.length;break}if(o<0){o=0;break}a=t.slice(0,o),h=Math.floor(s.measureText(a,i).width),l=t.slice(0,o+1),c=Math.floor(s.measureText(l,i).width)}return r&&(o=Mv(t,o)),o}function Mv(t,e){let i=e;for(;Bv.test(t[i-1])&&Bv.test(t[i])||_v.test(t[i]);)if(i--,i<=0)return e;return i}function kv(t,e){const i=Av.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}let Rv=class{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=yv.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){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:iv.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.actualBoundingBoxAscent-n.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:iv.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.fontBoundingBoxAscent-n.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,n){if(0===t.length)return{verticalList:t,width:0};const{fontSize:r=12}=e;t.forEach((t=>{t.width=0===t.direction?r:this.measureTextWidth(t.text,e)}));const s=[];let o=0,a=0;for(;a<t.length&&o+t[a].width<i;a++)o+=t[a].width,s.push(t[a]);if(t[a]&&t[a].text.length>1){const r=this._clipText(t[a].text,e,i-o,0,t[a].text.length-1);if(n&&r.str!==t[a].text){let i="",n=0;for(let e=0;e<a;e++){const r=t[e];i+=r.text,n+=r.text.length}i+=t[a].text;let s=Mv(i,n+r.str.length);s-=n,s!==r.str.length-1&&(r.str=r.str.substring(0,s),r.width=this.measureTextWidth(r.str,e))}s.push(Object.assign(Object.assign({},t[a]),{text:r.str,width:r.width})),o+=r.width}return{verticalList:s,width:o}}clipText(t,e,i,n){if(0===t.length)return{str:"",width:0};let r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};if(r=this.measureTextWidth(t[0],e),r>i)return{str:"",width:0};const s=this._clipText(t,e,i,0,t.length-1);if(n&&s.str!==t){const i=Mv(t,s.str.length);i!==s.str.length&&(s.str=t.substring(0,i),s.width=this.measureTextWidth(s.str,e))}return s}_clipText(t,e,i,n,r){const s=Math.floor((n+r)/2),o=t.substring(0,s+1),a=this.measureTextWidth(o,e);let h;if(a>i){if(o.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(a<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:o,width:a}:this._clipText(t,e,i,s,r)}return{str:o,width:a}}clipTextWithSuffixVertical(t,e,i,n,r){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};const s=this.clipTextVertical(t,e,i,r);if(s.verticalList.length===t.length&&s.verticalList[s.verticalList.length-1].width===t[t.length-1].width)return s;const o=this.measureTextWidth(n,e);if(o>i)return s;i-=o;const a=this.clipTextVertical(t,e,i,r);return a.width+=o,a.verticalList.push({text:n,direction:1,width:o}),a}clipTextWithSuffix(t,e,i,n,r){if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};const s=this.measureTextWidth(t,e);if(s<=i)return{str:t,width:s};const o=this.measureTextWidth(n,e);if(o>i)return{str:"",width:0};i-=o;const a=this._clipText(t,e,i,0,t.length-1);if(r&&a.str!==t){const i=Mv(t,a.str.length);i!==a.str.length&&(a.str=t.substring(0,i),a.width=this.measureTextWidth(a.str,e))}return a.str+=n,a.width+=o,a}};Rv=vp([hp()],Rv);const Ov=Symbol.for("TextMeasureContribution");let Iv=class extends Rv{};Iv=vp([hp()],Iv);const Dv=new ip,Lv=Symbol.for("CanvasFactory"),Nv=Symbol.for("Context2dFactory");function Uv(t){return Dv.getNamed(Lv,Av.global.env)(t)}const Wv=1e-4,Fv=Math.sqrt(3),jv=1/3;function zv(t){return t>-im&&t<im}function Hv(t){return t>im||t<-im}const Gv=[0,0],Vv=[0,0],Xv=[0,0];function Yv(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function qv(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function Kv(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 $v(t){return(t%=rf)<0&&(t+=rf),t}function Zv(t,e,i,n,r,s){if(s>e&&s>n||s<e&&s<n)return 0;if(n===e)return 0;const o=(s-e)/(n-e);let a=n<e?1:-1;1!==o&&0!==o||(a=n<e?.5:-.5);const h=o*(i-t)+t;return h===r?1/0:h>r?a:0}function Jv(t,e,i,n,r,s,o,a,h){if(0===o)return!1;const l=o;if(h>e+l&&h>n+l&&h>s+l||h<e-l&&h<n-l&&h<s-l||a>t+l&&a>i+l&&a>r+l||a<t-l&&a<i-l&&a<r-l)return!1;const c=function(t,e,i,n,r,s,o,a,h){let l=0,c=.005,u=1/0;Gv[0]=o,Gv[1]=a;for(let o=0;o<1;o+=.05){Vv[0]=qv(t,i,r,o),Vv[1]=qv(e,n,s,o);const a=Yv(Gv,Vv);a<u&&(l=o,u=a)}u=1/0;for(let o=0;o<32&&!(c<Wv);o++){const o=l-c,a=l+c;Vv[0]=qv(t,i,r,o),Vv[1]=qv(e,n,s,o);const h=Yv(Vv,Gv);if(o>=0&&h<u)l=o,u=h;else{Xv[0]=qv(t,i,r,a),Xv[1]=qv(e,n,s,a);const o=Yv(Xv,Gv);a<=1&&o<u?(l=a,u=o):c*=.5}}return h&&(h[0]=qv(t,i,r,l),h[1]=qv(e,n,s,l)),Math.sqrt(u)}(t,e,i,n,r,s,a,h,null);return c<=l/2}function Qv(t,e,i,n,r,s,o,a,h,l,c){if(0===h)return!1;const u=h;if(c>e+u&&c>n+u&&c>s+u&&c>a+u||c<e-u&&c<n-u&&c<s-u&&c<a-u||l>t+u&&l>i+u&&l>r+u&&l>o+u||l<t-u&&l<i-u&&l<r-u&&l<o-u)return!1;const d=function(t,e,i,n,r,s,o,a,h,l,c){let u,d,p,f,g=0,v=.005,m=1/0;Gv[0]=h,Gv[1]=l;for(let h=0;h<1;h+=.05)Vv[0]=Kv(t,i,r,o,h),Vv[1]=Kv(e,n,s,a,h),p=Yv(Gv,Vv),p<m&&(g=h,m=p);m=1/0;for(let h=0;h<32&&!(v<Wv);h++)u=g-v,d=g+v,Vv[0]=Kv(t,i,r,o,u),Vv[1]=Kv(e,n,s,a,u),p=Yv(Vv,Gv),u>=0&&p<m?(g=u,m=p):(Xv[0]=Kv(t,i,r,o,d),Xv[1]=Kv(e,n,s,a,d),f=Yv(Xv,Gv),d<=1&&f<m?(g=d,m=f):v*=.5);return c&&(c[0]=Kv(t,i,r,o,g),c[1]=Kv(e,n,s,a,g)),Math.sqrt(m)}(t,e,i,n,r,s,o,a,l,c,null);return d<=u/2}function tm(t,e,i,n,r,s,o,a,h){if(0===o)return!1;const l=o;a-=t,h-=e;const c=Math.sqrt(a*a+h*h);if(c-l>i||c+l<i)return!1;if(Math.abs(n-r)%rf<1e-4)return!0;if(s){const t=n;n=$v(r),r=$v(t)}else n=$v(n),r=$v(r);n>r&&(r+=rf);let u=Math.atan2(h,a);return u<0&&(u+=rf),u>=n&&u<=r||u+rf>=n&&u+rf<=r}function em(t,e,i,n,r,s,o){if(0===r)return!1;const a=r,h=r/2;let l=0,c=t;if(o>e+h&&o>n+h||o<e-h&&o<n-h||s>t+h&&s>i+h||s<t-h&&s<i-h)return!1;if(t===i)return Math.abs(s-t)<=a/2;l=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=l*s-o+c;return u*u/(l*l+1)<=a/2*a/2}const im=1e-4;function nm(t,e,i,n,r){const s=6*i-12*e+6*t,o=9*e+3*n-3*t-9*i,a=3*e-3*t;let h=0;if(zv(o)){if(Hv(s)){const t=-a/s;t>=0&&t<=1&&(r[h++]=t)}}else{const t=s*s-4*o*a;if(zv(t))r[0]=-s/(2*o);else if(t>0){const e=Math.sqrt(t),i=(-s+e)/(2*o),n=(-s-e)/(2*o);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}const rm=[-1,-1,-1],sm=[-1,-1];function om(){const t=sm[0];sm[0]=sm[1],sm[1]=t}function am(t,e,i,n,r,s,o,a,h,l){if(l>e&&l>n&&l>s&&l>a||l<e&&l<n&&l<s&&l<a)return 0;const c=function(t,e,i,n,r,s){const o=n+3*(e-i)-t,a=3*(i-2*e+t),h=3*(e-t),l=t-r,c=a*a-3*o*h,u=a*h-9*o*l,d=h*h-3*a*l;let p=0;if(zv(c)&&zv(u))if(zv(a))s[0]=0;else{const t=-h/a;t>=0&&t<=1&&(s[p++]=t)}else{const t=u*u-4*c*d;if(zv(t)){const t=u/c,e=-a/o+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=c*a+1.5*o*(-u+e),n=c*a+1.5*o*(-u-e);i=i<0?-Math.pow(-i,jv):Math.pow(i,jv),n=n<0?-Math.pow(-n,jv):Math.pow(n,jv);const r=(-a-(i+n))/(3*o);r>=0&&r<=1&&(s[p++]=r)}else{const t=(2*c*a-3*o*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),r=(-a-2*i*n)/(3*o),h=(-a+i*(n+Fv*Math.sin(e)))/(3*o),l=(-a+i*(n-Fv*Math.sin(e)))/(3*o);r>=0&&r<=1&&(s[p++]=r),h>=0&&h<=1&&(s[p++]=h),l>=0&&l<=1&&(s[p++]=l)}}return p}(e,n,s,a,l,rm);if(0===c)return 0;let u=0,d=-1,p=0,f=0;for(let l=0;l<c;l++){const c=rm[l],g=0===c||1===c?.5:1;Kv(t,i,r,o,c)<h||(d<0&&(d=nm(e,n,s,a,sm),sm[1]<sm[0]&&d>1&&om(),p=Kv(e,n,s,a,sm[0]),d>1&&(f=Kv(e,n,s,a,sm[1]))),2===d?c<sm[0]?u+=p<e?g:-g:c<sm[1]?u+=f<p?g:-g:u+=a<f?g:-g:c<sm[0]?u+=p<e?g:-g:u+=a<p?g:-g)}return u}function hm(t,e,i,n,r,s,o,a){if(a>e&&a>n&&a>s||a<e&&a<n&&a<s)return 0;const h=function(t,e,i,n,r){const s=t-2*e+i,o=2*(e-t),a=t-n;let h=0;if(zv(s)){if(Hv(o)){const t=-a/o;t>=0&&t<=1&&(r[h++]=t)}}else{const t=o*o-4*s*a;if(zv(t)){const t=-o/(2*s);t>=0&&t<=1&&(r[h++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-o+e)/(2*s),n=(-o-e)/(2*s);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}(e,n,s,a,rm);if(0===h)return 0;const l=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,s);if(l>=0&&l<=1){let a=0;const c=qv(e,n,s,l);for(let n=0;n<h;n++){const h=0===rm[n]||1===rm[n]?.5:1;qv(t,i,r,rm[n])<o||(rm[n]<l?a+=c<e?h:-h:a+=s<c?h:-h)}return a}const c=0===rm[0]||1===rm[0]?.5:1;return qv(t,i,r,rm[0])<o?0:s<e?c:-c}function lm(t,e,i,n,r,s,o,a){if((a-=e)>i||a<-i)return 0;const h=Math.sqrt(i*i-a*a);rm[0]=-h,rm[1]=h;const l=Math.abs(n-r);if(l<1e-4)return 0;if(l>=rf-1e-4){n=0,r=rf;const e=s?1:-1;return o>=rm[0]+t&&o<=rm[1]+t?e:0}if(n>r){const t=n;n=r,r=t}n<0&&(n+=rf,r+=rf);let c=0;for(let e=0;e<2;e++){const i=rm[e];if(i+t>o){let t=Math.atan2(a,i),e=s?1:-1;t<0&&(t=rf+t),(t>=n&&t<=r||t+rf>=n&&t+rf<=r)&&(t>tf/2&&t<1.5*tf&&(e=-e),c+=e)}}return c}function cm(t){return Math.round(t/tf*1e8)/1e8%2*tf}function um(t,e){let i=cm(t[0]);i<0&&(i+=rf);const n=i-t[0];let r=t[1];r+=n,!e&&r-i>=rf?r=i+rf:e&&i-r>=rf?r=i-rf:!e&&i>r?r=i+(rf-cm(i-r)):e&&i<r&&(r=i-(rf-cm(r-i))),t[0]=i,t[1]=r}const dm=[0,0];function pm(t,e,i,n,r){const s=t,o=t.length;let a,h,l=0,c=0,u=0,d=0,p=0;for(let t=0;t<o;t++){const o=s[t],f=0===t;o[0]===Gf.M&&t>1&&(i||(l+=Zv(c,u,d,p,n,r))),f&&(c=o[1],u=o[2],d=c,p=u);const g=o[0],v=o[1],m=o[2],y=o[3],b=o[4],x=o[5],w=o[6];let A=b,S=x;dm[0]=A,dm[1]=S,um(dm,Boolean(o[6])),A=dm[0],S=dm[1];const T=A,C=S-A,B=!!(1-(o[6]?0:1)),_=(n-v)*y/y+v;switch(g){case Gf.M:d=v,p=m,c=d,u=p;break;case Gf.L:if(i){if(em(c,u,v,m,e,n,r))return!0}else l+=Zv(c,u,v,m,n,r)||0;c=v,u=m;break;case Gf.C:if(i){if(Qv(c,u,v,m,y,b,x,w,e,n,r))return!0}else l+=am(c,u,v,m,y,b,x,w,n,r)||0;c=x,u=w;break;case Gf.Q:if(i){if(Jv(c,u,v,m,y,b,e,n,r))return!0}else l+=hm(c,u,v,m,y,b,n,r)||0;c=y,u=b;break;case Gf.A:if(a=Math.cos(T)*y+v,h=Math.sin(T)*y+m,f?(d=a,p=h):l+=Zv(c,u,a,h,n,r),i){if(tm(v,m,y,T,T+C,B,e,_,r))return!0}else l+=lm(v,m,y,T,T+C,B,_,r);c=Math.cos(T+C)*y+v,u=Math.sin(T+C)*y+m;break;case Gf.R:if(d=c=v,p=u=m,a=d+y,h=p+b,i){if(em(d,p,a,p,e,n,r)||em(a,p,a,h,e,n,r)||em(a,h,d,h,e,n,r)||em(d,h,d,p,e,n,r))return!0}else l+=Zv(a,p,a,h,n,r),l+=Zv(d,h,d,p,n,r);break;case Gf.Z:if(i){if(em(c,u,d,p,e,n,r))return!0}else l+=Zv(c,u,d,p,n,r);c=d,u=p}}var f,g;return i||(f=u,g=p,Math.abs(f-g)<im)||(l+=Zv(c,u,d,p,n,r)||0),0!==l}var fm;t.DefaultGraphicUtil=class{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=Uv({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"){var n;this.configure(this.global,this.global.env);const r=this.global.measureTextMethod;this.global.measureTextMethod=i;const s={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:iv.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new Uf(Object.assign({defaultFontParams:{fontFamily:iv.fontFamily,fontSize:iv.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Uf.ALPHABET_CHAR_SET+Uf.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}},t.DefaultGraphicUtil=vp([hp(),mp(0,up(xp)),mp(0,lp(Ov)),mp(1,up(_p)),yp("design:paramtypes",[Object,Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(fm||(fm={}));const gm=new Of;t.DefaultTransformUtil=class{constructor(){this.matrix=new Of}init(t){return this.mode=fm.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=fm.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(gm.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(gm.a,gm.b,gm.c,gm.d,gm.e,gm.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(gm.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:n}=e;this.outTargetMatrix.translate(i,n),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-n)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(gm.a,gm.b,gm.c,gm.d,gm.e,gm.f),this}scale(t,e,i){return this.mode===fm.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===fm.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return gm.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(gm.a,gm.b,gm.c,gm.d,gm.e,gm.f),this}translate(t,e){return this.mode===fm.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===fm.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=vp([hp(),yp("design:paramtypes",[])],t.DefaultTransformUtil);const vm={arc:av,area:hv,circle:lv,line:dv,path:pv,symbol:mv,text:yv,rect:gv,rect3d:vv,polygon:fv,richtext:bv,richtextIcon:wv,image:xv,group:cv,glyph:uv},mm=Object.keys(vm);function ym(){return{arc:Object.assign({},vm.arc),area:Object.assign({},vm.area),circle:Object.assign({},vm.circle),line:Object.assign({},vm.line),path:Object.assign({},vm.path),symbol:Object.assign({},vm.symbol),text:Object.assign({},vm.text),rect:Object.assign({},vm.rect),rect3d:Object.assign({},vm.rect3d),polygon:Object.assign({},vm.polygon),richtext:Object.assign({},vm.richtext),richtextIcon:Object.assign({},vm.richtextIcon),image:Object.assign({},vm.image),group:Object.assign({},vm.group),glyph:Object.assign({},vm.glyph)}}function bm(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 xm=new Array(60).fill(0).map((()=>ym()));class wm{constructor(){this._defaultTheme=xm.pop()||ym(),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 r=this.getParentWithTheme(t);if(r){const t=r.theme;(t.dirty||i)&&t.applyTheme(r,e,!0),this.userTheme?bm(this.userTheme,t.userTheme,!1):this.userTheme=function(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=[],o=[];return void 0===e&&(e=!0),void 0===i&&(i=1/0),function t(i,a){if(null===i)return null;if(0===a)return i;var h,l,c;if("object"!=n(i))return i;if(Wp(i)?h=[]:Gp(i)?(h=new RegExp(i.source,(c="",(l=i).global&&(c+="g"),l.ignoreCase&&(c+="i"),l.multiline&&(c+="m"),c)),i.lastIndex&&(h.lastIndex=i.lastIndex)):h=Fp(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 o[u];s.push(i),o.push(h)}for(var d in i)h[d]=t(i[d],a-1);return h}(t,i)}(t.userTheme),bm(e,t.userTheme)}this.userTheme?this.doCombine(e):(r?this.combinedTheme=r.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);mm.forEach((r=>{var o,a;e[r]||s||t[r]?n[r]=Object.assign({},i[r],null!=s?s:{},null!==(o=t[r])&&void 0!==o?o:{},null!==(a=e[r])&&void 0!==a?a:{}):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 Am=new wm;function Sm(t,e){return t.glyphHost?Sm(t.glyphHost):e?(t.isContainer,e):Tm(t)||Am.getTheme()}function Tm(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)):Am.getTheme()}return null}class Cm{static GenAutoIncrementId(){return Cm.auto_increment_id++}}Cm.auto_increment_id=0;class Bm extends Mp{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=Cm.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}}}forEachChildrenAsync(t,e=!1){return bp(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&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(;null==t?void 0: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=Rp(i,!0)&&i||Lp(i)&&i.capture,r=Lp(i)&&i.once,s=Op(e)?void 0:e;return t=n?`${t}capture`:t,e=Op(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=Rp(i,!0)&&i||Lp(i)&&i.capture,r=Op(e)?void 0:e;t=n?`${t}capture`:t,e=Op(e)?e:e.handleEvent;const s=Lp(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 Lp(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 _m{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=_m.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new mf,this.page=new mf,this.canvas=new mf,this.viewport=new mf,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,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.")}}class Pm extends _m{constructor(){super(...arguments),this.client=new mf,this.movement=new mf,this.offset=new mf,this.global=new mf,this.screen=new mf}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}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,o,a,h,l,c,u,d,p,f){throw new Error("Method not implemented.")}}class Em extends Pm{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const n=new Em(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice(),n.type=this.type,n}}class Mm extends Pm{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const n=new Mm(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice(),n.type=this.type,n}}Mm.DOM_DELTA_PIXEL=0,Mm.DOM_DELTA_LINE=1,Mm.DOM_DELTA_PAGE=2;class km extends _m{constructor(t,e){super(),this.type=t,this.detail=e}}const Rm="object"==typeof performance&&performance.now?performance:Date;function Om(t){return"mouse"===t||"pen"===t}class Im{constructor(t){this.dispatch=new Mp,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof Em))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(Om(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)},this.onPointerMove=(t,e)=>{var i,n;if(!(t instanceof Em))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.createPointerEvent(t,t.type,e),s=Om(r.pointerType),o=this.trackingData(t.pointerId),a=this.findMountedTarget(o.overTargets);if(o.overTargets&&a&&a!==this.rootTarget&&a!==r.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,a||void 0);if(this.dispatchEvent(i,"pointerout"),s&&this.dispatchEvent(i,"mouseout"),!r.composedPath().includes(a)){const e=this.createPointerEvent(t,"pointerleave",a||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!r.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),s&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(a!==r.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(r,e);this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover");let n=null==a?void 0:a.parent;for(;n&&n!==this.rootTarget.parent&&n!==r.target;)n=n.parent;if(!n||n===this.rootTarget.parent){const t=this.clonePointerEvent(r,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==a&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(i)}const h="dispatchEvent";this[h](r,"pointermove"),"touch"===r.pointerType&&this[h](r,"touchmove"),s&&(this[h](r,"mousemove"),this.cursor=(null===(n=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor()),o.overTargets=r.composedPath(),this.freeEvent(r)},this.onPointerOver=(t,e)=>{var i,n;if(!(t instanceof Em))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(t.pointerId),s=this.createPointerEvent(t,t.type,e),o=Om(s.pointerType);this.dispatchEvent(s,"pointerover"),o&&this.dispatchEvent(s,"mouseover"),"mouse"===s.pointerType&&(this.cursor=(null===(n=null===(i=s.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor());const a=this.clonePointerEvent(s,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),o&&this.notifyTarget(a,"mouseenter"),a.target=a.target.parent;r.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(a)},this.onPointerOut=(t,e)=>{if(!(t instanceof Em))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=Om(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=""},this.onPointerUp=(t,e)=>{if(!(t instanceof Em))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=Rm.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(Om(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 o=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(Om(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(n,"click");e.target=o,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,Om(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)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof Em))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"):Om(r.pointerType)&&this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)},this.onWheel=(t,e)=>{if(!(t instanceof Mm))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)},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){var e,i,n,r,s;if(!this.rootTarget)return;const o=this.mappingTable[t.type];let a;const h=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[h])&&(null===(n=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[h])||void 0===n?void 0:n.stage.renderCount)===(null===(r=this._prePointTargetCache)||void 0===r?void 0:r.stageRenderCount)?a=this._prePointTargetCache[h]:(a=this.pickTarget(t.canvasX,t.canvasY,t),t.pickParams||(this._prePointTargetCache={[h]:a,stageRenderCount:null!==(s=null==a?void 0:a.stage.renderCount)&&void 0!==s?s:-1})),o)for(let e=0,i=o.length;e<i;e++)o[e].fn(t,a);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=null!=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)}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(Em);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,n),"string"==typeof e&&(n.type=e),n}createWheelEvent(t,e){const i=this.allocateEvent(Mm);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),i}clonePointerEvent(t,e){const i=this.allocateEvent(Em);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=null!=e?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 Em&&e instanceof Em&&(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 Pm&&e instanceof Pm&&(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=Rm.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),e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||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);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,i){let n;const r=this.rootTarget.pick(t,e);return n=r&&r.graphic?r.graphic:r&&r.group?r.group:t>=0&&t<=Xp(this.rootTarget,"width")&&e>=0&&e<=Xp(this.rootTarget,"height")?this.rootTarget:null,i&&(i.pickParams=r.params),n}}const Dm={pickable:!0,visible:!0,dispatchEvent(t){var e;if(!(t instanceof _m))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new km(t,e))}},Lm={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Nm{constructor(t){this.resolution=1,this.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)},this.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)},this.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)},this.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)},this.onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:n,global:r,viewport:s,autoPreventDefault:o=!1}=t;this.manager=new Im(n),this.globalObj=r,this.supportsPointerEvents=r.supportsPointerEvents,this.supportsTouchEvents=r.supportsTouchEvents,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=o,this.eventsAdded=!1,this.viewport=s,this.rootPointerEvent=new Em,this.rootWheelEvent=new Mm,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&&Up(t)&&!qp(this.cursorStyles,t)&&(i.style.cursor=t)}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){var e;const i=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(i)return i;const{clientX:n,clientY:r}=t,s=this.domElement.getBoundingClientRect();return{x:n-s.left,y:r-s.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];Np(n.button)&&(n.button=0),Np(n.buttons)&&(n.buttons=1),Np(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),Np(n.width)&&(n.width=n.radiusX||1),Np(n.height)&&(n.height=n.radiusY||1),Np(n.tiltX)&&(n.tiltX=0),Np(n.tiltY)&&(n.tiltY=0),Np(n.pointerType)&&(n.pointerType="touch"),Np(n.pointerId)&&(n.pointerId=n.identifier||0),Np(n.pressure)&&(n.pressure=n.force||.5),Np(n.twist)&&(n.twist=0),Np(n.tangentialPressure)&&(n.tangentialPressure=0),Np(n.layerX)&&(n.layerX=n.offsetX=n.clientX),Np(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;Np(i.isPrimary)&&(i.isPrimary=!0),Np(i.width)&&(i.width=1),Np(i.height)&&(i.height=1),Np(i.tiltX)&&(i.tiltX=0),Np(i.tiltY)&&(i.tiltY=0),Np(i.pointerType)&&(i.pointerType="mouse"),Np(i.pointerId)&&(i.pointerId=1),Np(i.pressure)&&(i.pressure=.5),Np(i.twist)&&(i.twist=0),Np(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=Lm[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Rm.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 Um=(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"},Wm=(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 Fm{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return Fm.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 jm{static Avaliable(){return!0}avaliable(){return jm.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 zm{static Avaliable(){return!!Av.global.getRequestAnimationFrame()}avaliable(){return zm.Avaliable()}tick(t,e){Av.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var Hm;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Hm||(Hm={}));class Gm{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===Hm.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=Hm.INITIAL,Av.global.hooks.onSetEnv.tap("window",(()=>{this.initHandler()})),Av.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:zm},{mode:"timeout",cons:jm},{mode:"manual",cons:Fm}];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 zm;break;case"timeout":t=new jm;break;case"manual":t=new Fm;break;default:console.warn("非法的计时器模式"),t=new zm}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!==Hm.INITIAL&&(this.status=Hm.PAUSE,!0)}resume(){return this.status!==Hm.INITIAL&&(this.status=Hm.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===Hm.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Hm.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=Hm.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=Hm.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class Vm{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 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 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-Vm.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Vm.bounceIn(2*t):.5*Vm.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/rf*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*rf/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/rf*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*rf/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/rf*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*rf/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*rf/e)*.5+1}}}Vm.quadIn=Vm.getPowIn(2),Vm.quadOut=Vm.getPowOut(2),Vm.quadInOut=Vm.getPowInOut(2),Vm.cubicIn=Vm.getPowIn(3),Vm.cubicOut=Vm.getPowOut(3),Vm.cubicInOut=Vm.getPowInOut(3),Vm.quartIn=Vm.getPowIn(4),Vm.quartOut=Vm.getPowOut(4),Vm.quartInOut=Vm.getPowInOut(4),Vm.quintIn=Vm.getPowIn(5),Vm.quintOut=Vm.getPowOut(5),Vm.quintInOut=Vm.getPowInOut(5),Vm.backIn=Vm.getBackIn(1.7),Vm.backOut=Vm.getBackOut(1.7),Vm.backInOut=Vm.getBackInOut(1.7),Vm.elasticIn=Vm.getElasticIn(1,.3),Vm.elasticOut=Vm.getElasticOut(1,.3),Vm.elasticInOut=Vm.getElasticInOut(1,.3*1.5);class Xm{constructor(){this.id=Cm.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,e=!0){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),e&&t.release()}}const Ym=new Xm;class qm{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(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class Km extends qm{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class $m{constructor(e=Cm.GenAutoIncrementId(),i=Ym){this.id=e,this.timeline=i,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new Zm(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.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=hf(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){$m.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=$m.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 Km((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const o=$m.interpolateMap.get(t)||$m.interpolateMap.get("");return!!o&&o(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 Zm(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()}}$m.mode=t.AnimateMode.NORMAL,$m.interpolateMap=new Map;class Zm{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 Jm(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?Vm[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?Vm[n]:n,o=this._addStep(i,null,s);return o.type=t.AnimateStepType.to,this._appendProps(e,o,!!r&&r.tempProps),o.propKeys||(o.propKeys=Object.keys(o.props)),r&&r.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(o.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(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.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 Jm(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){var e;const i=this.duration,n=this.loop,r=this.rawPosition;let s,o,a=!1;const h=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,i<=0)return a=!0,a;if(s=Math.floor(t/i),o=t-s*i,a=t>=n*i+i,a&&(o=i,s=n,t=o*s+i),t===r)return a;const l=!this.reversed!=!(this.bounce&&s%2);return l&&(o=i-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+h,this.updatePosition(a,l),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 o=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(o=i.easing(o)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,o,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,o)))}}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 Jm{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 Qm={duration:200,easing:"cubicOut"},ty={duration:1e3,easing:"quadInOut"};var ey;t.Edge=void 0,(ey=t.Edge||(t.Edge={}))[ey.Top=1]="Top",ey[ey.Right=2]="Right",ey[ey.Bottom=4]="Bottom",ey[ey.Left=8]="Left",ey[ey.ALL=15]="ALL";const iy=[!1,!1,!1,!1],ny=t=>{var e;let i=!0;if(Rp(t,!0)){for(let n=0;n<4;n++)iy[n]=t,i&&(i=!(null!==(e=iy[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)iy[e]=!!t[e],i&&(i=!!iy[e]);else iy[0]=!1,iy[1]=!1,iy[2]=!1,iy[3]=!1;return{isFullStroke:i,stroke:iy}},ry=[0,0,0,0],sy=t=>t?Wp(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(ry[0]=t[0],ry[2]=t[0],ry[1]=t[1],ry[3]=t[1],ry):t:t:0,oy=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],ay=[1,2,3,0,1,2,3,0];function hy(t,e,i,n){for(;t>=rf;)t-=rf;for(;t<0;)t+=rf;for(;t>e;)e+=rf;oy[0].x=i,oy[1].y=i,oy[2].x=-i,oy[3].y=-i;const r=Math.ceil(t/ef)%4,s=Math.ceil(e/ef)%4;if(n.add(af(t)*i,cf(t)*i),n.add(af(e)*i,cf(e)*i),r!==s||e-t>tf){let t=!1;for(let e=0;e<ay.length;e++)if(t||r!==ay[e]){if(t&&s===ay[e])break;if(t){const t=oy[ay[e]];n.add(t.x,t.y)}}else{t=!0;const e=oy[r];n.add(e.x,e.y)}}}function ly(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function cy(t,e,i){const{x:n,y:r}=gf(t.x,t.y,e.x,e.y,i),{x:s,y:o}=gf(t.x1,t.y1,e.x1,e.y1,i),a=new mf(n,r,s,o);return a.defined=e.defined,a}function uy(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 mf(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)n[r]=cy(t[r],e[r],i)}else{n=e.map((t=>{const e=new mf(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)n[r]=cy(t[r],e[r],i)}return n}const dy=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],py=t=>dy.includes(t);function fy(t,e){if(Wp(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}class gy{constructor(){this.durations=[],this.timeout=gy.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)}}gy.TimeOut=1e3/60;const vy=new gy;var my;!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"}(my||(my={}));class yy extends qm{constructor(t,e,i,n,r){super(null,null,i,n,r),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==r?void 0:r.group,this._clipGraphic=null==r?void 0: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 by(t,e,i,n,r,s){const o=(e-t)*r+t,a=(i-e)*r+e,h=(n-i)*r+i,l=(a-o)*r+o,c=(h-a)*r+a,u=(c-l)*r+l;s[0]=t,s[1]=o,s[2]=l,s[3]=u,s[4]=u,s[5]=c,s[6]=h,s[7]=n}function xy(t,e){const i=t.length,n=e.length;if(i===n)return[t,e];const r=[],s=[],o=i<n?t:e,a=Math.min(i,n),h=Math.abs(n-i)/6,l=(a-2)/6,c=Math.ceil(h/l),u=[o[0],o[1]];let d=h;for(let t=2;t<a;t+=6){let e=o[t-2],i=o[t-1],n=o[t],a=o[t+1],h=o[t+2],l=o[t+3];const p=o[t+4],f=o[t+5];if(d<=0){u.push(n,a,h,l,p,f);continue}const g=Math.min(d,c)+1;for(let t=1;t<=g;t++){const o=t/g;by(e,n,h,p,o,r),by(i,a,l,f,o,s),e=r[3],i=s[3],u.push(r[1],s[1],r[2],s[2],e,i),n=r[5],a=s[5],h=r[6],l=s[6]}d-=g-1}return o===t?[u,e]:[t,u]}function wy(t,e){const i=t||e,n=i.length,r=i[n-2],s=i[n-1],o=[];for(let t=0;t<e.length;t+=2)o[t]=r,o[t+1]=s;return o}function Ay(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 Sy(t){let e=0,i=0,n=0;const r=t.length;for(let s=0,o=r-2;s<r;o=s,s+=2){const r=t[o],a=t[o+1],h=t[s],l=t[s+1],c=r*l-h*a;e+=c,i+=(r+h)*c,n+=(a+l)*c}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,n/e/3,e]}function Ty(t,e,i,n){const r=(t.length-2)/6;let s=1/0,o=0;const a=t.length,h=a-2;for(let l=0;l<r;l++){const r=6*l;let c=0;for(let s=0;s<a;s+=2){const o=0===s?r:(r+s-2)%h+2,a=t[o]-i[0],l=t[o+1]-i[1],u=e[s]-n[0]-a,d=e[s+1]-n[1]-l;c+=u*u+d*d}c<s&&(s=c,o=l)}return o}function Cy(t,e,i,n){const r=[];let s;for(let o=0;o<t.length;o++){let a=t[o];const h=e[o],l=Sy(a),c=Sy(h);null==s&&(s=l[2]<0!=c[2]<0);const u=[],d=[];let p=0,f=1/0;const g=[],v=a.length;s&&(a=Ay(a));const m=6*Ty(a,h,l,c),y=v-2;for(let t=0;t<y;t+=2){const e=(m+t)%y+2;u[t+2]=a[e]-l[0],u[t+3]=a[e+1]-l[1]}if(u[0]=a[m]-l[0],u[1]=a[m+1]-l[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<a.length;e+=2){const r=u[e],s=u[e+1],o=h[e]-c[0],a=h[e+1]-c[1],l=o*i-a*t,d=o*t+a*i;g[e]=l,g[e+1]=d;const p=l-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<v;t+=2)d[t]=h[t]-c[0],d[t+1]=h[t+1]-c[1];r.push({from:u,to:d,fromCp:l,toCp:c,rotation:-p})}return r}function By(t,e){let i,n;const r=[],s=[];for(let o=0;o<Math.max(t.length,e.length);o++){const a=t[o],h=e[o];let l,c;a?h?([l,c]=xy(a,h),i=l,n=c):(c=wy(n,a),l=a):(l=wy(i,h),c=h),r.push(l),s.push(c)}return[r,s]}const _y=(t,e,i,n,r)=>{Jp(e,n)&&Jp(i,r)||t.push(e,i,n,r,n,r)};function Py(t){const e=t.commandList,i=[];let n,r=0,s=0,o=0,a=0;const h=(t,e)=>{n&&n.length>2&&i.push(n),n=[t,e]};let l,c,u,d;for(let t=0,i=e.length;t<i;t++){const i=e[t],p=0===t;switch(p&&(o=r=i[1],a=s=i[2],[Gf.L,Gf.C,Gf.Q].includes(i[0])&&(n=[o,a])),i[0]){case Gf.M:r=o=i[1],s=a=i[2],h(o,a);break;case Gf.L:l=i[1],c=i[2],_y(n,r,s,l,c),r=l,s=c;break;case Gf.C:n.push(i[1],i[2],i[3],i[4],r=i[5],s=i[6]);break;case Gf.Q:l=i[1],c=i[2],u=i[3],d=i[4],n.push(r+2/3*(l-r),s+2/3*(c-s),u+2/3*(l-u),d+2/3*(c-d),u,d),r=u,s=d;break;case Gf.A:{const t=i[1],e=i[2],u=i[3],d=u,f=i[4],g=i[5],v=!!i[6];l=Math.cos(f)*u+t,c=Math.sin(f)*u+e,p?(o=l,a=c,h(o,a)):_y(n,r,s,l,c),r=Math.cos(g)*u+t,s=Math.sin(g)*u+e;const m=(v?-1:1)*Math.PI/2;for(let i=f;v?i>g:i<g;i+=m){const r=v?Math.max(i+m,g):Math.min(i+m,g);lg(n,i,r,t,e,u,d)}break}case Gf.E:{const t=i[1],e=i[2],u=i[3],d=i[4],f=i[5],g=i[6],v=i[7]+g,m=!!i[8],y=!Jp(f,0),b=Math.cos(f),x=Math.sin(f);let w=Math.cos(g)*u,A=Math.sin(g)*d;y?(l=w*b-A*x+t,c=w*x+A*b+e):(l=w+t,c=A+e),p?(o=l,a=c,h(o,a)):_y(n,r,s,l,c),w=Math.cos(v)*u,A=Math.sin(v)*d,y?(r=w*b-A*x+t,s=w*x+A*b+e):(r=w+t,s=A+e);const S=(m?-1:1)*Math.PI/2;for(let i=g;m?i>v:i<v;i+=S){const r=m?Math.max(i+S,v):Math.min(i+S,v);if(lg(n,i,r,t,e,u,d),y){const i=n.length;for(let r=i-6;r<=i-1;r+=2)w=n[r],A=n[r+1],n[r]=(w-t)*b-(A-e)*x+t,n[r+1]=(w-t)*x+(A-e)*b+e}}break}case Gf.R:o=r=i[1],a=s=i[2],l=o+i[3],c=a+i[4],h(l,a),_y(n,l,a,l,c),_y(n,l,c,o,c),_y(n,o,c,o,a),_y(n,o,a,l,a);break;case Gf.AT:{const t=i[1],e=i[2],h=i[3],l=i[4],c=i[5],u=yf.distancePP({x:r,y:s},{x:t,y:e}),d=yf.distancePP({x:h,y:l},{x:t,y:e}),p=((r-t)*(h-t)+(s-e)*(l-e))/(u*d),f=c/Math.sin(p/2),g=(r+h-2*t)/2,v=(s+l-2*e)/2,m=yf.distancePP({x:g,y:v},{x:0,y:0}),y=t+f*g/m,b=h+f*v/m,x=Math.sqrt(f*f-c*c);o=t+x*(r-t)/u,a=e+x*(s-e)/u,_y(n,r,s,o,a),r=t+x*(h-t)/d,s=e+x*(l-e)/d;const w=Sf({x:y,y:b},{x:o,y:a}),A=Sf({x:y,y:b},{x:r,y:s});lg(n,w,A,y,b,c,c);break}case Gf.Z:n&&_y(n,r,s,o,a),r=o,s=a}}return n&&n.length>2&&i.push(n),i}function Ey(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 My(t){const e=new qg;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 ky(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 o=[];for(let t=0;t<r;t++)o.push(s);const a=i-r*s;if(a>0)for(let t=0;t<a;t+=s)t+s<a?o.push(s):o.push(a-t);return o}const Ry=(t,e)=>{const i=t.getComputedAttribute("width"),n=t.getComputedAttribute("height"),r=ky(i,n,e),s=[],o=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*o,width:n,height:o})}return s},Oy=(t,e)=>{const i=t.getParsedAngle(),n=i.startAngle,r=i.endAngle,s=t.getComputedAttribute("innerRadius"),o=t.getComputedAttribute("outerRadius"),a=Math.abs(n-r),h=Math.abs(o-s),l=ky(a*(s+o)/2,h,e),c=[],u=h/l.length,d=o>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=l.length;t<e;t++){const e=l[t],i=a/e;for(let r=0;r<e;r++)c.push({innerRadius:o-u*t*d,outerRadius:o-u*(t+1)*d,startAngle:n+i*r*p,endAngle:n+i*(r+1)*p})}return c},Iy=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),o=ky(s*r,r,e),a=[],h=s/o[0],l=r/o.length,c=n>=i?1:-1;for(let t=0,e=o.length;t<e;t++)for(let e=0,n=o[t];e<n;e++)a.push({innerRadius:l*t,outerRadius:l*(t+1),startAngle:i+h*e*c,endAngle:i+h*(e+1)*c});return a},Dy=(t,e)=>{const i=t.filter((t=>!1!==t.defined&&jp(t.x)&&jp(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 o=0;for(let e=0,i=t.length;e<i;e++)if(n.push(t[e]),e<i-1){let i=s;const a=t[e].x,h=t[e].y,l=t[e+1].x,c=t[e+1].y;for(;i<1&&o<r;)n.push({x:a+(l-a)*i,y:h+(c-h)*i}),i+=s,o+=1}return n},Ly=(t,e)=>{var i,n;const r=t.attribute;let s=r.points;const o=r.segments;s||(s=o.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]));const a=s.filter((t=>!1!==t.defined&&jp(t.x)&&jp(t.y)));if(!a.length)return[];const h=[];a.forEach((t=>{h.push({x:t.x,y:t.y})}));for(let t=a.length-1;t>=0;t--){const e=a[t];h.push({x:null!==(i=e.x1)&&void 0!==i?i:e.x,y:null!==(n=e.y1)&&void 0!==n?n:e.y})}const l=[];return jy(s,e,l),l},Ny=(t,e)=>{const i=t.attribute,n=i.points;if(n)return Dy(n,e);if(i.segments){const t=i.segments.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]);return Dy(t,e)}return[]};const Uy=t=>t.map((t=>({x:t.x,y:t.y}))),Wy=(t,e,i)=>{const n=t.length,r=[];for(let a=0;a<n;a++){const h=t[a],l=a===n-1?t[0]:t[a+1],c=Df([e.x,e.y],[i.x,i.y],[h.x,h.y],[l.x,l.y]);c&&"boolean"!=typeof c&&r.push({dot:(s=[c[0]-e.x,c[1]-e.x],o=[i.x-e.x,i.y-e.x],s[0]*o[1]-s[1]*o[0]),point:{x:c[0],y:c[1]},edgeIndex:a})}var s,o;if(r.length<2)return[Uy(t),Uy(t)];r.sort(((t,e)=>t.dot-e.dot));let a=r[0],h=r[r.length-1];a.edgeIndex>h.edgeIndex&&([a,h]=[h,a]);const l=a.point,c=h.point,u=[{x:l.x,y:l.y}];for(let e=a.edgeIndex+1;e<=h.edgeIndex;e++)u.push({x:t[e].x,y:t[e].y});u.push({x:c.x,y:c.y});const d=[{x:c.x,y:c.y}];for(let e=h.edgeIndex+1,i=a.edgeIndex+n;e<=i;e++){const i=t[e%n];d.push({x:i.x,y:i.y})}return d.push({x:l.x,y:l.y}),[u,d]},Fy=t=>{const e=new xf;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 Wy(t,{x:n,y:e.y1},{x:n,y:e.y2})}const r=e.y1+n/2;return Wy(t,{x:e.x1,y:r},{x:e.x2,y:r})},jy=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=Fy(t);jy(r[0],n,i),jy(r[1],e-n,i)}},zy=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:Uy(i)}];const n=[];return jy(i,e,n),n},Hy=(t,e)=>{const i=Py(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 o=i.slice(s*r,s===e-1?n:(s+1)*r);t.push({path:My(o)})}return t}const r=[],s=Math.floor(e/n);let o=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]});jy(e,t===n-1?o:s,r),o-=s}return r};var Gy={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 Vy={};for(const t in Gy)qp(Gy,t)&&(Vy[Gy[t]]=t);const Xy={to:{},get:{}};function Yy(t,e,i){return Math.min(Math.max(e,t),i)}function qy(t){const e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}Xy.get=function(t,e=[0,0,0,1]){let i,n;switch(t.substring(0,3).toLowerCase()){case"hsl":i=Xy.get.hsl(t,e),n="hsl";break;case"hwb":i=Xy.get.hwb(t,e),n="hwb";break;default:i=Xy.get.rgb(t,e),n="rgb"}return i?{model:n,value:i}:null},Xy.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=Gy[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]=Yy(i[r],0,255);return i[3]=Yy(i[3],0,1),i},Xy.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]=Yy(parseFloat(i[2]),0,100),e[2]=Yy(parseFloat(i[3]),0,100),e[3]=Yy(isNaN(t)?1:t,0,1),e}return null},Xy.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]=Yy(parseFloat(i[2]),0,100),e[2]=Yy(parseFloat(i[3]),0,100),e[3]=Yy(isNaN(t)?1:t,0,1),e}return null},Xy.to.hex=function(...t){const e=t;return"#"+qy(e[0])+qy(e[1])+qy(e[2])+(e[3]<1?qy(Math.round(255*e[3])):"")},Xy.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]+")"},Xy.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]+")"},Xy.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]+")"},Xy.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+")"},Xy.to.keyword=function(t){return Vy[t.slice(0,3)]};const Ky=Xy;var $y;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}($y||($y={}));class Zy{static Get(t,e=$y.Color1,i=[0,0,0,1]){if(e===$y.Color1){let e=Zy.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;if(e=Xy.get(t),e&&e.value){const n=e.value,r=[n[0]/255,n[1]/255,n[2]/255,n[3]];Zy.store1[t]=r,Zy.store255[t]=n,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3]}return i}let n=Zy.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;if(n=Xy.get(t),n&&n.value){const e=n.value;Zy.store1[t]=[e[0]/255,e[1]/255,e[2]/255,e[3]],Zy.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===$y.Color1){if(Zy.store1[t])return;Zy.store1[t]=i,Zy.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Zy.store255[t])return;Zy.store255[t]=i,Zy.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function Jy(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 Qy(t,e,i,n,r){if(!t||!e)return t&&Jy(t)||e&&Jy(e)||!1;let s,o,a=!1,h=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=Zy.Get(t,$y.Color255):a=!0,Array.isArray(e)?o=e:"string"==typeof e?o=Zy.Get(e,$y.Color255):h=!0,a!==h){const s=a?t:e,o=a?e:t,h=Object.assign(Object.assign({},s),{stops:s.stops.map((t=>Object.assign(Object.assign({},t),{color:Jy(o)})))});return a?Qy(s,h,i,n,r):Qy(h,s,i,n,r)}if(a){if(t.gradient===e.gradient){const n=t,r=e,s=n.stops,o=r.stops;if(s.length!==o.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:ib(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:ib(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:ib(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,o);const l=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,o,i);return Jy(l,n)}Zy.store255={},Zy.store1={};const tb=[0,0,0,0],eb=[0,0,0,0];function ib(t,e,i){return Zy.Get(t,$y.Color255,tb),Zy.Get(e,$y.Color255,eb),`rgba(${Math.round(tb[0]+(eb[0]-tb[0])*i)},${Math.round(tb[1]+(eb[1]-tb[1])*i)},${Math.round(tb[2]+(eb[2]-tb[2])*i)},${tb[3]+(eb[3]-tb[3])*i})`}const nb=(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=Qy(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},rb=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const o=t[s],a=o.from,h=o.to,l=o.rotation*i,c=o.fromCp,u=o.toCp,d=Math.sin(l),p=Math.cos(l);r[0]=c[0]+(u[0]-c[0])*i,r[1]=c[1]+(u[1]-c[1])*i;for(let t=0;t<a.length;t+=2){const e=a[t],s=a[t+1],o=e*(1-i)+h[t]*i,l=s*(1-i)+h[t+1]*i;n[t]=o*p-l*d+r[0],n[t+1]=o*d+l*p+r[1]}let f=n[0],g=n[1];e.moveTo(f,g);for(let t=2;t<a.length;t+=6){const i=n[t],r=n[t+1],s=n[t+2],o=n[t+3],a=n[t+4],h=n[t+5];f===i&&g===r&&s===a&&o===h?e.lineTo(a,h):e.bezierCurveTo(i,r,s,o,a,h),f=a,g=h}}},sb=(t,e,i)=>{const n=t?Py(t):[],r=Py(e);i&&n&&(i.fromTransform&&Ey(n,i.fromTransform.clone().getInverse()),Ey(n,i.toTransfrom));const[s,o]=By(n,r);return t?Cy(s,o,10,Math.PI):o.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},ob=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],ab=(t,e)=>{if(!t||!e)return null;const i=[];let n=!1;return Object.keys(t).forEach((r=>{if(!ob.includes(r))return;const s=e[r];Ip(s)||Ip(t[r])||s===t[r]||("fill"===r||"stroke"===r?i.push({from:"string"==typeof t[r]?Zy.Get(t[r],$y.Color255):t[r],to:"string"==typeof s?Zy.Get(s,$y.Color255):s,key:r}):i.push({from:t[r],to:s,key:r}),n=!0)})),n?i:null};class hb extends qm{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}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;rb(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&nb(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const lb=(t,e,i,n)=>{var r,s,o;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 a=null==t?void 0:t.globalTransMatrix;n&&a&&(a=n.clone().multiply(a.a,a.b,a.c,a.d,a.e,a.f));const h=sb(null===(r=null==t?void 0:t.toCustomPath)||void 0===r?void 0:r.call(t),e.toCustomPath(),{fromTransform:a,toTransfrom:e.globalTransMatrix}),l=ab(null==t?void 0:t.attribute,e.attribute),c=e.animate(i);return(null==i?void 0:i.delay)&&c.wait(i.delay),c.play(new hb({morphingData:h,otherAttrs:l},null!==(s=null==i?void 0:i.duration)&&void 0!==s?s:ty.duration,null!==(o=null==i?void 0:i.easing)&&void 0!==o?o:ty.easing)),c};class cb extends qm{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}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)=>{var n;rb(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),(null===(n=this.otherAttrs)||void 0===n?void 0:n[i])&&this.otherAttrs[i].length&&nb(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const ub=t=>{const e={};return Object.keys(t).forEach((i=>{py(i)||(e[i]=t[i])})),e},db=(t,e,i)=>{const n=ub(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,o=s.width(),a=s.height();r.setTheme({rect:n}),new Array(i).fill(0).forEach((t=>{const i=Av.graphicService.creator.rect({x:0,y:0,width:o,height:a});r.appendChild(i),e.push(i)}))}},pb=(t,e,i)=>{const n=[],r=i?null:ub(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new qg).fromCustomPath2D(s)};n.push(Av.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&db(t,n,e),n},fb=(t,e,i)=>{const n=[],r=i?null:ub(t.attribute);if("rect"===t.type){Ry(t,e).forEach((t=>{n.push(Av.graphicService.creator.rect(i?t:Object.assign({},r,t)))}))}else if("arc"===t.type){Oy(t,e).forEach((t=>{n.push(Av.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("circle"===t.type){Iy(t,e).forEach((t=>{n.push(Av.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("line"===t.type){const s=Ny(t,e),o={size:10,symbolType:"circle"};s.forEach((t=>{n.push(Av.graphicService.creator.symbol(i?Object.assign({},t,o):Object.assign({},r,t,o)))}))}else if("polygon"===t.type){zy(t,e).forEach((t=>{n.push(Av.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("area"===t.type){Ly(t,e).forEach((t=>{n.push(Av.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("path"===t.type){Hy(t,e).forEach((t=>{"path"in t?n.push(Av.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(Av.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}return i&&db(t,n,e),n};class gb{static GetImage(t,e){var i;let n=gb.cache.get(t);n?"fail"===n.loadState?Av.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&Av.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,n.data)})):(n={type:"image",loadState:"init"},gb.cache.set(t,n),n.dataPromise=Av.global.loadImage(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))}))}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetSvg(t,e){var i;let n=gb.cache.get(t);n?"fail"===n.loadState?Av.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&Av.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,n.data)})):(n={type:"image",loadState:"init"},gb.cache.set(t,n),n.dataPromise=Av.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))}))}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=gb.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"},gb.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=Av.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=Av.global.loadBlob(t):"json"===e&&(i.dataPromise=Av.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}}gb.cache=new Map;const vb=new Of,mb=new wf,yb=["lineWidth","lineCap","lineJoin","miterLimit","scaleX","scaleY","angle","anchor"],bb=["x","y"],xb=["scaleX","scaleY"],wb=["angle"],Ab=new mf,Sb={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class Tb extends Bm{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(Tb.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 wf,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=Sm(this.parent).group,{scrollX:e=t.scrollX,scrollY:r=t.scrollY}=this.parent.attribute;Ab.x=i+e,Ab.y=n+r}else Ab.x=i,Ab.y=n;return Ab}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Av.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.addUpdateLayoutTag(),Av.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 Of),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(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e: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 mf(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.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);s?this._setAttributes(s,i,n):Ip(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t&&this.loadImage(e,!0)}needUpdateTags(t){for(let e=0;e<yb.length;e++){const i=yb[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<yb.length;e++){if(t===yb[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){var n,r;if(0===e&&0===i)return this;const s={type:t.AttributeUpdateType.TRANSLATE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,bb,s);o&&(e=o.x,i=o.y,delete o.x,delete o.y,this._setAttributes(o));const a=this.attribute,h=a.postMatrix;return h?Av.transformUtil.fromMatrix(h,h).translate(e,i):(a.x=(null!==(n=a.x)&&void 0!==n?n:Jg.x)+e,a.y=(null!==(r=a.y)&&void 0!==r?r:Jg.y)+i),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),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,bb,r);return s?(this._setAttributes(s,!1,r),this):(n.x=e,n.y=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}scale(e,i,n){var r,s;if(1===e&&1===i)return this;const o={type:t.AttributeUpdateType.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i,scaleCenter:n},this.attribute,xb,o);a&&(e=a.scaleX,i=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const h=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new Of,h.postMatrix=t),Av.transformUtil.fromMatrix(t,t).scale(e,i,n)}else h.scaleX=(null!==(r=h.scaleX)&&void 0!==r?r:Jg.scaleX)*e,h.scaleY=(null!==(s=h.scaleY)&&void 0!==s?s:Jg.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),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,xb,r);return s?(this._setAttributes(s,!1,r),this):(n.scaleX=e,n.scaleY=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}rotate(e,i){var n;if(0===e)return this;const r={type:t.AttributeUpdateType.ROTATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:e,rotateCenter:i},this.attribute,wb,r);s&&(delete s.angle,this._setAttributes(s,!1,r));const o=this.attribute;if(i){let{postMatrix:t}=this.attribute;t||(t=new Of,o.postMatrix=t),Av.transformUtil.fromMatrix(t,t).rotate(e,i)}else o.angle=(null!==(n=o.angle)&&void 0!==n?n:Jg.angle)+e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),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,wb,n);return r?(this._setAttributes(r,!1,n),this):(i.angle=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new $m(null==t?void 0: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){Av.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)&&(!!Ip(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(e,i,n,r){var s,o,a,h;if(n){const n=Object.keys(e),l=this.getNoWorkAnimateAttr(),c={};let u;r?n.forEach((t=>{l[t]?(u||(u={}),u[t]=e[t]):c[t]=void 0===e[t]?this.getDefaultAttribute(t):e[t]})):n.forEach((t=>{l[t]?(u||(u={}),u[t]=e[t]):c[t]=e[t]}));const d=this.animate();d.stateNames=i,d.to(c,null!==(o=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==o?o:Qm.duration,null!==(h=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==h?h:Qm.easing),u&&this.setAttributes(u,!1,{type:t.AttributeUpdateType.STATE})}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();qp(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){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const n={};t.forEach((e=>{var i;const r=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];r&&Object.assign(n,r)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,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}addUpdateLayoutTag(){this._updateTag|=t.UpdateTag.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=t.UpdateTag.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&t.UpdateTag.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],n=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:n}=this.attribute;return mb.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(mb),this.setAttributes({scaleX:t,scaleY:i,angle:n}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,r=n();i[0]=r.x1+(r.x2-r.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,r=n();i[1]=r.y1+(r.y2-r.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=Jg.x,y:e=Jg.y,scaleX:i=Jg.scaleX,scaleY:n=Jg.scaleY,angle:r=Jg.angle,scaleCenter:s,anchor:o,postMatrix:a}=this.attribute;let h=[0,0];const l={};if(o&&(h=this.getAnchor(o,l)),!s||1===i&&1===n)!function(t,e,i,n,r,s,o,a){var h,l,c=e.a,u=e.b,d=e.c,p=e.d,f=e.e,g=e.f,v=af(o),m=cf(o);a?(h=a[0],l=a[1]):(h=i,l=n);var y=h-i,b=l-n,x=c*v+d*m,w=u*v+p*m,A=d*v-c*m,S=p*v-u*m;t.a=r*x,t.b=r*w,t.c=s*A,t.d=s*S,t.e=f+c*h+d*l-x*y-A*b,t.f=g+u*h+p*l-w*y-S*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,o&&h);else{const o=this._transMatrix;o.reset(),o.translate(h[0],h[1]),o.rotate(r),o.translate(-h[0],-h[1]),o.translate(t,e),h=this.getAnchor(s,l),Av.transformUtil.fromMatrix(o,o).scale(i,n,{x:h[0],y:h[1]})}const c=this.getOffsetXY(Jg);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,a){const t=vb.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){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Av.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 o={};if(n.customAnimate)n.customAnimate.update(s,r,o);else{const t=n.props,a=n.parsedProps,h=n.propKeys;this.stepInterpolate(e,i,o,n,r,s,t,void 0,a,h)}this.setAttributes(o,!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,o,a,h,l){l||(l=Object.keys(o),n.propKeys=l),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=o[t])})):l.forEach((s=>{var l;if(!e.validAttr(s))return;const c=o[s],u=null!==(l=a&&a[s])&&void 0!==l?l:t.getLastPropByName(s,n);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,u,c,i),d||(d=e.customInterpolate(s,r,u,c,this,i),d||this.defaultInterpolate(c,u,s,i,h,r)||this._interpolate(s,r,u,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 o=r.fillColorArray,a=Qy(e,null!=o?o:t,s,!1,((t,e)=>{r.fillColorArray=e}));return a&&(n[i]=a),!0}if("stroke"===i){r||(r={});const o=r.strokeColorArray,a=Qy(e,null!=o?o:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return a&&(n[i]=a),!0}if("shadowColor"===i){r||(r={});const o=r.shadowColorArray,a=Qy(e,null!=o?o: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 Sm(this)[this.type][t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e: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=null!=t?t:Av.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 Up(t,!0)?this.pathProxy=(new qg).fromString(t):this.pathProxy=new qg,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){if(t.fill||t.stroke)return!0;return!1}(t))return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(i,n),"string"==typeof t?(n.state="loading",Hp(t)||Vp(t)?(gb.GetImage(t,this),this.backgroundImg=this.backgroundImg||e):t.startsWith("<svg")&&(gb.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",Av.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const r=new km(t,e);r.bubbles=!1,r.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(r)}}}Tb.mixin(Dm);var Cb={},Bb={};!function(t){var e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+e+"]["+(e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*",n=new RegExp("^"+i+"$");t.isExist=function(t){return void 0!==t},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,i){if(e)for(var n=Object.keys(e),r=n.length,s=0;s<r;s++)t[n[s]]="strict"===i?[e[n[s]]]:e[n[s]]},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(t){var e=n.exec(t);return!(null==e)},t.getAllMatches=function(t,e){for(var i=[],n=e.exec(t);n;){var r=[];r.startIndex=e.lastIndex-n[0].length;for(var s=n.length,o=0;o<s;o++)r.push(n[o]);i.push(r),n=e.exec(t)}return i},t.nameRegexp=i}(Bb);var _b=Bb,Pb={allowBooleanAttributes:!1,unpairedTags:[]};function Eb(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function Mb(t,e){for(var i=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var n=t.substr(i,e-i);if(e>5&&"xml"===n)return Ub("InvalidXml","XML declaration allowed only at the start of the document.",Fb(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function kb(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var i=1;for(e+=8;e<t.length;e++)if("<"===t[e])i++;else if(">"===t[e]&&0===--i)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}Cb.validate=function(t,e){e=Object.assign({},Pb,e);var i,n=[],r=!1,s=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if((o=Mb(t,o+=2)).err)return o}else{if("<"!==t[o]){if(Eb(t[o]))continue;return Ub("InvalidChar","char '"+t[o]+"' is not expected.",Fb(t,o))}var a=o;if("!"===t[++o]){o=kb(t,o);continue}var h=!1;"/"===t[o]&&(h=!0,o++);for(var l="";o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)l+=t[o];if("/"===(l=l.trim())[l.length-1]&&(l=l.substring(0,l.length-1),o--),i=l,!_b.isName(i)){return Ub("InvalidTag",0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",Fb(t,o))}var c=Ib(t,o);if(!1===c)return Ub("InvalidAttr","Attributes for '"+l+"' have open quote.",Fb(t,o));var u=c.value;if(o=c.index,"/"===u[u.length-1]){var d=o-u.length,p=Lb(u=u.substring(0,u.length-1),e);if(!0!==p)return Ub(p.err.code,p.err.msg,Fb(t,d+p.err.line));r=!0}else if(h){if(!c.tagClosed)return Ub("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Fb(t,o));if(u.trim().length>0)return Ub("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Fb(t,a));var f=n.pop();if(l!==f.tagName){var g=Fb(t,f.tagStartPos);return Ub("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+g.line+", col "+g.col+") instead of closing tag '"+l+"'.",Fb(t,a))}0==n.length&&(s=!0)}else{var v=Lb(u,e);if(!0!==v)return Ub(v.err.code,v.err.msg,Fb(t,o-u.length+v.err.line));if(!0===s)return Ub("InvalidXml","Multiple possible root nodes found.",Fb(t,o));-1!==e.unpairedTags.indexOf(l)||n.push({tagName:l,tagStartPos:a}),r=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o=kb(t,++o);continue}if("?"!==t[o+1])break;if((o=Mb(t,++o)).err)return o}else if("&"===t[o]){var m=Nb(t,o);if(-1==m)return Ub("InvalidChar","char '&' is not expected.",Fb(t,o));o=m}else if(!0===s&&!Eb(t[o]))return Ub("InvalidXml","Extra text at the end",Fb(t,o));"<"===t[o]&&o--}return r?1==n.length?Ub("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",Fb(t,n[0].tagStartPos)):!(n.length>0)||Ub("InvalidXml","Invalid '"+JSON.stringify(n.map((function(t){return t.tagName})),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Ub("InvalidXml","Start tag expected.",1)};var Rb='"',Ob="'";function Ib(t,e){for(var i="",n="",r=!1;e<t.length;e++){if(t[e]===Rb||t[e]===Ob)""===n?n=t[e]:n!==t[e]||(n="");else if(">"===t[e]&&""===n){r=!0;break}i+=t[e]}return""===n&&{value:i,index:e,tagClosed:r}}var Db=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function Lb(t,e){for(var i=_b.getAllMatches(t,Db),n={},r=0;r<i.length;r++){if(0===i[r][1].length)return Ub("InvalidAttr","Attribute '"+i[r][2]+"' has no space in starting.",jb(i[r]));if(void 0!==i[r][3]&&void 0===i[r][4])return Ub("InvalidAttr","Attribute '"+i[r][2]+"' is without value.",jb(i[r]));if(void 0===i[r][3]&&!e.allowBooleanAttributes)return Ub("InvalidAttr","boolean attribute '"+i[r][2]+"' is not allowed.",jb(i[r]));var s=i[r][2];if(!Wb(s))return Ub("InvalidAttr","Attribute '"+s+"' is an invalid name.",jb(i[r]));if(n.hasOwnProperty(s))return Ub("InvalidAttr","Attribute '"+s+"' is repeated.",jb(i[r]));n[s]=1}return!0}function Nb(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){var i=/\d/;for("x"===t[e]&&(e++,i=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(i))break}return-1}(t,++e);for(var i=0;e<t.length;e++,i++)if(!(t[e].match(/\w/)&&i<20)){if(";"===t[e])break;return-1}return e}function Ub(t,e,i){return{err:{code:t,msg:e,line:i.line||i,col:i.col}}}function Wb(t){return _b.isName(t)}function Fb(t,e){var i=t.substring(0,e).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function jb(t){return t.startIndex+t[1].length}var zb={},Hb={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,i){return t}};zb.buildOptions=function(t){return Object.assign({},Hb,t)},zb.defaultOptions=Hb;var Gb=function(){function t(e){r(this,t),this.tagname=e,this.child=[],this[":@"]={}}return o(t,[{key:"add",value:function(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push(a({},t,e))}},{key:"addChild",value:function(t){var e;("__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0)?this.child.push((a(e={},t.tagname,t.child),a(e,":@",t[":@"]),e)):this.child.push(a({},t.tagname,t.child))}}]),t}(),Vb=Bb;function Xb(t,e){for(var i="";e<t.length&&"'"!==t[e]&&'"'!==t[e];e++)i+=t[e];if(-1!==(i=i.trim()).indexOf(" "))throw new Error("External entites are not supported");for(var n=t[e++],r="";e<t.length&&t[e]!==n;e++)r+=t[e];return[i,r,e]}function Yb(t,e){return"!"===t[e+1]&&"-"===t[e+2]&&"-"===t[e+3]}function qb(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7]}function Kb(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8]}function $b(t,e){return"!"===t[e+1]&&"A"===t[e+2]&&"T"===t[e+3]&&"T"===t[e+4]&&"L"===t[e+5]&&"I"===t[e+6]&&"S"===t[e+7]&&"T"===t[e+8]}function Zb(t,e){return"!"===t[e+1]&&"N"===t[e+2]&&"O"===t[e+3]&&"T"===t[e+4]&&"A"===t[e+5]&&"T"===t[e+6]&&"I"===t[e+7]&&"O"===t[e+8]&&"N"===t[e+9]}function Jb(t){if(Vb.isName(t))return t;throw new Error("Invalid entity name ".concat(t))}var Qb=function(t,e){var i={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");e+=9;for(var n=1,r=!1,s=!1;e<t.length;e++)if("<"!==t[e]||s)if(">"===t[e]){if(s?"-"===t[e-1]&&"-"===t[e-2]&&(s=!1,n--):n--,0===n)break}else"["===t[e]?r=!0:t[e];else{if(r&&qb(t,e)){var o=d(Xb(t,(e+=7)+1),3);entityName=o[0],val=o[1],e=o[2],-1===val.indexOf("&")&&(i[Jb(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val:val})}else if(r&&Kb(t,e))e+=8;else if(r&&$b(t,e))e+=8;else if(r&&Zb(t,e))e+=9;else{if(!Yb)throw new Error("Invalid DOCTYPE");s=!0}n++,""}if(0!==n)throw new Error("Unclosed DOCTYPE");return{entities:i,i:e}},tx=/^[-+]?0x[a-fA-F0-9]+$/,ex=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var ix={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var nx=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=Object.assign({},ix,e),!t||"string"!=typeof t)return t;var i=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(i))return t;if(e.hex&&tx.test(i))return Number.parseInt(i,16);var n=ex.exec(i);if(n){var r=n[1],s=n[2],o=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t;return t}(n[3]),a=n[4]||n[6];if(!e.leadingZeros&&s.length>0&&r&&"."!==i[2])return t;if(!e.leadingZeros&&s.length>0&&!r&&"."!==i[1])return t;var h=Number(i),l=""+h;return-1!==l.search(/[eE]/)||a?e.eNotation?h:t:-1!==i.indexOf(".")?"0"===l&&""===o||l===o||r&&l==="-"+o?h:t:s?o===l||r+o===l?h:t:i===l||i===r+l?h:t}return t},rx=Bb,sx=Gb,ox=Qb,ax=nx;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,rx.nameRegexp);var hx=o((function t(e){r(this,t),this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=lx,this.parseXml=fx,this.parseTextData=cx,this.resolveNameSpace=ux,this.buildAttributesMap=px,this.isItStopNode=yx,this.replaceEntitiesValue=vx,this.readStopNodeData=Ax,this.saveTextToParentTag=mx,this.addChild=gx}));function lx(t){for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:t[n]}}}function cx(t,e,i,r,s,o,a){if(void 0!==t&&(this.options.trimValues&&!r&&(t=t.trim()),t.length>0)){a||(t=this.replaceEntitiesValue(t));var h=this.options.tagValueProcessor(e,t,i,s,o);return null==h?t:n(h)!==n(t)||h!==t?h:this.options.trimValues||t.trim()===t?Sx(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function ux(t){if(this.options.removeNSPrefix){var e=t.split(":"),i="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=i+e[1])}return t}var dx=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function px(t,e,i){if(!this.options.ignoreAttributes&&"string"==typeof t){for(var r=rx.getAllMatches(t,dx),s=r.length,o={},a=0;a<s;a++){var h=this.resolveNameSpace(r[a][1]),l=r[a][4],c=this.options.attributeNamePrefix+h;if(h.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),"__proto__"===c&&(c="#__proto__"),void 0!==l){this.options.trimValues&&(l=l.trim()),l=this.replaceEntitiesValue(l);var u=this.options.attributeValueProcessor(h,l,e);null==u?o[c]=l:n(u)!==n(l)||u!==l?o[c]=u:o[c]=Sx(l,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[c]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){var d={};return d[this.options.attributesGroupName]=o,d}return o}}var fx=function(t){t=t.replace(/\r\n?/g,"\n");for(var e=new sx("!xml"),i=e,n="",r="",s=0;s<t.length;s++){if("<"===t[s])if("/"===t[s+1]){var o=bx(t,">",s,"Closing Tag is not closed."),h=t.substring(s+2,o).trim();if(this.options.removeNSPrefix){var l=h.indexOf(":");-1!==l&&(h=h.substr(l+1))}this.options.transformTagName&&(h=this.options.transformTagName(h)),i&&(n=this.saveTextToParentTag(n,i,r));var c=r.substring(r.lastIndexOf(".")+1);if(h&&-1!==this.options.unpairedTags.indexOf(h))throw new Error("Unpaired tag can not be used as closing tag: </".concat(h,">"));var u=0;c&&-1!==this.options.unpairedTags.indexOf(c)?(u=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):u=r.lastIndexOf("."),r=r.substring(0,u),i=this.tagsNodeStack.pop(),n="",s=o}else if("?"===t[s+1]){var d=xx(t,s,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,i,r),this.options.ignoreDeclaration&&"?xml"===d.tagName||this.options.ignorePiTags);else{var p=new sx(d.tagName);p.add(this.options.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&(p[":@"]=this.buildAttributesMap(d.tagExp,r,d.tagName)),this.addChild(i,p,r)}s=d.closeIndex+1}else if("!--"===t.substr(s+1,3)){var f=bx(t,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){var g=t.substring(s+4,f-2);n=this.saveTextToParentTag(n,i,r),i.add(this.options.commentPropName,[a({},this.options.textNodeName,g)])}s=f}else if("!D"===t.substr(s+1,2)){var v=ox(t,s);this.docTypeEntities=v.entities,s=v.i}else if("!["===t.substr(s+1,2)){var m=bx(t,"]]>",s,"CDATA is not closed.")-2,y=t.substring(s+9,m);if(n=this.saveTextToParentTag(n,i,r),this.options.cdataPropName)i.add(this.options.cdataPropName,[a({},this.options.textNodeName,y)]);else{var b=this.parseTextData(y,i.tagname,r,!0,!1,!0);null==b&&(b=""),i.add(this.options.textNodeName,b)}s=m+2}else{var x=xx(t,s,this.options.removeNSPrefix),w=x.tagName,A=x.tagExp,S=x.attrExpPresent,T=x.closeIndex;this.options.transformTagName&&(w=this.options.transformTagName(w)),i&&n&&"!xml"!==i.tagname&&(n=this.saveTextToParentTag(n,i,r,!1));var C=i;if(C&&-1!==this.options.unpairedTags.indexOf(C.tagname)&&(i=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),w!==e.tagname&&(r+=r?"."+w:w),this.isItStopNode(this.options.stopNodes,r,w)){var B="";if(A.length>0&&A.lastIndexOf("/")===A.length-1)s=x.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(w))s=x.closeIndex;else{var _=this.readStopNodeData(t,w,T+1);if(!_)throw new Error("Unexpected end of ".concat(w));s=_.i,B=_.tagContent}var P=new sx(w);w!==A&&S&&(P[":@"]=this.buildAttributesMap(A,r,w)),B&&(B=this.parseTextData(B,w,r,!0,S,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),P.add(this.options.textNodeName,B),this.addChild(i,P,r)}else{if(A.length>0&&A.lastIndexOf("/")===A.length-1){"/"===w[w.length-1]?(w=w.substr(0,w.length-1),r=r.substr(0,r.length-1),A=w):A=A.substr(0,A.length-1),this.options.transformTagName&&(w=this.options.transformTagName(w));var E=new sx(w);w!==A&&S&&(E[":@"]=this.buildAttributesMap(A,r,w)),this.addChild(i,E,r),r=r.substr(0,r.lastIndexOf("."))}else{var M=new sx(w);this.tagsNodeStack.push(i),w!==A&&S&&(M[":@"]=this.buildAttributesMap(A,r,w)),this.addChild(i,M,r),i=M}n="",s=T}}else n+=t[s]}return e.child};function gx(t,e,i){var n=this.options.updateTag(e.tagname,i,e[":@"]);!1===n||("string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e))}var vx=function(t){if(this.options.processEntities){for(var e in this.docTypeEntities){var i=this.docTypeEntities[e];t=t.replace(i.regx,i.val)}for(var n in this.lastEntities){var r=this.lastEntities[n];t=t.replace(r.regex,r.val)}if(this.options.htmlEntities)for(var s in this.htmlEntities){var o=this.htmlEntities[s];t=t.replace(o.regex,o.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function mx(t,e,i,n){return t&&(void 0===n&&(n=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,i,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function yx(t,e,i){var n="*."+i;for(var r in t){var s=t[r];if(n===s||e===s)return!0}return!1}function bx(t,e,i,n){var r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function xx(t,e,i){var n=function(t,e){for(var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="",s=e;s<t.length;s++){var o=t[s];if(i)o===i&&(i="");else if('"'===o||"'"===o)i=o;else if(o===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===o&&(o=" ");r+=o}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(n){var r=n.data,s=n.index,o=r.search(/\s/),a=r,h=!0;if(-1!==o&&(a=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1)),i){var l=a.indexOf(":");-1!==l&&(h=(a=a.substr(l+1))!==n.data.substr(l+1))}return{tagName:a,tagExp:r,closeIndex:s,attrExpPresent:h}}}function Ax(t,e,i){for(var n=i,r=1;i<t.length;i++)if("<"===t[i])if("/"===t[i+1]){var s=bx(t,">",i,"".concat(e," is not closed"));if(t.substring(i+2,s).trim()===e&&0===--r)return{tagContent:t.substring(n,i),i:s};i=s}else if("?"===t[i+1]){i=bx(t,"?>",i+1,"StopNode is not closed.")}else if("!--"===t.substr(i+1,3)){i=bx(t,"--\x3e",i+3,"StopNode is not closed.")}else if("!["===t.substr(i+1,2)){i=bx(t,"]]>",i,"StopNode is not closed.")-2}else{var o=xx(t,i,">");if(o)(o&&o.tagName)===e&&"/"!==o.tagExp[o.tagExp.length-1]&&r++,i=o.closeIndex}}function Sx(t,e,i){if(e&&"string"==typeof t){var n=t.trim();return"true"===n||"false"!==n&&ax(t,i)}return rx.isExist(t)?t:""}var Tx=hx,Cx={};function Bx(t,e,i){for(var n,r={},s=0;s<t.length;s++){var o=t[s],a=_x(o),h="";if(h=void 0===i?a:i+"."+a,a===e.textNodeName)void 0===n?n=o[a]:n+=""+o[a];else{if(void 0===a)continue;if(o[a]){var l=Bx(o[a],e,h),c=Ex(l,e);o[":@"]?Px(l,o[":@"],h,e):1!==Object.keys(l).length||void 0===l[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(l).length&&(e.alwaysCreateTextNode?l[e.textNodeName]="":l=""):l=l[e.textNodeName],void 0!==r[a]&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(l)):e.isArray(a,h,c)?r[a]=[l]:r[a]=l}}}return"string"==typeof n?n.length>0&&(r[e.textNodeName]=n):void 0!==n&&(r[e.textNodeName]=n),r}function _x(t){for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];if(":@"!==n)return n}}function Px(t,e,i,n){if(e)for(var r=Object.keys(e),s=r.length,o=0;o<s;o++){var a=r[o];n.isArray(a,i+"."+a,!0,!0)?t[a]=[e[a]]:t[a]=e[a]}}function Ex(t,e){var i=e.textNodeName,n=Object.keys(t).length;return 0===n||!(1!==n||!t[i]&&"boolean"!=typeof t[i]&&0!==t[i])}Cx.prettify=function(t,e){return Bx(t,e)};var Mx=zb.buildOptions,kx=Tx,Rx=Cx.prettify,Ox=Cb,Ix=function(){function t(e){r(this,t),this.externalEntities={},this.options=Mx(e)}return o(t,[{key:"parse",value:function(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});var i=Ox.validate(t,e);if(!0!==i)throw Error("".concat(i.err.msg,":").concat(i.err.line,":").concat(i.err.col))}var n=new kx(this.options);n.addExternalEntities(this.externalEntities);var r=n.parseXml(t);return this.options.preserveOrder||void 0===r?r:Rx(r,this.options)}},{key:"addEntity",value:function(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}}]),t}(),Dx=Ix;function Lx(t,e,i,n){for(var r="",s=!1,o=0;o<t.length;o++){var a=t[o],h=Nx(a),l="";if(l=0===i.length?h:"".concat(i,".").concat(h),h!==e.textNodeName)if(h!==e.cdataPropName)if(h!==e.commentPropName)if("?"!==h[0]){var c=n;""!==c&&(c+=e.indentBy);var u=Ux(a[":@"],e),d=n+"<".concat(h).concat(u),p=Lx(a[h],e,l,c);-1!==e.unpairedTags.indexOf(h)?e.suppressUnpairedNode?r+=d+">":r+=d+"/>":p&&0!==p.length||!e.suppressEmptyNode?p&&p.endsWith(">")?r+=d+">".concat(p).concat(n,"</").concat(h,">"):(r+=d+">",p&&""!==n&&(p.includes("/>")||p.includes("</"))?r+=n+e.indentBy+p+n:r+=p,r+="</".concat(h,">")):r+=d+"/>",s=!0}else{var f=Ux(a[":@"],e),g="?xml"===h?"":n,v=a[h][0][e.textNodeName];v=0!==v.length?" "+v:"",r+=g+"<".concat(h).concat(v).concat(f,"?>"),s=!0}else r+=n+"\x3c!--".concat(a[h][0][e.textNodeName],"--\x3e"),s=!0;else s&&(r+=n),r+="<![CDATA[".concat(a[h][0][e.textNodeName],"]]>"),s=!1;else{var m=a[h];Wx(l,e)||(m=Fx(m=e.tagValueProcessor(h,m),e)),s&&(r+=n),r+=m,s=!1}}return r}function Nx(t){for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];if(":@"!==n)return n}}function Ux(t,e){var i="";if(t&&!e.ignoreAttributes)for(var n in t){var r=e.attributeValueProcessor(n,t[n]);!0===(r=Fx(r,e))&&e.suppressBooleanAttributes?i+=" ".concat(n.substr(e.attributeNamePrefix.length)):i+=" ".concat(n.substr(e.attributeNamePrefix.length),'="').concat(r,'"')}return i}function Wx(t,e){var i=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(var n in e.stopNodes)if(e.stopNodes[n]===t||e.stopNodes[n]==="*."+i)return!0;return!1}function Fx(t,e){if(t&&t.length>0&&e.processEntities)for(var i=0;i<e.entities.length;i++){var n=e.entities[i];t=t.replace(n.regex,n.val)}return t}var jx=function(t,e){var i="";return e.format&&e.indentBy.length>0&&(i="\n"),Lx(t,e,"",i)},zx={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Hx(t){this.options=Object.assign({},zx,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Xx),this.processTextOrObjNode=Gx,this.options.format?(this.indentate=Vx,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Gx(t,e,i){var n=this.j2x(t,i+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,i):this.buildObjectNode(n.val,e,n.attrStr,i)}function Vx(t){return this.options.indentBy.repeat(t)}function Xx(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}Hx.prototype.build=function(t){return this.options.preserveOrder?jx(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t=a({},this.options.arrayNodeName,t)),this.j2x(t,0).val)},Hx.prototype.j2x=function(t,e){var i="",r="";for(var s in t)if(void 0===t[s])this.isAttribute(s)&&(r+="");else if(null===t[s])this.isAttribute(s)?r+="":"?"===s[0]?r+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)r+=this.buildTextValNode(t[s],s,"",e);else if("object"!==n(t[s])){var o=this.isAttribute(s);if(o)i+=this.buildAttrPairStr(o,""+t[s]);else if(s===this.options.textNodeName){var a=this.options.tagValueProcessor(s,""+t[s]);r+=this.replaceEntitiesValue(a)}else r+=this.buildTextValNode(t[s],s,"",e)}else if(Array.isArray(t[s])){for(var h=t[s].length,l="",c=0;c<h;c++){var u=t[s][c];void 0===u||(null===u?"?"===s[0]?r+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+s+"/"+this.tagEndChar:"object"===n(u)?this.options.oneListGroup?l+=this.j2x(u,e+1).val:l+=this.processTextOrObjNode(u,s,e):l+=this.buildTextValNode(u,s,"",e))}this.options.oneListGroup&&(l=this.buildObjectNode(l,s,"",e)),r+=l}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName)for(var d=Object.keys(t[s]),p=d.length,f=0;f<p;f++)i+=this.buildAttrPairStr(d[f],""+t[s][d[f]]);else r+=this.processTextOrObjNode(t[s],s,e);return{attrStr:i,val:r}},Hx.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},Hx.prototype.buildObjectNode=function(t,e,i,n){if(""===t)return"?"===e[0]?this.indentate(n)+"<"+e+i+"?"+this.tagEndChar:this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar;var r="</"+e+this.tagEndChar,s="";return"?"===e[0]&&(s="?",r=""),!i&&""!==i||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===s.length?this.indentate(n)+"\x3c!--".concat(t,"--\x3e")+this.newLine:this.indentate(n)+"<"+e+i+s+this.tagEndChar+t+this.indentate(n)+r:this.indentate(n)+"<"+e+i+s+">"+t+r},Hx.prototype.closeTag=function(t){var e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":"></".concat(t),e},Hx.prototype.buildTextValNode=function(t,e,i,n){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(n)+"<![CDATA[".concat(t,"]]>")+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+"\x3c!--".concat(t,"--\x3e")+this.newLine;if("?"===e[0])return this.indentate(n)+"<"+e+i+"?"+this.tagEndChar;var r=this.options.tagValueProcessor(e,t);return""===(r=this.replaceEntitiesValue(r))?this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+i+">"+r+"</"+e+this.tagEndChar},Hx.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(var e=0;e<this.options.entities.length;e++){var i=this.options.entities[e];t=t.replace(i.regex,i.val)}return t};var Yx={XMLParser:Dx,XMLValidator:Cb,XMLBuilder:Hx};function qx(t,e,i,n=0){return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}let Kx=0;function $x(){return Kx++}var Zx;function Jx(e){const i=[];let n=0,r="";for(let s=0;s<e.length;s++)ew(e[s])?n?r+=e[s]:(n=1,r=e[s]):(n&&(i.push({text:r,direction:t.TextDirection.VERTICAL}),r="",n=0),i.push({text:e[s],direction:t.TextDirection.HORIZONTAL}));return r&&i.push({text:r,direction:t.TextDirection.VERTICAL}),i}t.TextDirection=void 0,(Zx=t.TextDirection||(t.TextDirection={}))[Zx.HORIZONTAL=0]="HORIZONTAL",Zx[Zx.VERTICAL=1]="VERTICAL";const Qx=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Qx.set(t,!0)));const tw=new Map;function ew(t){if(Qx.has(t))return!0;if(tw.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}function iw(t,e){const i=t["@_attribute"];if(i){i.split(";").forEach((t=>{if(!t)return;const i=t.split(":");if(2===i.length){const t=parseFloat(i[1]);e[i[0].trim()]=isFinite(t)?t:i[1].trim()}else{let t="";for(let e=1;e<i.length;e++)e>1&&(t+=":"),t+=i[e].trim();e[i[0].trim()]=t}}))}}[""].forEach((t=>tw.set(t,!0)));const nw=$x(),rw=$x(),sw=$x(),ow=$x(),aw=$x(),hw=$x(),lw=$x(),cw=$x(),uw=$x(),dw=$x(),pw=$x(),fw=$x(),gw=$x(),vw=$x(),mw=$x(),yw=$x(),bw=Symbol.for("GraphicService"),xw=Symbol.for("GraphicCreator"),ww={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"},Aw=Object.keys(ww),Sw={"@_stroke-linecap":"lineCap","@_stroke-linejoin":"lineJoin","@_stroke-dasharray":"lineDash","@_stroke-dashoffset":"lineDashOffset","@_stroke-width":"lineWidth","@_fill-opacity":"fillOpacity","@_stroke-opacity":"strokeOpacity","@_stroke":"stroke","@_fill":"fill"},Tw=Object.keys(Sw);var Cw;t.GroupUpdateAABBBoundsMode=void 0,(Cw=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[Cw.LESS_GROUP=0]="LESS_GROUP",Cw[Cw.MORE_GROUP=1]="MORE_GROUP";class Bw extends Tb{constructor(e){super(e),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=hw,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 wm),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new wm)}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 mf(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;Av.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Av.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateAABBBounds(){const t=this.attribute,e=Sm(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=Av.graphicService.updateGroupAABBBounds(t,Sm(this).group,this._AABBBounds,this),{boundsPadding:n=e.boundsPadding}=t,r=sy(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(),Av.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Av.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,Av.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){this.forEachChildren((t=>{Av.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),Av.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=Av.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new Bw(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Bw.NOWORK_ANIMATE_ATTR}}Bw.NOWORK_ANIMATE_ATTR=Sb;const _w=Symbol.for("LayerHandlerContribution");class Pw extends Bw{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){var r;super({}),this.stage=t,this.global=e,this.window=i,this.main=n.main,this.layerHandler=Dv.get(_w),this.layerHandler.init(this,i,{main:n.main,canvasId:n.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(r=n.zIndex)&&void 0!==r?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new wm,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=>{Av.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){var i;const n=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:n.x,y:n.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:null!==(i=t.background)&&void 0!==i?i: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){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}combineTo(t,e){var i,n,r;this.offscreen&&(this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r: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=>{Av.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i,n,r;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}t.DefaultLayerService=class{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 Pw(t,this.global,t.window,Object.assign(Object.assign({},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=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],t.DefaultLayerService);const Ew=Symbol.for("VWindow"),Mw=Symbol.for("WindowHandlerContribution");t.DefaultWindow=class{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.hooks={onChange:new Cp(["x","y","width","height"])},this._uid=Cm.GenAutoIncrementId()}postInit(){this.global.hooks.onSetEnv.tap("window",(()=>{this.active()})),this.active()}active(){const t=this.global;if(!t.env||this.actived)return;Dv.getNamed(Mw,t.env).configure(this,t),this.actived=!0,this._handler}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)}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}},vp([gp(),yp("design:type",Function),yp("design:paramtypes",[]),yp("design:returntype",void 0)],t.DefaultWindow.prototype,"postInit",null),t.DefaultWindow=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],t.DefaultWindow);const kw=Symbol.for("TransformUtil"),Rw=Symbol.for("GraphicUtil"),Ow=Symbol.for("LayerService");var Iw=new np((e=>{e(t.DefaultGlobal).toSelf().inSingletonScope(),e(_p).toService(t.DefaultGlobal),e(t.DefaultWindow).to(t.DefaultWindow),e(Ew).toService(t.DefaultWindow),e(t.DefaultGraphicUtil).toSelf().inSingletonScope(),e(Rw).toService(t.DefaultGraphicUtil),e(t.DefaultTransformUtil).toSelf().inSingletonScope(),e(kw).toService(t.DefaultTransformUtil),e(t.DefaultLayerService).toSelf().inSingletonScope(),e(Ow).toService(t.DefaultLayerService)}));function Dw(t,e){return!(!t&&!e)}function Lw(t,e){let i;return i=Wp(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Nw(t,e,i){return i&&t*e>0}function Uw(t,e,i,n,r){return r&&t*e>0&&i>0&&n>0}function Ww(t,e){return t*e>0}function Fw(t,e,i,n){return t*e>0&&i>0&&n>0}function jw(t,e,i,n,r,s,o,a){if(!t.pathProxy)return!1;const h=Sm(t,null==s?void 0:s.theme)[t.type],{fill:l=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:g=h.visible}=t.attribute,v=Nw(u,d,l),m=Ww(u,f),y=Dw(l),b=Lw(c,p);if(!g)return!0;if(!y&&!b)return!0;if(!(v||m||o||a))return!0;e.beginPath();return ug(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),b&&(a?a(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),y&&(o?o(e,t.attribute,h):v&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fill())),!0}function zw(t,e,i,n,r,s,o,a){const h=i-t,l=n-e,c=o-r,u=a-s;let d=u*h-c*l;return d*d<Qp?[]:(d=(c*(e-s)-u*(t-r))/d,[t+d*h,e+d*l])}function Hw(t,e,i,n,r,s,o){const a=t-i,h=e-n,l=(o?s:-s)/Math.sqrt(a*a+h*h),c=l*h,u=-l*a,d=t+c,p=e+u,f=i+c,g=n+u,v=(d+f)/2,m=(p+g)/2,y=f-d,b=g-p,x=y*y+b*b,w=r-s,A=d*g-f*p,S=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-A*A));let T=(A*b-y*S)/x,C=(-A*y-b*S)/x;const B=(A*b+y*S)/x,_=(-A*y+b*S)/x,P=T-v,E=C-m,M=B-v,k=_-m;return P*P+E*E>M*M+k*k&&(T=B,C=_),{cx:T,cy:C,x01:-c,y01:-u,x11:T*(r/w-1),y11:C*(r/w-1)}}function Gw(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=sf(h-a),c=h>a;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=Qp)e.moveTo(i,n);else if(l>=rf-Qp)e.moveTo(i+r*af(a),n+r*cf(a)),e.arc(i,n,r,a,h,!c),s>Qp&&(e.moveTo(i+s*af(h),n+s*cf(h)),e.arc(i,n,s,h,a,c));else{const d=t.getParsedCornerRadius(),{outerDeltaAngle:p,innerDeltaAngle:f,outerStartAngle:g,outerEndAngle:v,innerEndAngle:m,innerStartAngle:y}=t.getParsePadAngle(a,h),b=d,x=d,w=d,A=d,S=Math.max(x,b),T=Math.max(w,A);let C=S,B=T;const _=r*af(g),P=r*cf(g),E=s*af(m),M=s*cf(m);let k,R,O,I;if((T>Qp||S>Qp)&&(k=r*af(v),R=r*cf(v),O=s*af(y),I=s*cf(y),l<tf)){const t=zw(_,P,O,I,k,R,E,M);if(t){const e=_-t[0],i=P-t[1],n=k-t[0],o=R-t[1],a=1/cf(pf((e*n+i*o)/(uf(e*e+i*i)*uf(n*n+o*o)))/2),h=uf(t[0]*t[0]+t[1]*t[1]);B=lf(T,(s-h)/(a-1)),C=lf(S,(r-h)/(a+1))}}if(p<.001)o&&(o[3]||o[1])&&e.moveTo(i+_,n+P),u=!0;else if(C>Qp){const t=lf(b,C),s=lf(x,C),a=Hw(O,I,_,P,r,t,Number(c)),h=Hw(k,R,E,M,r,s,Number(c));C<S&&t===s?!o||o[0]?(e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),e.arc(i+a.cx,n+a.cy,C,of(a.y01,a.x01),of(h.y01,h.x01),!c)):e.moveTo(i+a.cx+C*af(of(h.y01,h.x01)),n+a.cy+C*cf(of(h.y01,h.x01))):!o||o[0]?(e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),t>0&&e.arc(i+a.cx,n+a.cy,t,of(a.y01,a.x01),of(a.y11,a.x11),!c),e.arc(i,n,r,of(a.cy+a.y11,a.cx+a.x11),of(h.cy+h.y11,h.cx+h.x11),!c),s>0&&e.arc(i+h.cx,n+h.cy,s,of(h.y11,h.x11),of(h.y01,h.x01),!c)):s>0?e.moveTo(i+h.cx+s*af(of(h.y01,h.x01)),n+h.cy+s*cf(of(h.y01,h.x01))):e.moveTo(i+k,n+r*cf(v))}else!o||o[0]?(e.moveTo(i+_,n+P),e.arc(i,n,r,g,v,!c)):e.moveTo(i+r*af(v),n+r*cf(v));if(!(s>Qp)||f<.001)!o||o[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),u=!0;else if(B>Qp){const t=lf(A,B),r=lf(w,B),a=Hw(E,M,k,R,s,-r,Number(c)),h=Hw(_,P,O,I,s,-t,Number(c));if(!o||o[1]?e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01):e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),B<T&&t===r){const t=of(h.y01,h.x01);!o||o[2]?e.arc(i+a.cx,n+a.cy,B,of(a.y01,a.x01),t,!c):e.moveTo(i+a.cx+af(t),n+a.cy+cf(t))}else!o||o[2]?(r>0&&e.arc(i+a.cx,n+a.cy,r,of(a.y01,a.x01),of(a.y11,a.x11),!c),e.arc(i,n,s,of(a.cy+a.y11,a.cx+a.x11),of(h.cy+h.y11,h.cx+h.x11),c),t>0&&e.arc(i+h.cx,n+h.cy,t,of(h.y11,h.x11),of(h.y01,h.x01),!c)):t>0?e.moveTo(i+h.cx+t*af(of(h.y01,h.x01)),n+h.cy+t*cf(of(h.y01,h.x01))):e.moveTo(i+O,n+I)}else!o||o[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),!o||o[2]?e.arc(i,n,s,m,y,c):e.moveTo(i+s*af(y),n+s*cf(y))}return o?o[3]&&e.lineTo(i+r*af(a),n+r*cf(a)):e.closePath(),u}class Vw{static GetCanvas(){try{return Vw.canvas||(Vw.canvas=Av.global.createCanvas({})),Vw.canvas}catch(t){return null}}static GetCtx(){if(!Vw.ctx){const t=Vw.GetCanvas();Vw.ctx=t.getContext("2d")}return Vw.ctx}}class Xw{constructor(t=[],e=100){const i=Vw.GetCanvas(),n=Vw.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 GetOrCreate(t=[],e=100){let i="";t.forEach((t=>i+=t.join())),i+=e;let n=Xw.dataMap.get(i);return n||(n=new Xw(t,e),Xw.dataMap.set(i,n)),n}static SetColorInterpolateInstance(t,e){Xw.dataMap.set(t,e)}static GetColorInterpolateInstance(t){return Xw.dataMap.get(t)}}Xw.dataMap=new Map;class Yw{static GetSize(t){for(let e=0;e<Yw.ImageSize.length;e++)if(Yw.ImageSize[e]>=t)return Yw.ImageSize[e];return t}static Get(t,e,i,n,r,s,o){const a=Yw.GenKey(t,e,i,n,r),h=Yw.cache[a];if(!h||0===h.length)return null;for(let t=0;t<h.length;t++)if(h[t].width>=s&&h[t].height>=o)return h[t].pattern;return null}static Set(t,e,i,n,r,s,o,a){const h=Yw.GenKey(t,e,i,n,r);Yw.cache[h]?Yw.cache[h].push({width:o,height:a,pattern:s}):Yw.cache[h]=[{width:o,height:a,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function qw(t,e,i,n){const{stops:r,startAngle:s,endAngle:o}=n;for(;i<0;)i+=rf;for(;i>rf;)i-=rf;if(i<s)return r[0].color;if(i>o)return r[0].color;let a,h,l=(i-s)/(o-s);for(let t=0;t<r.length;t++)if(r[t].offset>=l){a=r[t-1],h=r[t];break}return l=(l-a.offset)/(h.offset-a.offset),Qy(a.color,h.color,l,!1)}function Kw(t,e,i,n,r,s,o,a,h){const l=Math.floor(180*r/Math.PI),c=Vw.GetCanvas(),u=Vw.GetCtx();if(!u)return null;const d=Yw.GetSize(a),p=Yw.GetSize(h);let f=Yw.Get(e,i,n,s,o,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)))),v=l+1,m=r/Math.max(1,v-1),y=Xw.GetOrCreate(e,v),b=2*Math.PI*g/360;c.width=d,c.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=v-1;t<e&&!(s+t*m>o);t++){const e=y.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 c.width=x.width,c.height=x.height,u.putImageData(x,0,0),f=t.createPattern(c,"no-repeat"),f&&Yw.Set(e,i,n,s,o,f,d,p),f}Yw.cache={},Yw.ImageSize=[20,40,80,160,320,640,1280,2560];const $w=Symbol.for("ArcRenderContribution"),Zw=Symbol.for("AreaRenderContribution"),Jw=Symbol.for("CircleRenderContribution"),Qw=Symbol.for("GroupRenderContribution"),tA=Symbol.for("ImageRenderContribution"),eA=Symbol.for("PathRenderContribution"),iA=Symbol.for("PolygonRenderContribution"),nA=Symbol.for("RectRenderContribution"),rA=Symbol.for("SymbolRenderContribution"),sA=Symbol.for("TextRenderContribution"),oA=Symbol.for("InteractiveSubRenderContribution");t.DefaultCanvasArcRender=class{constructor(t){this.arcRenderContribitions=t,this.numberType=nw}drawArcTailCapPath(t,e,i,n,r,s,o,a){const h=a-o,l=t.getParsedAngle(),c=l.startAngle;let u=l.endAngle;u=a;const d=sf(u-c),p=u>c;let f=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),{outerDeltaAngle:v,innerDeltaAngle:m,outerStartAngle:y,outerEndAngle:b,innerEndAngle:x,innerStartAngle:w}=t.getParsePadAngle(c,u),A=g,S=g,T=g,C=g,B=Math.max(S,A),_=Math.max(T,C);let P=B,E=_;const M=r*af(y),k=r*cf(y),R=s*af(x),O=s*cf(x);let I,D,L,N;if((_>Qp||B>Qp)&&(I=r*af(b),D=r*cf(b),L=s*af(w),N=s*cf(w),d<tf)){const t=zw(M,k,L,N,I,D,R,O);if(t){const e=M-t[0],i=k-t[1],n=I-t[0],o=D-t[1],a=1/cf(pf((e*n+i*o)/(uf(e*e+i*i)*uf(n*n+o*o)))/2),h=uf(t[0]*t[0]+t[1]*t[1]);E=lf(_,(s-h)/(a-1)),P=lf(B,(r-h)/(a+1))}}if(P>Qp){const t=lf(A,P),s=lf(S,P),o=Hw(L,N,M,k,r,t,Number(p)),a=Hw(I,D,R,O,r,s,Number(p));if(P<B&&t===s)e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,P,of(o.y01,o.x01),of(a.y01,a.x01),!p);else{const t=u-h-.03,o=of(a.y11,a.x11);e.arc(i,n,r,t,o,!p),s>0&&e.arc(i+a.cx,n+a.cy,s,of(a.y11,a.x11),of(a.y01,a.x01),!p)}}else e.moveTo(i+M,n+k);if(!(s>Qp)||m<.001)e.lineTo(i+R,n+O),f=!0;else if(E>Qp){const t=lf(C,E),r=lf(T,E),o=Hw(R,O,I,D,s,-r,Number(p)),a=Hw(M,k,L,N,s,-t,Number(p));if(e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01),E<_&&t===r){const t=of(a.y01,a.x01);e.arc(i+o.cx,n+o.cy,E,of(o.y01,o.x01),t,!p)}else{r>0&&e.arc(i+o.cx,n+o.cy,r,of(o.y01,o.x01),of(o.y11,o.x11),!p);const t=of(o.cy+o.y11,o.cx+o.x11),a=u-h-.03;e.arc(i,n,s,t,a,p)}}else e.lineTo(i+s*af(w),n+s*cf(w));return f}drawShape(e,i,n,r,s,o,a,h){const l=Sm(e,null==o?void 0:o.theme).arc,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,fillOpacity:f=l.fillOpacity,lineWidth:g=l.lineWidth,strokeOpacity:v=l.strokeOpacity,visible:m=l.visible,x:y=l.x,y:b=l.y}=e.attribute,x=Nw(p,f,c),w=Ww(p,v),A=Dw(c,u),S=Lw(d,g);if(!e.valid||!m)return;if(!A&&!S)return;if(!(x||w||a||h||u))return;const{outerRadius:T=l.outerRadius,innerRadius:C=l.innerRadius,cap:B=l.cap,forceShowCap:_=l.forceShowCap}=e.attribute;let P=0;const E=(Rp(B)&&B||B[0])&&"conical"===c.gradient;if(E){const{sc:t,startAngle:i,endAngle:n}=e.getParsedAngle();sf(n-i)<rf-Qp&&(P=t||0,c.startAngle-=P,c.endAngle-=P)}let M=!1;const{isFullStroke:k,stroke:R}=ny(d);if(A||k){if(i.beginPath(),Gw(e,i,n,r,T,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)}))}M=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,A,S,x,w,l,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),A&&(a?a(i,e.attribute,l):x&&(i.setCommonStyle(e,e.attribute,y-n,b-r,l),i.fill())),S&&k&&(h?h(i,e.attribute,l):w&&(i.setStrokeStyle(e,e.attribute,y-n,b-r,l),i.stroke()))}if(!k&&S){if(i.beginPath(),Gw(e,i,n,r,T,C,R),!M){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)}))}M=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,A,S,x,w,l,s,a,h)}))}h?h(i,e.attribute,l):w&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke())}if((Rp(B)&&B||B[1])&&_){const{startAngle:o,endAngle:c}=e.getParsedAngle();if(sf(c-o)>=rf-Qp){i.beginPath();const o=Math.abs(T-C)/2/T,{endAngle:c=l.endAngle,fill:u=l.fill}=e.attribute,d=c;if(this.drawArcTailCapPath(e,i,n,r,T,C,d,d+o),!M){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)}))}M=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,A,S,x,w,l,s,a,h)}))}if(A){const t=u;if("conical"===t.gradient){const s=qw(0,0,c,t);a||Nw&&(i.setCommonStyle(e,e.attribute,n,r,l),i.fillStyle=s,i.fill())}}S&&(h||w&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke()))}}this._arcAfterRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,A,S,x,w,l,s,a,h)})),E&&(c.startAngle+=P,c.endAngle+=P)}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=Sm(t,null==n?void 0:n.theme).arc;r.highPerformanceSave();let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);jw(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasArcRender=vp([hp(),mp(0,up(xp)),mp(0,lp($w)),yp("design:paramtypes",[Object])],t.DefaultCanvasArcRender),t.DefaultCanvasCircleRender=class{constructor(t){this.circleRenderContribitions=t,this.numberType=ow}drawShape(e,i,n,r,s,o,a,h){const l=Sm(e,null==o?void 0:o.theme).circle,{fill:c=l.fill,background:u,stroke:d=l.stroke,radius:p=l.radius,startAngle:f=l.startAngle,endAngle:g=l.endAngle,fillOpacity:v=l.fillOpacity,strokeOpacity:m=l.strokeOpacity,opacity:y=l.opacity,lineWidth:b=l.lineWidth,visible:x=l.visible,x:w=l.x,y:A=l.y}=e.attribute,S=Nw(y,v,c),T=Ww(y,m),C=Dw(c,u),B=Lw(d,b);e.valid&&x&&(C||B)&&(S||T||a||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((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),C&&(a?a(i,e.attribute,l):S&&(i.setCommonStyle(e,e.attribute,w-n,A-r,l),i.fill())),B&&(h?h(i,e.attribute,l):T&&(i.setStrokeStyle(e,e.attribute,w-n,A-r,l),i.stroke())),this._circleRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h)})))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).circle;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);jw(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasCircleRender=vp([hp(),mp(0,up(xp)),mp(0,lp(Jw)),yp("design:paramtypes",[Object])],t.DefaultCanvasCircleRender);const aA=["radius","startAngle","endAngle",...yb];class hA extends Tb{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=ow}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=Sm(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=Av.graphicService.updateCircleAABBBounds(i,Sm(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=sy(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Sm(this).circle[t]}needUpdateTags(t){for(let e=0;e<aA.length;e++){const i=aA[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<aA.length;e++){if(t===aA[e])return!0}return!1}toCustomPath(){var t,e,i;const n=this.attribute,r=null!==(t=n.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),s=null!==(e=n.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),o=null!==(i=n.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),a=new qg;return a.arc(0,0,r,s,o),a}clone(){return new hA(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return hA.NOWORK_ANIMATE_ATTR}}function lA(t,e={},i){i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:o=e.fontSize,fontFamily:a=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(s?s+" ":"")+o*i+"px "+(a||"sans-serif")}function cA(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function uA(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)}hA.NOWORK_ANIMATE_ATTR=Sb;class dA{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,o,a,h){const l=[],c=[e,i],u=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,a);l.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===n||"start"===n||("center"===n?u[0]=c[0]/-2:"right"!==n&&"end"!==n||(u[0]=-c[0])),"top"===r||("middle"===r?u[1]=c[1]/-2:"bottom"===r&&(u[1]=-c[1]));const d={xOffset:u[0],yOffset:u[1],width:c[0],height:c[1]};return this.layoutWithBBox(d,l,n,r,s)}GetLayoutByLines(t,e,i,n,r="",s,o){t=t.map((t=>t.toString()));const a=[],h=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),o),a.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,r,s).str,width:e});h[0]=o}else{let e,i;o=0;for(let n=0,r=t.length;n<r;n++)i=t[n],e=this.textMeasure.measureTextWidth(i,this.textOptions),o=Math.max(o,e),a.push({str:i,width:e});h[0]=o}h[1]=a.length*n,h[0]=a.reduce(((t,e)=>Math.max(t,e.width)),0);const l={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(l,e,i),this.layoutWithBBox(l,a,e,i,n)}layoutWithBBox(t,e,i,n,r){const s=[0,0],o=e.length*r;"top"===n||("middle"===n?s[1]=(t.height-o)/2:"bottom"===n&&(s[1]=t.height-o));for(let o=0;o<e.length;o++)this.lineOffset(t,e[o],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 pA=["text","maxLineWidth","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak",...yb];class fA extends Tb{get font(){const t=Sm(this).text;return this._font||(this._font=lA(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=Sm(this).text;if(Array.isArray(e.text))return;const{maxLineWidth:n=i.maxLineWidth}=e;return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){if(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=Sm(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.toString())}get multilineLayout(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=yw,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return null!=t&&""!==t}doUpdateAABBBounds(){const t=Sm(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=this.attribute,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}updateSingallineAABBBounds(t){const e=Sm(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}updateMultilineAABBBounds(t){const e=Sm(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}updateHorizontalSinglelineAABBBounds(t){var e,i;const n=Sm(this).text,r=Av.graphicUtil.textMeasure;let s,o;const a=this.attribute,{maxLineWidth:h=n.maxLineWidth,ellipsis:l=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontFamily:d=n.fontFamily,fontSize:p=n.fontSize,fontWeight:f=n.fontWeight,stroke:g=n.stroke,lineWidth:v=n.lineWidth,wordBreak:m=n.wordBreak,ignoreBuf:y=n.ignoreBuf}=a,b=y?0:Math.max(2,.075*p),{lineHeight:x=(null!==(e=a.lineHeight)&&void 0!==e?e:(a.fontSize||n.fontSize)+b)}=a;if(!this.shouldUpdateShape()&&this.cache){s=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0;const t=cA(c,s),e=uA(u,x,p);return this._AABBBounds.set(t,e,t+s,e+x),g&&this._AABBBounds.expand(v/2),this._AABBBounds}if(Number.isFinite(h)){if(l){const e=!0===l?n.ellipsis:l,i=r.clipTextWithSuffix(t.toString(),{fontSize:p,fontWeight:f,fontFamily:d},h,e,!1);o=i.str,s=i.width}else{const e=r.clipText(t.toString(),{fontSize:p,fontWeight:f,fontFamily:d},h,!1);o=e.str,s=e.width}this.cache.clipedText=o,this.cache.clipedWidth=s}else s=r.measureTextWidth(t.toString(),{fontSize:p,fontWeight:f,fontFamily:d}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=s;this.clearUpdateShapeTag();const w=cA(c,s);let A=x;Av.global&&Av.global.isSafari()&&(A+=.2*p);const S=uA(u,A,p,b);return this._AABBBounds.set(w,S,w+s,S+A),g&&this._AABBBounds.expand(v/2),this._AABBBounds}getBaselineMapAlign(){return fA.baselineMapAlign}getAlignMapBaseline(){return fA.alignMapBaseline}updateVerticalSinglelineAABBBounds(e){var i,n,r;const s=Sm(this).text,o=Av.graphicUtil.textMeasure;let a;const h=this.attribute,{ignoreBuf:l=s.ignoreBuf}=h,c=l?0:2,{maxLineWidth:u=s.maxLineWidth,ellipsis:d=s.ellipsis,fontSize:p=s.fontSize,fontWeight:f=s.fontWeight,fontFamily:g=s.fontFamily,stroke:v=s.stroke,lineHeight:m=(null!==(i=h.lineHeight)&&void 0!==i?i:(h.fontSize||s.fontSize)+c),lineWidth:y=s.lineWidth,verticalMode:b=s.verticalMode}=h;let{textAlign:x=s.textAlign,textBaseline:w=s.textBaseline}=h;if(!b){const t=x;x=null!==(n=fA.baselineMapAlign[w])&&void 0!==n?n:"left",w=null!==(r=fA.alignMapBaseline[t])&&void 0!==r?r:"top"}if(!this.shouldUpdateShape()&&this.cache){a=this.cache.clipedWidth;const t=cA(x,a),e=uA(w,m,p);return this._AABBBounds.set(e,t,e+m,t+a),v&&this._AABBBounds.expand(y/2),this._AABBBounds}let A=[Jx(e.toString())];if(Number.isFinite(u)){if(d){const t=!0===d?s.ellipsis:d,e=o.clipTextWithSuffixVertical(A[0],{fontSize:p,fontWeight:f,fontFamily:g},u,t,!1);A=[e.verticalList],a=e.width}else{const t=o.clipTextVertical(A[0],{fontSize:p,fontWeight:f,fontFamily:g},u,!1);A=[t.verticalList],a=t.width}this.cache.verticalList=A,this.cache.clipedWidth=a}else a=0,A[0].forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?p:o.measureTextWidth(e.text,{fontSize:p,fontWeight:f,fontFamily:g});a+=i,e.width=i})),this.cache.verticalList=A,this.cache.clipedWidth=a;this.clearUpdateShapeTag();const S=cA(x,a),T=uA(w,m,p);return this._AABBBounds.set(T,S,T+m,S+a),v&&this._AABBBounds.expand(y/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e;const i=Sm(this).text,n=this.attribute,{fontFamily:r=i.fontFamily,textAlign:s=i.textAlign,textBaseline:o=i.textBaseline,fontSize:a=i.fontSize,fontWeight:h=i.fontWeight,lineHeight:l=n.lineHeight||n.fontSize||i.fontSize,ellipsis:c=i.ellipsis,maxLineWidth:u,stroke:d=i.stroke,lineWidth:p=i.lineWidth,wordBreak:f=i.wordBreak}=n;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const g=Av.graphicUtil.textMeasure,v=new dA(r,{fontSize:a,fontWeight:h,fontFamily:r},g).GetLayoutByLines(t,s,o,l,!0===c?i.ellipsis:c||void 0,!1,u),{bbox:m}=v;return this.cache.layoutData=v,this.clearUpdateShapeTag(),this._AABBBounds.set(m.xOffset,m.yOffset,m.xOffset+m.width,m.yOffset+m.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var i,n,r;const s=Sm(this).text,o=Av.graphicUtil.textMeasure;let a;const h=this.attribute,{ignoreBuf:l=s.ignoreBuf}=h,c=l?0:2,{maxLineWidth:u=s.maxLineWidth,ellipsis:d=s.ellipsis,fontFamily:p=s.fontFamily,fontSize:f=s.fontSize,fontWeight:g=s.fontWeight,stroke:v=s.stroke,lineHeight:m=(null!==(i=h.lineHeight)&&void 0!==i?i:(h.fontSize||s.fontSize)+c),lineWidth:y=s.lineWidth,verticalMode:b=s.verticalMode}=h;let{textAlign:x=s.textAlign,textBaseline:w=s.textBaseline}=h;if(!b){const t=x;x=null!==(n=fA.baselineMapAlign[w])&&void 0!==n?n:"left",w=null!==(r=fA.alignMapBaseline[t])&&void 0!==r?r:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=hf(e,a)}));const t=cA(x,a),e=this.cache.verticalList.length*m,i=uA(w,e,f);return this._AABBBounds.set(i,t,i+e,t+a),v&&this._AABBBounds.expand(y/2),this._AABBBounds}const A=e.map((t=>Jx(t.toString())));A.forEach(((e,i)=>{if(Number.isFinite(u))if(d){const t=!0===d?s.ellipsis:d,n=o.clipTextWithSuffixVertical(e,{fontSize:f,fontWeight:g,fontFamily:p},u,t,!1);A[i]=n.verticalList,a=n.width}else{const t=o.clipTextVertical(e,{fontSize:f,fontWeight:g,fontFamily:p},u,!1);A[i]=t.verticalList,a=t.width}else a=0,e.forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?f:o.measureTextWidth(e.text,{fontSize:f,fontWeight:g,fontFamily:p});a+=i,e.width=i}))})),this.cache.verticalList=A,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=hf(e,a)}));const S=cA(x,a),T=this.cache.verticalList.length*m,C=uA(w,T,f);return this._AABBBounds.set(C,S,C+T,S+a),v&&this._AABBBounds.expand(y/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Sm(this).text[t]}needUpdateTags(t){for(let e=0;e<pA.length;e++){const i=pA[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<pA.length;e++){if(t===pA[e])return!0}return!1}clone(){return new fA(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return fA.NOWORK_ANIMATE_ATTR}}fA.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Sb),fA.baselineMapAlign={top:"left",bottom:"right",middle:"center"},fA.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const gA=["heightLimit","lineClamp"];class vA extends fA{_isValid(){const{text:t}=this.attribute;return Wp(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,n;const r=Sm(this).text,{fontFamily:s=r.fontFamily,textAlign:o=r.textAlign,textBaseline:a=r.textBaseline,fontSize:h=r.fontSize,lineHeight:l=this.attribute.lineHeight||this.attribute.fontSize||r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:u,stroke:d=r.stroke,lineWidth:p=r.lineWidth,wordBreak:f=r.wordBreak,fontWeight:g=r.fontWeight,ignoreBuf:v=r.ignoreBuf,heightLimit:m=0,lineClamp:y}=this.attribute,b=v?0:2;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const x=Av.graphicUtil.textMeasure,w=new dA(s,{fontSize:h,fontWeight:g,fontFamily:s},x),A=t.map((t=>t.toString())),S=[],T=[0,0];let C=1/0;if(m>0&&(C=Math.max(Math.floor(m/l),1)),y&&(C=Math.min(C,y)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<A.length;t++){const e=A[t];let r=!0;if(t===C-1){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,u,c,!1);S.push({str:t.str,width:t.width});break}const s=w.textMeasure.clipText(e,w.textOptions,u,"break-word"===f);if(""!==e&&""===s.str){if(c){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,u,c,!1);s.str=null!==(i=t.str)&&void 0!==i?i:"",s.width=null!==(n=t.width)&&void 0!==n?n:0}else s.str="",s.width=0;r=!1}if(S.push({str:s.str,width:s.width}),s.str.length===e.length);else if(r){const i=e.substring(s.str.length);A.splice(t+1,0,i)}}let t=0;S.forEach((e=>{t=Math.max(t,e.width)})),T[0]=t}else{let t,e,i=0;for(let n=0,r=A.length;n<r;n++){if(n===C-1){const t=w.textMeasure.clipTextWithSuffix(A[n],w.textOptions,u,c,!1);S.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=A[n],t=w.textMeasure.measureTextWidth(e,w.textOptions,"break-word"===f),i=Math.max(i,t),S.push({str:e,width:t})}T[0]=i}T[1]=S.length*(l+b);const B={xOffset:0,yOffset:0,width:T[0],height:T[1]};w.LayoutBBox(B,o,a);const _=w.layoutWithBBox(B,S,o,a,l);return this.cache.layoutData=_,this.clearUpdateShapeTag(),this._AABBBounds.set(B.xOffset,B.yOffset,B.xOffset+B.width,B.yOffset+B.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<gA.length;e++){const i=gA[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<gA.length;e++){if(t===gA[e])return!0}return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return vA.NOWORK_ANIMATE_ATTR}}function mA(t,e,i,n,r){return r?t.arc(i,n,e,0,nf,!1,r):t.arc(i,n,e,0,nf),!1}var yA=new class{constructor(){this.type="circle",this.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 mA(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return mA(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 bA=new class{constructor(){this.type="cross",this.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 xA(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 wA=new class{constructor(){this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,r){return xA(t,e/2,i,n,r)}drawFitDir(t,e,i,n,r){return xA(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return xA(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 AA(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var SA=new class{constructor(){this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return AA(t,e/2,i,n)}drawOffset(t,e,i,n,r){return AA(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 TA{constructor(){this.type="triangleUp",this.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 CA=new TA;var BA=new class extends TA{constructor(){super(...arguments),this.type="triangle"}};const _A=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),PA=Math.sin(nf/10)*_A,EA=-Math.cos(nf/10)*_A;function MA(t,e,i,n){const r=PA*e,s=EA*e;t.moveTo(i,-e+n),t.lineTo(r+i,s+n);for(let o=1;o<5;++o){const a=nf*o/5,h=Math.cos(a),l=Math.sin(a);t.lineTo(l*e+i,-h*e+n),t.lineTo(h*r-l*s+i,l*r+h*s+n)}return t.closePath(),!0}var kA=new class{constructor(){this.type="star",this.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 MA(t,e/2,i,n)}drawOffset(t,e,i,n,r){return MA(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 RA=uf(3);function OA(t,e,i,n){const r=e,s=r/RA,o=s/5,a=e;return t.moveTo(0+i,-r+n),t.lineTo(s/2+i,n),t.lineTo(o/2+i,n),t.lineTo(o/2+i,a+n),t.lineTo(-o/2+i,a+n),t.lineTo(-o/2+i,n),t.lineTo(-s/2+i,n),t.closePath(),!0}var IA=new class{constructor(){this.type="arrow",this.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 OA(t,e/2,i,n)}drawOffset(t,e,i,n,r){return OA(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 DA(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 LA=new class{constructor(){this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return DA(t,e/2,i,n)}drawOffset(t,e,i,n,r){return DA(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 NA(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var UA=new class{constructor(){this.type="stroke",this.pathStr=""}draw(t,e,i,n){return NA(t,e/2,i,n)}drawOffset(t,e,i,n,r){return NA(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 WA=-.5,FA=uf(3)/2,jA=1/uf(12);function zA(t,e,i,n){const r=e/2,s=e*jA,o=r,a=e*jA+e,h=-o,l=a;return t.moveTo(r+i,s+n),t.lineTo(o+i,a+n),t.lineTo(h+i,l+n),t.lineTo(WA*r-FA*s+i,FA*r+WA*s+n),t.lineTo(WA*o-FA*a+i,FA*o+WA*a+n),t.lineTo(WA*h-FA*l+i,FA*h+WA*l+n),t.lineTo(WA*r+FA*s+i,WA*s-FA*r+n),t.lineTo(WA*o+FA*a+i,WA*a-FA*o+n),t.lineTo(WA*h+FA*l+i,WA*l-FA*h+n),t.closePath(),!1}var HA=new class{constructor(){this.type="wye",this.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 zA(t,e/2,i,n)}drawOffset(t,e,i,n,r){return zA(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 GA=new class{constructor(){this.type="triangleLeft",this.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 VA=new class{constructor(){this.type="triangleRight",this.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 XA=new class{constructor(){this.type="triangleDown",this.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 YA=uf(3);function qA(t,e,i,n){const r=e*YA;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var KA=new class extends TA{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return qA(t,e/2/YA,i,n)}drawOffset(t,e,i,n,r){return qA(t,e/2/YA+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function $A(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 ZA=new class{constructor(){this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return $A(t,e/4,i,n)}drawOffset(t,e,i,n,r){return $A(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 JA(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 QA=new class{constructor(){this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return JA(t,e/4,i,n)}drawOffset(t,e,i,n,r){return JA(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 tS(t,e,i,n){const r=2*e;return t.moveTo(i-r,n+e),t.lineTo(i,n-e),t.lineTo(i+r,n+e),!0}var eS=new class{constructor(){this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return tS(t,e/4,i,n)}drawOffset(t,e,i,n,r){return tS(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 iS(t,e,i,n){const r=2*e;return t.moveTo(i-r,n-e),t.lineTo(i,n+e),t.lineTo(i+r,n-e),!0}var nS=new class{constructor(){this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return iS(t,e/4,i,n)}drawOffset(t,e,i,n,r){return iS(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 rS(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var sS=new class{constructor(){this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,r){return rS(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return rS(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e}, ${i-r} L ${e},${i+r}`}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function oS(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var aS=new class{constructor(){this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,r){return oS(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return oS(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} L ${e+r},${i}`}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function hS(t,e,i,n,r){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var lS=new class{constructor(){this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,r){return hS(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return hS(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i-r} L ${e+r},${i+r} M ${e+r}, ${i-r} L ${e-r},${i+r}`}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function cS(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}var uS=new class{constructor(){this.type="rect",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return cS(t,jp(e)?[e,e]:e,i,n)}drawOffset(t,e,i,n,r){return cS(t,jp(e)?[e+2*r,e+2*r]:[e[0]+2*r,e[1]+2*r],i,n)}bounds(t,e){const i=jp(t)?[t,t]:t;e.x1=-i[0]/2,e.x2=i[0]/2,e.y1=-i[1]/2,e.y2=i[1]/2}};const dS=new wf;class pS{constructor(t,e,i=!1){this.pathStr="",this.type=t,Wp(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,r,s,o){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),ug(r.path.commandList,t,i,n,e,e),o&&o(r.path,r.attribute)})),!1):(ug(this.path.commandList,t,i,n,e+r,e+r),!1)}draw(t,e,i,n,r,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),ug(r.path.commandList,t,i,n,e,e),s&&s(r.path,r.attribute)})),!1):(ug(this.path.commandList,t,i,n,e,e),!1)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{dS.x1=i.bounds.x1*t,dS.y1=i.bounds.y1*t,dS.x2=i.bounds.x2*t,dS.y2=i.bounds.y2*t,e.union(dS)}))}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 fS=[yA,bA,wA,SA,KA,BA,kA,IA,LA,UA,HA,GA,VA,CA,XA,ZA,QA,eS,nS,uS,sS,aS,lS],gS={};fS.forEach((t=>{gS[t.type]=t}));const vS=["symbolType","size",...yb];let mS=class t extends Tb{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=mw}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return Wp(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=Sm(this).symbol,{symbolType:i=e.symbolType}=this.attribute;let n=gS[i];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[i],n)return this._parsedPath=n,n;if(!0===Yx.XMLValidator.validate(i,{allowBooleanAttributes:!0})){const e=new Yx.XMLParser({ignoreAttributes:!1}),{svg:n}=e.parse(i);if(!n)return null;const r=Wp(n.path)?n.path:[n.path],s=new wf,o=[];r.forEach((t=>{const e=(new qg).fromString(t["@_d"]),i={fill:"black"};Tw.forEach((e=>{t[e]&&(i[Sw[e]]=t[e])})),o.push({path:e,attribute:i}),s.union(e.bounds)}));const a=s.width(),h=s.height(),l=1/hf(a,h);return o.forEach((t=>t.path.transform(0,0,l,l))),this._parsedPath=new pS(i,o,!0),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}const r=(new qg).fromString(i),s=r.bounds.width(),o=r.bounds.height(),a=1/hf(s,o);return r.transform(0,0,a,a),this._parsedPath=new pS(i,r),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=Sm(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=Av.graphicService.updateSymbolAABBBounds(i,Sm(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=sy(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Sm(this).symbol[t]}needUpdateTags(t){for(let e=0;e<vS.length;e++){const i=vS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<vS.length;e++){if(t===vS[e])return!0}return!1}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=Wp(e)?e:[e,e];return t.path?(new qg).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new qg).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};mS.userSymbolMap={},mS.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Sb);const yS=["segments","points","curveType",...yb];let bS=class t extends Tb{constructor(t={}){super(t),this.type="line",this.numberType=cw}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=uy(i,n,e))}doUpdateAABBBounds(){const t=Sm(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateLineAABBBounds(e,Sm(this).line,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Sm(this).line[t]}needUpdateTags(t){for(let e=0;e<yS.length;e++){const i=yS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<yS.length;e++){if(t===yS[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=new qg,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(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};bS.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Sb);const xS=["width","height","cornerRadius",...yb];class wS extends Tb{constructor(t){super(t),this.type="rect",this.numberType=fw}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{width:t,height:e}=this.attribute;return this._validNumber(t)&&this._validNumber(e)}doUpdateAABBBounds(){const t=Sm(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateRectAABBBounds(e,Sm(this).rect,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Sm(this).rect[t]}needUpdateTags(t){for(let e=0;e<xS.length;e++){const i=xS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<xS.length;e++){if(t===xS[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=t.width,i=t.height,n=new qg;return n.moveTo(0,0),n.rect(0,0,e,i),n}clone(){return new wS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return wS.NOWORK_ANIMATE_ATTR}}wS.NOWORK_ANIMATE_ATTR=Sb;const AS=[[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 SS extends wS{constructor(t){super(t),this.type="rect3d",this.numberType=gw}findFace(){const t={polygons:[],vertices:[],edges:[]},e=Sm(this).rect3d,{width:i=e.width,height:n=e.width,length:r=lf(e.width,e.height)}=this.attribute;for(let e=0;e<AS.length;e++){const s=AS[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}getNoWorkAnimateAttr(){return SS.NOWORK_ANIMATE_ATTR}}SS.NOWORK_ANIMATE_ATTR=Sb;class TS extends Tb{constructor(t){super(t),this.type="glyph",this.numberType=aw,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=Av.graphicService.updateGlyphAABBBounds(this.attribute,Sm(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const n={},r=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const s=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];s&&(Object.assign(n,s.attributes),(null===(i=s.subAttributes)||void 0===i?void 0:i.length)&&r.forEach(((t,e)=>{Object.assign(t,s.subAttributes[e])})))})),this.subGraphic.forEach(((i,n)=>{i.updateNormalAttrs(r[n]),i.applyStateAttrs(r[n],t,e)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,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 TS(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return TS.NOWORK_ANIMATE_ATTR}}TS.NOWORK_ANIMATE_ATTR=Sb;class CS{constructor(t,e,i,n,r,s,o,a,h,l,c,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=o,this.lines=[],this.globalAlign=a,this.globalBaseline=h,this.layoutDirection=l,this.directionKey=Sv[this.layoutDirection],this.isWidthMax=c,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 o=0;switch(this.globalBaseline){case"top":o=0;break;case"middle":o=-s/2;break;case"bottom":o=-s}let a=0;switch(this.globalAlign){case"left":a=0;break;case"center":a=-r/2;break;case"right":a=-r}let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let l=!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 l;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,l=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}else{const i=Math.floor((h-this.actualHeight)/2);"vertical"===this.layoutDirection?a+=i:o+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,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,a,s+o,e);else{if(s+r>this[this.directionKey.top]+h||s<this[this.directionKey.top])return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,l=!0),this.lines[i].draw(t,n,a,s+o,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(a+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(a-=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]+a,this.lines[i][this.directionKey.top]+o,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;{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,l=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}}}}return l}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],o=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(o+s>this[this.directionKey.top]+r||o<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&o-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 BS{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:o}=kv(t,i);let a=0,h=0,l=0;this.height>r&&(a=(this.height-r)/2,h=Math.ceil(a),l=Math.floor(a)),"top"===this.textBaseline?(this.ascent=a,this.descent=r-a):"bottom"===this.textBaseline?(this.ascent=r-a,this.descent=a):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=s+l),this.length=t.length,this.width=o||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}=kv(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,o=this.left+i;e+=this.top;let a=this.direction;if(this.verticalEllipsis)s="...",a="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+="...","right"===r&&(o-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Ev(s,("vertical"===a?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}=kv(this.text.slice(t),this.character);"vertical"===a||(o-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===a&&(t.save(),t.rotateAbout(Math.PI/2,o,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(o,e),o=0,e=0),this.character.stroke&&(!function(t,e){const i=e&&e.stroke||Cv;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,o,e)),function(t,e){const i=e&&e.fill||Tv;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,o,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(o,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(o,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(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===a&&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=Ev(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+="...";const{width:n}=kv(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const _S=["width","height","image",...yb];class PS extends Tb{constructor(t){super(t),this.type="image",this.numberType=lw,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"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=Sm(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateImageAABBBounds(e,Sm(this).image,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return xv[t]}needUpdateTags(t){for(let e=0;e<_S.length;e++){const i=_S[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<_S.length;e++){if(t===_S[e])return!0}return!1}clone(){return new PS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return PS.NOWORK_ANIMATE_ATTR}}PS.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Sb);class ES extends PS{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=sy(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(Wp(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=sy(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=xv.width,height:e=xv.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 MS{constructor(t,e,i,n,r,s,o,a){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 ES?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=o,this.directionKey=Sv[this.direction];const h=this.directionKey;this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof BS){const e=Pv.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=a?0:this.width-this.actualWidth;let c=this.left,u=0;if(this.actualWidth<e&&!a)switch(this.textAlign){case"right":c=e-this.actualWidth;break;case"center":c=(e-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?c=(e-this.actualWidth)/2:u=(e-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof ES?(t["_"+h.x]=c,c+=t[h.width]+u,t["_"+h.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?l-t.height:(l-t.height)/2):(t[h.left]=c,c+=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 ES)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const{width:n}=kv("...",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 ES)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 ES)break;const{width:n}=kv("...",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 ES?t.width:t.getWidthWithEllips(this.direction)})),e}}class kS{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=Sv[this.direction]}store(t){if(t instanceof ES){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 MS(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 ES?"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=Ev(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 BS(i,t.newLine,t.character),new BS(n,!0,t.character)]}(t,n);this.store(e),this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const RS=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...yb];class OS extends Tb{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=vw}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:bv.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:bv.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(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:bv.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:bv.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:bv.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:bv.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:bv.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:bv.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=Sm(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateRichTextAABBBounds(e,Sm(this).richtext,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return bv[t]}needUpdateTags(t){for(let e=0;e<RS.length;e++){const i=RS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<RS.length;e++){if(t===RS[e])return!0}return!1}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}doUpdateFrameCache(){var t;const{textConfig:e,maxWidth:i,maxHeight:n,width:r,height:s,ellipsis:o,wordBreak:a,verticalDirection:h,textAlign:l,textBaseline:c,layoutDirection:u,singleLine:d}=this.attribute,p=[];for(let t=0;t<e.length;t++)if("image"in e[t]){const i=e[t],n=i.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(i.id);if(n)p.push(n);else{const t=new ES(i);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=i.id,p.push(t)}}else if(e[t].text.includes("\n")){const i=e[t].text.split("\n");for(let n=0;n<i.length;n++)p.push(new BS(i[n],0!==n,e[t]))}else p.push(new BS(e[t].text,!1,e[t]));const f=new CS(0,0,("number"==typeof i&&(!r||r>i)?i:r)||0,("number"==typeof n&&(!s||s>n)?n:s)||0,o,a,h,l,c,u||"horizontal","number"==typeof i&&(!r||r>i),"number"==typeof n&&(!s||s>n),d||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),g=new kS(f);for(let t=0;t<p.length;t++)g.deal(p[t]);g.send(),this._frameCache=f}clone(){return new OS(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e);this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{var e,i,n,r,s;const o=this.pickIcon(t.global);o&&o===this._currentHoverIcon||(o?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=o,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(o.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):!o&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame()))})),this.addEventListener("pointerleave",(t=>{var e,i;this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(e=this.stage)||void 0===e||e.setCursor(),null===(i=this.stage)||void 0===i||i.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let r;return e.icons.forEach((e=>{var s,o;e.AABBBounds.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(null!==(s=r.attribute.x)&&void 0!==s?s:0)+i,r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+n)})),r}getNoWorkAnimateAttr(){return OS.NOWORK_ANIMATE_ATTR}}OS.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Sb);const IS=["path","customPath",...yb];class DS extends Tb{constructor(t){super(t),this.type="path",this.numberType=uw}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=Sm(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof qg?e.path:(Ip(this.cache)&&this.doUpdatePathShape(),this.cache instanceof qg?this.cache:t.path)}doUpdateAABBBounds(){const t=Sm(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updatePathAABBBounds(e,Sm(this).path,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;Up(t.path,!0)?this.cache=(new qg).fromString(t.path):t.customPath&&(this.cache=new qg,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Sm(this).path[t]}needUpdateTags(t){for(let e=0;e<IS.length;e++){const i=IS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<IS.length;e++){if(t===IS[e])return!0}return!1}toCustomPath(){return(new qg).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new DS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return DS.NOWORK_ANIMATE_ATTR}}DS.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Sb);const LS=["segments","points","curveType",...yb];class NS extends Tb{constructor(t){super(t),this.type="area",this.numberType=sw}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=Sm(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateAreaAABBBounds(e,Sm(this).area,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=uy(i,n,e))}getDefaultAttribute(t){return Sm(this).area[t]}needUpdateTags(t){for(let e=0;e<LS.length;e++){const i=LS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<LS.length;e++){if(t===LS[e])return!0}return!1}toCustomPath(){const t=new qg,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var r,s;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(s=e.y1)&&void 0!==s?s: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 NS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return NS.NOWORK_ANIMATE_ATTR}}NS.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Sb);const US=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...yb];class WS extends Tb{constructor(t){super(t),this.type="arc",this.numberType=nw}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=Sm(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(jp(e,!0)?e:r*parseFloat(e)/100,r/2)}getParsedAngle(){const t=Sm(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=Af(e),i=e+s,n&&sf(s)<rf-Qp){let s=1,o=1;n.length&&(s=Number(n[0]),o=Number(n[1]));const{outerRadius:a=t.outerRadius,innerRadius:h=t.innerRadius}=this.attribute,l=Math.abs(a-h)/2,c=l/a;if(l>Qp&&a>Qp)return{startAngle:e-r*c*s,endAngle:i+r*c*o,sc:r*c*s,ec:r*c*o}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=Sm(this).arc,{outerRadius:n=i.outerRadius,innerRadius:r=i.innerRadius,padAngle:s=i.padAngle}=this.attribute,{padRadius:o=uf(n*n+r*r)}=this.attribute,a=sf(e-t);let h=t,l=e,c=t,u=e;const d=s/2;let p=a,f=a;if(d>Qp&&o>Qp){const i=e>t?1:-1;let s=ff(Number(o)/r*cf(d)),a=ff(Number(o)/n*cf(d));return(p-=2*s)>Qp?(s*=i,c+=s,u-=s):(p=0,c=u=(t+e)/2),(f-=2*a)>Qp?(a*=i,h+=a,l-=a):(f=0,h=l=(t+e)/2),{outerStartAngle:h,outerEndAngle:l,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}return{outerStartAngle:h,outerEndAngle:l,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}doUpdateAABBBounds(t){const e=Sm(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=Av.graphicService.updateArcAABBBounds(i,Sm(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=sy(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){for(let e=0;e<US.length;e++){const i=US[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<US.length;e++){if(t===US[e])return!0}return!1}getDefaultAttribute(t){return Sm(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let n=t.innerRadius,r=t.outerRadius;const s=sf(i-e),o=i>e;if(r<n){const t=r;r=n,n=t}const a=new qg;if(r<=Qp)a.moveTo(0,0);else if(s>=rf-Qp)a.moveTo(0+r*af(e),0+r*cf(e)),a.arc(0,0,r,e,i,!o),n>Qp&&(a.moveTo(0+n*af(i),0+n*cf(i)),a.arc(0,0,n,i,e,o));else{const t=r*af(e),s=r*cf(e),h=n*af(i),l=n*cf(i);a.moveTo(0+t,0+s),a.arc(0,0,r,e,i,!o),a.lineTo(0+h,0+l),a.arc(0,0,n,i,e,o),a.closePath()}return a}clone(){return new WS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return WS.NOWORK_ANIMATE_ATTR}}WS.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Sb);class FS extends WS{constructor(t){super(t),this.type="arc3d",this.numberType=rw}doUpdateAABBBounds(){const t=Sm(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateArc3dAABBBounds(e,Sm(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}getNoWorkAnimateAttr(){return FS.NOWORK_ANIMATE_ATTR}}FS.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Sb);const jS=["points","cornerRadius",...yb];class zS extends Tb{constructor(t){super(t),this.type="polygon",this.numberType=dw}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=Sm(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updatePolygonAABBBounds(e,Sm(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=uy(i,n,e))}getDefaultAttribute(t){return Sm(this).polygon[t]}needUpdateTags(t){for(let e=0;e<jS.length;e++){const i=jS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<jS.length;e++){if(t===jS[e])return!0}return!1}toCustomPath(){const t=this.attribute.points,e=new qg;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 zS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return zS.NOWORK_ANIMATE_ATTR}}zS.NOWORK_ANIMATE_ATTR=Sb;class HS extends zS{constructor(t){super(t),this.type="pyramid3d",this.numberType=pw}doUpdateAABBBounds(){const t=Sm(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updatePyramid3dAABBBounds(e,Sm(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(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=yf.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,r=hf(r,e);const o=yf.distancePP(i[s].p,i[s+1].p);i[s].d=o,i[s+1].d=o,r=hf(r,o)}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}getNoWorkAnimateAttr(){return HS.NOWORK_ANIMATE_ATTR}}HS.NOWORK_ANIMATE_ATTR=Sb;let GS=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:o=t.lineWidth}=r;i.expand(n+(s+o)/2)}return i}};GS=vp([hp()],GS);const VS=Symbol.for("RectBoundsContribution");let XS=class extends GS{};XS=vp([hp()],XS);const YS=Symbol.for("SymbolBoundsContribution");let qS=class extends GS{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:o=e.strokeBoundsBuffer}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:a=t.lineWidth}=r;qx(i,n+(s+a)/2,!0,o)}return i}};qS=vp([hp()],qS);const KS=Symbol.for("CircleBoundsContribution");let $S=class extends GS{};$S=vp([hp()],$S);const ZS=Symbol.for("ArcBoundsContribution");let JS=class extends GS{};JS=vp([hp()],JS);const QS=Symbol.for("PathBoundsContribution");let tT=class extends GS{};tT=vp([hp()],tT);const eT=Symbol.for("MatrixAllocate"),iT=Symbol.for("Mat4Allocate");function nT(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class rT{constructor(){this.pools=[]}allocate(t,e,i,n,r,s){if(!this.pools.length)return new Of(t,e,i,n,r,s);const o=this.pools.pop();return o.a=t,o.b=e,o.c=i,o.d=n,o.e=r,o.f=s,o}allocateByObj(t){if(!this.pools.length)return new Of(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=[]}}class sT{constructor(){this.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 sT.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 oT=new rT,aT=new sT;function hT(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],o=e[5],a=e[6],h=e[7],l=e[8],c=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+l*n,t[5]=o*r+c*n,t[6]=a*r+u*n,t[7]=h*r+d*n,t[8]=l*r-s*n,t[9]=c*r-o*n,t[10]=u*r-a*n,t[11]=d*r-h*n,t}function lT(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],l=e[8],c=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-l*n,t[1]=o*r-c*n,t[2]=a*r-u*n,t[3]=h*r-d*n,t[8]=s*n+l*r,t[9]=o*n+c*r,t[10]=a*n+u*r,t[11]=h*n+d*r,t}function cT(t,e,i){const n=i[0],r=i[1],s=i[2];let o,a,h,l,c,u,d,p,f,g,v,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]):(o=e[0],a=e[1],h=e[2],l=e[3],c=e[4],u=e[5],d=e[6],p=e[7],f=e[8],g=e[9],v=e[10],m=e[11],t[0]=o,t[1]=a,t[2]=h,t[3]=l,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=f,t[9]=g,t[10]=v,t[11]=m,t[12]=o*n+c*r+f*s+e[12],t[13]=a*n+u*r+g*s+e[13],t[14]=h*n+d*r+v*s+e[14],t[15]=l*n+p*r+m*s+e[15]),t}function uT(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 dT(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i[0],x=i[1],w=i[2],A=i[3];return t[0]=b*n+x*a+w*u+A*g,t[1]=b*r+x*h+w*d+A*v,t[2]=b*s+x*l+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i[4],x=i[5],w=i[6],A=i[7],t[4]=b*n+x*a+w*u+A*g,t[5]=b*r+x*h+w*d+A*v,t[6]=b*s+x*l+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=i[8],x=i[9],w=i[10],A=i[11],t[8]=b*n+x*a+w*u+A*g,t[9]=b*r+x*h+w*d+A*v,t[10]=b*s+x*l+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i[12],x=i[13],w=i[14],A=i[15],t[12]=b*n+x*a+w*u+A*g,t[13]=b*r+x*h+w*d+A*v,t[14]=b*s+x*l+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t}function pT(t,e,i){var n;const{x:r=i.x,y:s=i.y,z:o=i.z,dx:a=i.dx,dy:h=i.dy,dz:l=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:f=i.beta,angle:g=i.angle,anchor3d:v=e.attribute.anchor,anchor:m}=e.attribute,y=[0,0,0];if(v){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;y[0]=i.x1+(i.x2-i.x1)*t}else y[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;y[1]=i.x1+(i.x2-i.x1)*t}else y[1]=v[1];y[2]=null!==(n=v[2])&&void 0!==n?n: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),cT(t,t,[r+a,s+h,o+l]),cT(t,t,[y[0],y[1],y[2]]),hT(t,t,f),lT(t,t,p),cT(t,t,[-y[0],-y[1],y[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,u,d]),g){const i=aT.allocate(),n=[0,0];if(m){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=v[1]}cT(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],l=e[4],c=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+l*n,t[1]=o*r+c*n,t[2]=a*r+u*n,t[3]=h*r+d*n,t[4]=l*r-s*n,t[5]=c*r-o*n,t[6]=u*r-a*n,t[7]=d*r-h*n}(i,i,g),cT(i,i,[-n[0],-n[1],0]),dT(t,t,i)}}function fT(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{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 Cp(["graphic"]),onSetStage:new Cp(["graphic","stage"]),onRemove:new Cp(["graphic"]),onRelease:new Cp(["graphic"]),onAddIncremental:new Cp(["graphic","group","stage"]),onClearIncremental:new Cp(["graphic","group","stage"]),beforeUpdateAABBBounds:new Cp(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new Cp(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new wf,this.tempAABBBounds2=new wf}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)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.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 Ff(t);return ug(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((o=>{o.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:o,clip:a=e.clip}=t;o&&o.length?o.forEach((t=>{i.union(t.AABBBounds)})):null!=r&&null!=s&&i.set(0,0,r,s),a||n.forEachChildren((t=>{i.union(t.AABBBounds)}));const h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.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:o=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:h=e.textAlign,textBaseline:l=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 l=r||e||0,c=s||h||0;c="number"==typeof a&&c>a?a:c||0,l="number"==typeof o&&l>o?o:l||0,i.set(0,0,l,c)}let c=0;switch(l){case"top":c=0;break;case"middle":c=-i.height()/2;break;case"bottom":c=-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,c);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,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2);const{scaleX:a=e.scaleX,scaleY:h=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:c=e.strokeBoundsBuffer}=t;if(l){qx(s,l/Math.abs(a+h),!0,c),i.union(s)}return this.combindShadowAABBBounds(i,n),bf(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((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,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,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.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:o=0}=t,a=s+o;i.setValue(-a,-a,a,a);const h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.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:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,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:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,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:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),s}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i: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,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.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(o.x1,o.y1,o.x2,o.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:o=e.radius}=t;return s-r>rf-Qp?i.set(-o,-o,o,o):hy(r,s,o,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,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.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(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,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:o=e.endAngle,startAngle:a=e.startAngle}=t;if(a>o){const t=a;a=o,o=t}return r<=Qp?i.set(0,0,0,0):Math.abs(o-a)>rf-Qp?i.set(-r,-r,r,r):(hy(a,o,r,i),hy(a,o,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,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.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(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateSymbolAABBBoundsImprecise(t,e,i,n){const{size:r=e.size}=t;if(Wp(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:o=i.scaleY,stroke:a=i.stroke,shadowBlur:h=i.shadowBlur,lineWidth:l=i.lineWidth,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a){qx(u,l/Math.abs(s+o),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(h){qx(u,h/Math.abs(s+o),n,c),e.union(u)}this.combindShadowAABBBounds(e,r),bf(e,e,r.transMatrix)}},t.DefaultGraphicService=vp([hp(),mp(0,up(xw)),mp(1,up(xp)),mp(1,lp(VS)),mp(2,up(xp)),mp(2,lp(YS)),mp(3,up(xp)),mp(3,lp(KS)),mp(4,up(xp)),mp(4,lp(ZS)),mp(5,up(xp)),mp(5,lp(QS)),yp("design:paramtypes",[Object,Object,Object,Object,Object,Object])],t.DefaultGraphicService);class gT extends Bw{constructor(t){super({x:0,y:0}),this.type="shadowroot",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}}function vT(t){return new WS(t)}function mT(t){return new FS(t)}function yT(t){return new HS(t)}function bT(t){return new NS(t)}function xT(t){return new hA(t)}function wT(t){return new Bw(t)}function AT(t){return new bS(t)}function ST(t){return new DS(t)}function TT(t){return new wS(t)}function CT(t){return new SS(t)}function BT(t){return new TS(t)}function _T(t){return new fA(t)}function PT(t){return new vA(t)}function ET(t){return new mS(t)}function MT(t){return new PS(t)}function kT(t){return new zS(t)}function RT(t){return new gT(t)}function OT(t){return new OS(t)}const IT={arc:vT,area:bT,circle:xT,group:wT,image:MT,line:AT,path:ST,rect:TT,rect3d:CT,symbol:ET,text:_T,richtext:OT,polygon:kT,shadowRoot:RT,wrapText:PT},DT=_T({text:""});const LT=OT({});function NT(e,i,n,r,s){var o;const{offsetX:a=0,offsetY:h=0,offsetZ:l=0,mode:c="none",drawConnect:u=!1,zeroX:d=0,zeroY:p=0}=s||{};if(u&&"none"===c)return;if(!i)return;let f=!0;const{curves:g}=i;if(n>=1){if(u){let t,i=!0;g.forEach(((n,r)=>{var s;let o=n.p0;if(n.originP1!==n.originP2){if(t&&t.originP1===t.originP2&&(o=t.p0),n.defined)i||(e.lineTo(o.x+a,o.y+h,l),i=!i);else{const{originP1:t,originP2:r}=n;let c;if(t&&!1!==t.defined?c=o:t&&!1!==r.defined&&(c=null!==(s=n.p3)&&void 0!==s?s:n.p1),i){i=!i;const t=c?c.x:n.p0.x,r=c?c.y:n.p0.y;e.moveTo(t+a,r+h,l)}else c&&(i=!i,e.lineTo(c.x+a,c.y+h,l))}t=n}else t=n}))}else g.forEach((t=>{t.defined?(f&&e.moveTo(t.p0.x+a,t.p0.y+h,l),FT(e,t,1,s),f=!1):f=!0}));return}if(n<=0)return;let v;"x"===r?v=t.Direction.ROW:"y"===r?v=t.Direction.COLUMN:"auto"===r&&(v=i.direction);const m=n*i.tryUpdateLength(v);let y=0,b=!0,x=null;for(let t=0,i=g.length;t<i;t++){const i=g[t],n=i.getLength(v),r=(m-y)/n;if(y+=n,r<0)break;if(u){let t=i.p0;if(i.originP1===i.originP2){x=i;continue}if(x&&x.originP1===x.originP2&&(t=x.p0),i.defined)b||(e.lineTo(t.x+a,t.y+h,l),b=!b);else{const{originP1:n,originP2:r}=i;let s;if(n&&!1!==n.defined?s=t:n&&!1!==r.defined&&(s=null!==(o=i.p3)&&void 0!==o?o:i.p1),b){b=!b;const t=s?s.x:i.p0.x,n=s?s.y:i.p0.y;e.moveTo(t+a,n+h,l)}else s&&(b=!b,e.lineTo(s.x+a,s.y+h,l))}x=i}else{if(!i.defined){f=!0;continue}f&&e.moveTo(i.p0.x+a,i.p0.y+h,l),FT(e,i,lf(r,1),s),f=!1}}}function UT(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},o=e?e.points[e.points.length-1]:i.points[0];t.moveTo(o.x+r,o.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 WT(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},{points:o}=i,a=[];for(let t=0;t<o.length;t++)o[t].defined;a.push(o),a.forEach(((i,n)=>{var o,a,h,l;const c=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(c.x+r,c.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(null!==(o=n.x1)&&void 0!==o?o:n.x,null!==(a=n.y1)&&void 0!==a?a:n.y)}t.lineTo(null!==(h=c.x1)&&void 0!==h?h:c.x,null!==(l=c.y1)&&void 0!==l?l:c.y),t.closePath()}))}function FT(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=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,o):t.lineTo(r+e.p1.x,s+e.p1.y,o);else if(e.p2&&e.p3){const[n]=mg(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,o)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,o)}}function jT(e,i,n,r){var s;const{drawConnect:o=!1,mode:a="none"}=r||{};if(o&&"none"===a)return;const{top:h,bottom:l}=i;if(n>=1){const t=[],i=[];let n=!0;if(o){let n,s,o=!0;const a=h.curves.length;h.curves.forEach(((h,c)=>{const u=l.curves[a-c-1];let d=h,p=u;if(h.originP1===h.originP2)return n=h,void(s=u);if(n&&n.originP1===n.originP2&&(d=n,p=s),h.defined)o||(t.push(d),i.push(p),zT(e,t,i,r),t.length=0,i.length=0,o=!o);else{const{originP1:n,originP2:s}=h;let a,l;n&&!1!==n.defined?(a=d,l=p):n&&!1!==s.defined&&(a=h,l=u),o?(o=!o,t.push(a||h),i.push(l||u)):a&&(o=!o,t.push(a||h),i.push(l||u),zT(e,t,i,r),t.length=0,i.length=0)}n=h})),zT(e,t,i,r)}else{for(let s=0,o=h.curves.length;s<o;s++){const a=h.curves[s];n!==a.defined?(n?(HT(e,t,i,r),t.length=0,i.length=0):(t.push(a),i.push(l.curves[o-s-1])),n=!n):n&&(t.push(a),i.push(l.curves[o-s-1]))}HT(e,t,i,r)}return}if(n<=0)return;let{direction:c}=r||{};const{curves:u}=h,d=null!==(s=u[u.length-1].p3)&&void 0!==s?s:u[u.length-1].p1,p=sf(d.x-u[0].p0.x),f=sf(d.y-u[0].p0.y);c=null!=c?c:p>f?t.Direction.ROW:t.Direction.COLUMN,Number.isFinite(p)||(c=t.Direction.COLUMN),Number.isFinite(f)||(c=t.Direction.ROW);const g=n*(c===t.Direction.ROW?p:f);let v=0,m=!0;const y=[],b=[];let x,w,A=!0;for(let t=0,i=h.curves.length;t<i;t++){const n=h.curves[t],s=n.getLength(c),a=(g-v)/s;if(a<0)break;if(v+=s,o){const s=l.curves[i-t-1];let o=n,a=s;if(n.originP1===n.originP2){x=n,w=s;continue}if(x&&x.originP1===x.originP2&&(o=x,a=w),n.defined)A||(y.push(o),b.push(a),zT(e,y,b,r),y.length=0,b.length=0,A=!A);else{const{originP1:t,originP2:i}=n;let h,l;t&&!1!==t.defined?(h=o,l=a):t&&!1!==i.defined&&(h=n,l=s),A?(A=!A,y.push(h||n),b.push(l||s)):h&&(A=!A,y.push(h||n),b.push(l||s),zT(e,y,b,r),y.length=0,b.length=0)}x=n}else{let s=null,o=null;m!==n.defined?(m?(HT(e,y,b,r),y.length=0,b.length=0):(s=n,o=l.curves[i-t-1]),m=!m):m&&(s=n,o=l.curves[i-t-1]),s&&o&&(a<1&&(s=s.p2&&s.p3?mg(s,a)[0]:bg(s,a)[0],o=o.p2&&o.p3?mg(o,1-a)[1]:bg(o,1-a)[1]),s.defined=m,o.defined=m,y.push(s),b.push(o)),s=null,o=null}}o?zT(e,y,b,r):HT(e,y,b,r)}function zT(t,e,i,n){if(e.length<2)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0,mode:a}=n||{};let h=e[0];t.moveTo(h.p0.x+r,h.p0.y+s,o),h=e[e.length-1];let l=h.p3||h.p1;t.lineTo(l.x+r,l.y+s,o),h=i[i.length-1],t.lineTo(h.p0.x+r,h.p0.y+s,o),h=i[0],l=h.p3||h.p1,t.lineTo(l.x+r,l.y+s,o),t.closePath()}function HT(t,e,i,n){const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=n||{};let a=!0;e.forEach((e=>{e.defined?(a&&t.moveTo(e.p0.x+r,e.p0.y+s,o),GT(t,e,1,n),a=!1):a=!0})),a=!0;for(let e=i.length-1;e>=0;e--){const h=i[e];h.defined?(a&&t.lineTo(h.p0.x+r,h.p0.y+s,o),GT(t,h,1,n),a=!1):a=!0}t.closePath()}function GT(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=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,o):t.lineTo(r+e.p1.x,s+e.p1.y,o);else if(e.p2&&e.p3){const[n]=mg(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,o)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,o)}}function VT(t,e,i){switch(e){case"linear":default:return Cg(t,i);case"basis":return Mg(t,i);case"monotoneX":return Ug(t,i);case"monotoneY":return Fg(t,i);case"step":return zg(t,.5,i);case"stepBefore":return zg(t,0,i);case"stepAfter":return zg(t,1,i);case"linearClosed":return Vg(t,i)}}t.BaseRender=class{transform(t,e,i,n=!1){const r=t.transMatrix,{x:s=e.x,y:o=e.y,z:a=e.z,scaleX:h=e.scaleX,scaleY:l=e.scaleY,angle:c=e.angle,postMatrix:u}=t.attribute,d=r.onlyTranslate()&&!u,p=i.modelMatrix,f=i.camera,g={x:s,y:o,z:a,lastModelMatrix:p},v=f&&(n||fT(t));if(v){const n=aT.allocate(),r=aT.allocate();pT(r,t,e),dT(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),aT.free(r)}if(d&&!p){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,g.z=a,i.setTransformForCurrent()}else if(v)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,l,c)}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,o=n.project(0,0,i),a=n.project(r,0,i),h=n.project(r,s,i),l={x:0,y:0},c={x:r,y:0},u={x:r,y:s};n.camera=null;const d=1/(l.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*l.y),p=-(l.y*(h.x-a.x)-c.y*h.x+u.y*a.x+(c.y-u.y)*o.x)*d,f=(c.y*h.y+l.y*(a.y-h.y)-u.y*a.y+(u.y-c.y)*o.y)*d,g=(l.x*(h.x-a.x)-c.x*h.x+u.x*a.x+(c.x-u.x)*o.x)*d,v=-(c.x*h.y+l.x*(a.y-h.y)-u.x*a.y+(u.x-c.x)*o.y)*d,m=(l.x*(u.y*a.x-c.y*h.x)+l.y*(c.x*h.x-u.x*a.x)+(u.x*c.y-c.x*u.y)*o.x)*d,y=(l.x*(u.y*a.y-c.y*h.y)+l.y*(c.x*h.y-u.x*a.y)+(u.x*c.y-c.x*u.y)*o.y)*d;n.setTransform(p,f,g,v,m,y,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,r,s,o){const a=t.project(e,i,n);t.translate(a.x,a.y,!1),t.scale(r,s,!1),t.rotate(o,!1),t.translate(-a.x,-a.y,!1),t.setTransformForCurrent()}},t.BaseRender=vp([hp()],t.BaseRender),t.DefaultCanvasLineRender=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=cw}draw(t,e,i,n){const{context:r}=i;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).line,o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,jw(t,r,a,h)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&aT.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){var g,v,m,y,b;if(!e)return;t.beginPath();const x=null!==(g=this.z)&&void 0!==g?g:0;NT(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:x}),d.cache&&!Wp(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowStyle&&t.setShadowStyle(d,o,a);const{x:w=0,x:A=0}=o;!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,o,w-c,A-u,a),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,o,w-c,A-u,a),t.stroke()));let{connectedType:S,connectedX:T,connectedY:C,connectedStyle:B}=o;if(Wp(a)?(S=null!==(v=null!=S?S:a[0].connectedType)&&void 0!==v?v:a[1].connectedType,T=null!==(m=null!=T?T:a[0].connectedX)&&void 0!==m?m:a[1].connectedX,C=null!==(y=null!=C?C:a[0].connectedY)&&void 0!==y?y:a[1].connectedY,B=null!==(b=null!=B?B:a[0].connectedStyle)&&void 0!==b?b:a[1].connectedStyle):(S=null!=S?S:a.connectedType,T=null!=T?T:a.connectedX,C=null!=C?C:a.connectedY,B=null!=B?B:a.connectedStyle),"connect"!==S&&"zero"!==S&&(S="none"),"none"!==S){t.beginPath(),NT(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:x,drawConnect:!0,mode:S,zeroX:T,zeroY:C});const g=[];Wp(a)?a.forEach((t=>g.push(t))):g.push(a),g.push(o),!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,B,w-c,A-u,g),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,B,w-c,A-u,g),t.stroke()))}return!1}drawShape(t,e,i,n,r,s,o,a){const h=Sm(t,null==s?void 0:s.theme).line,{fill:l=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:g=h.visible}=t.attribute,v=Nw(u,d,l),m=Ww(u,p),y=Dw(l),b=Lw(c,f);if(!t.valid||!g)return;if(!y&&!b)return;if(!(v||m||o||a))return;if(t.shouldUpdateShape()){const{points:e,segments:i,closePath:n}=t.attribute;let{curveType:r=h.curveType}=t.attribute;n&&"linear"===r&&(r="linearClosed");const s=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const s=Yg(t.points,r,{startPoint:e});return n=s,s})).filter((t=>!!t)),"linearClosed"===r){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Yg(s,r)}t.clearUpdateShapeTag()}const{clipRange:x=h.clipRange,clipRangeByDimension:w=h.clipRangeByDimension}=t.attribute;if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===x){let s=!1;t.cache.forEach(((u,f)=>{s||(s=this.drawSegmentItem(e,u,!!l,!!c,d,p,r[f],[h,t.attribute],x,w,i,n,t,o,a))}))}else{const s=t.cache.reduce(((t,e)=>t+e.getLength()),0),u=x*s;let f=0,g=!1;t.cache.forEach(((s,v)=>{if(g)return;const m=s.getLength(),y=(u-f)/m;f+=m,y>0&&(g=this.drawSegmentItem(e,s,!!l,!!c,d,p,r[v],[h,t.attribute],lf(y,1),w,i,n,t,o,a))}))}}else this.drawSegmentItem(e,t.cache,!!l,!!c,d,p,t.attribute,h,x,w,i,n,t,o,a)}},t.DefaultCanvasLineRender=vp([hp()],t.DefaultCanvasLineRender),t.DefaultCanvasAreaRender=class{constructor(t){this.areaRenderContribitions=t,this.numberType=sw}drawShape(t,e,i,n,r,s,o,a){var h,l,c,u,d,p;const f=Sm(t,null==s?void 0:s.theme).area,{fill:g=f.fill,fillOpacity:v=f.fillOpacity,opacity:m=f.opacity,visible:y=f.visible,z:b=f.z,background:x,stroke:w=t.attribute.stroke,lineWidth:A=f.lineWidth,strokeOpacity:S=f.strokeOpacity}=t.attribute,T=Nw(m,v,g),C=Dw(g,x),B=Lw(w,A),_=Ww(m,S);if(!t.valid||!y)return;if(!C&&!B)return;if(!(T||o||_||a))return;const{clipRange:P=f.clipRange}=t.attribute;if(t.shouldUpdateShape()){const{points:e,segments:i,closePath:n}=t.attribute;let{curveType:r=f.curveType}=t.attribute;if(n&&"linear"===r&&(r="linearClosed"),i&&i.length){let e,n;const s=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y}),null;1===i?e={x:n.endX,y:n.endY}:i>1&&(e.x=n.endX,e.y=n.endY);const s=VT(t.points,r,{startPoint:e});return n=s,s})).filter((t=>!!t));let o;const a=[];for(let t=i.length-1;t>=0;t--){const e=i[t].points,n=[];for(let t=e.length-1;t>=0;t--)n.push({x:null!==(h=e[t].x1)&&void 0!==h?h:e[t].x,y:null!==(l=e[t].y1)&&void 0!==l?l:e[t].y});if(0!==t){const e=i[t-1].points,r=e[e.length-1];r&&n.push({x:null!==(c=r.x1)&&void 0!==c?c:r.x,y:null!==(u=r.y1)&&void 0!==u?u:r.y})}o=VT(n,"stepBefore"===r?"stepAfter":"stepAfter"===r?"stepBefore":r),a.unshift(o)}t.cacheArea=a.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!e||!e.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const i=e,n=[];for(let t=e.length-1;t>=0;t--)n.push({x:null!==(d=e[t].x1)&&void 0!==d?d:e[t].x,y:null!==(p=e[t].y1)&&void 0!==p?p:e[t].y});const s=VT(i,r),o=VT(n,"stepBefore"===r?"stepAfter":"stepAfter"===r?"stepBefore":r);t.cacheArea={top:s,bottom:o}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===P){let h=!1;t.cacheArea.forEach(((l,c)=>{h||(h=this.drawSegmentItem(e,l,C,v,B,S,s[c],[f,t.attribute],P,i,n,b,t,r,o,a))}))}else{const h=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),l=P*h;let c=0,u=!1;t.cacheArea.forEach(((h,d)=>{if(u)return;const p=h.top.getLength(),g=(l-c)/p;c+=p,g>0&&(u=this.drawSegmentItem(e,h,C,v,B,S,s[d],[f,t.attribute],lf(g,1),i,n,b,t,r,o,a))}))}}else this.drawSegmentItem(e,t.cacheArea,C,v,B,S,t.attribute,f,P,i,n,b,t,r,o,a)}draw(t,e,i,n){const{context:r}=i,s=Sm(t,null==n?void 0:n.theme).area;let{x:o=s.x,y:a=s.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);jw(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,g){let v=!1;return v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,!1,f,g),v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,!0,f,g),v}_drawSegmentItem(e,i,n,r,s,o,a,h,l,c,u,d,p,f,g,v,m){var y,b,x,w;let{connectedType:A,connectedX:S,connectedY:T,connectedStyle:C}=a;const B=[];if(g&&(Wp(h)?(A=null!==(y=null!=A?A:h[0].connectedType)&&void 0!==y?y:h[1].connectedType,S=null!==(b=null!=S?S:h[0].connectedX)&&void 0!==b?b:h[1].connectedX,T=null!==(x=null!=T?T:h[0].connectedY)&&void 0!==x?x:h[1].connectedY,C=null!==(w=null!=C?C:h[0].connectedStyle)&&void 0!==w?w:h[1].connectedStyle):(A=null!=A?A:h.connectedType,S=null!=S?S:h.connectedX,T=null!=T?T:h.connectedY,C=null!=C?C:h.connectedStyle),"connect"!==A&&"zero"!==A&&(A="none"),Wp(h)?h.forEach((t=>B.push(t))):B.push(h),B.push(a)),g&&"none"===A)return!1;if(!i)return;e.beginPath();const{points:_,segments:P}=p.attribute;let E,M,k=t.Direction.ROW;if(P){const t=P[P.length-1];M=P[0].points[0],E=t.points[t.points.length-1]}else M=_[0],E=_[_.length-1];k=sf(E.x-M.x)>sf(E.y-M.y)?t.Direction.ROW:t.Direction.COLUMN,jT(e.camera?e:e.nativeContext,i,l,{offsetX:c,offsetY:u,offsetZ:d,direction:k,drawConnect:g,mode:A,zeroX:S,zeroY:T}),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,c,u,!!r,!1,n,!1,h,f,v,null,{attribute:a})})),e.setShadowStyle&&e.setShadowStyle(p,a,h);const{x:R=0,x:O=0}=a;if(!1!==n&&(v?v(e,a,h):r&&(e.setCommonStyle(p,g?C:a,R-c,O-u,g?B:h),e.fill())),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[]),this._areaRenderContribitions.forEach((i=>{i.time===t.BaseRenderContributionTime.afterFillStroke&&i.drawShape(p,e,c,u,!!r,!1,n,!1,h,f,v,null,{attribute:a})})),!1!==s)if(m)m(e,a,h);else{const{stroke:n=h&&h[1]&&h[1].stroke}=a;Wp(n)&&(n[0]||n[2])&&!1===n[1]&&(e.beginPath(),NT(e.camera?e:e.nativeContext,n[0]?i.top:i.bottom,l,k===t.Direction.ROW?"x":"y",{offsetX:c,offsetY:u,offsetZ:d,drawConnect:g,mode:A,zeroX:S,zeroY:T})),e.setStrokeStyle(p,g?C:a,R-c,O-u,g?B:h),e.stroke()}return!1}},t.DefaultCanvasAreaRender=vp([hp(),mp(0,up(xp)),mp(0,lp(Zw)),yp("design:paramtypes",[Object])],t.DefaultCanvasAreaRender),t.DefaultCanvasPathRender=class extends t.BaseRender{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=uw}drawShape(e,i,n,r,s,o,a,h){var l,c;const u=Sm(e,null==o?void 0:o.theme).path,{fill:d=u.fill,stroke:p=u.stroke,fillOpacity:f=u.fillOpacity,strokeOpacity:g=u.strokeOpacity,opacity:v=u.opacity,background:m,lineWidth:y=u.lineWidth,visible:b=u.visible,x:x=u.x,y:w=u.y}=e.attribute,A=null!==(l=this.z)&&void 0!==l?l:0,S=Nw(v,f,d),T=Ww(v,g),C=Dw(d,m),B=Lw(p,y);if(e.valid&&b&&(C||B)&&(S||T||a||h||m)){if(i.beginPath(),e.pathShape)ug(e.pathShape.commandList,i,n,r,1,1,A);else{ug((null!==(c=e.attribute.path)&&void 0!==c?c:u.path).commandList,i,n,r,1,1,A)}this._pathRenderContribitions||(this._pathRenderContribitions=this.pathRenderContribitions.getContributions()||[],this._pathRenderContribitions.sort(((t,e)=>e.order-t.order))),this._pathRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,u,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,u),B&&(h?h(i,e.attribute,u):T&&(i.setStrokeStyle(e,e.attribute,x-n,w-r,u),i.stroke())),C&&(a?a(i,e.attribute,u):S&&(i.setCommonStyle(e,e.attribute,x-n,w-r,u),i.fill())),this._pathRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,u,s,a,h)}))}}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).path,o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,jw(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&aT.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}},t.DefaultCanvasPathRender=vp([hp(),mp(0,up(xp)),mp(0,lp(eA)),yp("design:paramtypes",[Object])],t.DefaultCanvasPathRender);const XT=tf/2;function YT(t,e,i,n,r,s){let o;if(jp(s,!0))o=[s,s,s,s];else if(Array.isArray(s)){const t=s;switch(t.length){case 0:o=[0,0,0,0];break;case 1:o=[t[0],t[0],t[0],t[0]];break;case 2:case 3:o=[t[0],t[1],t[0],t[1]];break;default:o=t.slice(0,5)}}else o=[0,0,0,0];if(n<0||Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])+Math.abs(o[3])<1e-12)return t.rect(e,i,n,r);const[a,h,l,c]=[[e,i],[e+n,i],[e+n,i+r],[e,i+r]],u=Math.min(n/2,r/2),d=[Math.min(u,o[0]),Math.min(u,o[1]),Math.min(u,o[2]),Math.min(u,o[3])],p=[a[0]+d[0],a[1]],f=[a[0],a[1]+d[0]],g=[h[0]-d[1],h[1]],v=[h[0],h[1]+d[1]],m=[l[0]-d[2],l[1]],y=[l[0],l[1]-d[2]],b=[c[0]+d[3],c[1]],x=[c[0],c[1]-d[3]];if(t.moveTo(p[0],p[1]),t.lineTo(g[0],g[1]),!Kp(g,v)){const e=g[0],i=g[1]+d[1];t.arc(e,i,d[1],-XT,0,!1)}if(t.lineTo(y[0],y[1]),!Kp(m,y)){const e=y[0]-d[2],i=y[1];t.arc(e,i,d[2],0,XT,!1)}if(t.lineTo(b[0],b[1]),!Kp(b,x)){const e=b[0],i=b[1]-d[3];t.arc(e,i,d[3],XT,tf,!1)}if(t.lineTo(f[0],f[1]),!Kp(p,f)){const e=p[0],i=p[1]+d[0];t.arc(e,i,d[0],tf,tf+XT,!1)}return t.closePath(),t}function qT(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 KT(t,e){return Math.sqrt(t*t+e*e)}function $T(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.DefaultCanvasRectRender=class{constructor(t){this.rectRenderContribitions=t,this.type="rect",this.numberType=fw}drawShape(e,i,n,r,s,o,a,h){const l=Sm(e,null==o?void 0:o.theme).rect,{fill:c=l.fill,background:u,stroke:d=l.stroke,width:p=l.width,height:f=l.height,cornerRadius:g=l.cornerRadius,opacity:v=l.opacity,fillOpacity:m=l.fillOpacity,lineWidth:y=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:x=l.visible,x:w=l.x,y:A=l.y}=e.attribute,S=Uw(v,m,p,f,c),T=Fw(v,b,p,f),C=Dw(c,u),B=Lw(d,y);if(!e.valid||!x)return;if(!C&&!B)return;if(!(S||T||a||h||u))return;0===g||Wp(g)&&g.every((t=>0===t))?(i.beginPath(),i.rect(n,r,p,f)):(i.beginPath(),YT(i,n,r,p,f,g)),this._rectRenderContribitions||(this._rectRenderContribitions=this.rectRenderContribitions.getContributions()||[],this._rectRenderContribitions.sort(((t,e)=>e.order-t.order)));const _={doFill:C,doStroke:B};this._rectRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h,_)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),_.doFill&&(a?a(i,e.attribute,l):S&&(i.setCommonStyle(e,e.attribute,w-n,A-r,l),i.fill())),_.doStroke&&(h?h(i,e.attribute,l):T&&(i.setStrokeStyle(e,e.attribute,w-n,A-r,l),i.stroke())),this._rectRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).rect;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);jw(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasRectRender=vp([hp(),mp(0,up(xp)),mp(0,lp(nA)),yp("design:paramtypes",[Object])],t.DefaultCanvasRectRender),t.DefaultCanvasSymbolRender=class extends t.BaseRender{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=mw}drawShape(e,i,n,r,s,o,a,h){var l;const c=Sm(e,null==o?void 0:o.theme).symbol,{size:u=c.size,fill:d=c.fill,background:p,fillOpacity:f=c.fillOpacity,strokeOpacity:g=c.strokeOpacity,opacity:v=c.opacity,lineWidth:m=c.lineWidth,stroke:y=c.stroke,visible:b=c.visible,x:x=c.x,y:w=c.y,scaleX:A=c.scaleX,scaleY:S=c.scaleY}=e.attribute,T=Nw(v,f,d),C=Ww(v,g),B=Dw(d,p),_=Lw(y,m);if(!e.valid||!b)return;if(!B&&!_)return;if(!(T||C||a||h||p))return;const P=e.getParsedPath();if(!P)return;const{keepDirIn3d:E=c.keepDirIn3d}=e.attribute,M=null!==(l=this.z)&&void 0!==l?l:0;if(i.beginPath(),E&&i.camera&&i.project){const t=i.project(n,r,M),s=i.camera;i.camera=null,!1===P.draw(i,u,t.x,t.y,void 0,((t,s)=>{s.fill&&(a?a(i,e.attribute,c):(i.setCommonStyle(e,s,x-n,w-r),i.fill())),s.stroke&&(h?h(i,e.attribute,c):(i.setStrokeStyle(e,s,(x-n)/A,(w-r)/S),i.stroke()))}))&&i.closePath(),i.camera=s}else!1===P.draw(i,u,n,r,M,((t,s)=>{s.fill&&(a?a(i,e.attribute,c):(i.setCommonStyle(e,s,x-n,w-r),i.fill())),s.stroke&&(h?h(i,e.attribute,c):(i.setStrokeStyle(e,s,(x-n)/A,(w-r)/S),i.stroke()))}))&&i.closePath();this._symbolRenderContribitions||(this._symbolRenderContribitions=this.symbolRenderContribitions.getContributions()||[],this._symbolRenderContribitions.sort(((t,e)=>e.order-t.order))),this._symbolRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,B,_,T,C,c,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),B&&!P.isSvg&&(a?a(i,e.attribute,c):T&&(i.setCommonStyle(e,e.attribute,x-n,w-r,c),i.fill())),_&&!P.isSvg&&(h?h(i,e.attribute,c):C&&(i.setStrokeStyle(e,e.attribute,(x-n)/A,(w-r)/S,c),i.stroke())),this._symbolRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,B,_,T,C,c,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).symbol,o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,jw(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&aT.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}},t.DefaultCanvasSymbolRender=vp([hp(),mp(0,up(xp)),mp(0,lp(rA)),yp("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender),t.DefaultCanvasTextRender=class extends t.BaseRender{constructor(t){super(),this.textRenderContribitions=t,this.numberType=yw}drawShape(e,i,n,r,s,o,a,h){var l,c,u;const d=Sm(e,null==o?void 0:o.theme).text,{text:p,fill:f=d.fill,stroke:g=d.stroke,fillOpacity:v=d.fillOpacity,strokeOpacity:m=d.strokeOpacity,opacity:y=d.opacity,lineWidth:b=d.lineWidth,visible:x=d.visible,underline:w=d.underline,lineThrough:A=d.lineThrough,keepDirIn3d:S=d.keepDirIn3d,direction:T=d.direction,fontSize:C=d.fontSize,verticalMode:B=d.verticalMode,x:_=d.x,y:P=d.y}=e.attribute;let{textAlign:E=d.textAlign,textBaseline:M=d.textBaseline}=e.attribute;if(!B&&"vertical"===T){const t=E;E=null!==(l=e.getBaselineMapAlign()[M])&&void 0!==l?l:"left",M=null!==(c=e.getAlignMapBaseline()[t])&&void 0!==c?c:"top"}const k=null!==(u=e.attribute.lineHeight)&&void 0!==u?u:C,R=Nw(y,v,f),O=Ww(y,m),I=Dw(f),D=Lw(g,b);if(!e.valid||!x)return;if(!(I||D||R||O))return;const L=!S,N=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)}))}this._textBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,I,D,R,O,d,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,d),L&&this.transformUseContext2d(e,d,N,i);const U=(t,s,o,l)=>{let c=n+s;const u=r+o;if(l){i.highPerformanceSave(),c+=C;const t=oT.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,u),i.transformFromMatrix(t,!0),oT.free(t)}D&&(h?h(i,e.attribute,d):O&&(i.setStrokeStyle(e,e.attribute,_-n,P-r,d),i.strokeText(t,c,u,N))),I&&(a?a(i,e.attribute,d):R&&(i.setCommonStyle(e,e.attribute,_-n,P-r,d),i.fillText(t,c,u,N),this.drawUnderLine(w,A,e,c,u,N,d,i))),l&&(i.highPerformanceRestore(),i.setTransformForCurrent())};if(Array.isArray(p))if(i.setTextStyleWithoutAlignBaseline(e.attribute,d,N),"horizontal"===T){const{multilineLayout:t}=e;if(!t)return void i.highPerformanceRestore();const{xOffset:s,yOffset:o}=t.bbox;D&&(h?h(i,e.attribute,d):O&&(i.setStrokeStyle(e,e.attribute,_-n,P-r,d),t.lines.forEach((t=>{i.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+o+r,N)})))),I&&(a?a(i,e.attribute,d):R&&(i.setCommonStyle(e,e.attribute,_-n,P-r,d),t.lines.forEach((t=>{i.fillText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+o+r,N),this.drawMultiUnderLine(w,A,e,(t.leftOffset||0)+n,(t.topOffset||0)+o+r,N,t.width,d,i)}))))}else{const t=e.cache,{verticalList:n}=t;i.textAlign="left",i.textBaseline="top";const r=k*n.length;let s=0;n.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);s=hf(e,s)}));let o=0,a=0;"bottom"===M?a=-r:"middle"===M&&(a=-r/2),"center"===E?o-=s/2:"right"===E&&(o-=s),n.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),n=s-i;let h=o;"center"===E?h+=n/2:"right"===E&&(h+=n),t.forEach((t=>{const{text:i,width:n,direction:s}=t;U(i,r-(e+1)*k+a,h,s),h+=n}))}))}else{const t=e.cache;if("horizontal"===T){i.setTextStyle(e.attribute,d,N);const t=e.clipedText;let n=0;k!==C&&("top"===M?n=(k-C)/2:"middle"===M||"bottom"===M&&(n=-(k-C)/2)),U(t,0,n,0)}else if(t){i.setTextStyleWithoutAlignBaseline(e.attribute,d,N);const{verticalList:n}=t;let r=0;const s=n[0].reduce(((t,e)=>t+(e.width||0)),0);let o=0;"bottom"===M?o=-k:"middle"===M&&(o=-k/2),"center"===E?r-=s/2:"right"===E&&(r-=s),i.textAlign="left",i.textBaseline="top",n[0].forEach((t=>{const{text:e,width:i,direction:n}=t;U(e,o,r,n),r+=i}))}}L&&this.restoreTransformUseContext2d(e,d,N,i),this._textAfterRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,I,D,R,O,d,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,h=this.transform(t,s,r,a),{x:l,y:c,z:u,lastModelMatrix:d}=h;this.z=u,this.drawShape(t,r,l,c,i,n),this.z=0,r.modelMatrix=d,r.highPerformanceRestore()}drawUnderLine(t,e,i,n,r,s,o,a){if(e+t<=0)return;const{textAlign:h=o.textAlign,textBaseline:l=o.textBaseline,fontSize:c=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,fillOpacity:p=o.fillOpacity}=i.attribute,f=i.clipedWidth,g=cA(h,f),v=uA(l,c,c),m={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};if(t){m.lineWidth=t,a.setStrokeStyle(i,m,n,r,o),a.beginPath();const e=r+v+c;a.moveTo(n+g,e,s),a.lineTo(n+g+f,e,s),a.stroke()}if(e){m.lineWidth=e,a.setStrokeStyle(i,m,n,r,o),a.beginPath();const t=r+v+c/2;a.moveTo(n+g,t,s),a.lineTo(n+g+f,t,s),a.stroke()}}drawMultiUnderLine(t,e,i,n,r,s,o,a,h){if(e+t<=0)return;const{textAlign:l=a.textAlign,fontSize:c=a.fontSize,fill:u=a.fill,opacity:d=a.opacity,fillOpacity:p=a.fillOpacity}=i.attribute,f=cA(l,o),g=uA("alphabetic",c,c),v={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};let m=-3;if(t){v.lineWidth=t,h.setStrokeStyle(i,v,n,r,a),h.beginPath();const e=r+g+c+m;h.moveTo(n+f,e,s),h.lineTo(n+f+o,e,s),h.stroke()}if(m=-1,e){v.lineWidth=e,h.setStrokeStyle(i,v,n,r,a),h.beginPath();const t=r+g+c/2+m;h.moveTo(n+f,t,s),h.lineTo(n+f+o,t,s),h.stroke()}}},t.DefaultCanvasTextRender=vp([hp(),mp(0,up(xp)),mp(0,lp(sA)),yp("design:paramtypes",[Object])],t.DefaultCanvasTextRender),t.AbstractGraphicRender=class{},t.AbstractGraphicRender=vp([hp()],t.AbstractGraphicRender),t.DefaultCanvasPolygonRender=class{constructor(t){this.polygonRenderContribitions=t,this.numberType=dw}drawShape(e,i,n,r,s,o,a,h){const l=Sm(e,null==o?void 0:o.theme).polygon,{points:c=l.points,fill:u=l.fill,stroke:d=l.stroke,cornerRadius:p=l.cornerRadius,fillOpacity:f=l.fillOpacity,background:g,strokeOpacity:v=l.strokeOpacity,lineWidth:m=l.lineWidth,opacity:y=l.opacity,visible:b=l.visible,x:x=l.x,y:w=l.y,closePath:A=l.closePath}=e.attribute,S=Nw(y,f,u),T=Ww(y,v),C=Dw(u,g),B=Lw(d,m);e.valid&&b&&(C||B)&&(S||T||a||h||g)&&(i.beginPath(),p<=0||Wp(p)&&p.every((t=>0===t))?qT(i.camera?i:i.nativeContext,c,n,r):function(t,e,i,n,r,s=!0){var o;if(e.length<3)return void qT(t,e,i,n);let a=0,h=e.length-1;s||(a+=1,h-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let s=a;s<=h;s++){const a=e[0===s?h:(s-1)%e.length],l=e[s%e.length],c=e[(s+1)%e.length],u=l.x-a.x,d=l.y-a.y,p=l.x-c.x,f=l.y-c.y,g=(Math.atan2(d,u)-Math.atan2(f,p))/2,v=Math.abs(Math.tan(g));let m=Array.isArray(r)?null!==(o=r[s%e.length])&&void 0!==o?o:0:r,y=m/v;const b=KT(u,d),x=KT(p,f),w=Math.min(b,x);y>w&&(y=w,m=w*v);const A=$T(l,y,b,u,d),S=$T(l,y,x,p,f),T=2*l.x-A.x-S.x,C=2*l.y-A.y-S.y,B=KT(T,C),_=$T(l,KT(y,m),B,T,C);let P=Math.atan2(A.y-_.y,A.x-_.x);const E=Math.atan2(S.y-_.y,S.x-_.x);let M=E-P;M<0&&(P=E,M=-M),M>Math.PI&&(M-=Math.PI),0===s?t.moveTo(A.x+i,A.y+n):t.lineTo(A.x+i,A.y+n),M&&t.arcTo(l.x+i,l.y+n,S.x+i,S.y+n,m),t.lineTo(S.x+i,S.y+n)}s||t.lineTo(e[h+1].x+i,e[h+1].y+n)}(i.camera?i:i.nativeContext,c,n,r,p,A),A&&i.closePath(),this._polygonRenderContribitions||(this._polygonRenderContribitions=this.polygonRenderContribitions.getContributions()||[],this._polygonRenderContribitions.sort(((t,e)=>e.order-t.order))),this._polygonRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),C&&(a?a(i,e.attribute,l):f&&(i.setCommonStyle(e,e.attribute,x-n,w-r,l),i.fill())),B&&(h?h(i,e.attribute,l):v&&(i.setStrokeStyle(e,e.attribute,x-n,w-r,l),i.stroke())),this._polygonRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h)})))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).polygon;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);jw(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasPolygonRender=vp([hp(),mp(0,up(xp)),mp(0,lp(iA)),yp("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);const ZT=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class{constructor(t){this.imageRenderContribitions=t,this.numberType=lw}drawShape(e,i,n,r,s,o,a){const h=Sm(e).image,{fill:l=h.fill,width:c=h.width,height:u=h.height,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,visible:f=h.visible,repeatX:g=h.repeatX,repeatY:v=h.repeatY,cornerRadius:m=h.cornerRadius,image:y}=e.attribute,b=Nw(d,p,l),x=Dw(l);if(e.valid&&f&&x&&(b||a)){if(this._imageRenderContribitions||(this._imageRenderContribitions=this.imageRenderContribitions.getContributions()||[]),this._imageRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,x,!1,b,!1,h,s,a)})),i.setShadowStyle&&i.setShadowStyle(e,h),x)if(a)a(i,e.attribute,h);else if(b){if(!y||!e.resources)return;const t=e.resources.get(y);if("success"!==t.state)return;let s=!1;0===m||Wp(m)&&m.every((t=>0===t))||(i.beginPath(),YT(i,n,r,c,u,m),i.save(),i.clip(),s=!0),i.setCommonStyle(e,e.attribute,n,r,h);let o=0;if("repeat"===g&&(o|=1),"repeat"===v&&(o|=2),o){const e=i.createPattern(t.data,ZT[o]);i.fillStyle=e,i.fillRect(n,r,c,u)}else i.drawImage(t.data,n,r,c,u);s&&i.restore()}this._imageRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,x,!1,b,!1,h,s,a)}))}}draw(t,e,i){const{context:n}=e.drawParams;if(!n)return;const r=Sm(t).image;let{x:s=r.x,y:o=r.y}=t.attribute;const{image:a}=t.attribute;if(!a||!t.resources)return;if("success"===t.resources.get(a).state){if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,n,s,o,i),n.highPerformanceRestore()}}},t.DefaultCanvasImageRender=vp([hp(),mp(0,up(xp)),mp(0,lp(tA)),yp("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const JT=Symbol.for("IncrementalDrawContribution"),QT=Symbol.for("ArcRender"),tC=Symbol.for("Arc3dRender"),eC=Symbol.for("AreaRender"),iC=Symbol.for("CircleRender"),nC=Symbol.for("GraphicRender"),rC=Symbol.for("GroupRender"),sC=Symbol.for("LineRender"),oC=Symbol.for("PathRender"),aC=Symbol.for("PolygonRender"),hC=Symbol.for("RectRender"),lC=Symbol.for("Rect3DRender"),cC=Symbol.for("SymbolRender"),uC=Symbol.for("TextRender"),dC=Symbol.for("RichTextRender"),pC=Symbol.for("Pyramid3dRender"),fC=Symbol.for("GlyphRender"),gC=Symbol.for("ImageRender"),vC=Symbol.for("RenderSelector"),mC=Symbol.for("DrawContribution");function yC(t,e,i){let n=e;const{a:r,b:s,c:o,d:a}=t.currentMatrix,h=Math.sign(r)*Math.sqrt(r*r+s*s),l=Math.sign(a)*Math.sqrt(o*o+a*a);return h+l===0?0:(n=n/Math.abs(h+l)*2*i,n)}function bC(t,e,i,n,r){if(!e||!0===e)return"black";let s,o;if(Wp(e))for(let t=0;t<e.length&&(o=e[t],!o);t++);else o=e;return"string"==typeof o?o:("linear"===o.gradient?s=function(t,e,i,n=0,r=0){var s,o,a,h;const l=i.AABBBounds;if(!l)return;let c=l.x2-l.x1,u=l.y2-l.y1,d=l.x1-n,p=l.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;c/=t,u/=e,d/=t,p/=e}const f=t.createLinearGradient(d+(null!==(s=e.x0)&&void 0!==s?s:0)*c,p+(null!==(o=e.y0)&&void 0!==o?o:0)*u,d+(null!==(a=e.x1)&&void 0!==a?a:1)*c,p+(null!==(h=e.y1)&&void 0!==h?h:0)*u);return e.stops.forEach((t=>{f.addColorStop(t.offset,t.color)})),f}(t,o,i,n,r):"conical"===o.gradient?s=function(t,e,i,n=0,r=0){var s,o;const a=i.AABBBounds;if(!a)return;let h=a.x2-a.x1,l=a.y2-a.y1,c=a.x1-n,u=a.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;h/=t,l/=e,c/=t,u/=e}const d=t.createConicGradient(c+(null!==(s=e.x)&&void 0!==s?s:0)*h,u+(null!==(o=e.y)&&void 0!==o?o:0)*l,e.startAngle,e.endAngle);let p;return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d.GetPattern(h+c,l+u,p)}(t,o,i,n,r):"radial"===o.gradient&&(s=function(t,e,i,n=0,r=0){var s,o,a,h,l,c;const u=i.AABBBounds;if(!u)return;let d=u.x2-u.x1,p=u.y2-u.y1,f=u.x1-n,g=u.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;f/=t,g/=e,d/=t,p/=e}const v=t.createRadialGradient(f+(null!==(s=e.x0)&&void 0!==s?s:.5)*d,g+(null!==(o=e.y0)&&void 0!==o?o:.5)*p,Math.max(d,p)*(null!==(a=e.r0)&&void 0!==a?a:0),f+(null!==(h=e.x1)&&void 0!==h?h:.5)*d,g+(null!==(l=e.y1)&&void 0!==l?l:.5)*p,Math.max(d,p)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{v.addColorStop(t.offset,t.color)})),v}(t,o,i,n,r)),s||"orange")}const xC=new class{constructor(){this.pools=[]}allocate(t){if(!this.pools.length)return Uv(Object.assign({nativeCanvas:Av.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 Uv(Object.assign({nativeCanvas:Av.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{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,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=Sm(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=vp([hp()],t.DefaultBaseBackgroundRenderContribution),t.DefaultBaseInteractiveRenderContribution=class{constructor(e){this.subRenderContribitions=e,this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,o,a,h,l,c,u,d)}))}},t.DefaultBaseInteractiveRenderContribution=vp([hp(),mp(0,up(xp)),mp(0,lp(oA)),yp("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution),t.DefaultBaseTextureRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,n,r){const s=(t-2*e)/2,o=xC.allocate({width:t,height:t,dpr:1}),a=o.getContext("2d");if(!a)return null;a.clearRect(0,0,t,t),r(s,a);const h=n.createPattern(o.nativeCanvas,"repeat");return xC.free(o),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,rf),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,o,a,h,l,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:f=h.textureColor,textureSize:g=h.textureSize,texturePadding:v=h.texturePadding}=t.attribute;if(!p)return;let m=this.textureMap.get(p);if(!m)switch(p){case"circle":m=this.createCirclePattern(g,v,f,e);break;case"diamond":m=this.createDiamondPattern(g,v,f,e);break;case"rect":m=this.createRectPattern(g,v,f,e);break;case"vertical-line":m=this.createVerticalLinePattern(g,v,f,e);break;case"horizontal-line":m=this.createHorizontalLinePattern(g,v,f,e);break;case"bias-lr":m=this.createBiasLRLinePattern(g,v,f,e);break;case"bias-rl":m=this.createBiasRLLinePattern(g,v,f,e);break;case"grid":m=this.createGridPattern(g,v,f,e)}m&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=m,e.fill(),e.highPerformanceRestore())}},t.DefaultBaseTextureRenderContribution=vp([hp()],t.DefaultBaseTextureRenderContribution),t.DefaultArcRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{innerRadius:v=h.innerRadius,outerRadius:m=h.outerRadius,startAngle:y=h.startAngle,endAngle:b=h.endAngle,opacity:x=h.opacity,x:w=h.x,y:A=h.y,scaleX:S=h.scaleX,scaleY:T=h.scaleY}=t.attribute,C=!(!d||!d.stroke),B=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=d,s=yC(e,r,e.dpr),o=r/m;if(t.setAttributes({outerRadius:m+s,innerRadius:v-s,startAngle:y-o,endAngle:b+o}),e.beginPath(),Gw(t,e,i,n,m+s,v-s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(C){const r=h.outerBorder.opacity;h.outerBorder.opacity=x,e.setStrokeStyle(t,d,(w-i)/S,(A-n)/T,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=yC(e,r,e.dpr),o=r/m;if(t.setAttributes({outerRadius:m-s,innerRadius:v+s,startAngle:y+o,endAngle:b-o}),e.beginPath(),Gw(t,e,i,n,m-s,v+s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(B){const r=h.innerBorder.opacity;h.innerBorder.opacity=x,e.setStrokeStyle(t,p,(w-i)/S,(A-n)/T,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:m,innerRadius:v,startAngle:y,endAngle:b})}},t.DefaultArcRenderContribution=vp([hp()],t.DefaultArcRenderContribution),t.DefaultArcBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultArcBackgroundRenderContribution=vp([hp()],t.DefaultArcBackgroundRenderContribution),t.DefaultArcTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultArcTextureRenderContribution=vp([hp()],t.DefaultArcTextureRenderContribution),t.DefaultCircleRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{radius:v=h.radius,startAngle:m=h.startAngle,endAngle:y=h.endAngle,opacity:b=h.opacity,x:x=h.x,y:w=h.y,scaleX:A=h.scaleX,scaleY:S=h.scaleY}=t.attribute,T=!(!d||!d.stroke),C=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=d,s=yC(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,v+s,m,y),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(T){const r=h.outerBorder.opacity;h.outerBorder.opacity=b,e.setStrokeStyle(t,d,(x-i)/A,(w-n)/S,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=yC(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,v-s,m,y),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(C){const r=h.innerBorder.opacity;h.innerBorder.opacity=b,e.setStrokeStyle(t,p,(x-i)/A,(w-n)/S,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultCircleRenderContribution=vp([hp()],t.DefaultCircleRenderContribution),t.DefaultCircleBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultCircleBackgroundRenderContribution=vp([hp()],t.DefaultCircleBackgroundRenderContribution),t.DefaultCircleTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultCircleTextureRenderContribution=vp([hp()],t.DefaultCircleTextureRenderContribution),t.DefaultGroupBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,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=vp([hp()],t.DefaultGroupBackgroundRenderContribution),t.DefaultImageBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,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=Sm(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 if(Lp(d)){const{stroke:i,fill:n,lineWidth:r=1,cornerRadius:s=0,expandX:o=0,expandY:a=0}=d;if(!i&&!n)return;e.beginPath();const{x:h,y:l,width:c,height:u}=function(t){const e=sy(t.attribute.boundsPadding),i=t.AABBBounds;let n=i.x1,r=i.y1,s=i.width(),o=i.height();jp(e)?(n+=e,r+=e,s-=2*e,o-=2*e):(n+=e[3],r+=e[0],s-=e[1]+e[3],o-=e[0]+e[2]);return{x:n,y:r,width:s,height:o}}(t);s?YT(e,h-o,l-a,c+2*o,u+2*a,s):e.rect(h-o,l-a,c+2*o,u+2*a),e.globalAlpha=1,n&&(e.fillStyle=n,e.fill()),i&&r>0&&(e.lineWidth=r,e.strokeStyle=i,e.stroke())}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=vp([hp()],t.DefaultImageBackgroundRenderContribution),t.DefaultRectRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{width:v=h.width,height:m=h.height,cornerRadius:y=h.cornerRadius,opacity:b=h.opacity,x:x=h.x,y:w=h.y,scaleX:A=h.scaleX,scaleY:S=h.scaleY}=t.attribute,T=!(!d||!d.stroke),C=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=d,s=yC(e,r,e.dpr),o=i-s,a=n-s,l=2*s;if(0===y||Wp(y)&&y.every((t=>0===t))?(e.beginPath(),e.rect(o,a,v+l,m+l)):(e.beginPath(),YT(e,o,a,v+l,m+l,y)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(T){const r=h.outerBorder.opacity;h.outerBorder.opacity=b,e.setStrokeStyle(t,d,(x-i)/A,(w-n)/S,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=yC(e,r,e.dpr),o=i+s,a=n+s,l=2*s;if(0===y||Wp(y)&&y.every((t=>0===t))?(e.beginPath(),e.rect(o,a,v-l,m-l)):(e.beginPath(),YT(e,o,a,v-l,m-l,y)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(C){const r=h.innerBorder.opacity;h.innerBorder.opacity=b,e.setStrokeStyle(t,p,(x-i)/A,(w-n)/S,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultRectRenderContribution=vp([hp()],t.DefaultRectRenderContribution),t.DefaultRectBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultRectBackgroundRenderContribution=vp([hp()],t.DefaultRectBackgroundRenderContribution),t.DefaultRectTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultRectTextureRenderContribution=vp([hp()],t.DefaultRectTextureRenderContribution),t.SplitRectBeforeRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){const{stroke:p=h.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}},t.SplitRectBeforeRenderContribution=vp([hp()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,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=vp([hp()],t.SplitRectAfterRenderContribution),t.DefaultSymbolRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:f}=t.attribute,g=p&&!1!==p.visible,v=f&&!1!==f.visible;if(!g&&!v)return;const{size:m=h.size,opacity:y=h.opacity,x:b=h.x,y:x=h.y,scaleX:w=h.scaleX,scaleY:A=h.scaleY}=t.attribute,S=!(!p||!p.stroke),T=!(!f||!f.stroke);if(g){const{distance:r=h.outerBorder.distance}=p,s=yC(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,m,i,n,s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.outerBorder);else if(S){const r=h.outerBorder.opacity;h.outerBorder.opacity=y,e.setStrokeStyle(t,p,(b-i)/w,(x-n)/A,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(v){const{distance:r=h.innerBorder.distance}=f,s=yC(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,m,i,n,-s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,f,h.innerBorder);else if(T){const r=h.innerBorder.opacity;h.innerBorder.opacity=y,e.setStrokeStyle(t,f,(b-i)/w,(x-n)/A,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultSymbolRenderContribution=vp([hp()],t.DefaultSymbolRenderContribution);class wC extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}}class AC extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}}const SC=Symbol.for("RenderService"),TC=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{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,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}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=vp([hp(),mp(0,up(mC)),yp("design:paramtypes",[Object])],t.DefaultRenderService);var CC=new np((e=>{e(t.DefaultRenderService).toSelf(),e(SC).toService(t.DefaultRenderService)}));function BC(t,e,i,n=!1,r=!1){const s={},o=[];let a=!1;if(r)a=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:r=e}=t.attribute;if(0===n)i=r;else if(i!==r)return a=!0,!0;return!1}),n)}if(a){t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],o.push(i))}),n),o.sort(((t,e)=>n?e-t:t-e));let a=!1;for(let t=0;t<o.length&&!a;t++){const e=o[t],h=s[e];r&&h.sort(((t,e)=>{var i,r;return(n?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(r=t.attribute.z)&&void 0!==r?r:0))}));for(let t=0;t<h.length;t++)if(i(h[t],t)){a=!0;break}}}else t.forEachChildren(i,n)}function _C(t,e,i,n=!1){return bp(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,n)}))}function PC(t,e,i,n=!1){const r={},s=[];let o=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(undefined!==n)return o=!0,!0;return!1}),n);let a=null,h=!1;if(o){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 o=!1;for(let t=0;t<s.length&&!o;t++){const i=s[t],n=r[i];for(let t=0;t<n.length;t++){if(h){o=!0,a=n[t];break}n[t]._uid!==e||(h=!0)}}}else t.forEachChildren((t=>h?(a=t,!0):(t._uid===e&&(h=!0),!1)),n);return a}const EC=Symbol.for("PickItemInterceptor");let MC=class{constructor(){this.order=1}afterPickItem(t,e,i,n,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,r):null}beforePickItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,r):null}_pickItem(t,e,i,n,r){if(!t.shadowRoot)return null;const{parentMatrix:s}=r||{};if(!s)return null;const o=e.pickContext;o.highPerformanceSave();const a=t.shadowRoot,h=oT.allocateByObj(s),l=new mf(i.x,i.y);s.transformPoint(l,l);const c=t.transMatrix;h.multiply(c.a,c.b,c.c,c.d,c.e,c.f);const u=e.pickGroup(a,l.clone(),h,n);return o.highPerformanceRestore(),u}};MC=vp([hp()],MC);let kC=class{constructor(){this.order=1}beforePickItem(t,e,i,n,r){if(!t.in3dMode||n.in3dInterceptor)return null;const s=e.pickContext,o=t.stage;if(!s||!o)return null;if(n.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=o.camera,t.isContainer){let o,a=!1,h=!1;if(t.forEachChildren((t=>(a=t.numberType===rw,!a))),t.forEachChildren((t=>(h=!!t.findFace,!h))),a){const s=t.getChildren(),a=[...s];a.sort(((t,e)=>{var i,n,r,s;let o=(null!==(n=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==n?n:0)/2,a=(null!==(s=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==s?s:0)/2;for(;o<0;)o+=rf;for(;a<0;)a+=rf;return a-o})),a.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),a.forEach((e=>{t.appendChild(e)})),n.hack_pieFace="outside",o=e.pickGroup(t,i,r.parentMatrix,n),o.graphic||(n.hack_pieFace="inside",o=e.pickGroup(t,i,r.parentMatrix,n)),o.graphic||(n.hack_pieFace="top",o=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 a=t.getChildren(),h=a.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i: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)})),o=e.pickGroup(t,i,r.parentMatrix,n),t.removeAllChild(),a.forEach((t=>{t._next=null,t._prev=null})),t.update(),a.forEach((e=>{t.add(e)}))}else o=e.pickGroup(t,i,r.parentMatrix,n);return s.camera=null,n.in3dInterceptor=!1,o}return s.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};kC=vp([hp()],kC);const RC=Symbol.for("GraphicPicker"),OC=Symbol.for("PickerService");t.DefaultPickService=class{constructor(t,e){this.global=t,this.pickItemInterceptorContributions=e,this.type="default"}_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 o=new Of(1,0,0,1,r,s);let a;for(let r=t.length-1;r>=0&&(n=t[r].isContainer?this.pickGroup(t[r],e,o,i):this.pickItem(t[r],e,o,i),!n.graphic);r--)a||(a=n.group);if(n.graphic||(n.group=a),this.pickContext&&(this.pickContext.inuse=!1),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){return!!this.pickItem(t,e,null,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=n.pickContext,o=s.modelMatrix;if(s.camera){const e=t.transMatrix,i=aT.allocate();if(uT(i,e),o){if(i){const t=aT.allocate();s.modelMatrix=dT(t,o,i),aT.free(i)}}else uT(i,t.globalTransMatrix),s.modelMatrix=i}if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const a=this.InterceptorContributions[r];if(a.beforePickItem){const r=a.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return s.modelMatrix!==o&&aT.free(s.modelMatrix),s.modelMatrix=o,r}}const a=t.transMatrix,h=oT.allocateByObj(i),l=new mf(e.x,e.y);h.transformPoint(l,l);const c=t.AABBBounds.containsPoint(l);if(!c&&!t.stage.camera)return r;const u=this.pickItem(t,l.clone(),i,n);u&&u.graphic&&(r.graphic=u.graphic,r.params=u.params);const d=!1!==t.attribute.pickable&&c;return h.multiply(a.a,a.b,a.c,a.d,a.e,a.f),!1===t.attribute.childrenPickable||u&&u.graphic||BC(t,ov.zIndex,(s=>{if(s.isContainer){const i=new mf(e.x,e.y),o=Sm(t).group,{scrollX:a=o.scrollX,scrollY:l=o.scrollY}=t.attribute;i.x-=a,i.y-=l,r=this.pickGroup(s,i,h,n)}else{const o=new mf(e.x,e.y);h.transformPoint(o,o);const a=Sm(t).group,{scrollX:l=a.scrollX,scrollY:c=a.scrollY}=t.attribute;o.x-=l,o.y-=c;const u=this.pickItem(s,o,i,n);u&&u.graphic&&(r.graphic=u.graphic,r.params=u.params)}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==o&&aT.free(s.modelMatrix),s.modelMatrix=o,r.graphic||r.group||!d||t.stage.camera||(r.group=t),oT.free(h),r}selectPicker(t){const e=this.pickerMap.get(t.numberType);return e||null}},t.DefaultPickService=vp([hp(),mp(0,up(_p)),mp(1,up(xp)),mp(1,lp(EC)),yp("design:paramtypes",[Object,Object])],t.DefaultPickService);const IC=Symbol.for("BoundsPicker"),DC=Symbol.for("GlobalPickerService");function LC(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i[0],x=i[1],w=i[2],A=i[3];return t[0]=b*n+x*a+w*u+A*g,t[1]=b*r+x*h+w*d+A*v,t[2]=b*s+x*l+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i[4],x=i[5],w=i[6],A=i[7],t[4]=b*n+x*a+w*u+A*g,t[5]=b*r+x*h+w*d+A*v,t[6]=b*s+x*l+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=i[8],x=i[9],w=i[10],A=i[11],t[8]=b*n+x*a+w*u+A*g,t[9]=b*r+x*h+w*d+A*v,t[10]=b*s+x*l+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i[12],x=i[13],w=i[14],A=i[15],t[12]=b*n+x*a+w*u+A*g,t[13]=b*r+x*h+w*d+A*v,t[14]=b*s+x*l+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t}function NC(t,e,i){const n=e[0],r=e[1],s=e[2];let o=i[3]*n+i[7]*r+i[11]*s+i[15];return o=o||1,t[0]=(i[0]*n+i[4]*r+i[8]*s+i[12])/o,t[1]=(i[1]*n+i[5]*r+i[9]*s+i[13])/o,t[2]=(i[2]*n+i[6]*r+i[10]*s+i[14])/o,t}t.DefaultGlobalPickerService=class{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 Of(1,0,0,1,0,0);let s;for(let o=0;o<t.length;o++){if(t[o].isContainer)n=this.pickGroup(t[o],e,r,i);else{const s=this.pickItem(t[o],e,r,i);s&&(n.graphic=s.graphic,n.params=s.params)}if(n.graphic)break;s||(s=n.group)}if(n.graphic||(n.group=s),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){return!!this.pickItem(t,e,null,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=t.transMatrix,o=new mf(e.x,e.y);i.transformPoint(o,o);const a=t.AABBBounds.containsPoint(o);if(!a)return r;const h=!1!==t.attribute.pickable&&a;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 mf(e.x,e.y);i.transformPoint(s,s);const o=this.pickItem(t,s,i,n);o&&(r.graphic=o.graphic,r.params=o.params)}return!!r.graphic||!!r.group})),r.graphic||r.group||!h||(r.group=t),r}pickItem(t,e,i,n){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?{graphic:t}:null}},t.DefaultGlobalPickerService=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],t.DefaultGlobalPickerService);class UC{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=aT.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=aT.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,n){let r,s,o,a,h,l,c,u,d,p;const f=e[0],g=e[1],v=e[2],m=n[0],y=n[1],b=n[2],x=i[0],w=i[1],A=i[2];Math.abs(f-x)<Qp&&Math.abs(g-w)<Qp&&Math.abs(v-A)<Qp?sT.identity(t):(c=f-x,u=g-w,d=v-A,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,r=y*d-b*u,s=b*c-m*d,o=m*u-y*c,p=Math.hypot(r,s,o),p?(p=1/p,r*=p,s*=p,o*=p):(r=0,s=0,o=0),a=u*o-d*s,h=d*r-c*o,l=c*s-u*r,p=Math.hypot(a,h,l),p?(p=1/p,a*=p,h*=p,l*=p):(a=0,h=0,l=0),t[0]=r,t[1]=a,t[2]=c,t[3]=0,t[4]=s,t[5]=h,t[6]=u,t[7]=0,t[8]=o,t[9]=l,t[10]=d,t[11]=0,t[12]=-(r*f+s*g+o*v),t[13]=-(a*f+h*g+l*v),t[14]=-(c*f+u*g+d*v),t[15]=1)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=aT.allocate()),this._vp=LC(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=aT.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=aT.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return function(t,e,i,n,r,s,o){const a=1/(e-i),h=1/(n-r),l=1/(s-o);t[0]=-2*a,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*l,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*h,t[14]=(o+s)*l,t[15]=1}(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=aT.allocate()),this._vp=LC(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return NC(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;NC(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 WC=[0,0,0],FC=new Of(1,0,0,1,0,0);t.BrowserContext2d=class{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())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},Qg),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},ev),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},iv),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Of(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Of(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 Of(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 oT.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&&(oT.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(oT.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,o=!0,a=this.dpr){this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&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,o=!0){this.matrix.multiply(t,e,i,n,r,s),o&&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,o){if(o=o||0,this.camera){const a=[];((t,e,i,n,r,s,o,a)=>{if(a)for(;i>e;)i-=rf;else for(;i<e;)i+=rf;const h=tf/3*(i>e?1:-1);let l=e,c=l;for(;c!==i;){c=h>0?Math.min(c+h,i):Math.max(c+h,i);const e=Math.abs(c-l),a=4*Math.tan(e/4)/3,u=c<l?-1:1,d=Math.cos(l),p=Math.sin(l),f=Math.cos(c),g=Math.sin(c),v=d*s+n,m=p*o+r,y=f*s+n,b=g*o+r,x=s*a*u,w=o*a*u;t.push([v-x*p,m+w*d,y+x*g,b-w*f,y,b]),l=c}})(a,n,r,t,e,i,i,s);for(let t=0;t<a.length;++t){const e=a[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],o)}}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,o){if(o=o||0,this.camera){let a=o,h=o;this.modelMatrix&&(NC(WC,[t,e,o],this.modelMatrix),t=WC[0],e=WC[1],a=WC[2],NC(WC,[i,n,o],this.modelMatrix),i=WC[0],n=WC[1],h=WC[2],NC(WC,[r,s,o],this.modelMatrix),r=WC[0],s=WC[1],o=WC[2]);let l=this.camera.vp(r,s,o);r=l.x,s=l.y,l=this.camera.vp(t,e,a),t=l.x,e=l.y,l=this.camera.vp(i,n,h),i=l.x,n=l.y}this.nativeContext.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.nativeContext.closePath()}ellipse(t,e,i,n,r,s,o,a){null==a?this.nativeContext.ellipse(t,e,i,n,r,s,o):this.nativeContext.ellipse(t,e,i,n,r,s,o,a)}lineTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(NC(WC,[t,e,i],this.modelMatrix),t=WC[0],e=WC[1],i=WC[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&&(NC(WC,[t,e,i],this.modelMatrix),t=WC[0],e=WC[1],i=WC[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&&(NC(WC,[t,e,r],this.modelMatrix),t=WC[0],e=WC[1],s=WC[2],NC(WC,[i,n,r],this.modelMatrix),i=WC[0],n=WC[1],r=WC[2]);let o=this.camera.vp(i,n,r);i=o.x,n=o.y,o=this.camera.vp(t,e,s),t=o.x,e=o.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 o=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),s=!0},GetPattern(a,h,l){return s&&(l||(l=n-i),r=Kw(o,this.stops,t,e,l,i,n,a,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&&(NC(WC,[t,e,i],this.modelMatrix),t=WC[0],e=WC[1],i=WC[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&&(NC(WC,[t,e,i],this.modelMatrix),t=WC[0],e=WC[1],i=WC[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(NC(WC,[e,i,n],this.modelMatrix),e=WC[0],i=WC[1],n=WC[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=Av.global.measureTextMethod){var i,n;return e&&"native"!==e?(this.mathTextMeasure||(this.mathTextMeasure=Av.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas))),this.mathTextMeasure.textSpec.fontFamily=null!==(i=this.fontFamily)&&void 0!==i?i:iv.fontFamily,this.mathTextMeasure.textSpec.fontSize=null!==(n=this.fontSize)&&void 0!==n?n:iv.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&&(NC(WC,[e,i,n],this.modelMatrix),e=WC[0],i=WC[1],n=WC[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])}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:o=r.fillOpacity,opacity:a=r.opacity,fill:h=r.fill}=e;o>1e-12&&a>1e-12?(s.globalAlpha=o*a,s.fillStyle=bC(this,h,t,i,n)):s.globalAlpha=o*a}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)}_setShadowStyle(t,e,i){const n=this.nativeContext;i||(i=this.fillAttributes);const{opacity:r=i.opacity,shadowBlur:s=i.shadowBlur,shadowColor:o=i.shadowColor,shadowOffsetX:a=i.shadowOffsetX,shadowOffsetY:h=i.shadowOffsetY,blur:l=i.blur}=e;r<=1e-12||(s||a||h?(n.shadowBlur=s,n.shadowColor=o,n.shadowOffsetX=a,n.shadowOffsetY=h,this._clearShadowStyle=!0):this._clearShadowStyle&&(n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0),l?(n.filter=`blur(${l}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:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=yC(this,h,this.dpr),s.strokeStyle=bC(this,l,t,i,n),s.lineJoin=c,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=lA(t,e,r&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:s=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=s,this.fontSize=o,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){var n,r;const s=this.nativeContext;e||(e=this.textAttributes),t.font?s.font=t.font:s.font=lA(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:o=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=o,this.fontSize=a,s.textAlign=null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(FC,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=>oT.free(t))),this.stack.length=0}},t.BrowserContext2d.env="browser",t.BrowserContext2d=vp([hp(),yp("design:paramtypes",[Object,Number])],t.BrowserContext2d);const jC={WIDTH:500,HEIGHT:500,DPR:1};t.BrowserCanvas=class{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._displayWidth,this._displayHeight)}constructor(e){const{nativeCanvas:i,width:n=jC.WIDTH,height:r=jC.HEIGHT,dpr:s=jC.DPR,container:o,x:a,y:h,canvasControled:l=!0}=e;if(this._x=null!=a?a:0,this._y=null!=h?h:0,this._pixelWidth=n*s,this._pixelHeight=r*s,this._visiable=!1!==e.visiable,this.controled=l,"string"==typeof o){const t=Av.global.getElementById(o);t&&(this._container=t)}else this._container=o;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:o}=this;o.width=e*n,o.height=i*n;!o.style||this.setCanvasStyle(o,r,s,e,i),t.id&&(o.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.env="browser",t.BrowserCanvas=vp([hp(),yp("design:paramtypes",[Object])],t.BrowserCanvas);const zC=Symbol.for("CanvasArcPicker"),HC=Symbol.for("CanvasArc3dPicker"),GC=Symbol.for("CanvasAreaPicker"),VC=Symbol.for("CanvasCirclePicker"),XC=Symbol.for("CanvasImagePicker"),YC=Symbol.for("CanvasLinePicker"),qC=Symbol.for("CanvasPathPicker"),KC=Symbol.for("CanvasRectPicker"),$C=Symbol.for("CanvasRect3dPicker"),ZC=Symbol.for("CanvasSymbolPicker"),JC=Symbol.for("CanvasTextPicker"),QC=Symbol.for("CanvasPolygonPicker"),tB=Symbol.for("CanvasPyramid3dPicker"),eB=Symbol.for("CanvasRichTextPicker"),iB=Symbol.for("CanvasGlyphPicker"),nB=Symbol.for("CanvasGroupPicker"),rB=Symbol.for("CanvasPickerContribution"),sB=Symbol.for("MathArcPicker"),oB=Symbol.for("MathAreaPicker"),aB=Symbol.for("MathCirclePicker"),hB=Symbol.for("MathLinePicker"),lB=Symbol.for("MathPathPicker"),cB=Symbol.for("MathRectPicker"),uB=Symbol.for("MathSymbolPicker"),dB=Symbol.for("MathTextPicker"),pB=Symbol.for("MathPolygonPicker"),fB=Symbol.for("MathGlyphPicker"),gB=Symbol.for("MathPickerContribution");t.DefaultCanvasPickerService=class extends t.DefaultPickService{constructor(t,e,i,n,r,s,o,a,h,l,c,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=o,this.pathPicker=a,this.symbolPicker=h,this.textPicker=l,this.polygonPicker=c,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,n){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.beforePickItem){const r=s.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n)?t:null,o={graphic:s};if(s)return o;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.afterPickItem){const r=s.afterPickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}return o}},vp([gp(),yp("design:type",Function),yp("design:paramtypes",[]),yp("design:returntype",void 0)],t.DefaultCanvasPickerService.prototype,"init",null),t.DefaultCanvasPickerService=vp([hp(),mp(0,up(xp)),mp(0,lp(rB)),mp(1,up(VC)),mp(2,up(KC)),mp(3,up(zC)),mp(4,up(GC)),mp(5,up(XC)),mp(6,up(YC)),mp(7,up(qC)),mp(8,up(ZC)),mp(9,up(JC)),mp(10,up(QC)),mp(11,up(eB)),mp(12,up(mC)),mp(13,up(_p)),mp(14,up(xp)),mp(14,lp(EC)),yp("design:paramtypes",[Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object])],t.DefaultCanvasPickerService);const vB=new Of(1,0,0,1,0,0),mB={x:0,y:0};t.EmptyContext2d=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Of(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Of(1,0,0,1,0,0),this.path=new qg}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 oT.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(oT.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(oT.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,o=!0,a=this.dpr){this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&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,o=!0){this.matrix.multiply(t,e,i,n,r,s),o&&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,o,a){}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},mB),function(t,e,i){return pm(t,0,!1,e,i)}(this.path.commandList,mB.x,mB.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},mB);const i=yC(this,this.lineWidth,this.dpr);return function(t,e,i,n){return pm(t,e,!0,i,n)}(this.path.commandList,i,mB.x,mB.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(vB,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=>oT.free(t))),this.stack.length=0}},t.EmptyContext2d=vp([hp(),yp("design:paramtypes",[Object,Number])],t.EmptyContext2d),t.DefaultMathPickerService=class extends t.DefaultPickService{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,n){if(!1===t.attribute.pickable)return null;const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n)?t:null;return s?{graphic:s}:null}},vp([gp(),yp("design:type",Function),yp("design:paramtypes",[]),yp("design:returntype",void 0)],t.DefaultMathPickerService.prototype,"init",null),t.DefaultMathPickerService=vp([hp(),mp(0,up(xp)),mp(0,lp(gB)),mp(1,up(_p)),mp(2,up(xp)),mp(2,lp(EC)),yp("design:paramtypes",[Object,Object,Object])],t.DefaultMathPickerService);var yB=new np((e=>{e(t.DefaultCanvasPickerService).toSelf().inSingletonScope(),e(t.DefaultMathPickerService).toSelf().inSingletonScope(),e(OC).toService(t.DefaultCanvasPickerService),e(t.DefaultGlobalPickerService).toSelf().inSingletonScope(),e(DC).toService(t.DefaultGlobalPickerService),e(kC).toSelf().inSingletonScope(),e(EC).toService(kC),e(MC).toSelf().inSingletonScope(),e(EC).toService(MC),Ap(e,EC)})),bB=new np((e=>{e(t.DefaultGraphicService).toSelf().inSingletonScope(),e(bw).toService(t.DefaultGraphicService),e(XS).toSelf().inSingletonScope(),e(VS).toService(XS),Ap(e,VS),e(qS).toSelf().inSingletonScope(),e(YS).toService(qS),Ap(e,YS),e($S).toSelf().inSingletonScope(),e(KS).toService($S),Ap(e,KS),e(JS).toSelf().inSingletonScope(),e(ZS).toService(JS),Ap(e,ZS),e(tT).toSelf().inSingletonScope(),e(QS).toService(tT),Ap(e,QS),e(xw).toConstantValue(IT)}));const xB=Symbol.for("AutoEnablePlugins"),wB=Symbol.for("PluginService");let AB=class{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&&Dv.isBound(xB)&&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=[]}};AB=vp([hp(),mp(0,up(xp)),mp(0,lp(xB)),yp("design:paramtypes",[Object])],AB);var SB=new np((t=>{t(AB).toSelf(),t(wB).toService(AB),Sp(t,xB)}));t.BaseEnvContribution=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new wf}removeDom(t){return!1}createDom(t){return null}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"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}},t.BaseEnvContribution=vp([hp()],t.BaseEnvContribution);class TB{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function CB(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}let BB=class extends t.BaseEnvContribution{constructor(){super(),this.type="browser",this.supportEvent=!0;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){var i;if(e){const{clientX:n,clientY:r}=t,s=e.getBoundingClientRect(),o=null===(i=e.getNativeHandler)||void 0===i?void 0:i.call(e).nativeCanvas;let a,h;return o&&(a=s.width/o.offsetWidth,h=s.height/o.offsetHeight),{x:(n-s.left)/(zp(a)?a:1),y:(r-s.top)/(zp(h)?a:1)}}return{x:t.offsetX,y:t.offsetY}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/xml").firstChild),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new TB(t)}return new wf}removeDom(t){return t.parentElement.removeChild(t),!0}createDom(t){const{tagName:e="div",width:i,height:n,style:r,parent:s}=t,o=document.createElement(e);if(r&&(Up(r)?o.setAttribute("style",r):Object.keys(r).forEach((t=>{o.setAttribute(t,r[t])}))),null!=i&&(o.style.width=`${i}px`),null!=n&&(o.style.height=`${n}px`),s){const t=Up(s)?this.getElementById(s):s;t&&t.appendChild&&t.appendChild(o)}return o}loadImage(t){return CB(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return CB(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,i;const n=document.createElement("canvas");t.id&&(n.id=null!==(e=t.id)&&void 0!==e?e:Cm.GenAutoIncrementId().toString());const r=null!==(i=t.dpr)&&void 0!==i?i:window.devicePixelRatio;return t.width&&t.height&&(n.style.width=`${t.width}px`,n.style.height=`${t.height}px`,n.width=t.width*r,n.height=t.height*r),n}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}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){}getElementTop(t,e){let i=t.offsetTop,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,n=n.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetLeft,n=n.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,n=t.offsetLeft,r=t.offsetParent;for(;null!==r;)i+=r.offsetTop,n+=r.offsetLeft,r=r.offsetParent;return{top:i,left:n}}};function _B(){Dv.rebind(OC).toService(t.DefaultMathPickerService)}function PB(){Dv.rebind(OC).toService(t.DefaultMathPickerService)}BB=vp([hp(),yp("design:paramtypes",[])],BB);let EB=class extends t.BaseEnvContribution{constructor(){super(),this.type="feishu",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,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,o)=>{const a=tt.createCanvasContext(e);a.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:null!=e?e:"",getContext:()=>a,getBoundingClientRect:()=>({height:t.height,width:t.width})};i.set(e,h),o>=n&&r.push(h)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),_B())}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 vy.call(t)}}getCancelAnimationFrame(){return t=>{vy.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){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};EB=vp([hp(),yp("design:paramtypes",[])],EB);let MB=class extends t.BaseEnvContribution{constructor(){super(),this.type="taro",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,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,o,a,h;t.env===this.type&&(t.setActiveEnvContribution(this),i=e.domref,n=e.canvasIdLists,r=this.canvasMap,s=e.freeCanvasIdx,o=this.freeCanvasList,a=e.taro,h=e.pixelRatio,n.forEach(((t,e)=>{const n=a.createCanvasContext(t);n.canvas={width:i.width*h,height:i.height*h},n.createRadialGradient||(n.createRadialGradient=(...t)=>n.createCircularGradient(...t)),!n.getImageData&&a.canvasGetImageData&&(n.getImageData=(e,i,n,r)=>new Promise(((s,o)=>{try{a.canvasGetImageData({canvasId:t,x:e,y:i,width:n,height:r,success(t){s(t)}})}catch(t){o(t)}})));const l={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,l),e>=s&&o.push(l),l})),this.taro=e.taro,this.pixelRatio=e.pixelRatio,PB())}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){}};MB=vp([hp(),yp("design:paramtypes",[])],MB);let kB=!1;try{kB=!!lynx.createCanvasNG}catch(t){}let RB=class extends t.BaseEnvContribution{constructor(){super(),this.type="lynx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,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,o)=>{const a=kB?lynx.createCanvasNG(e):lynx.createCanvas(e);a.width=t.width*s,a.height=t.height*s,kB&&a.attachToCanvasView(e);const h=a.getContext("2d");h.draw=(t,e)=>{e()};const l={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:null!=e?e:"",getContext:()=>h,getBoundingClientRect:()=>({height:t.height,width:t.width})};i.set(e,l),o>=n&&r.push(l)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),_B())}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 vy.call(t)}}getCancelAnimationFrame(){return t=>{vy.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){}};RB=vp([hp(),yp("design:paramtypes",[])],RB);let OB=class extends t.BaseEnvContribution{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.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 vy.call(t)}}getCancelAnimationFrame(){return t=>{vy.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(...t){}createOffscreenCanvas(t){}};OB=vp([hp()],OB);let IB=class extends t.BaseEnvContribution{constructor(){super(),this.type="wx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,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),function(t,e,i,n,r,s){return bp(this,void 0,void 0,(function*(){const t=wx.getSystemInfoSync().pixelRatio;for(let o=0;o<e.length;o++){const a=e[o];yield new Promise((e=>{let h=wx.createSelectorQuery();s&&(h=h.in(s)),h.select(`#${a}`).fields({node:!0,size:!0}).exec((s=>{if(!s[0])return;const h=s[0].node,l=s[0].width,c=s[0].height;h.width=l*t,h.height=c*t,i.set(a,h),o>=n&&r.push(h),e(null)}))}))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((()=>{_B()}))}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 vy.call(t)}}getCancelAnimationFrame(){return t=>{vy.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){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};IB=vp([hp(),yp("design:paramtypes",[])],IB);var DB=new np((t=>{t(BB).toSelf().inSingletonScope(),t(Bp).toService(BB),t(EB).toSelf().inSingletonScope(),t(Bp).toService(EB),t(MB).toSelf().inSingletonScope(),t(Bp).toService(MB),t(RB).toSelf().inSingletonScope(),t(Bp).toService(RB),t(IB).toSelf().inSingletonScope(),t(Bp).toService(IB),t(OB).toSelf().inSingletonScope(),t(Bp).toService(OB),Ap(t,Bp)}));t.BaseWindowHandlerContribution=class{constructor(){this._uid=Cm.GenAutoIncrementId()}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}},t.BaseWindowHandlerContribution=vp([hp(),yp("design:paramtypes",[])],t.BaseWindowHandlerContribution);let LB=class extends t.BaseWindowHandlerContribution{get container(){return this.canvas.nativeCanvas.parentElement}constructor(t){super(),this.global=t,this.type="browser",this._canvasIsIntersecting=!0}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),this.postInit()}postInit(){try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>n)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}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:Cm.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new t.BrowserCanvas(r)}createWindowByCanvas(e){var i;let n;if("string"==typeof e.canvas){if(n=this.global.getElementById(e.canvas),!n)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else n=e.canvas;if(!n)throw new Error("发生错误,传入的canvas不正确");let r=e.width,s=e.height;if(null==r||null==s||!e.canvasControled){const t=n.getBoundingClientRect();r=t.width,s=t.height}let o=e.dpr;if(!1===e.canvasControled&&(o&&console.warn("canvasControled为false后,dpr参数将无效"),o=null),null==o){o=null!==(i=n.getContext("2d").pixelRatio)&&void 0!==i?i:n.width/r}this.canvas=new t.BrowserCanvas({width:r,height:s,dpr:o,nativeCanvas:n,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()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};LB.env="browser",LB=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],LB);let NB=class extends t.BrowserContext2d{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)=>{var o;try{tt.canvasGetImageData({canvasId:null!==(o=this.canvas.nativeCanvas.id)&&void 0!==o?o: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}};NB.env="feishu",NB=vp([hp()],NB);const UB={WIDTH:500,HEIGHT:500,DPR:1};let WB=class{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=UB.WIDTH,height:n=UB.HEIGHT,dpr:r=UB.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,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 NB(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){}};WB.env="feishu",WB=vp([hp(),yp("design:paramtypes",[Object])],WB);let FB=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="feishu",this.eventManager=new class{constructor(){this.cache={}}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={}}}}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:Cm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new WB(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 WB({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()}};FB.env="feishu",FB=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],FB);let jB=class extends t.BrowserContext2d{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:o=r.fillOpacity,opacity:a=r.opacity,fill:h=r.fill}=e;o>1e-12&&a>1e-12&&(s.setGlobalAlpha(o*a),s.setFillStyle(bC(this,h,t,i,n)))}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.setGlobalAlpha(o*a),s.setLineWidth(yC(this,h,this.dpr)),s.setStrokeStyle(bC(this,l,t,i,n)),s.setLineJoin(c),s.setLineDash(u),s.setLineCap(d),s.setMiterLimit(p)}}setTextStyleWithoutAlignBaseline(t,e){var i;const n=this.nativeContext;e||(e=this.textAttributes),t.font?n.font=t.font:n.font=lA(t,e),n.setFontSize(null!==(i=t.fontSize)&&void 0!==i?i:e.fontSize)}setTextStyle(t,e){var i,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=lA(t,e),r.setTextAlign(null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign),r.setTextBaseline(null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline)}createConicGradient(t,e,i,n){return null}createPattern(t,e){return null}};jB.env="taro",jB=vp([hp()],jB);const zB={WIDTH:500,HEIGHT:500,DPR:1};let HB=class{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=zB.WIDTH,height:n=zB.HEIGHT,dpr:r=zB.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,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 jB(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){}};HB.env="taro",HB=vp([hp(),yp("design:paramtypes",[Object])],HB);let GB=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="taro",this.eventManager=new class{constructor(){this.cache={}}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={}}}}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:Cm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new HB(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 HB({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]=Object.assign(Object.assign({},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]=Object.assign(Object.assign({},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()}};GB.env="taro",GB=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],GB);let VB=class extends t.BrowserContext2d{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:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=yC(this,h,this.dpr),s.strokeStyle=bC(this,l,t,i,n),s.lineJoin=c,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)}))}))}};VB.env="lynx",VB=vp([hp()],VB);const XB={WIDTH:500,HEIGHT:500,DPR:1};let YB=class{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=XB.WIDTH,height:n=XB.HEIGHT,dpr:r=XB.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,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 VB(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){}};YB.env="lynx",YB=vp([hp(),yp("design:paramtypes",[Object])],YB);let qB=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="lynx",this.eventManager=new class{constructor(){this.cache={}}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={}}}}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:Cm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new YB(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 YB({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()}};qB.env="lynx",qB=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],qB),new Of(1,0,0,1,0,0);let KB=class extends t.BrowserContext2d{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 Of(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(...t){}};KB.env="node",KB=vp([hp(),yp("design:paramtypes",[Object,Number])],KB);const $B={WIDTH:500,HEIGHT:500,DPR:1};let ZB=class{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=$B.WIDTH,height:n=$B.HEIGHT,canvasControled:r=!0,dpr:s=$B.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 KB(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&&Op(this._nativeCanvas.release)&&this._nativeCanvas.release()}};ZB.env="node",ZB=vp([hp(),yp("design:paramtypes",[Object])],ZB);let JB=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}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:Cm.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new ZB(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 ZB({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){}};JB.env="node",JB=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],JB);let QB=class extends t.BrowserContext2d{draw(){}createPattern(t,e){return null}};QB.env="wx",QB=vp([hp()],QB);const t_={WIDTH:500,HEIGHT:500,DPR:1};let e_=class{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=t_.WIDTH,height:n=t_.HEIGHT,dpr:r=t_.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,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 QB(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_.env="wx",e_=vp([hp(),yp("design:paramtypes",[Object])],e_);class i_{constructor(){this.cache={}}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={}}}let n_=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="wx",this.eventManager=new i_}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:Cm.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){var e,i,n,r;const{type:s}=t;return!!this.eventManager.cache[s]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=null!==(e=t.changedTouches[0].x)&&void 0!==e?e:t.changedTouches[0].pageX,t.changedTouches[0].clientX=null!==(i=t.changedTouches[0].x)&&void 0!==i?i:t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=null!==(n=t.changedTouches[0].y)&&void 0!==n?n:t.changedTouches[0].pageY,t.changedTouches[0].clientY=null!==(r=t.changedTouches[0].y)&&void 0!==r?r:t.changedTouches[0].pageY),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[s].listener&&this.eventManager.cache[s].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()}};n_.env="wx",n_=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],n_);var r_=new np((t=>{t(LB).toSelf(),t(Mw).toDynamicValue((t=>t.container.get(LB))).whenTargetNamed(LB.env),t(FB).toSelf(),t(Mw).toDynamicValue((t=>t.container.get(FB))).whenTargetNamed(FB.env),t(GB).toSelf(),t(Mw).toDynamicValue((t=>t.container.get(GB))).whenTargetNamed(GB.env),t(qB).toSelf(),t(Mw).toDynamicValue((t=>t.container.get(qB))).whenTargetNamed(qB.env),t(n_).toSelf(),t(Mw).toDynamicValue((t=>t.container.get(n_))).whenTargetNamed(n_.env),t(JB).toSelf(),t(Mw).toDynamicValue((t=>t.container.get(JB))).whenTargetNamed(JB.env)})),s_=new np((t=>{t(Iv).toSelf().inSingletonScope(),t(Ov).toService(Iv),Ap(t,Ov)}));let o_=class{constructor(t){this.global=t,this.offscreen=!1}setDpr(t){this.canvas.dpr=t}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=Uv({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){var n;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,Object.assign(Object.assign({context:this.context,clear:null!==(n=e.background)&&void 0!==n?n:"#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){var n;const r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};o_=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],o_);let a_=class{constructor(t){this.global=t,this.offscreen=!0}setDpr(t){this.canvas.dpr=t}init(t,e,i){this.layer=t;const n=Uv({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){var i;e.renderService.render(t,Object.assign(Object.assign({context:this.context},e),{x:0,y:0,clear:null!==(i=e.background)&&void 0!==i?i:"#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:o=0,width:a=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,o,a,h),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,o,a,h),n.nativeContext.restore()}merge(t){}};a_=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],a_);var h_=new np((t=>{t(o_).toSelf(),t(a_).toSelf(),t(_w).toService(o_)}));const l_=Symbol.for("DrawItemInterceptor"),c_=new wf;let u_=class{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,i,n,r),!1}drawItem(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){c_.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(c_),!0}};u_=vp([hp()],u_);let d_=class{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.attribute._debug_bounds)return!1;const{context:s}=i;s.highPerformanceSave(),s.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const o=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(s,t),s.strokeRect(o.x1,o.y1,o.width(),o.height()),s.highPerformanceRestore(),!0}};d_=vp([hp()],d_);let p_=class{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:s,stage:o}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=o.camera;const a=s.currentMatrix;a.a/=s.dpr,a.b/=s.dpr,a.c/=s.dpr,a.d/=s.dpr,a.e/=s.dpr,a.f/=s.dpr;const h=aT.allocate();uT(h,a);const l=s.modelMatrix;if(l){if(h){const t=aT.allocate();s.modelMatrix=dT(t,l,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===rw,!e))),t.forEachChildren((t=>(r=!!t.findFace,!r))),e){const e=t.getChildren(),r=[...e];r.sort(((t,e)=>{var i,n,r,s;let o=((null!==(i=t.attribute.startAngle)&&void 0!==i?i:0)+(null!==(n=t.attribute.endAngle)&&void 0!==n?n:0))/2,a=((null!==(r=e.attribute.startAngle)&&void 0!==r?r:0)+(null!==(s=e.attribute.endAngle)&&void 0!==s?s:0))/2;for(;o<0;)o+=rf;for(;a<0;)a+=rf;return a-o})),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=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i: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!==l&&aT.free(s.modelMatrix),s.modelMatrix=l,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}};p_=vp([hp()],p_);let f_=class{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 xf,this.backupDirtyBounds=new xf}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:o,height:a}=e;if(!i)return;const h=this.dirtyBounds.setValue(0,0,o,a);if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=(l=h,c=n.dirtyBounds,u=!1,null===l?c:null===c?l:(Tf=l.x1,Cf=l.x2,Bf=l.y1,_f=l.y2,Pf=c.x1,Ef=c.x2,Mf=c.y1,kf=c.y2,u&&(Tf>Cf&&(Tf=(d=[Cf,Tf])[0],Cf=d[1]),Bf>_f&&(Bf=(p=[_f,Bf])[0],_f=p[1]),Pf>Ef&&(Pf=(f=[Ef,Pf])[0],Ef=f[1]),Mf>kf&&(Mf=(g=[kf,Mf])[0],kf=g[1])),Tf>=Ef||Cf<=Pf||Bf>=kf||_f<=Mf?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(Tf,Pf),y1:Math.max(Bf,Mf),x2:Math.min(Cf,Ef),y2:Math.min(_f,kf)}));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 l,c,u,d,p,f,g;this.backupDirtyBounds.copy(h),i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0);const v=h.width()*i.dpr!==i.canvas.width||h.height()*i.dpr!==i.canvas.height;i.save(),i.translate(r,s,!0),v&&(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)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:ov.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:ov.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=PC(e,i,ov.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(!Lf(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:()=>{var n;i?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))})):BC(t,ov.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))}),!1,!!(null===(n=e.context)||void 0===n?void 0:n.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 o=s.layer.getNativeHandler().getContext(),a=s.drawContribution||Dv.get(JT);a.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:s.layer,context:o,startAtId:t._uid,break:!1})),s.drawContribution=a;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,Object.assign(Object.assign({},e),{drawContribution:a,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&&!Lf(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,o=0,a=0;e.clearRect(o,a,r,s),e.fillStyle=bC(e,n,{AABBBounds:{x1:o,y1:a,x2:o+r,y2:a+s}},0,0),e.fillRect(o,a,r,s)}}afterDraw(t,e){}};vp([up(_p),yp("design:type",Object)],f_.prototype,"global",void 0),vp([gp(),yp("design:type",Function),yp("design:paramtypes",[]),yp("design:returntype",void 0)],f_.prototype,"init",null),f_=vp([hp(),mp(0,dp(nC)),mp(1,up(vC)),mp(2,up(Ow)),mp(3,up(xp)),mp(3,lp(l_)),yp("design:paramtypes",[Array,Object,Object,Object])],f_);let g_=class{selector(t){return null}};g_=vp([hp()],g_);let v_=class{constructor(t){this.groupRenderContribitions=t,this.numberType=hw}drawShape(e,i,n,r,s,o,a,h){const l=Sm(e,null==o?void 0:o.theme).group,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,width:f=l.width,height:g=l.height,clip:v=l.clip,fillOpacity:m=l.fillOpacity,strokeOpacity:y=l.strokeOpacity,cornerRadius:b=l.cornerRadius,path:x=l.path,lineWidth:w=l.lineWidth,visible:A=l.visible}=e.attribute,S=Uw(p,m,f,g,c),T=Fw(p,y,f,g),C=Dw(c,u),B=Lw(d,w);if(!e.valid||!A)return;if(!v){if(!C&&!B)return;if(!(S||T||a||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,o)})),i.disableFill=t,i.disableStroke=e,i.disableBeginPath=n}else 0===b||Wp(b)&&b.every((t=>0===t))?(i.beginPath(),i.rect(n,r,f,g)):(i.beginPath(),YT(i,n,r,f,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[]);const _={doFill:C,doStroke:B};this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h,_)})),v&&i.clip(),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),_.doFill&&(a?a(i,e.attribute,l):S&&(i.setCommonStyle(e,e.attribute,n,r,l),i.fill())),_.doStroke&&(h?h(i,e.attribute,l):T&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke())),this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s}=t.attribute;s?r.save():r.highPerformanceSave();const o=Sm(t,null==n?void 0:n.theme).group,a=r.modelMatrix;if(r.camera){const e=aT.allocate(),i=aT.allocate();pT(i,t,o),dT(e,a||e,i),r.modelMatrix=e,aT.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=o.scrollX,scrollY:l=o.scrollY}=t.attribute;let c;(h||l)&&r.translate(h,l),n&&n.drawingCb&&(c=n.drawingCb()),r.modelMatrix!==a&&aT.free(r.modelMatrix),r.modelMatrix=a,c&&c.then?c.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}};v_=vp([hp(),mp(0,up(xp)),mp(0,lp(Qw)),yp("design:paramtypes",[Object])],v_);let m_=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.numberType=cw}drawShape(t,e,i,n,r,s,o,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(e>h.length)return;const l=Sm(t).line,{fill:c=l.fill,stroke:u=l.stroke,opacity:d=l.opacity,fillOpacity:p=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,lineWidth:g=l.lineWidth,visible:v=l.visible}=t.attribute,m=Nw(d,p,c),y=Ww(d,f),b=Dw(c),x=Lw(u,g);if(!t.valid||!v)return;if(!b&&!x)return;if(!(m||y||o||a))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],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,o,a)}drawIncreaseSegment(t,e,i,n,r,s,o,a){n&&(e.beginPath(),UT(e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setStrokeStyle(t,r,o,a,s),e.stroke())}};m_=vp([hp()],m_);let y_=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.numberType=sw}drawShape(t,e,i,n,r,s,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:a}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(s>h.length)return;const l=Sm(t).area,{fill:c=l.fill,fillOpacity:u=l.fillOpacity,opacity:d=l.opacity,visible:p=l.visible}=t.attribute,f=Nw(d,u,c),g=Dw(c);if(!t.valid||!p)return;if(!g)return;if(!f&&!o)return;for(let r=s;r<s+a;r++)this.drawIncreaseSegment(t,e,h[r-1],h[r],t.attribute.segments[r],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,o)}drawIncreaseSegment(t,e,i,n,r,s,o,a){n&&(e.beginPath(),WT(e.camera?e:e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setCommonStyle(t,r,o,a,s),e.fill())}};var b_;y_=vp([hp()],y_),function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(b_||(b_={}));let x_=class extends f_{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,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=b_.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new Cp([])}}init(){super.init(),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return bp(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=yield 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)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:ov.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:ov.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})))}))}_increaseRender(t,e){return bp(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return bp(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>bp(this,void 0,void 0,(function*(){if(2!==t.count)yield _C(t,ov.zIndex,((i,n)=>{if(this.status===b_.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,yield this.waitToNextFrame();else this.renderItem(n,e);i(!1)}}))})})),this.hooks.completeDraw.call()}))}waitToNextFrame(){return bp(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return bp(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return bp(this,void 0,void 0,(function*(){this.rendering&&(this.status=b_.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=b_.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return bp(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>bp(this,void 0,void 0,(function*(){yield _C(t,ov.zIndex,(t=>bp(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};vp([up(_p),yp("design:type",Object)],x_.prototype,"global",void 0),x_=vp([hp(),mp(0,dp(nC)),mp(1,up(vC)),mp(2,up(m_)),mp(3,up(y_)),mp(4,up(Ow)),mp(5,up(xp)),mp(5,lp(l_)),yp("design:paramtypes",[Array,Object,Object,Object,Object,Object])],x_);let w_=class extends t.BaseRender{constructor(){super(...arguments),this.type="rect3d",this.numberType=gw}drawShape(t,e,i,n,r,s,o,a){var h;const l=Sm(t,null==s?void 0:s.theme).rect3d,{fill:c=l.fill,stroke:u=l.stroke,width:d=l.width,height:p=l.height,opacity:f=l.opacity,fillOpacity:g=l.fillOpacity,lineWidth:v=l.lineWidth,strokeOpacity:m=l.strokeOpacity,visible:y=l.visible}=t.attribute,b=null!==(h=this.z)&&void 0!==h?h:0,x=Uw(f,g,d,p,c),w=Fw(f,m,d,p),A=Dw(c),S=Lw(u,v);if(!t.valid||!y)return;if(!A&&!S)return;if(!(x||w||o||a))return;const{light:T,camera:C}=r.stage||{},B=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,b,B,r,e,T,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,b,B,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const o=s[n[0]],a={x:t+o[0],y:e+o[1],z:i+o[2]},h=s[n[1]],l={x:t+h[0],y:e+h[1],z:i+h[2]};r.beginPath(),r.moveTo(a.x,a.y,a.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(t,e,i,n,r,s,o,a){const h=Ky.get(r).value,l=n.vertices,c=l.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=c[i[0]],s=c[i[1]],o=c[i[2]],a=c[i[3]];t.ave_z=r+s+o+a})),u.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),u.forEach((n=>{const{polygon:c,normal:u}=n.polygon,d=l[c[0]],p=l[c[1]],f=l[c[2]],g=l[c[3]],v={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]},y={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(v.x,v.y,v.z),s.lineTo(m.x,m.y,m.z),s.lineTo(y.x,y.y,y.z),s.lineTo(b.x,b.y,b.z),s.closePath(),a?a(s,null,null):(s.fillStyle=o?o.computeColor(u,h):r,s.fill())}))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=Sm(t).rect,s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;this.z=h,this.drawShape(t,n,o,a,i),this.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore()}};w_=vp([hp()],w_);let A_=class{constructor(){this.numberType=vw}drawShape(t,e,i,n,r){const s=Sm(t).richtext,{width:o=s.width,height:a=s.height,opacity:h=s.opacity,fillOpacity:l=s.fillOpacity,visible:c=s.visible}=t.attribute;if(!t.valid||!c)return;if(!Nw(h,l,!0))return;e.translate(i,n);t.getFrameCache().draw(e,this.drawIcon)}drawIcon(t,e,i,n,r){var s;const o=Sm(t).richtextIcon,{width:a=o.width,height:h=o.height,opacity:l=o.opacity,image:c,backgroundFill:u=o.backgroundFill,backgroundFillOpacity:d=o.backgroundFillOpacity,backgroundStroke:p=o.backgroundStroke,backgroundStrokeOpacity:f=o.backgroundStrokeOpacity,backgroundRadius:g=o.backgroundRadius,margin:v}=t.attribute,{backgroundWidth:m=a,backgroundHeight:y=h}=t.attribute;if(v&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(m-a)/2,r=(y-h)/2;0===g?(e.beginPath(),e.rect(i-t,n-r,m,y)):(e.beginPath(),YT(e,i-t,n-r,m,y,g)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=f,e.strokeStyle=p,e.stroke())}const b=c&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(c));b&&"success"===b.state&&(e.globalAlpha=l,e.drawImage(b.data,i,n,a,h))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=Sm(t).richtext;let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,n,s,o,i),n.highPerformanceRestore()}};A_=vp([hp()],A_);let S_=class{constructor(){this.numberType=aw}drawShape(t,e,i,n,r,s,o,a){r.drawContribution&&t.getSubGraphic().forEach((t=>{const h=r.drawContribution.getRenderContribution(t);h&&h.drawShape&&h.drawShape(t,e,i,n,r,s,o,a)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;if(r.highPerformanceSave(),!i.drawContribution)return;const s=Sm(t),o=t.getSubGraphic();o.length&&o.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:s})})),r.highPerformanceRestore()}};S_=vp([hp()],S_);let T_=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=rw}drawShape(t,e,i,n,r,s,o,a){var h;const l=Sm(t,null==s?void 0:s.theme).arc,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,fillOpacity:f=l.fillOpacity,lineWidth:g=l.lineWidth,strokeOpacity:v=l.strokeOpacity,visible:m=l.visible}=t.attribute,y=Nw(p,f,c),b=Ww(p,v),x=Dw(c,u),w=Lw(d,g),A=null!==(h=this.z)&&void 0!==h?h:0;if(!t.valid||!m)return;if(!x&&!w)return;if(!(y||b||o||a||u))return;const{outerRadius:S=l.outerRadius,innerRadius:T=l.innerRadius,height:C=10}=t.attribute,B=Ky.get(c).value,{light:_}=r.stage||{},P=r.hack_pieFace,E={top:A,bottom:A+C},M={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===P||"top"===P?(e.beginPath(),function(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=sf(h-a),c=h>a;let u=!1;if(s<o){const t=s;s=o,o=t}if(s<=Qp)e.moveTo(i,n,r);else if(l>=rf-Qp)e.moveTo(i+s*af(a),n+s*cf(a),r),e.arc(i,n,s,a,h,!c,r),o>Qp&&(e.moveTo(i+o*af(h),n+o*cf(h),r),e.arc(i,n,o,h,a,c,r));else{const{outerDeltaAngle:l,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:f,innerEndAngle:g,innerStartAngle:v}=t.getParsePadAngle(a,h),m=s*af(p),y=s*cf(p),b=o*af(g),x=o*cf(g);l<.001?u=!0:(e.moveTo(i+m,n+y,r),e.arc(i,n,s,p,f,!c,r)),!(o>Qp)||d<.001?(e.lineTo(i+b,n+x,r),u=!0):(e.lineTo(i+b,n+x,r),e.arc(i,n,o,g,v,c,r))}e.closePath()}(t,e,i,n,E[P],S,T),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),x&&(o?o(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=_?_.computeColor(M[P],B):c,e.fill())),w&&(a?a(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke()))):"outside"!==P&&"inside"!==P||("inside"===P&&(e.save(),e.beginPath(),e.arc(i,n,T,0,rf,!0,E.top),e.clip()),e.beginPath(),function(t,e,i,n,r,s,o,a){const{startAngle:h,endAngle:l}=t.getParsedAngle(),c=sf(l-h),u=l>h;let d=!1;if(o<=Qp)e.moveTo(i,n,r);else if(c>=rf-Qp)e.moveTo(i+o*af(h),n+o*cf(h),r),e.arc(i,n,o,h,l,!u,r),e.lineTo(i+o*af(l),n+o*cf(l),s),e.arc(i,n,o,l,h,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=a(h,l),f=o*af(c),g=o*cf(c),v=o*af(p),m=o*cf(p);t<.001?d=!0:(e.moveTo(i+f,n+g,r),e.arc(i,n,o,c,p,!u,r),e.lineTo(i+v,n+m,s),e.arc(i,n,o,p,c,u,s))}e.closePath()}(t,e,i,n,E.top,E.bottom,"outside"===P?S:T,((e,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:o,innerEndAngle:a,innerStartAngle:h}=t.getParsePadAngle(e,i);return"outside"===P?{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:a,innerouterStartAngle:h}})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),x&&(o?o(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=_?_.computeColor(M[P],B):c,e.fill())),w&&(a?a(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke())),"inside"===P&&e.restore())}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=Sm(t,null==n?void 0:n.theme).arc;r.save();const o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,jw(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&aT.free(r.modelMatrix),r.modelMatrix=c),r.restore()}};T_=vp([hp()],T_);let C_=class extends t.BaseRender{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=pw}drawShape(t,e,i,n,r,s,o,a){var h;const l=Sm(t,null==s?void 0:s.theme).polygon,{fill:c=l.fill,stroke:u=l.stroke,opacity:d=l.opacity,fillOpacity:p=l.fillOpacity,lineWidth:f=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:v=l.visible,points:m,face:y=[!0,!0,!0,!0,!0,!0]}=t.attribute,b=null!==(h=this.z)&&void 0!==h?h:0,x=Nw(d,p,c),w=Ww(d,g),A=Dw(c),S=Lw(u,f);if(!t.valid||!v||4!==m.length)return;if(!A&&!S)return;if(!(x||w||o||a))return;const{light:T,camera:C}=r.stage||{},B=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,b,B,y,r,e,T,C,t,l,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,b,B,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const o=s[n[0]],a=s[n[1]],h={x:t+o[0],y:e+o[1],z:i+o[2]},l={x:t+a[0],y:e+a[1],z:i+a[2]};r.beginPath(),r.moveTo(h.x,h.y,h.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(t,e,i,n,r,s,o,a,h,l,c,u){const d=Ky.get(s).value,p=n.vertices,f=p.map((t=>o.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]],o=f[i[1]],a=f[i[2]],h=f[i[3]];t.ave_z=s+o+a+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]],v=p[r[2]],m=p[r[3]],y={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+v[0],y:e+v[1],z:i+v[2]},w={x:t+m[0],y:e+m[1],z:i+m[2]};o.beginPath(),o.moveTo(y.x,y.y,y.z),o.lineTo(b.x,b.y,b.z),o.lineTo(x.x,x.y,x.z),o.lineTo(w.x,w.y,w.z),o.closePath(),u?u(o,l.attribute,c):(o.fillStyle=a?a.computeColor(h,d):s,o.fill())}))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=Sm(t).polygon,s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;this.z=h,this.drawShape(t,n,o,a,i),this.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore()}};C_=vp([hp()],C_);let B_=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};B_=vp([hp()],B_);let __=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}};__=vp([hp()],__);let P_=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};P_=vp([hp()],P_);let E_=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}};E_=vp([hp()],E_);let M_=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};M_=vp([hp()],M_);let k_=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){var p,f,g,v;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:m=t.attribute}=d||{},{texture:y=(null!==(p=t.attribute.texture)&&void 0!==p?p:fy(h,"texture")),textureColor:b=(null!==(f=t.attribute.textureColor)&&void 0!==f?f:fy(h,"textureColor")),textureSize:x=(null!==(g=t.attribute.textureSize)&&void 0!==g?g:fy(h,"textureSize")),texturePadding:w=(null!==(v=t.attribute.texturePadding)&&void 0!==v?v:fy(h,"texturePadding"))}=m;if(!y)return;let A=this.textureMap.get(y);if(!A)switch(y){case"circle":A=this.createCirclePattern(x,w,b,e);break;case"diamond":A=this.createDiamondPattern(x,w,b,e);break;case"rect":A=this.createRectPattern(x,w,b,e);break;case"vertical-line":A=this.createVerticalLinePattern(x,w,b,e);break;case"horizontal-line":A=this.createHorizontalLinePattern(x,w,b,e);break;case"bias-lr":A=this.createBiasLRLinePattern(x,w,b,e);break;case"bias-rl":A=this.createBiasRLLinePattern(x,w,b,e);break;case"grid":A=this.createGridPattern(x,w,b,e)}A&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=A,e.fill(),e.highPerformanceRestore())}};k_=vp([hp()],k_);var R_=new np((e=>{e(f_).toSelf(),e(mC).toService(f_),e(x_).toSelf(),e(JT).toService(x_),e(g_).toSelf(),e(vC).toService(g_),e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(iC).to(t.DefaultCanvasCircleRender),e(nC).to(t.DefaultCanvasCircleRender),e(t.DefaultCircleRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleTextureRenderContribution).toSelf().inSingletonScope(),e(Jw).toService(t.DefaultCircleRenderContribution),e(Jw).toService(t.DefaultCircleBackgroundRenderContribution),e(Jw).toService(t.DefaultCircleTextureRenderContribution),Ap(e,Jw),e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(hC).to(t.DefaultCanvasRectRender),e(nC).to(t.DefaultCanvasRectRender),e(w_).toSelf().inSingletonScope(),e(lC).toService(w_),e(nC).toService(lC),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(nA).toService(t.DefaultRectRenderContribution),e(nA).toService(t.DefaultRectBackgroundRenderContribution),e(nA).toService(t.DefaultRectTextureRenderContribution),e(nA).toService(t.SplitRectBeforeRenderContribution),e(nA).toService(t.SplitRectAfterRenderContribution),Ap(e,nA),e(t.DefaultCanvasTextRender).toSelf().inSingletonScope(),e(uC).to(t.DefaultCanvasTextRender),e(nC).to(t.DefaultCanvasTextRender),Ap(e,sA),e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(oC).to(t.DefaultCanvasPathRender),e(nC).to(t.DefaultCanvasPathRender),e(P_).toSelf().inSingletonScope(),e(E_).toSelf().inSingletonScope(),e(eA).toService(P_),e(eA).toService(E_),Ap(e,eA),e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(cC).to(t.DefaultCanvasSymbolRender),e(nC).to(t.DefaultCanvasSymbolRender),e(t.DefaultSymbolRenderContribution).toSelf().inSingletonScope(),e(wC).toSelf().inSingletonScope(),e(AC).toSelf().inSingletonScope(),e(rA).toService(t.DefaultSymbolRenderContribution),e(rA).toService(wC),e(rA).toService(AC),Ap(e,rA),e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(QT).to(t.DefaultCanvasArcRender),e(nC).to(t.DefaultCanvasArcRender),e(T_).toSelf().inSingletonScope(),e(tC).toService(T_),e(nC).toService(tC),e(t.DefaultArcRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcTextureRenderContribution).toSelf().inSingletonScope(),e($w).toService(t.DefaultArcRenderContribution),e($w).toService(t.DefaultArcBackgroundRenderContribution),e($w).toService(t.DefaultArcTextureRenderContribution),Ap(e,$w),e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(sC).to(t.DefaultCanvasLineRender),e(nC).to(t.DefaultCanvasLineRender),e(m_).toSelf().inSingletonScope(),e(y_).toSelf().inSingletonScope(),e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(eC).to(t.DefaultCanvasAreaRender),e(nC).to(t.DefaultCanvasAreaRender),e(M_).toSelf().inSingletonScope(),e(k_).toSelf().inSingletonScope(),e(Zw).toService(M_),e(Zw).toService(k_),Ap(e,Zw),e(v_).toSelf().inSingletonScope(),e(rC).to(v_),e(nC).to(v_),e(t.DefaultGroupBackgroundRenderContribution).toSelf().inSingletonScope(),e(Qw).toService(t.DefaultGroupBackgroundRenderContribution),Ap(e,Qw),e(t.DefaultCanvasPolygonRender).toSelf().inSingletonScope(),e(aC).to(t.DefaultCanvasPolygonRender),e(nC).to(t.DefaultCanvasPolygonRender),e(B_).toSelf().inSingletonScope(),e(__).toSelf().inSingletonScope(),e(iA).toService(B_),e(iA).toService(__),Ap(e,iA),e(S_).toSelf().inSingletonScope(),e(fC).toService(S_),e(nC).toService(fC),e(t.DefaultCanvasImageRender).toSelf().inSingletonScope(),e(gC).toService(t.DefaultCanvasImageRender),e(nC).toService(gC),e(t.DefaultImageBackgroundRenderContribution).toSelf().inSingletonScope(),e(tA).toService(t.DefaultImageBackgroundRenderContribution),Ap(e,tA),e(A_).toSelf().inSingletonScope(),e(dC).toService(A_),e(nC).toService(dC),e(C_).toSelf().inSingletonScope(),e(pC).toService(C_),e(nC).toService(pC),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),e(sA).toService(t.DefaultBaseInteractiveRenderContribution),e($w).toService(t.DefaultBaseInteractiveRenderContribution),e(eA).toService(t.DefaultBaseInteractiveRenderContribution),e(rA).toService(t.DefaultBaseInteractiveRenderContribution),e(nA).toService(t.DefaultBaseInteractiveRenderContribution),e(tA).toService(t.DefaultBaseInteractiveRenderContribution),e(Jw).toService(t.DefaultBaseInteractiveRenderContribution),e(Zw).toService(t.DefaultBaseInteractiveRenderContribution),e(iA).toService(t.DefaultBaseInteractiveRenderContribution),Ap(e,oA),Ap(e,nC),e(u_).toSelf().inSingletonScope(),e(l_).toService(u_),e(d_).toSelf().inSingletonScope(),e(l_).toService(d_),e(p_).toSelf().inSingletonScope(),e(l_).toService(p_),Ap(e,l_)}));let O_=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=ow}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=yC(n,s,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};O_=vp([hp(),mp(0,up(iC)),yp("design:paramtypes",[Object])],O_);const I_=new wf;let D_=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=fw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;n.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,n.setTransformForCurrent()}else o=0,a=0,h=!1,n.transformFromMatrix(t.transMatrix,!0);let l=!0;if(!h||t.shadowRoot||jp(s,!0)&&0!==s||Wp(s)&&s.some((t=>0!==t)))l=!1,this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,i,n)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,r)=>{if(l)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=yC(n,s,n.dpr),l=t.isPointInStroke(e.x,e.y),l}));else{const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)l=!0;else if(n){const i=t.AABBBounds;I_.setValue(i.x1,i.y1,i.x2,i.y2),I_.expand(-s/2),l=!I_.containsPoint(e)}}return n.highPerformanceRestore(),l}};D_=vp([hp(),mp(0,up(hC)),yp("design:paramtypes",[Object])],D_);let L_=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=nw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).arc;n.highPerformanceSave();let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=yC(n,s,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};L_=vp([hp(),mp(0,up(QT)),yp("design:paramtypes",[Object])],L_);let N_=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=sw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a))),n.highPerformanceRestore(),a}};N_=vp([hp(),mp(0,up(eC)),yp("design:paramtypes",[Object])],N_);let U_=class{constructor(){this.type="image",this.numberType=lw}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};U_=vp([hp()],U_);let W_=class extends t.BaseRender{};W_=vp([hp()],W_);let F_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=cw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const r=Sm(t).line,s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=yC(n,r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};F_=vp([hp(),mp(0,up(sC)),yp("design:paramtypes",[Object])],F_);let j_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=uw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).path;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=yC(n,r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};j_=vp([hp(),mp(0,up(oC)),yp("design:paramtypes",[Object])],j_),TT({});let z_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=mw}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const s=Sm(t).symbol,o=this.transform(t,s,n),{x:a,y:h,z:l,lastModelMatrix:c}=o;let u=e;if(n.camera){u=e.clone();const i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let d=!1;return this.canvasRenderer.drawShape(t,n,a,h,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,i)=>{if(d)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=yC(n,r,n.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==c&&aT.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),d}};z_=vp([hp(),mp(0,up(cC)),yp("design:paramtypes",[Object])],z_);let H_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=yw}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();const s=Sm(t).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,h=this.transform(t,s,n,a),{x:l,y:c,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,l,c,{},null,((e,i,n)=>{if(f)return!0;const{fontSize:r=s.fontSize,textBaseline:o=s.textBaseline,textAlign:a=s.textAlign}=t.attribute,h=t.AABBBounds,d=h.height(),g=h.width(),v=uA(o,d,r),m=cA(a,g);return e.rect(m+l,v+c,g,d,u),f=e.isPointInPath(p.x,p.y),f}),((t,e,i)=>f)),this.canvasRenderer.z=0,n.modelMatrix!==d&&aT.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),f}};H_=vp([hp(),mp(0,up(uC)),yp("design:paramtypes",[Object])],H_);let G_=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=dw}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};G_=vp([hp(),mp(0,up(aC)),yp("design:paramtypes",[Object])],G_),new wf;let V_=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=vw}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};V_=vp([hp(),mp(0,up(dC)),yp("design:paramtypes",[Object])],V_);let X_=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=aw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{if(n)return;const s=r.pickItem(t,e,null,i);n=!(!s||!s.graphic)})),n}return!1}};X_=vp([hp(),mp(0,up(fC)),yp("design:paramtypes",[Object])],X_),new wf;let Y_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=gw}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).rect;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};Y_=vp([hp(),mp(0,up(lC)),yp("design:paramtypes",[Object])],Y_),new wf;let q_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=pw}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).polygon;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>!1)),this.canvasRenderer.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};q_=vp([hp(),mp(0,up(pC)),yp("design:paramtypes",[Object])],q_),new wf;let K_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=rw}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).arc;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};K_=vp([hp(),mp(0,up(tC)),yp("design:paramtypes",[Object])],K_);let $_=class{constructor(){this.type="group",this.numberType=hw}contains(t,e,i){return!1}};$_=vp([hp()],$_);var Z_=new np(((t,e,i,n)=>{t(O_).toSelf().inSingletonScope(),t(VC).toService(O_),t(rB).toService(VC),t(D_).toSelf().inSingletonScope(),t(KC).toService(D_),t(rB).toService(KC),t(Y_).toSelf().inSingletonScope(),t($C).toService(Y_),t(rB).toService($C),t(L_).toSelf().inSingletonScope(),t(zC).toService(L_),t(rB).toService(zC),t(N_).toSelf().inSingletonScope(),t(GC).toService(N_),t(rB).toService(GC),t(U_).toSelf().inSingletonScope(),t(XC).toService(U_),t(rB).toService(XC),t(F_).toSelf().inSingletonScope(),t(YC).toService(F_),t(rB).toService(YC),t(j_).toSelf().inSingletonScope(),t(qC).toService(j_),t(rB).toService(qC),t(z_).toSelf().inSingletonScope(),t(ZC).toService(z_),t(rB).toService(ZC),t(H_).toSelf().inSingletonScope(),t(JC).toService(H_),t(rB).toService(JC),t(G_).toSelf().inSingletonScope(),t(QC).toService(G_),t(rB).toService(QC),t(q_).toSelf().inSingletonScope(),t(tB).toService(q_),t(rB).toService(tB),t(K_).toSelf().inSingletonScope(),t(HC).toService(K_),t(rB).toService(HC),t(V_).toSelf().inSingletonScope(),t(eB).toService(V_),t(rB).toService(eB),t(X_).toSelf().inSingletonScope(),t(iB).toService(X_),t(rB).toService(iB),t($_).toSelf().inSingletonScope(),t(nB).toService($_),t(rB).toService(nB),Ap(t,rB)}));let J_=class{constructor(t){this.canvasRenderer=t,this.type="path",this.numberType=uw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).path;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};J_=vp([hp(),mp(0,up(oC)),yp("design:paramtypes",[Object])],J_);let Q_=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=ow}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};Q_=vp([hp(),mp(0,up(iC)),yp("design:paramtypes",[Object])],Q_);const tP=new wf;let eP=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=fw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;n.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,n.setTransformForCurrent()}else o=0,a=0,h=!1,n.transformFromMatrix(t.transMatrix,!0);let l=!0;if(!h||jp(s,!0)&&0!==s||Wp(s)&&s.some((t=>0!==t)))l=!1,this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,i,n)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,r)=>{if(l)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,l=t.isPointInStroke(e.x,e.y),l}));else if(l){const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)l=!0;else if(n){const i=t.AABBBounds;tP.setValue(i.x1,i.y1,i.x2,i.y2),tP.expand(-s/2),l=!tP.containsPoint(e)}}return n.highPerformanceRestore(),l}};eP=vp([hp(),mp(0,up(hC)),yp("design:paramtypes",[Object])],eP);let iP=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=nw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).arc;n.highPerformanceSave();let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};iP=vp([hp(),mp(0,up(QT)),yp("design:paramtypes",[Object])],iP);let nP=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=sw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a))),n.highPerformanceRestore(),a}};nP=vp([hp(),mp(0,up(eC)),yp("design:paramtypes",[Object])],nP);let rP=class{constructor(t){this.canvasRenderer=t,this.type="line",this.numberType=cw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).line;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};rP=vp([hp(),mp(0,up(sC)),yp("design:paramtypes",[Object])],rP);let sP=class{constructor(t){this.canvasRenderer=t,this.type="symbol",this.numberType=mw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).symbol;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};sP=vp([hp(),mp(0,up(cC)),yp("design:paramtypes",[Object])],sP);let oP=class{constructor(){this.type="text",this.numberType=yw}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};oP=vp([hp()],oP);let aP=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=dw}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};aP=vp([hp(),mp(0,up(aC)),yp("design:paramtypes",[Object])],aP);let hP=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=aw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{n||(n=!!r.pickItem(t,e,null,i))})),n}return!1}};hP=vp([hp(),mp(0,up(fC)),yp("design:paramtypes",[Object])],hP);var lP=new np((t=>{t(Q_).toSelf().inSingletonScope(),t(aB).toService(Q_),t(gB).toService(aB),t(eP).toSelf().inSingletonScope(),t(cB).toService(eP),t(gB).toService(cB),t(iP).toSelf().inSingletonScope(),t(sB).toService(iP),t(gB).toService(sB),t(nP).toSelf().inSingletonScope(),t(oB).toService(nP),t(gB).toService(oB),t(rP).toSelf().inSingletonScope(),t(hB).toService(rP),t(gB).toService(hB),t(J_).toSelf().inSingletonScope(),t(lB).toService(J_),t(gB).toService(lB),t(sP).toSelf().inSingletonScope(),t(uB).toService(sP),t(gB).toService(uB),t(oP).toSelf().inSingletonScope(),t(dB).toService(oP),t(gB).toService(dB),t(aP).toSelf().inSingletonScope(),t(pB).toService(aP),t(gB).toService(pB),t(hP).toSelf().inSingletonScope(),t(fB).toService(hP),t(hP).toService(fB),Ap(t,gB)}));var cP=new np((e=>{e(Lv).toDynamicValue((()=>e=>new t.BrowserCanvas(e))).whenTargetNamed(t.BrowserCanvas.env),e(Nv).toDynamicValue((()=>(e,i)=>new t.BrowserContext2d(e,i))).whenTargetNamed(t.BrowserContext2d.env)})),uP=new np((t=>{t(Lv).toDynamicValue((()=>t=>new HB(t))).whenTargetNamed(HB.env),t(Nv).toDynamicValue((()=>(t,e)=>new jB(t,e))).whenTargetNamed(jB.env)})),dP=new np((t=>{t(Lv).toDynamicValue((()=>t=>new WB(t))).whenTargetNamed(WB.env),t(Nv).toDynamicValue((()=>(t,e)=>new NB(t,e))).whenTargetNamed(NB.env)})),pP=new np((t=>{t(Lv).toDynamicValue((()=>t=>new YB(t))).whenTargetNamed(YB.env),t(Nv).toDynamicValue((()=>(t,e)=>new VB(t,e))).whenTargetNamed(VB.env)})),fP=new np((t=>{t(Lv).toDynamicValue((()=>t=>new e_(t))).whenTargetNamed(e_.env),t(Nv).toDynamicValue((()=>(t,e)=>new QB(t,e))).whenTargetNamed(QB.env)})),gP=new np((t=>{t(Lv).toDynamicValue((()=>t=>new ZB(t))).whenTargetNamed(ZB.env),t(Nv).toDynamicValue((()=>(t,e)=>new KB(t,e))).whenTargetNamed(KB.env)}));Dv.load(Iw),Dv.load(bB),Dv.load(CC),Dv.load(yB),Dv.load(SB),function(t){t.load(DB),t.load(r_),t.load(s_),t.load(h_)}(Dv),function(t){t.load(R_)}(Dv),function(t){t.load(Z_),t.load(lP)}(Dv),function(t){t.load(cP),t.load(dP),t.load(uP),t.load(pP),t.load(fP),t.load(gP)}(Dv);const vP=Dv.get(_p);Av.global=vP;const mP=Dv.get(Rw);Av.graphicUtil=mP;const yP=Dv.get(kw);Av.transformUtil=yP;const bP=Dv.get(bw);Av.graphicService=bP;const xP=Dv.get(DC),wP=Dv.get(Ow);Av.layerService=wP;class AP{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=Cm.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,Av.graphicService.hooks.onAttributeUpdate.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),Av.graphicService.hooks.onSetStage.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}deactivate(t){Av.graphicService.hooks.onAttributeUpdate.taps=Av.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),Av.graphicService.hooks.onSetStage.taps=Av.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}class SP{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=Cm.GenAutoIncrementId(),this.key=this.name+this._uid,this.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)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const r=t.page.x-this.pageX,s=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const o=r/100,a=s/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+o,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+a,n.set3dOptions(this.option3d),n.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 TP{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=Cm.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,Av.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))})),Av.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){Av.graphicService.hooks.onAddIncremental.taps=Av.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),Av.graphicService.hooks.onClearIncremental.taps=Av.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,Av.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,Object.assign({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())}}class CP{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=Cm.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)})),Av.graphicService.hooks.onRelease.tap(this.key,(t=>{this.removeDom(t)}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key))}drawHTML(t){"browser"===Av.global.env&&t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:ov.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:ov.zIndex)})).forEach((t=>{this.renderGroupHTML(t)}))}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeDom(t){t.bindDom&&t.bindDom.size&&(t.bindDom.forEach((t=>{t.dom&&t.dom.parentElement.removeChild(t.dom)})),t.bindDom.clear())}renderGraphicHTML(t){const{html:e}=t.attribute;if(!e)return void(t.bindDom&&t.bindDom.size&&(t.bindDom.forEach((t=>{t.dom&&t.dom.parentElement.removeChild(t.dom)})),t.bindDom.clear()));const i=t.stage;if(!i)return;const{dom:n,container:r,width:s,height:o,style:a,anchorType:h="boundsLeftTop"}=e;t.bindDom||(t.bindDom=new Map);const l=t.bindDom.get(n);if(l&&(!r||r===l.container))return;let c,u;t.bindDom.forEach((({wrapGroup:t})=>{Av.global.removeDom(t)})),c="string"==typeof n?(new DOMParser).parseFromString(n,"text/xml").firstChild:n;const d=r||(!0===i.params.enableHtmlAttribute?null:i.params.enableHtmlAttribute);u=d?"string"==typeof d?Av.global.getElementById(d):d:t.stage.window.getContainer();const p=Av.global.createDom({tagName:"div",width:s,height:o,style:a,parent:u});p&&(p.appendChild(c),t.bindDom.set(n,{dom:c,container:r,wrapGroup:p})),p.style.pointerEvents="none",p.style.position||(p.style.position="absolute",u.style.position="relative");let f=0,g=0;if("position"===h){const e=t.transMatrix;f=e.e,g=e.f}else{const e=t.AABBBounds;f=e.x1,g=e.y1}const v=Av.global.getElementTopLeft(u,!1),m=i.window.getTopLeft(!1),y=f+m.left-v.left,b=g+m.top-v.top;p.style.left=`${y}px`,p.style.top=`${b}px`}}const BP=new wf;class _P{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=Cm.GenAutoIncrementId(),this.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()})),Av.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&&(BP.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(BP,t.parent&&t.parent.globalTransMatrix)))})),Av.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))})),Av.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){Av.graphicService.hooks.beforeUpdateAABBBounds.taps=Av.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),Av.graphicService.hooks.afterUpdateAABBBounds.taps=Av.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)),Av.graphicService.hooks.onRemove.taps=Av.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}class PP{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=Cm.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new wf}tryLayout(t){const e=t.parent;if(!e||!t.needUpdateLayout())return;const i=Sm(e).group,{display:n=i.display}=e.attribute;if("flex"!==n)return;const{flexDirection:r=i.flexDirection,flexWrap:s=i.flexWrap,justifyContent:o=i.justifyContent,alignItems:a=i.alignItems,alignContent:h=i.alignContent,clip:l=i.clip}=e.attribute;let c=0,u=0,d=0;if(e.forEachChildren((t=>{const e=t.AABBBounds;"column"===r||"column-reverse"===r?(u+=e.height(),c=Math.max(c,e.width())):(c+=e.width(),u=Math.max(u,e.height())),d+=e.x1,d+=e.y1,d+=e.x2,d+=e.y2})),!isFinite(d))return;const p=e.attribute.width||c,f=e.attribute.height||u;e.attribute.width||(e.attribute.width=0),e.attribute.height||(e.attribute.height=0),this.tempBounds.copy(e._AABBBounds);const g={main:{len:p,field:"x"},cross:{len:f,field:"y"},dir:1},v=g.main,m=g.cross;"row-reverse"===r?g.dir=-1:"column"===r?(v.len=f,m.len=p,v.field="y",m.field="x"):"column-reverse"===r&&(v.len=f,m.len=p,v.field="y",m.field="x",g.dir=-1);let y=0,b=0;const x=[];e.forEachChildren((t=>{const e=t.AABBBounds,i="x"===v.field?e.width():e.height(),n="x"===m.field?e.width():e.height();x.push({mainLen:i,crossLen:n}),y+=i,b=Math.max(b,n)}));const w=[];if(y>v.len&&"wrap"===s){let t=0,e=0;x.forEach((({mainLen:i,crossLen:n},r)=>{t+i>v.len?0===t?(w.push({idx:r,mainLen:t+i,crossLen:n}),t=0,e=0):(w.push({idx:r-1,mainLen:t,crossLen:n}),t=i,e=n):(t+=i,e=Math.max(e,n))})),w.push({idx:x.length-1,mainLen:t,crossLen:e})}else w.push({idx:x.length-1,mainLen:y,crossLen:b});const A=e.getChildren();let S=0;if(w.forEach((t=>{this.layoutMain(e,A,o,v,x,S,t),S=t.idx+1})),b=w.reduce(((t,e)=>t+e.crossLen),0),1===w.length)if("flex-end"===a){const t=m.len;this.layoutCross(A,a,m,t,x,w[0],0)}else if("center"===a){const t=m.len/2;this.layoutCross(A,a,m,t,x,w[0],0)}else A.forEach((t=>{t.attribute[m.field]=EP(t,m.field)}));else if("flex-start"===h){S=0;let t=0;w.forEach(((e,i)=>{this.layoutCross(A,"flex-start",m,t,x,w[i],S),S=e.idx+1,t+=e.crossLen}))}else if("center"===h){S=0;let t=Math.max(0,(m.len-b)/2);w.forEach(((e,i)=>{this.layoutCross(A,"center",m,t+e.crossLen/2,x,w[i],S),S=e.idx+1,t+=e.crossLen}))}else if("space-around"===h){S=0;const t=Math.max(0,(m.len-b)/w.length/2);let e=t;w.forEach(((i,n)=>{this.layoutCross(A,"flex-start",m,e,x,w[n],S),S=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===h){S=0;const t=Math.max(0,(m.len-b)/(2*w.length-2));let e=0;w.forEach(((i,n)=>{this.layoutCross(A,"flex-start",m,e,x,w[n],S),S=i.idx+1,e+=i.crossLen+2*t}))}A.forEach(((t,e)=>{t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),e.addUpdateLayoutTag(),l||this.tempBounds.equals(e.AABBBounds)||this.tryLayout(e)}layoutMain(t,e,i,n,r,s,o){if("flex-start"===i){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t+EP(e[i],n.field),t+=r[i].mainLen}else if("flex-end"===i){let t=n.len;for(let i=s;i<=o.idx;i++)t-=r[i].mainLen,e[i].attribute[n.field]=t+EP(e[i],n.field)}else if("space-around"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t+EP(e[i],n.field),t+=r[i].mainLen}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/t/2;let a=i;for(let t=s;t<=o.idx;t++)e[t].attribute[n.field]=a+EP(e[t],n.field),a+=r[t].mainLen+2*i}else if("space-between"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t+EP(e[i],n.field),t+=r[i].mainLen}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/(2*t-2);let a=0;for(let t=s;t<=o.idx;t++)e[t].attribute[n.field]=a+EP(e[t],n.field),a+=r[t].mainLen+2*i}}layoutCross(t,e,i,n,r,s,o){if("flex-end"===e)for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen+EP(t[e],i.field);else if("center"===e)for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen/2+EP(t[e],i.field);else for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n+EP(t[e],i.field)}activate(t){this.pluginService=t,bP.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t)})),bP.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t)}))}deactivate(t){bP.hooks.onAttributeUpdate.taps=bP.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),bP.hooks.onSetStage.taps=bP.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}function EP(t,e){if(!t.attribute.boundsPadding)return 0;if(function(t){return"number"==typeof t&&Number.isFinite(t)}(t.attribute.boundsPadding))return t.attribute.boundsPadding;if(Wp(t.attribute.boundsPadding)&&1===t.attribute.boundsPadding.length)return t.attribute.boundsPadding[0];const i=sy(t.attribute.boundsPadding);return"x"===e?i[3]:"y"===e?i[0]:0}const MP=new Gm;MP.addTimeline(Ym);MP.setFPS(60);class kP{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=Ky.get(e).value,this.colorRgb[0]/=255,this.colorRgb[1]/=255,this.colorRgb[2]/=255,this.ambient=i;const n=uf(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=lf(hf((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let r;if(Up(e)){r=Ky.get(e).value}else r=e;const s=this.colorRgb;return Ky.to.rgb(s[0]*r[0]*n,s[1]*r[1]*n,s[2]*r[2]*n)}}const RP="white";class OP extends Bw{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(){var t;return null!==(t=this._background)&&void 0!==t?t:RP}set background(t){this._background=t}get defaultLayer(){return this.at(0)}constructor(t){var e;super({}),this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null},this.params=t,this.theme=new wm,this.hooks={beforeRender:new Cp(["stage"]),afterRender:new Cp(["stage"])},this.global=Dv.get(_p),this.window=Dv.get(Ew),this.renderService=Dv.get(SC),this.pickerService=Dv.get(OC),this.pluginService=Dv.get(wB),this.layerService=Dv.get(Ow),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 wf,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=null!==(e=t.background)&&void 0!==e?e:RP,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 Nm({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(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.enableLayout&&this.enableLayout(),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||MP,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new Xm,this.ticker.addTimeline(this.timeline),this.timeline.pause(),this.optmize(t.optimize)}optmize(t){this.optmizeRender(null==t?void 0:t.skipRenderWithOutRange)}optmizeRender(t=!0){t&&(this._skipRender=this.window.isVisible()?0:1,this.window.onVisibleChange((t=>{t?(this.dirtyBounds&&this.dirtyBounds.setValue(0,0,this._viewBox.width(),this._viewBox.height()),this._skipRender>1&&this.renderNextFrame(),this._skipRender=0):this._skipRender=1})))}getTimeline(){return this.timeline}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:o=1,fieldDepth:a}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:n,beta:r,camera:s,fieldRatio:o,fieldDepth:a})}set3dOptions(t){var e,i,n,r,s,o;this.option3d=t;const a=this.get3dOptions(t),{light:h,center:l,camera:c,alpha:u,beta:d,fieldRatio:p,fieldDepth:f}=a,{dir:g=[1,1,-1],color:v="white",ambient:m}=h,y=(null!==(e=l.x)&&void 0!==e?e:this.width/2)+(null!==(i=l.dx)&&void 0!==i?i:0),b=(null!==(n=l.y)&&void 0!==n?n:this.height/2)+(null!==(r=l.dy)&&void 0!==r?r:0),x=[y,b,(null!==(s=l.z)&&void 0!==s?s:0)+(null!==(o=l.dz)&&void 0!==o?o:0)];let w=0,A=0,S=0;c||(w=Math.sin(u)+y,A=Math.sin(d)+b,S=Math.cos(u)*Math.cos(d)*1),this.light=new kP(g,v,m);const T={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:f,viewParams:{pos:[w,A,S],center:x,up:[0,1,0]}};this.camera?this.camera.params=T:this.camera=new UC(T),t.enableView3dTransform&&this.enableView3dTransform()}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 SP))}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 AP))}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 TP))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new xf;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t||(t=new _P,this.pluginService.register(t)),t.activate(this.pluginService)}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableLayout(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new PP))}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableHtmlAttribute(t){this.htmlAttribute||(this.htmlAttribute=t,this.pluginService.register(new CP))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").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",this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(this._viewBox,t)}render(t,e){this.ticker.start(),this.timeline.resume(),this._skipRender||(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},Object.assign({renderStyle:this.renderStyle},e))})),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear(),this.hooks.afterRender.call(this)),this._skipRender&&this._skipRender++}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.timeline.resume(),this.ticker.start(),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(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},Object.assign({renderStyle:this.renderStyle},this.lastRenderparams||{}))})),this.combineLayersToWindow(),this.hooks.afterRender.call(this),this.nextFrameRenderLayerSet.clear()),this._skipRender&&this._skipRender++}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=Object.assign(Object.assign({},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,e=!0){this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){const i=this.pickerService.pick(this.children,new mf(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0: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,Object.assign(Object.assign({},e),{renderService:this.renderService,background:i===this.defaultLayer?this.background:void 0,clear:0===n,updateBounds:!!this.dirtyBounds}))}))}renderToNewWindow(t=!0,e){const i=Dv.get(Ew);if(t)i.create({width:this.viewWidth,height:this.viewHeight,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""});else{const t=e?e.width():Math.min(this.viewWidth,this.window.width-this.x),n=e?e.height():Math.min(this.viewHeight,this.window.height-this.y);i.create({width:t,height:n,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""})}const n=e?-e.x1:0,r=e?-e.y1:0;return this.renderTo(i,{x:n,y:r,width:e?e.x2:i.width,height:e?e.y2:i.height}),i}toCanvas(t=!0,e){const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t)}getCursor(){return this._cursor}}var IP;!function(t){t[t.W=1]="W",t[t.H=2]="H",t[t.WH=3]="WH"}(IP||(IP={}));const DP={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},LP=Object.keys(DP);function NP(t){return OT(t?t.attribute:{})}function UP(t,e){if(Wp(t))return t.forEach((t=>UP(t,e)));e.push(t)}NP.Text=function(t){return Object.assign({type:"rich/text"},t)},NP.Image=function(t){return Object.assign({type:"rich/image"},t)};const WP=Bw;t.ACustomAnimate=qm,t.ARC3D_NUMBER_TYPE=rw,t.ARC_NUMBER_TYPE=nw,t.AREA_NUMBER_TYPE=sw,t.Animate=$m,t.AnimateGroup=class extends qm{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?Vm[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends qm{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?Vm[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Arc=WS,t.Arc3d=FS,t.Arc3dRender=tC,t.ArcRender=QT,t.ArcRenderContribution=$w,t.Area=NS,t.AreaRender=eC,t.AreaRenderContribution=Zw,t.AttributeAnimate=class extends qm{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=xB,t.Basis=Pg,t.BeforeRenderConstribution=TC,t.BoundsContext=Ff,t.BoundsPicker=IC,t.CIRCLE_NUMBER_TYPE=ow,t.CanvasFactory=Lv,t.CanvasTextLayout=dA,t.CbAnimate=Km,t.Circle=hA,t.CircleRender=iC,t.CircleRenderContribution=Jw,t.ClipAngleAnimate=class extends yy{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p,f,g,v;const m=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},y=null!==(a=m.width)&&void 0!==a?a:0,b=null!==(h=m.height)&&void 0!==h?h:0,x=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",w=null!==(c=null==r?void 0:r.startAngle)&&void 0!==c?c:0,A=null!==(u=null==r?void 0:r.orient)&&void 0!==u?u:"clockwise";let S=0,T=0;"anticlockwise"===A?(T="in"===x?w+2*Math.PI:w,T=w+2*Math.PI):(S=w,T="out"===x?w+2*Math.PI:w);const C=Av.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:y/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:b/2,outerRadius:null!==(v=null==r?void 0:r.radius)&&void 0!==v?v:(y+b)/2,innerRadius:0,startAngle:S,endAngle:T,fill:!0});let B,_;"anticlockwise"===A?(B={startAngle:w+2*Math.PI},_={startAngle:w}):(B={endAngle:w},_={endAngle:w+2*Math.PI}),super("in"===x?B:_,"in"===x?_:B,i,n,{group:null==r?void 0:r.group,clipGraphic:C})}},t.ClipDirectionAnimate=class extends yy{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p;const f=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},g=null!==(h=null!==(a=null==r?void 0:r.width)&&void 0!==a?a:f.width)&&void 0!==h?h:0,v=null!==(c=null!==(l=null==r?void 0:r.height)&&void 0!==l?l:f.height)&&void 0!==c?c:0,m=null!==(u=null==r?void 0:r.animationType)&&void 0!==u?u:"in",y=null!==(d=null==r?void 0:r.direction)&&void 0!==d?d:"x",b=null!==(p=null==r?void 0:r.orient)&&void 0!==p?p:"positive",x=Av.graphicService.creator.rect({x:0,y:0,width:"in"===m&&"x"===y?0:g,height:"in"===m&&"y"===y?0:v,fill:!0});let w={},A={};"y"===y?"negative"===b?(w={y:v,height:0},A={y:0,height:v}):(w={height:0},A={height:v}):"negative"===b?(w={x:g,width:0},A={x:0,width:g}):(w={width:0},A={width:g}),super("in"===m?w:A,"in"===m?A:w,i,n,{group:null==r?void 0:r.group,clipGraphic:x})}},t.ClipGraphicAnimate=yy,t.ClipRadiusAnimate=class extends yy{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p,f,g;const v=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},m=null!==(a=v.width)&&void 0!==a?a:0,y=null!==(h=v.height)&&void 0!==h?h:0,b=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",x=null!==(c=null==r?void 0:r.startRadius)&&void 0!==c?c:0,w=null!==(u=null==r?void 0:r.endRadius)&&void 0!==u?u:Math.sqrt((m/2)**2+(y/2)**2),A=Av.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:m/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:y/2,outerRadius:"out"===b?w:x,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),S={outerRadius:x},T={outerRadius:w};super("in"===b?S:T,"in"===b?T:S,i,n,{group:null==r?void 0:r.group,clipGraphic:A})}},t.ColorInterpolate=Xw,t.Context2dFactory=Nv,t.ContributionProvider=xp,t.CurveContext=class{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 xg(new mf(this._lastX,this._lastY),new mf(t,e))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,e,i,n,r,s){const o=new yg(new mf(this._lastX,this._lastY),new mf(t,e),new mf(i,n),new mf(r,s));this.path.curves.push(o),this._lastX=r,this._lastY=s}arcTo(t,e,i,n,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,r,s,o,a){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=km,t.CustomPath2D=qg,t.CustomSymbolClass=pS,t.DefaultArcAttribute=av,t.DefaultAreaAttribute=hv,t.DefaultAttribute=ov,t.DefaultCircleAttribute=lv,t.DefaultConnectAttribute=rv,t.DefaultDebugAttribute=sv,t.DefaultFillStyle=Qg,t.DefaultGlyphAttribute=uv,t.DefaultGroupAttribute=cv,t.DefaultImageAttribute=xv,t.DefaultLayout=Zg,t.DefaultLineAttribute=dv,t.DefaultMat4Allocate=sT,t.DefaultMatrixAllocate=rT,t.DefaultMorphingAnimateConfig=ty,t.DefaultPathAttribute=pv,t.DefaultPolygonAttribute=fv,t.DefaultRect3dAttribute=vv,t.DefaultRectAttribute=gv,t.DefaultRichTextAttribute=bv,t.DefaultRichTextIconAttribute=wv,t.DefaultStateAnimateConfig=Qm,t.DefaultStrokeStyle=ev,t.DefaultStyle=nv,t.DefaultSymbolAttribute=mv,t.DefaultSymbolBackgroundRenderContribution=wC,t.DefaultSymbolTextureRenderContribution=AC,t.DefaultTextAttribute=yv,t.DefaultTextStyle=iv,t.DefaultTicker=Gm,t.DefaultTimeline=Xm,t.DefaultTransform=Jg,t.DragNDrop=class{constructor(t){this.onPointerDown=t=>{const e=t.target,i=this.rootNode,n=e===i;if(e&&!n){let r,s=!1;function o(t){if(s||(t.type="dragstart",null==e||e.dispatchEvent(t),s=!0),t.type="drag",null==e||e.dispatchEvent(t),!n){e.pickable=!1;const n=(null==i?void 0:i.pick(t.global.x,t.global.y)).graphic;e.pickable=!0,r!==n&&(r&&(t.type="dragleave",t.target=r,r.dispatchEvent(t)),n&&(t.type="dragenter",t.target=n,n.dispatchEvent(t)),r=n,r&&(t.type="dragover",t.target=r,r.dispatchEvent(t)))}}null==i||i.addEventListener("pointermove",o);const a=function(){s&&(r&&(t.type="drop",t.target=r,r.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),s=!1),null==i||i.removeEventListener("pointermove",o)};e.addEventListener("pointerup",a,{once:!0}),e.addEventListener("pointerupoutside",a,{once:!0})}},this.rootNode=t,this.initEvents()}initEvents(){var t;null===(t=this.rootNode)||void 0===t||t.addEventListener("pointerdown",this.onPointerDown)}removeEvents(){var t;null===(t=this.rootNode)||void 0===t||t.removeEventListener("pointerdown",this.onPointerDown)}release(){this.removeEvents(),this.rootNode=null}},t.DrawContribution=mC,t.EventManager=Im,t.EventSystem=Nm,t.EventTarget=Dm,t.FadeInPlus=class extends qm{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=my.LEFT_TO_RIGHT,fill:o=!0,stroke:a=!0}=r||{};this.direction=s,this.fill=o,this.stroke=a,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 my.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case my.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case my.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case my.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=_m,t.FederatedMouseEvent=Pm,t.FederatedPointerEvent=Em,t.FederatedWheelEvent=Mm,t.Fragment=WP,t.GLYPH_NUMBER_TYPE=aw,t.GRAPHIC_UPDATE_TAG_KEY=yb,t.GROUP_NUMBER_TYPE=hw,t.Generator=Cm,t.Gesture=class extends Mp{constructor(t,e={}){var i,n,r,s,o,a,h,l;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.onStart=t=>{this.reset(),this.startTime=Rm.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=Wm(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)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const n=t.clone(),{x:r,y:s,pointerId:o}=n;for(let t=0,e=i.length;t<e;t++)if(o===i[t].pointerId){i[t]=n;break}const a={x:r,y:s},h=i.map((t=>({x:t.x,y:t.y}))),l=Rm.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=l,this.lastMovePoint=a,1===e.length){const t=e[0],i=r-t.x,o=s-t.y,l=this.direction||Um(t,a);this.direction=l;const c=this.getEventType(a);return n.direction=l,n.deltaX=i,n.deltaY=o,n.points=h,this.triggerStartEvent(c,n),void this.triggerEvent(c,n)}const{startDistance:c}=this,u=Wm(h[0],h[1]);n.scale=u/c,n.center=this.center,n.points=h,this.triggerStartEvent("pinch",n),this.triggerEvent("pinch",n)},this.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=Rm.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=Wm(i,r),o=s/t;o>this.config.swipe.velocity&&s>this.config.swipe.threshold&&(e.velocity=o,e.direction=Um(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()},this.element=t,this.config={press:{time:null!==(n=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==n?n:251,threshold:null!==(s=null===(r=null==e?void 0:e.press)||void 0===r?void 0:r.threshold)&&void 0!==s?s:9},swipe:{threshold:null!==(a=null===(o=null==e?void 0:e.swipe)||void 0===o?void 0:o.threshold)&&void 0!==a?a:10,velocity:null!==(l=null===(h=null==e?void 0:e.swipe)||void 0===h?void 0:h.velocity)&&void 0!==l?l:.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}getEventType(t){const{eventType:e,startTime:i,startPoints:n}=this;if(e)return e;let r;return r=Rm.now()-i>this.config.press.time&&Wm(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=Av.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=DC,t.Glyph=TS,t.GlyphRender=fC,t.Graphic=Tb,t.GraphicAnimate=class extends qm{constructor(t,e,i,n,r){super(t,e,i,n,r),this.graphic=null==r?void 0: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=xw,t.GraphicPicker=RC,t.GraphicRender=nC,t.GraphicService=bw,t.GraphicUtil=Rw,t.Group=Bw,t.GroupFadeIn=class extends qm{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 qm{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=rC,t.GroupRenderContribution=Qw,t.IMAGE_NUMBER_TYPE=lw,t.Image=PS,t.ImageRender=gC,t.ImageRenderContribution=tA,t.IncreaseCount=class extends qm{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n,r,s;this.fromNumber=jp(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(i=this.from)||void 0===i?void 0:i.text),this.toNumber=jp(null===(n=this.to)||void 0===n?void 0:n.text)?null===(r=this.to)||void 0===r?void 0:r.text:Number.parseFloat(null===(s=this.to)||void 0===s?void 0:s.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1)}onEnd(){}onUpdate(t,e,i){var n,r;!1!==this.valid&&(i.text=t?this.toNumber.toFixed():(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(null!==(r=null===(n=this.params)||void 0===n?void 0:n.fixed)&&void 0!==r?r:0))}},t.IncrementalDrawContribution=JT,t.InputText=class extends qm{constructor(){super(...arguments),this.fromText="",this.toText=""}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n;if(this.fromText=null!==(e=null===(t=this.from)||void 0===t?void 0:t.text)&&void 0!==e?e:"",this.toText=null!==(n=null===(i=this.to)||void 0===i?void 0:i.text)&&void 0!==n?n:"",!this.toText||Wp(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=Av.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){var n;if(!1===this.valid)return;const r=this.fromText.length,s=this.toText.length,o=Math.ceil(r+(s-r)*e);i.text=this.toText.substr(0,o);const a=null===(n=this.target.shadowRoot)||void 0===n?void 0:n.at(0),h=this.target.clipedWidth+2;a.setAttribute("x",h)}},t.InteractiveSubRenderContribution=oA,t.LINE_NUMBER_TYPE=cw,t.Layer=Pw,t.LayerHandlerContribution=_w,t.LayerService=Ow,t.Line=bS,t.LineRender=sC,t.Linear=Tg,t.LinearClosed=Gg,t.ManualTickHandler=Fm,t.ManualTicker=class extends Gm{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new Fm;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.Mat4Allocate=iT,t.MatrixAllocate=eT,t.Meteor=class extends qm{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 mf(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=Dg,t.MonotoneY=Lg,t.MorphingPath=hb,t.MotionPath=class extends qm{constructor(t,e,i,n,r){var s;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=null!==(s=r.initAngle)&&void 0!==s?s: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=cb,t.NOWORK_ANIMATE_ATTR=Sb,t.Node=Bm,t.PATH_NUMBER_TYPE=uw,t.POLYGON_NUMBER_TYPE=dw,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=pw,t.Path=DS,t.PathRender=oC,t.PathRenderContribution=eA,t.PickerService=OC,t.PluginService=wB,t.Polygon=zS,t.PolygonRender=aC,t.PolygonRenderContribution=iA,t.Pyramid3d=HS,t.Pyramid3dRender=pC,t.RAFTickHandler=zm,t.REACT_TO_CANOPUS_EVENTS=DP,t.REACT_TO_CANOPUS_EVENTS_LIST=LP,t.RECT3D_NUMBER_TYPE=gw,t.RECT_NUMBER_TYPE=fw,t.RICHTEXT_NUMBER_TYPE=vw,t.RafBasedSTO=gy,t.Rect=wS,t.Rect3DRender=lC,t.Rect3d=SS,t.RectRender=hC,t.RectRenderContribution=nA,t.ReflectSegContext=Ag,t.RenderSelector=vC,t.RenderService=SC,t.ResourceLoader=gb,t.RichText=OS,t.RichTextRender=dC,t.RotateBySphereAnimate=class extends qm{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 o=Math.acos((i-t.x)/e/Math.sin(s));r-t.z<0&&(o=rf-o),this.theta=o,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,o=this.theta+s,a=this.phi,h=r*Math.sin(a)*Math.cos(o)+n.x,l=r*Math.cos(a)+n.y,c=r*Math.sin(a)*Math.sin(o)+n.z;for(i.x=h,i.y=l,i.z=c,i.alpha=o+tf/2;i.alpha>rf;)i.alpha-=rf;i.alpha=rf-i.alpha,i.zIndex=-1e4*i.z}},t.SVG_ATTRIBUTE_MAP=ww,t.SVG_ATTRIBUTE_MAP_KEYS=Aw,t.SVG_PARSE_ATTRIBUTE_MAP=Sw,t.SVG_PARSE_ATTRIBUTE_MAP_KEYS=Tw,t.SYMBOL_NUMBER_TYPE=mw,t.SegContext=wg,t.Stage=OP,t.Step=jg,t.StreamLight=class extends qm{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){var t;const e=this.target.attachShadow(),i=this.target.AABBBounds.height(),n=Av.graphicService.creator.rect(Object.assign(Object.assign({height:i,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff"},null===(t=this.params)||void 0===t?void 0:t.attribute),{x:0,y:0,width:0}));this.rect=n,e.add(n)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(e,i,n){var r,s,o,a,h,l;const c=null!==(r=this.target.attribute.width)&&void 0!==r?r:250,u=null!==(o=null===(s=this.params)||void 0===s?void 0:s.streamLength)&&void 0!==o?o:c,d=null!==(l=null===(h=null===(a=this.params)||void 0===a?void 0:a.attribute)||void 0===h?void 0:h.width)&&void 0!==l?l:60,p=-d,f=p+(u-p)*i,g=Math.max(f,0),v=Math.min(Math.min(f+d,d),u-f),m=v+g>c?Math.max(c-g,0):v;this.rect.setAttributes({x:g,width:m},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}},t.SubAnimate=Zm,t.Symbol=mS,t.SymbolRender=cC,t.SymbolRenderContribution=rA,t.TEXT_NUMBER_TYPE=yw,t.TagPointsUpdate=class extends qm{constructor(t,e,i,n,r){super(t,e,i,n,r),this.newPointAnimateType="appear"===(null==r?void 0:r.newPointAnimateType)?"appear":"grow"}onBind(){var t,e;const i=null===(t=this.from)||void 0===t?void 0:t.points,n=null===(e=this.to)||void 0===e?void 0:e.points;this.fromPoints=i?Array.isArray(i)?i:[i]:[],this.toPoints=n?Array.isArray(n)?n:[n]:[];const r=new Map;this.fromPoints.forEach((t=>{t.context&&r.set(t.context,t)}));let s,o,a=1/0,h=-1/0;for(let t=0;t<this.toPoints.length;t+=1)if(r.has(this.toPoints[t].context)){a=t,s=r.get(this.toPoints[t].context);break}for(let t=this.toPoints.length-1;t>=0;t-=1)if(r.has(this.toPoints[t].context)){h=t,o=r.get(this.toPoints[t].context);break}let l=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const i=r.get(t.context);return i?(l=i,[i,t]):"appear"===this.newPointAnimateType?[t,t]:e<a&&s?[s,t]:e>h&&o?[o,t]:[l,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],n=new mf(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=cy(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),i.points=this.points}},t.Text=fA,t.TextRender=uC,t.TextRenderContribution=sA,t.Theme=wm,t.TimeOutTickHandler=jm,t.TransformUtil=kw,t.VArc=function(t){return vT(t?t.attribute:{})},t.VArc3d=function(t){return mT(t?t.attribute:{})},t.VArea=function(t){return bT(t?t.attribute:{})},t.VCircle=function(t){return xT(t?t.attribute:{})},t.VGlyph=function(t){return BT(t?t.attribute:{})},t.VGroup=function(t){return wT(t?t.attribute:{})},t.VImage=function(t){return MT(t?t.attribute:{})},t.VLine=function(t){return AT(t?t.attribute:{})},t.VPath=function(t){return ST(t?t.attribute:{})},t.VPolygon=function(t){return kT(t?t.attribute:{})},t.VPyramid3d=function(t){return yT(t?t.attribute:{})},t.VRect=function(t){return TT(t?t.attribute:{})},t.VRect3d=function(t){return CT(t?t.attribute:{})},t.VRichText=NP,t.VSymbol=function(t){return ET(t?t.attribute:{})},t.VText=function(t){return _T(t?t.attribute:{})},t.VWindow=Ew,t.WindowHandlerContribution=Mw,t.WrapText=vA,t.addArcToBezierPath=lg,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=By,t.alignSubpath=xy,t.applyTransformOnBezierCurves=Ey,t.bezier=ag,t.bezierCurversToPath=My,t.binarySplitPolygon=Fy,t.bindContributionProvider=Ap,t.bindContributionProviderNoSingletonScope=Sp,t.boundStroke=qx,t.builtinSymbols=fS,t.builtinSymbolsMap=gS,t.calcLineCache=Yg,t.centroidOfSubpath=Sy,t.circleBounds=hy,t.cloneGraphic=pb,t.container=Dv,t.cornerTangents=Hw,t.createArc=vT,t.createArc3d=mT,t.createArea=bT,t.createCircle=xT,t.createColor=bC,t.createConicalGradient=Kw,t.createGlyph=BT,t.createGroup=wT,t.createImage=MT,t.createLine=AT,t.createMat4=nT,t.createPath=ST,t.createPolygon=kT,t.createPyramid3d=yT,t.createRect=TT,t.createRect3d=CT,t.createRectPath=YT,t.createRichText=OT,t.createShadowRoot=RT,t.createStage=function(t){return new OP(t)},t.createSymbol=ET,t.createText=_T,t.createWrapText=PT,t.cubicCalc=gg,t.cubicLength=fg,t.cubicPointAt=vg,t.cubicSubdivide=by,t.defaultTicker=MP,t.defaultTimeline=Ym,t.drawArc=hg,t.drawArcPath=Gw,t.drawAreaSegments=jT,t.drawIncrementalAreaSegments=WT,t.drawIncrementalSegments=UT,t.drawPathProxy=jw,t.drawSegments=NT,t.enumCommandMap=Gf,t.fillVisible=Nw,t.findBestMorphingRotation=Cy,t.findNextGraphic=PC,t.foreach=BC,t.foreachAsync=_C,t.genBasisSegments=Mg,t.genBasisTypeSegments=Eg,t.genLinearClosedSegments=Vg,t.genLinearClosedTypeSegments=Xg,t.genLinearSegments=Cg,t.genLinearTypeSegments=Bg,t.genMonotoneXSegments=Ug,t.genMonotoneYSegments=Fg,t.genMonotpneXTypeSegments=Ng,t.genMonotpneYTypeSegments=Wg,t.genNumberType=$x,t.genStepSegments=zg,t.genStepTypeSegments=Hg,t.getAttributeFromDefaultAttrList=fy,t.getConicGradientAt=qw,t.getContextFont=lA,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,o=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=i.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=i.AABBBounds;o[1]=e.x1+(e.x2-e.x1)*t}else o[1]=s[1]}if("text"===i.type){const{textAlign:t}=i.attribute;o[0]+=cA(t,i.clipedWidth)}o[0]+=t,o[1]+=e;const a=aT.allocate();return cT(a,a,[o[0],o[1],0]),r&&hT(a,a,r),n&&lT(a,a,n),cT(a,a,[-o[0],-o[1],0]),a},t.getModelMatrix=pT,t.getRichTextBounds=function(t){return LT.setAttributes(t),LT.AABBBounds},t.getScaledStroke=yC,t.getTextBounds=function(t){return DT.setAttributes(t),DT.AABBBounds},t.getTheme=Sm,t.getThemeFromGroup=Tm,t.globalTheme=Am,t.graphicCreator=IT,t.graphicService=bP,t.graphicUtil=mP,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.intersect=zw,t.isTransformKey=py,t.jsx=function(t,e,...i){const n=e||{},{key:r,attribute:s,stateProxy:o}=n,a=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i}(n,["key","attribute","stateProxy"]);let h=t;Up(t)&&(h=IT[t]);const l=[];i.length&&UP(1===i.length?i[0]:i,l);const c="Group"===h.name?new h(s):h(e);return function(t,e,i){let n,r=!1;switch(t.type){case"richtext":case"rich/image":break;case"rich/text":n=t.attribute||{},e[0]&&(n.text=e[0]);break;default:r=!0}r?(e.forEach((e=>{e&&t.add(e)})),Object.keys(i).forEach((e=>{const n=DP[e];n&&t.on(n,i[e])}))):"richtext"===t.type&&(t.attribute.textConfig=e.map((t=>t.attribute)).filter((t=>t)))}(c,l,a),o&&(c.stateProxy=o),c},t.layerService=wP,t.loadFeishuContributions=_B,t.loadTaroContributions=PB,t.mat3Tomat4=uT,t.mat4Allocate=aT,t.matrixAllocate=oT,t.morphPath=lb,t.multiToOneMorph=(e,i,n)=>{var r,s,o;const a=e.filter((t=>t.toCustomPath&&t.valid));a.length||__DEV__&&console.error(e," is not validate"),i.valid&&i.toCustomPath||__DEV__&&console.error(i," is not validate");const h=("clone"===(null==n?void 0:n.splitPath)?pb:null!==(r=null==n?void 0:n.splitPath)&&void 0!==r?r:fb)(i,a.length,!0),l=i.attribute;i.setAttribute("visible",!1);const c=a.map(((t,e)=>sb(t.toCustomPath(),h[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:h[e].globalTransMatrix}))),u=a.map(((t,e)=>ab(t.attribute,l)));if(null==n?void 0:n.individualDelay){const r=n.onEnd;let s=a.length;const o=()=>{s--,0===s&&(i.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),r&&r())};h.forEach(((t,i)=>{var r,s,h;const l=(null!==(r=n.delay)&&void 0!==r?r:0)+n.individualDelay(i,a.length,e[i],t),d=t.animate(Object.assign({},n,{onEnd:o}));d.wait(l),d.play(new hb({morphingData:c[i],saveOnEnd:!0,otherAttrs:u[i]},null!==(s=n.duration)&&void 0!==s?s:ty.duration,null!==(h=n.easing)&&void 0!==h?h:ty.easing))}))}else{const e=null==n?void 0:n.onEnd,r=n?Object.assign({},n):{};r.onEnd=()=>{i.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),e&&e()};const a=i.animate(r);(null==n?void 0:n.delay)&&a.wait(n.delay),a.play(new cb({morphingData:c,otherAttrs:u},null!==(s=null==n?void 0:n.duration)&&void 0!==s?s:ty.duration,null!==(o=null==n?void 0:n.easing)&&void 0!==o?o:ty.easing))}},t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i.a,x=i.b,w=0,A=0;return t[0]=b*n+x*a+w*u+A*g,t[1]=b*r+x*h+w*d+A*v,t[2]=b*s+x*l+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i.c,x=i.d,w=0,A=0,t[4]=b*n+x*a+w*u+A*g,t[5]=b*r+x*h+w*d+A*v,t[6]=b*s+x*l+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=0,x=0,w=1,A=0,t[8]=b*n+x*a+w*u+A*g,t[9]=b*r+x*h+w*d+A*v,t[10]=b*s+x*l+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i.e,x=i.f,w=0,A=1,t[12]=b*n+x*a+w*u+A*g,t[13]=b*r+x*h+w*d+A*v,t[14]=b*s+x*l+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t},t.multiplyMat4Mat4=dT,t.newThemeObj=ym,t.oneToMultiMorph=(t,e,i)=>{var n;const r=e.filter((t=>t&&t.toCustomPath&&t.valid));r.length||__DEV__&&console.error(r," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");const s=("clone"===(null==i?void 0:i.splitPath)?pb:null!==(n=null==i?void 0:i.splitPath)&&void 0!==n?n:fb)(t,r.length,!1),o=null==i?void 0:i.onEnd;let a=r.length;const h=()=>{a--,0===a&&o&&o()};r.forEach(((e,n)=>{var o;const a=s[n],l=(null!==(o=null==i?void 0:i.delay)&&void 0!==o?o:0)+((null==i?void 0:i.individualDelay)?i.individualDelay(n,r.length,a,e):0);lb(a,e,Object.assign({},i,{onEnd:h,delay:l}),t.globalTransMatrix)}))},t.parsePadding=sy,t.parseStroke=ny,t.parseSvgPath=Zf,t.pathToBezierCurves=Py,t.pickerService=xP,t.point=_g,t.pointEqual=ly,t.pointInterpolation=cy,t.pointInterpolationHighPerformance=function(t,e,i,n){const{x:r,y:s}=gf(t.x,t.y,e.x,e.y,i),{x:o,y:a}=gf(t.x1,t.y1,e.x1,e.y1,i);return n.x=r,n.y=s,n.x1=o,n.y1=a,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)=>ly(t,e[i]))):!Number.isNaN(t.x+t.y)&&ly(t,e))},t.pointsInterpolation=uy,t.rafBasedSto=vy,t.rectFillVisible=Uw,t.rectStrokeVisible=Fw,t.recursiveCallBinarySplit=jy,t.renderCommandList=ug,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.rotateX=hT,t.rotateY=lT,t.runFill=Dw,t.runStroke=Lw,t.segments=og,t.shouldUseMat4=fT,t.snapLength=pg,t.splitArc=Oy,t.splitArea=Ly,t.splitCircle=Iy,t.splitGraphic=fb,t.splitLine=Ny,t.splitPath=Hy,t.splitPolygon=zy,t.splitRect=Ry,t.splitToGrids=ky,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=Ww,t.textDrawOffsetX=cA,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=uA,t.transformKeys=dy,t.transformUtil=yP,t.translate=cT,t.version="0.15.5",t.verticalLayout=Jx,t.vglobal=vP,t.waitForAllSubLayers=function(t){return bp(this,void 0,void 0,(function*(){const e=[],i=t.getChildren();yield new Promise((t=>{Av.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)}))})))}))})),yield Promise.all(e)}))},t.wrapCanvas=Uv,t.wrapContext=function(t,e){return Dv.getNamed(Nv,Av.global.env)(t,e)},t.xul=function(t){const e=Wp(t)?t[0]:t,i=[];if(!e)return i;if(!0===Yx.XMLValidator.validate(e,{allowBooleanAttributes:!0})){const t=new Yx.XMLParser({ignoreAttributes:!1}).parse(e);t.tc&&Object.keys(t.tc).forEach((e=>{"text"===e?i.push(function(t){const e={text:""};iw(t,e);const i=t["#text"];i&&(e.text=i);return e}(t.tc[e])):i.push(function(t){const e={image:"",width:0,height:0};iw(t,e);const i=e.image;i&&(e.image=i.replaceAll("&quot",'"').replaceAll("&lt","<").replaceAll("&gt",">"));return e}(t.tc[e]))}))}return i}}));
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,f(n.key),n)}}function o(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t,e,i){return(e=f(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(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 u(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=h(t);if(e){var r=h(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return c(this,i)}}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,s,o,a=[],h=!0,l=!1;try{if(s=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;h=!1}else for(;!(h=(n=s.call(i)).done)&&(a.push(n.value),a.length!==e);h=!0);}catch(t){l=!0,r=t}finally{try{if(!h&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(l)throw r}}return a}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return p(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return p(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function f(t){var e=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)}(t,"string");return"symbol"==typeof e?e:String(e)}var g=function(t){return t&&t.Math==Math&&t},v=g("object"==("undefined"==typeof globalThis?"undefined":n(globalThis))&&globalThis)||g("object"==("undefined"==typeof window?"undefined":n(window))&&window)||g("object"==("undefined"==typeof self?"undefined":n(self))&&self)||g("object"==n(e)&&e)||function(){return this}()||e||Function("return this")(),m={},y=function(t){try{return!!t()}catch(t){return!0}},b=!y((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),x=!y((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),w=x,A=Function.prototype.call,S=w?A.bind(A):function(){return A.apply(A,arguments)},T={},C={}.propertyIsEnumerable,B=Object.getOwnPropertyDescriptor,_=B&&!C.call({1:2},1);T.f=_?function(t){var e=B(this,t);return!!e&&e.enumerable}:C;var P,E,M=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},k=x,R=Function.prototype,O=R.call,I=k&&R.bind.bind(O,O),D=k?I:function(t){return function(){return O.apply(t,arguments)}},L=D,N=L({}.toString),U=L("".slice),W=function(t){return U(N(t),8,-1)},F=y,j=W,z=Object,H=D("".split),G=F((function(){return!z("z").propertyIsEnumerable(0)}))?function(t){return"String"==j(t)?H(t,""):z(t)}:z,V=function(t){return null==t},X=V,Y=TypeError,q=function(t){if(X(t))throw Y("Can't call method on "+t);return t},K=G,$=q,Z=function(t){return K($(t))},J="object"==("undefined"==typeof document?"undefined":n(document))&&document.all,Q={all:J,IS_HTMLDDA:void 0===J&&void 0!==J},et=Q.all,it=Q.IS_HTMLDDA?function(t){return"function"==typeof t||t===et}:function(t){return"function"==typeof t},nt=it,rt=Q.all,st=Q.IS_HTMLDDA?function(t){return"object"==n(t)?null!==t:nt(t)||t===rt}:function(t){return"object"==n(t)?null!==t:nt(t)},ot=v,at=it,ht=function(t,e){return arguments.length<2?(i=ot[t],at(i)?i:void 0):ot[t]&&ot[t][e];var i},lt=D({}.isPrototypeOf),ct=v,ut="undefined"!=typeof navigator&&String(navigator.userAgent)||"",dt=ct.process,pt=ct.Deno,ft=dt&&dt.versions||pt&&pt.version,gt=ft&&ft.v8;gt&&(E=(P=gt.split("."))[0]>0&&P[0]<4?1:+(P[0]+P[1])),!E&&ut&&(!(P=ut.match(/Edge\/(\d+)/))||P[1]>=74)&&(P=ut.match(/Chrome\/(\d+)/))&&(E=+P[1]);var vt=E,mt=y,yt=v.String,bt=!!Object.getOwnPropertySymbols&&!mt((function(){var t=Symbol();return!yt(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&vt&&vt<41})),xt=bt&&!Symbol.sham&&"symbol"==n(Symbol.iterator),wt=ht,At=it,St=lt,Tt=Object,Ct=xt?function(t){return"symbol"==n(t)}:function(t){var e=wt("Symbol");return At(e)&&St(e.prototype,Tt(t))},Bt=String,_t=function(t){try{return Bt(t)}catch(t){return"Object"}},Pt=it,Et=_t,Mt=TypeError,kt=function(t){if(Pt(t))return t;throw Mt(Et(t)+" is not a function")},Rt=kt,Ot=V,It=function(t,e){var i=t[e];return Ot(i)?void 0:Rt(i)},Dt=S,Lt=it,Nt=st,Ut=TypeError,Wt={exports:{}},Ft=v,jt=Object.defineProperty,zt=function(t,e){try{jt(Ft,t,{value:e,configurable:!0,writable:!0})}catch(i){Ft[t]=e}return e},Ht=zt,Gt="__core-js_shared__",Vt=v[Gt]||Ht(Gt,{}),Xt=Vt;(Wt.exports=function(t,e){return Xt[t]||(Xt[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 Yt=Wt.exports,qt=q,Kt=Object,$t=function(t){return Kt(qt(t))},Zt=$t,Jt=D({}.hasOwnProperty),Qt=Object.hasOwn||function(t,e){return Jt(Zt(t),e)},te=D,ee=0,ie=Math.random(),ne=te(1..toString),re=function(t){return"Symbol("+(void 0===t?"":t)+")_"+ne(++ee+ie,36)},se=Yt,oe=Qt,ae=re,he=bt,le=xt,ce=v.Symbol,ue=se("wks"),de=le?ce.for||ce:ce&&ce.withoutSetter||ae,pe=function(t){return oe(ue,t)||(ue[t]=he&&oe(ce,t)?ce[t]:de("Symbol."+t)),ue[t]},fe=S,ge=st,ve=Ct,me=It,ye=function(t,e){var i,n;if("string"===e&&Lt(i=t.toString)&&!Nt(n=Dt(i,t)))return n;if(Lt(i=t.valueOf)&&!Nt(n=Dt(i,t)))return n;if("string"!==e&&Lt(i=t.toString)&&!Nt(n=Dt(i,t)))return n;throw Ut("Can't convert object to primitive value")},be=TypeError,xe=pe("toPrimitive"),we=function(t,e){if(!ge(t)||ve(t))return t;var i,n=me(t,xe);if(n){if(void 0===e&&(e="default"),i=fe(n,t,e),!ge(i)||ve(i))return i;throw be("Can't convert object to primitive value")}return void 0===e&&(e="number"),ye(t,e)},Ae=Ct,Se=function(t){var e=we(t,"string");return Ae(e)?e:e+""},Te=st,Ce=v.document,Be=Te(Ce)&&Te(Ce.createElement),_e=function(t){return Be?Ce.createElement(t):{}},Pe=_e,Ee=!b&&!y((function(){return 7!=Object.defineProperty(Pe("div"),"a",{get:function(){return 7}}).a})),Me=b,ke=S,Re=T,Oe=M,Ie=Z,De=Se,Le=Qt,Ne=Ee,Ue=Object.getOwnPropertyDescriptor;m.f=Me?Ue:function(t,e){if(t=Ie(t),e=De(e),Ne)try{return Ue(t,e)}catch(t){}if(Le(t,e))return Oe(!ke(Re.f,t,e),t[e])};var We={},Fe=b&&y((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),je=st,ze=String,He=TypeError,Ge=function(t){if(je(t))return t;throw He(ze(t)+" is not an object")},Ve=b,Xe=Ee,Ye=Fe,qe=Ge,Ke=Se,$e=TypeError,Ze=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,Qe="enumerable",ti="configurable",ei="writable";We.f=Ve?Ye?function(t,e,i){if(qe(t),e=Ke(e),qe(i),"function"==typeof t&&"prototype"===e&&"value"in i&&ei in i&&!i[ei]){var n=Je(t,e);n&&n[ei]&&(t[e]=i.value,i={configurable:ti in i?i[ti]:n[ti],enumerable:Qe in i?i[Qe]:n[Qe],writable:!1})}return Ze(t,e,i)}:Ze:function(t,e,i){if(qe(t),e=Ke(e),qe(i),Xe)try{return Ze(t,e,i)}catch(t){}if("get"in i||"set"in i)throw $e("Accessors not supported");return"value"in i&&(t[e]=i.value),t};var ii=We,ni=M,ri=b?function(t,e,i){return ii.f(t,e,ni(1,i))}:function(t,e,i){return t[e]=i,t},si={exports:{}},oi=b,ai=Qt,hi=Function.prototype,li=oi&&Object.getOwnPropertyDescriptor,ci=ai(hi,"name"),ui={EXISTS:ci,PROPER:ci&&"something"===function(){}.name,CONFIGURABLE:ci&&(!oi||oi&&li(hi,"name").configurable)},di=it,pi=Vt,fi=D(Function.toString);di(pi.inspectSource)||(pi.inspectSource=function(t){return fi(t)});var gi,vi,mi,yi=pi.inspectSource,bi=it,xi=v.WeakMap,wi=bi(xi)&&/native code/.test(String(xi)),Ai=re,Si=Yt("keys"),Ti=function(t){return Si[t]||(Si[t]=Ai(t))},Ci={},Bi=wi,_i=v,Pi=st,Ei=ri,Mi=Qt,ki=Vt,Ri=Ti,Oi=Ci,Ii="Object already initialized",Di=_i.TypeError,Li=_i.WeakMap;if(Bi||ki.state){var Ni=ki.state||(ki.state=new Li);Ni.get=Ni.get,Ni.has=Ni.has,Ni.set=Ni.set,gi=function(t,e){if(Ni.has(t))throw Di(Ii);return e.facade=t,Ni.set(t,e),e},vi=function(t){return Ni.get(t)||{}},mi=function(t){return Ni.has(t)}}else{var Ui=Ri("state");Oi[Ui]=!0,gi=function(t,e){if(Mi(t,Ui))throw Di(Ii);return e.facade=t,Ei(t,Ui,e),e},vi=function(t){return Mi(t,Ui)?t[Ui]:{}},mi=function(t){return Mi(t,Ui)}}var Wi={set:gi,get:vi,has:mi,enforce:function(t){return mi(t)?vi(t):gi(t,{})},getterFor:function(t){return function(e){var i;if(!Pi(e)||(i=vi(e)).type!==t)throw Di("Incompatible receiver, "+t+" required");return i}}},Fi=D,ji=y,zi=it,Hi=Qt,Gi=b,Vi=ui.CONFIGURABLE,Xi=yi,Yi=Wi.enforce,qi=Wi.get,Ki=String,$i=Object.defineProperty,Zi=Fi("".slice),Ji=Fi("".replace),Qi=Fi([].join),tn=Gi&&!ji((function(){return 8!==$i((function(){}),"length",{value:8}).length})),en=String(String).split("String"),nn=si.exports=function(t,e,i){"Symbol("===Zi(Ki(e),0,7)&&(e="["+Ji(Ki(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!Hi(t,"name")||Vi&&t.name!==e)&&(Gi?$i(t,"name",{value:e,configurable:!0}):t.name=e),tn&&i&&Hi(i,"arity")&&t.length!==i.arity&&$i(t,"length",{value:i.arity});try{i&&Hi(i,"constructor")&&i.constructor?Gi&&$i(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=Yi(t);return Hi(n,"source")||(n.source=Qi(en,"string"==typeof e?e:"")),t};Function.prototype.toString=nn((function(){return zi(this)&&qi(this).source||Xi(this)}),"toString");var rn=si.exports,sn=it,on=We,an=rn,hn=zt,ln=function(t,e,i,n){n||(n={});var r=n.enumerable,s=void 0!==n.name?n.name:e;if(sn(i)&&an(i,s,n),n.global)r?t[e]=i:hn(e,i);else{try{n.unsafe?t[e]&&(r=!0):delete t[e]}catch(t){}r?t[e]=i:on.f(t,e,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},cn={},un=Math.ceil,dn=Math.floor,pn=Math.trunc||function(t){var e=+t;return(e>0?dn:un)(e)},fn=function(t){var e=+t;return e!=e||0===e?0:pn(e)},gn=fn,vn=Math.max,mn=Math.min,yn=function(t,e){var i=gn(t);return i<0?vn(i+e,0):mn(i,e)},bn=fn,xn=Math.min,wn=function(t){return t>0?xn(bn(t),9007199254740991):0},An=function(t){return wn(t.length)},Sn=Z,Tn=yn,Cn=An,Bn=function(t){return function(e,i,n){var r,s=Sn(e),o=Cn(s),a=Tn(n,o);if(t&&i!=i){for(;o>a;)if((r=s[a++])!=r)return!0}else for(;o>a;a++)if((t||a in s)&&s[a]===i)return t||a||0;return!t&&-1}},_n={includes:Bn(!0),indexOf:Bn(!1)},Pn=Qt,En=Z,Mn=_n.indexOf,kn=Ci,Rn=D([].push),On=function(t,e){var i,n=En(t),r=0,s=[];for(i in n)!Pn(kn,i)&&Pn(n,i)&&Rn(s,i);for(;e.length>r;)Pn(n,i=e[r++])&&(~Mn(s,i)||Rn(s,i));return s},In=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Dn=On,Ln=In.concat("length","prototype");cn.f=Object.getOwnPropertyNames||function(t){return Dn(t,Ln)};var Nn={};Nn.f=Object.getOwnPropertySymbols;var Un=ht,Wn=cn,Fn=Nn,jn=Ge,zn=D([].concat),Hn=Un("Reflect","ownKeys")||function(t){var e=Wn.f(jn(t)),i=Fn.f;return i?zn(e,i(t)):e},Gn=Qt,Vn=Hn,Xn=m,Yn=We,qn=y,Kn=it,$n=/#|\.prototype\./,Zn=function(t,e){var i=Qn[Jn(t)];return i==er||i!=tr&&(Kn(e)?qn(e):!!e)},Jn=Zn.normalize=function(t){return String(t).replace($n,".").toLowerCase()},Qn=Zn.data={},tr=Zn.NATIVE="N",er=Zn.POLYFILL="P",ir=Zn,nr=v,rr=m.f,sr=ri,or=ln,ar=zt,hr=function(t,e,i){for(var n=Vn(e),r=Yn.f,s=Xn.f,o=0;o<n.length;o++){var a=n[o];Gn(t,a)||i&&Gn(i,a)||r(t,a,s(e,a))}},lr=ir,cr=function(t,e){var i,r,s,o,a,h=t.target,l=t.global,c=t.stat;if(i=l?nr:c?nr[h]||ar(h,{}):(nr[h]||{}).prototype)for(r in e){if(o=e[r],s=t.dontCallGetSet?(a=rr(i,r))&&a.value:i[r],!lr(l?r:h+(c?".":"#")+r,t.forced)&&void 0!==s){if(n(o)==n(s))continue;hr(o,s)}(t.sham||s&&s.sham)&&sr(o,"sham",!0),or(i,r,o,t)}},ur={exports:{}},dr={},pr=Se,fr=We,gr=M,vr=yn,mr=An,yr=function(t,e,i){var n=pr(e);n in t?fr.f(t,n,gr(0,i)):t[n]=i},br=Array,xr=Math.max,wr=W,Ar=Z,Sr=cn.f,Tr=function(t,e,i){for(var n=mr(t),r=vr(e,n),s=vr(void 0===i?n:i,n),o=br(xr(s-r,0)),a=0;r<s;r++,a++)yr(o,a,t[r]);return o.length=a,o},Cr="object"==("undefined"==typeof window?"undefined":n(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];dr.f=function(t){return Cr&&"Window"==wr(t)?function(t){try{return Sr(t)}catch(t){return Tr(Cr)}}(t):Sr(Ar(t))};var Br=y((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),_r=y,Pr=st,Er=W,Mr=Br,kr=Object.isExtensible,Rr=_r((function(){kr(1)}))||Mr?function(t){return!!Pr(t)&&((!Mr||"ArrayBuffer"!=Er(t))&&(!kr||kr(t)))}:kr,Or=!y((function(){return Object.isExtensible(Object.preventExtensions({}))})),Ir=cr,Dr=D,Lr=Ci,Nr=st,Ur=Qt,Wr=We.f,Fr=cn,jr=dr,zr=Rr,Hr=Or,Gr=!1,Vr=re("meta"),Xr=0,Yr=function(t){Wr(t,Vr,{value:{objectID:"O"+Xr++,weakData:{}}})},qr=ur.exports={enable:function(){qr.enable=function(){},Gr=!0;var t=Fr.f,e=Dr([].splice),i={};i[Vr]=1,t(i).length&&(Fr.f=function(i){for(var n=t(i),r=0,s=n.length;r<s;r++)if(n[r]===Vr){e(n,r,1);break}return n},Ir({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:jr.f}))},fastKey:function(t,e){if(!Nr(t))return"symbol"==n(t)?t:("string"==typeof t?"S":"P")+t;if(!Ur(t,Vr)){if(!zr(t))return"F";if(!e)return"E";Yr(t)}return t[Vr].objectID},getWeakData:function(t,e){if(!Ur(t,Vr)){if(!zr(t))return!0;if(!e)return!1;Yr(t)}return t[Vr].weakData},onFreeze:function(t){return Hr&&Gr&&zr(t)&&!Ur(t,Vr)&&Yr(t),t}};Lr[Vr]=!0;var Kr=ur.exports,$r=W,Zr=D,Jr=function(t){if("Function"===$r(t))return Zr(t)},Qr=kt,ts=x,es=Jr(Jr.bind),is=function(t,e){return Qr(t),void 0===e?t:ts?es(t,e):function(){return t.apply(e,arguments)}},ns={},rs=ns,ss=pe("iterator"),os=Array.prototype,as={};as[pe("toStringTag")]="z";var hs="[object z]"===String(as),ls=it,cs=W,us=pe("toStringTag"),ds=Object,ps="Arguments"==cs(function(){return arguments}()),fs=hs?cs: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=ds(t),us))?i:ps?cs(e):"Object"==(n=cs(e))&&ls(e.callee)?"Arguments":n},gs=fs,vs=It,ms=V,ys=ns,bs=pe("iterator"),xs=function(t){if(!ms(t))return vs(t,bs)||vs(t,"@@iterator")||ys[gs(t)]},ws=S,As=kt,Ss=Ge,Ts=_t,Cs=xs,Bs=TypeError,_s=S,Ps=Ge,Es=It,Ms=is,ks=S,Rs=Ge,Os=_t,Is=function(t){return void 0!==t&&(rs.Array===t||os[ss]===t)},Ds=An,Ls=lt,Ns=function(t,e){var i=arguments.length<2?Cs(t):e;if(As(i))return Ss(ws(i,t));throw Bs(Ts(t)+" is not iterable")},Us=xs,Ws=function(t,e,i){var n,r;Ps(t);try{if(!(n=Es(t,"return"))){if("throw"===e)throw i;return i}n=_s(n,t)}catch(t){r=!0,n=t}if("throw"===e)throw i;if(r)throw n;return Ps(n),i},Fs=TypeError,js=function(t,e){this.stopped=t,this.result=e},zs=js.prototype,Hs=function(t,e,i){var r,s,o,a,h,l,c,u=i&&i.that,d=!(!i||!i.AS_ENTRIES),p=!(!i||!i.IS_RECORD),f=!(!i||!i.IS_ITERATOR),g=!(!i||!i.INTERRUPTED),v=Ms(e,u),m=function(t){return r&&Ws(r,"normal",t),new js(!0,t)},y=function(t){return d?(Rs(t),g?v(t[0],t[1],m):v(t[0],t[1])):g?v(t,m):v(t)};if(p)r=t.iterator;else if(f)r=t;else{if(!(s=Us(t)))throw Fs(Os(t)+" is not iterable");if(Is(s)){for(o=0,a=Ds(t);a>o;o++)if((h=y(t[o]))&&Ls(zs,h))return h;return new js(!1)}r=Ns(t,s)}for(l=p?t.next:r.next;!(c=ks(l,r)).done;){try{h=y(c.value)}catch(t){Ws(r,"throw",t)}if("object"==n(h)&&h&&Ls(zs,h))return h}return new js(!1)},Gs=lt,Vs=TypeError,Xs=function(t,e){if(Gs(e,t))return t;throw Vs("Incorrect invocation")},Ys=pe("iterator"),qs=!1;try{var Ks=0,$s={next:function(){return{done:!!Ks++}},return:function(){qs=!0}};$s[Ys]=function(){return this},Array.from($s,(function(){throw 2}))}catch(t){}var Zs=We.f,Js=Qt,Qs=pe("toStringTag"),to=function(t,e,i){t&&!i&&(t=t.prototype),t&&!Js(t,Qs)&&Zs(t,Qs,{configurable:!0,value:e})},eo=D,io=kt,no=it,ro=String,so=TypeError,oo=function(t,e,i){try{return eo(io(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}},ao=Ge,ho=function(t){if("object"==n(t)||no(t))return t;throw so("Can't set "+ro(t)+" as a prototype")},lo=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=oo(Object.prototype,"__proto__","set"))(i,[]),e=i instanceof Array}catch(t){}return function(i,n){return ao(i),ho(n),e?t(i,n):i.__proto__=n,i}}():void 0),co=it,uo=st,po=lo,fo=cr,go=v,vo=D,mo=ir,yo=ln,bo=Kr,xo=Hs,wo=Xs,Ao=it,So=V,To=st,Co=y,Bo=function(t,e){if(!e&&!qs)return!1;var i=!1;try{var n={};n[Ys]=function(){return{next:function(){return{done:i=!0}}}},t(n)}catch(t){}return i},_o=to,Po=function(t,e,i){var n,r;return po&&co(n=e.constructor)&&n!==i&&uo(r=n.prototype)&&r!==i.prototype&&po(t,r),t},Eo=function(t,e,i){var n=-1!==t.indexOf("Map"),r=-1!==t.indexOf("Weak"),s=n?"set":"add",o=go[t],a=o&&o.prototype,h=o,l={},c=function(t){var e=vo(a[t]);yo(a,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(r&&!To(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return r&&!To(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(r&&!To(t))&&e(this,0===t?0:t)}:function(t,i){return e(this,0===t?0:t,i),this})};if(mo(t,!Ao(o)||!(r||a.forEach&&!Co((function(){(new o).entries().next()})))))h=i.getConstructor(e,t,n,s),bo.enable();else if(mo(t,!0)){var u=new h,d=u[s](r?{}:-0,1)!=u,p=Co((function(){u.has(1)})),f=Bo((function(t){new o(t)})),g=!r&&Co((function(){for(var t=new o,e=5;e--;)t[s](e,e);return!t.has(-0)}));f||((h=e((function(t,e){wo(t,a);var i=Po(new o,t,h);return So(e)||xo(e,i[s],{that:i,AS_ENTRIES:n}),i}))).prototype=a,a.constructor=h),(p||g)&&(c("delete"),c("has"),n&&c("get")),(g||d)&&c(s),r&&a.clear&&delete a.clear}return l[t]=h,fo({global:!0,constructor:!0,forced:h!=o},l),_o(h,t),r||i.setStrong(h,t,n),h},Mo={},ko=On,Ro=In,Oo=Object.keys||function(t){return ko(t,Ro)},Io=b,Do=Fe,Lo=We,No=Ge,Uo=Z,Wo=Oo;Mo.f=Io&&!Do?Object.defineProperties:function(t,e){No(t);for(var i,n=Uo(e),r=Wo(e),s=r.length,o=0;s>o;)Lo.f(t,i=r[o++],n[i]);return t};var Fo,jo=ht("document","documentElement"),zo=Ge,Ho=Mo,Go=In,Vo=Ci,Xo=jo,Yo=_e,qo="prototype",Ko="script",$o=Ti("IE_PROTO"),Zo=function(){},Jo=function(t){return"<"+Ko+">"+t+"</"+Ko+">"},Qo=function(t){t.write(Jo("")),t.close();var e=t.parentWindow.Object;return t=null,e},ta=function(){try{Fo=new ActiveXObject("htmlfile")}catch(t){}var t,e,i;ta="undefined"!=typeof document?document.domain&&Fo?Qo(Fo):(e=Yo("iframe"),i="java"+Ko+":",e.style.display="none",Xo.appendChild(e),e.src=String(i),(t=e.contentWindow.document).open(),t.write(Jo("document.F=Object")),t.close(),t.F):Qo(Fo);for(var n=Go.length;n--;)delete ta[qo][Go[n]];return ta()};Vo[$o]=!0;var ea,ia,na,ra=Object.create||function(t,e){var i;return null!==t?(Zo[qo]=zo(t),i=new Zo,Zo[qo]=null,i[$o]=t):i=ta(),void 0===e?i:Ho.f(i,e)},sa=rn,oa=We,aa=function(t,e,i){return i.get&&sa(i.get,e,{getter:!0}),i.set&&sa(i.set,e,{setter:!0}),oa.f(t,e,i)},ha=ln,la=function(t,e,i){for(var n in e)ha(t,n,e[n],i);return t},ca=!y((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),ua=Qt,da=it,pa=$t,fa=ca,ga=Ti("IE_PROTO"),va=Object,ma=va.prototype,ya=fa?va.getPrototypeOf:function(t){var e=pa(t);if(ua(e,ga))return e[ga];var i=e.constructor;return da(i)&&e instanceof i?i.prototype:e instanceof va?ma:null},ba=y,xa=it,wa=st,Aa=ya,Sa=ln,Ta=pe("iterator"),Ca=!1;[].keys&&("next"in(na=[].keys())?(ia=Aa(Aa(na)))!==Object.prototype&&(ea=ia):Ca=!0);var Ba=!wa(ea)||ba((function(){var t={};return ea[Ta].call(t)!==t}));Ba&&(ea={}),xa(ea[Ta])||Sa(ea,Ta,(function(){return this}));var _a={IteratorPrototype:ea,BUGGY_SAFARI_ITERATORS:Ca},Pa=_a.IteratorPrototype,Ea=ra,Ma=M,ka=to,Ra=ns,Oa=function(){return this},Ia=cr,Da=S,La=it,Na=function(t,e,i,n){var r=e+" Iterator";return t.prototype=Ea(Pa,{next:Ma(+!n,i)}),ka(t,r,!1),Ra[r]=Oa,t},Ua=ya,Wa=lo,Fa=to,ja=ri,za=ln,Ha=ns,Ga=ui.PROPER,Va=ui.CONFIGURABLE,Xa=_a.IteratorPrototype,Ya=_a.BUGGY_SAFARI_ITERATORS,qa=pe("iterator"),Ka="keys",$a="values",Za="entries",Ja=function(){return this},Qa=ht,th=aa,eh=b,ih=pe("species"),nh=ra,rh=aa,sh=la,oh=is,ah=Xs,hh=V,lh=Hs,ch=function(t,e,i,n,r,s,o){Na(i,e,n);var a,h,l,c=function(t){if(t===r&&g)return g;if(!Ya&&t in p)return p[t];switch(t){case Ka:case $a:case Za:return function(){return new i(this,t)}}return function(){return new i(this)}},u=e+" Iterator",d=!1,p=t.prototype,f=p[qa]||p["@@iterator"]||r&&p[r],g=!Ya&&f||c(r),v="Array"==e&&p.entries||f;if(v&&(a=Ua(v.call(new t)))!==Object.prototype&&a.next&&(Ua(a)!==Xa&&(Wa?Wa(a,Xa):La(a[qa])||za(a,qa,Ja)),Fa(a,u,!0)),Ga&&r==$a&&f&&f.name!==$a&&(Va?ja(p,"name",$a):(d=!0,g=function(){return Da(f,this)})),r)if(h={values:c($a),keys:s?g:c(Ka),entries:c(Za)},o)for(l in h)(Ya||d||!(l in p))&&za(p,l,h[l]);else Ia({target:e,proto:!0,forced:Ya||d},h);return p[qa]!==g&&za(p,qa,g,{name:r}),Ha[e]=g,h},uh=function(t,e){return{value:t,done:e}},dh=function(t){var e=Qa(t);eh&&e&&!e[ih]&&th(e,ih,{configurable:!0,get:function(){return this}})},ph=b,fh=Kr.fastKey,gh=Wi.set,vh=Wi.getterFor,mh={getConstructor:function(t,e,i,n){var r=t((function(t,r){ah(t,s),gh(t,{type:e,index:nh(null),first:void 0,last:void 0,size:0}),ph||(t.size=0),hh(r)||lh(r,t[n],{that:t,AS_ENTRIES:i})})),s=r.prototype,o=vh(e),a=function(t,e,i){var n,r,s=o(t),a=h(t,e);return a?a.value=i:(s.last=a={index:r=fh(e,!0),key:e,value:i,previous:n=s.last,next:void 0,removed:!1},s.first||(s.first=a),n&&(n.next=a),ph?s.size++:t.size++,"F"!==r&&(s.index[r]=a)),t},h=function(t,e){var i,n=o(t),r=fh(e);if("F"!==r)return n.index[r];for(i=n.first;i;i=i.next)if(i.key==e)return i};return sh(s,{clear:function(){for(var t=o(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,ph?t.size=0:this.size=0},delete:function(t){var e=this,i=o(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),ph?i.size--:e.size--}return!!n},forEach:function(t){for(var e,i=o(this),n=oh(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)}}),sh(s,i?{get:function(t){var e=h(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),ph&&rh(s,"size",{configurable:!0,get:function(){return o(this).size}}),r},setStrong:function(t,e,i){var n=e+" Iterator",r=vh(e),s=vh(n);ch(t,e,(function(t,e){gh(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)?uh("keys"==e?i.key:"values"==e?i.value:[i.key,i.value],!1):(t.target=void 0,uh(void 0,!0))}),i?"entries":"values",!i,!0),dh(e)}};Eo("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),mh);var yh=W,bh=Array.isArray||function(t){return"Array"==yh(t)},xh=D,wh=y,Ah=it,Sh=fs,Th=yi,Ch=function(){},Bh=[],_h=ht("Reflect","construct"),Ph=/^\s*(?:class|function)\b/,Eh=xh(Ph.exec),Mh=!Ph.exec(Ch),kh=function(t){if(!Ah(t))return!1;try{return _h(Ch,Bh,t),!0}catch(t){return!1}},Rh=function(t){if(!Ah(t))return!1;switch(Sh(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Mh||!!Eh(Ph,Th(t))}catch(t){return!0}};Rh.sham=!0;var Oh=!_h||wh((function(){var t;return kh(kh.call)||!kh(Object)||!kh((function(){t=!0}))||t}))?Rh:kh,Ih=bh,Dh=Oh,Lh=st,Nh=pe("species"),Uh=Array,Wh=function(t){var e;return Ih(t)&&(e=t.constructor,(Dh(e)&&(e===Uh||Ih(e.prototype))||Lh(e)&&null===(e=e[Nh]))&&(e=void 0)),void 0===e?Uh:e},Fh=is,jh=G,zh=$t,Hh=An,Gh=function(t,e){return new(Wh(t))(0===e?0:e)},Vh=D([].push),Xh=function(t){var e=1==t,i=2==t,n=3==t,r=4==t,s=6==t,o=7==t,a=5==t||s;return function(h,l,c,u){for(var d,p,f=zh(h),g=jh(f),v=Fh(l,c),m=Hh(g),y=0,b=u||Gh,x=e?b(h,m):i||o?b(h,0):void 0;m>y;y++)if((a||y in g)&&(p=v(d=g[y],y,f),t))if(e)x[y]=p;else if(p)switch(t){case 3:return!0;case 5:return d;case 6:return y;case 2:Vh(x,d)}else switch(t){case 4:return!1;case 7:Vh(x,d)}return s?-1:n||r?r:x}},Yh={forEach:Xh(0),map:Xh(1),filter:Xh(2),some:Xh(3),every:Xh(4),find:Xh(5),findIndex:Xh(6),filterReject:Xh(7)},qh=D,Kh=la,$h=Kr.getWeakData,Zh=Xs,Jh=Ge,Qh=V,tl=st,el=Hs,il=Qt,nl=Wi.set,rl=Wi.getterFor,sl=Yh.find,ol=Yh.findIndex,al=qh([].splice),hl=0,ll=function(t){return t.frozen||(t.frozen=new cl)},cl=function(){this.entries=[]},ul=function(t,e){return sl(t.entries,(function(t){return t[0]===e}))};cl.prototype={get:function(t){var e=ul(this,t);if(e)return e[1]},has:function(t){return!!ul(this,t)},set:function(t,e){var i=ul(this,t);i?i[1]=e:this.entries.push([t,e])},delete:function(t){var e=ol(this.entries,(function(e){return e[0]===t}));return~e&&al(this.entries,e,1),!!~e}};var dl,pl={getConstructor:function(t,e,i,n){var r=t((function(t,r){Zh(t,s),nl(t,{type:e,id:hl++,frozen:void 0}),Qh(r)||el(r,t[n],{that:t,AS_ENTRIES:i})})),s=r.prototype,o=rl(e),a=function(t,e,i){var n=o(t),r=$h(Jh(e),!0);return!0===r?ll(n).set(e,i):r[n.id]=i,t};return Kh(s,{delete:function(t){var e=o(this);if(!tl(t))return!1;var i=$h(t);return!0===i?ll(e).delete(t):i&&il(i,e.id)&&delete i[e.id]},has:function(t){var e=o(this);if(!tl(t))return!1;var i=$h(t);return!0===i?ll(e).has(t):i&&il(i,e.id)}}),Kh(s,i?{get:function(t){var e=o(this);if(tl(t)){var i=$h(t);return!0===i?ll(e).get(t):i?i[e.id]:void 0}},set:function(t,e){return a(this,t,e)}}:{add:function(t){return a(this,t,!0)}}),r}},fl=Or,gl=v,vl=D,ml=la,yl=Kr,bl=Eo,xl=pl,wl=st,Al=Wi.enforce,Sl=y,Tl=wi,Cl=Object,Bl=Array.isArray,_l=Cl.isExtensible,Pl=Cl.isFrozen,El=Cl.isSealed,Ml=Cl.freeze,kl=Cl.seal,Rl={},Ol={},Il=!gl.ActiveXObject&&"ActiveXObject"in gl,Dl=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Ll=bl("WeakMap",Dl,xl),Nl=Ll.prototype,Ul=vl(Nl.set);if(Tl)if(Il){dl=xl.getConstructor(Dl,"WeakMap",!0),yl.enable();var Wl=vl(Nl.delete),Fl=vl(Nl.has),jl=vl(Nl.get);ml(Nl,{delete:function(t){if(wl(t)&&!_l(t)){var e=Al(this);return e.frozen||(e.frozen=new dl),Wl(this,t)||e.frozen.delete(t)}return Wl(this,t)},has:function(t){if(wl(t)&&!_l(t)){var e=Al(this);return e.frozen||(e.frozen=new dl),Fl(this,t)||e.frozen.has(t)}return Fl(this,t)},get:function(t){if(wl(t)&&!_l(t)){var e=Al(this);return e.frozen||(e.frozen=new dl),Fl(this,t)?jl(this,t):e.frozen.get(t)}return jl(this,t)},set:function(t,e){if(wl(t)&&!_l(t)){var i=Al(this);i.frozen||(i.frozen=new dl),Fl(this,t)?Ul(this,t,e):i.frozen.set(t,e)}else Ul(this,t,e);return this}})}else fl&&Sl((function(){var t=Ml([]);return Ul(new Ll,t,1),!Pl(t)}))&&ml(Nl,{set:function(t,e){var i;return Bl(t)&&(Pl(t)?i=Rl:El(t)&&(i=Ol)),Ul(this,t,e),i==Rl&&Ml(t),i==Ol&&kl(t),this}});var zl=ht,Hl=D,Gl=Yt,Vl=zl("Map"),Xl=zl("WeakMap"),Yl=Hl([].push),ql=Gl("metadata"),Kl=ql.store||(ql.store=new Xl),$l=function(t,e,i){var n=Kl.get(t);if(!n){if(!i)return;Kl.set(t,n=new Vl)}var r=n.get(e);if(!r){if(!i)return;n.set(e,r=new Vl)}return r},Zl={store:Kl,getMap:$l,has:function(t,e,i){var n=$l(e,i,!1);return void 0!==n&&n.has(t)},get:function(t,e,i){var n=$l(e,i,!1);return void 0===n?void 0:n.get(t)},set:function(t,e,i,n){$l(i,n,!0).set(t,e)},keys:function(t,e){var i=$l(t,e,!1),n=[];return i&&i.forEach((function(t,e){Yl(n,e)})),n},toKey:function(t){return void 0===t||"symbol"==n(t)?t:String(t)}},Jl=Ge,Ql=Zl.toKey,tc=Zl.set;cr({target:"Reflect",stat:!0},{defineMetadata:function(t,e,i){var n=arguments.length<4?void 0:Ql(arguments[3]);tc(t,e,Jl(i),n)}});var ec=Ge,ic=Zl.toKey,nc=Zl.getMap,rc=Zl.store;cr({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var i=arguments.length<3?void 0:ic(arguments[2]),n=nc(ec(e),i,!1);if(void 0===n||!n.delete(t))return!1;if(n.size)return!0;var r=rc.get(e);return r.delete(i),!!r.size||rc.delete(e)}});var sc=Ge,oc=ya,ac=Zl.has,hc=Zl.get,lc=Zl.toKey,cc=function t(e,i,n){if(ac(e,i,n))return hc(e,i,n);var r=oc(i);return null!==r?t(e,r,n):void 0};cr({target:"Reflect",stat:!0},{getMetadata:function(t,e){var i=arguments.length<3?void 0:lc(arguments[2]);return cc(t,sc(e),i)}});var uc=D,dc=Map.prototype,pc={Map:Map,set:uc(dc.set),get:uc(dc.get),has:uc(dc.has),remove:uc(dc.delete),proto:dc},fc=S,gc=D,vc=function(t,e,i){for(var n,r,s=i||t.next;!(n=fc(s,t)).done;)if(void 0!==(r=e(n.value)))return r},mc=pc.Map,yc=pc.proto,bc=gc(yc.forEach),xc=gc(yc.entries),wc=xc(new mc).next,Ac=kt,Sc=V,Tc=An,Cc=$t,Bc=function(t,e,i){return i?vc(xc(t),(function(t){return e(t[1],t[0])}),wc):bc(t,e)},_c=pc.Map,Pc=pc.has,Ec=pc.set,Mc=D([].push),kc=cr,Rc=D,Oc=Zl,Ic=Ge,Dc=ya,Lc=Rc((function(t){var e,i,n,r=Cc(this),s=Tc(r),o=[],a=new _c,h=Sc(t)?function(t){return t}:Ac(t);for(e=0;e<s;e++)n=h(i=r[e]),Pc(a,n)||Ec(a,n,i);return Bc(a,(function(t){Mc(o,t)})),o})),Nc=Rc([].concat),Uc=Oc.keys,Wc=Oc.toKey,Fc=function t(e,i){var n=Uc(e,i),r=Dc(e);if(null===r)return n;var s=t(r,i);return s.length?n.length?Lc(Nc(n,s)):s:n};kc({target:"Reflect",stat:!0},{getMetadataKeys:function(t){var e=arguments.length<2?void 0:Wc(arguments[1]);return Fc(Ic(t),e)}});var jc=Ge,zc=Zl.get,Hc=Zl.toKey;cr({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var i=arguments.length<3?void 0:Hc(arguments[2]);return zc(t,jc(e),i)}});var Gc=Ge,Vc=Zl.keys,Xc=Zl.toKey;cr({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:Xc(arguments[1]);return Vc(Gc(t),e)}});var Yc=Ge,qc=ya,Kc=Zl.has,$c=Zl.toKey,Zc=function t(e,i,n){if(Kc(e,i,n))return!0;var r=qc(i);return null!==r&&t(e,r,n)};cr({target:"Reflect",stat:!0},{hasMetadata:function(t,e){var i=arguments.length<3?void 0:$c(arguments[2]);return Zc(t,Yc(e),i)}});var Jc=Ge,Qc=Zl.has,tu=Zl.toKey;cr({target:"Reflect",stat:!0},{hasOwnMetadata:function(t,e){var i=arguments.length<3?void 0:tu(arguments[2]);return Qc(t,Jc(e),i)}});var eu=Ge,iu=Zl.toKey,nu=Zl.set;cr({target:"Reflect",stat:!0},{metadata:function(t,e){return function(i,n){nu(t,e,eu(i),iu(n))}}});var ru="named",su="name",ou="unmanaged",au="optional",hu="inject",lu="multi_inject",cu="inversify:tagged",uu="inversify:tagged_props",du="inversify:paramtypes",pu="post_construct",fu="pre_destroy";var gu=[hu,lu,su,ou,ru,au],vu={Request:"Request",Singleton:"Singleton",Transient:"Transient"},mu={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},yu={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},bu=0;function xu(){return bu++}var wu=function(){function t(t,e){this.id=xu(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=mu.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===vu.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}(),Au="Metadata key was used more than once in a parameter:",Su="NULL argument",Tu="Key Not Found",Cu="Ambiguous match found for serviceIdentifier:",Bu="No matching bindings found for serviceIdentifier:",_u="Missing required @injectable annotation in:",Pu="Missing required @inject or @multiInject annotation in:",Eu="Circular dependency found:",Mu="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",ku=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."},Ru=function(t,e){return"@postConstruct error in class "+t+": "+e},Ou=function(t,e){return"@preDestroy error in class "+t+": "+e},Iu=function(t,e){return"onDeactivation() error in class "+t+": "+e},Du="Maximum call stack size exceeded",Lu=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(du,t),userGeneratedMetadata:Reflect.getMetadata(cu,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(uu,t)||[]},t}(),Nu={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function Uu(t){return t instanceof RangeError||t.message===Du}function Wu(t){return"function"==typeof t?t.name:"symbol"===n(t)?t.toString():t}function Fu(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=Hu(t.implementationType)),n=n+"\n "+e,t.constraint.metaData&&(n=n+" - "+t.constraint.metaData)}))),n}function ju(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||ju(t.parentRequest,e))}function zu(t){t.childRequests.forEach((function(t){if(ju(t,t.serviceIdentifier)){var e=function(t){var e=function t(e,i){void 0===i&&(i=[]);var n=Wu(e.serviceIdentifier);return i.push(n),null!==e.parentRequest?t(e.parentRequest,i):i}(t);return e.reverse().join(" --\x3e ")}(t);throw new Error(Eu+" "+e)}zu(t)}))}function Hu(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 Gu=function(){function t(t){this.id=xu(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}(),Vu=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===ru?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},t}(),Xu=function(t,e){this.parentContext=t,this.rootRequest=e},Yu=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}(),qu=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}(),Ku=function(){function t(t,e,i,r){this.id=xu(),this.type=t,this.serviceIdentifier=i;var s="symbol"===n(e)?e.toString().slice(7,-1):e;this.name=new qu(s||""),this.identifier=e,this.metadata=new Array;var o=null;"string"==typeof r?o=new Vu(ru,r):r instanceof Vu&&(o=r),null!==o&&this.metadata.push(o)}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(lu)},t.prototype.matchesArray=function(t){return this.matchesTag(lu)(t)},t.prototype.isNamed=function(){return this.hasTag(ru)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return gu.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(au)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===ru}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return gu.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(ru)(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}(),$u=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 Zu(t,e,i,n){var r=t.getConstructorMetadata(i),s=r.compilerGeneratedMetadata;if(void 0===s)throw new Error(_u+" "+e+".");var o=r.userGeneratedMetadata,a=Object.keys(o),h=0===i.length&&a.length>0,l=a.length>i.length,c=function(t,e,i,n,r){for(var s=[],o=0;o<r;o++){var a=Ju(o,t,e,i,n);null!==a&&s.push(a)}return s}(n,e,s,o,h||l?a.length:i.length),u=td(t,i,e);return $u($u([],c,!0),u,!0)}function Ju(t,e,i,n,r){var s=r[t.toString()]||[],o=id(s),a=!0!==o.unmanaged,h=n[t],l=o.inject||o.multiInject;if((h=l||h)instanceof Yu&&(h=h.unwrap()),a){if(!e&&(h===Object||h===Function||void 0===h))throw new Error(Pu+" argument "+t+" in class "+i+".");var c=new Ku(yu.ConstructorArgument,o.targetName,h);return c.metadata=s,c}return null}function Qu(t,e,i,n){var r=t||e;if(void 0===r){var s=_u+" for property "+String(i)+" in class "+n+".";throw new Error(s)}return r}function td(t,e,i){for(var n=t.getPropertiesMetadata(e),r=[],s=Object.getOwnPropertySymbols(n),o=0,a=Object.keys(n).concat(s);o<a.length;o++){var h=a[o],l=n[h],c=id(l),u=c.targetName||h,d=Qu(c.inject,c.multiInject,h,i),p=new Ku(yu.ClassProperty,u,d);p.metadata=l,r.push(p)}var f=Object.getPrototypeOf(e.prototype).constructor;if(f!==Object){var g=td(t,f,i);r=$u($u([],r,!0),g,!0)}return r}function ed(t,e){var i=Object.getPrototypeOf(e.prototype).constructor;if(i!==Object){var n=Zu(t,Hu(i),i,!0),r=n.map((function(t){return t.metadata.filter((function(t){return t.key===ou}))})),s=[].concat.apply([],r).length,o=n.length-s;return o>0?o:ed(t,i)}return 0}function id(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[hu],multiInject:e[lu],targetName:e[su],unmanaged:e[ou]}}var nd=function(){function t(t,e,i,n,r){this.id=xu(),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 rd(t){return t._bindingDictionary}function sd(t,e,i,n,r){var s=ad(i.container,r.serviceIdentifier),o=[];return s.length===Nu.NoBindingsAvailable&&i.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(i.container.bind(r.serviceIdentifier).toSelf(),s=ad(i.container,r.serviceIdentifier)),o=e?s:s.filter((function(t){var e=new nd(t.serviceIdentifier,i,n,t,r);return t.constraint(e)})),function(t,e,i,n){switch(e.length){case Nu.NoBindingsAvailable:if(i.isOptional())return e;var r=Wu(t),s=Bu;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+=Fu(n,r,ad),new Error(s);case Nu.OnlyOneBindingAvailable:return e;case Nu.MultipleBindingsAvailable:default:if(i.isArray())return e;r=Wu(t),s=Cu+" "+r;throw s+=Fu(n,r,ad),new Error(s)}}(r.serviceIdentifier,o,r,i.container),o}function od(t,e,i,n,r,s){var o,a;if(null===r){o=sd(t,e,n,null,s),a=new nd(i,n,null,o,s);var h=new Xu(n,a);n.addPlan(h)}else o=sd(t,e,n,r,s),a=r.addChildRequest(s.serviceIdentifier,o,s);o.forEach((function(e){var i=null;if(s.isArray())i=a.addChildRequest(e.serviceIdentifier,e,s);else{if(e.cache)return;i=a}if(e.type===mu.Instance&&null!==e.implementationType){var r=function(t,e){return Zu(t,Hu(e),e,!1)}(t,e.implementationType);if(!n.container.options.skipBaseClassChecks){var o=ed(t,e.implementationType);if(r.length<o){var h=ku(Hu(e.implementationType));throw new Error(h)}}r.forEach((function(e){od(t,!1,e.serviceIdentifier,n,i,e)}))}}))}function ad(t,e){var i=[],n=rd(t);return n.hasKey(e)?i=n.get(e):null!==t.parent&&(i=ad(t.parent,e)),i}function hd(t,e,i,n,r,s,o,a){void 0===a&&(a=!1);var h=new Gu(e),l=function(t,e,i,n,r,s){var o=new Vu(t?lu:hu,i),a=new Ku(e,n,i,o);if(void 0!==r){var h=new Vu(r,s);a.metadata.push(h)}return a}(i,n,r,"",s,o);try{return od(t,a,r,h,null,l),h}catch(t){throw Uu(t)&&zu(h.plan.rootRequest),t}}function ld(t){return("object"===n(t)&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function cd(t){return!!ld(t)||Array.isArray(t)&&t.some(ld)}var ud,dd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(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(o,a)}h((n=n.apply(t,e||[])).next())}))},pd=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)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 o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}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,a])}}},fd=function(t,e,i){t.has(e.id)||t.set(e.id,i)},gd=function(t,e){t.cache=e,t.activated=!0,ld(e)&&vd(t,e)},vd=function(t,e){return dd(void 0,void 0,void 0,(function(){var i,n;return pd(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"}(ud||(ud={}));var md=function(){return md=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},md.apply(this,arguments)},yd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(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(o,a)}h((n=n.apply(t,e||[])).next())}))},bd=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)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 o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}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,a])}}},xd=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 wd(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===yu.ConstructorArgument?t.constructorInjections.push(n):(t.propertyRequests.push(i),t.propertyInjections.push(n)),t.isAsync||(t.isAsync=cd(n)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,i),s=md(md({},r),{constr:t});n=r.isAsync?function(t){return yd(this,void 0,void 0,(function(){var e,i;return bd(this,(function(n){switch(n.label){case 0:return[4,Sd(t.constructorInjections)];case 1:return e=n.sent(),[4,Sd(t.propertyInjections)];case 2:return i=n.sent(),[2,Ad(md(md({},t),{constructorInjections:e,propertyInjections:i}))]}}))}))}(s):Ad(s)}else n=new t;return n}function Ad(t){var e,i=new((e=t.constr).bind.apply(e,xd([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 Sd(t){return yd(this,void 0,void 0,(function(){var e,i,n,r;return bd(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 Td(t,e){var i=function(t,e){var i,n;if(Reflect.hasMetadata(pu,t)){var r=Reflect.getMetadata(pu,t);try{return null===(n=(i=e)[r.value])||void 0===n?void 0:n.call(i)}catch(e){throw new Error(Ru(t.name,e.message))}}}(t,e);return ld(i)?i.then((function(){return e})):e}function Cd(t,e){t.scope!==vu.Singleton&&function(t,e){var i="Class cannot be instantiated in "+(t.scope===vu.Request?"request":"transient")+" scope.";if("function"==typeof t.onDeactivation)throw new Error(Iu(e.name,i));if(Reflect.hasMetadata(fu,e))throw new Error(Ou(e.name,i))}(t,e)}var Bd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(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(o,a)}h((n=n.apply(t,e||[])).next())}))},_d=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)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 o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}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,a])}}},Pd=function t(e){return function(i){i.parentContext.setCurrentRequest(i);var n=i.bindings,r=i.childRequests,s=i.target&&i.target.isArray(),o=!(i.parentRequest&&i.parentRequest.target&&i.target&&i.parentRequest.target.matchesArray(i.target.serviceIdentifier));if(s&&o)return r.map((function(i){return t(e)(i)}));if(!i.target.isOptional()||0!==n.length){var a=n[0];return Rd(e,i,a)}}},Ed=function(t,e){var i=function(t){switch(t.type){case mu.Factory:return{factory:t.factory,factoryType:ud.Factory};case mu.Provider:return{factory:t.provider,factoryType:ud.Provider};case mu.DynamicValue:return{factory:t.dynamicValue,factoryType:ud.DynamicValue};default:throw new Error("Unexpected factory type "+t.type)}}(t);return function(t,e){try{return t()}catch(t){throw Uu(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}))},Md=function(t,e,i){var n,r=e.childRequests;switch(function(t){var e=null;switch(t.type){case mu.ConstantValue:case mu.Function:e=t.cache;break;case mu.Constructor:case mu.Instance:e=t.implementationType;break;case mu.DynamicValue:e=t.dynamicValue;break;case mu.Provider:e=t.provider;break;case mu.Factory:e=t.factory}if(null===e){var i=Wu(t.serviceIdentifier);throw new Error("Invalid binding type: "+i)}}(i),i.type){case mu.ConstantValue:case mu.Function:n=i.cache;break;case mu.Constructor:n=i.implementationType;break;case mu.Instance:n=function(t,e,i,n){Cd(t,e);var r=wd(e,i,n);return ld(r)?r.then((function(t){return Td(e,t)})):Td(e,r)}(i,i.implementationType,r,Pd(t));break;default:n=Ed(i,e.parentContext)}return n},kd=function(t,e,i){var n=function(t,e){return e.scope===vu.Singleton&&e.activated?e.cache:e.scope===vu.Request&&t.has(e.id)?t.get(e.id):null}(t,e);return null!==n||function(t,e,i){e.scope===vu.Singleton&&gd(e,i),e.scope===vu.Request&&fd(t,e,i)}(t,e,n=i()),n},Rd=function(t,e,i){return kd(t,i,(function(){var n=Md(t,e,i);return n=ld(n)?n.then((function(t){return Od(e,i,t)})):Od(e,i,n)}))};function Od(t,e,i){var n,r=Id(t.parentContext,e,i),s=Ud(t.parentContext.container),o=s.next();do{n=o.value;var a=t.parentContext,h=t.serviceIdentifier,l=Nd(n,h);r=ld(r)?Ld(l,a,r):Dd(l,a,r),o=s.next()}while(!0!==o.done&&!rd(n).hasKey(t.serviceIdentifier));return r}var Id=function(t,e,i){return"function"==typeof e.onActivation?e.onActivation(t,i):i},Dd=function(t,e,i){for(var n=t.next();!n.done;){if(ld(i=n.value(e,i)))return Ld(t,e,i);n=t.next()}return i},Ld=function(t,e,i){return Bd(void 0,void 0,void 0,(function(){var n,r;return _d(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]}}))}))},Nd=function(t,e){var i=t._activations;return i.hasKey(e)?i.get(e).values():[].values()},Ud=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 Wd=function t(e,i){var n=e.parentRequest;return null!==n&&(!!i(n)||t(n,i))},Fd=function(t){return function(e){var i=function(i){return null!==i&&null!==i.target&&i.target.matchesTag(t)(e)};return i.metaData=new Vu(t,e),i}},jd=Fd(ru),zd=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}},Hd=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new Gd(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=jd(t),new Gd(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 Gd(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=Fd(t)(e),new Gd(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return null!==e&&zd(t)(e.parentRequest)},new Gd(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return null!==e&&jd(t)(e.parentRequest)},new Gd(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&Fd(t)(e)(i.parentRequest)},new Gd(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&Wd(e,zd(t))},new Gd(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&!Wd(e,zd(t))},new Gd(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Wd(e,jd(t))},new Gd(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&!Wd(e,jd(t))},new Gd(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&Wd(i,Fd(t)(e))},new Gd(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&!Wd(i,Fd(t)(e))},new Gd(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&Wd(e,t)},new Gd(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&!Wd(e,t)},new Gd(this._binding)},t}(),Gd=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new Hd(this._binding)},t.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new Hd(this._binding)},t}(),Vd=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Hd(this._binding),this._bindingOnSyntax=new Gd(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}(),Xd=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=vu.Request,new Vd(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=vu.Singleton,new Vd(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=vu.Transient,new Vd(this._binding)},t}(),Yd=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Hd(this._binding),this._bindingOnSyntax=new Gd(this._binding),this._bindingInSyntax=new Xd(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}(),qd=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=mu.Instance,this._binding.implementationType=t,new Yd(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=mu.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=vu.Singleton,new Vd(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=mu.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Yd(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=mu.Constructor,this._binding.implementationType=t,this._binding.scope=vu.Singleton,new Vd(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=mu.Factory,this._binding.factory=t,this._binding.scope=vu.Singleton,new Vd(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=mu.Function,this._binding.scope=vu.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=mu.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=vu.Singleton,new Vd(this._binding)},t.prototype.toAutoNamedFactory=function(t){return this._binding.type=mu.Factory,this._binding.factory=function(e){return function(i){return e.container.getNamed(t,i)}},new Vd(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=mu.Provider,this._binding.provider=t,this._binding.scope=vu.Singleton,new Vd(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}(),Kd=function(){function t(){}return t.of=function(e,i,n,r,s){var o=new t;return o.bindings=e,o.middleware=i,o.deactivations=r,o.activations=n,o.moduleActivationStore=s,o},t}();var $d=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(Su);if(null==e)throw new Error(Su);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(Su);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(Tu)},t.prototype.remove=function(t){if(null==t)throw new Error(Su);if(!this._map.delete(t))throw new Error(Tu)},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=[],o=0,a=n;o<a.length;o++){var h=a[o];t(h)?i.push(h):s.push(h)}e._setValue(r,s)})),i},t.prototype.hasKey=function(t){if(null==t)throw new Error(Su);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}(),Zd=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 $d,onDeactivations:new $d}},t}(),Jd=function(){return Jd=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},Jd.apply(this,arguments)},Qd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(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(o,a)}h((n=n.apply(t,e||[])).next())}))},tp=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)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 o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}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,a])}}},ep=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))},ip=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=vu.Transient;else if(e.defaultScope!==vu.Singleton&&e.defaultScope!==vu.Transient&&e.defaultScope!==vu.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=xu(),this._bindingDictionary=new $d,this._snapshots=[],this._middleware=null,this._activations=new $d,this._deactivations=new $d,this.parent=null,this._metadataReader=new Lu,this._moduleActivationStore=new Zd}return t.merge=function(e,i){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=new t,o=ep([e,i],n,!0).map((function(t){return rd(t)})),a=rd(s);return o.forEach((function(t){var e;e=a,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],o=i(s.id);s.registry(o.bindFunction,o.unbindFunction,o.isboundFunction,o.rebindFunction,o.unbindAsyncFunction,o.onActivationFunction,o.onDeactivationFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Qd(this,void 0,void 0,(function(){var e,i,n,r,s;return tp(this,(function(o){switch(o.label){case 0:e=this._getContainerModuleHelpersFactory(),i=0,n=t,o.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:o.sent(),o.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 Qd(this,void 0,void 0,(function(){var e,i,n,r;return tp(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||vu.Transient,i=new wu(t,e);return this._bindingDictionary.add(t,i),new qd(i)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.rebindAsync=function(t){return Qd(this,void 0,void 0,(function(){return tp(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 Qd(this,void 0,void 0,(function(){var e;return tp(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 $d},t.prototype.unbindAllAsync=function(){return Qd(this,void 0,void 0,(function(){var t,e=this;return tp(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 $d,[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,ru,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 Ku(yu.Variable,"",e,new Vu(i,n)),s=new Gu(t);return new nd(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(Kd.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 Qd(this,void 0,void 0,(function(){var e;return tp(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 Qd(this,void 0,void 0,(function(){var n;return tp(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,ru,e)},t.prototype.getNamedAsync=function(t,e){return this.getTaggedAsync(t,ru,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,ru,e)},t.prototype.getAllNamedAsync=function(t,e){return this.getAllTaggedAsync(t,ru,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(fu,t))return e[Reflect.getMetadata(fu,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(ld(r))return this._handleDeactivationError(r.then((function(){return i._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,e,n)})),n)}var s=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,e,n);if(ld(s))return this._handleDeactivationError(s,n)}catch(t){throw new Error(Iu(n.name,t.message))}},t.prototype._handleDeactivationError=function(t,e){return Qd(this,void 0,void 0,(function(){var i;return tp(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(Iu(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(ld(r))return r.then((function(){return i._deactivateContainerAsync(t,e)}));n=e.next()}},t.prototype._deactivateContainerAsync=function(t,e){return Qd(this,void 0,void 0,(function(){var i;return tp(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:(o=s,function(i){var n=t.bind(i);return e(n,o),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 o}},t.prototype._getAll=function(t){return Promise.all(this._get(t))},t.prototype._get=function(t){var e=Jd(Jd({},t),{contextInterceptor:function(t){return t},targetType:yu.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(cd(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=hd(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return function(t){return Pd(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}(i=e.contextInterceptor(i))}},t.prototype._deactivateIfSingleton=function(t){var e=this;if(t.activated)return ld(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(ld(this._deactivateIfSingleton(n)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}},t.prototype._deactivateSingletonsAsync=function(t){return Qd(this,void 0,void 0,(function(){var e=this;return tp(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 Qd(this,void 0,void 0,(function(){return tp(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: "+Wu(t))}},t.prototype._bindingDeactivationAndPreDestroy=function(t,e,i){var n=this;if("function"==typeof t.onDeactivation){var r=t.onDeactivation(e);if(ld(r))return r.then((function(){return n._preDestroy(i,e)}))}return this._preDestroy(i,e)},t.prototype._bindingDeactivationAndPreDestroyAsync=function(t,e,i){return Qd(this,void 0,void 0,(function(){return tp(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}(),np=function(t){this.id=xu(),this.registry=t};function rp(t,e,i,n){!function(t){if(void 0!==t)throw new Error(Mu)}(e),op(cu,t,i.toString(),n)}function sp(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(Au+" "+i.toString())}else e=[t];return e}function op(t,e,i,n){var r=sp(n),s={};Reflect.hasOwnMetadata(t,e)&&(s=Reflect.getMetadata(t,e));var o=s[i];if(void 0===o)o=[];else for(var a=function(t){if(r.some((function(e){return e.key===t.key})))throw new Error(Au+" "+t.key.toString())},h=0,l=o;h<l.length;h++){a(l[h])}o.push.apply(o,r),s[i]=o,Reflect.defineMetadata(t,s,e)}function ap(t){return function(e,i,n){"number"==typeof n?rp(e,i,n,t):function(t,e,i){if(void 0!==t.prototype)throw new Error(Mu);op(uu,t.constructor,e,i)}(e,i,t)}}function hp(){return function(t){if(Reflect.hasOwnMetadata(du,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(du,e,t),t}}function lp(t){return ap(new Vu(ru,t))}function cp(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 ap(new Vu(t,e))(i,n,r)}}}var up=cp(hu),dp=cp(lu);var pp,fp,gp=(pp=pu,fp="Cannot apply @postConstruct decorator multiple times in the same class",function(){return function(t,e){var i=new Vu(pp,e);if(Reflect.hasOwnMetadata(pp,t.constructor))throw new Error(fp);Reflect.defineMetadata(pp,i,t.constructor)}});function vp(t,e,i,r){var s,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var h=t.length-1;h>=0;h--)(s=t[h])&&(a=(o<3?s(a):o>3?s(e,i,a):s(e,i))||a);return o>3&&a&&Object.defineProperty(e,i,a),a}function mp(t,e){return function(i,n){e(i,n,t)}}function yp(t,e){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function bp(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(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(o,a)}h((n=n.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const xp=Symbol("ContributionProvider");class wp{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 Ap(t,e){t(xp).toDynamicValue((({container:t})=>new wp(e,t))).inSingletonScope().whenTargetNamed(e)}function Sp(t,e){t(xp).toDynamicValue((({container:t})=>new wp(e,t))).whenTargetNamed(e)}class Tp{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 Cp extends Tp{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const Bp=Symbol.for("EnvContribution"),_p=Symbol.for("VGlobal"),Pp="browser";t.DefaultGlobal=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv(Pp),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv(Pp),this.envContribution.supportEvent}get supportsTouchEvents(){return this._env||this.setEnv(Pp),this.envContribution.supportsTouchEvents}get supportsPointerEvents(){return this._env||this.setEnv(Pp),this.envContribution.supportsPointerEvents}get supportsMouseEvents(){return this._env||this.setEnv(Pp),this.envContribution.supportsMouseEvents}get applyStyles(){return this._env||this.setEnv(Pp),this.envContribution.applyStyles}constructor(t){this.contributions=t,this.hooks={onSetEnv:new Cp(["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(Pp),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv(Pp),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(Pp),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv(Pp),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv(Pp),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv(Pp),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv(Pp),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv(Pp),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv(Pp),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv(Pp),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv(Pp),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv(Pp),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv(Pp),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv(Pp),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)}isChrome(){return this._env||this.setEnv("browser"),"browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1}isSafari(){return this._env||this.setEnv("browser"),"browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}getElementTop(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}},t.DefaultGlobal=vp([hp(),mp(0,up(xp)),mp(0,lp(Bp)),yp("design:paramtypes",[Object])],t.DefaultGlobal);var Ep={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,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.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},a.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,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,r,s,o){var a=i?i+t:t;if(!this._events[a])return!1;var h,l,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,r),!0;case 5:return c.fn.call(c.context,e,n,r,s),!0;case 6:return c.fn.call(c.context,e,n,r,s,o),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,n);break;case 4:c[l].fn.call(c[l].context,e,n,r);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},a.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var h=0,l=[],c=a.length;h<c;h++)(a[h].fn!==e||r&&!a[h].once||n&&a[h].context!==n)&&l.push(a[h]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(Ep);var Mp=i(Ep.exports),kp=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},Rp=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||kp(t,"Boolean")},Op=function(t){return"function"==typeof t},Ip=function(t){return null==t},Dp=function(t){return null!=t},Lp=function(t){var e=n(t);return null!==t&&"object"===e||"function"===e},Np=function(t){return void 0===t},Up=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n(t);return e?"string"===i:"string"===i||kp(t,"String")},Wp=function(t){return Array.isArray?Array.isArray(t):kp(t,"Array")},Fp=function(t){return kp(t,"Date")},jp=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n(t);return e?"number"===i:"number"===i||kp(t,"Number")},zp=function(t){return jp(t)&&Number.isFinite(t)},Hp=function(t){return new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t)},Gp=function(t){return kp(t,"RegExp")},Vp=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)},Xp=function(t,e,i){for(var n=Up(e)?e.split("."):e,r=0;r<n.length;r++)t=t?t[n[r]]:void 0;return void 0===t?i:t},Yp=Object.prototype.hasOwnProperty,qp=function(t,e){return null!=t&&Yp.call(t,e)};function Kp(t,e){if(!Wp(t)||!Wp(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 $p=1e-10,Zp=1e-10;function Jp(t,e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$p,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zp)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}var Qp=1e-12,tf=Math.PI,ef=tf/2,nf=2*tf,rf=2*Math.PI,sf=Math.abs,of=Math.atan2,af=Math.cos,hf=Math.max,lf=Math.min,cf=Math.sin,uf=Math.sqrt,df=Math.pow;function pf(t){return t>1?0:t<-1?tf:Math.acos(t)}function ff(t){return t>=1?ef:t<=-1?-ef:Math.asin(t)}function gf(t,e,i,n,r){var s,o;return"number"==typeof t&&"number"==typeof i&&(s=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(o=(1-r)*e+r*n),{x:s,y:o}}function vf(t,e){return t[0]*e[1]-t[1]*e[0]}var mf=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 o(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 jp(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return jp(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}(),yf=function(){function t(){r(this,t)}return o(t,null,[{key:"distancePP",value:function(t,e){return uf(df(t.x-e.x,2)+df(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,i,n){return uf(df(t-i,2)+df(e-n,2))}},{key:"distancePN",value:function(t,e,i){return uf(df(e-t.x,2)+df(i-t.y,2))}},{key:"pointAtPP",value:function(t,e,i){return new mf((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}]),t}();function bf(t,e,i){var n=e.x1,r=e.y1,s=e.x2,o=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*o+i.e,i.b*s+i.d*o+i.f),t.add(i.a*n+i.c*o+i.e,i.b*n+i.d*o+i.f),e)}var xf=function(){function t(e){r(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return o(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 Wp(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 bf(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,o=this.y2,a=Math.cos(t),h=Math.sin(t),l=e-e*a+i*h,c=i-e*h-i*a;return[a*n-h*r+l,h*n+a*r+c,a*n-h*o+l,h*n+a*o+c,a*s-h*r+l,h*s+a*r+c,a*s-h*o+l,h*s+a*o+c]}},{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}(),wf=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&&l(t,e)}(i,t);var e=u(i);function i(){return r(this,i),e.apply(this,arguments)}return o(i)}(xf);var Af=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-nf;)t+=nf;else if(t>0)for(;t>nf;)t-=nf;return t};function Sf(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}var Tf,Cf,Bf,_f,Pf,Ef,Mf,kf,Rf,Of=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,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=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=o,this.f=a}return o(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,o=this.f,a=new t,h=e*r-i*n;return a.a=r/h,a.b=-i/h,a.c=-n/h,a.d=e/h,a.e=(n*o-r*s)/h,a.f=-(e*o-i*s)/h,a}},{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,o=this.b*-i+this.d*e;return this.a=n,this.b=r,this.c=s,this.d=o,this}},{key:"rotateByCenter",value:function(t,e,i){var n=Math.cos(t),r=Math.sin(t),s=(1-n)*e+r*i,o=(1-n)*i-r*e,a=n*this.a-r*this.b,h=r*this.a+n*this.b,l=n*this.c-r*this.d,c=r*this.c+n*this.d,u=n*this.e-r*this.f+s,d=r*this.e+n*this.f+o;return this.a=a,this.b=h,this.c=l,this.d=c,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 o=this.a,a=this.b,h=this.c,l=this.d,c=o*t+h*e,u=a*t+l*e,d=o*i+h*n,p=a*i+l*n,f=o*r+h*s+this.e,g=a*r+l*s+this.f;return this.a=c,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,o=this.e,a=this.f,h=i*s-n*r,l=s/h,c=-n/h,u=-r/h,d=i/h,p=(r*a-s*o)/h,f=-(i*a-n*o)/h,g=t.x,v=t.y;e.x=g*l+v*u+p,e.y=g*c+v*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 o=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),s.scaleX=o,s.scaleY=r/o,s.skewX=(t*i+e*n)/r,s.skewY=0}else if(0!==i||0!==n){var a=Math.sqrt(i*i+n*n);s.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/a):-Math.acos(i/a)),s.scaleX=r/a,s.scaleY=a,s.skewX=0,s.skewY=(t*i+e*n)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}]),t}();function If(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function Df(t,e,i,n){if(!function(t,e,i,n){var r,s=t[0],o=e[0],a=i[0],h=n[0];return o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),!(o<a||h<s||(s=t[1],o=e[1],a=i[1],h=n[1],o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),o<a||h<s))}(t,e,i,n))return!1;var r,s,o=[0,0],a=[0,0],h=[0,0];if(If(o,e,t),If(a,n,i),sf((r=o)[0]-(s=a)[0])+sf(r[1]-s[1])<1e-12)return!0;If(h,i,t);var l=vf(h,a)/vf(o,a);return l>=0&&l<=1&&[t[0]+o[0]*l,t[1]+o[1]*l]}function Lf(t,e,i){var n,r,s,o;return!(t&&e&&(i?(Tf=t.x1,Cf=t.x2,Bf=t.y1,_f=t.y2,Pf=e.x1,Ef=e.x2,Mf=e.y1,kf=e.y2,Tf>Cf&&(n=[Cf,Tf],Tf=n[0],Cf=n[1]),Bf>_f&&(r=[_f,Bf],Bf=r[0],_f=r[1]),Pf>Ef&&(s=[Ef,Pf],Pf=s[0],Ef=s[1]),Mf>kf&&(o=[kf,Mf],Mf=o[0],kf=o[1]),Tf>Ef||Cf<Pf||Bf>kf||_f<Mf):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"}(Rf||(Rf={}));var Nf=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 Uf=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(),Dp(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=Dp(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return o(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(Ip(this._canvas)&&(Dp(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),Ip(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&Dp(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),Ip(this._context)&&Dp(this._canvas)){var t=this._canvas.getContext("2d");Dp(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,o=t.fontWeight,a=void 0===o?e.fontWeight:o,h=t.fontSize,l=void 0===h?e.fontSize:h,c=t.fontFamily;return(n?n+" ":"")+(s?s+" ":"")+(a?a+" ":"")+l+"px "+((void 0===c?e.fontFamily:c)||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!Ip(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,o=s.fontStyle,a=void 0===o?r.fontStyle:o,h=s.fontVariant,l=void 0===h?r.fontVariant:h,c=s.fontWeight,u=void 0===c?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":c,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,v=s.align,m=s.textAlign,y=void 0===m?null!=v?v:"center":m,b=s.baseline,x=s.textBaseline,w=void 0===x?null!=b?b:"middle":x,A=s.ellipsis,S=s.limit,T=s.lineHeight;return{fontStyle:a,fontVariant:l,fontFamily:g,fontSize:p,fontWeight:u,textAlign:y,textBaseline:w,ellipsis:A,limit:S,lineHeight:void 0===T?p:T}}},{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(Ip(t))return{width:0,height:0};if(Ip(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);var e,i=this.textSpec,n=i.fontFamily,r=i.fontSize,s=i.fontWeight,o=i.textAlign,a=i.textBaseline,h=i.ellipsis,l=i.limit,c=i.lineHeight;try{var u=this._option.getTextBounds({text:t,fontFamily:n,fontSize:r,fontWeight:s,textAlign:o,textBaseline:a,ellipsis:!!h,maxLineWidth:l||1/0,lineHeight:c});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);Ip(s)&&t.NUMBERS_CHAR_SET.includes(r)&&(s=this._measureNumberChar()),Ip(s)&&["F","W"].includes(Nf(r))&&(s=this._measureFullSizeChar()),Ip(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 o=t[s],a=["F","W"].includes(Nf(o))?1:.53;e.width+=a*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(Ip(t))return s;if(Wp(t)){var o=t.filter(Dp).map((function(t){return t.toString()}));return 0===o.length?s:1===o.length?e(o[0]):{width:o.reduce((function(t,i){return Math.max(t,e(i).width)}),0),height:o.length*((null!=r?r:n)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(Ip(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 Ip(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(Ip(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 Dp(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){Dp(this._canvas)&&(this._canvas=null),Dp(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}]),t}();Uf.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Uf.NUMBERS_CHAR_SET="0123456789",Uf.FULL_SIZE_CHAR="字";const Wf=nf-1e-8;class Ff{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,s){if(Math.abs(r-n)>Wf)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let o,a,h,l,c=1/0,u=-1/0,d=1/0,p=-1/0;function f(t){h=i*Math.cos(t),l=i*Math.sin(t),h<c&&(c=h),h>u&&(u=h),l<d&&(d=l),l>p&&(p=l)}if(f(n),f(r),r!==n)if((n%=nf)<0&&(n+=nf),(r%=nf)<0&&(r+=nf),r<n&&(s=!s,o=n,n=r,r=o),s)for(r-=nf,o=n-n%ef,a=0;a<4&&o>r;++a,o-=ef)f(o);else for(o=n-n%ef+ef,a=0;a<4&&o<r;++a,o+=ef)f(o);this.bounds.add(t+c,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 jf{constructor(){this.curves=[],this.bounds=new wf}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const zf=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Hf={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},Gf={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Vf,Xf,Yf,qf,Kf,$f;function Zf(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(Vf=e[t],Xf=Vf.slice(1),Yf=Vf[0],i=[Yf],n=Xf.match(zf),null!==n){for(let t=0,e=n.length;t<e;t++)qf=n[t],Kf=parseFloat(qf),Number.isNaN(Kf)||i.push(Kf);if($f=Hf[Yf],i.length-1>$f){let t;for(let e=1,n=i.length;e<n;e+=$f){t=[Yf];for(let n=e,r=e+$f;n<r;n++)t.push(i[n]);r.push(t)}}else r.push(i)}else r.push(i);return r}var Jf,Qf,tg,eg,ig,ng,rg,sg;function og(t,e,i,n,r,s,o,a,h){const l=o*(Math.PI/180);const c=Math.sin(l),u=Math.cos(l),d=u*(a-t)*.5+c*(h-e)*.5,p=u*(h-e)*.5-c*(a-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,v=c/i,m=-c/n,y=u/n,b=g*a+v*h,x=m*a+y*h,w=g*t+v*e,A=m*t+y*e;let S=1/((w-b)*(w-b)+(A-x)*(A-x))-.25;S<0&&(S=0);let T=Math.sqrt(S);s===r&&(T=-T);const C=.5*(b+w)-T*(A-x),B=.5*(x+A)+T*(w-b),_=Math.atan2(x-B,b-C);let P=Math.atan2(A-B,w-C)-_;P<0&&1===s?P+=nf:P>0&&0===s&&(P-=nf);const E=Math.ceil(Math.abs(P/(ef+.001))),M=[];for(let t=0;t<E;++t){const e=_+t*P/E,r=_+(t+1)*P/E;M[t]=[C,B,e,r,i,n,c,u]}return M}function ag(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=h*s,c=-a*o,u=a*s,d=h*o,p=Math.cos(n),f=Math.sin(n),g=Math.cos(r),v=Math.sin(r),m=.5*(r-n),y=Math.sin(.5*m),b=8/3*y*y/Math.sin(m),x=e+p-b*f,w=i+f+b*p,A=e+g,S=i+v,T=A+b*v,C=S-b*g;return[l*x+c*w,u*x+d*w,l*T+c*C,u*T+d*C,l*A+c*S,u*A+d*S]}function hg(t,e,i,n){const r=og(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=ag(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(Jf=t.UpdateTag||(t.UpdateTag={}))[Jf.NONE=0]="NONE",Jf[Jf.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",Jf[Jf.UPDATE_SHAPE=2]="UPDATE_SHAPE",Jf[Jf.CLEAR_SHAPE=253]="CLEAR_SHAPE",Jf[Jf.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",Jf[Jf.INIT=179]="INIT",Jf[Jf.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",Jf[Jf.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",Jf[Jf.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",Jf[Jf.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",Jf[Jf.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",Jf[Jf.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",Jf[Jf.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",Jf[Jf.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",t.IContainPointMode=void 0,(Qf=t.IContainPointMode||(t.IContainPointMode={}))[Qf.GLOBAL=1]="GLOBAL",Qf[Qf.LOCAL=16]="LOCAL",Qf[Qf.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",Qf[Qf.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(tg=t.AttributeUpdateType||(t.AttributeUpdateType={}))[tg.INIT=0]="INIT",tg[tg.DEFAULT=1]="DEFAULT",tg[tg.STATE=2]="STATE",tg[tg.ANIMATE_BIND=10]="ANIMATE_BIND",tg[tg.ANIMATE_PLAY=11]="ANIMATE_PLAY",tg[tg.ANIMATE_START=12]="ANIMATE_START",tg[tg.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",tg[tg.ANIMATE_END=14]="ANIMATE_END",tg[tg.TRANSLATE=20]="TRANSLATE",tg[tg.TRANSLATE_TO=21]="TRANSLATE_TO",tg[tg.SCALE=22]="SCALE",tg[tg.SCALE_TO=23]="SCALE_TO",tg[tg.ROTATE=24]="ROTATE",tg[tg.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(eg=t.AnimateStatus||(t.AnimateStatus={}))[eg.INITIAL=0]="INITIAL",eg[eg.RUNNING=1]="RUNNING",eg[eg.PAUSED=2]="PAUSED",eg[eg.END=3]="END",t.AnimateMode=void 0,(ig=t.AnimateMode||(t.AnimateMode={}))[ig.NORMAL=0]="NORMAL",ig[ig.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(ng=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",ng.from="from",ng.to="to",ng.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,(rg=t.CurveTypeEnum||(t.CurveTypeEnum={}))[rg.CubicBezierCurve=0]="CubicBezierCurve",rg[rg.QuadraticBezierCurve=1]="QuadraticBezierCurve",rg[rg.ArcCurve=2]="ArcCurve",rg[rg.LineCurve=3]="LineCurve",rg[rg.EllipseCurve=4]="EllipseCurve",rg[rg.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(sg=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[sg.beforeFillStroke=0]="beforeFillStroke",sg[sg.afterFillStroke=1]="afterFillStroke";const lg=(t,e,i,n,r,s,o)=>{const a=Math.abs(i-e),h=4*Math.tan(a/4)/3,l=i<e?-1:1,c=Math.cos(e),u=Math.sin(e),d=Math.cos(i),p=Math.sin(i),f=c*s+n,g=u*o+r,v=d*s+n,m=p*o+r,y=s*h*l,b=o*h*l;t.push(f-y*u,g+b*c,v+y*p,m-b*d,v,m)},cg=[(t,e,i,n,r,s,o)=>e.arc(t[1]*r+i,t[2]*s+n,t[3]*(r+s)/2,t[4],t[5],t[6],o),(t,e,i,n,r,s,o)=>e.arcTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*(r+s)/2,o),(t,e,i,n,r,s,o)=>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,o),(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,o)=>e.lineTo(t[1]*r+i,t[2]*s+n,o),(t,e,i,n,r,s,o)=>e.moveTo(t[1]*r+i,t[2]*s+n,o),(t,e,i,n,r,s,o)=>e.quadraticCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,o),(t,e,i,n,r,s,o)=>e.rect(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,o)];function ug(t,e,i=0,n=0,r=1,s=1,o){for(let a=0;a<t.length;a++){const h=t[a];cg[h[0]](h,e,i,n,r,s,o)}}class dg{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function pg(t,e){let i=0;const n=t.length;for(let r=0;r<n;r++){const s=t[r],o=e[r],a=t[(r+1)%n],h=e[(r+1)%n];i+=yf.distanceNN(s,o,a,h)}return i/2}function fg(t,e,i,n,r){return pg([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function gg(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 vg(t,e,i,n,r){const s=gg(t.x,e.x,i.x,n.x,r),o=gg(t.y,e.y,i.y,n.y,r);return new mf(s,o)}function mg(t,e){const{p0:i,p1:n,p2:r,p3:s}=t,o=vg(i,n,r,s,e),a=yf.pointAtPP(i,n,e),h=yf.pointAtPP(n,r,e),l=yf.pointAtPP(r,s,e),c=yf.pointAtPP(a,h,e),u=yf.pointAtPP(h,l,e);return[new yg(i,a,c,o),new yg(o,u,l,s)]}class yg extends dg{constructor(e,i,n,r){super(),this.type=t.CurveTypeEnum.CubicBezierCurve,this.p0=e,this.p1=i,this.p2=n,this.p3=r}_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 vg(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?fg(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(e){return e===t.Direction.ROW?sf(this.p0.x-this.p3.x):e===t.Direction.COLUMN?sf(this.p0.y-this.p3.y):0}getAngleAt(t){const e=hf(t-.01,0),i=lf(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return of(r.y-n.y,r.x-n.x)}}function bg(t,e){const{p0:i,p1:n}=t,r=yf.pointAtPP(i,n,e);return[new xg(i,r),new xg(r,n)]}class xg extends dg{constructor(e,i){super(),this.type=t.CurveTypeEnum.LineCurve,this.p0=e,this.p1=i}getPointAt(t){if(!1!==this.defined)return yf.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=of(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()?yf.distancePP(this.p0,this.p1):60}calcProjLength(e){return e===t.Direction.ROW?sf(this.p0.x-this.p1.x):e===t.Direction.COLUMN?sf(this.p0.y-this.p1.y):0}}class wg{get endX(){return this._lastX}get endY(){return this._lastY}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,o,a){const h=new yg(new mf(this._lastX,this._lastY),new mf(t,e),new mf(i,n),new mf(r,s));h.originP1=this._lastOriginP,h.originP2=a,h.defined=o,this.curves.push(h),this._lastX=r,this._lastY=s,this._lastOriginP=a}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const r=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,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,n,r){const s=new xg(new mf(this._lastX,this._lastY),new mf(t,e));return s.originP1=n,s.originP2=r,s.defined=i,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(e){var i,n;if(e===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(i=e.p3)&&void 0!==i?i:e.p1;return sf(t.p0.y-n.y)}if(e===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return sf(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Ag extends wg{bezierCurveTo(t,e,i,n,r,s,o,a){return super.bezierCurveTo(e,t,n,i,s,r,o,a)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function Sg(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 Tg{constructor(t,e){this.context=t,e&&(this.startPoint=e)}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,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Cg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new wg("linear",null!=n?n:sf(e[e.length-1].x-e[0].x)>sf(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Bg(new Tg(s,r),e),s}function Bg(t,e){return Sg(t,e,1)}function _g(t,e,i,n,r){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,t.lastPoint1)}class Pg{constructor(t,e){this.context=t,this.startPoint=e}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)_g(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);(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,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:_g(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,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Eg(t,e){return Sg(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 Cg(e,i);const s=new wg("basis",null!=n?n:sf(e[e.length-1].x-e[0].x)>sf(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Eg(new Pg(s,r),e),s}function kg(t){return t<0?-1:1}function Rg(t,e,i){const n=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(n||Number(r<0&&-0)),o=(i-t._y1)/(r||Number(n<0&&-0)),a=(s*r+o*n)/(n+r);return(kg(s)+kg(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function Og(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Ig(t,e,i,n,r){const s=t._x0,o=t._y0,a=t._x1,h=t._y1,l=(a-s)/3;t.context.bezierCurveTo(s+l,o+l*e,a-l,h-l*i,a,h,n,t.lastPoint1)}class Dg{constructor(t,e){this.context=t,this.startPoint=e}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._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:Ig(this,this._t0,Og(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(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,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,Ig(this,Og(this,e=Rg(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Ig(this,this._t0,e=Rg(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,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}}tryUpdateLength(){return this.context.tryUpdateLength()}}class Lg extends Dg{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Ng(t,e){return Sg(t,e,2)}function Ug(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return Cg(e,i);const s=new wg("monotoneX",null!=n?n:sf(e[e.length-1].x-e[0].x)>sf(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Ng(new Dg(s,r),e),s}function Wg(t,e){return Sg(t,e,2)}function Fg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return Cg(e,i);const s=new Ag("monotoneY",null!=n?n:sf(e[e.length-1].x-e[0].x)>sf(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Wg(new Lg(s,r),e),s}let jg=class{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}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.lastPoint),(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,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function zg(e,i,n={}){const{direction:r,startPoint:s}=n;if(e.length<2-Number(!!s))return null;const o=new wg("step",null!=r?r:sf(e[e.length-1].x-e[0].x)>sf(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Hg(new jg(o,i,s),e),o}function Hg(t,e){return Sg(t,e,1)}class Gg{constructor(t,e){this.context=t,e&&(this.startPoint=e)}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,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Vg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new wg("linear",null!=n?n:sf(e[e.length-1].x-e[0].x)>sf(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Xg(new Gg(s,r),e),s}function Xg(t,e){return Sg(t,e,1)}function Yg(t,e,i){switch(e){case"linear":default:return Cg(t,i);case"basis":return Mg(t,i);case"monotoneX":return Ug(t,i);case"monotoneY":return Fg(t,i);case"step":return zg(t,.5,i);case"stepBefore":return zg(t,0,i);case"stepAfter":return zg(t,1,i);case"linearClosed":return Vg(t,i)}}class qg extends jf{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Ff(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Gf.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Gf.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Gf.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([Gf.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([Gf.AT,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}ellipse(t,e,i,n,r,s,o,a){return this.commandList.push([Gf.E,t,e,i,n,r,s,o,a]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,s,o,a),this}rect(t,e,i,n){return this.commandList.push([Gf.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([Gf.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([Gf.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[Gf.M]=t=>`M${t[1]} ${t[2]}`,t[Gf.L]=t=>`L${t[1]} ${t[2]}`,t[Gf.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Gf.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Gf.A]=t=>{const e=[];lg(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[Gf.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=Zf(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=Yg(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[Gf.M]=this.moveToTransform,t[Gf.L]=this.lineToTransform,t[Gf.Q]=this.quadraticCurveToTransform,t[Gf.C]=this.bezierCurveToTransform,t[Gf.AT]=this.arcToTransform,t[Gf.E]=this.ellipseTransform,t[Gf.R]=this.rectTransform,t[Gf.A]=this.arcTransform,t[Gf.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,o,a,h,l,c=null,u=0,d=0,p=0,f=0;for(let g=0,v=t.length;g<v;++g){switch(s=t[g],1===n&&1===r||(s=$g(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":o=u+s[5],a=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,o+e,a+i),u=o,d=a;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":o=u+s[3],a=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,o+e,a+i),p=u+s[1],f=d+s[2],u=o,d=a;break;case"S":o=s[3],a=s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,s[1]+e,s[2]+i,o+e,a+i),u=o,d=a,p=s[1],f=s[2];break;case"q":o=u+s[3],a=d+s[4],p=u+s[1],f=d+s[2],this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a;break;case"Q":o=s[3],a=s[4],this.quadraticCurveTo(s[1]+e,s[2]+i,o+e,a+i),u=o,d=a,p=s[1],f=s[2];break;case"t":o=u+s[1],a=d+s[2],null===c[0].match(/[QqTt]/)?(p=u,f=d):"t"===c[0]?(p=2*u-h,f=2*d-l):"q"===c[0]&&(p=2*u-p,f=2*d-f),h=p,l=f,this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a,p=u+s[1],f=d+s[2];break;case"T":o=s[1],a=s[2],p=2*u-p,f=2*d-f,this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a;break;case"a":hg(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":hg(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()}c=s}}_runCommandList(t,e=0,i=0,n=1,r=1){if(0!==e||0!==i||1!==n||1!==r)for(let s=0,o=t.length;s<o;++s){const o=t[s].slice();switch(o[0]){case Gf.L:this.lineToTransform(o,e,i,n,r);break;case Gf.M:this.moveToTransform(o,e,i,n,r);break;case Gf.C:this.bezierCurveToTransform(o,e,i,n,r);break;case Gf.Q:this.quadraticCurveToTransform(o,e,i,n,r);break;case Gf.A:this.arcToTransform(o,e,i,n,r);break;case Gf.E:this.ellipseTransform(o,e,i,n,r);break;case Gf.R:this.rectTransform(o,e,i,n,r);break;case Gf.AT:this.arcToTransform(o,e,i,n,r);break;case Gf.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),ug(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 sf(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 sf(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 Kg=["l",0,0,0,0,0,0,0];function $g(t,e,i){const n=Kg[0]=t[0];if("a"===n||"A"===n)Kg[1]=e*t[1],Kg[2]=i*t[2],Kg[3]=t[3],Kg[4]=t[4],Kg[5]=t[5],Kg[6]=e*t[6],Kg[7]=i*t[7];else if("h"===n||"H"===n)Kg[1]=e*t[1];else if("v"===n||"V"===n)Kg[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)Kg[n]=(n%2==1?e:i)*t[n];return Kg}const Zg={alignSelf:"auto"},Jg={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,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new Of},Qg={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},tv={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},ev=Object.assign({outerBorder:Object.assign(Object.assign({},tv),{distance:0}),innerBorder:Object.assign(Object.assign({},tv),{distance:0})},tv),iv={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,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0},nv=Object.assign(Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:0,blur:0,cursor:null,html:null},Qg),ev),Zg),rv={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},sv={_debug_bounds:!1},ov=Object.assign(Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1},sv),nv),Jg);const av=Object.assign(Object.assign({},ov),{startAngle:0,endAngle:rf,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),hv=Object.assign(Object.assign(Object.assign({},ov),rv),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),lv=Object.assign(Object.assign({},ov),{radius:1,startAngle:0,endAngle:rf}),cv=Object.assign(Object.assign({},ov),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start"}),uv=Object.assign(Object.assign({},ov),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),dv=Object.assign(Object.assign(Object.assign({},ov),rv),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),pv=Object.assign(Object.assign({},ov),{path:new qg,customPath:()=>{console.warn("空函数")}}),fv=Object.assign(Object.assign({},ov),{points:[],cornerRadius:0,closePath:!0}),gv=Object.assign(Object.assign({},ov),{width:0,height:0,strokeBoundsBuffer:0,cornerRadius:0}),vv=Object.assign(Object.assign({},ov),{width:0,height:0,cornerRadius:0,length:0}),mv=Object.assign(Object.assign({},ov),{symbolType:"circle",size:10,keepDirIn3d:!0}),yv=Object.assign(Object.assign(Object.assign({},ov),iv),{strokeBoundsBuffer:0,keepDirIn3d:!0}),bv=Object.assign(Object.assign({},ov),{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}),xv=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},ov),{fill:!0,cornerRadius:0}),wv=Object.assign(Object.assign({},xv),{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});const Av=new class{},Sv={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"}},Tv=!0,Cv=!1,Bv=/\w|\(|\)|-/,_v=/[.?!,;:/,。?!、;:]/,Pv=/\S/;function Ev(t,e,i,n,r){if(!e||e<=0)return 0;const s=Av.graphicUtil.textMeasure;let o=n,a=t.slice(0,o),h=Math.floor(s.measureText(a,i).width),l=t.slice(0,o+1),c=Math.floor(s.measureText(l,i).width);for(;h>e||c<=e;){if(h>e?o--:o++,o>t.length){o=t.length;break}if(o<0){o=0;break}a=t.slice(0,o),h=Math.floor(s.measureText(a,i).width),l=t.slice(0,o+1),c=Math.floor(s.measureText(l,i).width)}return r&&(o=Mv(t,o)),o}function Mv(t,e){let i=e;for(;Bv.test(t[i-1])&&Bv.test(t[i])||_v.test(t[i]);)if(i--,i<=0)return e;return i}function kv(t,e){const i=Av.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}let Rv=class{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=yv.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){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:iv.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.actualBoundingBoxAscent-n.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:iv.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.fontBoundingBoxAscent-n.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,n){if(0===t.length)return{verticalList:t,width:0};const{fontSize:r=12}=e;t.forEach((t=>{t.width=0===t.direction?r:this.measureTextWidth(t.text,e)}));const s=[];let o=0,a=0;for(;a<t.length&&o+t[a].width<i;a++)o+=t[a].width,s.push(t[a]);if(t[a]&&t[a].text.length>1){const r=this._clipText(t[a].text,e,i-o,0,t[a].text.length-1);if(n&&r.str!==t[a].text){let i="",n=0;for(let e=0;e<a;e++){const r=t[e];i+=r.text,n+=r.text.length}i+=t[a].text;let s=Mv(i,n+r.str.length);s-=n,s!==r.str.length-1&&(r.str=r.str.substring(0,s),r.width=this.measureTextWidth(r.str,e))}s.push(Object.assign(Object.assign({},t[a]),{text:r.str,width:r.width})),o+=r.width}return{verticalList:s,width:o}}clipText(t,e,i,n){if(0===t.length)return{str:"",width:0};let r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};if(r=this.measureTextWidth(t[0],e),r>i)return{str:"",width:0};const s=this._clipText(t,e,i,0,t.length-1);if(n&&s.str!==t){const i=Mv(t,s.str.length);i!==s.str.length&&(s.str=t.substring(0,i),s.width=this.measureTextWidth(s.str,e))}return s}_clipText(t,e,i,n,r){const s=Math.floor((n+r)/2),o=t.substring(0,s+1),a=this.measureTextWidth(o,e);let h;if(a>i){if(o.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(a<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:o,width:a}:this._clipText(t,e,i,s,r)}return{str:o,width:a}}clipTextWithSuffixVertical(t,e,i,n,r){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};const s=this.clipTextVertical(t,e,i,r);if(s.verticalList.length===t.length&&s.verticalList[s.verticalList.length-1].width===t[t.length-1].width)return s;const o=this.measureTextWidth(n,e);if(o>i)return s;i-=o;const a=this.clipTextVertical(t,e,i,r);return a.width+=o,a.verticalList.push({text:n,direction:1,width:o}),a}clipTextWithSuffix(t,e,i,n,r){if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};const s=this.measureTextWidth(t,e);if(s<=i)return{str:t,width:s};const o=this.measureTextWidth(n,e);if(o>i)return{str:"",width:0};i-=o;const a=this._clipText(t,e,i,0,t.length-1);if(r&&a.str!==t){const i=Mv(t,a.str.length);i!==a.str.length&&(a.str=t.substring(0,i),a.width=this.measureTextWidth(a.str,e))}return a.str+=n,a.width+=o,a}};Rv=vp([hp()],Rv);const Ov=Symbol.for("TextMeasureContribution");let Iv=class extends Rv{};Iv=vp([hp()],Iv);const Dv=new ip,Lv=Symbol.for("CanvasFactory"),Nv=Symbol.for("Context2dFactory");function Uv(t){return Dv.getNamed(Lv,Av.global.env)(t)}const Wv=1e-4,Fv=Math.sqrt(3),jv=1/3;function zv(t){return t>-im&&t<im}function Hv(t){return t>im||t<-im}const Gv=[0,0],Vv=[0,0],Xv=[0,0];function Yv(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function qv(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function Kv(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 $v(t){return(t%=rf)<0&&(t+=rf),t}function Zv(t,e,i,n,r,s){if(s>e&&s>n||s<e&&s<n)return 0;if(n===e)return 0;const o=(s-e)/(n-e);let a=n<e?1:-1;1!==o&&0!==o||(a=n<e?.5:-.5);const h=o*(i-t)+t;return h===r?1/0:h>r?a:0}function Jv(t,e,i,n,r,s,o,a,h){if(0===o)return!1;const l=o;if(h>e+l&&h>n+l&&h>s+l||h<e-l&&h<n-l&&h<s-l||a>t+l&&a>i+l&&a>r+l||a<t-l&&a<i-l&&a<r-l)return!1;const c=function(t,e,i,n,r,s,o,a,h){let l=0,c=.005,u=1/0;Gv[0]=o,Gv[1]=a;for(let o=0;o<1;o+=.05){Vv[0]=qv(t,i,r,o),Vv[1]=qv(e,n,s,o);const a=Yv(Gv,Vv);a<u&&(l=o,u=a)}u=1/0;for(let o=0;o<32&&!(c<Wv);o++){const o=l-c,a=l+c;Vv[0]=qv(t,i,r,o),Vv[1]=qv(e,n,s,o);const h=Yv(Vv,Gv);if(o>=0&&h<u)l=o,u=h;else{Xv[0]=qv(t,i,r,a),Xv[1]=qv(e,n,s,a);const o=Yv(Xv,Gv);a<=1&&o<u?(l=a,u=o):c*=.5}}return h&&(h[0]=qv(t,i,r,l),h[1]=qv(e,n,s,l)),Math.sqrt(u)}(t,e,i,n,r,s,a,h,null);return c<=l/2}function Qv(t,e,i,n,r,s,o,a,h,l,c){if(0===h)return!1;const u=h;if(c>e+u&&c>n+u&&c>s+u&&c>a+u||c<e-u&&c<n-u&&c<s-u&&c<a-u||l>t+u&&l>i+u&&l>r+u&&l>o+u||l<t-u&&l<i-u&&l<r-u&&l<o-u)return!1;const d=function(t,e,i,n,r,s,o,a,h,l,c){let u,d,p,f,g=0,v=.005,m=1/0;Gv[0]=h,Gv[1]=l;for(let h=0;h<1;h+=.05)Vv[0]=Kv(t,i,r,o,h),Vv[1]=Kv(e,n,s,a,h),p=Yv(Gv,Vv),p<m&&(g=h,m=p);m=1/0;for(let h=0;h<32&&!(v<Wv);h++)u=g-v,d=g+v,Vv[0]=Kv(t,i,r,o,u),Vv[1]=Kv(e,n,s,a,u),p=Yv(Vv,Gv),u>=0&&p<m?(g=u,m=p):(Xv[0]=Kv(t,i,r,o,d),Xv[1]=Kv(e,n,s,a,d),f=Yv(Xv,Gv),d<=1&&f<m?(g=d,m=f):v*=.5);return c&&(c[0]=Kv(t,i,r,o,g),c[1]=Kv(e,n,s,a,g)),Math.sqrt(m)}(t,e,i,n,r,s,o,a,l,c,null);return d<=u/2}function tm(t,e,i,n,r,s,o,a,h){if(0===o)return!1;const l=o;a-=t,h-=e;const c=Math.sqrt(a*a+h*h);if(c-l>i||c+l<i)return!1;if(Math.abs(n-r)%rf<1e-4)return!0;if(s){const t=n;n=$v(r),r=$v(t)}else n=$v(n),r=$v(r);n>r&&(r+=rf);let u=Math.atan2(h,a);return u<0&&(u+=rf),u>=n&&u<=r||u+rf>=n&&u+rf<=r}function em(t,e,i,n,r,s,o){if(0===r)return!1;const a=r,h=r/2;let l=0,c=t;if(o>e+h&&o>n+h||o<e-h&&o<n-h||s>t+h&&s>i+h||s<t-h&&s<i-h)return!1;if(t===i)return Math.abs(s-t)<=a/2;l=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=l*s-o+c;return u*u/(l*l+1)<=a/2*a/2}const im=1e-4;function nm(t,e,i,n,r){const s=6*i-12*e+6*t,o=9*e+3*n-3*t-9*i,a=3*e-3*t;let h=0;if(zv(o)){if(Hv(s)){const t=-a/s;t>=0&&t<=1&&(r[h++]=t)}}else{const t=s*s-4*o*a;if(zv(t))r[0]=-s/(2*o);else if(t>0){const e=Math.sqrt(t),i=(-s+e)/(2*o),n=(-s-e)/(2*o);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}const rm=[-1,-1,-1],sm=[-1,-1];function om(){const t=sm[0];sm[0]=sm[1],sm[1]=t}function am(t,e,i,n,r,s,o,a,h,l){if(l>e&&l>n&&l>s&&l>a||l<e&&l<n&&l<s&&l<a)return 0;const c=function(t,e,i,n,r,s){const o=n+3*(e-i)-t,a=3*(i-2*e+t),h=3*(e-t),l=t-r,c=a*a-3*o*h,u=a*h-9*o*l,d=h*h-3*a*l;let p=0;if(zv(c)&&zv(u))if(zv(a))s[0]=0;else{const t=-h/a;t>=0&&t<=1&&(s[p++]=t)}else{const t=u*u-4*c*d;if(zv(t)){const t=u/c,e=-a/o+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=c*a+1.5*o*(-u+e),n=c*a+1.5*o*(-u-e);i=i<0?-Math.pow(-i,jv):Math.pow(i,jv),n=n<0?-Math.pow(-n,jv):Math.pow(n,jv);const r=(-a-(i+n))/(3*o);r>=0&&r<=1&&(s[p++]=r)}else{const t=(2*c*a-3*o*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),r=(-a-2*i*n)/(3*o),h=(-a+i*(n+Fv*Math.sin(e)))/(3*o),l=(-a+i*(n-Fv*Math.sin(e)))/(3*o);r>=0&&r<=1&&(s[p++]=r),h>=0&&h<=1&&(s[p++]=h),l>=0&&l<=1&&(s[p++]=l)}}return p}(e,n,s,a,l,rm);if(0===c)return 0;let u=0,d=-1,p=0,f=0;for(let l=0;l<c;l++){const c=rm[l],g=0===c||1===c?.5:1;Kv(t,i,r,o,c)<h||(d<0&&(d=nm(e,n,s,a,sm),sm[1]<sm[0]&&d>1&&om(),p=Kv(e,n,s,a,sm[0]),d>1&&(f=Kv(e,n,s,a,sm[1]))),2===d?c<sm[0]?u+=p<e?g:-g:c<sm[1]?u+=f<p?g:-g:u+=a<f?g:-g:c<sm[0]?u+=p<e?g:-g:u+=a<p?g:-g)}return u}function hm(t,e,i,n,r,s,o,a){if(a>e&&a>n&&a>s||a<e&&a<n&&a<s)return 0;const h=function(t,e,i,n,r){const s=t-2*e+i,o=2*(e-t),a=t-n;let h=0;if(zv(s)){if(Hv(o)){const t=-a/o;t>=0&&t<=1&&(r[h++]=t)}}else{const t=o*o-4*s*a;if(zv(t)){const t=-o/(2*s);t>=0&&t<=1&&(r[h++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-o+e)/(2*s),n=(-o-e)/(2*s);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}(e,n,s,a,rm);if(0===h)return 0;const l=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,s);if(l>=0&&l<=1){let a=0;const c=qv(e,n,s,l);for(let n=0;n<h;n++){const h=0===rm[n]||1===rm[n]?.5:1;qv(t,i,r,rm[n])<o||(rm[n]<l?a+=c<e?h:-h:a+=s<c?h:-h)}return a}const c=0===rm[0]||1===rm[0]?.5:1;return qv(t,i,r,rm[0])<o?0:s<e?c:-c}function lm(t,e,i,n,r,s,o,a){if((a-=e)>i||a<-i)return 0;const h=Math.sqrt(i*i-a*a);rm[0]=-h,rm[1]=h;const l=Math.abs(n-r);if(l<1e-4)return 0;if(l>=rf-1e-4){n=0,r=rf;const e=s?1:-1;return o>=rm[0]+t&&o<=rm[1]+t?e:0}if(n>r){const t=n;n=r,r=t}n<0&&(n+=rf,r+=rf);let c=0;for(let e=0;e<2;e++){const i=rm[e];if(i+t>o){let t=Math.atan2(a,i),e=s?1:-1;t<0&&(t=rf+t),(t>=n&&t<=r||t+rf>=n&&t+rf<=r)&&(t>tf/2&&t<1.5*tf&&(e=-e),c+=e)}}return c}function cm(t){return Math.round(t/tf*1e8)/1e8%2*tf}function um(t,e){let i=cm(t[0]);i<0&&(i+=rf);const n=i-t[0];let r=t[1];r+=n,!e&&r-i>=rf?r=i+rf:e&&i-r>=rf?r=i-rf:!e&&i>r?r=i+(rf-cm(i-r)):e&&i<r&&(r=i-(rf-cm(r-i))),t[0]=i,t[1]=r}const dm=[0,0];function pm(t,e,i,n,r){const s=t,o=t.length;let a,h,l=0,c=0,u=0,d=0,p=0;for(let t=0;t<o;t++){const o=s[t],f=0===t;o[0]===Gf.M&&t>1&&(i||(l+=Zv(c,u,d,p,n,r))),f&&(c=o[1],u=o[2],d=c,p=u);const g=o[0],v=o[1],m=o[2],y=o[3],b=o[4],x=o[5],w=o[6];let A=b,S=x;dm[0]=A,dm[1]=S,um(dm,Boolean(o[6])),A=dm[0],S=dm[1];const T=A,C=S-A,B=!!(1-(o[6]?0:1)),_=(n-v)*y/y+v;switch(g){case Gf.M:d=v,p=m,c=d,u=p;break;case Gf.L:if(i){if(em(c,u,v,m,e,n,r))return!0}else l+=Zv(c,u,v,m,n,r)||0;c=v,u=m;break;case Gf.C:if(i){if(Qv(c,u,v,m,y,b,x,w,e,n,r))return!0}else l+=am(c,u,v,m,y,b,x,w,n,r)||0;c=x,u=w;break;case Gf.Q:if(i){if(Jv(c,u,v,m,y,b,e,n,r))return!0}else l+=hm(c,u,v,m,y,b,n,r)||0;c=y,u=b;break;case Gf.A:if(a=Math.cos(T)*y+v,h=Math.sin(T)*y+m,f?(d=a,p=h):l+=Zv(c,u,a,h,n,r),i){if(tm(v,m,y,T,T+C,B,e,_,r))return!0}else l+=lm(v,m,y,T,T+C,B,_,r);c=Math.cos(T+C)*y+v,u=Math.sin(T+C)*y+m;break;case Gf.R:if(d=c=v,p=u=m,a=d+y,h=p+b,i){if(em(d,p,a,p,e,n,r)||em(a,p,a,h,e,n,r)||em(a,h,d,h,e,n,r)||em(d,h,d,p,e,n,r))return!0}else l+=Zv(a,p,a,h,n,r),l+=Zv(d,h,d,p,n,r);break;case Gf.Z:if(i){if(em(c,u,d,p,e,n,r))return!0}else l+=Zv(c,u,d,p,n,r);c=d,u=p}}var f,g;return i||(f=u,g=p,Math.abs(f-g)<im)||(l+=Zv(c,u,d,p,n,r)||0),0!==l}var fm;t.DefaultGraphicUtil=class{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=Uv({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"){var n;this.configure(this.global,this.global.env);const r=this.global.measureTextMethod;this.global.measureTextMethod=i;const s={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:iv.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new Uf(Object.assign({defaultFontParams:{fontFamily:iv.fontFamily,fontSize:iv.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Uf.ALPHABET_CHAR_SET+Uf.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}},t.DefaultGraphicUtil=vp([hp(),mp(0,up(xp)),mp(0,lp(Ov)),mp(1,up(_p)),yp("design:paramtypes",[Object,Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(fm||(fm={}));const gm=new Of;t.DefaultTransformUtil=class{constructor(){this.matrix=new Of}init(t){return this.mode=fm.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=fm.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(gm.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(gm.a,gm.b,gm.c,gm.d,gm.e,gm.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(gm.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:n}=e;this.outTargetMatrix.translate(i,n),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-n)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(gm.a,gm.b,gm.c,gm.d,gm.e,gm.f),this}scale(t,e,i){return this.mode===fm.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===fm.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return gm.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(gm.a,gm.b,gm.c,gm.d,gm.e,gm.f),this}translate(t,e){return this.mode===fm.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===fm.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=vp([hp(),yp("design:paramtypes",[])],t.DefaultTransformUtil);const vm={arc:av,area:hv,circle:lv,line:dv,path:pv,symbol:mv,text:yv,rect:gv,rect3d:vv,polygon:fv,richtext:bv,richtextIcon:wv,image:xv,group:cv,glyph:uv},mm=Object.keys(vm);function ym(){return{arc:Object.assign({},vm.arc),area:Object.assign({},vm.area),circle:Object.assign({},vm.circle),line:Object.assign({},vm.line),path:Object.assign({},vm.path),symbol:Object.assign({},vm.symbol),text:Object.assign({},vm.text),rect:Object.assign({},vm.rect),rect3d:Object.assign({},vm.rect3d),polygon:Object.assign({},vm.polygon),richtext:Object.assign({},vm.richtext),richtextIcon:Object.assign({},vm.richtextIcon),image:Object.assign({},vm.image),group:Object.assign({},vm.group),glyph:Object.assign({},vm.glyph)}}function bm(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 xm=new Array(60).fill(0).map((()=>ym()));class wm{constructor(){this._defaultTheme=xm.pop()||ym(),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 r=this.getParentWithTheme(t);if(r){const t=r.theme;(t.dirty||i)&&t.applyTheme(r,e,!0),this.userTheme?bm(this.userTheme,t.userTheme,!1):this.userTheme=function(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=[],o=[];return void 0===e&&(e=!0),void 0===i&&(i=1/0),function t(i,a){if(null===i)return null;if(0===a)return i;var h,l,c;if("object"!=n(i))return i;if(Wp(i)?h=[]:Gp(i)?(h=new RegExp(i.source,(c="",(l=i).global&&(c+="g"),l.ignoreCase&&(c+="i"),l.multiline&&(c+="m"),c)),i.lastIndex&&(h.lastIndex=i.lastIndex)):h=Fp(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 o[u];s.push(i),o.push(h)}for(var d in i)h[d]=t(i[d],a-1);return h}(t,i)}(t.userTheme),bm(e,t.userTheme)}this.userTheme?this.doCombine(e):(r?this.combinedTheme=r.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);mm.forEach((r=>{var o,a;e[r]||s||t[r]?n[r]=Object.assign({},i[r],null!=s?s:{},null!==(o=t[r])&&void 0!==o?o:{},null!==(a=e[r])&&void 0!==a?a:{}):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 Am=new wm;function Sm(t,e){return t.glyphHost?Sm(t.glyphHost):e?(t.isContainer,e):Tm(t)||Am.getTheme()}function Tm(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)):Am.getTheme()}return null}class Cm{static GenAutoIncrementId(){return Cm.auto_increment_id++}}Cm.auto_increment_id=0;class Bm extends Mp{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=Cm.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}}}forEachChildrenAsync(t,e=!1){return bp(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&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(;null==t?void 0: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=Rp(i,!0)&&i||Lp(i)&&i.capture,r=Lp(i)&&i.once,s=Op(e)?void 0:e;return t=n?`${t}capture`:t,e=Op(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=Rp(i,!0)&&i||Lp(i)&&i.capture,r=Op(e)?void 0:e;t=n?`${t}capture`:t,e=Op(e)?e:e.handleEvent;const s=Lp(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 Lp(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 _m{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=_m.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new mf,this.page=new mf,this.canvas=new mf,this.viewport=new mf,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,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.")}}class Pm extends _m{constructor(){super(...arguments),this.client=new mf,this.movement=new mf,this.offset=new mf,this.global=new mf,this.screen=new mf}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}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,o,a,h,l,c,u,d,p,f){throw new Error("Method not implemented.")}}class Em extends Pm{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const n=new Em(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice(),n.type=this.type,n}}class Mm extends Pm{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const n=new Mm(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice(),n.type=this.type,n}}Mm.DOM_DELTA_PIXEL=0,Mm.DOM_DELTA_LINE=1,Mm.DOM_DELTA_PAGE=2;class km extends _m{constructor(t,e){super(),this.type=t,this.detail=e}}const Rm="object"==typeof performance&&performance.now?performance:Date;function Om(t){return"mouse"===t||"pen"===t}class Im{constructor(t){this.dispatch=new Mp,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof Em))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(Om(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)},this.onPointerMove=(t,e)=>{var i,n;if(!(t instanceof Em))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.createPointerEvent(t,t.type,e),s=Om(r.pointerType),o=this.trackingData(t.pointerId),a=this.findMountedTarget(o.overTargets);if(o.overTargets&&a&&a!==this.rootTarget&&a!==r.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,a||void 0);if(this.dispatchEvent(i,"pointerout"),s&&this.dispatchEvent(i,"mouseout"),!r.composedPath().includes(a)){const e=this.createPointerEvent(t,"pointerleave",a||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!r.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),s&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(a!==r.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(r,e);this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover");let n=null==a?void 0:a.parent;for(;n&&n!==this.rootTarget.parent&&n!==r.target;)n=n.parent;if(!n||n===this.rootTarget.parent){const t=this.clonePointerEvent(r,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==a&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(i)}const h="dispatchEvent";this[h](r,"pointermove"),"touch"===r.pointerType&&this[h](r,"touchmove"),s&&(this[h](r,"mousemove"),this.cursor=(null===(n=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor()),o.overTargets=r.composedPath(),this.freeEvent(r)},this.onPointerOver=(t,e)=>{var i,n;if(!(t instanceof Em))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(t.pointerId),s=this.createPointerEvent(t,t.type,e),o=Om(s.pointerType);this.dispatchEvent(s,"pointerover"),o&&this.dispatchEvent(s,"mouseover"),"mouse"===s.pointerType&&(this.cursor=(null===(n=null===(i=s.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor());const a=this.clonePointerEvent(s,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),o&&this.notifyTarget(a,"mouseenter"),a.target=a.target.parent;r.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(a)},this.onPointerOut=(t,e)=>{if(!(t instanceof Em))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=Om(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=""},this.onPointerUp=(t,e)=>{if(!(t instanceof Em))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=Rm.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(Om(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 o=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(Om(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(n,"click");e.target=o,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,Om(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)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof Em))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"):Om(r.pointerType)&&this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)},this.onWheel=(t,e)=>{if(!(t instanceof Mm))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)},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){var e,i,n,r,s;if(!this.rootTarget)return;const o=this.mappingTable[t.type];let a;const h=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[h])&&(null===(n=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[h])||void 0===n?void 0:n.stage.renderCount)===(null===(r=this._prePointTargetCache)||void 0===r?void 0:r.stageRenderCount)?a=this._prePointTargetCache[h]:(a=this.pickTarget(t.canvasX,t.canvasY,t),t.pickParams||(this._prePointTargetCache={[h]:a,stageRenderCount:null!==(s=null==a?void 0:a.stage.renderCount)&&void 0!==s?s:-1})),o)for(let e=0,i=o.length;e<i;e++)o[e].fn(t,a);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=null!=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)}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(Em);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,n),"string"==typeof e&&(n.type=e),n}createWheelEvent(t,e){const i=this.allocateEvent(Mm);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),i}clonePointerEvent(t,e){const i=this.allocateEvent(Em);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=null!=e?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 Em&&e instanceof Em&&(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 Pm&&e instanceof Pm&&(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=Rm.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),e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||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);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,i){let n;const r=this.rootTarget.pick(t,e);return n=r&&r.graphic?r.graphic:r&&r.group?r.group:t>=0&&t<=Xp(this.rootTarget,"width")&&e>=0&&e<=Xp(this.rootTarget,"height")?this.rootTarget:null,i&&(i.pickParams=r.params),n}}const Dm={pickable:!0,visible:!0,dispatchEvent(t){var e;if(!(t instanceof _m))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new km(t,e))}},Lm={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Nm{constructor(t){this.resolution=1,this.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)},this.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)},this.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)},this.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)},this.onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:n,global:r,viewport:s,autoPreventDefault:o=!1}=t;this.manager=new Im(n),this.globalObj=r,this.supportsPointerEvents=r.supportsPointerEvents,this.supportsTouchEvents=r.supportsTouchEvents,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=o,this.eventsAdded=!1,this.viewport=s,this.rootPointerEvent=new Em,this.rootWheelEvent=new Mm,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&&Up(t)&&!qp(this.cursorStyles,t)&&(i.style.cursor=t)}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){var e;const i=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(i)return i;const{clientX:n,clientY:r}=t,s=this.domElement.getBoundingClientRect();return{x:n-s.left,y:r-s.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];Np(n.button)&&(n.button=0),Np(n.buttons)&&(n.buttons=1),Np(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),Np(n.width)&&(n.width=n.radiusX||1),Np(n.height)&&(n.height=n.radiusY||1),Np(n.tiltX)&&(n.tiltX=0),Np(n.tiltY)&&(n.tiltY=0),Np(n.pointerType)&&(n.pointerType="touch"),Np(n.pointerId)&&(n.pointerId=n.identifier||0),Np(n.pressure)&&(n.pressure=n.force||.5),Np(n.twist)&&(n.twist=0),Np(n.tangentialPressure)&&(n.tangentialPressure=0),Np(n.layerX)&&(n.layerX=n.offsetX=n.clientX),Np(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;Np(i.isPrimary)&&(i.isPrimary=!0),Np(i.width)&&(i.width=1),Np(i.height)&&(i.height=1),Np(i.tiltX)&&(i.tiltX=0),Np(i.tiltY)&&(i.tiltY=0),Np(i.pointerType)&&(i.pointerType="mouse"),Np(i.pointerId)&&(i.pointerId=1),Np(i.pressure)&&(i.pressure=.5),Np(i.twist)&&(i.twist=0),Np(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=Lm[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Rm.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 Um=(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"},Wm=(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 Fm{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return Fm.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 jm{static Avaliable(){return!0}avaliable(){return jm.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 zm{static Avaliable(){return!!Av.global.getRequestAnimationFrame()}avaliable(){return zm.Avaliable()}tick(t,e){Av.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var Hm;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Hm||(Hm={}));class Gm{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===Hm.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=Hm.INITIAL,Av.global.hooks.onSetEnv.tap("window",(()=>{this.initHandler()})),Av.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:zm},{mode:"timeout",cons:jm},{mode:"manual",cons:Fm}];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 zm;break;case"timeout":t=new jm;break;case"manual":t=new Fm;break;default:console.warn("非法的计时器模式"),t=new zm}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!==Hm.INITIAL&&(this.status=Hm.PAUSE,!0)}resume(){return this.status!==Hm.INITIAL&&(this.status=Hm.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===Hm.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Hm.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=Hm.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=Hm.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class Vm{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 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 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-Vm.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Vm.bounceIn(2*t):.5*Vm.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/rf*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*rf/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/rf*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*rf/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/rf*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*rf/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*rf/e)*.5+1}}}Vm.quadIn=Vm.getPowIn(2),Vm.quadOut=Vm.getPowOut(2),Vm.quadInOut=Vm.getPowInOut(2),Vm.cubicIn=Vm.getPowIn(3),Vm.cubicOut=Vm.getPowOut(3),Vm.cubicInOut=Vm.getPowInOut(3),Vm.quartIn=Vm.getPowIn(4),Vm.quartOut=Vm.getPowOut(4),Vm.quartInOut=Vm.getPowInOut(4),Vm.quintIn=Vm.getPowIn(5),Vm.quintOut=Vm.getPowOut(5),Vm.quintInOut=Vm.getPowInOut(5),Vm.backIn=Vm.getBackIn(1.7),Vm.backOut=Vm.getBackOut(1.7),Vm.backInOut=Vm.getBackInOut(1.7),Vm.elasticIn=Vm.getElasticIn(1,.3),Vm.elasticOut=Vm.getElasticOut(1,.3),Vm.elasticInOut=Vm.getElasticInOut(1,.3*1.5);class Xm{constructor(){this.id=Cm.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,e=!0){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),e&&t.release()}}const Ym=new Xm;class qm{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(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class Km extends qm{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class $m{constructor(e=Cm.GenAutoIncrementId(),i=Ym){this.id=e,this.timeline=i,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new Zm(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.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=hf(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){$m.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=$m.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 Km((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const o=$m.interpolateMap.get(t)||$m.interpolateMap.get("");return!!o&&o(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 Zm(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()}}$m.mode=t.AnimateMode.NORMAL,$m.interpolateMap=new Map;class Zm{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 Jm(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?Vm[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?Vm[n]:n,o=this._addStep(i,null,s);return o.type=t.AnimateStepType.to,this._appendProps(e,o,!!r&&r.tempProps),o.propKeys||(o.propKeys=Object.keys(o.props)),r&&r.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(o.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(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.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 Jm(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){var e;const i=this.duration,n=this.loop,r=this.rawPosition;let s,o,a=!1;const h=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,i<=0)return a=!0,a;if(s=Math.floor(t/i),o=t-s*i,a=t>=n*i+i,a&&(o=i,s=n,t=o*s+i),t===r)return a;const l=!this.reversed!=!(this.bounce&&s%2);return l&&(o=i-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+h,this.updatePosition(a,l),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 o=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(o=i.easing(o)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,o,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,o)))}}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 Jm{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 Qm={duration:200,easing:"cubicOut"},ty={duration:1e3,easing:"quadInOut"};var ey;t.Edge=void 0,(ey=t.Edge||(t.Edge={}))[ey.Top=1]="Top",ey[ey.Right=2]="Right",ey[ey.Bottom=4]="Bottom",ey[ey.Left=8]="Left",ey[ey.ALL=15]="ALL";const iy=[!1,!1,!1,!1],ny=t=>{var e;let i=!0;if(Rp(t,!0)){for(let n=0;n<4;n++)iy[n]=t,i&&(i=!(null!==(e=iy[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)iy[e]=!!t[e],i&&(i=!!iy[e]);else iy[0]=!1,iy[1]=!1,iy[2]=!1,iy[3]=!1;return{isFullStroke:i,stroke:iy}},ry=[0,0,0,0],sy=t=>t?Wp(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(ry[0]=t[0],ry[2]=t[0],ry[1]=t[1],ry[3]=t[1],ry):t:t:0,oy=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],ay=[1,2,3,0,1,2,3,0];function hy(t,e,i,n){for(;t>=rf;)t-=rf;for(;t<0;)t+=rf;for(;t>e;)e+=rf;oy[0].x=i,oy[1].y=i,oy[2].x=-i,oy[3].y=-i;const r=Math.ceil(t/ef)%4,s=Math.ceil(e/ef)%4;if(n.add(af(t)*i,cf(t)*i),n.add(af(e)*i,cf(e)*i),r!==s||e-t>tf){let t=!1;for(let e=0;e<ay.length;e++)if(t||r!==ay[e]){if(t&&s===ay[e])break;if(t){const t=oy[ay[e]];n.add(t.x,t.y)}}else{t=!0;const e=oy[r];n.add(e.x,e.y)}}}function ly(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function cy(t,e,i){const{x:n,y:r}=gf(t.x,t.y,e.x,e.y,i),{x:s,y:o}=gf(t.x1,t.y1,e.x1,e.y1,i),a=new mf(n,r,s,o);return a.defined=e.defined,a}function uy(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 mf(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)n[r]=cy(t[r],e[r],i)}else{n=e.map((t=>{const e=new mf(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)n[r]=cy(t[r],e[r],i)}return n}const dy=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],py=t=>dy.includes(t);function fy(t,e){if(Wp(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}class gy{constructor(){this.durations=[],this.timeout=gy.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)}}gy.TimeOut=1e3/60;const vy=new gy;var my;!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"}(my||(my={}));class yy extends qm{constructor(t,e,i,n,r){super(null,null,i,n,r),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==r?void 0:r.group,this._clipGraphic=null==r?void 0: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 by(t,e,i,n,r,s){const o=(e-t)*r+t,a=(i-e)*r+e,h=(n-i)*r+i,l=(a-o)*r+o,c=(h-a)*r+a,u=(c-l)*r+l;s[0]=t,s[1]=o,s[2]=l,s[3]=u,s[4]=u,s[5]=c,s[6]=h,s[7]=n}function xy(t,e){const i=t.length,n=e.length;if(i===n)return[t,e];const r=[],s=[],o=i<n?t:e,a=Math.min(i,n),h=Math.abs(n-i)/6,l=(a-2)/6,c=Math.ceil(h/l),u=[o[0],o[1]];let d=h;for(let t=2;t<a;t+=6){let e=o[t-2],i=o[t-1],n=o[t],a=o[t+1],h=o[t+2],l=o[t+3];const p=o[t+4],f=o[t+5];if(d<=0){u.push(n,a,h,l,p,f);continue}const g=Math.min(d,c)+1;for(let t=1;t<=g;t++){const o=t/g;by(e,n,h,p,o,r),by(i,a,l,f,o,s),e=r[3],i=s[3],u.push(r[1],s[1],r[2],s[2],e,i),n=r[5],a=s[5],h=r[6],l=s[6]}d-=g-1}return o===t?[u,e]:[t,u]}function wy(t,e){const i=t||e,n=i.length,r=i[n-2],s=i[n-1],o=[];for(let t=0;t<e.length;t+=2)o[t]=r,o[t+1]=s;return o}function Ay(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 Sy(t){let e=0,i=0,n=0;const r=t.length;for(let s=0,o=r-2;s<r;o=s,s+=2){const r=t[o],a=t[o+1],h=t[s],l=t[s+1],c=r*l-h*a;e+=c,i+=(r+h)*c,n+=(a+l)*c}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,n/e/3,e]}function Ty(t,e,i,n){const r=(t.length-2)/6;let s=1/0,o=0;const a=t.length,h=a-2;for(let l=0;l<r;l++){const r=6*l;let c=0;for(let s=0;s<a;s+=2){const o=0===s?r:(r+s-2)%h+2,a=t[o]-i[0],l=t[o+1]-i[1],u=e[s]-n[0]-a,d=e[s+1]-n[1]-l;c+=u*u+d*d}c<s&&(s=c,o=l)}return o}function Cy(t,e,i,n){const r=[];let s;for(let o=0;o<t.length;o++){let a=t[o];const h=e[o],l=Sy(a),c=Sy(h);null==s&&(s=l[2]<0!=c[2]<0);const u=[],d=[];let p=0,f=1/0;const g=[],v=a.length;s&&(a=Ay(a));const m=6*Ty(a,h,l,c),y=v-2;for(let t=0;t<y;t+=2){const e=(m+t)%y+2;u[t+2]=a[e]-l[0],u[t+3]=a[e+1]-l[1]}if(u[0]=a[m]-l[0],u[1]=a[m+1]-l[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<a.length;e+=2){const r=u[e],s=u[e+1],o=h[e]-c[0],a=h[e+1]-c[1],l=o*i-a*t,d=o*t+a*i;g[e]=l,g[e+1]=d;const p=l-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<v;t+=2)d[t]=h[t]-c[0],d[t+1]=h[t+1]-c[1];r.push({from:u,to:d,fromCp:l,toCp:c,rotation:-p})}return r}function By(t,e){let i,n;const r=[],s=[];for(let o=0;o<Math.max(t.length,e.length);o++){const a=t[o],h=e[o];let l,c;a?h?([l,c]=xy(a,h),i=l,n=c):(c=wy(n,a),l=a):(l=wy(i,h),c=h),r.push(l),s.push(c)}return[r,s]}const _y=(t,e,i,n,r)=>{Jp(e,n)&&Jp(i,r)||t.push(e,i,n,r,n,r)};function Py(t){const e=t.commandList,i=[];let n,r=0,s=0,o=0,a=0;const h=(t,e)=>{n&&n.length>2&&i.push(n),n=[t,e]};let l,c,u,d;for(let t=0,i=e.length;t<i;t++){const i=e[t],p=0===t;switch(p&&(o=r=i[1],a=s=i[2],[Gf.L,Gf.C,Gf.Q].includes(i[0])&&(n=[o,a])),i[0]){case Gf.M:r=o=i[1],s=a=i[2],h(o,a);break;case Gf.L:l=i[1],c=i[2],_y(n,r,s,l,c),r=l,s=c;break;case Gf.C:n.push(i[1],i[2],i[3],i[4],r=i[5],s=i[6]);break;case Gf.Q:l=i[1],c=i[2],u=i[3],d=i[4],n.push(r+2/3*(l-r),s+2/3*(c-s),u+2/3*(l-u),d+2/3*(c-d),u,d),r=u,s=d;break;case Gf.A:{const t=i[1],e=i[2],u=i[3],d=u,f=i[4],g=i[5],v=!!i[6];l=Math.cos(f)*u+t,c=Math.sin(f)*u+e,p?(o=l,a=c,h(o,a)):_y(n,r,s,l,c),r=Math.cos(g)*u+t,s=Math.sin(g)*u+e;const m=(v?-1:1)*Math.PI/2;for(let i=f;v?i>g:i<g;i+=m){const r=v?Math.max(i+m,g):Math.min(i+m,g);lg(n,i,r,t,e,u,d)}break}case Gf.E:{const t=i[1],e=i[2],u=i[3],d=i[4],f=i[5],g=i[6],v=i[7]+g,m=!!i[8],y=!Jp(f,0),b=Math.cos(f),x=Math.sin(f);let w=Math.cos(g)*u,A=Math.sin(g)*d;y?(l=w*b-A*x+t,c=w*x+A*b+e):(l=w+t,c=A+e),p?(o=l,a=c,h(o,a)):_y(n,r,s,l,c),w=Math.cos(v)*u,A=Math.sin(v)*d,y?(r=w*b-A*x+t,s=w*x+A*b+e):(r=w+t,s=A+e);const S=(m?-1:1)*Math.PI/2;for(let i=g;m?i>v:i<v;i+=S){const r=m?Math.max(i+S,v):Math.min(i+S,v);if(lg(n,i,r,t,e,u,d),y){const i=n.length;for(let r=i-6;r<=i-1;r+=2)w=n[r],A=n[r+1],n[r]=(w-t)*b-(A-e)*x+t,n[r+1]=(w-t)*x+(A-e)*b+e}}break}case Gf.R:o=r=i[1],a=s=i[2],l=o+i[3],c=a+i[4],h(l,a),_y(n,l,a,l,c),_y(n,l,c,o,c),_y(n,o,c,o,a),_y(n,o,a,l,a);break;case Gf.AT:{const t=i[1],e=i[2],h=i[3],l=i[4],c=i[5],u=yf.distancePP({x:r,y:s},{x:t,y:e}),d=yf.distancePP({x:h,y:l},{x:t,y:e}),p=((r-t)*(h-t)+(s-e)*(l-e))/(u*d),f=c/Math.sin(p/2),g=(r+h-2*t)/2,v=(s+l-2*e)/2,m=yf.distancePP({x:g,y:v},{x:0,y:0}),y=t+f*g/m,b=h+f*v/m,x=Math.sqrt(f*f-c*c);o=t+x*(r-t)/u,a=e+x*(s-e)/u,_y(n,r,s,o,a),r=t+x*(h-t)/d,s=e+x*(l-e)/d;const w=Sf({x:y,y:b},{x:o,y:a}),A=Sf({x:y,y:b},{x:r,y:s});lg(n,w,A,y,b,c,c);break}case Gf.Z:n&&_y(n,r,s,o,a),r=o,s=a}}return n&&n.length>2&&i.push(n),i}function Ey(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 My(t){const e=new qg;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 ky(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 o=[];for(let t=0;t<r;t++)o.push(s);const a=i-r*s;if(a>0)for(let t=0;t<a;t+=s)t+s<a?o.push(s):o.push(a-t);return o}const Ry=(t,e)=>{const i=t.getComputedAttribute("width"),n=t.getComputedAttribute("height"),r=ky(i,n,e),s=[],o=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*o,width:n,height:o})}return s},Oy=(t,e)=>{const i=t.getParsedAngle(),n=i.startAngle,r=i.endAngle,s=t.getComputedAttribute("innerRadius"),o=t.getComputedAttribute("outerRadius"),a=Math.abs(n-r),h=Math.abs(o-s),l=ky(a*(s+o)/2,h,e),c=[],u=h/l.length,d=o>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=l.length;t<e;t++){const e=l[t],i=a/e;for(let r=0;r<e;r++)c.push({innerRadius:o-u*t*d,outerRadius:o-u*(t+1)*d,startAngle:n+i*r*p,endAngle:n+i*(r+1)*p})}return c},Iy=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),o=ky(s*r,r,e),a=[],h=s/o[0],l=r/o.length,c=n>=i?1:-1;for(let t=0,e=o.length;t<e;t++)for(let e=0,n=o[t];e<n;e++)a.push({innerRadius:l*t,outerRadius:l*(t+1),startAngle:i+h*e*c,endAngle:i+h*(e+1)*c});return a},Dy=(t,e)=>{const i=t.filter((t=>!1!==t.defined&&jp(t.x)&&jp(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 o=0;for(let e=0,i=t.length;e<i;e++)if(n.push(t[e]),e<i-1){let i=s;const a=t[e].x,h=t[e].y,l=t[e+1].x,c=t[e+1].y;for(;i<1&&o<r;)n.push({x:a+(l-a)*i,y:h+(c-h)*i}),i+=s,o+=1}return n},Ly=(t,e)=>{var i,n;const r=t.attribute;let s=r.points;const o=r.segments;s||(s=o.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]));const a=s.filter((t=>!1!==t.defined&&jp(t.x)&&jp(t.y)));if(!a.length)return[];const h=[];a.forEach((t=>{h.push({x:t.x,y:t.y})}));for(let t=a.length-1;t>=0;t--){const e=a[t];h.push({x:null!==(i=e.x1)&&void 0!==i?i:e.x,y:null!==(n=e.y1)&&void 0!==n?n:e.y})}const l=[];return jy(s,e,l),l},Ny=(t,e)=>{const i=t.attribute,n=i.points;if(n)return Dy(n,e);if(i.segments){const t=i.segments.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]);return Dy(t,e)}return[]};const Uy=t=>t.map((t=>({x:t.x,y:t.y}))),Wy=(t,e,i)=>{const n=t.length,r=[];for(let a=0;a<n;a++){const h=t[a],l=a===n-1?t[0]:t[a+1],c=Df([e.x,e.y],[i.x,i.y],[h.x,h.y],[l.x,l.y]);c&&"boolean"!=typeof c&&r.push({dot:(s=[c[0]-e.x,c[1]-e.x],o=[i.x-e.x,i.y-e.x],s[0]*o[1]-s[1]*o[0]),point:{x:c[0],y:c[1]},edgeIndex:a})}var s,o;if(r.length<2)return[Uy(t),Uy(t)];r.sort(((t,e)=>t.dot-e.dot));let a=r[0],h=r[r.length-1];a.edgeIndex>h.edgeIndex&&([a,h]=[h,a]);const l=a.point,c=h.point,u=[{x:l.x,y:l.y}];for(let e=a.edgeIndex+1;e<=h.edgeIndex;e++)u.push({x:t[e].x,y:t[e].y});u.push({x:c.x,y:c.y});const d=[{x:c.x,y:c.y}];for(let e=h.edgeIndex+1,i=a.edgeIndex+n;e<=i;e++){const i=t[e%n];d.push({x:i.x,y:i.y})}return d.push({x:l.x,y:l.y}),[u,d]},Fy=t=>{const e=new xf;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 Wy(t,{x:n,y:e.y1},{x:n,y:e.y2})}const r=e.y1+n/2;return Wy(t,{x:e.x1,y:r},{x:e.x2,y:r})},jy=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=Fy(t);jy(r[0],n,i),jy(r[1],e-n,i)}},zy=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:Uy(i)}];const n=[];return jy(i,e,n),n},Hy=(t,e)=>{const i=Py(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 o=i.slice(s*r,s===e-1?n:(s+1)*r);t.push({path:My(o)})}return t}const r=[],s=Math.floor(e/n);let o=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]});jy(e,t===n-1?o:s,r),o-=s}return r};var Gy={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 Vy={};for(const t in Gy)qp(Gy,t)&&(Vy[Gy[t]]=t);const Xy={to:{},get:{}};function Yy(t,e,i){return Math.min(Math.max(e,t),i)}function qy(t){const e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}Xy.get=function(t,e=[0,0,0,1]){let i,n;switch(t.substring(0,3).toLowerCase()){case"hsl":i=Xy.get.hsl(t,e),n="hsl";break;case"hwb":i=Xy.get.hwb(t,e),n="hwb";break;default:i=Xy.get.rgb(t,e),n="rgb"}return i?{model:n,value:i}:null},Xy.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=Gy[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]=Yy(i[r],0,255);return i[3]=Yy(i[3],0,1),i},Xy.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]=Yy(parseFloat(i[2]),0,100),e[2]=Yy(parseFloat(i[3]),0,100),e[3]=Yy(isNaN(t)?1:t,0,1),e}return null},Xy.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]=Yy(parseFloat(i[2]),0,100),e[2]=Yy(parseFloat(i[3]),0,100),e[3]=Yy(isNaN(t)?1:t,0,1),e}return null},Xy.to.hex=function(...t){const e=t;return"#"+qy(e[0])+qy(e[1])+qy(e[2])+(e[3]<1?qy(Math.round(255*e[3])):"")},Xy.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]+")"},Xy.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]+")"},Xy.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]+")"},Xy.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+")"},Xy.to.keyword=function(t){return Vy[t.slice(0,3)]};const Ky=Xy;var $y;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}($y||($y={}));class Zy{static Get(t,e=$y.Color1,i=[0,0,0,1]){if(e===$y.Color1){let e=Zy.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;if(e=Xy.get(t),e&&e.value){const n=e.value,r=[n[0]/255,n[1]/255,n[2]/255,n[3]];Zy.store1[t]=r,Zy.store255[t]=n,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3]}return i}let n=Zy.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;if(n=Xy.get(t),n&&n.value){const e=n.value;Zy.store1[t]=[e[0]/255,e[1]/255,e[2]/255,e[3]],Zy.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===$y.Color1){if(Zy.store1[t])return;Zy.store1[t]=i,Zy.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Zy.store255[t])return;Zy.store255[t]=i,Zy.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function Jy(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 Qy(t,e,i,n,r){if(!t||!e)return t&&Jy(t)||e&&Jy(e)||!1;let s,o,a=!1,h=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=Zy.Get(t,$y.Color255):a=!0,Array.isArray(e)?o=e:"string"==typeof e?o=Zy.Get(e,$y.Color255):h=!0,a!==h){const s=a?t:e,o=a?e:t,h=Object.assign(Object.assign({},s),{stops:s.stops.map((t=>Object.assign(Object.assign({},t),{color:Jy(o)})))});return a?Qy(s,h,i,n,r):Qy(h,s,i,n,r)}if(a){if(t.gradient===e.gradient){const n=t,r=e,s=n.stops,o=r.stops;if(s.length!==o.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:ib(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:ib(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:ib(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,o);const l=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,o,i);return Jy(l,n)}Zy.store255={},Zy.store1={};const tb=[0,0,0,0],eb=[0,0,0,0];function ib(t,e,i){return Zy.Get(t,$y.Color255,tb),Zy.Get(e,$y.Color255,eb),`rgba(${Math.round(tb[0]+(eb[0]-tb[0])*i)},${Math.round(tb[1]+(eb[1]-tb[1])*i)},${Math.round(tb[2]+(eb[2]-tb[2])*i)},${tb[3]+(eb[3]-tb[3])*i})`}const nb=(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=Qy(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},rb=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const o=t[s],a=o.from,h=o.to,l=o.rotation*i,c=o.fromCp,u=o.toCp,d=Math.sin(l),p=Math.cos(l);r[0]=c[0]+(u[0]-c[0])*i,r[1]=c[1]+(u[1]-c[1])*i;for(let t=0;t<a.length;t+=2){const e=a[t],s=a[t+1],o=e*(1-i)+h[t]*i,l=s*(1-i)+h[t+1]*i;n[t]=o*p-l*d+r[0],n[t+1]=o*d+l*p+r[1]}let f=n[0],g=n[1];e.moveTo(f,g);for(let t=2;t<a.length;t+=6){const i=n[t],r=n[t+1],s=n[t+2],o=n[t+3],a=n[t+4],h=n[t+5];f===i&&g===r&&s===a&&o===h?e.lineTo(a,h):e.bezierCurveTo(i,r,s,o,a,h),f=a,g=h}}},sb=(t,e,i)=>{const n=t?Py(t):[],r=Py(e);i&&n&&(i.fromTransform&&Ey(n,i.fromTransform.clone().getInverse()),Ey(n,i.toTransfrom));const[s,o]=By(n,r);return t?Cy(s,o,10,Math.PI):o.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},ob=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],ab=(t,e)=>{if(!t||!e)return null;const i=[];let n=!1;return Object.keys(t).forEach((r=>{if(!ob.includes(r))return;const s=e[r];Ip(s)||Ip(t[r])||s===t[r]||("fill"===r||"stroke"===r?i.push({from:"string"==typeof t[r]?Zy.Get(t[r],$y.Color255):t[r],to:"string"==typeof s?Zy.Get(s,$y.Color255):s,key:r}):i.push({from:t[r],to:s,key:r}),n=!0)})),n?i:null};class hb extends qm{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}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;rb(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&nb(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const lb=(t,e,i,n)=>{var r,s,o;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 a=null==t?void 0:t.globalTransMatrix;n&&a&&(a=n.clone().multiply(a.a,a.b,a.c,a.d,a.e,a.f));const h=sb(null===(r=null==t?void 0:t.toCustomPath)||void 0===r?void 0:r.call(t),e.toCustomPath(),{fromTransform:a,toTransfrom:e.globalTransMatrix}),l=ab(null==t?void 0:t.attribute,e.attribute),c=e.animate(i);return(null==i?void 0:i.delay)&&c.wait(i.delay),c.play(new hb({morphingData:h,otherAttrs:l},null!==(s=null==i?void 0:i.duration)&&void 0!==s?s:ty.duration,null!==(o=null==i?void 0:i.easing)&&void 0!==o?o:ty.easing)),c};class cb extends qm{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}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)=>{var n;rb(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),(null===(n=this.otherAttrs)||void 0===n?void 0:n[i])&&this.otherAttrs[i].length&&nb(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const ub=t=>{const e={};return Object.keys(t).forEach((i=>{py(i)||(e[i]=t[i])})),e},db=(t,e,i)=>{const n=ub(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,o=s.width(),a=s.height();r.setTheme({rect:n}),new Array(i).fill(0).forEach((t=>{const i=Av.graphicService.creator.rect({x:0,y:0,width:o,height:a});r.appendChild(i),e.push(i)}))}},pb=(t,e,i)=>{const n=[],r=i?null:ub(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new qg).fromCustomPath2D(s)};n.push(Av.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&db(t,n,e),n},fb=(t,e,i)=>{const n=[],r=i?null:ub(t.attribute);if("rect"===t.type){Ry(t,e).forEach((t=>{n.push(Av.graphicService.creator.rect(i?t:Object.assign({},r,t)))}))}else if("arc"===t.type){Oy(t,e).forEach((t=>{n.push(Av.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("circle"===t.type){Iy(t,e).forEach((t=>{n.push(Av.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("line"===t.type){const s=Ny(t,e),o={size:10,symbolType:"circle"};s.forEach((t=>{n.push(Av.graphicService.creator.symbol(i?Object.assign({},t,o):Object.assign({},r,t,o)))}))}else if("polygon"===t.type){zy(t,e).forEach((t=>{n.push(Av.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("area"===t.type){Ly(t,e).forEach((t=>{n.push(Av.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("path"===t.type){Hy(t,e).forEach((t=>{"path"in t?n.push(Av.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(Av.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}return i&&db(t,n,e),n};class gb{static GetImage(t,e){var i;let n=gb.cache.get(t);n?"fail"===n.loadState?Av.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&Av.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,n.data)})):(n={type:"image",loadState:"init"},gb.cache.set(t,n),n.dataPromise=Av.global.loadImage(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))}))}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetSvg(t,e){var i;let n=gb.cache.get(t);n?"fail"===n.loadState?Av.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&Av.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,n.data)})):(n={type:"image",loadState:"init"},gb.cache.set(t,n),n.dataPromise=Av.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))}))}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=gb.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"},gb.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=Av.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=Av.global.loadBlob(t):"json"===e&&(i.dataPromise=Av.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}}gb.cache=new Map;const vb=new Of,mb=new wf,yb=["lineWidth","lineCap","lineJoin","miterLimit","scaleX","scaleY","angle","anchor"],bb=["x","y"],xb=["scaleX","scaleY"],wb=["angle"],Ab=new mf,Sb={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class Tb extends Bm{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(Tb.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 wf,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=Sm(this.parent).group,{scrollX:e=t.scrollX,scrollY:r=t.scrollY}=this.parent.attribute;Ab.x=i+e,Ab.y=n+r}else Ab.x=i,Ab.y=n;return Ab}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Av.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.addUpdateLayoutTag(),Av.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 Of),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(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e: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 mf(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.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);s?this._setAttributes(s,i,n):Ip(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t&&this.loadImage(e,!0)}needUpdateTags(t){for(let e=0;e<yb.length;e++){const i=yb[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<yb.length;e++){if(t===yb[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){var n,r;if(0===e&&0===i)return this;const s={type:t.AttributeUpdateType.TRANSLATE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,bb,s);o&&(e=o.x,i=o.y,delete o.x,delete o.y,this._setAttributes(o));const a=this.attribute,h=a.postMatrix;return h?Av.transformUtil.fromMatrix(h,h).translate(e,i):(a.x=(null!==(n=a.x)&&void 0!==n?n:Jg.x)+e,a.y=(null!==(r=a.y)&&void 0!==r?r:Jg.y)+i),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),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,bb,r);return s?(this._setAttributes(s,!1,r),this):(n.x=e,n.y=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}scale(e,i,n){var r,s;if(1===e&&1===i)return this;const o={type:t.AttributeUpdateType.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i,scaleCenter:n},this.attribute,xb,o);a&&(e=a.scaleX,i=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const h=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new Of,h.postMatrix=t),Av.transformUtil.fromMatrix(t,t).scale(e,i,n)}else h.scaleX=(null!==(r=h.scaleX)&&void 0!==r?r:Jg.scaleX)*e,h.scaleY=(null!==(s=h.scaleY)&&void 0!==s?s:Jg.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),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,xb,r);return s?(this._setAttributes(s,!1,r),this):(n.scaleX=e,n.scaleY=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}rotate(e,i){var n;if(0===e)return this;const r={type:t.AttributeUpdateType.ROTATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:e,rotateCenter:i},this.attribute,wb,r);s&&(delete s.angle,this._setAttributes(s,!1,r));const o=this.attribute;if(i){let{postMatrix:t}=this.attribute;t||(t=new Of,o.postMatrix=t),Av.transformUtil.fromMatrix(t,t).rotate(e,i)}else o.angle=(null!==(n=o.angle)&&void 0!==n?n:Jg.angle)+e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),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,wb,n);return r?(this._setAttributes(r,!1,n),this):(i.angle=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new $m(null==t?void 0: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){Av.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)&&(!!Ip(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(e,i,n,r){var s,o,a,h;if(n){const n=Object.keys(e),l=this.getNoWorkAnimateAttr(),c={};let u;r?n.forEach((t=>{l[t]?(u||(u={}),u[t]=e[t]):c[t]=void 0===e[t]?this.getDefaultAttribute(t):e[t]})):n.forEach((t=>{l[t]?(u||(u={}),u[t]=e[t]):c[t]=e[t]}));const d=this.animate();d.stateNames=i,d.to(c,null!==(o=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==o?o:Qm.duration,null!==(h=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==h?h:Qm.easing),u&&this.setAttributes(u,!1,{type:t.AttributeUpdateType.STATE})}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();qp(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){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const n={};t.forEach((e=>{var i;const r=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];r&&Object.assign(n,r)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,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}addUpdateLayoutTag(){this._updateTag|=t.UpdateTag.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=t.UpdateTag.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&t.UpdateTag.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],n=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:n}=this.attribute;return mb.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(mb),this.setAttributes({scaleX:t,scaleY:i,angle:n}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,r=n();i[0]=r.x1+(r.x2-r.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,r=n();i[1]=r.y1+(r.y2-r.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=Jg.x,y:e=Jg.y,scaleX:i=Jg.scaleX,scaleY:n=Jg.scaleY,angle:r=Jg.angle,scaleCenter:s,anchor:o,postMatrix:a}=this.attribute;let h=[0,0];const l={};if(o&&(h=this.getAnchor(o,l)),!s||1===i&&1===n)!function(t,e,i,n,r,s,o,a){var h,l,c=e.a,u=e.b,d=e.c,p=e.d,f=e.e,g=e.f,v=af(o),m=cf(o);a?(h=a[0],l=a[1]):(h=i,l=n);var y=h-i,b=l-n,x=c*v+d*m,w=u*v+p*m,A=d*v-c*m,S=p*v-u*m;t.a=r*x,t.b=r*w,t.c=s*A,t.d=s*S,t.e=f+c*h+d*l-x*y-A*b,t.f=g+u*h+p*l-w*y-S*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,o&&h);else{const o=this._transMatrix;o.reset(),o.translate(h[0],h[1]),o.rotate(r),o.translate(-h[0],-h[1]),o.translate(t,e),h=this.getAnchor(s,l),Av.transformUtil.fromMatrix(o,o).scale(i,n,{x:h[0],y:h[1]})}const c=this.getOffsetXY(Jg);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,a){const t=vb.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){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Av.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 o={};if(n.customAnimate)n.customAnimate.update(s,r,o);else{const t=n.props,a=n.parsedProps,h=n.propKeys;this.stepInterpolate(e,i,o,n,r,s,t,void 0,a,h)}this.setAttributes(o,!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,o,a,h,l){l||(l=Object.keys(o),n.propKeys=l),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=o[t])})):l.forEach((s=>{var l;if(!e.validAttr(s))return;const c=o[s],u=null!==(l=a&&a[s])&&void 0!==l?l:t.getLastPropByName(s,n);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,u,c,i),d||(d=e.customInterpolate(s,r,u,c,this,i),d||this.defaultInterpolate(c,u,s,i,h,r)||this._interpolate(s,r,u,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 o=r.fillColorArray,a=Qy(e,null!=o?o:t,s,!1,((t,e)=>{r.fillColorArray=e}));return a&&(n[i]=a),!0}if("stroke"===i){r||(r={});const o=r.strokeColorArray,a=Qy(e,null!=o?o:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return a&&(n[i]=a),!0}if("shadowColor"===i){r||(r={});const o=r.shadowColorArray,a=Qy(e,null!=o?o: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 Sm(this)[this.type][t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e: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=null!=t?t:Av.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 Up(t,!0)?this.pathProxy=(new qg).fromString(t):this.pathProxy=new qg,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){if(t.fill||t.stroke)return!0;return!1}(t))return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(i,n),"string"==typeof t?(n.state="loading",Hp(t)||Vp(t)?(gb.GetImage(t,this),this.backgroundImg=this.backgroundImg||e):t.startsWith("<svg")&&(gb.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",Av.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const r=new km(t,e);r.bubbles=!1,r.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(r)}}}Tb.mixin(Dm);var Cb={},Bb={};!function(t){var e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+e+"]["+(e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*",n=new RegExp("^"+i+"$");t.isExist=function(t){return void 0!==t},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,i){if(e)for(var n=Object.keys(e),r=n.length,s=0;s<r;s++)t[n[s]]="strict"===i?[e[n[s]]]:e[n[s]]},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(t){var e=n.exec(t);return!(null==e)},t.getAllMatches=function(t,e){for(var i=[],n=e.exec(t);n;){var r=[];r.startIndex=e.lastIndex-n[0].length;for(var s=n.length,o=0;o<s;o++)r.push(n[o]);i.push(r),n=e.exec(t)}return i},t.nameRegexp=i}(Bb);var _b=Bb,Pb={allowBooleanAttributes:!1,unpairedTags:[]};function Eb(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function Mb(t,e){for(var i=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var n=t.substr(i,e-i);if(e>5&&"xml"===n)return Ub("InvalidXml","XML declaration allowed only at the start of the document.",Fb(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function kb(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var i=1;for(e+=8;e<t.length;e++)if("<"===t[e])i++;else if(">"===t[e]&&0===--i)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}Cb.validate=function(t,e){e=Object.assign({},Pb,e);var i,n=[],r=!1,s=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if((o=Mb(t,o+=2)).err)return o}else{if("<"!==t[o]){if(Eb(t[o]))continue;return Ub("InvalidChar","char '"+t[o]+"' is not expected.",Fb(t,o))}var a=o;if("!"===t[++o]){o=kb(t,o);continue}var h=!1;"/"===t[o]&&(h=!0,o++);for(var l="";o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)l+=t[o];if("/"===(l=l.trim())[l.length-1]&&(l=l.substring(0,l.length-1),o--),i=l,!_b.isName(i)){return Ub("InvalidTag",0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",Fb(t,o))}var c=Ib(t,o);if(!1===c)return Ub("InvalidAttr","Attributes for '"+l+"' have open quote.",Fb(t,o));var u=c.value;if(o=c.index,"/"===u[u.length-1]){var d=o-u.length,p=Lb(u=u.substring(0,u.length-1),e);if(!0!==p)return Ub(p.err.code,p.err.msg,Fb(t,d+p.err.line));r=!0}else if(h){if(!c.tagClosed)return Ub("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Fb(t,o));if(u.trim().length>0)return Ub("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Fb(t,a));var f=n.pop();if(l!==f.tagName){var g=Fb(t,f.tagStartPos);return Ub("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+g.line+", col "+g.col+") instead of closing tag '"+l+"'.",Fb(t,a))}0==n.length&&(s=!0)}else{var v=Lb(u,e);if(!0!==v)return Ub(v.err.code,v.err.msg,Fb(t,o-u.length+v.err.line));if(!0===s)return Ub("InvalidXml","Multiple possible root nodes found.",Fb(t,o));-1!==e.unpairedTags.indexOf(l)||n.push({tagName:l,tagStartPos:a}),r=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o=kb(t,++o);continue}if("?"!==t[o+1])break;if((o=Mb(t,++o)).err)return o}else if("&"===t[o]){var m=Nb(t,o);if(-1==m)return Ub("InvalidChar","char '&' is not expected.",Fb(t,o));o=m}else if(!0===s&&!Eb(t[o]))return Ub("InvalidXml","Extra text at the end",Fb(t,o));"<"===t[o]&&o--}return r?1==n.length?Ub("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",Fb(t,n[0].tagStartPos)):!(n.length>0)||Ub("InvalidXml","Invalid '"+JSON.stringify(n.map((function(t){return t.tagName})),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Ub("InvalidXml","Start tag expected.",1)};var Rb='"',Ob="'";function Ib(t,e){for(var i="",n="",r=!1;e<t.length;e++){if(t[e]===Rb||t[e]===Ob)""===n?n=t[e]:n!==t[e]||(n="");else if(">"===t[e]&&""===n){r=!0;break}i+=t[e]}return""===n&&{value:i,index:e,tagClosed:r}}var Db=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function Lb(t,e){for(var i=_b.getAllMatches(t,Db),n={},r=0;r<i.length;r++){if(0===i[r][1].length)return Ub("InvalidAttr","Attribute '"+i[r][2]+"' has no space in starting.",jb(i[r]));if(void 0!==i[r][3]&&void 0===i[r][4])return Ub("InvalidAttr","Attribute '"+i[r][2]+"' is without value.",jb(i[r]));if(void 0===i[r][3]&&!e.allowBooleanAttributes)return Ub("InvalidAttr","boolean attribute '"+i[r][2]+"' is not allowed.",jb(i[r]));var s=i[r][2];if(!Wb(s))return Ub("InvalidAttr","Attribute '"+s+"' is an invalid name.",jb(i[r]));if(n.hasOwnProperty(s))return Ub("InvalidAttr","Attribute '"+s+"' is repeated.",jb(i[r]));n[s]=1}return!0}function Nb(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){var i=/\d/;for("x"===t[e]&&(e++,i=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(i))break}return-1}(t,++e);for(var i=0;e<t.length;e++,i++)if(!(t[e].match(/\w/)&&i<20)){if(";"===t[e])break;return-1}return e}function Ub(t,e,i){return{err:{code:t,msg:e,line:i.line||i,col:i.col}}}function Wb(t){return _b.isName(t)}function Fb(t,e){var i=t.substring(0,e).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function jb(t){return t.startIndex+t[1].length}var zb={},Hb={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,i){return t}};zb.buildOptions=function(t){return Object.assign({},Hb,t)},zb.defaultOptions=Hb;var Gb=function(){function t(e){r(this,t),this.tagname=e,this.child=[],this[":@"]={}}return o(t,[{key:"add",value:function(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push(a({},t,e))}},{key:"addChild",value:function(t){var e;("__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0)?this.child.push((a(e={},t.tagname,t.child),a(e,":@",t[":@"]),e)):this.child.push(a({},t.tagname,t.child))}}]),t}(),Vb=Bb;function Xb(t,e){for(var i="";e<t.length&&"'"!==t[e]&&'"'!==t[e];e++)i+=t[e];if(-1!==(i=i.trim()).indexOf(" "))throw new Error("External entites are not supported");for(var n=t[e++],r="";e<t.length&&t[e]!==n;e++)r+=t[e];return[i,r,e]}function Yb(t,e){return"!"===t[e+1]&&"-"===t[e+2]&&"-"===t[e+3]}function qb(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7]}function Kb(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8]}function $b(t,e){return"!"===t[e+1]&&"A"===t[e+2]&&"T"===t[e+3]&&"T"===t[e+4]&&"L"===t[e+5]&&"I"===t[e+6]&&"S"===t[e+7]&&"T"===t[e+8]}function Zb(t,e){return"!"===t[e+1]&&"N"===t[e+2]&&"O"===t[e+3]&&"T"===t[e+4]&&"A"===t[e+5]&&"T"===t[e+6]&&"I"===t[e+7]&&"O"===t[e+8]&&"N"===t[e+9]}function Jb(t){if(Vb.isName(t))return t;throw new Error("Invalid entity name ".concat(t))}var Qb=function(t,e){var i={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");e+=9;for(var n=1,r=!1,s=!1;e<t.length;e++)if("<"!==t[e]||s)if(">"===t[e]){if(s?"-"===t[e-1]&&"-"===t[e-2]&&(s=!1,n--):n--,0===n)break}else"["===t[e]?r=!0:t[e];else{if(r&&qb(t,e)){var o=d(Xb(t,(e+=7)+1),3);entityName=o[0],val=o[1],e=o[2],-1===val.indexOf("&")&&(i[Jb(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val:val})}else if(r&&Kb(t,e))e+=8;else if(r&&$b(t,e))e+=8;else if(r&&Zb(t,e))e+=9;else{if(!Yb)throw new Error("Invalid DOCTYPE");s=!0}n++,""}if(0!==n)throw new Error("Unclosed DOCTYPE");return{entities:i,i:e}},tx=/^[-+]?0x[a-fA-F0-9]+$/,ex=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var ix={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var nx=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=Object.assign({},ix,e),!t||"string"!=typeof t)return t;var i=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(i))return t;if(e.hex&&tx.test(i))return Number.parseInt(i,16);var n=ex.exec(i);if(n){var r=n[1],s=n[2],o=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t;return t}(n[3]),a=n[4]||n[6];if(!e.leadingZeros&&s.length>0&&r&&"."!==i[2])return t;if(!e.leadingZeros&&s.length>0&&!r&&"."!==i[1])return t;var h=Number(i),l=""+h;return-1!==l.search(/[eE]/)||a?e.eNotation?h:t:-1!==i.indexOf(".")?"0"===l&&""===o||l===o||r&&l==="-"+o?h:t:s?o===l||r+o===l?h:t:i===l||i===r+l?h:t}return t},rx=Bb,sx=Gb,ox=Qb,ax=nx;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,rx.nameRegexp);var hx=o((function t(e){r(this,t),this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=lx,this.parseXml=fx,this.parseTextData=cx,this.resolveNameSpace=ux,this.buildAttributesMap=px,this.isItStopNode=yx,this.replaceEntitiesValue=vx,this.readStopNodeData=Ax,this.saveTextToParentTag=mx,this.addChild=gx}));function lx(t){for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:t[n]}}}function cx(t,e,i,r,s,o,a){if(void 0!==t&&(this.options.trimValues&&!r&&(t=t.trim()),t.length>0)){a||(t=this.replaceEntitiesValue(t));var h=this.options.tagValueProcessor(e,t,i,s,o);return null==h?t:n(h)!==n(t)||h!==t?h:this.options.trimValues||t.trim()===t?Sx(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function ux(t){if(this.options.removeNSPrefix){var e=t.split(":"),i="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=i+e[1])}return t}var dx=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function px(t,e,i){if(!this.options.ignoreAttributes&&"string"==typeof t){for(var r=rx.getAllMatches(t,dx),s=r.length,o={},a=0;a<s;a++){var h=this.resolveNameSpace(r[a][1]),l=r[a][4],c=this.options.attributeNamePrefix+h;if(h.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),"__proto__"===c&&(c="#__proto__"),void 0!==l){this.options.trimValues&&(l=l.trim()),l=this.replaceEntitiesValue(l);var u=this.options.attributeValueProcessor(h,l,e);null==u?o[c]=l:n(u)!==n(l)||u!==l?o[c]=u:o[c]=Sx(l,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[c]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){var d={};return d[this.options.attributesGroupName]=o,d}return o}}var fx=function(t){t=t.replace(/\r\n?/g,"\n");for(var e=new sx("!xml"),i=e,n="",r="",s=0;s<t.length;s++){if("<"===t[s])if("/"===t[s+1]){var o=bx(t,">",s,"Closing Tag is not closed."),h=t.substring(s+2,o).trim();if(this.options.removeNSPrefix){var l=h.indexOf(":");-1!==l&&(h=h.substr(l+1))}this.options.transformTagName&&(h=this.options.transformTagName(h)),i&&(n=this.saveTextToParentTag(n,i,r));var c=r.substring(r.lastIndexOf(".")+1);if(h&&-1!==this.options.unpairedTags.indexOf(h))throw new Error("Unpaired tag can not be used as closing tag: </".concat(h,">"));var u=0;c&&-1!==this.options.unpairedTags.indexOf(c)?(u=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):u=r.lastIndexOf("."),r=r.substring(0,u),i=this.tagsNodeStack.pop(),n="",s=o}else if("?"===t[s+1]){var d=xx(t,s,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,i,r),this.options.ignoreDeclaration&&"?xml"===d.tagName||this.options.ignorePiTags);else{var p=new sx(d.tagName);p.add(this.options.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&(p[":@"]=this.buildAttributesMap(d.tagExp,r,d.tagName)),this.addChild(i,p,r)}s=d.closeIndex+1}else if("!--"===t.substr(s+1,3)){var f=bx(t,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){var g=t.substring(s+4,f-2);n=this.saveTextToParentTag(n,i,r),i.add(this.options.commentPropName,[a({},this.options.textNodeName,g)])}s=f}else if("!D"===t.substr(s+1,2)){var v=ox(t,s);this.docTypeEntities=v.entities,s=v.i}else if("!["===t.substr(s+1,2)){var m=bx(t,"]]>",s,"CDATA is not closed.")-2,y=t.substring(s+9,m);if(n=this.saveTextToParentTag(n,i,r),this.options.cdataPropName)i.add(this.options.cdataPropName,[a({},this.options.textNodeName,y)]);else{var b=this.parseTextData(y,i.tagname,r,!0,!1,!0);null==b&&(b=""),i.add(this.options.textNodeName,b)}s=m+2}else{var x=xx(t,s,this.options.removeNSPrefix),w=x.tagName,A=x.tagExp,S=x.attrExpPresent,T=x.closeIndex;this.options.transformTagName&&(w=this.options.transformTagName(w)),i&&n&&"!xml"!==i.tagname&&(n=this.saveTextToParentTag(n,i,r,!1));var C=i;if(C&&-1!==this.options.unpairedTags.indexOf(C.tagname)&&(i=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),w!==e.tagname&&(r+=r?"."+w:w),this.isItStopNode(this.options.stopNodes,r,w)){var B="";if(A.length>0&&A.lastIndexOf("/")===A.length-1)s=x.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(w))s=x.closeIndex;else{var _=this.readStopNodeData(t,w,T+1);if(!_)throw new Error("Unexpected end of ".concat(w));s=_.i,B=_.tagContent}var P=new sx(w);w!==A&&S&&(P[":@"]=this.buildAttributesMap(A,r,w)),B&&(B=this.parseTextData(B,w,r,!0,S,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),P.add(this.options.textNodeName,B),this.addChild(i,P,r)}else{if(A.length>0&&A.lastIndexOf("/")===A.length-1){"/"===w[w.length-1]?(w=w.substr(0,w.length-1),r=r.substr(0,r.length-1),A=w):A=A.substr(0,A.length-1),this.options.transformTagName&&(w=this.options.transformTagName(w));var E=new sx(w);w!==A&&S&&(E[":@"]=this.buildAttributesMap(A,r,w)),this.addChild(i,E,r),r=r.substr(0,r.lastIndexOf("."))}else{var M=new sx(w);this.tagsNodeStack.push(i),w!==A&&S&&(M[":@"]=this.buildAttributesMap(A,r,w)),this.addChild(i,M,r),i=M}n="",s=T}}else n+=t[s]}return e.child};function gx(t,e,i){var n=this.options.updateTag(e.tagname,i,e[":@"]);!1===n||("string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e))}var vx=function(t){if(this.options.processEntities){for(var e in this.docTypeEntities){var i=this.docTypeEntities[e];t=t.replace(i.regx,i.val)}for(var n in this.lastEntities){var r=this.lastEntities[n];t=t.replace(r.regex,r.val)}if(this.options.htmlEntities)for(var s in this.htmlEntities){var o=this.htmlEntities[s];t=t.replace(o.regex,o.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function mx(t,e,i,n){return t&&(void 0===n&&(n=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,i,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function yx(t,e,i){var n="*."+i;for(var r in t){var s=t[r];if(n===s||e===s)return!0}return!1}function bx(t,e,i,n){var r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function xx(t,e,i){var n=function(t,e){for(var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="",s=e;s<t.length;s++){var o=t[s];if(i)o===i&&(i="");else if('"'===o||"'"===o)i=o;else if(o===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===o&&(o=" ");r+=o}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(n){var r=n.data,s=n.index,o=r.search(/\s/),a=r,h=!0;if(-1!==o&&(a=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1)),i){var l=a.indexOf(":");-1!==l&&(h=(a=a.substr(l+1))!==n.data.substr(l+1))}return{tagName:a,tagExp:r,closeIndex:s,attrExpPresent:h}}}function Ax(t,e,i){for(var n=i,r=1;i<t.length;i++)if("<"===t[i])if("/"===t[i+1]){var s=bx(t,">",i,"".concat(e," is not closed"));if(t.substring(i+2,s).trim()===e&&0===--r)return{tagContent:t.substring(n,i),i:s};i=s}else if("?"===t[i+1]){i=bx(t,"?>",i+1,"StopNode is not closed.")}else if("!--"===t.substr(i+1,3)){i=bx(t,"--\x3e",i+3,"StopNode is not closed.")}else if("!["===t.substr(i+1,2)){i=bx(t,"]]>",i,"StopNode is not closed.")-2}else{var o=xx(t,i,">");if(o)(o&&o.tagName)===e&&"/"!==o.tagExp[o.tagExp.length-1]&&r++,i=o.closeIndex}}function Sx(t,e,i){if(e&&"string"==typeof t){var n=t.trim();return"true"===n||"false"!==n&&ax(t,i)}return rx.isExist(t)?t:""}var Tx=hx,Cx={};function Bx(t,e,i){for(var n,r={},s=0;s<t.length;s++){var o=t[s],a=_x(o),h="";if(h=void 0===i?a:i+"."+a,a===e.textNodeName)void 0===n?n=o[a]:n+=""+o[a];else{if(void 0===a)continue;if(o[a]){var l=Bx(o[a],e,h),c=Ex(l,e);o[":@"]?Px(l,o[":@"],h,e):1!==Object.keys(l).length||void 0===l[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(l).length&&(e.alwaysCreateTextNode?l[e.textNodeName]="":l=""):l=l[e.textNodeName],void 0!==r[a]&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(l)):e.isArray(a,h,c)?r[a]=[l]:r[a]=l}}}return"string"==typeof n?n.length>0&&(r[e.textNodeName]=n):void 0!==n&&(r[e.textNodeName]=n),r}function _x(t){for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];if(":@"!==n)return n}}function Px(t,e,i,n){if(e)for(var r=Object.keys(e),s=r.length,o=0;o<s;o++){var a=r[o];n.isArray(a,i+"."+a,!0,!0)?t[a]=[e[a]]:t[a]=e[a]}}function Ex(t,e){var i=e.textNodeName,n=Object.keys(t).length;return 0===n||!(1!==n||!t[i]&&"boolean"!=typeof t[i]&&0!==t[i])}Cx.prettify=function(t,e){return Bx(t,e)};var Mx=zb.buildOptions,kx=Tx,Rx=Cx.prettify,Ox=Cb,Ix=function(){function t(e){r(this,t),this.externalEntities={},this.options=Mx(e)}return o(t,[{key:"parse",value:function(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});var i=Ox.validate(t,e);if(!0!==i)throw Error("".concat(i.err.msg,":").concat(i.err.line,":").concat(i.err.col))}var n=new kx(this.options);n.addExternalEntities(this.externalEntities);var r=n.parseXml(t);return this.options.preserveOrder||void 0===r?r:Rx(r,this.options)}},{key:"addEntity",value:function(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}}]),t}(),Dx=Ix;function Lx(t,e,i,n){for(var r="",s=!1,o=0;o<t.length;o++){var a=t[o],h=Nx(a),l="";if(l=0===i.length?h:"".concat(i,".").concat(h),h!==e.textNodeName)if(h!==e.cdataPropName)if(h!==e.commentPropName)if("?"!==h[0]){var c=n;""!==c&&(c+=e.indentBy);var u=Ux(a[":@"],e),d=n+"<".concat(h).concat(u),p=Lx(a[h],e,l,c);-1!==e.unpairedTags.indexOf(h)?e.suppressUnpairedNode?r+=d+">":r+=d+"/>":p&&0!==p.length||!e.suppressEmptyNode?p&&p.endsWith(">")?r+=d+">".concat(p).concat(n,"</").concat(h,">"):(r+=d+">",p&&""!==n&&(p.includes("/>")||p.includes("</"))?r+=n+e.indentBy+p+n:r+=p,r+="</".concat(h,">")):r+=d+"/>",s=!0}else{var f=Ux(a[":@"],e),g="?xml"===h?"":n,v=a[h][0][e.textNodeName];v=0!==v.length?" "+v:"",r+=g+"<".concat(h).concat(v).concat(f,"?>"),s=!0}else r+=n+"\x3c!--".concat(a[h][0][e.textNodeName],"--\x3e"),s=!0;else s&&(r+=n),r+="<![CDATA[".concat(a[h][0][e.textNodeName],"]]>"),s=!1;else{var m=a[h];Wx(l,e)||(m=Fx(m=e.tagValueProcessor(h,m),e)),s&&(r+=n),r+=m,s=!1}}return r}function Nx(t){for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];if(":@"!==n)return n}}function Ux(t,e){var i="";if(t&&!e.ignoreAttributes)for(var n in t){var r=e.attributeValueProcessor(n,t[n]);!0===(r=Fx(r,e))&&e.suppressBooleanAttributes?i+=" ".concat(n.substr(e.attributeNamePrefix.length)):i+=" ".concat(n.substr(e.attributeNamePrefix.length),'="').concat(r,'"')}return i}function Wx(t,e){var i=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(var n in e.stopNodes)if(e.stopNodes[n]===t||e.stopNodes[n]==="*."+i)return!0;return!1}function Fx(t,e){if(t&&t.length>0&&e.processEntities)for(var i=0;i<e.entities.length;i++){var n=e.entities[i];t=t.replace(n.regex,n.val)}return t}var jx=function(t,e){var i="";return e.format&&e.indentBy.length>0&&(i="\n"),Lx(t,e,"",i)},zx={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Hx(t){this.options=Object.assign({},zx,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Xx),this.processTextOrObjNode=Gx,this.options.format?(this.indentate=Vx,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Gx(t,e,i){var n=this.j2x(t,i+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,i):this.buildObjectNode(n.val,e,n.attrStr,i)}function Vx(t){return this.options.indentBy.repeat(t)}function Xx(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}Hx.prototype.build=function(t){return this.options.preserveOrder?jx(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t=a({},this.options.arrayNodeName,t)),this.j2x(t,0).val)},Hx.prototype.j2x=function(t,e){var i="",r="";for(var s in t)if(void 0===t[s])this.isAttribute(s)&&(r+="");else if(null===t[s])this.isAttribute(s)?r+="":"?"===s[0]?r+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)r+=this.buildTextValNode(t[s],s,"",e);else if("object"!==n(t[s])){var o=this.isAttribute(s);if(o)i+=this.buildAttrPairStr(o,""+t[s]);else if(s===this.options.textNodeName){var a=this.options.tagValueProcessor(s,""+t[s]);r+=this.replaceEntitiesValue(a)}else r+=this.buildTextValNode(t[s],s,"",e)}else if(Array.isArray(t[s])){for(var h=t[s].length,l="",c=0;c<h;c++){var u=t[s][c];void 0===u||(null===u?"?"===s[0]?r+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+s+"/"+this.tagEndChar:"object"===n(u)?this.options.oneListGroup?l+=this.j2x(u,e+1).val:l+=this.processTextOrObjNode(u,s,e):l+=this.buildTextValNode(u,s,"",e))}this.options.oneListGroup&&(l=this.buildObjectNode(l,s,"",e)),r+=l}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName)for(var d=Object.keys(t[s]),p=d.length,f=0;f<p;f++)i+=this.buildAttrPairStr(d[f],""+t[s][d[f]]);else r+=this.processTextOrObjNode(t[s],s,e);return{attrStr:i,val:r}},Hx.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},Hx.prototype.buildObjectNode=function(t,e,i,n){if(""===t)return"?"===e[0]?this.indentate(n)+"<"+e+i+"?"+this.tagEndChar:this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar;var r="</"+e+this.tagEndChar,s="";return"?"===e[0]&&(s="?",r=""),!i&&""!==i||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===s.length?this.indentate(n)+"\x3c!--".concat(t,"--\x3e")+this.newLine:this.indentate(n)+"<"+e+i+s+this.tagEndChar+t+this.indentate(n)+r:this.indentate(n)+"<"+e+i+s+">"+t+r},Hx.prototype.closeTag=function(t){var e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":"></".concat(t),e},Hx.prototype.buildTextValNode=function(t,e,i,n){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(n)+"<![CDATA[".concat(t,"]]>")+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+"\x3c!--".concat(t,"--\x3e")+this.newLine;if("?"===e[0])return this.indentate(n)+"<"+e+i+"?"+this.tagEndChar;var r=this.options.tagValueProcessor(e,t);return""===(r=this.replaceEntitiesValue(r))?this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+i+">"+r+"</"+e+this.tagEndChar},Hx.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(var e=0;e<this.options.entities.length;e++){var i=this.options.entities[e];t=t.replace(i.regex,i.val)}return t};var Yx={XMLParser:Dx,XMLValidator:Cb,XMLBuilder:Hx};function qx(t,e,i,n=0){return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}let Kx=0;function $x(){return Kx++}var Zx;function Jx(e){const i=[];let n=0,r="";for(let s=0;s<e.length;s++)ew(e[s])?n?r+=e[s]:(n=1,r=e[s]):(n&&(i.push({text:r,direction:t.TextDirection.VERTICAL}),r="",n=0),i.push({text:e[s],direction:t.TextDirection.HORIZONTAL}));return r&&i.push({text:r,direction:t.TextDirection.VERTICAL}),i}t.TextDirection=void 0,(Zx=t.TextDirection||(t.TextDirection={}))[Zx.HORIZONTAL=0]="HORIZONTAL",Zx[Zx.VERTICAL=1]="VERTICAL";const Qx=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Qx.set(t,!0)));const tw=new Map;function ew(t){if(Qx.has(t))return!0;if(tw.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}function iw(t,e){const i=t["@_attribute"];if(i){i.split(";").forEach((t=>{if(!t)return;const i=t.split(":");if(2===i.length){const t=parseFloat(i[1]);e[i[0].trim()]=isFinite(t)?t:i[1].trim()}else{let t="";for(let e=1;e<i.length;e++)e>1&&(t+=":"),t+=i[e].trim();e[i[0].trim()]=t}}))}}[""].forEach((t=>tw.set(t,!0)));const nw=$x(),rw=$x(),sw=$x(),ow=$x(),aw=$x(),hw=$x(),lw=$x(),cw=$x(),uw=$x(),dw=$x(),pw=$x(),fw=$x(),gw=$x(),vw=$x(),mw=$x(),yw=$x(),bw=Symbol.for("GraphicService"),xw=Symbol.for("GraphicCreator"),ww={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"},Aw=Object.keys(ww),Sw={"@_stroke-linecap":"lineCap","@_stroke-linejoin":"lineJoin","@_stroke-dasharray":"lineDash","@_stroke-dashoffset":"lineDashOffset","@_stroke-width":"lineWidth","@_fill-opacity":"fillOpacity","@_stroke-opacity":"strokeOpacity","@_stroke":"stroke","@_fill":"fill"},Tw=Object.keys(Sw);var Cw;t.GroupUpdateAABBBoundsMode=void 0,(Cw=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[Cw.LESS_GROUP=0]="LESS_GROUP",Cw[Cw.MORE_GROUP=1]="MORE_GROUP";class Bw extends Tb{constructor(e){super(e),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=hw,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 wm),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new wm)}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 mf(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;Av.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Av.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateAABBBounds(){const t=this.attribute,e=Sm(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=Av.graphicService.updateGroupAABBBounds(t,Sm(this).group,this._AABBBounds,this),{boundsPadding:n=e.boundsPadding}=t,r=sy(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(),Av.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Av.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,Av.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){this.forEachChildren((t=>{Av.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),Av.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=Av.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new Bw(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Bw.NOWORK_ANIMATE_ATTR}}Bw.NOWORK_ANIMATE_ATTR=Sb;const _w=Symbol.for("LayerHandlerContribution");class Pw extends Bw{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){var r;super({}),this.stage=t,this.global=e,this.window=i,this.main=n.main,this.layerHandler=Dv.get(_w),this.layerHandler.init(this,i,{main:n.main,canvasId:n.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(r=n.zIndex)&&void 0!==r?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new wm,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=>{Av.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){var i;const n=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:n.x,y:n.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:null!==(i=t.background)&&void 0!==i?i: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){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}combineTo(t,e){var i,n,r;this.offscreen&&(this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r: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=>{Av.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i,n,r;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}t.DefaultLayerService=class{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 Pw(t,this.global,t.window,Object.assign(Object.assign({},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=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],t.DefaultLayerService);const Ew=Symbol.for("VWindow"),Mw=Symbol.for("WindowHandlerContribution");t.DefaultWindow=class{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.hooks={onChange:new Cp(["x","y","width","height"])},this._uid=Cm.GenAutoIncrementId()}postInit(){this.global.hooks.onSetEnv.tap("window",(()=>{this.active()})),this.active()}active(){const t=this.global;if(!t.env||this.actived)return;Dv.getNamed(Mw,t.env).configure(this,t),this.actived=!0,this._handler}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)}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}},vp([gp(),yp("design:type",Function),yp("design:paramtypes",[]),yp("design:returntype",void 0)],t.DefaultWindow.prototype,"postInit",null),t.DefaultWindow=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],t.DefaultWindow);const kw=Symbol.for("TransformUtil"),Rw=Symbol.for("GraphicUtil"),Ow=Symbol.for("LayerService");var Iw=new np((e=>{e(t.DefaultGlobal).toSelf().inSingletonScope(),e(_p).toService(t.DefaultGlobal),e(t.DefaultWindow).to(t.DefaultWindow),e(Ew).toService(t.DefaultWindow),e(t.DefaultGraphicUtil).toSelf().inSingletonScope(),e(Rw).toService(t.DefaultGraphicUtil),e(t.DefaultTransformUtil).toSelf().inSingletonScope(),e(kw).toService(t.DefaultTransformUtil),e(t.DefaultLayerService).toSelf().inSingletonScope(),e(Ow).toService(t.DefaultLayerService)}));function Dw(t,e){return!(!t&&!e)}function Lw(t,e){let i;return i=Wp(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Nw(t,e,i){return i&&t*e>0}function Uw(t,e,i,n,r){return r&&t*e>0&&i>0&&n>0}function Ww(t,e){return t*e>0}function Fw(t,e,i,n){return t*e>0&&i>0&&n>0}function jw(t,e,i,n,r,s,o,a){if(!t.pathProxy)return!1;const h=Sm(t,null==s?void 0:s.theme)[t.type],{fill:l=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:g=h.visible}=t.attribute,v=Nw(u,d,l),m=Ww(u,f),y=Dw(l),b=Lw(c,p);if(!g)return!0;if(!y&&!b)return!0;if(!(v||m||o||a))return!0;e.beginPath();return ug(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),b&&(a?a(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),y&&(o?o(e,t.attribute,h):v&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fill())),!0}function zw(t,e,i,n,r,s,o,a){const h=i-t,l=n-e,c=o-r,u=a-s;let d=u*h-c*l;return d*d<Qp?[]:(d=(c*(e-s)-u*(t-r))/d,[t+d*h,e+d*l])}function Hw(t,e,i,n,r,s,o){const a=t-i,h=e-n,l=(o?s:-s)/Math.sqrt(a*a+h*h),c=l*h,u=-l*a,d=t+c,p=e+u,f=i+c,g=n+u,v=(d+f)/2,m=(p+g)/2,y=f-d,b=g-p,x=y*y+b*b,w=r-s,A=d*g-f*p,S=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-A*A));let T=(A*b-y*S)/x,C=(-A*y-b*S)/x;const B=(A*b+y*S)/x,_=(-A*y+b*S)/x,P=T-v,E=C-m,M=B-v,k=_-m;return P*P+E*E>M*M+k*k&&(T=B,C=_),{cx:T,cy:C,x01:-c,y01:-u,x11:T*(r/w-1),y11:C*(r/w-1)}}function Gw(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=sf(h-a),c=h>a;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=Qp)e.moveTo(i,n);else if(l>=rf-Qp)e.moveTo(i+r*af(a),n+r*cf(a)),e.arc(i,n,r,a,h,!c),s>Qp&&(e.moveTo(i+s*af(h),n+s*cf(h)),e.arc(i,n,s,h,a,c));else{const d=t.getParsedCornerRadius(),{outerDeltaAngle:p,innerDeltaAngle:f,outerStartAngle:g,outerEndAngle:v,innerEndAngle:m,innerStartAngle:y}=t.getParsePadAngle(a,h),b=d,x=d,w=d,A=d,S=Math.max(x,b),T=Math.max(w,A);let C=S,B=T;const _=r*af(g),P=r*cf(g),E=s*af(m),M=s*cf(m);let k,R,O,I;if((T>Qp||S>Qp)&&(k=r*af(v),R=r*cf(v),O=s*af(y),I=s*cf(y),l<tf)){const t=zw(_,P,O,I,k,R,E,M);if(t){const e=_-t[0],i=P-t[1],n=k-t[0],o=R-t[1],a=1/cf(pf((e*n+i*o)/(uf(e*e+i*i)*uf(n*n+o*o)))/2),h=uf(t[0]*t[0]+t[1]*t[1]);B=lf(T,(s-h)/(a-1)),C=lf(S,(r-h)/(a+1))}}if(p<.001)o&&(o[3]||o[1])&&e.moveTo(i+_,n+P),u=!0;else if(C>Qp){const t=lf(b,C),s=lf(x,C),a=Hw(O,I,_,P,r,t,Number(c)),h=Hw(k,R,E,M,r,s,Number(c));C<S&&t===s?!o||o[0]?(e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),e.arc(i+a.cx,n+a.cy,C,of(a.y01,a.x01),of(h.y01,h.x01),!c)):e.moveTo(i+a.cx+C*af(of(h.y01,h.x01)),n+a.cy+C*cf(of(h.y01,h.x01))):!o||o[0]?(e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),t>0&&e.arc(i+a.cx,n+a.cy,t,of(a.y01,a.x01),of(a.y11,a.x11),!c),e.arc(i,n,r,of(a.cy+a.y11,a.cx+a.x11),of(h.cy+h.y11,h.cx+h.x11),!c),s>0&&e.arc(i+h.cx,n+h.cy,s,of(h.y11,h.x11),of(h.y01,h.x01),!c)):s>0?e.moveTo(i+h.cx+s*af(of(h.y01,h.x01)),n+h.cy+s*cf(of(h.y01,h.x01))):e.moveTo(i+k,n+r*cf(v))}else!o||o[0]?(e.moveTo(i+_,n+P),e.arc(i,n,r,g,v,!c)):e.moveTo(i+r*af(v),n+r*cf(v));if(!(s>Qp)||f<.001)!o||o[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),u=!0;else if(B>Qp){const t=lf(A,B),r=lf(w,B),a=Hw(E,M,k,R,s,-r,Number(c)),h=Hw(_,P,O,I,s,-t,Number(c));if(!o||o[1]?e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01):e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),B<T&&t===r){const t=of(h.y01,h.x01);!o||o[2]?e.arc(i+a.cx,n+a.cy,B,of(a.y01,a.x01),t,!c):e.moveTo(i+a.cx+af(t),n+a.cy+cf(t))}else!o||o[2]?(r>0&&e.arc(i+a.cx,n+a.cy,r,of(a.y01,a.x01),of(a.y11,a.x11),!c),e.arc(i,n,s,of(a.cy+a.y11,a.cx+a.x11),of(h.cy+h.y11,h.cx+h.x11),c),t>0&&e.arc(i+h.cx,n+h.cy,t,of(h.y11,h.x11),of(h.y01,h.x01),!c)):t>0?e.moveTo(i+h.cx+t*af(of(h.y01,h.x01)),n+h.cy+t*cf(of(h.y01,h.x01))):e.moveTo(i+O,n+I)}else!o||o[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),!o||o[2]?e.arc(i,n,s,m,y,c):e.moveTo(i+s*af(y),n+s*cf(y))}return o?o[3]&&e.lineTo(i+r*af(a),n+r*cf(a)):e.closePath(),u}class Vw{static GetCanvas(){try{return Vw.canvas||(Vw.canvas=Av.global.createCanvas({})),Vw.canvas}catch(t){return null}}static GetCtx(){if(!Vw.ctx){const t=Vw.GetCanvas();Vw.ctx=t.getContext("2d")}return Vw.ctx}}class Xw{constructor(t=[],e=100){const i=Vw.GetCanvas(),n=Vw.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 GetOrCreate(t=[],e=100){let i="";t.forEach((t=>i+=t.join())),i+=e;let n=Xw.dataMap.get(i);return n||(n=new Xw(t,e),Xw.dataMap.set(i,n)),n}static SetColorInterpolateInstance(t,e){Xw.dataMap.set(t,e)}static GetColorInterpolateInstance(t){return Xw.dataMap.get(t)}}Xw.dataMap=new Map;class Yw{static GetSize(t){for(let e=0;e<Yw.ImageSize.length;e++)if(Yw.ImageSize[e]>=t)return Yw.ImageSize[e];return t}static Get(t,e,i,n,r,s,o){const a=Yw.GenKey(t,e,i,n,r),h=Yw.cache[a];if(!h||0===h.length)return null;for(let t=0;t<h.length;t++)if(h[t].width>=s&&h[t].height>=o)return h[t].pattern;return null}static Set(t,e,i,n,r,s,o,a){const h=Yw.GenKey(t,e,i,n,r);Yw.cache[h]?Yw.cache[h].push({width:o,height:a,pattern:s}):Yw.cache[h]=[{width:o,height:a,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function qw(t,e,i,n){const{stops:r,startAngle:s,endAngle:o}=n;for(;i<0;)i+=rf;for(;i>rf;)i-=rf;if(i<s)return r[0].color;if(i>o)return r[0].color;let a,h,l=(i-s)/(o-s);for(let t=0;t<r.length;t++)if(r[t].offset>=l){a=r[t-1],h=r[t];break}return l=(l-a.offset)/(h.offset-a.offset),Qy(a.color,h.color,l,!1)}function Kw(t,e,i,n,r,s,o,a,h){const l=Math.floor(180*r/Math.PI),c=Vw.GetCanvas(),u=Vw.GetCtx();if(!u)return null;const d=Yw.GetSize(a),p=Yw.GetSize(h);let f=Yw.Get(e,i,n,s,o,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)))),v=l+1,m=r/Math.max(1,v-1),y=Xw.GetOrCreate(e,v),b=2*Math.PI*g/360;c.width=d,c.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=v-1;t<e&&!(s+t*m>o);t++){const e=y.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 c.width=x.width,c.height=x.height,u.putImageData(x,0,0),f=t.createPattern(c,"no-repeat"),f&&Yw.Set(e,i,n,s,o,f,d,p),f}Yw.cache={},Yw.ImageSize=[20,40,80,160,320,640,1280,2560];const $w=Symbol.for("ArcRenderContribution"),Zw=Symbol.for("AreaRenderContribution"),Jw=Symbol.for("CircleRenderContribution"),Qw=Symbol.for("GroupRenderContribution"),tA=Symbol.for("ImageRenderContribution"),eA=Symbol.for("PathRenderContribution"),iA=Symbol.for("PolygonRenderContribution"),nA=Symbol.for("RectRenderContribution"),rA=Symbol.for("SymbolRenderContribution"),sA=Symbol.for("TextRenderContribution"),oA=Symbol.for("InteractiveSubRenderContribution");t.DefaultCanvasArcRender=class{constructor(t){this.arcRenderContribitions=t,this.numberType=nw}drawArcTailCapPath(t,e,i,n,r,s,o,a){const h=a-o,l=t.getParsedAngle(),c=l.startAngle;let u=l.endAngle;u=a;const d=sf(u-c),p=u>c;let f=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),{outerDeltaAngle:v,innerDeltaAngle:m,outerStartAngle:y,outerEndAngle:b,innerEndAngle:x,innerStartAngle:w}=t.getParsePadAngle(c,u),A=g,S=g,T=g,C=g,B=Math.max(S,A),_=Math.max(T,C);let P=B,E=_;const M=r*af(y),k=r*cf(y),R=s*af(x),O=s*cf(x);let I,D,L,N;if((_>Qp||B>Qp)&&(I=r*af(b),D=r*cf(b),L=s*af(w),N=s*cf(w),d<tf)){const t=zw(M,k,L,N,I,D,R,O);if(t){const e=M-t[0],i=k-t[1],n=I-t[0],o=D-t[1],a=1/cf(pf((e*n+i*o)/(uf(e*e+i*i)*uf(n*n+o*o)))/2),h=uf(t[0]*t[0]+t[1]*t[1]);E=lf(_,(s-h)/(a-1)),P=lf(B,(r-h)/(a+1))}}if(P>Qp){const t=lf(A,P),s=lf(S,P),o=Hw(L,N,M,k,r,t,Number(p)),a=Hw(I,D,R,O,r,s,Number(p));if(P<B&&t===s)e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,P,of(o.y01,o.x01),of(a.y01,a.x01),!p);else{const t=u-h-.03,o=of(a.y11,a.x11);e.arc(i,n,r,t,o,!p),s>0&&e.arc(i+a.cx,n+a.cy,s,of(a.y11,a.x11),of(a.y01,a.x01),!p)}}else e.moveTo(i+M,n+k);if(!(s>Qp)||m<.001)e.lineTo(i+R,n+O),f=!0;else if(E>Qp){const t=lf(C,E),r=lf(T,E),o=Hw(R,O,I,D,s,-r,Number(p)),a=Hw(M,k,L,N,s,-t,Number(p));if(e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01),E<_&&t===r){const t=of(a.y01,a.x01);e.arc(i+o.cx,n+o.cy,E,of(o.y01,o.x01),t,!p)}else{r>0&&e.arc(i+o.cx,n+o.cy,r,of(o.y01,o.x01),of(o.y11,o.x11),!p);const t=of(o.cy+o.y11,o.cx+o.x11),a=u-h-.03;e.arc(i,n,s,t,a,p)}}else e.lineTo(i+s*af(w),n+s*cf(w));return f}drawShape(e,i,n,r,s,o,a,h){const l=Sm(e,null==o?void 0:o.theme).arc,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,fillOpacity:f=l.fillOpacity,lineWidth:g=l.lineWidth,strokeOpacity:v=l.strokeOpacity,visible:m=l.visible,x:y=l.x,y:b=l.y}=e.attribute,x=Nw(p,f,c),w=Ww(p,v),A=Dw(c,u),S=Lw(d,g);if(!e.valid||!m)return;if(!A&&!S)return;if(!(x||w||a||h||u))return;const{outerRadius:T=l.outerRadius,innerRadius:C=l.innerRadius,cap:B=l.cap,forceShowCap:_=l.forceShowCap}=e.attribute;let P=0;const E=(Rp(B)&&B||B[0])&&"conical"===c.gradient;if(E){const{sc:t,startAngle:i,endAngle:n}=e.getParsedAngle();sf(n-i)<rf-Qp&&(P=t||0,c.startAngle-=P,c.endAngle-=P)}let M=!1;const{isFullStroke:k,stroke:R}=ny(d);if(A||k){if(i.beginPath(),Gw(e,i,n,r,T,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)}))}M=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,A,S,x,w,l,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),A&&(a?a(i,e.attribute,l):x&&(i.setCommonStyle(e,e.attribute,y-n,b-r,l),i.fill())),S&&k&&(h?h(i,e.attribute,l):w&&(i.setStrokeStyle(e,e.attribute,y-n,b-r,l),i.stroke()))}if(!k&&S){if(i.beginPath(),Gw(e,i,n,r,T,C,R),!M){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)}))}M=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,A,S,x,w,l,s,a,h)}))}h?h(i,e.attribute,l):w&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke())}if((Rp(B)&&B||B[1])&&_){const{startAngle:o,endAngle:c}=e.getParsedAngle();if(sf(c-o)>=rf-Qp){i.beginPath();const o=Math.abs(T-C)/2/T,{endAngle:c=l.endAngle,fill:u=l.fill}=e.attribute,d=c;if(this.drawArcTailCapPath(e,i,n,r,T,C,d,d+o),!M){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)}))}M=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,A,S,x,w,l,s,a,h)}))}if(A){const t=u;if("conical"===t.gradient){const s=qw(0,0,c,t);a||Nw&&(i.setCommonStyle(e,e.attribute,n,r,l),i.fillStyle=s,i.fill())}}S&&(h||w&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke()))}}this._arcAfterRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,A,S,x,w,l,s,a,h)})),E&&(c.startAngle+=P,c.endAngle+=P)}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=Sm(t,null==n?void 0:n.theme).arc;r.highPerformanceSave();let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);jw(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasArcRender=vp([hp(),mp(0,up(xp)),mp(0,lp($w)),yp("design:paramtypes",[Object])],t.DefaultCanvasArcRender),t.DefaultCanvasCircleRender=class{constructor(t){this.circleRenderContribitions=t,this.numberType=ow}drawShape(e,i,n,r,s,o,a,h){const l=Sm(e,null==o?void 0:o.theme).circle,{fill:c=l.fill,background:u,stroke:d=l.stroke,radius:p=l.radius,startAngle:f=l.startAngle,endAngle:g=l.endAngle,fillOpacity:v=l.fillOpacity,strokeOpacity:m=l.strokeOpacity,opacity:y=l.opacity,lineWidth:b=l.lineWidth,visible:x=l.visible,x:w=l.x,y:A=l.y}=e.attribute,S=Nw(y,v,c),T=Ww(y,m),C=Dw(c,u),B=Lw(d,b);e.valid&&x&&(C||B)&&(S||T||a||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((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),C&&(a?a(i,e.attribute,l):S&&(i.setCommonStyle(e,e.attribute,w-n,A-r,l),i.fill())),B&&(h?h(i,e.attribute,l):T&&(i.setStrokeStyle(e,e.attribute,w-n,A-r,l),i.stroke())),this._circleRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h)})))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).circle;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);jw(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasCircleRender=vp([hp(),mp(0,up(xp)),mp(0,lp(Jw)),yp("design:paramtypes",[Object])],t.DefaultCanvasCircleRender);const aA=["radius","startAngle","endAngle",...yb];class hA extends Tb{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=ow}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=Sm(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=Av.graphicService.updateCircleAABBBounds(i,Sm(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=sy(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Sm(this).circle[t]}needUpdateTags(t){for(let e=0;e<aA.length;e++){const i=aA[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<aA.length;e++){if(t===aA[e])return!0}return!1}toCustomPath(){var t,e,i;const n=this.attribute,r=null!==(t=n.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),s=null!==(e=n.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),o=null!==(i=n.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),a=new qg;return a.arc(0,0,r,s,o),a}clone(){return new hA(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return hA.NOWORK_ANIMATE_ATTR}}function lA(t,e={},i){i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:o=e.fontSize,fontFamily:a=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(s?s+" ":"")+o*i+"px "+(a||"sans-serif")}function cA(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function uA(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)}hA.NOWORK_ANIMATE_ATTR=Sb;class dA{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,o,a,h){const l=[],c=[e,i],u=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,a);l.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===n||"start"===n||("center"===n?u[0]=c[0]/-2:"right"!==n&&"end"!==n||(u[0]=-c[0])),"top"===r||("middle"===r?u[1]=c[1]/-2:"bottom"===r&&(u[1]=-c[1]));const d={xOffset:u[0],yOffset:u[1],width:c[0],height:c[1]};return this.layoutWithBBox(d,l,n,r,s)}GetLayoutByLines(t,e,i,n,r="",s,o){t=t.map((t=>t.toString()));const a=[],h=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),o),a.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,r,s).str,width:e});h[0]=o}else{let e,i;o=0;for(let n=0,r=t.length;n<r;n++)i=t[n],e=this.textMeasure.measureTextWidth(i,this.textOptions),o=Math.max(o,e),a.push({str:i,width:e});h[0]=o}h[1]=a.length*n,h[0]=a.reduce(((t,e)=>Math.max(t,e.width)),0);const l={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(l,e,i),this.layoutWithBBox(l,a,e,i,n)}layoutWithBBox(t,e,i,n,r){const s=[0,0],o=e.length*r;"top"===n||("middle"===n?s[1]=(t.height-o)/2:"bottom"===n&&(s[1]=t.height-o));for(let o=0;o<e.length;o++)this.lineOffset(t,e[o],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 pA=["text","maxLineWidth","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak",...yb];class fA extends Tb{get font(){const t=Sm(this).text;return this._font||(this._font=lA(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=Sm(this).text;if(Array.isArray(e.text))return;const{maxLineWidth:n=i.maxLineWidth}=e;return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){if(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=Sm(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.toString())}get multilineLayout(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=yw,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return null!=t&&""!==t}doUpdateAABBBounds(){const t=Sm(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=this.attribute,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}updateSingallineAABBBounds(t){const e=Sm(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}updateMultilineAABBBounds(t){const e=Sm(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}updateHorizontalSinglelineAABBBounds(t){var e,i;const n=Sm(this).text,r=Av.graphicUtil.textMeasure;let s,o;const a=this.attribute,{maxLineWidth:h=n.maxLineWidth,ellipsis:l=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontFamily:d=n.fontFamily,fontSize:p=n.fontSize,fontWeight:f=n.fontWeight,stroke:g=n.stroke,lineWidth:v=n.lineWidth,wordBreak:m=n.wordBreak,ignoreBuf:y=n.ignoreBuf}=a,b=y?0:Math.max(2,.075*p),{lineHeight:x=(null!==(e=a.lineHeight)&&void 0!==e?e:(a.fontSize||n.fontSize)+b)}=a;if(!this.shouldUpdateShape()&&this.cache){s=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0;const t=cA(c,s),e=uA(u,x,p);return this._AABBBounds.set(t,e,t+s,e+x),g&&this._AABBBounds.expand(v/2),this._AABBBounds}if(Number.isFinite(h)){if(l){const e=!0===l?n.ellipsis:l,i=r.clipTextWithSuffix(t.toString(),{fontSize:p,fontWeight:f,fontFamily:d},h,e,!1);o=i.str,s=i.width}else{const e=r.clipText(t.toString(),{fontSize:p,fontWeight:f,fontFamily:d},h,!1);o=e.str,s=e.width}this.cache.clipedText=o,this.cache.clipedWidth=s}else s=r.measureTextWidth(t.toString(),{fontSize:p,fontWeight:f,fontFamily:d}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=s;this.clearUpdateShapeTag();const w=cA(c,s);let A=x;Av.global&&Av.global.isSafari()&&(A+=.2*p);const S=uA(u,A,p,b);return this._AABBBounds.set(w,S,w+s,S+A),g&&this._AABBBounds.expand(v/2),this._AABBBounds}getBaselineMapAlign(){return fA.baselineMapAlign}getAlignMapBaseline(){return fA.alignMapBaseline}updateVerticalSinglelineAABBBounds(e){var i,n,r;const s=Sm(this).text,o=Av.graphicUtil.textMeasure;let a;const h=this.attribute,{ignoreBuf:l=s.ignoreBuf}=h,c=l?0:2,{maxLineWidth:u=s.maxLineWidth,ellipsis:d=s.ellipsis,fontSize:p=s.fontSize,fontWeight:f=s.fontWeight,fontFamily:g=s.fontFamily,stroke:v=s.stroke,lineHeight:m=(null!==(i=h.lineHeight)&&void 0!==i?i:(h.fontSize||s.fontSize)+c),lineWidth:y=s.lineWidth,verticalMode:b=s.verticalMode}=h;let{textAlign:x=s.textAlign,textBaseline:w=s.textBaseline}=h;if(!b){const t=x;x=null!==(n=fA.baselineMapAlign[w])&&void 0!==n?n:"left",w=null!==(r=fA.alignMapBaseline[t])&&void 0!==r?r:"top"}if(!this.shouldUpdateShape()&&this.cache){a=this.cache.clipedWidth;const t=cA(x,a),e=uA(w,m,p);return this._AABBBounds.set(e,t,e+m,t+a),v&&this._AABBBounds.expand(y/2),this._AABBBounds}let A=[Jx(e.toString())];if(Number.isFinite(u)){if(d){const t=!0===d?s.ellipsis:d,e=o.clipTextWithSuffixVertical(A[0],{fontSize:p,fontWeight:f,fontFamily:g},u,t,!1);A=[e.verticalList],a=e.width}else{const t=o.clipTextVertical(A[0],{fontSize:p,fontWeight:f,fontFamily:g},u,!1);A=[t.verticalList],a=t.width}this.cache.verticalList=A,this.cache.clipedWidth=a}else a=0,A[0].forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?p:o.measureTextWidth(e.text,{fontSize:p,fontWeight:f,fontFamily:g});a+=i,e.width=i})),this.cache.verticalList=A,this.cache.clipedWidth=a;this.clearUpdateShapeTag();const S=cA(x,a),T=uA(w,m,p);return this._AABBBounds.set(T,S,T+m,S+a),v&&this._AABBBounds.expand(y/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e;const i=Sm(this).text,n=this.attribute,{fontFamily:r=i.fontFamily,textAlign:s=i.textAlign,textBaseline:o=i.textBaseline,fontSize:a=i.fontSize,fontWeight:h=i.fontWeight,lineHeight:l=n.lineHeight||n.fontSize||i.fontSize,ellipsis:c=i.ellipsis,maxLineWidth:u,stroke:d=i.stroke,lineWidth:p=i.lineWidth,wordBreak:f=i.wordBreak}=n;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const g=Av.graphicUtil.textMeasure,v=new dA(r,{fontSize:a,fontWeight:h,fontFamily:r},g).GetLayoutByLines(t,s,o,l,!0===c?i.ellipsis:c||void 0,!1,u),{bbox:m}=v;return this.cache.layoutData=v,this.clearUpdateShapeTag(),this._AABBBounds.set(m.xOffset,m.yOffset,m.xOffset+m.width,m.yOffset+m.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var i,n,r;const s=Sm(this).text,o=Av.graphicUtil.textMeasure;let a;const h=this.attribute,{ignoreBuf:l=s.ignoreBuf}=h,c=l?0:2,{maxLineWidth:u=s.maxLineWidth,ellipsis:d=s.ellipsis,fontFamily:p=s.fontFamily,fontSize:f=s.fontSize,fontWeight:g=s.fontWeight,stroke:v=s.stroke,lineHeight:m=(null!==(i=h.lineHeight)&&void 0!==i?i:(h.fontSize||s.fontSize)+c),lineWidth:y=s.lineWidth,verticalMode:b=s.verticalMode}=h;let{textAlign:x=s.textAlign,textBaseline:w=s.textBaseline}=h;if(!b){const t=x;x=null!==(n=fA.baselineMapAlign[w])&&void 0!==n?n:"left",w=null!==(r=fA.alignMapBaseline[t])&&void 0!==r?r:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=hf(e,a)}));const t=cA(x,a),e=this.cache.verticalList.length*m,i=uA(w,e,f);return this._AABBBounds.set(i,t,i+e,t+a),v&&this._AABBBounds.expand(y/2),this._AABBBounds}const A=e.map((t=>Jx(t.toString())));A.forEach(((e,i)=>{if(Number.isFinite(u))if(d){const t=!0===d?s.ellipsis:d,n=o.clipTextWithSuffixVertical(e,{fontSize:f,fontWeight:g,fontFamily:p},u,t,!1);A[i]=n.verticalList,a=n.width}else{const t=o.clipTextVertical(e,{fontSize:f,fontWeight:g,fontFamily:p},u,!1);A[i]=t.verticalList,a=t.width}else a=0,e.forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?f:o.measureTextWidth(e.text,{fontSize:f,fontWeight:g,fontFamily:p});a+=i,e.width=i}))})),this.cache.verticalList=A,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=hf(e,a)}));const S=cA(x,a),T=this.cache.verticalList.length*m,C=uA(w,T,f);return this._AABBBounds.set(C,S,C+T,S+a),v&&this._AABBBounds.expand(y/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Sm(this).text[t]}needUpdateTags(t){for(let e=0;e<pA.length;e++){const i=pA[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<pA.length;e++){if(t===pA[e])return!0}return!1}clone(){return new fA(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return fA.NOWORK_ANIMATE_ATTR}}fA.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Sb),fA.baselineMapAlign={top:"left",bottom:"right",middle:"center"},fA.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const gA=["heightLimit","lineClamp"];class vA extends fA{_isValid(){const{text:t}=this.attribute;return Wp(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,n;const r=Sm(this).text,{fontFamily:s=r.fontFamily,textAlign:o=r.textAlign,textBaseline:a=r.textBaseline,fontSize:h=r.fontSize,lineHeight:l=this.attribute.lineHeight||this.attribute.fontSize||r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:u,stroke:d=r.stroke,lineWidth:p=r.lineWidth,wordBreak:f=r.wordBreak,fontWeight:g=r.fontWeight,ignoreBuf:v=r.ignoreBuf,heightLimit:m=0,lineClamp:y}=this.attribute,b=v?0:2;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const x=Av.graphicUtil.textMeasure,w=new dA(s,{fontSize:h,fontWeight:g,fontFamily:s},x),A=t.map((t=>t.toString())),S=[],T=[0,0];let C=1/0;if(m>0&&(C=Math.max(Math.floor(m/l),1)),y&&(C=Math.min(C,y)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<A.length;t++){const e=A[t];let r=!0;if(t===C-1){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,u,c,!1);S.push({str:t.str,width:t.width});break}const s=w.textMeasure.clipText(e,w.textOptions,u,"break-word"===f);if(""!==e&&""===s.str){if(c){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,u,c,!1);s.str=null!==(i=t.str)&&void 0!==i?i:"",s.width=null!==(n=t.width)&&void 0!==n?n:0}else s.str="",s.width=0;r=!1}if(S.push({str:s.str,width:s.width}),s.str.length===e.length);else if(r){const i=e.substring(s.str.length);A.splice(t+1,0,i)}}let t=0;S.forEach((e=>{t=Math.max(t,e.width)})),T[0]=t}else{let t,e,i=0;for(let n=0,r=A.length;n<r;n++){if(n===C-1){const t=w.textMeasure.clipTextWithSuffix(A[n],w.textOptions,u,c,!1);S.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=A[n],t=w.textMeasure.measureTextWidth(e,w.textOptions,"break-word"===f),i=Math.max(i,t),S.push({str:e,width:t})}T[0]=i}T[1]=S.length*(l+b);const B={xOffset:0,yOffset:0,width:T[0],height:T[1]};w.LayoutBBox(B,o,a);const _=w.layoutWithBBox(B,S,o,a,l);return this.cache.layoutData=_,this.clearUpdateShapeTag(),this._AABBBounds.set(B.xOffset,B.yOffset,B.xOffset+B.width,B.yOffset+B.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<gA.length;e++){const i=gA[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<gA.length;e++){if(t===gA[e])return!0}return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return vA.NOWORK_ANIMATE_ATTR}}function mA(t,e,i,n,r){return r?t.arc(i,n,e,0,nf,!1,r):t.arc(i,n,e,0,nf),!1}var yA=new class{constructor(){this.type="circle",this.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 mA(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return mA(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 bA=new class{constructor(){this.type="cross",this.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 xA(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 wA=new class{constructor(){this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,r){return xA(t,e/2,i,n,r)}drawFitDir(t,e,i,n,r){return xA(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return xA(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 AA(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var SA=new class{constructor(){this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return AA(t,e/2,i,n)}drawOffset(t,e,i,n,r){return AA(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 TA{constructor(){this.type="triangleUp",this.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 CA=new TA;var BA=new class extends TA{constructor(){super(...arguments),this.type="triangle"}};const _A=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),PA=Math.sin(nf/10)*_A,EA=-Math.cos(nf/10)*_A;function MA(t,e,i,n){const r=PA*e,s=EA*e;t.moveTo(i,-e+n),t.lineTo(r+i,s+n);for(let o=1;o<5;++o){const a=nf*o/5,h=Math.cos(a),l=Math.sin(a);t.lineTo(l*e+i,-h*e+n),t.lineTo(h*r-l*s+i,l*r+h*s+n)}return t.closePath(),!0}var kA=new class{constructor(){this.type="star",this.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 MA(t,e/2,i,n)}drawOffset(t,e,i,n,r){return MA(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 RA=uf(3);function OA(t,e,i,n){const r=e,s=r/RA,o=s/5,a=e;return t.moveTo(0+i,-r+n),t.lineTo(s/2+i,n),t.lineTo(o/2+i,n),t.lineTo(o/2+i,a+n),t.lineTo(-o/2+i,a+n),t.lineTo(-o/2+i,n),t.lineTo(-s/2+i,n),t.closePath(),!0}var IA=new class{constructor(){this.type="arrow",this.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 OA(t,e/2,i,n)}drawOffset(t,e,i,n,r){return OA(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 DA(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 LA=new class{constructor(){this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return DA(t,e/2,i,n)}drawOffset(t,e,i,n,r){return DA(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 NA(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var UA=new class{constructor(){this.type="stroke",this.pathStr=""}draw(t,e,i,n){return NA(t,e/2,i,n)}drawOffset(t,e,i,n,r){return NA(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 WA=-.5,FA=uf(3)/2,jA=1/uf(12);function zA(t,e,i,n){const r=e/2,s=e*jA,o=r,a=e*jA+e,h=-o,l=a;return t.moveTo(r+i,s+n),t.lineTo(o+i,a+n),t.lineTo(h+i,l+n),t.lineTo(WA*r-FA*s+i,FA*r+WA*s+n),t.lineTo(WA*o-FA*a+i,FA*o+WA*a+n),t.lineTo(WA*h-FA*l+i,FA*h+WA*l+n),t.lineTo(WA*r+FA*s+i,WA*s-FA*r+n),t.lineTo(WA*o+FA*a+i,WA*a-FA*o+n),t.lineTo(WA*h+FA*l+i,WA*l-FA*h+n),t.closePath(),!1}var HA=new class{constructor(){this.type="wye",this.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 zA(t,e/2,i,n)}drawOffset(t,e,i,n,r){return zA(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 GA=new class{constructor(){this.type="triangleLeft",this.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 VA=new class{constructor(){this.type="triangleRight",this.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 XA=new class{constructor(){this.type="triangleDown",this.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 YA=uf(3);function qA(t,e,i,n){const r=e*YA;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var KA=new class extends TA{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return qA(t,e/2/YA,i,n)}drawOffset(t,e,i,n,r){return qA(t,e/2/YA+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function $A(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 ZA=new class{constructor(){this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return $A(t,e/4,i,n)}drawOffset(t,e,i,n,r){return $A(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 JA(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 QA=new class{constructor(){this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return JA(t,e/4,i,n)}drawOffset(t,e,i,n,r){return JA(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 tS(t,e,i,n){const r=2*e;return t.moveTo(i-r,n+e),t.lineTo(i,n-e),t.lineTo(i+r,n+e),!0}var eS=new class{constructor(){this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return tS(t,e/4,i,n)}drawOffset(t,e,i,n,r){return tS(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 iS(t,e,i,n){const r=2*e;return t.moveTo(i-r,n-e),t.lineTo(i,n+e),t.lineTo(i+r,n-e),!0}var nS=new class{constructor(){this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return iS(t,e/4,i,n)}drawOffset(t,e,i,n,r){return iS(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 rS(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var sS=new class{constructor(){this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,r){return rS(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return rS(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e}, ${i-r} L ${e},${i+r}`}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function oS(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var aS=new class{constructor(){this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,r){return oS(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return oS(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} L ${e+r},${i}`}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function hS(t,e,i,n,r){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var lS=new class{constructor(){this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,r){return hS(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return hS(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i-r} L ${e+r},${i+r} M ${e+r}, ${i-r} L ${e-r},${i+r}`}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function cS(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}var uS=new class{constructor(){this.type="rect",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return cS(t,jp(e)?[e,e]:e,i,n)}drawOffset(t,e,i,n,r){return cS(t,jp(e)?[e+2*r,e+2*r]:[e[0]+2*r,e[1]+2*r],i,n)}bounds(t,e){const i=jp(t)?[t,t]:t;e.x1=-i[0]/2,e.x2=i[0]/2,e.y1=-i[1]/2,e.y2=i[1]/2}};const dS=new wf;class pS{constructor(t,e,i=!1){this.pathStr="",this.type=t,Wp(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,r,s,o){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),ug(r.path.commandList,t,i,n,e,e),o&&o(r.path,r.attribute)})),!1):(ug(this.path.commandList,t,i,n,e+r,e+r),!1)}draw(t,e,i,n,r,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),ug(r.path.commandList,t,i,n,e,e),s&&s(r.path,r.attribute)})),!1):(ug(this.path.commandList,t,i,n,e,e),!1)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{dS.x1=i.bounds.x1*t,dS.y1=i.bounds.y1*t,dS.x2=i.bounds.x2*t,dS.y2=i.bounds.y2*t,e.union(dS)}))}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 fS=[yA,bA,wA,SA,KA,BA,kA,IA,LA,UA,HA,GA,VA,CA,XA,ZA,QA,eS,nS,uS,sS,aS,lS],gS={};fS.forEach((t=>{gS[t.type]=t}));const vS=["symbolType","size",...yb];let mS=class t extends Tb{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=mw}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return Wp(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=Sm(this).symbol,{symbolType:i=e.symbolType}=this.attribute;let n=gS[i];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[i],n)return this._parsedPath=n,n;if(!0===Yx.XMLValidator.validate(i,{allowBooleanAttributes:!0})){const e=new Yx.XMLParser({ignoreAttributes:!1}),{svg:n}=e.parse(i);if(!n)return null;const r=Wp(n.path)?n.path:[n.path],s=new wf,o=[];r.forEach((t=>{const e=(new qg).fromString(t["@_d"]),i={fill:"black"};Tw.forEach((e=>{t[e]&&(i[Sw[e]]=t[e])})),o.push({path:e,attribute:i}),s.union(e.bounds)}));const a=s.width(),h=s.height(),l=1/hf(a,h);return o.forEach((t=>t.path.transform(0,0,l,l))),this._parsedPath=new pS(i,o,!0),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}const r=(new qg).fromString(i),s=r.bounds.width(),o=r.bounds.height(),a=1/hf(s,o);return r.transform(0,0,a,a),this._parsedPath=new pS(i,r),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=Sm(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=Av.graphicService.updateSymbolAABBBounds(i,Sm(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=sy(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Sm(this).symbol[t]}needUpdateTags(t){for(let e=0;e<vS.length;e++){const i=vS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<vS.length;e++){if(t===vS[e])return!0}return!1}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=Wp(e)?e:[e,e];return t.path?(new qg).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new qg).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};mS.userSymbolMap={},mS.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Sb);const yS=["segments","points","curveType",...yb];let bS=class t extends Tb{constructor(t={}){super(t),this.type="line",this.numberType=cw}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=uy(i,n,e))}doUpdateAABBBounds(){const t=Sm(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateLineAABBBounds(e,Sm(this).line,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Sm(this).line[t]}needUpdateTags(t){for(let e=0;e<yS.length;e++){const i=yS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<yS.length;e++){if(t===yS[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=new qg,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(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};bS.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Sb);const xS=["width","height","cornerRadius",...yb];class wS extends Tb{constructor(t){super(t),this.type="rect",this.numberType=fw}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{width:t,height:e}=this.attribute;return this._validNumber(t)&&this._validNumber(e)}doUpdateAABBBounds(){const t=Sm(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateRectAABBBounds(e,Sm(this).rect,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Sm(this).rect[t]}needUpdateTags(t){for(let e=0;e<xS.length;e++){const i=xS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<xS.length;e++){if(t===xS[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=t.width,i=t.height,n=new qg;return n.moveTo(0,0),n.rect(0,0,e,i),n}clone(){return new wS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return wS.NOWORK_ANIMATE_ATTR}}wS.NOWORK_ANIMATE_ATTR=Sb;const AS=[[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 SS extends wS{constructor(t){super(t),this.type="rect3d",this.numberType=gw}findFace(){const t={polygons:[],vertices:[],edges:[]},e=Sm(this).rect3d,{width:i=e.width,height:n=e.width,length:r=lf(e.width,e.height)}=this.attribute;for(let e=0;e<AS.length;e++){const s=AS[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}getNoWorkAnimateAttr(){return SS.NOWORK_ANIMATE_ATTR}}SS.NOWORK_ANIMATE_ATTR=Sb;class TS extends Tb{constructor(t){super(t),this.type="glyph",this.numberType=aw,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=Av.graphicService.updateGlyphAABBBounds(this.attribute,Sm(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const n={},r=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const s=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];s&&(Object.assign(n,s.attributes),(null===(i=s.subAttributes)||void 0===i?void 0:i.length)&&r.forEach(((t,e)=>{Object.assign(t,s.subAttributes[e])})))})),this.subGraphic.forEach(((i,n)=>{i.updateNormalAttrs(r[n]),i.applyStateAttrs(r[n],t,e)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,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 TS(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return TS.NOWORK_ANIMATE_ATTR}}TS.NOWORK_ANIMATE_ATTR=Sb;class CS{constructor(t,e,i,n,r,s,o,a,h,l,c,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=o,this.lines=[],this.globalAlign=a,this.globalBaseline=h,this.layoutDirection=l,this.directionKey=Sv[this.layoutDirection],this.isWidthMax=c,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 o=0;switch(this.globalBaseline){case"top":o=0;break;case"middle":o=-s/2;break;case"bottom":o=-s}let a=0;switch(this.globalAlign){case"left":a=0;break;case"center":a=-r/2;break;case"right":a=-r}let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let l=!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 l;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,l=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}else{const i=Math.floor((h-this.actualHeight)/2);"vertical"===this.layoutDirection?a+=i:o+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,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,a,s+o,e);else{if(s+r>this[this.directionKey.top]+h||s<this[this.directionKey.top])return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,l=!0),this.lines[i].draw(t,n,a,s+o,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(a+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(a-=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]+a,this.lines[i][this.directionKey.top]+o,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;{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,l=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}}}}return l}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],o=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(o+s>this[this.directionKey.top]+r||o<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&o-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 BS{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:o}=kv(t,i);let a=0,h=0,l=0;this.height>r&&(a=(this.height-r)/2,h=Math.ceil(a),l=Math.floor(a)),"top"===this.textBaseline?(this.ascent=a,this.descent=r-a):"bottom"===this.textBaseline?(this.ascent=r-a,this.descent=a):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=s+l),this.length=t.length,this.width=o||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}=kv(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,o=this.left+i;e+=this.top;let a=this.direction;if(this.verticalEllipsis)s="...",a="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+="...","right"===r&&(o-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Ev(s,("vertical"===a?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}=kv(this.text.slice(t),this.character);"vertical"===a||(o-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===a&&(t.save(),t.rotateAbout(Math.PI/2,o,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(o,e),o=0,e=0),this.character.stroke&&(!function(t,e){const i=e&&e.stroke||Cv;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,o,e)),function(t,e){const i=e&&e.fill||Tv;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,o,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(o,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(o,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(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===a&&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=Ev(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+="...";const{width:n}=kv(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const _S=["width","height","image",...yb];class PS extends Tb{constructor(t){super(t),this.type="image",this.numberType=lw,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"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=Sm(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateImageAABBBounds(e,Sm(this).image,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return xv[t]}needUpdateTags(t){for(let e=0;e<_S.length;e++){const i=_S[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<_S.length;e++){if(t===_S[e])return!0}return!1}clone(){return new PS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return PS.NOWORK_ANIMATE_ATTR}}PS.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Sb);class ES extends PS{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=sy(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(Wp(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=sy(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=xv.width,height:e=xv.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 MS{constructor(t,e,i,n,r,s,o,a){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 ES?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=o,this.directionKey=Sv[this.direction];const h=this.directionKey;this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof BS){const e=Pv.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=a?0:this.width-this.actualWidth;let c=this.left,u=0;if(this.actualWidth<e&&!a)switch(this.textAlign){case"right":c=e-this.actualWidth;break;case"center":c=(e-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?c=(e-this.actualWidth)/2:u=(e-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof ES?(t["_"+h.x]=c,c+=t[h.width]+u,t["_"+h.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?l-t.height:(l-t.height)/2):(t[h.left]=c,c+=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 ES)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const{width:n}=kv("...",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 ES)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 ES)break;const{width:n}=kv("...",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 ES?t.width:t.getWidthWithEllips(this.direction)})),e}}class kS{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=Sv[this.direction]}store(t){if(t instanceof ES){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 MS(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 ES?"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=Ev(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 BS(i,t.newLine,t.character),new BS(n,!0,t.character)]}(t,n);this.store(e),this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const RS=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...yb];class OS extends Tb{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=vw}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:bv.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:bv.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(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:bv.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:bv.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:bv.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:bv.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:bv.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:bv.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=Sm(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateRichTextAABBBounds(e,Sm(this).richtext,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return bv[t]}needUpdateTags(t){for(let e=0;e<RS.length;e++){const i=RS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<RS.length;e++){if(t===RS[e])return!0}return!1}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}doUpdateFrameCache(){var t;const{textConfig:e,maxWidth:i,maxHeight:n,width:r,height:s,ellipsis:o,wordBreak:a,verticalDirection:h,textAlign:l,textBaseline:c,layoutDirection:u,singleLine:d}=this.attribute,p=[];for(let t=0;t<e.length;t++)if("image"in e[t]){const i=e[t],n=i.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(i.id);if(n)p.push(n);else{const t=new ES(i);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=i.id,p.push(t)}}else if(e[t].text.includes("\n")){const i=e[t].text.split("\n");for(let n=0;n<i.length;n++)p.push(new BS(i[n],0!==n,e[t]))}else p.push(new BS(e[t].text,!1,e[t]));const f=new CS(0,0,("number"==typeof i&&(!r||r>i)?i:r)||0,("number"==typeof n&&(!s||s>n)?n:s)||0,o,a,h,l,c,u||"horizontal","number"==typeof i&&(!r||r>i),"number"==typeof n&&(!s||s>n),d||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),g=new kS(f);for(let t=0;t<p.length;t++)g.deal(p[t]);g.send(),this._frameCache=f}clone(){return new OS(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e);this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{var e,i,n,r,s;const o=this.pickIcon(t.global);o&&o===this._currentHoverIcon||(o?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=o,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(o.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):!o&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame()))})),this.addEventListener("pointerleave",(t=>{var e,i;this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(e=this.stage)||void 0===e||e.setCursor(),null===(i=this.stage)||void 0===i||i.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let r;return e.icons.forEach((e=>{var s,o;e.AABBBounds.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(null!==(s=r.attribute.x)&&void 0!==s?s:0)+i,r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+n)})),r}getNoWorkAnimateAttr(){return OS.NOWORK_ANIMATE_ATTR}}OS.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Sb);const IS=["path","customPath",...yb];class DS extends Tb{constructor(t){super(t),this.type="path",this.numberType=uw}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=Sm(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof qg?e.path:(Ip(this.cache)&&this.doUpdatePathShape(),this.cache instanceof qg?this.cache:t.path)}doUpdateAABBBounds(){const t=Sm(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updatePathAABBBounds(e,Sm(this).path,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;Up(t.path,!0)?this.cache=(new qg).fromString(t.path):t.customPath&&(this.cache=new qg,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Sm(this).path[t]}needUpdateTags(t){for(let e=0;e<IS.length;e++){const i=IS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<IS.length;e++){if(t===IS[e])return!0}return!1}toCustomPath(){return(new qg).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new DS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return DS.NOWORK_ANIMATE_ATTR}}DS.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Sb);const LS=["segments","points","curveType",...yb];class NS extends Tb{constructor(t){super(t),this.type="area",this.numberType=sw}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=Sm(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateAreaAABBBounds(e,Sm(this).area,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=uy(i,n,e))}getDefaultAttribute(t){return Sm(this).area[t]}needUpdateTags(t){for(let e=0;e<LS.length;e++){const i=LS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<LS.length;e++){if(t===LS[e])return!0}return!1}toCustomPath(){const t=new qg,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var r,s;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(s=e.y1)&&void 0!==s?s: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 NS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return NS.NOWORK_ANIMATE_ATTR}}NS.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Sb);const US=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...yb];class WS extends Tb{constructor(t){super(t),this.type="arc",this.numberType=nw}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=Sm(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(jp(e,!0)?e:r*parseFloat(e)/100,r/2)}getParsedAngle(){const t=Sm(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=Af(e),i=e+s,n&&sf(s)<rf-Qp){let s=1,o=1;n.length&&(s=Number(n[0]),o=Number(n[1]));const{outerRadius:a=t.outerRadius,innerRadius:h=t.innerRadius}=this.attribute,l=Math.abs(a-h)/2,c=l/a;if(l>Qp&&a>Qp)return{startAngle:e-r*c*s,endAngle:i+r*c*o,sc:r*c*s,ec:r*c*o}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=Sm(this).arc,{outerRadius:n=i.outerRadius,innerRadius:r=i.innerRadius,padAngle:s=i.padAngle}=this.attribute,{padRadius:o=uf(n*n+r*r)}=this.attribute,a=sf(e-t);let h=t,l=e,c=t,u=e;const d=s/2;let p=a,f=a;if(d>Qp&&o>Qp){const i=e>t?1:-1;let s=ff(Number(o)/r*cf(d)),a=ff(Number(o)/n*cf(d));return(p-=2*s)>Qp?(s*=i,c+=s,u-=s):(p=0,c=u=(t+e)/2),(f-=2*a)>Qp?(a*=i,h+=a,l-=a):(f=0,h=l=(t+e)/2),{outerStartAngle:h,outerEndAngle:l,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}return{outerStartAngle:h,outerEndAngle:l,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}doUpdateAABBBounds(t){const e=Sm(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=Av.graphicService.updateArcAABBBounds(i,Sm(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=sy(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){for(let e=0;e<US.length;e++){const i=US[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<US.length;e++){if(t===US[e])return!0}return!1}getDefaultAttribute(t){return Sm(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let n=t.innerRadius,r=t.outerRadius;const s=sf(i-e),o=i>e;if(r<n){const t=r;r=n,n=t}const a=new qg;if(r<=Qp)a.moveTo(0,0);else if(s>=rf-Qp)a.moveTo(0+r*af(e),0+r*cf(e)),a.arc(0,0,r,e,i,!o),n>Qp&&(a.moveTo(0+n*af(i),0+n*cf(i)),a.arc(0,0,n,i,e,o));else{const t=r*af(e),s=r*cf(e),h=n*af(i),l=n*cf(i);a.moveTo(0+t,0+s),a.arc(0,0,r,e,i,!o),a.lineTo(0+h,0+l),a.arc(0,0,n,i,e,o),a.closePath()}return a}clone(){return new WS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return WS.NOWORK_ANIMATE_ATTR}}WS.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Sb);class FS extends WS{constructor(t){super(t),this.type="arc3d",this.numberType=rw}doUpdateAABBBounds(){const t=Sm(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updateArc3dAABBBounds(e,Sm(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}getNoWorkAnimateAttr(){return FS.NOWORK_ANIMATE_ATTR}}FS.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Sb);const jS=["points","cornerRadius",...yb];class zS extends Tb{constructor(t){super(t),this.type="polygon",this.numberType=dw}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=Sm(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updatePolygonAABBBounds(e,Sm(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=uy(i,n,e))}getDefaultAttribute(t){return Sm(this).polygon[t]}needUpdateTags(t){for(let e=0;e<jS.length;e++){const i=jS[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<jS.length;e++){if(t===jS[e])return!0}return!1}toCustomPath(){const t=this.attribute.points,e=new qg;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 zS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return zS.NOWORK_ANIMATE_ATTR}}zS.NOWORK_ANIMATE_ATTR=Sb;class HS extends zS{constructor(t){super(t),this.type="pyramid3d",this.numberType=pw}doUpdateAABBBounds(){const t=Sm(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Av.graphicService.updatePyramid3dAABBBounds(e,Sm(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=sy(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=yf.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,r=hf(r,e);const o=yf.distancePP(i[s].p,i[s+1].p);i[s].d=o,i[s+1].d=o,r=hf(r,o)}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}getNoWorkAnimateAttr(){return HS.NOWORK_ANIMATE_ATTR}}HS.NOWORK_ANIMATE_ATTR=Sb;let GS=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:o=t.lineWidth}=r;i.expand(n+(s+o)/2)}return i}};GS=vp([hp()],GS);const VS=Symbol.for("RectBoundsContribution");let XS=class extends GS{};XS=vp([hp()],XS);const YS=Symbol.for("SymbolBoundsContribution");let qS=class extends GS{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:o=e.strokeBoundsBuffer}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:a=t.lineWidth}=r;qx(i,n+(s+a)/2,!0,o)}return i}};qS=vp([hp()],qS);const KS=Symbol.for("CircleBoundsContribution");let $S=class extends GS{};$S=vp([hp()],$S);const ZS=Symbol.for("ArcBoundsContribution");let JS=class extends GS{};JS=vp([hp()],JS);const QS=Symbol.for("PathBoundsContribution");let tT=class extends GS{};tT=vp([hp()],tT);const eT=Symbol.for("MatrixAllocate"),iT=Symbol.for("Mat4Allocate");function nT(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class rT{constructor(){this.pools=[]}allocate(t,e,i,n,r,s){if(!this.pools.length)return new Of(t,e,i,n,r,s);const o=this.pools.pop();return o.a=t,o.b=e,o.c=i,o.d=n,o.e=r,o.f=s,o}allocateByObj(t){if(!this.pools.length)return new Of(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=[]}}class sT{constructor(){this.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 sT.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 oT=new rT,aT=new sT;function hT(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],o=e[5],a=e[6],h=e[7],l=e[8],c=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+l*n,t[5]=o*r+c*n,t[6]=a*r+u*n,t[7]=h*r+d*n,t[8]=l*r-s*n,t[9]=c*r-o*n,t[10]=u*r-a*n,t[11]=d*r-h*n,t}function lT(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],l=e[8],c=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-l*n,t[1]=o*r-c*n,t[2]=a*r-u*n,t[3]=h*r-d*n,t[8]=s*n+l*r,t[9]=o*n+c*r,t[10]=a*n+u*r,t[11]=h*n+d*r,t}function cT(t,e,i){const n=i[0],r=i[1],s=i[2];let o,a,h,l,c,u,d,p,f,g,v,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]):(o=e[0],a=e[1],h=e[2],l=e[3],c=e[4],u=e[5],d=e[6],p=e[7],f=e[8],g=e[9],v=e[10],m=e[11],t[0]=o,t[1]=a,t[2]=h,t[3]=l,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=f,t[9]=g,t[10]=v,t[11]=m,t[12]=o*n+c*r+f*s+e[12],t[13]=a*n+u*r+g*s+e[13],t[14]=h*n+d*r+v*s+e[14],t[15]=l*n+p*r+m*s+e[15]),t}function uT(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 dT(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i[0],x=i[1],w=i[2],A=i[3];return t[0]=b*n+x*a+w*u+A*g,t[1]=b*r+x*h+w*d+A*v,t[2]=b*s+x*l+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i[4],x=i[5],w=i[6],A=i[7],t[4]=b*n+x*a+w*u+A*g,t[5]=b*r+x*h+w*d+A*v,t[6]=b*s+x*l+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=i[8],x=i[9],w=i[10],A=i[11],t[8]=b*n+x*a+w*u+A*g,t[9]=b*r+x*h+w*d+A*v,t[10]=b*s+x*l+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i[12],x=i[13],w=i[14],A=i[15],t[12]=b*n+x*a+w*u+A*g,t[13]=b*r+x*h+w*d+A*v,t[14]=b*s+x*l+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t}function pT(t,e,i){var n;const{x:r=i.x,y:s=i.y,z:o=i.z,dx:a=i.dx,dy:h=i.dy,dz:l=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:f=i.beta,angle:g=i.angle,anchor3d:v=e.attribute.anchor,anchor:m}=e.attribute,y=[0,0,0];if(v){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;y[0]=i.x1+(i.x2-i.x1)*t}else y[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;y[1]=i.x1+(i.x2-i.x1)*t}else y[1]=v[1];y[2]=null!==(n=v[2])&&void 0!==n?n: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),cT(t,t,[r+a,s+h,o+l]),cT(t,t,[y[0],y[1],y[2]]),hT(t,t,f),lT(t,t,p),cT(t,t,[-y[0],-y[1],y[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,u,d]),g){const i=aT.allocate(),n=[0,0];if(m){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=v[1]}cT(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],l=e[4],c=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+l*n,t[1]=o*r+c*n,t[2]=a*r+u*n,t[3]=h*r+d*n,t[4]=l*r-s*n,t[5]=c*r-o*n,t[6]=u*r-a*n,t[7]=d*r-h*n}(i,i,g),cT(i,i,[-n[0],-n[1],0]),dT(t,t,i)}}function fT(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{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 Cp(["graphic"]),onSetStage:new Cp(["graphic","stage"]),onRemove:new Cp(["graphic"]),onRelease:new Cp(["graphic"]),onAddIncremental:new Cp(["graphic","group","stage"]),onClearIncremental:new Cp(["graphic","group","stage"]),beforeUpdateAABBBounds:new Cp(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new Cp(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new wf,this.tempAABBBounds2=new wf}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)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.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 Ff(t);return ug(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((o=>{o.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:o,clip:a=e.clip}=t;o&&o.length?o.forEach((t=>{i.union(t.AABBBounds)})):null!=r&&null!=s&&i.set(0,0,r,s),a||n.forEachChildren((t=>{i.union(t.AABBBounds)}));const h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.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:o=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:h=e.textAlign,textBaseline:l=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 l=r||e||0,c=s||h||0;c="number"==typeof a&&c>a?a:c||0,l="number"==typeof o&&l>o?o:l||0,i.set(0,0,l,c)}let c=0;switch(l){case"top":c=0;break;case"middle":c=-i.height()/2;break;case"bottom":c=-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,c);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,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2);const{scaleX:a=e.scaleX,scaleY:h=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:c=e.strokeBoundsBuffer}=t;if(l){qx(s,l/Math.abs(a+h),!0,c),i.union(s)}return this.combindShadowAABBBounds(i,n),bf(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((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,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,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.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:o=0}=t,a=s+o;i.setValue(-a,-a,a,a);const h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.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:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,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:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,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:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),s}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i: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,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.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(o.x1,o.y1,o.x2,o.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:o=e.radius}=t;return s-r>rf-Qp?i.set(-o,-o,o,o):hy(r,s,o,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,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.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(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,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:o=e.endAngle,startAngle:a=e.startAngle}=t;if(a>o){const t=a;a=o,o=t}return r<=Qp?i.set(0,0,0,0):Math.abs(o-a)>rf-Qp?i.set(-r,-r,r,r):(hy(a,o,r,i),hy(a,o,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,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.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(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateSymbolAABBBoundsImprecise(t,e,i,n){const{size:r=e.size}=t;if(Wp(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:o=i.scaleY,stroke:a=i.stroke,shadowBlur:h=i.shadowBlur,lineWidth:l=i.lineWidth,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a){qx(u,l/Math.abs(s+o),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(h){qx(u,h/Math.abs(s+o),n,c),e.union(u)}this.combindShadowAABBBounds(e,r),bf(e,e,r.transMatrix)}},t.DefaultGraphicService=vp([hp(),mp(0,up(xw)),mp(1,up(xp)),mp(1,lp(VS)),mp(2,up(xp)),mp(2,lp(YS)),mp(3,up(xp)),mp(3,lp(KS)),mp(4,up(xp)),mp(4,lp(ZS)),mp(5,up(xp)),mp(5,lp(QS)),yp("design:paramtypes",[Object,Object,Object,Object,Object,Object])],t.DefaultGraphicService);class gT extends Bw{constructor(t){super({x:0,y:0}),this.type="shadowroot",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}}function vT(t){return new WS(t)}function mT(t){return new FS(t)}function yT(t){return new HS(t)}function bT(t){return new NS(t)}function xT(t){return new hA(t)}function wT(t){return new Bw(t)}function AT(t){return new bS(t)}function ST(t){return new DS(t)}function TT(t){return new wS(t)}function CT(t){return new SS(t)}function BT(t){return new TS(t)}function _T(t){return new fA(t)}function PT(t){return new vA(t)}function ET(t){return new mS(t)}function MT(t){return new PS(t)}function kT(t){return new zS(t)}function RT(t){return new gT(t)}function OT(t){return new OS(t)}const IT={arc:vT,area:bT,circle:xT,group:wT,image:MT,line:AT,path:ST,rect:TT,rect3d:CT,symbol:ET,text:_T,richtext:OT,polygon:kT,shadowRoot:RT,wrapText:PT},DT=_T({text:""});const LT=OT({});function NT(e,i,n,r,s){var o;const{offsetX:a=0,offsetY:h=0,offsetZ:l=0,mode:c="none",drawConnect:u=!1,zeroX:d=0,zeroY:p=0}=s||{};if(u&&"none"===c)return;if(!i)return;let f=!0;const{curves:g}=i;if(n>=1){if(u){let t,i=!0;g.forEach(((n,r)=>{var s;let o=n.p0;if(n.originP1!==n.originP2){if(t&&t.originP1===t.originP2&&(o=t.p0),n.defined)i||(e.lineTo(o.x+a,o.y+h,l),i=!i);else{const{originP1:t,originP2:r}=n;let c;if(t&&!1!==t.defined?c=o:t&&!1!==r.defined&&(c=null!==(s=n.p3)&&void 0!==s?s:n.p1),i){i=!i;const t=c?c.x:n.p0.x,r=c?c.y:n.p0.y;e.moveTo(t+a,r+h,l)}else c&&(i=!i,e.lineTo(c.x+a,c.y+h,l))}t=n}else t=n}))}else g.forEach((t=>{t.defined?(f&&e.moveTo(t.p0.x+a,t.p0.y+h,l),FT(e,t,1,s),f=!1):f=!0}));return}if(n<=0)return;let v;"x"===r?v=t.Direction.ROW:"y"===r?v=t.Direction.COLUMN:"auto"===r&&(v=i.direction);const m=n*i.tryUpdateLength(v);let y=0,b=!0,x=null;for(let t=0,i=g.length;t<i;t++){const i=g[t],n=i.getLength(v),r=(m-y)/n;if(y+=n,r<0)break;if(u){let t=i.p0;if(i.originP1===i.originP2){x=i;continue}if(x&&x.originP1===x.originP2&&(t=x.p0),i.defined)b||(e.lineTo(t.x+a,t.y+h,l),b=!b);else{const{originP1:n,originP2:r}=i;let s;if(n&&!1!==n.defined?s=t:n&&!1!==r.defined&&(s=null!==(o=i.p3)&&void 0!==o?o:i.p1),b){b=!b;const t=s?s.x:i.p0.x,n=s?s.y:i.p0.y;e.moveTo(t+a,n+h,l)}else s&&(b=!b,e.lineTo(s.x+a,s.y+h,l))}x=i}else{if(!i.defined){f=!0;continue}f&&e.moveTo(i.p0.x+a,i.p0.y+h,l),FT(e,i,lf(r,1),s),f=!1}}}function UT(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},o=e?e.points[e.points.length-1]:i.points[0];t.moveTo(o.x+r,o.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 WT(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},{points:o}=i,a=[];for(let t=0;t<o.length;t++)o[t].defined;a.push(o),a.forEach(((i,n)=>{var o,a,h,l;const c=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(c.x+r,c.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(null!==(o=n.x1)&&void 0!==o?o:n.x,null!==(a=n.y1)&&void 0!==a?a:n.y)}t.lineTo(null!==(h=c.x1)&&void 0!==h?h:c.x,null!==(l=c.y1)&&void 0!==l?l:c.y),t.closePath()}))}function FT(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=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,o):t.lineTo(r+e.p1.x,s+e.p1.y,o);else if(e.p2&&e.p3){const[n]=mg(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,o)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,o)}}function jT(e,i,n,r){var s;const{drawConnect:o=!1,mode:a="none"}=r||{};if(o&&"none"===a)return;const{top:h,bottom:l}=i;if(n>=1){const t=[],i=[];let n=!0;if(o){let n,s,o=!0;const a=h.curves.length;h.curves.forEach(((h,c)=>{const u=l.curves[a-c-1];let d=h,p=u;if(h.originP1===h.originP2)return n=h,void(s=u);if(n&&n.originP1===n.originP2&&(d=n,p=s),h.defined)o||(t.push(d),i.push(p),zT(e,t,i,r),t.length=0,i.length=0,o=!o);else{const{originP1:n,originP2:s}=h;let a,l;n&&!1!==n.defined?(a=d,l=p):n&&!1!==s.defined&&(a=h,l=u),o?(o=!o,t.push(a||h),i.push(l||u)):a&&(o=!o,t.push(a||h),i.push(l||u),zT(e,t,i,r),t.length=0,i.length=0)}n=h})),zT(e,t,i,r)}else{for(let s=0,o=h.curves.length;s<o;s++){const a=h.curves[s];n!==a.defined?(n?(HT(e,t,i,r),t.length=0,i.length=0):(t.push(a),i.push(l.curves[o-s-1])),n=!n):n&&(t.push(a),i.push(l.curves[o-s-1]))}HT(e,t,i,r)}return}if(n<=0)return;let{direction:c}=r||{};const{curves:u}=h,d=null!==(s=u[u.length-1].p3)&&void 0!==s?s:u[u.length-1].p1,p=sf(d.x-u[0].p0.x),f=sf(d.y-u[0].p0.y);c=null!=c?c:p>f?t.Direction.ROW:t.Direction.COLUMN,Number.isFinite(p)||(c=t.Direction.COLUMN),Number.isFinite(f)||(c=t.Direction.ROW);const g=n*(c===t.Direction.ROW?p:f);let v=0,m=!0;const y=[],b=[];let x,w,A=!0;for(let t=0,i=h.curves.length;t<i;t++){const n=h.curves[t],s=n.getLength(c),a=(g-v)/s;if(a<0)break;if(v+=s,o){const s=l.curves[i-t-1];let o=n,a=s;if(n.originP1===n.originP2){x=n,w=s;continue}if(x&&x.originP1===x.originP2&&(o=x,a=w),n.defined)A||(y.push(o),b.push(a),zT(e,y,b,r),y.length=0,b.length=0,A=!A);else{const{originP1:t,originP2:i}=n;let h,l;t&&!1!==t.defined?(h=o,l=a):t&&!1!==i.defined&&(h=n,l=s),A?(A=!A,y.push(h||n),b.push(l||s)):h&&(A=!A,y.push(h||n),b.push(l||s),zT(e,y,b,r),y.length=0,b.length=0)}x=n}else{let s=null,o=null;m!==n.defined?(m?(HT(e,y,b,r),y.length=0,b.length=0):(s=n,o=l.curves[i-t-1]),m=!m):m&&(s=n,o=l.curves[i-t-1]),s&&o&&(a<1&&(s=s.p2&&s.p3?mg(s,a)[0]:bg(s,a)[0],o=o.p2&&o.p3?mg(o,1-a)[1]:bg(o,1-a)[1]),s.defined=m,o.defined=m,y.push(s),b.push(o)),s=null,o=null}}o?zT(e,y,b,r):HT(e,y,b,r)}function zT(t,e,i,n){if(e.length<2)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0,mode:a}=n||{};let h=e[0];t.moveTo(h.p0.x+r,h.p0.y+s,o),h=e[e.length-1];let l=h.p3||h.p1;t.lineTo(l.x+r,l.y+s,o),h=i[i.length-1],t.lineTo(h.p0.x+r,h.p0.y+s,o),h=i[0],l=h.p3||h.p1,t.lineTo(l.x+r,l.y+s,o),t.closePath()}function HT(t,e,i,n){const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=n||{};let a=!0;e.forEach((e=>{e.defined?(a&&t.moveTo(e.p0.x+r,e.p0.y+s,o),GT(t,e,1,n),a=!1):a=!0})),a=!0;for(let e=i.length-1;e>=0;e--){const h=i[e];h.defined?(a&&t.lineTo(h.p0.x+r,h.p0.y+s,o),GT(t,h,1,n),a=!1):a=!0}t.closePath()}function GT(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=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,o):t.lineTo(r+e.p1.x,s+e.p1.y,o);else if(e.p2&&e.p3){const[n]=mg(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,o)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,o)}}function VT(t,e,i){switch(e){case"linear":default:return Cg(t,i);case"basis":return Mg(t,i);case"monotoneX":return Ug(t,i);case"monotoneY":return Fg(t,i);case"step":return zg(t,.5,i);case"stepBefore":return zg(t,0,i);case"stepAfter":return zg(t,1,i);case"linearClosed":return Vg(t,i)}}t.BaseRender=class{transform(t,e,i,n=!1){const r=t.transMatrix,{x:s=e.x,y:o=e.y,z:a=e.z,scaleX:h=e.scaleX,scaleY:l=e.scaleY,angle:c=e.angle,postMatrix:u}=t.attribute,d=r.onlyTranslate()&&!u,p=i.modelMatrix,f=i.camera,g={x:s,y:o,z:a,lastModelMatrix:p},v=f&&(n||fT(t));if(v){const n=aT.allocate(),r=aT.allocate();pT(r,t,e),dT(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),aT.free(r)}if(d&&!p){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,g.z=a,i.setTransformForCurrent()}else if(v)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,l,c)}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,o=n.project(0,0,i),a=n.project(r,0,i),h=n.project(r,s,i),l={x:0,y:0},c={x:r,y:0},u={x:r,y:s};n.camera=null;const d=1/(l.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*l.y),p=-(l.y*(h.x-a.x)-c.y*h.x+u.y*a.x+(c.y-u.y)*o.x)*d,f=(c.y*h.y+l.y*(a.y-h.y)-u.y*a.y+(u.y-c.y)*o.y)*d,g=(l.x*(h.x-a.x)-c.x*h.x+u.x*a.x+(c.x-u.x)*o.x)*d,v=-(c.x*h.y+l.x*(a.y-h.y)-u.x*a.y+(u.x-c.x)*o.y)*d,m=(l.x*(u.y*a.x-c.y*h.x)+l.y*(c.x*h.x-u.x*a.x)+(u.x*c.y-c.x*u.y)*o.x)*d,y=(l.x*(u.y*a.y-c.y*h.y)+l.y*(c.x*h.y-u.x*a.y)+(u.x*c.y-c.x*u.y)*o.y)*d;n.setTransform(p,f,g,v,m,y,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,r,s,o){const a=t.project(e,i,n);t.translate(a.x,a.y,!1),t.scale(r,s,!1),t.rotate(o,!1),t.translate(-a.x,-a.y,!1),t.setTransformForCurrent()}},t.BaseRender=vp([hp()],t.BaseRender),t.DefaultCanvasLineRender=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=cw}draw(t,e,i,n){const{context:r}=i;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).line,o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,jw(t,r,a,h)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&aT.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){var g,v,m,y,b;if(!e)return;t.beginPath();const x=null!==(g=this.z)&&void 0!==g?g:0;NT(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:x}),d.cache&&!Wp(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowStyle&&t.setShadowStyle(d,o,a);const{x:w=0,x:A=0}=o;!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,o,w-c,A-u,a),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,o,w-c,A-u,a),t.stroke()));let{connectedType:S,connectedX:T,connectedY:C,connectedStyle:B}=o;if(Wp(a)?(S=null!==(v=null!=S?S:a[0].connectedType)&&void 0!==v?v:a[1].connectedType,T=null!==(m=null!=T?T:a[0].connectedX)&&void 0!==m?m:a[1].connectedX,C=null!==(y=null!=C?C:a[0].connectedY)&&void 0!==y?y:a[1].connectedY,B=null!==(b=null!=B?B:a[0].connectedStyle)&&void 0!==b?b:a[1].connectedStyle):(S=null!=S?S:a.connectedType,T=null!=T?T:a.connectedX,C=null!=C?C:a.connectedY,B=null!=B?B:a.connectedStyle),"connect"!==S&&"zero"!==S&&(S="none"),"none"!==S){t.beginPath(),NT(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:x,drawConnect:!0,mode:S,zeroX:T,zeroY:C});const g=[];Wp(a)?a.forEach((t=>g.push(t))):g.push(a),g.push(o),!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,B,w-c,A-u,g),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,B,w-c,A-u,g),t.stroke()))}return!1}drawShape(t,e,i,n,r,s,o,a){const h=Sm(t,null==s?void 0:s.theme).line,{fill:l=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:g=h.visible}=t.attribute,v=Nw(u,d,l),m=Ww(u,p),y=Dw(l),b=Lw(c,f);if(!t.valid||!g)return;if(!y&&!b)return;if(!(v||m||o||a))return;if(t.shouldUpdateShape()){const{points:e,segments:i,closePath:n}=t.attribute;let{curveType:r=h.curveType}=t.attribute;n&&"linear"===r&&(r="linearClosed");const s=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const s=Yg(t.points,r,{startPoint:e});return n=s,s})).filter((t=>!!t)),"linearClosed"===r){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Yg(s,r)}t.clearUpdateShapeTag()}const{clipRange:x=h.clipRange,clipRangeByDimension:w=h.clipRangeByDimension}=t.attribute;if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===x){let s=!1;t.cache.forEach(((u,f)=>{s||(s=this.drawSegmentItem(e,u,!!l,!!c,d,p,r[f],[h,t.attribute],x,w,i,n,t,o,a))}))}else{const s=t.cache.reduce(((t,e)=>t+e.getLength()),0),u=x*s;let f=0,g=!1;t.cache.forEach(((s,v)=>{if(g)return;const m=s.getLength(),y=(u-f)/m;f+=m,y>0&&(g=this.drawSegmentItem(e,s,!!l,!!c,d,p,r[v],[h,t.attribute],lf(y,1),w,i,n,t,o,a))}))}}else this.drawSegmentItem(e,t.cache,!!l,!!c,d,p,t.attribute,h,x,w,i,n,t,o,a)}},t.DefaultCanvasLineRender=vp([hp()],t.DefaultCanvasLineRender),t.DefaultCanvasAreaRender=class{constructor(t){this.areaRenderContribitions=t,this.numberType=sw}drawShape(t,e,i,n,r,s,o,a){var h,l,c,u,d,p;const f=Sm(t,null==s?void 0:s.theme).area,{fill:g=f.fill,fillOpacity:v=f.fillOpacity,opacity:m=f.opacity,visible:y=f.visible,z:b=f.z,background:x,stroke:w=t.attribute.stroke,lineWidth:A=f.lineWidth,strokeOpacity:S=f.strokeOpacity}=t.attribute,T=Nw(m,v,g),C=Dw(g,x),B=Lw(w,A),_=Ww(m,S);if(!t.valid||!y)return;if(!C&&!B)return;if(!(T||o||_||a))return;const{clipRange:P=f.clipRange}=t.attribute;if(t.shouldUpdateShape()){const{points:e,segments:i,closePath:n}=t.attribute;let{curveType:r=f.curveType}=t.attribute;if(n&&"linear"===r&&(r="linearClosed"),i&&i.length){let e,n;const s=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y}),null;1===i?e={x:n.endX,y:n.endY}:i>1&&(e.x=n.endX,e.y=n.endY);const s=VT(t.points,r,{startPoint:e});return n=s,s})).filter((t=>!!t));let o;const a=[];for(let t=i.length-1;t>=0;t--){const e=i[t].points,n=[];for(let t=e.length-1;t>=0;t--)n.push({x:null!==(h=e[t].x1)&&void 0!==h?h:e[t].x,y:null!==(l=e[t].y1)&&void 0!==l?l:e[t].y});if(0!==t){const e=i[t-1].points,r=e[e.length-1];r&&n.push({x:null!==(c=r.x1)&&void 0!==c?c:r.x,y:null!==(u=r.y1)&&void 0!==u?u:r.y})}o=VT(n,"stepBefore"===r?"stepAfter":"stepAfter"===r?"stepBefore":r),a.unshift(o)}t.cacheArea=a.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!e||!e.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const i=e,n=[];for(let t=e.length-1;t>=0;t--)n.push({x:null!==(d=e[t].x1)&&void 0!==d?d:e[t].x,y:null!==(p=e[t].y1)&&void 0!==p?p:e[t].y});const s=VT(i,r),o=VT(n,"stepBefore"===r?"stepAfter":"stepAfter"===r?"stepBefore":r);t.cacheArea={top:s,bottom:o}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===P){let h=!1;t.cacheArea.forEach(((l,c)=>{h||(h=this.drawSegmentItem(e,l,C,v,B,S,s[c],[f,t.attribute],P,i,n,b,t,r,o,a))}))}else{const h=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),l=P*h;let c=0,u=!1;t.cacheArea.forEach(((h,d)=>{if(u)return;const p=h.top.getLength(),g=(l-c)/p;c+=p,g>0&&(u=this.drawSegmentItem(e,h,C,v,B,S,s[d],[f,t.attribute],lf(g,1),i,n,b,t,r,o,a))}))}}else this.drawSegmentItem(e,t.cacheArea,C,v,B,S,t.attribute,f,P,i,n,b,t,r,o,a)}draw(t,e,i,n){const{context:r}=i,s=Sm(t,null==n?void 0:n.theme).area;let{x:o=s.x,y:a=s.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);jw(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,g){let v=!1;return v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,!1,f,g),v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,!0,f,g),v}_drawSegmentItem(e,i,n,r,s,o,a,h,l,c,u,d,p,f,g,v,m){var y,b,x,w;let{connectedType:A,connectedX:S,connectedY:T,connectedStyle:C}=a;const B=[];if(g&&(Wp(h)?(A=null!==(y=null!=A?A:h[0].connectedType)&&void 0!==y?y:h[1].connectedType,S=null!==(b=null!=S?S:h[0].connectedX)&&void 0!==b?b:h[1].connectedX,T=null!==(x=null!=T?T:h[0].connectedY)&&void 0!==x?x:h[1].connectedY,C=null!==(w=null!=C?C:h[0].connectedStyle)&&void 0!==w?w:h[1].connectedStyle):(A=null!=A?A:h.connectedType,S=null!=S?S:h.connectedX,T=null!=T?T:h.connectedY,C=null!=C?C:h.connectedStyle),"connect"!==A&&"zero"!==A&&(A="none"),Wp(h)?h.forEach((t=>B.push(t))):B.push(h),B.push(a)),g&&"none"===A)return!1;if(!i)return;e.beginPath();const{points:_,segments:P}=p.attribute;let E,M,k=t.Direction.ROW;if(P){const t=P[P.length-1];M=P[0].points[0],E=t.points[t.points.length-1]}else M=_[0],E=_[_.length-1];k=sf(E.x-M.x)>sf(E.y-M.y)?t.Direction.ROW:t.Direction.COLUMN,jT(e.camera?e:e.nativeContext,i,l,{offsetX:c,offsetY:u,offsetZ:d,direction:k,drawConnect:g,mode:A,zeroX:S,zeroY:T}),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,c,u,!!r,!1,n,!1,h,f,v,null,{attribute:a})})),e.setShadowStyle&&e.setShadowStyle(p,a,h);const{x:R=0,x:O=0}=a;if(!1!==n&&(v?v(e,a,h):r&&(e.setCommonStyle(p,g?C:a,R-c,O-u,g?B:h),e.fill())),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[]),this._areaRenderContribitions.forEach((i=>{i.time===t.BaseRenderContributionTime.afterFillStroke&&i.drawShape(p,e,c,u,!!r,!1,n,!1,h,f,v,null,{attribute:a})})),!1!==s)if(m)m(e,a,h);else{const{stroke:n=h&&h[1]&&h[1].stroke}=a;Wp(n)&&(n[0]||n[2])&&!1===n[1]&&(e.beginPath(),NT(e.camera?e:e.nativeContext,n[0]?i.top:i.bottom,l,k===t.Direction.ROW?"x":"y",{offsetX:c,offsetY:u,offsetZ:d,drawConnect:g,mode:A,zeroX:S,zeroY:T})),e.setStrokeStyle(p,g?C:a,R-c,O-u,g?B:h),e.stroke()}return!1}},t.DefaultCanvasAreaRender=vp([hp(),mp(0,up(xp)),mp(0,lp(Zw)),yp("design:paramtypes",[Object])],t.DefaultCanvasAreaRender),t.DefaultCanvasPathRender=class extends t.BaseRender{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=uw}drawShape(e,i,n,r,s,o,a,h){var l,c;const u=Sm(e,null==o?void 0:o.theme).path,{fill:d=u.fill,stroke:p=u.stroke,fillOpacity:f=u.fillOpacity,strokeOpacity:g=u.strokeOpacity,opacity:v=u.opacity,background:m,lineWidth:y=u.lineWidth,visible:b=u.visible,x:x=u.x,y:w=u.y}=e.attribute,A=null!==(l=this.z)&&void 0!==l?l:0,S=Nw(v,f,d),T=Ww(v,g),C=Dw(d,m),B=Lw(p,y);if(e.valid&&b&&(C||B)&&(S||T||a||h||m)){if(i.beginPath(),e.pathShape)ug(e.pathShape.commandList,i,n,r,1,1,A);else{ug((null!==(c=e.attribute.path)&&void 0!==c?c:u.path).commandList,i,n,r,1,1,A)}this._pathRenderContribitions||(this._pathRenderContribitions=this.pathRenderContribitions.getContributions()||[],this._pathRenderContribitions.sort(((t,e)=>e.order-t.order))),this._pathRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,u,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,u),B&&(h?h(i,e.attribute,u):T&&(i.setStrokeStyle(e,e.attribute,x-n,w-r,u),i.stroke())),C&&(a?a(i,e.attribute,u):S&&(i.setCommonStyle(e,e.attribute,x-n,w-r,u),i.fill())),this._pathRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,u,s,a,h)}))}}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).path,o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,jw(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&aT.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}},t.DefaultCanvasPathRender=vp([hp(),mp(0,up(xp)),mp(0,lp(eA)),yp("design:paramtypes",[Object])],t.DefaultCanvasPathRender);const XT=tf/2;function YT(t,e,i,n,r,s){let o;if(jp(s,!0))o=[s,s,s,s];else if(Array.isArray(s)){const t=s;switch(t.length){case 0:o=[0,0,0,0];break;case 1:o=[t[0],t[0],t[0],t[0]];break;case 2:case 3:o=[t[0],t[1],t[0],t[1]];break;default:o=t.slice(0,5)}}else o=[0,0,0,0];if(n<0||Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])+Math.abs(o[3])<1e-12)return t.rect(e,i,n,r);const[a,h,l,c]=[[e,i],[e+n,i],[e+n,i+r],[e,i+r]],u=Math.min(n/2,r/2),d=[Math.min(u,o[0]),Math.min(u,o[1]),Math.min(u,o[2]),Math.min(u,o[3])],p=[a[0]+d[0],a[1]],f=[a[0],a[1]+d[0]],g=[h[0]-d[1],h[1]],v=[h[0],h[1]+d[1]],m=[l[0]-d[2],l[1]],y=[l[0],l[1]-d[2]],b=[c[0]+d[3],c[1]],x=[c[0],c[1]-d[3]];if(t.moveTo(p[0],p[1]),t.lineTo(g[0],g[1]),!Kp(g,v)){const e=g[0],i=g[1]+d[1];t.arc(e,i,d[1],-XT,0,!1)}if(t.lineTo(y[0],y[1]),!Kp(m,y)){const e=y[0]-d[2],i=y[1];t.arc(e,i,d[2],0,XT,!1)}if(t.lineTo(b[0],b[1]),!Kp(b,x)){const e=b[0],i=b[1]-d[3];t.arc(e,i,d[3],XT,tf,!1)}if(t.lineTo(f[0],f[1]),!Kp(p,f)){const e=p[0],i=p[1]+d[0];t.arc(e,i,d[0],tf,tf+XT,!1)}return t.closePath(),t}function qT(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 KT(t,e){return Math.sqrt(t*t+e*e)}function $T(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.DefaultCanvasRectRender=class{constructor(t){this.rectRenderContribitions=t,this.type="rect",this.numberType=fw}drawShape(e,i,n,r,s,o,a,h){const l=Sm(e,null==o?void 0:o.theme).rect,{fill:c=l.fill,background:u,stroke:d=l.stroke,width:p=l.width,height:f=l.height,cornerRadius:g=l.cornerRadius,opacity:v=l.opacity,fillOpacity:m=l.fillOpacity,lineWidth:y=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:x=l.visible,x:w=l.x,y:A=l.y}=e.attribute,S=Uw(v,m,p,f,c),T=Fw(v,b,p,f),C=Dw(c,u),B=Lw(d,y);if(!e.valid||!x)return;if(!C&&!B)return;if(!(S||T||a||h||u))return;0===g||Wp(g)&&g.every((t=>0===t))?(i.beginPath(),i.rect(n,r,p,f)):(i.beginPath(),YT(i,n,r,p,f,g)),this._rectRenderContribitions||(this._rectRenderContribitions=this.rectRenderContribitions.getContributions()||[],this._rectRenderContribitions.sort(((t,e)=>e.order-t.order)));const _={doFill:C,doStroke:B};this._rectRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h,_)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),_.doFill&&(a?a(i,e.attribute,l):S&&(i.setCommonStyle(e,e.attribute,w-n,A-r,l),i.fill())),_.doStroke&&(h?h(i,e.attribute,l):T&&(i.setStrokeStyle(e,e.attribute,w-n,A-r,l),i.stroke())),this._rectRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).rect;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);jw(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasRectRender=vp([hp(),mp(0,up(xp)),mp(0,lp(nA)),yp("design:paramtypes",[Object])],t.DefaultCanvasRectRender),t.DefaultCanvasSymbolRender=class extends t.BaseRender{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=mw}drawShape(e,i,n,r,s,o,a,h){var l;const c=Sm(e,null==o?void 0:o.theme).symbol,{size:u=c.size,fill:d=c.fill,background:p,fillOpacity:f=c.fillOpacity,strokeOpacity:g=c.strokeOpacity,opacity:v=c.opacity,lineWidth:m=c.lineWidth,stroke:y=c.stroke,visible:b=c.visible,x:x=c.x,y:w=c.y,scaleX:A=c.scaleX,scaleY:S=c.scaleY}=e.attribute,T=Nw(v,f,d),C=Ww(v,g),B=Dw(d,p),_=Lw(y,m);if(!e.valid||!b)return;if(!B&&!_)return;if(!(T||C||a||h||p))return;const P=e.getParsedPath();if(!P)return;const{keepDirIn3d:E=c.keepDirIn3d}=e.attribute,M=null!==(l=this.z)&&void 0!==l?l:0;if(i.beginPath(),E&&i.camera&&i.project){const t=i.project(n,r,M),s=i.camera;i.camera=null,!1===P.draw(i,u,t.x,t.y,void 0,((t,s)=>{s.fill&&(a?a(i,e.attribute,c):(i.setCommonStyle(e,s,x-n,w-r),i.fill())),s.stroke&&(h?h(i,e.attribute,c):(i.setStrokeStyle(e,s,(x-n)/A,(w-r)/S),i.stroke()))}))&&i.closePath(),i.camera=s}else!1===P.draw(i,u,n,r,M,((t,s)=>{s.fill&&(a?a(i,e.attribute,c):(i.setCommonStyle(e,s,x-n,w-r),i.fill())),s.stroke&&(h?h(i,e.attribute,c):(i.setStrokeStyle(e,s,(x-n)/A,(w-r)/S),i.stroke()))}))&&i.closePath();this._symbolRenderContribitions||(this._symbolRenderContribitions=this.symbolRenderContribitions.getContributions()||[],this._symbolRenderContribitions.sort(((t,e)=>e.order-t.order))),this._symbolRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,B,_,T,C,c,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),B&&!P.isSvg&&(a?a(i,e.attribute,c):T&&(i.setCommonStyle(e,e.attribute,x-n,w-r,c),i.fill())),_&&!P.isSvg&&(h?h(i,e.attribute,c):C&&(i.setStrokeStyle(e,e.attribute,(x-n)/A,(w-r)/S,c),i.stroke())),this._symbolRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,B,_,T,C,c,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).symbol,o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,jw(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&aT.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}},t.DefaultCanvasSymbolRender=vp([hp(),mp(0,up(xp)),mp(0,lp(rA)),yp("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender),t.DefaultCanvasTextRender=class extends t.BaseRender{constructor(t){super(),this.textRenderContribitions=t,this.numberType=yw}drawShape(e,i,n,r,s,o,a,h){var l,c,u;const d=Sm(e,null==o?void 0:o.theme).text,{text:p,fill:f=d.fill,stroke:g=d.stroke,fillOpacity:v=d.fillOpacity,strokeOpacity:m=d.strokeOpacity,opacity:y=d.opacity,lineWidth:b=d.lineWidth,visible:x=d.visible,underline:w=d.underline,lineThrough:A=d.lineThrough,keepDirIn3d:S=d.keepDirIn3d,direction:T=d.direction,fontSize:C=d.fontSize,verticalMode:B=d.verticalMode,x:_=d.x,y:P=d.y}=e.attribute;let{textAlign:E=d.textAlign,textBaseline:M=d.textBaseline}=e.attribute;if(!B&&"vertical"===T){const t=E;E=null!==(l=e.getBaselineMapAlign()[M])&&void 0!==l?l:"left",M=null!==(c=e.getAlignMapBaseline()[t])&&void 0!==c?c:"top"}const k=null!==(u=e.attribute.lineHeight)&&void 0!==u?u:C,R=Nw(y,v,f),O=Ww(y,m),I=Dw(f),D=Lw(g,b);if(!e.valid||!x)return;if(!(I||D||R||O))return;const L=!S,N=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)}))}this._textBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,I,D,R,O,d,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,d),L&&this.transformUseContext2d(e,d,N,i);const U=(t,s,o,l)=>{let c=n+s;const u=r+o;if(l){i.highPerformanceSave(),c+=C;const t=oT.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,u),i.transformFromMatrix(t,!0),oT.free(t)}D&&(h?h(i,e.attribute,d):O&&(i.setStrokeStyle(e,e.attribute,_-n,P-r,d),i.strokeText(t,c,u,N))),I&&(a?a(i,e.attribute,d):R&&(i.setCommonStyle(e,e.attribute,_-n,P-r,d),i.fillText(t,c,u,N),this.drawUnderLine(w,A,e,c,u,N,d,i))),l&&(i.highPerformanceRestore(),i.setTransformForCurrent())};if(Array.isArray(p))if(i.setTextStyleWithoutAlignBaseline(e.attribute,d,N),"horizontal"===T){const{multilineLayout:t}=e;if(!t)return void i.highPerformanceRestore();const{xOffset:s,yOffset:o}=t.bbox;D&&(h?h(i,e.attribute,d):O&&(i.setStrokeStyle(e,e.attribute,_-n,P-r,d),t.lines.forEach((t=>{i.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+o+r,N)})))),I&&(a?a(i,e.attribute,d):R&&(i.setCommonStyle(e,e.attribute,_-n,P-r,d),t.lines.forEach((t=>{i.fillText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+o+r,N),this.drawMultiUnderLine(w,A,e,(t.leftOffset||0)+n,(t.topOffset||0)+o+r,N,t.width,d,i)}))))}else{const t=e.cache,{verticalList:n}=t;i.textAlign="left",i.textBaseline="top";const r=k*n.length;let s=0;n.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);s=hf(e,s)}));let o=0,a=0;"bottom"===M?a=-r:"middle"===M&&(a=-r/2),"center"===E?o-=s/2:"right"===E&&(o-=s),n.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),n=s-i;let h=o;"center"===E?h+=n/2:"right"===E&&(h+=n),t.forEach((t=>{const{text:i,width:n,direction:s}=t;U(i,r-(e+1)*k+a,h,s),h+=n}))}))}else{const t=e.cache;if("horizontal"===T){i.setTextStyle(e.attribute,d,N);const t=e.clipedText;let n=0;k!==C&&("top"===M?n=(k-C)/2:"middle"===M||"bottom"===M&&(n=-(k-C)/2)),U(t,0,n,0)}else if(t){i.setTextStyleWithoutAlignBaseline(e.attribute,d,N);const{verticalList:n}=t;let r=0;const s=n[0].reduce(((t,e)=>t+(e.width||0)),0);let o=0;"bottom"===M?o=-k:"middle"===M&&(o=-k/2),"center"===E?r-=s/2:"right"===E&&(r-=s),i.textAlign="left",i.textBaseline="top",n[0].forEach((t=>{const{text:e,width:i,direction:n}=t;U(e,o,r,n),r+=i}))}}L&&this.restoreTransformUseContext2d(e,d,N,i),this._textAfterRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,I,D,R,O,d,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,h=this.transform(t,s,r,a),{x:l,y:c,z:u,lastModelMatrix:d}=h;this.z=u,this.drawShape(t,r,l,c,i,n),this.z=0,r.modelMatrix=d,r.highPerformanceRestore()}drawUnderLine(t,e,i,n,r,s,o,a){if(e+t<=0)return;const{textAlign:h=o.textAlign,textBaseline:l=o.textBaseline,fontSize:c=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,fillOpacity:p=o.fillOpacity}=i.attribute,f=i.clipedWidth,g=cA(h,f),v=uA(l,c,c),m={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};if(t){m.lineWidth=t,a.setStrokeStyle(i,m,n,r,o),a.beginPath();const e=r+v+c;a.moveTo(n+g,e,s),a.lineTo(n+g+f,e,s),a.stroke()}if(e){m.lineWidth=e,a.setStrokeStyle(i,m,n,r,o),a.beginPath();const t=r+v+c/2;a.moveTo(n+g,t,s),a.lineTo(n+g+f,t,s),a.stroke()}}drawMultiUnderLine(t,e,i,n,r,s,o,a,h){if(e+t<=0)return;const{textAlign:l=a.textAlign,fontSize:c=a.fontSize,fill:u=a.fill,opacity:d=a.opacity,fillOpacity:p=a.fillOpacity}=i.attribute,f=cA(l,o),g=uA("alphabetic",c,c),v={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};let m=-3;if(t){v.lineWidth=t,h.setStrokeStyle(i,v,n,r,a),h.beginPath();const e=r+g+c+m;h.moveTo(n+f,e,s),h.lineTo(n+f+o,e,s),h.stroke()}if(m=-1,e){v.lineWidth=e,h.setStrokeStyle(i,v,n,r,a),h.beginPath();const t=r+g+c/2+m;h.moveTo(n+f,t,s),h.lineTo(n+f+o,t,s),h.stroke()}}},t.DefaultCanvasTextRender=vp([hp(),mp(0,up(xp)),mp(0,lp(sA)),yp("design:paramtypes",[Object])],t.DefaultCanvasTextRender),t.AbstractGraphicRender=class{},t.AbstractGraphicRender=vp([hp()],t.AbstractGraphicRender),t.DefaultCanvasPolygonRender=class{constructor(t){this.polygonRenderContribitions=t,this.numberType=dw}drawShape(e,i,n,r,s,o,a,h){const l=Sm(e,null==o?void 0:o.theme).polygon,{points:c=l.points,fill:u=l.fill,stroke:d=l.stroke,cornerRadius:p=l.cornerRadius,fillOpacity:f=l.fillOpacity,background:g,strokeOpacity:v=l.strokeOpacity,lineWidth:m=l.lineWidth,opacity:y=l.opacity,visible:b=l.visible,x:x=l.x,y:w=l.y,closePath:A=l.closePath}=e.attribute,S=Nw(y,f,u),T=Ww(y,v),C=Dw(u,g),B=Lw(d,m);e.valid&&b&&(C||B)&&(S||T||a||h||g)&&(i.beginPath(),p<=0||Wp(p)&&p.every((t=>0===t))?qT(i.camera?i:i.nativeContext,c,n,r):function(t,e,i,n,r,s=!0){var o;if(e.length<3)return void qT(t,e,i,n);let a=0,h=e.length-1;s||(a+=1,h-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let s=a;s<=h;s++){const a=e[0===s?h:(s-1)%e.length],l=e[s%e.length],c=e[(s+1)%e.length],u=l.x-a.x,d=l.y-a.y,p=l.x-c.x,f=l.y-c.y,g=(Math.atan2(d,u)-Math.atan2(f,p))/2,v=Math.abs(Math.tan(g));let m=Array.isArray(r)?null!==(o=r[s%e.length])&&void 0!==o?o:0:r,y=m/v;const b=KT(u,d),x=KT(p,f),w=Math.min(b,x);y>w&&(y=w,m=w*v);const A=$T(l,y,b,u,d),S=$T(l,y,x,p,f),T=2*l.x-A.x-S.x,C=2*l.y-A.y-S.y,B=KT(T,C),_=$T(l,KT(y,m),B,T,C);let P=Math.atan2(A.y-_.y,A.x-_.x);const E=Math.atan2(S.y-_.y,S.x-_.x);let M=E-P;M<0&&(P=E,M=-M),M>Math.PI&&(M-=Math.PI),0===s?t.moveTo(A.x+i,A.y+n):t.lineTo(A.x+i,A.y+n),M&&t.arcTo(l.x+i,l.y+n,S.x+i,S.y+n,m),t.lineTo(S.x+i,S.y+n)}s||t.lineTo(e[h+1].x+i,e[h+1].y+n)}(i.camera?i:i.nativeContext,c,n,r,p,A),A&&i.closePath(),this._polygonRenderContribitions||(this._polygonRenderContribitions=this.polygonRenderContribitions.getContributions()||[],this._polygonRenderContribitions.sort(((t,e)=>e.order-t.order))),this._polygonRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),C&&(a?a(i,e.attribute,l):f&&(i.setCommonStyle(e,e.attribute,x-n,w-r,l),i.fill())),B&&(h?h(i,e.attribute,l):v&&(i.setStrokeStyle(e,e.attribute,x-n,w-r,l),i.stroke())),this._polygonRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h)})))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=Sm(t,null==n?void 0:n.theme).polygon;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);jw(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasPolygonRender=vp([hp(),mp(0,up(xp)),mp(0,lp(iA)),yp("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);const ZT=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class{constructor(t){this.imageRenderContribitions=t,this.numberType=lw}drawShape(e,i,n,r,s,o,a){const h=Sm(e).image,{fill:l=h.fill,width:c=h.width,height:u=h.height,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,visible:f=h.visible,repeatX:g=h.repeatX,repeatY:v=h.repeatY,cornerRadius:m=h.cornerRadius,image:y}=e.attribute,b=Nw(d,p,l),x=Dw(l);if(e.valid&&f&&x&&(b||a)){if(this._imageRenderContribitions||(this._imageRenderContribitions=this.imageRenderContribitions.getContributions()||[]),this._imageRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,x,!1,b,!1,h,s,a)})),i.setShadowStyle&&i.setShadowStyle(e,h),x)if(a)a(i,e.attribute,h);else if(b){if(!y||!e.resources)return;const t=e.resources.get(y);if("success"!==t.state)return;let s=!1;0===m||Wp(m)&&m.every((t=>0===t))||(i.beginPath(),YT(i,n,r,c,u,m),i.save(),i.clip(),s=!0),i.setCommonStyle(e,e.attribute,n,r,h);let o=0;if("repeat"===g&&(o|=1),"repeat"===v&&(o|=2),o){const e=i.createPattern(t.data,ZT[o]);i.fillStyle=e,i.fillRect(n,r,c,u)}else i.drawImage(t.data,n,r,c,u);s&&i.restore()}this._imageRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,x,!1,b,!1,h,s,a)}))}}draw(t,e,i){const{context:n}=e.drawParams;if(!n)return;const r=Sm(t).image;let{x:s=r.x,y:o=r.y}=t.attribute;const{image:a}=t.attribute;if(!a||!t.resources)return;if("success"===t.resources.get(a).state){if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,n,s,o,i),n.highPerformanceRestore()}}},t.DefaultCanvasImageRender=vp([hp(),mp(0,up(xp)),mp(0,lp(tA)),yp("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const JT=Symbol.for("IncrementalDrawContribution"),QT=Symbol.for("ArcRender"),tC=Symbol.for("Arc3dRender"),eC=Symbol.for("AreaRender"),iC=Symbol.for("CircleRender"),nC=Symbol.for("GraphicRender"),rC=Symbol.for("GroupRender"),sC=Symbol.for("LineRender"),oC=Symbol.for("PathRender"),aC=Symbol.for("PolygonRender"),hC=Symbol.for("RectRender"),lC=Symbol.for("Rect3DRender"),cC=Symbol.for("SymbolRender"),uC=Symbol.for("TextRender"),dC=Symbol.for("RichTextRender"),pC=Symbol.for("Pyramid3dRender"),fC=Symbol.for("GlyphRender"),gC=Symbol.for("ImageRender"),vC=Symbol.for("RenderSelector"),mC=Symbol.for("DrawContribution");function yC(t,e,i){let n=e;const{a:r,b:s,c:o,d:a}=t.currentMatrix,h=Math.sign(r)*Math.sqrt(r*r+s*s),l=Math.sign(a)*Math.sqrt(o*o+a*a);return h+l===0?0:(n=n/Math.abs(h+l)*2*i,n)}function bC(t,e,i,n,r){if(!e||!0===e)return"black";let s,o;if(Wp(e))for(let t=0;t<e.length&&(o=e[t],!o);t++);else o=e;return"string"==typeof o?o:("linear"===o.gradient?s=function(t,e,i,n=0,r=0){var s,o,a,h;const l=i.AABBBounds;if(!l)return;let c=l.x2-l.x1,u=l.y2-l.y1,d=l.x1-n,p=l.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;c/=t,u/=e,d/=t,p/=e}const f=t.createLinearGradient(d+(null!==(s=e.x0)&&void 0!==s?s:0)*c,p+(null!==(o=e.y0)&&void 0!==o?o:0)*u,d+(null!==(a=e.x1)&&void 0!==a?a:1)*c,p+(null!==(h=e.y1)&&void 0!==h?h:0)*u);return e.stops.forEach((t=>{f.addColorStop(t.offset,t.color)})),f}(t,o,i,n,r):"conical"===o.gradient?s=function(t,e,i,n=0,r=0){var s,o;const a=i.AABBBounds;if(!a)return;let h=a.x2-a.x1,l=a.y2-a.y1,c=a.x1-n,u=a.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;h/=t,l/=e,c/=t,u/=e}const d=t.createConicGradient(c+(null!==(s=e.x)&&void 0!==s?s:0)*h,u+(null!==(o=e.y)&&void 0!==o?o:0)*l,e.startAngle,e.endAngle);let p;return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d.GetPattern(h+c,l+u,p)}(t,o,i,n,r):"radial"===o.gradient&&(s=function(t,e,i,n=0,r=0){var s,o,a,h,l,c;const u=i.AABBBounds;if(!u)return;let d=u.x2-u.x1,p=u.y2-u.y1,f=u.x1-n,g=u.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;f/=t,g/=e,d/=t,p/=e}const v=t.createRadialGradient(f+(null!==(s=e.x0)&&void 0!==s?s:.5)*d,g+(null!==(o=e.y0)&&void 0!==o?o:.5)*p,Math.max(d,p)*(null!==(a=e.r0)&&void 0!==a?a:0),f+(null!==(h=e.x1)&&void 0!==h?h:.5)*d,g+(null!==(l=e.y1)&&void 0!==l?l:.5)*p,Math.max(d,p)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{v.addColorStop(t.offset,t.color)})),v}(t,o,i,n,r)),s||"orange")}const xC=new class{constructor(){this.pools=[]}allocate(t){if(!this.pools.length)return Uv(Object.assign({nativeCanvas:Av.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 Uv(Object.assign({nativeCanvas:Av.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{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,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=Sm(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=vp([hp()],t.DefaultBaseBackgroundRenderContribution),t.DefaultBaseInteractiveRenderContribution=class{constructor(e){this.subRenderContribitions=e,this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,o,a,h,l,c,u,d)}))}},t.DefaultBaseInteractiveRenderContribution=vp([hp(),mp(0,up(xp)),mp(0,lp(oA)),yp("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution),t.DefaultBaseTextureRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,n,r){const s=(t-2*e)/2,o=xC.allocate({width:t,height:t,dpr:1}),a=o.getContext("2d");if(!a)return null;a.clearRect(0,0,t,t),r(s,a);const h=n.createPattern(o.nativeCanvas,"repeat");return xC.free(o),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,rf),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,o,a,h,l,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:f=h.textureColor,textureSize:g=h.textureSize,texturePadding:v=h.texturePadding}=t.attribute;if(!p)return;let m=this.textureMap.get(p);if(!m)switch(p){case"circle":m=this.createCirclePattern(g,v,f,e);break;case"diamond":m=this.createDiamondPattern(g,v,f,e);break;case"rect":m=this.createRectPattern(g,v,f,e);break;case"vertical-line":m=this.createVerticalLinePattern(g,v,f,e);break;case"horizontal-line":m=this.createHorizontalLinePattern(g,v,f,e);break;case"bias-lr":m=this.createBiasLRLinePattern(g,v,f,e);break;case"bias-rl":m=this.createBiasRLLinePattern(g,v,f,e);break;case"grid":m=this.createGridPattern(g,v,f,e)}m&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=m,e.fill(),e.highPerformanceRestore())}},t.DefaultBaseTextureRenderContribution=vp([hp()],t.DefaultBaseTextureRenderContribution),t.DefaultArcRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{innerRadius:v=h.innerRadius,outerRadius:m=h.outerRadius,startAngle:y=h.startAngle,endAngle:b=h.endAngle,opacity:x=h.opacity,x:w=h.x,y:A=h.y,scaleX:S=h.scaleX,scaleY:T=h.scaleY}=t.attribute,C=!(!d||!d.stroke),B=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=d,s=yC(e,r,e.dpr),o=r/m;if(t.setAttributes({outerRadius:m+s,innerRadius:v-s,startAngle:y-o,endAngle:b+o}),e.beginPath(),Gw(t,e,i,n,m+s,v-s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(C){const r=h.outerBorder.opacity;h.outerBorder.opacity=x,e.setStrokeStyle(t,d,(w-i)/S,(A-n)/T,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=yC(e,r,e.dpr),o=r/m;if(t.setAttributes({outerRadius:m-s,innerRadius:v+s,startAngle:y+o,endAngle:b-o}),e.beginPath(),Gw(t,e,i,n,m-s,v+s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(B){const r=h.innerBorder.opacity;h.innerBorder.opacity=x,e.setStrokeStyle(t,p,(w-i)/S,(A-n)/T,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:m,innerRadius:v,startAngle:y,endAngle:b})}},t.DefaultArcRenderContribution=vp([hp()],t.DefaultArcRenderContribution),t.DefaultArcBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultArcBackgroundRenderContribution=vp([hp()],t.DefaultArcBackgroundRenderContribution),t.DefaultArcTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultArcTextureRenderContribution=vp([hp()],t.DefaultArcTextureRenderContribution),t.DefaultCircleRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{radius:v=h.radius,startAngle:m=h.startAngle,endAngle:y=h.endAngle,opacity:b=h.opacity,x:x=h.x,y:w=h.y,scaleX:A=h.scaleX,scaleY:S=h.scaleY}=t.attribute,T=!(!d||!d.stroke),C=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=d,s=yC(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,v+s,m,y),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(T){const r=h.outerBorder.opacity;h.outerBorder.opacity=b,e.setStrokeStyle(t,d,(x-i)/A,(w-n)/S,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=yC(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,v-s,m,y),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(C){const r=h.innerBorder.opacity;h.innerBorder.opacity=b,e.setStrokeStyle(t,p,(x-i)/A,(w-n)/S,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultCircleRenderContribution=vp([hp()],t.DefaultCircleRenderContribution),t.DefaultCircleBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultCircleBackgroundRenderContribution=vp([hp()],t.DefaultCircleBackgroundRenderContribution),t.DefaultCircleTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultCircleTextureRenderContribution=vp([hp()],t.DefaultCircleTextureRenderContribution),t.DefaultGroupBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,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=vp([hp()],t.DefaultGroupBackgroundRenderContribution),t.DefaultImageBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,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=Sm(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 if(Lp(d)){const{stroke:i,fill:n,lineWidth:r=1,cornerRadius:s=0,expandX:o=0,expandY:a=0}=d;if(!i&&!n)return;e.beginPath();const{x:h,y:l,width:c,height:u}=function(t){const e=sy(t.attribute.boundsPadding),i=t.AABBBounds;let n=i.x1,r=i.y1,s=i.width(),o=i.height();jp(e)?(n+=e,r+=e,s-=2*e,o-=2*e):(n+=e[3],r+=e[0],s-=e[1]+e[3],o-=e[0]+e[2]);return{x:n,y:r,width:s,height:o}}(t);s?YT(e,h-o,l-a,c+2*o,u+2*a,s):e.rect(h-o,l-a,c+2*o,u+2*a),e.globalAlpha=1,n&&(e.fillStyle=n,e.fill()),i&&r>0&&(e.lineWidth=r,e.strokeStyle=i,e.stroke())}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=vp([hp()],t.DefaultImageBackgroundRenderContribution),t.DefaultRectRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{width:v=h.width,height:m=h.height,cornerRadius:y=h.cornerRadius,opacity:b=h.opacity,x:x=h.x,y:w=h.y,scaleX:A=h.scaleX,scaleY:S=h.scaleY}=t.attribute,T=!(!d||!d.stroke),C=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=d,s=yC(e,r,e.dpr),o=i-s,a=n-s,l=2*s;if(0===y||Wp(y)&&y.every((t=>0===t))?(e.beginPath(),e.rect(o,a,v+l,m+l)):(e.beginPath(),YT(e,o,a,v+l,m+l,y)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(T){const r=h.outerBorder.opacity;h.outerBorder.opacity=b,e.setStrokeStyle(t,d,(x-i)/A,(w-n)/S,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=yC(e,r,e.dpr),o=i+s,a=n+s,l=2*s;if(0===y||Wp(y)&&y.every((t=>0===t))?(e.beginPath(),e.rect(o,a,v-l,m-l)):(e.beginPath(),YT(e,o,a,v-l,m-l,y)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(C){const r=h.innerBorder.opacity;h.innerBorder.opacity=b,e.setStrokeStyle(t,p,(x-i)/A,(w-n)/S,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultRectRenderContribution=vp([hp()],t.DefaultRectRenderContribution),t.DefaultRectBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultRectBackgroundRenderContribution=vp([hp()],t.DefaultRectBackgroundRenderContribution),t.DefaultRectTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultRectTextureRenderContribution=vp([hp()],t.DefaultRectTextureRenderContribution),t.SplitRectBeforeRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){const{stroke:p=h.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}},t.SplitRectBeforeRenderContribution=vp([hp()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,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=vp([hp()],t.SplitRectAfterRenderContribution),t.DefaultSymbolRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:f}=t.attribute,g=p&&!1!==p.visible,v=f&&!1!==f.visible;if(!g&&!v)return;const{size:m=h.size,opacity:y=h.opacity,x:b=h.x,y:x=h.y,scaleX:w=h.scaleX,scaleY:A=h.scaleY}=t.attribute,S=!(!p||!p.stroke),T=!(!f||!f.stroke);if(g){const{distance:r=h.outerBorder.distance}=p,s=yC(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,m,i,n,s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,p,h.outerBorder);else if(S){const r=h.outerBorder.opacity;h.outerBorder.opacity=y,e.setStrokeStyle(t,p,(b-i)/w,(x-n)/A,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(v){const{distance:r=h.innerBorder.distance}=f,s=yC(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,m,i,n,-s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,f,h.innerBorder);else if(T){const r=h.innerBorder.opacity;h.innerBorder.opacity=y,e.setStrokeStyle(t,f,(b-i)/w,(x-n)/A,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultSymbolRenderContribution=vp([hp()],t.DefaultSymbolRenderContribution);class wC extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}}class AC extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}}const SC=Symbol.for("RenderService"),TC=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{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,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}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=vp([hp(),mp(0,up(mC)),yp("design:paramtypes",[Object])],t.DefaultRenderService);var CC=new np((e=>{e(t.DefaultRenderService).toSelf(),e(SC).toService(t.DefaultRenderService)}));function BC(t,e,i,n=!1,r=!1){const s={},o=[];let a=!1;if(r)a=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:r=e}=t.attribute;if(0===n)i=r;else if(i!==r)return a=!0,!0;return!1}),n)}if(a){t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],o.push(i))}),n),o.sort(((t,e)=>n?e-t:t-e));let a=!1;for(let t=0;t<o.length&&!a;t++){const e=o[t],h=s[e];r&&h.sort(((t,e)=>{var i,r;return(n?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(r=t.attribute.z)&&void 0!==r?r:0))}));for(let t=0;t<h.length;t++)if(i(h[t],t)){a=!0;break}}}else t.forEachChildren(i,n)}function _C(t,e,i,n=!1){return bp(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,n)}))}function PC(t,e,i,n=!1){const r={},s=[];let o=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(undefined!==n)return o=!0,!0;return!1}),n);let a=null,h=!1;if(o){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 o=!1;for(let t=0;t<s.length&&!o;t++){const i=s[t],n=r[i];for(let t=0;t<n.length;t++){if(h){o=!0,a=n[t];break}n[t]._uid!==e||(h=!0)}}}else t.forEachChildren((t=>h?(a=t,!0):(t._uid===e&&(h=!0),!1)),n);return a}const EC=Symbol.for("PickItemInterceptor");let MC=class{constructor(){this.order=1}afterPickItem(t,e,i,n,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,r):null}beforePickItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,r):null}_pickItem(t,e,i,n,r){if(!t.shadowRoot)return null;const{parentMatrix:s}=r||{};if(!s)return null;const o=e.pickContext;o.highPerformanceSave();const a=t.shadowRoot,h=oT.allocateByObj(s),l=new mf(i.x,i.y);s.transformPoint(l,l);const c=t.transMatrix;h.multiply(c.a,c.b,c.c,c.d,c.e,c.f);const u=e.pickGroup(a,l.clone(),h,n);return o.highPerformanceRestore(),u}};MC=vp([hp()],MC);let kC=class{constructor(){this.order=1}beforePickItem(t,e,i,n,r){if(!t.in3dMode||n.in3dInterceptor)return null;const s=e.pickContext,o=t.stage;if(!s||!o)return null;if(n.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=o.camera,t.isContainer){let o,a=!1,h=!1;if(t.forEachChildren((t=>(a=t.numberType===rw,!a))),t.forEachChildren((t=>(h=!!t.findFace,!h))),a){const s=t.getChildren(),a=[...s];a.sort(((t,e)=>{var i,n,r,s;let o=(null!==(n=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==n?n:0)/2,a=(null!==(s=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==s?s:0)/2;for(;o<0;)o+=rf;for(;a<0;)a+=rf;return a-o})),a.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),a.forEach((e=>{t.appendChild(e)})),n.hack_pieFace="outside",o=e.pickGroup(t,i,r.parentMatrix,n),o.graphic||(n.hack_pieFace="inside",o=e.pickGroup(t,i,r.parentMatrix,n)),o.graphic||(n.hack_pieFace="top",o=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 a=t.getChildren(),h=a.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i: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)})),o=e.pickGroup(t,i,r.parentMatrix,n),t.removeAllChild(),a.forEach((t=>{t._next=null,t._prev=null})),t.update(),a.forEach((e=>{t.add(e)}))}else o=e.pickGroup(t,i,r.parentMatrix,n);return s.camera=null,n.in3dInterceptor=!1,o}return s.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};kC=vp([hp()],kC);const RC=Symbol.for("GraphicPicker"),OC=Symbol.for("PickerService");t.DefaultPickService=class{constructor(t,e){this.global=t,this.pickItemInterceptorContributions=e,this.type="default"}_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 o=new Of(1,0,0,1,r,s);let a;for(let r=t.length-1;r>=0&&(n=t[r].isContainer?this.pickGroup(t[r],e,o,i):this.pickItem(t[r],e,o,i),!n.graphic);r--)a||(a=n.group);if(n.graphic||(n.group=a),this.pickContext&&(this.pickContext.inuse=!1),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){return!!this.pickItem(t,e,null,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=n.pickContext,o=s.modelMatrix;if(s.camera){const e=t.transMatrix,i=aT.allocate();if(uT(i,e),o){if(i){const t=aT.allocate();s.modelMatrix=dT(t,o,i),aT.free(i)}}else uT(i,t.globalTransMatrix),s.modelMatrix=i}if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const a=this.InterceptorContributions[r];if(a.beforePickItem){const r=a.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return s.modelMatrix!==o&&aT.free(s.modelMatrix),s.modelMatrix=o,r}}const a=t.transMatrix,h=oT.allocateByObj(i),l=new mf(e.x,e.y);h.transformPoint(l,l);const c=t.AABBBounds.containsPoint(l);if(!c&&!t.stage.camera)return r;const u=this.pickItem(t,l.clone(),i,n);u&&u.graphic&&(r.graphic=u.graphic,r.params=u.params);const d=!1!==t.attribute.pickable&&c;return h.multiply(a.a,a.b,a.c,a.d,a.e,a.f),!1===t.attribute.childrenPickable||u&&u.graphic||BC(t,ov.zIndex,(s=>{if(s.isContainer){const i=new mf(e.x,e.y),o=Sm(t).group,{scrollX:a=o.scrollX,scrollY:l=o.scrollY}=t.attribute;i.x-=a,i.y-=l,r=this.pickGroup(s,i,h,n)}else{const o=new mf(e.x,e.y);h.transformPoint(o,o);const a=Sm(t).group,{scrollX:l=a.scrollX,scrollY:c=a.scrollY}=t.attribute;o.x-=l,o.y-=c;const u=this.pickItem(s,o,i,n);u&&u.graphic&&(r.graphic=u.graphic,r.params=u.params)}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==o&&aT.free(s.modelMatrix),s.modelMatrix=o,r.graphic||r.group||!d||t.stage.camera||(r.group=t),oT.free(h),r}selectPicker(t){const e=this.pickerMap.get(t.numberType);return e||null}},t.DefaultPickService=vp([hp(),mp(0,up(_p)),mp(1,up(xp)),mp(1,lp(EC)),yp("design:paramtypes",[Object,Object])],t.DefaultPickService);const IC=Symbol.for("BoundsPicker"),DC=Symbol.for("GlobalPickerService");function LC(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i[0],x=i[1],w=i[2],A=i[3];return t[0]=b*n+x*a+w*u+A*g,t[1]=b*r+x*h+w*d+A*v,t[2]=b*s+x*l+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i[4],x=i[5],w=i[6],A=i[7],t[4]=b*n+x*a+w*u+A*g,t[5]=b*r+x*h+w*d+A*v,t[6]=b*s+x*l+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=i[8],x=i[9],w=i[10],A=i[11],t[8]=b*n+x*a+w*u+A*g,t[9]=b*r+x*h+w*d+A*v,t[10]=b*s+x*l+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i[12],x=i[13],w=i[14],A=i[15],t[12]=b*n+x*a+w*u+A*g,t[13]=b*r+x*h+w*d+A*v,t[14]=b*s+x*l+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t}function NC(t,e,i){const n=e[0],r=e[1],s=e[2];let o=i[3]*n+i[7]*r+i[11]*s+i[15];return o=o||1,t[0]=(i[0]*n+i[4]*r+i[8]*s+i[12])/o,t[1]=(i[1]*n+i[5]*r+i[9]*s+i[13])/o,t[2]=(i[2]*n+i[6]*r+i[10]*s+i[14])/o,t}t.DefaultGlobalPickerService=class{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 Of(1,0,0,1,0,0);let s;for(let o=0;o<t.length;o++){if(t[o].isContainer)n=this.pickGroup(t[o],e,r,i);else{const s=this.pickItem(t[o],e,r,i);s&&(n.graphic=s.graphic,n.params=s.params)}if(n.graphic)break;s||(s=n.group)}if(n.graphic||(n.group=s),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){return!!this.pickItem(t,e,null,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=t.transMatrix,o=new mf(e.x,e.y);i.transformPoint(o,o);const a=t.AABBBounds.containsPoint(o);if(!a)return r;const h=!1!==t.attribute.pickable&&a;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 mf(e.x,e.y);i.transformPoint(s,s);const o=this.pickItem(t,s,i,n);o&&(r.graphic=o.graphic,r.params=o.params)}return!!r.graphic||!!r.group})),r.graphic||r.group||!h||(r.group=t),r}pickItem(t,e,i,n){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?{graphic:t}:null}},t.DefaultGlobalPickerService=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],t.DefaultGlobalPickerService);class UC{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=aT.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=aT.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,n){let r,s,o,a,h,l,c,u,d,p;const f=e[0],g=e[1],v=e[2],m=n[0],y=n[1],b=n[2],x=i[0],w=i[1],A=i[2];Math.abs(f-x)<Qp&&Math.abs(g-w)<Qp&&Math.abs(v-A)<Qp?sT.identity(t):(c=f-x,u=g-w,d=v-A,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,r=y*d-b*u,s=b*c-m*d,o=m*u-y*c,p=Math.hypot(r,s,o),p?(p=1/p,r*=p,s*=p,o*=p):(r=0,s=0,o=0),a=u*o-d*s,h=d*r-c*o,l=c*s-u*r,p=Math.hypot(a,h,l),p?(p=1/p,a*=p,h*=p,l*=p):(a=0,h=0,l=0),t[0]=r,t[1]=a,t[2]=c,t[3]=0,t[4]=s,t[5]=h,t[6]=u,t[7]=0,t[8]=o,t[9]=l,t[10]=d,t[11]=0,t[12]=-(r*f+s*g+o*v),t[13]=-(a*f+h*g+l*v),t[14]=-(c*f+u*g+d*v),t[15]=1)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=aT.allocate()),this._vp=LC(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=aT.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=aT.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return function(t,e,i,n,r,s,o){const a=1/(e-i),h=1/(n-r),l=1/(s-o);t[0]=-2*a,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*l,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*h,t[14]=(o+s)*l,t[15]=1}(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=aT.allocate()),this._vp=LC(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return NC(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;NC(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 WC=[0,0,0],FC=new Of(1,0,0,1,0,0);t.BrowserContext2d=class{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())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},Qg),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},ev),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},iv),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Of(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Of(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 Of(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 oT.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&&(oT.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(oT.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,o=!0,a=this.dpr){this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&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,o=!0){this.matrix.multiply(t,e,i,n,r,s),o&&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,o){if(o=o||0,this.camera){const a=[];((t,e,i,n,r,s,o,a)=>{if(a)for(;i>e;)i-=rf;else for(;i<e;)i+=rf;const h=tf/3*(i>e?1:-1);let l=e,c=l;for(;c!==i;){c=h>0?Math.min(c+h,i):Math.max(c+h,i);const e=Math.abs(c-l),a=4*Math.tan(e/4)/3,u=c<l?-1:1,d=Math.cos(l),p=Math.sin(l),f=Math.cos(c),g=Math.sin(c),v=d*s+n,m=p*o+r,y=f*s+n,b=g*o+r,x=s*a*u,w=o*a*u;t.push([v-x*p,m+w*d,y+x*g,b-w*f,y,b]),l=c}})(a,n,r,t,e,i,i,s);for(let t=0;t<a.length;++t){const e=a[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],o)}}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,o){if(o=o||0,this.camera){let a=o,h=o;this.modelMatrix&&(NC(WC,[t,e,o],this.modelMatrix),t=WC[0],e=WC[1],a=WC[2],NC(WC,[i,n,o],this.modelMatrix),i=WC[0],n=WC[1],h=WC[2],NC(WC,[r,s,o],this.modelMatrix),r=WC[0],s=WC[1],o=WC[2]);let l=this.camera.vp(r,s,o);r=l.x,s=l.y,l=this.camera.vp(t,e,a),t=l.x,e=l.y,l=this.camera.vp(i,n,h),i=l.x,n=l.y}this.nativeContext.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.nativeContext.closePath()}ellipse(t,e,i,n,r,s,o,a){null==a?this.nativeContext.ellipse(t,e,i,n,r,s,o):this.nativeContext.ellipse(t,e,i,n,r,s,o,a)}lineTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(NC(WC,[t,e,i],this.modelMatrix),t=WC[0],e=WC[1],i=WC[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&&(NC(WC,[t,e,i],this.modelMatrix),t=WC[0],e=WC[1],i=WC[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&&(NC(WC,[t,e,r],this.modelMatrix),t=WC[0],e=WC[1],s=WC[2],NC(WC,[i,n,r],this.modelMatrix),i=WC[0],n=WC[1],r=WC[2]);let o=this.camera.vp(i,n,r);i=o.x,n=o.y,o=this.camera.vp(t,e,s),t=o.x,e=o.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 o=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),s=!0},GetPattern(a,h,l){return s&&(l||(l=n-i),r=Kw(o,this.stops,t,e,l,i,n,a,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&&(NC(WC,[t,e,i],this.modelMatrix),t=WC[0],e=WC[1],i=WC[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&&(NC(WC,[t,e,i],this.modelMatrix),t=WC[0],e=WC[1],i=WC[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(NC(WC,[e,i,n],this.modelMatrix),e=WC[0],i=WC[1],n=WC[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=Av.global.measureTextMethod){var i,n;return e&&"native"!==e?(this.mathTextMeasure||(this.mathTextMeasure=Av.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas))),this.mathTextMeasure.textSpec.fontFamily=null!==(i=this.fontFamily)&&void 0!==i?i:iv.fontFamily,this.mathTextMeasure.textSpec.fontSize=null!==(n=this.fontSize)&&void 0!==n?n:iv.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&&(NC(WC,[e,i,n],this.modelMatrix),e=WC[0],i=WC[1],n=WC[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])}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:o=r.fillOpacity,opacity:a=r.opacity,fill:h=r.fill}=e;o>1e-12&&a>1e-12?(s.globalAlpha=o*a,s.fillStyle=bC(this,h,t,i,n)):s.globalAlpha=o*a}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)}_setShadowStyle(t,e,i){const n=this.nativeContext;i||(i=this.fillAttributes);const{opacity:r=i.opacity,shadowBlur:s=i.shadowBlur,shadowColor:o=i.shadowColor,shadowOffsetX:a=i.shadowOffsetX,shadowOffsetY:h=i.shadowOffsetY,blur:l=i.blur}=e;r<=1e-12||(s||a||h?(n.shadowBlur=s,n.shadowColor=o,n.shadowOffsetX=a,n.shadowOffsetY=h,this._clearShadowStyle=!0):this._clearShadowStyle&&(n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0),l?(n.filter=`blur(${l}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:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=yC(this,h,this.dpr),s.strokeStyle=bC(this,l,t,i,n),s.lineJoin=c,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=lA(t,e,r&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:s=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=s,this.fontSize=o,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){var n,r;const s=this.nativeContext;e||(e=this.textAttributes),t.font?s.font=t.font:s.font=lA(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:o=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=o,this.fontSize=a,s.textAlign=null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(FC,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=>oT.free(t))),this.stack.length=0}},t.BrowserContext2d.env="browser",t.BrowserContext2d=vp([hp(),yp("design:paramtypes",[Object,Number])],t.BrowserContext2d);const jC={WIDTH:500,HEIGHT:500,DPR:1};t.BrowserCanvas=class{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._displayWidth,this._displayHeight)}constructor(e){const{nativeCanvas:i,width:n=jC.WIDTH,height:r=jC.HEIGHT,dpr:s=jC.DPR,container:o,x:a,y:h,canvasControled:l=!0}=e;if(this._x=null!=a?a:0,this._y=null!=h?h:0,this._pixelWidth=n*s,this._pixelHeight=r*s,this._visiable=!1!==e.visiable,this.controled=l,"string"==typeof o){const t=Av.global.getElementById(o);t&&(this._container=t)}else this._container=o;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:o}=this;o.width=e*n,o.height=i*n;!o.style||this.setCanvasStyle(o,r,s,e,i),t.id&&(o.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.env="browser",t.BrowserCanvas=vp([hp(),yp("design:paramtypes",[Object])],t.BrowserCanvas);const zC=Symbol.for("CanvasArcPicker"),HC=Symbol.for("CanvasArc3dPicker"),GC=Symbol.for("CanvasAreaPicker"),VC=Symbol.for("CanvasCirclePicker"),XC=Symbol.for("CanvasImagePicker"),YC=Symbol.for("CanvasLinePicker"),qC=Symbol.for("CanvasPathPicker"),KC=Symbol.for("CanvasRectPicker"),$C=Symbol.for("CanvasRect3dPicker"),ZC=Symbol.for("CanvasSymbolPicker"),JC=Symbol.for("CanvasTextPicker"),QC=Symbol.for("CanvasPolygonPicker"),tB=Symbol.for("CanvasPyramid3dPicker"),eB=Symbol.for("CanvasRichTextPicker"),iB=Symbol.for("CanvasGlyphPicker"),nB=Symbol.for("CanvasGroupPicker"),rB=Symbol.for("CanvasPickerContribution"),sB=Symbol.for("MathArcPicker"),oB=Symbol.for("MathAreaPicker"),aB=Symbol.for("MathCirclePicker"),hB=Symbol.for("MathLinePicker"),lB=Symbol.for("MathPathPicker"),cB=Symbol.for("MathRectPicker"),uB=Symbol.for("MathSymbolPicker"),dB=Symbol.for("MathTextPicker"),pB=Symbol.for("MathPolygonPicker"),fB=Symbol.for("MathGlyphPicker"),gB=Symbol.for("MathPickerContribution");t.DefaultCanvasPickerService=class extends t.DefaultPickService{constructor(t,e,i,n,r,s,o,a,h,l,c,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=o,this.pathPicker=a,this.symbolPicker=h,this.textPicker=l,this.polygonPicker=c,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,n){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.beforePickItem){const r=s.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n)?t:null,o={graphic:s};if(s)return o;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.afterPickItem){const r=s.afterPickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}return o}},vp([gp(),yp("design:type",Function),yp("design:paramtypes",[]),yp("design:returntype",void 0)],t.DefaultCanvasPickerService.prototype,"init",null),t.DefaultCanvasPickerService=vp([hp(),mp(0,up(xp)),mp(0,lp(rB)),mp(1,up(VC)),mp(2,up(KC)),mp(3,up(zC)),mp(4,up(GC)),mp(5,up(XC)),mp(6,up(YC)),mp(7,up(qC)),mp(8,up(ZC)),mp(9,up(JC)),mp(10,up(QC)),mp(11,up(eB)),mp(12,up(mC)),mp(13,up(_p)),mp(14,up(xp)),mp(14,lp(EC)),yp("design:paramtypes",[Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object])],t.DefaultCanvasPickerService);const vB=new Of(1,0,0,1,0,0),mB={x:0,y:0};t.EmptyContext2d=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Of(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Of(1,0,0,1,0,0),this.path=new qg}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 oT.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(oT.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(oT.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,o=!0,a=this.dpr){this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&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,o=!0){this.matrix.multiply(t,e,i,n,r,s),o&&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,o,a){}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},mB),function(t,e,i){return pm(t,0,!1,e,i)}(this.path.commandList,mB.x,mB.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},mB);const i=yC(this,this.lineWidth,this.dpr);return function(t,e,i,n){return pm(t,e,!0,i,n)}(this.path.commandList,i,mB.x,mB.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(vB,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=>oT.free(t))),this.stack.length=0}},t.EmptyContext2d=vp([hp(),yp("design:paramtypes",[Object,Number])],t.EmptyContext2d),t.DefaultMathPickerService=class extends t.DefaultPickService{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,n){if(!1===t.attribute.pickable)return null;const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n)?t:null;return s?{graphic:s}:null}},vp([gp(),yp("design:type",Function),yp("design:paramtypes",[]),yp("design:returntype",void 0)],t.DefaultMathPickerService.prototype,"init",null),t.DefaultMathPickerService=vp([hp(),mp(0,up(xp)),mp(0,lp(gB)),mp(1,up(_p)),mp(2,up(xp)),mp(2,lp(EC)),yp("design:paramtypes",[Object,Object,Object])],t.DefaultMathPickerService);var yB=new np((e=>{e(t.DefaultCanvasPickerService).toSelf().inSingletonScope(),e(t.DefaultMathPickerService).toSelf().inSingletonScope(),e(OC).toService(t.DefaultCanvasPickerService),e(t.DefaultGlobalPickerService).toSelf().inSingletonScope(),e(DC).toService(t.DefaultGlobalPickerService),e(kC).toSelf().inSingletonScope(),e(EC).toService(kC),e(MC).toSelf().inSingletonScope(),e(EC).toService(MC),Ap(e,EC)})),bB=new np((e=>{e(t.DefaultGraphicService).toSelf().inSingletonScope(),e(bw).toService(t.DefaultGraphicService),e(XS).toSelf().inSingletonScope(),e(VS).toService(XS),Ap(e,VS),e(qS).toSelf().inSingletonScope(),e(YS).toService(qS),Ap(e,YS),e($S).toSelf().inSingletonScope(),e(KS).toService($S),Ap(e,KS),e(JS).toSelf().inSingletonScope(),e(ZS).toService(JS),Ap(e,ZS),e(tT).toSelf().inSingletonScope(),e(QS).toService(tT),Ap(e,QS),e(xw).toConstantValue(IT)}));const xB=Symbol.for("AutoEnablePlugins"),wB=Symbol.for("PluginService");let AB=class{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&&Dv.isBound(xB)&&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=[]}};AB=vp([hp(),mp(0,up(xp)),mp(0,lp(xB)),yp("design:paramtypes",[Object])],AB);var SB=new np((t=>{t(AB).toSelf(),t(wB).toService(AB),Sp(t,xB)}));t.BaseEnvContribution=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new wf}removeDom(t){return!1}createDom(t){return null}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"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}},t.BaseEnvContribution=vp([hp()],t.BaseEnvContribution);class TB{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function CB(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}let BB=class extends t.BaseEnvContribution{constructor(){super(),this.type="browser",this.supportEvent=!0;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){var i;if(e){const{clientX:n,clientY:r}=t,s=e.getBoundingClientRect(),o=null===(i=e.getNativeHandler)||void 0===i?void 0:i.call(e).nativeCanvas;let a,h;return o&&(a=s.width/o.offsetWidth,h=s.height/o.offsetHeight),{x:(n-s.left)/(zp(a)?a:1),y:(r-s.top)/(zp(h)?a:1)}}return{x:t.offsetX,y:t.offsetY}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/xml").firstChild),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new TB(t)}return new wf}removeDom(t){return t.parentElement.removeChild(t),!0}createDom(t){const{tagName:e="div",width:i,height:n,style:r,parent:s}=t,o=document.createElement(e);if(r&&(Up(r)?o.setAttribute("style",r):Object.keys(r).forEach((t=>{o.setAttribute(t,r[t])}))),null!=i&&(o.style.width=`${i}px`),null!=n&&(o.style.height=`${n}px`),s){const t=Up(s)?this.getElementById(s):s;t&&t.appendChild&&t.appendChild(o)}return o}loadImage(t){return CB(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return CB(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,i;const n=document.createElement("canvas");t.id&&(n.id=null!==(e=t.id)&&void 0!==e?e:Cm.GenAutoIncrementId().toString());const r=null!==(i=t.dpr)&&void 0!==i?i:window.devicePixelRatio;return t.width&&t.height&&(n.style.width=`${t.width}px`,n.style.height=`${t.height}px`,n.width=t.width*r,n.height=t.height*r),n}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}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){}getElementTop(t,e){let i=t.offsetTop,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,n=n.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetLeft,n=n.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,n=t.offsetLeft,r=t.offsetParent;for(;null!==r;)i+=r.offsetTop,n+=r.offsetLeft,r=r.offsetParent;return{top:i,left:n}}};function _B(){Dv.rebind(OC).toService(t.DefaultMathPickerService)}function PB(){Dv.rebind(OC).toService(t.DefaultMathPickerService)}BB=vp([hp(),yp("design:paramtypes",[])],BB);let EB=class extends t.BaseEnvContribution{constructor(){super(),this.type="feishu",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,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,o)=>{const a=tt.createCanvasContext(e);a.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:null!=e?e:"",getContext:()=>a,getBoundingClientRect:()=>({height:t.height,width:t.width})};i.set(e,h),o>=n&&r.push(h)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),_B())}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 vy.call(t)}}getCancelAnimationFrame(){return t=>{vy.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){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};EB=vp([hp(),yp("design:paramtypes",[])],EB);let MB=class extends t.BaseEnvContribution{constructor(){super(),this.type="taro",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,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,o,a,h;t.env===this.type&&(t.setActiveEnvContribution(this),i=e.domref,n=e.canvasIdLists,r=this.canvasMap,s=e.freeCanvasIdx,o=this.freeCanvasList,a=e.taro,h=e.pixelRatio,n.forEach(((t,e)=>{const n=a.createCanvasContext(t);n.canvas={width:i.width*h,height:i.height*h},n.createRadialGradient||(n.createRadialGradient=(...t)=>n.createCircularGradient(...t)),!n.getImageData&&a.canvasGetImageData&&(n.getImageData=(e,i,n,r)=>new Promise(((s,o)=>{try{a.canvasGetImageData({canvasId:t,x:e,y:i,width:n,height:r,success(t){s(t)}})}catch(t){o(t)}})));const l={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,l),e>=s&&o.push(l),l})),this.taro=e.taro,this.pixelRatio=e.pixelRatio,PB())}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){}};MB=vp([hp(),yp("design:paramtypes",[])],MB);let kB=!1;try{kB=!!lynx.createCanvasNG}catch(t){}let RB=class extends t.BaseEnvContribution{constructor(){super(),this.type="lynx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,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,o)=>{const a=kB?lynx.createCanvasNG(e):lynx.createCanvas(e);a.width=t.width*s,a.height=t.height*s,kB&&a.attachToCanvasView(e);const h=a.getContext("2d");h.draw=(t,e)=>{e()};const l={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:null!=e?e:"",getContext:()=>h,getBoundingClientRect:()=>({height:t.height,width:t.width})};i.set(e,l),o>=n&&r.push(l)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),_B())}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 vy.call(t)}}getCancelAnimationFrame(){return t=>{vy.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){}};RB=vp([hp(),yp("design:paramtypes",[])],RB);let OB=class extends t.BaseEnvContribution{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.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 vy.call(t)}}getCancelAnimationFrame(){return t=>{vy.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(...t){}createOffscreenCanvas(t){}};OB=vp([hp()],OB);let IB=class extends t.BaseEnvContribution{constructor(){super(),this.type="wx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,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),function(t,e,i,n,r,s){return bp(this,void 0,void 0,(function*(){const t=wx.getSystemInfoSync().pixelRatio;for(let o=0;o<e.length;o++){const a=e[o];yield new Promise((e=>{let h=wx.createSelectorQuery();s&&(h=h.in(s)),h.select(`#${a}`).fields({node:!0,size:!0}).exec((s=>{if(!s[0])return;const h=s[0].node,l=s[0].width,c=s[0].height;h.width=l*t,h.height=c*t,i.set(a,h),o>=n&&r.push(h),e(null)}))}))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((()=>{_B()}))}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 vy.call(t)}}getCancelAnimationFrame(){return t=>{vy.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){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};IB=vp([hp(),yp("design:paramtypes",[])],IB);var DB=new np((t=>{t(BB).toSelf().inSingletonScope(),t(Bp).toService(BB),t(EB).toSelf().inSingletonScope(),t(Bp).toService(EB),t(MB).toSelf().inSingletonScope(),t(Bp).toService(MB),t(RB).toSelf().inSingletonScope(),t(Bp).toService(RB),t(IB).toSelf().inSingletonScope(),t(Bp).toService(IB),t(OB).toSelf().inSingletonScope(),t(Bp).toService(OB),Ap(t,Bp)}));t.BaseWindowHandlerContribution=class{constructor(){this._uid=Cm.GenAutoIncrementId()}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}},t.BaseWindowHandlerContribution=vp([hp(),yp("design:paramtypes",[])],t.BaseWindowHandlerContribution);let LB=class extends t.BaseWindowHandlerContribution{get container(){return this.canvas.nativeCanvas.parentElement}constructor(t){super(),this.global=t,this.type="browser",this._canvasIsIntersecting=!0}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),this.postInit()}postInit(){try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>n)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}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:Cm.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new t.BrowserCanvas(r)}createWindowByCanvas(e){var i;let n;if("string"==typeof e.canvas){if(n=this.global.getElementById(e.canvas),!n)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else n=e.canvas;if(!n)throw new Error("发生错误,传入的canvas不正确");let r=e.width,s=e.height;if(null==r||null==s||!e.canvasControled){const t=n.getBoundingClientRect();r=t.width,s=t.height}let o=e.dpr;if(!1===e.canvasControled&&(o&&console.warn("canvasControled为false后,dpr参数将无效"),o=null),null==o){o=null!==(i=n.getContext("2d").pixelRatio)&&void 0!==i?i:n.width/r}this.canvas=new t.BrowserCanvas({width:r,height:s,dpr:o,nativeCanvas:n,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()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};LB.env="browser",LB=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],LB);let NB=class extends t.BrowserContext2d{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)=>{var o;try{tt.canvasGetImageData({canvasId:null!==(o=this.canvas.nativeCanvas.id)&&void 0!==o?o: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}};NB.env="feishu",NB=vp([hp()],NB);const UB={WIDTH:500,HEIGHT:500,DPR:1};let WB=class{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=UB.WIDTH,height:n=UB.HEIGHT,dpr:r=UB.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,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 NB(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){}};WB.env="feishu",WB=vp([hp(),yp("design:paramtypes",[Object])],WB);let FB=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="feishu",this.eventManager=new class{constructor(){this.cache={}}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={}}}}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:Cm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new WB(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 WB({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()}};FB.env="feishu",FB=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],FB);let jB=class extends t.BrowserContext2d{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:o=r.fillOpacity,opacity:a=r.opacity,fill:h=r.fill}=e;o>1e-12&&a>1e-12&&(s.setGlobalAlpha(o*a),s.setFillStyle(bC(this,h,t,i,n)))}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.setGlobalAlpha(o*a),s.setLineWidth(yC(this,h,this.dpr)),s.setStrokeStyle(bC(this,l,t,i,n)),s.setLineJoin(c),s.setLineDash(u),s.setLineCap(d),s.setMiterLimit(p)}}setTextStyleWithoutAlignBaseline(t,e){var i;const n=this.nativeContext;e||(e=this.textAttributes),t.font?n.font=t.font:n.font=lA(t,e),n.setFontSize(null!==(i=t.fontSize)&&void 0!==i?i:e.fontSize)}setTextStyle(t,e){var i,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=lA(t,e),r.setTextAlign(null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign),r.setTextBaseline(null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline)}createConicGradient(t,e,i,n){return null}createPattern(t,e){return null}};jB.env="taro",jB=vp([hp()],jB);const zB={WIDTH:500,HEIGHT:500,DPR:1};let HB=class{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=zB.WIDTH,height:n=zB.HEIGHT,dpr:r=zB.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,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 jB(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){}};HB.env="taro",HB=vp([hp(),yp("design:paramtypes",[Object])],HB);let GB=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="taro",this.eventManager=new class{constructor(){this.cache={}}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={}}}}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:Cm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new HB(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 HB({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]=Object.assign(Object.assign({},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]=Object.assign(Object.assign({},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()}};GB.env="taro",GB=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],GB);let VB=class extends t.BrowserContext2d{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:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=yC(this,h,this.dpr),s.strokeStyle=bC(this,l,t,i,n),s.lineJoin=c,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)}))}))}};VB.env="lynx",VB=vp([hp()],VB);const XB={WIDTH:500,HEIGHT:500,DPR:1};let YB=class{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=XB.WIDTH,height:n=XB.HEIGHT,dpr:r=XB.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,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 VB(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){}};YB.env="lynx",YB=vp([hp(),yp("design:paramtypes",[Object])],YB);let qB=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="lynx",this.eventManager=new class{constructor(){this.cache={}}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={}}}}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:Cm.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new YB(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 YB({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()}};qB.env="lynx",qB=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],qB),new Of(1,0,0,1,0,0);let KB=class extends t.BrowserContext2d{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 Of(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(...t){}};KB.env="node",KB=vp([hp(),yp("design:paramtypes",[Object,Number])],KB);const $B={WIDTH:500,HEIGHT:500,DPR:1};let ZB=class{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=$B.WIDTH,height:n=$B.HEIGHT,canvasControled:r=!0,dpr:s=$B.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 KB(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&&Op(this._nativeCanvas.release)&&this._nativeCanvas.release()}};ZB.env="node",ZB=vp([hp(),yp("design:paramtypes",[Object])],ZB);let JB=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}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:Cm.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new ZB(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 ZB({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){}};JB.env="node",JB=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],JB);let QB=class extends t.BrowserContext2d{draw(){}createPattern(t,e){return null}};QB.env="wx",QB=vp([hp()],QB);const t_={WIDTH:500,HEIGHT:500,DPR:1};let e_=class{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=t_.WIDTH,height:n=t_.HEIGHT,dpr:r=t_.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,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 QB(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_.env="wx",e_=vp([hp(),yp("design:paramtypes",[Object])],e_);class i_{constructor(){this.cache={}}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={}}}let n_=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="wx",this.eventManager=new i_}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:Cm.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){var e,i,n,r;const{type:s}=t;return!!this.eventManager.cache[s]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=null!==(e=t.changedTouches[0].x)&&void 0!==e?e:t.changedTouches[0].pageX,t.changedTouches[0].clientX=null!==(i=t.changedTouches[0].x)&&void 0!==i?i:t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=null!==(n=t.changedTouches[0].y)&&void 0!==n?n:t.changedTouches[0].pageY,t.changedTouches[0].clientY=null!==(r=t.changedTouches[0].y)&&void 0!==r?r:t.changedTouches[0].pageY),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[s].listener&&this.eventManager.cache[s].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()}};n_.env="wx",n_=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],n_);var r_=new np((t=>{t(LB).toSelf(),t(Mw).toDynamicValue((t=>t.container.get(LB))).whenTargetNamed(LB.env),t(FB).toSelf(),t(Mw).toDynamicValue((t=>t.container.get(FB))).whenTargetNamed(FB.env),t(GB).toSelf(),t(Mw).toDynamicValue((t=>t.container.get(GB))).whenTargetNamed(GB.env),t(qB).toSelf(),t(Mw).toDynamicValue((t=>t.container.get(qB))).whenTargetNamed(qB.env),t(n_).toSelf(),t(Mw).toDynamicValue((t=>t.container.get(n_))).whenTargetNamed(n_.env),t(JB).toSelf(),t(Mw).toDynamicValue((t=>t.container.get(JB))).whenTargetNamed(JB.env)})),s_=new np((t=>{t(Iv).toSelf().inSingletonScope(),t(Ov).toService(Iv),Ap(t,Ov)}));let o_=class{constructor(t){this.global=t,this.offscreen=!1}setDpr(t){this.canvas.dpr=t}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=Uv({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){var n;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,Object.assign(Object.assign({context:this.context,clear:null!==(n=e.background)&&void 0!==n?n:"#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){var n;const r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};o_=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],o_);let a_=class{constructor(t){this.global=t,this.offscreen=!0}setDpr(t){this.canvas.dpr=t}init(t,e,i){this.layer=t;const n=Uv({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){var i;e.renderService.render(t,Object.assign(Object.assign({context:this.context},e),{x:0,y:0,clear:null!==(i=e.background)&&void 0!==i?i:"#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:o=0,width:a=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,o,a,h),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,o,a,h),n.nativeContext.restore()}merge(t){}};a_=vp([hp(),mp(0,up(_p)),yp("design:paramtypes",[Object])],a_);var h_=new np((t=>{t(o_).toSelf(),t(a_).toSelf(),t(_w).toService(o_)}));const l_=Symbol.for("DrawItemInterceptor"),c_=new wf;let u_=class{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,i,n,r),!1}drawItem(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){c_.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(c_),!0}};u_=vp([hp()],u_);let d_=class{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.attribute._debug_bounds)return!1;const{context:s}=i;s.highPerformanceSave(),s.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const o=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(s,t),s.strokeRect(o.x1,o.y1,o.width(),o.height()),s.highPerformanceRestore(),!0}};d_=vp([hp()],d_);let p_=class{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:s,stage:o}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=o.camera;const a=s.currentMatrix;a.a/=s.dpr,a.b/=s.dpr,a.c/=s.dpr,a.d/=s.dpr,a.e/=s.dpr,a.f/=s.dpr;const h=aT.allocate();uT(h,a);const l=s.modelMatrix;if(l){if(h){const t=aT.allocate();s.modelMatrix=dT(t,l,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===rw,!e))),t.forEachChildren((t=>(r=!!t.findFace,!r))),e){const e=t.getChildren(),r=[...e];r.sort(((t,e)=>{var i,n,r,s;let o=((null!==(i=t.attribute.startAngle)&&void 0!==i?i:0)+(null!==(n=t.attribute.endAngle)&&void 0!==n?n:0))/2,a=((null!==(r=e.attribute.startAngle)&&void 0!==r?r:0)+(null!==(s=e.attribute.endAngle)&&void 0!==s?s:0))/2;for(;o<0;)o+=rf;for(;a<0;)a+=rf;return a-o})),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=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i: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!==l&&aT.free(s.modelMatrix),s.modelMatrix=l,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}};p_=vp([hp()],p_);let f_=class{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 xf,this.backupDirtyBounds=new xf}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:o,height:a}=e;if(!i)return;const h=this.dirtyBounds.setValue(0,0,o,a);if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=(l=h,c=n.dirtyBounds,u=!1,null===l?c:null===c?l:(Tf=l.x1,Cf=l.x2,Bf=l.y1,_f=l.y2,Pf=c.x1,Ef=c.x2,Mf=c.y1,kf=c.y2,u&&(Tf>Cf&&(Tf=(d=[Cf,Tf])[0],Cf=d[1]),Bf>_f&&(Bf=(p=[_f,Bf])[0],_f=p[1]),Pf>Ef&&(Pf=(f=[Ef,Pf])[0],Ef=f[1]),Mf>kf&&(Mf=(g=[kf,Mf])[0],kf=g[1])),Tf>=Ef||Cf<=Pf||Bf>=kf||_f<=Mf?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(Tf,Pf),y1:Math.max(Bf,Mf),x2:Math.min(Cf,Ef),y2:Math.min(_f,kf)}));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 l,c,u,d,p,f,g;this.backupDirtyBounds.copy(h),i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0);const v=h.width()*i.dpr!==i.canvas.width||h.height()*i.dpr!==i.canvas.height;i.save(),i.translate(r,s,!0),v&&(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)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:ov.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:ov.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=PC(e,i,ov.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(!Lf(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:()=>{var n;i?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))})):BC(t,ov.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))}),!1,!!(null===(n=e.context)||void 0===n?void 0:n.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 o=s.layer.getNativeHandler().getContext(),a=s.drawContribution||Dv.get(JT);a.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:s.layer,context:o,startAtId:t._uid,break:!1})),s.drawContribution=a;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,Object.assign(Object.assign({},e),{drawContribution:a,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&&!Lf(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,o=0,a=0;e.clearRect(o,a,r,s),e.fillStyle=bC(e,n,{AABBBounds:{x1:o,y1:a,x2:o+r,y2:a+s}},0,0),e.fillRect(o,a,r,s)}}afterDraw(t,e){}};vp([up(_p),yp("design:type",Object)],f_.prototype,"global",void 0),vp([gp(),yp("design:type",Function),yp("design:paramtypes",[]),yp("design:returntype",void 0)],f_.prototype,"init",null),f_=vp([hp(),mp(0,dp(nC)),mp(1,up(vC)),mp(2,up(Ow)),mp(3,up(xp)),mp(3,lp(l_)),yp("design:paramtypes",[Array,Object,Object,Object])],f_);let g_=class{selector(t){return null}};g_=vp([hp()],g_);let v_=class{constructor(t){this.groupRenderContribitions=t,this.numberType=hw}drawShape(e,i,n,r,s,o,a,h){const l=Sm(e,null==o?void 0:o.theme).group,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,width:f=l.width,height:g=l.height,clip:v=l.clip,fillOpacity:m=l.fillOpacity,strokeOpacity:y=l.strokeOpacity,cornerRadius:b=l.cornerRadius,path:x=l.path,lineWidth:w=l.lineWidth,visible:A=l.visible}=e.attribute,S=Uw(p,m,f,g,c),T=Fw(p,y,f,g),C=Dw(c,u),B=Lw(d,w);if(!e.valid||!A)return;if(!v){if(!C&&!B)return;if(!(S||T||a||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,o)})),i.disableFill=t,i.disableStroke=e,i.disableBeginPath=n}else 0===b||Wp(b)&&b.every((t=>0===t))?(i.beginPath(),i.rect(n,r,f,g)):(i.beginPath(),YT(i,n,r,f,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[]);const _={doFill:C,doStroke:B};this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h,_)})),v&&i.clip(),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),_.doFill&&(a?a(i,e.attribute,l):S&&(i.setCommonStyle(e,e.attribute,n,r,l),i.fill())),_.doStroke&&(h?h(i,e.attribute,l):T&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke())),this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,B,S,T,l,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s}=t.attribute;s?r.save():r.highPerformanceSave();const o=Sm(t,null==n?void 0:n.theme).group,a=r.modelMatrix;if(r.camera){const e=aT.allocate(),i=aT.allocate();pT(i,t,o),dT(e,a||e,i),r.modelMatrix=e,aT.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=o.scrollX,scrollY:l=o.scrollY}=t.attribute;let c;(h||l)&&r.translate(h,l),n&&n.drawingCb&&(c=n.drawingCb()),r.modelMatrix!==a&&aT.free(r.modelMatrix),r.modelMatrix=a,c&&c.then?c.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}};v_=vp([hp(),mp(0,up(xp)),mp(0,lp(Qw)),yp("design:paramtypes",[Object])],v_);let m_=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.numberType=cw}drawShape(t,e,i,n,r,s,o,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(e>h.length)return;const l=Sm(t).line,{fill:c=l.fill,stroke:u=l.stroke,opacity:d=l.opacity,fillOpacity:p=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,lineWidth:g=l.lineWidth,visible:v=l.visible}=t.attribute,m=Nw(d,p,c),y=Ww(d,f),b=Dw(c),x=Lw(u,g);if(!t.valid||!v)return;if(!b&&!x)return;if(!(m||y||o||a))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],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,o,a)}drawIncreaseSegment(t,e,i,n,r,s,o,a){n&&(e.beginPath(),UT(e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setStrokeStyle(t,r,o,a,s),e.stroke())}};m_=vp([hp()],m_);let y_=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.numberType=sw}drawShape(t,e,i,n,r,s,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:a}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(s>h.length)return;const l=Sm(t).area,{fill:c=l.fill,fillOpacity:u=l.fillOpacity,opacity:d=l.opacity,visible:p=l.visible}=t.attribute,f=Nw(d,u,c),g=Dw(c);if(!t.valid||!p)return;if(!g)return;if(!f&&!o)return;for(let r=s;r<s+a;r++)this.drawIncreaseSegment(t,e,h[r-1],h[r],t.attribute.segments[r],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,o)}drawIncreaseSegment(t,e,i,n,r,s,o,a){n&&(e.beginPath(),WT(e.camera?e:e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setCommonStyle(t,r,o,a,s),e.fill())}};var b_;y_=vp([hp()],y_),function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(b_||(b_={}));let x_=class extends f_{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,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=b_.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new Cp([])}}init(){super.init(),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return bp(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=yield 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)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:ov.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:ov.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})))}))}_increaseRender(t,e){return bp(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return bp(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>bp(this,void 0,void 0,(function*(){if(2!==t.count)yield _C(t,ov.zIndex,((i,n)=>{if(this.status===b_.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,yield this.waitToNextFrame();else this.renderItem(n,e);i(!1)}}))})})),this.hooks.completeDraw.call()}))}waitToNextFrame(){return bp(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return bp(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return bp(this,void 0,void 0,(function*(){this.rendering&&(this.status=b_.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=b_.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return bp(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>bp(this,void 0,void 0,(function*(){yield _C(t,ov.zIndex,(t=>bp(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};vp([up(_p),yp("design:type",Object)],x_.prototype,"global",void 0),x_=vp([hp(),mp(0,dp(nC)),mp(1,up(vC)),mp(2,up(m_)),mp(3,up(y_)),mp(4,up(Ow)),mp(5,up(xp)),mp(5,lp(l_)),yp("design:paramtypes",[Array,Object,Object,Object,Object,Object])],x_);let w_=class extends t.BaseRender{constructor(){super(...arguments),this.type="rect3d",this.numberType=gw}drawShape(t,e,i,n,r,s,o,a){var h;const l=Sm(t,null==s?void 0:s.theme).rect3d,{fill:c=l.fill,stroke:u=l.stroke,width:d=l.width,height:p=l.height,opacity:f=l.opacity,fillOpacity:g=l.fillOpacity,lineWidth:v=l.lineWidth,strokeOpacity:m=l.strokeOpacity,visible:y=l.visible}=t.attribute,b=null!==(h=this.z)&&void 0!==h?h:0,x=Uw(f,g,d,p,c),w=Fw(f,m,d,p),A=Dw(c),S=Lw(u,v);if(!t.valid||!y)return;if(!A&&!S)return;if(!(x||w||o||a))return;const{light:T,camera:C}=r.stage||{},B=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,b,B,r,e,T,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,b,B,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const o=s[n[0]],a={x:t+o[0],y:e+o[1],z:i+o[2]},h=s[n[1]],l={x:t+h[0],y:e+h[1],z:i+h[2]};r.beginPath(),r.moveTo(a.x,a.y,a.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(t,e,i,n,r,s,o,a){const h=Ky.get(r).value,l=n.vertices,c=l.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=c[i[0]],s=c[i[1]],o=c[i[2]],a=c[i[3]];t.ave_z=r+s+o+a})),u.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),u.forEach((n=>{const{polygon:c,normal:u}=n.polygon,d=l[c[0]],p=l[c[1]],f=l[c[2]],g=l[c[3]],v={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]},y={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(v.x,v.y,v.z),s.lineTo(m.x,m.y,m.z),s.lineTo(y.x,y.y,y.z),s.lineTo(b.x,b.y,b.z),s.closePath(),a?a(s,null,null):(s.fillStyle=o?o.computeColor(u,h):r,s.fill())}))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=Sm(t).rect,s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;this.z=h,this.drawShape(t,n,o,a,i),this.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore()}};w_=vp([hp()],w_);let A_=class{constructor(){this.numberType=vw}drawShape(t,e,i,n,r){const s=Sm(t).richtext,{width:o=s.width,height:a=s.height,opacity:h=s.opacity,fillOpacity:l=s.fillOpacity,visible:c=s.visible}=t.attribute;if(!t.valid||!c)return;if(!Nw(h,l,!0))return;e.translate(i,n);t.getFrameCache().draw(e,this.drawIcon)}drawIcon(t,e,i,n,r){var s;const o=Sm(t).richtextIcon,{width:a=o.width,height:h=o.height,opacity:l=o.opacity,image:c,backgroundFill:u=o.backgroundFill,backgroundFillOpacity:d=o.backgroundFillOpacity,backgroundStroke:p=o.backgroundStroke,backgroundStrokeOpacity:f=o.backgroundStrokeOpacity,backgroundRadius:g=o.backgroundRadius,margin:v}=t.attribute,{backgroundWidth:m=a,backgroundHeight:y=h}=t.attribute;if(v&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(m-a)/2,r=(y-h)/2;0===g?(e.beginPath(),e.rect(i-t,n-r,m,y)):(e.beginPath(),YT(e,i-t,n-r,m,y,g)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=f,e.strokeStyle=p,e.stroke())}const b=c&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(c));b&&"success"===b.state&&(e.globalAlpha=l,e.drawImage(b.data,i,n,a,h))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=Sm(t).richtext;let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,n,s,o,i),n.highPerformanceRestore()}};A_=vp([hp()],A_);let S_=class{constructor(){this.numberType=aw}drawShape(t,e,i,n,r,s,o,a){r.drawContribution&&t.getSubGraphic().forEach((t=>{const h=r.drawContribution.getRenderContribution(t);h&&h.drawShape&&h.drawShape(t,e,i,n,r,s,o,a)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;if(r.highPerformanceSave(),!i.drawContribution)return;const s=Sm(t),o=t.getSubGraphic();o.length&&o.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:s})})),r.highPerformanceRestore()}};S_=vp([hp()],S_);let T_=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=rw}drawShape(t,e,i,n,r,s,o,a){var h;const l=Sm(t,null==s?void 0:s.theme).arc,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,fillOpacity:f=l.fillOpacity,lineWidth:g=l.lineWidth,strokeOpacity:v=l.strokeOpacity,visible:m=l.visible}=t.attribute,y=Nw(p,f,c),b=Ww(p,v),x=Dw(c,u),w=Lw(d,g),A=null!==(h=this.z)&&void 0!==h?h:0;if(!t.valid||!m)return;if(!x&&!w)return;if(!(y||b||o||a||u))return;const{outerRadius:S=l.outerRadius,innerRadius:T=l.innerRadius,height:C=10}=t.attribute,B=Ky.get(c).value,{light:_}=r.stage||{},P=r.hack_pieFace,E={top:A,bottom:A+C},M={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===P||"top"===P?(e.beginPath(),function(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=sf(h-a),c=h>a;let u=!1;if(s<o){const t=s;s=o,o=t}if(s<=Qp)e.moveTo(i,n,r);else if(l>=rf-Qp)e.moveTo(i+s*af(a),n+s*cf(a),r),e.arc(i,n,s,a,h,!c,r),o>Qp&&(e.moveTo(i+o*af(h),n+o*cf(h),r),e.arc(i,n,o,h,a,c,r));else{const{outerDeltaAngle:l,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:f,innerEndAngle:g,innerStartAngle:v}=t.getParsePadAngle(a,h),m=s*af(p),y=s*cf(p),b=o*af(g),x=o*cf(g);l<.001?u=!0:(e.moveTo(i+m,n+y,r),e.arc(i,n,s,p,f,!c,r)),!(o>Qp)||d<.001?(e.lineTo(i+b,n+x,r),u=!0):(e.lineTo(i+b,n+x,r),e.arc(i,n,o,g,v,c,r))}e.closePath()}(t,e,i,n,E[P],S,T),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),x&&(o?o(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=_?_.computeColor(M[P],B):c,e.fill())),w&&(a?a(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke()))):"outside"!==P&&"inside"!==P||("inside"===P&&(e.save(),e.beginPath(),e.arc(i,n,T,0,rf,!0,E.top),e.clip()),e.beginPath(),function(t,e,i,n,r,s,o,a){const{startAngle:h,endAngle:l}=t.getParsedAngle(),c=sf(l-h),u=l>h;let d=!1;if(o<=Qp)e.moveTo(i,n,r);else if(c>=rf-Qp)e.moveTo(i+o*af(h),n+o*cf(h),r),e.arc(i,n,o,h,l,!u,r),e.lineTo(i+o*af(l),n+o*cf(l),s),e.arc(i,n,o,l,h,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=a(h,l),f=o*af(c),g=o*cf(c),v=o*af(p),m=o*cf(p);t<.001?d=!0:(e.moveTo(i+f,n+g,r),e.arc(i,n,o,c,p,!u,r),e.lineTo(i+v,n+m,s),e.arc(i,n,o,p,c,u,s))}e.closePath()}(t,e,i,n,E.top,E.bottom,"outside"===P?S:T,((e,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:o,innerEndAngle:a,innerStartAngle:h}=t.getParsePadAngle(e,i);return"outside"===P?{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:a,innerouterStartAngle:h}})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),x&&(o?o(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=_?_.computeColor(M[P],B):c,e.fill())),w&&(a?a(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke())),"inside"===P&&e.restore())}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=Sm(t,null==n?void 0:n.theme).arc;r.save();const o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,jw(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&aT.free(r.modelMatrix),r.modelMatrix=c),r.restore()}};T_=vp([hp()],T_);let C_=class extends t.BaseRender{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=pw}drawShape(t,e,i,n,r,s,o,a){var h;const l=Sm(t,null==s?void 0:s.theme).polygon,{fill:c=l.fill,stroke:u=l.stroke,opacity:d=l.opacity,fillOpacity:p=l.fillOpacity,lineWidth:f=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:v=l.visible,points:m,face:y=[!0,!0,!0,!0,!0,!0]}=t.attribute,b=null!==(h=this.z)&&void 0!==h?h:0,x=Nw(d,p,c),w=Ww(d,g),A=Dw(c),S=Lw(u,f);if(!t.valid||!v||4!==m.length)return;if(!A&&!S)return;if(!(x||w||o||a))return;const{light:T,camera:C}=r.stage||{},B=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,b,B,y,r,e,T,C,t,l,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,b,B,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const o=s[n[0]],a=s[n[1]],h={x:t+o[0],y:e+o[1],z:i+o[2]},l={x:t+a[0],y:e+a[1],z:i+a[2]};r.beginPath(),r.moveTo(h.x,h.y,h.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(t,e,i,n,r,s,o,a,h,l,c,u){const d=Ky.get(s).value,p=n.vertices,f=p.map((t=>o.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]],o=f[i[1]],a=f[i[2]],h=f[i[3]];t.ave_z=s+o+a+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]],v=p[r[2]],m=p[r[3]],y={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+v[0],y:e+v[1],z:i+v[2]},w={x:t+m[0],y:e+m[1],z:i+m[2]};o.beginPath(),o.moveTo(y.x,y.y,y.z),o.lineTo(b.x,b.y,b.z),o.lineTo(x.x,x.y,x.z),o.lineTo(w.x,w.y,w.z),o.closePath(),u?u(o,l.attribute,c):(o.fillStyle=a?a.computeColor(h,d):s,o.fill())}))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=Sm(t).polygon,s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;this.z=h,this.drawShape(t,n,o,a,i),this.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore()}};C_=vp([hp()],C_);let B_=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};B_=vp([hp()],B_);let __=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}};__=vp([hp()],__);let P_=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};P_=vp([hp()],P_);let E_=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}};E_=vp([hp()],E_);let M_=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};M_=vp([hp()],M_);let k_=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){var p,f,g,v;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:m=t.attribute}=d||{},{texture:y=(null!==(p=t.attribute.texture)&&void 0!==p?p:fy(h,"texture")),textureColor:b=(null!==(f=t.attribute.textureColor)&&void 0!==f?f:fy(h,"textureColor")),textureSize:x=(null!==(g=t.attribute.textureSize)&&void 0!==g?g:fy(h,"textureSize")),texturePadding:w=(null!==(v=t.attribute.texturePadding)&&void 0!==v?v:fy(h,"texturePadding"))}=m;if(!y)return;let A=this.textureMap.get(y);if(!A)switch(y){case"circle":A=this.createCirclePattern(x,w,b,e);break;case"diamond":A=this.createDiamondPattern(x,w,b,e);break;case"rect":A=this.createRectPattern(x,w,b,e);break;case"vertical-line":A=this.createVerticalLinePattern(x,w,b,e);break;case"horizontal-line":A=this.createHorizontalLinePattern(x,w,b,e);break;case"bias-lr":A=this.createBiasLRLinePattern(x,w,b,e);break;case"bias-rl":A=this.createBiasRLLinePattern(x,w,b,e);break;case"grid":A=this.createGridPattern(x,w,b,e)}A&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=A,e.fill(),e.highPerformanceRestore())}};k_=vp([hp()],k_);var R_=new np((e=>{e(f_).toSelf(),e(mC).toService(f_),e(x_).toSelf(),e(JT).toService(x_),e(g_).toSelf(),e(vC).toService(g_),e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(iC).to(t.DefaultCanvasCircleRender),e(nC).to(t.DefaultCanvasCircleRender),e(t.DefaultCircleRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleTextureRenderContribution).toSelf().inSingletonScope(),e(Jw).toService(t.DefaultCircleRenderContribution),e(Jw).toService(t.DefaultCircleBackgroundRenderContribution),e(Jw).toService(t.DefaultCircleTextureRenderContribution),Ap(e,Jw),e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(hC).to(t.DefaultCanvasRectRender),e(nC).to(t.DefaultCanvasRectRender),e(w_).toSelf().inSingletonScope(),e(lC).toService(w_),e(nC).toService(lC),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(nA).toService(t.DefaultRectRenderContribution),e(nA).toService(t.DefaultRectBackgroundRenderContribution),e(nA).toService(t.DefaultRectTextureRenderContribution),e(nA).toService(t.SplitRectBeforeRenderContribution),e(nA).toService(t.SplitRectAfterRenderContribution),Ap(e,nA),e(t.DefaultCanvasTextRender).toSelf().inSingletonScope(),e(uC).to(t.DefaultCanvasTextRender),e(nC).to(t.DefaultCanvasTextRender),Ap(e,sA),e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(oC).to(t.DefaultCanvasPathRender),e(nC).to(t.DefaultCanvasPathRender),e(P_).toSelf().inSingletonScope(),e(E_).toSelf().inSingletonScope(),e(eA).toService(P_),e(eA).toService(E_),Ap(e,eA),e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(cC).to(t.DefaultCanvasSymbolRender),e(nC).to(t.DefaultCanvasSymbolRender),e(t.DefaultSymbolRenderContribution).toSelf().inSingletonScope(),e(wC).toSelf().inSingletonScope(),e(AC).toSelf().inSingletonScope(),e(rA).toService(t.DefaultSymbolRenderContribution),e(rA).toService(wC),e(rA).toService(AC),Ap(e,rA),e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(QT).to(t.DefaultCanvasArcRender),e(nC).to(t.DefaultCanvasArcRender),e(T_).toSelf().inSingletonScope(),e(tC).toService(T_),e(nC).toService(tC),e(t.DefaultArcRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcTextureRenderContribution).toSelf().inSingletonScope(),e($w).toService(t.DefaultArcRenderContribution),e($w).toService(t.DefaultArcBackgroundRenderContribution),e($w).toService(t.DefaultArcTextureRenderContribution),Ap(e,$w),e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(sC).to(t.DefaultCanvasLineRender),e(nC).to(t.DefaultCanvasLineRender),e(m_).toSelf().inSingletonScope(),e(y_).toSelf().inSingletonScope(),e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(eC).to(t.DefaultCanvasAreaRender),e(nC).to(t.DefaultCanvasAreaRender),e(M_).toSelf().inSingletonScope(),e(k_).toSelf().inSingletonScope(),e(Zw).toService(M_),e(Zw).toService(k_),Ap(e,Zw),e(v_).toSelf().inSingletonScope(),e(rC).to(v_),e(nC).to(v_),e(t.DefaultGroupBackgroundRenderContribution).toSelf().inSingletonScope(),e(Qw).toService(t.DefaultGroupBackgroundRenderContribution),Ap(e,Qw),e(t.DefaultCanvasPolygonRender).toSelf().inSingletonScope(),e(aC).to(t.DefaultCanvasPolygonRender),e(nC).to(t.DefaultCanvasPolygonRender),e(B_).toSelf().inSingletonScope(),e(__).toSelf().inSingletonScope(),e(iA).toService(B_),e(iA).toService(__),Ap(e,iA),e(S_).toSelf().inSingletonScope(),e(fC).toService(S_),e(nC).toService(fC),e(t.DefaultCanvasImageRender).toSelf().inSingletonScope(),e(gC).toService(t.DefaultCanvasImageRender),e(nC).toService(gC),e(t.DefaultImageBackgroundRenderContribution).toSelf().inSingletonScope(),e(tA).toService(t.DefaultImageBackgroundRenderContribution),Ap(e,tA),e(A_).toSelf().inSingletonScope(),e(dC).toService(A_),e(nC).toService(dC),e(C_).toSelf().inSingletonScope(),e(pC).toService(C_),e(nC).toService(pC),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),e(sA).toService(t.DefaultBaseInteractiveRenderContribution),e($w).toService(t.DefaultBaseInteractiveRenderContribution),e(eA).toService(t.DefaultBaseInteractiveRenderContribution),e(rA).toService(t.DefaultBaseInteractiveRenderContribution),e(nA).toService(t.DefaultBaseInteractiveRenderContribution),e(tA).toService(t.DefaultBaseInteractiveRenderContribution),e(Jw).toService(t.DefaultBaseInteractiveRenderContribution),e(Zw).toService(t.DefaultBaseInteractiveRenderContribution),e(iA).toService(t.DefaultBaseInteractiveRenderContribution),Ap(e,oA),Ap(e,nC),e(u_).toSelf().inSingletonScope(),e(l_).toService(u_),e(d_).toSelf().inSingletonScope(),e(l_).toService(d_),e(p_).toSelf().inSingletonScope(),e(l_).toService(p_),Ap(e,l_)}));let O_=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=ow}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=yC(n,s,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};O_=vp([hp(),mp(0,up(iC)),yp("design:paramtypes",[Object])],O_);const I_=new wf;let D_=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=fw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;n.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,n.setTransformForCurrent()}else o=0,a=0,h=!1,n.transformFromMatrix(t.transMatrix,!0);let l=!0;if(!h||t.shadowRoot||jp(s,!0)&&0!==s||Wp(s)&&s.some((t=>0!==t)))l=!1,this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,i,n)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,r)=>{if(l)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=yC(n,s,n.dpr),l=t.isPointInStroke(e.x,e.y),l}));else{const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)l=!0;else if(n){const i=t.AABBBounds;I_.setValue(i.x1,i.y1,i.x2,i.y2),I_.expand(-s/2),l=!I_.containsPoint(e)}}return n.highPerformanceRestore(),l}};D_=vp([hp(),mp(0,up(hC)),yp("design:paramtypes",[Object])],D_);let L_=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=nw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).arc;n.highPerformanceSave();let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=yC(n,s,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};L_=vp([hp(),mp(0,up(QT)),yp("design:paramtypes",[Object])],L_);let N_=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=sw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a))),n.highPerformanceRestore(),a}};N_=vp([hp(),mp(0,up(eC)),yp("design:paramtypes",[Object])],N_);let U_=class{constructor(){this.type="image",this.numberType=lw}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};U_=vp([hp()],U_);let W_=class extends t.BaseRender{};W_=vp([hp()],W_);let F_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=cw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const r=Sm(t).line,s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=yC(n,r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};F_=vp([hp(),mp(0,up(sC)),yp("design:paramtypes",[Object])],F_);let j_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=uw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).path;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=yC(n,r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};j_=vp([hp(),mp(0,up(oC)),yp("design:paramtypes",[Object])],j_),TT({});let z_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=mw}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const s=Sm(t).symbol,o=this.transform(t,s,n),{x:a,y:h,z:l,lastModelMatrix:c}=o;let u=e;if(n.camera){u=e.clone();const i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let d=!1;return this.canvasRenderer.drawShape(t,n,a,h,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,i)=>{if(d)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=yC(n,r,n.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==c&&aT.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),d}};z_=vp([hp(),mp(0,up(cC)),yp("design:paramtypes",[Object])],z_);let H_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=yw}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();const s=Sm(t).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,h=this.transform(t,s,n,a),{x:l,y:c,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,l,c,{},null,((e,i,n)=>{if(f)return!0;const{fontSize:r=s.fontSize,textBaseline:o=s.textBaseline,textAlign:a=s.textAlign}=t.attribute,h=t.AABBBounds,d=h.height(),g=h.width(),v=uA(o,d,r),m=cA(a,g);return e.rect(m+l,v+c,g,d,u),f=e.isPointInPath(p.x,p.y),f}),((t,e,i)=>f)),this.canvasRenderer.z=0,n.modelMatrix!==d&&aT.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),f}};H_=vp([hp(),mp(0,up(uC)),yp("design:paramtypes",[Object])],H_);let G_=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=dw}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};G_=vp([hp(),mp(0,up(aC)),yp("design:paramtypes",[Object])],G_),new wf;let V_=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=vw}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};V_=vp([hp(),mp(0,up(dC)),yp("design:paramtypes",[Object])],V_);let X_=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=aw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{if(n)return;const s=r.pickItem(t,e,null,i);n=!(!s||!s.graphic)})),n}return!1}};X_=vp([hp(),mp(0,up(fC)),yp("design:paramtypes",[Object])],X_),new wf;let Y_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=gw}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).rect;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};Y_=vp([hp(),mp(0,up(lC)),yp("design:paramtypes",[Object])],Y_),new wf;let q_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=pw}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).polygon;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>!1)),this.canvasRenderer.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};q_=vp([hp(),mp(0,up(pC)),yp("design:paramtypes",[Object])],q_),new wf;let K_=class extends W_{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=rw}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).arc;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==l&&aT.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};K_=vp([hp(),mp(0,up(tC)),yp("design:paramtypes",[Object])],K_);let $_=class{constructor(){this.type="group",this.numberType=hw}contains(t,e,i){return!1}};$_=vp([hp()],$_);var Z_=new np(((t,e,i,n)=>{t(O_).toSelf().inSingletonScope(),t(VC).toService(O_),t(rB).toService(VC),t(D_).toSelf().inSingletonScope(),t(KC).toService(D_),t(rB).toService(KC),t(Y_).toSelf().inSingletonScope(),t($C).toService(Y_),t(rB).toService($C),t(L_).toSelf().inSingletonScope(),t(zC).toService(L_),t(rB).toService(zC),t(N_).toSelf().inSingletonScope(),t(GC).toService(N_),t(rB).toService(GC),t(U_).toSelf().inSingletonScope(),t(XC).toService(U_),t(rB).toService(XC),t(F_).toSelf().inSingletonScope(),t(YC).toService(F_),t(rB).toService(YC),t(j_).toSelf().inSingletonScope(),t(qC).toService(j_),t(rB).toService(qC),t(z_).toSelf().inSingletonScope(),t(ZC).toService(z_),t(rB).toService(ZC),t(H_).toSelf().inSingletonScope(),t(JC).toService(H_),t(rB).toService(JC),t(G_).toSelf().inSingletonScope(),t(QC).toService(G_),t(rB).toService(QC),t(q_).toSelf().inSingletonScope(),t(tB).toService(q_),t(rB).toService(tB),t(K_).toSelf().inSingletonScope(),t(HC).toService(K_),t(rB).toService(HC),t(V_).toSelf().inSingletonScope(),t(eB).toService(V_),t(rB).toService(eB),t(X_).toSelf().inSingletonScope(),t(iB).toService(X_),t(rB).toService(iB),t($_).toSelf().inSingletonScope(),t(nB).toService($_),t(rB).toService(nB),Ap(t,rB)}));let J_=class{constructor(t){this.canvasRenderer=t,this.type="path",this.numberType=uw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).path;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};J_=vp([hp(),mp(0,up(oC)),yp("design:paramtypes",[Object])],J_);let Q_=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=ow}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};Q_=vp([hp(),mp(0,up(iC)),yp("design:paramtypes",[Object])],Q_);const tP=new wf;let eP=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=fw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;n.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,n.setTransformForCurrent()}else o=0,a=0,h=!1,n.transformFromMatrix(t.transMatrix,!0);let l=!0;if(!h||jp(s,!0)&&0!==s||Wp(s)&&s.some((t=>0!==t)))l=!1,this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,i,n)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,r)=>{if(l)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,l=t.isPointInStroke(e.x,e.y),l}));else if(l){const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)l=!0;else if(n){const i=t.AABBBounds;tP.setValue(i.x1,i.y1,i.x2,i.y2),tP.expand(-s/2),l=!tP.containsPoint(e)}}return n.highPerformanceRestore(),l}};eP=vp([hp(),mp(0,up(hC)),yp("design:paramtypes",[Object])],eP);let iP=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=nw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).arc;n.highPerformanceSave();let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};iP=vp([hp(),mp(0,up(QT)),yp("design:paramtypes",[Object])],iP);let nP=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=sw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a))),n.highPerformanceRestore(),a}};nP=vp([hp(),mp(0,up(eC)),yp("design:paramtypes",[Object])],nP);let rP=class{constructor(t){this.canvasRenderer=t,this.type="line",this.numberType=cw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).line;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};rP=vp([hp(),mp(0,up(sC)),yp("design:paramtypes",[Object])],rP);let sP=class{constructor(t){this.canvasRenderer=t,this.type="symbol",this.numberType=mw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).symbol;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};sP=vp([hp(),mp(0,up(cC)),yp("design:paramtypes",[Object])],sP);let oP=class{constructor(){this.type="text",this.numberType=yw}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};oP=vp([hp()],oP);let aP=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=dw}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=Sm(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};aP=vp([hp(),mp(0,up(aC)),yp("design:paramtypes",[Object])],aP);let hP=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=aw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{n||(n=!!r.pickItem(t,e,null,i))})),n}return!1}};hP=vp([hp(),mp(0,up(fC)),yp("design:paramtypes",[Object])],hP);var lP=new np((t=>{t(Q_).toSelf().inSingletonScope(),t(aB).toService(Q_),t(gB).toService(aB),t(eP).toSelf().inSingletonScope(),t(cB).toService(eP),t(gB).toService(cB),t(iP).toSelf().inSingletonScope(),t(sB).toService(iP),t(gB).toService(sB),t(nP).toSelf().inSingletonScope(),t(oB).toService(nP),t(gB).toService(oB),t(rP).toSelf().inSingletonScope(),t(hB).toService(rP),t(gB).toService(hB),t(J_).toSelf().inSingletonScope(),t(lB).toService(J_),t(gB).toService(lB),t(sP).toSelf().inSingletonScope(),t(uB).toService(sP),t(gB).toService(uB),t(oP).toSelf().inSingletonScope(),t(dB).toService(oP),t(gB).toService(dB),t(aP).toSelf().inSingletonScope(),t(pB).toService(aP),t(gB).toService(pB),t(hP).toSelf().inSingletonScope(),t(fB).toService(hP),t(hP).toService(fB),Ap(t,gB)}));var cP=new np((e=>{e(Lv).toDynamicValue((()=>e=>new t.BrowserCanvas(e))).whenTargetNamed(t.BrowserCanvas.env),e(Nv).toDynamicValue((()=>(e,i)=>new t.BrowserContext2d(e,i))).whenTargetNamed(t.BrowserContext2d.env)})),uP=new np((t=>{t(Lv).toDynamicValue((()=>t=>new HB(t))).whenTargetNamed(HB.env),t(Nv).toDynamicValue((()=>(t,e)=>new jB(t,e))).whenTargetNamed(jB.env)})),dP=new np((t=>{t(Lv).toDynamicValue((()=>t=>new WB(t))).whenTargetNamed(WB.env),t(Nv).toDynamicValue((()=>(t,e)=>new NB(t,e))).whenTargetNamed(NB.env)})),pP=new np((t=>{t(Lv).toDynamicValue((()=>t=>new YB(t))).whenTargetNamed(YB.env),t(Nv).toDynamicValue((()=>(t,e)=>new VB(t,e))).whenTargetNamed(VB.env)})),fP=new np((t=>{t(Lv).toDynamicValue((()=>t=>new e_(t))).whenTargetNamed(e_.env),t(Nv).toDynamicValue((()=>(t,e)=>new QB(t,e))).whenTargetNamed(QB.env)})),gP=new np((t=>{t(Lv).toDynamicValue((()=>t=>new ZB(t))).whenTargetNamed(ZB.env),t(Nv).toDynamicValue((()=>(t,e)=>new KB(t,e))).whenTargetNamed(KB.env)}));Dv.load(Iw),Dv.load(bB),Dv.load(CC),Dv.load(yB),Dv.load(SB),function(t){t.load(DB),t.load(r_),t.load(s_),t.load(h_)}(Dv),function(t){t.load(R_)}(Dv),function(t){t.load(Z_),t.load(lP)}(Dv),function(t){t.load(cP),t.load(dP),t.load(uP),t.load(pP),t.load(fP),t.load(gP)}(Dv);const vP=Dv.get(_p);Av.global=vP;const mP=Dv.get(Rw);Av.graphicUtil=mP;const yP=Dv.get(kw);Av.transformUtil=yP;const bP=Dv.get(bw);Av.graphicService=bP;const xP=Dv.get(DC),wP=Dv.get(Ow);Av.layerService=wP;class AP{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=Cm.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,Av.graphicService.hooks.onAttributeUpdate.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),Av.graphicService.hooks.onSetStage.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}deactivate(t){Av.graphicService.hooks.onAttributeUpdate.taps=Av.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),Av.graphicService.hooks.onSetStage.taps=Av.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}class SP{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=Cm.GenAutoIncrementId(),this.key=this.name+this._uid,this.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)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const r=t.page.x-this.pageX,s=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const o=r/100,a=s/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+o,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+a,n.set3dOptions(this.option3d),n.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 TP{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=Cm.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,Av.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))})),Av.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){Av.graphicService.hooks.onAddIncremental.taps=Av.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),Av.graphicService.hooks.onClearIncremental.taps=Av.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,Av.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,Object.assign({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())}}class CP{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=Cm.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)})),Av.graphicService.hooks.onRelease.tap(this.key,(t=>{this.removeDom(t)}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key))}drawHTML(t){"browser"===Av.global.env&&t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:ov.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:ov.zIndex)})).forEach((t=>{this.renderGroupHTML(t)}))}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeDom(t){t.bindDom&&t.bindDom.size&&(t.bindDom.forEach((t=>{t.dom&&t.dom.parentElement.removeChild(t.dom)})),t.bindDom.clear())}renderGraphicHTML(t){const{html:e}=t.attribute;if(!e)return void(t.bindDom&&t.bindDom.size&&(t.bindDom.forEach((t=>{t.dom&&t.dom.parentElement.removeChild(t.dom)})),t.bindDom.clear()));const i=t.stage;if(!i)return;const{dom:n,container:r,width:s,height:o,style:a,anchorType:h="boundsLeftTop"}=e;t.bindDom||(t.bindDom=new Map);const l=t.bindDom.get(n);if(l&&(!r||r===l.container))return;let c,u;t.bindDom.forEach((({wrapGroup:t})=>{Av.global.removeDom(t)})),c="string"==typeof n?(new DOMParser).parseFromString(n,"text/xml").firstChild:n;const d=r||(!0===i.params.enableHtmlAttribute?null:i.params.enableHtmlAttribute);u=d?"string"==typeof d?Av.global.getElementById(d):d:t.stage.window.getContainer();const p=Av.global.createDom({tagName:"div",width:s,height:o,style:a,parent:u});p&&(p.appendChild(c),t.bindDom.set(n,{dom:c,container:r,wrapGroup:p})),p.style.pointerEvents="none",p.style.position||(p.style.position="absolute",u.style.position="relative");let f=0,g=0;if("position"===h){const e=t.transMatrix;f=e.e,g=e.f}else{const e=t.AABBBounds;f=e.x1,g=e.y1}const v=Av.global.getElementTopLeft(u,!1),m=i.window.getTopLeft(!1),y=f+m.left-v.left,b=g+m.top-v.top;p.style.left=`${y}px`,p.style.top=`${b}px`}}const BP=new wf;class _P{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=Cm.GenAutoIncrementId(),this.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()})),Av.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&&(BP.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(BP,t.parent&&t.parent.globalTransMatrix)))})),Av.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))})),Av.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){Av.graphicService.hooks.beforeUpdateAABBBounds.taps=Av.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),Av.graphicService.hooks.afterUpdateAABBBounds.taps=Av.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)),Av.graphicService.hooks.onRemove.taps=Av.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}class PP{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=Cm.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new wf}tryLayout(t){const e=t.parent;if(!e||!t.needUpdateLayout())return;const i=Sm(e).group,{display:n=i.display}=e.attribute;if("flex"!==n)return;const{flexDirection:r=i.flexDirection,flexWrap:s=i.flexWrap,justifyContent:o=i.justifyContent,alignItems:a=i.alignItems,alignContent:h=i.alignContent,clip:l=i.clip}=e.attribute;let c=0,u=0,d=0;if(e.forEachChildren((t=>{const e=t.AABBBounds;"column"===r||"column-reverse"===r?(u+=e.height(),c=Math.max(c,e.width())):(c+=e.width(),u=Math.max(u,e.height())),d+=e.x1,d+=e.y1,d+=e.x2,d+=e.y2})),!isFinite(d))return;const p=e.attribute.width||c,f=e.attribute.height||u;e.attribute.width||(e.attribute.width=0),e.attribute.height||(e.attribute.height=0),this.tempBounds.copy(e._AABBBounds);const g={main:{len:p,field:"x"},cross:{len:f,field:"y"},dir:1},v=g.main,m=g.cross;"row-reverse"===r?g.dir=-1:"column"===r?(v.len=f,m.len=p,v.field="y",m.field="x"):"column-reverse"===r&&(v.len=f,m.len=p,v.field="y",m.field="x",g.dir=-1);let y=0,b=0;const x=[];e.forEachChildren((t=>{const e=t.AABBBounds,i="x"===v.field?e.width():e.height(),n="x"===m.field?e.width():e.height();x.push({mainLen:i,crossLen:n}),y+=i,b=Math.max(b,n)}));const w=[];if(y>v.len&&"wrap"===s){let t=0,e=0;x.forEach((({mainLen:i,crossLen:n},r)=>{t+i>v.len?0===t?(w.push({idx:r,mainLen:t+i,crossLen:n}),t=0,e=0):(w.push({idx:r-1,mainLen:t,crossLen:n}),t=i,e=n):(t+=i,e=Math.max(e,n))})),w.push({idx:x.length-1,mainLen:t,crossLen:e})}else w.push({idx:x.length-1,mainLen:y,crossLen:b});const A=e.getChildren();let S=0;if(w.forEach((t=>{this.layoutMain(e,A,o,v,x,S,t),S=t.idx+1})),b=w.reduce(((t,e)=>t+e.crossLen),0),1===w.length)if("flex-end"===a){const t=m.len;this.layoutCross(A,a,m,t,x,w[0],0)}else if("center"===a){const t=m.len/2;this.layoutCross(A,a,m,t,x,w[0],0)}else A.forEach((t=>{t.attribute[m.field]=EP(t,m.field)}));else if("flex-start"===h){S=0;let t=0;w.forEach(((e,i)=>{this.layoutCross(A,"flex-start",m,t,x,w[i],S),S=e.idx+1,t+=e.crossLen}))}else if("center"===h){S=0;let t=Math.max(0,(m.len-b)/2);w.forEach(((e,i)=>{this.layoutCross(A,"center",m,t+e.crossLen/2,x,w[i],S),S=e.idx+1,t+=e.crossLen}))}else if("space-around"===h){S=0;const t=Math.max(0,(m.len-b)/w.length/2);let e=t;w.forEach(((i,n)=>{this.layoutCross(A,"flex-start",m,e,x,w[n],S),S=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===h){S=0;const t=Math.max(0,(m.len-b)/(2*w.length-2));let e=0;w.forEach(((i,n)=>{this.layoutCross(A,"flex-start",m,e,x,w[n],S),S=i.idx+1,e+=i.crossLen+2*t}))}A.forEach(((t,e)=>{t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),e.addUpdateLayoutTag(),l||this.tempBounds.equals(e.AABBBounds)||this.tryLayout(e)}layoutMain(t,e,i,n,r,s,o){if("flex-start"===i){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t+EP(e[i],n.field),t+=r[i].mainLen}else if("flex-end"===i){let t=n.len;for(let i=s;i<=o.idx;i++)t-=r[i].mainLen,e[i].attribute[n.field]=t+EP(e[i],n.field)}else if("space-around"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t+EP(e[i],n.field),t+=r[i].mainLen}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/t/2;let a=i;for(let t=s;t<=o.idx;t++)e[t].attribute[n.field]=a+EP(e[t],n.field),a+=r[t].mainLen+2*i}else if("space-between"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t+EP(e[i],n.field),t+=r[i].mainLen}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/(2*t-2);let a=0;for(let t=s;t<=o.idx;t++)e[t].attribute[n.field]=a+EP(e[t],n.field),a+=r[t].mainLen+2*i}}layoutCross(t,e,i,n,r,s,o){if("flex-end"===e)for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen+EP(t[e],i.field);else if("center"===e)for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen/2+EP(t[e],i.field);else for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n+EP(t[e],i.field)}activate(t){this.pluginService=t,bP.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t)})),bP.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t)}))}deactivate(t){bP.hooks.onAttributeUpdate.taps=bP.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),bP.hooks.onSetStage.taps=bP.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}function EP(t,e){if(!t.attribute.boundsPadding)return 0;if(function(t){return"number"==typeof t&&Number.isFinite(t)}(t.attribute.boundsPadding))return t.attribute.boundsPadding;if(Wp(t.attribute.boundsPadding)&&1===t.attribute.boundsPadding.length)return t.attribute.boundsPadding[0];const i=sy(t.attribute.boundsPadding);return"x"===e?i[3]:"y"===e?i[0]:0}const MP=new Gm;MP.addTimeline(Ym);MP.setFPS(60);class kP{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=Ky.get(e).value,this.colorRgb[0]/=255,this.colorRgb[1]/=255,this.colorRgb[2]/=255,this.ambient=i;const n=uf(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=lf(hf((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let r;if(Up(e)){r=Ky.get(e).value}else r=e;const s=this.colorRgb;return Ky.to.rgb(s[0]*r[0]*n,s[1]*r[1]*n,s[2]*r[2]*n)}}const RP="white";class OP extends Bw{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(){var t;return null!==(t=this._background)&&void 0!==t?t:RP}set background(t){this._background=t}get defaultLayer(){return this.at(0)}constructor(t){var e;super({}),this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null},this.params=t,this.theme=new wm,this.hooks={beforeRender:new Cp(["stage"]),afterRender:new Cp(["stage"])},this.global=Dv.get(_p),this.window=Dv.get(Ew),this.renderService=Dv.get(SC),this.pickerService=Dv.get(OC),this.pluginService=Dv.get(wB),this.layerService=Dv.get(Ow),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 wf,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=null!==(e=t.background)&&void 0!==e?e:RP,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 Nm({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(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.enableLayout&&this.enableLayout(),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||MP,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new Xm,this.ticker.addTimeline(this.timeline),this.timeline.pause(),this.optmize(t.optimize)}optmize(t){this.optmizeRender(null==t?void 0:t.skipRenderWithOutRange)}optmizeRender(t=!0){t&&(this._skipRender=this.window.isVisible()?0:1,this.window.onVisibleChange((t=>{t?(this.dirtyBounds&&this.dirtyBounds.setValue(0,0,this._viewBox.width(),this._viewBox.height()),this._skipRender>1&&this.renderNextFrame(),this._skipRender=0):this._skipRender=1})))}getTimeline(){return this.timeline}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:o=1,fieldDepth:a}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:n,beta:r,camera:s,fieldRatio:o,fieldDepth:a})}set3dOptions(t){var e,i,n,r,s,o;this.option3d=t;const a=this.get3dOptions(t),{light:h,center:l,camera:c,alpha:u,beta:d,fieldRatio:p,fieldDepth:f}=a,{dir:g=[1,1,-1],color:v="white",ambient:m}=h,y=(null!==(e=l.x)&&void 0!==e?e:this.width/2)+(null!==(i=l.dx)&&void 0!==i?i:0),b=(null!==(n=l.y)&&void 0!==n?n:this.height/2)+(null!==(r=l.dy)&&void 0!==r?r:0),x=[y,b,(null!==(s=l.z)&&void 0!==s?s:0)+(null!==(o=l.dz)&&void 0!==o?o:0)];let w=0,A=0,S=0;c||(w=Math.sin(u)+y,A=Math.sin(d)+b,S=Math.cos(u)*Math.cos(d)*1),this.light=new kP(g,v,m);const T={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:f,viewParams:{pos:[w,A,S],center:x,up:[0,1,0]}};this.camera?this.camera.params=T:this.camera=new UC(T),t.enableView3dTransform&&this.enableView3dTransform()}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 SP))}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 AP))}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 TP))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new xf;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t||(t=new _P,this.pluginService.register(t)),t.activate(this.pluginService)}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableLayout(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new PP))}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableHtmlAttribute(t){this.htmlAttribute||(this.htmlAttribute=t,this.pluginService.register(new CP))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").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",this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(this._viewBox,t)}render(t,e){this.ticker.start(),this.timeline.resume(),this._skipRender||(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},Object.assign({renderStyle:this.renderStyle},e))})),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear(),this.hooks.afterRender.call(this)),this._skipRender&&this._skipRender++}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.timeline.resume(),this.ticker.start(),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(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},Object.assign({renderStyle:this.renderStyle},this.lastRenderparams||{}))})),this.combineLayersToWindow(),this.hooks.afterRender.call(this),this.nextFrameRenderLayerSet.clear()),this._skipRender&&this._skipRender++}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=Object.assign(Object.assign({},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,e=!0){this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){const i=this.pickerService.pick(this.children,new mf(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0: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,Object.assign(Object.assign({},e),{renderService:this.renderService,background:i===this.defaultLayer?this.background:void 0,clear:0===n,updateBounds:!!this.dirtyBounds}))}))}renderToNewWindow(t=!0,e){const i=Dv.get(Ew);if(t)i.create({width:this.viewWidth,height:this.viewHeight,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""});else{const t=e?e.width():Math.min(this.viewWidth,this.window.width-this.x),n=e?e.height():Math.min(this.viewHeight,this.window.height-this.y);i.create({width:t,height:n,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""})}const n=e?-e.x1:0,r=e?-e.y1:0;return this.renderTo(i,{x:n,y:r,width:e?e.x2:i.width,height:e?e.y2:i.height}),i}toCanvas(t=!0,e){const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t)}getCursor(){return this._cursor}}var IP;!function(t){t[t.W=1]="W",t[t.H=2]="H",t[t.WH=3]="WH"}(IP||(IP={}));const DP={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},LP=Object.keys(DP);function NP(t){return OT(t?t.attribute:{})}function UP(t,e){if(Wp(t))return t.forEach((t=>UP(t,e)));e.push(t)}NP.Text=function(t){return Object.assign({type:"rich/text"},t)},NP.Image=function(t){return Object.assign({type:"rich/image"},t)};const WP=Bw;t.ACustomAnimate=qm,t.ARC3D_NUMBER_TYPE=rw,t.ARC_NUMBER_TYPE=nw,t.AREA_NUMBER_TYPE=sw,t.Animate=$m,t.AnimateGroup=class extends qm{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?Vm[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends qm{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?Vm[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Arc=WS,t.Arc3d=FS,t.Arc3dRender=tC,t.ArcRender=QT,t.ArcRenderContribution=$w,t.Area=NS,t.AreaRender=eC,t.AreaRenderContribution=Zw,t.AttributeAnimate=class extends qm{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=xB,t.Basis=Pg,t.BeforeRenderConstribution=TC,t.BoundsContext=Ff,t.BoundsPicker=IC,t.CIRCLE_NUMBER_TYPE=ow,t.CanvasFactory=Lv,t.CanvasTextLayout=dA,t.CbAnimate=Km,t.Circle=hA,t.CircleRender=iC,t.CircleRenderContribution=Jw,t.ClipAngleAnimate=class extends yy{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p,f,g,v;const m=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},y=null!==(a=m.width)&&void 0!==a?a:0,b=null!==(h=m.height)&&void 0!==h?h:0,x=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",w=null!==(c=null==r?void 0:r.startAngle)&&void 0!==c?c:0,A=null!==(u=null==r?void 0:r.orient)&&void 0!==u?u:"clockwise";let S=0,T=0;"anticlockwise"===A?(T="in"===x?w+2*Math.PI:w,T=w+2*Math.PI):(S=w,T="out"===x?w+2*Math.PI:w);const C=Av.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:y/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:b/2,outerRadius:null!==(v=null==r?void 0:r.radius)&&void 0!==v?v:(y+b)/2,innerRadius:0,startAngle:S,endAngle:T,fill:!0});let B,_;"anticlockwise"===A?(B={startAngle:w+2*Math.PI},_={startAngle:w}):(B={endAngle:w},_={endAngle:w+2*Math.PI}),super("in"===x?B:_,"in"===x?_:B,i,n,{group:null==r?void 0:r.group,clipGraphic:C})}},t.ClipDirectionAnimate=class extends yy{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p;const f=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},g=null!==(h=null!==(a=null==r?void 0:r.width)&&void 0!==a?a:f.width)&&void 0!==h?h:0,v=null!==(c=null!==(l=null==r?void 0:r.height)&&void 0!==l?l:f.height)&&void 0!==c?c:0,m=null!==(u=null==r?void 0:r.animationType)&&void 0!==u?u:"in",y=null!==(d=null==r?void 0:r.direction)&&void 0!==d?d:"x",b=null!==(p=null==r?void 0:r.orient)&&void 0!==p?p:"positive",x=Av.graphicService.creator.rect({x:0,y:0,width:"in"===m&&"x"===y?0:g,height:"in"===m&&"y"===y?0:v,fill:!0});let w={},A={};"y"===y?"negative"===b?(w={y:v,height:0},A={y:0,height:v}):(w={height:0},A={height:v}):"negative"===b?(w={x:g,width:0},A={x:0,width:g}):(w={width:0},A={width:g}),super("in"===m?w:A,"in"===m?A:w,i,n,{group:null==r?void 0:r.group,clipGraphic:x})}},t.ClipGraphicAnimate=yy,t.ClipRadiusAnimate=class extends yy{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p,f,g;const v=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},m=null!==(a=v.width)&&void 0!==a?a:0,y=null!==(h=v.height)&&void 0!==h?h:0,b=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",x=null!==(c=null==r?void 0:r.startRadius)&&void 0!==c?c:0,w=null!==(u=null==r?void 0:r.endRadius)&&void 0!==u?u:Math.sqrt((m/2)**2+(y/2)**2),A=Av.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:m/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:y/2,outerRadius:"out"===b?w:x,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),S={outerRadius:x},T={outerRadius:w};super("in"===b?S:T,"in"===b?T:S,i,n,{group:null==r?void 0:r.group,clipGraphic:A})}},t.ColorInterpolate=Xw,t.Context2dFactory=Nv,t.ContributionProvider=xp,t.CurveContext=class{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 xg(new mf(this._lastX,this._lastY),new mf(t,e))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,e,i,n,r,s){const o=new yg(new mf(this._lastX,this._lastY),new mf(t,e),new mf(i,n),new mf(r,s));this.path.curves.push(o),this._lastX=r,this._lastY=s}arcTo(t,e,i,n,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,r,s,o,a){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=km,t.CustomPath2D=qg,t.CustomSymbolClass=pS,t.DefaultArcAttribute=av,t.DefaultAreaAttribute=hv,t.DefaultAttribute=ov,t.DefaultCircleAttribute=lv,t.DefaultConnectAttribute=rv,t.DefaultDebugAttribute=sv,t.DefaultFillStyle=Qg,t.DefaultGlyphAttribute=uv,t.DefaultGroupAttribute=cv,t.DefaultImageAttribute=xv,t.DefaultLayout=Zg,t.DefaultLineAttribute=dv,t.DefaultMat4Allocate=sT,t.DefaultMatrixAllocate=rT,t.DefaultMorphingAnimateConfig=ty,t.DefaultPathAttribute=pv,t.DefaultPolygonAttribute=fv,t.DefaultRect3dAttribute=vv,t.DefaultRectAttribute=gv,t.DefaultRichTextAttribute=bv,t.DefaultRichTextIconAttribute=wv,t.DefaultStateAnimateConfig=Qm,t.DefaultStrokeStyle=ev,t.DefaultStyle=nv,t.DefaultSymbolAttribute=mv,t.DefaultSymbolBackgroundRenderContribution=wC,t.DefaultSymbolTextureRenderContribution=AC,t.DefaultTextAttribute=yv,t.DefaultTextStyle=iv,t.DefaultTicker=Gm,t.DefaultTimeline=Xm,t.DefaultTransform=Jg,t.DragNDrop=class{constructor(t){this.onPointerDown=t=>{const e=t.target,i=this.rootNode,n=e===i;if(e&&!n){let r,s=!1;function o(t){if(s||(t.type="dragstart",null==e||e.dispatchEvent(t),s=!0),t.type="drag",null==e||e.dispatchEvent(t),!n){e.pickable=!1;const n=(null==i?void 0:i.pick(t.global.x,t.global.y)).graphic;e.pickable=!0,r!==n&&(r&&(t.type="dragleave",t.target=r,r.dispatchEvent(t)),n&&(t.type="dragenter",t.target=n,n.dispatchEvent(t)),r=n,r&&(t.type="dragover",t.target=r,r.dispatchEvent(t)))}}null==i||i.addEventListener("pointermove",o);const a=function(){s&&(r&&(t.type="drop",t.target=r,r.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),s=!1),null==i||i.removeEventListener("pointermove",o)};e.addEventListener("pointerup",a,{once:!0}),e.addEventListener("pointerupoutside",a,{once:!0})}},this.rootNode=t,this.initEvents()}initEvents(){var t;null===(t=this.rootNode)||void 0===t||t.addEventListener("pointerdown",this.onPointerDown)}removeEvents(){var t;null===(t=this.rootNode)||void 0===t||t.removeEventListener("pointerdown",this.onPointerDown)}release(){this.removeEvents(),this.rootNode=null}},t.DrawContribution=mC,t.EventManager=Im,t.EventSystem=Nm,t.EventTarget=Dm,t.FadeInPlus=class extends qm{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=my.LEFT_TO_RIGHT,fill:o=!0,stroke:a=!0}=r||{};this.direction=s,this.fill=o,this.stroke=a,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 my.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case my.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case my.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case my.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=_m,t.FederatedMouseEvent=Pm,t.FederatedPointerEvent=Em,t.FederatedWheelEvent=Mm,t.Fragment=WP,t.GLYPH_NUMBER_TYPE=aw,t.GRAPHIC_UPDATE_TAG_KEY=yb,t.GROUP_NUMBER_TYPE=hw,t.Generator=Cm,t.Gesture=class extends Mp{constructor(t,e={}){var i,n,r,s,o,a,h,l;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.onStart=t=>{this.reset(),this.startTime=Rm.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=Wm(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)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const n=t.clone(),{x:r,y:s,pointerId:o}=n;for(let t=0,e=i.length;t<e;t++)if(o===i[t].pointerId){i[t]=n;break}const a={x:r,y:s},h=i.map((t=>({x:t.x,y:t.y}))),l=Rm.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=l,this.lastMovePoint=a,1===e.length){const t=e[0],i=r-t.x,o=s-t.y,l=this.direction||Um(t,a);this.direction=l;const c=this.getEventType(a);return n.direction=l,n.deltaX=i,n.deltaY=o,n.points=h,this.triggerStartEvent(c,n),void this.triggerEvent(c,n)}const{startDistance:c}=this,u=Wm(h[0],h[1]);n.scale=u/c,n.center=this.center,n.points=h,this.triggerStartEvent("pinch",n),this.triggerEvent("pinch",n)},this.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=Rm.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=Wm(i,r),o=s/t;o>this.config.swipe.velocity&&s>this.config.swipe.threshold&&(e.velocity=o,e.direction=Um(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()},this.element=t,this.config={press:{time:null!==(n=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==n?n:251,threshold:null!==(s=null===(r=null==e?void 0:e.press)||void 0===r?void 0:r.threshold)&&void 0!==s?s:9},swipe:{threshold:null!==(a=null===(o=null==e?void 0:e.swipe)||void 0===o?void 0:o.threshold)&&void 0!==a?a:10,velocity:null!==(l=null===(h=null==e?void 0:e.swipe)||void 0===h?void 0:h.velocity)&&void 0!==l?l:.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}getEventType(t){const{eventType:e,startTime:i,startPoints:n}=this;if(e)return e;let r;return r=Rm.now()-i>this.config.press.time&&Wm(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=Av.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=DC,t.Glyph=TS,t.GlyphRender=fC,t.Graphic=Tb,t.GraphicAnimate=class extends qm{constructor(t,e,i,n,r){super(t,e,i,n,r),this.graphic=null==r?void 0: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=xw,t.GraphicPicker=RC,t.GraphicRender=nC,t.GraphicService=bw,t.GraphicUtil=Rw,t.Group=Bw,t.GroupFadeIn=class extends qm{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 qm{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=rC,t.GroupRenderContribution=Qw,t.IMAGE_NUMBER_TYPE=lw,t.Image=PS,t.ImageRender=gC,t.ImageRenderContribution=tA,t.IncreaseCount=class extends qm{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n,r,s;this.fromNumber=jp(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(i=this.from)||void 0===i?void 0:i.text),this.toNumber=jp(null===(n=this.to)||void 0===n?void 0:n.text)?null===(r=this.to)||void 0===r?void 0:r.text:Number.parseFloat(null===(s=this.to)||void 0===s?void 0:s.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1)}onEnd(){}onUpdate(t,e,i){var n,r;!1!==this.valid&&(i.text=t?this.toNumber.toFixed():(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(null!==(r=null===(n=this.params)||void 0===n?void 0:n.fixed)&&void 0!==r?r:0))}},t.IncrementalDrawContribution=JT,t.InputText=class extends qm{constructor(){super(...arguments),this.fromText="",this.toText=""}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n;if(this.fromText=null!==(e=null===(t=this.from)||void 0===t?void 0:t.text)&&void 0!==e?e:"",this.toText=null!==(n=null===(i=this.to)||void 0===i?void 0:i.text)&&void 0!==n?n:"",!this.toText||Wp(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=Av.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){var n;if(!1===this.valid)return;const r=this.fromText.length,s=this.toText.length,o=Math.ceil(r+(s-r)*e);i.text=this.toText.substr(0,o);const a=null===(n=this.target.shadowRoot)||void 0===n?void 0:n.at(0),h=this.target.clipedWidth+2;a.setAttribute("x",h)}},t.InteractiveSubRenderContribution=oA,t.LINE_NUMBER_TYPE=cw,t.Layer=Pw,t.LayerHandlerContribution=_w,t.LayerService=Ow,t.Line=bS,t.LineRender=sC,t.Linear=Tg,t.LinearClosed=Gg,t.ManualTickHandler=Fm,t.ManualTicker=class extends Gm{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new Fm;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.Mat4Allocate=iT,t.MatrixAllocate=eT,t.Meteor=class extends qm{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 mf(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=Dg,t.MonotoneY=Lg,t.MorphingPath=hb,t.MotionPath=class extends qm{constructor(t,e,i,n,r){var s;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=null!==(s=r.initAngle)&&void 0!==s?s: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=cb,t.NOWORK_ANIMATE_ATTR=Sb,t.Node=Bm,t.PATH_NUMBER_TYPE=uw,t.POLYGON_NUMBER_TYPE=dw,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=pw,t.Path=DS,t.PathRender=oC,t.PathRenderContribution=eA,t.PickerService=OC,t.PluginService=wB,t.Polygon=zS,t.PolygonRender=aC,t.PolygonRenderContribution=iA,t.Pyramid3d=HS,t.Pyramid3dRender=pC,t.RAFTickHandler=zm,t.REACT_TO_CANOPUS_EVENTS=DP,t.REACT_TO_CANOPUS_EVENTS_LIST=LP,t.RECT3D_NUMBER_TYPE=gw,t.RECT_NUMBER_TYPE=fw,t.RICHTEXT_NUMBER_TYPE=vw,t.RafBasedSTO=gy,t.Rect=wS,t.Rect3DRender=lC,t.Rect3d=SS,t.RectRender=hC,t.RectRenderContribution=nA,t.ReflectSegContext=Ag,t.RenderSelector=vC,t.RenderService=SC,t.ResourceLoader=gb,t.RichText=OS,t.RichTextRender=dC,t.RotateBySphereAnimate=class extends qm{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 o=Math.acos((i-t.x)/e/Math.sin(s));r-t.z<0&&(o=rf-o),this.theta=o,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,o=this.theta+s,a=this.phi,h=r*Math.sin(a)*Math.cos(o)+n.x,l=r*Math.cos(a)+n.y,c=r*Math.sin(a)*Math.sin(o)+n.z;for(i.x=h,i.y=l,i.z=c,i.alpha=o+tf/2;i.alpha>rf;)i.alpha-=rf;i.alpha=rf-i.alpha,i.zIndex=-1e4*i.z}},t.SVG_ATTRIBUTE_MAP=ww,t.SVG_ATTRIBUTE_MAP_KEYS=Aw,t.SVG_PARSE_ATTRIBUTE_MAP=Sw,t.SVG_PARSE_ATTRIBUTE_MAP_KEYS=Tw,t.SYMBOL_NUMBER_TYPE=mw,t.SegContext=wg,t.Stage=OP,t.Step=jg,t.StreamLight=class extends qm{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){var t;const e=this.target.attachShadow(),i=this.target.AABBBounds.height(),n=Av.graphicService.creator.rect(Object.assign(Object.assign({height:i,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff"},null===(t=this.params)||void 0===t?void 0:t.attribute),{x:0,y:0,width:0}));this.rect=n,e.add(n)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(e,i,n){var r,s,o,a,h,l;const c=null!==(r=this.target.attribute.width)&&void 0!==r?r:250,u=null!==(o=null===(s=this.params)||void 0===s?void 0:s.streamLength)&&void 0!==o?o:c,d=null!==(l=null===(h=null===(a=this.params)||void 0===a?void 0:a.attribute)||void 0===h?void 0:h.width)&&void 0!==l?l:60,p=-d,f=p+(u-p)*i,g=Math.max(f,0),v=Math.min(Math.min(f+d,d),u-f),m=v+g>c?Math.max(c-g,0):v;this.rect.setAttributes({x:g,width:m},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}},t.SubAnimate=Zm,t.Symbol=mS,t.SymbolRender=cC,t.SymbolRenderContribution=rA,t.TEXT_NUMBER_TYPE=yw,t.TagPointsUpdate=class extends qm{constructor(t,e,i,n,r){super(t,e,i,n,r),this.newPointAnimateType="appear"===(null==r?void 0:r.newPointAnimateType)?"appear":"grow"}onBind(){var t,e;const i=null===(t=this.from)||void 0===t?void 0:t.points,n=null===(e=this.to)||void 0===e?void 0:e.points;this.fromPoints=i?Array.isArray(i)?i:[i]:[],this.toPoints=n?Array.isArray(n)?n:[n]:[];const r=new Map;this.fromPoints.forEach((t=>{t.context&&r.set(t.context,t)}));let s,o,a=1/0,h=-1/0;for(let t=0;t<this.toPoints.length;t+=1)if(r.has(this.toPoints[t].context)){a=t,s=r.get(this.toPoints[t].context);break}for(let t=this.toPoints.length-1;t>=0;t-=1)if(r.has(this.toPoints[t].context)){h=t,o=r.get(this.toPoints[t].context);break}let l=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const i=r.get(t.context);return i?(l=i,[i,t]):"appear"===this.newPointAnimateType?[t,t]:e<a&&s?[s,t]:e>h&&o?[o,t]:[l,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],n=new mf(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=cy(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),i.points=this.points}},t.Text=fA,t.TextRender=uC,t.TextRenderContribution=sA,t.Theme=wm,t.TimeOutTickHandler=jm,t.TransformUtil=kw,t.VArc=function(t){return vT(t?t.attribute:{})},t.VArc3d=function(t){return mT(t?t.attribute:{})},t.VArea=function(t){return bT(t?t.attribute:{})},t.VCircle=function(t){return xT(t?t.attribute:{})},t.VGlyph=function(t){return BT(t?t.attribute:{})},t.VGroup=function(t){return wT(t?t.attribute:{})},t.VImage=function(t){return MT(t?t.attribute:{})},t.VLine=function(t){return AT(t?t.attribute:{})},t.VPath=function(t){return ST(t?t.attribute:{})},t.VPolygon=function(t){return kT(t?t.attribute:{})},t.VPyramid3d=function(t){return yT(t?t.attribute:{})},t.VRect=function(t){return TT(t?t.attribute:{})},t.VRect3d=function(t){return CT(t?t.attribute:{})},t.VRichText=NP,t.VSymbol=function(t){return ET(t?t.attribute:{})},t.VText=function(t){return _T(t?t.attribute:{})},t.VWindow=Ew,t.WindowHandlerContribution=Mw,t.WrapText=vA,t.addArcToBezierPath=lg,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=By,t.alignSubpath=xy,t.applyTransformOnBezierCurves=Ey,t.bezier=ag,t.bezierCurversToPath=My,t.binarySplitPolygon=Fy,t.bindContributionProvider=Ap,t.bindContributionProviderNoSingletonScope=Sp,t.boundStroke=qx,t.builtinSymbols=fS,t.builtinSymbolsMap=gS,t.calcLineCache=Yg,t.centroidOfSubpath=Sy,t.circleBounds=hy,t.cloneGraphic=pb,t.container=Dv,t.cornerTangents=Hw,t.createArc=vT,t.createArc3d=mT,t.createArea=bT,t.createCircle=xT,t.createColor=bC,t.createConicalGradient=Kw,t.createGlyph=BT,t.createGroup=wT,t.createImage=MT,t.createLine=AT,t.createMat4=nT,t.createPath=ST,t.createPolygon=kT,t.createPyramid3d=yT,t.createRect=TT,t.createRect3d=CT,t.createRectPath=YT,t.createRichText=OT,t.createShadowRoot=RT,t.createStage=function(t){return new OP(t)},t.createSymbol=ET,t.createText=_T,t.createWrapText=PT,t.cubicCalc=gg,t.cubicLength=fg,t.cubicPointAt=vg,t.cubicSubdivide=by,t.defaultTicker=MP,t.defaultTimeline=Ym,t.drawArc=hg,t.drawArcPath=Gw,t.drawAreaSegments=jT,t.drawIncrementalAreaSegments=WT,t.drawIncrementalSegments=UT,t.drawPathProxy=jw,t.drawSegments=NT,t.enumCommandMap=Gf,t.fillVisible=Nw,t.findBestMorphingRotation=Cy,t.findNextGraphic=PC,t.foreach=BC,t.foreachAsync=_C,t.genBasisSegments=Mg,t.genBasisTypeSegments=Eg,t.genLinearClosedSegments=Vg,t.genLinearClosedTypeSegments=Xg,t.genLinearSegments=Cg,t.genLinearTypeSegments=Bg,t.genMonotoneXSegments=Ug,t.genMonotoneYSegments=Fg,t.genMonotpneXTypeSegments=Ng,t.genMonotpneYTypeSegments=Wg,t.genNumberType=$x,t.genStepSegments=zg,t.genStepTypeSegments=Hg,t.getAttributeFromDefaultAttrList=fy,t.getConicGradientAt=qw,t.getContextFont=lA,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,o=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=i.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=i.AABBBounds;o[1]=e.x1+(e.x2-e.x1)*t}else o[1]=s[1]}if("text"===i.type){const{textAlign:t}=i.attribute;o[0]+=cA(t,i.clipedWidth)}o[0]+=t,o[1]+=e;const a=aT.allocate();return cT(a,a,[o[0],o[1],0]),r&&hT(a,a,r),n&&lT(a,a,n),cT(a,a,[-o[0],-o[1],0]),a},t.getModelMatrix=pT,t.getRichTextBounds=function(t){return LT.setAttributes(t),LT.AABBBounds},t.getScaledStroke=yC,t.getTextBounds=function(t){return DT.setAttributes(t),DT.AABBBounds},t.getTheme=Sm,t.getThemeFromGroup=Tm,t.globalTheme=Am,t.graphicCreator=IT,t.graphicService=bP,t.graphicUtil=mP,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.intersect=zw,t.isTransformKey=py,t.jsx=function(t,e,...i){const n=e||{},{key:r,attribute:s,stateProxy:o}=n,a=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i}(n,["key","attribute","stateProxy"]);let h=t;Up(t)&&(h=IT[t]);const l=[];i.length&&UP(1===i.length?i[0]:i,l);const c="Group"===h.name?new h(s):h(e);return function(t,e,i){let n,r=!1;switch(t.type){case"richtext":case"rich/image":break;case"rich/text":n=t.attribute||{},e[0]&&(n.text=e[0]);break;default:r=!0}r?(e.forEach((e=>{e&&t.add(e)})),Object.keys(i).forEach((e=>{const n=DP[e];n&&t.on(n,i[e])}))):"richtext"===t.type&&(t.attribute.textConfig=e.map((t=>t.attribute)).filter((t=>t)))}(c,l,a),o&&(c.stateProxy=o),c},t.layerService=wP,t.loadFeishuContributions=_B,t.loadTaroContributions=PB,t.mat3Tomat4=uT,t.mat4Allocate=aT,t.matrixAllocate=oT,t.morphPath=lb,t.multiToOneMorph=(e,i,n)=>{var r,s,o;const a=e.filter((t=>t.toCustomPath&&t.valid));a.length||__DEV__&&console.error(e," is not validate"),i.valid&&i.toCustomPath||__DEV__&&console.error(i," is not validate");const h=("clone"===(null==n?void 0:n.splitPath)?pb:null!==(r=null==n?void 0:n.splitPath)&&void 0!==r?r:fb)(i,a.length,!0),l=i.attribute;i.setAttribute("visible",!1);const c=a.map(((t,e)=>sb(t.toCustomPath(),h[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:h[e].globalTransMatrix}))),u=a.map(((t,e)=>ab(t.attribute,l)));if(null==n?void 0:n.individualDelay){const r=n.onEnd;let s=a.length;const o=()=>{s--,0===s&&(i.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),r&&r())};h.forEach(((t,i)=>{var r,s,h;const l=(null!==(r=n.delay)&&void 0!==r?r:0)+n.individualDelay(i,a.length,e[i],t),d=t.animate(Object.assign({},n,{onEnd:o}));d.wait(l),d.play(new hb({morphingData:c[i],saveOnEnd:!0,otherAttrs:u[i]},null!==(s=n.duration)&&void 0!==s?s:ty.duration,null!==(h=n.easing)&&void 0!==h?h:ty.easing))}))}else{const e=null==n?void 0:n.onEnd,r=n?Object.assign({},n):{};r.onEnd=()=>{i.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),e&&e()};const a=i.animate(r);(null==n?void 0:n.delay)&&a.wait(n.delay),a.play(new cb({morphingData:c,otherAttrs:u},null!==(s=null==n?void 0:n.duration)&&void 0!==s?s:ty.duration,null!==(o=null==n?void 0:n.easing)&&void 0!==o?o:ty.easing))}},t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i.a,x=i.b,w=0,A=0;return t[0]=b*n+x*a+w*u+A*g,t[1]=b*r+x*h+w*d+A*v,t[2]=b*s+x*l+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i.c,x=i.d,w=0,A=0,t[4]=b*n+x*a+w*u+A*g,t[5]=b*r+x*h+w*d+A*v,t[6]=b*s+x*l+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=0,x=0,w=1,A=0,t[8]=b*n+x*a+w*u+A*g,t[9]=b*r+x*h+w*d+A*v,t[10]=b*s+x*l+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i.e,x=i.f,w=0,A=1,t[12]=b*n+x*a+w*u+A*g,t[13]=b*r+x*h+w*d+A*v,t[14]=b*s+x*l+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t},t.multiplyMat4Mat4=dT,t.newThemeObj=ym,t.oneToMultiMorph=(t,e,i)=>{var n;const r=e.filter((t=>t&&t.toCustomPath&&t.valid));r.length||__DEV__&&console.error(r," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");const s=("clone"===(null==i?void 0:i.splitPath)?pb:null!==(n=null==i?void 0:i.splitPath)&&void 0!==n?n:fb)(t,r.length,!1),o=null==i?void 0:i.onEnd;let a=r.length;const h=()=>{a--,0===a&&o&&o()};r.forEach(((e,n)=>{var o;const a=s[n],l=(null!==(o=null==i?void 0:i.delay)&&void 0!==o?o:0)+((null==i?void 0:i.individualDelay)?i.individualDelay(n,r.length,a,e):0);lb(a,e,Object.assign({},i,{onEnd:h,delay:l}),t.globalTransMatrix)}))},t.parsePadding=sy,t.parseStroke=ny,t.parseSvgPath=Zf,t.pathToBezierCurves=Py,t.pickerService=xP,t.point=_g,t.pointEqual=ly,t.pointInterpolation=cy,t.pointInterpolationHighPerformance=function(t,e,i,n){const{x:r,y:s}=gf(t.x,t.y,e.x,e.y,i),{x:o,y:a}=gf(t.x1,t.y1,e.x1,e.y1,i);return n.x=r,n.y=s,n.x1=o,n.y1=a,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)=>ly(t,e[i]))):!Number.isNaN(t.x+t.y)&&ly(t,e))},t.pointsInterpolation=uy,t.rafBasedSto=vy,t.rectFillVisible=Uw,t.rectStrokeVisible=Fw,t.recursiveCallBinarySplit=jy,t.renderCommandList=ug,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.rotateX=hT,t.rotateY=lT,t.runFill=Dw,t.runStroke=Lw,t.segments=og,t.shouldUseMat4=fT,t.snapLength=pg,t.splitArc=Oy,t.splitArea=Ly,t.splitCircle=Iy,t.splitGraphic=fb,t.splitLine=Ny,t.splitPath=Hy,t.splitPolygon=zy,t.splitRect=Ry,t.splitToGrids=ky,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=Ww,t.textDrawOffsetX=cA,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=uA,t.transformKeys=dy,t.transformUtil=yP,t.translate=cT,t.version="0.15.7",t.verticalLayout=Jx,t.vglobal=vP,t.waitForAllSubLayers=function(t){return bp(this,void 0,void 0,(function*(){const e=[],i=t.getChildren();yield new Promise((t=>{Av.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)}))})))}))})),yield Promise.all(e)}))},t.wrapCanvas=Uv,t.wrapContext=function(t,e){return Dv.getNamed(Nv,Av.global.env)(t,e)},t.xul=function(t){const e=Wp(t)?t[0]:t,i=[];if(!e)return i;if(!0===Yx.XMLValidator.validate(e,{allowBooleanAttributes:!0})){const t=new Yx.XMLParser({ignoreAttributes:!1}).parse(e);t.tc&&Object.keys(t.tc).forEach((e=>{"text"===e?i.push(function(t){const e={text:""};iw(t,e);const i=t["#text"];i&&(e.text=i);return e}(t.tc[e])):i.push(function(t){const e={image:"",width:0,height:0};iw(t,e);const i=e.image;i&&(e.image=i.replaceAll("&quot",'"').replaceAll("&lt","<").replaceAll("&gt",">"));return e}(t.tc[e]))}))}return i}}));