@netless/appliance-plugin 1.0.0-beta.8 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/cdn.js +1 -1
- package/cdn/fullWorker-CIvt1j.js +453 -0
- package/cdn/subWorker-BE-0dg.js +453 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +13 -13
- package/dist/core/enum.d.ts +8 -1
- package/dist/core/mainEngine.d.ts +9 -2
- package/dist/core/mainThread/base.d.ts +2 -2
- package/dist/core/mainThread/index.d.ts +2 -2
- package/dist/core/mainThread/snapshotThread.d.ts +4 -4
- package/dist/core/mainThread/subLocalThread.d.ts +17 -13
- package/dist/core/mainThread/subTopThread.d.ts +7 -7
- package/dist/core/mainThread/vNodeManager.d.ts +2 -1
- package/dist/core/msgEvent/base.d.ts +6 -2
- package/dist/core/msgEvent/copyNode/forMain.d.ts +1 -0
- package/dist/core/msgEvent/deleteNode/forMain.d.ts +1 -0
- package/dist/core/msgEvent/deleteNode/forMainThread.d.ts +1 -4
- package/dist/core/msgEvent/deleteNode/forWorker.d.ts +1 -4
- package/dist/core/msgEvent/index.d.ts +4 -0
- package/dist/core/msgEvent/rotateNode/forMain.d.ts +2 -1
- package/dist/core/msgEvent/scaleNode/forMain.d.ts +2 -1
- package/dist/core/msgEvent/setColor/forMain.d.ts +1 -0
- package/dist/core/msgEvent/setFont/forMain.d.ts +1 -0
- package/dist/core/msgEvent/setLock/forMain.d.ts +1 -0
- package/dist/core/msgEvent/setPoint/forMain.d.ts +1 -0
- package/dist/core/msgEvent/setShape/forMain.d.ts +1 -0
- package/dist/core/msgEvent/setZIndex/forMain.d.ts +1 -0
- package/dist/core/msgEvent/translateNode/forMain.d.ts +2 -1
- package/dist/core/tools/base.d.ts +1 -1
- package/dist/core/tools/text.d.ts +2 -8
- package/dist/core/tools/utils.d.ts +2 -2
- package/dist/core/types.d.ts +1 -1
- package/dist/core/worker/base.d.ts +21 -13
- package/dist/core/worker/fullWorkerLocal.d.ts +1 -0
- package/dist/core/worker/subWorkerLocal.d.ts +3 -0
- package/dist/core/worker/subWorkerTopLayer.d.ts +7 -7
- package/dist/core/worker/vNodeManager.d.ts +2 -1
- package/dist/core/worker/workerManager.d.ts +2 -1
- package/dist/fullWorker.js +453 -566
- package/dist/index-BcIJbozZ.js +1 -0
- package/dist/index-C1YKkWHE.mjs +9090 -0
- package/dist/{index-Bt9t1FKB.mjs → index-ClJPZxV-.mjs} +1195 -1151
- package/dist/index-SsMz_ohn.js +1 -0
- package/dist/plugin/single/applianceDisplayer.d.ts +0 -1
- package/dist/plugin/types.d.ts +6 -14
- package/dist/style.css +1 -1
- package/dist/subWorker.js +453 -566
- package/package.json +5 -2
- package/cdn/fullWorker-BlZ1Wa.js +0 -566
- package/cdn/subWorker-BKoiIW.js +0 -566
- package/dist/index-BUCsfWH1.js +0 -1
- package/dist/index-Bz3L5rvA.js +0 -1
- package/dist/index-CTYUQm0L.mjs +0 -8859
package/cdn/fullWorker-BlZ1Wa.js
DELETED
|
@@ -1,566 +0,0 @@
|
|
|
1
|
-
var cg=Object.defineProperty;var fg=(re,Xt,fe)=>Xt in re?cg(re,Xt,{enumerable:!0,configurable:!0,writable:!0,value:fe}):re[Xt]=fe;var nt=(re,Xt,fe)=>(fg(re,typeof Xt!="symbol"?Xt+"":Xt,fe),fe);(function(){"use strict";var re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xt(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}function fe(){this.__data__=[],this.size=0}var ei=fe;function ri(d,r){return d===r||d!==d&&r!==r}var Ze=ri,ni=Ze;function ii(d,r){for(var t=d.length;t--;)if(ni(d[t][0],r))return t;return-1}var Ne=ii,si=Ne,oi=Array.prototype,ai=oi.splice;function li(d){var r=this.__data__,t=si(r,d);if(t<0)return!1;var e=r.length-1;return t==e?r.pop():ai.call(r,t,1),--this.size,!0}var ci=li,fi=Ne;function ui(d){var r=this.__data__,t=fi(r,d);return t<0?void 0:r[t][1]}var hi=ui,di=Ne;function gi(d){return di(this.__data__,d)>-1}var pi=gi,vi=Ne;function mi(d,r){var t=this.__data__,e=vi(t,d);return e<0?(++this.size,t.push([d,r])):t[e][1]=r,this}var yi=mi,Si=ei,xi=ci,Ti=hi,Mi=pi,Oi=yi;function ve(d){var r=-1,t=d==null?0:d.length;for(this.clear();++r<t;){var e=d[r];this.set(e[0],e[1])}}ve.prototype.clear=Si,ve.prototype.delete=xi,ve.prototype.get=Ti,ve.prototype.has=Mi,ve.prototype.set=Oi;var We=ve,Ei=We;function Pi(){this.__data__=new Ei,this.size=0}var Ai=Pi;function Ci(d){var r=this.__data__,t=r.delete(d);return this.size=r.size,t}var Ri=Ci;function Ii(d){return this.__data__.get(d)}var Li=Ii;function bi(d){return this.__data__.has(d)}var Di=bi,wi=typeof re=="object"&&re&&re.Object===Object&&re,Tr=wi,Ni=Tr,Wi=typeof self=="object"&&self&&self.Object===Object&&self,Bi=Ni||Wi||Function("return this")(),Zt=Bi,Fi=Zt,ji=Fi.Symbol,Be=ji,Mr=Be,Or=Object.prototype,Ui=Or.hasOwnProperty,$i=Or.toString,Ae=Mr?Mr.toStringTag:void 0;function zi(d){var r=Ui.call(d,Ae),t=d[Ae];try{d[Ae]=void 0;var e=!0}catch{}var n=$i.call(d);return e&&(r?d[Ae]=t:delete d[Ae]),n}var Gi=zi,Hi=Object.prototype,Ki=Hi.toString;function Vi(d){return Ki.call(d)}var Yi=Vi,Er=Be,Xi=Gi,Ji=Yi,Qi="[object Null]",Zi="[object Undefined]",Pr=Er?Er.toStringTag:void 0;function ki(d){return d==null?d===void 0?Zi:Qi:Pr&&Pr in Object(d)?Xi(d):Ji(d)}var ue=ki;function qi(d){var r=typeof d;return d!=null&&(r=="object"||r=="function")}var oe=qi,_i=ue,ts=oe,es="[object AsyncFunction]",rs="[object Function]",ns="[object GeneratorFunction]",is="[object Proxy]";function ss(d){if(!ts(d))return!1;var r=_i(d);return r==rs||r==ns||r==es||r==is}var Ar=ss,os=Zt,as=os["__core-js_shared__"],ls=as,ke=ls,Cr=function(){var d=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}();function cs(d){return!!Cr&&Cr in d}var fs=cs,us=Function.prototype,hs=us.toString;function ds(d){if(d!=null){try{return hs.call(d)}catch{}try{return d+""}catch{}}return""}var Rr=ds,gs=Ar,ps=fs,vs=oe,ms=Rr,ys=/[\\^$.*+?()[\]{}|]/g,Ss=/^\[object .+?Constructor\]$/,xs=Function.prototype,Ts=Object.prototype,Ms=xs.toString,Os=Ts.hasOwnProperty,Es=RegExp("^"+Ms.call(Os).replace(ys,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ps(d){if(!vs(d)||ps(d))return!1;var r=gs(d)?Es:Ss;return r.test(ms(d))}var As=Ps;function Cs(d,r){return d==null?void 0:d[r]}var Rs=Cs,Is=As,Ls=Rs;function bs(d,r){var t=Ls(d,r);return Is(t)?t:void 0}var he=bs,Ds=he,ws=Zt,Ns=Ds(ws,"Map"),qe=Ns,Ws=he,Bs=Ws(Object,"create"),Fe=Bs,Ir=Fe;function Fs(){this.__data__=Ir?Ir(null):{},this.size=0}var js=Fs;function Us(d){var r=this.has(d)&&delete this.__data__[d];return this.size-=r?1:0,r}var $s=Us,zs=Fe,Gs="__lodash_hash_undefined__",Hs=Object.prototype,Ks=Hs.hasOwnProperty;function Vs(d){var r=this.__data__;if(zs){var t=r[d];return t===Gs?void 0:t}return Ks.call(r,d)?r[d]:void 0}var Ys=Vs,Xs=Fe,Js=Object.prototype,Qs=Js.hasOwnProperty;function Zs(d){var r=this.__data__;return Xs?r[d]!==void 0:Qs.call(r,d)}var ks=Zs,qs=Fe,_s="__lodash_hash_undefined__";function to(d,r){var t=this.__data__;return this.size+=this.has(d)?0:1,t[d]=qs&&r===void 0?_s:r,this}var eo=to,ro=js,no=$s,io=Ys,so=ks,oo=eo;function me(d){var r=-1,t=d==null?0:d.length;for(this.clear();++r<t;){var e=d[r];this.set(e[0],e[1])}}me.prototype.clear=ro,me.prototype.delete=no,me.prototype.get=io,me.prototype.has=so,me.prototype.set=oo;var ao=me,Lr=ao,lo=We,co=qe;function fo(){this.size=0,this.__data__={hash:new Lr,map:new(co||lo),string:new Lr}}var uo=fo;function ho(d){var r=typeof d;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?d!=="__proto__":d===null}var go=ho,po=go;function vo(d,r){var t=d.__data__;return po(r)?t[typeof r=="string"?"string":"hash"]:t.map}var je=vo,mo=je;function yo(d){var r=mo(this,d).delete(d);return this.size-=r?1:0,r}var So=yo,xo=je;function To(d){return xo(this,d).get(d)}var Mo=To,Oo=je;function Eo(d){return Oo(this,d).has(d)}var Po=Eo,Ao=je;function Co(d,r){var t=Ao(this,d),e=t.size;return t.set(d,r),this.size+=t.size==e?0:1,this}var Ro=Co,Io=uo,Lo=So,bo=Mo,Do=Po,wo=Ro;function ye(d){var r=-1,t=d==null?0:d.length;for(this.clear();++r<t;){var e=d[r];this.set(e[0],e[1])}}ye.prototype.clear=Io,ye.prototype.delete=Lo,ye.prototype.get=bo,ye.prototype.has=Do,ye.prototype.set=wo;var br=ye,No=We,Wo=qe,Bo=br,Fo=200;function jo(d,r){var t=this.__data__;if(t instanceof No){var e=t.__data__;if(!Wo||e.length<Fo-1)return e.push([d,r]),this.size=++t.size,this;t=this.__data__=new Bo(e)}return t.set(d,r),this.size=t.size,this}var Uo=jo,$o=We,zo=Ai,Go=Ri,Ho=Li,Ko=Di,Vo=Uo;function Se(d){var r=this.__data__=new $o(d);this.size=r.size}Se.prototype.clear=zo,Se.prototype.delete=Go,Se.prototype.get=Ho,Se.prototype.has=Ko,Se.prototype.set=Vo;var Dr=Se;function Yo(d,r){for(var t=-1,e=d==null?0:d.length;++t<e&&r(d[t],t,d)!==!1;);return d}var Xo=Yo,Jo=he,Qo=function(){try{var d=Jo(Object,"defineProperty");return d({},"",{}),d}catch{}}(),Zo=Qo,wr=Zo;function ko(d,r,t){r=="__proto__"&&wr?wr(d,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):d[r]=t}var Nr=ko,qo=Nr,_o=Ze,ta=Object.prototype,ea=ta.hasOwnProperty;function ra(d,r,t){var e=d[r];(!(ea.call(d,r)&&_o(e,t))||t===void 0&&!(r in d))&&qo(d,r,t)}var Wr=ra,na=Wr,ia=Nr;function sa(d,r,t,e){var n=!t;t||(t={});for(var i=-1,a=r.length;++i<a;){var s=r[i],o=e?e(t[s],d[s],s,t,d):void 0;o===void 0&&(o=d[s]),n?ia(t,s,o):na(t,s,o)}return t}var Ue=sa;function oa(d,r){for(var t=-1,e=Array(d);++t<d;)e[t]=r(t);return e}var aa=oa;function la(d){return d!=null&&typeof d=="object"}var ie=la,ca=ue,fa=ie,ua="[object Arguments]";function ha(d){return fa(d)&&ca(d)==ua}var da=ha,Br=da,ga=ie,Fr=Object.prototype,pa=Fr.hasOwnProperty,va=Fr.propertyIsEnumerable,ma=Br(function(){return arguments}())?Br:function(d){return ga(d)&&pa.call(d,"callee")&&!va.call(d,"callee")},ya=ma,Sa=Array.isArray,$e=Sa,ze={exports:{}};function xa(){return!1}var Ta=xa;ze.exports,function(d,r){var t=Zt,e=Ta,n=r&&!r.nodeType&&r,i=n&&!0&&d&&!d.nodeType&&d,a=i&&i.exports===n,s=a?t.Buffer:void 0,o=s?s.isBuffer:void 0,f=o||e;d.exports=f}(ze,ze.exports);var _e=ze.exports,Ma=9007199254740991,Oa=/^(?:0|[1-9]\d*)$/;function Ea(d,r){var t=typeof d;return r=r??Ma,!!r&&(t=="number"||t!="symbol"&&Oa.test(d))&&d>-1&&d%1==0&&d<r}var Pa=Ea,Aa=9007199254740991;function Ca(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=Aa}var jr=Ca,Ra=ue,Ia=jr,La=ie,ba="[object Arguments]",Da="[object Array]",wa="[object Boolean]",Na="[object Date]",Wa="[object Error]",Ba="[object Function]",Fa="[object Map]",ja="[object Number]",Ua="[object Object]",$a="[object RegExp]",za="[object Set]",Ga="[object String]",Ha="[object WeakMap]",Ka="[object ArrayBuffer]",Va="[object DataView]",Ya="[object Float32Array]",Xa="[object Float64Array]",Ja="[object Int8Array]",Qa="[object Int16Array]",Za="[object Int32Array]",ka="[object Uint8Array]",qa="[object Uint8ClampedArray]",_a="[object Uint16Array]",tl="[object Uint32Array]",Ft={};Ft[Ya]=Ft[Xa]=Ft[Ja]=Ft[Qa]=Ft[Za]=Ft[ka]=Ft[qa]=Ft[_a]=Ft[tl]=!0,Ft[ba]=Ft[Da]=Ft[Ka]=Ft[wa]=Ft[Va]=Ft[Na]=Ft[Wa]=Ft[Ba]=Ft[Fa]=Ft[ja]=Ft[Ua]=Ft[$a]=Ft[za]=Ft[Ga]=Ft[Ha]=!1;function el(d){return La(d)&&Ia(d.length)&&!!Ft[Ra(d)]}var rl=el;function nl(d){return function(r){return d(r)}}var tr=nl,Ge={exports:{}};Ge.exports,function(d,r){var t=Tr,e=r&&!r.nodeType&&r,n=e&&!0&&d&&!d.nodeType&&d,i=n&&n.exports===e,a=i&&t.process,s=function(){try{var o=n&&n.require&&n.require("util").types;return o||a&&a.binding&&a.binding("util")}catch{}}();d.exports=s}(Ge,Ge.exports);var er=Ge.exports,il=rl,sl=tr,Ur=er,$r=Ur&&Ur.isTypedArray,ol=$r?sl($r):il,zr=ol,al=aa,ll=ya,cl=$e,fl=_e,ul=Pa,hl=zr,dl=Object.prototype,gl=dl.hasOwnProperty;function pl(d,r){var t=cl(d),e=!t&&ll(d),n=!t&&!e&&fl(d),i=!t&&!e&&!n&&hl(d),a=t||e||n||i,s=a?al(d.length,String):[],o=s.length;for(var f in d)(r||gl.call(d,f))&&!(a&&(f=="length"||n&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||ul(f,o)))&&s.push(f);return s}var Gr=pl,vl=Object.prototype;function ml(d){var r=d&&d.constructor,t=typeof r=="function"&&r.prototype||vl;return d===t}var rr=ml;function yl(d,r){return function(t){return d(r(t))}}var Hr=yl,Sl=Hr,xl=Sl(Object.keys,Object),Tl=xl,Ml=rr,Ol=Tl,El=Object.prototype,Pl=El.hasOwnProperty;function Al(d){if(!Ml(d))return Ol(d);var r=[];for(var t in Object(d))Pl.call(d,t)&&t!="constructor"&&r.push(t);return r}var Cl=Al,Rl=Ar,Il=jr;function Ll(d){return d!=null&&Il(d.length)&&!Rl(d)}var Kr=Ll,bl=Gr,Dl=Cl,wl=Kr;function Nl(d){return wl(d)?bl(d):Dl(d)}var nr=Nl,Wl=Ue,Bl=nr;function Fl(d,r){return d&&Wl(r,Bl(r),d)}var jl=Fl;function Ul(d){var r=[];if(d!=null)for(var t in Object(d))r.push(t);return r}var $l=Ul,zl=oe,Gl=rr,Hl=$l,Kl=Object.prototype,Vl=Kl.hasOwnProperty;function Yl(d){if(!zl(d))return Hl(d);var r=Gl(d),t=[];for(var e in d)e=="constructor"&&(r||!Vl.call(d,e))||t.push(e);return t}var Xl=Yl,Jl=Gr,Ql=Xl,Zl=Kr;function kl(d){return Zl(d)?Jl(d,!0):Ql(d)}var ir=kl,ql=Ue,_l=ir;function tc(d,r){return d&&ql(r,_l(r),d)}var ec=tc,He={exports:{}};He.exports,function(d,r){var t=Zt,e=r&&!r.nodeType&&r,n=e&&!0&&d&&!d.nodeType&&d,i=n&&n.exports===e,a=i?t.Buffer:void 0,s=a?a.allocUnsafe:void 0;function o(f,v){if(v)return f.slice();var l=f.length,p=s?s(l):new f.constructor(l);return f.copy(p),p}d.exports=o}(He,He.exports);var rc=He.exports;function nc(d,r){var t=-1,e=d.length;for(r||(r=Array(e));++t<e;)r[t]=d[t];return r}var ic=nc;function sc(d,r){for(var t=-1,e=d==null?0:d.length,n=0,i=[];++t<e;){var a=d[t];r(a,t,d)&&(i[n++]=a)}return i}var oc=sc;function ac(){return[]}var Vr=ac,lc=oc,cc=Vr,fc=Object.prototype,uc=fc.propertyIsEnumerable,Yr=Object.getOwnPropertySymbols,hc=Yr?function(d){return d==null?[]:(d=Object(d),lc(Yr(d),function(r){return uc.call(d,r)}))}:cc,sr=hc,dc=Ue,gc=sr;function pc(d,r){return dc(d,gc(d),r)}var vc=pc;function mc(d,r){for(var t=-1,e=r.length,n=d.length;++t<e;)d[n+t]=r[t];return d}var Xr=mc,yc=Hr,Sc=yc(Object.getPrototypeOf,Object),Jr=Sc,xc=Xr,Tc=Jr,Mc=sr,Oc=Vr,Ec=Object.getOwnPropertySymbols,Pc=Ec?function(d){for(var r=[];d;)xc(r,Mc(d)),d=Tc(d);return r}:Oc,Qr=Pc,Ac=Ue,Cc=Qr;function Rc(d,r){return Ac(d,Cc(d),r)}var Ic=Rc,Lc=Xr,bc=$e;function Dc(d,r,t){var e=r(d);return bc(d)?e:Lc(e,t(d))}var Zr=Dc,wc=Zr,Nc=sr,Wc=nr;function Bc(d){return wc(d,Wc,Nc)}var kr=Bc,Fc=Zr,jc=Qr,Uc=ir;function $c(d){return Fc(d,Uc,jc)}var zc=$c,Gc=he,Hc=Zt,Kc=Gc(Hc,"DataView"),Vc=Kc,Yc=he,Xc=Zt,Jc=Yc(Xc,"Promise"),Qc=Jc,Zc=he,kc=Zt,qc=Zc(kc,"Set"),_c=qc,tf=he,ef=Zt,rf=tf(ef,"WeakMap"),nf=rf,or=Vc,ar=qe,lr=Qc,cr=_c,fr=nf,qr=ue,xe=Rr,_r="[object Map]",sf="[object Object]",tn="[object Promise]",en="[object Set]",rn="[object WeakMap]",nn="[object DataView]",of=xe(or),af=xe(ar),lf=xe(lr),cf=xe(cr),ff=xe(fr),de=qr;(or&&de(new or(new ArrayBuffer(1)))!=nn||ar&&de(new ar)!=_r||lr&&de(lr.resolve())!=tn||cr&&de(new cr)!=en||fr&&de(new fr)!=rn)&&(de=function(d){var r=qr(d),t=r==sf?d.constructor:void 0,e=t?xe(t):"";if(e)switch(e){case of:return nn;case af:return _r;case lf:return tn;case cf:return en;case ff:return rn}return r});var Ke=de,uf=Object.prototype,hf=uf.hasOwnProperty;function df(d){var r=d.length,t=new d.constructor(r);return r&&typeof d[0]=="string"&&hf.call(d,"index")&&(t.index=d.index,t.input=d.input),t}var gf=df,pf=Zt,vf=pf.Uint8Array,sn=vf,on=sn;function mf(d){var r=new d.constructor(d.byteLength);return new on(r).set(new on(d)),r}var ur=mf,yf=ur;function Sf(d,r){var t=r?yf(d.buffer):d.buffer;return new d.constructor(t,d.byteOffset,d.byteLength)}var xf=Sf,Tf=/\w*$/;function Mf(d){var r=new d.constructor(d.source,Tf.exec(d));return r.lastIndex=d.lastIndex,r}var Of=Mf,an=Be,ln=an?an.prototype:void 0,cn=ln?ln.valueOf:void 0;function Ef(d){return cn?Object(cn.call(d)):{}}var Pf=Ef,Af=ur;function Cf(d,r){var t=r?Af(d.buffer):d.buffer;return new d.constructor(t,d.byteOffset,d.length)}var Rf=Cf,If=ur,Lf=xf,bf=Of,Df=Pf,wf=Rf,Nf="[object Boolean]",Wf="[object Date]",Bf="[object Map]",Ff="[object Number]",jf="[object RegExp]",Uf="[object Set]",$f="[object String]",zf="[object Symbol]",Gf="[object ArrayBuffer]",Hf="[object DataView]",Kf="[object Float32Array]",Vf="[object Float64Array]",Yf="[object Int8Array]",Xf="[object Int16Array]",Jf="[object Int32Array]",Qf="[object Uint8Array]",Zf="[object Uint8ClampedArray]",kf="[object Uint16Array]",qf="[object Uint32Array]";function _f(d,r,t){var e=d.constructor;switch(r){case Gf:return If(d);case Nf:case Wf:return new e(+d);case Hf:return Lf(d,t);case Kf:case Vf:case Yf:case Xf:case Jf:case Qf:case Zf:case kf:case qf:return wf(d,t);case Bf:return new e;case Ff:case $f:return new e(d);case jf:return bf(d);case Uf:return new e;case zf:return Df(d)}}var tu=_f,eu=oe,fn=Object.create,ru=function(){function d(){}return function(r){if(!eu(r))return{};if(fn)return fn(r);d.prototype=r;var t=new d;return d.prototype=void 0,t}}(),nu=ru,iu=nu,su=Jr,ou=rr;function au(d){return typeof d.constructor=="function"&&!ou(d)?iu(su(d)):{}}var lu=au,cu=Ke,fu=ie,uu="[object Map]";function hu(d){return fu(d)&&cu(d)==uu}var du=hu,gu=du,pu=tr,un=er,hn=un&&un.isMap,vu=hn?pu(hn):gu,mu=vu,yu=Ke,Su=ie,xu="[object Set]";function Tu(d){return Su(d)&&yu(d)==xu}var Mu=Tu,Ou=Mu,Eu=tr,dn=er,gn=dn&&dn.isSet,Pu=gn?Eu(gn):Ou,Au=Pu,Cu=Dr,Ru=Xo,Iu=Wr,Lu=jl,bu=ec,Du=rc,wu=ic,Nu=vc,Wu=Ic,Bu=kr,Fu=zc,ju=Ke,Uu=gf,$u=tu,zu=lu,Gu=$e,Hu=_e,Ku=mu,Vu=oe,Yu=Au,Xu=nr,Ju=ir,Qu=1,Zu=2,ku=4,pn="[object Arguments]",qu="[object Array]",_u="[object Boolean]",th="[object Date]",eh="[object Error]",vn="[object Function]",rh="[object GeneratorFunction]",nh="[object Map]",ih="[object Number]",mn="[object Object]",sh="[object RegExp]",oh="[object Set]",ah="[object String]",lh="[object Symbol]",ch="[object WeakMap]",fh="[object ArrayBuffer]",uh="[object DataView]",hh="[object Float32Array]",dh="[object Float64Array]",gh="[object Int8Array]",ph="[object Int16Array]",vh="[object Int32Array]",mh="[object Uint8Array]",yh="[object Uint8ClampedArray]",Sh="[object Uint16Array]",xh="[object Uint32Array]",Wt={};Wt[pn]=Wt[qu]=Wt[fh]=Wt[uh]=Wt[_u]=Wt[th]=Wt[hh]=Wt[dh]=Wt[gh]=Wt[ph]=Wt[vh]=Wt[nh]=Wt[ih]=Wt[mn]=Wt[sh]=Wt[oh]=Wt[ah]=Wt[lh]=Wt[mh]=Wt[yh]=Wt[Sh]=Wt[xh]=!0,Wt[eh]=Wt[vn]=Wt[ch]=!1;function Ve(d,r,t,e,n,i){var a,s=r&Qu,o=r&Zu,f=r&ku;if(t&&(a=n?t(d,e,n,i):t(d)),a!==void 0)return a;if(!Vu(d))return d;var v=Gu(d);if(v){if(a=Uu(d),!s)return wu(d,a)}else{var l=ju(d),p=l==vn||l==rh;if(Hu(d))return Du(d,s);if(l==mn||l==pn||p&&!n){if(a=o||p?{}:zu(d),!s)return o?Wu(d,bu(a,d)):Nu(d,Lu(a,d))}else{if(!Wt[l])return n?d:{};a=$u(d,l,s)}}i||(i=new Cu);var y=i.get(d);if(y)return y;i.set(d,a),Yu(d)?d.forEach(function(m){a.add(Ve(m,r,t,m,d,i))}):Ku(d)&&d.forEach(function(m,T){a.set(T,Ve(m,r,t,T,d,i))});var O=f?o?Fu:Bu:o?Ju:Xu,x=v?void 0:O(d);return Ru(x||d,function(m,T){x&&(T=m,m=d[T]),Iu(a,T,Ve(m,r,t,T,d,i))}),a}var Th=Ve,Mh=Th,Oh=1,Eh=4;function Ph(d){return Mh(d,Oh|Eh)}var Ah=Ph,Jt=Xt(Ah),Vt=(d=>(d.Normal="Normal",d.Stroke="Stroke",d.Dotted="Dotted",d.LongDotted="LongDotted",d))(Vt||{}),Lt=(d=>(d.None="None",d.ShowFloatBar="ShowFloatBar",d.ZIndexFloatBar="ZIndexFloatBar",d.DeleteNode="DeleteNode",d.CopyNode="CopyNode",d.ZIndexActive="ZIndexActive",d.ZIndexNode="ZIndexNode",d.RotateNode="RotateNode",d.SetColorNode="SetColorNode",d.TranslateNode="TranslateNode",d.ScaleNode="ScaleNode",d.OriginalEvent="OriginalEvent",d.CreateScene="CreateScene",d.ActiveCursor="ActiveCursor",d.MoveCursor="MoveCursor",d.CommandEditor="CommandEditor",d.SetEditorData="SetEditorData",d.SetFontStyle="SetFontStyle",d.SetPoint="SetPoint",d.SetLock="SetLock",d.SetShapeOpt="SetShapeOpt",d))(Lt||{}),ht=(d=>(d[d.Pencil=1]="Pencil",d[d.Eraser=2]="Eraser",d[d.Selector=3]="Selector",d[d.Clicker=4]="Clicker",d[d.Arrow=5]="Arrow",d[d.Hand=6]="Hand",d[d.LaserPen=7]="LaserPen",d[d.Text=8]="Text",d[d.Straight=9]="Straight",d[d.Rectangle=10]="Rectangle",d[d.Ellipse=11]="Ellipse",d[d.Star=12]="Star",d[d.Triangle=13]="Triangle",d[d.Rhombus=14]="Rhombus",d[d.Polygon=15]="Polygon",d[d.SpeechBalloon=16]="SpeechBalloon",d[d.Image=17]="Image",d))(ht||{}),Tt=(d=>(d[d.Local=1]="Local",d[d.Service=2]="Service",d[d.Worker=3]="Worker",d))(Tt||{}),Rt=(d=>(d[d.Pending=0]="Pending",d[d.Start=1]="Start",d[d.Doing=2]="Doing",d[d.Done=3]="Done",d[d.Unwritable=4]="Unwritable",d))(Rt||{}),ct=(d=>(d[d.None=0]="None",d[d.Init=1]="Init",d[d.UpdateCamera=2]="UpdateCamera",d[d.UpdateTools=3]="UpdateTools",d[d.CreateWork=4]="CreateWork",d[d.DrawWork=5]="DrawWork",d[d.FullWork=6]="FullWork",d[d.UpdateNode=7]="UpdateNode",d[d.RemoveNode=8]="RemoveNode",d[d.Clear=9]="Clear",d[d.Select=10]="Select",d[d.Destroy=11]="Destroy",d[d.Snapshot=12]="Snapshot",d[d.BoundingBox=13]="BoundingBox",d[d.Cursor=14]="Cursor",d[d.TextUpdate=15]="TextUpdate",d[d.GetTextActive=16]="GetTextActive",d[d.TasksQueue=17]="TasksQueue",d[d.CursorHover=18]="CursorHover",d))(ct||{}),Mt=(d=>(d[d.None=0]="None",d[d.Bg=1]="Bg",d[d.ServiceFloat=2]="ServiceFloat",d[d.Float=3]="Float",d[d.TopFloat=4]="TopFloat",d))(Mt||{}),jt=(d=>(d[d.none=1]="none",d[d.all=2]="all",d[d.both=3]="both",d[d.proportional=4]="proportional",d))(jt||{});class kt{constructor(){nt(this,"localWork");nt(this,"serviceWork");nt(this,"scene")}registerForWorker(r,t,e){return this.localWork=r,this.serviceWork=t,this.scene=e,this}}class Ch extends kt{constructor(){super(...arguments);nt(this,"emitEventType",Lt.CopyNode)}consume(t){const{msgType:e,dataType:n,emitEventType:i}=t;if(e===ct.FullWork&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0}async consumeForLocalWorker(t){var n;const{workId:e}=t;e&&await((n=this.localWork)==null?void 0:n.consumeFull(t,this.scene))}}const Rh={linear:d=>d,easeInQuad:d=>d*d,easeOutQuad:d=>d*(2-d),easeInOutQuad:d=>d<.5?2*d*d:-1+(4-2*d)*d,easeInCubic:d=>d*d*d,easeOutCubic:d=>--d*d*d+1,easeInOutCubic:d=>d<.5?4*d*d*d:(d-1)*(2*d-2)*(2*d-2)+1,easeInQuart:d=>d*d*d*d,easeOutQuart:d=>1- --d*d*d*d,easeInOutQuart:d=>d<.5?8*d*d*d*d:1-8*--d*d*d*d,easeInQuint:d=>d*d*d*d*d,easeOutQuint:d=>1+--d*d*d*d*d,easeInOutQuint:d=>d<.5?16*d*d*d*d*d:1+16*--d*d*d*d*d,easeInSine:d=>1-Math.cos(d*Math.PI/2),easeOutSine:d=>Math.sin(d*Math.PI/2),easeInOutSine:d=>-(Math.cos(Math.PI*d)-1)/2,easeInExpo:d=>d<=0?0:Math.pow(2,10*d-10),easeOutExpo:d=>d>=1?1:1-Math.pow(2,-10*d),easeInOutExpo:d=>d<=0?0:d>=1?1:d<.5?Math.pow(2,20*d-10)/2:(2-Math.pow(2,-20*d+10))/2};class _{constructor(r=0,t=0,e=1){this.x=r,this.y=t,this.z=e}get XY(){return[this.x,this.y]}setz(r){return this.z=r,this}setXY(r=this.x,t=this.y){return this.x=r,this.y=t,this}set(r=this.x,t=this.y,e=this.z){return this.x=r,this.y=t,this.z=e,this}setTo({x:r=0,y:t=0,z:e=1}){return this.x=r,this.y=t,this.z=e,this}rot(r){if(r===0)return this;const{x:t,y:e}=this,n=Math.sin(r),i=Math.cos(r);return this.x=t*i-e*n,this.y=t*n+e*i,this}rotWith(r,t){if(t===0)return this;const e=this.x-r.x,n=this.y-r.y,i=Math.sin(t),a=Math.cos(t);return this.x=r.x+(e*a-n*i),this.y=r.y+(e*i+n*a),this}clone(){const{x:r,y:t,z:e}=this;return new _(r,t,e)}sub(r){return this.x-=r.x,this.y-=r.y,this}subXY(r,t){return this.x-=r,this.y-=t,this}subScalar(r){return this.x-=r,this.y-=r,this}add(r){return this.x+=r.x,this.y+=r.y,this}addXY(r,t){return this.x+=r,this.y+=t,this}addScalar(r){return this.x+=r,this.y+=r,this}clamp(r,t){return this.x=Math.max(this.x,r),this.y=Math.max(this.y,r),t!==void 0&&(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)),this}div(r){return this.x/=r,this.y/=r,this}divV(r){return this.x/=r.x,this.y/=r.y,this}mul(r){return this.x*=r,this.y*=r,this}mulV(r){return this.x*=r.x,this.y*=r.y,this}abs(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this}nudge(r,t){const e=_.Tan(r,this);return this.add(e.mul(t))}neg(){return this.x*=-1,this.y*=-1,this}cross(r){return this.x=this.y*r.z-this.z*r.y,this.y=this.z*r.x-this.x*r.z,this}dpr(r){return _.Dpr(this,r)}cpr(r){return _.Cpr(this,r)}len2(){return _.Len2(this)}len(){return _.Len(this)}pry(r){return _.Pry(this,r)}per(){const{x:r,y:t}=this;return this.x=t,this.y=-r,this}uni(){return _.Uni(this)}tan(r){return _.Tan(this,r)}dist(r){return _.Dist(this,r)}distanceToLineSegment(r,t){return _.DistanceToLineSegment(r,t,this)}slope(r){return _.Slope(this,r)}snapToGrid(r){return this.x=Math.round(this.x/r)*r,this.y=Math.round(this.y/r)*r,this}angle(r){return _.Angle(this,r)}toAngle(){return _.ToAngle(this)}lrp(r,t){return this.x=this.x+(r.x-this.x)*t,this.y=this.y+(r.y-this.y)*t,this}equals(r,t){return _.Equals(this,r,t)}equalsXY(r,t){return _.EqualsXY(this,r,t)}norm(){const r=this.len();return this.x=r===0?0:this.x/r,this.y=r===0?0:this.y/r,this}toFixed(){return _.ToFixed(this)}toString(){return _.ToString(_.ToFixed(this))}toJson(){return _.ToJson(this)}toArray(){return _.ToArray(this)}static Add(r,t){return new _(r.x+t.x,r.y+t.y)}static AddXY(r,t,e){return new _(r.x+t,r.y+e)}static Sub(r,t){return new _(r.x-t.x,r.y-t.y)}static SubXY(r,t,e){return new _(r.x-t,r.y-e)}static AddScalar(r,t){return new _(r.x+t,r.y+t)}static SubScalar(r,t){return new _(r.x-t,r.y-t)}static Div(r,t){return new _(r.x/t,r.y/t)}static Mul(r,t){return new _(r.x*t,r.y*t)}static DivV(r,t){return new _(r.x/t.x,r.y/t.y)}static MulV(r,t){return new _(r.x*t.x,r.y*t.y)}static Neg(r){return new _(-r.x,-r.y)}static Per(r){return new _(r.y,-r.x)}static Dist2(r,t){return _.Sub(r,t).len2()}static Abs(r){return new _(Math.abs(r.x),Math.abs(r.y))}static Dist(r,t){return Math.hypot(r.y-t.y,r.x-t.x)}static Dpr(r,t){return r.x*t.x+r.y*t.y}static Cross(r,t){return new _(r.y*t.z-r.z*t.y,r.z*t.x-r.x*t.z)}static Cpr(r,t){return r.x*t.y-t.x*r.y}static Len2(r){return r.x*r.x+r.y*r.y}static Len(r){return Math.hypot(r.x,r.y)}static Pry(r,t){return _.Dpr(r,t)/_.Len(t)}static Uni(r){return _.Div(r,_.Len(r))}static Tan(r,t){return _.Uni(_.Sub(r,t))}static Min(r,t){return new _(Math.min(r.x,t.x),Math.min(r.y,t.y))}static Max(r,t){return new _(Math.max(r.x,t.x),Math.max(r.y,t.y))}static From(r){return new _().add(r)}static FromArray(r){return new _(r[0],r[1])}static Rot(r,t=0){const e=Math.sin(t),n=Math.cos(t);return new _(r.x*n-r.y*e,r.x*e+r.y*n)}static RotWith(r,t,e){const n=r.x-t.x,i=r.y-t.y,a=Math.sin(e),s=Math.cos(e);return new _(t.x+(n*s-i*a),t.y+(n*a+i*s))}static NearestPointOnLineThroughPoint(r,t,e){return _.Mul(t,_.Sub(e,r).pry(t)).add(r)}static NearestPointOnLineSegment(r,t,e,n=!0){const i=_.Tan(t,r),a=_.Add(r,_.Mul(i,_.Sub(e,r).pry(i)));if(n){if(a.x<Math.min(r.x,t.x))return _.Cast(r.x<t.x?r:t);if(a.x>Math.max(r.x,t.x))return _.Cast(r.x>t.x?r:t);if(a.y<Math.min(r.y,t.y))return _.Cast(r.y<t.y?r:t);if(a.y>Math.max(r.y,t.y))return _.Cast(r.y>t.y?r:t)}return a}static DistanceToLineThroughPoint(r,t,e){return _.Dist(e,_.NearestPointOnLineThroughPoint(r,t,e))}static DistanceToLineSegment(r,t,e,n=!0){return _.Dist(e,_.NearestPointOnLineSegment(r,t,e,n))}static Snap(r,t=1){return new _(Math.round(r.x/t)*t,Math.round(r.y/t)*t)}static Cast(r){return r instanceof _?r:_.From(r)}static Slope(r,t){return r.x===t.y?NaN:(r.y-t.y)/(r.x-t.x)}static Angle(r,t){return Math.atan2(t.y-r.y,t.x-r.x)}static Lrp(r,t,e){return _.Sub(t,r).mul(e).add(r)}static Med(r,t){return new _((r.x+t.x)/2,(r.y+t.y)/2)}static Equals(r,t,e=1e-4){return Math.abs(r.x-t.x)<e&&Math.abs(r.y-t.y)<e}static EqualsXY(r,t,e){return r.x===t&&r.y===e}static EqualsXYZ(r,t,e=1e-4){return _.Equals(r,t,e)&&Math.abs((r.z||0)-(t.z||0))<e}static Clockwise(r,t,e){return(e.x-r.x)*(t.y-r.y)-(t.x-r.x)*(e.y-r.y)<0}static Rescale(r,t){const e=_.Len(r);return new _(t*r.x/e,t*r.y/e)}static ScaleWithOrigin(r,t,e){return _.Sub(r,e).mul(t).add(e)}static ScaleWOrigin(r,t,e){return _.Sub(r,e).mulV(t).add(e)}static ToFixed(r,t=2){return new _(+r.x.toFixed(t),+r.y.toFixed(t),+r.z.toFixed(t))}static Nudge(r,t,e){return _.Add(r,_.Tan(t,r).mul(e))}static ToString(r){return`${r.x}, ${r.y}`}static ToAngle(r){let t=Math.atan2(r.y,r.x);return t<0&&(t+=Math.PI*2),t}static FromAngle(r,t=1){return new _(Math.cos(r)*t,Math.sin(r)*t)}static ToArray(r){return[r.x,r.y,r.z]}static ToJson(r){const{x:t,y:e,z:n}=r;return{x:t,y:e,z:n}}static Average(r){const t=r.length,e=new _(0,0);for(let n=0;n<t;n++)e.add(r[n]);return e.div(t)}static Clamp(r,t,e){return e===void 0?new _(Math.min(Math.max(r.x,t)),Math.min(Math.max(r.y,t))):new _(Math.min(Math.max(r.x,t),e),Math.min(Math.max(r.y,t),e))}static PointsBetween(r,t,e=6){const n=[];for(let i=0;i<e;i++){const a=Rh.easeInQuad(i/(e-1)),s=_.Lrp(r,t,a);s.z=Math.min(1,.5+Math.abs(.5-Ih(a))*.65),n.push(s)}return n}static SnapToGrid(r,t=8){return new _(Math.round(r.x/t)*t,Math.round(r.y/t)*t)}}const Ih=d=>d<.5?2*d*d:-1+(4-2*d)*d;class xt extends _{constructor(r=0,t=0,e=0,n={x:0,y:0},i=0,a=0){super(r,t,e),this.x=r,this.y=t,this.z=e,this.v=n,this.t=i,this.a=a}get timestamp(){return this.t}get pressure(){return this.z}get angleNum(){return this.a}get XY(){return[this.x,this.y]}setA(r){this.a=r}setT(r){this.t=r}setv(r){return this.v={x:r.x,y:r.y},this}set(r=this.x,t=this.y,e=this.z,n=this.v,i=this.t,a=this.a){return this.x=r,this.y=t,this.z=e,this.v=n,this.t=i,this.a=a,this}clone(){const{x:r,y:t,z:e,v:n,t:i,a}=this,s={x:n.x,y:n.y};return new xt(r,t,e,s,i,a)}distance(r){return xt.GetDistance(this,r)}isNear(r,t){return xt.IsNear(this,r,t)}getAngleByPoints(r,t){return xt.GetAngleByPoints(r,this,t)}static Sub(r,t){return new xt(r.x-t.x,r.y-t.y)}static Add(r,t){return new xt(r.x+t.x,r.y+t.y)}static GetDistance(r,t){return xt.Len(r.clone().sub(t))}static GetAngleByPoints(r,t,e){const n=t.x-r.x,i=e.x-t.x,a=t.y-r.y,s=e.y-t.y;let o=0;const f=Math.sqrt(n*n+a*a),v=Math.sqrt(i*i+s*s);if(f&&v){const l=n*i+a*s;o=Math.acos(l/(f*v)),o=o/Math.PI*180;let p=n*s-a*i;p=p>0?1:-1,o=180+p*o}return o}static IsNear(r,t,e){return xt.Len(r.clone().sub(t))<e}static RotWith(r,t,e,n=2){const i=r.x-t.x,a=r.y-t.y,s=Math.sin(e),o=Math.cos(e),f=Math.pow(10,n),v=Math.floor((t.x+(i*o-a*s))*f)/f,l=Math.floor((t.y+(i*s+a*o))*f)/f;return new xt(v,l)}static GetDotStroke(r,t,e=16){const n=new _(1,1),i=Math.PI+.001,a=xt.Add(r,xt.Sub(r,n).uni().per().mul(-t)),s=[];for(let o=1/e,f=o;f<=1;f+=o)s.push(xt.RotWith(a,r,i*2*f));return s}static GetSemicircleStroke(r,t,e=-1,n=8){const i=e*(Math.PI+.001),a=[];for(let s=1/n,o=s;o<=1;o+=s)a.push(xt.RotWith(t,r,i*o));return a}}function Ot(d,r){if(d&&r){const t=Math.min(d.x,r.x),e=Math.min(d.y,r.y),n=Math.max(d.x+d.w,r.x+r.w),i=Math.max(d.y+d.h,r.y+r.h),a=n-t,s=i-e;return{x:t,y:e,w:a,h:s}}return r||d}function wt(d,r=0){const t={x:0,y:0,w:0,h:0};let e=1/0,n=1/0,i=-1/0,a=-1/0;return d.forEach(s=>{const[o,f]=s.XY;e=Math.min(e,o-r),n=Math.min(n,f-r),i=Math.max(i,o+r),a=Math.max(a,f+r)}),t.x=e,t.y=n,t.w=i-e,t.h=a-n,t}function Ce(d,r){return!(d.x+d.w<r.x||d.x>r.x+r.w||d.y+d.h<r.y||d.y>r.y+r.h)}function Bt(d,r=10){return{x:Math.floor(d.x-r),y:Math.floor(d.y-r),w:Math.floor(d.w+r*2),h:Math.floor(d.h+r*2)}}function Re(d,r){return{x:d.x+r[0],y:d.y+r[1],w:d.w,h:d.h}}function yn(d,r){const t=new _(d.x,d.y),e=new _(d.x+d.w,d.y),n=new _(d.x+d.w,d.y+d.h),i=new _(d.x,d.y+d.h),a=new _(d.x+d.w/2,d.y+d.h/2),s=Math.PI*r/180,o=_.RotWith(t,a,s),f=_.RotWith(e,a,s),v=_.RotWith(n,a,s),l=_.RotWith(i,a,s);return[o,f,v,l]}function Sn(d,r){const t=yn(d,r);return wt(t)}function xn(d,r){const t=new _(d.x,d.y),e=new _(d.x+d.w,d.y),n=new _(d.x+d.w,d.y+d.h),i=new _(d.x,d.y+d.h),a=new _(d.x+d.w/2,d.y+d.h/2),s=new _(r[0],r[1]),o=_.ScaleWOrigin(t,s,a),f=_.ScaleWOrigin(e,s,a),v=_.ScaleWOrigin(n,s,a),l=_.ScaleWOrigin(i,s,a);return wt([o,f,v,l])}function Lh(d,r,t){const e=[];for(let n=0;n<d.length;n++){const i=d[n],a=new _(t[0],t[1]),s=_.ScaleWOrigin(i,a,r);e.push(s)}return e}function bh(d,r,t){const e=[];for(let n=0;n<d.length;n++){const i=d[n],a=Math.PI*t/180,s=_.RotWith(i,r,a);e.push(s)}return e}function Dh(d,r,t){const e=new _(r[0],r[1]);for(let n=0;n<d.length;n+=3){const i=new _(d[n],d[n+1]),a=Math.PI*t/180,s=_.RotWith(i,e,a);d[n]=s.x,d[n+1]=s.y}}function wh(d,r,t){const e=new _(r[0],r[1]);for(let n=0;n<d.length;n+=3){const i=new _(d[n],d[n+1]),a=new _(t[0],t[1]),s=_.ScaleWOrigin(i,a,e);d[n]=s.x,d[n+1]=s.y}}function Nh(d,r){return d[0]>=r.x&&d[0]<=r.x+r.w&&d[1]>=r.y&&d[1]<=r.y+r.h}function Tn(d,r){const t=d<=r?1:d/r,e=r<=d?1:r/d;return[t,e]}const Wh=d=>{if(d.tagName==="GROUP"){const r=Object.getOwnPropertySymbols(d).find(t=>t.toString()==="Symbol(sealed)");if(r&&d[r])return!0}return!1},Bh=d=>!d.isHid;function Te(d){return`${Ye(d.x)},${Ye(d.y)} `}function Me(d,r){return`${Ye((d.x+r.x)/2)},${Ye((d.y+r.y)/2)} `}function Ye(d){return+d.toFixed(4)}var Fh=ue,jh=ie,Uh="[object Number]";function $h(d){return typeof d=="number"||jh(d)&&Fh(d)==Uh}var zh=$h,Qt=Xt(zh);const te=class te{constructor(r){nt(this,"syncUnitTime",1e3);nt(this,"vNodes");nt(this,"drawLayer");nt(this,"fullLayer");nt(this,"workId");const{vNodes:t,fullLayer:e,drawLayer:n}=r;this.vNodes=t,this.fullLayer=e,this.drawLayer=n}setWorkId(r){this.workId=r}getWorkId(){return this.workId}getWorkOptions(){return this.workOptions}setWorkOptions(r){var n,i,a;this.workOptions=r,this.syncUnitTime=r.syncUnitTime||this.syncUnitTime;const t=(n=this.workId)==null?void 0:n.toString(),e=t&&((i=this.vNodes)==null?void 0:i.get(t))||void 0;t&&e&&(e.opt=r,(a=this.vNodes)==null||a.setInfo(t,e))}updataOptService(r){var n,i;let t;const e=(n=this.workId)==null?void 0:n.toString();if(e&&r){const a=this.fullLayer.getElementsByName(e)||this.drawLayer&&this.drawLayer.getElementsByName(e)||[];if(a.length!==1)return;const s=a[0],{pos:o,zIndex:f,scale:v,angle:l,translate:p}=r,y={};Qt(f)&&(y.zIndex=f),o&&(y.pos=[o[0],o[1]]),v&&(y.scale=v),l&&(y.rotate=l),p&&(y.translate=p),s.attr(y);const O=s==null?void 0:s.getBoundingClientRect();return O&&(t=Ot(t,{x:Math.floor(O.x-te.SafeBorderPadding),y:Math.floor(O.y-te.SafeBorderPadding),w:Math.floor(O.width+te.SafeBorderPadding*2),h:Math.floor(O.height+te.SafeBorderPadding*2)})),(i=this.vNodes)==null||i.setInfo(e,{rect:t,centerPos:o}),t}}replace(r,t,e){var s;const n=r.getElementsByName(t),i=n.length;if(i){if(i>1)for(let o=1;o<n.length;o++)n[o].remove();r.replaceChild(e,n[0])}else r.append(e);this.fullLayer===r?(s=this.drawLayer)==null||s.getElementsByName(t).forEach(o=>{o.remove()}):this.fullLayer.getElementsByName(t).forEach(o=>{o.remove()})}static updateNodeOpt(r){const{node:t,opt:e,vNodes:n,willSerializeData:i,targetNode:a}=r,{zIndex:s,translate:o,angle:f,box:v,boxScale:l,boxTranslate:p,pointMap:y}=e;let O;const x=a&&Jt(a)||n.get(t.name);if(!x)return;Qt(s)&&(t.setAttribute("zIndex",s),x.opt.zIndex=s);const m=t.parent;if(m){if(v&&p&&l){const{rect:T}=x,c=[];for(let L=0;L<x.op.length;L+=3)c.push(new xt(x.op[L],x.op[L+1],x.op[L+2]));const h=wt(c),u=[h.w*m.worldScaling[0],h.h*m.worldScaling[0]],g=[T.w-u[0],T.h-u[1]],M=[(T.w*l[0]-g[0])/u[0],(T.h*l[1]-g[1])/u[1]],A=[p[0]/m.worldScaling[0],p[1]/m.worldScaling[1]],I=x.op.map((L,D)=>{const R=D%3;return R===0?L+A[0]:R===1?L+A[1]:L}),b=[x.centerPos[0]+A[0],x.centerPos[1]+A[1]];wh(I,b,M);const E=[];for(let L=0;L<I.length;L+=3)E.push(new xt(I[L],I[L+1],I[L+2]));x.op=I,x.centerPos=b}else if(o){const T=[o[0]/m.worldScaling[0],o[1]/m.worldScaling[1]];t.setAttribute("translate",T),x.opt.translate=T,a&&(O=Re(x.rect,o),x.rect=O)}else Qt(f)&&(t.setAttribute("rotate",f),x.opt.rotate=f,a&&(O=Sn(x.rect,f),x.rect=O));if(y){const T=y.get(t.name);if(T)for(let c=0,h=0;c<x.op.length;c+=3,h++)x.op[c]=T[h][0],x.op[c+1]=T[h][1]}if(i){if(o){const T=[o[0]/m.worldScaling[0],o[1]/m.worldScaling[1]],c=x.op.map((h,u)=>{const g=u%3;return g===0?h+T[0]:g===1?h+T[1]:h});x.op=c,x.centerPos=[x.centerPos[0]+T[0],x.centerPos[1]+T[1]],x!=null&&x.opt&&(x.opt.translate=void 0)}else if(Qt(f)){const T=x.op;Dh(T,x.centerPos,f),x.op=T,x!=null&&x.opt&&(x.opt.rotate=void 0)}}x&&n.setInfo(t.name,x)}}static getCenterPos(r,t){const{worldPosition:e,worldScaling:n}=t;return[(r.x+r.w/2-e[0])/n[0],(r.y+r.h/2-e[1])/n[1]]}static getRectFromLayer(r,t){const e=r.getElementsByName(t)[0];if(e){const n=e.getBoundingClientRect();return{x:Math.floor(n.x-te.SafeBorderPadding),y:Math.floor(n.y-te.SafeBorderPadding),w:Math.floor(n.width+te.SafeBorderPadding*2),h:Math.floor(n.height+te.SafeBorderPadding*2)}}}};nt(te,"SafeBorderPadding",10);let yt=te;var Dt=function(d){var r={};function t(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return d[e].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=d,t.c=r,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i})},t.r=function(e){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(n&1&&(e=t(e)),n&8||n&4&&typeof e=="object"&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),n&2&&typeof e!="string")for(var a in e)t.d(i,a,(function(s){return e[s]}).bind(null,a));return i},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/js/",t(t.s=0)}([function(d,r,t){t.r(r),t.d(r,"version",function(){return H}),t.d(r,"helpers",function(){return W}),t.d(r,"createElement",function(){return D}),t.d(r,"isSpriteNode",function(){return R}),t.d(r,"registerNode",function(){return C});var e=t(12);t.d(r,"ENV",function(){return e.ENV});var n=t(68);t.d(r,"requestAnimationFrame",function(){return n.requestAnimationFrame}),t.d(r,"cancelAnimationFrame",function(){return n.cancelAnimationFrame});var i=t(70);t.d(r,"Node",function(){return i.default});var a=t(217);t.d(r,"Cloud",function(){return a.default});var s=t(219);t.d(r,"Block",function(){return s.default});var o=t(224);t.d(r,"Sprite",function(){return o.default});var f=t(226);t.d(r,"Path",function(){return f.default});var v=t(229);t.d(r,"Rect",function(){return v.default});var l=t(231);t.d(r,"Triangle",function(){return l.default});var p=t(236);t.d(r,"Parallel",function(){return p.default});var y=t(238);t.d(r,"Regular",function(){return y.default});var O=t(240);t.d(r,"Star",function(){return O.default});var x=t(242);t.d(r,"Ellipse",function(){return x.default});var m=t(244);t.d(r,"Arc",function(){return m.default});var T=t(246);t.d(r,"Ring",function(){return T.default});var c=t(232);t.d(r,"Polyline",function(){return c.default});var h=t(248);t.d(r,"Label",function(){return h.default});var u=t(250);t.d(r,"Group",function(){return u.default});var g=t(286);t.d(r,"Layer",function(){return g.default});var M=t(287);t.d(r,"SpriteSvg",function(){return M.default});var A=t(289);t.d(r,"LayerWorker",function(){return A.default});var I=t(290);t.d(r,"Scene",function(){return I.default});var b=t(213),E=t(221);t.d(r,"Color",function(){return E.Color}),t.d(r,"Gradient",function(){return E.Gradient});var L=t(72);t(1).glMatrix.setMatrixArrayType(Array);const D=b.default.createElement,R=b.default.isSpriteNode,C=b.default.registerNode,W={parseColor:E.parseColor,sizeToPixel:L.sizeToPixel,toArray:L.toArray,toString:L.toString,toNumber:L.toNumber};let z;z="3.8.3";const H=z},function(d,r,t){t.r(r);var e=t(2);t.d(r,"glMatrix",function(){return e});var n=t(3);t.d(r,"mat2",function(){return n});var i=t(4);t.d(r,"mat2d",function(){return i});var a=t(5);t.d(r,"mat3",function(){return a});var s=t(6);t.d(r,"mat4",function(){return s});var o=t(7);t.d(r,"quat",function(){return o});var f=t(10);t.d(r,"quat2",function(){return f});var v=t(11);t.d(r,"vec2",function(){return v});var l=t(8);t.d(r,"vec3",function(){return l});var p=t(9);t.d(r,"vec4",function(){return p})},function(d,r,t){t.r(r),t.d(r,"EPSILON",function(){return e}),t.d(r,"ARRAY_TYPE",function(){return n}),t.d(r,"RANDOM",function(){return i}),t.d(r,"setMatrixArrayType",function(){return a}),t.d(r,"toRadian",function(){return o}),t.d(r,"equals",function(){return f});var e=1e-6,n=typeof Float32Array<"u"?Float32Array:Array,i=Math.random;function a(v){n=v}var s=Math.PI/180;function o(v){return v*s}function f(v,l){return Math.abs(v-l)<=e*Math.max(1,Math.abs(v),Math.abs(l))}Math.hypot||(Math.hypot=function(){for(var v=0,l=arguments.length;l--;)v+=arguments[l]*arguments[l];return Math.sqrt(v)})},function(d,r,t){t.r(r),t.d(r,"create",function(){return n}),t.d(r,"clone",function(){return i}),t.d(r,"copy",function(){return a}),t.d(r,"identity",function(){return s}),t.d(r,"fromValues",function(){return o}),t.d(r,"set",function(){return f}),t.d(r,"transpose",function(){return v}),t.d(r,"invert",function(){return l}),t.d(r,"adjoint",function(){return p}),t.d(r,"determinant",function(){return y}),t.d(r,"multiply",function(){return O}),t.d(r,"rotate",function(){return x}),t.d(r,"scale",function(){return m}),t.d(r,"fromRotation",function(){return T}),t.d(r,"fromScaling",function(){return c}),t.d(r,"str",function(){return h}),t.d(r,"frob",function(){return u}),t.d(r,"LDU",function(){return g}),t.d(r,"add",function(){return M}),t.d(r,"subtract",function(){return A}),t.d(r,"exactEquals",function(){return I}),t.d(r,"equals",function(){return b}),t.d(r,"multiplyScalar",function(){return E}),t.d(r,"multiplyScalarAndAdd",function(){return L}),t.d(r,"mul",function(){return D}),t.d(r,"sub",function(){return R});var e=t(2);function n(){var C=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(C[1]=0,C[2]=0),C[0]=1,C[3]=1,C}function i(C){var W=new e.ARRAY_TYPE(4);return W[0]=C[0],W[1]=C[1],W[2]=C[2],W[3]=C[3],W}function a(C,W){return C[0]=W[0],C[1]=W[1],C[2]=W[2],C[3]=W[3],C}function s(C){return C[0]=1,C[1]=0,C[2]=0,C[3]=1,C}function o(C,W,z,H){var X=new e.ARRAY_TYPE(4);return X[0]=C,X[1]=W,X[2]=z,X[3]=H,X}function f(C,W,z,H,X){return C[0]=W,C[1]=z,C[2]=H,C[3]=X,C}function v(C,W){if(C===W){var z=W[1];C[1]=W[2],C[2]=z}else C[0]=W[0],C[1]=W[2],C[2]=W[1],C[3]=W[3];return C}function l(C,W){var z=W[0],H=W[1],X=W[2],Z=W[3],j=z*Z-X*H;return j?(j=1/j,C[0]=Z*j,C[1]=-H*j,C[2]=-X*j,C[3]=z*j,C):null}function p(C,W){var z=W[0];return C[0]=W[3],C[1]=-W[1],C[2]=-W[2],C[3]=z,C}function y(C){return C[0]*C[3]-C[2]*C[1]}function O(C,W,z){var H=W[0],X=W[1],Z=W[2],j=W[3],G=z[0],Q=z[1],tt=z[2],et=z[3];return C[0]=H*G+Z*Q,C[1]=X*G+j*Q,C[2]=H*tt+Z*et,C[3]=X*tt+j*et,C}function x(C,W,z){var H=W[0],X=W[1],Z=W[2],j=W[3],G=Math.sin(z),Q=Math.cos(z);return C[0]=H*Q+Z*G,C[1]=X*Q+j*G,C[2]=H*-G+Z*Q,C[3]=X*-G+j*Q,C}function m(C,W,z){var H=W[0],X=W[1],Z=W[2],j=W[3],G=z[0],Q=z[1];return C[0]=H*G,C[1]=X*G,C[2]=Z*Q,C[3]=j*Q,C}function T(C,W){var z=Math.sin(W),H=Math.cos(W);return C[0]=H,C[1]=z,C[2]=-z,C[3]=H,C}function c(C,W){return C[0]=W[0],C[1]=0,C[2]=0,C[3]=W[1],C}function h(C){return"mat2("+C[0]+", "+C[1]+", "+C[2]+", "+C[3]+")"}function u(C){return Math.hypot(C[0],C[1],C[2],C[3])}function g(C,W,z,H){return C[2]=H[2]/H[0],z[0]=H[0],z[1]=H[1],z[3]=H[3]-C[2]*z[1],[C,W,z]}function M(C,W,z){return C[0]=W[0]+z[0],C[1]=W[1]+z[1],C[2]=W[2]+z[2],C[3]=W[3]+z[3],C}function A(C,W,z){return C[0]=W[0]-z[0],C[1]=W[1]-z[1],C[2]=W[2]-z[2],C[3]=W[3]-z[3],C}function I(C,W){return C[0]===W[0]&&C[1]===W[1]&&C[2]===W[2]&&C[3]===W[3]}function b(C,W){var z=C[0],H=C[1],X=C[2],Z=C[3],j=W[0],G=W[1],Q=W[2],tt=W[3];return Math.abs(z-j)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(j))&&Math.abs(H-G)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(G))&&Math.abs(X-Q)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(Q))&&Math.abs(Z-tt)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(tt))}function E(C,W,z){return C[0]=W[0]*z,C[1]=W[1]*z,C[2]=W[2]*z,C[3]=W[3]*z,C}function L(C,W,z,H){return C[0]=W[0]+z[0]*H,C[1]=W[1]+z[1]*H,C[2]=W[2]+z[2]*H,C[3]=W[3]+z[3]*H,C}var D=O,R=A},function(d,r,t){t.r(r),t.d(r,"create",function(){return n}),t.d(r,"clone",function(){return i}),t.d(r,"copy",function(){return a}),t.d(r,"identity",function(){return s}),t.d(r,"fromValues",function(){return o}),t.d(r,"set",function(){return f}),t.d(r,"invert",function(){return v}),t.d(r,"determinant",function(){return l}),t.d(r,"multiply",function(){return p}),t.d(r,"rotate",function(){return y}),t.d(r,"scale",function(){return O}),t.d(r,"translate",function(){return x}),t.d(r,"fromRotation",function(){return m}),t.d(r,"fromScaling",function(){return T}),t.d(r,"fromTranslation",function(){return c}),t.d(r,"str",function(){return h}),t.d(r,"frob",function(){return u}),t.d(r,"add",function(){return g}),t.d(r,"subtract",function(){return M}),t.d(r,"multiplyScalar",function(){return A}),t.d(r,"multiplyScalarAndAdd",function(){return I}),t.d(r,"exactEquals",function(){return b}),t.d(r,"equals",function(){return E}),t.d(r,"mul",function(){return L}),t.d(r,"sub",function(){return D});var e=t(2);function n(){var R=new e.ARRAY_TYPE(6);return e.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0,R[4]=0,R[5]=0),R[0]=1,R[3]=1,R}function i(R){var C=new e.ARRAY_TYPE(6);return C[0]=R[0],C[1]=R[1],C[2]=R[2],C[3]=R[3],C[4]=R[4],C[5]=R[5],C}function a(R,C){return R[0]=C[0],R[1]=C[1],R[2]=C[2],R[3]=C[3],R[4]=C[4],R[5]=C[5],R}function s(R){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R[4]=0,R[5]=0,R}function o(R,C,W,z,H,X){var Z=new e.ARRAY_TYPE(6);return Z[0]=R,Z[1]=C,Z[2]=W,Z[3]=z,Z[4]=H,Z[5]=X,Z}function f(R,C,W,z,H,X,Z){return R[0]=C,R[1]=W,R[2]=z,R[3]=H,R[4]=X,R[5]=Z,R}function v(R,C){var W=C[0],z=C[1],H=C[2],X=C[3],Z=C[4],j=C[5],G=W*X-z*H;return G?(G=1/G,R[0]=X*G,R[1]=-z*G,R[2]=-H*G,R[3]=W*G,R[4]=(H*j-X*Z)*G,R[5]=(z*Z-W*j)*G,R):null}function l(R){return R[0]*R[3]-R[1]*R[2]}function p(R,C,W){var z=C[0],H=C[1],X=C[2],Z=C[3],j=C[4],G=C[5],Q=W[0],tt=W[1],et=W[2],at=W[3],q=W[4],pt=W[5];return R[0]=z*Q+X*tt,R[1]=H*Q+Z*tt,R[2]=z*et+X*at,R[3]=H*et+Z*at,R[4]=z*q+X*pt+j,R[5]=H*q+Z*pt+G,R}function y(R,C,W){var z=C[0],H=C[1],X=C[2],Z=C[3],j=C[4],G=C[5],Q=Math.sin(W),tt=Math.cos(W);return R[0]=z*tt+X*Q,R[1]=H*tt+Z*Q,R[2]=z*-Q+X*tt,R[3]=H*-Q+Z*tt,R[4]=j,R[5]=G,R}function O(R,C,W){var z=C[0],H=C[1],X=C[2],Z=C[3],j=C[4],G=C[5],Q=W[0],tt=W[1];return R[0]=z*Q,R[1]=H*Q,R[2]=X*tt,R[3]=Z*tt,R[4]=j,R[5]=G,R}function x(R,C,W){var z=C[0],H=C[1],X=C[2],Z=C[3],j=C[4],G=C[5],Q=W[0],tt=W[1];return R[0]=z,R[1]=H,R[2]=X,R[3]=Z,R[4]=z*Q+X*tt+j,R[5]=H*Q+Z*tt+G,R}function m(R,C){var W=Math.sin(C),z=Math.cos(C);return R[0]=z,R[1]=W,R[2]=-W,R[3]=z,R[4]=0,R[5]=0,R}function T(R,C){return R[0]=C[0],R[1]=0,R[2]=0,R[3]=C[1],R[4]=0,R[5]=0,R}function c(R,C){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R[4]=C[0],R[5]=C[1],R}function h(R){return"mat2d("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+", "+R[4]+", "+R[5]+")"}function u(R){return Math.hypot(R[0],R[1],R[2],R[3],R[4],R[5],1)}function g(R,C,W){return R[0]=C[0]+W[0],R[1]=C[1]+W[1],R[2]=C[2]+W[2],R[3]=C[3]+W[3],R[4]=C[4]+W[4],R[5]=C[5]+W[5],R}function M(R,C,W){return R[0]=C[0]-W[0],R[1]=C[1]-W[1],R[2]=C[2]-W[2],R[3]=C[3]-W[3],R[4]=C[4]-W[4],R[5]=C[5]-W[5],R}function A(R,C,W){return R[0]=C[0]*W,R[1]=C[1]*W,R[2]=C[2]*W,R[3]=C[3]*W,R[4]=C[4]*W,R[5]=C[5]*W,R}function I(R,C,W,z){return R[0]=C[0]+W[0]*z,R[1]=C[1]+W[1]*z,R[2]=C[2]+W[2]*z,R[3]=C[3]+W[3]*z,R[4]=C[4]+W[4]*z,R[5]=C[5]+W[5]*z,R}function b(R,C){return R[0]===C[0]&&R[1]===C[1]&&R[2]===C[2]&&R[3]===C[3]&&R[4]===C[4]&&R[5]===C[5]}function E(R,C){var W=R[0],z=R[1],H=R[2],X=R[3],Z=R[4],j=R[5],G=C[0],Q=C[1],tt=C[2],et=C[3],at=C[4],q=C[5];return Math.abs(W-G)<=e.EPSILON*Math.max(1,Math.abs(W),Math.abs(G))&&Math.abs(z-Q)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(Q))&&Math.abs(H-tt)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(tt))&&Math.abs(X-et)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(et))&&Math.abs(Z-at)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(at))&&Math.abs(j-q)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(q))}var L=p,D=M},function(d,r,t){t.r(r),t.d(r,"create",function(){return n}),t.d(r,"fromMat4",function(){return i}),t.d(r,"clone",function(){return a}),t.d(r,"copy",function(){return s}),t.d(r,"fromValues",function(){return o}),t.d(r,"set",function(){return f}),t.d(r,"identity",function(){return v}),t.d(r,"transpose",function(){return l}),t.d(r,"invert",function(){return p}),t.d(r,"adjoint",function(){return y}),t.d(r,"determinant",function(){return O}),t.d(r,"multiply",function(){return x}),t.d(r,"translate",function(){return m}),t.d(r,"rotate",function(){return T}),t.d(r,"scale",function(){return c}),t.d(r,"fromTranslation",function(){return h}),t.d(r,"fromRotation",function(){return u}),t.d(r,"fromScaling",function(){return g}),t.d(r,"fromMat2d",function(){return M}),t.d(r,"fromQuat",function(){return A}),t.d(r,"normalFromMat4",function(){return I}),t.d(r,"projection",function(){return b}),t.d(r,"str",function(){return E}),t.d(r,"frob",function(){return L}),t.d(r,"add",function(){return D}),t.d(r,"subtract",function(){return R}),t.d(r,"multiplyScalar",function(){return C}),t.d(r,"multiplyScalarAndAdd",function(){return W}),t.d(r,"exactEquals",function(){return z}),t.d(r,"equals",function(){return H}),t.d(r,"mul",function(){return X}),t.d(r,"sub",function(){return Z});var e=t(2);function n(){var j=new e.ARRAY_TYPE(9);return e.ARRAY_TYPE!=Float32Array&&(j[1]=0,j[2]=0,j[3]=0,j[5]=0,j[6]=0,j[7]=0),j[0]=1,j[4]=1,j[8]=1,j}function i(j,G){return j[0]=G[0],j[1]=G[1],j[2]=G[2],j[3]=G[4],j[4]=G[5],j[5]=G[6],j[6]=G[8],j[7]=G[9],j[8]=G[10],j}function a(j){var G=new e.ARRAY_TYPE(9);return G[0]=j[0],G[1]=j[1],G[2]=j[2],G[3]=j[3],G[4]=j[4],G[5]=j[5],G[6]=j[6],G[7]=j[7],G[8]=j[8],G}function s(j,G){return j[0]=G[0],j[1]=G[1],j[2]=G[2],j[3]=G[3],j[4]=G[4],j[5]=G[5],j[6]=G[6],j[7]=G[7],j[8]=G[8],j}function o(j,G,Q,tt,et,at,q,pt,dt){var B=new e.ARRAY_TYPE(9);return B[0]=j,B[1]=G,B[2]=Q,B[3]=tt,B[4]=et,B[5]=at,B[6]=q,B[7]=pt,B[8]=dt,B}function f(j,G,Q,tt,et,at,q,pt,dt,B){return j[0]=G,j[1]=Q,j[2]=tt,j[3]=et,j[4]=at,j[5]=q,j[6]=pt,j[7]=dt,j[8]=B,j}function v(j){return j[0]=1,j[1]=0,j[2]=0,j[3]=0,j[4]=1,j[5]=0,j[6]=0,j[7]=0,j[8]=1,j}function l(j,G){if(j===G){var Q=G[1],tt=G[2],et=G[5];j[1]=G[3],j[2]=G[6],j[3]=Q,j[5]=G[7],j[6]=tt,j[7]=et}else j[0]=G[0],j[1]=G[3],j[2]=G[6],j[3]=G[1],j[4]=G[4],j[5]=G[7],j[6]=G[2],j[7]=G[5],j[8]=G[8];return j}function p(j,G){var Q=G[0],tt=G[1],et=G[2],at=G[3],q=G[4],pt=G[5],dt=G[6],B=G[7],F=G[8],V=F*q-pt*B,J=-F*at+pt*dt,N=B*at-q*dt,$=Q*V+tt*J+et*N;return $?($=1/$,j[0]=V*$,j[1]=(-F*tt+et*B)*$,j[2]=(pt*tt-et*q)*$,j[3]=J*$,j[4]=(F*Q-et*dt)*$,j[5]=(-pt*Q+et*at)*$,j[6]=N*$,j[7]=(-B*Q+tt*dt)*$,j[8]=(q*Q-tt*at)*$,j):null}function y(j,G){var Q=G[0],tt=G[1],et=G[2],at=G[3],q=G[4],pt=G[5],dt=G[6],B=G[7],F=G[8];return j[0]=q*F-pt*B,j[1]=et*B-tt*F,j[2]=tt*pt-et*q,j[3]=pt*dt-at*F,j[4]=Q*F-et*dt,j[5]=et*at-Q*pt,j[6]=at*B-q*dt,j[7]=tt*dt-Q*B,j[8]=Q*q-tt*at,j}function O(j){var G=j[0],Q=j[1],tt=j[2],et=j[3],at=j[4],q=j[5],pt=j[6],dt=j[7],B=j[8];return G*(B*at-q*dt)+Q*(-B*et+q*pt)+tt*(dt*et-at*pt)}function x(j,G,Q){var tt=G[0],et=G[1],at=G[2],q=G[3],pt=G[4],dt=G[5],B=G[6],F=G[7],V=G[8],J=Q[0],N=Q[1],$=Q[2],S=Q[3],P=Q[4],w=Q[5],U=Q[6],K=Q[7],Y=Q[8];return j[0]=J*tt+N*q+$*B,j[1]=J*et+N*pt+$*F,j[2]=J*at+N*dt+$*V,j[3]=S*tt+P*q+w*B,j[4]=S*et+P*pt+w*F,j[5]=S*at+P*dt+w*V,j[6]=U*tt+K*q+Y*B,j[7]=U*et+K*pt+Y*F,j[8]=U*at+K*dt+Y*V,j}function m(j,G,Q){var tt=G[0],et=G[1],at=G[2],q=G[3],pt=G[4],dt=G[5],B=G[6],F=G[7],V=G[8],J=Q[0],N=Q[1];return j[0]=tt,j[1]=et,j[2]=at,j[3]=q,j[4]=pt,j[5]=dt,j[6]=J*tt+N*q+B,j[7]=J*et+N*pt+F,j[8]=J*at+N*dt+V,j}function T(j,G,Q){var tt=G[0],et=G[1],at=G[2],q=G[3],pt=G[4],dt=G[5],B=G[6],F=G[7],V=G[8],J=Math.sin(Q),N=Math.cos(Q);return j[0]=N*tt+J*q,j[1]=N*et+J*pt,j[2]=N*at+J*dt,j[3]=N*q-J*tt,j[4]=N*pt-J*et,j[5]=N*dt-J*at,j[6]=B,j[7]=F,j[8]=V,j}function c(j,G,Q){var tt=Q[0],et=Q[1];return j[0]=tt*G[0],j[1]=tt*G[1],j[2]=tt*G[2],j[3]=et*G[3],j[4]=et*G[4],j[5]=et*G[5],j[6]=G[6],j[7]=G[7],j[8]=G[8],j}function h(j,G){return j[0]=1,j[1]=0,j[2]=0,j[3]=0,j[4]=1,j[5]=0,j[6]=G[0],j[7]=G[1],j[8]=1,j}function u(j,G){var Q=Math.sin(G),tt=Math.cos(G);return j[0]=tt,j[1]=Q,j[2]=0,j[3]=-Q,j[4]=tt,j[5]=0,j[6]=0,j[7]=0,j[8]=1,j}function g(j,G){return j[0]=G[0],j[1]=0,j[2]=0,j[3]=0,j[4]=G[1],j[5]=0,j[6]=0,j[7]=0,j[8]=1,j}function M(j,G){return j[0]=G[0],j[1]=G[1],j[2]=0,j[3]=G[2],j[4]=G[3],j[5]=0,j[6]=G[4],j[7]=G[5],j[8]=1,j}function A(j,G){var Q=G[0],tt=G[1],et=G[2],at=G[3],q=Q+Q,pt=tt+tt,dt=et+et,B=Q*q,F=tt*q,V=tt*pt,J=et*q,N=et*pt,$=et*dt,S=at*q,P=at*pt,w=at*dt;return j[0]=1-V-$,j[3]=F-w,j[6]=J+P,j[1]=F+w,j[4]=1-B-$,j[7]=N-S,j[2]=J-P,j[5]=N+S,j[8]=1-B-V,j}function I(j,G){var Q=G[0],tt=G[1],et=G[2],at=G[3],q=G[4],pt=G[5],dt=G[6],B=G[7],F=G[8],V=G[9],J=G[10],N=G[11],$=G[12],S=G[13],P=G[14],w=G[15],U=Q*pt-tt*q,K=Q*dt-et*q,Y=Q*B-at*q,k=tt*dt-et*pt,rt=tt*B-at*pt,it=et*B-at*dt,lt=F*S-V*$,ut=F*P-J*$,ot=F*w-N*$,st=V*P-J*S,ft=V*w-N*S,vt=J*w-N*P,mt=U*vt-K*ft+Y*st+k*ot-rt*ut+it*lt;return mt?(mt=1/mt,j[0]=(pt*vt-dt*ft+B*st)*mt,j[1]=(dt*ot-q*vt-B*ut)*mt,j[2]=(q*ft-pt*ot+B*lt)*mt,j[3]=(et*ft-tt*vt-at*st)*mt,j[4]=(Q*vt-et*ot+at*ut)*mt,j[5]=(tt*ot-Q*ft-at*lt)*mt,j[6]=(S*it-P*rt+w*k)*mt,j[7]=(P*Y-$*it-w*K)*mt,j[8]=($*rt-S*Y+w*U)*mt,j):null}function b(j,G,Q){return j[0]=2/G,j[1]=0,j[2]=0,j[3]=0,j[4]=-2/Q,j[5]=0,j[6]=-1,j[7]=1,j[8]=1,j}function E(j){return"mat3("+j[0]+", "+j[1]+", "+j[2]+", "+j[3]+", "+j[4]+", "+j[5]+", "+j[6]+", "+j[7]+", "+j[8]+")"}function L(j){return Math.hypot(j[0],j[1],j[2],j[3],j[4],j[5],j[6],j[7],j[8])}function D(j,G,Q){return j[0]=G[0]+Q[0],j[1]=G[1]+Q[1],j[2]=G[2]+Q[2],j[3]=G[3]+Q[3],j[4]=G[4]+Q[4],j[5]=G[5]+Q[5],j[6]=G[6]+Q[6],j[7]=G[7]+Q[7],j[8]=G[8]+Q[8],j}function R(j,G,Q){return j[0]=G[0]-Q[0],j[1]=G[1]-Q[1],j[2]=G[2]-Q[2],j[3]=G[3]-Q[3],j[4]=G[4]-Q[4],j[5]=G[5]-Q[5],j[6]=G[6]-Q[6],j[7]=G[7]-Q[7],j[8]=G[8]-Q[8],j}function C(j,G,Q){return j[0]=G[0]*Q,j[1]=G[1]*Q,j[2]=G[2]*Q,j[3]=G[3]*Q,j[4]=G[4]*Q,j[5]=G[5]*Q,j[6]=G[6]*Q,j[7]=G[7]*Q,j[8]=G[8]*Q,j}function W(j,G,Q,tt){return j[0]=G[0]+Q[0]*tt,j[1]=G[1]+Q[1]*tt,j[2]=G[2]+Q[2]*tt,j[3]=G[3]+Q[3]*tt,j[4]=G[4]+Q[4]*tt,j[5]=G[5]+Q[5]*tt,j[6]=G[6]+Q[6]*tt,j[7]=G[7]+Q[7]*tt,j[8]=G[8]+Q[8]*tt,j}function z(j,G){return j[0]===G[0]&&j[1]===G[1]&&j[2]===G[2]&&j[3]===G[3]&&j[4]===G[4]&&j[5]===G[5]&&j[6]===G[6]&&j[7]===G[7]&&j[8]===G[8]}function H(j,G){var Q=j[0],tt=j[1],et=j[2],at=j[3],q=j[4],pt=j[5],dt=j[6],B=j[7],F=j[8],V=G[0],J=G[1],N=G[2],$=G[3],S=G[4],P=G[5],w=G[6],U=G[7],K=G[8];return Math.abs(Q-V)<=e.EPSILON*Math.max(1,Math.abs(Q),Math.abs(V))&&Math.abs(tt-J)<=e.EPSILON*Math.max(1,Math.abs(tt),Math.abs(J))&&Math.abs(et-N)<=e.EPSILON*Math.max(1,Math.abs(et),Math.abs(N))&&Math.abs(at-$)<=e.EPSILON*Math.max(1,Math.abs(at),Math.abs($))&&Math.abs(q-S)<=e.EPSILON*Math.max(1,Math.abs(q),Math.abs(S))&&Math.abs(pt-P)<=e.EPSILON*Math.max(1,Math.abs(pt),Math.abs(P))&&Math.abs(dt-w)<=e.EPSILON*Math.max(1,Math.abs(dt),Math.abs(w))&&Math.abs(B-U)<=e.EPSILON*Math.max(1,Math.abs(B),Math.abs(U))&&Math.abs(F-K)<=e.EPSILON*Math.max(1,Math.abs(F),Math.abs(K))}var X=x,Z=R},function(d,r,t){t.r(r),t.d(r,"create",function(){return n}),t.d(r,"clone",function(){return i}),t.d(r,"copy",function(){return a}),t.d(r,"fromValues",function(){return s}),t.d(r,"set",function(){return o}),t.d(r,"identity",function(){return f}),t.d(r,"transpose",function(){return v}),t.d(r,"invert",function(){return l}),t.d(r,"adjoint",function(){return p}),t.d(r,"determinant",function(){return y}),t.d(r,"multiply",function(){return O}),t.d(r,"translate",function(){return x}),t.d(r,"scale",function(){return m}),t.d(r,"rotate",function(){return T}),t.d(r,"rotateX",function(){return c}),t.d(r,"rotateY",function(){return h}),t.d(r,"rotateZ",function(){return u}),t.d(r,"fromTranslation",function(){return g}),t.d(r,"fromScaling",function(){return M}),t.d(r,"fromRotation",function(){return A}),t.d(r,"fromXRotation",function(){return I}),t.d(r,"fromYRotation",function(){return b}),t.d(r,"fromZRotation",function(){return E}),t.d(r,"fromRotationTranslation",function(){return L}),t.d(r,"fromQuat2",function(){return D}),t.d(r,"getTranslation",function(){return R}),t.d(r,"getScaling",function(){return C}),t.d(r,"getRotation",function(){return W}),t.d(r,"fromRotationTranslationScale",function(){return z}),t.d(r,"fromRotationTranslationScaleOrigin",function(){return H}),t.d(r,"fromQuat",function(){return X}),t.d(r,"frustum",function(){return Z}),t.d(r,"perspective",function(){return j}),t.d(r,"perspectiveFromFieldOfView",function(){return G}),t.d(r,"ortho",function(){return Q}),t.d(r,"lookAt",function(){return tt}),t.d(r,"targetTo",function(){return et}),t.d(r,"str",function(){return at}),t.d(r,"frob",function(){return q}),t.d(r,"add",function(){return pt}),t.d(r,"subtract",function(){return dt}),t.d(r,"multiplyScalar",function(){return B}),t.d(r,"multiplyScalarAndAdd",function(){return F}),t.d(r,"exactEquals",function(){return V}),t.d(r,"equals",function(){return J}),t.d(r,"mul",function(){return N}),t.d(r,"sub",function(){return $});var e=t(2);function n(){var S=new e.ARRAY_TYPE(16);return e.ARRAY_TYPE!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=0,S[12]=0,S[13]=0,S[14]=0),S[0]=1,S[5]=1,S[10]=1,S[15]=1,S}function i(S){var P=new e.ARRAY_TYPE(16);return P[0]=S[0],P[1]=S[1],P[2]=S[2],P[3]=S[3],P[4]=S[4],P[5]=S[5],P[6]=S[6],P[7]=S[7],P[8]=S[8],P[9]=S[9],P[10]=S[10],P[11]=S[11],P[12]=S[12],P[13]=S[13],P[14]=S[14],P[15]=S[15],P}function a(S,P){return S[0]=P[0],S[1]=P[1],S[2]=P[2],S[3]=P[3],S[4]=P[4],S[5]=P[5],S[6]=P[6],S[7]=P[7],S[8]=P[8],S[9]=P[9],S[10]=P[10],S[11]=P[11],S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15],S}function s(S,P,w,U,K,Y,k,rt,it,lt,ut,ot,st,ft,vt,mt){var gt=new e.ARRAY_TYPE(16);return gt[0]=S,gt[1]=P,gt[2]=w,gt[3]=U,gt[4]=K,gt[5]=Y,gt[6]=k,gt[7]=rt,gt[8]=it,gt[9]=lt,gt[10]=ut,gt[11]=ot,gt[12]=st,gt[13]=ft,gt[14]=vt,gt[15]=mt,gt}function o(S,P,w,U,K,Y,k,rt,it,lt,ut,ot,st,ft,vt,mt,gt){return S[0]=P,S[1]=w,S[2]=U,S[3]=K,S[4]=Y,S[5]=k,S[6]=rt,S[7]=it,S[8]=lt,S[9]=ut,S[10]=ot,S[11]=st,S[12]=ft,S[13]=vt,S[14]=mt,S[15]=gt,S}function f(S){return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function v(S,P){if(S===P){var w=P[1],U=P[2],K=P[3],Y=P[6],k=P[7],rt=P[11];S[1]=P[4],S[2]=P[8],S[3]=P[12],S[4]=w,S[6]=P[9],S[7]=P[13],S[8]=U,S[9]=Y,S[11]=P[14],S[12]=K,S[13]=k,S[14]=rt}else S[0]=P[0],S[1]=P[4],S[2]=P[8],S[3]=P[12],S[4]=P[1],S[5]=P[5],S[6]=P[9],S[7]=P[13],S[8]=P[2],S[9]=P[6],S[10]=P[10],S[11]=P[14],S[12]=P[3],S[13]=P[7],S[14]=P[11],S[15]=P[15];return S}function l(S,P){var w=P[0],U=P[1],K=P[2],Y=P[3],k=P[4],rt=P[5],it=P[6],lt=P[7],ut=P[8],ot=P[9],st=P[10],ft=P[11],vt=P[12],mt=P[13],gt=P[14],St=P[15],It=w*rt-U*k,Et=w*it-K*k,Pt=w*lt-Y*k,At=U*it-K*rt,Ct=U*lt-Y*rt,Gt=K*lt-Y*it,Ut=ut*mt-ot*vt,$t=ut*gt-st*vt,zt=ut*St-ft*vt,Ht=ot*gt-st*mt,Kt=ot*St-ft*mt,Yt=st*St-ft*gt,bt=It*Yt-Et*Kt+Pt*Ht+At*zt-Ct*$t+Gt*Ut;return bt?(bt=1/bt,S[0]=(rt*Yt-it*Kt+lt*Ht)*bt,S[1]=(K*Kt-U*Yt-Y*Ht)*bt,S[2]=(mt*Gt-gt*Ct+St*At)*bt,S[3]=(st*Ct-ot*Gt-ft*At)*bt,S[4]=(it*zt-k*Yt-lt*$t)*bt,S[5]=(w*Yt-K*zt+Y*$t)*bt,S[6]=(gt*Pt-vt*Gt-St*Et)*bt,S[7]=(ut*Gt-st*Pt+ft*Et)*bt,S[8]=(k*Kt-rt*zt+lt*Ut)*bt,S[9]=(U*zt-w*Kt-Y*Ut)*bt,S[10]=(vt*Ct-mt*Pt+St*It)*bt,S[11]=(ot*Pt-ut*Ct-ft*It)*bt,S[12]=(rt*$t-k*Ht-it*Ut)*bt,S[13]=(w*Ht-U*$t+K*Ut)*bt,S[14]=(mt*Et-vt*At-gt*It)*bt,S[15]=(ut*At-ot*Et+st*It)*bt,S):null}function p(S,P){var w=P[0],U=P[1],K=P[2],Y=P[3],k=P[4],rt=P[5],it=P[6],lt=P[7],ut=P[8],ot=P[9],st=P[10],ft=P[11],vt=P[12],mt=P[13],gt=P[14],St=P[15];return S[0]=rt*(st*St-ft*gt)-ot*(it*St-lt*gt)+mt*(it*ft-lt*st),S[1]=-(U*(st*St-ft*gt)-ot*(K*St-Y*gt)+mt*(K*ft-Y*st)),S[2]=U*(it*St-lt*gt)-rt*(K*St-Y*gt)+mt*(K*lt-Y*it),S[3]=-(U*(it*ft-lt*st)-rt*(K*ft-Y*st)+ot*(K*lt-Y*it)),S[4]=-(k*(st*St-ft*gt)-ut*(it*St-lt*gt)+vt*(it*ft-lt*st)),S[5]=w*(st*St-ft*gt)-ut*(K*St-Y*gt)+vt*(K*ft-Y*st),S[6]=-(w*(it*St-lt*gt)-k*(K*St-Y*gt)+vt*(K*lt-Y*it)),S[7]=w*(it*ft-lt*st)-k*(K*ft-Y*st)+ut*(K*lt-Y*it),S[8]=k*(ot*St-ft*mt)-ut*(rt*St-lt*mt)+vt*(rt*ft-lt*ot),S[9]=-(w*(ot*St-ft*mt)-ut*(U*St-Y*mt)+vt*(U*ft-Y*ot)),S[10]=w*(rt*St-lt*mt)-k*(U*St-Y*mt)+vt*(U*lt-Y*rt),S[11]=-(w*(rt*ft-lt*ot)-k*(U*ft-Y*ot)+ut*(U*lt-Y*rt)),S[12]=-(k*(ot*gt-st*mt)-ut*(rt*gt-it*mt)+vt*(rt*st-it*ot)),S[13]=w*(ot*gt-st*mt)-ut*(U*gt-K*mt)+vt*(U*st-K*ot),S[14]=-(w*(rt*gt-it*mt)-k*(U*gt-K*mt)+vt*(U*it-K*rt)),S[15]=w*(rt*st-it*ot)-k*(U*st-K*ot)+ut*(U*it-K*rt),S}function y(S){var P=S[0],w=S[1],U=S[2],K=S[3],Y=S[4],k=S[5],rt=S[6],it=S[7],lt=S[8],ut=S[9],ot=S[10],st=S[11],ft=S[12],vt=S[13],mt=S[14],gt=S[15],St=P*k-w*Y,It=P*rt-U*Y,Et=P*it-K*Y,Pt=w*rt-U*k,At=w*it-K*k,Ct=U*it-K*rt,Gt=lt*vt-ut*ft,Ut=lt*mt-ot*ft,$t=lt*gt-st*ft,zt=ut*mt-ot*vt,Ht=ut*gt-st*vt,Kt=ot*gt-st*mt;return St*Kt-It*Ht+Et*zt+Pt*$t-At*Ut+Ct*Gt}function O(S,P,w){var U=P[0],K=P[1],Y=P[2],k=P[3],rt=P[4],it=P[5],lt=P[6],ut=P[7],ot=P[8],st=P[9],ft=P[10],vt=P[11],mt=P[12],gt=P[13],St=P[14],It=P[15],Et=w[0],Pt=w[1],At=w[2],Ct=w[3];return S[0]=Et*U+Pt*rt+At*ot+Ct*mt,S[1]=Et*K+Pt*it+At*st+Ct*gt,S[2]=Et*Y+Pt*lt+At*ft+Ct*St,S[3]=Et*k+Pt*ut+At*vt+Ct*It,Et=w[4],Pt=w[5],At=w[6],Ct=w[7],S[4]=Et*U+Pt*rt+At*ot+Ct*mt,S[5]=Et*K+Pt*it+At*st+Ct*gt,S[6]=Et*Y+Pt*lt+At*ft+Ct*St,S[7]=Et*k+Pt*ut+At*vt+Ct*It,Et=w[8],Pt=w[9],At=w[10],Ct=w[11],S[8]=Et*U+Pt*rt+At*ot+Ct*mt,S[9]=Et*K+Pt*it+At*st+Ct*gt,S[10]=Et*Y+Pt*lt+At*ft+Ct*St,S[11]=Et*k+Pt*ut+At*vt+Ct*It,Et=w[12],Pt=w[13],At=w[14],Ct=w[15],S[12]=Et*U+Pt*rt+At*ot+Ct*mt,S[13]=Et*K+Pt*it+At*st+Ct*gt,S[14]=Et*Y+Pt*lt+At*ft+Ct*St,S[15]=Et*k+Pt*ut+At*vt+Ct*It,S}function x(S,P,w){var U=w[0],K=w[1],Y=w[2],k,rt,it,lt,ut,ot,st,ft,vt,mt,gt,St;return P===S?(S[12]=P[0]*U+P[4]*K+P[8]*Y+P[12],S[13]=P[1]*U+P[5]*K+P[9]*Y+P[13],S[14]=P[2]*U+P[6]*K+P[10]*Y+P[14],S[15]=P[3]*U+P[7]*K+P[11]*Y+P[15]):(k=P[0],rt=P[1],it=P[2],lt=P[3],ut=P[4],ot=P[5],st=P[6],ft=P[7],vt=P[8],mt=P[9],gt=P[10],St=P[11],S[0]=k,S[1]=rt,S[2]=it,S[3]=lt,S[4]=ut,S[5]=ot,S[6]=st,S[7]=ft,S[8]=vt,S[9]=mt,S[10]=gt,S[11]=St,S[12]=k*U+ut*K+vt*Y+P[12],S[13]=rt*U+ot*K+mt*Y+P[13],S[14]=it*U+st*K+gt*Y+P[14],S[15]=lt*U+ft*K+St*Y+P[15]),S}function m(S,P,w){var U=w[0],K=w[1],Y=w[2];return S[0]=P[0]*U,S[1]=P[1]*U,S[2]=P[2]*U,S[3]=P[3]*U,S[4]=P[4]*K,S[5]=P[5]*K,S[6]=P[6]*K,S[7]=P[7]*K,S[8]=P[8]*Y,S[9]=P[9]*Y,S[10]=P[10]*Y,S[11]=P[11]*Y,S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15],S}function T(S,P,w,U){var K=U[0],Y=U[1],k=U[2],rt=Math.hypot(K,Y,k),it,lt,ut,ot,st,ft,vt,mt,gt,St,It,Et,Pt,At,Ct,Gt,Ut,$t,zt,Ht,Kt,Yt,bt,ee;return rt<e.EPSILON?null:(rt=1/rt,K*=rt,Y*=rt,k*=rt,it=Math.sin(w),lt=Math.cos(w),ut=1-lt,ot=P[0],st=P[1],ft=P[2],vt=P[3],mt=P[4],gt=P[5],St=P[6],It=P[7],Et=P[8],Pt=P[9],At=P[10],Ct=P[11],Gt=K*K*ut+lt,Ut=Y*K*ut+k*it,$t=k*K*ut-Y*it,zt=K*Y*ut-k*it,Ht=Y*Y*ut+lt,Kt=k*Y*ut+K*it,Yt=K*k*ut+Y*it,bt=Y*k*ut-K*it,ee=k*k*ut+lt,S[0]=ot*Gt+mt*Ut+Et*$t,S[1]=st*Gt+gt*Ut+Pt*$t,S[2]=ft*Gt+St*Ut+At*$t,S[3]=vt*Gt+It*Ut+Ct*$t,S[4]=ot*zt+mt*Ht+Et*Kt,S[5]=st*zt+gt*Ht+Pt*Kt,S[6]=ft*zt+St*Ht+At*Kt,S[7]=vt*zt+It*Ht+Ct*Kt,S[8]=ot*Yt+mt*bt+Et*ee,S[9]=st*Yt+gt*bt+Pt*ee,S[10]=ft*Yt+St*bt+At*ee,S[11]=vt*Yt+It*bt+Ct*ee,P!==S&&(S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15]),S)}function c(S,P,w){var U=Math.sin(w),K=Math.cos(w),Y=P[4],k=P[5],rt=P[6],it=P[7],lt=P[8],ut=P[9],ot=P[10],st=P[11];return P!==S&&(S[0]=P[0],S[1]=P[1],S[2]=P[2],S[3]=P[3],S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15]),S[4]=Y*K+lt*U,S[5]=k*K+ut*U,S[6]=rt*K+ot*U,S[7]=it*K+st*U,S[8]=lt*K-Y*U,S[9]=ut*K-k*U,S[10]=ot*K-rt*U,S[11]=st*K-it*U,S}function h(S,P,w){var U=Math.sin(w),K=Math.cos(w),Y=P[0],k=P[1],rt=P[2],it=P[3],lt=P[8],ut=P[9],ot=P[10],st=P[11];return P!==S&&(S[4]=P[4],S[5]=P[5],S[6]=P[6],S[7]=P[7],S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15]),S[0]=Y*K-lt*U,S[1]=k*K-ut*U,S[2]=rt*K-ot*U,S[3]=it*K-st*U,S[8]=Y*U+lt*K,S[9]=k*U+ut*K,S[10]=rt*U+ot*K,S[11]=it*U+st*K,S}function u(S,P,w){var U=Math.sin(w),K=Math.cos(w),Y=P[0],k=P[1],rt=P[2],it=P[3],lt=P[4],ut=P[5],ot=P[6],st=P[7];return P!==S&&(S[8]=P[8],S[9]=P[9],S[10]=P[10],S[11]=P[11],S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15]),S[0]=Y*K+lt*U,S[1]=k*K+ut*U,S[2]=rt*K+ot*U,S[3]=it*K+st*U,S[4]=lt*K-Y*U,S[5]=ut*K-k*U,S[6]=ot*K-rt*U,S[7]=st*K-it*U,S}function g(S,P){return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=P[0],S[13]=P[1],S[14]=P[2],S[15]=1,S}function M(S,P){return S[0]=P[0],S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=P[1],S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=P[2],S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function A(S,P,w){var U=w[0],K=w[1],Y=w[2],k=Math.hypot(U,K,Y),rt,it,lt;return k<e.EPSILON?null:(k=1/k,U*=k,K*=k,Y*=k,rt=Math.sin(P),it=Math.cos(P),lt=1-it,S[0]=U*U*lt+it,S[1]=K*U*lt+Y*rt,S[2]=Y*U*lt-K*rt,S[3]=0,S[4]=U*K*lt-Y*rt,S[5]=K*K*lt+it,S[6]=Y*K*lt+U*rt,S[7]=0,S[8]=U*Y*lt+K*rt,S[9]=K*Y*lt-U*rt,S[10]=Y*Y*lt+it,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S)}function I(S,P){var w=Math.sin(P),U=Math.cos(P);return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=U,S[6]=w,S[7]=0,S[8]=0,S[9]=-w,S[10]=U,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function b(S,P){var w=Math.sin(P),U=Math.cos(P);return S[0]=U,S[1]=0,S[2]=-w,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=w,S[9]=0,S[10]=U,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function E(S,P){var w=Math.sin(P),U=Math.cos(P);return S[0]=U,S[1]=w,S[2]=0,S[3]=0,S[4]=-w,S[5]=U,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function L(S,P,w){var U=P[0],K=P[1],Y=P[2],k=P[3],rt=U+U,it=K+K,lt=Y+Y,ut=U*rt,ot=U*it,st=U*lt,ft=K*it,vt=K*lt,mt=Y*lt,gt=k*rt,St=k*it,It=k*lt;return S[0]=1-(ft+mt),S[1]=ot+It,S[2]=st-St,S[3]=0,S[4]=ot-It,S[5]=1-(ut+mt),S[6]=vt+gt,S[7]=0,S[8]=st+St,S[9]=vt-gt,S[10]=1-(ut+ft),S[11]=0,S[12]=w[0],S[13]=w[1],S[14]=w[2],S[15]=1,S}function D(S,P){var w=new e.ARRAY_TYPE(3),U=-P[0],K=-P[1],Y=-P[2],k=P[3],rt=P[4],it=P[5],lt=P[6],ut=P[7],ot=U*U+K*K+Y*Y+k*k;return ot>0?(w[0]=(rt*k+ut*U+it*Y-lt*K)*2/ot,w[1]=(it*k+ut*K+lt*U-rt*Y)*2/ot,w[2]=(lt*k+ut*Y+rt*K-it*U)*2/ot):(w[0]=(rt*k+ut*U+it*Y-lt*K)*2,w[1]=(it*k+ut*K+lt*U-rt*Y)*2,w[2]=(lt*k+ut*Y+rt*K-it*U)*2),L(S,P,w),S}function R(S,P){return S[0]=P[12],S[1]=P[13],S[2]=P[14],S}function C(S,P){var w=P[0],U=P[1],K=P[2],Y=P[4],k=P[5],rt=P[6],it=P[8],lt=P[9],ut=P[10];return S[0]=Math.hypot(w,U,K),S[1]=Math.hypot(Y,k,rt),S[2]=Math.hypot(it,lt,ut),S}function W(S,P){var w=new e.ARRAY_TYPE(3);C(w,P);var U=1/w[0],K=1/w[1],Y=1/w[2],k=P[0]*U,rt=P[1]*K,it=P[2]*Y,lt=P[4]*U,ut=P[5]*K,ot=P[6]*Y,st=P[8]*U,ft=P[9]*K,vt=P[10]*Y,mt=k+ut+vt,gt=0;return mt>0?(gt=Math.sqrt(mt+1)*2,S[3]=.25*gt,S[0]=(ot-ft)/gt,S[1]=(st-it)/gt,S[2]=(rt-lt)/gt):k>ut&&k>vt?(gt=Math.sqrt(1+k-ut-vt)*2,S[3]=(ot-ft)/gt,S[0]=.25*gt,S[1]=(rt+lt)/gt,S[2]=(st+it)/gt):ut>vt?(gt=Math.sqrt(1+ut-k-vt)*2,S[3]=(st-it)/gt,S[0]=(rt+lt)/gt,S[1]=.25*gt,S[2]=(ot+ft)/gt):(gt=Math.sqrt(1+vt-k-ut)*2,S[3]=(rt-lt)/gt,S[0]=(st+it)/gt,S[1]=(ot+ft)/gt,S[2]=.25*gt),S}function z(S,P,w,U){var K=P[0],Y=P[1],k=P[2],rt=P[3],it=K+K,lt=Y+Y,ut=k+k,ot=K*it,st=K*lt,ft=K*ut,vt=Y*lt,mt=Y*ut,gt=k*ut,St=rt*it,It=rt*lt,Et=rt*ut,Pt=U[0],At=U[1],Ct=U[2];return S[0]=(1-(vt+gt))*Pt,S[1]=(st+Et)*Pt,S[2]=(ft-It)*Pt,S[3]=0,S[4]=(st-Et)*At,S[5]=(1-(ot+gt))*At,S[6]=(mt+St)*At,S[7]=0,S[8]=(ft+It)*Ct,S[9]=(mt-St)*Ct,S[10]=(1-(ot+vt))*Ct,S[11]=0,S[12]=w[0],S[13]=w[1],S[14]=w[2],S[15]=1,S}function H(S,P,w,U,K){var Y=P[0],k=P[1],rt=P[2],it=P[3],lt=Y+Y,ut=k+k,ot=rt+rt,st=Y*lt,ft=Y*ut,vt=Y*ot,mt=k*ut,gt=k*ot,St=rt*ot,It=it*lt,Et=it*ut,Pt=it*ot,At=U[0],Ct=U[1],Gt=U[2],Ut=K[0],$t=K[1],zt=K[2],Ht=(1-(mt+St))*At,Kt=(ft+Pt)*At,Yt=(vt-Et)*At,bt=(ft-Pt)*Ct,ee=(1-(st+St))*Ct,De=(gt+It)*Ct,we=(vt+Et)*Gt,_n=(gt-It)*Gt,ti=(1-(st+mt))*Gt;return S[0]=Ht,S[1]=Kt,S[2]=Yt,S[3]=0,S[4]=bt,S[5]=ee,S[6]=De,S[7]=0,S[8]=we,S[9]=_n,S[10]=ti,S[11]=0,S[12]=w[0]+Ut-(Ht*Ut+bt*$t+we*zt),S[13]=w[1]+$t-(Kt*Ut+ee*$t+_n*zt),S[14]=w[2]+zt-(Yt*Ut+De*$t+ti*zt),S[15]=1,S}function X(S,P){var w=P[0],U=P[1],K=P[2],Y=P[3],k=w+w,rt=U+U,it=K+K,lt=w*k,ut=U*k,ot=U*rt,st=K*k,ft=K*rt,vt=K*it,mt=Y*k,gt=Y*rt,St=Y*it;return S[0]=1-ot-vt,S[1]=ut+St,S[2]=st-gt,S[3]=0,S[4]=ut-St,S[5]=1-lt-vt,S[6]=ft+mt,S[7]=0,S[8]=st+gt,S[9]=ft-mt,S[10]=1-lt-ot,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function Z(S,P,w,U,K,Y,k){var rt=1/(w-P),it=1/(K-U),lt=1/(Y-k);return S[0]=Y*2*rt,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=Y*2*it,S[6]=0,S[7]=0,S[8]=(w+P)*rt,S[9]=(K+U)*it,S[10]=(k+Y)*lt,S[11]=-1,S[12]=0,S[13]=0,S[14]=k*Y*2*lt,S[15]=0,S}function j(S,P,w,U,K){var Y=1/Math.tan(P/2),k;return S[0]=Y/w,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=Y,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=-1,S[12]=0,S[13]=0,S[15]=0,K!=null&&K!==1/0?(k=1/(U-K),S[10]=(K+U)*k,S[14]=2*K*U*k):(S[10]=-1,S[14]=-2*U),S}function G(S,P,w,U){var K=Math.tan(P.upDegrees*Math.PI/180),Y=Math.tan(P.downDegrees*Math.PI/180),k=Math.tan(P.leftDegrees*Math.PI/180),rt=Math.tan(P.rightDegrees*Math.PI/180),it=2/(k+rt),lt=2/(K+Y);return S[0]=it,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=lt,S[6]=0,S[7]=0,S[8]=-((k-rt)*it*.5),S[9]=(K-Y)*lt*.5,S[10]=U/(w-U),S[11]=-1,S[12]=0,S[13]=0,S[14]=U*w/(w-U),S[15]=0,S}function Q(S,P,w,U,K,Y,k){var rt=1/(P-w),it=1/(U-K),lt=1/(Y-k);return S[0]=-2*rt,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=-2*it,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=2*lt,S[11]=0,S[12]=(P+w)*rt,S[13]=(K+U)*it,S[14]=(k+Y)*lt,S[15]=1,S}function tt(S,P,w,U){var K,Y,k,rt,it,lt,ut,ot,st,ft,vt=P[0],mt=P[1],gt=P[2],St=U[0],It=U[1],Et=U[2],Pt=w[0],At=w[1],Ct=w[2];return Math.abs(vt-Pt)<e.EPSILON&&Math.abs(mt-At)<e.EPSILON&&Math.abs(gt-Ct)<e.EPSILON?f(S):(ut=vt-Pt,ot=mt-At,st=gt-Ct,ft=1/Math.hypot(ut,ot,st),ut*=ft,ot*=ft,st*=ft,K=It*st-Et*ot,Y=Et*ut-St*st,k=St*ot-It*ut,ft=Math.hypot(K,Y,k),ft?(ft=1/ft,K*=ft,Y*=ft,k*=ft):(K=0,Y=0,k=0),rt=ot*k-st*Y,it=st*K-ut*k,lt=ut*Y-ot*K,ft=Math.hypot(rt,it,lt),ft?(ft=1/ft,rt*=ft,it*=ft,lt*=ft):(rt=0,it=0,lt=0),S[0]=K,S[1]=rt,S[2]=ut,S[3]=0,S[4]=Y,S[5]=it,S[6]=ot,S[7]=0,S[8]=k,S[9]=lt,S[10]=st,S[11]=0,S[12]=-(K*vt+Y*mt+k*gt),S[13]=-(rt*vt+it*mt+lt*gt),S[14]=-(ut*vt+ot*mt+st*gt),S[15]=1,S)}function et(S,P,w,U){var K=P[0],Y=P[1],k=P[2],rt=U[0],it=U[1],lt=U[2],ut=K-w[0],ot=Y-w[1],st=k-w[2],ft=ut*ut+ot*ot+st*st;ft>0&&(ft=1/Math.sqrt(ft),ut*=ft,ot*=ft,st*=ft);var vt=it*st-lt*ot,mt=lt*ut-rt*st,gt=rt*ot-it*ut;return ft=vt*vt+mt*mt+gt*gt,ft>0&&(ft=1/Math.sqrt(ft),vt*=ft,mt*=ft,gt*=ft),S[0]=vt,S[1]=mt,S[2]=gt,S[3]=0,S[4]=ot*gt-st*mt,S[5]=st*vt-ut*gt,S[6]=ut*mt-ot*vt,S[7]=0,S[8]=ut,S[9]=ot,S[10]=st,S[11]=0,S[12]=K,S[13]=Y,S[14]=k,S[15]=1,S}function at(S){return"mat4("+S[0]+", "+S[1]+", "+S[2]+", "+S[3]+", "+S[4]+", "+S[5]+", "+S[6]+", "+S[7]+", "+S[8]+", "+S[9]+", "+S[10]+", "+S[11]+", "+S[12]+", "+S[13]+", "+S[14]+", "+S[15]+")"}function q(S){return Math.hypot(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[8],S[9],S[10],S[11],S[12],S[13],S[14],S[15])}function pt(S,P,w){return S[0]=P[0]+w[0],S[1]=P[1]+w[1],S[2]=P[2]+w[2],S[3]=P[3]+w[3],S[4]=P[4]+w[4],S[5]=P[5]+w[5],S[6]=P[6]+w[6],S[7]=P[7]+w[7],S[8]=P[8]+w[8],S[9]=P[9]+w[9],S[10]=P[10]+w[10],S[11]=P[11]+w[11],S[12]=P[12]+w[12],S[13]=P[13]+w[13],S[14]=P[14]+w[14],S[15]=P[15]+w[15],S}function dt(S,P,w){return S[0]=P[0]-w[0],S[1]=P[1]-w[1],S[2]=P[2]-w[2],S[3]=P[3]-w[3],S[4]=P[4]-w[4],S[5]=P[5]-w[5],S[6]=P[6]-w[6],S[7]=P[7]-w[7],S[8]=P[8]-w[8],S[9]=P[9]-w[9],S[10]=P[10]-w[10],S[11]=P[11]-w[11],S[12]=P[12]-w[12],S[13]=P[13]-w[13],S[14]=P[14]-w[14],S[15]=P[15]-w[15],S}function B(S,P,w){return S[0]=P[0]*w,S[1]=P[1]*w,S[2]=P[2]*w,S[3]=P[3]*w,S[4]=P[4]*w,S[5]=P[5]*w,S[6]=P[6]*w,S[7]=P[7]*w,S[8]=P[8]*w,S[9]=P[9]*w,S[10]=P[10]*w,S[11]=P[11]*w,S[12]=P[12]*w,S[13]=P[13]*w,S[14]=P[14]*w,S[15]=P[15]*w,S}function F(S,P,w,U){return S[0]=P[0]+w[0]*U,S[1]=P[1]+w[1]*U,S[2]=P[2]+w[2]*U,S[3]=P[3]+w[3]*U,S[4]=P[4]+w[4]*U,S[5]=P[5]+w[5]*U,S[6]=P[6]+w[6]*U,S[7]=P[7]+w[7]*U,S[8]=P[8]+w[8]*U,S[9]=P[9]+w[9]*U,S[10]=P[10]+w[10]*U,S[11]=P[11]+w[11]*U,S[12]=P[12]+w[12]*U,S[13]=P[13]+w[13]*U,S[14]=P[14]+w[14]*U,S[15]=P[15]+w[15]*U,S}function V(S,P){return S[0]===P[0]&&S[1]===P[1]&&S[2]===P[2]&&S[3]===P[3]&&S[4]===P[4]&&S[5]===P[5]&&S[6]===P[6]&&S[7]===P[7]&&S[8]===P[8]&&S[9]===P[9]&&S[10]===P[10]&&S[11]===P[11]&&S[12]===P[12]&&S[13]===P[13]&&S[14]===P[14]&&S[15]===P[15]}function J(S,P){var w=S[0],U=S[1],K=S[2],Y=S[3],k=S[4],rt=S[5],it=S[6],lt=S[7],ut=S[8],ot=S[9],st=S[10],ft=S[11],vt=S[12],mt=S[13],gt=S[14],St=S[15],It=P[0],Et=P[1],Pt=P[2],At=P[3],Ct=P[4],Gt=P[5],Ut=P[6],$t=P[7],zt=P[8],Ht=P[9],Kt=P[10],Yt=P[11],bt=P[12],ee=P[13],De=P[14],we=P[15];return Math.abs(w-It)<=e.EPSILON*Math.max(1,Math.abs(w),Math.abs(It))&&Math.abs(U-Et)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(Et))&&Math.abs(K-Pt)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(Pt))&&Math.abs(Y-At)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(At))&&Math.abs(k-Ct)<=e.EPSILON*Math.max(1,Math.abs(k),Math.abs(Ct))&&Math.abs(rt-Gt)<=e.EPSILON*Math.max(1,Math.abs(rt),Math.abs(Gt))&&Math.abs(it-Ut)<=e.EPSILON*Math.max(1,Math.abs(it),Math.abs(Ut))&&Math.abs(lt-$t)<=e.EPSILON*Math.max(1,Math.abs(lt),Math.abs($t))&&Math.abs(ut-zt)<=e.EPSILON*Math.max(1,Math.abs(ut),Math.abs(zt))&&Math.abs(ot-Ht)<=e.EPSILON*Math.max(1,Math.abs(ot),Math.abs(Ht))&&Math.abs(st-Kt)<=e.EPSILON*Math.max(1,Math.abs(st),Math.abs(Kt))&&Math.abs(ft-Yt)<=e.EPSILON*Math.max(1,Math.abs(ft),Math.abs(Yt))&&Math.abs(vt-bt)<=e.EPSILON*Math.max(1,Math.abs(vt),Math.abs(bt))&&Math.abs(mt-ee)<=e.EPSILON*Math.max(1,Math.abs(mt),Math.abs(ee))&&Math.abs(gt-De)<=e.EPSILON*Math.max(1,Math.abs(gt),Math.abs(De))&&Math.abs(St-we)<=e.EPSILON*Math.max(1,Math.abs(St),Math.abs(we))}var N=O,$=dt},function(d,r,t){t.r(r),t.d(r,"create",function(){return s}),t.d(r,"identity",function(){return o}),t.d(r,"setAxisAngle",function(){return f}),t.d(r,"getAxisAngle",function(){return v}),t.d(r,"getAngle",function(){return l}),t.d(r,"multiply",function(){return p}),t.d(r,"rotateX",function(){return y}),t.d(r,"rotateY",function(){return O}),t.d(r,"rotateZ",function(){return x}),t.d(r,"calculateW",function(){return m}),t.d(r,"exp",function(){return T}),t.d(r,"ln",function(){return c}),t.d(r,"pow",function(){return h}),t.d(r,"slerp",function(){return u}),t.d(r,"random",function(){return g}),t.d(r,"invert",function(){return M}),t.d(r,"conjugate",function(){return A}),t.d(r,"fromMat3",function(){return I}),t.d(r,"fromEuler",function(){return b}),t.d(r,"str",function(){return E}),t.d(r,"clone",function(){return L}),t.d(r,"fromValues",function(){return D}),t.d(r,"copy",function(){return R}),t.d(r,"set",function(){return C}),t.d(r,"add",function(){return W}),t.d(r,"mul",function(){return z}),t.d(r,"scale",function(){return H}),t.d(r,"dot",function(){return X}),t.d(r,"lerp",function(){return Z}),t.d(r,"length",function(){return j}),t.d(r,"len",function(){return G}),t.d(r,"squaredLength",function(){return Q}),t.d(r,"sqrLen",function(){return tt}),t.d(r,"normalize",function(){return et}),t.d(r,"exactEquals",function(){return at}),t.d(r,"equals",function(){return q}),t.d(r,"rotationTo",function(){return pt}),t.d(r,"sqlerp",function(){return dt}),t.d(r,"setAxes",function(){return B});var e=t(2),n=t(5),i=t(8),a=t(9);function s(){var F=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0),F[3]=1,F}function o(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F}function f(F,V,J){J=J*.5;var N=Math.sin(J);return F[0]=N*V[0],F[1]=N*V[1],F[2]=N*V[2],F[3]=Math.cos(J),F}function v(F,V){var J=Math.acos(V[3])*2,N=Math.sin(J/2);return N>e.EPSILON?(F[0]=V[0]/N,F[1]=V[1]/N,F[2]=V[2]/N):(F[0]=1,F[1]=0,F[2]=0),J}function l(F,V){var J=X(F,V);return Math.acos(2*J*J-1)}function p(F,V,J){var N=V[0],$=V[1],S=V[2],P=V[3],w=J[0],U=J[1],K=J[2],Y=J[3];return F[0]=N*Y+P*w+$*K-S*U,F[1]=$*Y+P*U+S*w-N*K,F[2]=S*Y+P*K+N*U-$*w,F[3]=P*Y-N*w-$*U-S*K,F}function y(F,V,J){J*=.5;var N=V[0],$=V[1],S=V[2],P=V[3],w=Math.sin(J),U=Math.cos(J);return F[0]=N*U+P*w,F[1]=$*U+S*w,F[2]=S*U-$*w,F[3]=P*U-N*w,F}function O(F,V,J){J*=.5;var N=V[0],$=V[1],S=V[2],P=V[3],w=Math.sin(J),U=Math.cos(J);return F[0]=N*U-S*w,F[1]=$*U+P*w,F[2]=S*U+N*w,F[3]=P*U-$*w,F}function x(F,V,J){J*=.5;var N=V[0],$=V[1],S=V[2],P=V[3],w=Math.sin(J),U=Math.cos(J);return F[0]=N*U+$*w,F[1]=$*U-N*w,F[2]=S*U+P*w,F[3]=P*U-S*w,F}function m(F,V){var J=V[0],N=V[1],$=V[2];return F[0]=J,F[1]=N,F[2]=$,F[3]=Math.sqrt(Math.abs(1-J*J-N*N-$*$)),F}function T(F,V){var J=V[0],N=V[1],$=V[2],S=V[3],P=Math.sqrt(J*J+N*N+$*$),w=Math.exp(S),U=P>0?w*Math.sin(P)/P:0;return F[0]=J*U,F[1]=N*U,F[2]=$*U,F[3]=w*Math.cos(P),F}function c(F,V){var J=V[0],N=V[1],$=V[2],S=V[3],P=Math.sqrt(J*J+N*N+$*$),w=P>0?Math.atan2(P,S)/P:0;return F[0]=J*w,F[1]=N*w,F[2]=$*w,F[3]=.5*Math.log(J*J+N*N+$*$+S*S),F}function h(F,V,J){return c(F,V),H(F,F,J),T(F,F),F}function u(F,V,J,N){var $=V[0],S=V[1],P=V[2],w=V[3],U=J[0],K=J[1],Y=J[2],k=J[3],rt,it,lt,ut,ot;return it=$*U+S*K+P*Y+w*k,it<0&&(it=-it,U=-U,K=-K,Y=-Y,k=-k),1-it>e.EPSILON?(rt=Math.acos(it),lt=Math.sin(rt),ut=Math.sin((1-N)*rt)/lt,ot=Math.sin(N*rt)/lt):(ut=1-N,ot=N),F[0]=ut*$+ot*U,F[1]=ut*S+ot*K,F[2]=ut*P+ot*Y,F[3]=ut*w+ot*k,F}function g(F){var V=e.RANDOM(),J=e.RANDOM(),N=e.RANDOM(),$=Math.sqrt(1-V),S=Math.sqrt(V);return F[0]=$*Math.sin(2*Math.PI*J),F[1]=$*Math.cos(2*Math.PI*J),F[2]=S*Math.sin(2*Math.PI*N),F[3]=S*Math.cos(2*Math.PI*N),F}function M(F,V){var J=V[0],N=V[1],$=V[2],S=V[3],P=J*J+N*N+$*$+S*S,w=P?1/P:0;return F[0]=-J*w,F[1]=-N*w,F[2]=-$*w,F[3]=S*w,F}function A(F,V){return F[0]=-V[0],F[1]=-V[1],F[2]=-V[2],F[3]=V[3],F}function I(F,V){var J=V[0]+V[4]+V[8],N;if(J>0)N=Math.sqrt(J+1),F[3]=.5*N,N=.5/N,F[0]=(V[5]-V[7])*N,F[1]=(V[6]-V[2])*N,F[2]=(V[1]-V[3])*N;else{var $=0;V[4]>V[0]&&($=1),V[8]>V[$*3+$]&&($=2);var S=($+1)%3,P=($+2)%3;N=Math.sqrt(V[$*3+$]-V[S*3+S]-V[P*3+P]+1),F[$]=.5*N,N=.5/N,F[3]=(V[S*3+P]-V[P*3+S])*N,F[S]=(V[S*3+$]+V[$*3+S])*N,F[P]=(V[P*3+$]+V[$*3+P])*N}return F}function b(F,V,J,N){var $=.5*Math.PI/180;V*=$,J*=$,N*=$;var S=Math.sin(V),P=Math.cos(V),w=Math.sin(J),U=Math.cos(J),K=Math.sin(N),Y=Math.cos(N);return F[0]=S*U*Y-P*w*K,F[1]=P*w*Y+S*U*K,F[2]=P*U*K-S*w*Y,F[3]=P*U*Y+S*w*K,F}function E(F){return"quat("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+")"}var L=a.clone,D=a.fromValues,R=a.copy,C=a.set,W=a.add,z=p,H=a.scale,X=a.dot,Z=a.lerp,j=a.length,G=j,Q=a.squaredLength,tt=Q,et=a.normalize,at=a.exactEquals,q=a.equals,pt=function(){var F=i.create(),V=i.fromValues(1,0,0),J=i.fromValues(0,1,0);return function(N,$,S){var P=i.dot($,S);return P<-.999999?(i.cross(F,V,$),i.len(F)<1e-6&&i.cross(F,J,$),i.normalize(F,F),f(N,F,Math.PI),N):P>.999999?(N[0]=0,N[1]=0,N[2]=0,N[3]=1,N):(i.cross(F,$,S),N[0]=F[0],N[1]=F[1],N[2]=F[2],N[3]=1+P,et(N,N))}}(),dt=function(){var F=s(),V=s();return function(J,N,$,S,P,w){return u(F,N,P,w),u(V,$,S,w),u(J,F,V,2*w*(1-w)),J}}(),B=function(){var F=n.create();return function(V,J,N,$){return F[0]=N[0],F[3]=N[1],F[6]=N[2],F[1]=$[0],F[4]=$[1],F[7]=$[2],F[2]=-J[0],F[5]=-J[1],F[8]=-J[2],et(V,I(V,F))}}()},function(d,r,t){t.r(r),t.d(r,"create",function(){return n}),t.d(r,"clone",function(){return i}),t.d(r,"length",function(){return a}),t.d(r,"fromValues",function(){return s}),t.d(r,"copy",function(){return o}),t.d(r,"set",function(){return f}),t.d(r,"add",function(){return v}),t.d(r,"subtract",function(){return l}),t.d(r,"multiply",function(){return p}),t.d(r,"divide",function(){return y}),t.d(r,"ceil",function(){return O}),t.d(r,"floor",function(){return x}),t.d(r,"min",function(){return m}),t.d(r,"max",function(){return T}),t.d(r,"round",function(){return c}),t.d(r,"scale",function(){return h}),t.d(r,"scaleAndAdd",function(){return u}),t.d(r,"distance",function(){return g}),t.d(r,"squaredDistance",function(){return M}),t.d(r,"squaredLength",function(){return A}),t.d(r,"negate",function(){return I}),t.d(r,"inverse",function(){return b}),t.d(r,"normalize",function(){return E}),t.d(r,"dot",function(){return L}),t.d(r,"cross",function(){return D}),t.d(r,"lerp",function(){return R}),t.d(r,"hermite",function(){return C}),t.d(r,"bezier",function(){return W}),t.d(r,"random",function(){return z}),t.d(r,"transformMat4",function(){return H}),t.d(r,"transformMat3",function(){return X}),t.d(r,"transformQuat",function(){return Z}),t.d(r,"rotateX",function(){return j}),t.d(r,"rotateY",function(){return G}),t.d(r,"rotateZ",function(){return Q}),t.d(r,"angle",function(){return tt}),t.d(r,"zero",function(){return et}),t.d(r,"str",function(){return at}),t.d(r,"exactEquals",function(){return q}),t.d(r,"equals",function(){return pt}),t.d(r,"sub",function(){return dt}),t.d(r,"mul",function(){return B}),t.d(r,"div",function(){return F}),t.d(r,"dist",function(){return V}),t.d(r,"sqrDist",function(){return J}),t.d(r,"len",function(){return N}),t.d(r,"sqrLen",function(){return $}),t.d(r,"forEach",function(){return S});var e=t(2);function n(){var P=new e.ARRAY_TYPE(3);return e.ARRAY_TYPE!=Float32Array&&(P[0]=0,P[1]=0,P[2]=0),P}function i(P){var w=new e.ARRAY_TYPE(3);return w[0]=P[0],w[1]=P[1],w[2]=P[2],w}function a(P){var w=P[0],U=P[1],K=P[2];return Math.hypot(w,U,K)}function s(P,w,U){var K=new e.ARRAY_TYPE(3);return K[0]=P,K[1]=w,K[2]=U,K}function o(P,w){return P[0]=w[0],P[1]=w[1],P[2]=w[2],P}function f(P,w,U,K){return P[0]=w,P[1]=U,P[2]=K,P}function v(P,w,U){return P[0]=w[0]+U[0],P[1]=w[1]+U[1],P[2]=w[2]+U[2],P}function l(P,w,U){return P[0]=w[0]-U[0],P[1]=w[1]-U[1],P[2]=w[2]-U[2],P}function p(P,w,U){return P[0]=w[0]*U[0],P[1]=w[1]*U[1],P[2]=w[2]*U[2],P}function y(P,w,U){return P[0]=w[0]/U[0],P[1]=w[1]/U[1],P[2]=w[2]/U[2],P}function O(P,w){return P[0]=Math.ceil(w[0]),P[1]=Math.ceil(w[1]),P[2]=Math.ceil(w[2]),P}function x(P,w){return P[0]=Math.floor(w[0]),P[1]=Math.floor(w[1]),P[2]=Math.floor(w[2]),P}function m(P,w,U){return P[0]=Math.min(w[0],U[0]),P[1]=Math.min(w[1],U[1]),P[2]=Math.min(w[2],U[2]),P}function T(P,w,U){return P[0]=Math.max(w[0],U[0]),P[1]=Math.max(w[1],U[1]),P[2]=Math.max(w[2],U[2]),P}function c(P,w){return P[0]=Math.round(w[0]),P[1]=Math.round(w[1]),P[2]=Math.round(w[2]),P}function h(P,w,U){return P[0]=w[0]*U,P[1]=w[1]*U,P[2]=w[2]*U,P}function u(P,w,U,K){return P[0]=w[0]+U[0]*K,P[1]=w[1]+U[1]*K,P[2]=w[2]+U[2]*K,P}function g(P,w){var U=w[0]-P[0],K=w[1]-P[1],Y=w[2]-P[2];return Math.hypot(U,K,Y)}function M(P,w){var U=w[0]-P[0],K=w[1]-P[1],Y=w[2]-P[2];return U*U+K*K+Y*Y}function A(P){var w=P[0],U=P[1],K=P[2];return w*w+U*U+K*K}function I(P,w){return P[0]=-w[0],P[1]=-w[1],P[2]=-w[2],P}function b(P,w){return P[0]=1/w[0],P[1]=1/w[1],P[2]=1/w[2],P}function E(P,w){var U=w[0],K=w[1],Y=w[2],k=U*U+K*K+Y*Y;return k>0&&(k=1/Math.sqrt(k)),P[0]=w[0]*k,P[1]=w[1]*k,P[2]=w[2]*k,P}function L(P,w){return P[0]*w[0]+P[1]*w[1]+P[2]*w[2]}function D(P,w,U){var K=w[0],Y=w[1],k=w[2],rt=U[0],it=U[1],lt=U[2];return P[0]=Y*lt-k*it,P[1]=k*rt-K*lt,P[2]=K*it-Y*rt,P}function R(P,w,U,K){var Y=w[0],k=w[1],rt=w[2];return P[0]=Y+K*(U[0]-Y),P[1]=k+K*(U[1]-k),P[2]=rt+K*(U[2]-rt),P}function C(P,w,U,K,Y,k){var rt=k*k,it=rt*(2*k-3)+1,lt=rt*(k-2)+k,ut=rt*(k-1),ot=rt*(3-2*k);return P[0]=w[0]*it+U[0]*lt+K[0]*ut+Y[0]*ot,P[1]=w[1]*it+U[1]*lt+K[1]*ut+Y[1]*ot,P[2]=w[2]*it+U[2]*lt+K[2]*ut+Y[2]*ot,P}function W(P,w,U,K,Y,k){var rt=1-k,it=rt*rt,lt=k*k,ut=it*rt,ot=3*k*it,st=3*lt*rt,ft=lt*k;return P[0]=w[0]*ut+U[0]*ot+K[0]*st+Y[0]*ft,P[1]=w[1]*ut+U[1]*ot+K[1]*st+Y[1]*ft,P[2]=w[2]*ut+U[2]*ot+K[2]*st+Y[2]*ft,P}function z(P,w){w=w||1;var U=e.RANDOM()*2*Math.PI,K=e.RANDOM()*2-1,Y=Math.sqrt(1-K*K)*w;return P[0]=Math.cos(U)*Y,P[1]=Math.sin(U)*Y,P[2]=K*w,P}function H(P,w,U){var K=w[0],Y=w[1],k=w[2],rt=U[3]*K+U[7]*Y+U[11]*k+U[15];return rt=rt||1,P[0]=(U[0]*K+U[4]*Y+U[8]*k+U[12])/rt,P[1]=(U[1]*K+U[5]*Y+U[9]*k+U[13])/rt,P[2]=(U[2]*K+U[6]*Y+U[10]*k+U[14])/rt,P}function X(P,w,U){var K=w[0],Y=w[1],k=w[2];return P[0]=K*U[0]+Y*U[3]+k*U[6],P[1]=K*U[1]+Y*U[4]+k*U[7],P[2]=K*U[2]+Y*U[5]+k*U[8],P}function Z(P,w,U){var K=U[0],Y=U[1],k=U[2],rt=U[3],it=w[0],lt=w[1],ut=w[2],ot=Y*ut-k*lt,st=k*it-K*ut,ft=K*lt-Y*it,vt=Y*ft-k*st,mt=k*ot-K*ft,gt=K*st-Y*ot,St=rt*2;return ot*=St,st*=St,ft*=St,vt*=2,mt*=2,gt*=2,P[0]=it+ot+vt,P[1]=lt+st+mt,P[2]=ut+ft+gt,P}function j(P,w,U,K){var Y=[],k=[];return Y[0]=w[0]-U[0],Y[1]=w[1]-U[1],Y[2]=w[2]-U[2],k[0]=Y[0],k[1]=Y[1]*Math.cos(K)-Y[2]*Math.sin(K),k[2]=Y[1]*Math.sin(K)+Y[2]*Math.cos(K),P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P}function G(P,w,U,K){var Y=[],k=[];return Y[0]=w[0]-U[0],Y[1]=w[1]-U[1],Y[2]=w[2]-U[2],k[0]=Y[2]*Math.sin(K)+Y[0]*Math.cos(K),k[1]=Y[1],k[2]=Y[2]*Math.cos(K)-Y[0]*Math.sin(K),P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P}function Q(P,w,U,K){var Y=[],k=[];return Y[0]=w[0]-U[0],Y[1]=w[1]-U[1],Y[2]=w[2]-U[2],k[0]=Y[0]*Math.cos(K)-Y[1]*Math.sin(K),k[1]=Y[0]*Math.sin(K)+Y[1]*Math.cos(K),k[2]=Y[2],P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P}function tt(P,w){var U=P[0],K=P[1],Y=P[2],k=w[0],rt=w[1],it=w[2],lt=Math.sqrt(U*U+K*K+Y*Y),ut=Math.sqrt(k*k+rt*rt+it*it),ot=lt*ut,st=ot&&L(P,w)/ot;return Math.acos(Math.min(Math.max(st,-1),1))}function et(P){return P[0]=0,P[1]=0,P[2]=0,P}function at(P){return"vec3("+P[0]+", "+P[1]+", "+P[2]+")"}function q(P,w){return P[0]===w[0]&&P[1]===w[1]&&P[2]===w[2]}function pt(P,w){var U=P[0],K=P[1],Y=P[2],k=w[0],rt=w[1],it=w[2];return Math.abs(U-k)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(k))&&Math.abs(K-rt)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(rt))&&Math.abs(Y-it)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(it))}var dt=l,B=p,F=y,V=g,J=M,N=a,$=A,S=function(){var P=n();return function(w,U,K,Y,k,rt){var it,lt;for(U||(U=3),K||(K=0),Y?lt=Math.min(Y*U+K,w.length):lt=w.length,it=K;it<lt;it+=U)P[0]=w[it],P[1]=w[it+1],P[2]=w[it+2],k(P,P,rt),w[it]=P[0],w[it+1]=P[1],w[it+2]=P[2];return w}}()},function(d,r,t){t.r(r),t.d(r,"create",function(){return n}),t.d(r,"clone",function(){return i}),t.d(r,"fromValues",function(){return a}),t.d(r,"copy",function(){return s}),t.d(r,"set",function(){return o}),t.d(r,"add",function(){return f}),t.d(r,"subtract",function(){return v}),t.d(r,"multiply",function(){return l}),t.d(r,"divide",function(){return p}),t.d(r,"ceil",function(){return y}),t.d(r,"floor",function(){return O}),t.d(r,"min",function(){return x}),t.d(r,"max",function(){return m}),t.d(r,"round",function(){return T}),t.d(r,"scale",function(){return c}),t.d(r,"scaleAndAdd",function(){return h}),t.d(r,"distance",function(){return u}),t.d(r,"squaredDistance",function(){return g}),t.d(r,"length",function(){return M}),t.d(r,"squaredLength",function(){return A}),t.d(r,"negate",function(){return I}),t.d(r,"inverse",function(){return b}),t.d(r,"normalize",function(){return E}),t.d(r,"dot",function(){return L}),t.d(r,"cross",function(){return D}),t.d(r,"lerp",function(){return R}),t.d(r,"random",function(){return C}),t.d(r,"transformMat4",function(){return W}),t.d(r,"transformQuat",function(){return z}),t.d(r,"zero",function(){return H}),t.d(r,"str",function(){return X}),t.d(r,"exactEquals",function(){return Z}),t.d(r,"equals",function(){return j}),t.d(r,"sub",function(){return G}),t.d(r,"mul",function(){return Q}),t.d(r,"div",function(){return tt}),t.d(r,"dist",function(){return et}),t.d(r,"sqrDist",function(){return at}),t.d(r,"len",function(){return q}),t.d(r,"sqrLen",function(){return pt}),t.d(r,"forEach",function(){return dt});var e=t(2);function n(){var B=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(B[0]=0,B[1]=0,B[2]=0,B[3]=0),B}function i(B){var F=new e.ARRAY_TYPE(4);return F[0]=B[0],F[1]=B[1],F[2]=B[2],F[3]=B[3],F}function a(B,F,V,J){var N=new e.ARRAY_TYPE(4);return N[0]=B,N[1]=F,N[2]=V,N[3]=J,N}function s(B,F){return B[0]=F[0],B[1]=F[1],B[2]=F[2],B[3]=F[3],B}function o(B,F,V,J,N){return B[0]=F,B[1]=V,B[2]=J,B[3]=N,B}function f(B,F,V){return B[0]=F[0]+V[0],B[1]=F[1]+V[1],B[2]=F[2]+V[2],B[3]=F[3]+V[3],B}function v(B,F,V){return B[0]=F[0]-V[0],B[1]=F[1]-V[1],B[2]=F[2]-V[2],B[3]=F[3]-V[3],B}function l(B,F,V){return B[0]=F[0]*V[0],B[1]=F[1]*V[1],B[2]=F[2]*V[2],B[3]=F[3]*V[3],B}function p(B,F,V){return B[0]=F[0]/V[0],B[1]=F[1]/V[1],B[2]=F[2]/V[2],B[3]=F[3]/V[3],B}function y(B,F){return B[0]=Math.ceil(F[0]),B[1]=Math.ceil(F[1]),B[2]=Math.ceil(F[2]),B[3]=Math.ceil(F[3]),B}function O(B,F){return B[0]=Math.floor(F[0]),B[1]=Math.floor(F[1]),B[2]=Math.floor(F[2]),B[3]=Math.floor(F[3]),B}function x(B,F,V){return B[0]=Math.min(F[0],V[0]),B[1]=Math.min(F[1],V[1]),B[2]=Math.min(F[2],V[2]),B[3]=Math.min(F[3],V[3]),B}function m(B,F,V){return B[0]=Math.max(F[0],V[0]),B[1]=Math.max(F[1],V[1]),B[2]=Math.max(F[2],V[2]),B[3]=Math.max(F[3],V[3]),B}function T(B,F){return B[0]=Math.round(F[0]),B[1]=Math.round(F[1]),B[2]=Math.round(F[2]),B[3]=Math.round(F[3]),B}function c(B,F,V){return B[0]=F[0]*V,B[1]=F[1]*V,B[2]=F[2]*V,B[3]=F[3]*V,B}function h(B,F,V,J){return B[0]=F[0]+V[0]*J,B[1]=F[1]+V[1]*J,B[2]=F[2]+V[2]*J,B[3]=F[3]+V[3]*J,B}function u(B,F){var V=F[0]-B[0],J=F[1]-B[1],N=F[2]-B[2],$=F[3]-B[3];return Math.hypot(V,J,N,$)}function g(B,F){var V=F[0]-B[0],J=F[1]-B[1],N=F[2]-B[2],$=F[3]-B[3];return V*V+J*J+N*N+$*$}function M(B){var F=B[0],V=B[1],J=B[2],N=B[3];return Math.hypot(F,V,J,N)}function A(B){var F=B[0],V=B[1],J=B[2],N=B[3];return F*F+V*V+J*J+N*N}function I(B,F){return B[0]=-F[0],B[1]=-F[1],B[2]=-F[2],B[3]=-F[3],B}function b(B,F){return B[0]=1/F[0],B[1]=1/F[1],B[2]=1/F[2],B[3]=1/F[3],B}function E(B,F){var V=F[0],J=F[1],N=F[2],$=F[3],S=V*V+J*J+N*N+$*$;return S>0&&(S=1/Math.sqrt(S)),B[0]=V*S,B[1]=J*S,B[2]=N*S,B[3]=$*S,B}function L(B,F){return B[0]*F[0]+B[1]*F[1]+B[2]*F[2]+B[3]*F[3]}function D(B,F,V,J){var N=V[0]*J[1]-V[1]*J[0],$=V[0]*J[2]-V[2]*J[0],S=V[0]*J[3]-V[3]*J[0],P=V[1]*J[2]-V[2]*J[1],w=V[1]*J[3]-V[3]*J[1],U=V[2]*J[3]-V[3]*J[2],K=F[0],Y=F[1],k=F[2],rt=F[3];return B[0]=Y*U-k*w+rt*P,B[1]=-(K*U)+k*S-rt*$,B[2]=K*w-Y*S+rt*N,B[3]=-(K*P)+Y*$-k*N,B}function R(B,F,V,J){var N=F[0],$=F[1],S=F[2],P=F[3];return B[0]=N+J*(V[0]-N),B[1]=$+J*(V[1]-$),B[2]=S+J*(V[2]-S),B[3]=P+J*(V[3]-P),B}function C(B,F){F=F||1;var V,J,N,$,S,P;do V=e.RANDOM()*2-1,J=e.RANDOM()*2-1,S=V*V+J*J;while(S>=1);do N=e.RANDOM()*2-1,$=e.RANDOM()*2-1,P=N*N+$*$;while(P>=1);var w=Math.sqrt((1-S)/P);return B[0]=F*V,B[1]=F*J,B[2]=F*N*w,B[3]=F*$*w,B}function W(B,F,V){var J=F[0],N=F[1],$=F[2],S=F[3];return B[0]=V[0]*J+V[4]*N+V[8]*$+V[12]*S,B[1]=V[1]*J+V[5]*N+V[9]*$+V[13]*S,B[2]=V[2]*J+V[6]*N+V[10]*$+V[14]*S,B[3]=V[3]*J+V[7]*N+V[11]*$+V[15]*S,B}function z(B,F,V){var J=F[0],N=F[1],$=F[2],S=V[0],P=V[1],w=V[2],U=V[3],K=U*J+P*$-w*N,Y=U*N+w*J-S*$,k=U*$+S*N-P*J,rt=-S*J-P*N-w*$;return B[0]=K*U+rt*-S+Y*-w-k*-P,B[1]=Y*U+rt*-P+k*-S-K*-w,B[2]=k*U+rt*-w+K*-P-Y*-S,B[3]=F[3],B}function H(B){return B[0]=0,B[1]=0,B[2]=0,B[3]=0,B}function X(B){return"vec4("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+")"}function Z(B,F){return B[0]===F[0]&&B[1]===F[1]&&B[2]===F[2]&&B[3]===F[3]}function j(B,F){var V=B[0],J=B[1],N=B[2],$=B[3],S=F[0],P=F[1],w=F[2],U=F[3];return Math.abs(V-S)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(S))&&Math.abs(J-P)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(P))&&Math.abs(N-w)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(w))&&Math.abs($-U)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(U))}var G=v,Q=l,tt=p,et=u,at=g,q=M,pt=A,dt=function(){var B=n();return function(F,V,J,N,$,S){var P,w;for(V||(V=4),J||(J=0),N?w=Math.min(N*V+J,F.length):w=F.length,P=J;P<w;P+=V)B[0]=F[P],B[1]=F[P+1],B[2]=F[P+2],B[3]=F[P+3],$(B,B,S),F[P]=B[0],F[P+1]=B[1],F[P+2]=B[2],F[P+3]=B[3];return F}}()},function(d,r,t){t.r(r),t.d(r,"create",function(){return a}),t.d(r,"clone",function(){return s}),t.d(r,"fromValues",function(){return o}),t.d(r,"fromRotationTranslationValues",function(){return f}),t.d(r,"fromRotationTranslation",function(){return v}),t.d(r,"fromTranslation",function(){return l}),t.d(r,"fromRotation",function(){return p}),t.d(r,"fromMat4",function(){return y}),t.d(r,"copy",function(){return O}),t.d(r,"identity",function(){return x}),t.d(r,"set",function(){return m}),t.d(r,"getReal",function(){return T}),t.d(r,"getDual",function(){return c}),t.d(r,"setReal",function(){return h}),t.d(r,"setDual",function(){return u}),t.d(r,"getTranslation",function(){return g}),t.d(r,"translate",function(){return M}),t.d(r,"rotateX",function(){return A}),t.d(r,"rotateY",function(){return I}),t.d(r,"rotateZ",function(){return b}),t.d(r,"rotateByQuatAppend",function(){return E}),t.d(r,"rotateByQuatPrepend",function(){return L}),t.d(r,"rotateAroundAxis",function(){return D}),t.d(r,"add",function(){return R}),t.d(r,"multiply",function(){return C}),t.d(r,"mul",function(){return W}),t.d(r,"scale",function(){return z}),t.d(r,"dot",function(){return H}),t.d(r,"lerp",function(){return X}),t.d(r,"invert",function(){return Z}),t.d(r,"conjugate",function(){return j}),t.d(r,"length",function(){return G}),t.d(r,"len",function(){return Q}),t.d(r,"squaredLength",function(){return tt}),t.d(r,"sqrLen",function(){return et}),t.d(r,"normalize",function(){return at}),t.d(r,"str",function(){return q}),t.d(r,"exactEquals",function(){return pt}),t.d(r,"equals",function(){return dt});var e=t(2),n=t(7),i=t(6);function a(){var B=new e.ARRAY_TYPE(8);return e.ARRAY_TYPE!=Float32Array&&(B[0]=0,B[1]=0,B[2]=0,B[4]=0,B[5]=0,B[6]=0,B[7]=0),B[3]=1,B}function s(B){var F=new e.ARRAY_TYPE(8);return F[0]=B[0],F[1]=B[1],F[2]=B[2],F[3]=B[3],F[4]=B[4],F[5]=B[5],F[6]=B[6],F[7]=B[7],F}function o(B,F,V,J,N,$,S,P){var w=new e.ARRAY_TYPE(8);return w[0]=B,w[1]=F,w[2]=V,w[3]=J,w[4]=N,w[5]=$,w[6]=S,w[7]=P,w}function f(B,F,V,J,N,$,S){var P=new e.ARRAY_TYPE(8);P[0]=B,P[1]=F,P[2]=V,P[3]=J;var w=N*.5,U=$*.5,K=S*.5;return P[4]=w*J+U*V-K*F,P[5]=U*J+K*B-w*V,P[6]=K*J+w*F-U*B,P[7]=-w*B-U*F-K*V,P}function v(B,F,V){var J=V[0]*.5,N=V[1]*.5,$=V[2]*.5,S=F[0],P=F[1],w=F[2],U=F[3];return B[0]=S,B[1]=P,B[2]=w,B[3]=U,B[4]=J*U+N*w-$*P,B[5]=N*U+$*S-J*w,B[6]=$*U+J*P-N*S,B[7]=-J*S-N*P-$*w,B}function l(B,F){return B[0]=0,B[1]=0,B[2]=0,B[3]=1,B[4]=F[0]*.5,B[5]=F[1]*.5,B[6]=F[2]*.5,B[7]=0,B}function p(B,F){return B[0]=F[0],B[1]=F[1],B[2]=F[2],B[3]=F[3],B[4]=0,B[5]=0,B[6]=0,B[7]=0,B}function y(B,F){var V=n.create();i.getRotation(V,F);var J=new e.ARRAY_TYPE(3);return i.getTranslation(J,F),v(B,V,J),B}function O(B,F){return B[0]=F[0],B[1]=F[1],B[2]=F[2],B[3]=F[3],B[4]=F[4],B[5]=F[5],B[6]=F[6],B[7]=F[7],B}function x(B){return B[0]=0,B[1]=0,B[2]=0,B[3]=1,B[4]=0,B[5]=0,B[6]=0,B[7]=0,B}function m(B,F,V,J,N,$,S,P,w){return B[0]=F,B[1]=V,B[2]=J,B[3]=N,B[4]=$,B[5]=S,B[6]=P,B[7]=w,B}var T=n.copy;function c(B,F){return B[0]=F[4],B[1]=F[5],B[2]=F[6],B[3]=F[7],B}var h=n.copy;function u(B,F){return B[4]=F[0],B[5]=F[1],B[6]=F[2],B[7]=F[3],B}function g(B,F){var V=F[4],J=F[5],N=F[6],$=F[7],S=-F[0],P=-F[1],w=-F[2],U=F[3];return B[0]=(V*U+$*S+J*w-N*P)*2,B[1]=(J*U+$*P+N*S-V*w)*2,B[2]=(N*U+$*w+V*P-J*S)*2,B}function M(B,F,V){var J=F[0],N=F[1],$=F[2],S=F[3],P=V[0]*.5,w=V[1]*.5,U=V[2]*.5,K=F[4],Y=F[5],k=F[6],rt=F[7];return B[0]=J,B[1]=N,B[2]=$,B[3]=S,B[4]=S*P+N*U-$*w+K,B[5]=S*w+$*P-J*U+Y,B[6]=S*U+J*w-N*P+k,B[7]=-J*P-N*w-$*U+rt,B}function A(B,F,V){var J=-F[0],N=-F[1],$=-F[2],S=F[3],P=F[4],w=F[5],U=F[6],K=F[7],Y=P*S+K*J+w*$-U*N,k=w*S+K*N+U*J-P*$,rt=U*S+K*$+P*N-w*J,it=K*S-P*J-w*N-U*$;return n.rotateX(B,F,V),J=B[0],N=B[1],$=B[2],S=B[3],B[4]=Y*S+it*J+k*$-rt*N,B[5]=k*S+it*N+rt*J-Y*$,B[6]=rt*S+it*$+Y*N-k*J,B[7]=it*S-Y*J-k*N-rt*$,B}function I(B,F,V){var J=-F[0],N=-F[1],$=-F[2],S=F[3],P=F[4],w=F[5],U=F[6],K=F[7],Y=P*S+K*J+w*$-U*N,k=w*S+K*N+U*J-P*$,rt=U*S+K*$+P*N-w*J,it=K*S-P*J-w*N-U*$;return n.rotateY(B,F,V),J=B[0],N=B[1],$=B[2],S=B[3],B[4]=Y*S+it*J+k*$-rt*N,B[5]=k*S+it*N+rt*J-Y*$,B[6]=rt*S+it*$+Y*N-k*J,B[7]=it*S-Y*J-k*N-rt*$,B}function b(B,F,V){var J=-F[0],N=-F[1],$=-F[2],S=F[3],P=F[4],w=F[5],U=F[6],K=F[7],Y=P*S+K*J+w*$-U*N,k=w*S+K*N+U*J-P*$,rt=U*S+K*$+P*N-w*J,it=K*S-P*J-w*N-U*$;return n.rotateZ(B,F,V),J=B[0],N=B[1],$=B[2],S=B[3],B[4]=Y*S+it*J+k*$-rt*N,B[5]=k*S+it*N+rt*J-Y*$,B[6]=rt*S+it*$+Y*N-k*J,B[7]=it*S-Y*J-k*N-rt*$,B}function E(B,F,V){var J=V[0],N=V[1],$=V[2],S=V[3],P=F[0],w=F[1],U=F[2],K=F[3];return B[0]=P*S+K*J+w*$-U*N,B[1]=w*S+K*N+U*J-P*$,B[2]=U*S+K*$+P*N-w*J,B[3]=K*S-P*J-w*N-U*$,P=F[4],w=F[5],U=F[6],K=F[7],B[4]=P*S+K*J+w*$-U*N,B[5]=w*S+K*N+U*J-P*$,B[6]=U*S+K*$+P*N-w*J,B[7]=K*S-P*J-w*N-U*$,B}function L(B,F,V){var J=F[0],N=F[1],$=F[2],S=F[3],P=V[0],w=V[1],U=V[2],K=V[3];return B[0]=J*K+S*P+N*U-$*w,B[1]=N*K+S*w+$*P-J*U,B[2]=$*K+S*U+J*w-N*P,B[3]=S*K-J*P-N*w-$*U,P=V[4],w=V[5],U=V[6],K=V[7],B[4]=J*K+S*P+N*U-$*w,B[5]=N*K+S*w+$*P-J*U,B[6]=$*K+S*U+J*w-N*P,B[7]=S*K-J*P-N*w-$*U,B}function D(B,F,V,J){if(Math.abs(J)<e.EPSILON)return O(B,F);var N=Math.hypot(V[0],V[1],V[2]);J=J*.5;var $=Math.sin(J),S=$*V[0]/N,P=$*V[1]/N,w=$*V[2]/N,U=Math.cos(J),K=F[0],Y=F[1],k=F[2],rt=F[3];B[0]=K*U+rt*S+Y*w-k*P,B[1]=Y*U+rt*P+k*S-K*w,B[2]=k*U+rt*w+K*P-Y*S,B[3]=rt*U-K*S-Y*P-k*w;var it=F[4],lt=F[5],ut=F[6],ot=F[7];return B[4]=it*U+ot*S+lt*w-ut*P,B[5]=lt*U+ot*P+ut*S-it*w,B[6]=ut*U+ot*w+it*P-lt*S,B[7]=ot*U-it*S-lt*P-ut*w,B}function R(B,F,V){return B[0]=F[0]+V[0],B[1]=F[1]+V[1],B[2]=F[2]+V[2],B[3]=F[3]+V[3],B[4]=F[4]+V[4],B[5]=F[5]+V[5],B[6]=F[6]+V[6],B[7]=F[7]+V[7],B}function C(B,F,V){var J=F[0],N=F[1],$=F[2],S=F[3],P=V[4],w=V[5],U=V[6],K=V[7],Y=F[4],k=F[5],rt=F[6],it=F[7],lt=V[0],ut=V[1],ot=V[2],st=V[3];return B[0]=J*st+S*lt+N*ot-$*ut,B[1]=N*st+S*ut+$*lt-J*ot,B[2]=$*st+S*ot+J*ut-N*lt,B[3]=S*st-J*lt-N*ut-$*ot,B[4]=J*K+S*P+N*U-$*w+Y*st+it*lt+k*ot-rt*ut,B[5]=N*K+S*w+$*P-J*U+k*st+it*ut+rt*lt-Y*ot,B[6]=$*K+S*U+J*w-N*P+rt*st+it*ot+Y*ut-k*lt,B[7]=S*K-J*P-N*w-$*U+it*st-Y*lt-k*ut-rt*ot,B}var W=C;function z(B,F,V){return B[0]=F[0]*V,B[1]=F[1]*V,B[2]=F[2]*V,B[3]=F[3]*V,B[4]=F[4]*V,B[5]=F[5]*V,B[6]=F[6]*V,B[7]=F[7]*V,B}var H=n.dot;function X(B,F,V,J){var N=1-J;return H(F,V)<0&&(J=-J),B[0]=F[0]*N+V[0]*J,B[1]=F[1]*N+V[1]*J,B[2]=F[2]*N+V[2]*J,B[3]=F[3]*N+V[3]*J,B[4]=F[4]*N+V[4]*J,B[5]=F[5]*N+V[5]*J,B[6]=F[6]*N+V[6]*J,B[7]=F[7]*N+V[7]*J,B}function Z(B,F){var V=tt(F);return B[0]=-F[0]/V,B[1]=-F[1]/V,B[2]=-F[2]/V,B[3]=F[3]/V,B[4]=-F[4]/V,B[5]=-F[5]/V,B[6]=-F[6]/V,B[7]=F[7]/V,B}function j(B,F){return B[0]=-F[0],B[1]=-F[1],B[2]=-F[2],B[3]=F[3],B[4]=-F[4],B[5]=-F[5],B[6]=-F[6],B[7]=F[7],B}var G=n.length,Q=G,tt=n.squaredLength,et=tt;function at(B,F){var V=tt(F);if(V>0){V=Math.sqrt(V);var J=F[0]/V,N=F[1]/V,$=F[2]/V,S=F[3]/V,P=F[4],w=F[5],U=F[6],K=F[7],Y=J*P+N*w+$*U+S*K;B[0]=J,B[1]=N,B[2]=$,B[3]=S,B[4]=(P-J*Y)/V,B[5]=(w-N*Y)/V,B[6]=(U-$*Y)/V,B[7]=(K-S*Y)/V}return B}function q(B){return"quat2("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+", "+B[4]+", "+B[5]+", "+B[6]+", "+B[7]+")"}function pt(B,F){return B[0]===F[0]&&B[1]===F[1]&&B[2]===F[2]&&B[3]===F[3]&&B[4]===F[4]&&B[5]===F[5]&&B[6]===F[6]&&B[7]===F[7]}function dt(B,F){var V=B[0],J=B[1],N=B[2],$=B[3],S=B[4],P=B[5],w=B[6],U=B[7],K=F[0],Y=F[1],k=F[2],rt=F[3],it=F[4],lt=F[5],ut=F[6],ot=F[7];return Math.abs(V-K)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(K))&&Math.abs(J-Y)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(Y))&&Math.abs(N-k)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(k))&&Math.abs($-rt)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(rt))&&Math.abs(S-it)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(it))&&Math.abs(P-lt)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(lt))&&Math.abs(w-ut)<=e.EPSILON*Math.max(1,Math.abs(w),Math.abs(ut))&&Math.abs(U-ot)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(ot))}},function(d,r,t){t.r(r),t.d(r,"create",function(){return n}),t.d(r,"clone",function(){return i}),t.d(r,"fromValues",function(){return a}),t.d(r,"copy",function(){return s}),t.d(r,"set",function(){return o}),t.d(r,"add",function(){return f}),t.d(r,"subtract",function(){return v}),t.d(r,"multiply",function(){return l}),t.d(r,"divide",function(){return p}),t.d(r,"ceil",function(){return y}),t.d(r,"floor",function(){return O}),t.d(r,"min",function(){return x}),t.d(r,"max",function(){return m}),t.d(r,"round",function(){return T}),t.d(r,"scale",function(){return c}),t.d(r,"scaleAndAdd",function(){return h}),t.d(r,"distance",function(){return u}),t.d(r,"squaredDistance",function(){return g}),t.d(r,"length",function(){return M}),t.d(r,"squaredLength",function(){return A}),t.d(r,"negate",function(){return I}),t.d(r,"inverse",function(){return b}),t.d(r,"normalize",function(){return E}),t.d(r,"dot",function(){return L}),t.d(r,"cross",function(){return D}),t.d(r,"lerp",function(){return R}),t.d(r,"random",function(){return C}),t.d(r,"transformMat2",function(){return W}),t.d(r,"transformMat2d",function(){return z}),t.d(r,"transformMat3",function(){return H}),t.d(r,"transformMat4",function(){return X}),t.d(r,"rotate",function(){return Z}),t.d(r,"angle",function(){return j}),t.d(r,"zero",function(){return G}),t.d(r,"str",function(){return Q}),t.d(r,"exactEquals",function(){return tt}),t.d(r,"equals",function(){return et}),t.d(r,"len",function(){return at}),t.d(r,"sub",function(){return q}),t.d(r,"mul",function(){return pt}),t.d(r,"div",function(){return dt}),t.d(r,"dist",function(){return B}),t.d(r,"sqrDist",function(){return F}),t.d(r,"sqrLen",function(){return V}),t.d(r,"forEach",function(){return J});var e=t(2);function n(){var N=new e.ARRAY_TYPE(2);return e.ARRAY_TYPE!=Float32Array&&(N[0]=0,N[1]=0),N}function i(N){var $=new e.ARRAY_TYPE(2);return $[0]=N[0],$[1]=N[1],$}function a(N,$){var S=new e.ARRAY_TYPE(2);return S[0]=N,S[1]=$,S}function s(N,$){return N[0]=$[0],N[1]=$[1],N}function o(N,$,S){return N[0]=$,N[1]=S,N}function f(N,$,S){return N[0]=$[0]+S[0],N[1]=$[1]+S[1],N}function v(N,$,S){return N[0]=$[0]-S[0],N[1]=$[1]-S[1],N}function l(N,$,S){return N[0]=$[0]*S[0],N[1]=$[1]*S[1],N}function p(N,$,S){return N[0]=$[0]/S[0],N[1]=$[1]/S[1],N}function y(N,$){return N[0]=Math.ceil($[0]),N[1]=Math.ceil($[1]),N}function O(N,$){return N[0]=Math.floor($[0]),N[1]=Math.floor($[1]),N}function x(N,$,S){return N[0]=Math.min($[0],S[0]),N[1]=Math.min($[1],S[1]),N}function m(N,$,S){return N[0]=Math.max($[0],S[0]),N[1]=Math.max($[1],S[1]),N}function T(N,$){return N[0]=Math.round($[0]),N[1]=Math.round($[1]),N}function c(N,$,S){return N[0]=$[0]*S,N[1]=$[1]*S,N}function h(N,$,S,P){return N[0]=$[0]+S[0]*P,N[1]=$[1]+S[1]*P,N}function u(N,$){var S=$[0]-N[0],P=$[1]-N[1];return Math.hypot(S,P)}function g(N,$){var S=$[0]-N[0],P=$[1]-N[1];return S*S+P*P}function M(N){var $=N[0],S=N[1];return Math.hypot($,S)}function A(N){var $=N[0],S=N[1];return $*$+S*S}function I(N,$){return N[0]=-$[0],N[1]=-$[1],N}function b(N,$){return N[0]=1/$[0],N[1]=1/$[1],N}function E(N,$){var S=$[0],P=$[1],w=S*S+P*P;return w>0&&(w=1/Math.sqrt(w)),N[0]=$[0]*w,N[1]=$[1]*w,N}function L(N,$){return N[0]*$[0]+N[1]*$[1]}function D(N,$,S){var P=$[0]*S[1]-$[1]*S[0];return N[0]=N[1]=0,N[2]=P,N}function R(N,$,S,P){var w=$[0],U=$[1];return N[0]=w+P*(S[0]-w),N[1]=U+P*(S[1]-U),N}function C(N,$){$=$||1;var S=e.RANDOM()*2*Math.PI;return N[0]=Math.cos(S)*$,N[1]=Math.sin(S)*$,N}function W(N,$,S){var P=$[0],w=$[1];return N[0]=S[0]*P+S[2]*w,N[1]=S[1]*P+S[3]*w,N}function z(N,$,S){var P=$[0],w=$[1];return N[0]=S[0]*P+S[2]*w+S[4],N[1]=S[1]*P+S[3]*w+S[5],N}function H(N,$,S){var P=$[0],w=$[1];return N[0]=S[0]*P+S[3]*w+S[6],N[1]=S[1]*P+S[4]*w+S[7],N}function X(N,$,S){var P=$[0],w=$[1];return N[0]=S[0]*P+S[4]*w+S[12],N[1]=S[1]*P+S[5]*w+S[13],N}function Z(N,$,S,P){var w=$[0]-S[0],U=$[1]-S[1],K=Math.sin(P),Y=Math.cos(P);return N[0]=w*Y-U*K+S[0],N[1]=w*K+U*Y+S[1],N}function j(N,$){var S=N[0],P=N[1],w=$[0],U=$[1],K=Math.sqrt(S*S+P*P)*Math.sqrt(w*w+U*U),Y=K&&(S*w+P*U)/K;return Math.acos(Math.min(Math.max(Y,-1),1))}function G(N){return N[0]=0,N[1]=0,N}function Q(N){return"vec2("+N[0]+", "+N[1]+")"}function tt(N,$){return N[0]===$[0]&&N[1]===$[1]}function et(N,$){var S=N[0],P=N[1],w=$[0],U=$[1];return Math.abs(S-w)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(w))&&Math.abs(P-U)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(U))}var at=M,q=v,pt=l,dt=p,B=u,F=g,V=A,J=function(){var N=n();return function($,S,P,w,U,K){var Y,k;for(S||(S=2),P||(P=0),w?k=Math.min(w*S+P,$.length):k=$.length,Y=P;Y<k;Y+=S)N[0]=$[Y],N[1]=$[Y+1],U(N,N,K),$[Y]=N[0],$[Y+1]=N[1];return $}}()},function(d,r,t){t.r(r);var e=t(13);t.d(r,"Renderer",function(){return e.default});var n=t(40);t.d(r,"Figure2D",function(){return n.default});var i=t(56);t.d(r,"Mesh2D",function(){return i.default});var a=t(29);t.d(r,"MeshCloud",function(){return a.default});var s=t(23);t.d(r,"parseFont",function(){return s.default});var o=t(31);t.d(r,"parseColor",function(){return o.default});var f=t(21);t.d(r,"ENV",function(){return f.default}),t(1).glMatrix.setMatrixArrayType(Array)},function(d,r,t){t.r(r),t.d(r,"default",function(){return b});var e=t(14),n=t(1),i=t(20),a=t(27),s=t(25),o=t(40),f=t(56),v=t(29),l=t(59),p=t(21),y=t(63);t(1).glMatrix.setMatrixArrayType(Array);const O={autoUpdate:!1,preserveDrawingBuffer:!1,bufferSize:1500},x=`attribute vec3 a_vertexPosition;
|
|
2
|
-
attribute vec3 a_vertexTextureCoord;
|
|
3
|
-
varying vec3 vTextureCoord;
|
|
4
|
-
uniform mat3 viewMatrix;
|
|
5
|
-
uniform mat3 projectionMatrix;
|
|
6
|
-
|
|
7
|
-
void main() {
|
|
8
|
-
gl_PointSize = 1.0;
|
|
9
|
-
vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);
|
|
10
|
-
gl_Position = vec4(pos.xy, 1.0, 1.0);
|
|
11
|
-
vTextureCoord = a_vertexTextureCoord;
|
|
12
|
-
}
|
|
13
|
-
`,m=`precision mediump float;
|
|
14
|
-
varying vec3 vTextureCoord;
|
|
15
|
-
uniform sampler2D u_texSampler;
|
|
16
|
-
void main() {
|
|
17
|
-
gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);
|
|
18
|
-
}
|
|
19
|
-
`,T=Symbol("glRenderer"),c=Symbol("canvasRenderer"),h=Symbol("options"),u=Symbol("globalTransform"),g=Symbol("applyGlobalTransform"),M=Symbol("canvas");function A(E){const L=E.gl,D=E.fbo;D&&L.bindFramebuffer(L.FRAMEBUFFER,D),E._draw(),D&&L.bindFramebuffer(L.FRAMEBUFFER,null)}function I(E,L,D,R){const C=E.createTexture(L.canvas),W=[[[0,0],[D,0],[D,R],[0,R],[0,0]]];W.closed=!0;const z=new f.default({contours:W});z.setTexture(C),E.setMeshData([z.meshData]),A(E),C.delete(),L.clearRect(0,0,D,R),delete L._filter}class b{constructor(L,D={}){let R=D.contextType;if(R||(typeof WebGL2RenderingContext=="function"?R="webgl2":typeof WebGLRenderingContext=="function"?R="webgl":R="2d"),!L.getContext){const C=L;L={getContext(){return C},width:D.width,height:D.height},C.canvas=L,R="2d"}if(this[M]=L,R!=="webgl"&&R!=="webgl2"&&R!=="2d")throw new Error(`Unknown context type ${R}`);if(D.contextType=R,this[h]=Object.assign({},O,D),R==="webgl"||R==="webgl2"){R==="webgl2"&&(this[h].webgl2=!0);const C=new e.default(L,this[h]);R==="webgl2"&&!C.isWebGL2&&(D.contextType="webgl"),Object(y.createShaders)(C),Object(y.applyShader)(C),Object(y.createCloudShaders)(C);const W=C.gl;W.clearColor(0,0,0,0),W.blendFuncSeparate(W.SRC_ALPHA,W.ONE_MINUS_SRC_ALPHA,W.ONE,W.ONE_MINUS_SRC_ALPHA),this[T]=C}else this[c]=new i.default(L,this[h]);this[u]=[1,0,0,0,1,0,0,0,1],this.updateResolution()}get canvas(){return this[M]}get canvasRenderer(){return this[c]}get glRenderer(){return this[T]}get isWebGL2(){return this[T]&&this[T].isWebGL2}get options(){return this[h]}get globalTransformMatrix(){const L=this[u];return[L[0],L[1],L[3],L[4],L[6],L[7]]}get viewMatrix(){return this[u]}[g](){const L=this[T]||this[c];if(this[T]){const{width:D,height:R}=this.canvas;L.uniforms.viewMatrix=this.viewMatrix,L.uniforms.projectionMatrix=this.projectionMatrix,L.uniforms.u_resolution=[D,R]}}updateResolution(){const{width:L,height:D}=this.canvas,R=[1,0,0,0,1,0,-L/2,-D/2,1],C=[2/L,0,0,0,-2/D,0,0,0,1],W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),C,R);this.projectionMatrix=W,this[T]&&this[T].gl.viewport(0,0,L,D)}createTexture(L,D){return(this[T]||this[c]).createTexture(L,D)}loadTexture(L,{useImageBitmap:D=!1}={}){return(this[T]||this[c]).loadTexture(L,{useImageBitmap:D})}createText(L,{font:D="16px arial",fillColor:R=null,strokeColor:C=null,strokeWidth:W=1}={}){if(this[T]){const z=p.default.createText(L,{font:D,fillColor:R,strokeColor:C,strokeWidth:W});return{image:this.createTexture(z.image),rect:z.rect}}return{_img:{font:D,fillColor:R,strokeColor:C,strokeWidth:W,text:L}}}createProgram({vertex:L,fragment:D,options:R}={}){if(this[T]){const C=this[T].compileSync(D,L);return C._attribOpts=R,C}throw new Error("Context 2D cannot create webgl program.")}createPassProgram({vertex:L=x,fragment:D=m,options:R}={}){return this.createProgram({vertex:L,fragment:D,options:R})}useProgram(L,D={}){if(this[T]){const R=Object.assign({},L._attribOpts,D);return this[T].useProgram(L,R)}throw new Error("Context 2D cannot use webgl program.")}deleteTexture(L){return(this[T]||this[c]).deleteTexture(L)}clear(...L){if(this[T]){const D=this[T].gl;D.clear(D.COLOR_BUFFER_BIT)}else this[c].clear(...L)}drawMeshCloud(L,{clear:D=!1,program:R=null}={}){const C=this[T]||this[c],W=R||L.program;if(this[T]){const z=C.gl;if(D&&z.clear(z.COLOR_BUFFER_BIT),W)C.program!==W&&this.useProgram(W,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}});else{const H=L.mesh.meshData,X=!!H.uniforms.u_texSampler,Z=!!H.uniforms.u_filterFlag,j=!!H.uniforms.u_radialGradientVector,G=L.hasCloudColor,Q=L.hasCloudFilter,tt=!!H.uniforms.u_clipSampler;Object(y.applyCloudShader)(C,{hasTexture:X,hasFilter:Z,hasGradient:j,hasCloudColor:G,hasCloudFilter:Q,hasClipPath:tt})}this[g](),C.setMeshData([L.meshData]),L.beforeRender&&L.beforeRender(z,L),A(C),L.afterRender&&L.afterRender(z,L)}else C.setTransform(this.globalTransformMatrix),C.drawMeshCloud(L,{clear:D,hook:!1})}drawMeshes(L,{clear:D=!1,program:R=null}={}){const C=this[T]||this[c];if(this[T]){const W=C.fbo,z=Object(a.default)(this,L,R==null),H=C.gl;D&&H.clear(H.COLOR_BUFFER_BIT);const X=!Object(l.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;for(const Z of z){this._drawCalls++;const j=R||Z.program;if(Z instanceof v.default)this.drawMeshCloud(Z,{clear:D,program:j});else{const{width:G,height:Q}=this.canvas;if(Z.beforeRender&&Z.beforeRender(H,Z),Z.pass.length&&((!this.fbo||this.fbo.width!==G||this.fbo.height!==Q)&&(this.fbo={width:G,height:Q,target:C.createFBO(),buffer:C.createFBO(),swap(){[this.target,this.buffer]=[this.buffer,this.target]}}),C.bindFBO(this.fbo.target)),!j&&Z.filterCanvas){Object(y.applyShader)(C,{hasTexture:!0});let tt=this.filterContext;tt||(tt=p.default.createCanvas(G,Q).getContext("2d"),this.filterContext=tt);const et=L[Z.packIndex],at=et.filter,q=L[Z.packIndex+1],pt=L[Z.packIndex-1];(!pt||!pt.filterCanvas||pt.filter!==at)&&(!q||!q.filterCanvas||q.filter!==at)?(X?(tt.save(),Object(s.drawMesh2D)(et,tt,!1),tt.restore(),Object(s.applyFilter)(tt,at)):Object(s.drawMesh2D)(et,tt,!0),this[g](),I(C,tt,G,Q)):(X&&tt.save(),Object(s.drawMesh2D)(et,tt,!1),X&&tt.restore(),(!q||!q.filterCanvas||et.filter!==q.filter)&&(Object(s.applyFilter)(tt,at),this[g](),I(C,tt,G,Q)))}else{if(j)C.program!==j&&this.useProgram(j,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{const tt=!!Z.uniforms.u_texSampler,et=!!Z.uniforms.u_filterFlag,at=!!Z.uniforms.u_radialGradientVector,q=!!Z.uniforms.u_clipSampler;Object(y.applyShader)(C,{hasTexture:tt,hasFilter:et,hasGradient:at,hasClipPath:q})}Z.filterCanvas&&console.warn("User program ignored some filter effects."),this[g](),C.setMeshData([Z]),A(C)}if(Z.pass.length){const tt=Z.pass.length;Z.pass.forEach((et,at)=>{et.blend=Z.enableBlend,et.setTexture(C.fbo.texture),at===tt-1?C.bindFBO(W):(this.fbo.swap(),C.bindFBO(this.fbo.target)),et.program?C.useProgram(et.program):(this.defaultPassProgram=this.defaultPassProgram||this.createPassProgram(),C.useProgram(this.defaultPassProgram)),C.setMeshData([et.meshData]),H.clear(H.COLOR_BUFFER_BIT),A(C)})}Z.afterRender&&Z.afterRender(H,Z)}}}else C.setTransform(this.globalTransformMatrix),C.drawMeshes(L,{clear:D})}drawImage(L,...D){const R=D.length;if(R<2)throw new TypeError(`Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ${D.length+1} present.`);if(R!==2&&R!==4&&R!==8)throw new TypeError(`Failed to execute 'drawImage' on 'Renderer': Valid arities are: [3, 5, 9], but ${D.length+1} arguments provided.`);let C=null,W=null;R===2?C=[D[0],D[1],L.width,L.height]:R===4?C=D:R===8&&(W=D.slice(0,4),C=D.slice(4));const z=this.createTexture(L),{width:H,height:X}=this.canvas,Z=new o.default;Z.rect(C[0],C[1],H,X);const j=new f.default(Z,{width:H,height:X});j.setTexture(z,{rect:C,srcRect:W}),this.drawMeshes([j]),this.deleteTexture(z)}setGlobalTransform(...L){return this[u]=[L[0],L[1],0,L[2],L[3],0,L[4],L[5],1],this}globalTransform(...L){const D=this[u];return this[u]=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),D,L),this}globalTranslate(L,D){let R=n.mat3.create();return R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[L,D]),this.globalTransform(...R)}globalRotate(L,[D,R]=[0,0]){let C=n.mat3.create();return C=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),C,[D,R]),C=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),C,L),C=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),C,[-D,-R]),this.globalTransform(...C)}globalScale(L,D=L,[R,C]=[0,0]){let W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[R,C]),W=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),W,[L,D]),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-R,-C]),this.globalTransform(...W)}globalSkew(L,D=L,[R,C]=[0,0]){let W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[R,C]),W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),W,n.mat3.fromValues(1,Math.tan(D),Math.tan(L),1,0,0)),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-R,-C]),this.globalTransform(...W)}transformPoint(L,D,R){let C=this.globalTransformMatrix;R&&(C=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),C,R));const W=L*C[0]+D*C[2]+C[4],z=L*C[1]+D*C[3]+C[5];return[W,z]}}},function(d,r,t){t.r(r);var e=t(15);t(1).glMatrix.setMatrixArrayType(Array),r.default=e.default},function(d,r,t){t.r(r),t.d(r,"default",function(){return y});var e=t(16),n=t(17),i=t(18),a=t(19);t(1).glMatrix.setMatrixArrayType(Array);function s(O,x,m){return x in O?Object.defineProperty(O,x,{value:m,enumerable:!0,configurable:!0,writable:!0}):O[x]=m,O}const o={};function f(O,x=3){const m=[],T=O.length;for(let c=0;c<T;c++)c%x<2&&m.push(.5*(O[c]+1));return m}function v(O,x){const m=x._buffers;Object.values(m).forEach(T=>{O.deleteBuffer(T)}),x._buffers={}}function l(O,x,m){return O.activeTexture(O.TEXTURE0+m),Array.isArray(x._img)?O.bindTexture(O.TEXTURE_CUBE_MAP,x):O.bindTexture(O.TEXTURE_2D,x),x}const p={int:"1i",ivec2:"2i",ivec3:"3i",ivec4:"4i",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",mat2:"Matrix2fv",mat3:"Matrix3fv",mat4:"Matrix4fv",sampler1D:"sampler1D",sampler2D:"sampler2D",sampler3D:"sampler3D",samplerCube:"samplerCube",sampler1DShadow:"sampler1DShadow",sampler2DShadow:"sampler2DShadow",sampler2DRect:"sampler2DRect",sampler2DRectShadow:"sampler2DRectShadow"};class y{static addLibs(x={}){Object.assign(o,x)}static FLOAT(x,m){return Object(e.pointsToBuffer)(x,Float32Array,m)}static UNSIGNED_BYTE(x,m){return Object(e.pointsToBuffer)(x,Uint8Array,m)}static UNSIGNED_SHORT(x,m){return Object(e.pointsToBuffer)(x,Uint16Array,m)}static BYTE(x,m){return Object(e.pointsToBuffer)(x,Int8Array,m)}static SHORT(x,m){return Object(e.pointsToBuffer)(x,Int16Array,m)}constructor(x,m={}){this.options=Object.assign({},y.defaultOptions,m),this.canvas=x;let T;this.options.webgl2&&(T=x.getContext("webgl2",this.options)),T==null&&(T=Object(e.setupWebGL)(x,this.options),this.aia_ext=T.getExtension("ANGLE_instanced_arrays")),this.gl=T,T.viewport(0,0,x.width,x.height),T.clearColor(0,0,0,0),T.blendFuncSeparate(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA,T.ONE,T.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={}}get program(){const x=this.gl;return x.getParameter(x.CURRENT_PROGRAM)}_declareUniform(x,m,T="1f"){const c=this.gl,h=c.getUniformLocation(x,m);let u;const g=this;if(/^sampler/.test(T)){const M=x._samplerMap,A=x._bindTextures;Object.defineProperty(x.uniforms,m,{get(){return u},set(I){u=I;const b=M[m]!=null?M[m]:A.length;A[b]=I,l(c,I,b),M[m]||(M[m]=b,c.uniform1i(h,b)),g.options.autoUpdate&&g.update()},configurable:!1,enumerable:!0})}else{const M=T.indexOf("Matrix")===0,A=!M&&/v$/.test(T),I=c[`uniform${T}`].bind(c);Object.defineProperty(x.uniforms,m,{get(){return u},set(b){u=b,typeof b=="number"&&(b=[b]),M?I(h,!1,b):A?I(h,b):I(h,...b),g.options.autoUpdate&&g.update()},configurable:!1,enumerable:!0})}}_draw(){const x=this.program;x.meshData.forEach((m,T)=>{const{positions:c,cells:h,instanceCount:u,cellsCount:g,attributes:M,uniforms:A,textureCoord:I,enableBlend:b}=m,E=this.gl;let L=m.mode!=null?m.mode:E.TRIANGLES;typeof L=="string"&&(L=E[L]),b?E.enable(E.BLEND):E.disable(E.BLEND),E.bindBuffer(E.ARRAY_BUFFER,x._buffers.verticesBuffer),E.bufferData(E.ARRAY_BUFFER,c,E.STATIC_DRAW),h&&(E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,x._buffers.cellsBuffer),E.bufferData(E.ELEMENT_ARRAY_BUFFER,h,E.STATIC_DRAW));const D=[];M&&Object.values(M).forEach(({name:C,data:W,divisor:z})=>{if(E.bindBuffer(E.ARRAY_BUFFER,x._buffers[C]),E.bufferData(E.ARRAY_BUFFER,W,E.STATIC_DRAW),z!=null){const H=E.getAttribLocation(x,C);H>=0&&(E.enableVertexAttribArray(H),D.push(H),E.vertexAttribDivisor?E.vertexAttribDivisor(H,z):this.aia_ext&&this.aia_ext.vertexAttribDivisorANGLE(H,z))}}),A&&Object.entries(A).forEach(([C,W])=>{this.uniforms[C]=W});let R;if(!h){const C=x._dimension;R=c.length/C}if(x._enableTextures&&x._buffers.texCoordBuffer){const C=I||f(c,x._dimension);E.bindBuffer(E.ARRAY_BUFFER,x._buffers.texCoordBuffer),E.bufferData(E.ARRAY_BUFFER,y.FLOAT(C),E.STATIC_DRAW)}u!=null?(h?E.drawElementsInstanced?E.drawElementsInstanced(L,g,E.UNSIGNED_SHORT,0,u):this.aia_ext&&this.aia_ext.drawElementsInstancedANGLE(L,g,E.UNSIGNED_SHORT,0,u):E.drawArraysInstanced?E.drawArraysInstanced(L,0,R,u):this.aia_ext.drawArraysInstancedANGLE(L,0,R,u),D.forEach(C=>{E.vertexAttribDivisor?E.vertexAttribDivisor(C,null):this.aia_ext&&this.aia_ext.vertexAttribDivisorANGLE(C,null)})):h?E.drawElements(L,g,E.UNSIGNED_SHORT,0):E.drawArrays(L,0,R)})}get isWebGL2(){return typeof WebGL2RenderingContext<"u"&&this.gl instanceof WebGL2RenderingContext}get enableTextures(){return this.program&&this.program._enableTextures}get uniforms(){const x=this.program;if(!x||!x.uniforms)throw Error("No avaliable program.");return x.uniforms}deleteProgram(x){const m=this.gl;this.program===x&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),m.useProgram(null));const T=this.programs.indexOf(x);T>=0&&this.programs.splice(T,1),v(m,x),m.deleteProgram(x)}setMeshData(x){Array.isArray(x)||(x=[x]);const m=this.program;m.meshData=x.map(({mode:T,positions:c,instanceCount:h,cells:u,cellsCount:g,attributes:M,uniforms:A,textureCoord:I,enableBlend:b})=>{const E={positions:y.FLOAT(c),uniforms:A,enableBlend:!!b,textureCoord:y.FLOAT(I)};if(u&&(E.cells=y.USHORT(u),E.cellsCount=g||E.cells.length),T!=null&&(E.mode=T),h!=null){if(!this.isWebGL2&&!this.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");E.instanceCount=h}if(M){const L={};Object.entries(M).forEach(([D,R])=>{if(!m._attribute[D])m._attribute[D]="ignored";else if(m._attribute[D]!=="ignored"){const{name:C,type:W}=m._attribute[D];let z=R.data||R;if(Array.isArray(z)&&(z=y[W](z)),L[D]={name:C,data:z},R.divisor!=null){if(!this.isWebGL2&&!this.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");L[D].divisor=R.divisor}}}),E.attributes=L}return E}),this.options.autoUpdate&&this.update()}createProgram(x,m){const T=/^\s*uniform\s+sampler/mg.test(x);x==null&&(x=i.default),m==null&&(m=T?a.default:n.default);const c=this.gl,h=Object(e.createProgram)(c,m,x);h.shaderText={vertexShader:m,fragmentShader:x},h._buffers={},h._attribute={},h.uniforms={},h._samplerMap={},h._bindTextures=[];const u=new RegExp(`(?:attribute|in) vec(\\d) ${this.options.vertexPosition}`,"im");let g=m.match(u);g&&(h._dimension=Number(g[1]));const M=new RegExp(`(?:attribute|in) vec(\\d) ${this.options.vertexTextureCoord}`,"im");g=m.match(M),g&&(h._texCoordSize=Number(g[1]));const A=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/gim;if(g=m.match(A),g)for(let E=0;E<g.length;E++){const L=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/im,D=g[E].match(L);if(D&&D[3]!==this.options.vertexPosition&&D[3]!==this.options.vertexTextureCoord){let[,R,C,W]=D;R==="mat"&&(C**=2),h._buffers[W]=c.createBuffer(),h._attribute[W]={name:W,type:R,size:Number(C)||1}}}const I=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;g=m.match(I)||[],g=g.concat(x.match(I)||[]),g.forEach(E=>{const L=E.match(/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/);let[D,R,C]=L.slice(1);D=p[D],C=!!C,D.indexOf("Matrix")!==0&&C&&(D+="v"),this._declareUniform(h,R,D)}),h._buffers.verticesBuffer=c.createBuffer(),h._buffers.cellsBuffer=c.createBuffer();const b=c.getAttribLocation(h,this.options.vertexTextureCoord);return h._enableTextures=b>=0,h._enableTextures&&(h._buffers.texCoordBuffer=c.createBuffer()),this.programs.push(h),h}useProgram(x,m={}){this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);const T=this.gl;T.useProgram(x);const c=x._dimension;T.bindBuffer(T.ARRAY_BUFFER,x._buffers.verticesBuffer);const h=T.getAttribLocation(x,this.options.vertexPosition);if(T.vertexAttribPointer(h,c,T.FLOAT,!1,0,0),T.enableVertexAttribArray(h),x._enableTextures){T.bindBuffer(T.ARRAY_BUFFER,x._buffers.texCoordBuffer);const u=T.getAttribLocation(x,this.options.vertexTextureCoord);T.vertexAttribPointer(u,x._texCoordSize||2,T.FLOAT,!1,0,0),T.enableVertexAttribArray(u)}if(Object.entries(x._attribute).forEach(([u,g])=>{if(g!=="ignored"){const M=g.size,A=m[u]||{},I=!!A.normalize;let b=A.type||"FLOAT";const E=A.key||u;b==="UBYTE"&&(b="UNSIGNED_BYTE"),b==="USHORT"&&(b="UNSIGNED_SHORT"),g.type=b,E&&E!==u&&(x._attribute[E]=g),T.bindBuffer(T.ARRAY_BUFFER,x._buffers[u]);const L=T.getAttribLocation(x,u);L>=0&&(T.vertexAttribPointer(L,M,T[b],I,0,0),T.enableVertexAttribArray(L))}}),!x.meshData){const u=[[-1,-1,0,1].slice(0,c),[1,-1,0,1].slice(0,c),[1,1,0,1].slice(0,c),[-1,1,0,1].slice(0,c)],g=[[0,1,3],[3,1,2]];this.setMeshData({positions:u,cells:g})}return x}compileSync(x,m){x=x||i.default;const T={};function c(M){M=M.replace(/^\s*/mg,"");const A=[],I=M.match(/^#pragma\s+include\s+.*/mg);if(I){for(let b=0;b<I.length;b++){const L=I[b].match(/(?:<|")(.*)(?:>|")/);if(L){const D=L[0].indexOf("<")===0?"lib":"link";let R=L[1];if(R==="graph"&&(R="graphics"),T[R])A.push(`/* included ${R} */`);else if(T[R]=!0,D==="lib"){const C=c(o[R]);A.push(C)}else if(D==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.")}}A.forEach(b=>{M=M.replace(/^#pragma\s+include\s+.*/m,b)})}return M}const h=c(x),u=m?c(m):null;return this.createProgram(h,u)}async compile(x,m){x=x||i.default;const T={};async function c(M){M=M.replace(/^\s*/mg,"");const A=[],I=M.match(/^#pragma\s+include\s+.*/mg);if(I){for(let b=0;b<I.length;b++){const L=I[b].match(/(?:<|")(.*)(?:>|")/);if(L){const D=L[0].indexOf("<")===0?"lib":"link";let R=L[1];if(R==="graph"&&(R="graphics"),T[R])A.push(`/* included ${R} */`);else if(T[R]=!0,D==="lib"){const C=await c(o[R]);A.push(C)}else if(D==="link"){let C=await y.fetchShader(R);C=await c(C),A.push(C)}}}A.forEach(b=>{M=M.replace(/^#pragma\s+include\s+.*/m,b)})}return M}const h=await c(x),u=m?await c(m):null;return this.createProgram(h,u)}async load(x,m=null){return x=await y.fetchShader(x),m&&(m=await y.fetchShader(m)),this.compile(x,m)}createTexture(x=null,{wrapS:m=this.gl.CLAMP_TO_EDGE,wrapT:T=this.gl.CLAMP_TO_EDGE,minFilter:c=this.gl.LINEAR,magFilter:h=this.gl.LINEAR}={}){const u=this.gl,g=Array.isArray(x)?u.TEXTURE_CUBE_MAP:u.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),u.activeTexture(u.TEXTURE0+this._max_texture_image_units-1);const M=u.createTexture();u.bindTexture(g,M),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!0);const{width:A,height:I}=this.canvas;if(x)if(g===u.TEXTURE_CUBE_MAP)for(let b=0;b<6;b++)u.texImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,x[b]);else u.texImage2D(g,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,x);else if(g===u.TEXTURE_CUBE_MAP)for(let b=0;b<6;b++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,u.RGBA,A,I,0,u.RGBA,u.UNSIGNED_BYTE,null);else u.texImage2D(g,0,u.RGBA,A,I,0,u.RGBA,u.UNSIGNED_BYTE,null);return u.texParameteri(g,u.TEXTURE_MIN_FILTER,c),u.texParameteri(g,u.TEXTURE_MAG_FILTER,h),u.texParameteri(g,u.TEXTURE_WRAP_S,m),u.texParameteri(g,u.TEXTURE_WRAP_T,T),g===u.TEXTURE_CUBE_MAP&&(x.width=x[0].width,x.height=x[0].height),u.bindTexture(g,null),M._img=x||{width:A,height:I},M.delete=()=>{this.deleteTexture(M)},M}deleteTexture(x){const m=x._img;this.gl.deleteTexture(x),typeof m.close=="function"&&m.close()}async loadTexture(x,{useImageBitmap:m=!0}={}){const T=await y.loadImage(x,{useImageBitmap:m});return this.createTexture(T)}createFBO({color:x=1,blend:m=!1,depth:T=this.options.depth!==!1,stencil:c=!!this.options.stencil}={}){const h=this.gl,u=h.createFramebuffer();h.bindFramebuffer(h.FRAMEBUFFER,u);const g=[];for(let I=0;I<x;I++){const b=this.createTexture();h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0+I,h.TEXTURE_2D,b,0),g.push(b)}u.textures=g,u.texture=g[0],u.blend=m;const{width:M,height:A}=this.canvas;return T&&!c&&(u.depthBuffer=h.createRenderbuffer(),h.bindRenderbuffer(h.RENDERBUFFER,u.depthBuffer),h.renderbufferStorage(h.RENDERBUFFER,h.DEPTH_COMPONENT16,M,A),h.framebufferRenderbuffer(h.FRAMEBUFFER,h.DEPTH_ATTACHMENT,h.RENDERBUFFER,u.depthBuffer)),c&&!T&&(u.stencilBuffer=h.createRenderbuffer(),h.bindRenderbuffer(h.RENDERBUFFER,u.stencilBuffer),h.renderbufferStorage(h.RENDERBUFFER,h.STENCIL_INDEX8,M,A),h.framebufferRenderbuffer(h.FRAMEBUFFER,h.STENCIL_ATTACHMENT,h.RENDERBUFFER,u.stencilBuffer)),T&&c&&(u.depthStencilBuffer=h.createRenderbuffer(),h.bindRenderbuffer(h.RENDERBUFFER,u.depthStencilBuffer),h.renderbufferStorage(h.RENDERBUFFER,h.DEPTH_STENCIL,M,A),h.framebufferRenderbuffer(h.FRAMEBUFFER,h.DEPTH_STENCIL_ATTACHMENT,h.RENDERBUFFER,u.depthStencilBuffer)),h.bindFramebuffer(h.FRAMEBUFFER,null),u}bindFBO(x=null){this.fbo=x}render({clearBuffer:x=!0}={}){this.startRender=!0;const m=this.gl;let T=this.program;T||(T=this.createProgram(),this.useProgram(T)),this.fbo&&m.bindFramebuffer(m.FRAMEBUFFER,this.fbo);const c=this.options.depth;c&&m.enable(m.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(c?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));const h=this._renderFrameID;this._draw(),this.fbo&&m.bindFramebuffer(m.FRAMEBUFFER,null),this._renderFrameID===h&&(this._renderFrameID=null)}update(){this.startRender&&this._renderFrameID==null&&(this._renderFrameID=requestAnimationFrame(this.render.bind(this)))}}s(y,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),s(y,"UBYTE",y.UNSIGNED_BYTE),s(y,"USHORT",y.UNSIGNED_SHORT),s(y,"fetchShader",e.fetchShader),s(y,"loadImage",e.loadImage)},function(d,r,t){t.r(r),t.d(r,"setupWebGL",function(){return n}),t.d(r,"createProgram",function(){return i}),t.d(r,"pointsToBuffer",function(){return a}),t.d(r,"loadImage",function(){return o}),t.d(r,"fetchShader",function(){return v}),t(1).glMatrix.setMatrixArrayType(Array);function e(l,p){const y=["webgl","experimental-webgl","webkit-3d","moz-webgl"];let O=null;for(let x=0;x<y.length;++x){try{O=l.getContext(y[x],p)}catch{}if(O)break}return O}function n(l,p){const y=e(l,p);if(!y)throw new Error("Sorry, your browser doesn't support WebGL.");return y}function i(l,p,y){const O=l.createShader(l.VERTEX_SHADER);if(l.shaderSource(O,p),l.compileShader(O),!l.getShaderParameter(O,l.COMPILE_STATUS)){const T=`Vertex shader failed to compile. The error log is:${l.getShaderInfoLog(O)}`;throw new Error(T)}const x=l.createShader(l.FRAGMENT_SHADER);if(l.shaderSource(x,y),l.compileShader(x),!l.getShaderParameter(x,l.COMPILE_STATUS)){const T=`Fragment shader failed to compile. The error log is:${l.getShaderInfoLog(x)}`;throw new Error(T)}const m=l.createProgram();if(l.attachShader(m,O),l.attachShader(m,x),l.linkProgram(m),!l.getProgramParameter(m,l.LINK_STATUS)){const T=`Shader program failed to link. The error log is:${l.getProgramInfoLog(m)}`;throw new Error(T)}return l.deleteShader(O),l.deleteShader(x),m}function a(l,p=Float32Array,y=null){if(y&&!(y instanceof p))throw new TypeError("Wrong buffer type.");if(l==null||l instanceof p)return l;if(l[0]==null||l[0].length==null)return y?(y.set(l,0),y):new p(l);const O=l[0].length,x=l.length;y||(y=new p(O*x));let m=0;for(let T=0;T<x;T++)for(let c=0;c<O;c++)y[m++]=l[T][c];return y}const s={};function o(l,{useImageBitmap:p=!0,alias:y=null}={}){if(!s[l]){if(typeof Image=="function"){const O=new Image;typeof l=="string"&&!(typeof location=="object"&&/^file:/.test(location.href))&&!/^data:/.test(l)&&(O.crossOrigin="anonymous"),s[l]=new Promise(x=>{O.onload=function(){p&&typeof createImageBitmap=="function"?createImageBitmap(O,{imageOrientation:"flipY"}).then(m=>{s[l]=m,y&&(s[y]=m),x(m)}):(s[l]=O,y&&(s[y]=O),x(O))},O.src=l}),y&&(s[y]=s[l])}else if(typeof fetch=="function")return fetch(l,{method:"GET",mode:"cors",cache:"default"}).then(O=>O.blob()).then(O=>createImageBitmap(O,{imageOrientation:"flipY"}).then(x=>(s[l]=x,y&&(s[y]=x),x)))}return s[l]}const f={};async function v(l){if(f[l])return f[l];const p=await fetch(l);if(p.status>=200&&p.status<300){const y=await p.text();return f[l]=y,y}throw new Error("Shader loaded error.")}},function(d,r,t){t.r(r),r.default=`attribute vec3 a_vertexPosition;
|
|
20
|
-
|
|
21
|
-
void main() {
|
|
22
|
-
gl_PointSize = 1.0;
|
|
23
|
-
gl_Position = vec4(a_vertexPosition, 1);
|
|
24
|
-
}`},function(d,r,t){t.r(r),r.default=`#ifdef GL_ES
|
|
25
|
-
precision mediump float;
|
|
26
|
-
#endif
|
|
27
|
-
|
|
28
|
-
void main() {
|
|
29
|
-
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.1);
|
|
30
|
-
}`},function(d,r,t){t.r(r),r.default=`attribute vec4 a_vertexPosition;
|
|
31
|
-
attribute vec2 a_vertexTextureCoord;
|
|
32
|
-
varying vec2 vTextureCoord;
|
|
33
|
-
|
|
34
|
-
void main() {
|
|
35
|
-
gl_PointSize = 1.0;
|
|
36
|
-
gl_Position = a_vertexPosition;
|
|
37
|
-
vTextureCoord = a_vertexTextureCoord;
|
|
38
|
-
}`},function(d,r,t){t.r(r),t.d(r,"default",function(){return a});var e=t(21),n=t(25);t(1).glMatrix.setMatrixArrayType(Array);const i=Symbol("transform");class a{constructor(o,f){this.context=o.getContext("2d"),this.options=f,this[i]=[1,0,0,1,0,0]}createTexture(o){return{_img:o}}async loadTexture(o){const f=await e.default.loadImage(o,{useImageBitmap:!1});return this.createTexture(f)}deleteTexture(o){return o}clear(o,f,v,l){const p=this.context;o=o||0,f=f||0,v=v||p.canvas.width-o,l=l||p.canvas.height-f,p.clearRect(o,f,v,l)}drawMeshCloud(o,{clear:f=!1}={}){const v=[];for(let l=0;l<o.amount;l++){const p=o.getTransform(l);let y=o.getTextureFrame(l);y&&(y=y._img);const O=o.getFilter(l),{fill:x,stroke:m}=o.getCloudRGBA(l);v.push({mesh:o.mesh,_cloudOptions:[x,m,y,p,O]})}o.beforeRender&&o.beforeRender(this.context,o),this.drawMeshes(v,{clear:f,hook:!1}),o.afterRender&&o.afterRender(this.context,o)}drawMeshes(o,{clear:f=!1,hook:v=!0}={}){const l=this.context;f&&l.clearRect(0,0,l.canvas.width,l.canvas.height);let p=null;const{width:y,height:O}=l.canvas,x=o.length;o.forEach((m,T)=>{let c,h,u,g,M;v&&m.beforeRender&&m.beforeRender(l,m),m._cloudOptions&&([c,h,u,g,M]=m._cloudOptions,m=m.mesh);let A=m.filter;if(M&&(A=A?`${A} ${M}`:M),A&&!this.filterBuffer&&this.filterBuffer!==!1){const I=e.default.createCanvas(y,O);I?this.filterBuffer=I.getContext("2d"):this.filterBuffer=!1}p&&p!==A&&(Object(n.applyFilter)(this.filterBuffer,p),l.drawImage(this.filterBuffer.canvas,0,0,y,O),this.filterBuffer.clearRect(0,0,y,O),p=null),A&&this.filterBuffer?(this.filterBuffer.save(),this.filterBuffer.transform(...this[i]),Object(n.drawMesh2D)(m,this.filterBuffer,!1,c,h,u,g),this.filterBuffer.restore(),T===x-1?(Object(n.applyFilter)(this.filterBuffer,A),l.drawImage(this.filterBuffer.canvas,0,0,y,O),this.filterBuffer.clearRect(0,0,y,O)):p=A):(l.save(),l.transform(...this[i]),Object(n.drawMesh2D)(m,l,!1,c,h,u,g),l.restore()),v&&m.afterRender&&m.afterRender(l,m)})}setTransform(o){this[i]=o}}},function(d,r,t){t.r(r),(function(e){var n=t(14),i=t(23),a=t(24);t(1).glMatrix.setMatrixArrayType(Array);const s={};function o(y,O){const{style:x,variant:m,weight:T,stretch:c,size:h,pxLineHeight:u,family:g}=y;return c==="normal"?`${x} ${m} ${T} ${h*O}px/${u*O}px ${g}`:`${x} ${m} ${T} ${c} ${h*O}px/${u*O}px ${g}`}function f(y,{font:O,fillColor:x,strokeColor:m,strokeWidth:T,ratio:c=1,textCanvas:h,cachable:u=!1}){let g;if(u){g=[y,O,String(x),String(m),String(T)].join("###");const z=s[g];if(z)return z}h||(h=l(1,1));const M=h.getContext("2d");M.save(),M.font=O;let{width:A}=M.measureText(y);M.restore();const I=Object(i.default)(O),b=Math.max(I.pxLineHeight,I.pxHeight*1.13);/italic|oblique/.test(O)&&(A+=b*Math.tan(15*Math.PI/180)),!x&&!m&&(x="#000");const E=M.canvas,L=Math.ceil(A),D=Math.ceil(b);E.width=Math.round(L*c),E.height=Math.round(D*c),M.save(),M.font=o(I,c),M.textAlign="center",M.textBaseline="middle";const R=E.height*.5+I.pxHeight*.05*c,C=E.width*.5;if(x){if(Array.isArray(x))x=Object(a.default)(x);else if(x.vector){let z;const{vector:H,colors:X}=x;H.length===6?z=M.createRadialGradient(...H):z=M.createLinearGradient(...H),X.forEach(({offset:Z,color:j})=>{z.addColorStop(Z,j)}),x=z}M.fillStyle=x,M.fillText(y,C,R)}if(m){if(M.lineWidth=T*c,Array.isArray(m))m=Object(a.default)(m);else if(m.vector){let z;const{vector:H,colors:X}=m;H.length===6?z=M.createRadialGradient(...H):z=M.createLinearGradient(...H),X.forEach(({offset:Z,color:j})=>{z.addColorStop(Z,j)}),m=z}M.strokeStyle=m,M.strokeText(y,C,R)}M.restore();const W={image:h,rect:[0,0,L,D]};return u&&(s[g]=W),W}let v=!1;if(typeof navigator=="object"&&typeof navigator.userAgent=="string"){const y=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);y&&(v=Number(y[1])<70)}function l(y,O,x={}){const m=x.offscreen||!v&&x.offscreen!==!1;let T;return typeof e<"u"&&typeof e.createCanvas=="function"?T=e.createCanvas(y,O,x):m&&typeof OffscreenCanvas=="function"?T=new OffscreenCanvas(y,O):(T=document.createElement("canvas"),T.width=y,T.height=O),T}const p={createCanvas:l,createText:f,loadImage:n.default.loadImage};r.default=p}).call(this,t(22))},function(d,r){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch{typeof window=="object"&&(t=window)}d.exports=t},function(d,r,t){t.r(r),t.d(r,"default",function(){return x}),t(1).glMatrix.setMatrixArrayType(Array);function e(m,T){if(typeof m=="string"){const u=m.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);u?m={size:parseFloat(u[1]),unit:u[2]}:m={size:parseInt(m,10),unit:"px"}}let{size:c,unit:h}=m;if(h==="pt")c/=.75;else if(h==="pc")c*=16;else if(h==="in")c*=96;else if(h==="cm")c*=96/2.54;else if(h==="mm")c*=96/25.4;else if(h==="em"||h==="rem"||h==="ex"){if(!T&&typeof getComputedStyle=="function"&&typeof document<"u"){const u=getComputedStyle(document.documentElement).fontSize;T=e(u,16)}c*=T,h==="ex"&&(c/=2)}else if(h==="q")c*=96/25.4/4;else if(h==="vw"||h==="vh"){if(typeof document<"u"){const u=h==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;c*=u/100}}else if((h==="vmax"||h==="vmin")&&typeof document<"u"){const u=document.documentElement.clientWidth,g=document.documentElement.clientHeight;h==="vmax"?c*=Math.max(u,g)/100:c*=Math.min(u,g)/100}return c}const n="bold|bolder|lighter|[1-9]00",i="italic|oblique",a="small-caps",s="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",o="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",f=`'([^']+)'|"([^"]+)"|([\\w-]|[一-龥])+`,v=new RegExp(`(${n}) +`,"i"),l=new RegExp(`(${i}) +`,"i"),p=new RegExp(`(${a}) +`,"i"),y=new RegExp(`(${s}) +`,"i"),O=new RegExp("([\\d\\.]+)("+o+")(?:\\/([\\d\\.]+)("+o+"))? *((?:"+f+")( *, *(?:"+f+"))*)");function x(m,T){const c=O.exec(m);if(!c)return;const h=parseFloat(c[3]),u={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(c[1]),unit:c[2],lineHeight:Number.isFinite(h)?h:void 0,lineHeightUnit:c[4],family:c[5].replace(/ *, */g,",")},g=m.substring(0,c.index),M=v.exec(g),A=l.exec(g),I=p.exec(g),b=y.exec(g);return M&&(u.weight=M[1]),A&&(u.style=A[1]),I&&(u.variant=I[1]),b&&(u.stretch=b[1]),u.pxHeight=e({size:u.size,unit:u.unit},T),u.pxLineHeight=e({size:u.lineHeight||u.size,unit:u.lineHeightUnit||u.unit},T),u}},function(d,r,t){t.r(r),t.d(r,"default",function(){return e}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return`rgba(${n.map((i,a)=>a<3?Math.round(i*255):i).join()})`}},function(d,r,t){t.r(r),t.d(r,"applyFilter",function(){return s}),t.d(r,"drawMesh2D",function(){return f});var e=t(1),n=t(24),i=t(23),a=t(26);t(1).glMatrix.setMatrixArrayType(Array);function s(v,l){const p=v.canvas;v.save(),v.filter=l,v.drawImage(p,0,0,p.width,p.height),v.restore()}function o(v,l){const p=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;v=v.match(p).slice(1,5).map(Number),l=l.match(p).slice(1,5).map(Number);const y=[],O=l[3];for(let x=0;x<4;x++)y[x]=Object(a.mix)(v[x],l[x],O);return`rgba(${y.join()})`}function f(v,l,p=!0,y=null,O=null,x=null,m=null){l.save();let T=!1,c=!1;if(l.globalAlpha=v.getOpacity(),v._updateMatrix&&v.transformScale/v.contours.scale>1.5&&v.accurate(v.transformScale),v.lineWidth){let g=v.gradient&&v.gradient.stroke;if(g){const{vector:M,colors:A}=g;if(M.length===6)g=l.createRadialGradient(...M);else if(M.length===4)g=l.createLinearGradient(...M);else if(M.length===3)g=l.createCircularGradient(...M);else throw new TypeError("Invalid vector dimension.");A.forEach(({offset:I,color:b})=>{let E=Object(n.default)(b);O&&(E=o(E,O)),g.addColorStop(I,E)}),l.strokeStyle=g,T=!0}else v.strokeStyle&&(O?l.strokeStyle=o(v.strokeStyle,O):l.strokeStyle=v.strokeStyle,T=!0)}T&&(l.lineWidth=v.lineWidth,l.lineJoin=v.lineJoin,l.lineCap=v.lineCap,l.miterLimit=v.miterLimit,v.lineDash&&(l.setLineDash(v.lineDash),v.lineDashOffset&&(l.lineDashOffset=v.lineDashOffset)));let h=v.gradient&&v.gradient.fill;if(h){const{vector:g,colors:M}=h;if(g.length===6)h=l.createRadialGradient(...g);else if(g.length===4)h=l.createLinearGradient(...g);else if(g.length===3)h=l.createCircularGradient(...g);else throw new TypeError("Invalid vector dimension.");M.forEach(({offset:A,color:I})=>{let b=Object(n.default)(I);O&&(b=o(b,O)),h.addColorStop(A,b)}),l.fillStyle=h,c=!0}else v.fillStyle&&(y?l.fillStyle=o(v.fillStyle,y):l.fillStyle=v.fillStyle,c=!0);if(m&&l.transform(...m),l.transform(...v.transformMatrix),v.clipPath){const g=v.clipPath,M=new Path2D(g);l.clip(M)}const u=v.contours.length;if(v.contours.forEach((g,M)=>{const A=g.length,I=A>1&&e.vec2.equals(g[0],g[A-1]),b=M===u-1&&v.texture;if(g&&A>0){if(c||T||b){l.beginPath(),l.moveTo(...g[0]);for(let E=1;E<A;E++)E===A-1&&I?l.closePath():l.lineTo(...g[E])}if(c&&l.fill(v.fillRule),b){l.save(),l.clip();let{image:E,options:L}=v.texture;if(x&&(E=x),L.repeat&&console.warn("Context 2D not supported image repeat yet."),E.font){L.scale&&console.warn("Context 2D not supported text scale yet."),L.srcRect&&console.warn("Context 2D not supported text srcRect yet.");let{font:D,fillColor:R,strokeColor:C,strokeWidth:W,text:z}=E;!R&&!C&&(R="#000"),Array.isArray(R)&&(R=Object(n.default)(R)),Array.isArray(C)&&(C=Object(n.default)(C)),l.font=D;const{width:H}=l.measureText(z),X=Object(i.default)(D),Z=Math.max(X.pxLineHeight,X.pxHeight*1.13);l.textAlign="center",l.textBaseline="middle";const j=L.rect,G=j[0]+Z*.5+X.pxHeight*.06,Q=j[1]+H*.5;j[2]!=null&&l.scale(j[2]/H,j[3]/Z),R&&(l.fillStyle=R,l.fillText(z,Q,G)),C&&(l.lineWidth=W,l.strokeStyle=C,l.strokeText(z,Q,G))}else{let D=L.rect;const R=L.srcRect;L.scale&&(D=[0,0,l.canvas.width,l.canvas.height]),L.rotated&&D&&(D=[-D[1],D[0],D[3],D[2]]),R&&(D=D||[0,0,R[2],R[3]]),L.rotated&&(l.translate(0,D?D[2]:E.width),l.rotate(-.5*Math.PI)),R?l.drawImage(E,...R,...D):D?l.drawImage(E,...D):l.drawImage(E,0,0)}l.restore()}T&&l.stroke()}}),l.restore(),p){const g=v.filter;g&&s(l,g)}}},function(d,r,t){t.r(r),t.d(r,"clamp",function(){return e}),t.d(r,"mix",function(){return n}),t.d(r,"transformPoint",function(){return i}),t(1).glMatrix.setMatrixArrayType(Array);function e(a,s,o){return s>o&&([s,o]=[o,s]),a<s?s:a>o?o:a}function n(a,s,o){return a*(1-o)+s*o}function i(a,s){const[o,f]=a;return[o*s[0]+f*s[2]+s[4],o*s[1]+f*s[3]+s[5]]}},function(d,r,t){t.r(r),t.d(r,"default",function(){return o});var e=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function i(f,v,l){const p=f.uniforms||{},y=v.uniforms||{};if(p.u_texSampler&&y.u_texSampler&&p.u_texSampler!==y.u_texSampler)return!1;const O=Object.keys(p),x=Object.keys(y),m=O.indexOf("u_texSampler"),T=x.indexOf("u_texSampler");if(m>=0&&O.splice(m,1),T>=0&&x.splice(T,1),O.length!==x.length)return!1;const c=O.every(h=>{const u=p[h],g=y[h];if(u===g)return!0;if(u.length&&g.length&&u.length===g.length){for(let M=0;M<u.length;M++)if(u[M]!==g[M])return!1;return!0}return!1});if(c){if(p.u_texSampler&&!y.u_texSampler)v.setTexture(p.u_texSampler,{hidden:!0});else if(!p.u_texSampler&&y.u_texSampler)for(let h=0;h<l.length;h++)l[h].setTexture(y.u_texSampler,{hidden:!0})}return c}const a={};function s(f,v){if(f.length){const l=Object(e.default)(f,a);return l.enableBlend=v,f[0].filterCanvas&&(l.filterCanvas=!0),l.packIndex=f[0].packIndex,l.packLength=f.length,l.beforeRender=f[0].beforeRender,l.pass=f[0].pass,l.afterRender=f[f.length-1].afterRender,f.length=0,l}}function*o(f,v,l=!1){const p=[],y=f.options.bufferSize;let O=0,x=!1;for(let m=0;m<v.length;m++){const T=v[m];if(T instanceof n.default)p.length&&(yield s(p,x)),O=0,x=!1,yield T;else{const c=T.meshData;if(c.clipPath&&!c.uniforms.u_clipSampler){const u=f.createTexture(c.clipPath);c.uniforms.u_clipSampler=u}let h=0;if((!l||!T.canIgnore())&&c&&c.positions.length){T.packIndex=m;const u=T.filterCanvas;if(h=c.positions.length,u||O+h>y)p.length&&(yield s(p,x)),O=0,x=!1;else if(O){const g=p[p.length-1];g&&(g.filterCanvas||g.afterRender||T.beforeRender||g.pass.length||T.pass.length||g.program!==T.program||!i(g,T,p))&&(yield s(p,x),O=0,x=!1)}p.push(T),x=x||T.enableBlend,O+=h}m===v.length-1&&p.length&&(yield s(p,x))}}}},function(d,r,t){t.r(r),t.d(r,"default",function(){return i}),t(1).glMatrix.setMatrixArrayType(Array);const e={UNSIGNED_BYTE:Uint8Array,UNSIGNED_SHORT:Uint16Array,BYTE:Int8Array,SHORT:Int16Array,FLOAT:Float32Array};function n(a,s){let o=0,f=0,v=0,l=0,p=0,y=0,O=0;const x=a[0].program;for(let m=0;m<a.length;m++){const T=a[m].meshData;if(T){O+=T.positions.length;const c=T.positions[0].length;o+=T.positions.length*c,f+=T.cells.length*3,y+=T.attributes.a_color.length*4;const h=T.textureCoord;h&&(v+=h.length*h[0].length);const u=T.attributes.a_sourceRect;u&&(l+=u.length*4);const g=T.attributes.a_clipUV;g&&(p+=g.length*2)}}if((!s.positions||s.positions.length<o)&&(s.positions=new Float32Array(o)),(!s.cells||s.cells.length<f)&&(s.cells=new Uint16Array(f)),v&&(!s.textureCoord||s.textureCoord.length<v)&&(s.textureCoord=new Float32Array(v)),(!s.a_color||s.a_color.length<y)&&(s.a_color=new Uint8Array(y)),l&&(!s.a_sourceRect||s.a_sourceRect.length<l)&&(s.a_sourceRect=new Float32Array(l)),p&&(!s.a_clipUV||s.a_clipUV.length<p)&&(s.a_clipUV=new Float32Array(p)),x){const m=Object.entries(x._attribute),T=x._attribOpts||{};for(let c=0;c<m.length;c++){const[h,u]=m[c];if(h!=="a_color"&&h!=="a_sourceRect"&&u!=="ignored"){const g=T[h]?T[h].type:"FLOAT",M=e[g],A=u.size*O;(!s[h]||s[h].length<A)&&(s[h]=new M(A))}}}return s}function i(a,s){let o=[],f=[],v=[],l=[],p=[],y=[],O=0,x=0;const m=a[0]?a[0].uniforms||{}:{},T=a[0]?a[0].program:null;s&&(n(a,s),f=s.cells,o=s.positions,v=s.textureCoord,l=s.a_color,p=s.a_sourceRect,y=s.a_clipUV);let c=!1,h=!1;const u={};for(let M=0;M<a.length;M++){let A=a[M];if(A){if(A.meshData&&(A=A.meshData),s){const b=A.positions;for(let E=0;E<b.length;E++){const L=b[E],D=3*(O+E);for(let R=0;R<L.length;R++)o[D+R]=L[R]}}else o.push(...A.positions);const I=A.cells;for(let b=0;b<I.length;b++){const E=I[b];if(s){const L=3*(x+b);f[L]=E[0]+O,f[L+1]=E[1]+O,f[L+2]=E[2]+O}else f.push([E[0]+O,E[1]+O,E[2]+O])}if(s){const b=A.attributes.a_color;for(let E=0;E<b.length;E++){const L=b[E],D=4*(O+E);l[D]=L[0],l[D+1]=L[1],l[D+2]=L[2],l[D+3]=L[3]}}else l.push(...A.attributes.a_color);if(A.attributes.a_sourceRect)if(c=!0,s){const b=A.attributes.a_sourceRect;for(let E=0;E<b.length;E++){const L=b[E],D=4*(O+E);p[D]=L[0],p[D+1]=L[1],p[D+2]=L[2],p[D+3]=L[3]}}else p.push(...A.attributes.a_sourceRect);if(A.attributes.a_clipUV)if(h=!0,s){const b=A.attributes.a_clipUV;for(let E=0;E<b.length;E++){const L=b[E],D=2*(O+E);y[D]=L[0],y[D+1]=L[1]}}else y.push(...A.attributes.a_clipUV);if(A.textureCoord)if(s){const b=A.textureCoord;for(let E=0;E<b.length;E++){const L=b[E],D=3*(O+E);for(let R=0;R<L.length;R++)v[D+R]=L[R]}}else v.push(...A.textureCoord);if(T){const b=Object.entries(T._attribute);for(let E=0;E<b.length;E++){const[L,D]=b[E];if(L!=="a_color"&&L!=="a_sourceRect"&&D!=="ignored")if(u[L]=[],s){u[L]=s[L];const R=A.attributes[L],C=R[0].length;for(let W=0;W<R.length;W++){const z=R[W],H=C*(O+W);for(let X=0;X<z.length;X++)u[L][H+X]=z[X]}}else u[L].push(...A.attributes[L])}}O+=A.positions.length,x+=A.cells.length}}u.a_color=l,c&&p&&p.length>0&&(u.a_sourceRect=p);const g={positions:o,cells:f,attributes:u,uniforms:m,cellsCount:x*3,program:T};return v&&v.length&&(g.textureCoord=v),h&&y.length>0&&(u.a_clipUV=y),g}},function(d,r,t){t.r(r);var e=t(1),n=t(30),i=t(26),a=t(31);t(1).glMatrix.setMatrixArrayType(Array);function s(u,g){var M=Object.keys(u);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(u);g&&(A=A.filter(function(I){return Object.getOwnPropertyDescriptor(u,I).enumerable})),M.push.apply(M,A)}return M}function o(u){for(var g=1;g<arguments.length;g++){var M=arguments[g]!=null?arguments[g]:{};g%2?s(Object(M),!0).forEach(function(A){f(u,A,M[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(M)):s(Object(M)).forEach(function(A){Object.defineProperty(u,A,Object.getOwnPropertyDescriptor(M,A))})}return u}function f(u,g,M){return g in u?Object.defineProperty(u,g,{value:M,enumerable:!0,configurable:!0,writable:!0}):u[g]=M,u}const v=Symbol("mesh"),l=Symbol("count"),p=Symbol("blend"),y=Symbol("filter"),O=Symbol("textures"),x=Symbol("textureOptions"),m=Symbol("cloudColor"),T=Symbol("cloudFilter"),c=Symbol("buffer");function h(u,g=null){const M=new Float32Array(3*u),A=new Float32Array(3*u),I=new Float32Array(4*u),b=new Float32Array(4*u),E=new Float32Array(4*u),L=new Float32Array(4*u),D=new Float32Array(4*u),R=new Uint8Array(u),C=new Uint8Array(4*u),W=new Uint8Array(4*u);return g&&(M.set(g.transform0,0),A.set(g.transform1,0),I.set(g.color0,0),b.set(g.color1,0),E.set(g.color2,0),L.set(g.color3,0),D.set(g.color4,0),R.set(g.frameIndex,0),C.set(g.fillColor,0),W.set(g.strokeColor,0)),{bufferSize:u,transform0:M,transform1:A,color0:I,color1:b,color2:E,color3:L,color4:D,frameIndex:R,fillColor:C,strokeColor:W}}r.default=class{constructor(u,g=1,{buffer:M=1e3}={}){M=Math.max(M,g),this[l]=g,this[v]=u,this[c]=h(M),this[O]=[],this[y]=[],this[m]=!1,this[T]=!1,this[p]=!1,this.initBuffer()}initBuffer(u=0){const g=this[l];for(let M=u;M<g;M++)this[c].transform0.set([1,0,0],M*3),this[c].transform1.set([0,1,0],M*3),this[c].frameIndex.set([-1],M),this[c].fillColor.set([0,0,0,0],M*4),this[c].strokeColor.set([0,0,0,0],M*4),this.setColorTransform(M,null)}get bufferSize(){return this[c].bufferSize}get mesh(){return this[v]}set mesh(u){this[v]=u,this[O]&&this.setTextureFrames(this[O],this[x])}get hasCloudColor(){return this[m]}get hasCloudFilter(){return this[T]}_getFilter(u){return this[y][u]=this[y][u]||[],this[y][u]}getFilter(u){return this._getFilter(u).join(" ")}get enableBlend(){return this[v].enableBlend||this[p]}canIgnore(){return this[v].canIgnore()}delete(u){if(u>=this[l]||u<0)throw new Error("Out of range.");const{transform0:g,transform1:M,color0:A,color1:I,color2:b,color3:E,color4:L,frameIndex:D,fillColor:R,strokeColor:C}=this[c];g.set(g.subarray(3*(u+1)),3*u),M.set(M.subarray(3*(u+1)),3*u),A.set(A.subarray(4*(u+1)),4*u),I.set(I.subarray(4*(u+1)),4*u),b.set(b.subarray(4*(u+1)),4*u),E.set(E.subarray(4*(u+1)),4*u),L.set(L.subarray(4*(u+1)),4*u),D.set(D.subarray(u+1),u),R.set(R.subarray(4*(u+1)),4*u),C.set(C.subarray(4*(u+1)),4*u);for(const W in this[y])W===u?delete this[y][W]:W>u&&(this[y][W-1]=this[y][W],delete this[y][W]);this[l]--}setColorTransform(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=4;const{color0:M,color1:A,color2:I,color3:b,color4:E}=this[c];return g!=null?(M.set([g[0],g[5],g[10],g[15]],u),A.set([g[1],g[6],g[11],g[16]],u),I.set([g[2],g[7],g[12],g[17]],u),b.set([g[3],g[8],g[13],g[18]],u),E.set([g[4],g[9],g[14],g[19]],u),this[p]=this[p]||g[18]<1,this[T]=!0):(M.set([1,0,0,0],u),A.set([0,1,0,0],u),I.set([0,0,1,0],u),b.set([0,0,0,1],u),E.set([0,0,0,0],u)),this}getColorTransform(u){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=4;const{color0:g,color1:M,color2:A,color3:I,color4:b}=this[c];return[g[u],M[u],A[u],I[u],b[u],g[u+1],M[u+1],A[u+1],I[u+1],b[u+1],g[u+2],M[u+2],A[u+2],I[u+2],b[u+2],g[u+3],M[u+3],A[u+3],I[u+3],b[u+3]]}transformColor(u,g){let M=this.getColorTransform(u);return M=Object(n.multiply)(M,g),this.setColorTransform(u,M),this}setFillColor(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a.default)(g)),g[3]>0&&(this[m]=!0),this[c].fillColor.set(g.map(M=>Math.round(255*M)),4*u)}setStrokeColor(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a.default)(g)),g[3]>0&&(this[m]=!0),this[c].strokeColor.set(g.map(M=>Math.round(255*M)),4*u)}getCloudRGBA(u){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=4;const{fillColor:g,strokeColor:M}=this[c],A=[g[u],g[u+1],g[u+2],g[u+3]],I=[M[u],M[u+1],M[u+2],M[u+3]];return A[3]/=255,I[3]/=255,{fill:`rgba(${A.join()})`,stroke:`rgba(${I.join()})`}}grayscale(u,g){this.transformColor(u,Object(n.grayscale)(g)),this._getFilter(u).push(`grayscale(${100*g}%)`)}brightness(u,g){this.transformColor(u,Object(n.brightness)(g)),this._getFilter(u).push(`brightness(${100*g}%)`)}saturate(u,g){this.transformColor(u,Object(n.saturate)(g)),this._getFilter(u).push(`saturate(${100*g}%)`)}contrast(u,g){this.transformColor(u,Object(n.contrast)(g)),this._getFilter(u).push(`contrast(${100*g}%)`)}invert(u,g){this.transformColor(u,Object(n.invert)(g)),this._getFilter(u).push(`invert(${100*g}%)`)}sepia(u,g){this.transformColor(u,Object(n.sepia)(g)),this._getFilter(u).push(`sepia(${100*g}%)`)}opacity(u,g){this.transformColor(u,Object(n.opacity)(g)),this._getFilter(u).push(`opacity(${100*g}%)`)}hueRotate(u,g){this.transformColor(u,Object(n.hueRotate)(g)),this._getFilter(u).push(`hue-rotate(${g}deg)`)}setTransform(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=3,g==null&&(g=[1,0,0,1,0,0]);const{transform0:M,transform1:A}=this[c];return M.set([g[0],g[2],g[4]],u),A.set([g[1],g[3],g[5]],u),this}getTransform(u){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=3;const{transform0:g,transform1:M}=this[c];return[g[u],M[u],g[u+1],M[u+1],g[u+2],M[u+2]]}getTextureFrame(u){return this[O][this[c].frameIndex[u]]}setTextureFrames(u=[],g={}){if(u.length>12)throw new Error("Max frames exceed. Allow 12 frames.");u.length&&this[v].setTexture(u[0],g),this[O]=u,this[x]=g}setFrameIndex(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");const M=this[O].length;if(M<=0)throw new Error("No frames");this[c].frameIndex[u]=g%M}get amount(){return this[l]}set amount(u){const g=this[l];u!==g&&(u>this[c].bufferSize&&(this[c]=h(Math.max(u,this[c].bufferSize+1e3),this[c])),this[l]=u,u>g&&this.initBuffer(g))}get meshData(){const{attributes:u,cells:g,positions:M,textureCoord:A,uniforms:I}=this[v].meshData,b=this[O],E={attributes:o({},u),cells:g,positions:M,textureCoord:A,uniforms:o({},I),instanceCount:this[l],enableBlend:this.enableBlend};b.length&&b.forEach((G,Q)=>{E.uniforms[`u_texFrame${Q}`]=G});const{transform0:L,transform1:D,color0:R,color1:C,color2:W,color3:z,color4:H,fillColor:X,strokeColor:Z,frameIndex:j}=this[c];return this[v].uniforms.u_texSampler&&(E.attributes.a_frameIndex={data:j,divisor:1}),E.attributes.a_transform0={data:L,divisor:1},E.attributes.a_transform1={data:D,divisor:1},E.attributes.a_colorCloud0={data:R,divisor:1},E.attributes.a_colorCloud1={data:C,divisor:1},E.attributes.a_colorCloud2={data:W,divisor:1},E.attributes.a_colorCloud3={data:z,divisor:1},E.attributes.a_colorCloud4={data:H,divisor:1},this.hasCloudColor&&(E.attributes.a_fillCloudColor={data:X,divisor:1},E.attributes.a_strokeCloudColor={data:Z,divisor:1}),E}setProgram(u){this[v].setProgram(u)}get program(){return this[v].program}transform(u,g){const M=this.getTransform(u);return g=e.mat2d.multiply(Array.of(0,0,0,0,0,0),M,g),this.setTransform(u,g),this}translate(u,[g,M]){let A=e.mat2d.create();return A=e.mat2d.translate(Array.of(0,0,0,0,0,0),A,[g,M]),this.transform(u,A)}rotate(u,g,[M,A]=[0,0]){let I=e.mat2d.create();return I=e.mat2d.translate(Array.of(0,0,0,0,0,0),I,[M,A]),I=e.mat2d.rotate(Array.of(0,0,0,0,0,0),I,g),I=e.mat2d.translate(Array.of(0,0,0,0,0,0),I,[-M,-A]),this.transform(u,I)}scale(u,[g,M=g],[A,I]=[0,0]){let b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,I]),b=e.mat2d.scale(Array.of(0,0,0,0,0,0),b,[g,M]),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-A,-I]),this.transform(u,b)}skew(u,[g,M=g],[A,I]=[0,0]){let b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,I]),b=e.mat2d.multiply(Array.of(0,0,0,0,0,0),b,e.mat2d.fromValues(1,Math.tan(M),Math.tan(g),1,0,0)),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-A,-I]),this.transform(u,b)}isPointCollision(u,[g,M],A="both"){const I=this.getTransform(u),b=Object(i.transformPoint)([g,M],e.mat2d.invert(Array.of(0,0,0,0,0,0),I));return this[v].isPointCollision(...b,A)}isPointInFill(u,[g,M]){return this.isPointCollision(u,[g,M],"fill")}isPointInStroke(u,[g,M]){return this.isPointCollision(u,[g,M],"stroke")}}},function(d,r,t){t.r(r),t.d(r,"multiply",function(){return n}),t.d(r,"grayscale",function(){return i}),t.d(r,"brightness",function(){return a}),t.d(r,"saturate",function(){return s}),t.d(r,"contrast",function(){return o}),t.d(r,"invert",function(){return f}),t.d(r,"sepia",function(){return v}),t.d(r,"opacity",function(){return l}),t.d(r,"hueRotate",function(){return p});var e=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(y,O){const x=[],m=y[0],T=y[1],c=y[2],h=y[3],u=y[4],g=y[5],M=y[6],A=y[7],I=y[8],b=y[9],E=y[10],L=y[11],D=y[12],R=y[13],C=y[14],W=y[15],z=y[16],H=y[17],X=y[18],Z=y[19];let j=O[0],G=O[1],Q=O[2],tt=O[3],et=O[4];return x[0]=j*m+G*g+Q*E+tt*W,x[1]=j*T+G*M+Q*L+tt*z,x[2]=j*c+G*A+Q*D+tt*H,x[3]=j*h+G*I+Q*R+tt*X,x[4]=j*u+G*b+Q*C+tt*Z+et,j=O[5],G=O[6],Q=O[7],tt=O[8],et=O[9],x[5]=j*m+G*g+Q*E+tt*W,x[6]=j*T+G*M+Q*L+tt*z,x[7]=j*c+G*A+Q*D+tt*H,x[8]=j*h+G*I+Q*R+tt*X,x[9]=j*u+G*b+Q*C+tt*Z+et,j=O[10],G=O[11],Q=O[12],tt=O[13],et=O[14],x[10]=j*m+G*g+Q*E+tt*W,x[11]=j*T+G*M+Q*L+tt*z,x[12]=j*c+G*A+Q*D+tt*H,x[13]=j*h+G*I+Q*R+tt*X,x[14]=j*u+G*b+Q*C+tt*Z+et,j=O[15],G=O[16],Q=O[17],tt=O[18],et=O[19],x[15]=j*m+G*g+Q*E+tt*W,x[16]=j*T+G*M+Q*L+tt*z,x[17]=j*c+G*A+Q*D+tt*H,x[18]=j*h+G*I+Q*R+tt*X,x[19]=j*u+G*b+Q*C+tt*Z+et,x}function i(y){y=Object(e.clamp)(0,1,y);const O=.2126*y,x=.7152*y,m=.0722*y;return[O+1-y,x,m,0,0,O,x+1-y,m,0,0,O,x,m+1-y,0,0,0,0,0,1,0]}function a(y){return[y,0,0,0,0,0,y,0,0,0,0,0,y,0,0,0,0,0,1,0]}function s(y){const O=.2126*(1-y),x=.7152*(1-y),m=.0722*(1-y);return[O+y,x,m,0,0,O,x+y,m,0,0,O,x,m+y,0,0,0,0,0,1,0]}function o(y){const O=.5*(1-y);return[y,0,0,0,O,0,y,0,0,O,0,0,y,0,O,0,0,0,1,0]}function f(y){const O=1-2*y;return[O,0,0,0,y,0,O,0,0,y,0,0,O,0,y,0,0,0,1,0]}function v(y){return[1-.607*y,.769*y,.189*y,0,0,.349*y,1-.314*y,.168*y,0,0,.272*y,.534*y,1-.869*y,0,0,0,0,0,1,0]}function l(y){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,y,0]}function p(y){const O=y/180*Math.PI,x=Math.cos(O),m=Math.sin(O),T=.2126,c=.7152,h=.0722;return[T+x*(1-T)+m*-T,c+x*-c+m*-c,h+x*-h+m*(1-h),0,0,T+x*-T+m*.143,c+x*(1-c)+m*.14,h+x*-h+m*-.283,0,0,T+x*-T+m*-(1-T),c+x*-c+m*c,h+x*(1-h)+m*h,0,0,0,0,0,1,0]}},function(d,r,t){t.r(r),t.d(r,"default",function(){return i});var e=t(32),n=t.n(e);t(1).glMatrix.setMatrixArrayType(Array);function i(a){const s=n()(a);if(!s||!s.length)throw new TypeError("Invalid color value.");return[s[0]/255,s[1]/255,s[2]/255,s[3]]}},function(d,r,t){var e=t(33),n=t(37),i=t(39);d.exports=function(s){var o,f=e(s);return f.space?(o=Array(3),o[0]=i(f.values[0],0,255),o[1]=i(f.values[1],0,255),o[2]=i(f.values[2],0,255),f.space[0]==="h"&&(o=n.rgb(o)),o.push(i(f.alpha,0,1)),o):[]}},function(d,r,t){(function(e){var n=t(34),i=t(35),a=t(36);d.exports=o;var s={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function o(f){var v,l=[],p=1,y;if(typeof f=="string")if(n[f])l=n[f].slice(),y="rgb";else if(f==="transparent")p=0,y="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(f)){var O=f.slice(1),x=O.length,m=x<=4;p=1,m?(l=[parseInt(O[0]+O[0],16),parseInt(O[1]+O[1],16),parseInt(O[2]+O[2],16)],x===4&&(p=parseInt(O[3]+O[3],16)/255)):(l=[parseInt(O[0]+O[1],16),parseInt(O[2]+O[3],16),parseInt(O[4]+O[5],16)],x===8&&(p=parseInt(O[6]+O[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),y="rgb"}else if(v=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(f)){var T=v[1],c=T==="rgb",O=T.replace(/a$/,"");y=O;var x=O==="cmyk"?4:O==="gray"?1:3;l=v[2].trim().split(/\s*,\s*/).map(function(M,A){if(/%$/.test(M))return A===x?parseFloat(M)/100:O==="rgb"?parseFloat(M)*255/100:parseFloat(M);if(O[A]==="h"){if(/deg$/.test(M))return parseFloat(M);if(s[M]!==void 0)return s[M]}return parseFloat(M)}),T===O&&l.push(1),p=c||l[x]===void 0?1:l[x],l=l.slice(0,x)}else f.length>10&&/[0-9](?:\s|\/)/.test(f)&&(l=f.match(/([0-9]+)/g).map(function(u){return parseFloat(u)}),y=f.match(/([a-z])/ig).join("").toLowerCase());else if(!isNaN(f))y="rgb",l=[f>>>16,(f&65280)>>>8,f&255];else if(i(f)){var h=a(f.r,f.red,f.R,null);h!==null?(y="rgb",l=[h,a(f.g,f.green,f.G),a(f.b,f.blue,f.B)]):(y="hsl",l=[a(f.h,f.hue,f.H),a(f.s,f.saturation,f.S),a(f.l,f.lightness,f.L,f.b,f.brightness)]),p=a(f.a,f.alpha,f.opacity,1),f.opacity!=null&&(p/=100)}else(Array.isArray(f)||e.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(f))&&(l=[f[0],f[1],f[2]],y="rgb",p=f.length===4?f[3]:1);return{space:y,values:l,alpha:p}}}).call(this,t(22))},function(d,r,t){d.exports={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]}},function(d,r,t){var e=Object.prototype.toString;d.exports=function(n){var i;return e.call(n)==="[object Object]"&&(i=Object.getPrototypeOf(n),i===null||i===Object.getPrototypeOf({}))}},function(d,r){d.exports=function(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==void 0)return arguments[t]}},function(d,r,t){var e=t(38);d.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(n){var i=n[0]/360,a=n[1]/100,s=n[2]/100,o,f,v,l,p;if(a===0)return p=s*255,[p,p,p];s<.5?f=s*(1+a):f=s+a-s*a,o=2*s-f,l=[0,0,0];for(var y=0;y<3;y++)v=i+1/3*-(y-1),v<0?v++:v>1&&v--,6*v<1?p=o+(f-o)*6*v:2*v<1?p=f:3*v<2?p=o+(f-o)*(2/3-v)*6:p=o,l[y]=p*255;return l}},e.hsl=function(n){var i=n[0]/255,a=n[1]/255,s=n[2]/255,o=Math.min(i,a,s),f=Math.max(i,a,s),v=f-o,l,p,y;return f===o?l=0:i===f?l=(a-s)/v:a===f?l=2+(s-i)/v:s===f&&(l=4+(i-a)/v),l=Math.min(l*60,360),l<0&&(l+=360),y=(o+f)/2,f===o?p=0:y<=.5?p=v/(f+o):p=v/(2-f-o),[l,p*100,y*100]}},function(d,r,t){d.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},function(d,r){d.exports=t;function t(e,n,i){return n<i?e<n?n:e>i?i:e:e<i?i:e>n?n:e}},function(d,r,t){t.r(r),t.d(r,"default",function(){return h});var e=t(41),n=t.n(e),i=t(42),a=t.n(i),s=t(43),o=t.n(s),f=t(44),v=t(46),l=t.n(v),p=t(53),y=t(55);t(1).glMatrix.setMatrixArrayType(Array);const O=Symbol("contours"),x=Symbol("path"),m=Symbol("simplify"),T=Symbol("scale"),c=2*Math.PI;class h{constructor(g={}){typeof g=="string"&&(g={path:g}),g.path?this[x]=n()(g.path):this[x]=[],this[O]=null,this[m]=g.simplify!=null?g.simplify:0,this[T]=g.scale!=null?g.scale:2}get contours(){let g=null;if(!this[O]&&this[x]){const M=Object(f.default)(o()(this[x]));this[O]=l()(M,this[T],this[m]),this[O].path=M,this[O].simplify=this[m],this[O].scale=this[T]}return this[O]&&(g=this[O].map(M=>[...M]),g.path=this[O].path,g.simplify=this[O].simplify,g.scale=this[O].scale),g}get path(){return this[x]}get simplify(){return this[m]}get boundingBox(){const g=this.contours;if(g&&g.length){const M=g.reduce((A,I)=>[...A,...I]);return a()(M)}return[[0,0],[0,0]]}get boundingCenter(){const g=this.boundingBox;return g?[.5*(g[0][0]+g[1][0]),.5*(g[0][1]+g[1][1])]:[0,0]}normalize(g=0,M=0){const A=Object(f.default)(o()(this[x])).map(([I,...b])=>{const E=[I];for(let L=0;L<b.length;L+=2){const D=b[L]-g,R=b[L+1]-M;E.push(D,R)}return E});return this.beginPath(),this[x].push(...A),this}getPointAtLength(g){return this.contours?Object(p.getPointAtLength)(this[O],g):null}getTotalLength(){return this.contours?Object(p.getTotalLength)(this[O]):0}addPath(g){this[O]=null,typeof g=="string"&&(g=n()(g)),this[x].push(...g)}beginPath(){this[x]=[],this[O]=null}clear(){this.beginPath()}ellipse(g,M,A,I,b,E,L,D=0){if(E+=b,L+=b,A<=0||I<=0||L===E)return;L<E&&(L=E+c+(L-E)%c),L-E>c&&(L=E+c);const R=L-E;R>=c&&(L-=.001);let C=this[x].length>0&&R<c?"L":"M";const W=Object(y.getPoint)(g,M,A,I,E),z=Object(y.getPoint)(g,M,A,I,L),H=+!D;let X=R>Math.PI?1:0;D&&(X=1-X),C+=W.join(" "),C+=`A${A} ${I} 0 ${X} ${H} ${z.join(" ")}`,R>=c&&(C+="Z"),this.addPath(C)}arc(g,M,A,I,b,E=0){return this.ellipse(g,M,A,A,0,I,b,E)}arcTo(g,M,A,I,b,E,L){this[O]=null,this[x].push(["A",g,M,A,I,b,E,L])}moveTo(g,M){this[O]=null,this[x].push(["M",g,M])}lineTo(g,M){this[O]=null,this[x].push(["L",g,M])}bezierCurveTo(g,M,A,I,b,E){this[O]=null,this[x].push(["C",g,M,A,I,b,E])}quadraticCurveTo(g,M,A,I){this[O]=null,this[x].push(["Q",g,M,A,I])}rect(g,M,A,I){const b=`M${g} ${M}L${g+A} ${M}L${g+A} ${M+I}L${g} ${M+I}Z`;this.addPath(b)}closePath(){this[O]=null;let g=[];const M=this[x].length;M>0&&(g=this[x][M-1]),g[0]!=="Z"&&g[0]!=="z"&&this[x].push(["Z"])}}},function(d,r){d.exports=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(s){var o=[];return s.replace(e,function(f,v,l){var p=v.toLowerCase();for(l=a(l),p=="m"&&l.length>2&&(o.push([v].concat(l.splice(0,2))),p="l",v=v=="m"?"l":"L");;){if(l.length==t[p])return l.unshift(v),o.push(l);if(l.length<t[p])throw new Error("malformed path data");o.push([v].concat(l.splice(0,t[p])))}}),o}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function a(s){var o=s.match(i);return o?o.map(Number):[]}},function(d,r,t){d.exports=e;function e(n){var i=n.length;if(i===0)return[[],[]];for(var a=n[0].length,s=n[0].slice(),o=n[0].slice(),f=1;f<i;++f)for(var v=n[f],l=0;l<a;++l){var p=v[l];s[l]=Math.min(s[l],p),o[l]=Math.max(o[l],p)}return[s,o]}},function(d,r){d.exports=t;function t(e){var n=0,i=0,a=0,s=0;return e.map(function(o){o=o.slice();var f=o[0],v=f.toUpperCase();if(f!=v)switch(o[0]=v,f){case"a":o[6]+=a,o[7]+=s;break;case"v":o[1]+=s;break;case"h":o[1]+=a;break;default:for(var l=1;l<o.length;)o[l++]+=a,o[l++]+=s}switch(v){case"Z":a=n,s=i;break;case"H":a=o[1];break;case"V":s=o[1];break;case"M":a=n=o[1],s=i=o[2];break;default:a=o[o.length-2],s=o[o.length-1]}return o})}},function(d,r,t){t.r(r),t.d(r,"default",function(){return n});var e=t(45);t(1).glMatrix.setMatrixArrayType(Array);function n(s){for(var o,f=[],v=0,l=0,p=0,y=0,O=null,x=null,m=0,T=0,c=0,h=s.length;c<h;c++){var u=s[c],g=u[0];switch(g){case"M":p=u[1],y=u[2];break;case"A":var M=Object(e.default)(m,T,u[6],u[7],u[4],u[5],u[1],u[2],u[3]);if(!M.length)continue;M=M.map(L=>{const[D,R,C,W,z,H,X,Z]=L;return{x1:C,y1:W,x2:z,y2:H,x:X,y:Z}});for(var A=0,I;A<M.length;A++)I=M[A],u=["C",I.x1,I.y1,I.x2,I.y2,I.x,I.y],A<M.length-1&&f.push(u);break;case"S":var b=m,E=T;(o=="C"||o=="S")&&(b+=b-v,E+=E-l),u=["C",b,E,u[1],u[2],u[3],u[4]];break;case"T":o=="Q"||o=="T"?(O=m*2-O,x=T*2-x):(O=m,x=T),u=a(m,T,O,x,u[1],u[2]);break;case"Q":O=u[1],x=u[2],u=a(m,T,u[1],u[2],u[3],u[4]);break;case"L":u=i(m,T,u[1],u[2]);break;case"H":u=i(m,T,u[1],T);break;case"V":u=i(m,T,m,u[1]);break;case"Z":u=i(m,T,p,y);break}o=g,m=u[u.length-2],T=u[u.length-1],u.length>4?(v=u[u.length-4],l=u[u.length-3]):(v=m,l=T),f.push(u)}return f}function i(s,o,f,v){return["C",s,o,f,v,f,v]}function a(s,o,f,v,l,p){return["C",s/3+2/3*f,o/3+2/3*v,l/3+2/3*f,p/3+2/3*v,l,p]}},function(d,r,t){t.r(r),t.d(r,"default",function(){return s}),t(1).glMatrix.setMatrixArrayType(Array);const e=Math.PI*2;function n(o,f,v,l){const p=o*l-f*v<0?-1:1;let y=o*v+f*l;return y>1&&(y=1),y<-1&&(y=-1),p*Math.acos(y)}function i(o,f,v,l,p,y,O,x,m,T){const c=T*(o-v)/2+m*(f-l)/2,h=-m*(o-v)/2+T*(f-l)/2,u=O*O,g=x*x,M=c*c,A=h*h;let I=u*g-u*A-g*M;I<0&&(I=0),I/=u*A+g*M,I=Math.sqrt(I)*(p===y?-1:1);const b=I*O/x*h,E=I*-x/O*c,L=T*b-m*E+(o+v)/2,D=m*b+T*E+(f+l)/2,R=(c-b)/O,C=(h-E)/x,W=(-c-b)/O,z=(-h-E)/x,H=n(1,0,R,C);let X=n(R,C,W,z);return y===0&&X>0&&(X-=e),y===1&&X<0&&(X+=e),[L,D,H,X]}function a(o,f){const v=1.3333333333333333*Math.tan(f/4),l=Math.cos(o),p=Math.sin(o),y=Math.cos(o+f),O=Math.sin(o+f);return[l,p,l-p*v,p+l*v,y+O*v,O-y*v,y,O]}function s(o,f,v,l,p,y,O,x,m){const T=Math.sin(m*e/360),c=Math.cos(m*e/360),h=c*(o-v)/2+T*(f-l)/2,u=-T*(o-v)/2+c*(f-l)/2;if(h===0&&u===0)return[];if(O===0||x===0)return[];O=Math.abs(O),x=Math.abs(x);const g=h*h/(O*O)+u*u/(x*x);g>1&&(O*=Math.sqrt(g),x*=Math.sqrt(g));const M=i(o,f,v,l,p,y,O,x,T,c),A=[];let I=M[2],b=M[3];const E=Math.max(Math.ceil(Math.abs(b)/(e/4)),1);b/=E;for(let L=0;L<E;L++)A.push(a(I,b)),I+=b;return A.map(L=>{for(let D=0;D<L.length;D+=2){let R=L[D+0],C=L[D+1];R*=O,C*=x;const W=c*R-T*C,z=T*R+c*C;L[D+0]=W+M[0],L[D+1]=z+M[1]}return L})}},function(d,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(47),{copy:n}=t(49),i=t(50);function a(l,p,y){return l[0]=p,l[1]=y,l}var s=[0,0],o=[0,0],f=[0,0];function v(l,p,y,O){e(y,a(s,O[1],O[2]),a(o,O[3],O[4]),a(f,O[5],O[6]),p,l)}d.exports=function(p,y,O){var x=[],m=[],T=[0,0];return p.forEach(function(c,h,u){if(c[0]==="M")n(T,c.slice(1)),m.length>0&&(x.push(m),m=[]);else if(c[0]==="C")v(m,y,T,c),a(T,c[5],c[6]);else throw new Error("illegal type in SVG: "+c[0])}),m.length>0&&x.push(m),x.map(function(c){return i(c,O||0)})}},function(d,r,t){d.exports=t(48)()},function(d,r){function t(n){return[n[0],n[1]]}function e(n,i){return[n,i]}d.exports=function(i){i=i||{};var a=typeof i.recursion=="number"?i.recursion:8,s=typeof i.epsilon=="number"?i.epsilon:11920929e-14,o=typeof i.pathEpsilon=="number"?i.pathEpsilon:1,f=typeof i.angleEpsilon=="number"?i.angleEpsilon:.01,v=i.angleTolerance||0,l=i.cuspLimit||0;return function(x,m,T,c,h,u){u||(u=[]),h=typeof h=="number"?h:1;var g=o/h;return g*=g,p(x,m,T,c,u,g),u};function p(O,x,m,T,c,h){c.push(t(O));var u=O[0],g=O[1],M=x[0],A=x[1],I=m[0],b=m[1],E=T[0],L=T[1];y(u,g,M,A,I,b,E,L,c,h,0),c.push(t(T))}function y(O,x,m,T,c,h,u,g,M,A,I){if(!(I>a)){var b=Math.PI,E=(O+m)/2,L=(x+T)/2,D=(m+c)/2,R=(T+h)/2,C=(c+u)/2,W=(h+g)/2,z=(E+D)/2,H=(L+R)/2,X=(D+C)/2,Z=(R+W)/2,j=(z+X)/2,G=(H+Z)/2;if(I>0){var Q=u-O,tt=g-x,et=Math.abs((m-u)*tt-(T-g)*Q),at=Math.abs((c-u)*tt-(h-g)*Q),q,pt;if(et>s&&at>s){if((et+at)*(et+at)<=A*(Q*Q+tt*tt)){if(v<f){M.push(e(j,G));return}var dt=Math.atan2(h-T,c-m);if(q=Math.abs(dt-Math.atan2(T-x,m-O)),pt=Math.abs(Math.atan2(g-h,u-c)-dt),q>=b&&(q=2*b-q),pt>=b&&(pt=2*b-pt),q+pt<v){M.push(e(j,G));return}if(l!==0){if(q>l){M.push(e(m,T));return}if(pt>l){M.push(e(c,h));return}}}}else if(et>s){if(et*et<=A*(Q*Q+tt*tt)){if(v<f){M.push(e(j,G));return}if(q=Math.abs(Math.atan2(h-T,c-m)-Math.atan2(T-x,m-O)),q>=b&&(q=2*b-q),q<v){M.push(e(m,T)),M.push(e(c,h));return}if(l!==0&&q>l){M.push(e(m,T));return}}}else if(at>s){if(at*at<=A*(Q*Q+tt*tt)){if(v<f){M.push(e(j,G));return}if(q=Math.abs(Math.atan2(g-h,u-c)-Math.atan2(h-T,c-m)),q>=b&&(q=2*b-q),q<v){M.push(e(m,T)),M.push(e(c,h));return}if(l!==0&&q>l){M.push(e(c,h));return}}}else if(Q=j-(O+u)/2,tt=G-(x+g)/2,Q*Q+tt*tt<=A){M.push(e(j,G));return}}y(O,x,E,L,z,H,j,G,M,A,I+1),y(j,G,X,Z,C,W,u,g,M,A,I+1)}}}},function(d,r,t){t.r(r),t.d(r,"create",function(){return i}),t.d(r,"clone",function(){return n}),t.d(r,"copy",function(){return a}),t.d(r,"scaleAndAdd",function(){return s}),t.d(r,"dot",function(){return o}),t.d(r,"rotate",function(){return f}),t.d(r,"cross",function(){return v}),t.d(r,"sub",function(){return l}),t.d(r,"add",function(){return p}),t.d(r,"computeMiter",function(){return m}),t.d(r,"normal",function(){return T}),t.d(r,"direction",function(){return c});var e=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(h){return[h[0],h[1]]}function i(){return[0,0]}const a=e.vec2.copy,s=e.vec2.scaleAndAdd,o=e.vec2.dot,f=e.vec2.rotate,v=e.vec2.cross,l=e.vec2.sub,p=e.vec2.add,y=e.vec2.normalize,O=e.vec2.set,x=i();function m(h,u,g,M,A){p(h,g,M),y(h,h),O(u,-h[1],h[0]),O(x,-g[1],g[0]);const I=A/o(u,x);return Math.abs(I)}function T(h,u){return O(h,-u[1],u[0]),h}function c(h,u,g){return l(h,u,g),y(h,h),h}},function(d,r,t){var e=t(51),n=t(52);d.exports=function(a,s){return a=e(a,s),a=n(a,s),a},d.exports.radialDistance=e,d.exports.douglasPeucker=n},function(d,r){function t(e,n){var i=e[0]-n[0],a=e[1]-n[1];return i*i+a*a}d.exports=function(n,i){if(n.length<=1)return n;i=typeof i=="number"?i:1;for(var a=i*i,s=n[0],o=[s],f,v=1,l=n.length;v<l;v++)f=n[v],t(f,s)>a&&(o.push(f),s=f);return s!==f&&o.push(f),o}},function(d,r){function t(n,i,a){var s=i[0],o=i[1],f=a[0]-s,v=a[1]-o;if(f!==0||v!==0){var l=((n[0]-s)*f+(n[1]-o)*v)/(f*f+v*v);l>1?(s=a[0],o=a[1]):l>0&&(s+=f*l,o+=v*l)}return f=n[0]-s,v=n[1]-o,f*f+v*v}function e(n,i,a,s,o){for(var f=s,v,l=i+1;l<a;l++){var p=t(n[l],n[i],n[a]);p>f&&(v=l,f=p)}f>s&&(v-i>1&&e(n,i,v,s,o),o.push(n[v]),a-v>1&&e(n,v,a,s,o))}d.exports=function(i,a){if(i.length<=1)return i;a=typeof a=="number"?a:1;var s=a*a,o=i.length-1,f=[i[0]];return e(i,0,o,s,f),f.push(i[o]),f}},function(d,r,t){t.r(r),t.d(r,"getTotalLength",function(){return n}),t.d(r,"getPointAtLength",function(){return a}),t.d(r,"getDashContours",function(){return s});var e=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(o){if(o.totalLength!=null)return o.totalLength;let f=0;return o.forEach(v=>{let l=v[0];for(let p=1;p<v.length;p++){const y=v[p];f+=Object(e.distance)(l,y),l=y}}),o.totalLength=f,f}function i(o,f,v=!0){if(f=Number(f),!Number.isFinite(f))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(f<=0)throw new TypeError("Length must > 0");const l=n(o);if(f>=l){const y=o[o.length-1],O=y[y.length-2],x=y[y.length-1],m=Math.atan2(x[1]-O[1],x[0]-O[0]);return{current:o.map(T=>[...T]),point:{x:x[0],y:x[1],angle:m}}}const p=[];for(let y=0;y<o.length;y++){p[y]=[];const O=o[y];let x=O[0];for(let m=1;m<O.length;m++){const T=O[m],c=Object(e.distance)(x,T);if(f<c){const h=f/c,u=Math.atan2(T[1]-x[1],T[0]-x[0]),g={x:x[0]*(1-h)+T[0]*h,y:x[1]*(1-h)+T[1]*h,angle:u};if(p[y].push(x),f>0&&p[y].push([g.x,g.y]),!v)return{current:p,point:g};const M=[],A=y;for(;y<o.length;y++){for(M[y-A]=[],y===A&&M[0].push([g.x,g.y]);m<O.length;m++)M[y-A].push(O[m]);m=0}return{current:p,point:g,rest:M}}f-=c,p[y].push(x),x=T}}}function a(o,f){if(f=Number(f),!Number.isFinite(f))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(o.length<=0)return{x:0,y:0,angle:0};if(f<=0){const v=o[0][0],l=o[0][1],p=Math.atan2(l[1]-v[1],l[0]-v[0]);return{x:v[0],y:v[1],angle:p}}return i(o,f,!1).point}function s(o,f,v){let l=0,p=f[0],y=o;const O=[],x=f.length;if(v>0){do v-=f[l%x],l++;while(v>0);v<0&&(p=-v,l--)}else if(v<0){l=-1;do v+=f[l%x+x-1],l--;while(v<0);v>=0&&(l++,p=f[l%x+x-1]-v)}do{const m=i(y,p);y=m.rest,++l%2&&O.push(...m.current);let T=l%x;T<0&&(T+=x),p=f[T]}while(y);return O}},function(d,r,t){t.r(r),t.d(r,"normalize",function(){return e}),t.d(r,"distance",function(){return n}),t(1).glMatrix.setMatrixArrayType(Array);function e([i,a,s],o,f,v){return i=i*2/o-1,a=1-a*2/f,Number.isFinite(v)?(s=s*2/v-1,[i,a,s]):[i,a]}function n([i,a,s=0],[o,f,v=0]){return Math.hypot(o-i,f-a,v-s)}},function(d,r,t){t.r(r),t.d(r,"getPoint",function(){return n}),t(1).glMatrix.setMatrixArrayType(Array);const e=Math.PI*2;function n(i,a,s,o,f){f%=e,f<0&&(f+=e);const v=Math.tan(f);if(Math.abs(v)<1e5){const l=a-v*i,p=1/s**2+v**2/o**2;let y=-1;(f<=Math.PI/2||f>3*Math.PI/2)&&(y=1);const O=y*Math.sqrt(1/p)+i,x=v*O+l;return[O,x]}return f<Math.PI?[i,a+o]:[i,a-o]}},function(d,r,t){t.r(r),t.d(r,"default",function(){return V});var e=t(1),n=t(42),i=t.n(n),a=t(57),s=t(28),o=t(24),f=t(30),v=t(59),l=t(53),p=t(60),y=t.n(p),O=t(46),x=t.n(O),m=t(31),T=t(40),c=t(21);t(1).glMatrix.setMatrixArrayType(Array);function h(J,N){if(J==null)return{};var $=u(J,N),S,P;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(J);for(P=0;P<w.length;P++)S=w[P],!(N.indexOf(S)>=0)&&Object.prototype.propertyIsEnumerable.call(J,S)&&($[S]=J[S])}return $}function u(J,N){if(J==null)return{};var $={},S=Object.keys(J),P,w;for(w=0;w<S.length;w++)P=S[w],!(N.indexOf(P)>=0)&&($[P]=J[P]);return $}const g=Symbol("mesh"),M=Symbol("contours"),A=Symbol("stroke"),I=Symbol("fill"),b=Symbol("strokeColor"),E=Symbol("fillColor"),L=Symbol("transform"),D=Symbol("invertTransform"),R=Symbol("uniforms"),C=Symbol("texOptions"),W=Symbol("blend"),z=Symbol("applyTexture"),H=Symbol("applyTransform"),X=Symbol("applyGradientTransform"),Z=Symbol("applyProgram"),j=Symbol("gradient"),G=Symbol("filter"),Q=Symbol("opacity"),tt=Symbol("program"),et=Symbol("attributes"),at=Symbol("pass"),q=Symbol("clipContext"),pt=Symbol("applyClipPath");function dt(J,N){const[$,S]=[J[1][0]-J[0][0],J[1][1]-J[0][1]],P=[];for(let w=0;w<N.length;w++){const U=N[w],K=[(U[0]-J[0][0])/$,1-(U[1]-J[0][1])/S];P.push(K)}return P}function B([J,N],[$,S,P,w],{scale:U}){return U||(J/=P,N=1-N/w,J-=$,N+=S),[J,N,0]}function F(J,N,$){const S=x()(J,N,$);return S.path=J,S.simplify=$,S.scale=N,S}class V{constructor(N){this[A]=null,this[I]=null,this[L]=[1,0,0,1,0,0],this[Q]=1,this[R]={},this[G]=[],this[W]=null,this[C]={},this.contours=N.contours,this[tt]=null,this[et]={},this[at]=[]}get contours(){return this[M]}set contours(N){this[g]=null,this[M]=N;const $=N.scale;this.transformScale/$>1.5&&this.accurate(this.transformScale)}setProgram(N){this[tt]=N,this[g]&&this[Z](N)}get program(){return this[tt]}setAttribute(N,$){$==null?delete this[et][N]:this[et][N]=$}getOpacity(){return this[Q]}setOpacity(N){if(N<0||N>1)throw new TypeError("Invalid opacity value.");this[g]&&this[g].positions.forEach($=>{$[2]=1/$[2]>0?N:-N}),this[Q]=N}setClipPath(N){this.clipPath=N,this[R].u_clipSampler&&this[R].u_clipSampler.delete(),this.setUniforms({u_clipSampler:null}),this[g]&&delete this[g].attributes.a_clipUV,N&&this[g]&&this[pt]()}[pt](){if(this.clipPath){this[q]||(this[q]=c.default.createCanvas(1,1));const[[N,$],[S,P]]=this.boundingBox;S&&P&&(this[q].width=S-N,this[q].height=P-$);const w=this[q].getContext("2d"),U=new Path2D(this.clipPath);w.clearRect(0,0,this[q].width,this[q].height),w.save(),w.translate(-N,-$),w.fillStyle="white",w.fill(U),w.restore(),this[g].clipPath=this[q];const K=dt(this.boundingBox,this[g].position0);this[g].attributes.a_clipUV=K}}getPointAtLength(N){return Object(l.getPointAtLength)(this[M],N)}getTotalLength(){return Object(l.getTotalLength)(this[M])}get blend(){return this[W]==null?"auto":this[W]}set blend(N){this[W]=N,this[g]&&(this[g].enableBlend=this.enableBlend)}get boundingBox(){if(this[g]&&this[g].boundingBox)return this[g].boundingBox;const N=this.meshData;if(N){const $=N.position0;if($.length)N.boundingBox=i()($);else return[[0,0],[0,0]];return N.boundingBox}return[[0,0],[0,0]]}get boundingCenter(){const N=this.boundingBox;return N?[.5*(N[0][0]+N[1][0]),.5*(N[0][1]+N[1][1])]:[0,0]}get fillRule(){return this[I]?this[I].rule:"nonzero"}get lineWidth(){return this[A]?this[A].lineWidth:0}get lineCap(){return this[A]?this[A].lineCap:""}get lineJoin(){return this[A]?this[A].lineJoin:""}get miterLimit(){return this[A]?this[A].miterLimit:0}get strokeStyle(){return this[b]&&this[b][3]!==0?Object(o.default)(this[b]):""}get lineDash(){return this[A]?this[A].lineDash:null}get lineDashOffset(){return this[A]?this[A].lineDashOffset:0}get fillStyle(){return this[E]&&this[E][3]!==0?Object(o.default)(this[E]):""}get gradient(){return this[j]}get texture(){return this[R].u_texSampler?{image:this[R].u_texSampler._img,options:this[C]}:null}get enableBlend(){return this[W]===!0||this[W]===!1?this[W]:this[Q]<1||this[b]!=null&&this[b][3]<1||this[E]!=null&&this[E][3]<1||this[R].u_colorMatrix!=null&&this[R].u_colorMatrix[18]<1||this[R].u_radialGradientVector!=null||this.beforeRender||this.afterRender}get filterCanvas(){return/blur|drop-shadow|url/.test(this.filter)}get filter(){return this[G].join(" ")}get transformMatrix(){return this[L]}get invertMatrix(){if(!this[D]){const N=e.mat2d.invert(Array.of(0,0,0,0,0,0),this[L]);this[D]=N}return this[D]}get transformScale(){const N=this[L];return Math.max(Math.hypot(N[0],N[1]),Math.hypot(N[2],N[3]))}get uniforms(){return this[R]}get pass(){return this[at]}[Z](N){const $=this[et],S=this[g].position0,P=Object.entries(N._attribute);for(let w=0;w<P.length;w++){const[U,K]=P[w];if(U!=="a_color"&&U!=="a_sourceRect"&&K!=="ignored"){const Y=$[U];if(U==="uv"&&!Y){const k=this[g].boundingBox||i()(S);this[g].attributes[U]=dt(k,S)}else{this[g].attributes[U]=[];for(let k=0;k<S.length;k++){const rt=S[k];this[g].attributes[U].push(Y?Y(rt,w,S):Array(K.size).fill(0))}}}}}get meshData(){if(this._updateMatrix&&this.transformScale/this.contours.scale>1.5&&this.accurate(this.transformScale),!this[g]){!this[I]&&!this[A]&&this.setFill();const N=this[M],$={};if(N&&N.length){if(this[I])try{const w=y()(N,this[I]);w.positions=w.positions.map(U=>(U.push(this[Q]),U)),w.attributes={a_color:Array.from({length:w.positions.length}).map(()=>this[E].map(U=>Math.round(255*U)))},$.fill=w}catch{}if(this[A]){const w=this[A].lineDash;let U=N;if(w){const Y=this[A].lineDashOffset;U=Object(l.getDashContours)(N,w,Y)}const K=U.map((Y,k)=>{const rt=Y.length>1&&e.vec2.equals(Y[0],Y[Y.length-1]),it=this[A].build(Y,rt);return y()([it])});K.forEach(Y=>{Y.positions=Y.positions.map(k=>(k.push(-this[Q]),k)),Y.attributes={a_color:Array.from({length:Y.positions.length}).map(()=>this[b].map(k=>Math.round(255*k)))}}),$.stroke=Object(s.default)(K)}}const S=Object(s.default)([$.fill,$.stroke]);S.fillPointCount=$.fill?$.fill.positions.length:0,S.enableBlend=this.enableBlend,S.position0=S.positions.map(([w,U,K])=>[w,U,K]),S.uniforms=this[R],this[g]=S,this[R].u_texSampler&&this[z](S,this[C]);const P=this[L];Object(v.isUnitTransform)(P)||(this[H](S,P),this[R].u_radialGradientVector&&this[X]()),this.clipPath&&this[pt](),this[tt]&&this[Z](this[tt])}return this._updateMatrix&&(this[g].matrix=this[L],this[H](this[g],this[L]),this[R].u_radialGradientVector&&this[X]()),this[g]}[H](N,$){const{positions:S,position0:P}=N;for(let w=0;w<S.length;w++){const[U,K]=P[w],Y=S[w];Y[0]=U*$[0]+K*$[2]+$[4],Y[1]=U*$[1]+K*$[3]+$[5]}this._updateMatrix=!1}[X](){const N=this[L],$=[...this._radialGradientVector];if($){const[S,P,,w,U]=$;$[0]=S*N[0]+P*N[2]+N[4],$[1]=S*N[1]+P*N[3]+N[5],$[3]=w*N[0]+U*N[2]+N[4],$[4]=w*N[1]+U*N[3]+N[5],this[R].u_radialGradientVector=$}}[z](N,$){function S(k,rt){return k==null&&rt==null?!0:k==null||rt==null?!1:k[0]===rt[0]&&k[1]===rt[1]&&k[2]===rt[2]&&k[3]===rt[3]}const P=this[R].u_texSampler;if(!P)return;const{width:w,height:U}=P._img,K=$.srcRect;let Y=$.rect||[0,0];if($.rotated&&(Y=[-Y[1],Y[0],Y[3],Y[2]]),Y[2]==null&&(Y[2]=K?K[2]:w),Y[3]==null&&(Y[3]=K?K[3]:U),$.hidden)N.textureCoord=N.positions.map(()=>[-1,-1,-1]);else if(!N.textureCoord||!S(this[C].rect,$.rect)||this[C].hidden!==$.hidden||this[C].rotated!==$.rotated){let k=null;$.rotated&&(k=e.mat2d.rotate(Array.of(0,0,0,0,0,0),e.mat2d.fromValues(1,0,0,1,0,0),.5*Math.PI),k=e.mat2d.translate(Array.of(0,0,0,0,0,0),k,[0,-Y[2]])),N.textureCoord=N.position0.map(([rt,it,lt])=>{if(1/lt>0){if($.rotated){const ot=rt*k[0]+it*k[2]+k[4],st=rt*k[1]+it*k[3]+k[5];[rt,it]=[ot,st]}const ut=B([rt,it],[Y[0]/Y[2],Y[1]/Y[3],Y[2],Y[3]],$);return $.repeat&&(ut[2]=1),ut}return[-1,-1,-1]})}if(K){const k=[K[0]/w,K[1]/U,K[2]/w,K[3]/U];N.attributes.a_sourceRect=N.positions.map(()=>[...k])}else N.attributes.a_sourceRect=N.positions.map(()=>[0,0,0,0])}accurate(N){if(!this.contours)return;if(this.contours.path){const S=this.contours.simplify,P=F(this.contours.path,2*N,S);this[g]=null,this[M]=P}}canIgnore(){const N=this[A]==null||this[A].lineWidth===0||this[b][3]===0,$=this[I]==null||this[E][3]===0,S=this[R].u_radialGradientVector==null,P=this[R].u_texSampler==null;return this[Q]===0||this[tt]==null&&N&&$&&S&&P&&!this.beforeRender&&!this.afterRender}setStroke({thickness:N=1,cap:$="butt",join:S="miter",miterLimit:P=10,color:w=[0,0,0,0],lineDash:U=null,lineDashOffset:K=0,roundSegments:Y=20}={}){return this[g]=null,this[A]=new a.default({lineWidth:N,lineCap:$,lineJoin:S,miterLimit:P,roundSegments:Y}),typeof w=="string"&&(w=Object(m.default)(w)),this[b]=w,this[A].lineDash=U,this[A].lineDashOffset=K,this}setFill({rule:N=this.fillRule,color:$=[0,0,0,0]}={}){return this[g]=null,this[I]={rule:N},typeof $=="string"&&($=Object(m.default)($)),this[E]=$,this}setTexture(N,$={}){if(N&&N.image){const{image:S,rect:P}=N;if(N=S,$.rect)for(let w=0;w<$.rect.length;w++)P[w]=$.rect[w];$.rect=P}return this[I]||this.setFill(),this.setUniforms({u_texSampler:N}),this[g]&&this[z](this[g],$),this[C]=$,this}setCircularGradient({vector:N,colors:$,type:S="fill"}={}){if(N.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:S})}setLinearGradient({vector:N,colors:$,type:S="fill"}={}){if(N.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:S})}setRadialGradient({vector:N,colors:$,type:S="fill"}={}){if(N.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:N,colors:$,type:S})}setGradient({vector:N,colors:$,type:S="fill"}={}){$=$.map(({offset:U,color:K})=>(typeof K=="string"&&(K=Object(m.default)(K)),{offset:U,color:K})),this[j]=this[j]||{},this[j][S]={vector:N,colors:$},$.sort((U,K)=>U.offset-K.offset);const P=[];$.forEach(({offset:U,color:K})=>{P.push(U,...K)});let w;if(N.length===4?w=[N[0],N[1],0,N[2],N[3],0]:w=[...N],P.length<40&&P.push(-1),P.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=w,this[R].u_colorSteps=P,S==="fill"?this[R].u_gradientType=1:this[R].u_gradientType=0,this[X](),this}setUniforms(N={}){return Object.assign(this[R],N),this}setTransform(...N){const $=this[L];return e.mat2d.equals(N,$)||(this[L]=N,delete this[D],this._updateMatrix=!0),this}transform(...N){const $=this[L];return this[L]=e.mat2d.multiply(Array.of(0,0,0,0,0,0),$,N),delete this[D],this._updateMatrix=!0,this}translate(N,$){let S=e.mat2d.create();return S=e.mat2d.translate(Array.of(0,0,0,0,0,0),S,[N,$]),this.transform(...S)}rotate(N,[$,S]=[0,0]){let P=e.mat2d.create();return P=e.mat2d.translate(Array.of(0,0,0,0,0,0),P,[$,S]),P=e.mat2d.rotate(Array.of(0,0,0,0,0,0),P,N),P=e.mat2d.translate(Array.of(0,0,0,0,0,0),P,[-$,-S]),this.transform(...P)}scale(N,$=N,[S,P]=[0,0]){let w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[S,P]),w=e.mat2d.scale(Array.of(0,0,0,0,0,0),w,[N,$]),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-S,-P]),this.transform(...w)}skew(N,$=N,[S,P]=[0,0]){let w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[S,P]),w=e.mat2d.multiply(Array.of(0,0,0,0,0,0),w,e.mat2d.fromValues(1,Math.tan($),Math.tan(N),1,0,0)),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-S,-P]),this.transform(...w)}clearFilter(){return this.setColorTransform(null),this[G].length=0,this}setColorTransform(...N){return N[0]===null?this.setUniforms({u_filterFlag:0,u_colorMatrix:0}):this.setUniforms({u_filterFlag:1,u_colorMatrix:N}),this}transformColor(...N){let $=this.uniforms.u_colorMatrix;return $?$=Object(f.multiply)($,N):$=N,this.setColorTransform(...$),this}blur(N){return this[G].push(`blur(${N}px)`),this}brightness(N=1){return this[G].push(`brightness(${100*N}%)`),this.transformColor(...Object(f.brightness)(N))}contrast(N=1){return this[G].push(`contrast(${100*N}%)`),this.transformColor(...Object(f.contrast)(N))}dropShadow(N,$,S=0,P=[0,0,0,1]){return Array.isArray(P)&&(P=Object(o.default)(P)),this[G].push(`drop-shadow(${N}px ${$}px ${S}px ${P})`),this}grayscale(N=1){return this[G].push(`grayscale(${100*N}%)`),this.transformColor(...Object(f.grayscale)(N))}hueRotate(N=0){return this[G].push(`hue-rotate(${N}deg)`),this.transformColor(...Object(f.hueRotate)(N))}invert(N=1){return this[G].push(`invert(${100*N}%)`),this.transformColor(...Object(f.invert)(N))}opacity(N=1){return this[G].push(`opacity(${100*N}%)`),this.transformColor(...Object(f.opacity)(N))}saturate(N=1){return this[G].push(`saturate(${100*N}%)`),this.transformColor(...Object(f.saturate)(N))}sepia(N=1){return this[G].push(`sepia(${100*N}%)`),this.transformColor(...Object(f.sepia)(N))}url(N){return this[G].push(`url(${N})`),this}isPointCollision(N,$,S="both"){const P=this.meshData,{positions:w,cells:U}=P,K=this.invertMatrix,Y=K[0]*N+K[2]*$+K[4],k=K[1]*N+K[3]*$+K[5],rt=this.boundingBox;if(Y<rt[0][0]||Y>rt[1][0]||k<rt[0][1]||k>rt[1][1])return!1;function it([lt,ut],[ot,st],[ft,vt]){const mt=ft-ot,gt=vt-st,St=((lt-ot)*mt+(ut-st)*gt)/(mt**2+gt**2);return St>=0&&St<=1}for(let lt=0;lt<U.length;lt++){const ut=U[lt];if(S==="fill"&&ut[0]>=P.fillPointCount)break;if(S==="stroke"&&ut[0]<P.fillPointCount)continue;const[[ot,st],[ft,vt],[mt,gt]]=ut.map(Pt=>w[Pt]),St=Math.sign((N-ot)*(vt-st)-(ft-ot)*($-st));if(St===0&&it([N,$],[ot,st],[ft,vt]))return!0;const It=Math.sign((N-ft)*(gt-vt)-(mt-ft)*($-vt));if(It===0&&it([N,$],[ft,vt],[mt,gt]))return!0;const Et=Math.sign((N-mt)*(st-gt)-(ot-mt)*($-gt));if(Et===0&&it([N,$],[mt,gt],[ot,st])||St===1&&It===1&&Et===1||St===-1&&It===-1&&Et===-1)return!0}return!1}isPointInFill(N,$){return this.isPointCollision(N,$,"fill")}isPointInStroke(N,$){return this.isPointCollision(N,$,"stroke")}addPass(N,$={}){let{width:S,height:P}=$,w=h($,["width","height"]);const U=new T.default;U.rect(0,0,S,P);const K=new V(U,{width:S,height:P});K.setUniforms(w),K.setProgram(N),this[at].push(K)}}},function(d,r,t){t.r(r);var e=t(58);t(1).glMatrix.setMatrixArrayType(Array),r.default=e.Stroke},function(d,r,t){t.r(r),t.d(r,"Stroke",function(){return v});var e=t(49);t(1).glMatrix.setMatrixArrayType(Array);const n=Object(e.create)(),i=Object(e.create)(),a=Object(e.create)(),s=Object(e.create)(),o=Object(e.create)(),f=1e20;class v{constructor({lineWidth:x=1,lineJoin:m="miter",miterLimit:T=10,lineCap:c="butt",roundSegments:h=20}={}){this.lineWidth=x,this.lineJoin=m,this.miterLimit=T,this.lineCap=c,this.roundSegments=h,this._normal=null}build(x,m=!1){let T=x.length;if(x=[...x],T<2)return x;m&&((x[0][0]!==x[T-1][0]||x[0][1]!==x[T-1][1])&&x.push([...x[0]]),x.push([...x[1]])),T=x.length,this._normal=null;const c={left:[],right:[]},h=this.lineWidth/2,u=this.lineCap;if(!m&&u==="square"){Object(e.direction)(i,x[0],x[1]),Object(e.scaleAndAdd)(x[0],x[0],i,h);const M=x.length-1;Object(e.direction)(i,x[M],x[M-1]),Object(e.scaleAndAdd)(x[M],x[M],i,h)}for(let M=1;M<T;M++){const A=x[M-1],I=x[M],b=x[M+1];this._seg(c,A,I,b,h,m)}return!m&&u==="round"&&y(c,this.roundSegments),[...c.left,...c.right.reverse()]}_seg(x,m,T,c,h,u){const g=this.lineJoin==="bevel",M=this.lineJoin==="round";if(Object(e.direction)(i,T,m),this._normal||(this._normal=Object(e.create)(),Object(e.normal)(this._normal,i)),x.left.length||p(x,m,this._normal,h),!c)Object(e.normal)(this._normal,i),u?p(x,m,this._normal,h):p(x,T,this._normal,h);else{Object(e.direction)(a,c,T);let A=Object(e.computeMiter)(s,o,i,a,h);A=Math.min(A,f);const I=Object(e.dot)(s,this._normal)<0?-1:1;let b=g||M;if(!b&&this.lineJoin==="miter"&&A/h>this.miterLimit&&(b=!0),b){Object(e.scaleAndAdd)(n,T,this._normal,-h*I),l(x,n,I);let E=1/0;m&&(E=Math.min(E,Math.hypot(T[0]-m[0],T[1]-m[1]))),c&&(E=Math.min(E,Math.hypot(c[0]-T[0],c[1]-T[1])));const L=Math.max(h,Math.min(A,E));if(Object(e.scaleAndAdd)(n,T,o,L*I),l(x,n,-I),c)if(Object(e.normal)(n,a),Object(e.copy)(this._normal,n),Object(e.scaleAndAdd)(n,T,n,-h*I),M){const D=Object(e.clone)(n),R=I>0?x.left[x.left.length-1]:x.right[x.right.length-1],C=Object(e.clone)(T),W=Object(e.sub)(Object(e.create)(),R,C),z=Object(e.sub)(Object(e.create)(),D,C),H=Math.PI/this.roundSegments;for(let X=0;X<this.roundSegments&&(Object(e.rotate)(W,W,[0,0],I*H),Math.sign(Object(e.cross)(n,W,z)[2])===I);X++)Object(e.add)(n,W,C),l(x,n,I);l(x,D,I)}else l(x,n,I)}else p(x,T,o,A),Object(e.copy)(this._normal,o)}}}function l(O,x,m){m>0?O.left.push(Object(e.clone)(x)):O.right.push(Object(e.clone)(x))}function p(O,x,m,T,c=-1){Object(e.scaleAndAdd)(n,x,m,-T),l(O,n,-c),Object(e.scaleAndAdd)(n,x,m,T),l(O,n,c)}function y({left:O,right:x},m){const T=Object(e.create)(),c=Object(e.create)();let h=O[0],u=x[0],g=[.5*(h[0]+u[0]),.5*(h[1]+u[1])];Object(e.sub)(c,h,g);for(let M=1;M<=m;M++){const A=-1*Math.PI*M/m;Object(e.rotate)(T,c,[0,0],A),Object(e.add)(n,g,T),O.unshift(Object(e.clone)(n))}h=x[x.length-1],u=O[O.length-1],g=[.5*(h[0]+u[0]),.5*(h[1]+u[1])],Object(e.sub)(c,h,g);for(let M=1;M<=m;M++){const A=-1*Math.PI*M/m;Object(e.rotate)(T,c,[0,0],A),Object(e.add)(n,g,T),x.push(Object(e.clone)(n))}}},function(d,r,t){t.r(r),t.d(r,"isUnitTransform",function(){return e}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0}},function(d,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(61),n=t(62);d.exports=function(i,a){if(a=a||{},i=i.filter(function(m){return m.length>2}),i.length===0)return{positions:[],cells:[]};typeof a.vertexSize!="number"&&(a.vertexSize=i[0][0].length),i=i.map(function(m){return m.reduce(function(T,c){return T.concat(c)})});const s=a.rule==="evenodd"?e.WINDING_ODD:e.WINDING_NONZERO;for(var o=e.tesselate(n({contours:i,windingRule:s,elementType:e.POLYGONS,polySize:3,vertexSize:2},a)),f=[],v=0;v<o.vertices.length;v+=a.vertexSize){var l=o.vertices.slice(v,v+a.vertexSize);f.push(l)}var p=[];for(v=0;v<o.elements.length;v+=3){var y=o.elements[v],O=o.elements[v+1],x=o.elements[v+2];p.push([y,O,x])}return{positions:f,cells:p}}},function(d,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e={},n={};d.exports=e,e.WINDING_ODD=0,e.WINDING_NONZERO=1,e.WINDING_POSITIVE=2,e.WINDING_NEGATIVE=3,e.WINDING_ABS_GEQ_TWO=4,e.POLYGONS=0,e.CONNECTED_POLYGONS=1,e.BOUNDARY_CONTOURS=2,e.tesselate=function(c){for(var h=c.debug||!1,u=new T,g=0;g<c.contours.length;g++)u.addContour(c.vertexSize||2,c.contours[g]);return u.tesselate(c.windingRule||e.WINDING_ODD,c.elementType||e.POLYGONS,c.polySize||3,c.vertexSize||2,c.normal||[0,0,1]),{vertices:u.vertices,vertexIndices:u.vertexIndices,vertexCount:u.vertexCount,elements:u.elements,elementCount:u.elementCount,mesh:h?u.mesh:void 0}};var i=function(c){if(!c)throw"Assertion Failed!"};function a(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}function s(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}function o(c){this.next=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Org=null,this.Lface=null,this.activeRegion=null,this.winding=0,this.side=c}o.prototype={get Rface(){return this.Sym.Lface},set Rface(c){this.Sym.Lface=c},get Dst(){return this.Sym.Org},set Dst(c){this.Sym.Org=c},get Oprev(){return this.Sym.Lnext},set Oprev(c){this.Sym.Lnext=c},get Lprev(){return this.Onext.Sym},set Lprev(c){this.Onext.Sym=c},get Dprev(){return this.Lnext.Sym},set Dprev(c){this.Lnext.Sym=c},get Rprev(){return this.Sym.Onext},set Rprev(c){this.Sym.Onext=c},get Dnext(){return this.Sym.Onext.Sym},set Dnext(c){this.Sym.Onext.Sym=c},get Rnext(){return this.Sym.Lnext.Sym},set Rnext(c){this.Sym.Lnext.Sym=c}};function f(){var c=new a,h=new s,u=new o(0),g=new o(1);c.next=c.prev=c,c.anEdge=null,h.next=h.prev=h,h.anEdge=null,h.trail=null,h.marked=!1,h.inside=!1,u.next=u,u.Sym=g,u.Onext=null,u.Lnext=null,u.Org=null,u.Lface=null,u.winding=0,u.activeRegion=null,g.next=g,g.Sym=u,g.Onext=null,g.Lnext=null,g.Org=null,g.Lface=null,g.winding=0,g.activeRegion=null,this.vHead=c,this.fHead=h,this.eHead=u,this.eHeadSym=g}f.prototype={makeEdge_:function(c){var h=new o(0),u=new o(1);c.Sym.side<c.side&&(c=c.Sym);var g=c.Sym.next;return u.next=g,g.Sym.next=h,h.next=c,c.Sym.next=u,h.Sym=u,h.Onext=h,h.Lnext=u,h.Org=null,h.Lface=null,h.winding=0,h.activeRegion=null,u.Sym=h,u.Onext=u,u.Lnext=h,u.Org=null,u.Lface=null,u.winding=0,u.activeRegion=null,h},splice_:function(c,h){var u=c.Onext,g=h.Onext;u.Sym.Lnext=h,g.Sym.Lnext=c,c.Onext=g,h.Onext=u},makeVertex_:function(c,h,u){var g=c;i(g!==null);var M=u.prev;g.prev=M,M.next=g,g.next=u,u.prev=g,g.anEdge=h;var A=h;do A.Org=g,A=A.Onext;while(A!==h)},makeFace_:function(c,h,u){var g=c;i(g!==null);var M=u.prev;g.prev=M,M.next=g,g.next=u,u.prev=g,g.anEdge=h,g.trail=null,g.marked=!1,g.inside=u.inside;var A=h;do A.Lface=g,A=A.Lnext;while(A!==h)},killEdge_:function(c){c.Sym.side<c.side&&(c=c.Sym);var h=c.next,u=c.Sym.next;h.Sym.next=u,u.Sym.next=h},killVertex_:function(c,h){var u=c.anEdge,g=u;do g.Org=h,g=g.Onext;while(g!==u);var M=c.prev,A=c.next;A.prev=M,M.next=A},killFace_:function(c,h){var u=c.anEdge,g=u;do g.Lface=h,g=g.Lnext;while(g!==u);var M=c.prev,A=c.next;A.prev=M,M.next=A},makeEdge:function(){var c=new a,h=new a,u=new s,g=this.makeEdge_(this.eHead);return this.makeVertex_(c,g,this.vHead),this.makeVertex_(h,g.Sym,this.vHead),this.makeFace_(u,g,this.fHead),g},splice:function(c,h){var u=!1,g=!1;if(c!==h){if(h.Org!==c.Org&&(g=!0,this.killVertex_(h.Org,c.Org)),h.Lface!==c.Lface&&(u=!0,this.killFace_(h.Lface,c.Lface)),this.splice_(h,c),!g){var M=new a;this.makeVertex_(M,h,c.Org),c.Org.anEdge=c}if(!u){var A=new s;this.makeFace_(A,h,c.Lface),c.Lface.anEdge=c}}},delete:function(c){var h=c.Sym,u=!1;if(c.Lface!==c.Rface&&(u=!0,this.killFace_(c.Lface,c.Rface)),c.Onext===c)this.killVertex_(c.Org,null);else if(c.Rface.anEdge=c.Oprev,c.Org.anEdge=c.Onext,this.splice_(c,c.Oprev),!u){var g=new s;this.makeFace_(g,c,c.Lface)}h.Onext===h?(this.killVertex_(h.Org,null),this.killFace_(h.Lface,null)):(c.Lface.anEdge=h.Oprev,h.Org.anEdge=h.Onext,this.splice_(h,h.Oprev)),this.killEdge_(c)},addEdgeVertex:function(c){var h=this.makeEdge_(c),u=h.Sym;this.splice_(h,c.Lnext),h.Org=c.Dst;var g=new a;return this.makeVertex_(g,u,h.Org),h.Lface=u.Lface=c.Lface,h},splitEdge:function(c,h){var u=this.addEdgeVertex(c),g=u.Sym;return this.splice_(c.Sym,c.Sym.Oprev),this.splice_(c.Sym,g),c.Dst=g.Org,g.Dst.anEdge=g.Sym,g.Rface=c.Rface,g.winding=c.winding,g.Sym.winding=c.Sym.winding,g},connect:function(c,h){var u=!1,g=this.makeEdge_(c),M=g.Sym;if(h.Lface!==c.Lface&&(u=!0,this.killFace_(h.Lface,c.Lface)),this.splice_(g,c.Lnext),this.splice_(M,h),g.Org=c.Dst,M.Org=h.Org,g.Lface=M.Lface=c.Lface,c.Lface.anEdge=M,!u){var A=new s;this.makeFace_(A,g,c.Lface)}return g},zapFace:function(c){var h=c.anEdge,u,g,M,A,I;g=h.Lnext;do u=g,g=u.Lnext,u.Lface=null,u.Rface===null&&(u.Onext===u?this.killVertex_(u.Org,null):(u.Org.anEdge=u.Onext,this.splice_(u,u.Oprev)),M=u.Sym,M.Onext===M?this.killVertex_(M.Org,null):(M.Org.anEdge=M.Onext,this.splice_(M,M.Oprev)),this.killEdge_(u));while(u!=h);A=c.prev,I=c.next,I.prev=A,A.next=I},countFaceVerts_:function(c){var h=c.anEdge,u=0;do u++,h=h.Lnext;while(h!==c.anEdge);return u},mergeConvexFaces:function(c){var h,u,g,M,A,I,b;for(h=this.fHead.next;h!==this.fHead;h=h.next)if(h.inside)for(u=h.anEdge,A=u.Org;g=u.Lnext,M=u.Sym,M&&M.Lface&&M.Lface.inside&&(I=this.countFaceVerts_(h),b=this.countFaceVerts_(M.Lface),I+b-2<=c&&n.vertCCW(u.Lprev.Org,u.Org,M.Lnext.Lnext.Org)&&n.vertCCW(M.Lprev.Org,M.Org,u.Lnext.Lnext.Org)&&(g=M.Lnext,this.delete(M),u=null,M=null)),!(u&&u.Lnext.Org===A);)u=g;return!0},check:function(){var c=this.fHead,h=this.vHead,u=this.eHead,g,M,A,I,b,E;for(M=c,M=c;(g=M.next)!==c;M=g){i(g.prev===M),b=g.anEdge;do i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b),i(b.Lface===g),b=b.Lnext;while(b!==g.anEdge)}for(i(g.prev===M&&g.anEdge===null),I=h,I=h;(A=I.next)!==h;I=A){i(A.prev===I),b=A.anEdge;do i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b),i(b.Org===A),b=b.Onext;while(b!==A.anEdge)}for(i(A.prev===I&&A.anEdge===null),E=u,E=u;(b=E.next)!==u;E=b)i(b.Sym.next===E.Sym),i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Org!==null),i(b.Dst!==null),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b);i(b.Sym.next===E.Sym&&b.Sym===this.eHeadSym&&b.Sym.Sym===b&&b.Org===null&&b.Dst===null&&b.Lface===null&&b.Rface===null)}},n.vertEq=function(c,h){return c.s===h.s&&c.t===h.t},n.vertLeq=function(c,h){return c.s<h.s||c.s===h.s&&c.t<=h.t},n.transLeq=function(c,h){return c.t<h.t||c.t===h.t&&c.s<=h.s},n.edgeGoesLeft=function(c){return n.vertLeq(c.Dst,c.Org)},n.edgeGoesRight=function(c){return n.vertLeq(c.Org,c.Dst)},n.vertL1dist=function(c,h){return Math.abs(c.s-h.s)+Math.abs(c.t-h.t)},n.edgeEval=function(c,h,u){i(n.vertLeq(c,h)&&n.vertLeq(h,u));var g=h.s-c.s,M=u.s-h.s;return g+M>0?g<M?h.t-c.t+(c.t-u.t)*(g/(g+M)):h.t-u.t+(u.t-c.t)*(M/(g+M)):0},n.edgeSign=function(c,h,u){i(n.vertLeq(c,h)&&n.vertLeq(h,u));var g=h.s-c.s,M=u.s-h.s;return g+M>0?(h.t-u.t)*g+(h.t-c.t)*M:0},n.transEval=function(c,h,u){i(n.transLeq(c,h)&&n.transLeq(h,u));var g=h.t-c.t,M=u.t-h.t;return g+M>0?g<M?h.s-c.s+(c.s-u.s)*(g/(g+M)):h.s-u.s+(u.s-c.s)*(M/(g+M)):0},n.transSign=function(c,h,u){i(n.transLeq(c,h)&&n.transLeq(h,u));var g=h.t-c.t,M=u.t-h.t;return g+M>0?(h.s-u.s)*g+(h.s-c.s)*M:0},n.vertCCW=function(c,h,u){return c.s*(h.t-u.t)+h.s*(u.t-c.t)+u.s*(c.t-h.t)>=0},n.interpolate=function(c,h,u,g){return c=c<0?0:c,u=u<0?0:u,c<=u?u===0?(h+g)/2:h+(g-h)*(c/(c+u)):g+(h-g)*(u/(c+u))},n.intersect=function(c,h,u,g,M){var A,I,b;n.vertLeq(c,h)||(b=c,c=h,h=b),n.vertLeq(u,g)||(b=u,u=g,g=b),n.vertLeq(c,u)||(b=c,c=u,u=b,b=h,h=g,g=b),n.vertLeq(u,h)?n.vertLeq(h,g)?(A=n.edgeEval(c,u,h),I=n.edgeEval(u,h,g),A+I<0&&(A=-A,I=-I),M.s=n.interpolate(A,u.s,I,h.s)):(A=n.edgeSign(c,u,h),I=-n.edgeSign(c,g,h),A+I<0&&(A=-A,I=-I),M.s=n.interpolate(A,u.s,I,g.s)):M.s=(u.s+h.s)/2,n.transLeq(c,h)||(b=c,c=h,h=b),n.transLeq(u,g)||(b=u,u=g,g=b),n.transLeq(c,u)||(b=c,c=u,u=b,b=h,h=g,g=b),n.transLeq(u,h)?n.transLeq(h,g)?(A=n.transEval(c,u,h),I=n.transEval(u,h,g),A+I<0&&(A=-A,I=-I),M.t=n.interpolate(A,u.t,I,h.t)):(A=n.transSign(c,u,h),I=-n.transSign(c,g,h),A+I<0&&(A=-A,I=-I),M.t=n.interpolate(A,u.t,I,g.t)):M.t=(u.t+h.t)/2};function v(){this.key=null,this.next=null,this.prev=null}function l(c,h){this.head=new v,this.head.next=this.head,this.head.prev=this.head,this.frame=c,this.leq=h}l.prototype={min:function(){return this.head.next},max:function(){return this.head.prev},insert:function(c){return this.insertBefore(this.head,c)},search:function(c){var h=this.head;do h=h.next;while(h.key!==null&&!this.leq(this.frame,c,h.key));return h},insertBefore:function(c,h){do c=c.prev;while(c.key!==null&&!this.leq(this.frame,c.key,h));var u=new v;return u.key=h,u.next=c.next,c.next.prev=u,u.prev=c,c.next=u,u},delete:function(c){c.next.prev=c.prev,c.prev.next=c.next}};function p(){this.handle=null}function y(){this.key=null,this.node=null}function O(c,h){this.size=0,this.max=c,this.nodes=[],this.nodes.length=c+1;var u;for(u=0;u<this.nodes.length;u++)this.nodes[u]=new p;for(this.handles=[],this.handles.length=c+1,u=0;u<this.handles.length;u++)this.handles[u]=new y;this.initialized=!1,this.freeList=0,this.leq=h,this.nodes[1].handle=1,this.handles[1].key=null}O.prototype={floatDown_:function(c){var h=this.nodes,u=this.handles,g,M,A;for(g=h[c].handle;;){if(A=c<<1,A<this.size&&this.leq(u[h[A+1].handle].key,u[h[A].handle].key)&&++A,i(A<=this.max),M=h[A].handle,A>this.size||this.leq(u[g].key,u[M].key)){h[c].handle=g,u[g].node=c;break}h[c].handle=M,u[M].node=c,c=A}},floatUp_:function(c){var h=this.nodes,u=this.handles,g,M,A;for(g=h[c].handle;;){if(A=c>>1,M=h[A].handle,A===0||this.leq(u[M].key,u[g].key)){h[c].handle=g,u[g].node=c;break}h[c].handle=M,u[M].node=c,c=A}},init:function(){for(var c=this.size;c>=1;--c)this.floatDown_(c);this.initialized=!0},min:function(){return this.handles[this.nodes[1].handle].key},insert:function(c){var h,u;if(h=++this.size,h*2>this.max){this.max*=2;var g,M;for(M=this.nodes.length,this.nodes.length=this.max+1,g=M;g<this.nodes.length;g++)this.nodes[g]=new p;for(M=this.handles.length,this.handles.length=this.max+1,g=M;g<this.handles.length;g++)this.handles[g]=new y}return this.freeList===0?u=h:(u=this.freeList,this.freeList=this.handles[u].node),this.nodes[h].handle=u,this.handles[u].node=h,this.handles[u].key=c,this.initialized&&this.floatUp_(h),u},extractMin:function(){var c=this.nodes,h=this.handles,u=c[1].handle,g=h[u].key;return this.size>0&&(c[1].handle=c[this.size].handle,h[c[1].handle].node=1,h[u].key=null,h[u].node=this.freeList,this.freeList=u,--this.size,this.size>0&&this.floatDown_(1)),g},delete:function(c){var h=this.nodes,u=this.handles,g;i(c>=1&&c<=this.max&&u[c].key!==null),g=u[c].node,h[g].handle=h[this.size].handle,u[h[g].handle].node=g,--this.size,g<=this.size&&(g<=1||this.leq(u[h[g>>1].handle].key,u[h[g].handle].key)?this.floatDown_(g):this.floatUp_(g)),u[c].key=null,u[c].node=this.freeList,this.freeList=c}};function x(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}var m={};m.regionBelow=function(c){return c.nodeUp.prev.key},m.regionAbove=function(c){return c.nodeUp.next.key},m.debugEvent=function(c){},m.addWinding=function(c,h){c.winding+=h.winding,c.Sym.winding+=h.Sym.winding},m.edgeLeq=function(c,h,u){var g=c.event,I,b,M=h.eUp,A=u.eUp;if(M.Dst===g)return A.Dst===g?n.vertLeq(M.Org,A.Org)?n.edgeSign(A.Dst,M.Org,A.Org)<=0:n.edgeSign(M.Dst,A.Org,M.Org)>=0:n.edgeSign(A.Dst,g,A.Org)<=0;if(A.Dst===g)return n.edgeSign(M.Dst,g,M.Org)>=0;var I=n.edgeEval(M.Dst,g,M.Org),b=n.edgeEval(A.Dst,g,A.Org);return I>=b},m.deleteRegion=function(c,h){h.fixUpperEdge&&i(h.eUp.winding===0),h.eUp.activeRegion=null,c.dict.delete(h.nodeUp)},m.fixUpperEdge=function(c,h,u){i(h.fixUpperEdge),c.mesh.delete(h.eUp),h.fixUpperEdge=!1,h.eUp=u,u.activeRegion=h},m.topLeftRegion=function(c,h){var u=h.eUp.Org,g;do h=m.regionAbove(h);while(h.eUp.Org===u);if(h.fixUpperEdge){if(g=c.mesh.connect(m.regionBelow(h).eUp.Sym,h.eUp.Lnext),g===null)return null;m.fixUpperEdge(c,h,g),h=m.regionAbove(h)}return h},m.topRightRegion=function(c){var h=c.eUp.Dst;do c=m.regionAbove(c);while(c.eUp.Dst===h);return c},m.addRegionBelow=function(c,h,u){var g=new x;return g.eUp=u,g.nodeUp=c.dict.insertBefore(h.nodeUp,g),g.fixUpperEdge=!1,g.sentinel=!1,g.dirty=!1,u.activeRegion=g,g},m.isWindingInside=function(c,h){switch(c.windingRule){case e.WINDING_ODD:return(h&1)!==0;case e.WINDING_NONZERO:return h!==0;case e.WINDING_POSITIVE:return h>0;case e.WINDING_NEGATIVE:return h<0;case e.WINDING_ABS_GEQ_TWO:return h>=2||h<=-2}return i(!1),!1},m.computeWinding=function(c,h){h.windingNumber=m.regionAbove(h).windingNumber+h.eUp.winding,h.inside=m.isWindingInside(c,h.windingNumber)},m.finishRegion=function(c,h){var u=h.eUp,g=u.Lface;g.inside=h.inside,g.anEdge=u,m.deleteRegion(c,h)},m.finishLeftRegions=function(c,h,u){for(var g,I,M=null,A=h,I=h.eUp;A!==u;){if(A.fixUpperEdge=!1,M=m.regionBelow(A),g=M.eUp,g.Org!=I.Org){if(!M.fixUpperEdge){m.finishRegion(c,A);break}g=c.mesh.connect(I.Lprev,g.Sym),m.fixUpperEdge(c,M,g)}I.Onext!==g&&(c.mesh.splice(g.Oprev,g),c.mesh.splice(I,g)),m.finishRegion(c,A),I=M.eUp,A=M}return I},m.addRightEdges=function(c,h,u,g,M,A){var I,b,E,L,D=!0;E=u;do i(n.vertLeq(E.Org,E.Dst)),m.addRegionBelow(c,h,E.Sym),E=E.Onext;while(E!==g);for(M===null&&(M=m.regionBelow(h).eUp.Rprev),b=h,L=M;I=m.regionBelow(b),E=I.eUp.Sym,E.Org===L.Org;)E.Onext!==L&&(c.mesh.splice(E.Oprev,E),c.mesh.splice(L.Oprev,E)),I.windingNumber=b.windingNumber-E.winding,I.inside=m.isWindingInside(c,I.windingNumber),b.dirty=!0,!D&&m.checkForRightSplice(c,b)&&(m.addWinding(E,L),m.deleteRegion(c,b),c.mesh.delete(L)),D=!1,b=I,L=E;b.dirty=!0,i(b.windingNumber-E.winding===I.windingNumber),A&&m.walkDirtyRegions(c,b)},m.spliceMergeVertices=function(c,h,u){c.mesh.splice(h,u)},m.vertexWeights=function(c,h,u){var g=n.vertL1dist(h,c),M=n.vertL1dist(u,c),A=.5*M/(g+M),I=.5*g/(g+M);c.coords[0]+=A*h.coords[0]+I*u.coords[0],c.coords[1]+=A*h.coords[1]+I*u.coords[1],c.coords[2]+=A*h.coords[2]+I*u.coords[2]},m.getIntersectData=function(c,h,u,g,M,A){h.coords[0]=h.coords[1]=h.coords[2]=0,h.idx=-1,m.vertexWeights(h,u,g),m.vertexWeights(h,M,A)},m.checkForRightSplice=function(c,h){var u=m.regionBelow(h),g=h.eUp,M=u.eUp;if(n.vertLeq(g.Org,M.Org)){if(n.edgeSign(M.Dst,g.Org,M.Org)>0)return!1;n.vertEq(g.Org,M.Org)?g.Org!==M.Org&&(c.pq.delete(g.Org.pqHandle),m.spliceMergeVertices(c,M.Oprev,g)):(c.mesh.splitEdge(M.Sym),c.mesh.splice(g,M.Oprev),h.dirty=u.dirty=!0)}else{if(n.edgeSign(g.Dst,M.Org,g.Org)<0)return!1;m.regionAbove(h).dirty=h.dirty=!0,c.mesh.splitEdge(g.Sym),c.mesh.splice(M.Oprev,g)}return!0},m.checkForLeftSplice=function(c,h){var u=m.regionBelow(h),g=h.eUp,M=u.eUp,A;if(i(!n.vertEq(g.Dst,M.Dst)),n.vertLeq(g.Dst,M.Dst)){if(n.edgeSign(g.Dst,M.Dst,g.Org)<0)return!1;m.regionAbove(h).dirty=h.dirty=!0,A=c.mesh.splitEdge(g),c.mesh.splice(M.Sym,A),A.Lface.inside=h.inside}else{if(n.edgeSign(M.Dst,g.Dst,M.Org)>0)return!1;h.dirty=u.dirty=!0,A=c.mesh.splitEdge(M),c.mesh.splice(g.Lnext,M.Sym),A.Rface.inside=h.inside}return!0},m.checkForIntersect=function(c,h){var u=m.regionBelow(h),g=h.eUp,M=u.eUp,A=g.Org,I=M.Org,b=g.Dst,E=M.Dst,L,D,R=new a,C,W;if(i(!n.vertEq(E,b)),i(n.edgeSign(b,c.event,A)<=0),i(n.edgeSign(E,c.event,I)>=0),i(A!==c.event&&I!==c.event),i(!h.fixUpperEdge&&!u.fixUpperEdge),A===I||(L=Math.min(A.t,b.t),D=Math.max(I.t,E.t),L>D))return!1;if(n.vertLeq(A,I)){if(n.edgeSign(E,A,I)>0)return!1}else if(n.edgeSign(b,I,A)<0)return!1;return m.debugEvent(c),n.intersect(b,A,E,I,R),i(Math.min(A.t,b.t)<=R.t),i(R.t<=Math.max(I.t,E.t)),i(Math.min(E.s,b.s)<=R.s),i(R.s<=Math.max(I.s,A.s)),n.vertLeq(R,c.event)&&(R.s=c.event.s,R.t=c.event.t),C=n.vertLeq(A,I)?A:I,n.vertLeq(C,R)&&(R.s=C.s,R.t=C.t),n.vertEq(R,A)||n.vertEq(R,I)?(m.checkForRightSplice(c,h),!1):!n.vertEq(b,c.event)&&n.edgeSign(b,c.event,R)>=0||!n.vertEq(E,c.event)&&n.edgeSign(E,c.event,R)<=0?E===c.event?(c.mesh.splitEdge(g.Sym),c.mesh.splice(M.Sym,g),h=m.topLeftRegion(c,h),g=m.regionBelow(h).eUp,m.finishLeftRegions(c,m.regionBelow(h),u),m.addRightEdges(c,h,g.Oprev,g,g,!0),!0):b===c.event?(c.mesh.splitEdge(M.Sym),c.mesh.splice(g.Lnext,M.Oprev),u=h,h=m.topRightRegion(h),W=m.regionBelow(h).eUp.Rprev,u.eUp=M.Oprev,M=m.finishLeftRegions(c,u,null),m.addRightEdges(c,h,M.Onext,g.Rprev,W,!0),!0):(n.edgeSign(b,c.event,R)>=0&&(m.regionAbove(h).dirty=h.dirty=!0,c.mesh.splitEdge(g.Sym),g.Org.s=c.event.s,g.Org.t=c.event.t),n.edgeSign(E,c.event,R)<=0&&(h.dirty=u.dirty=!0,c.mesh.splitEdge(M.Sym),M.Org.s=c.event.s,M.Org.t=c.event.t),!1):(c.mesh.splitEdge(g.Sym),c.mesh.splitEdge(M.Sym),c.mesh.splice(M.Oprev,g),g.Org.s=R.s,g.Org.t=R.t,g.Org.pqHandle=c.pq.insert(g.Org),m.getIntersectData(c,g.Org,A,b,I,E),m.regionAbove(h).dirty=h.dirty=u.dirty=!0,!1)},m.walkDirtyRegions=function(c,h){for(var u=m.regionBelow(h),g,M;;){for(;u.dirty;)h=u,u=m.regionBelow(u);if(!h.dirty&&(u=h,h=m.regionAbove(h),h===null||!h.dirty))return;if(h.dirty=!1,g=h.eUp,M=u.eUp,g.Dst!==M.Dst&&m.checkForLeftSplice(c,h)&&(u.fixUpperEdge?(m.deleteRegion(c,u),c.mesh.delete(M),u=m.regionBelow(h),M=u.eUp):h.fixUpperEdge&&(m.deleteRegion(c,h),c.mesh.delete(g),h=m.regionAbove(u),g=h.eUp)),g.Org!==M.Org)if(g.Dst!==M.Dst&&!h.fixUpperEdge&&!u.fixUpperEdge&&(g.Dst===c.event||M.Dst===c.event)){if(m.checkForIntersect(c,h))return}else m.checkForRightSplice(c,h);g.Org===M.Org&&g.Dst===M.Dst&&(m.addWinding(M,g),m.deleteRegion(c,h),c.mesh.delete(g),h=m.regionAbove(u))}},m.connectRightVertex=function(c,h,u){var g,M=u.Onext,A=m.regionBelow(h),I=h.eUp,b=A.eUp,E=!1;if(I.Dst!==b.Dst&&m.checkForIntersect(c,h),n.vertEq(I.Org,c.event)&&(c.mesh.splice(M.Oprev,I),h=m.topLeftRegion(c,h),M=m.regionBelow(h).eUp,m.finishLeftRegions(c,m.regionBelow(h),A),E=!0),n.vertEq(b.Org,c.event)&&(c.mesh.splice(u,b.Oprev),u=m.finishLeftRegions(c,A,null),E=!0),E){m.addRightEdges(c,h,u.Onext,M,M,!0);return}n.vertLeq(b.Org,I.Org)?g=b.Oprev:g=I,g=c.mesh.connect(u.Lprev,g),m.addRightEdges(c,h,g,g.Onext,g.Onext,!1),g.Sym.activeRegion.fixUpperEdge=!0,m.walkDirtyRegions(c,h)},m.connectLeftDegenerate=function(c,h,u){var g,M,A,I,b;if(g=h.eUp,n.vertEq(g.Org,u)){i(!1),m.spliceMergeVertices(c,g,u.anEdge);return}if(!n.vertEq(g.Dst,u)){c.mesh.splitEdge(g.Sym),h.fixUpperEdge&&(c.mesh.delete(g.Onext),h.fixUpperEdge=!1),c.mesh.splice(u.anEdge,g),m.sweepEvent(c,u);return}i(!1),h=m.topRightRegion(h),b=m.regionBelow(h),A=b.eUp.Sym,M=I=A.Onext,b.fixUpperEdge&&(i(M!==A),m.deleteRegion(c,b),c.mesh.delete(A),A=M.Oprev),c.mesh.splice(u.anEdge,A),n.edgeGoesLeft(M)||(M=null),m.addRightEdges(c,h,A.Onext,I,M,!0)},m.connectLeftVertex=function(c,h){var u,g,M,A,I,b,E=new x;if(E.eUp=h.anEdge.Sym,u=c.dict.search(E).key,g=m.regionBelow(u),!!g){if(A=u.eUp,I=g.eUp,n.edgeSign(A.Dst,h,A.Org)===0){m.connectLeftDegenerate(c,u,h);return}if(M=n.vertLeq(I.Dst,A.Dst)?u:g,u.inside||M.fixUpperEdge){if(M===u)b=c.mesh.connect(h.anEdge.Sym,A.Lnext);else{var L=c.mesh.connect(I.Dnext,h.anEdge);b=L.Sym}M.fixUpperEdge?m.fixUpperEdge(c,M,b):m.computeWinding(c,m.addRegionBelow(c,u,b)),m.sweepEvent(c,h)}else m.addRightEdges(c,u,h.anEdge,h.anEdge,null,!0)}},m.sweepEvent=function(c,h){c.event=h,m.debugEvent(c);for(var u=h.anEdge;u.activeRegion===null;)if(u=u.Onext,u===h.anEdge){m.connectLeftVertex(c,h);return}var g=m.topLeftRegion(c,u.activeRegion);i(g!==null);var M=m.regionBelow(g),A=M.eUp,I=m.finishLeftRegions(c,M,null);I.Onext===A?m.connectRightVertex(c,g,I):m.addRightEdges(c,g,I.Onext,A,A,!0)},m.addSentinel=function(c,h,u,g){var M=new x,A=c.mesh.makeEdge();A.Org.s=u,A.Org.t=g,A.Dst.s=h,A.Dst.t=g,c.event=A.Dst,M.eUp=A,M.windingNumber=0,M.inside=!1,M.fixUpperEdge=!1,M.sentinel=!0,M.dirty=!1,M.nodeUp=c.dict.insert(M)},m.initEdgeDict=function(c){c.dict=new l(c,m.edgeLeq);var h=c.bmax[0]-c.bmin[0],u=c.bmax[1]-c.bmin[1],g=c.bmin[0]-h,M=c.bmax[0]+h,A=c.bmin[1]-u,I=c.bmax[1]+u;m.addSentinel(c,g,M,A),m.addSentinel(c,g,M,I)},m.doneEdgeDict=function(c){for(var h,u=0;(h=c.dict.min().key)!==null;)h.sentinel||(i(h.fixUpperEdge),i(++u===1)),i(h.windingNumber===0),m.deleteRegion(c,h)},m.removeDegenerateEdges=function(c){var h,u,g,M=c.mesh.eHead;for(h=M.next;h!==M;h=u)u=h.next,g=h.Lnext,n.vertEq(h.Org,h.Dst)&&h.Lnext.Lnext!==h&&(m.spliceMergeVertices(c,g,h),c.mesh.delete(h),h=g,g=h.Lnext),g.Lnext===h&&(g!==h&&((g===u||g===u.Sym)&&(u=u.next),c.mesh.delete(g)),(h===u||h===u.Sym)&&(u=u.next),c.mesh.delete(h))},m.initPriorityQ=function(c){var h,u,g,M=0;for(g=c.mesh.vHead,u=g.next;u!==g;u=u.next)M++;for(M+=8,h=c.pq=new O(M,n.vertLeq),g=c.mesh.vHead,u=g.next;u!==g;u=u.next)u.pqHandle=h.insert(u);return u!==g?!1:(h.init(),!0)},m.donePriorityQ=function(c){c.pq=null},m.removeDegenerateFaces=function(c,h){var u,g,M;for(u=h.fHead.next;u!==h.fHead;u=g)g=u.next,M=u.anEdge,i(M.Lnext!==M),M.Lnext.Lnext===M&&(m.addWinding(M.Onext,M),c.mesh.delete(M));return!0},m.computeInterior=function(c){var h,u;if(m.removeDegenerateEdges(c),!m.initPriorityQ(c))return!1;for(m.initEdgeDict(c);(h=c.pq.extractMin())!==null;){for(;u=c.pq.min(),!(u===null||!n.vertEq(u,h));)u=c.pq.extractMin(),m.spliceMergeVertices(c,h.anEdge,u.anEdge);m.sweepEvent(c,h)}return c.event=c.dict.min().key.eUp.Org,m.debugEvent(c),m.doneEdgeDict(c),m.donePriorityQ(c),m.removeDegenerateFaces(c,c.mesh)?(c.mesh.check(),!0):!1};function T(){this.mesh=null,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=e.WINDING_ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}T.prototype={dot_:function(c,h){return c[0]*h[0]+c[1]*h[1]+c[2]*h[2]},normalize_:function(c){var h=c[0]*c[0]+c[1]*c[1]+c[2]*c[2];i(h>0),h=Math.sqrt(h),c[0]/=h,c[1]/=h,c[2]/=h},longAxis_:function(c){var h=0;return Math.abs(c[1])>Math.abs(c[0])&&(h=1),Math.abs(c[2])>Math.abs(c[h])&&(h=2),h},computeNormal_:function(c){var h,u,g,M,A,I,b=[0,0,0],E=[0,0,0],L=[0,0,0],D=[0,0,0],R=[0,0,0],C=[null,null,null],W=[null,null,null],z=this.mesh.vHead,H;for(h=z.next,H=0;H<3;++H)M=h.coords[H],E[H]=M,W[H]=h,b[H]=M,C[H]=h;for(h=z.next;h!==z;h=h.next)for(H=0;H<3;++H)M=h.coords[H],M<E[H]&&(E[H]=M,W[H]=h),M>b[H]&&(b[H]=M,C[H]=h);if(H=0,b[1]-E[1]>b[0]-E[0]&&(H=1),b[2]-E[2]>b[H]-E[H]&&(H=2),E[H]>=b[H]){c[0]=0,c[1]=0,c[2]=1;return}for(I=0,u=W[H],g=C[H],L[0]=u.coords[0]-g.coords[0],L[1]=u.coords[1]-g.coords[1],L[2]=u.coords[2]-g.coords[2],h=z.next;h!==z;h=h.next)D[0]=h.coords[0]-g.coords[0],D[1]=h.coords[1]-g.coords[1],D[2]=h.coords[2]-g.coords[2],R[0]=L[1]*D[2]-L[2]*D[1],R[1]=L[2]*D[0]-L[0]*D[2],R[2]=L[0]*D[1]-L[1]*D[0],A=R[0]*R[0]+R[1]*R[1]+R[2]*R[2],A>I&&(I=A,c[0]=R[0],c[1]=R[1],c[2]=R[2]);I<=0&&(c[0]=c[1]=c[2]=0,c[this.longAxis_(L)]=1)},checkOrientation_:function(){var c,h,u=this.mesh.fHead,g,M=this.mesh.vHead,A;for(c=0,h=u.next;h!==u;h=h.next)if(A=h.anEdge,!(A.winding<=0))do c+=(A.Org.s-A.Dst.s)*(A.Org.t+A.Dst.t),A=A.Lnext;while(A!==h.anEdge);if(c<0){for(g=M.next;g!==M;g=g.next)g.t=-g.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},projectPolygon_:function(){var c,h=this.mesh.vHead,u=[0,0,0],g,M,A,I,b=!1;for(u[0]=this.normal[0],u[1]=this.normal[1],u[2]=this.normal[2],u[0]===0&&u[1]===0&&u[2]===0&&(this.computeNormal_(u),b=!0),g=this.sUnit,M=this.tUnit,A=this.longAxis_(u),g[A]=0,g[(A+1)%3]=1,g[(A+2)%3]=0,M[A]=0,M[(A+1)%3]=0,M[(A+2)%3]=u[A]>0?1:-1,c=h.next;c!==h;c=c.next)c.s=this.dot_(c.coords,g),c.t=this.dot_(c.coords,M);for(b&&this.checkOrientation_(),I=!0,c=h.next;c!==h;c=c.next)I?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,I=!1):(c.s<this.bmin[0]&&(this.bmin[0]=c.s),c.s>this.bmax[0]&&(this.bmax[0]=c.s),c.t<this.bmin[1]&&(this.bmin[1]=c.t),c.t>this.bmax[1]&&(this.bmax[1]=c.t))},addWinding_:function(c,h){c.winding+=h.winding,c.Sym.winding+=h.Sym.winding},tessellateMonoRegion_:function(c,h){var u,g;for(u=h.anEdge,i(u.Lnext!==u&&u.Lnext.Lnext!==u);n.vertLeq(u.Dst,u.Org);u=u.Lprev);for(;n.vertLeq(u.Org,u.Dst);u=u.Lnext);for(g=u.Lprev;u.Lnext!==g;)if(n.vertLeq(u.Dst,g.Org)){for(;g.Lnext!==u&&(n.edgeGoesLeft(g.Lnext)||n.edgeSign(g.Org,g.Dst,g.Lnext.Dst)<=0);){var M=c.connect(g.Lnext,g);g=M.Sym}g=g.Lprev}else{for(;g.Lnext!==u&&(n.edgeGoesRight(u.Lprev)||n.edgeSign(u.Dst,u.Org,u.Lprev.Org)>=0);){var M=c.connect(u,u.Lprev);u=M.Sym}u=u.Lnext}for(i(g.Lnext!==u);g.Lnext.Lnext!==u;){var M=c.connect(g.Lnext,g);g=M.Sym}return!0},tessellateInterior_:function(c){var h,u;for(h=c.fHead.next;h!==c.fHead;h=u)if(u=h.next,h.inside&&!this.tessellateMonoRegion_(c,h))return!1;return!0},discardExterior_:function(c){var h,u;for(h=c.fHead.next;h!==c.fHead;h=u)u=h.next,h.inside||c.zapFace(h)},setWindingNumber_:function(c,h,u){var g,M;for(g=c.eHead.next;g!==c.eHead;g=M)M=g.next,g.Rface.inside!==g.Lface.inside?g.winding=g.Lface.inside?h:-h:u?c.delete(g):g.winding=0},getNeighbourFace_:function(c){return!c.Rface||!c.Rface.inside?-1:c.Rface.n},outputPolymesh_:function(c,h,u,g){var M,A,I,b=0,E=0,L,D;for(u>3&&c.mergeConvexFaces(u),M=c.vHead.next;M!==c.vHead;M=M.next)M.n=-1;for(A=c.fHead.next;A!==c.fHead;A=A.next)if(A.n=-1,!!A.inside){I=A.anEdge,L=0;do M=I.Org,M.n===-1&&(M.n=E,E++),L++,I=I.Lnext;while(I!==A.anEdge);i(L<=u),A.n=b,++b}for(this.elementCount=b,h===e.CONNECTED_POLYGONS&&(b*=2),this.elements=[],this.elements.length=b*u,this.vertexCount=E,this.vertices=[],this.vertices.length=E*g,this.vertexIndices=[],this.vertexIndices.length=E,M=c.vHead.next;M!==c.vHead;M=M.next)if(M.n!==-1){var R=M.n*g;this.vertices[R+0]=M.coords[0],this.vertices[R+1]=M.coords[1],g>2&&(this.vertices[R+2]=M.coords[2]),this.vertexIndices[M.n]=M.idx}var C=0;for(A=c.fHead.next;A!==c.fHead;A=A.next)if(A.inside){I=A.anEdge,L=0;do M=I.Org,this.elements[C++]=M.n,L++,I=I.Lnext;while(I!==A.anEdge);for(D=L;D<u;++D)this.elements[C++]=-1;if(h===e.CONNECTED_POLYGONS){I=A.anEdge;do this.elements[C++]=this.getNeighbourFace_(I),I=I.Lnext;while(I!==A.anEdge);for(D=L;D<u;++D)this.elements[C++]=-1}}},outputContours_:function(c,h){var u,g,M,A=0,I=0;for(this.vertexCount=0,this.elementCount=0,u=c.fHead.next;u!==c.fHead;u=u.next)if(u.inside){M=g=u.anEdge;do this.vertexCount++,g=g.Lnext;while(g!==M);this.elementCount++}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*h,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var b=0,E=0,L=0;for(A=0,u=c.fHead.next;u!==c.fHead;u=u.next)if(u.inside){I=0,M=g=u.anEdge;do this.vertices[b++]=g.Org.coords[0],this.vertices[b++]=g.Org.coords[1],h>2&&(this.vertices[b++]=g.Org.coords[2]),this.vertexIndices[E++]=g.Org.idx,I++,g=g.Lnext;while(g!==M);this.elements[L++]=A,this.elements[L++]=I,A+=I}},addContour:function(c,h){var u,g;for(this.mesh===null&&(this.mesh=new f),c<2&&(c=2),c>3&&(c=3),u=null,g=0;g<h.length;g+=c)u===null?(u=this.mesh.makeEdge(),this.mesh.splice(u,u.Sym)):(this.mesh.splitEdge(u),u=u.Lnext),u.Org.coords[0]=h[g+0],u.Org.coords[1]=h[g+1],c>2?u.Org.coords[2]=h[g+2]:u.Org.coords[2]=0,u.Org.idx=this.vertexIndexCounter++,u.winding=1,u.Sym.winding=-1},tesselate:function(c,h,u,g,M){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,M&&(this.normal[0]=M[0],this.normal[1]=M[1],this.normal[2]=M[2]),this.windingRule=c,g<2&&(g=2),g>3&&(g=3),!this.mesh)return!1;this.projectPolygon_(),m.computeInterior(this);var A=this.mesh;return h===e.BOUNDARY_CONTOURS?this.setWindingNumber_(A,1,!0):this.tessellateInterior_(A),A.check(),h===e.BOUNDARY_CONTOURS?this.outputContours_(A,g):this.outputPolymesh_(A,h,u,g),!0}}},function(d,r){d.exports=e;var t=Object.prototype.hasOwnProperty;function e(){for(var n={},i=0;i<arguments.length;i++){var a=arguments[i];for(var s in a)t.call(a,s)&&(n[s]=a[s])}return n}},function(d,r,t){t.r(r),t.d(r,"createShaders",function(){return o}),t.d(r,"applyShader",function(){return f}),t.d(r,"createCloudShaders",function(){return l}),t.d(r,"applyCloudShader",function(){return p});var e=t(64),n=t(65),i=t(66),a=t(67);t(1).glMatrix.setMatrixArrayType(Array);const s=Symbol("shaders");function o(y){y[s]=[];for(let O=0;O<16;O++){const x=[],m=!!(O&1),T=!!(O&2),c=!!(O&4),h=!!(O&8);m&&x.push("#define TEXTURE 1"),T&&x.push("#define FILTER 1"),c&&x.push("#define GRADIENT 1"),h&&x.push("#define CLIPPATH 1");const u=`${x.join(`
|
|
39
|
-
`)}
|
|
40
|
-
`,g=[];m&&g.push("uniform sampler2D u_texSampler;"),h&&g.push("uniform sampler2D u_clipSampler;"),y[s][O]=[u+g.join(`
|
|
41
|
-
`)+n.default,u+e.default]}}function f(y,{hasTexture:O=!1,hasFilter:x=!1,hasGradient:m=!1,hasClipPath:T=!1}={}){const c=O|x<<1|m<<2|T<<3;let h=y[s][c];Array.isArray(h)&&(h=y.createProgram(...h),y[s][c]=h),y.program!==h&&y.useProgram(h,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}})}const v=[];function l(y){for(let O=0;O<64;O++){const x=[],m=!!(O&1),T=!!(O&2),c=!!(O&4),h=!!(O&8),u=!!(O&16),g=!!(O&32);m&&x.push("#define TEXTURE 1"),T&&x.push("#define FILTER 1"),c&&x.push("#define GRADIENT 1"),h&&x.push("#define CLOUDCOLOR 1"),u&&x.push("#define CLOUDFILTER 1"),g&&x.push("#define CLIPPATH 1");const M=`${x.join(`
|
|
42
|
-
`)}
|
|
43
|
-
`,A=[];if(m){A.push("uniform sampler2D u_texSampler;");for(let I=0;I<12;I++)A.push(`uniform sampler2D u_texFrame${I};`)}g&&A.push("uniform sampler2D u_clipSampler;"),v[O]=[M+A.join(`
|
|
44
|
-
`)+a.default,M+i.default]}}function p(y,{hasTexture:O=!1,hasFilter:x=!1,hasGradient:m=!1,hasCloudColor:T=!1,hasCloudFilter:c=!1,hasClipPath:h=!1}={}){const u=O|x<<1|m<<2|T<<3|c<<4|h<<5;let g=v[u];Array.isArray(g)&&(g=y.createProgram(...g),v[u]=g),y.program!==g&&y.useProgram(g,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}})}},function(d,r,t){t.r(r),r.default=`attribute vec3 a_vertexPosition;
|
|
45
|
-
attribute vec4 a_color;
|
|
46
|
-
varying vec4 vColor;
|
|
47
|
-
varying float flagBackground;
|
|
48
|
-
uniform vec2 u_resolution;
|
|
49
|
-
uniform mat3 viewMatrix;
|
|
50
|
-
uniform mat3 projectionMatrix;
|
|
51
|
-
|
|
52
|
-
#ifdef TEXTURE
|
|
53
|
-
attribute vec3 a_vertexTextureCoord;
|
|
54
|
-
varying vec3 vTextureCoord;
|
|
55
|
-
attribute vec4 a_sourceRect;
|
|
56
|
-
varying vec4 vSourceRect;
|
|
57
|
-
#endif
|
|
58
|
-
|
|
59
|
-
#ifdef CLIPPATH
|
|
60
|
-
attribute vec2 a_clipUV;
|
|
61
|
-
varying vec2 vClipUV;
|
|
62
|
-
#endif
|
|
63
|
-
|
|
64
|
-
#ifdef GRADIENT
|
|
65
|
-
uniform float u_radialGradientVector[6];
|
|
66
|
-
varying vec3 vGradientVector1;
|
|
67
|
-
varying vec3 vGradientVector2;
|
|
68
|
-
#endif
|
|
69
|
-
|
|
70
|
-
void main() {
|
|
71
|
-
gl_PointSize = 1.0;
|
|
72
|
-
|
|
73
|
-
vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);
|
|
74
|
-
gl_Position = vec4(pos.xy, 1.0, 1.0);
|
|
75
|
-
|
|
76
|
-
#ifdef GRADIENT
|
|
77
|
-
vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);
|
|
78
|
-
vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);
|
|
79
|
-
float h = u_resolution.y;
|
|
80
|
-
vg1.y = h - vg1.y;
|
|
81
|
-
vg2.y = h - vg2.y;
|
|
82
|
-
vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);
|
|
83
|
-
vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);
|
|
84
|
-
#endif
|
|
85
|
-
|
|
86
|
-
flagBackground = a_vertexPosition.z;
|
|
87
|
-
vColor = a_color;
|
|
88
|
-
|
|
89
|
-
#ifdef TEXTURE
|
|
90
|
-
vTextureCoord = a_vertexTextureCoord;
|
|
91
|
-
vSourceRect = a_sourceRect;
|
|
92
|
-
#endif
|
|
93
|
-
|
|
94
|
-
#ifdef CLIPPATH
|
|
95
|
-
vClipUV = a_clipUV;
|
|
96
|
-
#endif
|
|
97
|
-
}`},function(d,r,t){t.r(r),r.default=`precision mediump float;
|
|
98
|
-
|
|
99
|
-
varying vec4 vColor;
|
|
100
|
-
varying float flagBackground;
|
|
101
|
-
|
|
102
|
-
#ifdef TEXTURE
|
|
103
|
-
varying vec3 vTextureCoord;
|
|
104
|
-
varying vec4 vSourceRect;
|
|
105
|
-
#endif
|
|
106
|
-
|
|
107
|
-
#ifdef CLIPPATH
|
|
108
|
-
varying vec2 vClipUV;
|
|
109
|
-
#endif
|
|
110
|
-
|
|
111
|
-
#ifdef FILTER
|
|
112
|
-
uniform int u_filterFlag;
|
|
113
|
-
uniform float u_colorMatrix[20];
|
|
114
|
-
#endif
|
|
115
|
-
|
|
116
|
-
#ifdef GRADIENT
|
|
117
|
-
varying vec3 vGradientVector1;
|
|
118
|
-
varying vec3 vGradientVector2;
|
|
119
|
-
uniform float u_colorSteps[40];
|
|
120
|
-
uniform int u_gradientType;
|
|
121
|
-
// uniform float u_radialGradientVector[6];
|
|
122
|
-
|
|
123
|
-
void gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {
|
|
124
|
-
float t;
|
|
125
|
-
// center circle radius
|
|
126
|
-
float cr = gv1.z;
|
|
127
|
-
// focal circle radius
|
|
128
|
-
float fr = gv2.z;
|
|
129
|
-
|
|
130
|
-
if(cr > 0.0 || fr > 0.0) {
|
|
131
|
-
// radial gradient
|
|
132
|
-
vec2 center = gv1.xy;
|
|
133
|
-
vec2 focal = gv2.xy;
|
|
134
|
-
float x = focal.x - gl_FragCoord.x;
|
|
135
|
-
float y = focal.y - gl_FragCoord.y;
|
|
136
|
-
float dx = focal.x - center.x;
|
|
137
|
-
float dy = focal.y - center.y;
|
|
138
|
-
float dr = cr - fr;
|
|
139
|
-
float a = dx * dx + dy * dy - dr * dr;
|
|
140
|
-
float b = -2.0 * (y * dy + x * dx + fr * dr);
|
|
141
|
-
float c = x * x + y * y - fr * fr;
|
|
142
|
-
t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));
|
|
143
|
-
} else {
|
|
144
|
-
// linear gradient
|
|
145
|
-
vec2 v1 = gl_FragCoord.xy - gv1.xy;
|
|
146
|
-
vec2 v2 = gv2.xy - gv1.xy;
|
|
147
|
-
t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
vec4 colors[8];
|
|
151
|
-
colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);
|
|
152
|
-
colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);
|
|
153
|
-
colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);
|
|
154
|
-
colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);
|
|
155
|
-
colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);
|
|
156
|
-
colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);
|
|
157
|
-
colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);
|
|
158
|
-
colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);
|
|
159
|
-
|
|
160
|
-
float steps[8];
|
|
161
|
-
steps[0] = colorSteps[0];
|
|
162
|
-
steps[1] = colorSteps[5];
|
|
163
|
-
steps[2] = colorSteps[10];
|
|
164
|
-
steps[3] = colorSteps[15];
|
|
165
|
-
steps[4] = colorSteps[20];
|
|
166
|
-
steps[5] = colorSteps[25];
|
|
167
|
-
steps[6] = colorSteps[30];
|
|
168
|
-
steps[7] = colorSteps[35];
|
|
169
|
-
|
|
170
|
-
color = colors[0];
|
|
171
|
-
for (int i = 1; i < 8; i++) {
|
|
172
|
-
if (steps[i] < 0.0 || steps[i] > 1.0) {
|
|
173
|
-
break;
|
|
174
|
-
}
|
|
175
|
-
if(steps[i] == steps[i - 1]) {
|
|
176
|
-
color = colors[i];
|
|
177
|
-
} else {
|
|
178
|
-
color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));
|
|
179
|
-
}
|
|
180
|
-
if (steps[i] >= t) {
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
#endif
|
|
186
|
-
|
|
187
|
-
#ifdef FILTER
|
|
188
|
-
void transformColor(inout vec4 color, in float colorMatrix[20]) {
|
|
189
|
-
float r = color.r, g = color.g, b = color.b, a = color.a;
|
|
190
|
-
color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];
|
|
191
|
-
color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];
|
|
192
|
-
color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];
|
|
193
|
-
color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];
|
|
194
|
-
}
|
|
195
|
-
#endif
|
|
196
|
-
|
|
197
|
-
void main() {
|
|
198
|
-
vec4 color = vColor;
|
|
199
|
-
float opacity = abs(flagBackground);
|
|
200
|
-
|
|
201
|
-
#ifdef GRADIENT
|
|
202
|
-
if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {
|
|
203
|
-
gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);
|
|
204
|
-
}
|
|
205
|
-
#endif
|
|
206
|
-
|
|
207
|
-
if(opacity < 1.0) {
|
|
208
|
-
color.a *= opacity;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
#ifdef TEXTURE
|
|
212
|
-
if(flagBackground > 0.0) {
|
|
213
|
-
vec3 texCoord = vTextureCoord;
|
|
214
|
-
|
|
215
|
-
if(texCoord.z == 1.0) {
|
|
216
|
-
texCoord = fract(texCoord);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
if(texCoord.x <= 1.0 && texCoord.x >= 0.0
|
|
220
|
-
&& texCoord.y <= 1.0 && texCoord.y >= 0.0) {
|
|
221
|
-
if(vSourceRect.z > 0.0) {
|
|
222
|
-
texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;
|
|
223
|
-
texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);
|
|
224
|
-
}
|
|
225
|
-
vec4 texColor = texture2D(u_texSampler, texCoord.xy);
|
|
226
|
-
float alpha = texColor.a;
|
|
227
|
-
if(opacity < 1.0) {
|
|
228
|
-
texColor.a *= opacity;
|
|
229
|
-
alpha *= mix(0.465, 1.0, opacity);
|
|
230
|
-
}
|
|
231
|
-
// color = mix(color, texColor, texColor.a);
|
|
232
|
-
color.rgb = mix(color.rgb, texColor.rgb, alpha);
|
|
233
|
-
// color.rgb = mix(texColor.rgb, color.rgb, color.a);
|
|
234
|
-
color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));
|
|
235
|
-
color.a = texColor.a + (1.0 - texColor.a) * color.a;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
#endif
|
|
239
|
-
|
|
240
|
-
#ifdef FILTER
|
|
241
|
-
if(u_filterFlag > 0) {
|
|
242
|
-
transformColor(color, u_colorMatrix);
|
|
243
|
-
}
|
|
244
|
-
#endif
|
|
245
|
-
|
|
246
|
-
#ifdef CLIPPATH
|
|
247
|
-
float clip = texture2D(u_clipSampler, vClipUV).r;
|
|
248
|
-
color *= clip;
|
|
249
|
-
#endif
|
|
250
|
-
|
|
251
|
-
gl_FragColor = color;
|
|
252
|
-
}`},function(d,r,t){t.r(r),r.default=`attribute vec3 a_vertexPosition;
|
|
253
|
-
attribute vec4 a_color;
|
|
254
|
-
varying vec4 vColor;
|
|
255
|
-
varying float flagBackground;
|
|
256
|
-
attribute vec3 a_transform0;
|
|
257
|
-
attribute vec3 a_transform1;
|
|
258
|
-
uniform vec2 u_resolution;
|
|
259
|
-
uniform mat3 viewMatrix;
|
|
260
|
-
uniform mat3 projectionMatrix;
|
|
261
|
-
|
|
262
|
-
#ifdef TEXTURE
|
|
263
|
-
attribute vec3 a_vertexTextureCoord;
|
|
264
|
-
varying vec3 vTextureCoord;
|
|
265
|
-
attribute float a_frameIndex;
|
|
266
|
-
varying float frameIndex;
|
|
267
|
-
attribute vec4 a_sourceRect;
|
|
268
|
-
varying vec4 vSourceRect;
|
|
269
|
-
#endif
|
|
270
|
-
|
|
271
|
-
#ifdef CLIPPATH
|
|
272
|
-
attribute vec2 a_clipUV;
|
|
273
|
-
varying vec2 vClipUV;
|
|
274
|
-
#endif
|
|
275
|
-
|
|
276
|
-
#ifdef CLOUDFILTER
|
|
277
|
-
attribute vec4 a_colorCloud0;
|
|
278
|
-
attribute vec4 a_colorCloud1;
|
|
279
|
-
attribute vec4 a_colorCloud2;
|
|
280
|
-
attribute vec4 a_colorCloud3;
|
|
281
|
-
attribute vec4 a_colorCloud4;
|
|
282
|
-
varying vec4 colorCloud0;
|
|
283
|
-
varying vec4 colorCloud1;
|
|
284
|
-
varying vec4 colorCloud2;
|
|
285
|
-
varying vec4 colorCloud3;
|
|
286
|
-
varying vec4 colorCloud4;
|
|
287
|
-
#endif
|
|
288
|
-
|
|
289
|
-
#ifdef CLOUDCOLOR
|
|
290
|
-
attribute vec4 a_fillCloudColor;
|
|
291
|
-
attribute vec4 a_strokeCloudColor;
|
|
292
|
-
#endif
|
|
293
|
-
|
|
294
|
-
#ifdef GRADIENT
|
|
295
|
-
uniform float u_radialGradientVector[6];
|
|
296
|
-
varying vec3 vGradientVector1;
|
|
297
|
-
varying vec3 vGradientVector2;
|
|
298
|
-
#endif
|
|
299
|
-
|
|
300
|
-
void main() {
|
|
301
|
-
gl_PointSize = 1.0;
|
|
302
|
-
|
|
303
|
-
mat3 modelMatrix = mat3(
|
|
304
|
-
a_transform0.x, a_transform1.x, 0,
|
|
305
|
-
a_transform0.y, a_transform1.y, 0,
|
|
306
|
-
a_transform0.z, a_transform1.z, 1
|
|
307
|
-
);
|
|
308
|
-
|
|
309
|
-
vec3 pos = projectionMatrix * viewMatrix * modelMatrix * vec3(a_vertexPosition.xy, 1.0);
|
|
310
|
-
gl_Position = vec4(pos.xy, 1.0, 1.0);
|
|
311
|
-
|
|
312
|
-
#ifdef GRADIENT
|
|
313
|
-
vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);
|
|
314
|
-
vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);
|
|
315
|
-
float h = u_resolution.y;
|
|
316
|
-
vg1.y = h - vg1.y;
|
|
317
|
-
vg2.y = h - vg2.y;
|
|
318
|
-
vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);
|
|
319
|
-
vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);
|
|
320
|
-
#endif
|
|
321
|
-
|
|
322
|
-
flagBackground = a_vertexPosition.z;
|
|
323
|
-
|
|
324
|
-
#ifdef CLOUDCOLOR
|
|
325
|
-
if(flagBackground > 0.0) {
|
|
326
|
-
vColor = mix(a_color, a_fillCloudColor, a_fillCloudColor.a);
|
|
327
|
-
} else {
|
|
328
|
-
vColor = mix(a_color, a_strokeCloudColor, a_strokeCloudColor.a);
|
|
329
|
-
}
|
|
330
|
-
#else
|
|
331
|
-
vColor = a_color;
|
|
332
|
-
#endif
|
|
333
|
-
|
|
334
|
-
#ifdef TEXTURE
|
|
335
|
-
vTextureCoord = a_vertexTextureCoord;
|
|
336
|
-
frameIndex = a_frameIndex;
|
|
337
|
-
vSourceRect = a_sourceRect;
|
|
338
|
-
#endif
|
|
339
|
-
|
|
340
|
-
#ifdef CLIPPATH
|
|
341
|
-
vClipUV = a_clipUV;
|
|
342
|
-
#endif
|
|
343
|
-
|
|
344
|
-
#ifdef CLOUDFILTER
|
|
345
|
-
colorCloud0 = a_colorCloud0;
|
|
346
|
-
colorCloud1 = a_colorCloud1;
|
|
347
|
-
colorCloud2 = a_colorCloud2;
|
|
348
|
-
colorCloud3 = a_colorCloud3;
|
|
349
|
-
colorCloud4 = a_colorCloud4;
|
|
350
|
-
#endif
|
|
351
|
-
}`},function(d,r,t){t.r(r),r.default=`precision mediump float;
|
|
352
|
-
|
|
353
|
-
varying vec4 vColor;
|
|
354
|
-
varying float flagBackground;
|
|
355
|
-
|
|
356
|
-
#ifdef TEXTURE
|
|
357
|
-
varying float frameIndex;
|
|
358
|
-
varying vec3 vTextureCoord;
|
|
359
|
-
varying vec4 vSourceRect;
|
|
360
|
-
#endif
|
|
361
|
-
|
|
362
|
-
#ifdef CLIPPATH
|
|
363
|
-
varying vec2 vClipUV;
|
|
364
|
-
#endif
|
|
365
|
-
|
|
366
|
-
#ifdef FILTER
|
|
367
|
-
uniform int u_filterFlag;
|
|
368
|
-
uniform float u_colorMatrix[20];
|
|
369
|
-
#endif
|
|
370
|
-
|
|
371
|
-
#ifdef CLOUDFILTER
|
|
372
|
-
varying vec4 colorCloud0;
|
|
373
|
-
varying vec4 colorCloud1;
|
|
374
|
-
varying vec4 colorCloud2;
|
|
375
|
-
varying vec4 colorCloud3;
|
|
376
|
-
varying vec4 colorCloud4;
|
|
377
|
-
#endif
|
|
378
|
-
|
|
379
|
-
#ifdef GRADIENT
|
|
380
|
-
varying vec3 vGradientVector1;
|
|
381
|
-
varying vec3 vGradientVector2;
|
|
382
|
-
uniform float u_colorSteps[40];
|
|
383
|
-
uniform int u_gradientType;
|
|
384
|
-
|
|
385
|
-
void gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {
|
|
386
|
-
float t;
|
|
387
|
-
// center circle radius
|
|
388
|
-
float cr = gv1.z;
|
|
389
|
-
// focal circle radius
|
|
390
|
-
float fr = gv2.z;
|
|
391
|
-
|
|
392
|
-
if(cr > 0.0 || fr > 0.0) {
|
|
393
|
-
// radial gradient
|
|
394
|
-
vec2 center = gv1.xy;
|
|
395
|
-
vec2 focal = gv2.xy;
|
|
396
|
-
float x = focal.x - gl_FragCoord.x;
|
|
397
|
-
float y = focal.y - gl_FragCoord.y;
|
|
398
|
-
float dx = focal.x - center.x;
|
|
399
|
-
float dy = focal.y - center.y;
|
|
400
|
-
float dr = cr - fr;
|
|
401
|
-
float a = dx * dx + dy * dy - dr * dr;
|
|
402
|
-
float b = -2.0 * (y * dy + x * dx + fr * dr);
|
|
403
|
-
float c = x * x + y * y - fr * fr;
|
|
404
|
-
t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));
|
|
405
|
-
} else {
|
|
406
|
-
// linear gradient
|
|
407
|
-
vec2 v1 = gl_FragCoord.xy - gv1.xy;
|
|
408
|
-
vec2 v2 = gv2.xy - gv1.xy;
|
|
409
|
-
t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
vec4 colors[8];
|
|
413
|
-
colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);
|
|
414
|
-
colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);
|
|
415
|
-
colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);
|
|
416
|
-
colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);
|
|
417
|
-
colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);
|
|
418
|
-
colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);
|
|
419
|
-
colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);
|
|
420
|
-
colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);
|
|
421
|
-
|
|
422
|
-
float steps[8];
|
|
423
|
-
steps[0] = colorSteps[0];
|
|
424
|
-
steps[1] = colorSteps[5];
|
|
425
|
-
steps[2] = colorSteps[10];
|
|
426
|
-
steps[3] = colorSteps[15];
|
|
427
|
-
steps[4] = colorSteps[20];
|
|
428
|
-
steps[5] = colorSteps[25];
|
|
429
|
-
steps[6] = colorSteps[30];
|
|
430
|
-
steps[7] = colorSteps[35];
|
|
431
|
-
|
|
432
|
-
color = colors[0];
|
|
433
|
-
for (int i = 1; i < 8; i++) {
|
|
434
|
-
if (steps[i] < 0.0 || steps[i] > 1.0) {
|
|
435
|
-
break;
|
|
436
|
-
}
|
|
437
|
-
if(steps[i] == steps[i - 1]) {
|
|
438
|
-
color = colors[i];
|
|
439
|
-
} else {
|
|
440
|
-
color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));
|
|
441
|
-
}
|
|
442
|
-
if (steps[i] >= t) {
|
|
443
|
-
break;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
#endif
|
|
448
|
-
|
|
449
|
-
void transformColor(inout vec4 color, in float colorMatrix[20]) {
|
|
450
|
-
float r = color.r, g = color.g, b = color.b, a = color.a;
|
|
451
|
-
color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];
|
|
452
|
-
color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];
|
|
453
|
-
color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];
|
|
454
|
-
color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
#ifdef CLOUDFILTER
|
|
458
|
-
void buildCloudColor(inout float colorCloudMatrix[20]) {
|
|
459
|
-
colorCloudMatrix[0] = colorCloud0[0];
|
|
460
|
-
colorCloudMatrix[1] = colorCloud1[0];
|
|
461
|
-
colorCloudMatrix[2] = colorCloud2[0];
|
|
462
|
-
colorCloudMatrix[3] = colorCloud3[0];
|
|
463
|
-
colorCloudMatrix[4] = colorCloud4[0];
|
|
464
|
-
|
|
465
|
-
colorCloudMatrix[5] = colorCloud0[1];
|
|
466
|
-
colorCloudMatrix[6] = colorCloud1[1];
|
|
467
|
-
colorCloudMatrix[7] = colorCloud2[1];
|
|
468
|
-
colorCloudMatrix[8] = colorCloud3[1];
|
|
469
|
-
colorCloudMatrix[9] = colorCloud4[1];
|
|
470
|
-
|
|
471
|
-
colorCloudMatrix[10] = colorCloud0[2];
|
|
472
|
-
colorCloudMatrix[11] = colorCloud1[2];
|
|
473
|
-
colorCloudMatrix[12] = colorCloud2[2];
|
|
474
|
-
colorCloudMatrix[13] = colorCloud3[2];
|
|
475
|
-
colorCloudMatrix[14] = colorCloud4[2];
|
|
476
|
-
|
|
477
|
-
colorCloudMatrix[15] = colorCloud0[3];
|
|
478
|
-
colorCloudMatrix[16] = colorCloud1[3];
|
|
479
|
-
colorCloudMatrix[17] = colorCloud2[3];
|
|
480
|
-
colorCloudMatrix[18] = colorCloud3[3];
|
|
481
|
-
colorCloudMatrix[19] = colorCloud4[3];
|
|
482
|
-
}
|
|
483
|
-
#endif
|
|
484
|
-
|
|
485
|
-
void main() {
|
|
486
|
-
vec4 color = vColor;
|
|
487
|
-
float opacity = abs(flagBackground);
|
|
488
|
-
|
|
489
|
-
#ifdef GRADIENT
|
|
490
|
-
if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {
|
|
491
|
-
gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);
|
|
492
|
-
}
|
|
493
|
-
#endif
|
|
494
|
-
|
|
495
|
-
if(opacity < 1.0) {
|
|
496
|
-
color.a *= opacity;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
#ifdef TEXTURE
|
|
500
|
-
if(flagBackground > 0.0) {
|
|
501
|
-
vec3 texCoord = vTextureCoord;
|
|
502
|
-
|
|
503
|
-
if(texCoord.z == 1.0) {
|
|
504
|
-
texCoord = fract(texCoord);
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
if(texCoord.x <= 1.0 && texCoord.x >= 0.0
|
|
508
|
-
&& texCoord.y <= 1.0 && texCoord.y >= 0.0) {
|
|
509
|
-
if(vSourceRect.z > 0.0) {
|
|
510
|
-
texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;
|
|
511
|
-
texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);
|
|
512
|
-
}
|
|
513
|
-
if(frameIndex < 0.0) {
|
|
514
|
-
vec4 texColor = texture2D(u_texSampler, texCoord.xy);
|
|
515
|
-
color = mix(color, texColor, texColor.a);
|
|
516
|
-
} else {
|
|
517
|
-
int index = int(floor(clamp(0.0, 11.0, frameIndex)));
|
|
518
|
-
vec4 texColor;
|
|
519
|
-
if(index == 0) texColor = texture2D(u_texFrame0, texCoord.xy);
|
|
520
|
-
else if(index == 1) texColor = texture2D(u_texFrame1, texCoord.xy);
|
|
521
|
-
else if(index == 2) texColor = texture2D(u_texFrame2, texCoord.xy);
|
|
522
|
-
else if(index == 3) texColor = texture2D(u_texFrame3, texCoord.xy);
|
|
523
|
-
else if(index == 4) texColor = texture2D(u_texFrame4, texCoord.xy);
|
|
524
|
-
else if(index == 5) texColor = texture2D(u_texFrame5, texCoord.xy);
|
|
525
|
-
else if(index == 6) texColor = texture2D(u_texFrame6, texCoord.xy);
|
|
526
|
-
else if(index == 7) texColor = texture2D(u_texFrame7, texCoord.xy);
|
|
527
|
-
else if(index == 8) texColor = texture2D(u_texFrame8, texCoord.xy);
|
|
528
|
-
else if(index == 9) texColor = texture2D(u_texFrame9, texCoord.xy);
|
|
529
|
-
else if(index == 10) texColor = texture2D(u_texFrame10, texCoord.xy);
|
|
530
|
-
else texColor = texture2D(u_texFrame11, texCoord.xy);
|
|
531
|
-
float alpha = texColor.a;
|
|
532
|
-
if(opacity < 1.0) {
|
|
533
|
-
texColor.a *= opacity;
|
|
534
|
-
alpha *= mix(0.465, 1.0, opacity);
|
|
535
|
-
}
|
|
536
|
-
// color = mix(color, texColor, texColor.a);
|
|
537
|
-
color.rgb = mix(color.rgb, texColor.rgb, alpha);
|
|
538
|
-
// color.rgb = mix(texColor.rgb, color.rgb, color.a);
|
|
539
|
-
color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));
|
|
540
|
-
color.a = texColor.a + (1.0 - texColor.a) * color.a;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
#endif
|
|
545
|
-
|
|
546
|
-
#ifdef FILTER
|
|
547
|
-
if(u_filterFlag > 0) {
|
|
548
|
-
transformColor(color, u_colorMatrix);
|
|
549
|
-
}
|
|
550
|
-
#endif
|
|
551
|
-
|
|
552
|
-
#ifdef CLOUDFILTER
|
|
553
|
-
float colorCloudMatrix[20];
|
|
554
|
-
buildCloudColor(colorCloudMatrix);
|
|
555
|
-
transformColor(color, colorCloudMatrix);
|
|
556
|
-
#endif
|
|
557
|
-
|
|
558
|
-
#ifdef CLIPPATH
|
|
559
|
-
float clip = texture2D(u_clipSampler, vClipUV).r;
|
|
560
|
-
color *= clip;
|
|
561
|
-
#endif
|
|
562
|
-
|
|
563
|
-
gl_FragColor = color;
|
|
564
|
-
}`},function(d,r,t){t.r(r),(function(e,n){t.d(r,"requestAnimationFrame",function(){return a}),t.d(r,"cancelAnimationFrame",function(){return s}),t(1).glMatrix.setMatrixArrayType(Array);function i(){if(typeof performance<"u"&&performance.now)return performance.now();if(typeof e<"u"&&e.hrtime){const[o,f]=e.hrtime();return o*1e3+f*1e-6}return Date.now?Date.now():new Date().getTime()}let a,s;typeof n<"u"&&typeof n.requestAnimationFrame=="function"?(a=n.requestAnimationFrame,s=n.cancelAnimationFrame):(a=function(o){return setTimeout(()=>{o(i())},16)},s=function(o){return clearTimeout(o)})}).call(this,t(69),t(22))},function(d,r){var t=d.exports={},e,n;function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=i}catch{e=i}try{typeof clearTimeout=="function"?n=clearTimeout:n=a}catch{n=a}})();function s(T){if(e===setTimeout)return setTimeout(T,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(T,0);try{return e(T,0)}catch{try{return e.call(null,T,0)}catch{return e.call(this,T,0)}}}function o(T){if(n===clearTimeout)return clearTimeout(T);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(T);try{return n(T)}catch{try{return n.call(null,T)}catch{return n.call(this,T)}}}var f=[],v=!1,l,p=-1;function y(){!v||!l||(v=!1,l.length?f=l.concat(f):p=-1,f.length&&O())}function O(){if(!v){var T=s(y);v=!0;for(var c=f.length;c;){for(l=f,f=[];++p<c;)l&&l[p].run();p=-1,c=f.length}l=null,v=!1,o(T)}}t.nextTick=function(T){var c=new Array(arguments.length-1);if(arguments.length>1)for(var h=1;h<arguments.length;h++)c[h-1]=arguments[h];f.push(new x(T,c)),f.length===1&&!v&&s(O)};function x(T,c){this.fun=T,this.array=c}x.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function m(){}t.on=m,t.addListener=m,t.once=m,t.off=m,t.removeListener=m,t.removeAllListeners=m,t.emit=m,t.prependListener=m,t.prependOnceListener=m,t.listeners=function(T){return[]},t.binding=function(T){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(T){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},function(d,r,t){t.r(r),t.d(r,"default",function(){return I});var e=t(1),n=t(71),i=t(73),a=t(213),s=t(214),o=t(215),f=t(216);t(1).glMatrix.setMatrixArrayType(Array);function v(b,E){var L=Object.keys(b);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(b);E&&(D=D.filter(function(R){return Object.getOwnPropertyDescriptor(b,R).enumerable})),L.push.apply(L,D)}return L}function l(b){for(var E=1;E<arguments.length;E++){var L=arguments[E]!=null?arguments[E]:{};E%2?v(Object(L),!0).forEach(function(D){p(b,D,L[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(L)):v(Object(L)).forEach(function(D){Object.defineProperty(b,D,Object.getOwnPropertyDescriptor(L,D))})}return b}function p(b,E,L){return E in b?Object.defineProperty(b,E,{value:L,enumerable:!0,configurable:!0,writable:!0}):b[E]=L,b}const y=Symbol.for("spritejs_changedAttrs"),O=Symbol.for("spritejs_attributes"),x=Symbol("resolution"),m=Symbol("animations"),T=Symbol("eventListeners"),c=Symbol("captureEventListeners"),h=Symbol("filters"),u=Symbol("display"),g=Symbol("program"),M=Symbol("shaderAttrs"),A=Symbol("uniforms");class I{constructor(E={}){this.attributes=new this.constructor.Attr(this),this[x]={width:300,height:150},Object.assign(this.attributes,E),this[m]=new Set,this[T]={},this[c]={}}get ancestors(){let E=this.parent;const L=[];for(;E;)L.push(E),E=E.parent;return L}get animations(){return this[m]}get filters(){return this[h]||this.parent&&this.parent.filters}get isVisible(){return!1}get layer(){return this.parent?this.parent.layer:null}get localMatrix(){const E=this.transformMatrix,{x:L,y:D}=this.attributes;return E[4]+=L,E[5]+=D,E}get opacity(){let E=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(E*=this.parent.opacity),E}get parentNode(){return this.parent}get nextSibling(){return this.getNodeNearBy(1)}get previousSibling(){return this.getNodeNearBy(-1)}get program(){return this[g]}get renderer(){return this.parent?this.parent.renderer:null}get renderMatrix(){if(this.__cacheRenderMatrix)return this.__cacheRenderMatrix;let E=this.localMatrix;const L=this.parent;if(L){const D=L.__cacheRenderMatrix||L.renderMatrix;D&&(E=e.mat2d.multiply(Array.of(0,0,0,0,0,0),D,E))}return E}get worldScaling(){const E=this.renderMatrix;return[Math.hypot(E[0],E[1]),Math.hypot(E[2],E[3])]}get worldRotation(){const E=this.renderMatrix;return Math.atan2(E[1],E[3])}get worldPosition(){const E=this.renderMatrix;return[E[4],E[5]]}get uniforms(){return this[A]}get className(){return this.attributes.className}set className(E){this.attributes.className=E}get id(){return this.attributes.id}set id(E){this.attributes.id=E}get name(){return this.attributes.name}set name(E){this.attributes.name=E}get zIndex(){return this.attributes.zIndex}set zIndex(E){this.attributes.zIndex=E}get mesh(){return null}get shaderAttrs(){return this[M]||{}}activateAnimations(){const E=this.layer;if(E){const L=this[m];L.forEach(R=>{R.baseTimeline=E.timeline,R.play(),R.finished.then(()=>{L.delete(R)})});const D=this.children;D&&D.forEach(R=>{R.activateAnimations&&R.activateAnimations()})}}addEventListener(E,L,D={}){E==="mousewheel"&&(E="wheel"),typeof D=="boolean"&&(D={capture:D});const{capture:R,once:C}=D,W=R?c:T;return this[W][E]=this[W][E]||[],this[W][E].push({listener:L,once:C}),this}animate(E,L){const D=new i.default(this,E,L);return this.effects&&D.applyEffects(this.effects),this.layer&&(D.baseTimeline=this.layer.timeline,D.play(),D.finished.then(()=>{this[m].delete(D)})),this[m].add(D),D}attr(...E){if(E.length===0)return this.attributes[O];if(E.length>1){let[L,D]=E;return typeof D=="function"&&(D=D(this.attr(L))),this.setAttribute(L,D),this}return typeof E[0]=="string"?this.getAttribute(E[0]):(Object.assign(this.attributes,E[0]),this)}cloneNode(){const E=new this.constructor,L=this.attributes[y];return E.attr(L),E}connect(E,L){Object.defineProperty(this,"parent",{value:E,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:L,writable:!1,configurable:!0}),E.timeline&&this.activateAnimations(),this.setResolution(E.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:E,zOrder:L}})}contains(E){for(;E&&this!==E;)E=E.parent;return!!E}deactivateAnimations(){this[m].forEach(L=>L.cancel());const E=this.children;E&&E.forEach(L=>{L.deactivateAnimations&&L.deactivateAnimations()})}disconnect(){const{parent:E,zOrder:L}=this;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:E,zOrder:L}}),E&&E.forceUpdate()}dispatchEvent(E){E instanceof s.default||(E=new s.default(E)),E.target=this;let L=E.type;L==="mousewheel"&&(L="wheel");const D=[this];let R=this.parent;for(;E.bubbles&&R;)D.push(R),R=R.parent;for(let C=D.length-1;C>=0;C--){const W=D[C],z=W[c]&&W[c][L];if(z&&z.length&&(E.currentTarget=W,z.forEach(({listener:H,once:X})=>{H.call(this,E),X&&D.removeEventListener(H)}),delete E.currentTarget),!E.bubbles&&E.cancelBubble)break}if(!E.cancelBubble)for(let C=0;C<D.length;C++){const W=D[C],z=W[T]&&W[T][L];if(z&&z.length&&(E.currentTarget=W,z.forEach(({listener:H,once:X})=>{H.call(this,E),X&&D.removeEventListener(H)}),delete E.currentTarget),!E.bubbles||E.cancelBubble)break}}dispatchPointerEvent(E){const{layerX:L,layerY:D}=E;return this.isPointCollision(L,D)?(this.dispatchEvent(E),!0):!1}draw(E=[]){const L=this.mesh;if(L){if(Object(o.applyFilters)(L,this.filters),E.push(L),this[g]){L.setProgram(this[g]);const D=this[M];D&&Object.entries(D).forEach(([C,W])=>{L.setAttribute(C,W)});const R=this[A];if(this[A]){const C={};Object.entries(R).forEach(([W,z])=>{typeof z=="function"&&(z=z(this,W)),C[W]=z}),L.setUniforms(C)}}Object(f.default)(this,L)}return E}forceUpdate(){this.parent&&this.parent.forceUpdate()}getAttribute(E){return this.attributes[E]}getListeners(E,{capture:L=!1}={}){return[...this[L?c:T][E]||[]]}getNodeNearBy(E=1){if(!this.parent)return null;if(E===0)return this;const L=this.parent.children,D=L.indexOf(this);return L[D+E]}getWorldPosition(E,L){const D=this.renderMatrix,R=E*D[0]+L*D[2]+D[4],C=E*D[1]+L*D[3]+D[5];return[R,C]}getOffsetPosition(E,L){const D=e.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),R=E*D[0]+L*D[2]+D[4],C=E*D[1]+L*D[3]+D[5];return[R,C]}getResolution(){return l({},this[x])}isPointCollision(E,L){if(!this.mesh)return!1;const D=this.attributes.pointerEvents;if(D==="none"||D!=="all"&&!this.isVisible)return!1;let R="both";return D==="visibleFill"&&(R="fill"),D==="visibleStroke"&&(R="stroke"),this.mesh.isPointCollision(E,L,R)}onPropertyChange(E,L,D){E!=="id"&&E!=="name"&&E!=="className"&&E!=="pointerEvents"&&E!=="passEvents"&&this.forceUpdate(),E==="filter"&&(this[h]=Object(o.parseFilterString)(L)),E==="zIndex"&&this.parent&&this.parent.reorder()}setAttribute(E,L){E==="attrs"&&this.attr(L),this.attributes[E]=L}setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this)}setProgram(E){this[g]=E,this.forceUpdate()}setShaderAttribute(E,L){this[M]=this[M]||{},this[M][E]=L,this.forceUpdate()}setUniforms(E){this[A]=this[A]||{},Object.assign(this[A],E),this.forceUpdate()}setResolution({width:E,height:L}){const{width:D,height:R}=this[x];(D!==E||R!==L)&&(this[x]={width:E,height:L},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:E,height:L}}))}show(){this.attributes.display==="none"&&(this.attributes.display=this[u]||"")}hide(){this.attributes.display!=="none"&&(this[u]=this.attributes.display,this.attributes.display="none")}releaseMouseCapture(){this.layer&&this.layer.__mouseCapturedTarget===this&&(this.layer.__mouseCapturedTarget=null)}remove(){return this.parent&&this.parent.removeChild?(this.parent.removeChild(this),!0):!1}removeAllListeners(E,L={}){typeof L=="boolean"&&(L={capture:L});const R=L.capture?c:T;return this[R][E]&&(this[R][E]=[]),this}removeAttribute(E){this.setAttribute(E,null)}removeEventListener(E,L,D={}){typeof D=="boolean"&&(D={capture:D});const C=D.capture?c:T;if(this[C][E]){const W=this[C][E];if(W)for(let z=0;z<W.length;z++){const{listener:H}=W[z];if(H===L){this[C][E].splice(z,1);break}}}return this}transition(E,L="linear"){const D=this,R=Symbol("animation");L=L||"linear";let C=0;return typeof E=="object"&&(C=E.delay||0,E=E.duration),{[R]:null,cancel(W=!1){const z=this[R];z&&z.cancel(W)},end(){const W=this[R];W&&(W.playState==="running"||W.playState==="pending")&&W.finish()},reverse(){const W=this[R];if(W)if(W.playState==="running"||W.playState==="pending")W.playbackRate=-W.playbackRate;else{const z=W.timing.direction;W.timing.direction=z==="reverse"?"normal":"reverse",W.play()}return W.finished},attr(W,z){return this.end(),typeof W=="string"&&(W={[W]:z}),Object.entries(W).forEach(([H,X])=>{typeof X=="function"&&(W[H]=X(D.attr(H)))}),this[R]=D.animate([W],{duration:E*1e3,delay:C*1e3,fill:"forwards",easing:L}),this[R].finished}}}updateContours(){}}p(I,"Attr",n.default),a.default.registerNode(I,"node")},function(d,r,t){t.r(r),t.d(r,"default",function(){return I});var e=t(1),n=t(12),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);const a=Symbol.for("spritejs_setAttributeDefault"),s=Symbol.for("spritejs_declareAlias"),o=Symbol.for("spritejs_setAttribute"),f=Symbol.for("spritejs_getAttribute"),v=Symbol.for("spritejs_attributes"),l=Symbol.for("spritejs_changedAttrs"),p=Symbol("subject"),y=Symbol("attr"),O=Symbol("default"),x=Symbol("alias");function m(b,[E,L]){let D=e.mat2d.fromValues(1,0,0,1,0,0);return[...b].forEach(([R,C])=>{if((E||L)&&(D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[E,L])),R==="matrix")D=e.mat2d.multiply(D,D,C);else if(R==="offsetTranslate")D[4]+=C[0],D[5]+=C[1];else if(R==="offsetRotate")D=e.mat2d.rotate(Array.of(0,0,0,0,0,0),D,C);else if(R==="skew"){const[W,z]=C;D=e.mat2d.multiply(D,D,e.mat2d.fromValues(1,Math.tan(z),Math.tan(W),1,0,0))}else e.mat2d[R](D,D,C);(E||L)&&(D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-E,-L]))}),D}const T=Symbol("transformMatrix"),c=Symbol("transforms"),h=Symbol("changedAttrs"),u=Symbol("lastChangedAttr"),g=Symbol("offsetFigure");function M(b,E,L){const D=b[y][E];if(b[o](E,L,!1)||b[u]!==E){const C=b[c];C.has(E)&&C.delete(E),L&&(E==="rotate"&&(L=Math.PI*L/180),E==="scale"&&(L=L.map(W=>Math.abs(W)>1e-5?W:1/W>0?1e-5:-1e-5)),C.set(E,L)),b[T]=null,b[p].onPropertyChange(E,L,D,b)}}function A(b){const E=b[g],L=b.offsetDistance*E.getTotalLength(),D=E.getPointAtLength(L);if(D){const R=b[c];let C=b.offsetRotate;C==="auto"?C=D.angle:C==="reverse"?C=Math.PI+D.angle:C=Math.PI*C/180,R.set("offsetRotate",C),R.set("offsetTranslate",[D.x,D.y]),b[T]=null}}class I{static setDefault(E,...L){return E[a](...L)}static declareAlias(E,...L){return E[s](...L)}static setAttribute(E,...L){return E[o](...L)}static getAttribute(E,...L){return E[f](...L)}static getAttributes(E){return E[v]}static getChangedAttributes(E){return E[l]}constructor(E){this[p]=E,this[y]={},this[T]=e.mat2d.fromValues(1,0,0,1,0,0),this[c]=new Map,this[O]={},this[x]=[],Object.defineProperty(E,"transformMatrix",{get:()=>(this[T]||(this[T]=m(this[c],this.transformOrigin)),[...this[T]])}),this[a]({id:"",name:"",className:"",x:0,y:0,transformOrigin:[0,0],transform:"",translate:[0,0],rotate:0,scale:[1,1],skew:[0,0],opacity:1,zIndex:0,offsetPath:void 0,offsetDistance:0,offsetRotate:"auto",pointerEvents:"visible",filter:"none",display:""}),this[s]("class","pos"),this[h]=new Set,this[g]=new n.Figure2D({scale:5,simplify:0})}get[l](){const E={};return[...this[h]].forEach(L=>{E[L]=this[y][L]}),E}get[v](){const E=Object.assign({},this[y]);for(let L=0;L<this[x].length;L++){const D=this[x][L];E[D]=this[D]}return E}[a](E){Object.assign(this[O],E),Object.assign(this[y],E)}[s](...E){this[x].push(...E)}[o](E,L,D=!0){const R=this[y][E],C=this[p];return L==null&&(L=this[O][E]),Object(i.compareValue)(R,L)?!1:(this[y][E]=L,this[h].has(E)&&this[h].delete(E),this[h].add(E),this[u]=E,D&&C.onPropertyChange(E,L,R,this),!0)}[f](E){return this[y][E]}set id(E){this[o]("id",E)}get id(){return this[f]("id")}set name(E){this[o]("name",E)}get name(){return this[f]("name")}set className(E){this[o]("className",E)}get className(){return this[f]("className")}set class(E){this.className=E}get class(){return this.className}get x(){return this[f]("x")}set x(E){this[o]("x",Object(i.toNumber)(E))}get y(){return this[f]("y")}set y(E){this[o]("y",Object(i.toNumber)(E))}get pos(){return[this.x,this.y]}set pos(E){E=Object(i.toArray)(E),Array.isArray(E)||(E=[E,E]),this.x=E[0],this.y=E[1]}get transform(){return this[f]("transform")}set transform(E){let L=null;if(Array.isArray(E)&&(L=E,E=`matrix(${E.map(i.toNumber).join()})`),typeof E=="string")E=E.replace(/\s*,\s*/g,",");else if(E!=null)throw new TypeError("Invalid transform value.");const D=this[y].transform;if(this[o]("transform",E,!1)){const R=this[c];if(R.has("matrix")&&R.delete("matrix"),L)R.set("matrix",L);else if(E){const C=E.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(C){let W=e.mat2d.fromValues(1,0,0,1,0,0);for(let z=0;z<C.length;z++){const X=C[z].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(X){let[,Z,j]=X;Z==="rotate"?j=Math.PI*parseFloat(j)/180:j=j.trim().split(/[\s,]+/).map(G=>Object(i.toNumber)(G)),Z==="matrix"?W=e.mat2d.multiply(W,W,j):Z==="skew"?W=e.mat2d.multiply(W,W,e.mat2d.fromValues(1,Math.tan(j[1]),Math.tan(j[0]),1,0,0)):e.mat2d[Z](W,W,j),R.set("matrix",W)}}}else throw new TypeError("Invalid transform value.")}this[T]=null,this[p].onPropertyChange("transform",E,D,this)}}get transformOrigin(){return this[f]("transformOrigin")}set transformOrigin(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),this[o]("transformOrigin",E)&&(this[T]=null)}get rotate(){return this[f]("rotate")}set rotate(E){M(this,"rotate",E)}get translate(){return this[f]("translate")}set translate(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),M(this,"translate",E)}get scale(){return this[f]("scale")}set scale(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),M(this,"scale",E)}get skew(){return this[f]("skew")}set skew(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),M(this,"skew",E)}get opacity(){return this[f]("opacity")}set opacity(E){E!=null&&(E=Number(E)),this[o]("opacity",E)}get zIndex(){return this[f]("zIndex")}set zIndex(E){E!=null&&(E=Number(E)),this[o]("zIndex",E)}get offsetPath(){return this[f]("offsetPath")}set offsetPath(E){this[o]("offsetPath",E)&&(this[g].beginPath(),E!=null&&this[g].addPath(E),A(this))}get offsetDistance(){return this[f]("offsetDistance")}set offsetDistance(E){this[o]("offsetDistance",Object(i.toNumber)(E))&&A(this)}get offsetRotate(){return this[f]("offsetRotate")}set offsetRotate(E){this[o]("offsetRotate",E),A(this)}get pointerEvents(){return this[f]("pointerEvents")}set pointerEvents(E){if(E!=null&&E!=="none"&&E!=="visible"&&E!=="visibleFill"&&E!=="visibleStroke"&&E!=="all")throw new TypeError("Invalid pointerEvents type.");this[o]("pointerEvents",E)}get filter(){return this[f]("filter")}set filter(E){this[o]("filter",E)}get display(){return this[f]("display")}set display(E){this[o]("display",E)}set offset(E){}}},function(d,r,t){t.r(r),t.d(r,"sizeToPixel",function(){return e}),t.d(r,"toString",function(){return n}),t.d(r,"toNumber",function(){return i}),t.d(r,"toArray",function(){return a}),t.d(r,"compareValue",function(){return s}),t(1).glMatrix.setMatrixArrayType(Array);function e(o,f){const v=o.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);v?o={size:parseFloat(v[1]),unit:v[2]}:o={size:parseFloat(o),unit:"px"};let{size:l,unit:p}=o;if(p==="pt")l/=.75;else if(p==="pc")l*=16;else if(p==="in")l*=96;else if(p==="cm")l*=96/2.54;else if(p==="mm")l*=96/25.4;else if(p==="em"||p==="rem"||p==="ex"){if(!f&&typeof getComputedStyle=="function"&&typeof document<"u"){const y=getComputedStyle(document.documentElement).fontSize;y?f=e(y,16):f=16}l*=f,p==="ex"&&(l/=2)}else if(p==="q")l*=96/25.4/4;else if(p==="vw"||p==="vh"){if(typeof document<"u"){const y=p==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;l*=y/100}}else if((p==="vmax"||p==="vmin")&&typeof document<"u"){const y=window.innerWidth||document.documentElement.clientWidth,O=window.innerHeight||document.documentElement.clientHeight;p==="vmax"?l*=Math.max(y,O)/100:l*=Math.min(y,O)/100}return l}function n(o){return o==null?o:String(o)}function i(o){if(o==null)return o;if(typeof o=="string"&&(o=e(o)),!Number.isFinite(o))throw new TypeError("Invalid value");return o}function a(o,f=!1){return o===""?null:(typeof o=="string"&&(o=o.split(/[\s,]+/g)),Array.isArray(o)&&(f&&(o=o.map(i)),o.length===1)?o[0]:o)}function s(o,f){if(Array.isArray(o)&&Array.isArray(f)){if(o.length!==f.length)return!1;for(let v=0;v<o.length;v++)if(o[v]!==f[v])return!1;return!0}return o==null&&f==null||o===f}},function(d,r,t){t.r(r),t.d(r,"default",function(){return p});var e=t(74),n=t(32),i=t.n(n),a=t(68),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);function o(){return o=Object.assign||function(y){for(var O=1;O<arguments.length;O++){var x=arguments[O];for(var m in x)Object.prototype.hasOwnProperty.call(x,m)&&(y[m]=x[m])}return y},o.apply(this,arguments)}function f(y){if(typeof y=="string"){if(y=y.trim(),/^[0-9.]+%$/.test(y))return parseFloat(y)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(y))return Object(s.sizeToPixel)(y)}return y}function v(y,O,x,m,T){return typeof y=="string"&&(y=i()(y)),typeof O=="string"&&(O=i()(O)),e.Effects.default(y,O,x,m,T)}function l(y,O,x,m,T){return e.Effects.default(y,O,x,m,T)}e.Effects.default=function(y,O,x,m,T){return Array.isArray(y)&&Array.isArray(O)?y.map((c,h)=>c+(x-m)/(T-m)*(O[h]-c)):typeof y=="number"&&typeof O=="number"?y+(x-m)/(T-m)*(O-y):x-m>T-x?O:y},e.Effects.fillColor=v,e.Effects.strokeColor=v,e.Effects.bgcolor=v,e.Effects.borderColor=v,e.Effects.text=l;class p extends e.Animator{constructor(O,x,m){const T=O.attr();Object.entries(T).forEach(([c,h])=>{T[c]=e.Effects[c]?h:f(h)}),x=x.map(c=>{let h=o({},c);const u={};return Object.entries(h).forEach(([g,M])=>{u[g]=e.Effects[g]?M:f(M)}),u}),super(T,x,m),this.target=O,this.setter=function(c,h){h.attr(c)}}get playState(){return this.target.parent?super.playState:"idle"}get finished(){return super.finished.then(()=>{const O=this;return new Promise(x=>{function m(){O.setter(O.frame,O.target);const T=O.playState;T==="finished"||T==="idle"?(Object(a.cancelAnimationFrame)(O.requestId),x()):Object(a.requestAnimationFrame)(m)}m()})})}finish(){super.finish(),Object(a.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target)}play(){if(!this.target.parent||this.playState==="running")return;super.play(),this.setter(this.frame,this.target);const O=this;this.ready.then(()=>{O.setter(O.frame,O.target),O.requestId=Object(a.requestAnimationFrame)(function x(){const m=O.target;if(typeof document<"u"&&document.documentElement&&document.documentElement.contains&&m.layer&&m.layer.canvas&&!document.documentElement.contains(m.layer.canvas)){O.cancel();return}const T=O.playState;O.setter(O.frame,O.target),T!=="idle"&&(T==="running"?O.requestId=Object(a.requestAnimationFrame)(x):(T==="paused"||T==="pending"&&O.timeline.currentTime<0)&&O.ready.then(()=>{O.setter(O.frame,O.target),O.requestId=Object(a.requestAnimationFrame)(x)}))})})}cancel(O=!1){Object(a.cancelAnimationFrame)(this.requestId),O?(this.setter(this.frame,this.target),super.cancel()):(super.cancel(),this.setter(this.frame,this.target))}}},function(d,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.Timeline=r.Effects=r.Easings=r.Animator=void 0;var e=t(75),n=v(e),i=t(187),a=v(i),s=t(188),o=t(190),f=v(o);function v(l){return l&&l.__esModule?l:{default:l}}r.Animator=f.default,r.Easings=s.Easings,r.Effects=a.default,r.Timeline=n.default},function(d,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=c(e),i=t(133),a=c(i),s=t(141),o=c(s),f=t(164),v=c(f),l=t(170),p=c(l),y=t(171),O=c(y),x=t(175),m=c(x),T=t(186);function c(D){return D&&D.__esModule?D:{default:D}}var h=(0,T.createNowTime)(),u={originTime:0,playbackRate:1},g=(0,m.default)("timeMark"),M=(0,m.default)("playbackRate"),A=(0,m.default)("timers"),I=(0,m.default)("originTime"),b=(0,m.default)("setTimer"),E=(0,m.default)("parent"),L=function(){function D(R,C){(0,p.default)(this,D),R instanceof D&&(C=R,R={}),R=(0,v.default)({},u,R),C&&(this[E]=C);var W=R.nowtime||h;if(C)Object.defineProperty(this,"globalTime",{get:function(){return C.currentTime}});else{var z=W();Object.defineProperty(this,"globalTime",{get:function(){return W()-z}})}this[g]=[{globalTime:this.globalTime,localTime:-R.originTime,entropy:-R.originTime,playbackRate:R.playbackRate,globalEntropy:0}],this[E]&&(this[g][0].globalEntropy=this[E].entropy),this[I]=R.originTime,this[M]=R.playbackRate,this[A]=new o.default}return(0,O.default)(D,[{key:"markTime",value:function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=C.time,z=W===void 0?this.currentTime:W,H=C.entropy,X=H===void 0?this.entropy:H,Z=C.playbackRate,j=Z===void 0?this.playbackRate:Z,G={globalTime:this.globalTime,localTime:z,entropy:X,playbackRate:j,globalEntropy:this.globalEntropy};this[g].push(G)}},{key:"fork",value:function(C){return new D(C,this)}},{key:"seekGlobalTime",value:function(C){var W=this.seekTimeMark(C),z=this[g][W],H=z.entropy,X=z.playbackRate,Z=z.globalTime;return Z+(C-H)/Math.abs(X)}},{key:"seekLocalTime",value:function(C){var W=this.seekTimeMark(C),z=this[g][W],H=z.localTime,X=z.entropy,Z=z.playbackRate;return Z>0?H+(C-X):H-(C-X)}},{key:"seekTimeMark",value:function(C){var W=this[g],z=0,H=W.length-1;if(C<=W[z].entropy)return z;if(C>=W[H].entropy)return H;for(var X=Math.floor((z+H)/2);X>z&&X<H;){if(C===W[X].entropy)return X;C<W[X].entropy?H=X:C>W[X].entropy&&(z=X),X=Math.floor((z+H)/2)}return z}},{key:"updateTimers",value:function(){var C=this,W=[].concat((0,a.default)(this[A]));W.forEach(function(z){var H=(0,n.default)(z,2),X=H[0],Z=H[1];C[b](Z.handler,Z.time,X)})}},{key:"clearTimeout",value:function(R){function C(W){return R.apply(this,arguments)}return C.toString=function(){return R.toString()},C}(function(R){var C=this[A].get(R);C&&C.timerID!=null&&(this[E]?this[E].clearTimeout(C.timerID):clearTimeout(C.timerID)),this[A].delete(R)})},{key:"clearInterval",value:function(C){return this.clearTimeout(C)}},{key:"clear",value:function(){var C=this,W=this[A];[].concat((0,a.default)(W.keys())).forEach(function(z){C.clearTimeout(z)})}},{key:"setTimeout",value:function(C){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[b](C,W)}},{key:"setInterval",value:function(C){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},z=this,H=this[b](function X(){z[b](X,W,H),C()},W);return H}},{key:b,value:function(C,W){var z=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,m.default)("timerID");W=(0,T.formatDelay)(W);var X=this[A].get(H),Z=void 0,j=null,G=void 0,Q=void 0;X?(this.clearTimeout(H),W.isEntropy?Z=(W.delay-(this.entropy-X.startEntropy))/Math.abs(this.playbackRate):Z=(W.delay-(this.currentTime-X.startTime))/this.playbackRate,G=X.startTime,Q=X.startEntropy):(Z=W.delay/(W.isEntropy?Math.abs(this.playbackRate):this.playbackRate),G=this.currentTime,Q=this.entropy);var tt=this[E],et=tt?tt.setTimeout.bind(tt):setTimeout,at=W.heading;return!tt&&at===!1&&Z<0&&(Z=1/0),(isFinite(Z)||tt)&&(Z=Math.ceil(Z),et!==setTimeout&&(Z={delay:Z,heading:at}),j=et(function(){z[A].delete(H),C()},Z)),this[A].set(H,{timerID:j,handler:C,time:W,startTime:G,startEntropy:Q}),H}},{key:"parent",get:function(){return this[E]}},{key:"lastTimeMark",get:function(){return this[g][this[g].length-1]}},{key:"currentTime",get:function(){var C=this.lastTimeMark,W=C.localTime,z=C.globalTime;return W+(this.globalTime-z)*this.playbackRate},set:function(C){var W=this,z=this.currentTime,H=C,X=this[A];this.markTime({time:C}),[].concat((0,a.default)(X)).forEach(function(Z){var j=(0,n.default)(Z,2),G=j[0],Q=j[1];if(X.has(G)){var tt=Q.time,et=tt.isEntropy,at=tt.delay,q=tt.heading,pt=Q.handler,dt=Q.startTime;if(et)at===0&&(pt(),W.clearTimeout(G));else{var B=dt+at;(at===0||q!==!1&&(H-z)*at<=0||z<=B&&B<=H||z>=B&&B>=H)&&(pt(),W.clearTimeout(G))}}}),this.updateTimers()}},{key:"entropy",get:function(){var C=this.lastTimeMark,W=C.entropy,z=C.globalEntropy;return W+Math.abs((this.globalEntropy-z)*this.playbackRate)},set:function(C){if(this.entropy>C){var W=this.seekTimeMark(C);this[g].length=W+1}this.markTime({entropy:C}),this.updateTimers()}},{key:"globalEntropy",get:function(){return this[E]?this[E].entropy:this.globalTime}},{key:"playbackRate",get:function(){return this[M]},set:function(C){C!==this.playbackRate&&(this.markTime({playbackRate:C}),this[M]=C,this.updateTimers())}},{key:"paused",get:function(){if(this.playbackRate===0)return!0;for(var C=this.parent;C;){if(C.playbackRate===0)return!0;C=C.parent}return!1}}]),D}();r.default=L},function(d,r,t){r.__esModule=!0;var e=t(77),n=s(e),i=t(129),a=s(i);function s(o){return o&&o.__esModule?o:{default:o}}r.default=function(){function o(f,v){var l=[],p=!0,y=!1,O=void 0;try{for(var x=(0,a.default)(f),m;!(p=(m=x.next()).done)&&(l.push(m.value),!(v&&l.length===v));p=!0);}catch(T){y=!0,O=T}finally{try{!p&&x.return&&x.return()}finally{if(y)throw O}}return l}return function(f,v){if(Array.isArray(f))return f;if((0,n.default)(Object(f)))return o(f,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(d,r,t){d.exports={default:t(78),__esModule:!0}},function(d,r,t){t(79),t(125),d.exports=t(127)},function(d,r,t){t(80);for(var e=t(91),n=t(95),i=t(83),a=t(122)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),o=0;o<s.length;o++){var f=s[o],v=e[f],l=v&&v.prototype;l&&!l[a]&&n(l,a,f),i[f]=i.Array}},function(d,r,t){var e=t(81),n=t(82),i=t(83),a=t(84);d.exports=t(88)(Array,"Array",function(s,o){this._t=a(s),this._i=0,this._k=o},function(){var s=this._t,o=this._k,f=this._i++;return!s||f>=s.length?(this._t=void 0,n(1)):o=="keys"?n(0,f):o=="values"?n(0,s[f]):n(0,[f,s[f]])},"values"),i.Arguments=i.Array,e("keys"),e("values"),e("entries")},function(d,r){d.exports=function(){}},function(d,r){d.exports=function(t,e){return{value:e,done:!!t}}},function(d,r){d.exports={}},function(d,r,t){var e=t(85),n=t(87);d.exports=function(i){return e(n(i))}},function(d,r,t){var e=t(86);d.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return e(n)=="String"?n.split(""):Object(n)}},function(d,r){var t={}.toString;d.exports=function(e){return t.call(e).slice(8,-1)}},function(d,r){d.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t}},function(d,r,t){var e=t(89),n=t(90),i=t(106),a=t(95),s=t(83),o=t(107),f=t(121),v=t(123),l=t(122)("iterator"),p=!([].keys&&"next"in[].keys()),y="@@iterator",O="keys",x="values",m=function(){return this};d.exports=function(T,c,h,u,g,M,A){o(h,c,u);var I=function(j){if(!p&&j in D)return D[j];switch(j){case O:return function(){return new h(this,j)};case x:return function(){return new h(this,j)}}return function(){return new h(this,j)}},b=c+" Iterator",E=g==x,L=!1,D=T.prototype,R=D[l]||D[y]||g&&D[g],C=R||I(g),W=g?E?I("entries"):C:void 0,z=c=="Array"&&D.entries||R,H,X,Z;if(z&&(Z=v(z.call(new T)),Z!==Object.prototype&&Z.next&&(f(Z,b,!0),!e&&typeof Z[l]!="function"&&a(Z,l,m))),E&&R&&R.name!==x&&(L=!0,C=function(){return R.call(this)}),(!e||A)&&(p||L||!D[l])&&a(D,l,C),s[c]=C,s[b]=m,g)if(H={values:E?C:I(x),keys:M?C:I(O),entries:W},A)for(X in H)X in D||i(D,X,H[X]);else n(n.P+n.F*(p||L),c,H);return H}},function(d,r){d.exports=!0},function(d,r,t){var e=t(91),n=t(92),i=t(93),a=t(95),s=t(105),o="prototype",f=function(v,l,p){var y=v&f.F,O=v&f.G,x=v&f.S,m=v&f.P,T=v&f.B,c=v&f.W,h=O?n:n[l]||(n[l]={}),u=h[o],g=O?e:x?e[l]:(e[l]||{})[o],M,A,I;O&&(p=l);for(M in p)A=!y&&g&&g[M]!==void 0,!(A&&s(h,M))&&(I=A?g[M]:p[M],h[M]=O&&typeof g[M]!="function"?p[M]:T&&A?i(I,e):c&&g[M]==I?function(b){var E=function(L,D,R){if(this instanceof b){switch(arguments.length){case 0:return new b;case 1:return new b(L);case 2:return new b(L,D)}return new b(L,D,R)}return b.apply(this,arguments)};return E[o]=b[o],E}(I):m&&typeof I=="function"?i(Function.call,I):I,m&&((h.virtual||(h.virtual={}))[M]=I,v&f.R&&u&&!u[M]&&a(u,M,I)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,d.exports=f},function(d,r){var t=d.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=t)},function(d,r){var t=d.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t)},function(d,r,t){var e=t(94);d.exports=function(n,i,a){if(e(n),i===void 0)return n;switch(a){case 1:return function(s){return n.call(i,s)};case 2:return function(s,o){return n.call(i,s,o)};case 3:return function(s,o,f){return n.call(i,s,o,f)}}return function(){return n.apply(i,arguments)}}},function(d,r){d.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t}},function(d,r,t){var e=t(96),n=t(104);d.exports=t(100)?function(i,a,s){return e.f(i,a,n(1,s))}:function(i,a,s){return i[a]=s,i}},function(d,r,t){var e=t(97),n=t(99),i=t(103),a=Object.defineProperty;r.f=t(100)?Object.defineProperty:function(o,f,v){if(e(o),f=i(f,!0),e(v),n)try{return a(o,f,v)}catch{}if("get"in v||"set"in v)throw TypeError("Accessors not supported!");return"value"in v&&(o[f]=v.value),o}},function(d,r,t){var e=t(98);d.exports=function(n){if(!e(n))throw TypeError(n+" is not an object!");return n}},function(d,r){d.exports=function(t){return typeof t=="object"?t!==null:typeof t=="function"}},function(d,r,t){d.exports=!t(100)&&!t(101)(function(){return Object.defineProperty(t(102)("div"),"a",{get:function(){return 7}}).a!=7})},function(d,r,t){d.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(d,r){d.exports=function(t){try{return!!t()}catch{return!0}}},function(d,r,t){var e=t(98),n=t(91).document,i=e(n)&&e(n.createElement);d.exports=function(a){return i?n.createElement(a):{}}},function(d,r,t){var e=t(98);d.exports=function(n,i){if(!e(n))return n;var a,s;if(i&&typeof(a=n.toString)=="function"&&!e(s=a.call(n))||typeof(a=n.valueOf)=="function"&&!e(s=a.call(n))||!i&&typeof(a=n.toString)=="function"&&!e(s=a.call(n)))return s;throw TypeError("Can't convert object to primitive value")}},function(d,r){d.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}},function(d,r){var t={}.hasOwnProperty;d.exports=function(e,n){return t.call(e,n)}},function(d,r,t){d.exports=t(95)},function(d,r,t){var e=t(108),n=t(104),i=t(121),a={};t(95)(a,t(122)("iterator"),function(){return this}),d.exports=function(s,o,f){s.prototype=e(a,{next:n(1,f)}),i(s,o+" Iterator")}},function(d,r,t){var e=t(97),n=t(109),i=t(119),a=t(116)("IE_PROTO"),s=function(){},o="prototype",f=function(){var v=t(102)("iframe"),l=i.length,p="<",y=">",O;for(v.style.display="none",t(120).appendChild(v),v.src="javascript:",O=v.contentWindow.document,O.open(),O.write(p+"script"+y+"document.F=Object"+p+"/script"+y),O.close(),f=O.F;l--;)delete f[o][i[l]];return f()};d.exports=Object.create||function(l,p){var y;return l!==null?(s[o]=e(l),y=new s,s[o]=null,y[a]=l):y=f(),p===void 0?y:n(y,p)}},function(d,r,t){var e=t(96),n=t(97),i=t(110);d.exports=t(100)?Object.defineProperties:function(s,o){n(s);for(var f=i(o),v=f.length,l=0,p;v>l;)e.f(s,p=f[l++],o[p]);return s}},function(d,r,t){var e=t(111),n=t(119);d.exports=Object.keys||function(a){return e(a,n)}},function(d,r,t){var e=t(105),n=t(84),i=t(112)(!1),a=t(116)("IE_PROTO");d.exports=function(s,o){var f=n(s),v=0,l=[],p;for(p in f)p!=a&&e(f,p)&&l.push(p);for(;o.length>v;)e(f,p=o[v++])&&(~i(l,p)||l.push(p));return l}},function(d,r,t){var e=t(84),n=t(113),i=t(115);d.exports=function(a){return function(s,o,f){var v=e(s),l=n(v.length),p=i(f,l),y;if(a&&o!=o){for(;l>p;)if(y=v[p++],y!=y)return!0}else for(;l>p;p++)if((a||p in v)&&v[p]===o)return a||p||0;return!a&&-1}}},function(d,r,t){var e=t(114),n=Math.min;d.exports=function(i){return i>0?n(e(i),9007199254740991):0}},function(d,r){var t=Math.ceil,e=Math.floor;d.exports=function(n){return isNaN(n=+n)?0:(n>0?e:t)(n)}},function(d,r,t){var e=t(114),n=Math.max,i=Math.min;d.exports=function(a,s){return a=e(a),a<0?n(a+s,0):i(a,s)}},function(d,r,t){var e=t(117)("keys"),n=t(118);d.exports=function(i){return e[i]||(e[i]=n(i))}},function(d,r,t){var e=t(92),n=t(91),i="__core-js_shared__",a=n[i]||(n[i]={});(d.exports=function(s,o){return a[s]||(a[s]=o!==void 0?o:{})})("versions",[]).push({version:e.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(d,r){var t=0,e=Math.random();d.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+e).toString(36))}},function(d,r){d.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(d,r,t){var e=t(91).document;d.exports=e&&e.documentElement},function(d,r,t){var e=t(96).f,n=t(105),i=t(122)("toStringTag");d.exports=function(a,s,o){a&&!n(a=o?a:a.prototype,i)&&e(a,i,{configurable:!0,value:s})}},function(d,r,t){var e=t(117)("wks"),n=t(118),i=t(91).Symbol,a=typeof i=="function",s=d.exports=function(o){return e[o]||(e[o]=a&&i[o]||(a?i:n)("Symbol."+o))};s.store=e},function(d,r,t){var e=t(105),n=t(124),i=t(116)("IE_PROTO"),a=Object.prototype;d.exports=Object.getPrototypeOf||function(s){return s=n(s),e(s,i)?s[i]:typeof s.constructor=="function"&&s instanceof s.constructor?s.constructor.prototype:s instanceof Object?a:null}},function(d,r,t){var e=t(87);d.exports=function(n){return Object(e(n))}},function(d,r,t){var e=t(126)(!0);t(88)(String,"String",function(n){this._t=String(n),this._i=0},function(){var n=this._t,i=this._i,a;return i>=n.length?{value:void 0,done:!0}:(a=e(n,i),this._i+=a.length,{value:a,done:!1})})},function(d,r,t){var e=t(114),n=t(87);d.exports=function(i){return function(a,s){var o=String(n(a)),f=e(s),v=o.length,l,p;return f<0||f>=v?i?"":void 0:(l=o.charCodeAt(f),l<55296||l>56319||f+1===v||(p=o.charCodeAt(f+1))<56320||p>57343?i?o.charAt(f):l:i?o.slice(f,f+2):(l-55296<<10)+(p-56320)+65536)}}},function(d,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);d.exports=t(92).isIterable=function(a){var s=Object(a);return s[n]!==void 0||"@@iterator"in s||i.hasOwnProperty(e(s))}},function(d,r,t){var e=t(86),n=t(122)("toStringTag"),i=e(function(){return arguments}())=="Arguments",a=function(s,o){try{return s[o]}catch{}};d.exports=function(s){var o,f,v;return s===void 0?"Undefined":s===null?"Null":typeof(f=a(o=Object(s),n))=="string"?f:i?e(o):(v=e(o))=="Object"&&typeof o.callee=="function"?"Arguments":v}},function(d,r,t){d.exports={default:t(130),__esModule:!0}},function(d,r,t){t(79),t(125),d.exports=t(131)},function(d,r,t){var e=t(97),n=t(132);d.exports=t(92).getIterator=function(i){var a=n(i);if(typeof a!="function")throw TypeError(i+" is not iterable!");return e(a.call(i))}},function(d,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);d.exports=t(92).getIteratorMethod=function(a){if(a!=null)return a[n]||a["@@iterator"]||i[e(a)]}},function(d,r,t){r.__esModule=!0;var e=t(134),n=i(e);function i(a){return a&&a.__esModule?a:{default:a}}r.default=function(a){if(Array.isArray(a)){for(var s=0,o=Array(a.length);s<a.length;s++)o[s]=a[s];return o}else return(0,n.default)(a)}},function(d,r,t){d.exports={default:t(135),__esModule:!0}},function(d,r,t){t(125),t(136),d.exports=t(92).Array.from},function(d,r,t){var e=t(93),n=t(90),i=t(124),a=t(137),s=t(138),o=t(113),f=t(139),v=t(132);n(n.S+n.F*!t(140)(function(l){Array.from(l)}),"Array",{from:function(p){var y=i(p),O=typeof this=="function"?this:Array,x=arguments.length,m=x>1?arguments[1]:void 0,T=m!==void 0,c=0,h=v(y),u,g,M,A;if(T&&(m=e(m,x>2?arguments[2]:void 0,2)),h!=null&&!(O==Array&&s(h)))for(A=h.call(y),g=new O;!(M=A.next()).done;c++)f(g,c,T?a(A,m,[M.value,c],!0):M.value);else for(u=o(y.length),g=new O(u);u>c;c++)f(g,c,T?m(y[c],c):y[c]);return g.length=c,g}})},function(d,r,t){var e=t(97);d.exports=function(n,i,a,s){try{return s?i(e(a)[0],a[1]):i(a)}catch(f){var o=n.return;throw o!==void 0&&e(o.call(n)),f}}},function(d,r,t){var e=t(83),n=t(122)("iterator"),i=Array.prototype;d.exports=function(a){return a!==void 0&&(e.Array===a||i[n]===a)}},function(d,r,t){var e=t(96),n=t(104);d.exports=function(i,a,s){a in i?e.f(i,a,n(0,s)):i[a]=s}},function(d,r,t){var e=t(122)("iterator"),n=!1;try{var i=[7][e]();i.return=function(){n=!0},Array.from(i,function(){throw 2})}catch{}d.exports=function(a,s){if(!s&&!n)return!1;var o=!1;try{var f=[7],v=f[e]();v.next=function(){return{done:o=!0}},f[e]=function(){return v},a(f)}catch{}return o}},function(d,r,t){d.exports={default:t(142),__esModule:!0}},function(d,r,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),d.exports=t(92).Map},function(d,r){},function(d,r,t){var e=t(145),n=t(151),i="Map";d.exports=t(152)(i,function(a){return function(){return a(this,arguments.length>0?arguments[0]:void 0)}},{get:function(s){var o=e.getEntry(n(this,i),s);return o&&o.v},set:function(s,o){return e.def(n(this,i),s===0?0:s,o)}},e,!0)},function(d,r,t){var e=t(96).f,n=t(108),i=t(146),a=t(93),s=t(147),o=t(148),f=t(88),v=t(82),l=t(149),p=t(100),y=t(150).fastKey,O=t(151),x=p?"_s":"size",m=function(T,c){var h=y(c),u;if(h!=="F")return T._i[h];for(u=T._f;u;u=u.n)if(u.k==c)return u};d.exports={getConstructor:function(T,c,h,u){var g=T(function(M,A){s(M,g,c,"_i"),M._t=c,M._i=n(null),M._f=void 0,M._l=void 0,M[x]=0,A!=null&&o(A,h,M[u],M)});return i(g.prototype,{clear:function(){for(var A=O(this,c),I=A._i,b=A._f;b;b=b.n)b.r=!0,b.p&&(b.p=b.p.n=void 0),delete I[b.i];A._f=A._l=void 0,A[x]=0},delete:function(M){var A=O(this,c),I=m(A,M);if(I){var b=I.n,E=I.p;delete A._i[I.i],I.r=!0,E&&(E.n=b),b&&(b.p=E),A._f==I&&(A._f=b),A._l==I&&(A._l=E),A[x]--}return!!I},forEach:function(A){O(this,c);for(var I=a(A,arguments.length>1?arguments[1]:void 0,3),b;b=b?b.n:this._f;)for(I(b.v,b.k,this);b&&b.r;)b=b.p},has:function(A){return!!m(O(this,c),A)}}),p&&e(g.prototype,"size",{get:function(){return O(this,c)[x]}}),g},def:function(T,c,h){var u=m(T,c),g,M;return u?u.v=h:(T._l=u={i:M=y(c,!0),k:c,v:h,p:g=T._l,n:void 0,r:!1},T._f||(T._f=u),g&&(g.n=u),T[x]++,M!=="F"&&(T._i[M]=u)),T},getEntry:m,setStrong:function(T,c,h){f(T,c,function(u,g){this._t=O(u,c),this._k=g,this._l=void 0},function(){for(var u=this,g=u._k,M=u._l;M&&M.r;)M=M.p;return!u._t||!(u._l=M=M?M.n:u._t._f)?(u._t=void 0,v(1)):g=="keys"?v(0,M.k):g=="values"?v(0,M.v):v(0,[M.k,M.v])},h?"entries":"values",!h,!0),l(c)}}},function(d,r,t){var e=t(95);d.exports=function(n,i,a){for(var s in i)a&&n[s]?n[s]=i[s]:e(n,s,i[s]);return n}},function(d,r){d.exports=function(t,e,n,i){if(!(t instanceof e)||i!==void 0&&i in t)throw TypeError(n+": incorrect invocation!");return t}},function(d,l,t){var e=t(93),n=t(137),i=t(138),a=t(97),s=t(113),o=t(132),f={},v={},l=d.exports=function(p,y,O,x,m){var T=m?function(){return p}:o(p),c=e(O,x,y?2:1),h=0,u,g,M,A;if(typeof T!="function")throw TypeError(p+" is not iterable!");if(i(T)){for(u=s(p.length);u>h;h++)if(A=y?c(a(g=p[h])[0],g[1]):c(p[h]),A===f||A===v)return A}else for(M=T.call(p);!(g=M.next()).done;)if(A=n(M,c,g.value,y),A===f||A===v)return A};l.BREAK=f,l.RETURN=v},function(d,r,t){var e=t(91),n=t(92),i=t(96),a=t(100),s=t(122)("species");d.exports=function(o){var f=typeof n[o]=="function"?n[o]:e[o];a&&f&&!f[s]&&i.f(f,s,{configurable:!0,get:function(){return this}})}},function(d,r,t){var e=t(118)("meta"),n=t(98),i=t(105),a=t(96).f,s=0,o=Object.isExtensible||function(){return!0},f=!t(101)(function(){return o(Object.preventExtensions({}))}),v=function(x){a(x,e,{value:{i:"O"+ ++s,w:{}}})},l=function(x,m){if(!n(x))return typeof x=="symbol"?x:(typeof x=="string"?"S":"P")+x;if(!i(x,e)){if(!o(x))return"F";if(!m)return"E";v(x)}return x[e].i},p=function(x,m){if(!i(x,e)){if(!o(x))return!0;if(!m)return!1;v(x)}return x[e].w},y=function(x){return f&&O.NEED&&o(x)&&!i(x,e)&&v(x),x},O=d.exports={KEY:e,NEED:!1,fastKey:l,getWeak:p,onFreeze:y}},function(d,r,t){var e=t(98);d.exports=function(n,i){if(!e(n)||n._t!==i)throw TypeError("Incompatible receiver, "+i+" required!");return n}},function(d,r,t){var e=t(91),n=t(90),i=t(150),a=t(101),s=t(95),o=t(146),f=t(148),v=t(147),l=t(98),p=t(121),y=t(96).f,O=t(153)(0),x=t(100);d.exports=function(m,T,c,h,u,g){var M=e[m],A=M,I=u?"set":"add",b=A&&A.prototype,E={};return!x||typeof A!="function"||!(g||b.forEach&&!a(function(){new A().entries().next()}))?(A=h.getConstructor(T,m,u,I),o(A.prototype,c),i.NEED=!0):(A=T(function(L,D){v(L,A,m,"_c"),L._c=new M,D!=null&&f(D,u,L[I],L)}),O("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(L){var D=L=="add"||L=="set";L in b&&!(g&&L=="clear")&&s(A.prototype,L,function(R,C){if(v(this,A,L),!D&&g&&!l(R))return L=="get"?void 0:!1;var W=this._c[L](R===0?0:R,C);return D?this:W})}),g||y(A.prototype,"size",{get:function(){return this._c.size}})),p(A,m),E[m]=A,n(n.G+n.W+n.F,E),g||h.setStrong(A,m,u),A}},function(d,r,t){var e=t(93),n=t(85),i=t(124),a=t(113),s=t(154);d.exports=function(o,f){var v=o==1,l=o==2,p=o==3,y=o==4,O=o==6,x=o==5||O,m=f||s;return function(T,c,h){for(var u=i(T),g=n(u),M=e(c,h,3),A=a(g.length),I=0,b=v?m(T,A):l?m(T,0):void 0,E,L;A>I;I++)if((x||I in g)&&(E=g[I],L=M(E,I,u),o)){if(v)b[I]=L;else if(L)switch(o){case 3:return!0;case 5:return E;case 6:return I;case 2:b.push(E)}else if(y)return!1}return O?-1:p||y?y:b}}},function(d,r,t){var e=t(155);d.exports=function(n,i){return new(e(n))(i)}},function(d,r,t){var e=t(98),n=t(156),i=t(122)("species");d.exports=function(a){var s;return n(a)&&(s=a.constructor,typeof s=="function"&&(s===Array||n(s.prototype))&&(s=void 0),e(s)&&(s=s[i],s===null&&(s=void 0))),s===void 0?Array:s}},function(d,r,t){var e=t(86);d.exports=Array.isArray||function(i){return e(i)=="Array"}},function(d,r,t){var e=t(90);e(e.P+e.R,"Map",{toJSON:t(158)("Map")})},function(d,r,t){var e=t(128),n=t(159);d.exports=function(i){return function(){if(e(this)!=i)throw TypeError(i+"#toJSON isn't generic");return n(this)}}},function(d,r,t){var e=t(148);d.exports=function(n,i){var a=[];return e(n,!1,a.push,a,i),a}},function(d,r,t){t(161)("Map")},function(d,r,t){var e=t(90);d.exports=function(n){e(e.S,n,{of:function(){for(var a=arguments.length,s=new Array(a);a--;)s[a]=arguments[a];return new this(s)}})}},function(d,r,t){t(163)("Map")},function(d,r,t){var e=t(90),n=t(94),i=t(93),a=t(148);d.exports=function(s){e(e.S,s,{from:function(f){var v=arguments[1],l,p,y,O;return n(this),l=v!==void 0,l&&n(v),f==null?new this:(p=[],l?(y=0,O=i(v,arguments[2],2),a(f,!1,function(x){p.push(O(x,y++))})):a(f,!1,p.push,p),new this(p))}})}},function(d,r,t){d.exports={default:t(165),__esModule:!0}},function(d,r,t){t(166),d.exports=t(92).Object.assign},function(d,r,t){var e=t(90);e(e.S+e.F,"Object",{assign:t(167)})},function(d,r,t){var e=t(100),n=t(110),i=t(168),a=t(169),s=t(124),o=t(85),f=Object.assign;d.exports=!f||t(101)(function(){var v={},l={},p=Symbol(),y="abcdefghijklmnopqrst";return v[p]=7,y.split("").forEach(function(O){l[O]=O}),f({},v)[p]!=7||Object.keys(f({},l)).join("")!=y})?function(l,p){for(var y=s(l),O=arguments.length,x=1,m=i.f,T=a.f;O>x;)for(var c=o(arguments[x++]),h=m?n(c).concat(m(c)):n(c),u=h.length,g=0,M;u>g;)M=h[g++],(!e||T.call(c,M))&&(y[M]=c[M]);return y}:f},function(d,r){r.f=Object.getOwnPropertySymbols},function(d,r){r.f={}.propertyIsEnumerable},function(d,r,t){r.__esModule=!0,r.default=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}},function(d,r,t){r.__esModule=!0;var e=t(172),n=i(e);function i(a){return a&&a.__esModule?a:{default:a}}r.default=function(){function a(s,o){for(var f=0;f<o.length;f++){var v=o[f];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),(0,n.default)(s,v.key,v)}}return function(s,o,f){return o&&a(s.prototype,o),f&&a(s,f),s}}()},function(d,r,t){d.exports={default:t(173),__esModule:!0}},function(d,r,t){t(174);var e=t(92).Object;d.exports=function(i,a,s){return e.defineProperty(i,a,s)}},function(d,r,t){var e=t(90);e(e.S+e.F*!t(100),"Object",{defineProperty:t(96).f})},function(d,r,t){d.exports={default:t(176),__esModule:!0}},function(d,r,t){t(177),t(143),t(184),t(185),d.exports=t(92).Symbol},function(d,r,t){var e=t(91),n=t(105),i=t(100),a=t(90),s=t(106),o=t(150).KEY,f=t(101),v=t(117),l=t(121),p=t(118),y=t(122),O=t(178),x=t(179),m=t(180),T=t(156),c=t(97),h=t(98),u=t(124),g=t(84),M=t(103),A=t(104),I=t(108),b=t(181),E=t(183),L=t(168),D=t(96),R=t(110),C=E.f,W=D.f,z=b.f,H=e.Symbol,X=e.JSON,Z=X&&X.stringify,j="prototype",G=y("_hidden"),Q=y("toPrimitive"),tt={}.propertyIsEnumerable,et=v("symbol-registry"),at=v("symbols"),q=v("op-symbols"),pt=Object[j],dt=typeof H=="function"&&!!L.f,B=e.QObject,F=!B||!B[j]||!B[j].findChild,V=i&&f(function(){return I(W({},"a",{get:function(){return W(this,"a",{value:7}).a}})).a!=7})?function(ot,st,ft){var vt=C(pt,st);vt&&delete pt[st],W(ot,st,ft),vt&&ot!==pt&&W(pt,st,vt)}:W,J=function(ot){var st=at[ot]=I(H[j]);return st._k=ot,st},N=dt&&typeof H.iterator=="symbol"?function(ot){return typeof ot=="symbol"}:function(ot){return ot instanceof H},$=function(st,ft,vt){return st===pt&&$(q,ft,vt),c(st),ft=M(ft,!0),c(vt),n(at,ft)?(vt.enumerable?(n(st,G)&&st[G][ft]&&(st[G][ft]=!1),vt=I(vt,{enumerable:A(0,!1)})):(n(st,G)||W(st,G,A(1,{})),st[G][ft]=!0),V(st,ft,vt)):W(st,ft,vt)},S=function(st,ft){c(st);for(var vt=m(ft=g(ft)),mt=0,gt=vt.length,St;gt>mt;)$(st,St=vt[mt++],ft[St]);return st},P=function(st,ft){return ft===void 0?I(st):S(I(st),ft)},w=function(st){var ft=tt.call(this,st=M(st,!0));return this===pt&&n(at,st)&&!n(q,st)?!1:ft||!n(this,st)||!n(at,st)||n(this,G)&&this[G][st]?ft:!0},U=function(st,ft){if(st=g(st),ft=M(ft,!0),!(st===pt&&n(at,ft)&&!n(q,ft))){var vt=C(st,ft);return vt&&n(at,ft)&&!(n(st,G)&&st[G][ft])&&(vt.enumerable=!0),vt}},K=function(st){for(var ft=z(g(st)),vt=[],mt=0,gt;ft.length>mt;)!n(at,gt=ft[mt++])&>!=G&>!=o&&vt.push(gt);return vt},Y=function(st){for(var ft=st===pt,vt=z(ft?q:g(st)),mt=[],gt=0,St;vt.length>gt;)n(at,St=vt[gt++])&&(!ft||n(pt,St))&&mt.push(at[St]);return mt};dt||(H=function(){if(this instanceof H)throw TypeError("Symbol is not a constructor!");var st=p(arguments.length>0?arguments[0]:void 0),ft=function(vt){this===pt&&ft.call(q,vt),n(this,G)&&n(this[G],st)&&(this[G][st]=!1),V(this,st,A(1,vt))};return i&&F&&V(pt,st,{configurable:!0,set:ft}),J(st)},s(H[j],"toString",function(){return this._k}),E.f=U,D.f=$,t(182).f=b.f=K,t(169).f=w,L.f=Y,i&&!t(89)&&s(pt,"propertyIsEnumerable",w,!0),O.f=function(ot){return J(y(ot))}),a(a.G+a.W+a.F*!dt,{Symbol:H});for(var k="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;k.length>rt;)y(k[rt++]);for(var it=R(y.store),lt=0;it.length>lt;)x(it[lt++]);a(a.S+a.F*!dt,"Symbol",{for:function(ot){return n(et,ot+="")?et[ot]:et[ot]=H(ot)},keyFor:function(st){if(!N(st))throw TypeError(st+" is not a symbol!");for(var ft in et)if(et[ft]===st)return ft},useSetter:function(){F=!0},useSimple:function(){F=!1}}),a(a.S+a.F*!dt,"Object",{create:P,defineProperty:$,defineProperties:S,getOwnPropertyDescriptor:U,getOwnPropertyNames:K,getOwnPropertySymbols:Y});var ut=f(function(){L.f(1)});a(a.S+a.F*ut,"Object",{getOwnPropertySymbols:function(st){return L.f(u(st))}}),X&&a(a.S+a.F*(!dt||f(function(){var ot=H();return Z([ot])!="[null]"||Z({a:ot})!="{}"||Z(Object(ot))!="{}"})),"JSON",{stringify:function(st){for(var ft=[st],vt=1,mt,gt;arguments.length>vt;)ft.push(arguments[vt++]);if(gt=mt=ft[1],!(!h(mt)&&st===void 0||N(st)))return T(mt)||(mt=function(St,It){if(typeof gt=="function"&&(It=gt.call(this,St,It)),!N(It))return It}),ft[1]=mt,Z.apply(X,ft)}}),H[j][Q]||t(95)(H[j],Q,H[j].valueOf),l(H,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},function(d,r,t){r.f=t(122)},function(d,r,t){var e=t(91),n=t(92),i=t(89),a=t(178),s=t(96).f;d.exports=function(o){var f=n.Symbol||(n.Symbol=i?{}:e.Symbol||{});o.charAt(0)!="_"&&!(o in f)&&s(f,o,{value:a.f(o)})}},function(d,r,t){var e=t(110),n=t(168),i=t(169);d.exports=function(a){var s=e(a),o=n.f;if(o)for(var f=o(a),v=i.f,l=0,p;f.length>l;)v.call(a,p=f[l++])&&s.push(p);return s}},function(d,r,t){var e=t(84),n=t(182).f,i={}.toString,a=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(o){try{return n(o)}catch{return a.slice()}};d.exports.f=function(f){return a&&i.call(f)=="[object Window]"?s(f):n(e(f))}},function(d,r,t){var e=t(111),n=t(119).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(a){return e(a,n)}},function(d,r,t){var e=t(169),n=t(104),i=t(84),a=t(103),s=t(105),o=t(99),f=Object.getOwnPropertyDescriptor;r.f=t(100)?f:function(l,p){if(l=i(l),p=a(p,!0),o)try{return f(l,p)}catch{}if(s(l,p))return n(!e.f.call(l,p),l[p])}},function(d,r,t){t(179)("asyncIterator")},function(d,r,t){t(179)("observable")},function(d,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.createNowTime=e,r.formatDelay=n;function e(){var i=null;return Date.now?i=Date.now:i=function(){return new Date().getTime()},i}function n(i){return typeof i=="number"?i={delay:i}:"entropy"in i&&(i={delay:i.entropy,isEntropy:!0}),i}},function(d,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.default={default:function(n,i,a,s,o){return typeof n=="number"&&typeof i=="number"?n+(a-s)/(o-s)*(i-n):a-s>o-a?i:n}}},function(d,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.parseEasing=r.Easings=void 0;var e=t(76),n=f(e),i=t(133),a=f(i),s=t(141),o=f(s);function f(T){return T&&T.__esModule?T:{default:T}}var v=t(189),l=new o.default;function p(){for(var T=arguments.length,c=Array(T),h=0;h<T;h++)c[h]=arguments[h];var u=l.get(c);return u||(u=v.apply(void 0,c),l.set(c,u),u)}function y(T){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"end";return function(h,u){for(var g=1;g<u.length;g++){var M=u[g].offset;if(h<=M){var A=u[g-1].offset,I=M,b=(h-A)/(I-A),E=1/T,L=b/E;return c==="end"?L=Math.floor(L):L=Math.ceil(L),E*L*(I-A)+A}}return 0}}function O(T){var c=/^cubic-bezier\((.*)\)/,h=T.match(c);if(h){var u=h[1].trim();return u=u.split(",").map(function(E){return parseFloat(E.trim())}),p.apply(void 0,(0,a.default)(u))}if(c=/^steps\((.*)\)/,h=T.match(c),h){var g=h[1].trim();g=g.split(",").map(function(E){return E.trim()});var M=g,A=(0,n.default)(M,2),I=A[0],b=A[1];return y(parseInt(I,10),b)}return T}var x={linear:function(c){return c},ease:p(.25,.1,.25,1),"ease-in":p(.42,0,1,1),"ease-out":p(0,0,.58,1),"ease-in-out":p(.42,0,.58,1),"step-start":y(1,"start"),"step-end":y(1,"end")};function m(T){return typeof T=="string"?x[T]?T=x[T]:T=O(T):T.type==="cubic-bezier"?T=p.apply(void 0,(0,a.default)(T.value)):T.type==="steps"&&(T=y(T.step,T.pos)),T}r.Easings=x,r.parseEasing=m},function(d,r){var t=4,e=.001,n=1e-7,i=10,a=11,s=1/(a-1),o=typeof Float32Array=="function";function f(T,c){return 1-3*c+3*T}function v(T,c){return 3*c-6*T}function l(T){return 3*T}function p(T,c,h){return((f(c,h)*T+v(c,h))*T+l(c))*T}function y(T,c,h){return 3*f(c,h)*T*T+2*v(c,h)*T+l(c)}function O(T,c,h,u,g){var M,A,I=0;do A=c+(h-c)/2,M=p(A,u,g)-T,M>0?h=A:c=A;while(Math.abs(M)>n&&++I<i);return A}function x(T,c,h,u){for(var g=0;g<t;++g){var M=y(c,h,u);if(M===0)return c;var A=p(c,h,u)-T;c-=A/M}return c}function m(T){return T}d.exports=function(c,h,u,g){if(!(0<=c&&c<=1&&0<=u&&u<=1))throw new Error("bezier x values must be in [0, 1] range");if(c===h&&u===g)return m;for(var M=o?new Float32Array(a):new Array(a),A=0;A<a;++A)M[A]=p(A*s,c,u);function I(b){for(var E=0,L=1,D=a-1;L!==D&&M[L]<=b;++L)E+=s;--L;var R=(b-M[L])/(M[L+1]-M[L]),C=E+R*s,W=y(C,c,u);return W>=e?x(b,C,c,u):W===0?C:O(b,E,E+s,c,u)}return function(E){return E===0?0:E===1?1:p(I(E),h,g)}}},function(d,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(191),n=h(e),i=t(204),a=h(i),s=t(164),o=h(s),f=t(170),v=h(f),l=t(171),p=h(l),y=t(175),O=h(y),x=t(75),m=h(x),T=t(208),c=t(188);function h(W){return W&&W.__esModule?W:{default:W}}var u=(0,O.default)("timing"),g=(0,O.default)("keyframes"),M=(0,O.default)("initState"),A=(0,O.default)("readyDefer"),I=(0,O.default)("finishedDefer"),b=(0,O.default)("effects"),E=(0,O.default)("activeReadyTimer"),L=(0,O.default)("activeFinishTimer"),D=(0,O.default)("removeDefer"),R={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},C=function(){function W(z,H,X){var Z=this;if((0,v.default)(this,W),Array.isArray(z)){var j=[z[0],z,H];z=j[0],H=j[1],X=j[2]}typeof X=="number"&&(X={duration:X}),this[u]=(0,o.default)({},R,X),this[u].easing=(0,c.parseEasing)(this[u].easing),this[g]=(0,T.calculateFramesOffset)(H);var G=this[g][this[g].length-1];this[M]={},(0,a.default)(G).forEach(function(Q){Object.prototype.hasOwnProperty.call(z,Q)&&Q!=="easing"&&Q!=="offset"&&(Z[M][Q]=z[Q])}),this[g]=this[g].map(function(Q){return(0,o.default)({},Z[M],Q)}),this[g][0].offset!==0&&this[g].unshift((0,o.default)({},this[M],{offset:0})),G.offset<1&&this[g].push((0,o.default)({},G,{offset:1})),this[b]={},this.timeline=null}return(0,p.default)(W,[{key:"pause",value:function(){this.timeline.playbackRate=0}},{key:E,value:function(){var H=this;this[A]&&!this[A].timerID&&(this.timeline.currentTime<0?this[A].timerID=this.timeline.setTimeout(function(){H[A].resolve(),delete H[A]},{delay:-this.timeline.currentTime,heading:!1}):this[A].timerID=this.timeline.setTimeout(function(){H[A].resolve(),delete H[A]},{delay:0,isEntropy:!0}))}},{key:L,value:function(){var H=this,X=this[u],Z=X.duration,j=X.iterations,G=X.endDelay,Q=Math.ceil(Z*j+G-this.timeline.currentTime)+1;this[I]&&!this[I].timerID&&(this[I].timerID=this.timeline.setTimeout(function(){H[I].resolve(),H[D](A),H[D](I)},{delay:Q,heading:!1}),this[I].reverseTimerID=this.timeline.setTimeout(function(){H[I].resolve(),H[D](A),H[D](I),H.timeline=null},{delay:-this[u].delay-1,heading:!1}))}},{key:"play",value:function(){if(this.playState==="finished"&&this.cancel(),this.playState==="idle"){if(this.playbackRate<=0)return;var H=this[u],X=H.delay,Z=H.playbackRate,j=H.timeline;this.timeline=new m.default({originTime:X,playbackRate:Z},j),this[E](),this[L]()}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[E]())}},{key:D,value:function(H){var X=this[H],Z=this.timeline;X&&Z&&(Z.clearTimeout(X.timerID),X.reverseTimerID&&Z.clearTimeout(X.reverseTimerID)),delete this[H]}},{key:"cancel",value:function(){this[D](A),this[D](I),this.timeline=null}},{key:"finish",value:function(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[D](A),this[D](I)}},{key:"applyEffects",value:function(H){return(0,o.default)(this[b],H)}},{key:"playbackRate",get:function(){return this[u].playbackRate},set:function(H){this.timeline&&(this.timeline.playbackRate=H),this[u].playbackRate=H}},{key:"playState",get:function(){var H=this.timeline,X=this[u],Z=X.iterations,j=X.duration,G=X.endDelay,Q="running";if(H==null)Q="idle";else if(H.paused)Q="paused";else if(H.currentTime<0)Q="pending";else{var tt=H.currentTime-Z*j;tt>0&&tt<G?Q="pending":tt>=G&&(Q="finished")}return Q}},{key:"progress",get:function(){if(!this.timeline)return 0;var H=this[u],X=H.duration,Z=H.iterations,j=this.timeline,G=this.playState,Q=void 0;if(G==="idle")Q=0;else if(G==="paused"&&j.currentTime<0)Q=0;else if(G==="pending")if(j.currentTime<0)Q=0;else{var tt=j.seekLocalTime(Z*X);Q=(0,T.periodicity)(tt,X)[1]/X}else(G==="running"||G==="paused")&&(Q=(0,T.periodicity)(j.currentTime,X)[1]/X);return G==="finished"&&(Q=(0,T.periodicity)(Z,1)[1]),Q}},{key:"frame",get:function(){var H=this.playState,X=this[M],Z=this[u].fill;if(H==="idle")return X;var j=this.timeline.currentTime,G=this[g].slice(0),Q=(0,T.getProgress)(this.timeline,this[u],this.progress),tt=Q.p,et=Q.inverted,at=X;return j<0&&H==="pending"?(Z==="backwards"||Z==="both")&&(at=et?G[G.length-1]:G[0]):(H!=="pending"&&H!=="finished"||Z==="forwards"||Z==="both")&&(at=(0,T.getCurrentFrame)(this[u],G,this[b],tt)),at}},{key:"timing",get:function(){return this[u]}},{key:"effects",get:function(){return this[b]}},{key:"baseTimeline",set:function(H){this[u].timeline=H},get:function(){return this[u].timeline}},{key:"ready",get:function(){return this[A]?this[A].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n.default.resolve():(this[A]=(0,T.defer)(),this.timeline&&this[E](),this[A]?this[A].promise:n.default.resolve())}},{key:"finished",get:function(){return this.playState==="finished"?n.default.resolve():(this[I]||(this[I]=(0,T.defer)(),this.timeline&&this[L]()),this[I].promise)}}]),W}();r.default=C},function(d,r,t){d.exports={default:t(192),__esModule:!0}},function(d,r,t){t(143),t(125),t(79),t(193),t(202),t(203),d.exports=t(92).Promise},function(d,r,t){var e=t(89),n=t(91),i=t(93),a=t(128),s=t(90),o=t(98),f=t(94),v=t(147),l=t(148),p=t(194),y=t(195).set,O=t(197)(),x=t(198),m=t(199),T=t(200),c=t(201),h="Promise",u=n.TypeError,g=n.process,M=g&&g.versions,A=M&&M.v8||"",I=n[h],b=a(g)=="process",E=function(){},L,D,R,C,W=D=x.f,z=!!function(){try{var et=I.resolve(1),at=(et.constructor={})[t(122)("species")]=function(q){q(E,E)};return(b||typeof PromiseRejectionEvent=="function")&&et.then(E)instanceof at&&A.indexOf("6.6")!==0&&T.indexOf("Chrome/66")===-1}catch{}}(),H=function(et){var at;return o(et)&&typeof(at=et.then)=="function"?at:!1},X=function(et,at){if(!et._n){et._n=!0;var q=et._c;O(function(){for(var pt=et._v,dt=et._s==1,B=0,F=function(V){var J=dt?V.ok:V.fail,N=V.resolve,$=V.reject,S=V.domain,P,w,U;try{J?(dt||(et._h==2&&G(et),et._h=1),J===!0?P=pt:(S&&S.enter(),P=J(pt),S&&(S.exit(),U=!0)),P===V.promise?$(u("Promise-chain cycle")):(w=H(P))?w.call(P,N,$):N(P)):$(pt)}catch(K){S&&!U&&S.exit(),$(K)}};q.length>B;)F(q[B++]);et._c=[],et._n=!1,at&&!et._h&&Z(et)})}},Z=function(et){y.call(n,function(){var at=et._v,q=j(et),pt,dt,B;if(q&&(pt=m(function(){b?g.emit("unhandledRejection",at,et):(dt=n.onunhandledrejection)?dt({promise:et,reason:at}):(B=n.console)&&B.error&&B.error("Unhandled promise rejection",at)}),et._h=b||j(et)?2:1),et._a=void 0,q&&pt.e)throw pt.v})},j=function(et){return et._h!==1&&(et._a||et._c).length===0},G=function(et){y.call(n,function(){var at;b?g.emit("rejectionHandled",et):(at=n.onrejectionhandled)&&at({promise:et,reason:et._v})})},Q=function(et){var at=this;at._d||(at._d=!0,at=at._w||at,at._v=et,at._s=2,at._a||(at._a=at._c.slice()),X(at,!0))},tt=function(et){var at=this,q;if(!at._d){at._d=!0,at=at._w||at;try{if(at===et)throw u("Promise can't be resolved itself");(q=H(et))?O(function(){var pt={_w:at,_d:!1};try{q.call(et,i(tt,pt,1),i(Q,pt,1))}catch(dt){Q.call(pt,dt)}}):(at._v=et,at._s=1,X(at,!1))}catch(pt){Q.call({_w:at,_d:!1},pt)}}};z||(I=function(at){v(this,I,h,"_h"),f(at),L.call(this);try{at(i(tt,this,1),i(Q,this,1))}catch(q){Q.call(this,q)}},L=function(at){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},L.prototype=t(146)(I.prototype,{then:function(at,q){var pt=W(p(this,I));return pt.ok=typeof at=="function"?at:!0,pt.fail=typeof q=="function"&&q,pt.domain=b?g.domain:void 0,this._c.push(pt),this._a&&this._a.push(pt),this._s&&X(this,!1),pt.promise},catch:function(et){return this.then(void 0,et)}}),R=function(){var et=new L;this.promise=et,this.resolve=i(tt,et,1),this.reject=i(Q,et,1)},x.f=W=function(et){return et===I||et===C?new R(et):D(et)}),s(s.G+s.W+s.F*!z,{Promise:I}),t(121)(I,h),t(149)(h),C=t(92)[h],s(s.S+s.F*!z,h,{reject:function(at){var q=W(this),pt=q.reject;return pt(at),q.promise}}),s(s.S+s.F*(e||!z),h,{resolve:function(at){return c(e&&this===C?I:this,at)}}),s(s.S+s.F*!(z&&t(140)(function(et){I.all(et).catch(E)})),h,{all:function(at){var q=this,pt=W(q),dt=pt.resolve,B=pt.reject,F=m(function(){var V=[],J=0,N=1;l(at,!1,function($){var S=J++,P=!1;V.push(void 0),N++,q.resolve($).then(function(w){P||(P=!0,V[S]=w,--N||dt(V))},B)}),--N||dt(V)});return F.e&&B(F.v),pt.promise},race:function(at){var q=this,pt=W(q),dt=pt.reject,B=m(function(){l(at,!1,function(F){q.resolve(F).then(pt.resolve,dt)})});return B.e&&dt(B.v),pt.promise}})},function(d,r,t){var e=t(97),n=t(94),i=t(122)("species");d.exports=function(a,s){var o=e(a).constructor,f;return o===void 0||(f=e(o)[i])==null?s:n(f)}},function(d,r,t){var e=t(93),n=t(196),i=t(120),a=t(102),s=t(91),o=s.process,f=s.setImmediate,v=s.clearImmediate,l=s.MessageChannel,p=s.Dispatch,y=0,O={},x="onreadystatechange",m,T,c,h=function(){var g=+this;if(O.hasOwnProperty(g)){var M=O[g];delete O[g],M()}},u=function(g){h.call(g.data)};(!f||!v)&&(f=function(M){for(var A=[],I=1;arguments.length>I;)A.push(arguments[I++]);return O[++y]=function(){n(typeof M=="function"?M:Function(M),A)},m(y),y},v=function(M){delete O[M]},t(86)(o)=="process"?m=function(g){o.nextTick(e(h,g,1))}:p&&p.now?m=function(g){p.now(e(h,g,1))}:l?(T=new l,c=T.port2,T.port1.onmessage=u,m=e(c.postMessage,c,1)):s.addEventListener&&typeof postMessage=="function"&&!s.importScripts?(m=function(g){s.postMessage(g+"","*")},s.addEventListener("message",u,!1)):x in a("script")?m=function(g){i.appendChild(a("script"))[x]=function(){i.removeChild(this),h.call(g)}}:m=function(g){setTimeout(e(h,g,1),0)}),d.exports={set:f,clear:v}},function(d,r){d.exports=function(t,e,n){var i=n===void 0;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(d,r,t){var e=t(91),n=t(195).set,i=e.MutationObserver||e.WebKitMutationObserver,a=e.process,s=e.Promise,o=t(86)(a)=="process";d.exports=function(){var f,v,l,p=function(){var m,T;for(o&&(m=a.domain)&&m.exit();f;){T=f.fn,f=f.next;try{T()}catch(c){throw f?l():v=void 0,c}}v=void 0,m&&m.enter()};if(o)l=function(){a.nextTick(p)};else if(i&&!(e.navigator&&e.navigator.standalone)){var y=!0,O=document.createTextNode("");new i(p).observe(O,{characterData:!0}),l=function(){O.data=y=!y}}else if(s&&s.resolve){var x=s.resolve(void 0);l=function(){x.then(p)}}else l=function(){n.call(e,p)};return function(m){var T={fn:m,next:void 0};v&&(v.next=T),f||(f=T,l()),v=T}}},function(d,r,t){var e=t(94);function n(i){var a,s;this.promise=new i(function(o,f){if(a!==void 0||s!==void 0)throw TypeError("Bad Promise constructor");a=o,s=f}),this.resolve=e(a),this.reject=e(s)}d.exports.f=function(i){return new n(i)}},function(d,r){d.exports=function(t){try{return{e:!1,v:t()}}catch(e){return{e:!0,v:e}}}},function(d,r,t){var e=t(91),n=e.navigator;d.exports=n&&n.userAgent||""},function(d,r,t){var e=t(97),n=t(98),i=t(198);d.exports=function(a,s){if(e(a),n(s)&&s.constructor===a)return s;var o=i.f(a),f=o.resolve;return f(s),o.promise}},function(d,r,t){var e=t(90),n=t(92),i=t(91),a=t(194),s=t(201);e(e.P+e.R,"Promise",{finally:function(o){var f=a(this,n.Promise||i.Promise),v=typeof o=="function";return this.then(v?function(l){return s(f,o()).then(function(){return l})}:o,v?function(l){return s(f,o()).then(function(){throw l})}:o)}})},function(d,r,t){var e=t(90),n=t(198),i=t(199);e(e.S,"Promise",{try:function(a){var s=n.f(this),o=i(a);return(o.e?s.reject:s.resolve)(o.v),s.promise}})},function(d,r,t){d.exports={default:t(205),__esModule:!0}},function(d,r,t){t(206),d.exports=t(92).Object.keys},function(d,r,t){var e=t(124),n=t(110);t(207)("keys",function(){return function(a){return n(e(a))}})},function(d,r,t){var e=t(90),n=t(92),i=t(101);d.exports=function(a,s){var o=(n.Object||{})[a]||Object[a],f={};f[a]=s(o),e(e.S+e.F*i(function(){o(1)}),"Object",f)}},function(d,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=O(e),i=t(209),a=O(i),s=t(164),o=O(s),f=t(191),v=O(f);r.defer=x,r.periodicity=m,r.calculateFramesOffset=T,r.getProgress=c,r.getCurrentFrame=u;var l=t(188),p=t(187),y=O(p);function O(g){return g&&g.__esModule?g:{default:g}}function x(){var g={};return g.promise=new v.default(function(M,A){g.resolve=M,g.reject=A}),g}function m(g,M){var A=Math.floor(g/M),I=g-A*M;return I===0&&A>0&&(I=M,A--),[A,I]}function T(g){g=g.slice(0);var M=g[0],A=g[g.length-1];A.offset=A.offset||1,M.offset=M.offset||0;for(var I=0,b=-1,E=0;E<g.length;E++){var L=g[E];if(L.offset!=null){var D=E-b;if(D>1)for(var R=(L.offset-I)/D,C=0;C<D-1;C++)g[b+C+1].offset=I+R*(C+1);I=L.offset,b=E}if(L.easing!=null&&(L.easing=(0,l.parseEasing)(L.easing)),E>0){var W=g[E].easing!=null;g[E]=(0,o.default)({},g[E-1],g[E]),W||delete g[E].easing}}return g}function c(g,M,A){var I=g.currentTime,b=M.direction,E=M.duration,L=!1;if(b==="reverse")A=1-A,L=!0;else if(b==="alternate"||b==="alternate-reverse"){var D=Math.floor(I/E);A===1&&D--,D%2^b==="alternate-reverse"&&(A=1-A,L=!0)}return{p:A,inverted:L}}function h(g,M,A,I){var b={};return(0,a.default)(M).forEach(function(E){var L=(0,n.default)(E,2),D=L[0],R=L[1];if(D!=="offset"&&D!=="easing"){var C=A[D]||A.default,W=C(g[D],R,I,g.offset,M.offset);W!=null&&(b[D]=W)}}),b}function u(g,M,A,I){var b=g.easing,E=g.effect;E||(A=(0,o.default)({},y.default,A));var L={};I=b(I,M);for(var D=1;D<M.length;D++){var R=M[D],C=R.offset;if(C>=I||D===M.length-1){var W=M[D-1],z=W.offset,H=W.easing,X=I;if(H){var Z=C-z;X=H((I-z)/Z)*Z+z}E?L=E(W,R,X,z,C):L=h(W,R,A,X);break}}return L}},function(d,r,t){d.exports={default:t(210),__esModule:!0}},function(d,r,t){t(211),d.exports=t(92).Object.entries},function(d,r,t){var e=t(90),n=t(212)(!0);e(e.S,"Object",{entries:function(a){return n(a)}})},function(d,r,t){var e=t(100),n=t(110),i=t(84),a=t(169).f;d.exports=function(s){return function(o){for(var f=i(o),v=n(f),l=v.length,p=0,y=[],O;l>p;)O=v[p++],(!e||a.call(f,O))&&y.push(s?[O,f[O]]:f[O]);return y}}},function(d,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array);const e=new Map;function n(a,s={},o=[]){a=a.toLowerCase();const f=e.get(a);if(!f)throw new TypeError(`Invalid node: ${a}`);const v=new f(s);return o.forEach(l=>{v.appendChild(l)}),v}const i={registerNode(a,s,o=100){if(s=s.toLowerCase(),e.has(s))throw new TypeError(`Cannot registerNode, ${s} has been taken.`);e.set(s,a),Object.defineProperties(a.prototype,{nodeType:{value:o},tagName:{value:s.toUpperCase()},nodeName:{value:s},ownerDocument:{value:i},namespaceURI:{value:`http://spritejs.com/${s}`}})},createElement:n,createElementNS(a,s){return n(s)},isSpriteNode(a){return e.has(a.toLowerCase())}};r.default=i},function(d,r,t){t.r(r),t.d(r,"default",function(){return s}),t(1).glMatrix.setMatrixArrayType(Array);const e=Symbol("type"),n=Symbol("bubbles"),i=Symbol("originalEvent"),a=Symbol("detail");class s{constructor(f,{bubbles:v=null}={}){if(typeof f=="string"?(this[e]=f,this[n]=!!v):(this[e]=f.type,this[i]=f,this[n]=v!=null?!!v:!!f.bubbles,f.detail&&(this[a]=f.detail)),!this[e])throw new TypeError("Invalid event type.");this.cancelBubble=!1}setOriginalEvent(f){this[i]=f}get originalEvent(){return this[i]}get type(){return this[e]}get bubbles(){return this[n]}get detail(){return this[a]}stopPropagation(){this.cancelBubble=!0}}},function(d,r,t){t.r(r),t.d(r,"parseFilterString",function(){return n}),t.d(r,"applyFilters",function(){return i});var e=t(72);t(1).glMatrix.setMatrixArrayType(Array);function n(a){if(a=a.trim(),!a||a==="none")return null;const s=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+$/i,o=a.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+?/ig),f=[];return o&&o.forEach(v=>{const l=v.match(s);if(!l)throw new TypeError("Invalid fitler string.");let[,p,y]=l;p=p.toLowerCase(),y=y.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map((O,x)=>{let m;return p==="url"||p==="drop-shadow"&&x===3?m=O:m=Object(e.toNumber)(O),/%$/.test(O)&&(m/=100),m}),f.push({type:p,args:y})}),f}function i(a,s){a.clearFilter(),s&&s.forEach(({type:o,args:f})=>{let v=o;v==="drop-shadow"?v="dropShadow":v==="hue-rotate"&&(v="hueRotate"),a[v](...f)})}},function(d,r,t){t.r(r),t.d(r,"default",function(){return e}),t(1).glMatrix.setMatrixArrayType(Array);function e(n,i){if(!i)return;const a=n.getListeners("beforerender"),s=n.getListeners("afterrender");a.length&&!i.beforeRender?i.beforeRender=o=>{n.dispatchEvent({type:"beforerender",detail:{context:o}})}:a.length||(i.beforeRender=null),s.length&&!i.afterRender?i.afterRender=o=>{n.dispatchEvent({type:"afterrender",detail:{context:o}})}:s.length||(i.afterRender=null)}},function(d,r,t){t.r(r),t.d(r,"default",function(){return f});var e=t(12),n=t(218),i=t(70),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);const s=Symbol("amount"),o=Symbol("meshCloud");class f extends i.default{constructor(l,p=1){super(),this.meshNode=l,l.connect(this),this[s]=p,this[o]=null}get meshCloud(){const l=this.meshNode,p=this[s];return!this[o]&&l.mesh&&(this[o]=new e.MeshCloud(l.mesh,p)),this[o]}get isVisible(){return!!this.meshNode&&this.meshNode.isVisible}get amount(){return this[s]}set amount(l){this[s]=l,this[o]&&(this[o].amount=l)}brightness(l,p){this.meshCloud&&(this.meshCloud.brightness(l,p),this.forceUpdate())}contrast(l,p){this.meshCloud&&(this.meshCloud.contrast(l,p),this.forceUpdate())}delete(l){this.meshCloud&&(this.meshCloud.delete(l),this[s]--,this.forceUpdate())}draw(l=[]){if(super.draw(l),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);const p=this.shaderAttrs;p&&Object.entries(p).forEach(([O,x])=>{this.meshCloud.mesh.setAttribute(O,x)});const y=this.uniforms;if(this.uniforms){const O={};Object.entries(y).forEach(([x,m])=>{typeof m=="function"&&(m=m(this,x)),O[x]=m}),this.meshCloud.mesh.setUniforms(O)}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),l.push(this.meshCloud)}return l}getTransform(l){if(this.meshCloud)return this.meshCloud.getTransform(l)}grayscale(l,p){this.meshCloud&&(this.meshCloud.grayscale(l,p),this.forceUpdate())}hueRotate(l,p){this.meshCloud&&(this.meshCloud.hueRotate(l,p),this.forceUpdate())}invert(l,p){this.meshCloud&&(this.meshCloud.invert(l,p),this.forceUpdate())}isPointCollision(l,p){if(!this.meshCloud)return!1;const y=this.attributes.pointerEvents;if(y==="none"||y!=="all"&&!this.isVisible)return!1;let O="both";y==="visibleFill"&&(O="fill"),y==="visibleStroke"&&(O="stroke");for(let x=0;x<this[s];x++)if(!this.meshCloud.isPointCollision(x,[l,p],O))return!1;return!0}setOpacity(l,p){this.meshCloud&&(this.meshCloud.opacity(l,p),this.forceUpdate())}rotate(l,p,[y,O]=[0,0]){const x=Math.PI*p/180;if(this.meshCloud){const{x:m,y:T}=this.meshNode.attributes;this.meshCloud.rotate(l,x,[y+m,O+T]),this.forceUpdate()}}saturate(l,p){this.meshCloud&&(this.meshCloud.saturate(l,p),this.forceUpdate())}scale(l,[p,y=p],[O,x]=[0,0]){if(this.meshCloud){const{x:m,y:T}=this.meshNode.attributes,c=1e-5;Math.abs(p)<c&&(p=1/p>0?c:-c),Math.abs(y)<c&&(y=1/y>0?c:-c),this.meshCloud.scale(l,[p,y],[O+m,x+T]),this.forceUpdate()}}setColorTransform(l,p){this.meshCloud&&(this.meshCloud.setColorTransform(l,p),this.forceUpdate())}setFillColor(l,p){this.meshCloud&&(Array.isArray(p)&&(p=[...p],p[0]/=255,p[1]/=255,p[2]/=255),this.meshCloud.setFillColor(l,p),this.forceUpdate())}sepia(l,p){this.meshCloud&&(this.meshCloud.sepia(l,p),this.forceUpdate())}setResolution({width:l,height:p}){super.setResolution({width:l,height:p}),this.meshNode.setResolution({width:l,height:p})}setStrokeColor(l,p){this.meshCloud&&(Array.isArray(p)&&(p=[...p],p[0]/=255,p[1]/=255,p[2]/=255),this.meshCloud.setStrokeColor(l,p),this.forceUpdate())}setTransform(l,p){this.meshCloud&&(this.meshCloud.setTransform(l,p),this.forceUpdate())}skew(l,[p,y=p],[O,x]=[0,0]){if(this.meshCloud){const{x:m,y:T}=this.meshNode.attributes;this.meshCloud.skew(l,[p,y],[O+m,x+T]),this.forceUpdate()}}transform(l,p){this.meshCloud&&(this.meshCloud.transform(l,p),this.forceUpdate())}transformColor(l,p){this.meshCloud&&(this.meshCloud.transformColor(l,p),this.forceUpdate())}translate(l,[p,y]){this.meshCloud&&(this.meshCloud.translate(l,[p,y]),this.forceUpdate())}updateMesh(){this[o]&&(this[o].mesh=this.meshNode.mesh,this.forceUpdate())}}a.default.registerNode(f,"cloud")},function(d,r,t){t.r(r),t.d(r,"loadTexture",function(){return a}),t.d(r,"applyTexture",function(){return s}),t.d(r,"createTexture",function(){return f}),t.d(r,"deleteTexture",function(){return v}),t.d(r,"drawTexture",function(){return p}),t.d(r,"loadFrames",function(){return y});var e=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);const i={};function a(O,x){if(i[O])return i[O];const m=e.ENV.loadImage(O,{alias:x,useImageBitmap:!1});return m??O}async function s(O,x,m){let T=x;if(typeof x=="string"&&(T=a(x)),T&&typeof T.then=="function"&&(T=await T),x===O.attributes.texture){T&&T.image&&(T.sourceRect&&(O.attributes.sourceRect=T.sourceRect),O.textureImageRotated=!!T.rotated,T=T.image);const{width:c,height:h,textureRect:u}=O.attributes,g=O.textureImage;O.textureImage=T,m&&g!==T&&!u&&(c==null||h==null)&&O.updateContours(),O.forceUpdate()}return T}const o=Symbol("textureMap");function f(O,x){if(x[o]=x[o]||new Map,x[o].has(O))return x[o].get(O);const m=x.createTexture(O);return!/^blob:/.test(O.src)&&typeof O.getContext!="function"&&x[o].set(O,m),m}function v(O,x){if(x[o]&&x[o].has(O)){const m=x[o].get(O);return x.deleteTexture(m),x[o].delete(O),!0}return!1}const l=Symbol("textureContext");function p(O,x){const m=O.textureImage instanceof String?String(O.textureImage):O.textureImage,T=O.textureImageRotated,c=x.texture,h=O.renderer;if(m){const u=O.originalContentRect;let g=O.attributes.textureRect;const M=O.attributes.textureRepeat,A=O.attributes.sourceRect;if(!c||O[l]&&O[l]!==h||c.image!==m||c.options.repeat!==M||!Object(n.compareValue)(c.options.rect,g)||!Object(n.compareValue)(c.options.srcRect,A)){const I=f(m,h);g?(g[0]+=u[0],g[1]+=u[1]):g=u;let b=null;c&&!h[o].has(c.image)&&(!c.options||!c.options.hidden)&&(b=x.uniforms.u_texSampler),x.setTexture(I,{rect:g,repeat:M,srcRect:A,rotated:T}),b&&b.delete&&b.delete(),O[l]=h}}else if(c){let u=null;!h[o].has(c.image)&&(!c.options||!c.options.hidden)&&(u=x.uniforms.u_texSampler),x.setTexture(null),u&&u.delete&&u.delete()}}async function y(O,x){typeof x=="string"&&(x=await(await fetch(x,{method:"GET",mode:"cors",cache:"default"})).json());const m=await a(O),T=x.frames;return Object.entries(T).forEach(([c,h])=>{const{x:u,y:g,w:M,h:A}=h.frame;let I=[u,g,M,A];const b=h.rotated;b&&(I=[I[0],I[1],I[3],I[2]]),i[c]={image:m,sourceRect:I,rotated:b}}),m}},function(d,r,t){t.r(r),t.d(r,"default",function(){return y});var e=t(1),n=t(12),i=t(70),a=t(220),s=t(221),o=t(222),f=t(213),v=t(223);t(1).glMatrix.setMatrixArrayType(Array);function l(O,x,m){return x in O?Object.defineProperty(O,x,{value:m,enumerable:!0,configurable:!0,writable:!0}):O[x]=m,O}const p=Symbol("mesh");class y extends i.default{constructor(x={}){super(x)}get borderSize(){const{paddingTop:x,paddingRight:m,paddingBottom:T,paddingLeft:c,borderWidth:h}=this.attributes,[u,g]=this.contentSize;return[c+u+m+h,x+g+T+h]}get clientSize(){const{paddingTop:x,paddingRight:m,paddingBottom:T,paddingLeft:c}=this.attributes,[h,u]=this.contentSize;return[c+h+m,x+u+T]}get contentSize(){let{width:x,height:m,boxSizing:T,paddingTop:c,paddingRight:h,paddingBottom:u,paddingLeft:g}=this.attributes;if(x=x||0,m=m||0,T==="border-box"){const M=2*this.attributes.borderWidth;x-=M+h+g,m-=M+c+u,x=Math.max(0,x),m=Math.max(0,m)}return[x,m]}get hasBorder(){return this.attributes.borderWidth>0}get isVisible(){const[x,m]=this.borderSize;return x>0&&m>0}get mesh(){if(this.attributes.display==="none")return null;const x=this.clientBox;if(x){let m=this[p];if(m)m.box!==x&&(m.contours=x.contours,m.box=x);else{m=new n.Mesh2D(x),m.box=x;const c=this.attributes.bgcolor;if(Object(s.setFillColor)(m,{color:c}),this.hasBorder){const{borderColor:u,borderWidth:g,borderDash:M,borderDashOffset:A}=this.attributes;Object(s.setStrokeColor)(m,{color:u,lineWidth:g,lineDash:M,lineDashOffset:A})}this[p]=m;const h=this.attributes.clipPath;h&&this[p].setClipPath(h)}const T=this.opacity;return m.getOpacity()!==T&&m.setOpacity(T),m.setTransform(...this.renderMatrix),m}return null}get offsetSize(){const{paddingTop:x,paddingRight:m,paddingBottom:T,paddingLeft:c,borderWidth:h}=this.attributes,[u,g]=this.contentSize,M=2*h;return[c+u+m+M,x+g+T+M]}get originalClientRect(){if(this.mesh){const x=this.mesh.boundingBox;return[x[0][0],x[0][1],x[1][0]-x[0][0],x[1][1]-x[0][1]]}return[0,0,0,0]}get originalContentRect(){const[x,m,T,c]=this.originalClientRect,h=this.attributes.padding;return[x+h[0],m+h[1],T-h[0]-h[2],c-h[1]-h[3]]}getBoundingClientRect(){let x=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(x=e.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,x));let m=null;if(this.mesh){m=[...this.mesh.boundingBox];const T=this.attributes.borderWidth;T&&(m[0]=[m[0][0]-T,m[0][1]-T],m[1]=[m[1][0]+T,m[1][1]+T])}return Object(v.default)(m,x)}onPropertyChange(x,m,T){if(super.onPropertyChange(x,m,T),(x==="anchorX"||x==="anchorY"||x==="boxSizing"||x==="width"||x==="height"||x==="borderWidth"||x==="paddingLeft"||x==="paddingRight"||x==="paddingTop"||x==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(x))&&this.updateContours(),this[p]&&x==="clipPath"&&this[p].setClipPath(m),this[p]&&x==="bgcolor"&&Object(s.setFillColor)(this[p],{color:m}),this[p]&&(x==="borderColor"||x==="borderWidth"||x==="borderDash"||x==="borderDashOffset")){const{borderColor:c,borderWidth:h,borderDash:u,borderDashOffset:g}=this.attributes;Object(s.setStrokeColor)(this[p],{color:c,lineWidth:h,lineDash:h?u:0,lineDashOffset:g})}}updateContours(){const{anchorX:x,anchorY:m,borderWidth:T,borderRadius:c}=this.attributes,[h,u]=this.borderSize,g=this.offsetSize,M=.5*T,A=-x*g[0]+M,I=-m*g[1]+M;this.clientBox=new n.Figure2D,Object(o.createRadiusBox)(this.clientBox,[A,I,h,u],c)}}l(y,"Attr",a.default),f.default.registerNode(y,"block")},function(d,r,t){t.r(r),t.d(r,"default",function(){return v});var e=t(71),n=t(72),i=t(221);t(1).glMatrix.setMatrixArrayType(Array);const a=Symbol.for("spritejs_setAttribute"),s=Symbol.for("spritejs_getAttribute"),o=Symbol.for("spritejs_setAttributeDefault"),f=Symbol.for("spritejs_declareAlias");class v extends e.default{constructor(p){super(p),this[o]({anchorX:0,anchorY:0,width:void 0,height:void 0,borderWidth:0,borderColor:"rgba(0,0,0,1)",borderDash:void 0,borderDashOffset:0,borderTopLeftRadius:[0,0],borderTopRightRadius:[0,0],borderBottomRightRadius:[0,0],borderBottomLeftRadius:[0,0],bgcolor:"rgba(0,0,0,0)",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,boxSizing:"content-box",clipPath:void 0}),this[f]("anchor","size","border","borderRadius","padding")}get anchorX(){return this[s]("anchorX")}set anchorX(p){this[a]("anchorX",Object(n.toNumber)(p))}get anchorY(){return this[s]("anchorY")}set anchorY(p){this[a]("anchorY",Object(n.toNumber)(p))}get anchor(){return[this.anchorX,this.anchorY]}set anchor(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.anchorX=p[0],this.anchorY=p[1]}get width(){return this[s]("width")}set width(p){this[a]("width",Object(n.toNumber)(p))}get height(){return this[s]("height")}set height(p){this[a]("height",Object(n.toNumber)(p))}get size(){return[this.width,this.height]}set size(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.width=p[0],this.height=p[1]}get borderWidth(){return this[s]("borderWidth")}set borderWidth(p){this[a]("borderWidth",Object(n.toNumber)(p))}get borderColor(){return this[s]("borderColor")}set borderColor(p){this[a]("borderColor",Object(i.parseColor)(p))}get border(){return[this.borderWidth,this.borderColor]}set border(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p]),this.borderWidth=p[0],p[1]!=null&&(this.borderColor=p[1])}get borderDash(){return this[s]("borderDash")}set borderDash(p){p=Object(n.toArray)(p,!0),p!=null&&!Array.isArray(p)&&(p=[p]),this[a]("borderDash",p?p.map(n.toNumber):null)}get borderDashOffset(){return this[s]("borderDashOffset")}set borderDashOffset(p){this[a]("borderDashOffset",Object(n.toNumber)(p))}get borderTopLeftRadius(){return this[s]("borderTopLeftRadius")}set borderTopLeftRadius(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderTopLeftRadius",p.map(n.toNumber))}get borderTopRightRadius(){return this[s]("borderTopRightRadius")}set borderTopRightRadius(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderTopRightRadius",p.map(n.toNumber))}get borderBottomRightRadius(){return this[s]("borderBottomRightRadius")}set borderBottomRightRadius(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderBottomRightRadius",p.map(n.toNumber))}get borderBottomLeftRadius(){return this[s]("borderBottomLeftRadius")}set borderBottomLeftRadius(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderBottomLeftRadius",p.map(n.toNumber))}get borderRadius(){return[...this.borderTopLeftRadius,...this.borderTopRightRadius,...this.borderBottomRightRadius,...this.borderBottomLeftRadius]}set borderRadius(p){if(p=Object(n.toArray)(p),!Array.isArray(p))p=Array(8).fill(p);else if(p.length===2)p=[p[0],p[1],p[0],p[1],p[0],p[1],p[0],p[1]];else if(p.length===4)p=[p[0],p[1],p[2],p[3],p[0],p[1],p[2],p[3]];else if(p.length===6)p=[p[0],p[1],p[2],p[3],p[4],p[5],p[2],p[3]];else if(p.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[p[0],p[1]],this.borderTopRightRadius=[p[2],p[3]],this.borderBottomRightRadius=[p[4],p[5]],this.borderBottomLeftRadius=[p[6],p[7]]}get bgcolor(){return this[s]("bgcolor")}set bgcolor(p){this[a]("bgcolor",Object(i.parseColor)(p))}get paddingTop(){return this[s]("paddingTop")}set paddingTop(p){this[a]("paddingTop",Object(n.toNumber)(p))}get paddingRight(){return this[s]("paddingRight")}set paddingRight(p){this[a]("paddingRight",Object(n.toNumber)(p))}get paddingBottom(){return this[s]("paddingBottom")}set paddingBottom(p){this[a]("paddingBottom",Object(n.toNumber)(p))}get paddingLeft(){return this[s]("paddingLeft")}set paddingLeft(p){this[a]("paddingLeft",Object(n.toNumber)(p))}get padding(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft]}set padding(p){p=Object(n.toArray)(p),Array.isArray(p)?p.length===2?p=[p[0],p[1],p[0],p[1]]:p.length===3&&(p=[p[0],p[1],p[2],p[1]]):p=[p,p,p,p],this.paddingTop=p[0],this.paddingRight=p[1],this.paddingBottom=p[2],this.paddingLeft=p[3]}get clipPath(){return this[s]("clipPath")}set clipPath(p){this[a]("clipPath",p)}get boxSizing(){return this[s]("boxSizing")}set boxSizing(p){if(p!=null&&p!=="border-box"&&p!=="content-box")throw new TypeError("Invalid boxSizing type.");this[a]("boxSizing",p)}}},function(d,r,t){t.r(r),t.d(r,"Gradient",function(){return i}),t.d(r,"isTransparent",function(){return a}),t.d(r,"parseColor",function(){return s}),t.d(r,"setFillColor",function(){return f}),t.d(r,"setStrokeColor",function(){return v}),t.d(r,"Color",function(){return l});var e=t(32),n=t.n(e);t(1).glMatrix.setMatrixArrayType(Array);class i{constructor({vector:y,colors:O}){if(!Array.isArray(y)||y.length!==4&&y.length!==6&&y.length!==3)throw new TypeError("Invalid gradient");this.vector=y,this.colors=O.map(({offset:x,color:m})=>({offset:x,color:s(m)}))}toString(){return JSON.stringify({vector:this.vector,colors:this.colors})}}function a(p){return p instanceof i?!1:p==null?!0:n()(p)[3]===0}function s(p){if(p==null||(p||(p="transparent"),p instanceof i))return p;const y=n()(p);if(!y||!y.length)throw new TypeError("Invalid color value.");return`rgba(${y.join()})`}function o(p,y,O){const x=p.boundingBox[0];if(O.vector){let{vector:m,colors:T}=O;m.length===4?(m=[m[0]+x[0],m[1]+x[1],m[2]+x[0],m[3]+x[1]],p.setLinearGradient({vector:m,colors:T,type:y})):m.length===3?(m=[m[0]+x[0],m[1]+x[1],m[2]],p.setCircularGradient({vector:m,colors:T,type:y})):(m=[m[0]+x[0],m[1]+x[1],m[2],m[3]+x[0],m[4]+x[1],m[5]],p.setRadialGradient({vector:m,colors:T,type:y}))}else p.gradient&&p.gradient[y]&&(delete p.gradient[y],delete p.uniforms.u_radialGradientVector)}function f(p,{color:y,rule:O="nonzero"}){return o(p,"fill",y),y.vector||p.setFill({color:y,rule:O}),p}function v(p,{color:y,lineWidth:O,lineCap:x,lineJoin:m,lineDash:T,lineDashOffset:c,miterLimit:h,roundSegments:u}){o(p,"stroke",y),y.vector&&(y=[0,0,0,1]),p.setStroke({color:y,thickness:O,cap:x,join:m,miterLimit:h,lineDash:T,lineDashOffset:c,roundSegments:u})}class l extends Array{constructor(y=0,O=0,x=0,m=0){return Array.isArray(y)&&([y,O,x,m]=y),typeof y=="string"&&([y,O,x,m]=n()(y),y/=255,O/=255,x/=255),super(y,O,x,m),this}get r(){return Math.round(this[0]*255)}set r(y){this[0]=y/255}get g(){return Math.round(this[1]*255)}set g(y){this[1]=y/255}get b(){return Math.round(this[2]*255)}set b(y){this[2]=y/255}get a(){return this[3]}set a(y){this[3]=y}get hex(){const y=`0${this.r.toString(16)}`.slice(-2),O=`0${this.g.toString(16)}`.slice(-2),x=`0${this.b.toString(16)}`.slice(-2);let m;return this.a<1&&(m=Math.round(this[3]*255),m=`0${m.toString(16)}`.slice(-2)),`#${y}${O}${x}${m||""}`}get rgba(){return`rgba(${this.r},${this.g},${this.b},${this.a})`}fromColor(y){return typeof y=="string"&&(y=n()(y),y[0]/=255,y[1]/=255,y[2]/=255),this[0]=y[0],this[1]=y[1],this[2]=y[2],this[3]=y[3],this}}},function(d,r,t){t.r(r),t.d(r,"createRadiusBox",function(){return n}),t(1).glMatrix.setMatrixArrayType(Array);function e(i,a,s,o,f,v="leftTop"){const l=.5522848,p=o/2*l,y=f/2*l,O=a+o,x=s+f,m=a+o/2,T=s+f/2;v==="leftTop"?(i.moveTo(a,T),i.bezierCurveTo(a,T-y,m-p,s,m,s)):v==="rightTop"?i.bezierCurveTo(m+p,s,O,T-y,O,T):v==="rightBottom"?i.bezierCurveTo(O,T+y,m+p,x,m,x):v==="leftBottom"&&i.bezierCurveTo(m-p,x,a,T+y,a,T)}function n(i,[a,s,o,f],v){if(!v||Array.isArray(v)&&v.every(l=>l===0))i.beginPath(),i.rect(a,s,o,f);else{typeof v=="number"&&(v=Array(8).fill(v));const[l,p,y,O,x,m,T,c]=v.map((h,u)=>u%2?Math.min(h,f/2):Math.min(h,o/2));i.beginPath(),i.moveTo(a,s+p),e(i,a,s,l*2,p*2,"leftTop"),i.lineTo(a+o-y,s),e(i,a+o-y*2,s,y*2,O*2,"rightTop"),i.lineTo(a+o,s+f-m),e(i,a+o-x*2,s+f-m*2,x*2,m*2,"rightBottom"),i.lineTo(a+T,s+f),e(i,a,s+f-c*2,T*2,c*2,"leftBottom"),i.closePath()}return i}},function(d,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array),r.default=function(e,n){if(!e)return{x:0,y:0,width:0,height:0,left:0,top:0,right:0,bottom:0};const[[i,a],[s,o]]=e,f=i*n[0]+a*n[2]+n[4],v=i*n[1]+a*n[3]+n[5],l=s*n[0]+a*n[2]+n[4],p=s*n[1]+a*n[3]+n[5],y=s*n[0]+o*n[2]+n[4],O=s*n[1]+o*n[3]+n[5],x=i*n[0]+o*n[2]+n[4],m=i*n[1]+o*n[3]+n[5],T=Math.min(f,l,y,x),c=Math.min(v,p,O,m),h=Math.max(f,l,y,x),u=Math.max(v,p,O,m);return{x:T,y:c,width:h-T,height:u-c,left:T,top:c,right:h,bottom:u}}},function(d,r,t){t.r(r),t.d(r,"default",function(){return f});var e=t(218),n=t(219),i=t(225),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);function s(v,l,p){return l in v?Object.defineProperty(v,l,{value:p,enumerable:!0,configurable:!0,writable:!0}):v[l]=p,v}const o=Symbol("textureTask");class f extends n.default{constructor(l={}){typeof l=="string"&&(l={texture:l}),super(l)}get contentSize(){let[l,p]=super.contentSize;const{width:y,height:O}=this.attributes;if(y==null||O==null){const x=this.textureImage,m=this.attributes.textureRect,T=this.attributes.sourceRect;if(m)y==null&&(l=m[0]+m[2]),O==null&&(p=m[1]+m[3]);else if(T){const c=this.layer?this.layer.displayRatio:1;y==null&&(l=T[2]/c),O==null&&(p=T[3]/c)}else if(x){const c=this.layer?this.layer.displayRatio:1;y==null&&(l=x.width/c),O==null&&(p=x.height/c)}}return[l,p]}get textureImageReady(){return this[o]||Promise.resolve()}draw(l=[]){super.draw(l);const p=this.mesh;return p&&Object(e.drawTexture)(this,p),l}onPropertyChange(l,p,y){if(super.onPropertyChange(l,p,y),l==="texture"&&(this[o]=Object(e.applyTexture)(this,p,!0)),l==="textureRect"){const{width:O,height:x}=this.attributes;(O==null||x==null)&&this.updateContours()}}}s(f,"Attr",i.default),a.default.registerNode(f,"sprite")},function(d,r,t){t.r(r),t.d(r,"default",function(){return s});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);const n=Symbol.for("spritejs_setAttributeDefault"),i=Symbol.for("spritejs_setAttribute"),a=Symbol.for("spritejs_getAttribute");class s extends e.default{constructor(f){super(f),this[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0})}get texture(){return this[a]("texture")}set texture(f){this[i]("texture",f)}get textureRect(){return this[a]("textureRect")}set textureRect(f){this[i]("textureRect",f)}get sourceRect(){return this[a]("sourceRect")}set sourceRect(f){this[i]("sourceRect",f)}get textureRepeat(){return this[a]("textureRepeat")}set textureRepeat(f){this[i]("textureRepeat",!!f)}}},function(d,r,t){t.r(r),t.d(r,"default",function(){return O});var e=t(12),n=t(227),i=t.n(n),a=t(70),s=t(228),o=t(221),f=t(218),v=t(213),l=t(223);t(1).glMatrix.setMatrixArrayType(Array);function p(x,m,T){return m in x?Object.defineProperty(x,m,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[m]=T,x}const y=Symbol("mesh");class O extends a.default{constructor(m={}){typeof m=="string"&&(m={d:m}),super(m),this.effects={d(T,c,h,u,g){const M=(h-u)/(g-u);if(M<=0)return T;if(M>=1)return c;const A=i.a._preprocessing(i.a.path2shapes(T),i.a.path2shapes(c)),I=i.a._lerp(...A,M)[0];return I.reduce((E,L)=>`${E}${L.slice(2).join(" ")} `,`M${I[0][0]} ${I[0][1]}C`).trim()}}}get isVisible(){return!!this.d}get mesh(){if(this.attributes.display==="none")return null;const m=this.path;if(m){let T=this[y];if(T)T.path!==m&&(T.contours=m.contours,T.path=m);else{T=new e.Mesh2D(this.path),T.path=m;const h=this.attributes.fillColor,u=this.attributes.fillRule;h&&Object(o.setFillColor)(T,{color:h,rule:u});const g=this.attributes.lineWidth,M=this.attributes.strokeColor;if(M&&g>0){const{lineCap:I,lineJoin:b,miterLimit:E,lineDash:L,lineDashOffset:D,roundSegments:R}=this.attributes;Object(o.setStrokeColor)(T,{color:M,lineWidth:g,lineCap:I,lineJoin:b,miterLimit:E,lineDash:L,lineDashOffset:D,roundSegments:R})}this[y]=T;const A=this.attributes.clipPath;A&&this[y].setClipPath(A)}const c=this.opacity;return T.getOpacity()!==c&&T.setOpacity(c),T.setTransform(...this.renderMatrix),T}return null}get originalContentRect(){if(this.path){const m=this.path.boundingBox;return[m[0][0],m[0][1],m[1][0]-m[0][0],m[1][1]-m[0][1]]}return[0,0,0,0]}get originalClientRect(){if(this.mesh){const m=this.mesh.boundingBox;return[m[0][0],m[0][1],m[1][0]-m[0][0],m[1][1]-m[0][1]]}return[0,0,0,0]}get originalClientCenter(){return this.mesh?this.mesh.boundingCenter:[0,0]}set d(m){this.attributes.d=m}get d(){return this.attributes.d}draw(m=[]){super.draw(m);const T=this.mesh;return T&&Object(f.drawTexture)(this,T),m}getBoundingClientRect(){let m=null;return this.mesh&&(m=this.mesh.boundingBox),Object(l.default)(m,this.renderMatrix)}getPathLength(){return this.mesh?this.mesh.getTotalLength():0}getPointAtLength(m){if(this.mesh){const T=this.mesh.getPointAtLength(m);if(T)return[T.x,T.y]}return[0,0]}onPropertyChange(m,T,c){if(super.onPropertyChange(m,T,c),(m==="d"||m==="normalize")&&this.updateContours(),this[y]&&(m==="fillColor"||m==="fillRule")){const{fillColor:h,fillRule:u}=this.attributes;Object(o.setFillColor)(this[y],{color:h,rule:u})}if(this[y]&&(m==="strokeColor"||m==="lineWidth"||m==="lineCap"||m==="lineJoin"||m==="lineDash"||m==="lineDashOffset"||m==="roundSegments")){const{strokeColor:h,lineWidth:u}=this.attributes;if(h&&u>0){const{lineCap:g,lineJoin:M,lineDash:A,lineDashOffset:I,miterLimit:b,roundSegments:E}=this.attributes;Object(o.setStrokeColor)(this[y],{color:h,lineCap:g,lineJoin:M,lineWidth:u,lineDash:A,lineDashOffset:I,miterLimit:b,roundSegments:E})}}this[y]&&m==="clipPath"&&this[y].setClipPath(T),m==="texture"&&Object(f.applyTexture)(this,T)}updateContours(){this.path=new e.Figure2D,this.path.addPath(this.attributes.d),this.attributes.normalize&&this.path.normalize(...this.path.boundingCenter)}}p(O,"Attr",s.default),v.default.registerNode(O,"path")},function(d,r,t){(function(e,n){d.exports=n()})(this,function(){var e=function(){function L(D,R){var C=[],W=!0,z=!1,H=void 0;try{for(var X=D[Symbol.iterator](),Z;!(W=(Z=X.next()).done)&&(C.push(Z.value),!(R&&C.length===R));W=!0);}catch(j){z=!0,H=j}finally{try{!W&&X.return&&X.return()}finally{if(z)throw H}}return C}return function(D,R){if(Array.isArray(D))return D;if(Symbol.iterator in Object(D))return L(D,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=Math.PI*2,i=function(D,R,C,W,z,H,X){var Z=D.x,j=D.y;Z*=R,j*=C;var G=W*Z-z*j,Q=z*Z+W*j;return{x:G+H,y:Q+X}},a=function(D,R){var C=1.3333333333333333*Math.tan(R/4),W=Math.cos(D),z=Math.sin(D),H=Math.cos(D+R),X=Math.sin(D+R);return[{x:W-z*C,y:z+W*C},{x:H+X*C,y:X-H*C},{x:H,y:X}]},s=function(D,R,C,W){var z=D*W-R*C<0?-1:1,H=Math.sqrt(D*D+R*R),X=Math.sqrt(D*D+R*R),Z=D*C+R*W,j=Z/(H*X);return j>1&&(j=1),j<-1&&(j=-1),z*Math.acos(j)},o=function(D,R,C,W,z,H,X,Z,j,G,Q,tt){var et=Math.pow(z,2),at=Math.pow(H,2),q=Math.pow(Q,2),pt=Math.pow(tt,2),dt=et*at-et*pt-at*q;dt<0&&(dt=0),dt/=et*pt+at*q,dt=Math.sqrt(dt)*(X===Z?-1:1);var B=dt*z/H*tt,F=dt*-H/z*Q,V=G*B-j*F+(D+C)/2,J=j*B+G*F+(R+W)/2,N=(Q-B)/z,$=(tt-F)/H,S=(-Q-B)/z,P=(-tt-F)/H,w=s(1,0,N,$),U=s(N,$,S,P);return Z===0&&U>0&&(U-=n),Z===1&&U<0&&(U+=n),[V,J,w,U]},f=function(D){var R=D.px,C=D.py,W=D.cx,z=D.cy,H=D.rx,X=D.ry,Z=D.xAxisRotation,j=Z===void 0?0:Z,G=D.largeArcFlag,Q=G===void 0?0:G,tt=D.sweepFlag,et=tt===void 0?0:tt,at=[];if(H===0||X===0)return[];var q=Math.sin(j*n/360),pt=Math.cos(j*n/360),dt=pt*(R-W)/2+q*(C-z)/2,B=-q*(R-W)/2+pt*(C-z)/2;if(dt===0&&B===0)return[];H=Math.abs(H),X=Math.abs(X);var F=Math.pow(dt,2)/Math.pow(H,2)+Math.pow(B,2)/Math.pow(X,2);F>1&&(H*=Math.sqrt(F),X*=Math.sqrt(F));var V=o(R,C,W,z,H,X,Q,et,q,pt,dt,B),J=e(V,4),N=J[0],$=J[1],S=J[2],P=J[3],w=Math.max(Math.ceil(Math.abs(P)/(n/4)),1);P/=w;for(var U=0;U<w;U++)at.push(a(S,P)),S+=P;return at.map(function(K){var Y=i(K[0],H,X,pt,q,N,$),k=Y.x,rt=Y.y,it=i(K[1],H,X,pt,q,N,$),lt=it.x,ut=it.y,ot=i(K[2],H,X,pt,q,N,$),st=ot.x,ft=ot.y;return{x1:k,y1:rt,x2:lt,y2:ut,x:st,y:ft}})},v={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},l=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function p(L){var D=[];return L.replace(l,function(R,C,W){var z=C.toLowerCase();for(W=O(W),z=="m"&&W.length>2&&(D.push([C].concat(W.splice(0,2))),z="l",C=C=="m"?"l":"L");;){if(W.length==v[z])return W.unshift(C),D.push(W);if(W.length<v[z])throw new Error("malformed path data");D.push([C].concat(W.splice(0,v[z])))}}),D}var y=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function O(L){var D=L.match(y);return D?D.map(Number):[]}function x(L){var D=L[0][0],R=L[0][1],C=D,W=R;return L.forEach(function(z){var H=z[0],X=z[2],Z=z[4],j=z[6],G=z[1],Q=z[3],tt=z[5],et=z[7];D=Math.min(D,H,X,Z,j),R=Math.min(R,G,Q,tt,et),C=Math.max(C,H,X,Z,j),W=Math.max(W,G,Q,tt,et)}),[D,R,C,W]}function m(L,D){return Math.sqrt(Math.pow(L[0]-D[0],2)+Math.pow(L[1]-D[1],2))+Math.sqrt(Math.pow(L[2]-D[2],2)+Math.pow(L[3]-D[3],2))}function T(L,D){var R=L[0],C=L[2],W=L[4],z=L[6],H=L[1],X=L[3],Z=L[5],j=L[7],G=D[0],Q=D[2],tt=D[4],et=D[6],at=D[1],q=D[3],pt=D[5],dt=D[7];return Math.sqrt(Math.pow(G-R,2)+Math.pow(at-H,2))+Math.sqrt(Math.pow(Q-C,2)+Math.pow(q-X,2))+Math.sqrt(Math.pow(tt-W,2)+Math.pow(pt-Z,2))+Math.sqrt(Math.pow(et-z,2)+Math.pow(dt-j,2))}function c(L,D){var R=u(L.length),C=[];R.forEach(function(z){var H=0,X=0;z.forEach(function(Z){H+=T(L[Z],D[X++])}),C.push({index:z,distance:H})}),C.sort(function(z,H){return z.distance-H.distance});var W=[];return C[0].index.forEach(function(z){W.push(L[z])}),W}function h(L,D){var R=g(L.length),C=[];R.forEach(function(z){var H=0;z.forEach(function(X){H+=m(x(L[X]),x(D[X]))}),C.push({index:z,distance:H})}),C.sort(function(z,H){return z.distance-H.distance});var W=[];return C[0].index.forEach(function(z){W.push(L[z])}),W}function u(L){for(var D=[],R=0;R<L;R++){for(var C=[],W=0;W<L;W++){var z=W+R;z>L-1&&(z-=L),C[z]=W}D.push(C)}return D}function g(L){for(var D=[],R=0;R<L;R++)D.push(R);return M(D)}function M(L){var D=[],R=[];function C(W){var z,H;for(z=0;z<W.length;z++)H=W.splice(z,1)[0],R.push(H),W.length==0&&D.push(R.slice()),C(W),W.splice(z,0,H),R.pop();return D}return C(L)}var A={};A.parser=p,A.lerpCurve=function(L,D,R){return A.lerpPoints(L[0],L[1],D[0],D[1],R).concat(A.lerpPoints(L[2],L[3],D[2],D[3],R)).concat(A.lerpPoints(L[4],L[5],D[4],D[5],R)).concat(A.lerpPoints(L[6],L[7],D[6],D[7],R))},A.lerpPoints=function(L,D,R,C,W){return[L+(R-L)*W,D+(C-D)*W]},A.q2b=function(L,D,R,C,W,z){return[L,D,(L+2*R)/3,(D+2*C)/3,(W+2*R)/3,(z+2*C)/3,W,z]},A.path2shapes=function(L){for(var D=A.parser(L),R=0,C=0,W=0,z=D.length,H=[],X=null,Z=void 0,j=void 0,G=void 0,Q=void 0,tt=void 0,et=void 0,at=void 0;W<z;W++){var q=D[W],pt=q[0],dt=D[W-1];switch(pt){case"m":tt=H.length,H[tt]=[],X=H[tt],R=R+q[1],C=C+q[2];break;case"M":tt=H.length,H[tt]=[],X=H[tt],R=q[1],C=q[2];break;case"l":X.push([R,C,R,C,R,C,R+q[1],C+q[2]]),R+=q[1],C+=q[2];break;case"L":X.push([R,C,q[1],q[2],q[1],q[2],q[1],q[2]]),R=q[1],C=q[2];break;case"h":X.push([R,C,R,C,R,C,R+q[1],C]),R+=q[1];break;case"H":X.push([R,C,q[1],C,q[1],C,q[1],C]),R=q[1];break;case"v":X.push([R,C,R,C,R,C,R,C+q[1]]),C+=q[1];break;case"V":X.push([R,C,R,q[1],R,q[1],R,q[1]]),C=q[1];break;case"C":X.push([R,C,q[1],q[2],q[3],q[4],q[5],q[6]]),R=q[5],C=q[6];break;case"S":dt[0]==="C"||dt[0]==="c"?X.push([R,C,R+dt[5]-dt[3],C+dt[6]-dt[4],q[1],q[2],q[3],q[4]]):(dt[0]==="S"||dt[0]==="s")&&X.push([R,C,R+dt[3]-dt[1],C+dt[4]-dt[2],q[1],q[2],q[3],q[4]]),R=q[3],C=q[4];break;case"c":X.push([R,C,R+q[1],C+q[2],R+q[3],C+q[4],R+q[5],C+q[6]]),R=R+q[5],C=C+q[6];break;case"s":dt[0]==="C"||dt[0]==="c"?X.push([R,C,R+dt[5]-dt[3],C+dt[6]-dt[4],R+q[1],C+q[2],R+q[3],C+q[4]]):(dt[0]==="S"||dt[0]==="s")&&X.push([R,C,R+dt[3]-dt[1],C+dt[4]-dt[2],R+q[1],C+q[2],R+q[3],C+q[4]]),R=R+q[3],C=C+q[4];break;case"a":et=f({rx:q[1],ry:q[2],px:R,py:C,xAxisRotation:q[3],largeArcFlag:q[4],sweepFlag:q[5],cx:R+q[6],cy:C+q[7]}),at=et[et.length-1],et.forEach(function(B,F){F===0?X.push([R,C,B.x1,B.y1,B.x2,B.y2,B.x,B.y]):X.push([et[F-1].x,et[F-1].y,B.x1,B.y1,B.x2,B.y2,B.x,B.y])}),R=at.x,C=at.y;break;case"A":et=f({rx:q[1],ry:q[2],px:R,py:C,xAxisRotation:q[3],largeArcFlag:q[4],sweepFlag:q[5],cx:q[6],cy:q[7]}),at=et[et.length-1],et.forEach(function(B,F){F===0?X.push([R,C,B.x1,B.y1,B.x2,B.y2,B.x,B.y]):X.push([et[F-1].x,et[F-1].y,B.x1,B.y1,B.x2,B.y2,B.x,B.y])}),R=at.x,C=at.y;break;case"Q":X.push(A.q2b(R,C,q[1],q[2],q[3],q[4])),R=q[3],C=q[4];break;case"q":X.push(A.q2b(R,C,R+q[1],C+q[2],q[3]+R,q[4]+C)),R+=q[3],C+=q[4];break;case"T":dt[0]==="Q"||dt[0]==="q"?(G=R+dt[3]-dt[1],Q=C+dt[4]-dt[2],X.push(A.q2b(R,C,G,Q,q[1],q[2]))):(dt[0]==="T"||dt[0]==="t")&&(X.push(A.q2b(R,C,R+R-G,C+C-Q,q[1],q[2])),G=R+R-G,Q=C+C-Q),R=q[1],C=q[2];break;case"t":dt[0]==="Q"||dt[0]==="q"?(G=R+dt[3]-dt[1],Q=C+dt[4]-dt[2],X.push(A.q2b(R,C,G,Q,R+q[1],C+q[2]))):(dt[0]==="T"||dt[0]==="t")&&(X.push(A.q2b(R,C,R+R-G,C+C-Q,R+q[1],C+q[2])),G=R+R-G,Q=C+C-Q),R+=q[1],C+=q[2];break;case"Z":Z=X[0][0],j=X[0][1],X.push([R,C,Z,j,Z,j,Z,j]);break;case"z":Z=X[0][0],j=X[0][1],X.push([R,C,Z,j,Z,j,Z,j]);break}}return H},A._upCurves=function(L,D){for(var R=0,C=0,W=L.length;R<D;R++)L.push(L[C].slice(0)),C++,C>W-1&&(C-=W)};function I(L,D,R,C,W,z,H,X,Z){return{left:b(L,D,R,C,W,z,H,X,Z),right:b(H,X,W,z,R,C,L,D,1-Z,!0)}}function b(L,D,R,C,W,z,H,X,Z,j){var G=(R-L)*Z+L,Q=(C-D)*Z+D,tt=(W-R)*Z+R,et=(z-C)*Z+C,at=(H-W)*Z+W,q=(X-z)*Z+z,pt=(tt-G)*Z+G,dt=(et-Q)*Z+Q,B=(at-tt)*Z+tt,F=(q-et)*Z+et,V=(B-pt)*Z+pt,J=(F-dt)*Z+dt;return j?[V,J,pt,dt,G,Q,L,D]:[L,D,G,Q,pt,dt,V,J]}A._splitCurves=function(L,D){for(var R=0,C=0;R<D;R++){var W=L[C],z=I(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],.5);L.splice(C,1),L.splice(C,0,z.left,z.right),C+=2,C>=L.length-1&&(C=0)}};function E(L,D){for(var R=function(z){var H=L[L.length-1],X=[];H.forEach(function(Z){X.push(Z.slice(0))}),L.push(X)},C=0;C<D;C++)R()}return A.lerp=function(L,D,R){return A._lerp(A.path2shapes(L),A.path2shapes(D),R)},A.MIM_CURVES_COUNT=100,A._preprocessing=function(L,D){var R=L.length,C=D.length,W=JSON.parse(JSON.stringify(L)),z=JSON.parse(JSON.stringify(D));return R>C?E(z,R-C):R<C&&E(W,C-R),W=h(W,z),W.forEach(function(H,X){var Z=H.length,j=z[X].length;Z>j?Z<A.MIM_CURVES_COUNT?(A._splitCurves(H,A.MIM_CURVES_COUNT-Z),A._splitCurves(z[X],A.MIM_CURVES_COUNT-j)):A._splitCurves(z[X],Z-j):Z<j&&(j<A.MIM_CURVES_COUNT?(A._splitCurves(H,A.MIM_CURVES_COUNT-Z),A._splitCurves(z[X],A.MIM_CURVES_COUNT-j)):A._splitCurves(H,j-Z))}),W.forEach(function(H,X){W[X]=c(H,z[X])}),[W,z]},A._lerp=function(L,D,R){var C=[];return L.forEach(function(W,z){var H=[];W.forEach(function(X,Z){H.push(A.lerpCurve(X,D[z][Z],R))}),C.push(H)}),C},A.animate=function(L){var D=A.path2shapes(L.from),R=A.path2shapes(L.to),C=A._preprocessing(D,R),W=new Date,z=L.end||function(){},H=L.progress||function(){},X=L.begin||function(){},Z=L.easing||function(et){return et},j=null,G=null,Q=L.time;X(D);var tt=function et(){var at=new Date-W;if(at>=Q){G=R,H(G,1),z(G),cancelAnimationFrame(j);return}var q=Z(at/Q);G=A._lerp(C[0],C[1],q),H(G,q),j=requestAnimationFrame(et)};tt()},A})},function(d,r,t){t.r(r),t.d(r,"default",function(){return f});var e=t(71),n=t(221),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);const a=Symbol.for("spritejs_setAttributeDefault"),s=Symbol.for("spritejs_setAttribute"),o=Symbol.for("spritejs_getAttribute");class f extends e.default{constructor(l){super(l),this[a]({d:"",normalize:!1,fillColor:void 0,fillRule:"nonzero",strokeColor:void 0,lineWidth:1,lineJoin:"miter",lineCap:"butt",roundSegments:20,lineDash:void 0,lineDashOffset:0,miterLimit:10,texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0,clipPath:void 0})}get d(){return this[o]("d")}set d(l){this[s]("d",l)}get normalize(){return this[o]("normalize")}set normalize(l){this[s]("normalize",!!l)}get fillColor(){return this[o]("fillColor")}set fillColor(l){this[s]("fillColor",Object(n.parseColor)(l))}get fillRule(){return this[o]("fillRule")}set fillRule(l){if(l!=null&&l!=="nonzero"&&l!=="evenodd")throw new TypeError("Invalid fill rule.");this[s]("fillRule",l)}get strokeColor(){return this[o]("strokeColor")}set strokeColor(l){this[s]("strokeColor",Object(n.parseColor)(l))}get lineWidth(){return this[o]("lineWidth")}set lineWidth(l){this[s]("lineWidth",Object(i.toNumber)(l))}get lineJoin(){return this[o]("lineJoin")}set lineJoin(l){if(l!=null&&l!=="miter"&&l!=="bevel"&&l!=="round")throw new TypeError("Invalid lineJoin type.");this[s]("lineJoin",l)}get lineCap(){return this[o]("lineCap")}set lineCap(l){if(l!=null&&l!=="butt"&&l!=="square"&&l!=="round")throw new TypeError("Invalid lineCap type.");this[s]("lineCap",l)}get lineDash(){return this[o]("lineDash")}set lineDash(l){l=Object(i.toArray)(l,!0),l!=null&&!Array.isArray(l)&&(l=[l]),this[s]("lineDash",l?l.map(i.toNumber):null)}get lineDashOffset(){return this[o]("lineDashOffset")}set lineDashOffset(l){this[s]("lineDashOffset",Object(i.toNumber)(l))}get miterLimit(){return this[o]("miterLimit")}set miterLimit(l){this[s]("miterLimit",Object(i.toNumber)(l))}get roundSegments(){return this[o]("roundSegments")}set roundSegments(l){this[s]("roundSegments",l)}get texture(){return this[o]("texture")}set texture(l){this[s]("texture",l)}get textureRect(){return this[o]("textureRect")}set textureRect(l){this[s]("textureRect",l)}get sourceRect(){return this[o]("sourceRect")}set sourceRect(l){this[s]("sourceRect",l)}get textureRepeat(){return this[o]("textureRepeat")}set textureRepeat(l){this[s]("textureRepeat",!!l)}get clipPath(){return this[o]("clipPath")}set clipPath(l){this[s]("clipPath",l)}}},function(d,r,t){t.r(r),t.d(r,"default",function(){return s});var e=t(226),n=t(213),i=t(230);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o}class s extends e.default{get isVisible(){const{width:f,height:v}=this.attributes;return f>0&&v>0&&super.isVisible}}a(s,"Attr",i.default),n.default.registerNode(s,"rect")},function(d,r,t){t.r(r),t.d(r,"default",function(){return v});var e=t(228),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);const i=Symbol.for("spritejs_setAttributeDefault"),a=Symbol.for("spritejs_setAttribute"),s=Symbol.for("spritejs_getAttribute"),o=Symbol.for("spritejs_declareAlias");function f(l){const{width:p,height:y}=l;return`M0 0L${p} 0L${p} ${y}L0 ${y}Z`}class v extends e.default{constructor(p){super(p),this[i]({width:0,height:0}),this[o]("size")}get d(){return this[s]("d")}set d(p){}get width(){return this[s]("width")}set width(p){if(p=Object(n.toNumber)(p),this[a]("width",p)){const y=f(this);this[a]("d",y)}}get height(){return this[s]("height")}set height(p){if(p=Object(n.toNumber)(p),this[a]("height",p)){const y=f(this);this[a]("d",y)}}get size(){return[this.width,this.height]}set size(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.width=p[0],this.height=p[1]}}},function(d,r,t){t.r(r),t.d(r,"default",function(){return s});var e=t(232),n=t(213),i=t(235);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o}class s extends e.default{get isVisible(){const{sides:f}=this.attributes;return f[0]>0&&f[1]>0&&super.isVisible}}a(s,"Attr",i.default),n.default.registerNode(s,"triangle")},function(d,r,t){t.r(r),t.d(r,"default",function(){return s});var e=t(226),n=t(213),i=t(233);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o}class s extends e.default{get isVisible(){const{points:f}=this.attributes;return f.length>0&&super.isVisible}}a(s,"Attr",i.default),n.default.registerNode(s,"polyline")},function(d,r,t){t.r(r),t.d(r,"default",function(){return l});var e=t(228),n=t(72),i=t(234);t(1).glMatrix.setMatrixArrayType(Array);const a=Symbol.for("spritejs_setAttributeDefault"),s=Symbol.for("spritejs_setAttribute"),o=Symbol.for("spritejs_getAttribute"),f=Symbol.for("spritejs_declareAlias");function v(p){const{points:y,smooth:O,smoothRange:x,close:m}=p,T=[];for(let h=0;h<y.length;h+=2)T.push([y[h],y[h+1]]);let c="";return O?c=Object(i.makeSmoothCurveLine)(T,x):T.length&&(c=`M${T.map(h=>h.join(" ")).join("L")}`),c&&m&&(c+="Z"),c}class l extends e.default{constructor(y){super(y),this[a]({points:[],smooth:!1,smoothRange:[0],closeType:"none"}),this[f]("close")}get d(){return this[o]("d")}set d(y){}get close(){return this.closeType!=="none"}set close(y){y=y?"normal":"none",this.closeType=y}get closeType(){return this[o]("closeType")}set closeType(y){if(y!=null&&y!=="none"&&y!=="normal")throw new TypeError("Invalid closeType type.");if(this[s]("closeType",y)){const O=v(this);this[s]("d",O)}}get smooth(){return this[o]("smooth")}set smooth(y){if(this[s]("smooth",y)){const O=v(this);this[s]("d",O)}}get smoothRange(){return this[o]("smoothRange")}set smoothRange(y){if(y&&!Array.isArray(y)&&(y=[y]),this[s]("smoothRange",y)&&this.smooth){const O=v(this);this[s]("d",O)}}get points(){return this[o]("points")}set points(y){if(y=Object(n.toArray)(y),Array.isArray(y)&&(y=y.reduce((O,x)=>Array.isArray(x)?[...O,...x.map(m=>Object(n.toNumber)(m))]:[...O,Object(n.toNumber)(x)],[])),this[s]("points",y)){const O=v(this);this[s]("d",O)}}}},function(d,r,t){t.r(r),t.d(r,"makeSmoothCurveLine",function(){return e}),t(1).glMatrix.setMatrixArrayType(Array);function e(n,i=[0]){function a(f,v=.168,l=.168){let p,y,O,x;if((n[f].x===n[f+1].x||n[f].y===n[f+1].y)&&(v=0,l=0),f<1?(p=n[0].x+(n[1].x-n[0].x)*v,y=n[0].y+(n[1].y-n[0].y)*v):(p=n[f].x+(n[f+1].x-n[f-1].x)*v,y=n[f].y+(n[f+1].y-n[f-1].y)*v),f>n.length-3){const m=n.length-1;O=n[m].x-(n[m].x-n[m-1].x)*l,x=n[m].y-(n[m].y-n[m-1].y)*l}else O=n[f+1].x-(n[f+2].x-n[f].x)*l,x=n[f+1].y-(n[f+2].y-n[f].y)*l;return[{x:p,y},{x:O,y:x}]}n=n.map(([f,v])=>({x:f,y:v}));let s="",o=0;return n.forEach((f,v)=>{if(v===0)s+=`M${f.x} ${f.y}`;else{for(;v>i[o];)o++;if(o%2){const[l,p]=a(v-1);s+=`C${[l.x,l.y,p.x,p.y,f.x,f.y].join(" ")}`}else s+=`L${f.x} ${f.y}`}}),s}},function(d,r,t){t.r(r),t.d(r,"default",function(){return f});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);const i=Symbol.for("spritejs_setAttributeDefault"),a=Symbol.for("spritejs_setAttribute"),s=Symbol.for("spritejs_getAttribute");function o(v){const[l,p]=v.sides;let y=v.angle%360;return y<0&&(y+=360),y=Math.PI*y/180,[0,0,l,0,p*Math.cos(y),p*Math.sin(y)]}class f extends e.default{constructor(l){super(l),this[i]({sides:[0,0],angle:60,closeType:"normal"})}get points(){return super.points}set points(l){}get sides(){return this[s]("sides")}set sides(l){if(l=Object(n.toArray)(l,!0),l!=null&&!Array.isArray(l)&&(l=[l,l]),this[a]("sides",l)){const p=o(this);super.points=p}}get angle(){return this[s]("angle")}set angle(l){if(l=Object(n.toNumber)(l),this[a]("angle",l)){const p=o(this);super.points=p}}}},function(d,r,t){t.r(r),t.d(r,"default",function(){return s});var e=t(232),n=t(213),i=t(237);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o}class s extends e.default{get isVisible(){const{sides:f}=this.attributes;return f[0]>0&&f[1]>0&&super.isVisible}}a(s,"Attr",i.default),n.default.registerNode(s,"parallel")},function(d,r,t){t.r(r),t.d(r,"default",function(){return f});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);const i=Symbol.for("spritejs_setAttributeDefault"),a=Symbol.for("spritejs_setAttribute"),s=Symbol.for("spritejs_getAttribute");function o(v){const[l,p]=v.sides;let y=v.angle%360;y<0&&(y+=360),y=Math.PI*y/180;const O=p*Math.cos(y),x=p*Math.sin(y);return[0,0,l,0,O+l,x,O,x]}class f extends e.default{constructor(l){super(l),this[i]({sides:[0,0],angle:90,closeType:"normal"})}get points(){return super.points}set points(l){}get sides(){return this[s]("sides")}set sides(l){if(l=Object(n.toArray)(l,!0),l!=null&&!Array.isArray(l)&&(l=[l,l]),this[a]("sides",l)){const p=o(this);super.points=p}}get angle(){return this[s]("angle")}set angle(l){if(l=Object(n.toNumber)(l),this[a]("angle",l)){const p=o(this);super.points=p}}}},function(d,r,t){t.r(r),t.d(r,"default",function(){return s});var e=t(232),n=t(213),i=t(239);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o}class s extends e.default{}a(s,"Attr",i.default),n.default.registerNode(s,"regular")},function(d,r,t){t.r(r),t.d(r,"default",function(){return f});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);const i=Symbol.for("spritejs_setAttributeDefault"),a=Symbol.for("spritejs_setAttribute"),s=Symbol.for("spritejs_getAttribute");function o(v){const{edges:l,radius:p,offsetAngle:y}=v,O=Math.PI*y/180-.5*Math.PI;if(l<3||p<=0)return[];const x=[];for(let m=0;m<l;m++){const T=m*2*Math.PI/l+O,c=p*Math.cos(T),h=p*Math.sin(T);x.push(c,h)}return x}class f extends e.default{constructor(l){super(l),this[i]({edges:3,radius:0,offsetAngle:0,closeType:"normal"})}get points(){return super.points}set points(l){}get edges(){return this[s]("edges")}set edges(l){if(l=Object(n.toNumber)(l),this[a]("edges",l)){const p=o(this);super.points=p}}get radius(){return this[s]("radius")}set radius(l){if(l=Object(n.toNumber)(l),this[a]("radius",l)){const p=o(this);super.points=p}}get offsetAngle(){return this[s]("offsetAngle")}set offsetAngle(l){if(l=Object(n.toNumber)(l),this[a]("offsetAngle",l)){const p=o(this);super.points=p}}}},function(d,r,t){t.r(r),t.d(r,"default",function(){return s});var e=t(232),n=t(213),i=t(241);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o}class s extends e.default{}a(s,"Attr",i.default),n.default.registerNode(s,"star")},function(d,r,t){t.r(r),t.d(r,"default",function(){return f});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);const i=Symbol.for("spritejs_setAttributeDefault"),a=Symbol.for("spritejs_setAttribute"),s=Symbol.for("spritejs_getAttribute");function o(v){const{angles:l,innerRadius:p,outerRadius:y,offsetAngle:O}=v,x=Math.PI*O/180-.5*Math.PI;if(l<3||p<=0||y<=0)return[];const m=[];for(let T=0;T<l*2;T++){const c=T*Math.PI/l+x,h=T%2?p:y,u=h*Math.cos(c),g=h*Math.sin(c);m.push(u,g)}return m}class f extends e.default{constructor(l){super(l),this[i]({angles:5,innerRadius:0,outerRadius:0,offsetAngle:0,closeType:"normal"})}get points(){return super.points}set points(l){}get angles(){return this[s]("angles")}set angles(l){if(l=Object(n.toNumber)(l),this[a]("angles",l)){const p=o(this);super.points=p}}get innerRadius(){return this[s]("innerRadius")}set innerRadius(l){if(l=Object(n.toNumber)(l),this[a]("innerRadius",l)){const p=o(this);super.points=p}}get outerRadius(){return this[s]("outerRadius")}set outerRadius(l){if(l=Object(n.toNumber)(l),this[a]("outerRadius",l)){const p=o(this);super.points=p}}get radius(){return[this.innerRadius,this.outerRadius]}set radius(l){l=Object(n.toArray)(l,!0),Array.isArray(l)||(l=[l,l]),this.innerRadius=l[0],this.outerRadius=l[1]}get offsetAngle(){return this[s]("offsetAngle")}set offsetAngle(l){if(l=Object(n.toNumber)(l),this[a]("offsetAngle",l)){const p=o(this);super.points=p}}}},function(d,r,t){t.r(r),t.d(r,"default",function(){return s});var e=t(226),n=t(213),i=t(243);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o}class s extends e.default{get isVisible(){const{radiusX:f,radiusY:v,startAngle:l,endAngle:p}=this.attributes;return f>0&&v>0&&l!==p&&super.isVisible}}a(s,"Attr",i.default),n.default.registerNode(s,"ellipse")},function(d,r,t){t.r(r),t.d(r,"default",function(){return l});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);const a=Symbol.for("spritejs_setAttributeDefault"),s=Symbol.for("spritejs_setAttribute"),o=Symbol.for("spritejs_getAttribute"),f=Symbol.for("spritejs_declareAlias");function v(p){const{radiusX:y,radiusY:O,startAngle:x,endAngle:m,direction:T,closeType:c}=p,h=T==="anitclockwise",u=new e.Figure2D;return c==="sector"&&u.moveTo(0,0),u.ellipse(0,0,y,O,0,Math.PI*x/180,Math.PI*m/180,h),c!=="none"&&u.closePath(),u.path.reduce((A,I)=>A+I.join(" "),"")}class l extends n.default{constructor(y){super(y),this[a]({radiusX:0,radiusY:0,startAngle:0,endAngle:360,direction:"clockwise",closeType:"none"}),this[f]("radius","angle")}get d(){return this[o]("d")}set d(y){}get radiusX(){return this[o]("radiusX")}set radiusX(y){if(y=Object(i.toNumber)(y),this[s]("radiusX",y)){const O=v(this);this[s]("d",O)}}get radiusY(){return this[o]("radiusY")}set radiusY(y){if(y=Object(i.toNumber)(y),this[s]("radiusY",y)){const O=v(this);this[s]("d",O)}}get radius(){return[this.radiusX,this.radiusY]}set radius(y){y=Object(i.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this.radiusX=y[0],this.radiusY=y[1]}get angle(){return[this.startAngle,this.endAngle]}set angle(y){y=Object(i.toArray)(y),Array.isArray(y)||(y=[y,y]),this.startAngle=y[0],this.endAngle=y[1]}get direction(){return this[o]("direction")}set direction(y){if(y!=null&&y!=="clockwise"&&y!=="anticlockwise")throw new TypeError("Invalid direction type.");this[s]("direction",y)}get startAngle(){return this[o]("startAngle")}set startAngle(y){if(y=Object(i.toNumber)(y),this[s]("startAngle",y)){const O=v(this);this[s]("d",O)}}get endAngle(){return this[o]("endAngle")}set endAngle(y){if(y=Object(i.toNumber)(y),this[s]("endAngle",y)){const O=v(this);this[s]("d",O)}}get closeType(){return this[o]("closeType")}set closeType(y){if(y!=null&&y!=="none"&&y!=="sector"&&y!=="normal")throw new TypeError("Invalid closeType type.");if(this[s]("closeType",y)){const O=v(this);this[s]("d",O)}}}},function(d,r,t){t.r(r),t.d(r,"default",function(){return s});var e=t(242),n=t(213),i=t(245);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o}class s extends e.default{}a(s,"Attr",i.default),n.default.registerNode(s,"arc")},function(d,r,t){t.r(r),t.d(r,"default",function(){return i});var e=t(243),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);class i extends e.default{get radius(){return super.radiusX}set radius(s){s=Object(n.toNumber)(s),super.radiusX=s,super.radiusY=s}}},function(d,r,t){t.r(r),t.d(r,"default",function(){return s});var e=t(226),n=t(213),i=t(247);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o}class s extends e.default{get isVisible(){const{innerRadius:f,outerRadius:v,startAngle:l,endAngle:p}=this.attributes;return(f>0||v>0)&&l!==p&&super.isVisible}}a(s,"Attr",i.default),n.default.registerNode(s,"ring")},function(d,r,t){t.r(r),t.d(r,"default",function(){return l});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);const a=Symbol.for("spritejs_setAttributeDefault"),s=Symbol.for("spritejs_setAttribute"),o=Symbol.for("spritejs_getAttribute"),f=Symbol.for("spritejs_declareAlias");function v(p){let{innerRadius:y,outerRadius:O,startAngle:x,endAngle:m}=p;const T=new e.Figure2D;if(x=Math.PI*x/180,m=Math.PI*m/180,y>O&&([y,O]=[O,y]),y<=0&&T.moveTo(0,0),T.arc(0,0,O,x,m,!1),y>0){const u=Math.PI*2;m<x&&(m=x+u+(m-x)%u),m-x>=u&&(m=x+u-1e-6),T.arc(0,0,y,m,x,!0)}return T.closePath(),T.path.reduce((u,g)=>u+g.join(" "),"")}class l extends n.default{constructor(y){super(y),this[a]({innerRadius:0,outerRadius:0,startAngle:0,endAngle:360}),this[f]("radius","angle")}get d(){return this[o]("d")}set d(y){}get innerRadius(){return this[o]("innerRadius")}set innerRadius(y){if(y=Object(i.toNumber)(y),this[s]("innerRadius",y)){const O=v(this);this[s]("d",O)}}get outerRadius(){return this[o]("outerRadius")}set outerRadius(y){if(y=Object(i.toNumber)(y),this[s]("outerRadius",y)){const O=v(this);this[s]("d",O)}}get radius(){return[this.innerRadius,this.outerRadius]}set radius(y){y=Object(i.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this.innerRadius=y[0],this.outerRadius=y[1]}get startAngle(){return this[o]("startAngle")}set startAngle(y){if(y=Object(i.toNumber)(y),this[s]("startAngle",y)){const O=v(this);this[s]("d",O)}}get endAngle(){return this[o]("endAngle")}set endAngle(y){if(y=Object(i.toNumber)(y),this[s]("endAngle",y)){const O=v(this);this[s]("d",O)}}get angle(){return[this.startAngle,this.endAngle]}set angle(y){y=Object(i.toArray)(y),Array.isArray(y)||(y=[y,y]),this.startAngle=y[0],this.endAngle=y[1]}}},function(d,r,t){t.r(r),t.d(r,"default",function(){return O});var e=t(12),n=t(218),i=t(219),a=t(249),s=t(213);t(1).glMatrix.setMatrixArrayType(Array);function o(x,m,T){return m in x?Object.defineProperty(x,m,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[m]=T,x}const f=Symbol("textImage"),v=Symbol("textImageTask"),l=Symbol("textureContext"),p=Symbol("updateTextureRect"),y=Symbol("textCanvas");class O extends i.default{constructor(m={}){typeof m=="string"&&(m={text:m}),super(m)}get contentSize(){let[m,T]=super.contentSize;const{width:c,height:h}=this.attributes;if(c==null||h==null){const u=this[f];u&&(c==null&&(m=u.rect[2]),h==null&&(T=u.rect[3]))}return[m,T]}get text(){return this.attributes.text}set text(m){this.attributes.text=m}get textContent(){return this.attributes.text}set textContent(m){this.attributes.text=m}get textImage(){return this[f]||{}}get textImageReady(){return this[v]||Promise.resolve()}draw(m){super.draw(m);const T=this.mesh;if(T){const c=this[f];if(c){let h=T.texture;if(!h||this[l]&&this[l]!==this.renderer||c.needsUpdate?(c.needsUpdate=!1,Object(n.deleteTexture)(c.image,this.renderer),h=Object(n.createTexture)(c.image,this.renderer),this[p]=!0):h=T.uniforms.u_texSampler,this[p]){const[u,g]=c.rect.slice(2),[M,A]=this.contentSize,I=this.attributes.textAlign,b=this.attributes.verticalAlign;let E=0;I==="center"?E=(M-u)/2:(I==="right"||I==="end")&&(E=M-u);const L=this.attributes.fontSize,D=this.attributes.lineHeight;let R=0;b==="top"?R=(L-D)/2:b==="bottom"&&(R=(D-L)/2);const{paddingLeft:C,paddingTop:W}=this.attributes,{borderWidth:z}=this.attributes;E+=C+z,R+=W+z;const{anchorX:H,anchorY:X}=this.attributes;E-=this.offsetSize[0]*H,R-=this.offsetSize[1]*X,T.setTexture(h,{rect:[E,R,u,g]}),this[p]=!1,this[l]=this.renderer}}}return m}onPropertyChange(m,T,c){m==="text"||m==="fontSize"||m==="fontFamily"||m==="fontStyle"||m==="fontVariant"||m==="fontWeight"||m==="fontStretch"||m==="lineHeight"||m==="strokeColor"||m==="fillColor"||m==="strokeWidth"?this.updateText():((m==="textAlign"||m==="verticalAlign")&&(this[p]=!0),super.onPropertyChange(m,T,c))}updateContours(){super.updateContours(),this[p]=!0}updateText(){this[v]||(this[v]=Promise.resolve().then(()=>{this[v]=null;const{text:m,font:T,fillColor:c,strokeColor:h,strokeWidth:u}=this.attributes,g=this.layer?this.layer.displayRatio:1;return this[y]=this[y]||e.ENV.createCanvas(1,1),this[f]=e.ENV.createText(m,{font:T,fillColor:c,strokeColor:h,strokeWidth:u,parseFont:e.parseFont,ratio:g,textCanvas:this[y]}),this[f].needsUpdate=!0,this.updateContours(),this.forceUpdate(),this[f]}))}}o(O,"Attr",a.default),s.default.registerNode(O,"label")},function(d,r,t){t.r(r),t.d(r,"default",function(){return l});var e=t(12),n=t(72),i=t(221),a=t(220);t(1).glMatrix.setMatrixArrayType(Array);const s=Symbol.for("spritejs_setAttributeDefault"),o=Symbol.for("spritejs_setAttribute"),f=Symbol.for("spritejs_getAttribute"),v=Symbol.for("spritejs_declareAlias");class l extends a.default{constructor(y){super(y),this[s]({text:"",fontSize:16,fontFamily:"Helvetica,Arial,sans-serif",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fontStretch:"normal",lineHeight:"",textAlign:"left",strokeColor:void 0,strokeWidth:1,fillColor:void 0,verticalAlign:"middle"}),this[v]("font")}get text(){return this[f]("text")||" "}set text(y){this[o]("text",y)}get fontSize(){return this[f]("fontSize")}set fontSize(y){this[o]("fontSize",Object(n.toNumber)(y))}get fontFamily(){return this[f]("fontFamily")}set fontFamily(y){this[o]("fontFamily",y)}get fontStyle(){return this[f]("fontStyle")}set fontStyle(y){this[o]("fontStyle",y)}get fontVariant(){return this[f]("fontVariant")}set fontVariant(y){this[o]("fontVariant",y)}get fontWeight(){return this[f]("fontWeight")}set fontWeight(y){this[o]("fontWeight",y)}get fontStretch(){return this[f]("fontStretch")}set fontStretch(y){this[o]("fontStretch",y)}get lineHeight(){return this[f]("lineHeight")||this.fontSize}set lineHeight(y){this[o]("lineHeight",Object(n.toNumber)(y))}get textAlign(){return this[f]("textAlign")}set textAlign(y){this[o]("textAlign",y)}get strokeColor(){return this[f]("strokeColor")}set strokeColor(y){this[o]("strokeColor",Object(i.parseColor)(y))}get strokeWidth(){return this[f]("strokeWidth")}set strokeWidth(y){this[o]("strokeWidth",Object(n.toNumber)(y))}get verticalAlign(){return this[f]("verticalAlign")}set verticalAlign(y){this[o]("verticalAlign",y)}get fillColor(){return this[f]("fillColor")}set fillColor(y){this[o]("fillColor",Object(i.parseColor)(y))}get font(){const{fontStyle:y,fontVariant:O,fontWeight:x,fontStretch:m,fontSize:T,lineHeight:c,fontFamily:h}=this;return`${y} ${O} ${x} ${m} ${T}px/${c}px ${h}`}set font(y){if(y==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{const O=Object(e.parseFont)(y);this.fontStyle=O.style,this.fontVariant=O.variant,this.fontWeight=O.weight,this.fontStretch=O.stretch,this.fontSize=Object(n.toNumber)(`${O.size}${O.unit}`),O.lineHeight&&(this.lineHeight=O.pxLineHeight),this.fontFamily=O.family}}}},function(d,r,t){t.r(r),t.d(r,"default",function(){return y});var e=t(12),n=t(219),i=t(251),a=t(213),s=t(252);t(1).glMatrix.setMatrixArrayType(Array);function o(O,x,m){return x in O?Object.defineProperty(O,x,{value:m,enumerable:!0,configurable:!0,writable:!0}):O[x]=m,O}const f=Symbol("zOrder"),v=Symbol("ordered"),l=Symbol("children"),p=Symbol("sealed");class y extends n.default{constructor(x={}){super(x),this[l]=[],this[v]=null,this[f]=0}get childNodes(){return this[l]}get children(){return this[l]}get orderedChildren(){return this[v]||(this[v]=[...this[l]],this[v].sort((x,m)=>x.zIndex-m.zIndex||x.zOrder-m.zOrder)),this[v]}append(...x){return x.map(m=>this.appendChild(m))}appendChild(x){return x.remove(),this[l].push(x),x.connect(this,this[f]++),this[v]&&(this[v].length&&x.zIndex<this[v][this[v].length-1].zIndex?this.reorder():this[v].push(x)),x}cloneNode(x=!1){const m=super.cloneNode();return x&&this[l].forEach(T=>{const c=T.cloneNode(x);m.appendChild(c)}),m}dispatchPointerEvent(x){const m=this.orderedChildren;for(let T=m.length-1;T>=0;T--)if(m[T].dispatchPointerEvent(x))return!0;return super.dispatchPointerEvent(x)}draw(x=[]){if(this.__cacheRenderMatrix=this.renderMatrix,super.draw(x),!this[p]&&this.attributes.display!=="none"){const m=this.orderedChildren;for(let T=0;T<m.length;T++)m[T].draw(x)}return this.__cacheRenderMatrix=null,x}getElementById(x){return Object(s.querySelector)(`#${x}`,this)}getElementsByClassName(x){return Object(s.querySelectorAll)(`.${x}`,this)}getElementsByName(x){return Object(s.querySelectorAll)(`[name="${x}"]`,this)}getElementsByTagName(x){return Object(s.querySelectorAll)(x,this)}insertBefore(x,m){if(m==null)return this.appendChild(x);x.remove();const T=this[l].indexOf(m);if(T<0)throw new Error("Invalid reference node.");const c=m.zOrder;for(let h=T;h<this[l].length;h++){const u=this[l][h].zOrder,g=this[l][h];delete g.zOrder,Object.defineProperty(g,"zOrder",{value:u+1,writable:!1,configurable:!0})}if(this[l].splice(T,0,x),x.connect(this,c),this[v])if(x.zIndex!==m.zIndex)this.reorder();else{const h=this[v].indexOf(m);this[v].splice(h,0,x)}return x}querySelector(x){return Object(s.querySelector)(x,this)}querySelectorAll(x){return Object(s.querySelectorAll)(x,this)}replaceChild(x,m){x.remove();const T=this[l].indexOf(m);if(T<0)throw new Error("Invalid reference node.");if(this[l][T]=x,x.connect(this,m.zOrder),this[v])if(x.zIndex!==m.zIndex)this.reorder();else{const c=this[v].indexOf(m);this[v][c]=x}return m.disconnect(this),x}removeAllChildren(){const x=this[l];for(let m=x.length-1;m>=0;m--)x[m].remove()}removeChild(x){const m=this[l].indexOf(x);if(m>=0){if(this[l].splice(m,1),this[v]){const T=this[v].indexOf(x);this[v].splice(T,1)}return x.disconnect(this),x}return null}reorder(){this[v]=null}seal(){function x(h,u){const g=[];for(let M=0;M<h.length;M++){const A=[...h[M]];for(let I=1;I<A.length;I+=2){const b=A[I],E=A[I+1];A[I]=b*u[0]+E*u[2]+u[4],A[I+1]=b*u[1]+E*u[3]+u[5]}g.push(A)}return g}const m=this.orderedChildren,T=new e.Figure2D,c=this.localMatrix;for(let h=0;h<m.length;h++){let u=m[h];if(u instanceof y&&(u=u.seal()),u.clientBox){let g=u.clientBox.contours.path;g=x(g,u.localMatrix),T.addPath(g)}if(u.path){let g=u.path.contours.path;g=x(g,u.localMatrix),T.addPath(g)}}return this[p]=!0,this.clientBox=T,{clientBox:T,localMatrix:c}}setResolution({width:x,height:m}){super.setResolution({width:x,height:m}),this[l].forEach(T=>{T.setResolution({width:x,height:m})})}updateContours(){this[p]||super.updateContours()}}o(y,"Attr",i.default),a.default.registerNode(y,"group")},function(d,r,t){t.r(r),t.d(r,"default",function(){return n});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);class n extends e.default{}},function(d,r,t){t.r(r),t.d(r,"querySelectorAll",function(){return p}),t.d(r,"querySelector",function(){return y}),t.d(r,"isMatched",function(){return O}),t.d(r,"compile",function(){return x});var e=t(221),n=t(213);t(1).glMatrix.setMatrixArrayType(Array);const i=t(253);function a(m){return m.nodeType===1||n.default.isSpriteNode(m.nodeName)}function s(m){return Array.from(m.childNodes||[])}function o(m){return n.default.isSpriteNode(m.nodeName)?m.parent||m.canvas||m.container:m.parentElement}function f(m){let T=m.length,c,h,u;for(;--T>-1;){for(c=h=m[T],m[T]=null,u=!0;h;){if(m.indexOf(h)>-1){u=!1,m.splice(T,1);break}h=o(h)}u&&(m[T]=c)}return m}const v={isTag:a,existsOne(m,T){return T.some(c=>a(c)?m(c)||v.existsOne(m,s(c)):!1)},getSiblings(m){const T=o(m);return T&&s(T)},getChildren:s,getParent:o,getAttributeValue(m,T){if(m.nodeType===1&&T==="class"||T==="id")return m[T];if(this.hasAttrib(m,T)){let c=m.attributes[T];return Array.isArray(c)&&(c=`[${c.join()}]`),String(c)}},hasAttrib(m,T){return m.attributes[T]!=null},removeSubsets:f,getName(m){return m.tagName?m.tagName.toLowerCase():null},findOne:function m(T,c){let h=null;for(let u=0,g=c.length;u<g&&!h;u++)if(T(c[u]))h=c[u];else{const M=s(c[u]);M&&M.length>0&&(h=m(T,M))}return h},findAll:function m(T,c){let h=[];for(let u=0,g=c.length;u<g;u++){if(!a(c[u]))continue;T(c[u])&&h.push(c[u]);const M=s(c[u]);M&&(h=h.concat(m(T,M)))}return h},getText:function m(T){return Array.isArray(T)?T.map(m).join(""):a(T)?m(s(T)):T.nodeType===3?T.nodeValue:n.default.isSpriteNode(T.nodeName)?T.text:""}};function l(m){if(typeof m!="string")return m;let T=m.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return T&&(T=T.map(c=>{const h=c.slice(1,-1).split("="),u=Object(e.parseColor)(h[1].replace(/['"]/g,""));return[c,`[${h[0]}="${u}"]`]}),T.forEach(([c,h])=>{m=m.replace(c,h)})),T=m.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),T&&(T=T.map(c=>{const h=c.slice(1,-1).split("="),u=h[1].slice(2,-2).split(/,/g).map(g=>g.trim());return[c,`[${h[0]}="[${u}]"]`]}),T.forEach(([c,h])=>{m=m.replace(c,h)})),m}function p(m,T){return i.selectAll(l(m),T,{adapter:v})}function y(m,T){return i.selectOne(l(m),T,{adapter:v})}function O(m,T){return i.is(m,l(T),{adapter:v})}function x(m){return i.compile(l(m),{adapter:v})}},function(d,r,t){d.exports=x;var e=t(254),n=t(273).falseFunc,i=t(274);function a(m){return function(c,h,u){return h=h||{},h.adapter=h.adapter||e,m(c,h,u)}}var s=a(i),o=a(i.compileUnsafe);function f(m){return function(c,h,u){return u=u||{},u.adapter=u.adapter||e,typeof c!="function"&&(c=o(c,u,h)),c.shouldTestNextSiblings&&(h=l(u&&u.context||h,u.adapter)),Array.isArray(h)?h=u.adapter.removeSubsets(h):h=u.adapter.getChildren(h),m(c,h,u)}}function v(m,T){var c=T.getSiblings(m);if(!Array.isArray(c))return[];for(c=c.slice(0);c.shift()!==m;);return c}function l(m,T){Array.isArray(m)||(m=[m]);for(var c=m.slice(0),h=0,u=m.length;h<u;h++){var g=v(c[h],T);c.push.apply(c,g)}return c}var p=f(function(T,c,h){return T===n||!c||c.length===0?[]:h.adapter.findAll(T,c)}),y=f(function(T,c,h){return T===n||!c||c.length===0?null:h.adapter.findOne(T,c)});function O(m,T,c){return c=c||{},c.adapter=c.adapter||e,(typeof T=="function"?T:s(T,c))(m)}function x(m,T,c){return p(m,T,c)}x.compile=s,x.filters=i.Pseudos.filters,x.pseudos=i.Pseudos.pseudos,x.selectAll=p,x.selectOne=y,x.is=O,x.parse=s,x.iterate=p,x._compileUnsafe=o,x._compileToken=i.compileToken},function(d,r,t){var e=d.exports;[t(255),t(268),t(269),t(270),t(271),t(272)].forEach(function(n){Object.keys(n).forEach(function(i){e[i]=n[i].bind(e)})})},function(d,r,t){var e=t(256),n=t(257),i=e.isTag;d.exports={getInnerHTML:a,getOuterHTML:n,getText:s};function a(o,f){return o.children?o.children.map(function(v){return n(v,f)}).join(""):""}function s(o){return Array.isArray(o)?o.map(s).join(""):i(o)?o.name==="br"?`
|
|
565
|
-
`:s(o.children):o.type===e.CDATA?s(o.children):o.type===e.Text?o.data:""}},function(d,r){d.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",Doctype:"doctype",isTag:function(t){return t.type==="tag"||t.type==="script"||t.type==="style"}}},function(d,r,t){var e=t(258),n=t(259),i=t(267);i.elementNames.__proto__=null,i.attributeNames.__proto__=null;var a={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0};function s(m,T){if(m){var c="",h;for(var u in m)h=m[u],c&&(c+=" "),T.xmlMode==="foreign"&&(u=i.attributeNames[u]||u),c+=u,(h!==null&&h!==""||T.xmlMode)&&(c+='="'+(T.decodeEntities?n.encodeXML(h):h.replace(/\"/g,"""))+'"');return c}}var o={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},f=d.exports=function(m,T){!Array.isArray(m)&&!m.cheerio&&(m=[m]),T=T||{};for(var c="",h=0;h<m.length;h++){var u=m[h];u.type==="root"?c+=f(u.children,T):e.isTag(u)?c+=l(u,T):u.type===e.Directive?c+=p(u):u.type===e.Comment?c+=x(u):u.type===e.CDATA?c+=O(u):c+=y(u,T)}return c},v=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function l(m,T){T.xmlMode==="foreign"&&(m.name=i.elementNames[m.name]||m.name,m.parent&&v.indexOf(m.parent.name)>=0&&(T=Object.assign({},T,{xmlMode:!1}))),!T.xmlMode&&["svg","math"].indexOf(m.name)>=0&&(T=Object.assign({},T,{xmlMode:"foreign"}));var c="<"+m.name,h=s(m.attribs,T);return h&&(c+=" "+h),T.xmlMode&&(!m.children||m.children.length===0)?c+="/>":(c+=">",m.children&&(c+=f(m.children,T)),(!o[m.name]||T.xmlMode)&&(c+="</"+m.name+">")),c}function p(m){return"<"+m.data+">"}function y(m,T){var c=m.data||"";return T.decodeEntities&&!(m.parent&&m.parent.name in a)&&(c=n.encodeXML(c)),c}function O(m){return"<![CDATA["+m.children[0].data+"]]>"}function x(m){return"<!--"+m.data+"-->"}},function(d,r,t){Object.defineProperty(r,"__esModule",{value:!0});function e(n){return n.type==="tag"||n.type==="script"||n.type==="style"}r.isTag=e,r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"},function(d,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.encode=r.decodeStrict=r.decode=void 0;var e=t(260),n=t(266);function i(v,l){return(!l||l<=0?e.decodeXML:e.decodeHTML)(v)}r.decode=i;function a(v,l){return(!l||l<=0?e.decodeXML:e.decodeHTMLStrict)(v)}r.decodeStrict=a;function s(v,l){return(!l||l<=0?n.encodeXML:n.encodeHTML)(v)}r.encode=s;var o=t(266);Object.defineProperty(r,"encodeXML",{enumerable:!0,get:function(){return o.encodeXML}}),Object.defineProperty(r,"encodeHTML",{enumerable:!0,get:function(){return o.encodeHTML}}),Object.defineProperty(r,"escape",{enumerable:!0,get:function(){return o.escape}}),Object.defineProperty(r,"encodeHTML4",{enumerable:!0,get:function(){return o.encodeHTML}}),Object.defineProperty(r,"encodeHTML5",{enumerable:!0,get:function(){return o.encodeHTML}});var f=t(260);Object.defineProperty(r,"decodeXML",{enumerable:!0,get:function(){return f.decodeXML}}),Object.defineProperty(r,"decodeHTML",{enumerable:!0,get:function(){return f.decodeHTML}}),Object.defineProperty(r,"decodeHTMLStrict",{enumerable:!0,get:function(){return f.decodeHTMLStrict}}),Object.defineProperty(r,"decodeHTML4",{enumerable:!0,get:function(){return f.decodeHTML}}),Object.defineProperty(r,"decodeHTML5",{enumerable:!0,get:function(){return f.decodeHTML}}),Object.defineProperty(r,"decodeHTML4Strict",{enumerable:!0,get:function(){return f.decodeHTMLStrict}}),Object.defineProperty(r,"decodeHTML5Strict",{enumerable:!0,get:function(){return f.decodeHTMLStrict}}),Object.defineProperty(r,"decodeXMLStrict",{enumerable:!0,get:function(){return f.decodeXML}})},function(d,r,t){var e=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeHTML=r.decodeHTMLStrict=r.decodeXML=void 0;var n=e(t(261)),i=e(t(262)),a=e(t(263)),s=e(t(264));r.decodeXML=o(a.default),r.decodeHTMLStrict=o(n.default);function o(l){var p=Object.keys(l).join("|"),y=v(l);p+="|#[xX][\\da-fA-F]+|#\\d+";var O=new RegExp("&(?:"+p+");","g");return function(x){return String(x).replace(O,y)}}var f=function(l,p){return l<p?1:-1};r.decodeHTML=function(){for(var l=Object.keys(i.default).sort(f),p=Object.keys(n.default).sort(f),y=0,O=0;y<p.length;y++)l[O]===p[y]?(p[y]+=";?",O++):p[y]+=";";var x=new RegExp("&(?:"+p.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),m=v(n.default);function T(c){return c.substr(-1)!==";"&&(c+=";"),m(c)}return function(c){return String(c).replace(x,T)}}();function v(l){return function(y){if(y.charAt(1)==="#"){var O=y.charAt(2);return O==="X"||O==="x"?s.default(parseInt(y.substr(3),16)):s.default(parseInt(y.substr(2),10))}return l[y.slice(1,-1)]}}},function(d){d.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"","InvisibleTimes":"","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"","NegativeThickSpace":"","NegativeThinSpace":"","NegativeVeryThinSpace":"","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":" ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"","zwnj":""}')},function(d){d.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}')},function(d){d.exports=JSON.parse(`{"amp":"&","apos":"'","gt":">","lt":"<","quot":"\\""}`)},function(d,r,t){var e=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(r,"__esModule",{value:!0});var n=e(t(265));function i(a){if(a>=55296&&a<=57343||a>1114111)return"�";a in n.default&&(a=n.default[a]);var s="";return a>65535&&(a-=65536,s+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),s+=String.fromCharCode(a),s}r.default=i},function(d){d.exports=JSON.parse('{"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}')},function(d,r,t){var e=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(r,"__esModule",{value:!0}),r.escape=r.encodeHTML=r.encodeXML=void 0;var n=e(t(263)),i=v(n.default),a=l(i);r.encodeXML=O(i,a);var s=e(t(261)),o=v(s.default),f=l(o);r.encodeHTML=O(o,f);function v(T){return Object.keys(T).sort().reduce(function(c,h){return c[T[h]]="&"+h+";",c},{})}function l(T){for(var c=[],h=[],u=0,g=Object.keys(T);u<g.length;u++){var M=g[u];M.length===1?c.push("\\"+M):h.push(M)}c.sort();for(var A=0;A<c.length-1;A++){for(var I=A;I<c.length-1&&c[I].charCodeAt(1)+1===c[I+1].charCodeAt(1);)I+=1;var b=1+I-A;b<3||c.splice(A,b,c[A]+"-"+c[I])}return h.unshift("["+c.join("")+"]"),new RegExp(h.join("|"),"g")}var p=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function y(T){return"&#x"+T.codePointAt(0).toString(16).toUpperCase()+";"}function O(T,c){return function(h){return h.replace(c,function(u){return T[u]}).replace(p,y)}}var x=l(i);function m(T){return T.replace(x,y).replace(p,y)}r.escape=m},function(d){d.exports=JSON.parse('{"elementNames":{"altglyph":"altGlyph","altglyphdef":"altGlyphDef","altglyphitem":"altGlyphItem","animatecolor":"animateColor","animatemotion":"animateMotion","animatetransform":"animateTransform","clippath":"clipPath","feblend":"feBlend","fecolormatrix":"feColorMatrix","fecomponenttransfer":"feComponentTransfer","fecomposite":"feComposite","feconvolvematrix":"feConvolveMatrix","fediffuselighting":"feDiffuseLighting","fedisplacementmap":"feDisplacementMap","fedistantlight":"feDistantLight","fedropshadow":"feDropShadow","feflood":"feFlood","fefunca":"feFuncA","fefuncb":"feFuncB","fefuncg":"feFuncG","fefuncr":"feFuncR","fegaussianblur":"feGaussianBlur","feimage":"feImage","femerge":"feMerge","femergenode":"feMergeNode","femorphology":"feMorphology","feoffset":"feOffset","fepointlight":"fePointLight","fespecularlighting":"feSpecularLighting","fespotlight":"feSpotLight","fetile":"feTile","feturbulence":"feTurbulence","foreignobject":"foreignObject","glyphref":"glyphRef","lineargradient":"linearGradient","radialgradient":"radialGradient","textpath":"textPath"},"attributeNames":{"definitionurl":"definitionURL","attributename":"attributeName","attributetype":"attributeType","basefrequency":"baseFrequency","baseprofile":"baseProfile","calcmode":"calcMode","clippathunits":"clipPathUnits","diffuseconstant":"diffuseConstant","edgemode":"edgeMode","filterunits":"filterUnits","glyphref":"glyphRef","gradienttransform":"gradientTransform","gradientunits":"gradientUnits","kernelmatrix":"kernelMatrix","kernelunitlength":"kernelUnitLength","keypoints":"keyPoints","keysplines":"keySplines","keytimes":"keyTimes","lengthadjust":"lengthAdjust","limitingconeangle":"limitingConeAngle","markerheight":"markerHeight","markerunits":"markerUnits","markerwidth":"markerWidth","maskcontentunits":"maskContentUnits","maskunits":"maskUnits","numoctaves":"numOctaves","pathlength":"pathLength","patterncontentunits":"patternContentUnits","patterntransform":"patternTransform","patternunits":"patternUnits","pointsatx":"pointsAtX","pointsaty":"pointsAtY","pointsatz":"pointsAtZ","preservealpha":"preserveAlpha","preserveaspectratio":"preserveAspectRatio","primitiveunits":"primitiveUnits","refx":"refX","refy":"refY","repeatcount":"repeatCount","repeatdur":"repeatDur","requiredextensions":"requiredExtensions","requiredfeatures":"requiredFeatures","specularconstant":"specularConstant","specularexponent":"specularExponent","spreadmethod":"spreadMethod","startoffset":"startOffset","stddeviation":"stdDeviation","stitchtiles":"stitchTiles","surfacescale":"surfaceScale","systemlanguage":"systemLanguage","tablevalues":"tableValues","targetx":"targetX","targety":"targetY","textlength":"textLength","viewbox":"viewBox","viewtarget":"viewTarget","xchannelselector":"xChannelSelector","ychannelselector":"yChannelSelector","zoomandpan":"zoomAndPan"}}')},function(d,r){var t=r.getChildren=function(n){return n.children},e=r.getParent=function(n){return n.parent};r.getSiblings=function(n){var i=e(n);return i?t(i):[n]},r.getAttributeValue=function(n,i){return n.attribs&&n.attribs[i]},r.hasAttrib=function(n,i){return!!n.attribs&&hasOwnProperty.call(n.attribs,i)},r.getName=function(n){return n.name}},function(d,r){r.removeElement=function(t){if(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.parent){var e=t.parent.children;e.splice(e.lastIndexOf(t),1)}},r.replaceElement=function(t,e){var n=e.prev=t.prev;n&&(n.next=e);var i=e.next=t.next;i&&(i.prev=e);var a=e.parent=t.parent;if(a){var s=a.children;s[s.lastIndexOf(t)]=e}},r.appendChild=function(t,e){if(e.parent=t,t.children.push(e)!==1){var n=t.children[t.children.length-2];n.next=e,e.prev=n,e.next=null}},r.append=function(t,e){var n=t.parent,i=t.next;if(e.next=i,e.prev=t,t.next=e,e.parent=n,i){if(i.prev=e,n){var a=n.children;a.splice(a.lastIndexOf(i),0,e)}}else n&&n.children.push(e)},r.prepend=function(t,e){var n=t.parent;if(n){var i=n.children;i.splice(i.lastIndexOf(t),0,e)}t.prev&&(t.prev.next=e),e.parent=n,e.prev=t.prev,e.next=t,t.prev=e}},function(d,r,t){var e=t(256).isTag;d.exports={filter:n,find:i,findOneChild:a,findOne:s,existsOne:o,findAll:f};function n(v,l,p,y){return Array.isArray(l)||(l=[l]),(typeof y!="number"||!isFinite(y))&&(y=1/0),i(v,l,p!==!1,y)}function i(v,l,p,y){for(var O=[],x,m=0,T=l.length;m<T&&!(v(l[m])&&(O.push(l[m]),--y<=0)||(x=l[m].children,p&&x&&x.length>0&&(x=i(v,x,p,y),O=O.concat(x),y-=x.length,y<=0)));m++);return O}function a(v,l){for(var p=0,y=l.length;p<y;p++)if(v(l[p]))return l[p];return null}function s(v,l){for(var p=null,y=0,O=l.length;y<O&&!p;y++)if(e(l[y]))v(l[y])?p=l[y]:l[y].children.length>0&&(p=s(v,l[y].children));else continue;return p}function o(v,l){for(var p=0,y=l.length;p<y;p++)if(e(l[p])&&(v(l[p])||l[p].children.length>0&&o(v,l[p].children)))return!0;return!1}function f(v,l){for(var p=[],y=l.slice();y.length;){var O=y.shift();e(O)&&(O.children&&O.children.length>0&&y.unshift.apply(y,O.children),v(O)&&p.push(O))}return p}},function(d,r,t){var e=t(256),n=r.isTag=e.isTag;r.testElement=function(o,f){for(var v in o)if(o.hasOwnProperty(v)){if(v==="tag_name"){if(!n(f)||!o.tag_name(f.name))return!1}else if(v==="tag_type"){if(!o.tag_type(f.type))return!1}else if(v==="tag_contains"){if(n(f)||!o.tag_contains(f.data))return!1}else if(!f.attribs||!o[v](f.attribs[v]))return!1}return!0};var i={tag_name:function(o){return typeof o=="function"?function(f){return n(f)&&o(f.name)}:o==="*"?n:function(f){return n(f)&&f.name===o}},tag_type:function(o){return typeof o=="function"?function(f){return o(f.type)}:function(f){return f.type===o}},tag_contains:function(o){return typeof o=="function"?function(f){return!n(f)&&o(f.data)}:function(f){return!n(f)&&f.data===o}}};function a(o,f){return typeof f=="function"?function(v){return v.attribs&&f(v.attribs[o])}:function(v){return v.attribs&&v.attribs[o]===f}}function s(o,f){return function(v){return o(v)||f(v)}}r.getElements=function(o,f,v,l){var p=Object.keys(o).map(function(y){var O=o[y];return y in i?i[y](O):a(y,O)});return p.length===0?[]:this.filter(p.reduce(s),f,v,l)},r.getElementById=function(o,f,v){return Array.isArray(f)||(f=[f]),this.findOne(a("id",o),f,v!==!1)},r.getElementsByTagName=function(o,f,v,l){return this.filter(i.tag_name(o),f,v,l)},r.getElementsByTagType=function(o,f,v,l){return this.filter(i.tag_type(o),f,v,l)}},function(d,r){r.removeSubsets=function(n){for(var i=n.length,a,s,o;--i>-1;){for(a=s=n[i],n[i]=null,o=!0;s;){if(n.indexOf(s)>-1){o=!1,n.splice(i,1);break}s=s.parent}o&&(n[i]=a)}return n};var t={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},e=r.compareDocumentPosition=function(n,i){var a=[],s=[],o,f,v,l,p,y;if(n===i)return 0;for(o=n;o;)a.unshift(o),o=o.parent;for(o=i;o;)s.unshift(o),o=o.parent;for(y=0;a[y]===s[y];)y++;return y===0?t.DISCONNECTED:(f=a[y-1],v=f.children,l=a[y],p=s[y],v.indexOf(l)>v.indexOf(p)?f===i?t.FOLLOWING|t.CONTAINED_BY:t.FOLLOWING:f===n?t.PRECEDING|t.CONTAINS:t.PRECEDING)};r.uniqueSort=function(n){var i=n.length,a,s;for(n=n.slice();--i>-1;)a=n[i],s=n.indexOf(a),s>-1&&s<i&&n.splice(i,1);return n.sort(function(o,f){var v=e(o,f);return v&t.PRECEDING?-1:v&t.FOLLOWING?1:0}),n}},function(d,r){d.exports={trueFunc:function(){return!0},falseFunc:function(){return!1}}},function(d,r,t){d.exports=p;var e=t(275).parse,n=t(273),i=t(278),a=t(279),s=t(280),o=t(282),f=n.trueFunc,v=n.falseFunc,l=o.filters;function p(E,L,D){var R=O(E,L,D);return y(R,L)}function y(E,L){var D=L.adapter;return function(C){return D.isTag(C)&&E(C)}}function O(E,L,D){var R=e(E,L);return g(R,L,D)}function x(E){return E.type==="pseudo"&&(E.name==="scope"||Array.isArray(E.data)&&E.data.some(function(L){return L.some(x)}))}var m={type:"descendant"},T={type:"_flexibleDescendant"},c={type:"pseudo",name:"scope"},h={};function u(E,L,D){var R=L.adapter,C=!!D&&!!D.length&&D.every(function(W){return W===h||!!R.getParent(W)});E.forEach(function(W){if(!(W.length>0&&M(W[0])&&W[0].type!=="descendant"))if(C&&!(Array.isArray(W)?W.some(x):x(W)))W.unshift(m);else return;W.unshift(c)})}function g(E,L,D){E=E.filter(function(z){return z.length>0}),E.forEach(i);var R=Array.isArray(D);D=L&&L.context||D,D&&!R&&(D=[D]),u(E,L,D);var C=!1,W=E.map(function(z){if(z[0]&&z[1]&&z[0].name==="scope"){var H=z[1].type;R&&H==="descendant"?z[1]=T:(H==="adjacent"||H==="sibling")&&(C=!0)}return A(z,L,D)}).reduce(I,v);return W.shouldTestNextSiblings=C,W}function M(E){return a[E.type]<0}function A(E,L,D){return E.reduce(function(R,C){if(R===v)return R;if(!(C.type in s))throw new Error("Rule type "+C.type+" is not supported by css-select");return s[C.type](R,C,L,D)},L&&L.rootFunc||f)}function I(E,L){return L===v||E===f?E:E===v||L===f?L:function(R){return E(R)||L(R)}}function b(E){return E.some(M)}l.not=function(E,L,D,R){var C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),adapter:D.adapter};if(C.strict&&(L.length>1||L.some(b)))throw new Error("complex selectors in :not aren't allowed in strict mode");var W=g(L,C,R);return W===v?E:W===f?v:function(H){return!W(H)&&E(H)}},l.has=function(E,L,D){var R=D.adapter,C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),adapter:R},W=L.some(b)?[h]:null,z=g(L,C,W);return z===v?v:z===f?function(X){return R.getChildren(X).some(R.isTag)&&E(X)}:(z=y(z,D),W?function(X){return E(X)&&(W[0]=X,R.existsOne(z,R.getChildren(X)))}:function(X){return E(X)&&R.existsOne(z,R.getChildren(X))})},l.matches=function(E,L,D,R){var C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),rootFunc:E,adapter:D.adapter};return g(L,C,R)},p.compileToken=g,p.compileUnsafe=O,p.Pseudos=o},function(d,r,t){var e=this&&this.__createBinding||(Object.create?function(s,o,f,v){v===void 0&&(v=f),Object.defineProperty(s,v,{enumerable:!0,get:function(){return o[f]}})}:function(s,o,f,v){v===void 0&&(v=f),s[v]=o[f]}),n=this&&this.__exportStar||function(s,o){for(var f in s)f!=="default"&&!o.hasOwnProperty(f)&&e(o,s,f)};Object.defineProperty(r,"__esModule",{value:!0}),n(t(276),r);var i=t(276);Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return i.default}});var a=t(277);Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return a.default}})},function(d,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.default=x;var e=/^[^\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,n=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,i=/^\s*((?:\\.|[\w\u00b0-\uFFFF-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF-])*)|)|)\s*(i)?\]/,a={undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},s={">":"child","<":"parent","~":"sibling","+":"adjacent"},o={"#":["id","equals"],".":["class","element"]},f=new Set(["has","not","matches"]),v=new Set(["contains","icontains"]),l=new Set(['"',"'"]);function p(c,h,u){var g=parseInt(h,16)-65536;return g!==g||u?h:g<0?String.fromCharCode(g+65536):String.fromCharCode(g>>10|55296,g&1023|56320)}function y(c){return c.replace(n,p)}function O(c){return c===" "||c===`
|
|
566
|
-
`||c===" "||c==="\f"||c==="\r"}function x(c,h){var u=[];if(c=m(u,""+c,h),c!=="")throw new Error("Unmatched selector: "+c);return u}function m(c,h,u){var g=[],M=!1;function A(){var Q=h.match(e);if(!Q)throw new Error("Expected name, found "+h);var tt=Q[0];return h=h.substr(tt.length),y(tt)}function I(Q){for(;O(h.charAt(Q));)Q++;h=h.substr(Q)}function b(Q){for(var tt=0;h.charAt(--Q)==="\\";)tt++;return(tt&1)===1}for(I(0);h!=="";){var E=h.charAt(0);if(O(E))M=!0,I(1);else if(E in s)g.push({type:s[E]}),M=!1,I(1);else if(E===","){if(g.length===0)throw new Error("Empty sub-selector");c.push(g),g=[],M=!1,I(1)}else if(M&&(g.length>0&&g.push({type:"descendant"}),M=!1),E==="*")h=h.substr(1),g.push({type:"universal"});else if(E in o){var L=o[E],D=L[0],R=L[1];h=h.substr(1),g.push({type:"attribute",name:D,action:R,value:A(),ignoreCase:!1})}else if(E==="["){h=h.substr(1);var C=h.match(i);if(!C)throw new Error("Malformed attribute selector: "+h);h=h.substr(C[0].length);var W=y(C[1]);(!u||("lowerCaseAttributeNames"in u?u.lowerCaseAttributeNames:!u.xmlMode))&&(W=W.toLowerCase()),g.push({type:"attribute",name:W,action:a[C[2]],value:y(C[4]||C[5]||""),ignoreCase:!!C[6]})}else if(E===":"){if(h.charAt(1)===":"){h=h.substr(2),g.push({type:"pseudo-element",name:A().toLowerCase()});continue}h=h.substr(1);var z=A().toLowerCase(),C=null;if(h.charAt(0)==="(")if(f.has(z)){var H=h.charAt(1),X=l.has(H);if(h=h.substr(X?2:1),C=[],h=m(C,h,u),X){if(h.charAt(0)!==H)throw new Error("Unmatched quotes in :"+z);h=h.substr(1)}if(h.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+z+" ("+h+")");h=h.substr(1)}else{for(var Z=1,j=1;j>0&&Z<h.length;Z++)h.charAt(Z)==="("&&!b(Z)?j++:h.charAt(Z)===")"&&!b(Z)&&j--;if(j)throw new Error("Parenthesis not matched");if(C=h.substr(1,Z-2),h=h.substr(Z),v.has(z)){var H=C.charAt(0);H===C.slice(-1)&&l.has(H)&&(C=C.slice(1,-1)),C=y(C)}}g.push({type:"pseudo",name:z,data:C})}else if(e.test(h)){var G=A();(!u||("lowerCaseTags"in u?u.lowerCaseTags:!u.xmlMode))&&(G=G.toLowerCase()),g.push({type:"tag",name:G})}else return g.length&&g[g.length-1].type==="descendant"&&g.pop(),T(c,g),h}return T(c,g),h}function T(c,h){if(c.length>0&&h.length===0)throw new Error("Empty sub-selector");c.push(h)}},function(d,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"};function n(o){return o.map(i).join(", ")}r.default=n;function i(o){return o.map(a).join("")}function a(o){switch(o.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return"*";case"tag":return o.name;case"pseudo-element":return"::"+o.name;case"pseudo":return o.data===null?":"+o.name:typeof o.data=="string"?":"+o.name+"("+o.data+")":":"+o.name+"("+n(o.data)+")";case"attribute":return o.action==="exists"?"["+o.name+"]":o.name==="id"&&o.action==="equals"&&!o.ignoreCase?"#"+o.value:o.name==="class"&&o.action==="element"&&!o.ignoreCase?"."+o.value:"["+o.name+e[o.action]+"='"+o.value+"'"+(o.ignoreCase?"i":"")+"]";default:throw new Error("Unknown type")}}function s(o){return o}},function(d,r,t){d.exports=i;var e=t(279),n={__proto__:null,exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4};function i(s){for(var o=s.map(a),f=1;f<s.length;f++){var v=o[f];if(!(v<0))for(var l=f-1;l>=0&&v<o[l];l--){var p=s[l+1];s[l+1]=s[l],s[l]=p,o[l+1]=o[l],o[l]=v}}}function a(s){var o=e[s.type];if(o===e.attribute)o=n[s.action],o===n.equals&&s.name==="id"&&(o=9),s.ignoreCase&&(o>>=1);else if(o===e.pseudo)if(!s.data)o=3;else if(s.name==="has"||s.name==="contains")o=0;else if(s.name==="matches"||s.name==="not"){o=0;for(var f=0;f<s.data.length;f++)if(s.data[f].length===1){var v=a(s.data[f][0]);if(v===0){o=0;break}v>o&&(o=v)}s.data.length>1&&o>0&&(o-=1)}else o=1;return o}},function(d){d.exports=JSON.parse('{"universal":50,"tag":30,"attribute":1,"pseudo":0,"descendant":-1,"child":-1,"parent":-1,"sibling":-1,"adjacent":-1}')},function(d,r,t){var e=t(281),n=t(282);d.exports={__proto__:null,attribute:e.compile,pseudo:n.compile,tag:function(i,a,s){var o=a.name,f=s.adapter;return function(l){return f.getName(l)===o&&i(l)}},descendant:function(i,a,s){var o=typeof WeakSet<"u"?new WeakSet:null,f=s.adapter;return function(l){for(var p=!1;!p&&(l=f.getParent(l));)(!o||!o.has(l))&&(p=i(l),!p&&o&&o.add(l));return p}},_flexibleDescendant:function(i,a,s){var o=s.adapter;return function(v){for(var l=i(v);!l&&(v=o.getParent(v));)l=i(v);return l}},parent:function(i,a,s){if(s&&s.strict)throw new Error("Parent selector isn't part of CSS3");var o=s.adapter;return function(l){return o.getChildren(l).some(f)};function f(v){return o.isTag(v)&&i(v)}},child:function(i,a,s){var o=s.adapter;return function(v){var l=o.getParent(v);return!!l&&i(l)}},sibling:function(i,a,s){var o=s.adapter;return function(v){for(var l=o.getSiblings(v),p=0;p<l.length;p++)if(o.isTag(l[p])){if(l[p]===v)break;if(i(l[p]))return!0}return!1}},adjacent:function(i,a,s){var o=s.adapter;return function(v){for(var l=o.getSiblings(v),p,y=0;y<l.length;y++)if(o.isTag(l[y])){if(l[y]===v)break;p=l[y]}return!!p&&i(p)}},universal:function(i){return i}}},function(d,r,t){var e=t(273).falseFunc,n=/[-[\]{}()*+?.,\\^$|#\s]/g,i={__proto__:null,equals:function(a,s,o){var f=s.name,v=s.value,l=o.adapter;return s.ignoreCase?(v=v.toLowerCase(),function(y){var O=l.getAttributeValue(y,f);return O!=null&&O.toLowerCase()===v&&a(y)}):function(y){return l.getAttributeValue(y,f)===v&&a(y)}},hyphen:function(a,s,o){var f=s.name,v=s.value,l=v.length,p=o.adapter;return s.ignoreCase?(v=v.toLowerCase(),function(O){var x=p.getAttributeValue(O,f);return x!=null&&(x.length===l||x.charAt(l)==="-")&&x.substr(0,l).toLowerCase()===v&&a(O)}):function(O){var x=p.getAttributeValue(O,f);return x!=null&&x.substr(0,l)===v&&(x.length===l||x.charAt(l)==="-")&&a(O)}},element:function(a,s,o){var f=s.name,v=s.value,l=o.adapter;if(/\s/.test(v))return e;v=v.replace(n,"\\$&");var p="(?:^|\\s)"+v+"(?:$|\\s)",y=s.ignoreCase?"i":"",O=new RegExp(p,y);return function(m){var T=l.getAttributeValue(m,f);return T!=null&&O.test(T)&&a(m)}},exists:function(a,s,o){var f=s.name,v=o.adapter;return function(p){return v.hasAttrib(p,f)&&a(p)}},start:function(a,s,o){var f=s.name,v=s.value,l=v.length,p=o.adapter;return l===0?e:s.ignoreCase?(v=v.toLowerCase(),function(O){var x=p.getAttributeValue(O,f);return x!=null&&x.substr(0,l).toLowerCase()===v&&a(O)}):function(O){var x=p.getAttributeValue(O,f);return x!=null&&x.substr(0,l)===v&&a(O)}},end:function(a,s,o){var f=s.name,v=s.value,l=-v.length,p=o.adapter;return l===0?e:s.ignoreCase?(v=v.toLowerCase(),function(O){var x=p.getAttributeValue(O,f);return x!=null&&x.substr(l).toLowerCase()===v&&a(O)}):function(O){var x=p.getAttributeValue(O,f);return x!=null&&x.substr(l)===v&&a(O)}},any:function(a,s,o){var f=s.name,v=s.value,l=o.adapter;if(v==="")return e;if(s.ignoreCase){var p=new RegExp(v.replace(n,"\\$&"),"i");return function(O){var x=l.getAttributeValue(O,f);return x!=null&&p.test(x)&&a(O)}}return function(O){var x=l.getAttributeValue(O,f);return x!=null&&x.indexOf(v)>=0&&a(O)}},not:function(a,s,o){var f=s.name,v=s.value,l=o.adapter;return v===""?function(y){return!!l.getAttributeValue(y,f)&&a(y)}:s.ignoreCase?(v=v.toLowerCase(),function(y){var O=l.getAttributeValue(y,f);return O!=null&&O.toLowerCase()!==v&&a(y)}):function(y){return l.getAttributeValue(y,f)!==v&&a(y)}}};d.exports={compile:function(a,s,o){if(o&&o.strict&&(s.ignoreCase||s.action==="not"))throw new Error("Unsupported attribute selector");return i[s.action](a,s,o)},rules:i}},function(d,r,t){var e=t(283),n=t(273),i=t(281),a=n.trueFunc,s=n.falseFunc,o=i.rules.equals;function f(T,c){var h={name:T,value:c};return function(g,M,A){return o(g,h,A)}}function v(T,c){return function(h){return!!c.getParent(h)&&T(h)}}var l={contains:function(T,c,h){var u=h.adapter;return function(M){return T(M)&&u.getText(M).indexOf(c)>=0}},icontains:function(T,c,h){var u=c.toLowerCase(),g=h.adapter;return function(A){return T(A)&&g.getText(A).toLowerCase().indexOf(u)>=0}},"nth-child":function(T,c,h){var u=e(c),g=h.adapter;return u===s?u:u===a?v(T,g):function(A){for(var I=g.getSiblings(A),b=0,E=0;b<I.length;b++)if(g.isTag(I[b])){if(I[b]===A)break;E++}return u(E)&&T(A)}},"nth-last-child":function(T,c,h){var u=e(c),g=h.adapter;return u===s?u:u===a?v(T,g):function(A){for(var I=g.getSiblings(A),b=0,E=I.length-1;E>=0;E--)if(g.isTag(I[E])){if(I[E]===A)break;b++}return u(b)&&T(A)}},"nth-of-type":function(T,c,h){var u=e(c),g=h.adapter;return u===s?u:u===a?v(T,g):function(A){for(var I=g.getSiblings(A),b=0,E=0;E<I.length;E++)if(g.isTag(I[E])){if(I[E]===A)break;g.getName(I[E])===g.getName(A)&&b++}return u(b)&&T(A)}},"nth-last-of-type":function(T,c,h){var u=e(c),g=h.adapter;return u===s?u:u===a?v(T,g):function(A){for(var I=g.getSiblings(A),b=0,E=I.length-1;E>=0;E--)if(g.isTag(I[E])){if(I[E]===A)break;g.getName(I[E])===g.getName(A)&&b++}return u(b)&&T(A)}},root:function(T,c,h){var u=h.adapter;return function(g){return!u.getParent(g)&&T(g)}},scope:function(T,c,h,u){var g=h.adapter;if(!u||u.length===0)return l.root(T,c,h);function M(A,I){return typeof g.equals=="function"?g.equals(A,I):A===I}return u.length===1?function(A){return M(u[0],A)&&T(A)}:function(A){return u.indexOf(A)>=0&&T(A)}},checkbox:f("type","checkbox"),file:f("type","file"),password:f("type","password"),radio:f("type","radio"),reset:f("type","reset"),image:f("type","image"),submit:f("type","submit"),hover:function(T,c,h){var u=h.adapter;return typeof u.isHovered=="function"?function(M){return T(M)&&u.isHovered(M)}:s},visited:function(T,c,h){var u=h.adapter;return typeof u.isVisited=="function"?function(M){return T(M)&&u.isVisited(M)}:s},active:function(T,c,h){var u=h.adapter;return typeof u.isActive=="function"?function(M){return T(M)&&u.isActive(M)}:s}};function p(T,c){for(var h=0;T&&h<T.length;h++)if(c.isTag(T[h]))return T[h]}var y={empty:function(T,c){return!c.getChildren(T).some(function(h){return c.isTag(h)||h.type==="text"})},"first-child":function(T,c){return p(c.getSiblings(T),c)===T},"last-child":function(T,c){for(var h=c.getSiblings(T),u=h.length-1;u>=0;u--){if(h[u]===T)return!0;if(c.isTag(h[u]))break}return!1},"first-of-type":function(T,c){for(var h=c.getSiblings(T),u=0;u<h.length;u++)if(c.isTag(h[u])){if(h[u]===T)return!0;if(c.getName(h[u])===c.getName(T))break}return!1},"last-of-type":function(T,c){for(var h=c.getSiblings(T),u=h.length-1;u>=0;u--)if(c.isTag(h[u])){if(h[u]===T)return!0;if(c.getName(h[u])===c.getName(T))break}return!1},"only-of-type":function(T,c){for(var h=c.getSiblings(T),u=0,g=h.length;u<g;u++)if(c.isTag(h[u])){if(h[u]===T)continue;if(c.getName(h[u])===c.getName(T))return!1}return!0},"only-child":function(T,c){for(var h=c.getSiblings(T),u=0;u<h.length;u++)if(c.isTag(h[u])&&h[u]!==T)return!1;return!0},link:function(T,c){return c.hasAttrib(T,"href")},selected:function(T,c){if(c.hasAttrib(T,"selected"))return!0;if(c.getName(T)!=="option")return!1;var h=c.getParent(T);if(!h||c.getName(h)!=="select"||c.hasAttrib(h,"multiple"))return!1;for(var u=c.getChildren(h),g=!1,M=0;M<u.length;M++)if(c.isTag(u[M]))if(u[M]===T)g=!0;else if(g){if(c.hasAttrib(u[M],"selected"))return!1}else return!1;return g},disabled:function(T,c){return c.hasAttrib(T,"disabled")},enabled:function(T,c){return!c.hasAttrib(T,"disabled")},checked:function(T,c){return c.hasAttrib(T,"checked")||y.selected(T,c)},required:function(T,c){return c.hasAttrib(T,"required")},optional:function(T,c){return!c.hasAttrib(T,"required")},parent:function(T,c){return!y.empty(T,c)},header:O(["h1","h2","h3","h4","h5","h6"]),button:function(T,c){var h=c.getName(T);return h==="button"||h==="input"&&c.getAttributeValue(T,"type")==="button"},input:O(["input","textarea","select","button"]),text:function(T,c){var h;return c.getName(T)==="input"&&(!(h=c.getAttributeValue(T,"type"))||h.toLowerCase()==="text")}};function O(T){if(typeof Set<"u"){var c=new Set(T);return function(h,u){return c.has(u.getName(h))}}return function(h,u){return T.indexOf(u.getName(h))>=0}}function x(T,c,h){if(h===null){if(T.length>2&&c!=="scope")throw new Error("pseudo-selector :"+c+" requires an argument")}else if(T.length===2)throw new Error("pseudo-selector :"+c+" doesn't have any arguments")}var m=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;d.exports={compile:function(T,c,h,u){var g=c.name,M=c.data,A=h.adapter;if(h&&h.strict&&!m.test(g))throw new Error(":"+g+" isn't part of CSS3");if(typeof l[g]=="function")return l[g](T,M,h,u);if(typeof y[g]=="function"){var I=y[g];return x(I,g,M),I===s?I:T===a?function(E){return I(E,A,M)}:function(E){return I(E,A,M)&&T(E)}}else throw new Error("unmatched pseudo-class :"+g)},filters:l,pseudos:y}},function(d,r,t){var e=t(284),n=t(285);d.exports=function(a){return n(e(a))},d.exports.parse=e,d.exports.compile=n},function(d,r){d.exports=e;var t=/^([+\-]?\d*n)?\s*(?:([+\-]?)\s*(\d+))?$/;function e(n){if(n=n.trim().toLowerCase(),n==="even")return[2,0];if(n==="odd")return[2,1];var i=n.match(t);if(!i)throw new SyntaxError("n-th rule couldn't be parsed ('"+n+"')");var a;return i[1]?(a=parseInt(i[1],10),isNaN(a)&&(i[1].charAt(0)==="-"?a=-1:a=1)):a=0,[a,i[3]?parseInt((i[2]||"")+i[3],10):0]}},function(d,r,t){d.exports=a;var e=t(273),n=e.trueFunc,i=e.falseFunc;function a(s){var o=s[0],f=s[1]-1;if(f<0&&o<=0)return i;if(o===-1)return function(l){return l<=f};if(o===0)return function(l){return l===f};if(o===1)return f<0?n:function(l){return l>=f};var v=f%o;return v<0&&(v+=o),o>1?function(l){return l>=f&&l%o===v}:(o*=-1,function(l){return l<=f&&l%o===v})}},function(d,r,t){t.r(r),t.d(r,"default",function(){return M});var e=t(12),n=t(74),i=t(1),a=t(68),s=t(250),o=t(213),f=t(218);t(1).glMatrix.setMatrixArrayType(Array);function v(A,I){if(A==null)return{};var b=l(A,I),E,L;if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(A);for(L=0;L<D.length;L++)E=D[L],!(I.indexOf(E)>=0)&&Object.prototype.propertyIsEnumerable.call(A,E)&&(b[E]=A[E])}return b}function l(A,I){if(A==null)return{};var b={},E=Object.keys(A),L,D;for(D=0;D<E.length;D++)L=E[D],!(I.indexOf(L)>=0)&&(b[L]=A[L]);return b}const p={antialias:!0,autoRender:!0,alpha:!0},y=Symbol("autoRender"),O=Symbol("renderer"),x=Symbol("timeline"),m=Symbol("prepareRender"),T=Symbol("tickRender"),c=Symbol("pass"),h=Symbol("fbo"),u=Symbol("tickers"),g=Symbol("layerTransformInvert");class M extends s.default{constructor(I={}){if(super(),!I.canvas){const{width:D,height:R}=this.getResolution(),C=e.ENV.createCanvas(D,R,{offscreen:!!I.offscreen,id:I.id,extra:I.extra});C.style&&(C.style.position="absolute"),C.dataset&&(C.dataset.layerId=I.id),C.contextType&&(I.contextType=C.contextType),I.canvas=C}const b=I.canvas,E=Object.assign({},p,I);this[y]=E.autoRender,delete I.autoRender;const L=E.Renderer||e.Renderer;this[O]=new L(b,E),this.options=I,this.id=I.id,this[c]=[],this.setResolution(b),this.canvas=b,this[x]=new n.Timeline,this.__mouseCapturedTarget=null,this[g]=null}get autoRender(){return this[y]}get displayRatio(){return this.parent&&this.parent.options?this.parent.options.displayRatio:1}get height(){const{height:I}=this.getResolution();return I/this.displayRatio}get gl(){return this.renderer.glRenderer?this.renderer.glRenderer.gl:null}get layer(){return this}get offscreen(){return!!this.options.offscreen||this.canvas._offscreen}get pass(){return this[c]}get prepareRender(){return this[m]?this[m]:Promise.resolve()}get renderer(){return this[O]}get renderOffset(){if(this.parent&&this.parent.options){const{left:I,top:b}=this.parent.options;return[I,b]}return[this.options.left|0,this.options.top|0]}get timeline(){return this[x]}get width(){const{width:I}=this.getResolution();return I/this.displayRatio}get localMatrix(){const{x:I,y:b}=this.attributes;return[1,0,0,1,I,b]}get layerTransformInvert(){if(this[g])return this[g];const I=this.transformMatrix;return I[0]===1&&I[1]===0&&I[2]===0&&I[3]===1&&I[4]===0&&I[5]===0?null:(this[g]=i.mat2d.invert(Array.of(0,0,0,0,0,0),I),this[g])}forceContextLoss(){const I=this.renderer.glRenderer;if(I){const b=I.getExtension("WEBGL_lose_context");if(b)return b.loseContext(),!0}return!1}addPass({vertex:I,fragment:b,options:E,uniforms:L}={}){if(this.renderer.glRenderer){const{width:D,height:R}=this.getResolution(),C=this.renderer.createPassProgram({vertex:I,fragment:b,options:E}),W=new e.Figure2D;W.rect(0,0,D/this.displayRatio,R/this.displayRatio);const z=new e.Mesh2D(W);return z.setUniforms(L),z.setProgram(C),this[c].push(z),this.forceUpdate(),z}return null}deleteTexture(I){return Object(f.deleteTexture)(I,this.renderer)}dispatchPointerEvent(I){const b=I.type;if(b==="mousedown"||b==="mouseup"||b==="mousemove"){const C=this.__mouseCapturedTarget;if(C){if(C.layer===this)return C.dispatchEvent(I),!0;this.__mouseCapturedTarget=null}}let E,L;const D=this.layerTransformInvert;if(D){E=I.x,L=I.y;const C=D,W=C[0]*E+C[2]*L+C[4],z=C[1]*E+C[3]*L+C[5];delete I.x,delete I.y,delete I.layerX,delete I.layerY,Object.defineProperties(I,{layerX:{value:W,configurable:!0},layerY:{value:z,configurable:!0},x:{value:W,configurable:!0},y:{value:z,configurable:!0}})}const R=super.dispatchPointerEvent(I);return D&&Object.defineProperties(I,{layerX:{value:E,configurable:!0},layerY:{value:L,configurable:!0},x:{value:E,configurable:!0},y:{value:L,configurable:!0}}),R}forceUpdate(){if(!this[m])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();let I=null;const b=new Promise(E=>{I=E});b._resolve=I,this[m]=b}else{let I=null,b=null;const E=new Promise(L=>{I=L,this[y]&&(b=Object(a.requestAnimationFrame)(()=>{delete E._requestID,this.render()}))});E._resolve=I,E._requestID=b,this[m]=E}}getFBO(){const I=this.renderer.glRenderer,{width:b,height:E}=this.getResolution();return I&&(!this[h]||this[h].width!==b||this[h].height!==E)?(this[h]={width:b,height:E,target:I.createFBO(),buffer:I.createFBO(),swap(){[this.target,this.buffer]=[this.buffer,this.target]}},this[h]):this[h]?this[h]:null}updateGlobalTransform(){if(this.layerTransformInvert){const I=this.renderer,b=I.__globalTransformMatrix||I.globalTransformMatrix;I.__globalTransformMatrix=b;const E=i.mat2d.fromValues(1,0,0,1,0,0);I.setGlobalTransform(...i.mat2d.multiply(E,b,this.transformMatrix))}}onPropertyChange(I,b,E){if(super.onPropertyChange(I,b,E),I==="zIndex"&&(this.canvas.style.zIndex=b),I==="transform"||I==="translate"||I==="rotate"||I==="scale"||I==="skew"){const L=this[g];if(this[g]=null,this.updateGlobalTransform(),L&&!this.layerTransformInvert){const D=this.renderer,R=D.__globalTransformMatrix||D.globalTransformMatrix;D.setGlobalTransform(...R)}}}_prepareRenderFinished(){this[m]&&(this[m]._requestID&&Object(a.cancelAnimationFrame)(this[m]._requestID),this[m]._resolve(),delete this[m])}render({clear:I=!0}={}){const b=this[c].length?this.getFBO():null;b&&this.renderer.glRenderer.bindFBO(b.target),I&&this[O].clear();const E=this.draw();if(E&&E.length&&(this.renderer.drawMeshes(E),this.canvas.draw&&this.canvas.draw()),b){const L=this.renderer.glRenderer,D=this[c].length,{width:R,height:C}=this.getResolution(),W=[0,0,R/this.displayRatio,C/this.displayRatio];this[c].forEach((z,H)=>{z.blend=!0,z.setTexture(b.target.texture,{rect:W}),H===D-1?L.bindFBO(null):(b.swap(),L.bindFBO(b.target)),this[O].clear(),this.renderer.drawMeshes([z])})}this._prepareRenderFinished()}setResolution({width:I,height:b}){const E=this.renderer,L=E.__globalTransformMatrix||E.globalTransformMatrix,D=L[4],R=L[5],C=L[0],{width:W,height:z}=this.getResolution();(W!==I||z!==b)&&(super.setResolution({width:I,height:b}),this.canvas&&(this.canvas.width=I,this.canvas.height=b,E.updateResolution&&E.updateResolution()),this.attributes.size=[I,b],this[c].length&&this[c].forEach(j=>{const G=new e.Figure2D;G.rect(0,0,I/this.displayRatio,b/this.displayRatio),j.contours=G.contours}));const[H,X]=this.renderOffset,Z=this.displayRatio;(D!==H||R!==X||C!==Z)&&(E.setGlobalTransform(Z,0,0,Z,H,X),E.__globalTransformMatrix=null,this[g]=null,this.updateGlobalTransform(),this.forceUpdate())}tick(I=null,b={}){let{duration:E=1/0}=b,L=v(b,["duration"]);const D=this.timeline.fork(L),R=this;this[u]=this[u]||[],this[u].push({handler:I,duration:E});const C=()=>{let W=null,z=null;const H=()=>{const X=this[u].map(({handler:Z,duration:j})=>{const G=Math.min(1,D.currentTime/j);return{value:Z?Z(D.currentTime,G):null,p:G}});R[T]||(R[T]=Promise.resolve().then(()=>{R[y]&&R.render(),delete R[T];for(let Z=X.length-1;Z>=0;Z--){const{value:j,p:G}=X[Z];(j===!1||G>=1)&&this[u].splice(Z,1)}this[u].length>0&&C()}))};if(this[m]&&this[m]._type!=="ticker"&&(Object(a.cancelAnimationFrame)(this[m]._requestID),delete this[m]),!this[m]){const X=new Promise(Z=>{W=Z,z=Object(a.requestAnimationFrame)(H)});X._resolve=W,X._requestID=z,X._type="ticker",this[m]=X}};C()}toGlobalPos(I,b){if(this.layerTransformInvert){const W=this.transformMatrix;I=W[0]*I+W[2]*b+W[4],b=W[1]*I+W[3]*b+W[5]}const{width:E,height:L}=this.getResolution(),D=this.renderOffset,R=[this.canvas.clientWidth,this.canvas.clientHeight];I=I*R[0]/E+D[0],b=b*R[1]/L+D[1];const C=this.displayRatio;return I*=C,b*=C,[I,b]}toLocalPos(I,b){const{width:E,height:L}=this.getResolution(),D=this.renderOffset,R=[this.canvas.clientWidth,this.canvas.clientHeight];I=I*E/R[0]-D[0],b=b*L/R[1]-D[1];const C=this.displayRatio;I/=C,b/=C;const W=this.layerTransformInvert;return W&&(I=W[0]*I+W[2]*b+W[4],b=W[1]*I+W[3]*b+W[5]),[I,b]}}o.default.registerNode(M,"layer")},function(d,r,t){t.r(r),t.d(r,"default",function(){return m});var e=t(224),n=t(288),i=t(213),a=t(252),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);function o(T,c){if(T==null)return{};var h=f(T,c),u,g;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);for(g=0;g<M.length;g++)u=M[g],!(c.indexOf(u)>=0)&&Object.prototype.propertyIsEnumerable.call(T,u)&&(h[u]=T[u])}return h}function f(T,c){if(T==null)return{};var h={},u=Object.keys(T),g,M;for(M=0;M<u.length;M++)g=u[M],!(c.indexOf(g)>=0)&&(h[g]=T[g]);return h}function v(T,c,h){return c in T?Object.defineProperty(T,c,{value:h,enumerable:!0,configurable:!0,writable:!0}):T[c]=h,T}const l="http://www.w3.org/2000/svg",p=Symbol.for("spritejs_setAttribute"),y=Symbol("root"),O=Symbol("task");function x(T,c=!0){const h=T[y];if(h&&h.children[0]){const u=T.svg,g=T.layer?T.layer.displayRatio:1;if(!u.hasAttribute("data-original-width")){let I=u.getAttribute("width");I=I?Object(s.sizeToPixel)(I):300;let b=u.getAttribute("height");b=b?Object(s.sizeToPixel)(b):150,u.hasAttribute("viewBox")||u.setAttribute("viewBox",`0 0 ${Math.round(I)} ${Math.round(b)}`),u.setAttribute("data-original-width",I),u.setAttribute("data-original-height",b)}let M=T.attributes.width||Number(u.getAttribute("data-original-width")),A=T.attributes.height||Number(u.getAttribute("data-original-height"));if(M*=g,A*=g,c&&T.attributes.flexible){const I=T.attributes.scale[0];if(M*=I,A*=I,u.setAttribute("width",M),u.setAttribute("height",A),M&&A&&T.textureImage){const b=T.textureImage.width,E=T.textureImage.height,L=T.clientSize;T.attributes.textureRect=[0,0,Math.round(L[0]*b/M),Math.round(L[1]*E/A)]}}else T[O]||(u.setAttribute("width",M),u.setAttribute("height",A),T[O]=Promise.resolve().then(()=>{delete T[O];const I=h.innerHTML,b=new Blob([I],{type:"image/svg+xml"}),E=URL.createObjectURL(b),L=new Image;L.onload=function(){L.width&&L.height?(T.attributes[p]("texture",L),T.attributes.flexible&&(T.attributes.textureRect=null)):T.attributes[p]("texture",null)},L.src=E}))}}class m extends e.default{constructor(c={}){typeof c=="string"&&(c={svgText:c});let{svgText:h}=c,u=o(c,["svgText"]);if(super(u),this[y]=document.createElement("div"),h){this[y].innerHTML=h;const g=this[y].children[0];g?g.setAttribute("xmlns",l):(fetch(h).then(M=>M.text()).then(M=>{this[y].innerHTML=M,(!this.observer||this.attributes.flexible)&&x(this)}),h=null)}if(!h){const g=document.createElementNS(l,"svg");g.setAttribute("xmlns",l),this[y].appendChild(g)}if(typeof MutationObserver=="function"){const g=new MutationObserver(M=>{x(this,!1)});g.observe(this[y],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),this.observer=g}}get children(){return[this.svg]}get childNodes(){return[this.svg]}get svg(){return this[y]?this[y].children[0]:null}setResolution({width:c,height:h}){super.setResolution({width:c,height:h}),x(this)}dispatchPointerEvent(c){const h=super.dispatchPointerEvent(c);if(h&&this.attributes.passEvents&&typeof MouseEvent=="function"){const{x:u,y:g}=c;let[M,A]=this.getOffsetPosition(u,g);const I=c.originalEvent,b=this.attributes.anchor,E=this.clientSize;M=(M+b[0]*E[0])/2,A=(A+b[1]*E[1])/2;const L=c.type;if(L===I.type){let D=null;if(I instanceof MouseEvent)D=new MouseEvent(L,{screenX:M,screenY:A,clientX:M,clientY:A,bubbles:I.bubbles,button:I.button,buttons:I.buttons,cancelBubble:I.cancelBubble,cancelable:I.cancelable,currentTarget:I.currentTarget,fromElement:I.fromElement,relatedTarget:I.relatedTarget,returnValue:I.returnValue,srcElement:I.srcElement,target:I.target,toElement:I.toElement,which:I.witch});else if(I instanceof TouchEvent){let R=null;const C=I.changedTouches||[I];for(let W=0;W<C.length;W++){const z=C[W];if(c.identifier===z.identifier){R=z;break}}if(R){const W=new Touch({identifier:R.identifier,target:R.target,clientX:M,clientY:A,screenX:M,screenY:A,pageX:M,pageY:A,radiusX:R.radiusX,radiusY:R.radiusY,rotationAngle:R.rotationAngle,force:R.force});D=new TouchEvent(L,{cancelable:I.cancelable,bubbles:I.bubbles,composed:I.composed,touches:[W],targetTouches:[W],changedTouches:[W]})}}else D=I;D&&this.svg.dispatchEvent(D)}}return h}getElementById(c){return Object(a.querySelector)(`#${c}`,this)}getElementsByClassName(c){return Object(a.querySelectorAll)(`.${c}`,this)}getElementsByName(c){return Object(a.querySelectorAll)(`[name="${c}"]`,this)}getElementsByTagName(c){return Object(a.querySelectorAll)(c,this)}querySelector(c){return Object(a.querySelector)(c,this)}querySelectorAll(c){return Object(a.querySelectorAll)(c,this)}onPropertyChange(c,h,u){super.onPropertyChange(c,h,u),c==="flexible"&&x(this),this.attributes.flexible&&(c==="width"||c==="height"||c==="scale"||c==="transform")&&x(this)}}v(m,"Attr",n.default),i.default.registerNode(m,"spritesvg")},function(d,r,t){t.r(r),t.d(r,"default",function(){return s});var e=t(225);t(1).glMatrix.setMatrixArrayType(Array);const n=Symbol.for("spritejs_getAttribute"),i=Symbol.for("spritejs_setAttribute"),a=Symbol.for("spritejs_setAttributeDefault");class s extends e.default{constructor(f){super(f),this[a]({passEvents:!1,flexible:!1})}get texture(){return this[n]("texture")}set texture(f){}get passEvents(){return this[n]("passEvents")}set passEvents(f){return this[i]("passEvents",f)}get flexible(){return this[n]("flexible")}set flexible(f){return this[i]("flexible",f)}}},function(d,r,t){t.r(r);var e=t(12);t(1).glMatrix.setMatrixArrayType(Array);function n(f,v){var l=Object.keys(f);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(f);v&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(f,y).enumerable})),l.push.apply(l,p)}return l}function i(f){for(var v=1;v<arguments.length;v++){var l=arguments[v]!=null?arguments[v]:{};v%2?n(Object(l),!0).forEach(function(p){a(f,p,l[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(l)):n(Object(l)).forEach(function(p){Object.defineProperty(f,p,Object.getOwnPropertyDescriptor(l,p))})}return f}function a(f,v,l){return v in f?Object.defineProperty(f,v,{value:l,enumerable:!0,configurable:!0,writable:!0}):f[v]=l,f}const s=Symbol("inited");let o=null;typeof Worker=="function"&&(o=class extends Worker{constructor(f){if(f.worker===!0&&(f.worker=`./${f.id}.worker.js`),super(f.worker),this.options=f,!f.canvas){const{width:v,height:l}=this.getResolution(),p=e.ENV.createCanvas(v,l,{offscreen:!1});p.style&&(p.style.position="absolute"),p.dataset&&(p.dataset.layerId=f.id),f.canvas=p}this.canvas=f.canvas}get id(){return this.options.id}setResolution({width:f,height:v}){if(this[s])this.postMessage({type:"resolution_change",width:f,height:v});else{this.canvas.width=f,this.canvas.height=v;const l=this.options,p=l.canvas.transferControlToOffscreen(),y=i({},l);delete y.container,y.canvas=p,this.postMessage({type:"create",options:y},[p]),this[s]=!0}}getResolution(){if(this.canvas){const{width:f,height:v}=this.canvas;return{width:f,height:v}}return{width:300,height:150}}remove(){return this.parent&&this.parent.removeChild?(this.parent.removeChild(this),!0):!1}connect(f,v){Object.defineProperty(this,"parent",{value:f,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:v,writable:!1,configurable:!0})}disconnect(){delete this.parent,delete this.zOrder}dispatchPointerEvent(f){this.postMessage({type:"event",event:{cancelBubble:f.cancelBubble,bubbles:f.bubbles,detail:f.detail,identifier:f.identifier,layerX:f.layerX,layerY:f.layerY,originalX:f.originalX,originalY:f.originalY,type:f.type,x:f.x,y:f.y}})}}),r.default=o},function(d,r,t){t.r(r),(function(e){t.d(r,"default",function(){return M});var n=t(12),i=t(68),a=t(70),s=t(286),o=t(289),f=t(250),v=t(291),l=t(214),p=t(218),y=t(213);t(1).glMatrix.setMatrixArrayType(Array);const O=Symbol("enteredTargets");function x(A){return A.id=A.id||`_layer${Math.random().toString(36).slice(2,12)}`,A.dataset||(A.dataset={}),A.dataset.layerId=A.id,A.connect=(I,b)=>{A.parent=I,Object.defineProperty(A,"zOrder",{value:b,writable:!1,configurable:!0})},A.disconnect=I=>{delete A.zOrder},A.canvas=A,A.getResolution=()=>({width:0,height:0}),A.setResolution=()=>!1,A.options={handleEvent:!1},A}function m(A,I){const b=A.children;let E=null;for(let L=0;L<b.length;L++){const D=b[L];if((I===D||E!=null)&&(E=D),E&&E!==I&&!E.offscreen)return E.canvas}return null}function T(A,I){const[b,E]=A.renderOffset,{width:L,height:D}=A.getResolution(),R=A.displayRatio;A.renderer.drawImage(I.canvas,-b/R,-E/R,L/R,D/R)}const c={};function h(A){const I=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],b=A.container;b.addEventListener("mouseleave",E=>{const L=A[O];if(L.size){const D=new l.default("mouseleave");D.setOriginalEvent(E),[...L].forEach(R=>{R.dispatchEvent(D)}),A[O].clear()}},{passive:!0}),I.forEach(E=>{b.addEventListener(E,L=>{const{left:D,top:R,displayRatio:C}=A.options,W=A.orderedChildren;Object(v.default)(L,{offsetLeft:D,offsetTop:R,displayRatio:C}).forEach(H=>{const X=H.identifier;if(H.type==="touchmove"||H.type==="touchend"){const j=c[X];j&&j.dispatchEvent(H),H.type==="touchend"&&delete c[X]}else{for(let j=W.length-1;j>=0;j--){const G=W[j];if(G.options.handleEvent!==!1){if(G.dispatchPointerEvent(H)&&H.target!==G)break;H.cancelBubble=!1}}if(H.target===W[0])for(let j=W.length-1;j>=0;j--){const G=W[j];if(G.options.handleEvent!==!1){H.target=G;break}}}const Z=H.target;if(H.type==="touchstart"&&(c[X]=H.target),H.type==="mousemove"){const j=A[O];let G;if(Z){const et=Z.ancestors||[];G=new Set([Z,...et])}else G=new Set;const Q=Object.entries(L);if(!j.has(Z)&&Z){const et=new l.default("mouseenter");et.setOriginalEvent(L),Q.forEach(([q,pt])=>{et[q]=pt}),j.add(Z),Z.dispatchEvent(et);const at=Z.ancestors;at&&at.forEach(q=>{q instanceof a.default&&!j.has(q)&&(j.add(q),q.dispatchEvent(et))})}const tt=new l.default("mouseleave");tt.setOriginalEvent(L),Q.forEach(([et,at])=>{tt[et]=at}),[...j].forEach(et=>{G.has(et)||(j.delete(et),et.dispatchEvent(tt))})}})},{passive:E!=="contextmenu"})})}function u(A,I){if(I&&I.style){let{width:b,height:E,mode:L,container:D}=A;const{clientWidth:R,clientHeight:C}=D;b=b||R,E=E||C,L==="static"?(I.style.width=`${b}px`,I.style.height=`${E}px`):(I.style.top="0",I.style.left="0",I.style.width=`${R}px`,I.style.height=`${C}px`,I.style.transform="",I.style.webkitTransform="")}}const g=Symbol("offscreenLayerCount");class M extends f.default{constructor(I={}){if(super(),!I.container)if(typeof n.ENV.Container=="function")I.container=new n.ENV.Container(I.width||300,I.height||150);else throw new Error("No container specified.");if(this.container=I.container,this.container.style&&(this.container.style.overflow||(this.container.style.overflow="hidden"),this.container.style.position||(this.container.style.position="relative")),this.options=I,I.displayRatio=I.displayRatio||1,I.mode=I.mode||"scale",I.left=0,I.top=0,I.autoResize=I.autoResize!==!1,I.autoResize){let b;if(typeof globalThis<"u"?b=globalThis:b=typeof window<"u"?window:e,b.addEventListener){const E=this;b.addEventListener("resize",function L(){typeof document<"u"&&document.contains(E.container)?E.resize():b.removeEventListener("resize",L)})}}this[O]=new Set,this.setResolution(I),h(this),this[g]=0}get hasOffscreenCanvas(){return this[g]>0}set displayRatio(I){this.options.displayRatio!==I&&(this.options.displayRatio=I,this.resize())}get displayRatio(){return this.options.displayRatio}set height(I){this.options.height!==I&&(this.options.height=I,this.resize())}get height(){return this.options.height}set mode(I){this.options.mode!==I&&(this.options.mode=I,this.resize())}get mode(){return this.options.mode}set width(I){this.options.width!==I&&(this.options.width=I,this.resize())}get width(){return this.options.width}appendChild(I){!(I instanceof s.default)&&!(I instanceof o.default)&&x(I);const b=super.appendChild(I),E=I.canvas;return I.offscreen?this[g]++:this.container.appendChild(E),u(this.options,E),I.setResolution(this.getResolution()),b}forceUpdate(){this.hasOffscreenCanvas&&!this._requestID&&(this._requestID=Object(i.requestAnimationFrame)(()=>{delete this._requestID,this.render()}))}insertBefore(I,b){!(I instanceof s.default)&&!(I instanceof o.default)&&x(I);const E=super.insertBefore(I,b),L=I.canvas;if(!I.offscreen){const D=m(this,I);this.container.insertBefore(L,D)}return u(this.options,L),I.setResolution(this.getResolution()),E}layer(I="default",b={}){b=Object.assign({},this.options,b),b.id=I;const E=this.orderedChildren;for(let R=0;R<E.length;R++)if(E[R].id===I)return E[R];const L=b.worker;let D;return L?D=new o.default(b):D=new s.default(b),this.appendChild(D),D}async preload(...I){const b=[],E=[],L=[];for(let D=0;D<I.length;D++){const R=I[D];let C;if(typeof R=="string")C=Object(p.loadTexture)(R);else if(Array.isArray(R))C=Object(p.loadFrames)(...R);else{const{id:W,src:z}=R;C=Object(p.loadTexture)(z,W)}C instanceof Promise||(C=Promise.resolve(C)),E.push(C.then(W=>{b.push(W),L[D]=W;const z=new l.default({type:"preload",detail:{current:W,loaded:b,resources:I}});this.dispatchEvent(z)}))}return await Promise.all(E),L}removeChild(I){const b=super.removeChild(I);if(b){I._prepareRenderFinished&&I._prepareRenderFinished();const E=I.canvas;E&&E.remove&&E.remove(),I.offscreen&&this[g]--}return b}render(){const I=this.orderedChildren;let b=null;const E=[];for(let L=0;L<I.length;L++){const D=I[L],R=E.length>0;if(D instanceof s.default&&!D.offscreen)if(!D.autoRender)R&&(console.warn("Some offscreen canvas will not be rendered."),E.length=0);else if(b=D,R){D.renderer.clear();for(let C=0;C<E.length;C++){const W=E[C];W.render(),T(D,W)}E.length=0,D.render({clear:!1})}else D.prepareRender&&D.render();else D.offscreen?b?(D.prepareRender&&D.render(),T(b,D)):E.push(D):D instanceof o.default&&R&&(console.warn("Some offscreen canvas will not be rendered."),E.length=0)}}replaceChild(I,b){const E=super.replaceChild(I,b);b.canvas.remove&&b.canvas.remove(),b.offscreen&&this[g]--;const L=I.canvas;if(!I.offscreen){const D=m(this,I);this.container.insertBefore(L,D)}return u(this.options,L),I.setResolution(this.getResolution()),E}resize(){const I=this.options;this.children.forEach(b=>{u(I,b.canvas)}),this.setResolution(I),this.dispatchEvent({type:"resize"})}setResolution({width:I,height:b}={}){const E=this.container,{clientWidth:L,clientHeight:D}=E;(I==null||b==null)&&(I=I??L,b=b??D);const{mode:R,displayRatio:C}=this.options;if(I*=C,b*=C,this.options.left=0,this.options.top=0,R==="stickyHeight"||R==="stickyLeft"||R==="stickyRight"){const W=I;I=L*b/D,R==="stickyHeight"&&(this.options.left=.5*(I-W)),R==="stickyRight"&&(this.options.left=I-W)}else if(R==="stickyWidth"||R==="stickyTop"||R==="stickyBottom"){const W=b;b=D*I/L,R==="stickyWidth"&&(this.options.top=.5*(b-W)),R==="stickyBottom"&&(this.options.top=b-W)}super.setResolution({width:I,height:b})}snapshot({offscreen:I=!1,layers:b}={}){const E=I?"snapshotOffScreenCanvas":"snapshotCanvas",{width:L,height:D}=this.getResolution();this[E]=this[E]||n.ENV.createCanvas(L,D,{offscreen:I});const R=this[E].getContext("2d");b=b||this.orderedChildren,this[E].width=L,this[E].height=D;for(let C=0;C<b.length;C++){const W=b[C];if(!W.options.ignoreSnapshot){W.render&&W.render();const z=W.canvas;z&&z!==W&&R.drawImage(z,0,0,L,D)}}return this[E]}}typeof document<"u"&&(M.prototype.layer3d=function(A,I={}){const b=I.url||"https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.min.js";return new Promise((E,L)=>{const D=document.createElement("script");D.async=!1,D.src=b,D.onload=()=>{try{E(this.layer3d(A,I))}catch(R){L(R)}},document.documentElement.appendChild(D)})}),y.default.registerNode(M,"scene")}).call(this,t(22))},function(d,r,t){t.r(r),t.d(r,"default",function(){return n});var e=t(214);t(1).glMatrix.setMatrixArrayType(Array);function n(i,{offsetTop:a=0,offsetLeft:s=0,displayRatio:o=1}={}){let f,v;const l=[],{left:p,top:y,width:O,height:x}=i.target.getBoundingClientRect(),m=i.target.width,T=i.target.height,c=i.changedTouches||[i];for(let u=0;u<c.length;u++){const g=c[u],M=g.identifier,{clientX:A,clientY:I}=g;A!=null&&I!=null&&l.push({x:Math.round((A|0)-p),y:Math.round((I|0)-y),identifier:M})}l.length<=0&&l.push({x:f,y:v});const h=[];return l.forEach(u=>{u.x!=null&&u.y!=null&&(f=(u.x*m/O-s)/o,v=(u.y*T/x-a)/o);const g=new e.default(i);Object.defineProperties(g,{layerX:{value:f,configurable:!0},layerY:{value:v,configurable:!0},originalX:{value:u.x},originalY:{value:u.y},x:{value:f,configurable:!0},y:{value:v,configurable:!0},identifier:{value:u.identifier}}),h.push(g)}),h}}]);Dt.version,Dt.Arc,Dt.Block,Dt.Cloud,Dt.Color;const Gh=Dt.Ellipse;Dt.Gradient;const se=Dt.Group,Hh=Dt.Label;Dt.Layer,Dt.LayerWorker,Dt.Node,Dt.Parallel;const ge=Dt.Path,pe=Dt.Polyline,hr=Dt.Rect;Dt.Regular,Dt.Ring;const Kh=Dt.Scene,Vh=Dt.Sprite;Dt.SpriteSvg,Dt.Star,Dt.Triangle,Dt.helpers,Dt.createElement,Dt.isSpriteNode,Dt.registerNode,Dt.requestAnimationFrame,Dt.cancelAnimationFrame,Dt.ENV;function Oe(d,r=!0){const t=d.length;if(t<2)return"";let e=d[0],n=d[1];if(t===2)return`M${Te(e)}L${Te(n)}`;let i="";for(let a=2,s=t-1;a<s;a++)e=d[a],n=d[a+1],i+=Me(e,n);return r?`M${Me(d[0],d[1])}Q${Te(d[1])}${Me(d[1],d[2])}T${i}${Me(d[t-1],d[0])}${Me(d[0],d[1])}Z`:`M${Te(d[0])}Q${Te(d[1])}${Me(d[1],d[2])}${d.length>3?"T":""}${i}L${Te(d[t-1])}`}var dr={exports:{}};dr.exports,function(d){var r=function(){var t=String.fromCharCode,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function a(o,f){if(!i[o]){i[o]={};for(var v=0;v<o.length;v++)i[o][o.charAt(v)]=v}return i[o][f]}var s={compressToBase64:function(o){if(o==null)return"";var f=s._compress(o,6,function(v){return e.charAt(v)});switch(f.length%4){default:case 0:return f;case 1:return f+"===";case 2:return f+"==";case 3:return f+"="}},decompressFromBase64:function(o){return o==null?"":o==""?null:s._decompress(o.length,32,function(f){return a(e,o.charAt(f))})},compressToUTF16:function(o){return o==null?"":s._compress(o,15,function(f){return t(f+32)})+" "},decompressFromUTF16:function(o){return o==null?"":o==""?null:s._decompress(o.length,16384,function(f){return o.charCodeAt(f)-32})},compressToUint8Array:function(o){for(var f=s.compress(o),v=new Uint8Array(f.length*2),l=0,p=f.length;l<p;l++){var y=f.charCodeAt(l);v[l*2]=y>>>8,v[l*2+1]=y%256}return v},decompressFromUint8Array:function(o){if(o==null)return s.decompress(o);for(var f=new Array(o.length/2),v=0,l=f.length;v<l;v++)f[v]=o[v*2]*256+o[v*2+1];var p=[];return f.forEach(function(y){p.push(t(y))}),s.decompress(p.join(""))},compressToEncodedURIComponent:function(o){return o==null?"":s._compress(o,6,function(f){return n.charAt(f)})},decompressFromEncodedURIComponent:function(o){return o==null?"":o==""?null:(o=o.replace(/ /g,"+"),s._decompress(o.length,32,function(f){return a(n,o.charAt(f))}))},compress:function(o){return s._compress(o,16,function(f){return t(f)})},_compress:function(o,f,v){if(o==null)return"";var l,p,y={},O={},x="",m="",T="",c=2,h=3,u=2,g=[],M=0,A=0,I;for(I=0;I<o.length;I+=1)if(x=o.charAt(I),Object.prototype.hasOwnProperty.call(y,x)||(y[x]=h++,O[x]=!0),m=T+x,Object.prototype.hasOwnProperty.call(y,m))T=m;else{if(Object.prototype.hasOwnProperty.call(O,T)){if(T.charCodeAt(0)<256){for(l=0;l<u;l++)M=M<<1,A==f-1?(A=0,g.push(v(M)),M=0):A++;for(p=T.charCodeAt(0),l=0;l<8;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1}else{for(p=1,l=0;l<u;l++)M=M<<1|p,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=0;for(p=T.charCodeAt(0),l=0;l<16;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1}c--,c==0&&(c=Math.pow(2,u),u++),delete O[T]}else for(p=y[T],l=0;l<u;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1;c--,c==0&&(c=Math.pow(2,u),u++),y[m]=h++,T=String(x)}if(T!==""){if(Object.prototype.hasOwnProperty.call(O,T)){if(T.charCodeAt(0)<256){for(l=0;l<u;l++)M=M<<1,A==f-1?(A=0,g.push(v(M)),M=0):A++;for(p=T.charCodeAt(0),l=0;l<8;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1}else{for(p=1,l=0;l<u;l++)M=M<<1|p,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=0;for(p=T.charCodeAt(0),l=0;l<16;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1}c--,c==0&&(c=Math.pow(2,u),u++),delete O[T]}else for(p=y[T],l=0;l<u;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1;c--,c==0&&(c=Math.pow(2,u),u++)}for(p=2,l=0;l<u;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1;for(;;)if(M=M<<1,A==f-1){g.push(v(M));break}else A++;return g.join("")},decompress:function(o){return o==null?"":o==""?null:s._decompress(o.length,32768,function(f){return o.charCodeAt(f)})},_decompress:function(o,f,v){var l=[],p=4,y=4,O=3,x="",m=[],T,c,h,u,g,M,A,I={val:v(0),position:f,index:1};for(T=0;T<3;T+=1)l[T]=T;for(h=0,g=Math.pow(2,2),M=1;M!=g;)u=I.val&I.position,I.position>>=1,I.position==0&&(I.position=f,I.val=v(I.index++)),h|=(u>0?1:0)*M,M<<=1;switch(h){case 0:for(h=0,g=Math.pow(2,8),M=1;M!=g;)u=I.val&I.position,I.position>>=1,I.position==0&&(I.position=f,I.val=v(I.index++)),h|=(u>0?1:0)*M,M<<=1;A=t(h);break;case 1:for(h=0,g=Math.pow(2,16),M=1;M!=g;)u=I.val&I.position,I.position>>=1,I.position==0&&(I.position=f,I.val=v(I.index++)),h|=(u>0?1:0)*M,M<<=1;A=t(h);break;case 2:return""}for(l[3]=A,c=A,m.push(A);;){if(I.index>o)return"";for(h=0,g=Math.pow(2,O),M=1;M!=g;)u=I.val&I.position,I.position>>=1,I.position==0&&(I.position=f,I.val=v(I.index++)),h|=(u>0?1:0)*M,M<<=1;switch(A=h){case 0:for(h=0,g=Math.pow(2,8),M=1;M!=g;)u=I.val&I.position,I.position>>=1,I.position==0&&(I.position=f,I.val=v(I.index++)),h|=(u>0?1:0)*M,M<<=1;l[y++]=t(h),A=y-1,p--;break;case 1:for(h=0,g=Math.pow(2,16),M=1;M!=g;)u=I.val&I.position,I.position>>=1,I.position==0&&(I.position=f,I.val=v(I.index++)),h|=(u>0?1:0)*M,M<<=1;l[y++]=t(h),A=y-1,p--;break;case 2:return m.join("")}if(p==0&&(p=Math.pow(2,O),O++),l[A])x=l[A];else if(A===y)x=c+c.charAt(0);else return null;m.push(x),l[y++]=c+x.charAt(0),p--,c=x,p==0&&(p=Math.pow(2,O),O++)}}};return s}();d!=null?d.exports=r:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return r})}(dr);var Mn=dr.exports;function Ie(d){return JSON.parse(Mn.decompress(d))}function qt(d){return Mn.compress(JSON.stringify(d))}class On extends yt{constructor(t){super(t);nt(this,"canRotate",!0);nt(this,"scaleType",jt.all);nt(this,"toolsType",ht.Pencil);nt(this,"syncTimestamp");nt(this,"syncIndex",0);nt(this,"tmpPoints",[]);nt(this,"MAX_REPEAR",10);nt(this,"uniThickness");nt(this,"workOptions");nt(this,"centerPos",[0,0]);this.workOptions=t.toolsOpt,this.uniThickness=this.MAX_REPEAR/this.workOptions.thickness/10,this.syncTimestamp=0}combineConsume(){var s;const t=(s=this.workId)==null?void 0:s.toString(),e=this.transformDataAll(!0),n={name:t};let i;const a=this.drawLayer||this.fullLayer;return e.length&&(i=this.draw({attrs:n,tasks:e,replaceId:t,layer:a})),{rect:i,type:ct.DrawWork,dataType:Tt.Local}}setWorkOptions(t){super.setWorkOptions(t),this.syncTimestamp=Date.now()}consume(t){var c;const{data:e,isFullWork:n,isSubWorker:i,isMainThread:a,drawCount:s,replaceId:o}=t;if(((c=e.op)==null?void 0:c.length)===0)return{type:ct.None};const{workId:f}=e,{tasks:v,effects:l,consumeIndex:p}=this.transformData(e,!1);this.syncIndex=Math.min(this.syncIndex,p,Math.max(0,this.tmpPoints.length-2));const y={name:f==null?void 0:f.toString(),id:s==null?void 0:s.toString()};let O,x=!1;const m=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),v.length&&(v[0].taskId-this.syncTimestamp>this.syncUnitTime&&(x=!0,this.syncTimestamp=v[0].taskId,this.syncIndex=this.tmpPoints.length),i||a)){const h=n?this.fullLayer:this.drawLayer||this.fullLayer;O=this.draw({attrs:y,tasks:v,effects:l,layer:h,replaceId:o})}if(i)return p>10&&this.tmpPoints.splice(0,p-10),{rect:O,type:ct.DrawWork,dataType:Tt.Local};const T=[];return this.tmpPoints.slice(m).forEach(h=>{T.push(h.x,h.y,this.computRadius(h.z,this.workOptions.thickness))}),{rect:O,type:ct.DrawWork,dataType:Tt.Local,workId:x?f:void 0,op:x?T:void 0,index:x?m*3:void 0}}consumeAll(t){var v,l;if(t.data){const{op:p,workState:y}=t.data;p!=null&&p.length&&y===Rt.Done&&this.workOptions.strokeType===Vt.Stroke&&this.updateTempPointsWithPressureWhenDone(p)}const e=(v=this.workId)==null?void 0:v.toString();if(!e)return{type:ct.None};const n=this.transformDataAll(!0),i={name:e};let a;const s=this.fullLayer;n.length&&(a=this.draw({attrs:i,tasks:n,replaceId:e,layer:s}));const o=[];this.tmpPoints.map(p=>{o.push(p.x,p.y,this.computRadius(p.z,this.workOptions.thickness))}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;const f=qt(o);return(l=this.vNodes)==null||l.setInfo(e,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,s)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:e,ops:f,updateNodeOpt:{pos:this.centerPos,useAnimation:!0},opt:this.workOptions}}clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0}consumeService(t){var v,l;const{op:e,isFullWork:n,replaceId:i}=t;this.tmpPoints.length=0;for(let p=0;p<e.length;p+=3){const y=new xt(e[p],e[p+1],e[p+2]);if(this.tmpPoints.length>0){const O=this.tmpPoints[this.tmpPoints.length-1],x=_.Sub(y,O).uni();y.setv(x)}this.tmpPoints.push(y)}const a=this.transformDataAll(!1),s=(v=this.workId)==null?void 0:v.toString(),o={name:s};let f;if(s&&a.length){const p=n?this.fullLayer:this.drawLayer||this.fullLayer;f=this.draw({attrs:o,tasks:a,replaceId:i,layer:p}),(l=this.vNodes)==null||l.setInfo(s,{rect:f,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&yt.getCenterPos(f,p)})}return f}transformDataAll(t=!0){return this.getTaskPoints(this.tmpPoints,t&&this.workOptions.thickness||void 0)}draw(t){const{attrs:e,tasks:n,replaceId:i,effects:a,layer:s}=t,{strokeColor:o,strokeType:f,thickness:v,zIndex:l,scale:p,rotate:y,translate:O}=this.workOptions;a!=null&&a.size&&(a.forEach(u=>{var g;(g=s.getElementById(u+""))==null||g.remove()}),a.clear());let x;const m=[],T=s.worldPosition,c=s.worldScaling;for(let u=0;u<n.length;u++){const{pos:g,points:M}=n[u],{ps:A,rect:I}=this.computDrawPoints(M);let b;const E=M.length===1;f===Vt.Stroke||E?b=Oe(A,!0):b=Oe(A,!1);const L={pos:g,d:b,fillColor:f===Vt.Stroke||E?o:void 0,lineDash:f===Vt.Dotted&&!E?[1,v*2]:f===Vt.LongDotted&&!E?[v,v*2]:void 0,strokeColor:o,lineCap:f===Vt.Stroke||E?void 0:"round",lineWidth:f===Vt.Stroke||E?0:v};x=Ot(x,{x:Math.floor((I.x+g[0])*c[0]+T[0]-yt.SafeBorderPadding),y:Math.floor((I.y+g[1])*c[1]+T[1]-yt.SafeBorderPadding),w:Math.floor(I.w*c[0]+2*yt.SafeBorderPadding),h:Math.floor(I.h*c[1]+2*yt.SafeBorderPadding)}),m.push(L)}p&&(e.scale=p),y&&(e.rotate=y),O&&(e.translate=O);const h=new se;if(x){this.centerPos=yt.getCenterPos(x,s),h.attr({...e,normalize:!0,anchor:[.5,.5],bgcolor:f===Vt.Stroke?o:void 0,pos:this.centerPos,size:[(x.w-2*yt.SafeBorderPadding)/c[0],(x.h-2*yt.SafeBorderPadding)/c[1]],zIndex:l});const u=m.map(g=>(g.pos=[g.pos[0]-this.centerPos[0],g.pos[1]-this.centerPos[1]],new ge(g)));h.append(...u),f===Vt.Stroke&&h.seal(),this.replace(s,i||e.workId,h)}if(p||y||O){const u=h==null?void 0:h.getBoundingClientRect();if(u)return{x:Math.floor(u.x-yt.SafeBorderPadding),y:Math.floor(u.y-yt.SafeBorderPadding),w:Math.floor(u.width+yt.SafeBorderPadding*2),h:Math.floor(u.height+yt.SafeBorderPadding*2)}}return x}computDrawPoints(t){return this.workOptions.strokeType===Vt.Stroke||t.length===1?this.computStroke(t):this.computNomal(t)}computNomal(t){let e=this.workOptions.thickness;const n=t.map(i=>(e=Math.max(e,i.radius),i.point));return{ps:n,rect:wt(n,e)}}computStroke(t){return t.length===1?this.computDotStroke(t[0]):this.computLineStroke(t)}computLineStroke(t){const e=[],n=[];for(let f=0;f<t.length;f++){const{point:v,radius:l}=t[f];let p=v.v;f===0&&t.length>1&&(p=t[f+1].point.v);const y=_.Per(p).mul(l);e.push(xt.Sub(v,y)),n.push(xt.Add(v,y))}const i=t[t.length-1],a=xt.GetSemicircleStroke(i.point,e[e.length-1],-1,8),s=xt.GetSemicircleStroke(t[0].point,n[0],-1,8),o=e.concat(a,n.reverse(),s);return{ps:o,rect:wt(o)}}computDotStroke(t){const{point:e,radius:n}=t,i={x:e.x-n,y:e.y-n,w:n*2,h:n*2};return{ps:xt.GetDotStroke(e,n,8),rect:i}}transformData(t,e){const{op:n,workState:i}=t;let a=this.tmpPoints.length-1,s=[];if(n!=null&&n.length&&i){const{strokeType:o,thickness:f}=this.workOptions,v=new Set;a=o===Vt.Stroke?this.updateTempPointsWithPressure(n,f,v):this.updateTempPoints(n,f,v);const l=e?this.tmpPoints:this.tmpPoints.slice(a);return s=this.getTaskPoints(l,f),{tasks:s,effects:v,consumeIndex:a}}return{tasks:s,consumeIndex:a}}computRadius(t,e){return t*.03*e+e*.5}getMinZ(t,e){return((e||Math.max(1,Math.floor(t*.3)))-t*.5)*100/t/3}getTaskPoints(t,e){var l;const n=[];if(t.length===0)return[];let i=0,a=t[0].x,s=t[0].y,o=[a,s],f=[],v=t[0].t;for(;i<t.length;){const p=t[i],y=p.x-a,O=p.y-s,x=p.z,m=e?this.computRadius(x,e):x;if(f.push({point:new xt(y,O,x,t[i].v),radius:m}),i>0&&i<t.length-1){const T=t[i].getAngleByPoints(t[i-1],t[i+1]);if(T<90||T>270){const c=(l=f.pop())==null?void 0:l.point.clone();c&&n.push({taskId:v,pos:o,points:[...f,{point:c,radius:m}]}),a=t[i].x,s=t[i].y,o=[a,s];const h=p.x-a,u=p.y-s;f=[{point:new xt(h,u,x),radius:m}],v=Date.now()}}i++}return n.push({taskId:v,pos:o,points:f}),n}updateTempPointsWithPressure(t,e,n){const i=Date.now(),a=this.tmpPoints.length;let s=a;for(let f=0;f<t.length;f+=2){s=Math.min(s,a);const v=this.tmpPoints.length,l=new xt(t[f],t[f+1]);if(v===0){this.tmpPoints.push(l);continue}const p=v-1,y=this.tmpPoints[p],O=_.Sub(l,y).uni();if(l.isNear(y,e)){if(y.z<this.MAX_REPEAR){if(y.setz(Math.min(y.z+1,this.MAX_REPEAR)),s=Math.min(s,p),v>1){let T=v-1;for(;T>0;){const c=this.tmpPoints[T].distance(this.tmpPoints[T-1]),h=Math.max(this.tmpPoints[T].z-this.uniThickness*c,0);if(this.tmpPoints[T-1].z>=h)break;this.tmpPoints[T-1].setz(h),s=Math.min(s,T-1),T--}}}else s=1/0;continue}l.setv(O);const x=l.distance(y),m=Math.max(y.z-this.uniThickness*x,0);v>1&&_.Equals(O,y.v,.02)&&(m>0||y.z<=0)&&(n&&y.t&&n.add(y.t),this.tmpPoints.pop(),s=Math.min(p,s)),l.setz(m),this.tmpPoints.push(l)}if(s===1/0)return this.tmpPoints.length;let o=a;if(s===a){o=Math.max(o-1,0);const f=this.tmpPoints[o].t;f&&(n==null||n.add(f))}else{let f=a-1;for(o=s;f>=0;){const v=this.tmpPoints[f].t;if(v&&(n==null||n.add(v),f<=s)){o=f,f=-1;break}f--}}return this.tmpPoints[o].setT(i),o}updateTempPoints(t,e,n){var f;const i=Date.now(),a=this.tmpPoints.length;let s=a;for(let v=0;v<t.length;v+=2){const l=this.tmpPoints.length,p=new xt(t[v],t[v+1]);if(l===0){this.tmpPoints.push(p);continue}const y=l-1,O=this.tmpPoints[y],x=_.Sub(p,O).uni();if(p.isNear(O,e/2)){s=Math.min(y,s);continue}_.Equals(x,O.v,.02)&&(n&&O.t&&n.add(O.t),this.tmpPoints.pop(),s=Math.min(y,s)),p.setv(x),this.tmpPoints.push(p)}let o=a;if(s===a){o=Math.max(o-1,0);const v=this.tmpPoints[o].t;v&&(n==null||n.add(v))}else{let v=Math.min(a-1,s);for(o=s;v>=0;){const l=(f=this.tmpPoints[v])==null?void 0:f.t;if(l&&(n==null||n.add(l),v<=s)){o=v,v=-1;break}v--}}return this.tmpPoints[o].setT(i),o}updateTempPointsWithPressureWhenDone(t){const{thickness:e}=this.workOptions,n=t.length,i=this.getMinZ(e);for(let a=0;a<n;a+=2){const s=this.tmpPoints.length,o=new xt(t[a],t[a+1]);if(s===0){this.tmpPoints.push(o);continue}const f=s-1,v=this.tmpPoints[f],l=_.Sub(o,v).uni(),p=o.distance(v);if(s>1&&v.z===i)break;if(o.isNear(v,e/2)){if(n<3&&v.z<this.MAX_REPEAR&&(v.setz(Math.min(v.z+1,this.MAX_REPEAR)),s>1)){let O=s-1;for(;O>0;){const x=this.tmpPoints[O].distance(this.tmpPoints[O-1]),m=Math.max(this.tmpPoints[O].z-this.uniThickness*x,-e/4);if(this.tmpPoints[O-1].z>=m)break;this.tmpPoints[O-1].setz(m),O--}}continue}o.setv(l);const y=Math.max(v.z-this.uniThickness*p,i);s>1&&_.Equals(l,v.v,.02)&&v.z<=0&&this.tmpPoints.pop(),o.setz(y),this.tmpPoints.push(o)}}static updateNodeOpt(t){var o;const{node:e,opt:n,vNodes:i}=t,{strokeColor:a}=n,s=i.get(e.name);return a&&(e.tagName==="GROUP"?Wh(e)?e.setAttribute("bgcolor",a):e.children.forEach(f=>{f.setAttribute("strokeColor",a),f.getAttribute("fillColor")&&f.setAttribute("fillColor",a)}):(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a)),(o=s==null?void 0:s.opt)!=null&&o.strokeColor&&(s.opt.strokeColor=a)),s&&i.setInfo(e.name,s),yt.updateNodeOpt(t)}}class En extends yt{constructor(t){super(t);nt(this,"toolsType",ht.LaserPen);nt(this,"canRotate",!1);nt(this,"scaleType",jt.none);nt(this,"syncTimestamp");nt(this,"syncIndex",0);nt(this,"tmpPoints",[]);nt(this,"workOptions");nt(this,"consumeIndex",0);this.workOptions=t.toolsOpt,this.syncTimestamp=0}combineConsume(){}setWorkOptions(t){super.setWorkOptions(t),this.syncTimestamp=Date.now()}consume(t){const{data:e,isSubWorker:n}=t,{workId:i,op:a}=e;if((a==null?void 0:a.length)===0)return{type:ct.None};if(this.updateTempPoints(a||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:ct.None};const{strokeColor:s,thickness:o,strokeType:f}=this.workOptions,v=wt(this.tmpPoints,o);let l=!1;const p=this.syncIndex,y=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());const O={name:i==null?void 0:i.toString(),opacity:1,lineDash:f===Vt.Dotted?[1,o*2]:f===Vt.LongDotted?[o,o*2]:void 0,strokeColor:s,lineCap:"round",lineWidth:o,anchor:[.5,.5]},x=this.getTaskPoints(y);if(x.length){const T=Date.now();T-this.syncTimestamp>this.syncUnitTime&&(l=!0,this.syncTimestamp=T,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:O,tasks:x,isDot:!1,layer:this.drawLayer||this.fullLayer})}const m=[];return this.tmpPoints.slice(p).forEach(T=>{m.push(T.x,T.y)}),{rect:{x:v.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:v.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:v.w*this.fullLayer.worldScaling[0],h:v.h*this.fullLayer.worldScaling[1]},type:ct.DrawWork,dataType:Tt.Local,workId:l?i:void 0,op:l?m:void 0,index:l?p*2:void 0}}consumeAll(){var a;const t=(a=this.workId)==null?void 0:a.toString();let e;if(this.tmpPoints.length-1>this.consumeIndex){let s=this.tmpPoints.slice(this.consumeIndex);const o=s.length===1,{strokeColor:f,thickness:v,strokeType:l}=this.workOptions;if(o){const O=this.computDotStroke({point:s[0],radius:v/2});s=O.ps,e=O.rect}else e=wt(this.tmpPoints,v);const p={name:t==null?void 0:t.toString(),fillColor:o?f:void 0,opacity:1,lineDash:l===Vt.Dotted&&!o?[1,v*2]:l===Vt.LongDotted&&!o?[v,v*2]:void 0,strokeColor:f,lineCap:o?void 0:"round",lineWidth:o?0:v,anchor:[.5,.5]},y=this.getTaskPoints(s);y.length&&this.draw({attrs:p,tasks:y,isDot:o,layer:this.drawLayer||this.fullLayer})}const n=[];this.tmpPoints.forEach(s=>{n.push(s.x,s.y)});const i=qt(n);return{rect:e&&{x:e.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:e.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:e.w*this.fullLayer.worldScaling[0],h:e.h*this.fullLayer.worldScaling[1]},type:ct.FullWork,dataType:Tt.Local,workId:t,ops:i,index:this.syncIndex*2}}clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0}consumeService(t){var x;const{op:e,replaceId:n,isFullWork:i}=t,{strokeColor:a,thickness:s,strokeType:o}=this.workOptions;if(!e.length){const m=wt(this.tmpPoints,s);return{x:m.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:m.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:m.w*this.fullLayer.worldScaling[0],h:m.h*this.fullLayer.worldScaling[1]}}const f=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(e||[]);let v,l=this.tmpPoints.slice(f);const p=l.length===1;if(p){const m=this.computDotStroke({point:l[0],radius:s/2});l=m.ps,v=m.rect}else v=wt(this.tmpPoints,s);const y={name:(x=this.workId)==null?void 0:x.toString(),fillColor:p?a:void 0,opacity:1,lineDash:o===Vt.Dotted&&!p?[1,s*2]:o===Vt.LongDotted&&!p?[s,s*2]:void 0,strokeColor:a,lineCap:p?void 0:"round",lineWidth:p?0:s,anchor:[.5,.5]},O=this.getTaskPoints(l);if(O.length){const m=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:y,tasks:O,isDot:p,replaceId:n,layer:m})}return{x:v.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:v.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:v.w*this.fullLayer.worldScaling[0],h:v.h*this.fullLayer.worldScaling[1]}}computDotStroke(t){const{point:e,radius:n}=t,i={x:e.x-n,y:e.y-n,w:n*2,h:n*2};return{ps:xt.GetDotStroke(e,n,8),rect:i}}updateTempPoints(t){const e=this.tmpPoints.length;for(let n=0;n<t.length;n+=2){if(e){const i=this.tmpPoints.slice(-1)[0];i&&i.x===t[n]&&i.y===t[n+1]&&this.tmpPoints.pop()}this.tmpPoints.push(new xt(t[n],t[n+1]))}}async draw(t){const{attrs:e,tasks:n,isDot:i,layer:a}=t,{duration:s}=this.workOptions;for(const o of n){const f=new ge,{pos:v,points:l}=o;let p;i?p=Oe(l,!0):p=Oe(l,!1),f.attr({...e,pos:v,d:p});const{vertex:y,fragment:O}=this.workOptions;if(y&&O){const x=a.renderer.createProgram({vertex:y,fragment:O}),{width:m,height:T}=a.getResolution();f.setUniforms({u_time:0,u_resolution:[m,T]}),f.setProgram(x)}a.appendChild(f),f.transition(s).attr({scale:i?[.1,.1]:[1,1],lineWidth:i?0:1}).then(()=>{f.remove()})}}getTaskPoints(t){var f;const e=[];if(t.length===0)return[];let n=0,i=t[0].x,a=t[0].y,s=[i,a],o=[];for(;n<t.length;){const v=t[n],l=v.x-i,p=v.y-a;if(o.push(new xt(l,p)),n>0&&n<t.length-1){const y=t[n].getAngleByPoints(t[n-1],t[n+1]);if(y<90||y>270){const O=(f=o.pop())==null?void 0:f.clone();O&&e.push({pos:s,points:[...o,O]}),i=t[n].x,a=t[n].y,s=[i,a];const x=v.x-i,m=v.y-a;o=[new xt(x,m)]}}n++}return e.push({pos:s,points:o}),e}removeLocal(){}removeService(t){let e;const n=[];return this.fullLayer.getElementsByName(t).forEach(i=>{if(i.name===t){const a=i.getBoundingClientRect();e=Ot(e,{x:a.x,y:a.y,w:a.width,h:a.height}),n.push(i)}}),n.length&&n.forEach(i=>i.remove()),e}}var Yh=Xe;Xe.polyline=Xe,Xe.polygon=Xh;function Xe(d,r,t){var e=d.length,n=Ee(d[0],r),i=[],a,s,o,f,v;for(t||(t=[]),a=1;a<e;a++){for(s=d[a-1],o=d[a],f=v=Ee(o,r);;)if(n|f){if(n&f)break;n?(s=gr(s,o,n,r),n=Ee(s,r)):(o=gr(s,o,f,r),f=Ee(o,r))}else{i.push(s),f!==v?(i.push(o),a<e-1&&(t.push(i),i=[])):a===e-1&&i.push(o);break}n=v}return i.length&&t.push(i),t}function Xh(d,r){var t,e,n,i,a,s,o;for(e=1;e<=8;e*=2){for(t=[],n=d[d.length-1],i=!(Ee(n,r)&e),a=0;a<d.length;a++)s=d[a],o=!(Ee(s,r)&e),o!==i&&t.push(gr(n,s,e,r)),o&&t.push(s),n=s,i=o;if(d=t,!d.length)break}return t}function gr(d,r,t,e){return t&8?[d[0]+(r[0]-d[0])*(e[3]-d[1])/(r[1]-d[1]),e[3]]:t&4?[d[0]+(r[0]-d[0])*(e[1]-d[1])/(r[1]-d[1]),e[1]]:t&2?[e[2],d[1]+(r[1]-d[1])*(e[2]-d[0])/(r[0]-d[0])]:t&1?[e[0],d[1]+(r[1]-d[1])*(e[0]-d[0])/(r[0]-d[0])]:null}function Ee(d,r){var t=0;return d[0]<r[0]?t|=1:d[0]>r[2]&&(t|=2),d[1]<r[1]?t|=4:d[1]>r[3]&&(t|=8),t}var Jh=Xt(Yh);const Pe=class Pe extends yt{constructor(t,e){super(t);nt(this,"canRotate",!1);nt(this,"scaleType",jt.none);nt(this,"toolsType",ht.Eraser);nt(this,"serviceWork");nt(this,"tmpPoints",[]);nt(this,"workOptions");nt(this,"worldPosition");nt(this,"worldScaling");nt(this,"eraserRect");nt(this,"eraserPolyline");this.serviceWork=e,this.workOptions=t.toolsOpt,this.worldPosition=this.fullLayer.worldPosition,this.worldScaling=this.fullLayer.worldScaling}combineConsume(){}consumeService(){}setWorkOptions(t){super.setWorkOptions(t)}createEraserRect(t){const e=t[0]*this.worldScaling[0]+this.worldPosition[0],n=t[1]*this.worldScaling[1]+this.worldPosition[1],{width:i,height:a}=Pe.eraserSizes[this.workOptions.thickness];this.eraserRect={x:e-i*.5,y:n-a*.5,w:i,h:a},this.eraserPolyline=[this.eraserRect.x,this.eraserRect.y,this.eraserRect.x+this.eraserRect.w,this.eraserRect.y+this.eraserRect.h]}computRectCenterPoints(){const t=this.tmpPoints.slice(-2);if(this.tmpPoints.length===4){const e=new _(this.tmpPoints[0],this.tmpPoints[1]),n=new _(this.tmpPoints[2],this.tmpPoints[3]),i=_.Sub(n,e).uni(),a=_.Dist(e,n),{width:s,height:o}=Pe.eraserSizes[this.workOptions.thickness],f=Math.min(s,o),v=Math.round(a/f);if(v>1){const l=[];for(let p=0;p<v;p++){const y=_.Mul(i,p*f);l.push(this.tmpPoints[0]+y.x,this.tmpPoints[1]+y.y)}return l.concat(t)}}return t}isNear(t,e){const n=new _(t[0],t[1]),i=new _(e[0],e[1]),{width:a,height:s}=Pe.eraserSizes[this.workOptions.thickness];return _.Dist(n,i)<Math.hypot(a,s)*.5}cutPolyline(t,e){let n=[e],i=0;for(;i<t.length;){const o=t[i];if(o.length<2)break;n=a(n,o),i++}return n;function a(o,f){const v=o;for(let l=0;l<o.length;l++){const p=o[l],y=p.findIndex((O,x)=>x<p.length-1?s([O,p[x+1]],[f[0],f[1]]):!1);if(y!==-1&&y>-1){const O=[],x=p.slice(0,y+1);if(_.Equals(p[y],f[0])||x.push(f[0].clone().setz(p[y].z)),x.length>1&&O.push(x),y+f.length-1<p.length-1){const m=y+f.length-1,T=p.slice(m),c=f[f.length-1];_.Equals(p[m],c)||T.unshift(c.clone().setz(p[m].z)),T.length>1&&O.push(T)}return v.splice(l,1,...O),v}}return v}function s(o,f){const v=_.Sub(o[1],o[0]),l=_.Sub(f[1],f[0]),p=_.Sub(f[0],o[0]);return Math.abs(_.Cpr(v,l))<.1&&Math.abs(_.Cpr(v,p))<.1}}isSamePoint(t,e){return t[0]===e[0]&&t[1]===e[1]}translateIntersect(t){const e=[];for(let n=0;n<t.length;n++){const i=t[n].filter((o,f,v)=>!(f>0&&this.isSamePoint(o,v[f-1]))),a=[];let s=0;for(;s<i.length;){const o=i[s],f=new _(o[0],o[1]);a.push(f),s++}e.push(a)}return e}isLineEraser(t,e){return!(t===ht.Pencil&&!e)}remove(t){const{curNodeMap:e,removeIds:n,newWorkDatas:i}=t,{isLine:a}=this.workOptions;let s;for(const[o,f]of e.entries())if(f.rect&&this.eraserRect&&this.eraserPolyline&&Ce(this.eraserRect,f.rect)){const{op:v,toolsType:l}=f,p=this.isLineEraser(l,a),y=[],O=[];for(let m=0;m<v.length;m+=3){const T=new _(v[m]*this.worldScaling[0]+this.worldPosition[0],v[m+1]*this.worldScaling[1]+this.worldPosition[1],v[m+2]);O.push(T),y.push(new xt(T.x,T.y))}const x=y.length&&wt(y)||f.rect;if(Ce(x,this.eraserRect)){if(O.length>1){const m=Jh.polyline(O.map(T=>T.XY),this.eraserPolyline);if(m.length&&(n.add(f.name),!p)){const T=this.translateIntersect(m),c=this.cutPolyline(T,O);for(let h=0;h<c.length;h++){const u=`${o}_s_${h}`,g=[];c[h].forEach(M=>{g.push((M.x-this.worldPosition[0])/this.worldScaling[0],(M.y-this.worldPosition[1])/this.worldScaling[1],M.z)}),f.opt&&f.toolsType&&this.vNodes&&(this.vNodes.setInfo(u,{rect:x,op:g,opt:f.opt,canRotate:f.canRotate,scaleType:f.scaleType,toolsType:f.toolsType}),i.set(u,{workId:u,op:g,opt:f.opt,toolsType:f.toolsType}))}}}else n.add(f.name);s=Ot(s,x)}}return n.forEach(o=>{var f;return(f=this.vNodes)==null?void 0:f.delete(o)}),s&&(s.x-=yt.SafeBorderPadding,s.y-=yt.SafeBorderPadding,s.w+=yt.SafeBorderPadding*2,s.h+=yt.SafeBorderPadding*2),s}consume(t){const{op:e}=t.data;if(!e||e.length===0)return{type:ct.None};const n=this.tmpPoints.length;if(n>1&&this.isNear([e[0],e[1]],[this.tmpPoints[n-2],this.tmpPoints[n-1]]))return{type:ct.None};n===4&&(this.tmpPoints.shift(),this.tmpPoints.shift()),this.tmpPoints.push(e[0],e[1]);const i=this.computRectCenterPoints();let a;const s=new Set,o=new Map;if(!this.vNodes)return{type:ct.None};this.vNodes.setTarget();const f=this.getUnLockNodeMap(this.vNodes.getLastTarget());for(let v=0;v<i.length-1;v+=2){this.createEraserRect(i.slice(v,v+2));const l=this.remove({curNodeMap:f,removeIds:s,newWorkDatas:o});a=Ot(a,l)}if(this.vNodes.deleteLastTarget(),a&&s.size){for(const v of o.keys())s.has(v)&&o.delete(v);return{type:ct.RemoveNode,dataType:Tt.Local,rect:a,removeIds:[...s],newWorkDatas:o}}return{type:ct.None}}consumeAll(t){return this.consume(t)}clearTmpPoints(){this.tmpPoints.length=0}getUnLockNodeMap(t){var e;if(this.serviceWork){const n=Jt(t),i=this.serviceWork.selectorWorkShapes,a=this.serviceWork.workShapes;for(const s of i.values())if((e=s.selectIds)!=null&&e.length)for(const o of s.selectIds)n.delete(o);for(const s of a.keys())n.delete(s);return n}return t}};nt(Pe,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));let ae=Pe;const pr="++",Qh="selector",Zh="all";var kh="__lodash_hash_undefined__";function qh(d){return this.__data__.set(d,kh),this}var _h=qh;function td(d){return this.__data__.has(d)}var ed=td,rd=br,nd=_h,id=ed;function Je(d){var r=-1,t=d==null?0:d.length;for(this.__data__=new rd;++r<t;)this.add(d[r])}Je.prototype.add=Je.prototype.push=nd,Je.prototype.has=id;var sd=Je;function od(d,r){for(var t=-1,e=d==null?0:d.length;++t<e;)if(r(d[t],t,d))return!0;return!1}var ad=od;function ld(d,r){return d.has(r)}var cd=ld,fd=sd,ud=ad,hd=cd,dd=1,gd=2;function pd(d,r,t,e,n,i){var a=t&dd,s=d.length,o=r.length;if(s!=o&&!(a&&o>s))return!1;var f=i.get(d),v=i.get(r);if(f&&v)return f==r&&v==d;var l=-1,p=!0,y=t&gd?new fd:void 0;for(i.set(d,r),i.set(r,d);++l<s;){var O=d[l],x=r[l];if(e)var m=a?e(x,O,l,r,d,i):e(O,x,l,d,r,i);if(m!==void 0){if(m)continue;p=!1;break}if(y){if(!ud(r,function(T,c){if(!hd(y,c)&&(O===T||n(O,T,t,e,i)))return y.push(c)})){p=!1;break}}else if(!(O===x||n(O,x,t,e,i))){p=!1;break}}return i.delete(d),i.delete(r),p}var Pn=pd;function vd(d){var r=-1,t=Array(d.size);return d.forEach(function(e,n){t[++r]=[n,e]}),t}var md=vd;function yd(d){var r=-1,t=Array(d.size);return d.forEach(function(e){t[++r]=e}),t}var Sd=yd,An=Be,Cn=sn,xd=Ze,Td=Pn,Md=md,Od=Sd,Ed=1,Pd=2,Ad="[object Boolean]",Cd="[object Date]",Rd="[object Error]",Id="[object Map]",Ld="[object Number]",bd="[object RegExp]",Dd="[object Set]",wd="[object String]",Nd="[object Symbol]",Wd="[object ArrayBuffer]",Bd="[object DataView]",Rn=An?An.prototype:void 0,vr=Rn?Rn.valueOf:void 0;function Fd(d,r,t,e,n,i,a){switch(t){case Bd:if(d.byteLength!=r.byteLength||d.byteOffset!=r.byteOffset)return!1;d=d.buffer,r=r.buffer;case Wd:return!(d.byteLength!=r.byteLength||!i(new Cn(d),new Cn(r)));case Ad:case Cd:case Ld:return xd(+d,+r);case Rd:return d.name==r.name&&d.message==r.message;case bd:case wd:return d==r+"";case Id:var s=Md;case Dd:var o=e&Ed;if(s||(s=Od),d.size!=r.size&&!o)return!1;var f=a.get(d);if(f)return f==r;e|=Pd,a.set(d,r);var v=Td(s(d),s(r),e,n,i,a);return a.delete(d),v;case Nd:if(vr)return vr.call(d)==vr.call(r)}return!1}var jd=Fd,In=kr,Ud=1,$d=Object.prototype,zd=$d.hasOwnProperty;function Gd(d,r,t,e,n,i){var a=t&Ud,s=In(d),o=s.length,f=In(r),v=f.length;if(o!=v&&!a)return!1;for(var l=o;l--;){var p=s[l];if(!(a?p in r:zd.call(r,p)))return!1}var y=i.get(d),O=i.get(r);if(y&&O)return y==r&&O==d;var x=!0;i.set(d,r),i.set(r,d);for(var m=a;++l<o;){p=s[l];var T=d[p],c=r[p];if(e)var h=a?e(c,T,p,r,d,i):e(T,c,p,d,r,i);if(!(h===void 0?T===c||n(T,c,t,e,i):h)){x=!1;break}m||(m=p=="constructor")}if(x&&!m){var u=d.constructor,g=r.constructor;u!=g&&"constructor"in d&&"constructor"in r&&!(typeof u=="function"&&u instanceof u&&typeof g=="function"&&g instanceof g)&&(x=!1)}return i.delete(d),i.delete(r),x}var Hd=Gd,mr=Dr,Kd=Pn,Vd=jd,Yd=Hd,Ln=Ke,bn=$e,Dn=_e,Xd=zr,Jd=1,wn="[object Arguments]",Nn="[object Array]",Qe="[object Object]",Qd=Object.prototype,Wn=Qd.hasOwnProperty;function Zd(d,r,t,e,n,i){var a=bn(d),s=bn(r),o=a?Nn:Ln(d),f=s?Nn:Ln(r);o=o==wn?Qe:o,f=f==wn?Qe:f;var v=o==Qe,l=f==Qe,p=o==f;if(p&&Dn(d)){if(!Dn(r))return!1;a=!0,v=!1}if(p&&!v)return i||(i=new mr),a||Xd(d)?Kd(d,r,t,e,n,i):Vd(d,r,o,t,e,n,i);if(!(t&Jd)){var y=v&&Wn.call(d,"__wrapped__"),O=l&&Wn.call(r,"__wrapped__");if(y||O){var x=y?d.value():d,m=O?r.value():r;return i||(i=new mr),n(x,m,t,e,i)}}return p?(i||(i=new mr),Yd(d,r,t,e,n,i)):!1}var kd=Zd,qd=kd,Bn=ie;function Fn(d,r,t,e,n){return d===r?!0:d==null||r==null||!Bn(d)&&!Bn(r)?d!==d&&r!==r:qd(d,r,t,e,Fn,n)}var _d=Fn,t0=_d;function e0(d,r){return t0(d,r)}var r0=e0,le=Xt(r0);const ne=class ne extends yt{constructor(t){super(t);nt(this,"toolsType",ht.Selector);nt(this,"tmpPoints",[]);nt(this,"workOptions");nt(this,"vNodes");nt(this,"selectIds");nt(this,"selectorColor");nt(this,"strokeColor");nt(this,"fillColor");nt(this,"oldSelectRect");nt(this,"canRotate",!1);nt(this,"canTextEdit",!1);nt(this,"canLock",!1);nt(this,"scaleType",jt.all);nt(this,"toolsTypes");nt(this,"shapeOpt");nt(this,"textOpt");nt(this,"isLocked");this.workOptions=t.toolsOpt,this.vNodes=t.vNodes}computSelector(t=!0){const e=wt(this.tmpPoints);if(e.w===0||e.h===0)return{selectIds:[],intersectRect:void 0,subNodeMap:new Map};const{rectRange:n,nodeRange:i}=this.vNodes.getRectIntersectRange(e,t);return{selectIds:[...i.keys()],intersectRect:n,subNodeMap:i}}updateTempPoints(t){const e=this.tmpPoints.length,n=t.length;if(n>1){const i=new xt(t[n-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[n-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);e===2?this.tmpPoints.splice(1,1,i):this.tmpPoints.push(i)}}drawSelector(t){const{drawRect:e,subNodeMap:n,selectorId:i,layer:a,isService:s}=t,o=new se({pos:[e.x,e.y],anchor:[0,0],size:[e.w,e.h],id:i,name:i,zIndex:1e3}),f=[];if(s){const v=new hr({normalize:!0,pos:[e.w/2,e.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:e.w,height:e.h,name:ne.selectorBorderId});f.push(v)}n.forEach((v,l)=>{const p=[v.rect.x+v.rect.w/2-e.x,v.rect.y+v.rect.h/2-e.y],y=new hr({normalize:!0,pos:p,lineWidth:1,strokeColor:n.size>1?this.selectorColor||this.workOptions.strokeColor:void 0,width:v.rect.w,height:v.rect.h,id:`selector-${l}`,name:`selector-${l}`});f.push(y)}),f&&o.append(...f),(a==null?void 0:a.parent).appendChild(o)}draw(t,e,n,i=!1){var o,f;const{intersectRect:a,subNodeMap:s}=n;(f=(o=e.parent)==null?void 0:o.getElementById(t))==null||f.remove(),a&&this.drawSelector({drawRect:a,subNodeMap:s,selectorId:t,layer:e,isService:i})}getSelecteorInfo(t){this.scaleType=jt.all,this.canRotate=!1,this.textOpt=void 0,this.strokeColor=void 0,this.fillColor=void 0,this.canTextEdit=!1,this.canLock=!1,this.isLocked=!1,this.toolsTypes=void 0,this.shapeOpt=void 0;const e=new Set;let n;for(const i of t.values()){const{opt:a,canRotate:s,scaleType:o,toolsType:f}=i;this.selectorColor=this.workOptions.strokeColor,a.strokeColor&&(this.strokeColor=a.strokeColor),a.fillColor&&(this.fillColor=a.fillColor),a.textOpt&&(this.textOpt=a.textOpt),f===ht.SpeechBalloon&&(e.add(f),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=a.placement),f===ht.Polygon&&(e.add(f),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=a.vertices),f===ht.Star&&(e.add(f),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=a.vertices,this.shapeOpt.innerRatio=a.innerRatio,this.shapeOpt.innerVerticeStep=a.innerVerticeStep),f===ht.Text&&(this.textOpt=a),t.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=s,this.scaleType=o),o===jt.none&&(this.scaleType=o),f===ht.Image&&(n=i)}e.size&&(this.toolsTypes=[...e]),n&&(t.size===1?(this.canLock=!0,n.opt.locked&&(this.isLocked=!0,this.scaleType=jt.none,this.canRotate=!1,this.textOpt=void 0,this.fillColor=void 0,this.selectorColor="rgb(177,177,177)",this.strokeColor=void 0,this.canTextEdit=!1)):t.size>1&&!n.opt.locked&&(this.canLock=!1,this.canRotate=!1))}getChildrenPoints(){var t,e;if(this.scaleType===jt.both&&((t=this.selectIds)==null?void 0:t.length)===1){const n=this.selectIds[0],i=(e=this.vNodes.get(n))==null?void 0:e.op;if(i){const a=[];for(let s=0;s<i.length;s+=3)a.push([i[s],i[s+1]]);return a}}}consume(t){const{op:e,workState:n}=t.data;let i=this.oldSelectRect;if(n===Rt.Start&&(i=this.unSelectedAllIds()),!(e!=null&&e.length)||!this.vNodes.curNodeMap.size)return{type:ct.None};this.updateTempPoints(e);const a=this.computSelector();if(this.selectIds&&le(this.selectIds,a.selectIds))return{type:ct.None};this.selectIds=a.selectIds;const s=a.intersectRect;this.getSelecteorInfo(a.subNodeMap),this.draw(ne.selectorId,this.fullLayer,a),this.oldSelectRect=s;const o=this.getChildrenPoints();return{type:ct.Select,dataType:Tt.Local,rect:Ot(s,i),selectIds:a.selectIds,opt:this.workOptions,selectRect:s,selectorColor:this.selectorColor,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:o,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt}}consumeAll(){var e,n;let t=this.oldSelectRect;if(!((e=this.selectIds)!=null&&e.length)&&this.tmpPoints[0]&&this.selectSingleTool(this.tmpPoints[0].XY,ne.selectorId,!1),(n=this.selectIds)!=null&&n.length&&(t=this.selectedByIds(this.selectIds)),t){const i=this.getChildrenPoints();return{type:ct.Select,dataType:Tt.Local,rect:this.oldSelectRect,selectIds:this.selectIds,opt:this.workOptions,selectorColor:this.selectorColor,selectRect:this.oldSelectRect,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:i,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt}}return{type:ct.None}}consumeService(){}clearTmpPoints(){this.tmpPoints.length=0}clearSelectData(){this.selectIds=void 0,this.oldSelectRect=void 0}selectSingleTool(t,e=ne.selectorId,n=!1){if(t.length===2){const i=t[0],a=t[1];let s;const{nodeRange:o}=this.vNodes.getRectIntersectRange({x:i,y:a,w:0,h:0},!1),f=[...o.values()].sort((v,l)=>(l.opt.zIndex||0)-(v.opt.zIndex||0));for(const v of f){const l=this.fullLayer.getElementsByName(v.name);if(Yn(l).find(y=>y.isPointCollision(i,a))){s=v;break}}if(s){const v=s.name;if(!le(this.oldSelectRect,s.rect)){const l=new Map([[v,s]]);this.getSelecteorInfo(l),this.draw(e,this.fullLayer,{intersectRect:s.rect,subNodeMap:l,selectIds:this.selectIds||[]},n)}this.selectIds=[v],this.oldSelectRect=s.rect}}}unSelectedAllIds(){let t;for(const[e,n]of this.vNodes.curNodeMap.entries())n.isSelected&&(t=Ot(t,n.rect),this.vNodes.unSelected(e));return t}unSelectedByIds(t){let e;for(const n of t){const i=this.vNodes.get(n);i&&i.isSelected&&(e=Ot(e,i.rect),this.vNodes.unSelected(n))}return e}selectedByIds(t){let e;for(const n of t){const i=this.vNodes.get(n);i&&(e=Ot(e,i.rect),this.vNodes.selected(n))}return e}getSelectorRect(t,e){var s;let n;const i=(s=t.parent)==null?void 0:s.getElementById(e),a=i==null?void 0:i.getBoundingClientRect();return a&&(n=Ot(n,{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.floor(a.width+1),h:Math.floor(a.height+1)})),n}isCanFillColor(t){return t===ht.Ellipse||t===ht.Triangle||t===ht.Rectangle||t===ht.Polygon||t===ht.Star||t===ht.SpeechBalloon}async updateSelector(t){const{updateSelectorOpt:e,selectIds:n,vNodes:i,willSerializeData:a,worker:s,offset:o,scene:f,isMainThread:v}=t,l=this.fullLayer;if(!l)return;let p;const y=new Map,{box:O,workState:x,angle:m,translate:T}=e;let c=[0,0],h=[1,1],u=[0,0],g,M;if(O||T||Qt(m)){if(x===Rt.Start)return i.setTarget(),{type:ct.Select,dataType:Tt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect};if(g=i.getLastTarget(),g&&O){let b;n==null||n.forEach(E=>{const L=g==null?void 0:g.get(E);b=Ot(b,L==null?void 0:L.rect)}),b&&(h=[O.w/b.w,O.h/b.h],c=[O.x+O.w/2-(b.x+b.w/2),O.y+O.h/2-(b.y+b.h/2)],u=[b.x+b.w/2,b.y+b.h/2]),M=b}}if(n)for(const b of n){const E=i.get(b);if(E){const{toolsType:L}=E;let D=(l==null?void 0:l.getElementsByName(b))[0];if(D){const R={...e};let C;if(L){if(g&&(C=g.get(b),C&&O)){R.boxScale=h;const z=[C.rect.x+C.rect.w/2,C.rect.y+C.rect.h/2],H=[z[0]-u[0],z[1]-u[1]];R.boxTranslate=[H[0]*(h[0]-1)+c[0]+(o&&o[0]||0),H[1]*(h[1]-1)+c[1]+(o&&o[1]||0)]}const W=Vn(L);if(W==null||W.updateNodeOpt({node:D,opt:R,vNodes:i,willSerializeData:a,targetNode:C}),E&&s&&(a&&(R.angle||R.translate)||R.box&&R.workState!==Rt.Start||R.pointMap&&R.pointMap.has(b)||L===ht.Text&&(R.fontSize||R.translate||R.textInfos&&R.textInfos.get(b))||L===ht.Image&&(R.angle||R.translate||R.boxScale)||L===R.toolsType&&R.willRefresh)){const z=s.createWorkShapeNode({toolsType:L,toolsOpt:E.opt});z==null||z.setWorkId(b);let H;L===ht.Image&&f?H=await z.consumeServiceAsync({isFullWork:!0,replaceId:b,scene:f,isMainThread:v}):L===ht.Text?H=await z.consumeServiceAsync({isFullWork:!0,replaceId:b}):H=z==null?void 0:z.consumeService({op:E.op,isFullWork:!0,replaceId:b}),H&&(E.rect=H),D=(l==null?void 0:l.getElementsByName(b))[0]}E&&(y.set(b,E),p=Ot(p,E.rect))}}}}g&&x===Rt.Done&&i.deleteLastTarget();const A=p;if(M&&e.dir&&A&&!o){const b=[0,0];switch(e.dir){case"top":{const E=[M.x,M.y+M.h];e.reverseY?b[1]=E[1]-A.y:b[1]=E[1]-(A.y+A.h);break}case"topLeft":{const E=[M.x+M.w,M.y+M.h];e.reverseY?b[1]=E[1]-A.y:b[1]=E[1]-(A.y+A.h),e.reverseX?b[0]=E[0]-A.x:b[0]=E[0]-(A.x+A.w);break}case"topRight":{const E=[M.x,M.y+M.h];e.reverseY?b[1]=E[1]-A.y:b[1]=E[1]-(A.y+A.h),e.reverseX?b[0]=E[0]-(A.x+A.w):b[0]=E[0]-A.x;break}case"bottom":{const E=[M.x,M.y];e.reverseY?b[1]=E[1]-(A.y+A.h):b[1]=E[1]-A.y;break}case"bottomLeft":{const E=[M.x+M.w,M.y];e.reverseY?b[1]=E[1]-(A.y+A.h):b[1]=E[1]-A.y,e.reverseX?b[0]=E[0]-A.x:b[0]=E[0]-(A.x+A.w);break}case"bottomRight":{const E=[M.x,M.y];e.reverseY?b[1]=E[1]-(A.y+A.h):b[1]=E[1]-A.y,e.reverseX?b[0]=E[0]-(A.x+A.w):b[0]=E[0]-A.x;break}case"right":{const E=[M.x,M.y];e.reverseX?b[0]=E[0]-(A.x+A.w):b[0]=E[0]-A.x;break}}if(b[0]||b[1])return A.x=A.x+b[0],A.y=A.y+b[1],await this.updateSelector({...t,offset:b})}this.getSelecteorInfo(y),this.draw(ne.selectorId,l,{selectIds:n||[],subNodeMap:y,intersectRect:A});const I=Ot(this.oldSelectRect,A);return this.oldSelectRect=A,{type:ct.Select,dataType:Tt.Local,selectRect:A,renderRect:p,rect:Ot(I,A)}}blurSelector(){const t=this.unSelectedAllIds();return{type:ct.Select,dataType:Tt.Local,rect:t,selectIds:[],willSyncService:!0}}getRightServiceId(t){return t.replace(pr,"-")}selectServiceNode(t,e,n){const{selectIds:i}=e,a=this.getRightServiceId(t),s=this.getSelectorRect(this.fullLayer,a);let o;const f=new Map;return i==null||i.forEach(v=>{const l=this.vNodes.get(v);l&&(o=Ot(o,l.rect),f.set(v,l))}),this.getSelecteorInfo(f),this.draw(a,this.fullLayer,{intersectRect:o,selectIds:i||[],subNodeMap:f},n),Ot(o,s)}reRenderSelector(){var n;let t;const e=new Map;return(n=this.selectIds)==null||n.forEach(i=>{const a=this.vNodes.get(i);a&&(t=Ot(t,a.rect),e.set(i,a))},this),this.getSelecteorInfo(e),this.draw(ne.selectorId,this.fullLayer,{intersectRect:t,subNodeMap:e,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t}updateSelectIds(t){var a;let e;const n=(a=this.selectIds)==null?void 0:a.filter(s=>!t.includes(s));if(n!=null&&n.length&&(e=this.unSelectedByIds(n)),t.length){const s=this.selectedByIds(t);e=Ot(e,s)}this.selectIds=t;const i=this.reRenderSelector();return{bgRect:e,selectRect:i}}cursorHover(t){var a,s;const e=this.oldSelectRect;this.selectIds=[];const n=(a=this.workId)==null?void 0:a.toString(),i=[t[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];if(this.selectSingleTool(i,n,!0),this.oldSelectRect&&!le(e,this.oldSelectRect))return{type:ct.CursorHover,dataType:Tt.Local,rect:Ot(e,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((s=this.selectIds)!=null&&s.length||(this.oldSelectRect=void 0),e&&!this.oldSelectRect)return this.cursorBlur(),{type:ct.CursorHover,dataType:Tt.Local,rect:e,selectorColor:this.selectorColor,willSyncService:!1}}cursorBlur(){var e,n;this.selectIds=[];const t=(e=this.workId)==null?void 0:e.toString();((n=this.fullLayer)==null?void 0:n.parent).children.forEach(i=>{i.name===t&&i.remove()})}};nt(ne,"selectorId",Qh),nt(ne,"selectorBorderId","selector-border");let Nt=ne;class jn extends yt{constructor(t){super(t);nt(this,"canRotate",!1);nt(this,"scaleType",jt.both);nt(this,"toolsType",ht.Arrow);nt(this,"tmpPoints",[]);nt(this,"workOptions");nt(this,"oldRect");nt(this,"arrowTipWidth");nt(this,"syncTimestamp");this.workOptions=t.toolsOpt,this.arrowTipWidth=this.workOptions.thickness*4,this.syncTimestamp=0,this.syncUnitTime=50}consume(t){var O;const{data:e,isFullWork:n,isSubWorker:i,isMainThread:a}=t,s=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!s)return{type:ct.None};const{op:o,workState:f}=e,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};let l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};let p;if(i||a){const x=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({workId:s,layer:x})}if(!i){const x=Date.now();return x-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=x,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:this.tmpPoints.map(m=>[...m.XY,0]).flat(1),isSync:!0,index:0}):{type:ct.None}}const y=Ot(p,this.oldRect);return this.oldRect=p,{rect:y,type:ct.DrawWork,dataType:Tt.Local,workId:s}}consumeAll(t){var f,v;const{data:e}=t,n=(f=e==null?void 0:e.workId)==null?void 0:f.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};const i=this.fullLayer,a=this.draw({workId:n,layer:i});this.oldRect=a;const s=this.tmpPoints.map(l=>[...l.XY,0]).flat(1),o=qt(s);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:o,isSync:!0,opt:this.workOptions}}draw(t){const{workId:e,layer:n}=t,{strokeColor:i,thickness:a,zIndex:s,scale:o,rotate:f,translate:v}=this.workOptions,l=n.worldPosition,p=n.worldScaling,{points:y,rect:O}=this.computDrawPoints(a),m={pos:[O.x+O.w/2,O.y+O.h/2],name:e,id:e,close:!0,points:y,fillColor:i,strokeColor:i,lineWidth:0,normalize:!0,zIndex:s};o&&(m.scale=o),f&&(m.rotate=f),v&&(m.translate=v);const T=new pe(m);if(this.replace(n,e,T),o||f||v){const c=T.getBoundingClientRect();return{x:Math.floor(c.x-yt.SafeBorderPadding),y:Math.floor(c.y-yt.SafeBorderPadding),w:Math.floor(c.width+yt.SafeBorderPadding*2),h:Math.floor(c.height+yt.SafeBorderPadding*2)}}return{x:Math.floor(O.x*p[0]+l[0]-yt.SafeBorderPadding),y:Math.floor(O.y*p[1]+l[1]-yt.SafeBorderPadding),w:Math.floor(O.w*p[0]+2*yt.SafeBorderPadding),h:Math.floor(O.h*p[1]+2*yt.SafeBorderPadding)}}computDrawPoints(t){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.arrowTipWidth?this.computFullArrowPoints(t):this.computTrianglePoints()}computFullArrowPoints(t){const e=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=_.Per(e).mul(t/2),i=xt.Sub(this.tmpPoints[0],n),a=xt.Add(this.tmpPoints[0],n),s=_.Mul(e,this.arrowTipWidth),o=_.Sub(this.tmpPoints[1],s),f=xt.Sub(o,n),v=xt.Add(o,n),l=_.Per(e).mul(t*1.5),p=xt.Sub(o,l),y=xt.Add(o,l),O=[i,f,p,this.tmpPoints[1],y,v,a];return{points:O.map(x=>xt.Sub(x,this.tmpPoints[0]).XY).flat(1),rect:wt(O),isTriangle:!1,pos:this.tmpPoints[0].XY}}computTrianglePoints(){const t=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),e=this.tmpPoints[1].distance(this.tmpPoints[0]),n=_.Per(t).mul(Math.floor(e*3/8)),i=xt.Sub(this.tmpPoints[0],n),a=xt.Add(this.tmpPoints[0],n),s=[i,this.tmpPoints[1],a];return{points:s.map(o=>xt.Sub(o,this.tmpPoints[0]).XY).flat(1),rect:wt(s),isTriangle:!0,pos:this.tmpPoints[0].XY}}updateTempPoints(t){const e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],{thickness:a}=this.workOptions;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n}else this.tmpPoints.push(n);return!0}consumeService(t){var o,f;const{op:e,isFullWork:n}=t,i=(o=this.workId)==null?void 0:o.toString();if(!i)return;this.tmpPoints.length=0;for(let v=0;v<e.length;v+=3)this.tmpPoints.push(new xt(e[v],e[v+1],e[v+2]));const a=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:i,layer:a});return this.oldRect=s,(f=this.vNodes)==null||f.setInfo(i,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(s,a)}),s}clearTmpPoints(){this.tmpPoints.length=0}static updateNodeOpt(t){var o;const{node:e,opt:n,vNodes:i}=t,{strokeColor:a}=n,s=i.get(e.name);return a&&(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a),(o=s==null?void 0:s.opt)!=null&&o.strokeColor&&(s.opt.strokeColor=a),s&&i.setInfo(e.name,s)),yt.updateNodeOpt(t)}}class Un extends yt{constructor(t){super(t);nt(this,"canRotate",!1);nt(this,"scaleType",jt.all);nt(this,"toolsType",ht.Ellipse);nt(this,"tmpPoints",[]);nt(this,"workOptions");nt(this,"oldRect");nt(this,"syncTimestamp");this.workOptions=t.toolsOpt,this.syncTimestamp=0,this.syncUnitTime=50}consume(t){var O;const{data:e,isFullWork:n,isSubWorker:i,isMainThread:a}=t,s=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!s)return{type:ct.None};const{op:o,workState:f}=e,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};let l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};let p;if(i||a){const x=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({workId:s,layer:x,isDrawing:!0})}if(!i){const x=Date.now();return x-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=x,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:this.tmpPoints.map(m=>[...m.XY,0]).flat(1),isSync:!0,index:0}):{type:ct.None}}const y=Ot(p,this.oldRect);return this.oldRect=p,{rect:y,type:ct.DrawWork,dataType:Tt.Local,workId:s}}consumeAll(t){var f,v;const{data:e}=t,n=(f=e==null?void 0:e.workId)==null?void 0:f.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};const i=this.fullLayer,a=this.draw({workId:n,layer:i,isDrawing:!1});this.oldRect=a;const s=this.tmpPoints.map(l=>[...l.XY,0]).flat(1),o=qt(s);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:o,isSync:!0,opt:this.workOptions}}draw(t){const{workId:e,layer:n,isDrawing:i}=t,{strokeColor:a,fillColor:s,thickness:o,zIndex:f,scale:v,rotate:l,translate:p}=this.workOptions,y=n.worldScaling,{radius:O,rect:x,pos:m}=this.computDrawPoints(o),T={pos:m,name:e,id:e,radius:O,lineWidth:o,fillColor:s!=="transparent"&&s||void 0,strokeColor:a,normalize:!0},c={name:e,id:e,zIndex:f,pos:m,anchor:[.5,.5],size:[x.w,x.h]};v&&(c.scale=v),l&&(c.rotate=l),p&&(c.translate=p);const h=new se(c);if(i){const M=new ge({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/y[0],1/y[1]]});h.append(M)}const u=new Gh({...T,pos:[0,0]});h.append(u),this.replace(n,e,h);const g=h.getBoundingClientRect();return{x:Math.floor(g.x-yt.SafeBorderPadding),y:Math.floor(g.y-yt.SafeBorderPadding),w:Math.floor(g.width+yt.SafeBorderPadding*2),h:Math.floor(g.height+yt.SafeBorderPadding*2)}}computDrawPoints(t){const e=wt(this.tmpPoints),n=wt(this.tmpPoints,t),i=[Math.floor(e.x+e.w/2),Math.floor(e.y+e.h/2)];return{rect:n,pos:i,radius:[Math.floor(e.w/2),Math.floor(e.h/2)]}}updateTempPoints(t){const e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],{thickness:a}=this.workOptions;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n}else this.tmpPoints.push(n);return!0}consumeService(t){var o,f;const{op:e,isFullWork:n}=t,i=(o=this.workId)==null?void 0:o.toString();if(!i)return;this.tmpPoints.length=0;for(let v=0;v<e.length;v+=3)this.tmpPoints.push(new xt(e[v],e[v+1],e[v+2]));const a=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=s,(f=this.vNodes)==null||f.setInfo(i,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(s,a)}),s}clearTmpPoints(){this.tmpPoints.length=0}static updateNodeOpt(t){var v,l;const{node:e,opt:n,vNodes:i}=t,{strokeColor:a,fillColor:s}=n,o=i.get(e.name);let f=e;return e.tagName==="GROUP"&&(f=e.children[0]),a&&(f.setAttribute("strokeColor",a),(v=o==null?void 0:o.opt)!=null&&v.strokeColor&&(o.opt.strokeColor=a)),s&&(s==="transparent"?f.setAttribute("fillColor","rgba(0,0,0,0)"):f.setAttribute("fillColor",s),(l=o==null?void 0:o.opt)!=null&&l.fillColor&&(o.opt.fillColor=s)),o&&i.setInfo(e.name,o),yt.updateNodeOpt(t)}}var n0=ue,i0=ie,s0="[object Boolean]";function o0(d){return d===!0||d===!1||i0(d)&&n0(d)==s0}var a0=o0,ce=Xt(a0);class $n extends yt{constructor(t){super(t);nt(this,"canRotate",!0);nt(this,"scaleType",jt.all);nt(this,"toolsType",ht.Rectangle);nt(this,"tmpPoints",[]);nt(this,"workOptions");nt(this,"oldRect");nt(this,"syncTimestamp");this.workOptions=t.toolsOpt,this.syncTimestamp=0,this.syncUnitTime=50}transformData(){const t=wt(this.tmpPoints);return[[t.x,t.y,0],[t.x+t.w,t.y,0],[t.x+t.w,t.y+t.h,0],[t.x,t.y+t.h,0]]}computDrawPoints(t){const{thickness:e}=this.workOptions,n=[];for(const s of t)n.push(new _(...s));const i=wt(n,e),a=[i.x+i.w/2,i.y+i.h/2];return{rect:i,pos:a,points:n.map(s=>s.XY).flat(1)}}consume(t){var x;const{data:e,isFullWork:n,isSubWorker:i,isMainThread:a}=t,s=(x=e==null?void 0:e.workId)==null?void 0:x.toString();if(!s)return{type:ct.None};const{op:o,workState:f}=e,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};let l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};const p=this.transformData();let y;if(i||a){const m=n?this.fullLayer:this.drawLayer||this.fullLayer;y=this.draw({ps:p,workId:s,layer:m,isDrawing:!0})}if(!i){const m=Date.now();return m-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=m,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:p.flat(1),isSync:!0,index:0}):{type:ct.None}}const O=Ot(y,this.oldRect);return this.oldRect=y,{rect:O,type:ct.DrawWork,dataType:Tt.Local,workId:s}}consumeAll(t){var v,l;const{data:e}=t,n=(v=e==null?void 0:e.workId)==null?void 0:v.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};const i=this.transformData(),a=this.fullLayer,s=this.draw({ps:i,workId:n,layer:a,isDrawing:!1});this.oldRect=s;const o=i.flat(1),f=qt(o);return(l=this.vNodes)==null||l.setInfo(n,{rect:s,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,a)}),{rect:s,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:f,opt:this.workOptions,isSync:!0}}draw(t){const{workId:e,layer:n,isDrawing:i,ps:a,replaceId:s}=t,{strokeColor:o,fillColor:f,thickness:v,zIndex:l,scale:p,rotate:y,translate:O,textOpt:x}=this.workOptions,m=n.worldPosition,T=n.worldScaling,{points:c,rect:h,pos:u}=this.computDrawPoints(a),g={close:!0,normalize:!0,points:c,lineWidth:v,fillColor:f!=="transparent"&&f||void 0,strokeColor:o,lineJoin:"round"},M={x:Math.floor(h.x*T[0]+m[0]-yt.SafeBorderPadding),y:Math.floor(h.y*T[1]+m[1]-yt.SafeBorderPadding),w:Math.floor(h.w*T[0]+2*yt.SafeBorderPadding),h:Math.floor(h.h*T[0]+2*yt.SafeBorderPadding)},A=new se({name:e,id:e,zIndex:l,pos:u,anchor:[.5,.5],size:[h.w,h.h],scale:p,rotate:y,translate:O}),I=new pe({...g,pos:[0,0]});if(A.appendChild(I),i){const b=new ge({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/T[0],1/T[1]]});A.appendChild(b)}if(this.replace(n,s||e,A),p||y||O){const b=A.getBoundingClientRect();return{x:Math.floor(b.x-yt.SafeBorderPadding),y:Math.floor(b.y-yt.SafeBorderPadding),w:Math.floor(b.width+2*yt.SafeBorderPadding),h:Math.floor(b.height+2*yt.SafeBorderPadding)}}return M}updateTempPoints(t){const e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],{thickness:a}=this.workOptions;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n}else this.tmpPoints.push(n);return!0}consumeService(t){var v,l;const{op:e,isFullWork:n,replaceId:i}=t,a=(v=this.workId)==null?void 0:v.toString();if(!a)return;const s=[];for(let p=0;p<e.length;p+=3)s.push([e[p],e[p+1],e[p+2]]);const o=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({ps:s,workId:a,layer:o,isDrawing:!1,replaceId:i});return this.oldRect=f,(l=this.vNodes)==null||l.setInfo(a,{rect:f,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&yt.getCenterPos(f,o)}),f}clearTmpPoints(){this.tmpPoints.length=0}static updateNodeOpt(t){var T,c;const{node:e,opt:n,vNodes:i}=t,{strokeColor:a,fillColor:s,fontColor:o,fontBgColor:f,bold:v,italic:l,lineThrough:p,underline:y,fontSize:O}=n,x=i.get(e.name);let m=e;if(e.tagName==="GROUP"&&(m=e.children[0]),a&&(m.setAttribute("strokeColor",a),(T=x==null?void 0:x.opt)!=null&&T.strokeColor&&(x.opt.strokeColor=a)),s&&(s==="transparent"?m.setAttribute("fillColor","rgba(0,0,0,0)"):m.setAttribute("fillColor",s),(c=x==null?void 0:x.opt)!=null&&c.fillColor&&(x.opt.fillColor=s)),x!=null&&x.opt.textOpt){const h=x.opt.textOpt;o&&h.fontColor&&(h.fontColor=o),f&&h.fontBgColor&&(h.fontBgColor=f),v&&(h.bold=v),l&&(h.italic=l),ce(p)&&(h.lineThrough=p),ce(y)&&(h.underline=y),O&&(h.fontSize=O)}return x&&i.setInfo(e.name,x),yt.updateNodeOpt(t)}}class zn extends yt{constructor(t){super(t);nt(this,"canRotate",!1);nt(this,"scaleType",jt.all);nt(this,"toolsType",ht.Star);nt(this,"tmpPoints",[]);nt(this,"workOptions");nt(this,"oldRect");nt(this,"syncTimestamp");this.workOptions=t.toolsOpt,this.syncTimestamp=0,this.syncUnitTime=50}consume(t){var O;const{data:e,isFullWork:n,isSubWorker:i,isMainThread:a}=t,s=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!s)return{type:ct.None};const{op:o,workState:f}=e,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};let l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};let p;if(i||a){const x=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({workId:s,layer:x,isDrawing:!0})}if(!i){const x=Date.now();return x-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=x,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:this.tmpPoints.map(m=>[...m.XY,0]).flat(1),isSync:!0,index:0}):{type:ct.None}}const y=Ot(p,this.oldRect);return this.oldRect=p,{rect:y,type:ct.DrawWork,dataType:Tt.Local,workId:s}}consumeAll(t){var f,v;const{data:e}=t,n=(f=e==null?void 0:e.workId)==null?void 0:f.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};const i=this.fullLayer,a=this.draw({workId:n,layer:i,isDrawing:!1});this.oldRect=a;const s=this.tmpPoints.map(l=>[...l.XY,0]).flat(1),o=qt(s);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:o,isSync:!0,opt:this.workOptions}}draw(t){const{workId:e,layer:n,isDrawing:i}=t,{strokeColor:a,fillColor:s,thickness:o,zIndex:f,vertices:v,innerVerticeStep:l,innerRatio:p,scale:y,rotate:O,translate:x}=this.workOptions,m=n.worldScaling,{rect:T,pos:c,points:h}=this.computDrawPoints(o,v,l,p),u={close:!0,points:h,lineWidth:o,fillColor:s!=="transparent"&&s||void 0,strokeColor:a,normalize:!0,lineJoin:"round"},g={name:e,id:e,zIndex:f,pos:c,anchor:[.5,.5],size:[T.w,T.h],className:`${c[0]},${c[1]}`};y&&(g.scale=y),O&&(g.rotate=O),x&&(g.translate=x);const M=new se(g);if(i){const b=new ge({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/m[0],1/m[1]]});M.append(b)}const A=new pe({...u,pos:[0,0]});M.append(A),this.replace(n,e,M);const I=M.getBoundingClientRect();return{x:Math.floor(I.x-yt.SafeBorderPadding),y:Math.floor(I.y-yt.SafeBorderPadding),w:Math.floor(I.width+yt.SafeBorderPadding*2),h:Math.floor(I.height+yt.SafeBorderPadding*2)}}computDrawPoints(t,e,n,i){const a=wt(this.tmpPoints),s=[Math.floor(a.x+a.w/2),Math.floor(a.y+a.h/2)],o=Tn(a.w,a.h),f=Math.floor(Math.min(a.w,a.h)/2),v=i*f,l=[],p=2*Math.PI/e;for(let O=0;O<e;O++){const x=O*p-.5*Math.PI;let m,T;O%n===1?(m=v*o[0]*Math.cos(x),T=v*o[1]*Math.sin(x)):(m=f*o[0]*Math.cos(x),T=f*o[1]*Math.sin(x),l.push(m,T)),l.push(m,T)}return{rect:wt(this.tmpPoints,t),pos:s,points:l}}updateTempPoints(t){const e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],{thickness:a}=this.workOptions;if(i.isNear(n,a)||xt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n}else this.tmpPoints.push(n);return!0}consumeService(t){var o,f;const{op:e,isFullWork:n}=t,i=(o=this.workId)==null?void 0:o.toString();if(!i)return;this.tmpPoints.length=0;for(let v=0;v<e.length;v+=3)this.tmpPoints.push(new xt(e[v],e[v+1],e[v+2]));const a=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=s,(f=this.vNodes)==null||f.setInfo(i,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,a)}),s}clearTmpPoints(){this.tmpPoints.length=0}static updateNodeOpt(t){const{node:e,opt:n,vNodes:i}=t,{strokeColor:a,fillColor:s,toolsType:o,vertices:f,innerVerticeStep:v,innerRatio:l}=n,p=i.get(e.name),y=p==null?void 0:p.opt;let O=e;return e.tagName==="GROUP"&&(O=e.children[0]),a&&(O.setAttribute("strokeColor",a),y!=null&&y.strokeColor&&(y.strokeColor=a)),s&&(s==="transparent"?O.setAttribute("fillColor","rgba(0,0,0,0)"):O.setAttribute("fillColor",s),y!=null&&y.fillColor&&(y.fillColor=s)),o===ht.Star&&(f&&(y.vertices=f),v&&(y.innerVerticeStep=v),l&&(y.innerRatio=l)),p&&i.setInfo(e.name,{...p,opt:y}),yt.updateNodeOpt(t)}}class Gn extends yt{constructor(t){super(t);nt(this,"canRotate",!1);nt(this,"scaleType",jt.all);nt(this,"toolsType",ht.Polygon);nt(this,"tmpPoints",[]);nt(this,"workOptions");nt(this,"oldRect");nt(this,"syncTimestamp");this.workOptions=t.toolsOpt,this.syncTimestamp=0,this.syncUnitTime=50}consume(t){var O;const{data:e,isFullWork:n,isSubWorker:i,isMainThread:a}=t,s=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!s)return{type:ct.None};const{op:o,workState:f}=e,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};let l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};let p;if(i||a){const x=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({workId:s,layer:x,isDrawing:!0})}if(!i){const x=Date.now();return x-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=x,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:this.tmpPoints.map(m=>[...m.XY,0]).flat(1),isSync:!0,index:0}):{type:ct.None}}const y=Ot(p,this.oldRect);return this.oldRect=p,{rect:y,type:ct.DrawWork,dataType:Tt.Local,workId:s}}consumeAll(t){var f,v;const{data:e}=t,n=(f=e==null?void 0:e.workId)==null?void 0:f.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};const i=this.fullLayer,a=this.draw({workId:n,layer:i,isDrawing:!1});this.oldRect=a;const s=this.tmpPoints.map(l=>[...l.XY,0]).flat(1),o=qt(s);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:o,isSync:!0,opt:this.workOptions}}draw(t){const{workId:e,layer:n,isDrawing:i}=t,{strokeColor:a,fillColor:s,thickness:o,zIndex:f,vertices:v,scale:l,rotate:p,translate:y}=this.workOptions,O=n.worldScaling,{rect:x,pos:m,points:T}=this.computDrawPoints(o,v),c={close:!0,points:T,lineWidth:o,fillColor:s!=="transparent"&&s||void 0,strokeColor:a,normalize:!0,lineJoin:"round"},h={name:e,id:e,zIndex:f,pos:m,anchor:[.5,.5],size:[x.w,x.h]};l&&(h.scale=l),p&&(h.rotate=p),y&&(h.translate=y);const u=new se(h);if(i){const A=new ge({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/O[0],1/O[1]]});u.append(A)}const g=new pe({...c,pos:[0,0]});u.append(g),this.replace(n,e,u);const M=u.getBoundingClientRect();return{x:Math.floor(M.x-yt.SafeBorderPadding),y:Math.floor(M.y-yt.SafeBorderPadding),w:Math.floor(M.width+yt.SafeBorderPadding*2),h:Math.floor(M.height+yt.SafeBorderPadding*2)}}computDrawPoints(t,e){const n=wt(this.tmpPoints),i=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],a=Tn(n.w,n.h),s=Math.floor(Math.min(n.w,n.h)/2),o=[],f=2*Math.PI/e;for(let l=0;l<e;l++){const p=l*f-.5*Math.PI,y=s*a[0]*Math.cos(p),O=s*a[1]*Math.sin(p);o.push(y,O)}return{rect:wt(this.tmpPoints,t),pos:i,points:o}}updateTempPoints(t){const e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],{thickness:a}=this.workOptions;if(i.isNear(n,a)||xt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n}else this.tmpPoints.push(n);return!0}consumeService(t){var o,f;const{op:e,isFullWork:n}=t,i=(o=this.workId)==null?void 0:o.toString();if(!i)return;this.tmpPoints.length=0;for(let v=0;v<e.length;v+=3)this.tmpPoints.push(new xt(e[v],e[v+1],e[v+2]));const a=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=s,(f=this.vNodes)==null||f.setInfo(i,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,a)}),s}clearTmpPoints(){this.tmpPoints.length=0}static updateNodeOpt(t){const{node:e,opt:n,vNodes:i}=t,{strokeColor:a,fillColor:s,toolsType:o,vertices:f}=n,v=i.get(e.name),l=v==null?void 0:v.opt;let p=e;return e.tagName==="GROUP"&&(p=e.children[0]),a&&(p.setAttribute("strokeColor",a),l!=null&&l.strokeColor&&(l.strokeColor=a)),s&&(s==="transparent"?p.setAttribute("fillColor","rgba(0,0,0,0)"):p.setAttribute("fillColor",s),l!=null&&l.fillColor&&(l.fillColor=s)),o===ht.Polygon&&f&&(l.vertices=f),v&&i.setInfo(e.name,{...v,opt:l}),yt.updateNodeOpt(t)}}class _t{static bezier(r,t){const e=[];for(let n=0;n<t.length;n+=4){const i=t[n],a=t[n+1],s=t[n+2],o=t[n+3];i&&a&&s&&o?e.push(..._t.getBezierPoints(r,i,a,s,o)):i&&a&&s?e.push(..._t.getBezierPoints(r,i,a,s)):i&&a?e.push(..._t.getBezierPoints(r,i,a)):i&&e.push(i)}return e}static getBezierPoints(r=10,t,e,n,i){let a=null;const s=[];!n&&!i?a=_t.oneBezier:n&&!i?a=_t.twoBezier:n&&i&&(a=_t.threeBezier);for(let o=0;o<r;o++)a&&s.push(a(o/r,t,e,n,i));return i?s.push(i):n&&s.push(n),s}static oneBezier(r,t,e){const n=t.x+(e.x-t.x)*r,i=t.y+(e.y-t.y)*r;return new _(n,i)}static twoBezier(r,t,e,n){const i=(1-r)*(1-r)*t.x+2*r*(1-r)*e.x+r*r*n.x,a=(1-r)*(1-r)*t.y+2*r*(1-r)*e.y+r*r*n.y;return new _(i,a)}static threeBezier(r,t,e,n,i){const a=t.x*(1-r)*(1-r)*(1-r)+3*e.x*r*(1-r)*(1-r)+3*n.x*r*r*(1-r)+i.x*r*r*r,s=t.y*(1-r)*(1-r)*(1-r)+3*e.y*r*(1-r)*(1-r)+3*n.y*r*r*(1-r)+i.y*r*r*r;return new _(a,s)}}class Hn extends yt{constructor(t){super(t);nt(this,"canRotate",!1);nt(this,"scaleType",jt.all);nt(this,"toolsType",ht.SpeechBalloon);nt(this,"ratio",.8);nt(this,"tmpPoints",[]);nt(this,"workOptions");nt(this,"oldRect");nt(this,"syncTimestamp");this.workOptions=t.toolsOpt,this.syncTimestamp=0,this.syncUnitTime=50}consume(t){var O;const{data:e,isFullWork:n,isSubWorker:i,isMainThread:a}=t,s=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!s)return{type:ct.None};const{op:o,workState:f}=e,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};let l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};let p;if(i||a){const x=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({workId:s,layer:x,isDrawing:!0})}if(!i){const x=Date.now();return x-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=x,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:this.tmpPoints.map(m=>[...m.XY,0]).flat(1),isSync:!0,index:0}):{type:ct.None}}const y=Ot(p,this.oldRect);return this.oldRect=p,{rect:y,type:ct.DrawWork,dataType:Tt.Local,workId:s}}consumeAll(t){var f,v;const{data:e}=t,n=(f=e==null?void 0:e.workId)==null?void 0:f.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};const i=this.fullLayer,a=this.draw({workId:n,layer:i,isDrawing:!1});this.oldRect=a;const s=this.tmpPoints.map(l=>[...l.XY,0]).flat(1),o=qt(s);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:o,isSync:!0,opt:this.workOptions}}draw(t){const{workId:e,layer:n}=t,{strokeColor:i,fillColor:a,thickness:s,zIndex:o,placement:f,scale:v,rotate:l,translate:p}=this.workOptions,{rect:y,pos:O,points:x}=this.computDrawPoints(s,f),m={points:x.map(g=>g.XY),lineWidth:s,fillColor:a!=="transparent"&&a||void 0,strokeColor:i,normalize:!0,className:`${O[0]},${O[1]}`,lineJoin:"round",close:!0},T={name:e,id:e,zIndex:o,pos:O,anchor:[.5,.5],size:[y.w,y.h]};v&&(T.scale=v),l&&(T.rotate=l),p&&(T.translate=p);const c=new se(T),h=new pe({...m,pos:[0,0]});c.append(h),this.replace(n,e,c);const u=c.getBoundingClientRect();return{x:Math.floor(u.x-yt.SafeBorderPadding),y:Math.floor(u.y-yt.SafeBorderPadding),w:Math.floor(u.width+yt.SafeBorderPadding*2),h:Math.floor(u.height+yt.SafeBorderPadding*2)}}transformControlPoints(t){const e=wt(this.tmpPoints);switch(t){case"bottom":case"bottomLeft":case"bottomRight":{const n=e.y+e.h*this.ratio;return[new _(e.x,e.y,0),new _(e.x+e.w,e.y,0),new _(e.x+e.w,n,0),new _(e.x,n,0)]}case"top":case"topLeft":case"topRight":{const n=e.y+e.h*(1-this.ratio);return[new _(e.x,n,0),new _(e.x+e.w,n,0),new _(e.x+e.w,e.y+e.h,0),new _(e.x,e.y+e.h,0)]}case"left":case"leftBottom":case"leftTop":{const n=e.x+e.w*(1-this.ratio);return[new _(n,e.y,0),new _(e.x+e.w,e.y,0),new _(e.x+e.w,e.y+e.h,0),new _(n,e.y+e.h,0)]}case"right":case"rightBottom":case"rightTop":{const n=e.x+e.w*this.ratio;return[new _(e.x,e.y,0),new _(n,e.y,0),new _(n,e.y+e.h,0),new _(e.x,e.y+e.h,0)]}}}computDrawPoints(t,e){const n=wt(this.tmpPoints),i=this.transformControlPoints(e),a=Math.floor(n.w*.1),s=Math.floor(n.h*.1),o=[],f=_.Add(i[0],new _(0,s,0)),v=_.Add(i[0],new _(a,0,0)),l=_t.getBezierPoints(10,f,i[0],v),p=_.Sub(i[1],new _(a,0,0)),y=_.Add(i[1],new _(0,s,0)),O=_t.getBezierPoints(10,p,i[1],y),x=_.Sub(i[2],new _(0,s,0)),m=_.Sub(i[2],new _(a,0,0)),T=_t.getBezierPoints(10,x,i[2],m),c=_.Add(i[3],new _(a,0,0)),h=_.Sub(i[3],new _(0,s,0)),u=_t.getBezierPoints(10,c,i[3],h),g=a*(1-this.ratio)*10,M=s*(1-this.ratio)*10;switch(e){case"bottom":{const b=_.Sub(i[2],new _(a*5-g/2,0,0)),E=_.Sub(i[2],new _(a*5,-M,0)),L=_.Sub(i[2],new _(a*5+g/2,0,0));o.push(E,L,...u,...l,...O,...T,b);break}case"bottomRight":{const b=_.Sub(i[2],new _(a*1.1,0,0)),E=_.Sub(i[2],new _(a*1.1+g/2,-M,0)),L=_.Sub(i[2],new _(a*1.1+g,0,0));o.push(E,L,...u,...l,...O,...T,b);break}case"bottomLeft":{const b=_.Add(i[3],new _(a*1.1+g,0,0)),E=_.Add(i[3],new _(a*1.1+g/2,M,0)),L=_.Add(i[3],new _(a*1.1,0,0));o.push(E,L,...u,...l,...O,...T,b);break}case"top":{const b=_.Sub(i[1],new _(a*5-g/2,0,0)),E=_.Sub(i[1],new _(a*5,M,0)),L=_.Sub(i[1],new _(a*5+g/2,0,0));o.push(E,b,...O,...T,...u,...l,L);break}case"topRight":{const b=_.Sub(i[1],new _(a*1.1,0,0)),E=_.Sub(i[1],new _(a*1.1+g/2,M,0)),L=_.Sub(i[1],new _(a*1.1+g,0,0));o.push(E,b,...O,...T,...u,...l,L);break}case"topLeft":{const b=_.Add(i[0],new _(a*1.1+g,0,0)),E=_.Add(i[0],new _(a*1.1+g/2,-M,0)),L=_.Add(i[0],new _(a*1.1,0,0));o.push(E,b,...O,...T,...u,...l,L);break}case"left":{const b=_.Add(i[0],new _(0,s*5-M/2,0)),E=_.Add(i[0],new _(-g,s*5,0)),L=_.Add(i[0],new _(0,s*5+M/2,0));o.push(E,b,...l,...O,...T,...u,L);break}case"leftTop":{const b=_.Add(i[0],new _(0,s*1.1,0)),E=_.Add(i[0],new _(-g,s*1.1+M/2,0)),L=_.Add(i[0],new _(0,s*1.1+M,0));o.push(E,b,...l,...O,...T,...u,L);break}case"leftBottom":{const b=_.Sub(i[3],new _(0,s*1.1+M,0)),E=_.Sub(i[3],new _(g,s*1.1+M/2,0)),L=_.Sub(i[3],new _(0,s*1.1,0));o.push(E,b,...l,...O,...T,...u,L);break}case"right":{const b=_.Add(i[1],new _(0,s*5-M/2,0)),E=_.Add(i[1],new _(g,s*5,0)),L=_.Add(i[1],new _(0,s*5+M/2,0));o.push(E,L,...T,...u,...l,...O,b);break}case"rightTop":{const b=_.Add(i[1],new _(0,s*1.1,0)),E=_.Add(i[1],new _(g,s*1.1+M/2,0)),L=_.Add(i[1],new _(0,s*1.1+M,0));o.push(E,L,...T,...u,...l,...O,b);break}case"rightBottom":{const b=_.Sub(i[2],new _(0,s*1.1+M,0)),E=_.Sub(i[2],new _(-g,s*1.1+M/2,0)),L=_.Sub(i[2],new _(0,s*1.1,0));o.push(E,L,...T,...u,...l,...O,b);break}}const A=wt(this.tmpPoints,t),I=[Math.floor(A.x+A.w/2),Math.floor(A.y+A.h/2)];return{rect:A,pos:I,points:o}}updateTempPoints(t){const e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],{thickness:a}=this.workOptions;if(i.isNear(n,a)||xt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n}else this.tmpPoints.push(n);return!0}consumeService(t){var o,f;const{op:e,isFullWork:n}=t,i=(o=this.workId)==null?void 0:o.toString();if(!i)return;this.tmpPoints.length=0;for(let v=0;v<e.length;v+=3)this.tmpPoints.push(new xt(e[v],e[v+1],e[v+2]));const a=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=s,(f=this.vNodes)==null||f.setInfo(i,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,a)}),s}clearTmpPoints(){this.tmpPoints.length=0}static updateNodeOpt(t){const{node:e,opt:n,vNodes:i}=t,{strokeColor:a,fillColor:s,toolsType:o,placement:f}=n,v=i.get(e.name),l=v==null?void 0:v.opt;let p=e;return e.tagName==="GROUP"&&(p=e.children[0]),a&&(p.setAttribute("strokeColor",a),l!=null&&l.strokeColor&&(l.strokeColor=a)),s&&(s==="transparent"?p.setAttribute("fillColor","rgba(0,0,0,0)"):p.setAttribute("fillColor",s),l!=null&&l.fillColor&&(l.fillColor=s)),o===ht.SpeechBalloon&&f&&(l.placement=f),v&&i.setInfo(e.name,{...v,opt:l}),yt.updateNodeOpt(t)}}class Le extends yt{constructor(t){super(t);nt(this,"canRotate",!0);nt(this,"scaleType",jt.all);nt(this,"toolsType",ht.Image);nt(this,"tmpPoints",[]);nt(this,"workOptions");nt(this,"oldRect");this.workOptions=t.toolsOpt,this.scaleType=Le.getScaleType(this.workOptions)}consume(){return{type:ct.None}}consumeAll(){return{type:ct.None}}draw(t){const{layer:e,workId:n,replaceId:i,imageBitmap:a,isMainThread:s}=t,{centerX:o,centerY:f,width:v,height:l,rotate:p,zIndex:y}=this.workOptions,O={anchor:[.5,.5],pos:[o,f],name:n,size:[v,l],zIndex:y,rotate:!s&&180+(p||0)||p,texture:a},x=new Vh(O);this.replace(e,i||n,x);const m=x.getBoundingClientRect();if(m)return{x:Math.floor(m.x-yt.SafeBorderPadding),y:Math.floor(m.y-yt.SafeBorderPadding),w:Math.floor(m.width+yt.SafeBorderPadding*2),h:Math.floor(m.height+yt.SafeBorderPadding*2)}}consumeService(){}async consumeServiceAsync(t){var l,p,y,O;const{isFullWork:e,replaceId:n,scene:i,isMainThread:a}=t,{src:s,uuid:o}=this.workOptions,f=((l=this.workId)==null?void 0:l.toString())||o,v=e?this.fullLayer:this.drawLayer||this.fullLayer;if(s){const x=await i.preload({id:o,src:this.workOptions.src}),m=this.draw({workId:f,layer:v,replaceId:n,imageBitmap:x[0],isMainThread:a});return this.oldRect=f&&((y=(p=this.vNodes)==null?void 0:p.get(f))==null?void 0:y.rect)||void 0,(O=this.vNodes)==null||O.setInfo(f,{rect:m,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:m&&yt.getCenterPos(m,v)}),m}}clearTmpPoints(){this.tmpPoints.length=0}static getScaleType(t){const{uniformScale:e,rotate:n}=t;return e!==!1||n&&Math.abs(n)%90>0?jt.proportional:jt.all}static updateNodeOpt(t){const{node:e,opt:n,vNodes:i,targetNode:a}=t,{translate:s,box:o,boxScale:f,boxTranslate:v,angle:l,isLocked:p,zIndex:y}=n,O=a&&Jt(a)||i.get(e.name);if(!O)return;const x=e.parent;if(x){if(Qt(y)&&(e.setAttribute("zIndex",y),O.opt.zIndex=y),ce(p)&&(O.opt.locked=p),o&&v&&f){const{centerX:m,centerY:T,width:c,height:h,uniformScale:u,rotate:g}=O.opt,M=Math.min(f[0],f[1]),A=u!==!1?[M,M]:f,I=yn({x:m-c/2,y:T-h/2,w:c,h},g||0),b=Lh(I,new _(m,T),A),E=bh(b,new _(m,T),-(g||0)),L=wt(E);O.opt.width=Math.round(L.w),O.opt.height=Math.round(L.h);const D=[v[0]/x.worldScaling[0],v[1]/x.worldScaling[1]];O.opt.centerX=m+D[0],O.opt.centerY=T+D[1];const R=[O.centerPos[0]+D[0],O.centerPos[1]+D[1]];if(O.centerPos=R,a){let C=xn(O.rect,f);C=Re(C,D),O.rect=C}}else if(s){const m=[s[0]/x.worldScaling[0],s[1]/x.worldScaling[1]];if(O.opt.centerX=O.opt.centerX+m[0],O.opt.centerY=O.opt.centerY+m[1],O.centerPos=[O.centerPos[0]+m[0],O.centerPos[1]+m[1]],a){const T=Re(O.rect,m);O.rect=T}}else if(Qt(l)&&(O.opt.rotate=l,O.scaleType=Le.getScaleType(O.opt),a)){const m=Sn(O.rect,l);O.rect=m}return O&&i.setInfo(e.name,O),O==null?void 0:O.rect}}}class Kn extends yt{constructor(t){super(t);nt(this,"canRotate",!1);nt(this,"scaleType",jt.both);nt(this,"toolsType",ht.Straight);nt(this,"tmpPoints",[]);nt(this,"workOptions");nt(this,"oldRect");nt(this,"straightTipWidth");nt(this,"syncTimestamp");this.workOptions=t.toolsOpt,this.straightTipWidth=this.workOptions.thickness/2,this.syncTimestamp=0,this.syncUnitTime=50}consume(t){var O;const{data:e,isFullWork:n,isSubWorker:i,isMainThread:a}=t,s=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!s)return{type:ct.None};const{op:o,workState:f}=e,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};let l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};let p;if(i||a){const x=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({workId:s,layer:x})}if(!i){const x=Date.now();return x-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=x,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:this.tmpPoints.map(m=>[...m.XY,0]).flat(1),isSync:!0,index:0}):{type:ct.None}}const y=Ot(p,this.oldRect);return this.oldRect=p,{rect:y,type:ct.DrawWork,dataType:Tt.Local,workId:s}}consumeAll(t){var f,v;const{data:e}=t,n=(f=e==null?void 0:e.workId)==null?void 0:f.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};const i=this.fullLayer,a=this.draw({workId:n,layer:i});this.oldRect=a;const s=this.tmpPoints.map(l=>[...l.XY,0]).flat(1),o=qt(s);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:o,isSync:!0,opt:this.workOptions}}draw(t){const{workId:e,layer:n}=t,{strokeColor:i,thickness:a,zIndex:s,scale:o,rotate:f,translate:v}=this.workOptions,l=n.worldPosition,p=n.worldScaling,{d:y,rect:O}=this.computDrawPoints(a),x=[O.x+O.w/2,O.y+O.h/2],m={pos:x,name:e,id:e,d:y,fillColor:i,strokeColor:i,lineWidth:0,className:`${x[0]},${x[1]}`,normalize:!0,zIndex:s};o&&(m.scale=o),f&&(m.rotate=f),v&&(m.translate=v);const T=new ge(m);if(this.replace(n,e,T),f||o||v){const h=T.getBoundingClientRect();return{x:Math.floor(h.x-yt.SafeBorderPadding),y:Math.floor(h.y-yt.SafeBorderPadding),w:Math.floor(h.width+yt.SafeBorderPadding*2),h:Math.floor(h.height+yt.SafeBorderPadding*2)}}return{x:Math.floor(O.x*p[0]+l[0]-yt.SafeBorderPadding),y:Math.floor(O.y*p[1]+l[1]-yt.SafeBorderPadding),w:Math.floor(O.w*p[0]+2*yt.SafeBorderPadding),h:Math.floor(O.h*p[1]+2*yt.SafeBorderPadding)}}computDrawPoints(t){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(t):this.computDotPoints(t)}computFullPoints(t){const e=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=_.Per(e).mul(t/2),i=xt.Sub(this.tmpPoints[0],n),a=xt.Add(this.tmpPoints[0],n),s=xt.Sub(this.tmpPoints[1],n),o=xt.Add(this.tmpPoints[1],n),f=xt.GetSemicircleStroke(this.tmpPoints[1],s,-1,8),v=xt.GetSemicircleStroke(this.tmpPoints[0],a,-1,8),l=[i,s,...f,o,a,...v];return{d:Oe(l,!0),rect:wt(l),isDot:!1,pos:this.tmpPoints[0].XY}}computDotPoints(t){const e=xt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:Oe(e,!0),rect:wt(e),isDot:!0,pos:this.tmpPoints[0].XY}}updateTempPoints(t){const e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],{thickness:a}=this.workOptions;if(i.isNear(n,a))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n}else this.tmpPoints.push(n);return!0}consumeService(t){var o,f;const{op:e,isFullWork:n}=t,i=(o=this.workId)==null?void 0:o.toString();if(!i)return;this.tmpPoints.length=0;for(let v=0;v<e.length;v+=3)this.tmpPoints.push(new xt(e[v],e[v+1],e[v+2]));const a=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:i,layer:a});return this.oldRect=s,(f=this.vNodes)==null||f.setInfo(i,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,a)}),s}clearTmpPoints(){this.tmpPoints.length=0}static updateNodeOpt(t){var o;const{node:e,opt:n,vNodes:i}=t,{strokeColor:a}=n,s=i.get(e.name);return a&&(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a),(o=s==null?void 0:s.opt)!=null&&o.strokeColor&&(s.opt.strokeColor=a)),s&&i.setInfo(e.name,s),yt.updateNodeOpt(t)}}class be extends yt{constructor(t){super(t);nt(this,"canRotate",!1);nt(this,"scaleType",jt.all);nt(this,"toolsType",ht.Text);nt(this,"tmpPoints",[]);nt(this,"workOptions");nt(this,"oldRect");this.workOptions=t.toolsOpt}consume(){return{type:ct.None}}consumeAll(){return{type:ct.None}}consumeService(){}async draw(t){const{workId:e,layer:n,isDrawLabel:i}=t,{boxSize:a,boxPoint:s,zIndex:o}=this.workOptions,f=n.worldPosition,v=n.worldScaling;if(!s||!a)return;const l={name:e,id:e,pos:[s[0]+a[0]/2,s[1]+a[1]/2],anchor:[.5,.5],size:a,zIndex:o},p=new se(l),y={x:s[0],y:s[1],w:a[0],h:a[1]},O=new hr({normalize:!0,pos:[0,0],size:a}),x=i&&be.createLabels(this.workOptions,n)||[];return p.append(...x,O),this.replace(n,e,p),i&&(await new Promise(m=>{setTimeout(m,0)}),this.updateLabelsWidth(p)),{x:Math.floor(y.x*v[0]+f[0]),y:Math.floor(y.y*v[1]+f[1]),w:Math.floor(y.w*v[0]),h:Math.floor(y.h*v[1])}}async consumeServiceAsync(t){var f,v,l,p;const e=(f=this.workId)==null?void 0:f.toString();if(!e)return;const{isFullWork:n,replaceId:i,isDrawLabel:a}=t;this.oldRect=i&&((l=(v=this.vNodes)==null?void 0:v.get(i))==null?void 0:l.rect)||void 0;const s=n?this.fullLayer:this.drawLayer||this.fullLayer,o=await this.draw({workId:e,layer:s,isDrawLabel:a||this.workOptions.workState===Rt.Done});return(p=this.vNodes)==null||p.setInfo(e,{rect:o,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,s)}),o}updateLabelsWidth(t){t.children.forEach(e=>{if(e.tagName==="LABEL"){const n=e.name,{width:i}=e.getBoundingClientRect(),[a]=t.worldScaling,{underline:s,lineThrough:o}=this.getWorkOptions();s&&t.getElementsByName(`${n}_underline`)[0].attr({points:[0,0,i/a,0]}),o&&t.getElementsByName(`${n}_lineThrough`)[0].attr({points:[0,0,i/a,0]})}})}updataOptService(){}async updataOptServiceAsync(t){var y,O;if(!this.workId)return;const e=this.workId.toString(),{fontColor:n,fontBgColor:i,bold:a,italic:s,lineThrough:o,underline:f,zIndex:v}=t,l=(y=this.vNodes)==null?void 0:y.get(e);if(!l)return;n&&(l.opt.fontColor=n),i&&(l.opt.fontBgColor=i),a&&(l.opt.bold=a),s&&(l.opt.italic=s),ce(o)&&(l.opt.lineThrough=o),ce(f)&&(l.opt.underline=f),i&&(l.opt.fontBgColor=i),Qt(v)&&(l.opt.zIndex=v),this.oldRect=l.rect;const p=await this.draw({workId:e,layer:this.fullLayer,isDrawLabel:this.workOptions.workState===Rt.Done});return(O=this.vNodes)==null||O.setInfo(e,{rect:p,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:p&&yt.getCenterPos(p,this.fullLayer)}),p}clearTmpPoints(){this.tmpPoints.length=0}static getFontWidth(t){const{ctx:e,opt:n,text:i}=t,{bold:a,italic:s,fontSize:o,fontFamily:f}=n;return e.font=`${a} ${s} ${o}px ${f}`,e.measureText(i).width}static createLabels(t,e){const n=[],i=t.text.split(","),a=i.length;for(let s=0;s<a;s++){const o=i[s],{fontSize:f,lineHeight:v,bold:l,textAlign:p,italic:y,boxSize:O,fontFamily:x,verticalAlign:m,fontColor:T,underline:c,lineThrough:h}=t,u=v||f*1.2,g=e&&e.parent.canvas.getContext("2d"),M=g&&be.getFontWidth({text:o,opt:t,ctx:g,worldScaling:e.worldScaling});if(M){const A={anchor:[0,.5],text:o,fontSize:f,lineHeight:u,fontFamily:x,fontWeight:l,fillColor:T,textAlign:p,fontStyle:y,name:s.toString(),className:"label"},I=[0,0];if(m==="middle"){const E=(a-1)/2;I[1]=(s-E)*u}if(p==="left"){const E=O&&-O[0]/2||0;I[0]=y==="italic"&&E||E+5,console.log("text-left",I)}A.pos=I;const b=new Hh(A);if(n.push(b),c){const E={normalize:!1,pos:[A.pos[0],A.pos[1]+f/2],lineWidth:Math.floor(f/10),points:[0,0,M,0],strokeColor:T,name:`${s}_underline`,className:"underline"},L=new pe(E);n.push(L)}if(h){const E={normalize:!1,pos:A.pos,lineWidth:Math.floor(f/10),points:[0,0,M,0],strokeColor:T,name:`${s}_lineThrough`,className:"lineThrough"},L=new pe(E);n.push(L)}}}return n}static updateNodeOpt(t){const{node:e,opt:n,vNodes:i,targetNode:a}=t,{fontBgColor:s,fontColor:o,translate:f,box:v,boxScale:l,boxTranslate:p,bold:y,italic:O,lineThrough:x,underline:m,fontSize:T,textInfos:c,zIndex:h}=n,u=a&&Jt(a)||i.get(e.name);if(!u)return;const g=e.parent;if(!g)return;const M=u.opt;if(Qt(h)&&(e.setAttribute("zIndex",h),u.opt.zIndex=h),o&&M.fontColor&&(M.fontColor=o,e.children.forEach(A=>{A.tagName==="LABEL"?A.setAttribute("fillColor",o):A.tagName==="POLYLINE"&&A.setAttribute("strokeColor",o)})),s&&M.fontBgColor&&(M.fontBgColor=s),y&&(M.bold=y),O&&(M.italic=O),ce(x)&&(M.lineThrough=x),ce(m)&&(M.underline=m),T&&(M.fontSize=T),v&&p&&l){const A=c==null?void 0:c.get(e.name);if(A){const{fontSize:E,boxSize:L}=A;M.boxSize=L||M.boxSize,M.fontSize=E||M.fontSize}const I=u.rect,b=Re(xn(I,l),p);M.boxPoint=b&&[(b.x-g.worldPosition[0])/g.worldScaling[0],(b.y-g.worldPosition[1])/g.worldScaling[1]]}else if(f&&M.boxPoint){const A=[f[0]/g.worldScaling[0],f[1]/g.worldScaling[1]];M.boxPoint=[M.boxPoint[0]+A[0],M.boxPoint[1]+A[1]],u.centerPos=[u.centerPos[0]+A[0],u.centerPos[1]+A[1]],u.rect=Re(u.rect,A)}return u&&i.setInfo(e.name,u),u==null?void 0:u.rect}static getRectFromLayer(t,e){const n=t.getElementsByName(e)[0];if(n){const i=n.getBoundingClientRect();return{x:Math.floor(i.x),y:Math.floor(i.y),w:Math.floor(i.width),h:Math.floor(i.height)}}}}function Vn(d){switch(d){case ht.Arrow:return jn;case ht.Pencil:return On;case ht.Straight:return Kn;case ht.Ellipse:return Un;case ht.Polygon:case ht.Triangle:return Gn;case ht.Star:case ht.Rhombus:return zn;case ht.Rectangle:return $n;case ht.SpeechBalloon:return Hn;case ht.Text:return be;case ht.LaserPen:return En;case ht.Eraser:return ae;case ht.Selector:return Nt;case ht.Image:return Le}}function yr(d,r){const{toolsType:t,...e}=d;switch(t){case ht.Arrow:return new jn(e);case ht.Pencil:return new On(e);case ht.Straight:return new Kn(e);case ht.Ellipse:return new Un(e);case ht.Polygon:case ht.Triangle:return new Gn(e);case ht.Star:case ht.Rhombus:return new zn(e);case ht.Rectangle:return new $n(e);case ht.SpeechBalloon:return new Hn(e);case ht.Text:return new be(e);case ht.LaserPen:return new En(e);case ht.Eraser:return new ae(e,r);case ht.Selector:return e.vNodes?new Nt({...e,vNodes:e.vNodes,drawLayer:e.fullLayer}):void 0;case ht.Image:return new Le(e);default:return}}function Yn(d){const r=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE"];for(const e of d){if(e.tagName==="GROUP"&&e.children.length)return Yn(e.children);e.tagName&&t.includes(e.tagName)&&r.push(e)}return r}class l0 extends kt{constructor(){super(...arguments);nt(this,"emitEventType",Lt.SetColorNode)}consume(t){const{msgType:e,dataType:n,emitEventType:i}=t;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0}async consumeForLocalWorker(t){var f;const{workId:e,updateNodeOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,textUpdateForWoker:o}=t;e===Nt.selectorId&&n&&await((f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,textUpdateForWoker:o,callback:this.updateSelectorCallback}))}updateSelectorCallback(t){const{param:e,postData:n,newServiceStore:i}=t,{willSyncService:a,isSync:s,textUpdateForWoker:o}=e,f=n.render||[],v=n.sp||[];if(a)for(const[l,p]of i.entries())o&&p.toolsType===ht.Text?v.push({...p,workId:l,type:ct.TextUpdate,dataType:Tt.Local,willSyncService:!0}):v.push({...p,workId:l,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s});return{render:f,sp:v}}}class c0 extends kt{constructor(){super(...arguments);nt(this,"emitEventType",Lt.ZIndexNode)}consume(t){const{msgType:e,dataType:n,emitEventType:i}=t;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0}async consumeForLocalWorker(t){var o;const{workId:e,updateNodeOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s}=t;e===Nt.selectorId&&n&&await((o=this.localWork)==null?void 0:o.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback}))}updateSelectorCallback(t){const{param:e,postData:n,newServiceStore:i}=t,{willSyncService:a,isSync:s}=e,o=n.render||[],f=n.sp||[];if(a&&f)for(const[v,l]of i.entries())f.push({...l,workId:v,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s});return{render:o,sp:f}}}class f0 extends kt{constructor(){super(...arguments);nt(this,"emitEventType",Lt.TranslateNode)}consume(t){const{msgType:e,dataType:n,emitEventType:i}=t;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0}async consumeForLocalWorker(t){var v,l;const{workId:e,updateNodeOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,textUpdateForWoker:o,emitEventType:f}=t;e===Nt.selectorId&&n&&(n.workState===Rt.Done&&(n!=null&&n.translate)&&(n.translate[0]||n.translate[1])||n.workState!==Rt.Done?await((v=this.localWork)==null?void 0:v.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,isSync:!0,textUpdateForWoker:o,emitEventType:f,scene:this.scene,callback:this.updateSelectorCallback})):n.workState===Rt.Done&&((l=this.localWork)==null||l.vNodes.deleteLastTarget()))}updateSelectorCallback(t){const{param:e,postData:n,newServiceStore:i,workShapeNode:a,res:s}=t,{willSyncService:o,isSync:f,updateSelectorOpt:v,textUpdateForWoker:l}=e,p=v.workState,y=n.render||[],O=n.sp||[];if(p===Rt.Start)return{sp:[],render:[]};const x=s==null?void 0:s.selectRect;if(o){p===Rt.Doing&&O.push({type:ct.Select,selectIds:a.selectIds,selectRect:x,willSyncService:!0,isSync:!0,points:a.getChildrenPoints(),textOpt:a.textOpt});for(const[m,T]of i.entries())l&&T.toolsType===ht.Text?O.push({...T,workId:m,type:ct.TextUpdate,dataType:Tt.Local,willSyncService:!0}):O.push({...T,workId:m,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f})}return{render:y,sp:O}}}class u0 extends kt{constructor(){super(...arguments);nt(this,"emitEventType",Lt.DeleteNode)}consume(t){const{msgType:e,dataType:n,emitEventType:i}=t;if(e===ct.RemoveNode){if(n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;if(n===Tt.Service&&i===this.emitEventType)return this.consumeForServiceWorker(t),!0}}consumeForLocalWorker(t){if(!this.localWork)return;const{removeIds:e,willRefresh:n,willSyncService:i,viewId:a}=t;if(!(e!=null&&e.length))return;let s;const o=[],f=[],v=[];for(const l of e){if(l===Nt.selectorId){const y=this.localWork.workShapes.get(Nt.selectorId);if(!y)return;const O=y.selectIds&&[...y.selectIds]||[];for(const m of O){if(this.localWork.vNodes.get(m)){const c=this.commandDeleteText(m);c&&o.push(c)}s=Ot(s,this.localWork.removeNode(m)),v.push(m)}const x=y==null?void 0:y.updateSelectIds([]);s=Ot(s,x.bgRect),this.localWork.clearWorkShapeNodeCache(Nt.selectorId),this.localWork.workShapes.delete(Nt.selectorId),o.push({type:ct.Select,selectIds:[],willSyncService:i});continue}const p=this.commandDeleteText(l);p&&o.push(p),s=Ot(s,this.localWork.removeNode(l)),v.push(l)}i&&o.push({type:ct.RemoveNode,removeIds:v}),s&&n&&f.push({rect:Bt(s),clearCanvas:Mt.Bg,isClear:!0,viewId:a},{rect:Bt(s),drawCanvas:Mt.Bg,viewId:a}),(f.length||o.length)&&this.localWork._post({render:f,sp:o})}consumeForServiceWorker(t){this.serviceWork&&this.serviceWork.removeSelectWork(t)}commandDeleteText(t){var n;const e=(n=this.localWork)==null?void 0:n.vNodes.get(t);if(e&&e.toolsType===ht.Text)return{type:ct.TextUpdate,toolsType:ht.Text,workId:t,dataType:Tt.Local}}}class h0 extends kt{constructor(){super(...arguments);nt(this,"emitEventType",Lt.ScaleNode)}consume(t){const{msgType:e,dataType:n,emitEventType:i}=t;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0}async consumeForLocalWorker(t){var s;const{workId:e,updateNodeOpt:n,willSyncService:i,willSerializeData:a}=t;e===Nt.selectorId&&n&&await((s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willSyncService:i,willSerializeData:a,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback.bind(this)}))}updateSelectorCallback(t){const{param:e,postData:n,workShapeNode:i,res:a,newServiceStore:s}=t,{updateSelectorOpt:o,willSyncService:f,willSerializeData:v}=e,l=o.workState,p=n.render||[],y=n.sp||[],O=a==null?void 0:a.selectRect;if(l===Rt.Start)return{sp:[],render:[]};if(f){l===Rt.Doing&&y.push({type:ct.Select,selectIds:i.selectIds,selectRect:O,willSyncService:!0,isSync:!0,points:i.getChildrenPoints(),textOpt:i.textOpt}),v&&l===Rt.Done&&y.push({type:ct.Select,selectIds:i.selectIds,selectRect:O,willSyncService:!1,isSync:!0,points:i.getChildrenPoints(),textOpt:i.textOpt});for(const[x,m]of s.entries())m.toolsType===ht.Text?y.push({...m,workId:x,type:ct.TextUpdate,dataType:Tt.Local,willSyncService:!0}):y.push({...m,workId:x,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0})}return{render:p,sp:y}}}class d0 extends kt{constructor(){super(...arguments);nt(this,"emitEventType",Lt.RotateNode)}consume(t){const{msgType:e,dataType:n,emitEventType:i}=t;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0}async consumeForLocalWorker(t){var f;const{workId:e,updateNodeOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,emitEventType:o}=t;e===Nt.selectorId&&n&&await((f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,emitEventType:o,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback}))}updateSelectorCallback(t){const{param:e,postData:n,workShapeNode:i,res:a,newServiceStore:s}=t,{updateSelectorOpt:o,willSyncService:f,willSerializeData:v,isSync:l}=e,p=o.workState,y=n.render||[],O=n.sp||[],x=a==null?void 0:a.selectRect;if(f){v&&p===Rt.Done&&O.push({type:ct.Select,selectIds:i.selectIds,selectRect:x,willSyncService:!0,isSync:l,points:i.getChildrenPoints(),textOpt:i.textOpt,selectorColor:i.selectorColor,strokeColor:i.strokeColor,fillColor:i.fillColor,canTextEdit:i.canTextEdit,canRotate:i.canRotate,scaleType:i.scaleType,opt:i.getWorkOptions()||void 0,canLock:i.canLock,isLocked:i.isLocked,toolsTypes:i.toolsTypes,shapeOpt:i.shapeOpt});for(const[m,T]of s.entries())O.push({...T,workId:m,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l})}return{render:y,sp:O}}}class g0 extends kt{constructor(){super(...arguments);nt(this,"emitEventType",Lt.SetFontStyle)}consume(t){const{msgType:e,dataType:n,emitEventType:i}=t;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0}async consumeForLocalWorker(t){var f;const{workId:e,updateNodeOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,textUpdateForWoker:o}=t;e===Nt.selectorId&&n&&await((f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,textUpdateForWoker:o,callback:this.updateSelectorCallback}))}updateSelectorCallback(t){const{param:e,postData:n,newServiceStore:i,workShapeNode:a,res:s}=t,{willSyncService:o,isSync:f,updateSelectorOpt:v,textUpdateForWoker:l}=e,p=n.render||[],y=n.sp||[],O=s==null?void 0:s.selectRect;if(o&&y){v.fontSize&&y.push({type:ct.Select,selectIds:a.selectIds,selectRect:O,willSyncService:o,isSync:f,points:a.getChildrenPoints()});for(const[x,m]of i.entries())l&&m.toolsType===ht.Text?y.push({...m,workId:x,type:ct.TextUpdate,dataType:Tt.Local,willSyncService:!0}):y.push({...m,workId:x,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f})}return{render:p,sp:y}}}class p0 extends kt{constructor(){super(...arguments);nt(this,"emitEventType",Lt.SetPoint)}consume(t){const{msgType:e,dataType:n,emitEventType:i}=t;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0}async consumeForLocalWorker(t){var f;const{workId:e,updateNodeOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,textUpdateForWoker:o}=t;e===Nt.selectorId&&n&&await((f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,emitEventType:this.emitEventType,willSerializeData:s,isSync:!0,textUpdateForWoker:o,callback:this.updateSelectorCallback}))}updateSelectorCallback(t){const{param:e,postData:n,newServiceStore:i,workShapeNode:a,res:s}=t,{willSyncService:o,isSync:f}=e,v=n.render||[],l=n.sp||[],p=s==null?void 0:s.selectRect;if(o&&l){for(const[y,O]of i.entries())l.push({...O,workId:y,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f});l.push({type:ct.Select,selectIds:a.selectIds,selectRect:p,willSyncService:o,isSync:f,points:a.getChildrenPoints()})}return{render:v,sp:l}}}class v0 extends kt{constructor(){super(...arguments);nt(this,"emitEventType",Lt.SetLock)}consume(t){const{msgType:e,dataType:n,emitEventType:i}=t;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0}async consumeForLocalWorker(t){var o;const{workId:e,updateNodeOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s}=t;e===Nt.selectorId&&n&&await((o=this.localWork)==null?void 0:o.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback}))}updateSelectorCallback(t){const{param:e,postData:n,newServiceStore:i,workShapeNode:a,res:s}=t,{willSyncService:o,isSync:f,updateSelectorOpt:v}=e,l=n.render||[],p=n.sp||[],y=s==null?void 0:s.selectRect;if(o&&p){for(const[O,x]of i.entries())p.push({...x,workId:O,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f});p.push({isLocked:v.isLocked,selectorColor:a.selectorColor,scaleType:a.scaleType,canRotate:a.canRotate,type:ct.Select,selectIds:a.selectIds,selectRect:y,willSyncService:o,isSync:f})}return{render:l,sp:p}}}class m0 extends kt{constructor(){super(...arguments);nt(this,"emitEventType",Lt.SetShapeOpt)}consume(t){const{msgType:e,dataType:n,emitEventType:i}=t;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0}async consumeForLocalWorker(t){var o;const{workId:e,updateNodeOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s}=t;e===Nt.selectorId&&n&&await((o=this.localWork)==null?void 0:o.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback}))}updateSelectorCallback(t){const{param:e,postData:n,newServiceStore:i}=t,{willSyncService:a,isSync:s}=e,o=n.render||[],f=n.sp||[];if(a&&f)for(const[v,l]of i.entries())f.push({...l,workId:v,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s});return{render:o,sp:f}}}class y0{constructor(r){nt(this,"builders",new Map);this.builders=new Map(r.map(t=>[t,this.build(t)]))}build(r){switch(r){case Lt.TranslateNode:return new f0;case Lt.ZIndexNode:return new c0;case Lt.CopyNode:return new Ch;case Lt.SetColorNode:return new l0;case Lt.DeleteNode:return new u0;case Lt.ScaleNode:return new h0;case Lt.RotateNode:return new d0;case Lt.SetFontStyle:return new g0;case Lt.SetPoint:return new p0;case Lt.SetLock:return new v0;case Lt.SetShapeOpt:return new m0}}registerForWorker(r,t,e){return this.builders.forEach(n=>{n&&n.registerForWorker(r,t,e)}),this}consumeForWorker(r){for(const t of this.builders.values())if(t!=null&&t.consume(r))return!0;return!1}}const Sr="cursorhover";class S0{constructor(r,t){nt(this,"viewId");nt(this,"scene");nt(this,"scenePath");nt(this,"fullLayer");nt(this,"curNodeMap",new Map);nt(this,"targetNodeMap",[]);this.viewId=r,this.scene=t}init(r){this.fullLayer=r}get(r){return this.curNodeMap.get(r)}hasRenderNodes(){let r=!1;for(const t of this.curNodeMap.values())Bh(t)&&(r=!0);return r}has(r){this.curNodeMap.has(r)}setInfo(r,t){const e=this.curNodeMap.get(r)||{name:r,rect:t.rect};t.rect&&(e.rect=Jt(t.rect)),t.op&&(e.op=Jt(t.op)),t.canRotate&&(e.canRotate=t.canRotate),t.scaleType&&(e.scaleType=t.scaleType),t.opt&&(e.opt=Jt(t.opt)),t.toolsType&&(e.toolsType=t.toolsType),t.centerPos&&(e.centerPos=Jt(t.centerPos)),ce(t.isSelected)&&(e.isSelected=t.isSelected),e.rect?this.curNodeMap.set(r,e):this.curNodeMap.delete(r)}selected(r){this.setInfo(r,{isSelected:!0})}unSelected(r){this.setInfo(r,{isSelected:!1})}delete(r){this.curNodeMap.delete(r)}clear(){this.curNodeMap.clear(),this.targetNodeMap.length=0}hasRectIntersectRange(r,t=!0){for(const e of this.curNodeMap.values())if(Ce(r,e.rect)){if(t&&e.toolsType===ht.Image&&e.opt.locked||t&&e.toolsType===ht.Text&&(e.opt.workState===Rt.Doing||e.opt.workState===Rt.Start))continue;return!0}return!1}getRectIntersectRange(r,t=!0){let e;const n=new Map;for(const[i,a]of this.curNodeMap.entries())if(Ce(r,a.rect)){if(t&&a.toolsType===ht.Image&&a.opt.locked||t&&a.toolsType===ht.Text&&(a.opt.workState===Rt.Doing||a.opt.workState===Rt.Start))continue;e=Ot(e,a.rect),n.set(i,a)}return{rectRange:e,nodeRange:n}}getNodeRectFormShape(r,t){const e=Vn(t.toolsType);return this.fullLayer&&(e==null?void 0:e.getRectFromLayer(this.fullLayer,r))}updateNodesRect(){this.curNodeMap.forEach((r,t)=>{const e=this.getNodeRectFormShape(t,r);e?(r.rect=e,this.curNodeMap.set(t,r)):this.curNodeMap.delete(t)})}combineIntersectRect(r){let t=r;return this.curNodeMap.forEach(e=>{Ce(t,e.rect)&&(t=Ot(t,e.rect))}),t}setTarget(){return this.targetNodeMap.push(Jt(this.curNodeMap)),this.targetNodeMap.length-1}getLastTarget(){return this.targetNodeMap[this.targetNodeMap.length-1]}deleteLastTarget(){this.targetNodeMap.length=this.targetNodeMap.length-1}getTarget(r){return this.targetNodeMap[r]}deleteTarget(r){this.targetNodeMap.length=r}}class Xn{constructor(r,t){nt(this,"viewId");nt(this,"fullLayer");nt(this,"vNodes");nt(this,"dpr");nt(this,"opt");nt(this,"cameraOpt");nt(this,"scene");nt(this,"isSafari",!1);nt(this,"combinePostMsg",new Set);nt(this,"workerTaskId");this.viewId=r,this.opt=t,this.dpr=t.dpr,this.scene=this.createScene(t.offscreenCanvasOpt),this.fullLayer=this.createLayer("fullLayer",this.scene,{...t.layerOpt,bufferSize:this.viewId==="mainView"?6e3:3e3}),this.vNodes=new S0(r,this.scene)}setIsSafari(r){this.isSafari=r}async on(r,t){const{msgType:e,toolsType:n,opt:i,workId:a,workState:s,dataType:o}=r;switch(Qt(t)&&this.post({workerTasksqueueCount:t}),e){case ct.Destroy:this.destroy();break;case ct.Clear:this.clearAll();break;case ct.UpdateTools:if(n&&i){const f={toolsType:n,toolsOpt:i};this.localWork.setToolsOpt(f)}break;case ct.CreateWork:a&&i&&(!this.localWork.getTmpWorkShapeNode()&&n&&this.setToolsOpt({toolsType:n,toolsOpt:i}),this.setWorkOpt({workId:a,toolsOpt:i}));break;case ct.DrawWork:s===Rt.Done&&o===Tt.Local?this.consumeDrawAll(o,r):this.consumeDraw(o,r);break}}updateScene(r){this.scene.attr({...r});const{width:t,height:e}=r;this.scene.container.width=t,this.scene.container.height=e,this.scene.width=t,this.scene.height=e,this.updateLayer({width:t,height:e})}updateLayer(r){const{width:t,height:e}=r;this.fullLayer&&(this.fullLayer.parent.setAttribute("width",t),this.fullLayer.parent.setAttribute("height",e),this.fullLayer.setAttribute("size",[t,e]),this.fullLayer.setAttribute("pos",[t*.5,e*.5]))}createScene(r){const{width:t,height:e}=r,n=new OffscreenCanvas(t,e);return new Kh({container:n,displayRatio:this.dpr,depth:!1,desynchronized:!0,...r})}createLayer(r,t,e){const{width:n,height:i}=e,a=`offscreen-${r}`,s=t.layer(a,e),o=new se({anchor:[.5,.5],pos:[n*.5,i*.5],size:[n,i],name:"viewport",id:r});return s.append(o),o}clearAll(){var r;this.fullLayer&&(this.fullLayer.parent.children.forEach(t=>{t.name!=="viewport"&&t.remove()}),this.fullLayer.removeAllChildren()),this.localWork.destroy(),(r=this.serviceWork)==null||r.destroy()}setToolsOpt(r){this.localWork.setToolsOpt(r)}setWorkOpt(r){const{workId:t,toolsOpt:e}=r;t&&e&&this.localWork.setWorkOptions(t,e)}destroy(){var r;this.vNodes.clear(),this.fullLayer.remove(),this.scene.remove(),this.localWork.destroy(),(r=this.serviceWork)==null||r.destroy()}post(r){this.combinePostMsg.add(r),this.runBatchPostData()}runBatchPostData(){this.workerTaskId||(this.workerTaskId=requestAnimationFrame(this.combinePost.bind(this)))}combinePostData(){var a,s;this.workerTaskId=void 0;const r=[],t=[];let e,n;const i=new Set;for(const o of this.combinePostMsg.values()){if((a=o.render)!=null&&a.length)for(const f of o.render){let v=!1;if(f.workId&&i.add(f.workId),f.isClearAll&&(f.rect=this.getSceneRect(),f.isClear=!0,delete f.isClearAll),f.drawCanvas){const l=this.getLayer(f.drawCanvas);if(!l)continue;if(l.parent.render(),f.isDrawAll){const p=this.getSceneRect(),{rectRange:y}=this.vNodes.getRectIntersectRange(p,!1);f.rect=y,delete f.isDrawAll}}for(const l of r)if(f.viewId===l.viewId){f.isClear&&l.clearCanvas&&l.isClear&&l.clearCanvas===f.clearCanvas&&(l.rect=Ot(l.rect,f.rect),v=!0),l.drawCanvas&&l.drawCanvas===f.drawCanvas&&(l.rect=Ot(l.rect,f.rect),v=!0);continue}if(!v)if(f.isClear&&!f.drawCanvas){const l=r.find(p=>p.drawCanvas===f.clearCanvas&&le(p.rect,f.rect));l!=null&&l.rect&&(l.rect=Bt(l.rect,2)),r.unshift(f)}else f.drawCanvas&&!f.clearCanvas&&f.rect&&r.find(l=>l.isClear&&l.clearCanvas===f.drawCanvas&&le(l.rect,f.rect))&&(f.rect=Bt(f.rect,2)),r.push(f)}if((s=o.sp)!=null&&s.length)for(const f of o.sp){let v=!1;for(const l of t)if(le(f,l)){v=!0;break}v||t.push(f)}Qt(o.drawCount)&&(e=o.drawCount),Qt(o.workerTasksqueueCount)&&(n=o.workerTasksqueueCount)}return this.combinePostMsg.clear(),{render:r,sp:t,drawCount:e,workerTasksqueueCount:n,workIds:i}}safariFixRect(r){if(r.w+r.x<=0||r.h+r.y<=0||r.w<=0||r.h<=0)return;const t=this.scene.width,e=this.scene.height,n={x:Math.floor(Math.max(0,r.x)),y:Math.floor(Math.max(0,r.y)),w:Math.floor(Math.min(t,r.w)),h:Math.floor(Math.min(e,r.h))};return n.x+n.w>t&&(n.w=Math.floor(t-n.x)),n.y+n.h>e&&(n.h=Math.floor(e-n.y)),n}getSceneRect(){const{width:r,height:t}=this.scene;return{x:0,y:0,w:Math.floor(r),h:Math.floor(t)}}}class Jn{constructor(r){nt(this,"viewId");nt(this,"vNodes");nt(this,"thread");nt(this,"fullLayer");nt(this,"drawLayer");nt(this,"_post");nt(this,"tmpWorkShapeNode");nt(this,"tmpOpt");nt(this,"workShapes",new Map);nt(this,"workShapeState",new Map);nt(this,"effectWorkId");nt(this,"drawCount",0);this.thread=r.thread,this.viewId=r.viewId,this.vNodes=r.vNodes,this.fullLayer=r.fullLayer,this.drawLayer=r.drawLayer,this._post=this.thread.post.bind(r.thread)}destroy(){this.workShapeState.clear(),this.workShapes.clear()}getWorkShape(r){return this.workShapes.get(r)}getTmpWorkShapeNode(){return this.tmpWorkShapeNode}setTmpWorkId(r){if(r&&this.tmpWorkShapeNode){this.tmpWorkShapeNode.setWorkId(r),this.workShapes.set(r,this.tmpWorkShapeNode),this.tmpOpt&&this.setToolsOpt(this.tmpOpt);return}}setWorkOptions(r,t){var n;this.workShapes.get(r)||this.setTmpWorkId(r),(n=this.workShapes.get(r))==null||n.setWorkOptions(t)}createWorkShapeNode(r){var t;return yr({...r,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},(t=this.thread)==null?void 0:t.serviceWork)}setToolsOpt(r){var t,e;((t=this.tmpOpt)==null?void 0:t.toolsType)!==r.toolsType&&(e=this.tmpOpt)!=null&&e.toolsType&&this.clearAllWorkShapesCache(),this.tmpOpt=r,this.tmpWorkShapeNode=this.createWorkShapeNode(r)}clearWorkShapeNodeCache(r){var t;(t=this.getWorkShape(r))==null||t.clearTmpPoints(),this.workShapes.delete(r),this.workShapeState.delete(r)}clearAllWorkShapesCache(){this.workShapes.forEach(r=>r.clearTmpPoints()),this.workShapes.clear(),this.workShapeState.clear()}setFullWork(r){const{workId:t,opt:e,toolsType:n}=r;if(t&&e&&n){const i=t&&this.workShapes.get(t)||this.createWorkShapeNode({toolsOpt:e,toolsType:n,workId:t});return i?(i.setWorkId(t),this.workShapes.set(t,i),i):void 0}}}var x0=Zt,T0=function(){return x0.Date.now()},M0=T0,O0=/\s/;function E0(d){for(var r=d.length;r--&&O0.test(d.charAt(r)););return r}var P0=E0,A0=P0,C0=/^\s+/;function R0(d){return d&&d.slice(0,A0(d)+1).replace(C0,"")}var I0=R0,L0=ue,b0=ie,D0="[object Symbol]";function w0(d){return typeof d=="symbol"||b0(d)&&L0(d)==D0}var N0=w0,W0=I0,Qn=oe,B0=N0,Zn=NaN,F0=/^[-+]0x[0-9a-f]+$/i,j0=/^0b[01]+$/i,U0=/^0o[0-7]+$/i,$0=parseInt;function z0(d){if(typeof d=="number")return d;if(B0(d))return Zn;if(Qn(d)){var r=typeof d.valueOf=="function"?d.valueOf():d;d=Qn(r)?r+"":r}if(typeof d!="string")return d===0?d:+d;d=W0(d);var t=j0.test(d);return t||U0.test(d)?$0(d.slice(2),t?2:8):F0.test(d)?Zn:+d}var G0=z0,H0=oe,xr=M0,kn=G0,K0="Expected a function",V0=Math.max,Y0=Math.min;function X0(d,r,t){var e,n,i,a,s,o,f=0,v=!1,l=!1,p=!0;if(typeof d!="function")throw new TypeError(K0);r=kn(r)||0,H0(t)&&(v=!!t.leading,l="maxWait"in t,i=l?V0(kn(t.maxWait)||0,r):i,p="trailing"in t?!!t.trailing:p);function y(M){var A=e,I=n;return e=n=void 0,f=M,a=d.apply(I,A),a}function O(M){return f=M,s=setTimeout(T,r),v?y(M):a}function x(M){var A=M-o,I=M-f,b=r-A;return l?Y0(b,i-I):b}function m(M){var A=M-o,I=M-f;return o===void 0||A>=r||A<0||l&&I>=i}function T(){var M=xr();if(m(M))return c(M);s=setTimeout(T,x(M))}function c(M){return s=void 0,p&&e?y(M):(e=n=void 0,a)}function h(){s!==void 0&&clearTimeout(s),f=0,e=o=n=s=void 0}function u(){return s===void 0?a:c(xr())}function g(){var M=xr(),A=m(M);if(e=arguments,n=this,o=M,A){if(s===void 0)return O(o);if(l)return clearTimeout(s),s=setTimeout(T,r),y(o)}return s===void 0&&(s=setTimeout(T,r)),a}return g.cancel=h,g.flush=u,g}var J0=X0,Q0=J0,Z0=oe,k0="Expected a function";function q0(d,r,t){var e=!0,n=!0;if(typeof d!="function")throw new TypeError(k0);return Z0(t)&&(e="leading"in t?!!t.leading:e,n="trailing"in t?!!t.trailing:n),Q0(d,r,{leading:e,maxWait:r,trailing:n})}var _0=q0,tg=Xt(_0);class eg extends Jn{constructor(t){super(t);nt(this,"combineUnitTime",600);nt(this,"combineTimerId");nt(this,"effectSelectNodeData",new Set);nt(this,"batchEraserWorks",new Set);nt(this,"batchEraserRemoveNodes",new Set);nt(this,"batchEraserCombine",tg(()=>{const t=this.updateBatchEraserCombineNode(this.batchEraserWorks,this.batchEraserRemoveNodes);this.batchEraserWorks.clear(),this.batchEraserRemoveNodes.clear(),t.length&&this._post({render:t})},100,{leading:!1}))}consumeDraw(t,e){const{op:n,workId:i}=t;if(n!=null&&n.length&&i){const a=this.workShapes.get(i);if(!a)return;const s=a.toolsType;if(s===ht.LaserPen)return;const o=a.consume({data:t,isFullWork:!0});switch(s){case ht.Selector:o.type===ct.Select&&(o.selectIds&&e.runReverseSelectWork(o.selectIds),this.drawSelector(o));break;case ht.Eraser:o!=null&&o.rect&&this.drawEraser(o);break;case ht.Arrow:case ht.Straight:case ht.Ellipse:case ht.Rectangle:case ht.Star:case ht.Polygon:case ht.SpeechBalloon:o&&(this.drawCount++,this.drawPencil(o));break;case ht.Pencil:this.combineTimerId||(this.combineTimerId=setTimeout(()=>{this.combineTimerId=void 0,this.drawPencilCombine(i)},Math.floor(a.getWorkOptions().syncUnitTime||this.combineUnitTime/2))),o&&(this.drawCount++,this.drawPencil(o));break}}}consumeDrawAll(t,e){var a,s,o;this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0);const{workId:n,scenePath:i}=t;if(n){const f=this.workShapes.get(n);if(!f)return;const v=f.toolsType;if(v===ht.LaserPen)return;const l=this.workShapes.get(Sr),p=(a=l==null?void 0:l.selectIds)==null?void 0:a[0],y=f.consumeAll({data:t}),O=this.workShapeState.get(n);switch(v){case ht.Selector:y.selectIds&&p&&((s=y.selectIds)!=null&&s.includes(p))&&l.cursorBlur(),y.selectIds&&e.runReverseSelectWork(y.selectIds),this.drawSelector({...y,scenePath:i}),(o=f.selectIds)!=null&&o.length?f.clearTmpPoints():this.clearWorkShapeNodeCache(n);break;case ht.Eraser:y!=null&&y.rect&&this.drawEraser({...y,scenePath:i}),f.clearTmpPoints();break;case ht.Arrow:case ht.Straight:case ht.Ellipse:case ht.Rectangle:case ht.Star:case ht.Polygon:case ht.SpeechBalloon:this.drawPencilFull({...y,scenePath:i},f.getWorkOptions(),O),this.drawCount=0,this.clearWorkShapeNodeCache(n);break;case ht.Pencil:y!=null&&y.rect&&(this.drawPencilFull({...y,scenePath:i},f.getWorkOptions(),O),this.drawCount=0),this.clearWorkShapeNodeCache(n);break}}}async consumeFull(t,e){var a,s;const n=this.setFullWork(t),i=t.ops&&Ie(t.ops);if(n){const o=(a=t.workId)==null?void 0:a.toString();if(!o)return;const f=(s=this.vNodes.get(o))==null?void 0:s.rect;let v,l;n.toolsType===ht.Image&&e?(v=await n.consumeServiceAsync({scene:e,isFullWork:!0,replaceId:o}),l=(t==null?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt)):n.toolsType===ht.Text?v=await n.consumeServiceAsync({isFullWork:!0,replaceId:o}):(v=n.consumeService({op:i,isFullWork:!0,replaceId:o}),l=(t==null?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt)),v=Ot(v,l);const p=[],y=[];if(t.workId&&this.workShapes.delete(t.workId),n.toolsType===ht.Text&&console.log("text-render",n.getWorkOptions(),v,t.willRefresh,this.fullLayer.children),v&&t.willRefresh&&(f&&p.push({rect:v,isClear:!0,clearCanvas:Mt.Bg,viewId:this.viewId}),p.push({rect:v,drawCanvas:Mt.Bg,viewId:this.viewId})),t.willSyncService&&y.push({opt:t.opt,toolsType:t.toolsType,type:ct.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),p.length||y.length){const O={render:p,sp:y};this._post(O)}}}removeWork(t){const{workId:e}=t,n=e==null?void 0:e.toString();if(n){const i=this.removeNode(n);i&&this._post({render:[{rect:Bt(i),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(i),drawCanvas:Mt.Bg,viewId:this.viewId}]})}}removeNode(t){var i;this.workShapes.has(t)&&this.clearWorkShapeNodeCache(t);let e;const n=this.vNodes.get(t);return n&&(this.fullLayer.getElementsByName(t).concat(((i=this.drawLayer)==null?void 0:i.getElementsByName(t))||[]).forEach(a=>{a.remove()}),e=Ot(e,n.rect),this.vNodes.delete(t)),e}async checkTextActive(t){const{op:e,viewId:n,dataType:i}=t;if(e!=null&&e.length){let a;for(const s of this.vNodes.curNodeMap.values()){const{rect:o,name:f,toolsType:v,opt:l}=s,p=e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y=e[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];if(v===ht.Text&&Nh([p,y],o)&&l.workState===Rt.Done){a=f;break}}a&&(await this.blurSelector({viewId:n,msgType:ct.Select,dataType:i,isSync:!0}),this._post({sp:[{type:ct.GetTextActive,toolsType:ht.Text,workId:a}]}))}}async colloctEffectSelectWork(t){const e=this.workShapes.get(Nt.selectorId),{workId:n,msgType:i}=t;if(e&&n&&e.selectIds&&e.selectIds.includes(n.toString())){i===ct.RemoveNode?e.selectIds=e.selectIds.filter(a=>a!==n.toString()):this.effectSelectNodeData.add(t),await new Promise(a=>{setTimeout(()=>{a(!0)},0)}),await this.runEffectSelectWork(!0).then(()=>{var a;(a=this.effectSelectNodeData)==null||a.clear()});return}return t}async updateSelector(t){var O;const e=this.workShapes.get(Nt.selectorId);if(!((O=e==null?void 0:e.selectIds)!=null&&O.length))return;const{callback:n,...i}=t,{updateSelectorOpt:a,willSerializeData:s,scene:o}=i,f=await(e==null?void 0:e.updateSelector({updateSelectorOpt:a,selectIds:e.selectIds,vNodes:this.vNodes,willSerializeData:s,worker:this,scene:o})),v=new Map;e.selectIds.forEach(x=>{const m=this.vNodes.get(x);if(m){const{toolsType:T,op:c,opt:h}=m;v.set(x,{opt:h,toolsType:T,ops:(c==null?void 0:c.length)&&qt(c)||void 0})}});const l=[],p=[];f!=null&&f.rect&&l.push({rect:Bt(f.rect),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(f.rect),drawCanvas:Mt.Bg,viewId:this.viewId});const y=n&&n({res:f,workShapeNode:e,param:i,postData:{render:l,sp:p},newServiceStore:v})||{render:l,sp:p};(y.render.length||y.sp.length)&&this._post(y)}async blurSelector(t){var i;const e=this.workShapes.get(Nt.selectorId),n=e==null?void 0:e.blurSelector();if(this.clearWorkShapeNodeCache(Nt.selectorId),((i=this.fullLayer)==null?void 0:i.parent).children.forEach(a=>{a.name===Nt.selectorId&&a.remove()}),n){const a=[];a.push({...n,isSync:t==null?void 0:t.isSync}),this._post({render:(n==null?void 0:n.rect)&&[{rect:Bt(n.rect),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(n.rect),drawCanvas:Mt.Bg,viewId:this.viewId}],sp:a})}}reRenderSelector(t=!1){var a;const e=this.workShapes.get(Nt.selectorId);if(!e)return;if(e&&!((a=e.selectIds)!=null&&a.length))return this.blurSelector();const n=e.oldSelectRect,i=e.reRenderSelector();if(i){const s=Ot(n,i)||i;this._post({render:[{rect:Bt(s),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(s),drawCanvas:Mt.Bg,viewId:this.viewId}],sp:[{type:ct.Select,selectIds:e.selectIds,selectRect:i,willSyncService:t,viewId:this.viewId,points:e.getChildrenPoints(),textOpt:e.textOpt,selectorColor:e.selectorColor,strokeColor:e.strokeColor,fillColor:e.fillColor,canTextEdit:e.canTextEdit,canRotate:e.canRotate,scaleType:e.scaleType,opt:e.getWorkOptions()||void 0,canLock:e.canLock,isLocked:e.isLocked,toolsTypes:e.toolsTypes,shapeOpt:e.shapeOpt}]})}}updateFullSelectWork(t){var i,a,s,o,f,v,l;const e=this.workShapes.get(Nt.selectorId),{selectIds:n}=t;if(!(n!=null&&n.length)){this.blurSelector(t);return}if(!e){!this.setFullWork(t)&&t.workId&&((i=this.tmpWorkShapeNode)==null?void 0:i.toolsType)===ht.Selector&&this.setTmpWorkId(t.workId),this.updateFullSelectWork(t);return}if(e&&(n!=null&&n.length)){const{bgRect:p,selectRect:y}=e.updateSelectIds(n),O={render:[],sp:[]};p&&((a=O.render)==null||a.push({rect:Bt(p),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(p),drawCanvas:Mt.Bg,viewId:this.viewId})),(l=O.sp)==null||l.push({...t,selectorColor:((s=t.opt)==null?void 0:s.strokeColor)||e.selectorColor,strokeColor:((o=t.opt)==null?void 0:o.strokeColor)||e.strokeColor,fillColor:((f=t.opt)==null?void 0:f.fillColor)||e.fillColor,textOpt:((v=t.opt)==null?void 0:v.textOpt)||e.textOpt,canTextEdit:e.canTextEdit,canRotate:e.canRotate,scaleType:e.scaleType,type:ct.Select,selectRect:y,points:e.getChildrenPoints(),willSyncService:(t==null?void 0:t.willSyncService)||!1,opt:(t==null?void 0:t.willSyncService)&&e.getWorkOptions()||void 0,canLock:e.canLock,isLocked:e.isLocked,toolsTypes:e.toolsTypes,shapeOpt:e.shapeOpt}),this._post(O)}}destroy(){super.destroy(),this.effectSelectNodeData.clear(),this.batchEraserWorks.clear(),this.batchEraserRemoveNodes.clear()}drawPencilCombine(t){var n,i,a;const e=(n=this.workShapes.get(t))==null?void 0:n.combineConsume();if(e){const s={render:[],drawCount:this.drawCount};if(e!=null&&e.rect){const o=Bt(e.rect);(i=s.render)==null||i.push({rect:o,isClear:!0,clearCanvas:Mt.Float,viewId:this.viewId}),(a=s.render)==null||a.push({rect:o,drawCanvas:Mt.Float,viewId:this.viewId})}this._post(s)}}drawSelector(t){var n;const e={render:[],sp:[t]};t.rect&&((n=e.render)==null||n.push({rect:Bt(t.rect),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(t.rect),drawCanvas:Mt.Bg,viewId:this.viewId})),this._post(e)}async drawEraser(t){var n,i;const e=[];if((n=t.newWorkDatas)!=null&&n.size){for(const a of t.newWorkDatas.values()){const s=a.workId.toString();this.batchEraserWorks.add(s),e.push({type:ct.FullWork,workId:s,ops:qt(a.op),opt:a.opt,toolsType:a.toolsType,updateNodeOpt:{useAnimation:!1}})}delete t.newWorkDatas}(i=t.removeIds)==null||i.forEach(a=>{this.batchEraserRemoveNodes.add(a)}),e.push(t),this._post({sp:e}),this.batchEraserCombine()}drawPencil(t){this._post({drawCount:this.drawCount,sp:(t==null?void 0:t.op)&&[t]})}drawPencilFull(t,e,n){var s;let i=(n==null?void 0:n.willClear)||(e==null?void 0:e.isOpacity)||!1;!i&&t.rect&&(i=this.vNodes.hasRectIntersectRange(t.rect));const a={drawCount:1/0,render:[],sp:[t]};(s=a.render)==null||s.push({isClearAll:!0,clearCanvas:Mt.Float,viewId:this.viewId},{rect:t.rect,isClear:i,clearCanvas:Mt.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Mt.Bg,viewId:this.viewId}),this._post(a)}updateBatchEraserCombineNode(t,e){const n=[];let i;for(const a of e.keys())this.fullLayer.getElementsByName(a).forEach(s=>{const o=s.getBoundingClientRect();i=Ot(i,{x:o.x-ae.SafeBorderPadding,y:o.y-ae.SafeBorderPadding,w:o.width+ae.SafeBorderPadding*2,h:o.height+ae.SafeBorderPadding*2}),s.remove()});return t.forEach(a=>{const s=this.vNodes.get(a);if(s)if(this.fullLayer.getElementsByName(a)[0])i=Ot(i,s.rect);else{const f=this.setFullWork({...s,workId:a}),v=f&&f.consumeService({op:s.op,isFullWork:!0});v&&(s.rect=v,i=Ot(i,v))}}),i&&n.push({rect:i,isClear:!0,clearCanvas:Mt.Bg,viewId:this.viewId},{rect:i,drawCanvas:Mt.Bg,viewId:this.viewId}),n}async runEffectSelectWork(t){var e,n,i;for(const a of this.effectSelectNodeData.values()){const s=this.setFullWork(a);if(s){const o=(e=s.getWorkId())==null?void 0:e.toString();if(s.toolsType===ht.Image)await s.consumeServiceAsync({scene:(i=(n=this.drawLayer)==null?void 0:n.parent)==null?void 0:i.parent,isFullWork:!0,replaceId:o});else if(s.toolsType===ht.Text)await s.consumeServiceAsync({isFullWork:!0,replaceId:o});else{const f=a.ops&&Ie(a.ops);s.consumeService({op:f,isFullWork:!0,replaceId:o}),a!=null&&a.updateNodeOpt&&s.updataOptService(a.updateNodeOpt)}a.workId&&this.workShapes.delete(a.workId)}}this.reRenderSelector(t)}cursorHover(t){var s;const{opt:e,toolsType:n,point:i}=t,a=this.setFullWork({workId:Sr,toolsType:n,opt:e});if(a&&i){const o=a.cursorHover(i),f={render:[]};o&&o.type===ct.CursorHover&&o.rect&&((s=f.render)==null||s.push({rect:Bt(o.rect),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(o.rect),drawCanvas:Mt.Bg,viewId:this.viewId}),this._post(f))}}}class rg{constructor(r){nt(this,"viewId");nt(this,"vNodes");nt(this,"fullLayer");nt(this,"drawLayer");nt(this,"workShapes",new Map);nt(this,"selectorWorkShapes",new Map);nt(this,"animationId");nt(this,"willRunEffectSelectorIds",new Set);nt(this,"runEffectId");nt(this,"noAnimationRect");nt(this,"post");this.viewId=r.viewId,this.vNodes=r.vNodes,this.fullLayer=r.fullLayer,this.drawLayer=r.drawLayer,this.post=r.thread.post.bind(r.thread)}destroy(){this.workShapes.clear(),this.selectorWorkShapes.clear(),this.willRunEffectSelectorIds.clear()}consumeDraw(r){this.activeWorkShape(r),this.runAnimation()}consumeFull(r){this.activeWorkShape(r),this.runAnimation()}clearAllWorkShapesCache(){this.workShapes.forEach((r,t)=>{r.toolsType===ht.LaserPen?setTimeout(()=>{this.workShapes.delete(t)},2e3):this.workShapes.delete(t)})}runSelectWork(r){this.activeSelectorShape(r);const{workId:t}=r,e=t==null?void 0:t.toString();e&&this.willRunEffectSelectorIds.add(e),this.runEffect()}setNodeKey(r,t,e){return r.toolsType=t,r.node=yr({toolsType:t,toolsOpt:e,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),r}runReverseSelectWork(r){r.forEach(t=>{this.selectorWorkShapes.forEach((e,n)=>{var i;if((i=e.selectIds)!=null&&i.length){const a=e.selectIds.indexOf(t);a>-1&&(e.selectIds.splice(a,1),this.willRunEffectSelectorIds.add(n))}})}),this.willRunEffectSelectorIds.size&&this.runEffect()}removeWork(r){const{workId:t}=r,e=t==null?void 0:t.toString();if(e){const n=this.workShapes.get(e);if(n){this.workShapes.delete(e),this.removeNode(e,r,n==null?void 0:n.totalRect,!1);return}this.removeNode(e,r)}}removeSelectWork(r){const{workId:t}=r,e=t==null?void 0:t.toString();e&&(this.activeSelectorShape(r),this.willRunEffectSelectorIds.add(e)),this.runEffect()}removeNode(r,t,e,n=!0){var s;r.indexOf(Nt.selectorId)>-1&&this.removeSelectWork(t);let i=e;const a=(s=this.vNodes.get(r))==null?void 0:s.rect;a&&(i=Ot(a,i)),this.fullLayer.getElementsByName(r).forEach(o=>{o.remove()}),this.drawLayer.getElementsByName(r).forEach(o=>{o.remove()}),this.vNodes.delete(r),i&&this.post({render:[{rect:Bt(i),isClear:!0,clearCanvas:n?Mt.Bg:Mt.ServiceFloat,workerType:n?void 0:Tt.Service,viewId:this.viewId},{rect:Bt(i),drawCanvas:n?Mt.Bg:Mt.ServiceFloat,workerType:n?void 0:Tt.Service,viewId:this.viewId}]})}activeWorkShape(r){var y,O,x,m;const{workId:t,opt:e,toolsType:n,type:i,updateNodeOpt:a,ops:s,op:o,useAnimation:f}=r;if(!t)return;const v=t.toString(),l=(y=this.vNodes.get(v))==null?void 0:y.rect;if(!((O=this.workShapes)!=null&&O.has(v))){let T={toolsType:n,animationWorkData:o||[],animationIndex:0,type:i,updateNodeOpt:a,ops:s,useAnimation:typeof f<"u"?f:typeof(a==null?void 0:a.useAnimation)<"u"?a==null?void 0:a.useAnimation:!0,oldRect:l,isDiff:!1};n&&e&&(T=this.setNodeKey(T,n,e)),(x=this.workShapes)==null||x.set(v,T)}const p=(m=this.workShapes)==null?void 0:m.get(v);i&&(p.type=i),s&&(p.animationWorkData=Ie(s),p.ops=s),a&&(p.updateNodeOpt=a),o&&(p.isDiff=this.hasDiffData(p.animationWorkData||[],o,p.toolsType),p.animationWorkData=o),p.node&&p.node.getWorkId()!==v&&p.node.setWorkId(v),l&&(p.oldRect=l),n&&e&&(p.toolsType!==n&&n&&e&&this.setNodeKey(p,n,e),p.node&&p.node.setWorkOptions(e))}hasDiffData(r,t,e){const n=r.length;if(t.length<n)return!0;switch(e){case ht.Pencil:{for(let i=0;i<n;i+=3)if(t[i]!==r[i]||t[i+1]!==r[i+1])return!0;break}case ht.LaserPen:{for(let i=0;i<n;i+=2)if(t[i]!==r[i]||t[i+1]!==r[i+1])return!0;break}}return!1}async animationDraw(){var n,i,a,s,o,f,v,l,p,y,O,x,m,T,c,h,u,g,M,A,I,b,E,L,D,R,C,W;this.animationId=void 0;let r=!1;const t={render:[]},e=new Map;for(const[z,H]of this.workShapes.entries())switch(H.toolsType){case ht.Image:{const X=H.oldRect;X&&((n=t.render)==null||n.push({rect:X,isClear:!0,clearCanvas:Mt.Bg,viewId:this.viewId}));const Z=await((a=H.node)==null?void 0:a.consumeServiceAsync({isFullWork:!0,scene:(i=this.fullLayer.parent)==null?void 0:i.parent}));this.selectorWorkShapes.forEach((j,G)=>{var Q;(Q=j.selectIds)!=null&&Q.includes(z)&&(this.willRunEffectSelectorIds.add(G),this.noAnimationRect=Ot(this.noAnimationRect,X),this.noAnimationRect=Ot(this.noAnimationRect,Z),this.runEffect())}),this.workShapes.delete(z),(s=t.render)==null||s.push({rect:Z,drawCanvas:Mt.Bg,viewId:this.viewId});break}case ht.Text:{if(H.node){const X=H.oldRect,Z=await H.node.consumeServiceAsync({isFullWork:!0,replaceId:z});this.selectorWorkShapes.forEach((j,G)=>{var Q;(Q=j.selectIds)!=null&&Q.includes(z)&&(this.willRunEffectSelectorIds.add(G),this.noAnimationRect=Ot(this.noAnimationRect,X),this.noAnimationRect=Ot(this.noAnimationRect,Z),this.runEffect())}),(o=H.node)==null||o.clearTmpPoints(),this.workShapes.delete(z),(f=t.render)==null||f.push({rect:Z,drawCanvas:Mt.Bg,viewId:this.viewId})}break}case ht.Arrow:case ht.Straight:case ht.Rectangle:case ht.Ellipse:case ht.Star:case ht.Polygon:case ht.SpeechBalloon:{const X=!!H.ops;if((v=H.animationWorkData)!=null&&v.length){const Z=H.oldRect,j=H.node.oldRect;Z&&((l=t.render)==null||l.push({rect:Z,isClear:!0,clearCanvas:Mt.Bg,viewId:this.viewId}),(p=t.render)==null||p.push({rect:Z,drawCanvas:Mt.Bg,viewId:this.viewId})),j&&((y=t.render)==null||y.push({rect:j,isClear:!0,clearCanvas:Mt.ServiceFloat,viewId:this.viewId}));const G=(O=H.node)==null?void 0:O.consumeService({op:H.animationWorkData,isFullWork:X});e.set(z,{workState:Z?H.ops?Rt.Done:Rt.Doing:Rt.Start,op:H.animationWorkData.filter((Q,tt)=>{if(tt%3!==2)return!0}).slice(-2)}),X?(this.selectorWorkShapes.forEach((Q,tt)=>{var et;(et=Q.selectIds)!=null&&et.includes(z)&&(this.willRunEffectSelectorIds.add(tt),this.noAnimationRect=Ot(this.noAnimationRect,Z),this.noAnimationRect=Ot(this.noAnimationRect,j),this.noAnimationRect=Ot(this.noAnimationRect,G),this.runEffect())}),(x=H.node)==null||x.clearTmpPoints(),this.workShapes.delete(z),(m=t.render)==null||m.push({rect:G,drawCanvas:Mt.Bg,viewId:this.viewId})):(T=t.render)==null||T.push({rect:G,drawCanvas:Mt.ServiceFloat,workerType:X?void 0:Tt.Service,viewId:this.viewId}),H.animationWorkData.length=0}break}case ht.Pencil:{if(!H.useAnimation&&H.ops){let X=(c=H.node)==null?void 0:c.consumeService({op:H.animationWorkData||[],isFullWork:!0,replaceId:z});const Z=(h=H.node)==null?void 0:h.updataOptService(H.updateNodeOpt);X=Ot(X,Z),(u=t.render)==null||u.push({isClear:!0,rect:Ot(H.oldRect,X),clearCanvas:Mt.Bg,viewId:this.viewId}),(g=t.render)==null||g.push({rect:Ot(H.oldRect,X),drawCanvas:Mt.Bg,viewId:this.viewId}),this.selectorWorkShapes.forEach((j,G)=>{var Q;(Q=j.selectIds)!=null&&Q.includes(z)&&(this.willRunEffectSelectorIds.add(G),this.noAnimationRect=Ot(this.noAnimationRect,X),this.runEffect())}),(M=H.node)==null||M.clearTmpPoints(),this.workShapes.delete(z)}else if(H.useAnimation){if(H.isDel){(A=H.node)==null||A.clearTmpPoints(),this.workShapes.delete(z);break}const X=3,Z=this.computNextAnimationIndex(H,X),j=H.isDiff?0:Math.max(0,(H.animationIndex||0)-X),G=(H.animationWorkData||[]).slice(j,Z),Q=(b=(I=H.node)==null?void 0:I.getWorkId())==null?void 0:b.toString();if((H.animationIndex||0)<Z||H.isDiff){const tt=(E=H.node)==null?void 0:E.consumeService({op:G,isFullWork:!1});if((L=t.render)==null||L.push({rect:tt,drawCanvas:Mt.ServiceFloat,viewId:this.viewId}),H.animationIndex=Z,H.isDiff&&(H.isDiff=!1),G.length){const et=G.filter((at,q)=>{if(q%X!==X-1)return!0}).slice(-2);e.set(z,{workState:j===0?Rt.Start:Z===((D=H.animationWorkData)==null?void 0:D.length)?Rt.Done:Rt.Doing,op:et})}}else if(H.ops){const tt=(R=H.node)==null?void 0:R.consumeService({op:H.animationWorkData||[],isFullWork:!0,replaceId:Q});H.isDel=!0,(C=t.render)==null||C.push({isClear:!0,rect:tt,clearCanvas:Mt.ServiceFloat,viewId:this.viewId},{rect:tt,drawCanvas:Mt.ServiceFloat,viewId:this.viewId},{isClear:!0,rect:tt,clearCanvas:Mt.Bg,viewId:this.viewId},{rect:tt,drawCanvas:Mt.Bg,viewId:this.viewId}),e.set(z,{workState:Rt.Done,op:G.filter((et,at)=>{if(at%X!==X-1)return!0}).slice(-2)})}r=!0;break}break}}r&&this.runAnimation(),e.size&&(t.sp=[],e.forEach((z,H)=>{var X;(X=t.sp)==null||X.push({type:ct.Cursor,uid:H.split(pr)[0],op:z.op,workState:z.workState,viewId:this.viewId})})),(W=t.render)!=null&&W.length&&this.post(t)}runAnimation(){this.animationId||(this.animationId=requestAnimationFrame(this.animationDraw.bind(this)))}computNextAnimationIndex(r,t){var n;const e=Math.floor((r.animationWorkData||[]).slice(r.animationIndex).length*32/t/(((n=r.node)==null?void 0:n.syncUnitTime)||1e3))*t;return Math.min((r.animationIndex||0)+(e||t),(r.animationWorkData||[]).length)}runEffect(){this.runEffectId||(this.runEffectId=setTimeout(this.effectRunSelector.bind(this),0))}effectRunSelector(){this.runEffectId=void 0;let r=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(t=>{var i,a;const e=this.selectorWorkShapes.get(t),n=e&&e.selectIds&&((i=e.node)==null?void 0:i.selectServiceNode(t,e,!0));r=Ot(r,n),(a=e==null?void 0:e.selectIds)!=null&&a.length||this.selectorWorkShapes.delete(t)}),r&&this.post({render:[{rect:Bt(r),isClear:!0,clearCanvas:Mt.Bg,viewId:this.viewId},{rect:Bt(r),drawCanvas:Mt.Bg,viewId:this.viewId}]}),this.willRunEffectSelectorIds.clear(),this.noAnimationRect=void 0}activeSelectorShape(r){var f,v,l;const{workId:t,opt:e,toolsType:n,type:i,selectIds:a}=r;if(!t)return;const s=t.toString();if(!((f=this.selectorWorkShapes)!=null&&f.has(s))){let p={toolsType:n,selectIds:a,type:i,opt:e};n&&e&&(p=this.setNodeKey(p,n,e)),(v=this.selectorWorkShapes)==null||v.set(s,p)}const o=(l=this.selectorWorkShapes)==null?void 0:l.get(s);i&&(o.type=i),o.node&&o.node.getWorkId()!==s&&o.node.setWorkId(s),o.selectIds=a||[]}}class ng extends Jn{constructor(t){super(t);nt(this,"combineDrawTimer")}async runFullWork(t){var i,a;const e=this.setFullWork(t),n=t.ops&&Ie(t.ops);if(e){let s,o;const f=(i=e.getWorkId())==null?void 0:i.toString();return e.toolsType===ht.Image?s=await e.consumeServiceAsync({isFullWork:!0,scene:(a=this.fullLayer.parent)==null?void 0:a.parent}):e.toolsType===ht.Text?s=await e.consumeServiceAsync({isFullWork:!0,replaceId:f,isDrawLabel:!0}):(s=e.consumeService({op:n,isFullWork:!0,replaceId:f}),o=(t==null?void 0:t.updateNodeOpt)&&e.updataOptService(t.updateNodeOpt)),t.workId&&this.workShapes.delete(t.workId),Ot(s,o)}}runSelectWork(t){var n;const e=this.setFullWork(t);e&&((n=t.selectIds)!=null&&n.length)&&t.workId&&e.selectServiceNode(t.workId.toString(),{selectIds:t.selectIds},!1)}consumeDraw(t){const{workId:e}=t,n=this.workShapes.get(e);if(!n)return;const i=n.toolsType,a=n.consume({data:t,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0});switch(i){case ht.Arrow:case ht.Straight:case ht.Ellipse:case ht.Rectangle:case ht.Star:case ht.Polygon:case ht.SpeechBalloon:{a&&(this.drawCount++,this.drawArrow(a));break}case ht.Pencil:{a&&(this.drawCount++,this.drawPencil(a,e==null?void 0:e.toString()));break}}}consumeDrawAll(t){const{workId:e}=t;if(e){const n=this.workShapes.get(e);if(!n)return;switch(n.toolsType){case ht.Arrow:case ht.Straight:case ht.Ellipse:case ht.Pencil:case ht.Rectangle:case ht.Star:case ht.Polygon:case ht.SpeechBalloon:this.drawCount=0,this.fullLayer.removeAllChildren(),this.clearWorkShapeNodeCache(e);break}}}updateLabels(t,e){t.children.forEach(n=>{if(n.tagName==="LABEL"){const i=n.name,{width:a}=n.getBoundingClientRect(),[s]=t.worldScaling,{underline:o,lineThrough:f}=e.opt;o&&t.getElementsByName(`${i}_underline`)[0].attr({points:[0,0,a/s,0]}),f&&t.getElementsByName(`${i}_lineThrough`)[0].attr({points:[0,0,a/s,0]})}})}drawPencil(t,e){this._post({drawCount:this.drawCount,render:[{rect:t==null?void 0:t.rect,workId:e,drawCanvas:Mt.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]})}drawArrow(t){this._post({drawCount:this.drawCount,render:[{rect:(t==null?void 0:t.rect)&&Bt(t.rect),isClear:!0,clearCanvas:Mt.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&Bt(t.rect),drawCanvas:Mt.Float,viewId:this.viewId}]})}}class ig{constructor(r){nt(this,"viewId");nt(this,"vNodes");nt(this,"topLayer");nt(this,"post");nt(this,"serviceWorkShapes",new Map);nt(this,"localWorkShapes",new Map);nt(this,"tmpOpt");nt(this,"tmpWorkShapeNode");nt(this,"animationId");this.viewId=r.viewId,this.vNodes=r.vNodes,this.topLayer=r.topLayer,this.post=r.thread.post.bind(r.thread)}getWorkShape(r){return this.localWorkShapes.get(r)}getTmpWorkShapeNode(){return this.tmpWorkShapeNode}setTmpWorkId(r){if(r&&this.tmpWorkShapeNode){this.tmpWorkShapeNode.setWorkId(r),this.localWorkShapes.set(r,{node:this.tmpWorkShapeNode,toolsType:this.tmpWorkShapeNode.toolsType,workState:Rt.Start}),this.tmpOpt&&this.setToolsOpt(this.tmpOpt);return}}setWorkOptions(r,t){var n,i,a;((n=this.localWorkShapes.get(r))==null?void 0:n.node)||this.setTmpWorkId(r),(a=(i=this.localWorkShapes.get(r))==null?void 0:i.node)==null||a.setWorkOptions(t)}createWorkShapeNode(r){const{toolsType:t}=r;if(t===ht.LaserPen)return yr({...r,vNodes:this.vNodes,fullLayer:this.topLayer,drawLayer:this.topLayer})}clearAllWorkShapesCache(){this.localWorkShapes.forEach(r=>{var t;return(t=r.node)==null?void 0:t.clearTmpPoints()}),this.localWorkShapes.clear()}setToolsOpt(r){this.tmpOpt=r,this.tmpWorkShapeNode=this.createWorkShapeNode(r)}consumeDraw(r){const{workId:t,dataType:e}=r;if(e===Tt.Service)this.activeServiceWorkShape(r);else{const n=this.localWorkShapes.get(t);if(!n)return;const i=n.node.consume({data:r,isFullWork:!1,isSubWorker:!0});i.rect&&(n.totalRect=Ot(i.rect,n.totalRect),n.result=i,n.workState=Rt.Doing,t&&this.localWorkShapes.set(t,n))}this.runAnimation()}consumeDrawAll(r){const{workId:t,dataType:e}=r;if(e===Tt.Service)this.activeServiceWorkShape(r);else{const n=this.localWorkShapes.get(t);if(!n)return;const i=n.node.consumeAll({data:r});n.totalRect=Ot(i.rect,n.totalRect),n.result=i,n.workState=Rt.Done,t&&this.localWorkShapes.set(t,n)}this.runAnimation()}destroy(){this.serviceWorkShapes.clear(),this.localWorkShapes.clear()}setNodeKey(r,t,e){return r.toolsType=t,r.node=this.createWorkShapeNode({toolsType:t,toolsOpt:e}),r}activeServiceWorkShape(r){var p,y;const{workId:t,opt:e,toolsType:n,type:i,updateNodeOpt:a,ops:s,op:o}=r;if(!t)return;const f=t.toString(),v=(p=this.vNodes.get(f))==null?void 0:p.rect;if(!((y=this.serviceWorkShapes)!=null&&y.has(f))){let O={toolsType:n,animationWorkData:o||[],animationIndex:0,type:i,updateNodeOpt:a,ops:s,oldRect:v};n&&e&&(O=this.setNodeKey(O,n,e)),this.serviceWorkShapes.set(f,O)}const l=this.serviceWorkShapes.get(f);i&&(l.type=i),s&&(l.animationWorkData=Ie(s),l.ops=s),a&&(l.updateNodeOpt=a),o&&(l.animationWorkData=o),l.node&&l.node.getWorkId()!==f&&l.node.setWorkId(f),v&&(l.oldRect=v),n&&e&&(l.toolsType!==n&&n&&e&&this.setNodeKey(l,n,e),l.node&&l.node.setWorkOptions(e))}computNextAnimationIndex(r,t){var n;const e=Math.floor((r.animationWorkData||[]).slice(r.animationIndex).length*32/t/(((n=r.node)==null?void 0:n.syncUnitTime)||1e3))*t;return Math.min((r.animationIndex||0)+(e||t),(r.animationWorkData||[]).length)}async animationDraw(){var a,s,o,f;this.animationId=void 0;let r=!1;const t=new Map,e=[],n=[],i=[];for(const[v,l]of this.serviceWorkShapes.entries())switch(l.toolsType){case ht.LaserPen:{const y=this.computNextAnimationIndex(l,8),O=Math.max(0,l.animationIndex||0),x=(l.animationWorkData||[]).slice(O,y);if((l.animationIndex||0)<y){const m=(a=l.node)==null?void 0:a.consumeService({op:x,isFullWork:!1});l.totalRect=Ot(l.totalRect,m),l.animationIndex=y,x.length&&t.set(v,{workState:O===0?Rt.Start:y===((s=l.animationWorkData)==null?void 0:s.length)?Rt.Done:Rt.Doing,op:x.slice(-2)})}if(n.push({isClear:!0,rect:l.totalRect,clearCanvas:Mt.TopFloat,viewId:this.viewId}),e.push({rect:l.totalRect,drawCanvas:Mt.TopFloat,viewId:this.viewId}),l.isDel){(o=l.node)==null||o.clearTmpPoints(),this.serviceWorkShapes.delete(v);break}l.ops&&l.animationIndex===((f=l.animationWorkData)==null?void 0:f.length)&&!l.isDel&&(this.topLayer.getElementsByName(v.toString())[0]||(l.isDel=!0,this.serviceWorkShapes.set(v,l))),r=!0;break}}for(const[v,l]of this.localWorkShapes.entries()){const{result:p,toolsType:y,totalRect:O,isDel:x,workState:m}=l;switch(y){case ht.LaserPen:{if(O&&(n.push({isClear:!0,rect:O,clearCanvas:Mt.TopFloat,viewId:this.viewId}),e.push({rect:O,drawCanvas:Mt.TopFloat,viewId:this.viewId})),x){l.node.clearTmpPoints(),this.localWorkShapes.delete(v),i.push({removeIds:[v.toString()],viewId:this.viewId,type:ct.RemoveNode});break}p&&((p.op||p.ops)&&i.push(p),l.result=void 0),!this.topLayer.getElementsByName(v.toString())[0]&&m===Rt.Done&&(l.isDel=!0,this.localWorkShapes.set(v,l)),r=!0;break}}}r&&this.runAnimation(),t.size&&t.forEach((v,l)=>{i.push({type:ct.Cursor,uid:l.split(pr)[0],op:v.op,workState:v.workState,viewId:this.viewId})}),(e.length||n.length||i.length)&&this.post({render:[...n,...e],sp:i})}runAnimation(){this.animationId||(this.animationId=requestAnimationFrame(this.animationDraw.bind(this)))}}var qn=(d=>(d.Full="full",d.Sub="sub",d))(qn||{});class sg{constructor(r,t){nt(this,"_self");nt(this,"type");nt(this,"workThreadMap",new Map);this._self=r,this.type=t,this.register()}init(r){const{viewId:t,dpr:e,offscreenCanvasOpt:n,layerOpt:i,isSafari:a}=r;if(!e||!n||!i)return;let s;this.type==="full"&&(s=new og(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),this.type==="sub"&&(s=new ag(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),s&&a&&s.setIsSafari(a),s&&r.cameraOpt&&s.setCameraOpt(r.cameraOpt),s&&this.workThreadMap.set(t,s)}register(){onmessage=r=>{const t=r.data;if(t)for(const e of t.values()){const{msgType:n,viewId:i,tasksqueue:a,mainTasksqueueCount:s}=e;if(n===ct.Init){this.init(e);continue}if(n===ct.TasksQueue&&(a!=null&&a.size)&&s){for(const[f,v]of this.workThreadMap.entries()){const l=a.get(f);l&&v.on(l,s)}continue}if(i===Zh){for(const f of this.workThreadMap.values())f.on(e),n===ct.Destroy&&this.workThreadMap.delete(i);continue}const o=this.workThreadMap.get(i);o&&(o.on(e),n===ct.Destroy&&this.workThreadMap.delete(i))}}}post(r,t){t?this._self.postMessage(r,t):this._self.postMessage(r)}}class og extends Xn{constructor(t,e,n){super(t,e);nt(this,"serviceDrawLayer");nt(this,"localDrawLayer");nt(this,"snapshotFullLayer");nt(this,"methodBuilder");nt(this,"localWork");nt(this,"serviceWork");nt(this,"_post");this._post=n,this.serviceDrawLayer=this.createLayer("serviceDrawLayer",this.scene,{...e.layerOpt,bufferSize:1e3}),this.localDrawLayer=this.createLayer("localDrawLayer",this.scene,{...e.layerOpt,bufferSize:1e3});const i={thread:this,viewId:this.viewId,vNodes:this.vNodes,fullLayer:this.fullLayer};this.localWork=new eg({...i,drawLayer:this.localDrawLayer}),this.serviceWork=new rg({...i,drawLayer:this.serviceDrawLayer}),this.methodBuilder=new y0([Lt.CopyNode,Lt.SetColorNode,Lt.DeleteNode,Lt.RotateNode,Lt.ScaleNode,Lt.TranslateNode,Lt.ZIndexNode,Lt.SetFontStyle,Lt.SetPoint,Lt.SetLock,Lt.SetShapeOpt]).registerForWorker(this.localWork,this.serviceWork,this.scene),this.vNodes.init(this.fullLayer)}async combinePost(){var a,s,o,f;const{render:t,...e}=this.combinePostData();let n;if(t!=null&&t.length){const v=[];for(const l of t)if(l.rect){if(l.drawCanvas&&(l.rect=this.safariFixRect(Jt(l.rect))),!l.rect)continue;if(l.drawCanvas&&l.rect){const p=await this.getRectImageBitmap(l);l.imageBitmap=p,n||(n=[]),n.push(p)}v.push(l)}e.render=v}const i=(a=e.sp)==null?void 0:a.filter(v=>v.type!==ct.None||Object.keys(v).filter(l=>l==="type").length);i!=null&&i.length&&(e.sp=i.map(v=>({...v,viewId:this.viewId}))),((s=e.sp)==null?void 0:s.length)===0&&delete e.sp,e.drawCount===void 0&&delete e.drawCount,e.workerTasksqueueCount===void 0&&delete e.workerTasksqueueCount,(e!=null&&e.drawCount||e!=null&&e.workerTasksqueueCount||(o=e.sp)!=null&&o.length||(f=e.render)!=null&&f.length)&&this._post(e,n)}async on(t,e){if(this.methodBuilder.consumeForWorker(t))return;const{msgType:n,dataType:i,workId:a}=t;switch(n){case ct.UpdateCamera:await this.updateCamera(t),e&&this.post({workerTasksqueueCount:e});return;case ct.Select:i===Tt.Service&&(a===Nt.selectorId?this.localWork.updateFullSelectWork(t):this.serviceWork.runSelectWork(t));return;case ct.UpdateNode:case ct.FullWork:await this.consumeFull(i,t);return;case ct.RemoveNode:await this.removeNode(t);return;case ct.GetTextActive:this.checkTextActive(t);return;case ct.CursorHover:this.cursorHover(t);return}await super.on(t)}async removeNode(t){const{dataType:e,workId:n}=t;if(n===Nt.selectorId){this.localWork.blurSelector(t);return}e===Tt.Local&&(this.localWork.removeWork(t),await this.localWork.colloctEffectSelectWork(t)),e===Tt.Service&&(this.serviceWork.removeWork(t),await this.localWork.colloctEffectSelectWork(t))}checkTextActive(t){const{dataType:e}=t;e===Tt.Local&&this.localWork.checkTextActive(t)}clearAll(){this.vNodes.clear(),super.clearAll(),this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(t=>{t.name!=="viewport"&&t.remove()}),this.localDrawLayer.removeAllChildren()),this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(t=>{t.name!=="viewport"&&t.remove()}),this.serviceDrawLayer.removeAllChildren()),this.post({render:[{isClearAll:!0,clearCanvas:Mt.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:Mt.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:Mt.Float,viewId:this.viewId}],sp:[{type:ct.Clear}]})}updateLayer(t){const{width:e,height:n}=t;super.updateLayer(t),this.localDrawLayer&&(this.localDrawLayer.parent.setAttribute("width",e),this.localDrawLayer.parent.setAttribute("height",n),this.localDrawLayer.setAttribute("size",[e,n]),this.localDrawLayer.setAttribute("pos",[e*.5,n*.5])),this.serviceDrawLayer&&(this.serviceDrawLayer.parent.setAttribute("width",e),this.serviceDrawLayer.parent.setAttribute("height",n),this.serviceDrawLayer.setAttribute("size",[e,n]),this.serviceDrawLayer.setAttribute("pos",[e*.5,n*.5]))}setCameraOpt(t){this.cameraOpt=t;const{scale:e,centerX:n,centerY:i,width:a,height:s}=t;(a!==this.scene.width||s!==this.scene.height)&&this.updateScene({width:a,height:s}),this.fullLayer&&(this.fullLayer.setAttribute("scale",[e,e]),this.fullLayer.setAttribute("translate",[-n,-i])),this.localDrawLayer&&(this.localDrawLayer.setAttribute("scale",[e,e]),this.localDrawLayer.setAttribute("translate",[-n,-i])),this.serviceDrawLayer&&(this.serviceDrawLayer.setAttribute("scale",[e,e]),this.serviceDrawLayer.setAttribute("translate",[-n,-i]))}getLayer(t){switch(t){case Mt.Bg:return this.fullLayer;case Mt.ServiceFloat:return this.serviceDrawLayer;case Mt.Float:return this.localDrawLayer}}getOffscreen(t){return this.getLayer(t).parent.canvas}async consumeFull(t,e){const n=await this.localWork.colloctEffectSelectWork(e);n&&t===Tt.Local&&await this.localWork.consumeFull(n,this.scene),n&&t===Tt.Service&&this.serviceWork.consumeFull(n)}consumeDraw(t,e){t===Tt.Local&&this.localWork.consumeDraw(e,this.serviceWork),t===Tt.Service&&this.serviceWork.consumeDraw(e)}consumeDrawAll(t,e){t===Tt.Local&&this.localWork.consumeDrawAll(e,this.serviceWork)}async updateCamera(t){var i;const e=[],{cameraOpt:n}=t;if(n&&!le(this.cameraOpt,n)){const a=this.localWork.getWorkShape(Sr);a&&((i=a.selectIds)!=null&&i.length)&&a.cursorBlur();const s=!!this.localDrawLayer.children.length,o=!!this.serviceDrawLayer.children.length;if(this.setCameraOpt(n),this.localWork.workShapes.forEach((f,v)=>{(f.toolsType===ht.Pencil||f.toolsType===ht.Arrow||f.toolsType===ht.Straight||f.toolsType===ht.Ellipse||f.toolsType===ht.Rectangle||f.toolsType===ht.Star||f.toolsType===ht.Polygon||f.toolsType===ht.SpeechBalloon||f.toolsType===ht.Text)&&this.localWork.workShapeState.set(v,{willClear:!0})}),this.vNodes.curNodeMap.size&&(this.vNodes.updateNodesRect(),await this.localWork.reRenderSelector(),this.serviceWork.selectorWorkShapes.size))for(const[f,v]of this.serviceWork.selectorWorkShapes.entries())this.serviceWork.runSelectWork({workId:f,selectIds:v.selectIds,msgType:ct.Select,dataType:Tt.Service,viewId:this.viewId});this.vNodes.hasRenderNodes()&&(s&&e.push({isClearAll:!0,clearCanvas:Mt.Float,viewId:this.viewId}),o&&e.push({isClearAll:!0,clearCanvas:Mt.ServiceFloat,viewId:this.viewId}),e.push({isClearAll:!0,clearCanvas:Mt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Mt.Bg,viewId:this.viewId})),e.length&&(console.log("cameraOpt---2",e),this.post({render:e}))}}getRectImageBitmap(t){const{rect:e,drawCanvas:n}=t,i=e.x*this.dpr,a=e.y*this.dpr,s=e.w*this.dpr,o=e.h*this.dpr;return createImageBitmap(this.getOffscreen(n),i,a,s,o,{resizeQuality:"low"})}cursorHover(t){this.localWork.cursorHover(t)}}class ag extends Xn{constructor(t,e,n){super(t,e);nt(this,"_post");nt(this,"topLayer");nt(this,"snapshotFullLayer");nt(this,"serviceWork");nt(this,"localWork");nt(this,"topLayerWork");this._post=n,this.topLayer=this.createLayer("topLayer",this.scene,{...e.layerOpt,bufferSize:1500});const i={thread:this,viewId:this.viewId,vNodes:this.vNodes,fullLayer:this.fullLayer,topLayer:this.topLayer};this.localWork=new ng(i),this.topLayerWork=new ig(i),this.vNodes.init(this.fullLayer)}async combinePost(){var a,s,o,f,v;const{render:t,...e}=this.combinePostData();let n;if(t!=null&&t.length){const l=[];for(const p of t)if(p.rect){if(p.drawCanvas&&(p.rect=this.safariFixRect(Jt(p.rect))),!p.rect)continue;if(p.drawCanvas&&p.rect){const y=await this.getRectImageBitmap(p);p.imageBitmap=y,n||(n=[]),n.push(y)}l.push(p)}e.render=l}if((a=e.workIds)!=null&&a.size&&e.drawCount)for(const l of e.workIds.values())this.fullLayer.getElementsByName(l).forEach(p=>{p.id&&e.drawCount&&Number(p.id)<e.drawCount&&p.remove()});const i=(s=e.sp)==null?void 0:s.filter(l=>l.type!==ct.None||Object.keys(l).filter(p=>p==="type").length);i!=null&&i.length&&(e.sp=i.map(l=>({...l,viewId:this.viewId}))),((o=e.sp)==null?void 0:o.length)===0&&delete e.sp,e.drawCount===void 0&&delete e.drawCount,e.workerTasksqueueCount===void 0&&delete e.workerTasksqueueCount,((f=e.sp)!=null&&f.length||e.drawCount||(v=e==null?void 0:e.render)!=null&&v.length)&&(console.log("msg---layer--sub--000",this.fullLayer.children.map(l=>({name:l.name,id:l.id})),this.fullLayer),this._post(e,n))}getLayer(t,e){if(e&&this.snapshotFullLayer)return this.snapshotFullLayer;switch(t){case Mt.TopFloat:return this.topLayer;default:return this.fullLayer}}async on(t){const{msgType:e,toolsType:n,opt:i,workId:a,dataType:s}=t;switch(e){case ct.UpdateCamera:await this.updateCamera(t);break;case ct.UpdateTools:if(n===ht.LaserPen&&i){const o={toolsType:n,toolsOpt:i};this.topLayerWork.setToolsOpt(o);return}break;case ct.CreateWork:if(n===ht.LaserPen&&a&&i){this.topLayerWork.getTmpWorkShapeNode()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:i}),this.topLayerWork.setWorkOptions(a,i);return}break;case ct.FullWork:if(n===ht.LaserPen){this.consumeDrawAll(s,t);return}break;case ct.Snapshot:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,{...this.opt.layerOpt,bufferSize:this.viewId==="mainView"?6e3:3e3}),this.snapshotFullLayer&&(await this.getSnapshot(t),this.snapshotFullLayer=void 0);return;case ct.BoundingBox:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,{...this.opt.layerOpt,bufferSize:this.viewId==="mainView"?6e3:3e3}),this.snapshotFullLayer&&(await this.getBoundingRect(t),this.snapshotFullLayer=void 0);return}await super.on(t)}getOffscreen(t,e){return this.getLayer(t,e).parent.canvas}consumeDraw(t,e){const{op:n,workId:i}=e;if(n!=null&&n.length&&i){if(this.localWork.workShapes.get(i)){this.localWork.consumeDraw(e);return}if(this.topLayerWork.localWorkShapes.get(i)){this.topLayerWork.consumeDraw(e);return}}}consumeDrawAll(t,e){const{ops:n,op:i,workId:a}=e;if((n||i!=null&&i.length)&&a){if(this.localWork.workShapes.get(a)){this.localWork.consumeDrawAll(e);return}if(this.topLayerWork.localWorkShapes.get(a)){this.topLayerWork.consumeDrawAll(e);return}}}clearAll(){this.vNodes.clear(),super.clearAll(),this.topLayer&&(this.topLayer.parent.children.forEach(t=>{t.name!=="viewport"&&t.remove()}),this.topLayer.removeAllChildren()),this.post({render:[{isClearAll:!0,clearCanvas:Mt.TopFloat,viewId:this.viewId}],sp:[{type:ct.Clear}]})}getRectImageBitmap(t,e=!1,n){const{rect:i,drawCanvas:a}=t,s=i.x*this.dpr,o=i.y*this.dpr,f=i.w*this.dpr,v=i.h*this.dpr;return createImageBitmap(this.getOffscreen(a,e),s,o,f,v,n)}updateLayer(t){const{width:e,height:n}=t;super.updateLayer(t),this.topLayer&&(this.topLayer.parent.setAttribute("width",e),this.topLayer.parent.setAttribute("height",n),this.topLayer.setAttribute("size",[e,n]),this.topLayer.setAttribute("pos",[e*.5,n*.5])),this.snapshotFullLayer&&(this.snapshotFullLayer.parent.setAttribute("width",e),this.snapshotFullLayer.parent.setAttribute("height",n),this.snapshotFullLayer.setAttribute("size",[e,n]),this.snapshotFullLayer.setAttribute("pos",[e*.5,n*.5]))}async updateCamera(t){const e=[],{cameraOpt:n}=t;if(n&&!le(this.cameraOpt,n)){const i=!!this.topLayerWork.localWorkShapes.size;if(this.setCameraOpt(n),i){e.push({isClearAll:!0,clearCanvas:Mt.TopFloat,viewId:this.viewId});for(const[a,s]of this.topLayerWork.localWorkShapes.entries())if(s.totalRect){let o;this.topLayer.getElementsByName(a.toString()).forEach(f=>{const v=f.getBoundingClientRect(),l=Bt({x:v.x,y:v.y,w:v.width,h:v.height});o=Ot(o,l)}),s.totalRect=o,this.topLayerWork.localWorkShapes.set(a,s)}}e.length&&this.post({render:e})}}setCameraOpt(t,e){this.cameraOpt=t;const{scale:n,centerX:i,centerY:a,width:s,height:o}=t;(s!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:s,height:o}),e?(e.setAttribute("scale",[n,n]),e.setAttribute("translate",[-i,-a])):(this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-i,-a]),this.topLayer.setAttribute("scale",[n,n]),this.topLayer.setAttribute("translate",[-i,-a]))}async getSnapshot(t){const{scenePath:e,scenes:n,cameraOpt:i,w:a,h:s}=t;if(e&&n&&i&&this.snapshotFullLayer){const o=Jt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;let f;for(const[l,p]of Object.entries(n))if(p!=null&&p.type)switch(p==null?void 0:p.type){case ct.UpdateNode:case ct.FullWork:{const{opt:y}=p,O=await this.localWork.runFullWork({...p,opt:y,workId:l,msgType:ct.FullWork,dataType:Tt.Service,viewId:this.viewId});f=Ot(f,O);break}}let v;a&&s&&(v={resizeWidth:a,resizeHeight:s}),await new Promise(l=>{setTimeout(l,500)}),await this.getSnapshotRender({scenePath:e,curCameraOpt:o,options:v}),this.localWork.fullLayer=this.fullLayer,this.localWork.drawLayer=void 0}}async getSnapshotRender(t){var s,o;const{scenePath:e,curCameraOpt:n,options:i}=t;((s=this.snapshotFullLayer)==null?void 0:s.parent).render();const a=await this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:Mt.None},!0,i);a&&(this._post({sp:[{type:ct.Snapshot,scenePath:e,imageBitmap:a,viewId:this.viewId}]},[a]),a.close(),(o=this.snapshotFullLayer)==null||o.removeAllChildren(),this.setCameraOpt(n,this.fullLayer))}async getBoundingRect(t){const{scenePath:e,scenes:n,cameraOpt:i}=t;if(e&&n&&i&&this.snapshotFullLayer){const a=Jt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=this.snapshotFullLayer;let s;for(const[o,f]of Object.entries(n))if(f!=null&&f.type)switch(f==null?void 0:f.type){case ct.UpdateNode:case ct.FullWork:{const v=await this.localWork.runFullWork({...f,workId:o,msgType:ct.FullWork,dataType:Tt.Service,viewId:this.viewId});s=Ot(s,v);break}}s&&this.post({sp:[{type:ct.BoundingBox,scenePath:e,rect:s}]}),this.localWork.fullLayer=this.fullLayer,this.localWork.drawLayer=void 0,this.snapshotFullLayer.removeAllChildren(),this.setCameraOpt(a,this.fullLayer)}}}const lg=self;new sg(lg,qn.Full)})();
|