@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.
Files changed (53) hide show
  1. package/cdn/cdn.js +1 -1
  2. package/cdn/fullWorker-CIvt1j.js +453 -0
  3. package/cdn/subWorker-BE-0dg.js +453 -0
  4. package/dist/appliance-plugin.js +1 -1
  5. package/dist/appliance-plugin.mjs +13 -13
  6. package/dist/core/enum.d.ts +8 -1
  7. package/dist/core/mainEngine.d.ts +9 -2
  8. package/dist/core/mainThread/base.d.ts +2 -2
  9. package/dist/core/mainThread/index.d.ts +2 -2
  10. package/dist/core/mainThread/snapshotThread.d.ts +4 -4
  11. package/dist/core/mainThread/subLocalThread.d.ts +17 -13
  12. package/dist/core/mainThread/subTopThread.d.ts +7 -7
  13. package/dist/core/mainThread/vNodeManager.d.ts +2 -1
  14. package/dist/core/msgEvent/base.d.ts +6 -2
  15. package/dist/core/msgEvent/copyNode/forMain.d.ts +1 -0
  16. package/dist/core/msgEvent/deleteNode/forMain.d.ts +1 -0
  17. package/dist/core/msgEvent/deleteNode/forMainThread.d.ts +1 -4
  18. package/dist/core/msgEvent/deleteNode/forWorker.d.ts +1 -4
  19. package/dist/core/msgEvent/index.d.ts +4 -0
  20. package/dist/core/msgEvent/rotateNode/forMain.d.ts +2 -1
  21. package/dist/core/msgEvent/scaleNode/forMain.d.ts +2 -1
  22. package/dist/core/msgEvent/setColor/forMain.d.ts +1 -0
  23. package/dist/core/msgEvent/setFont/forMain.d.ts +1 -0
  24. package/dist/core/msgEvent/setLock/forMain.d.ts +1 -0
  25. package/dist/core/msgEvent/setPoint/forMain.d.ts +1 -0
  26. package/dist/core/msgEvent/setShape/forMain.d.ts +1 -0
  27. package/dist/core/msgEvent/setZIndex/forMain.d.ts +1 -0
  28. package/dist/core/msgEvent/translateNode/forMain.d.ts +2 -1
  29. package/dist/core/tools/base.d.ts +1 -1
  30. package/dist/core/tools/text.d.ts +2 -8
  31. package/dist/core/tools/utils.d.ts +2 -2
  32. package/dist/core/types.d.ts +1 -1
  33. package/dist/core/worker/base.d.ts +21 -13
  34. package/dist/core/worker/fullWorkerLocal.d.ts +1 -0
  35. package/dist/core/worker/subWorkerLocal.d.ts +3 -0
  36. package/dist/core/worker/subWorkerTopLayer.d.ts +7 -7
  37. package/dist/core/worker/vNodeManager.d.ts +2 -1
  38. package/dist/core/worker/workerManager.d.ts +2 -1
  39. package/dist/fullWorker.js +453 -566
  40. package/dist/index-BcIJbozZ.js +1 -0
  41. package/dist/index-C1YKkWHE.mjs +9090 -0
  42. package/dist/{index-Bt9t1FKB.mjs → index-ClJPZxV-.mjs} +1195 -1151
  43. package/dist/index-SsMz_ohn.js +1 -0
  44. package/dist/plugin/single/applianceDisplayer.d.ts +0 -1
  45. package/dist/plugin/types.d.ts +6 -14
  46. package/dist/style.css +1 -1
  47. package/dist/subWorker.js +453 -566
  48. package/package.json +5 -2
  49. package/cdn/fullWorker-BlZ1Wa.js +0 -566
  50. package/cdn/subWorker-BKoiIW.js +0 -566
  51. package/dist/index-BUCsfWH1.js +0 -1
  52. package/dist/index-Bz3L5rvA.js +0 -1
  53. package/dist/index-CTYUQm0L.mjs +0 -8859
@@ -1,566 +1,453 @@
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++])&&gt!=G&&gt!=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,"&quot;"))+'"');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)})();
1
+ var _excluded=["toolsType"],_excluded2=["callback"],_excluded3=["render"],_excluded4=["render"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],t.indexOf(o)>=0||{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)>=0)continue;t[n]=r[n];}return t;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function set(e,r,t,o){return set="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(e,r,t,o){var f,i=_superPropBase(e,r);if(i){if((f=Object.getOwnPropertyDescriptor(i,r)).set)return f.set.call(o,t),!0;if(!f.writable)return!1;}if(f=Object.getOwnPropertyDescriptor(o,r)){if(!f.writable)return!1;f.value=t,Object.defineProperty(o,r,f);}else _defineProperty(o,r,t);return!0;},set(e,r,t,o);}function _set(e,r,t,o,f){if(!set(e,r,t,o||e)&&f)throw new TypeError("failed to set property");return t;}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t);},_wrapNativeSuper(t);}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableRest();}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n9=0,F=function F(){};return{s:F,n:function n(){return _n9>=r.length?{done:!0}:{done:!1,value:r[_n9++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}var ei=Object.defineProperty;var ri=function ri(h,r,t){return r in h?ei(h,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[r]=t;};var nt=function nt(h,r,t){return ri(h,_typeof(r)!="symbol"?r+"":r,t),t;};var De=(typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?globalThis:(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:(typeof global==="undefined"?"undefined":_typeof(global))<"u"?global:(typeof self==="undefined"?"undefined":_typeof(self))<"u"?self:{};function ye(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h["default"]:h;}function ni(){this.__data__=[],this.size=0;}var ii=ni;function si(h,r){return h===r||h!==h&&r!==r;}var lr=si,oi=lr;function ai(h,r){for(var t=h.length;t--;)if(oi(h[t][0],r))return t;return-1;}var Ge=ai,li=Ge,ci=Array.prototype,fi=ci.splice;function ui(h){var r=this.__data__,t=li(r,h);if(t<0)return!1;var e=r.length-1;return t==e?r.pop():fi.call(r,t,1),--this.size,!0;}var hi=ui,di=Ge;function gi(h){var r=this.__data__,t=di(r,h);return t<0?void 0:r[t][1];}var pi=gi,vi=Ge;function mi(h){return vi(this.__data__,h)>-1;}var yi=mi,Si=Ge;function xi(h,r){var t=this.__data__,e=Si(t,h);return e<0?(++this.size,t.push([h,r])):t[e][1]=r,this;}var Ti=xi,Mi=ii,Oi=hi,Ei=pi,Pi=yi,Ai=Ti;function Se(h){var r=-1,t=h==null?0:h.length;for(this.clear();++r<t;){var e=h[r];this.set(e[0],e[1]);}}Se.prototype.clear=Mi;Se.prototype["delete"]=Oi;Se.prototype.get=Ei;Se.prototype.has=Pi;Se.prototype.set=Ai;var He=Se,Ci=He;function Ri(){this.__data__=new Ci(),this.size=0;}var Ii=Ri;function Li(h){var r=this.__data__,t=r["delete"](h);return this.size=r.size,t;}var bi=Li;function Di(h){return this.__data__.get(h);}var wi=Di;function Ni(h){return this.__data__.has(h);}var Wi=Ni,Bi=_typeof(De)=="object"&&De&&De.Object===Object&&De,cn=Bi,Fi=cn,ji=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,Ui=Fi||ji||Function("return this")(),_t=Ui,zi=_t,$i=zi.Symbol,Ke=$i,Or=Ke,fn=Object.prototype,Gi=fn.hasOwnProperty,Hi=fn.toString,Ae=Or?Or.toStringTag:void 0;function Ki(h){var r=Gi.call(h,Ae),t=h[Ae];try{h[Ae]=void 0;var e=!0;}catch(_unused){}var n=Hi.call(h);return e&&(r?h[Ae]=t:delete h[Ae]),n;}var Vi=Ki,Yi=Object.prototype,Xi=Yi.toString;function Ji(h){return Xi.call(h);}var Qi=Ji,Er=Ke,Zi=Vi,ki=Qi,qi="[object Null]",_i="[object Undefined]",Pr=Er?Er.toStringTag:void 0;function ts(h){return h==null?h===void 0?_i:qi:Pr&&Pr in Object(h)?Zi(h):ki(h);}var fe=ts;function es(h){var r=_typeof(h);return h!=null&&(r=="object"||r=="function");}var ae=es,rs=fe,ns=ae,is="[object AsyncFunction]",ss="[object Function]",os="[object GeneratorFunction]",as="[object Proxy]";function ls(h){if(!ns(h))return!1;var r=rs(h);return r==ss||r==os||r==is||r==as;}var un=ls,cs=_t,fs=cs["__core-js_shared__"],us=fs,ke=us,Ar=function(){var h=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:"";}();function hs(h){return!!Ar&&Ar in h;}var ds=hs,gs=Function.prototype,ps=gs.toString;function vs(h){if(h!=null){try{return ps.call(h);}catch(_unused2){}try{return h+"";}catch(_unused3){}}return"";}var hn=vs,ms=un,ys=ds,Ss=ae,xs=hn,Ts=/[\\^$.*+?()[\]{}|]/g,Ms=/^\[object .+?Constructor\]$/,Os=Function.prototype,Es=Object.prototype,Ps=Os.toString,As=Es.hasOwnProperty,Cs=RegExp("^"+Ps.call(As).replace(Ts,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Rs(h){if(!Ss(h)||ys(h))return!1;var r=ms(h)?Cs:Ms;return r.test(xs(h));}var Is=Rs;function Ls(h,r){return h==null?void 0:h[r];}var bs=Ls,Ds=Is,ws=bs;function Ns(h,r){var t=ws(h,r);return Ds(t)?t:void 0;}var ue=Ns,Ws=ue,Bs=_t,Fs=Ws(Bs,"Map"),cr=Fs,js=ue,Us=js(Object,"create"),Ve=Us,Cr=Ve;function zs(){this.__data__=Cr?Cr(null):{},this.size=0;}var $s=zs;function Gs(h){var r=this.has(h)&&delete this.__data__[h];return this.size-=r?1:0,r;}var Hs=Gs,Ks=Ve,Vs="__lodash_hash_undefined__",Ys=Object.prototype,Xs=Ys.hasOwnProperty;function Js(h){var r=this.__data__;if(Ks){var t=r[h];return t===Vs?void 0:t;}return Xs.call(r,h)?r[h]:void 0;}var Qs=Js,Zs=Ve,ks=Object.prototype,qs=ks.hasOwnProperty;function _s(h){var r=this.__data__;return Zs?r[h]!==void 0:qs.call(r,h);}var to=_s,eo=Ve,ro="__lodash_hash_undefined__";function no(h,r){var t=this.__data__;return this.size+=this.has(h)?0:1,t[h]=eo&&r===void 0?ro:r,this;}var io=no,so=$s,oo=Hs,ao=Qs,lo=to,co=io;function xe(h){var r=-1,t=h==null?0:h.length;for(this.clear();++r<t;){var e=h[r];this.set(e[0],e[1]);}}xe.prototype.clear=so;xe.prototype["delete"]=oo;xe.prototype.get=ao;xe.prototype.has=lo;xe.prototype.set=co;var fo=xe,Rr=fo,uo=He,ho=cr;function go(){this.size=0,this.__data__={hash:new Rr(),map:new(ho||uo)(),string:new Rr()};}var po=go;function vo(h){var r=_typeof(h);return r=="string"||r=="number"||r=="symbol"||r=="boolean"?h!=="__proto__":h===null;}var mo=vo,yo=mo;function So(h,r){var t=h.__data__;return yo(r)?t[typeof r=="string"?"string":"hash"]:t.map;}var Ye=So,xo=Ye;function To(h){var r=xo(this,h)["delete"](h);return this.size-=r?1:0,r;}var Mo=To,Oo=Ye;function Eo(h){return Oo(this,h).get(h);}var Po=Eo,Ao=Ye;function Co(h){return Ao(this,h).has(h);}var Ro=Co,Io=Ye;function Lo(h,r){var t=Io(this,h),e=t.size;return t.set(h,r),this.size+=t.size==e?0:1,this;}var bo=Lo,Do=po,wo=Mo,No=Po,Wo=Ro,Bo=bo;function Te(h){var r=-1,t=h==null?0:h.length;for(this.clear();++r<t;){var e=h[r];this.set(e[0],e[1]);}}Te.prototype.clear=Do;Te.prototype["delete"]=wo;Te.prototype.get=No;Te.prototype.has=Wo;Te.prototype.set=Bo;var dn=Te,Fo=He,jo=cr,Uo=dn,zo=200;function $o(h,r){var t=this.__data__;if(t instanceof Fo){var e=t.__data__;if(!jo||e.length<zo-1)return e.push([h,r]),this.size=++t.size,this;t=this.__data__=new Uo(e);}return t.set(h,r),this.size=t.size,this;}var Go=$o,Ho=He,Ko=Ii,Vo=bi,Yo=wi,Xo=Wi,Jo=Go;function Me(h){var r=this.__data__=new Ho(h);this.size=r.size;}Me.prototype.clear=Ko;Me.prototype["delete"]=Vo;Me.prototype.get=Yo;Me.prototype.has=Xo;Me.prototype.set=Jo;var gn=Me;function Qo(h,r){for(var t=-1,e=h==null?0:h.length;++t<e&&r(h[t],t,h)!==!1;);return h;}var Zo=Qo,ko=ue,qo=function(){try{var h=ko(Object,"defineProperty");return h({},"",{}),h;}catch(_unused4){}}(),_o=qo,Ir=_o;function ta(h,r,t){r=="__proto__"&&Ir?Ir(h,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):h[r]=t;}var pn=ta,ea=pn,ra=lr,na=Object.prototype,ia=na.hasOwnProperty;function sa(h,r,t){var e=h[r];(!(ia.call(h,r)&&ra(e,t))||t===void 0&&!(r in h))&&ea(h,r,t);}var vn=sa,oa=vn,aa=pn;function la(h,r,t,e){var n=!t;t||(t={});for(var i=-1,a=r.length;++i<a;){var o=r[i],s=e?e(t[o],h[o],o,t,h):void 0;s===void 0&&(s=h[o]),n?aa(t,o,s):oa(t,o,s);}return t;}var Xe=la;function ca(h,r){for(var t=-1,e=Array(h);++t<h;)e[t]=r(t);return e;}var fa=ca;function ua(h){return h!=null&&_typeof(h)=="object";}var re=ua,ha=fe,da=re,ga="[object Arguments]";function pa(h){return da(h)&&ha(h)==ga;}var va=pa,Lr=va,ma=re,mn=Object.prototype,ya=mn.hasOwnProperty,Sa=mn.propertyIsEnumerable,xa=Lr(/* @__PURE__ */function(){return arguments;}())?Lr:function(h){return ma(h)&&ya.call(h,"callee")&&!Sa.call(h,"callee");},Ta=xa,Ma=Array.isArray,Je=Ma,We={exports:{}};function Oa(){return!1;}var Ea=Oa;We.exports;(function(h,r){var t=_t,e=Ea,n=r&&!r.nodeType&&r,i=n&&!0&&h&&!h.nodeType&&h,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.isBuffer:void 0,f=s||e;h.exports=f;})(We,We.exports);var fr=We.exports,Pa=9007199254740991,Aa=/^(?:0|[1-9]\d*)$/;function Ca(h,r){var _r2;var t=_typeof(h);return r=(_r2=r)!==null&&_r2!==void 0?_r2:Pa,!!r&&(t=="number"||t!="symbol"&&Aa.test(h))&&h>-1&&h%1==0&&h<r;}var Ra=Ca,Ia=9007199254740991;function La(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=Ia;}var yn=La,ba=fe,Da=yn,wa=re,Na="[object Arguments]",Wa="[object Array]",Ba="[object Boolean]",Fa="[object Date]",ja="[object Error]",Ua="[object Function]",za="[object Map]",$a="[object Number]",Ga="[object Object]",Ha="[object RegExp]",Ka="[object Set]",Va="[object String]",Ya="[object WeakMap]",Xa="[object ArrayBuffer]",Ja="[object DataView]",Qa="[object Float32Array]",Za="[object Float64Array]",ka="[object Int8Array]",qa="[object Int16Array]",_a="[object Int32Array]",tl="[object Uint8Array]",el="[object Uint8ClampedArray]",rl="[object Uint16Array]",nl="[object Uint32Array]",Ft={};Ft[Qa]=Ft[Za]=Ft[ka]=Ft[qa]=Ft[_a]=Ft[tl]=Ft[el]=Ft[rl]=Ft[nl]=!0;Ft[Na]=Ft[Wa]=Ft[Xa]=Ft[Ba]=Ft[Ja]=Ft[Fa]=Ft[ja]=Ft[Ua]=Ft[za]=Ft[$a]=Ft[Ga]=Ft[Ha]=Ft[Ka]=Ft[Va]=Ft[Ya]=!1;function il(h){return wa(h)&&Da(h.length)&&!!Ft[ba(h)];}var sl=il;function ol(h){return function(r){return h(r);};}var ur=ol,Be={exports:{}};Be.exports;(function(h,r){var t=cn,e=r&&!r.nodeType&&r,n=e&&!0&&h&&!h.nodeType&&h,i=n&&n.exports===e,a=i&&t.process,o=function(){try{var s=n&&n.require&&n.require("util").types;return s||a&&a.binding&&a.binding("util");}catch(_unused5){}}();h.exports=o;})(Be,Be.exports);var hr=Be.exports,al=sl,ll=ur,br=hr,Dr=br&&br.isTypedArray,cl=Dr?ll(Dr):al,Sn=cl,fl=fa,ul=Ta,hl=Je,dl=fr,gl=Ra,pl=Sn,vl=Object.prototype,ml=vl.hasOwnProperty;function yl(h,r){var t=hl(h),e=!t&&ul(h),n=!t&&!e&&dl(h),i=!t&&!e&&!n&&pl(h),a=t||e||n||i,o=a?fl(h.length,String):[],s=o.length;for(var f in h)(r||ml.call(h,f))&&!(a&&(// Safari 9 has enumerable `arguments.length` in strict mode.
2
+ f=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
3
+ n&&(f=="offset"||f=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
4
+ i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||// Skip index properties.
5
+ gl(f,s)))&&o.push(f);return o;}var xn=yl,Sl=Object.prototype;function xl(h){var r=h&&h.constructor,t=typeof r=="function"&&r.prototype||Sl;return h===t;}var dr=xl;function Tl(h,r){return function(t){return h(r(t));};}var Tn=Tl,Ml=Tn,Ol=Ml(Object.keys,Object),El=Ol,Pl=dr,Al=El,Cl=Object.prototype,Rl=Cl.hasOwnProperty;function Il(h){if(!Pl(h))return Al(h);var r=[];for(var t in Object(h))Rl.call(h,t)&&t!="constructor"&&r.push(t);return r;}var Ll=Il,bl=un,Dl=yn;function wl(h){return h!=null&&Dl(h.length)&&!bl(h);}var Mn=wl,Nl=xn,Wl=Ll,Bl=Mn;function Fl(h){return Bl(h)?Nl(h):Wl(h);}var gr=Fl,jl=Xe,Ul=gr;function zl(h,r){return h&&jl(r,Ul(r),h);}var $l=zl;function Gl(h){var r=[];if(h!=null)for(var t in Object(h))r.push(t);return r;}var Hl=Gl,Kl=ae,Vl=dr,Yl=Hl,Xl=Object.prototype,Jl=Xl.hasOwnProperty;function Ql(h){if(!Kl(h))return Yl(h);var r=Vl(h),t=[];for(var e in h)e=="constructor"&&(r||!Jl.call(h,e))||t.push(e);return t;}var Zl=Ql,kl=xn,ql=Zl,_l=Mn;function tc(h){return _l(h)?kl(h,!0):ql(h);}var pr=tc,ec=Xe,rc=pr;function nc(h,r){return h&&ec(r,rc(r),h);}var ic=nc,Fe={exports:{}};Fe.exports;(function(h,r){var t=_t,e=r&&!r.nodeType&&r,n=e&&!0&&h&&!h.nodeType&&h,i=n&&n.exports===e,a=i?t.Buffer:void 0,o=a?a.allocUnsafe:void 0;function s(f,p){if(p)return f.slice();var c=f.length,v=o?o(c):new f.constructor(c);return f.copy(v),v;}h.exports=s;})(Fe,Fe.exports);var sc=Fe.exports;function oc(h,r){var t=-1,e=h.length;for(r||(r=Array(e));++t<e;)r[t]=h[t];return r;}var ac=oc;function lc(h,r){for(var t=-1,e=h==null?0:h.length,n=0,i=[];++t<e;){var a=h[t];r(a,t,h)&&(i[n++]=a);}return i;}var cc=lc;function fc(){return[];}var On=fc,uc=cc,hc=On,dc=Object.prototype,gc=dc.propertyIsEnumerable,wr=Object.getOwnPropertySymbols,pc=wr?function(h){return h==null?[]:(h=Object(h),uc(wr(h),function(r){return gc.call(h,r);}));}:hc,vr=pc,vc=Xe,mc=vr;function yc(h,r){return vc(h,mc(h),r);}var Sc=yc;function xc(h,r){for(var t=-1,e=r.length,n=h.length;++t<e;)h[n+t]=r[t];return h;}var En=xc,Tc=Tn,Mc=Tc(Object.getPrototypeOf,Object),Pn=Mc,Oc=En,Ec=Pn,Pc=vr,Ac=On,Cc=Object.getOwnPropertySymbols,Rc=Cc?function(h){for(var r=[];h;)Oc(r,Pc(h)),h=Ec(h);return r;}:Ac,An=Rc,Ic=Xe,Lc=An;function bc(h,r){return Ic(h,Lc(h),r);}var Dc=bc,wc=En,Nc=Je;function Wc(h,r,t){var e=r(h);return Nc(h)?e:wc(e,t(h));}var Cn=Wc,Bc=Cn,Fc=vr,jc=gr;function Uc(h){return Bc(h,jc,Fc);}var Rn=Uc,zc=Cn,$c=An,Gc=pr;function Hc(h){return zc(h,Gc,$c);}var Kc=Hc,Vc=ue,Yc=_t,Xc=Vc(Yc,"DataView"),Jc=Xc,Qc=ue,Zc=_t,kc=Qc(Zc,"Promise"),qc=kc,_c=ue,tf=_t,ef=_c(tf,"Set"),rf=ef,nf=ue,sf=_t,of=nf(sf,"WeakMap"),af=of,er=Jc,rr=cr,nr=qc,ir=rf,sr=af,In=fe,Oe=hn,Nr="[object Map]",lf="[object Object]",Wr="[object Promise]",Br="[object Set]",Fr="[object WeakMap]",jr="[object DataView]",cf=Oe(er),ff=Oe(rr),uf=Oe(nr),hf=Oe(ir),df=Oe(sr),le=In;(er&&le(new er(new ArrayBuffer(1)))!=jr||rr&&le(new rr())!=Nr||nr&&le(nr.resolve())!=Wr||ir&&le(new ir())!=Br||sr&&le(new sr())!=Fr)&&(le=function le(h){var r=In(h),t=r==lf?h.constructor:void 0,e=t?Oe(t):"";if(e)switch(e){case cf:return jr;case ff:return Nr;case uf:return Wr;case hf:return Br;case df:return Fr;}return r;});var Qe=le,gf=Object.prototype,pf=gf.hasOwnProperty;function vf(h){var r=h.length,t=new h.constructor(r);return r&&typeof h[0]=="string"&&pf.call(h,"index")&&(t.index=h.index,t.input=h.input),t;}var mf=vf,yf=_t,Sf=yf.Uint8Array,Ln=Sf,Ur=Ln;function xf(h){var r=new h.constructor(h.byteLength);return new Ur(r).set(new Ur(h)),r;}var mr=xf,Tf=mr;function Mf(h,r){var t=r?Tf(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.byteLength);}var Of=Mf,Ef=/\w*$/;function Pf(h){var r=new h.constructor(h.source,Ef.exec(h));return r.lastIndex=h.lastIndex,r;}var Af=Pf,zr=Ke,$r=zr?zr.prototype:void 0,Gr=$r?$r.valueOf:void 0;function Cf(h){return Gr?Object(Gr.call(h)):{};}var Rf=Cf,If=mr;function Lf(h,r){var t=r?If(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.length);}var bf=Lf,Df=mr,wf=Of,Nf=Af,Wf=Rf,Bf=bf,Ff="[object Boolean]",jf="[object Date]",Uf="[object Map]",zf="[object Number]",$f="[object RegExp]",Gf="[object Set]",Hf="[object String]",Kf="[object Symbol]",Vf="[object ArrayBuffer]",Yf="[object DataView]",Xf="[object Float32Array]",Jf="[object Float64Array]",Qf="[object Int8Array]",Zf="[object Int16Array]",kf="[object Int32Array]",qf="[object Uint8Array]",_f="[object Uint8ClampedArray]",tu="[object Uint16Array]",eu="[object Uint32Array]";function ru(h,r,t){var e=h.constructor;switch(r){case Vf:return Df(h);case Ff:case jf:return new e(+h);case Yf:return wf(h,t);case Xf:case Jf:case Qf:case Zf:case kf:case qf:case _f:case tu:case eu:return Bf(h,t);case Uf:return new e();case zf:case Hf:return new e(h);case $f:return Nf(h);case Gf:return new e();case Kf:return Wf(h);}}var nu=ru,iu=ae,Hr=Object.create,su=/* @__PURE__ */function(){function h(){}return function(r){if(!iu(r))return{};if(Hr)return Hr(r);h.prototype=r;var t=new h();return h.prototype=void 0,t;};}(),ou=su,au=ou,lu=Pn,cu=dr;function fu(h){return typeof h.constructor=="function"&&!cu(h)?au(lu(h)):{};}var uu=fu,hu=Qe,du=re,gu="[object Map]";function pu(h){return du(h)&&hu(h)==gu;}var vu=pu,mu=vu,yu=ur,Kr=hr,Vr=Kr&&Kr.isMap,Su=Vr?yu(Vr):mu,xu=Su,Tu=Qe,Mu=re,Ou="[object Set]";function Eu(h){return Mu(h)&&Tu(h)==Ou;}var Pu=Eu,Au=Pu,Cu=ur,Yr=hr,Xr=Yr&&Yr.isSet,Ru=Xr?Cu(Xr):Au,Iu=Ru,Lu=gn,bu=Zo,Du=vn,wu=$l,Nu=ic,Wu=sc,Bu=ac,Fu=Sc,ju=Dc,Uu=Rn,zu=Kc,$u=Qe,Gu=mf,Hu=nu,Ku=uu,Vu=Je,Yu=fr,Xu=xu,Ju=ae,Qu=Iu,Zu=gr,ku=pr,qu=1,_u=2,th=4,bn="[object Arguments]",eh="[object Array]",rh="[object Boolean]",nh="[object Date]",ih="[object Error]",Dn="[object Function]",sh="[object GeneratorFunction]",oh="[object Map]",ah="[object Number]",wn="[object Object]",lh="[object RegExp]",ch="[object Set]",fh="[object String]",uh="[object Symbol]",hh="[object WeakMap]",dh="[object ArrayBuffer]",gh="[object DataView]",ph="[object Float32Array]",vh="[object Float64Array]",mh="[object Int8Array]",yh="[object Int16Array]",Sh="[object Int32Array]",xh="[object Uint8Array]",Th="[object Uint8ClampedArray]",Mh="[object Uint16Array]",Oh="[object Uint32Array]",Bt={};Bt[bn]=Bt[eh]=Bt[dh]=Bt[gh]=Bt[rh]=Bt[nh]=Bt[ph]=Bt[vh]=Bt[mh]=Bt[yh]=Bt[Sh]=Bt[oh]=Bt[ah]=Bt[wn]=Bt[lh]=Bt[ch]=Bt[fh]=Bt[uh]=Bt[xh]=Bt[Th]=Bt[Mh]=Bt[Oh]=!0;Bt[ih]=Bt[Dn]=Bt[hh]=!1;function Ne(h,r,t,e,n,i){var a,o=r&qu,s=r&_u,f=r&th;if(t&&(a=n?t(h,e,n,i):t(h)),a!==void 0)return a;if(!Ju(h))return h;var p=Vu(h);if(p){if(a=Gu(h),!o)return Bu(h,a);}else{var c=$u(h),v=c==Dn||c==sh;if(Yu(h))return Wu(h,o);if(c==wn||c==bn||v&&!n){if(a=s||v?{}:Ku(h),!o)return s?ju(h,Nu(a,h)):Fu(h,wu(a,h));}else{if(!Bt[c])return n?h:{};a=Hu(h,c,o);}}i||(i=new Lu());var S=i.get(h);if(S)return S;i.set(h,a),Qu(h)?h.forEach(function(m){a.add(Ne(m,r,t,m,h,i));}):Xu(h)&&h.forEach(function(m,T){a.set(T,Ne(m,r,t,T,h,i));});var O=f?s?zu:Uu:s?ku:Zu,x=p?void 0:O(h);return bu(x||h,function(m,T){x&&(T=m,m=h[T]),Du(a,T,Ne(m,r,t,T,h,i));}),a;}var Eh=Ne,Ph=Eh,Ah=1,Ch=4;function Rh(h){return Ph(h,Ah|Ch);}var Ih=Rh,Jt=/* @__PURE__ */ye(Ih),Vt=/* @__PURE__ */function(h){return h.Normal="Normal",h.Stroke="Stroke",h.Dotted="Dotted",h.LongDotted="LongDotted",h;}(Vt||{}),Lt=/* @__PURE__ */function(h){return h.None="None",h.ShowFloatBar="ShowFloatBar",h.ZIndexFloatBar="ZIndexFloatBar",h.DeleteNode="DeleteNode",h.CopyNode="CopyNode",h.ZIndexActive="ZIndexActive",h.ZIndexNode="ZIndexNode",h.RotateNode="RotateNode",h.SetColorNode="SetColorNode",h.TranslateNode="TranslateNode",h.ScaleNode="ScaleNode",h.OriginalEvent="OriginalEvent",h.CreateScene="CreateScene",h.ActiveCursor="ActiveCursor",h.MoveCursor="MoveCursor",h.CommandEditor="CommandEditor",h.SetEditorData="SetEditorData",h.SetFontStyle="SetFontStyle",h.SetPoint="SetPoint",h.SetLock="SetLock",h.SetShapeOpt="SetShapeOpt",h.CameraChange="CameraChange",h.ActiveMethod="ActiveMethod",h;}(Lt||{}),ht=/* @__PURE__ */function(h){return h[h.Pencil=1]="Pencil",h[h.Eraser=2]="Eraser",h[h.Selector=3]="Selector",h[h.Clicker=4]="Clicker",h[h.Arrow=5]="Arrow",h[h.Hand=6]="Hand",h[h.LaserPen=7]="LaserPen",h[h.Text=8]="Text",h[h.Straight=9]="Straight",h[h.Rectangle=10]="Rectangle",h[h.Ellipse=11]="Ellipse",h[h.Star=12]="Star",h[h.Triangle=13]="Triangle",h[h.Rhombus=14]="Rhombus",h[h.Polygon=15]="Polygon",h[h.SpeechBalloon=16]="SpeechBalloon",h[h.Image=17]="Image",h;}(ht||{}),Mt=/* @__PURE__ */function(h){return h[h.Local=1]="Local",h[h.Service=2]="Service",h[h.Worker=3]="Worker",h;}(Mt||{}),Rt=/* @__PURE__ */function(h){return h[h.Pending=0]="Pending",h[h.Start=1]="Start",h[h.Doing=2]="Doing",h[h.Done=3]="Done",h[h.Unwritable=4]="Unwritable",h;}(Rt||{}),ct=/* @__PURE__ */function(h){return h[h.None=0]="None",h[h.Init=1]="Init",h[h.UpdateCamera=2]="UpdateCamera",h[h.UpdateTools=3]="UpdateTools",h[h.CreateWork=4]="CreateWork",h[h.DrawWork=5]="DrawWork",h[h.FullWork=6]="FullWork",h[h.UpdateNode=7]="UpdateNode",h[h.RemoveNode=8]="RemoveNode",h[h.Clear=9]="Clear",h[h.Select=10]="Select",h[h.Destroy=11]="Destroy",h[h.Snapshot=12]="Snapshot",h[h.BoundingBox=13]="BoundingBox",h[h.Cursor=14]="Cursor",h[h.TextUpdate=15]="TextUpdate",h[h.GetTextActive=16]="GetTextActive",h[h.TasksQueue=17]="TasksQueue",h[h.CursorHover=18]="CursorHover",h;}(ct||{}),Ce=/* @__PURE__ */function(h){return h.Webgl2="webgl2",h.Webgl="webgl",h.Canvas2d="2d",h;}(Ce||{}),xt=/* @__PURE__ */function(h){return h[h.None=0]="None",h[h.Bg=1]="Bg",h[h.ServiceFloat=2]="ServiceFloat",h[h.Float=3]="Float",h[h.TopFloat=4]="TopFloat",h;}(xt||{}),$t=/* @__PURE__ */function(h){return h[h.none=1]="none",h[h.all=2]="all",h[h.both=3]="both",h[h.proportional=4]="proportional",h;}($t||{});var te=/*#__PURE__*/function(){function te(){_classCallCheck(this,te);nt(this,"localWork");nt(this,"serviceWork");nt(this,"scene");}return _createClass(te,[{key:"registerForWorker",value:function registerForWorker(r,t,e){return this.localWork=r,this.serviceWork=t,this.scene=e,this;}}]);}();var Lh=/*#__PURE__*/function(_te){function Lh(){var _this;_classCallCheck(this,Lh);_this=_callSuper(this,Lh,arguments);nt(_this,"emitEventType",Lt.CopyNode);return _this;}_inherits(Lh,_te);return _createClass(Lh,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.FullWork&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var n,e;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:e=t.workId;_context.t0=e;if(!_context.t0){_context.next=5;break;}_context.next=5;return(n=this.localWork)==null?void 0:n.consumeFull(t,this.scene);case 5:case"end":return _context.stop();}},_callee,this);}));function consumeForLocalWorker(_x){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(te);var bh={linear:function linear(h){return h;},easeInQuad:function easeInQuad(h){return h*h;},easeOutQuad:function easeOutQuad(h){return h*(2-h);},easeInOutQuad:function easeInOutQuad(h){return h<0.5?2*h*h:-1+(4-2*h)*h;},easeInCubic:function easeInCubic(h){return h*h*h;},easeOutCubic:function easeOutCubic(h){return--h*h*h+1;},easeInOutCubic:function easeInOutCubic(h){return h<0.5?4*h*h*h:(h-1)*(2*h-2)*(2*h-2)+1;},easeInQuart:function easeInQuart(h){return h*h*h*h;},easeOutQuart:function easeOutQuart(h){return 1- --h*h*h*h;},easeInOutQuart:function easeInOutQuart(h){return h<0.5?8*h*h*h*h:1-8*--h*h*h*h;},easeInQuint:function easeInQuint(h){return h*h*h*h*h;},easeOutQuint:function easeOutQuint(h){return 1+--h*h*h*h*h;},easeInOutQuint:function easeInOutQuint(h){return h<0.5?16*h*h*h*h*h:1+16*--h*h*h*h*h;},easeInSine:function easeInSine(h){return 1-Math.cos(h*Math.PI/2);},easeOutSine:function easeOutSine(h){return Math.sin(h*Math.PI/2);},easeInOutSine:function easeInOutSine(h){return-(Math.cos(Math.PI*h)-1)/2;},easeInExpo:function easeInExpo(h){return h<=0?0:Math.pow(2,10*h-10);},easeOutExpo:function easeOutExpo(h){return h>=1?1:1-Math.pow(2,-10*h);},easeInOutExpo:function easeInOutExpo(h){return h<=0?0:h>=1?1:h<0.5?Math.pow(2,20*h-10)/2:(2-Math.pow(2,-20*h+10))/2;}};var _=/*#__PURE__*/function(){function _(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;_classCallCheck(this,_);this.x=r,this.y=t,this.z=e;}return _createClass(_,[{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setz",value:function setz(r){return this.z=r,this;}},{key:"setXY",value:function setXY(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;return this.x=r,this.y=t,this;}},{key:"set",value:function set(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;return this.x=r,this.y=t,this.z=e,this;}},{key:"setTo",value:function setTo(_ref){var _ref$x=_ref.x,r=_ref$x===void 0?0:_ref$x,_ref$y=_ref.y,t=_ref$y===void 0?0:_ref$y,_ref$z=_ref.z,e=_ref$z===void 0?1:_ref$z;return this.x=r,this.y=t,this.z=e,this;}},{key:"rot",value:function rot(r){if(r===0)return this;var t=this.x,e=this.y,n=Math.sin(r),i=Math.cos(r);return this.x=t*i-e*n,this.y=t*n+e*i,this;}},{key:"rotWith",value:function rotWith(r,t){if(t===0)return this;var 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;}},{key:"clone",value:function clone(){var r=this.x,t=this.y,e=this.z;return new _(r,t,e);}},{key:"sub",value:function sub(r){return this.x-=r.x,this.y-=r.y,this;}},{key:"subXY",value:function subXY(r,t){return this.x-=r,this.y-=t,this;}},{key:"subScalar",value:function subScalar(r){return this.x-=r,this.y-=r,this;}},{key:"add",value:function add(r){return this.x+=r.x,this.y+=r.y,this;}},{key:"addXY",value:function addXY(r,t){return this.x+=r,this.y+=t,this;}},{key:"addScalar",value:function addScalar(r){return this.x+=r,this.y+=r,this;}},{key:"clamp",value:function 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;}},{key:"div",value:function div(r){return this.x/=r,this.y/=r,this;}},{key:"divV",value:function divV(r){return this.x/=r.x,this.y/=r.y,this;}},{key:"mul",value:function mul(r){return this.x*=r,this.y*=r,this;}},{key:"mulV",value:function mulV(r){return this.x*=r.x,this.y*=r.y,this;}},{key:"abs",value:function abs(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this;}},{key:"nudge",value:function nudge(r,t){var e=_.Tan(r,this);return this.add(e.mul(t));}},{key:"neg",value:function neg(){return this.x*=-1,this.y*=-1,this;}},{key:"cross",value:function cross(r){return this.x=this.y*r.z-this.z*r.y,this.y=this.z*r.x-this.x*r.z,this;}},{key:"dpr",value:function dpr(r){return _.Dpr(this,r);}},{key:"cpr",value:function cpr(r){return _.Cpr(this,r);}},{key:"len2",value:function len2(){return _.Len2(this);}},{key:"len",value:function len(){return _.Len(this);}},{key:"pry",value:function pry(r){return _.Pry(this,r);}},{key:"per",value:function per(){var r=this.x,t=this.y;return this.x=t,this.y=-r,this;}},{key:"uni",value:function uni(){return _.Uni(this);}},{key:"tan",value:function tan(r){return _.Tan(this,r);}},{key:"dist",value:function dist(r){return _.Dist(this,r);}},{key:"distanceToLineSegment",value:function distanceToLineSegment(r,t){return _.DistanceToLineSegment(r,t,this);}},{key:"slope",value:function slope(r){return _.Slope(this,r);}},{key:"snapToGrid",value:function snapToGrid(r){return this.x=Math.round(this.x/r)*r,this.y=Math.round(this.y/r)*r,this;}},{key:"angle",value:function angle(r){return _.Angle(this,r);}},{key:"toAngle",value:function toAngle(){return _.ToAngle(this);}},{key:"lrp",value:function lrp(r,t){return this.x=this.x+(r.x-this.x)*t,this.y=this.y+(r.y-this.y)*t,this;}},{key:"equals",value:function equals(r,t){return _.Equals(this,r,t);}},{key:"equalsXY",value:function equalsXY(r,t){return _.EqualsXY(this,r,t);}},{key:"norm",value:function norm(){var r=this.len();return this.x=r===0?0:this.x/r,this.y=r===0?0:this.y/r,this;}},{key:"toFixed",value:function toFixed(){return _.ToFixed(this);}},{key:"toString",value:function toString(){return _.ToString(_.ToFixed(this));}},{key:"toJson",value:function toJson(){return _.ToJson(this);}},{key:"toArray",value:function toArray(){return _.ToArray(this);}}],[{key:"Add",value:function Add(r,t){return new _(r.x+t.x,r.y+t.y);}},{key:"AddXY",value:function AddXY(r,t,e){return new _(r.x+t,r.y+e);}},{key:"Sub",value:function Sub(r,t){return new _(r.x-t.x,r.y-t.y);}},{key:"SubXY",value:function SubXY(r,t,e){return new _(r.x-t,r.y-e);}},{key:"AddScalar",value:function AddScalar(r,t){return new _(r.x+t,r.y+t);}},{key:"SubScalar",value:function SubScalar(r,t){return new _(r.x-t,r.y-t);}},{key:"Div",value:function Div(r,t){return new _(r.x/t,r.y/t);}},{key:"Mul",value:function Mul(r,t){return new _(r.x*t,r.y*t);}},{key:"DivV",value:function DivV(r,t){return new _(r.x/t.x,r.y/t.y);}},{key:"MulV",value:function MulV(r,t){return new _(r.x*t.x,r.y*t.y);}},{key:"Neg",value:function Neg(r){return new _(-r.x,-r.y);}},{key:"Per",value:function Per(r){return new _(r.y,-r.x);}},{key:"Dist2",value:function Dist2(r,t){return _.Sub(r,t).len2();}},{key:"Abs",value:function Abs(r){return new _(Math.abs(r.x),Math.abs(r.y));}},{key:"Dist",value:function Dist(r,t){return Math.hypot(r.y-t.y,r.x-t.x);}},{key:"Dpr",value:function Dpr(r,t){return r.x*t.x+r.y*t.y;}},{key:"Cross",value:function Cross(r,t){return new _(r.y*t.z-r.z*t.y,r.z*t.x-r.x*t.z// A.z = A.x * V.y - A.y * V.x
6
+ );}},{key:"Cpr",value:function Cpr(r,t){return r.x*t.y-t.x*r.y;}},{key:"Len2",value:function Len2(r){return r.x*r.x+r.y*r.y;}},{key:"Len",value:function Len(r){return Math.hypot(r.x,r.y);}},{key:"Pry",value:function Pry(r,t){return _.Dpr(r,t)/_.Len(t);}},{key:"Uni",value:function Uni(r){return _.Div(r,_.Len(r));}},{key:"Tan",value:function Tan(r,t){return _.Uni(_.Sub(r,t));}},{key:"Min",value:function Min(r,t){return new _(Math.min(r.x,t.x),Math.min(r.y,t.y));}},{key:"Max",value:function Max(r,t){return new _(Math.max(r.x,t.x),Math.max(r.y,t.y));}},{key:"From",value:function From(r){return new _().add(r);}},{key:"FromArray",value:function FromArray(r){return new _(r[0],r[1]);}},{key:"Rot",value:function Rot(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=Math.sin(t),n=Math.cos(t);return new _(r.x*n-r.y*e,r.x*e+r.y*n);}},{key:"RotWith",value:function RotWith(r,t,e){var n=r.x-t.x,i=r.y-t.y,a=Math.sin(e),o=Math.cos(e);return new _(t.x+(n*o-i*a),t.y+(n*a+i*o));}/**
7
+ * Get the nearest point on a line with a known unit vector that passes through point A
8
+ *
9
+ * ```ts
10
+ * Vec.nearestPointOnLineThroughPoint(A, u, Point)
11
+ * ```
12
+ *
13
+ * @param A - Any point on the line
14
+ * @param u - The unit vector for the line.
15
+ * @param P - A point not on the line to test.
16
+ */},{key:"NearestPointOnLineThroughPoint",value:function NearestPointOnLineThroughPoint(r,t,e){return _.Mul(t,_.Sub(e,r).pry(t)).add(r);}},{key:"NearestPointOnLineSegment",value:function NearestPointOnLineSegment(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var 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;}},{key:"DistanceToLineThroughPoint",value:function DistanceToLineThroughPoint(r,t,e){return _.Dist(e,_.NearestPointOnLineThroughPoint(r,t,e));}},{key:"DistanceToLineSegment",value:function DistanceToLineSegment(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return _.Dist(e,_.NearestPointOnLineSegment(r,t,e,n));}},{key:"Snap",value:function Snap(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new _(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}},{key:"Cast",value:function Cast(r){return r instanceof _?r:_.From(r);}},{key:"Slope",value:function Slope(r,t){return r.x===t.y?NaN:(r.y-t.y)/(r.x-t.x);}},{key:"Angle",value:function Angle(r,t){return Math.atan2(t.y-r.y,t.x-r.x);}},{key:"Lrp",value:function Lrp(r,t,e){return _.Sub(t,r).mul(e).add(r);}},{key:"Med",value:function Med(r,t){return new _((r.x+t.x)/2,(r.y+t.y)/2);}},{key:"Equals",value:function Equals(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return Math.abs(r.x-t.x)<e&&Math.abs(r.y-t.y)<e;}},{key:"EqualsXY",value:function EqualsXY(r,t,e){return r.x===t&&r.y===e;}},{key:"EqualsXYZ",value:function EqualsXYZ(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return _.Equals(r,t,e)&&Math.abs((r.z||0)-(t.z||0))<e;}},{key:"Clockwise",value:function Clockwise(r,t,e){return(e.x-r.x)*(t.y-r.y)-(t.x-r.x)*(e.y-r.y)<0;}},{key:"Rescale",value:function Rescale(r,t){var e=_.Len(r);return new _(t*r.x/e,t*r.y/e);}},{key:"ScaleWithOrigin",value:function ScaleWithOrigin(r,t,e){return _.Sub(r,e).mul(t).add(e);}},{key:"ScaleWOrigin",value:function ScaleWOrigin(r,t,e){return _.Sub(r,e).mulV(t).add(e);}},{key:"ToFixed",value:function ToFixed(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:2;return new _(+r.x.toFixed(t),+r.y.toFixed(t),+r.z.toFixed(t));}},{key:"Nudge",value:function Nudge(r,t,e){return _.Add(r,_.Tan(t,r).mul(e));}},{key:"ToString",value:function ToString(r){return"".concat(r.x,", ").concat(r.y);}},{key:"ToAngle",value:function ToAngle(r){var t=Math.atan2(r.y,r.x);return t<0&&(t+=Math.PI*2),t;}},{key:"FromAngle",value:function FromAngle(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new _(Math.cos(r)*t,Math.sin(r)*t);}},{key:"ToArray",value:function ToArray(r){return[r.x,r.y,r.z];}},{key:"ToJson",value:function ToJson(r){var t=r.x,e=r.y,n=r.z;return{x:t,y:e,z:n};}},{key:"Average",value:function Average(r){var t=r.length,e=new _(0,0);for(var n=0;n<t;n++)e.add(r[n]);return e.div(t);}},{key:"Clamp",value:function 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));}/**
17
+ * Get an array of points (with simulated pressure) between two points.
18
+ *
19
+ * @param A - The first point.
20
+ * @param B - The second point.
21
+ * @param steps - The number of points to return.
22
+ */},{key:"PointsBetween",value:function PointsBetween(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:6;var n=[];for(var i=0;i<e;i++){var a=bh.easeInQuad(i/(e-1)),o=_.Lrp(r,t,a);o.z=Math.min(1,0.5+Math.abs(0.5-Dh(a))*0.65),n.push(o);}return n;}},{key:"SnapToGrid",value:function SnapToGrid(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:8;return new _(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}}]);}();var Dh=function Dh(h){return h<0.5?2*h*h:-1+(4-2*h)*h;};var Tt=/*#__PURE__*/function(_ref2){function Tt(){var _this2;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{x:0,y:0};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,Tt);_this2=_callSuper(this,Tt,[r,t,e]),_this2.x=r,_this2.y=t,_this2.z=e,_this2.v=n,_this2.t=i,_this2.a=a;return _this2;}_inherits(Tt,_ref2);return _createClass(Tt,[{key:"timestamp",get:function get(){return this.t;}},{key:"pressure",get:function get(){return this.z;}},{key:"angleNum",get:function get(){return this.a;}},{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setA",value:function setA(r){this.a=r;}},{key:"setT",value:function setT(r){this.t=r;}},{key:"setv",value:function setv(r){return this.v={x:r.x,y:r.y},this;}},{key:"set",value:function set(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this.v;var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this.t;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this.a;return this.x=r,this.y=t,this.z=e,this.v=n,this.t=i,this.a=a,this;}},{key:"clone",value:function clone(){var r=this.x,t=this.y,e=this.z,n=this.v,i=this.t,a=this.a,o={x:n.x,y:n.y};return new Tt(r,t,e,o,i,a);}},{key:"distance",value:function distance(r){return Tt.GetDistance(this,r);}},{key:"isNear",value:function isNear(r,t){return Tt.IsNear(this,r,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(r,t){return Tt.GetAngleByPoints(r,this,t);}}],[{key:"Sub",value:function Sub(r,t){return new Tt(r.x-t.x,r.y-t.y);}},{key:"Add",value:function Add(r,t){return new Tt(r.x+t.x,r.y+t.y);}},{key:"GetDistance",value:function GetDistance(r,t){return Tt.Len(r.clone().sub(t));}},{key:"GetAngleByPoints",value:function GetAngleByPoints(r,t,e){var n=t.x-r.x,i=e.x-t.x,a=t.y-r.y,o=e.y-t.y;var s=0;var f=Math.sqrt(n*n+a*a),p=Math.sqrt(i*i+o*o);if(f&&p){var c=n*i+a*o;s=Math.acos(c/(f*p)),s=s/Math.PI*180;var v=n*o-a*i;v=v>0?1:-1,s=180+v*s;}return s;}},{key:"IsNear",value:function IsNear(r,t,e){return Tt.Len(r.clone().sub(t))<e;}},{key:"RotWith",value:function RotWith(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:2;var i=r.x-t.x,a=r.y-t.y,o=Math.sin(e),s=Math.cos(e),f=Math.pow(10,n),p=Math.floor((t.x+(i*s-a*o))*f)/f,c=Math.floor((t.y+(i*o+a*s))*f)/f;return new Tt(p,c);}/**
23
+ * 根据圆心和半径,获取圆上的等份点
24
+ * @param o 圆心
25
+ * @param radius 半径
26
+ * @param average 均分数
27
+ * @returns
28
+ */},{key:"GetDotStroke",value:function GetDotStroke(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:16;var n=new _(1,1),i=Math.PI+1e-3,a=Tt.Add(r,Tt.Sub(r,n).uni().per().mul(-t)),o=[];for(var s=1/e,f=s;f<=1;f+=s)o.push(Tt.RotWith(a,r,i*2*f));return o;}/**
29
+ * 根据圆心和圆上的起始点,获取半圆上的等份点
30
+ * @param o 圆心
31
+ * @param p 圆弧起始点
32
+ * @param radian 1,逆时针180度 -1,顺时针
33
+ * @param average 均分数
34
+ * @returns
35
+ */},{key:"GetSemicircleStroke",value:function GetSemicircleStroke(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:8;var i=e*(Math.PI+1e-3),a=[];for(var o=1/n,s=o;s<=1;s+=o)a.push(Tt.RotWith(t,r,i*s));return a;}}]);}(_);function Ot(h,r){if(h&&r){var t=Math.min(h.x,r.x),_e2=Math.min(h.y,r.y),n=Math.max(h.x+h.w,r.x+r.w),i=Math.max(h.y+h.h,r.y+r.h),a=n-t,o=i-_e2;return{x:t,y:_e2,w:a,h:o};}return r||h;}function Wt(h){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var t={x:0,y:0,w:0,h:0};var e=1/0,n=1/0,i=-1/0,a=-1/0;return h.forEach(function(o){var _o$XY=_slicedToArray(o.XY,2),s=_o$XY[0],f=_o$XY[1];e=Math.min(e,s-r),n=Math.min(n,f-r),i=Math.max(i,s+r),a=Math.max(a,f+r);}),t.x=e,t.y=n,t.w=i-e,t.h=a-n,t;}function Re(h,r){return!(h.x+h.w<r.x||h.x>r.x+r.w||h.y+h.h<r.y||h.y>r.y+r.h);}function wt(h){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(h.x-r),y:Math.floor(h.y-r),w:Math.floor(h.w+r*2),h:Math.floor(h.h+r*2)};}function Ie(h,r){return{x:h.x+r[0],y:h.y+r[1],w:h.w,h:h.h};}function Nn(h,r){var t=new _(h.x,h.y),e=new _(h.x+h.w,h.y),n=new _(h.x+h.w,h.y+h.h),i=new _(h.x,h.y+h.h),a=new _(h.x+h.w/2,h.y+h.h/2),o=Math.PI*r/180,s=_.RotWith(t,a,o),f=_.RotWith(e,a,o),p=_.RotWith(n,a,o),c=_.RotWith(i,a,o);return[s,f,p,c];}function Wn(h,r){var t=Nn(h,r);return Wt(t);}function Bn(h,r){var t=new _(h.x,h.y),e=new _(h.x+h.w,h.y),n=new _(h.x+h.w,h.y+h.h),i=new _(h.x,h.y+h.h),a=new _(h.x+h.w/2,h.y+h.h/2),o=new _(r[0],r[1]),s=_.ScaleWOrigin(t,o,a),f=_.ScaleWOrigin(e,o,a),p=_.ScaleWOrigin(n,o,a),c=_.ScaleWOrigin(i,o,a);return Wt([s,f,p,c]);}function wh(h,r,t){var e=[];for(var n=0;n<h.length;n++){var i=h[n],a=new _(t[0],t[1]),o=_.ScaleWOrigin(i,a,r);e.push(o);}return e;}function Nh(h,r,t){var e=[];for(var n=0;n<h.length;n++){var i=h[n],a=Math.PI*t/180,o=_.RotWith(i,r,a);e.push(o);}return e;}function Wh(h,r,t){var e=new _(r[0],r[1]);for(var n=0;n<h.length;n+=3){var i=new _(h[n],h[n+1]),a=Math.PI*t/180,o=_.RotWith(i,e,a);h[n]=o.x,h[n+1]=o.y;}}function Bh(h,r,t){var e=new _(r[0],r[1]);for(var n=0;n<h.length;n+=3){var i=new _(h[n],h[n+1]),a=new _(t[0],t[1]),o=_.ScaleWOrigin(i,a,e);h[n]=o.x,h[n+1]=o.y;}}function Fh(h,r){return h[0]>=r.x&&h[0]<=r.x+r.w&&h[1]>=r.y&&h[1]<=r.y+r.h;}function Fn(h,r){var t=h<=r?1:h/r,e=r<=h?1:r/h;return[t,e];}var jh=function jh(h){if(h.tagName==="GROUP"){var r=Object.getOwnPropertySymbols(h).find(function(t){return t.toString()==="Symbol(sealed)";});if(r&&h[r])return!0;}return!1;},Uh=function Uh(h){return!h.isHid;};function de(h){return"".concat(je(h.x),",").concat(je(h.y)," ");}function ge(h,r){return"".concat(je((h.x+r.x)/2),",").concat(je((h.y+r.y)/2)," ");}function je(h){return+h.toFixed(4);}var zh=fe,$h=re,Gh="[object Number]";function Hh(h){return typeof h=="number"||$h(h)&&zh(h)==Gh;}var Kh=Hh,kt=/* @__PURE__ */ye(Kh);var Xt=/*#__PURE__*/function(){function Xt(r){_classCallCheck(this,Xt);nt(this,"syncUnitTime",1e3);nt(this,"vNodes");nt(this,"drawLayer");nt(this,"fullLayer");nt(this,"workId");var t=r.vNodes,e=r.fullLayer,n=r.drawLayer;this.vNodes=t,this.fullLayer=e,this.drawLayer=n;}/** 设置工作id */return _createClass(Xt,[{key:"setWorkId",value:function setWorkId(r){this.workId=r;}},{key:"getWorkId",value:function getWorkId(){return this.workId;}/** 获取工作选项配置 */},{key:"getWorkOptions",value:function getWorkOptions(){return this.workOptions;}/** 设置工作选项配置 */},{key:"setWorkOptions",value:function setWorkOptions(r){var n,i,a;this.workOptions=r,this.syncUnitTime=r.syncUnitTime||this.syncUnitTime;var 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));}/** 更新服务端同步配置,返回绘制结果 */},{key:"updataOptService",value:function updataOptService(r){var n,i;var t;var e=(n=this.workId)==null?void 0:n.toString();if(e&&r){var a=this.fullLayer.getElementsByName(e)||this.drawLayer&&this.drawLayer.getElementsByName(e)||[];if(a.length!==1)return;var o=a[0],s=r.pos,f=r.zIndex,p=r.scale,c=r.angle,v=r.translate,S={};kt(f)&&(S.zIndex=f),s&&(S.pos=[s[0],s[1]]),p&&(S.scale=p),c&&(S.rotate=c),v&&(S.translate=v),o.attr(S);var O=o==null?void 0:o.getBoundingClientRect();return O&&(t=Ot(t,{x:Math.floor(O.x-Xt.SafeBorderPadding),y:Math.floor(O.y-Xt.SafeBorderPadding),w:Math.floor(O.width+Xt.SafeBorderPadding*2),h:Math.floor(O.height+Xt.SafeBorderPadding*2)})),(i=this.vNodes)==null||i.setInfo(e,{rect:t,centerPos:s}),t;}}},{key:"replace",value:function replace(r,t,e){var o;var n=r.getElementsByName(t),i=n.length;if(i){if(i>1)for(var s=1;s<n.length;s++)n[s].remove();r.replaceChild(e,n[0]);}else r.append(e);this.fullLayer===r?(o=this.drawLayer)==null||o.getElementsByName(t).forEach(function(s){s.remove();}):this.fullLayer.getElementsByName(t).forEach(function(s){s.remove();});}}],[{key:"updateNodeOpt",value:function updateNodeOpt(r){var t=r.node,e=r.opt,n=r.vNodes,i=r.willSerializeData,a=r.targetNode,o=e.zIndex,s=e.translate,f=e.angle,p=e.box,c=e.boxScale,v=e.boxTranslate,S=e.pointMap;var O;var x=a&&Jt(a)||n.get(t.name);if(!x)return;kt(o)&&(t.setAttribute("zIndex",o),x.opt.zIndex=o);var m=t.parent;if(m){if(p&&v&&c){var T=x.rect,l=[];for(var L=0;L<x.op.length;L+=3)l.push(new Tt(x.op[L],x.op[L+1],x.op[L+2]));var d=Wt(l),u=[d.w*m.worldScaling[0],d.h*m.worldScaling[0]],g=[T.w-u[0],T.h-u[1]],M=[(T.w*c[0]-g[0])/u[0],(T.h*c[1]-g[1])/u[1]],A=[v[0]/m.worldScaling[0],v[1]/m.worldScaling[1]],R=x.op.map(function(L,D){var I=D%3;return I===0?L+A[0]:I===1?L+A[1]:L;}),b=[x.centerPos[0]+A[0],x.centerPos[1]+A[1]];Bh(R,b,M);var E=[];for(var _L=0;_L<R.length;_L+=3)E.push(new Tt(R[_L],R[_L+1],R[_L+2]));x.op=R,x.centerPos=b;}else if(s){if(t.setAttribute("translate",s),x.opt.translate=s,a){var _T=[s[0]*m.worldScaling[0],s[1]*m.worldScaling[1]];O=Ie(x.rect,_T),x.rect=O;}else{var _T2=Xt.getRectFromLayer(m,t.name);x.rect=_T2||x.rect;}}else if(kt(f))if(t.setAttribute("rotate",f),x.opt.rotate=f,a)O=Wn(x.rect,f),x.rect=O;else{var _T3=Xt.getRectFromLayer(m,t.name);x.rect=_T3||x.rect;}if(S){var _T4=S.get(t.name);if(_T4)for(var _l2=0,_d2=0;_l2<x.op.length;_l2+=3,_d2++)x.op[_l2]=_T4[_d2][0],x.op[_l2+1]=_T4[_d2][1];}if(i){if(s){var _T5=[s[0],s[1]],_l3=x.op.map(function(d,u){var g=u%3;return g===0?d+_T5[0]:g===1?d+_T5[1]:d;});x.op=_l3,x.centerPos=[x.centerPos[0]+_T5[0],x.centerPos[1]+_T5[1]],x!=null&&x.opt&&(x.opt.translate=void 0);}else if(kt(f)){var _T6=x.op;Wh(_T6,x.centerPos,f),x.op=_T6,x!=null&&x.opt&&(x.opt.rotate=void 0);}}x&&n.setInfo(t.name,x);}}},{key:"getCenterPos",value:function getCenterPos(r,t){var e=t.worldPosition,n=t.worldScaling;return[(r.x+r.w/2-e[0])/n[0],(r.y+r.h/2-e[1])/n[1]];}},{key:"getRectFromLayer",value:function getRectFromLayer(r,t){var e=r.getElementsByName(t)[0];if(e){var n=e.getBoundingClientRect();return{x:Math.floor(n.x-Xt.SafeBorderPadding),y:Math.floor(n.y-Xt.SafeBorderPadding),w:Math.floor(n.width+Xt.SafeBorderPadding*2),h:Math.floor(n.height+Xt.SafeBorderPadding*2)};}}}]);}();nt(Xt,"SafeBorderPadding",10);var yt=Xt;var Dt=/******/function(h){var r={};function t(e){if(r[e])return r[e].exports;var n=r[e]={/******/i:e,/******/l:!1,/******/exports:{}/******/};return h[e].call(n.exports,n,n.exports,t),n.l=!0,n.exports;}return t.m=h,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==="undefined"?"undefined":_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=/* @__PURE__ */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(o){return e[o];}.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);}([/* 0 */ /***/function(h,r,t){t.r(r),t.d(r,"version",function(){return K;}),t.d(r,"helpers",function(){return W;}),t.d(r,"createElement",function(){return D;}),t.d(r,"isSpriteNode",function(){return I;}),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 o=t(219);t.d(r,"Block",function(){return o["default"];});var s=t(224);t.d(r,"Sprite",function(){return s["default"];});var f=t(226);t.d(r,"Path",function(){return f["default"];});var p=t(229);t.d(r,"Rect",function(){return p["default"];});var c=t(231);t.d(r,"Triangle",function(){return c["default"];});var v=t(236);t.d(r,"Parallel",function(){return v["default"];});var S=t(238);t.d(r,"Regular",function(){return S["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 l=t(232);t.d(r,"Polyline",function(){return l["default"];});var d=t(248);t.d(r,"Label",function(){return d["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 R=t(290);t.d(r,"Scene",function(){return R["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);var D=b["default"].createElement,I=b["default"].isSpriteNode,C=b["default"].registerNode,W={parseColor:E.parseColor,sizeToPixel:L.sizeToPixel,toArray:L.toArray,toString:L.toString,toNumber:L.toNumber};var G;G="3.8.3";var K=G;},/* 1 */ /***/function(h,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 o=t(6);t.d(r,"mat4",function(){return o;});var s=t(7);t.d(r,"quat",function(){return s;});var f=t(10);t.d(r,"quat2",function(){return f;});var p=t(11);t.d(r,"vec2",function(){return p;});var c=t(8);t.d(r,"vec3",function(){return c;});var v=t(9);t.d(r,"vec4",function(){return v;});},/* 2 */ /***/function(h,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 s;}),t.d(r,"equals",function(){return f;});var e=1e-6,n=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,i=Math.random;function a(p){n=p;}var o=Math.PI/180;function s(p){return p*o;}function f(p,c){return Math.abs(p-c)<=e*Math.max(1,Math.abs(p),Math.abs(c));}Math.hypot||(Math.hypot=function(){for(var p=0,c=arguments.length;c--;)p+=arguments[c]*arguments[c];return Math.sqrt(p);});},/* 3 */ /***/function(h,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 o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return f;}),t.d(r,"transpose",function(){return p;}),t.d(r,"invert",function(){return c;}),t.d(r,"adjoint",function(){return v;}),t.d(r,"determinant",function(){return S;}),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 l;}),t.d(r,"str",function(){return d;}),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 R;}),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 I;});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 o(C){return C[0]=1,C[1]=0,C[2]=0,C[3]=1,C;}function s(C,W,G,K){var J=new e.ARRAY_TYPE(4);return J[0]=C,J[1]=W,J[2]=G,J[3]=K,J;}function f(C,W,G,K,J){return C[0]=W,C[1]=G,C[2]=K,C[3]=J,C;}function p(C,W){if(C===W){var G=W[1];C[1]=W[2],C[2]=G;}else C[0]=W[0],C[1]=W[2],C[2]=W[1],C[3]=W[3];return C;}function c(C,W){var G=W[0],K=W[1],J=W[2],Z=W[3],B=G*Z-J*K;return B?(B=1/B,C[0]=Z*B,C[1]=-K*B,C[2]=-J*B,C[3]=G*B,C):null;}function v(C,W){var G=W[0];return C[0]=W[3],C[1]=-W[1],C[2]=-W[2],C[3]=G,C;}function S(C){return C[0]*C[3]-C[2]*C[1];}function O(C,W,G){var K=W[0],J=W[1],Z=W[2],B=W[3],$=G[0],Q=G[1],et=G[2],tt=G[3];return C[0]=K*$+Z*Q,C[1]=J*$+B*Q,C[2]=K*et+Z*tt,C[3]=J*et+B*tt,C;}function x(C,W,G){var K=W[0],J=W[1],Z=W[2],B=W[3],$=Math.sin(G),Q=Math.cos(G);return C[0]=K*Q+Z*$,C[1]=J*Q+B*$,C[2]=K*-$+Z*Q,C[3]=J*-$+B*Q,C;}function m(C,W,G){var K=W[0],J=W[1],Z=W[2],B=W[3],$=G[0],Q=G[1];return C[0]=K*$,C[1]=J*$,C[2]=Z*Q,C[3]=B*Q,C;}function T(C,W){var G=Math.sin(W),K=Math.cos(W);return C[0]=K,C[1]=G,C[2]=-G,C[3]=K,C;}function l(C,W){return C[0]=W[0],C[1]=0,C[2]=0,C[3]=W[1],C;}function d(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,G,K){return C[2]=K[2]/K[0],G[0]=K[0],G[1]=K[1],G[3]=K[3]-C[2]*G[1],[C,W,G];}function M(C,W,G){return C[0]=W[0]+G[0],C[1]=W[1]+G[1],C[2]=W[2]+G[2],C[3]=W[3]+G[3],C;}function A(C,W,G){return C[0]=W[0]-G[0],C[1]=W[1]-G[1],C[2]=W[2]-G[2],C[3]=W[3]-G[3],C;}function R(C,W){return C[0]===W[0]&&C[1]===W[1]&&C[2]===W[2]&&C[3]===W[3];}function b(C,W){var G=C[0],K=C[1],J=C[2],Z=C[3],B=W[0],$=W[1],Q=W[2],et=W[3];return Math.abs(G-B)<=e.EPSILON*Math.max(1,Math.abs(G),Math.abs(B))&&Math.abs(K-$)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs($))&&Math.abs(J-Q)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(Q))&&Math.abs(Z-et)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(et));}function E(C,W,G){return C[0]=W[0]*G,C[1]=W[1]*G,C[2]=W[2]*G,C[3]=W[3]*G,C;}function L(C,W,G,K){return C[0]=W[0]+G[0]*K,C[1]=W[1]+G[1]*K,C[2]=W[2]+G[2]*K,C[3]=W[3]+G[3]*K,C;}var D=O,I=A;},/* 4 */ /***/function(h,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 o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return f;}),t.d(r,"invert",function(){return p;}),t.d(r,"determinant",function(){return c;}),t.d(r,"multiply",function(){return v;}),t.d(r,"rotate",function(){return S;}),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 l;}),t.d(r,"str",function(){return d;}),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 R;}),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 I=new e.ARRAY_TYPE(6);return e.ARRAY_TYPE!=Float32Array&&(I[1]=0,I[2]=0,I[4]=0,I[5]=0),I[0]=1,I[3]=1,I;}function i(I){var C=new e.ARRAY_TYPE(6);return C[0]=I[0],C[1]=I[1],C[2]=I[2],C[3]=I[3],C[4]=I[4],C[5]=I[5],C;}function a(I,C){return I[0]=C[0],I[1]=C[1],I[2]=C[2],I[3]=C[3],I[4]=C[4],I[5]=C[5],I;}function o(I){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=0,I[5]=0,I;}function s(I,C,W,G,K,J){var Z=new e.ARRAY_TYPE(6);return Z[0]=I,Z[1]=C,Z[2]=W,Z[3]=G,Z[4]=K,Z[5]=J,Z;}function f(I,C,W,G,K,J,Z){return I[0]=C,I[1]=W,I[2]=G,I[3]=K,I[4]=J,I[5]=Z,I;}function p(I,C){var W=C[0],G=C[1],K=C[2],J=C[3],Z=C[4],B=C[5],$=W*J-G*K;return $?($=1/$,I[0]=J*$,I[1]=-G*$,I[2]=-K*$,I[3]=W*$,I[4]=(K*B-J*Z)*$,I[5]=(G*Z-W*B)*$,I):null;}function c(I){return I[0]*I[3]-I[1]*I[2];}function v(I,C,W){var G=C[0],K=C[1],J=C[2],Z=C[3],B=C[4],$=C[5],Q=W[0],et=W[1],tt=W[2],ot=W[3],q=W[4],gt=W[5];return I[0]=G*Q+J*et,I[1]=K*Q+Z*et,I[2]=G*tt+J*ot,I[3]=K*tt+Z*ot,I[4]=G*q+J*gt+B,I[5]=K*q+Z*gt+$,I;}function S(I,C,W){var G=C[0],K=C[1],J=C[2],Z=C[3],B=C[4],$=C[5],Q=Math.sin(W),et=Math.cos(W);return I[0]=G*et+J*Q,I[1]=K*et+Z*Q,I[2]=G*-Q+J*et,I[3]=K*-Q+Z*et,I[4]=B,I[5]=$,I;}function O(I,C,W){var G=C[0],K=C[1],J=C[2],Z=C[3],B=C[4],$=C[5],Q=W[0],et=W[1];return I[0]=G*Q,I[1]=K*Q,I[2]=J*et,I[3]=Z*et,I[4]=B,I[5]=$,I;}function x(I,C,W){var G=C[0],K=C[1],J=C[2],Z=C[3],B=C[4],$=C[5],Q=W[0],et=W[1];return I[0]=G,I[1]=K,I[2]=J,I[3]=Z,I[4]=G*Q+J*et+B,I[5]=K*Q+Z*et+$,I;}function m(I,C){var W=Math.sin(C),G=Math.cos(C);return I[0]=G,I[1]=W,I[2]=-W,I[3]=G,I[4]=0,I[5]=0,I;}function T(I,C){return I[0]=C[0],I[1]=0,I[2]=0,I[3]=C[1],I[4]=0,I[5]=0,I;}function l(I,C){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=C[0],I[5]=C[1],I;}function d(I){return"mat2d("+I[0]+", "+I[1]+", "+I[2]+", "+I[3]+", "+I[4]+", "+I[5]+")";}function u(I){return Math.hypot(I[0],I[1],I[2],I[3],I[4],I[5],1);}function g(I,C,W){return I[0]=C[0]+W[0],I[1]=C[1]+W[1],I[2]=C[2]+W[2],I[3]=C[3]+W[3],I[4]=C[4]+W[4],I[5]=C[5]+W[5],I;}function M(I,C,W){return I[0]=C[0]-W[0],I[1]=C[1]-W[1],I[2]=C[2]-W[2],I[3]=C[3]-W[3],I[4]=C[4]-W[4],I[5]=C[5]-W[5],I;}function A(I,C,W){return I[0]=C[0]*W,I[1]=C[1]*W,I[2]=C[2]*W,I[3]=C[3]*W,I[4]=C[4]*W,I[5]=C[5]*W,I;}function R(I,C,W,G){return I[0]=C[0]+W[0]*G,I[1]=C[1]+W[1]*G,I[2]=C[2]+W[2]*G,I[3]=C[3]+W[3]*G,I[4]=C[4]+W[4]*G,I[5]=C[5]+W[5]*G,I;}function b(I,C){return I[0]===C[0]&&I[1]===C[1]&&I[2]===C[2]&&I[3]===C[3]&&I[4]===C[4]&&I[5]===C[5];}function E(I,C){var W=I[0],G=I[1],K=I[2],J=I[3],Z=I[4],B=I[5],$=C[0],Q=C[1],et=C[2],tt=C[3],ot=C[4],q=C[5];return Math.abs(W-$)<=e.EPSILON*Math.max(1,Math.abs(W),Math.abs($))&&Math.abs(G-Q)<=e.EPSILON*Math.max(1,Math.abs(G),Math.abs(Q))&&Math.abs(K-et)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(et))&&Math.abs(J-tt)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(tt))&&Math.abs(Z-ot)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(ot))&&Math.abs(B-q)<=e.EPSILON*Math.max(1,Math.abs(B),Math.abs(q));}var L=v,D=M;},/* 5 */ /***/function(h,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 o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return f;}),t.d(r,"identity",function(){return p;}),t.d(r,"transpose",function(){return c;}),t.d(r,"invert",function(){return v;}),t.d(r,"adjoint",function(){return S;}),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 l;}),t.d(r,"fromTranslation",function(){return d;}),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 R;}),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 I;}),t.d(r,"multiplyScalar",function(){return C;}),t.d(r,"multiplyScalarAndAdd",function(){return W;}),t.d(r,"exactEquals",function(){return G;}),t.d(r,"equals",function(){return K;}),t.d(r,"mul",function(){return J;}),t.d(r,"sub",function(){return Z;});var e=t(2);function n(){var B=new e.ARRAY_TYPE(9);return e.ARRAY_TYPE!=Float32Array&&(B[1]=0,B[2]=0,B[3]=0,B[5]=0,B[6]=0,B[7]=0),B[0]=1,B[4]=1,B[8]=1,B;}function i(B,$){return B[0]=$[0],B[1]=$[1],B[2]=$[2],B[3]=$[4],B[4]=$[5],B[5]=$[6],B[6]=$[8],B[7]=$[9],B[8]=$[10],B;}function a(B){var $=new e.ARRAY_TYPE(9);return $[0]=B[0],$[1]=B[1],$[2]=B[2],$[3]=B[3],$[4]=B[4],$[5]=B[5],$[6]=B[6],$[7]=B[7],$[8]=B[8],$;}function o(B,$){return B[0]=$[0],B[1]=$[1],B[2]=$[2],B[3]=$[3],B[4]=$[4],B[5]=$[5],B[6]=$[6],B[7]=$[7],B[8]=$[8],B;}function s(B,$,Q,et,tt,ot,q,gt,dt){var F=new e.ARRAY_TYPE(9);return F[0]=B,F[1]=$,F[2]=Q,F[3]=et,F[4]=tt,F[5]=ot,F[6]=q,F[7]=gt,F[8]=dt,F;}function f(B,$,Q,et,tt,ot,q,gt,dt,F){return B[0]=$,B[1]=Q,B[2]=et,B[3]=tt,B[4]=ot,B[5]=q,B[6]=gt,B[7]=dt,B[8]=F,B;}function p(B){return B[0]=1,B[1]=0,B[2]=0,B[3]=0,B[4]=1,B[5]=0,B[6]=0,B[7]=0,B[8]=1,B;}function c(B,$){if(B===$){var Q=$[1],et=$[2],tt=$[5];B[1]=$[3],B[2]=$[6],B[3]=Q,B[5]=$[7],B[6]=et,B[7]=tt;}else B[0]=$[0],B[1]=$[3],B[2]=$[6],B[3]=$[1],B[4]=$[4],B[5]=$[7],B[6]=$[2],B[7]=$[5],B[8]=$[8];return B;}function v(B,$){var Q=$[0],et=$[1],tt=$[2],ot=$[3],q=$[4],gt=$[5],dt=$[6],F=$[7],j=$[8],V=j*q-gt*F,X=-j*ot+gt*dt,N=F*ot-q*dt,z=Q*V+et*X+tt*N;return z?(z=1/z,B[0]=V*z,B[1]=(-j*et+tt*F)*z,B[2]=(gt*et-tt*q)*z,B[3]=X*z,B[4]=(j*Q-tt*dt)*z,B[5]=(-gt*Q+tt*ot)*z,B[6]=N*z,B[7]=(-F*Q+et*dt)*z,B[8]=(q*Q-et*ot)*z,B):null;}function S(B,$){var Q=$[0],et=$[1],tt=$[2],ot=$[3],q=$[4],gt=$[5],dt=$[6],F=$[7],j=$[8];return B[0]=q*j-gt*F,B[1]=tt*F-et*j,B[2]=et*gt-tt*q,B[3]=gt*dt-ot*j,B[4]=Q*j-tt*dt,B[5]=tt*ot-Q*gt,B[6]=ot*F-q*dt,B[7]=et*dt-Q*F,B[8]=Q*q-et*ot,B;}function O(B){var $=B[0],Q=B[1],et=B[2],tt=B[3],ot=B[4],q=B[5],gt=B[6],dt=B[7],F=B[8];return $*(F*ot-q*dt)+Q*(-F*tt+q*gt)+et*(dt*tt-ot*gt);}function x(B,$,Q){var et=$[0],tt=$[1],ot=$[2],q=$[3],gt=$[4],dt=$[5],F=$[6],j=$[7],V=$[8],X=Q[0],N=Q[1],z=Q[2],y=Q[3],P=Q[4],w=Q[5],U=Q[6],H=Q[7],Y=Q[8];return B[0]=X*et+N*q+z*F,B[1]=X*tt+N*gt+z*j,B[2]=X*ot+N*dt+z*V,B[3]=y*et+P*q+w*F,B[4]=y*tt+P*gt+w*j,B[5]=y*ot+P*dt+w*V,B[6]=U*et+H*q+Y*F,B[7]=U*tt+H*gt+Y*j,B[8]=U*ot+H*dt+Y*V,B;}function m(B,$,Q){var et=$[0],tt=$[1],ot=$[2],q=$[3],gt=$[4],dt=$[5],F=$[6],j=$[7],V=$[8],X=Q[0],N=Q[1];return B[0]=et,B[1]=tt,B[2]=ot,B[3]=q,B[4]=gt,B[5]=dt,B[6]=X*et+N*q+F,B[7]=X*tt+N*gt+j,B[8]=X*ot+N*dt+V,B;}function T(B,$,Q){var et=$[0],tt=$[1],ot=$[2],q=$[3],gt=$[4],dt=$[5],F=$[6],j=$[7],V=$[8],X=Math.sin(Q),N=Math.cos(Q);return B[0]=N*et+X*q,B[1]=N*tt+X*gt,B[2]=N*ot+X*dt,B[3]=N*q-X*et,B[4]=N*gt-X*tt,B[5]=N*dt-X*ot,B[6]=F,B[7]=j,B[8]=V,B;}function l(B,$,Q){var et=Q[0],tt=Q[1];return B[0]=et*$[0],B[1]=et*$[1],B[2]=et*$[2],B[3]=tt*$[3],B[4]=tt*$[4],B[5]=tt*$[5],B[6]=$[6],B[7]=$[7],B[8]=$[8],B;}function d(B,$){return B[0]=1,B[1]=0,B[2]=0,B[3]=0,B[4]=1,B[5]=0,B[6]=$[0],B[7]=$[1],B[8]=1,B;}function u(B,$){var Q=Math.sin($),et=Math.cos($);return B[0]=et,B[1]=Q,B[2]=0,B[3]=-Q,B[4]=et,B[5]=0,B[6]=0,B[7]=0,B[8]=1,B;}function g(B,$){return B[0]=$[0],B[1]=0,B[2]=0,B[3]=0,B[4]=$[1],B[5]=0,B[6]=0,B[7]=0,B[8]=1,B;}function M(B,$){return B[0]=$[0],B[1]=$[1],B[2]=0,B[3]=$[2],B[4]=$[3],B[5]=0,B[6]=$[4],B[7]=$[5],B[8]=1,B;}function A(B,$){var Q=$[0],et=$[1],tt=$[2],ot=$[3],q=Q+Q,gt=et+et,dt=tt+tt,F=Q*q,j=et*q,V=et*gt,X=tt*q,N=tt*gt,z=tt*dt,y=ot*q,P=ot*gt,w=ot*dt;return B[0]=1-V-z,B[3]=j-w,B[6]=X+P,B[1]=j+w,B[4]=1-F-z,B[7]=N-y,B[2]=X-P,B[5]=N+y,B[8]=1-F-V,B;}function R(B,$){var Q=$[0],et=$[1],tt=$[2],ot=$[3],q=$[4],gt=$[5],dt=$[6],F=$[7],j=$[8],V=$[9],X=$[10],N=$[11],z=$[12],y=$[13],P=$[14],w=$[15],U=Q*gt-et*q,H=Q*dt-tt*q,Y=Q*F-ot*q,k=et*dt-tt*gt,rt=et*F-ot*gt,it=tt*F-ot*dt,lt=j*y-V*z,ut=j*P-X*z,at=j*w-N*z,st=V*P-X*y,ft=V*w-N*y,vt=X*w-N*P,mt=U*vt-H*ft+Y*st+k*at-rt*ut+it*lt;return mt?(mt=1/mt,B[0]=(gt*vt-dt*ft+F*st)*mt,B[1]=(dt*at-q*vt-F*ut)*mt,B[2]=(q*ft-gt*at+F*lt)*mt,B[3]=(tt*ft-et*vt-ot*st)*mt,B[4]=(Q*vt-tt*at+ot*ut)*mt,B[5]=(et*at-Q*ft-ot*lt)*mt,B[6]=(y*it-P*rt+w*k)*mt,B[7]=(P*Y-z*it-w*H)*mt,B[8]=(z*rt-y*Y+w*U)*mt,B):null;}function b(B,$,Q){return B[0]=2/$,B[1]=0,B[2]=0,B[3]=0,B[4]=-2/Q,B[5]=0,B[6]=-1,B[7]=1,B[8]=1,B;}function E(B){return"mat3("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+", "+B[4]+", "+B[5]+", "+B[6]+", "+B[7]+", "+B[8]+")";}function L(B){return Math.hypot(B[0],B[1],B[2],B[3],B[4],B[5],B[6],B[7],B[8]);}function D(B,$,Q){return B[0]=$[0]+Q[0],B[1]=$[1]+Q[1],B[2]=$[2]+Q[2],B[3]=$[3]+Q[3],B[4]=$[4]+Q[4],B[5]=$[5]+Q[5],B[6]=$[6]+Q[6],B[7]=$[7]+Q[7],B[8]=$[8]+Q[8],B;}function I(B,$,Q){return B[0]=$[0]-Q[0],B[1]=$[1]-Q[1],B[2]=$[2]-Q[2],B[3]=$[3]-Q[3],B[4]=$[4]-Q[4],B[5]=$[5]-Q[5],B[6]=$[6]-Q[6],B[7]=$[7]-Q[7],B[8]=$[8]-Q[8],B;}function C(B,$,Q){return B[0]=$[0]*Q,B[1]=$[1]*Q,B[2]=$[2]*Q,B[3]=$[3]*Q,B[4]=$[4]*Q,B[5]=$[5]*Q,B[6]=$[6]*Q,B[7]=$[7]*Q,B[8]=$[8]*Q,B;}function W(B,$,Q,et){return B[0]=$[0]+Q[0]*et,B[1]=$[1]+Q[1]*et,B[2]=$[2]+Q[2]*et,B[3]=$[3]+Q[3]*et,B[4]=$[4]+Q[4]*et,B[5]=$[5]+Q[5]*et,B[6]=$[6]+Q[6]*et,B[7]=$[7]+Q[7]*et,B[8]=$[8]+Q[8]*et,B;}function G(B,$){return B[0]===$[0]&&B[1]===$[1]&&B[2]===$[2]&&B[3]===$[3]&&B[4]===$[4]&&B[5]===$[5]&&B[6]===$[6]&&B[7]===$[7]&&B[8]===$[8];}function K(B,$){var Q=B[0],et=B[1],tt=B[2],ot=B[3],q=B[4],gt=B[5],dt=B[6],F=B[7],j=B[8],V=$[0],X=$[1],N=$[2],z=$[3],y=$[4],P=$[5],w=$[6],U=$[7],H=$[8];return Math.abs(Q-V)<=e.EPSILON*Math.max(1,Math.abs(Q),Math.abs(V))&&Math.abs(et-X)<=e.EPSILON*Math.max(1,Math.abs(et),Math.abs(X))&&Math.abs(tt-N)<=e.EPSILON*Math.max(1,Math.abs(tt),Math.abs(N))&&Math.abs(ot-z)<=e.EPSILON*Math.max(1,Math.abs(ot),Math.abs(z))&&Math.abs(q-y)<=e.EPSILON*Math.max(1,Math.abs(q),Math.abs(y))&&Math.abs(gt-P)<=e.EPSILON*Math.max(1,Math.abs(gt),Math.abs(P))&&Math.abs(dt-w)<=e.EPSILON*Math.max(1,Math.abs(dt),Math.abs(w))&&Math.abs(F-U)<=e.EPSILON*Math.max(1,Math.abs(F),Math.abs(U))&&Math.abs(j-H)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(H));}var J=x,Z=I;},/* 6 */ /***/function(h,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 o;}),t.d(r,"set",function(){return s;}),t.d(r,"identity",function(){return f;}),t.d(r,"transpose",function(){return p;}),t.d(r,"invert",function(){return c;}),t.d(r,"adjoint",function(){return v;}),t.d(r,"determinant",function(){return S;}),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 l;}),t.d(r,"rotateY",function(){return d;}),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 R;}),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 I;}),t.d(r,"getScaling",function(){return C;}),t.d(r,"getRotation",function(){return W;}),t.d(r,"fromRotationTranslationScale",function(){return G;}),t.d(r,"fromRotationTranslationScaleOrigin",function(){return K;}),t.d(r,"fromQuat",function(){return J;}),t.d(r,"frustum",function(){return Z;}),t.d(r,"perspective",function(){return B;}),t.d(r,"perspectiveFromFieldOfView",function(){return $;}),t.d(r,"ortho",function(){return Q;}),t.d(r,"lookAt",function(){return et;}),t.d(r,"targetTo",function(){return tt;}),t.d(r,"str",function(){return ot;}),t.d(r,"frob",function(){return q;}),t.d(r,"add",function(){return gt;}),t.d(r,"subtract",function(){return dt;}),t.d(r,"multiplyScalar",function(){return F;}),t.d(r,"multiplyScalarAndAdd",function(){return j;}),t.d(r,"exactEquals",function(){return V;}),t.d(r,"equals",function(){return X;}),t.d(r,"mul",function(){return N;}),t.d(r,"sub",function(){return z;});var e=t(2);function n(){var y=new e.ARRAY_TYPE(16);return e.ARRAY_TYPE!=Float32Array&&(y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[11]=0,y[12]=0,y[13]=0,y[14]=0),y[0]=1,y[5]=1,y[10]=1,y[15]=1,y;}function i(y){var P=new e.ARRAY_TYPE(16);return P[0]=y[0],P[1]=y[1],P[2]=y[2],P[3]=y[3],P[4]=y[4],P[5]=y[5],P[6]=y[6],P[7]=y[7],P[8]=y[8],P[9]=y[9],P[10]=y[10],P[11]=y[11],P[12]=y[12],P[13]=y[13],P[14]=y[14],P[15]=y[15],P;}function a(y,P){return y[0]=P[0],y[1]=P[1],y[2]=P[2],y[3]=P[3],y[4]=P[4],y[5]=P[5],y[6]=P[6],y[7]=P[7],y[8]=P[8],y[9]=P[9],y[10]=P[10],y[11]=P[11],y[12]=P[12],y[13]=P[13],y[14]=P[14],y[15]=P[15],y;}function o(y,P,w,U,H,Y,k,rt,it,lt,ut,at,st,ft,vt,mt){var pt=new e.ARRAY_TYPE(16);return pt[0]=y,pt[1]=P,pt[2]=w,pt[3]=U,pt[4]=H,pt[5]=Y,pt[6]=k,pt[7]=rt,pt[8]=it,pt[9]=lt,pt[10]=ut,pt[11]=at,pt[12]=st,pt[13]=ft,pt[14]=vt,pt[15]=mt,pt;}function s(y,P,w,U,H,Y,k,rt,it,lt,ut,at,st,ft,vt,mt,pt){return y[0]=P,y[1]=w,y[2]=U,y[3]=H,y[4]=Y,y[5]=k,y[6]=rt,y[7]=it,y[8]=lt,y[9]=ut,y[10]=at,y[11]=st,y[12]=ft,y[13]=vt,y[14]=mt,y[15]=pt,y;}function f(y){return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y;}function p(y,P){if(y===P){var w=P[1],U=P[2],H=P[3],Y=P[6],k=P[7],rt=P[11];y[1]=P[4],y[2]=P[8],y[3]=P[12],y[4]=w,y[6]=P[9],y[7]=P[13],y[8]=U,y[9]=Y,y[11]=P[14],y[12]=H,y[13]=k,y[14]=rt;}else y[0]=P[0],y[1]=P[4],y[2]=P[8],y[3]=P[12],y[4]=P[1],y[5]=P[5],y[6]=P[9],y[7]=P[13],y[8]=P[2],y[9]=P[6],y[10]=P[10],y[11]=P[14],y[12]=P[3],y[13]=P[7],y[14]=P[11],y[15]=P[15];return y;}function c(y,P){var w=P[0],U=P[1],H=P[2],Y=P[3],k=P[4],rt=P[5],it=P[6],lt=P[7],ut=P[8],at=P[9],st=P[10],ft=P[11],vt=P[12],mt=P[13],pt=P[14],St=P[15],It=w*rt-U*k,Et=w*it-H*k,Pt=w*lt-Y*k,At=U*it-H*rt,Ct=U*lt-Y*rt,Gt=H*lt-Y*it,jt=ut*mt-at*vt,Ut=ut*pt-st*vt,zt=ut*St-ft*vt,Ht=at*pt-st*mt,Kt=at*St-ft*mt,Yt=st*St-ft*pt,bt=It*Yt-Et*Kt+Pt*Ht+At*zt-Ct*Ut+Gt*jt;return bt?(bt=1/bt,y[0]=(rt*Yt-it*Kt+lt*Ht)*bt,y[1]=(H*Kt-U*Yt-Y*Ht)*bt,y[2]=(mt*Gt-pt*Ct+St*At)*bt,y[3]=(st*Ct-at*Gt-ft*At)*bt,y[4]=(it*zt-k*Yt-lt*Ut)*bt,y[5]=(w*Yt-H*zt+Y*Ut)*bt,y[6]=(pt*Pt-vt*Gt-St*Et)*bt,y[7]=(ut*Gt-st*Pt+ft*Et)*bt,y[8]=(k*Kt-rt*zt+lt*jt)*bt,y[9]=(U*zt-w*Kt-Y*jt)*bt,y[10]=(vt*Ct-mt*Pt+St*It)*bt,y[11]=(at*Pt-ut*Ct-ft*It)*bt,y[12]=(rt*Ut-k*Ht-it*jt)*bt,y[13]=(w*Ht-U*Ut+H*jt)*bt,y[14]=(mt*Et-vt*At-pt*It)*bt,y[15]=(ut*At-at*Et+st*It)*bt,y):null;}function v(y,P){var w=P[0],U=P[1],H=P[2],Y=P[3],k=P[4],rt=P[5],it=P[6],lt=P[7],ut=P[8],at=P[9],st=P[10],ft=P[11],vt=P[12],mt=P[13],pt=P[14],St=P[15];return y[0]=rt*(st*St-ft*pt)-at*(it*St-lt*pt)+mt*(it*ft-lt*st),y[1]=-(U*(st*St-ft*pt)-at*(H*St-Y*pt)+mt*(H*ft-Y*st)),y[2]=U*(it*St-lt*pt)-rt*(H*St-Y*pt)+mt*(H*lt-Y*it),y[3]=-(U*(it*ft-lt*st)-rt*(H*ft-Y*st)+at*(H*lt-Y*it)),y[4]=-(k*(st*St-ft*pt)-ut*(it*St-lt*pt)+vt*(it*ft-lt*st)),y[5]=w*(st*St-ft*pt)-ut*(H*St-Y*pt)+vt*(H*ft-Y*st),y[6]=-(w*(it*St-lt*pt)-k*(H*St-Y*pt)+vt*(H*lt-Y*it)),y[7]=w*(it*ft-lt*st)-k*(H*ft-Y*st)+ut*(H*lt-Y*it),y[8]=k*(at*St-ft*mt)-ut*(rt*St-lt*mt)+vt*(rt*ft-lt*at),y[9]=-(w*(at*St-ft*mt)-ut*(U*St-Y*mt)+vt*(U*ft-Y*at)),y[10]=w*(rt*St-lt*mt)-k*(U*St-Y*mt)+vt*(U*lt-Y*rt),y[11]=-(w*(rt*ft-lt*at)-k*(U*ft-Y*at)+ut*(U*lt-Y*rt)),y[12]=-(k*(at*pt-st*mt)-ut*(rt*pt-it*mt)+vt*(rt*st-it*at)),y[13]=w*(at*pt-st*mt)-ut*(U*pt-H*mt)+vt*(U*st-H*at),y[14]=-(w*(rt*pt-it*mt)-k*(U*pt-H*mt)+vt*(U*it-H*rt)),y[15]=w*(rt*st-it*at)-k*(U*st-H*at)+ut*(U*it-H*rt),y;}function S(y){var P=y[0],w=y[1],U=y[2],H=y[3],Y=y[4],k=y[5],rt=y[6],it=y[7],lt=y[8],ut=y[9],at=y[10],st=y[11],ft=y[12],vt=y[13],mt=y[14],pt=y[15],St=P*k-w*Y,It=P*rt-U*Y,Et=P*it-H*Y,Pt=w*rt-U*k,At=w*it-H*k,Ct=U*it-H*rt,Gt=lt*vt-ut*ft,jt=lt*mt-at*ft,Ut=lt*pt-st*ft,zt=ut*mt-at*vt,Ht=ut*pt-st*vt,Kt=at*pt-st*mt;return St*Kt-It*Ht+Et*zt+Pt*Ut-At*jt+Ct*Gt;}function O(y,P,w){var U=P[0],H=P[1],Y=P[2],k=P[3],rt=P[4],it=P[5],lt=P[6],ut=P[7],at=P[8],st=P[9],ft=P[10],vt=P[11],mt=P[12],pt=P[13],St=P[14],It=P[15],Et=w[0],Pt=w[1],At=w[2],Ct=w[3];return y[0]=Et*U+Pt*rt+At*at+Ct*mt,y[1]=Et*H+Pt*it+At*st+Ct*pt,y[2]=Et*Y+Pt*lt+At*ft+Ct*St,y[3]=Et*k+Pt*ut+At*vt+Ct*It,Et=w[4],Pt=w[5],At=w[6],Ct=w[7],y[4]=Et*U+Pt*rt+At*at+Ct*mt,y[5]=Et*H+Pt*it+At*st+Ct*pt,y[6]=Et*Y+Pt*lt+At*ft+Ct*St,y[7]=Et*k+Pt*ut+At*vt+Ct*It,Et=w[8],Pt=w[9],At=w[10],Ct=w[11],y[8]=Et*U+Pt*rt+At*at+Ct*mt,y[9]=Et*H+Pt*it+At*st+Ct*pt,y[10]=Et*Y+Pt*lt+At*ft+Ct*St,y[11]=Et*k+Pt*ut+At*vt+Ct*It,Et=w[12],Pt=w[13],At=w[14],Ct=w[15],y[12]=Et*U+Pt*rt+At*at+Ct*mt,y[13]=Et*H+Pt*it+At*st+Ct*pt,y[14]=Et*Y+Pt*lt+At*ft+Ct*St,y[15]=Et*k+Pt*ut+At*vt+Ct*It,y;}function x(y,P,w){var U=w[0],H=w[1],Y=w[2],k,rt,it,lt,ut,at,st,ft,vt,mt,pt,St;return P===y?(y[12]=P[0]*U+P[4]*H+P[8]*Y+P[12],y[13]=P[1]*U+P[5]*H+P[9]*Y+P[13],y[14]=P[2]*U+P[6]*H+P[10]*Y+P[14],y[15]=P[3]*U+P[7]*H+P[11]*Y+P[15]):(k=P[0],rt=P[1],it=P[2],lt=P[3],ut=P[4],at=P[5],st=P[6],ft=P[7],vt=P[8],mt=P[9],pt=P[10],St=P[11],y[0]=k,y[1]=rt,y[2]=it,y[3]=lt,y[4]=ut,y[5]=at,y[6]=st,y[7]=ft,y[8]=vt,y[9]=mt,y[10]=pt,y[11]=St,y[12]=k*U+ut*H+vt*Y+P[12],y[13]=rt*U+at*H+mt*Y+P[13],y[14]=it*U+st*H+pt*Y+P[14],y[15]=lt*U+ft*H+St*Y+P[15]),y;}function m(y,P,w){var U=w[0],H=w[1],Y=w[2];return y[0]=P[0]*U,y[1]=P[1]*U,y[2]=P[2]*U,y[3]=P[3]*U,y[4]=P[4]*H,y[5]=P[5]*H,y[6]=P[6]*H,y[7]=P[7]*H,y[8]=P[8]*Y,y[9]=P[9]*Y,y[10]=P[10]*Y,y[11]=P[11]*Y,y[12]=P[12],y[13]=P[13],y[14]=P[14],y[15]=P[15],y;}function T(y,P,w,U){var H=U[0],Y=U[1],k=U[2],rt=Math.hypot(H,Y,k),it,lt,ut,at,st,ft,vt,mt,pt,St,It,Et,Pt,At,Ct,Gt,jt,Ut,zt,Ht,Kt,Yt,bt,Qt;return rt<e.EPSILON?null:(rt=1/rt,H*=rt,Y*=rt,k*=rt,it=Math.sin(w),lt=Math.cos(w),ut=1-lt,at=P[0],st=P[1],ft=P[2],vt=P[3],mt=P[4],pt=P[5],St=P[6],It=P[7],Et=P[8],Pt=P[9],At=P[10],Ct=P[11],Gt=H*H*ut+lt,jt=Y*H*ut+k*it,Ut=k*H*ut-Y*it,zt=H*Y*ut-k*it,Ht=Y*Y*ut+lt,Kt=k*Y*ut+H*it,Yt=H*k*ut+Y*it,bt=Y*k*ut-H*it,Qt=k*k*ut+lt,y[0]=at*Gt+mt*jt+Et*Ut,y[1]=st*Gt+pt*jt+Pt*Ut,y[2]=ft*Gt+St*jt+At*Ut,y[3]=vt*Gt+It*jt+Ct*Ut,y[4]=at*zt+mt*Ht+Et*Kt,y[5]=st*zt+pt*Ht+Pt*Kt,y[6]=ft*zt+St*Ht+At*Kt,y[7]=vt*zt+It*Ht+Ct*Kt,y[8]=at*Yt+mt*bt+Et*Qt,y[9]=st*Yt+pt*bt+Pt*Qt,y[10]=ft*Yt+St*bt+At*Qt,y[11]=vt*Yt+It*bt+Ct*Qt,P!==y&&(y[12]=P[12],y[13]=P[13],y[14]=P[14],y[15]=P[15]),y);}function l(y,P,w){var U=Math.sin(w),H=Math.cos(w),Y=P[4],k=P[5],rt=P[6],it=P[7],lt=P[8],ut=P[9],at=P[10],st=P[11];return P!==y&&(y[0]=P[0],y[1]=P[1],y[2]=P[2],y[3]=P[3],y[12]=P[12],y[13]=P[13],y[14]=P[14],y[15]=P[15]),y[4]=Y*H+lt*U,y[5]=k*H+ut*U,y[6]=rt*H+at*U,y[7]=it*H+st*U,y[8]=lt*H-Y*U,y[9]=ut*H-k*U,y[10]=at*H-rt*U,y[11]=st*H-it*U,y;}function d(y,P,w){var U=Math.sin(w),H=Math.cos(w),Y=P[0],k=P[1],rt=P[2],it=P[3],lt=P[8],ut=P[9],at=P[10],st=P[11];return P!==y&&(y[4]=P[4],y[5]=P[5],y[6]=P[6],y[7]=P[7],y[12]=P[12],y[13]=P[13],y[14]=P[14],y[15]=P[15]),y[0]=Y*H-lt*U,y[1]=k*H-ut*U,y[2]=rt*H-at*U,y[3]=it*H-st*U,y[8]=Y*U+lt*H,y[9]=k*U+ut*H,y[10]=rt*U+at*H,y[11]=it*U+st*H,y;}function u(y,P,w){var U=Math.sin(w),H=Math.cos(w),Y=P[0],k=P[1],rt=P[2],it=P[3],lt=P[4],ut=P[5],at=P[6],st=P[7];return P!==y&&(y[8]=P[8],y[9]=P[9],y[10]=P[10],y[11]=P[11],y[12]=P[12],y[13]=P[13],y[14]=P[14],y[15]=P[15]),y[0]=Y*H+lt*U,y[1]=k*H+ut*U,y[2]=rt*H+at*U,y[3]=it*H+st*U,y[4]=lt*H-Y*U,y[5]=ut*H-k*U,y[6]=at*H-rt*U,y[7]=st*H-it*U,y;}function g(y,P){return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=P[0],y[13]=P[1],y[14]=P[2],y[15]=1,y;}function M(y,P){return y[0]=P[0],y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=P[1],y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=P[2],y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y;}function A(y,P,w){var U=w[0],H=w[1],Y=w[2],k=Math.hypot(U,H,Y),rt,it,lt;return k<e.EPSILON?null:(k=1/k,U*=k,H*=k,Y*=k,rt=Math.sin(P),it=Math.cos(P),lt=1-it,y[0]=U*U*lt+it,y[1]=H*U*lt+Y*rt,y[2]=Y*U*lt-H*rt,y[3]=0,y[4]=U*H*lt-Y*rt,y[5]=H*H*lt+it,y[6]=Y*H*lt+U*rt,y[7]=0,y[8]=U*Y*lt+H*rt,y[9]=H*Y*lt-U*rt,y[10]=Y*Y*lt+it,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y);}function R(y,P){var w=Math.sin(P),U=Math.cos(P);return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=U,y[6]=w,y[7]=0,y[8]=0,y[9]=-w,y[10]=U,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y;}function b(y,P){var w=Math.sin(P),U=Math.cos(P);return y[0]=U,y[1]=0,y[2]=-w,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=w,y[9]=0,y[10]=U,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y;}function E(y,P){var w=Math.sin(P),U=Math.cos(P);return y[0]=U,y[1]=w,y[2]=0,y[3]=0,y[4]=-w,y[5]=U,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y;}function L(y,P,w){var U=P[0],H=P[1],Y=P[2],k=P[3],rt=U+U,it=H+H,lt=Y+Y,ut=U*rt,at=U*it,st=U*lt,ft=H*it,vt=H*lt,mt=Y*lt,pt=k*rt,St=k*it,It=k*lt;return y[0]=1-(ft+mt),y[1]=at+It,y[2]=st-St,y[3]=0,y[4]=at-It,y[5]=1-(ut+mt),y[6]=vt+pt,y[7]=0,y[8]=st+St,y[9]=vt-pt,y[10]=1-(ut+ft),y[11]=0,y[12]=w[0],y[13]=w[1],y[14]=w[2],y[15]=1,y;}function D(y,P){var w=new e.ARRAY_TYPE(3),U=-P[0],H=-P[1],Y=-P[2],k=P[3],rt=P[4],it=P[5],lt=P[6],ut=P[7],at=U*U+H*H+Y*Y+k*k;return at>0?(w[0]=(rt*k+ut*U+it*Y-lt*H)*2/at,w[1]=(it*k+ut*H+lt*U-rt*Y)*2/at,w[2]=(lt*k+ut*Y+rt*H-it*U)*2/at):(w[0]=(rt*k+ut*U+it*Y-lt*H)*2,w[1]=(it*k+ut*H+lt*U-rt*Y)*2,w[2]=(lt*k+ut*Y+rt*H-it*U)*2),L(y,P,w),y;}function I(y,P){return y[0]=P[12],y[1]=P[13],y[2]=P[14],y;}function C(y,P){var w=P[0],U=P[1],H=P[2],Y=P[4],k=P[5],rt=P[6],it=P[8],lt=P[9],ut=P[10];return y[0]=Math.hypot(w,U,H),y[1]=Math.hypot(Y,k,rt),y[2]=Math.hypot(it,lt,ut),y;}function W(y,P){var w=new e.ARRAY_TYPE(3);C(w,P);var U=1/w[0],H=1/w[1],Y=1/w[2],k=P[0]*U,rt=P[1]*H,it=P[2]*Y,lt=P[4]*U,ut=P[5]*H,at=P[6]*Y,st=P[8]*U,ft=P[9]*H,vt=P[10]*Y,mt=k+ut+vt,pt=0;return mt>0?(pt=Math.sqrt(mt+1)*2,y[3]=0.25*pt,y[0]=(at-ft)/pt,y[1]=(st-it)/pt,y[2]=(rt-lt)/pt):k>ut&&k>vt?(pt=Math.sqrt(1+k-ut-vt)*2,y[3]=(at-ft)/pt,y[0]=0.25*pt,y[1]=(rt+lt)/pt,y[2]=(st+it)/pt):ut>vt?(pt=Math.sqrt(1+ut-k-vt)*2,y[3]=(st-it)/pt,y[0]=(rt+lt)/pt,y[1]=0.25*pt,y[2]=(at+ft)/pt):(pt=Math.sqrt(1+vt-k-ut)*2,y[3]=(rt-lt)/pt,y[0]=(st+it)/pt,y[1]=(at+ft)/pt,y[2]=0.25*pt),y;}function G(y,P,w,U){var H=P[0],Y=P[1],k=P[2],rt=P[3],it=H+H,lt=Y+Y,ut=k+k,at=H*it,st=H*lt,ft=H*ut,vt=Y*lt,mt=Y*ut,pt=k*ut,St=rt*it,It=rt*lt,Et=rt*ut,Pt=U[0],At=U[1],Ct=U[2];return y[0]=(1-(vt+pt))*Pt,y[1]=(st+Et)*Pt,y[2]=(ft-It)*Pt,y[3]=0,y[4]=(st-Et)*At,y[5]=(1-(at+pt))*At,y[6]=(mt+St)*At,y[7]=0,y[8]=(ft+It)*Ct,y[9]=(mt-St)*Ct,y[10]=(1-(at+vt))*Ct,y[11]=0,y[12]=w[0],y[13]=w[1],y[14]=w[2],y[15]=1,y;}function K(y,P,w,U,H){var Y=P[0],k=P[1],rt=P[2],it=P[3],lt=Y+Y,ut=k+k,at=rt+rt,st=Y*lt,ft=Y*ut,vt=Y*at,mt=k*ut,pt=k*at,St=rt*at,It=it*lt,Et=it*ut,Pt=it*at,At=U[0],Ct=U[1],Gt=U[2],jt=H[0],Ut=H[1],zt=H[2],Ht=(1-(mt+St))*At,Kt=(ft+Pt)*At,Yt=(vt-Et)*At,bt=(ft-Pt)*Ct,Qt=(1-(st+St))*Ct,Ee=(pt+It)*Ct,Pe=(vt+Et)*Gt,Tr=(pt-It)*Gt,Mr=(1-(st+mt))*Gt;return y[0]=Ht,y[1]=Kt,y[2]=Yt,y[3]=0,y[4]=bt,y[5]=Qt,y[6]=Ee,y[7]=0,y[8]=Pe,y[9]=Tr,y[10]=Mr,y[11]=0,y[12]=w[0]+jt-(Ht*jt+bt*Ut+Pe*zt),y[13]=w[1]+Ut-(Kt*jt+Qt*Ut+Tr*zt),y[14]=w[2]+zt-(Yt*jt+Ee*Ut+Mr*zt),y[15]=1,y;}function J(y,P){var w=P[0],U=P[1],H=P[2],Y=P[3],k=w+w,rt=U+U,it=H+H,lt=w*k,ut=U*k,at=U*rt,st=H*k,ft=H*rt,vt=H*it,mt=Y*k,pt=Y*rt,St=Y*it;return y[0]=1-at-vt,y[1]=ut+St,y[2]=st-pt,y[3]=0,y[4]=ut-St,y[5]=1-lt-vt,y[6]=ft+mt,y[7]=0,y[8]=st+pt,y[9]=ft-mt,y[10]=1-lt-at,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y;}function Z(y,P,w,U,H,Y,k){var rt=1/(w-P),it=1/(H-U),lt=1/(Y-k);return y[0]=Y*2*rt,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=Y*2*it,y[6]=0,y[7]=0,y[8]=(w+P)*rt,y[9]=(H+U)*it,y[10]=(k+Y)*lt,y[11]=-1,y[12]=0,y[13]=0,y[14]=k*Y*2*lt,y[15]=0,y;}function B(y,P,w,U,H){var Y=1/Math.tan(P/2),k;return y[0]=Y/w,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=Y,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[11]=-1,y[12]=0,y[13]=0,y[15]=0,H!=null&&H!==1/0?(k=1/(U-H),y[10]=(H+U)*k,y[14]=2*H*U*k):(y[10]=-1,y[14]=-2*U),y;}function $(y,P,w,U){var H=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/(H+Y);return y[0]=it,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=lt,y[6]=0,y[7]=0,y[8]=-((k-rt)*it*0.5),y[9]=(H-Y)*lt*0.5,y[10]=U/(w-U),y[11]=-1,y[12]=0,y[13]=0,y[14]=U*w/(w-U),y[15]=0,y;}function Q(y,P,w,U,H,Y,k){var rt=1/(P-w),it=1/(U-H),lt=1/(Y-k);return y[0]=-2*rt,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=-2*it,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=2*lt,y[11]=0,y[12]=(P+w)*rt,y[13]=(H+U)*it,y[14]=(k+Y)*lt,y[15]=1,y;}function et(y,P,w,U){var H,Y,k,rt,it,lt,ut,at,st,ft,vt=P[0],mt=P[1],pt=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(pt-Ct)<e.EPSILON?f(y):(ut=vt-Pt,at=mt-At,st=pt-Ct,ft=1/Math.hypot(ut,at,st),ut*=ft,at*=ft,st*=ft,H=It*st-Et*at,Y=Et*ut-St*st,k=St*at-It*ut,ft=Math.hypot(H,Y,k),ft?(ft=1/ft,H*=ft,Y*=ft,k*=ft):(H=0,Y=0,k=0),rt=at*k-st*Y,it=st*H-ut*k,lt=ut*Y-at*H,ft=Math.hypot(rt,it,lt),ft?(ft=1/ft,rt*=ft,it*=ft,lt*=ft):(rt=0,it=0,lt=0),y[0]=H,y[1]=rt,y[2]=ut,y[3]=0,y[4]=Y,y[5]=it,y[6]=at,y[7]=0,y[8]=k,y[9]=lt,y[10]=st,y[11]=0,y[12]=-(H*vt+Y*mt+k*pt),y[13]=-(rt*vt+it*mt+lt*pt),y[14]=-(ut*vt+at*mt+st*pt),y[15]=1,y);}function tt(y,P,w,U){var H=P[0],Y=P[1],k=P[2],rt=U[0],it=U[1],lt=U[2],ut=H-w[0],at=Y-w[1],st=k-w[2],ft=ut*ut+at*at+st*st;ft>0&&(ft=1/Math.sqrt(ft),ut*=ft,at*=ft,st*=ft);var vt=it*st-lt*at,mt=lt*ut-rt*st,pt=rt*at-it*ut;return ft=vt*vt+mt*mt+pt*pt,ft>0&&(ft=1/Math.sqrt(ft),vt*=ft,mt*=ft,pt*=ft),y[0]=vt,y[1]=mt,y[2]=pt,y[3]=0,y[4]=at*pt-st*mt,y[5]=st*vt-ut*pt,y[6]=ut*mt-at*vt,y[7]=0,y[8]=ut,y[9]=at,y[10]=st,y[11]=0,y[12]=H,y[13]=Y,y[14]=k,y[15]=1,y;}function ot(y){return"mat4("+y[0]+", "+y[1]+", "+y[2]+", "+y[3]+", "+y[4]+", "+y[5]+", "+y[6]+", "+y[7]+", "+y[8]+", "+y[9]+", "+y[10]+", "+y[11]+", "+y[12]+", "+y[13]+", "+y[14]+", "+y[15]+")";}function q(y){return Math.hypot(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]);}function gt(y,P,w){return y[0]=P[0]+w[0],y[1]=P[1]+w[1],y[2]=P[2]+w[2],y[3]=P[3]+w[3],y[4]=P[4]+w[4],y[5]=P[5]+w[5],y[6]=P[6]+w[6],y[7]=P[7]+w[7],y[8]=P[8]+w[8],y[9]=P[9]+w[9],y[10]=P[10]+w[10],y[11]=P[11]+w[11],y[12]=P[12]+w[12],y[13]=P[13]+w[13],y[14]=P[14]+w[14],y[15]=P[15]+w[15],y;}function dt(y,P,w){return y[0]=P[0]-w[0],y[1]=P[1]-w[1],y[2]=P[2]-w[2],y[3]=P[3]-w[3],y[4]=P[4]-w[4],y[5]=P[5]-w[5],y[6]=P[6]-w[6],y[7]=P[7]-w[7],y[8]=P[8]-w[8],y[9]=P[9]-w[9],y[10]=P[10]-w[10],y[11]=P[11]-w[11],y[12]=P[12]-w[12],y[13]=P[13]-w[13],y[14]=P[14]-w[14],y[15]=P[15]-w[15],y;}function F(y,P,w){return y[0]=P[0]*w,y[1]=P[1]*w,y[2]=P[2]*w,y[3]=P[3]*w,y[4]=P[4]*w,y[5]=P[5]*w,y[6]=P[6]*w,y[7]=P[7]*w,y[8]=P[8]*w,y[9]=P[9]*w,y[10]=P[10]*w,y[11]=P[11]*w,y[12]=P[12]*w,y[13]=P[13]*w,y[14]=P[14]*w,y[15]=P[15]*w,y;}function j(y,P,w,U){return y[0]=P[0]+w[0]*U,y[1]=P[1]+w[1]*U,y[2]=P[2]+w[2]*U,y[3]=P[3]+w[3]*U,y[4]=P[4]+w[4]*U,y[5]=P[5]+w[5]*U,y[6]=P[6]+w[6]*U,y[7]=P[7]+w[7]*U,y[8]=P[8]+w[8]*U,y[9]=P[9]+w[9]*U,y[10]=P[10]+w[10]*U,y[11]=P[11]+w[11]*U,y[12]=P[12]+w[12]*U,y[13]=P[13]+w[13]*U,y[14]=P[14]+w[14]*U,y[15]=P[15]+w[15]*U,y;}function V(y,P){return y[0]===P[0]&&y[1]===P[1]&&y[2]===P[2]&&y[3]===P[3]&&y[4]===P[4]&&y[5]===P[5]&&y[6]===P[6]&&y[7]===P[7]&&y[8]===P[8]&&y[9]===P[9]&&y[10]===P[10]&&y[11]===P[11]&&y[12]===P[12]&&y[13]===P[13]&&y[14]===P[14]&&y[15]===P[15];}function X(y,P){var w=y[0],U=y[1],H=y[2],Y=y[3],k=y[4],rt=y[5],it=y[6],lt=y[7],ut=y[8],at=y[9],st=y[10],ft=y[11],vt=y[12],mt=y[13],pt=y[14],St=y[15],It=P[0],Et=P[1],Pt=P[2],At=P[3],Ct=P[4],Gt=P[5],jt=P[6],Ut=P[7],zt=P[8],Ht=P[9],Kt=P[10],Yt=P[11],bt=P[12],Qt=P[13],Ee=P[14],Pe=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(H-Pt)<=e.EPSILON*Math.max(1,Math.abs(H),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-jt)<=e.EPSILON*Math.max(1,Math.abs(it),Math.abs(jt))&&Math.abs(lt-Ut)<=e.EPSILON*Math.max(1,Math.abs(lt),Math.abs(Ut))&&Math.abs(ut-zt)<=e.EPSILON*Math.max(1,Math.abs(ut),Math.abs(zt))&&Math.abs(at-Ht)<=e.EPSILON*Math.max(1,Math.abs(at),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-Qt)<=e.EPSILON*Math.max(1,Math.abs(mt),Math.abs(Qt))&&Math.abs(pt-Ee)<=e.EPSILON*Math.max(1,Math.abs(pt),Math.abs(Ee))&&Math.abs(St-Pe)<=e.EPSILON*Math.max(1,Math.abs(St),Math.abs(Pe));}var N=O,z=dt;},/* 7 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return o;}),t.d(r,"identity",function(){return s;}),t.d(r,"setAxisAngle",function(){return f;}),t.d(r,"getAxisAngle",function(){return p;}),t.d(r,"getAngle",function(){return c;}),t.d(r,"multiply",function(){return v;}),t.d(r,"rotateX",function(){return S;}),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 l;}),t.d(r,"pow",function(){return d;}),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 R;}),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 I;}),t.d(r,"set",function(){return C;}),t.d(r,"add",function(){return W;}),t.d(r,"mul",function(){return G;}),t.d(r,"scale",function(){return K;}),t.d(r,"dot",function(){return J;}),t.d(r,"lerp",function(){return Z;}),t.d(r,"length",function(){return B;}),t.d(r,"len",function(){return $;}),t.d(r,"squaredLength",function(){return Q;}),t.d(r,"sqrLen",function(){return et;}),t.d(r,"normalize",function(){return tt;}),t.d(r,"exactEquals",function(){return ot;}),t.d(r,"equals",function(){return q;}),t.d(r,"rotationTo",function(){return gt;}),t.d(r,"sqlerp",function(){return dt;}),t.d(r,"setAxes",function(){return F;});var e=t(2),n=t(5),i=t(8),a=t(9);function o(){var j=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(j[0]=0,j[1]=0,j[2]=0),j[3]=1,j;}function s(j){return j[0]=0,j[1]=0,j[2]=0,j[3]=1,j;}function f(j,V,X){X=X*0.5;var N=Math.sin(X);return j[0]=N*V[0],j[1]=N*V[1],j[2]=N*V[2],j[3]=Math.cos(X),j;}function p(j,V){var X=Math.acos(V[3])*2,N=Math.sin(X/2);return N>e.EPSILON?(j[0]=V[0]/N,j[1]=V[1]/N,j[2]=V[2]/N):(j[0]=1,j[1]=0,j[2]=0),X;}function c(j,V){var X=J(j,V);return Math.acos(2*X*X-1);}function v(j,V,X){var N=V[0],z=V[1],y=V[2],P=V[3],w=X[0],U=X[1],H=X[2],Y=X[3];return j[0]=N*Y+P*w+z*H-y*U,j[1]=z*Y+P*U+y*w-N*H,j[2]=y*Y+P*H+N*U-z*w,j[3]=P*Y-N*w-z*U-y*H,j;}function S(j,V,X){X*=0.5;var N=V[0],z=V[1],y=V[2],P=V[3],w=Math.sin(X),U=Math.cos(X);return j[0]=N*U+P*w,j[1]=z*U+y*w,j[2]=y*U-z*w,j[3]=P*U-N*w,j;}function O(j,V,X){X*=0.5;var N=V[0],z=V[1],y=V[2],P=V[3],w=Math.sin(X),U=Math.cos(X);return j[0]=N*U-y*w,j[1]=z*U+P*w,j[2]=y*U+N*w,j[3]=P*U-z*w,j;}function x(j,V,X){X*=0.5;var N=V[0],z=V[1],y=V[2],P=V[3],w=Math.sin(X),U=Math.cos(X);return j[0]=N*U+z*w,j[1]=z*U-N*w,j[2]=y*U+P*w,j[3]=P*U-y*w,j;}function m(j,V){var X=V[0],N=V[1],z=V[2];return j[0]=X,j[1]=N,j[2]=z,j[3]=Math.sqrt(Math.abs(1-X*X-N*N-z*z)),j;}function T(j,V){var X=V[0],N=V[1],z=V[2],y=V[3],P=Math.sqrt(X*X+N*N+z*z),w=Math.exp(y),U=P>0?w*Math.sin(P)/P:0;return j[0]=X*U,j[1]=N*U,j[2]=z*U,j[3]=w*Math.cos(P),j;}function l(j,V){var X=V[0],N=V[1],z=V[2],y=V[3],P=Math.sqrt(X*X+N*N+z*z),w=P>0?Math.atan2(P,y)/P:0;return j[0]=X*w,j[1]=N*w,j[2]=z*w,j[3]=0.5*Math.log(X*X+N*N+z*z+y*y),j;}function d(j,V,X){return l(j,V),K(j,j,X),T(j,j),j;}function u(j,V,X,N){var z=V[0],y=V[1],P=V[2],w=V[3],U=X[0],H=X[1],Y=X[2],k=X[3],rt,it,lt,ut,at;return it=z*U+y*H+P*Y+w*k,it<0&&(it=-it,U=-U,H=-H,Y=-Y,k=-k),1-it>e.EPSILON?(rt=Math.acos(it),lt=Math.sin(rt),ut=Math.sin((1-N)*rt)/lt,at=Math.sin(N*rt)/lt):(ut=1-N,at=N),j[0]=ut*z+at*U,j[1]=ut*y+at*H,j[2]=ut*P+at*Y,j[3]=ut*w+at*k,j;}function g(j){var V=e.RANDOM(),X=e.RANDOM(),N=e.RANDOM(),z=Math.sqrt(1-V),y=Math.sqrt(V);return j[0]=z*Math.sin(2*Math.PI*X),j[1]=z*Math.cos(2*Math.PI*X),j[2]=y*Math.sin(2*Math.PI*N),j[3]=y*Math.cos(2*Math.PI*N),j;}function M(j,V){var X=V[0],N=V[1],z=V[2],y=V[3],P=X*X+N*N+z*z+y*y,w=P?1/P:0;return j[0]=-X*w,j[1]=-N*w,j[2]=-z*w,j[3]=y*w,j;}function A(j,V){return j[0]=-V[0],j[1]=-V[1],j[2]=-V[2],j[3]=V[3],j;}function R(j,V){var X=V[0]+V[4]+V[8],N;if(X>0)N=Math.sqrt(X+1),j[3]=0.5*N,N=0.5/N,j[0]=(V[5]-V[7])*N,j[1]=(V[6]-V[2])*N,j[2]=(V[1]-V[3])*N;else{var z=0;V[4]>V[0]&&(z=1),V[8]>V[z*3+z]&&(z=2);var y=(z+1)%3,P=(z+2)%3;N=Math.sqrt(V[z*3+z]-V[y*3+y]-V[P*3+P]+1),j[z]=0.5*N,N=0.5/N,j[3]=(V[y*3+P]-V[P*3+y])*N,j[y]=(V[y*3+z]+V[z*3+y])*N,j[P]=(V[P*3+z]+V[z*3+P])*N;}return j;}function b(j,V,X,N){var z=0.5*Math.PI/180;V*=z,X*=z,N*=z;var y=Math.sin(V),P=Math.cos(V),w=Math.sin(X),U=Math.cos(X),H=Math.sin(N),Y=Math.cos(N);return j[0]=y*U*Y-P*w*H,j[1]=P*w*Y+y*U*H,j[2]=P*U*H-y*w*Y,j[3]=P*U*Y+y*w*H,j;}function E(j){return"quat("+j[0]+", "+j[1]+", "+j[2]+", "+j[3]+")";}var L=a.clone,D=a.fromValues,I=a.copy,C=a.set,W=a.add,G=v,K=a.scale,J=a.dot,Z=a.lerp,B=a.length,$=B,Q=a.squaredLength,et=Q,tt=a.normalize,ot=a.exactEquals,q=a.equals,gt=function(){var j=i.create(),V=i.fromValues(1,0,0),X=i.fromValues(0,1,0);return function(N,z,y){var P=i.dot(z,y);return P<-0.999999?(i.cross(j,V,z),i.len(j)<1e-6&&i.cross(j,X,z),i.normalize(j,j),f(N,j,Math.PI),N):P>0.999999?(N[0]=0,N[1]=0,N[2]=0,N[3]=1,N):(i.cross(j,z,y),N[0]=j[0],N[1]=j[1],N[2]=j[2],N[3]=1+P,tt(N,N));};}(),dt=function(){var j=o(),V=o();return function(X,N,z,y,P,w){return u(j,N,P,w),u(V,z,y,w),u(X,j,V,2*w*(1-w)),X;};}(),F=function(){var j=n.create();return function(V,X,N,z){return j[0]=N[0],j[3]=N[1],j[6]=N[2],j[1]=z[0],j[4]=z[1],j[7]=z[2],j[2]=-X[0],j[5]=-X[1],j[8]=-X[2],tt(V,R(V,j));};}();},/* 8 */ /***/function(h,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 o;}),t.d(r,"copy",function(){return s;}),t.d(r,"set",function(){return f;}),t.d(r,"add",function(){return p;}),t.d(r,"subtract",function(){return c;}),t.d(r,"multiply",function(){return v;}),t.d(r,"divide",function(){return S;}),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 l;}),t.d(r,"scale",function(){return d;}),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 R;}),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 I;}),t.d(r,"hermite",function(){return C;}),t.d(r,"bezier",function(){return W;}),t.d(r,"random",function(){return G;}),t.d(r,"transformMat4",function(){return K;}),t.d(r,"transformMat3",function(){return J;}),t.d(r,"transformQuat",function(){return Z;}),t.d(r,"rotateX",function(){return B;}),t.d(r,"rotateY",function(){return $;}),t.d(r,"rotateZ",function(){return Q;}),t.d(r,"angle",function(){return et;}),t.d(r,"zero",function(){return tt;}),t.d(r,"str",function(){return ot;}),t.d(r,"exactEquals",function(){return q;}),t.d(r,"equals",function(){return gt;}),t.d(r,"sub",function(){return dt;}),t.d(r,"mul",function(){return F;}),t.d(r,"div",function(){return j;}),t.d(r,"dist",function(){return V;}),t.d(r,"sqrDist",function(){return X;}),t.d(r,"len",function(){return N;}),t.d(r,"sqrLen",function(){return z;}),t.d(r,"forEach",function(){return y;});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],H=P[2];return Math.hypot(w,U,H);}function o(P,w,U){var H=new e.ARRAY_TYPE(3);return H[0]=P,H[1]=w,H[2]=U,H;}function s(P,w){return P[0]=w[0],P[1]=w[1],P[2]=w[2],P;}function f(P,w,U,H){return P[0]=w,P[1]=U,P[2]=H,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 c(P,w,U){return P[0]=w[0]-U[0],P[1]=w[1]-U[1],P[2]=w[2]-U[2],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 S(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 l(P,w){return P[0]=Math.round(w[0]),P[1]=Math.round(w[1]),P[2]=Math.round(w[2]),P;}function d(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,H){return P[0]=w[0]+U[0]*H,P[1]=w[1]+U[1]*H,P[2]=w[2]+U[2]*H,P;}function g(P,w){var U=w[0]-P[0],H=w[1]-P[1],Y=w[2]-P[2];return Math.hypot(U,H,Y);}function M(P,w){var U=w[0]-P[0],H=w[1]-P[1],Y=w[2]-P[2];return U*U+H*H+Y*Y;}function A(P){var w=P[0],U=P[1],H=P[2];return w*w+U*U+H*H;}function R(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],H=w[1],Y=w[2],k=U*U+H*H+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 H=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-H*lt,P[2]=H*it-Y*rt,P;}function I(P,w,U,H){var Y=w[0],k=w[1],rt=w[2];return P[0]=Y+H*(U[0]-Y),P[1]=k+H*(U[1]-k),P[2]=rt+H*(U[2]-rt),P;}function C(P,w,U,H,Y,k){var rt=k*k,it=rt*(2*k-3)+1,lt=rt*(k-2)+k,ut=rt*(k-1),at=rt*(3-2*k);return P[0]=w[0]*it+U[0]*lt+H[0]*ut+Y[0]*at,P[1]=w[1]*it+U[1]*lt+H[1]*ut+Y[1]*at,P[2]=w[2]*it+U[2]*lt+H[2]*ut+Y[2]*at,P;}function W(P,w,U,H,Y,k){var rt=1-k,it=rt*rt,lt=k*k,ut=it*rt,at=3*k*it,st=3*lt*rt,ft=lt*k;return P[0]=w[0]*ut+U[0]*at+H[0]*st+Y[0]*ft,P[1]=w[1]*ut+U[1]*at+H[1]*st+Y[1]*ft,P[2]=w[2]*ut+U[2]*at+H[2]*st+Y[2]*ft,P;}function G(P,w){w=w||1;var U=e.RANDOM()*2*Math.PI,H=e.RANDOM()*2-1,Y=Math.sqrt(1-H*H)*w;return P[0]=Math.cos(U)*Y,P[1]=Math.sin(U)*Y,P[2]=H*w,P;}function K(P,w,U){var H=w[0],Y=w[1],k=w[2],rt=U[3]*H+U[7]*Y+U[11]*k+U[15];return rt=rt||1,P[0]=(U[0]*H+U[4]*Y+U[8]*k+U[12])/rt,P[1]=(U[1]*H+U[5]*Y+U[9]*k+U[13])/rt,P[2]=(U[2]*H+U[6]*Y+U[10]*k+U[14])/rt,P;}function J(P,w,U){var H=w[0],Y=w[1],k=w[2];return P[0]=H*U[0]+Y*U[3]+k*U[6],P[1]=H*U[1]+Y*U[4]+k*U[7],P[2]=H*U[2]+Y*U[5]+k*U[8],P;}function Z(P,w,U){var H=U[0],Y=U[1],k=U[2],rt=U[3],it=w[0],lt=w[1],ut=w[2],at=Y*ut-k*lt,st=k*it-H*ut,ft=H*lt-Y*it,vt=Y*ft-k*st,mt=k*at-H*ft,pt=H*st-Y*at,St=rt*2;return at*=St,st*=St,ft*=St,vt*=2,mt*=2,pt*=2,P[0]=it+at+vt,P[1]=lt+st+mt,P[2]=ut+ft+pt,P;}function B(P,w,U,H){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(H)-Y[2]*Math.sin(H),k[2]=Y[1]*Math.sin(H)+Y[2]*Math.cos(H),P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P;}function $(P,w,U,H){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(H)+Y[0]*Math.cos(H),k[1]=Y[1],k[2]=Y[2]*Math.cos(H)-Y[0]*Math.sin(H),P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P;}function Q(P,w,U,H){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(H)-Y[1]*Math.sin(H),k[1]=Y[0]*Math.sin(H)+Y[1]*Math.cos(H),k[2]=Y[2],P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P;}function et(P,w){var U=P[0],H=P[1],Y=P[2],k=w[0],rt=w[1],it=w[2],lt=Math.sqrt(U*U+H*H+Y*Y),ut=Math.sqrt(k*k+rt*rt+it*it),at=lt*ut,st=at&&L(P,w)/at;return Math.acos(Math.min(Math.max(st,-1),1));}function tt(P){return P[0]=0,P[1]=0,P[2]=0,P;}function ot(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 gt(P,w){var U=P[0],H=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(H-rt)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(rt))&&Math.abs(Y-it)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(it));}var dt=c,F=v,j=S,V=g,X=M,N=a,z=A,y=function(){var P=n();return function(w,U,H,Y,k,rt){var it,lt;for(U||(U=3),H||(H=0),Y?lt=Math.min(Y*U+H,w.length):lt=w.length,it=H;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;};}();},/* 9 */ /***/function(h,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 o;}),t.d(r,"set",function(){return s;}),t.d(r,"add",function(){return f;}),t.d(r,"subtract",function(){return p;}),t.d(r,"multiply",function(){return c;}),t.d(r,"divide",function(){return v;}),t.d(r,"ceil",function(){return S;}),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 l;}),t.d(r,"scaleAndAdd",function(){return d;}),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 R;}),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 I;}),t.d(r,"random",function(){return C;}),t.d(r,"transformMat4",function(){return W;}),t.d(r,"transformQuat",function(){return G;}),t.d(r,"zero",function(){return K;}),t.d(r,"str",function(){return J;}),t.d(r,"exactEquals",function(){return Z;}),t.d(r,"equals",function(){return B;}),t.d(r,"sub",function(){return $;}),t.d(r,"mul",function(){return Q;}),t.d(r,"div",function(){return et;}),t.d(r,"dist",function(){return tt;}),t.d(r,"sqrDist",function(){return ot;}),t.d(r,"len",function(){return q;}),t.d(r,"sqrLen",function(){return gt;}),t.d(r,"forEach",function(){return dt;});var e=t(2);function n(){var F=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0,F[3]=0),F;}function i(F){var j=new e.ARRAY_TYPE(4);return j[0]=F[0],j[1]=F[1],j[2]=F[2],j[3]=F[3],j;}function a(F,j,V,X){var N=new e.ARRAY_TYPE(4);return N[0]=F,N[1]=j,N[2]=V,N[3]=X,N;}function o(F,j){return F[0]=j[0],F[1]=j[1],F[2]=j[2],F[3]=j[3],F;}function s(F,j,V,X,N){return F[0]=j,F[1]=V,F[2]=X,F[3]=N,F;}function f(F,j,V){return F[0]=j[0]+V[0],F[1]=j[1]+V[1],F[2]=j[2]+V[2],F[3]=j[3]+V[3],F;}function p(F,j,V){return F[0]=j[0]-V[0],F[1]=j[1]-V[1],F[2]=j[2]-V[2],F[3]=j[3]-V[3],F;}function c(F,j,V){return F[0]=j[0]*V[0],F[1]=j[1]*V[1],F[2]=j[2]*V[2],F[3]=j[3]*V[3],F;}function v(F,j,V){return F[0]=j[0]/V[0],F[1]=j[1]/V[1],F[2]=j[2]/V[2],F[3]=j[3]/V[3],F;}function S(F,j){return F[0]=Math.ceil(j[0]),F[1]=Math.ceil(j[1]),F[2]=Math.ceil(j[2]),F[3]=Math.ceil(j[3]),F;}function O(F,j){return F[0]=Math.floor(j[0]),F[1]=Math.floor(j[1]),F[2]=Math.floor(j[2]),F[3]=Math.floor(j[3]),F;}function x(F,j,V){return F[0]=Math.min(j[0],V[0]),F[1]=Math.min(j[1],V[1]),F[2]=Math.min(j[2],V[2]),F[3]=Math.min(j[3],V[3]),F;}function m(F,j,V){return F[0]=Math.max(j[0],V[0]),F[1]=Math.max(j[1],V[1]),F[2]=Math.max(j[2],V[2]),F[3]=Math.max(j[3],V[3]),F;}function T(F,j){return F[0]=Math.round(j[0]),F[1]=Math.round(j[1]),F[2]=Math.round(j[2]),F[3]=Math.round(j[3]),F;}function l(F,j,V){return F[0]=j[0]*V,F[1]=j[1]*V,F[2]=j[2]*V,F[3]=j[3]*V,F;}function d(F,j,V,X){return F[0]=j[0]+V[0]*X,F[1]=j[1]+V[1]*X,F[2]=j[2]+V[2]*X,F[3]=j[3]+V[3]*X,F;}function u(F,j){var V=j[0]-F[0],X=j[1]-F[1],N=j[2]-F[2],z=j[3]-F[3];return Math.hypot(V,X,N,z);}function g(F,j){var V=j[0]-F[0],X=j[1]-F[1],N=j[2]-F[2],z=j[3]-F[3];return V*V+X*X+N*N+z*z;}function M(F){var j=F[0],V=F[1],X=F[2],N=F[3];return Math.hypot(j,V,X,N);}function A(F){var j=F[0],V=F[1],X=F[2],N=F[3];return j*j+V*V+X*X+N*N;}function R(F,j){return F[0]=-j[0],F[1]=-j[1],F[2]=-j[2],F[3]=-j[3],F;}function b(F,j){return F[0]=1/j[0],F[1]=1/j[1],F[2]=1/j[2],F[3]=1/j[3],F;}function E(F,j){var V=j[0],X=j[1],N=j[2],z=j[3],y=V*V+X*X+N*N+z*z;return y>0&&(y=1/Math.sqrt(y)),F[0]=V*y,F[1]=X*y,F[2]=N*y,F[3]=z*y,F;}function L(F,j){return F[0]*j[0]+F[1]*j[1]+F[2]*j[2]+F[3]*j[3];}function D(F,j,V,X){var N=V[0]*X[1]-V[1]*X[0],z=V[0]*X[2]-V[2]*X[0],y=V[0]*X[3]-V[3]*X[0],P=V[1]*X[2]-V[2]*X[1],w=V[1]*X[3]-V[3]*X[1],U=V[2]*X[3]-V[3]*X[2],H=j[0],Y=j[1],k=j[2],rt=j[3];return F[0]=Y*U-k*w+rt*P,F[1]=-(H*U)+k*y-rt*z,F[2]=H*w-Y*y+rt*N,F[3]=-(H*P)+Y*z-k*N,F;}function I(F,j,V,X){var N=j[0],z=j[1],y=j[2],P=j[3];return F[0]=N+X*(V[0]-N),F[1]=z+X*(V[1]-z),F[2]=y+X*(V[2]-y),F[3]=P+X*(V[3]-P),F;}function C(F,j){j=j||1;var V,X,N,z,y,P;do V=e.RANDOM()*2-1,X=e.RANDOM()*2-1,y=V*V+X*X;while(y>=1);do N=e.RANDOM()*2-1,z=e.RANDOM()*2-1,P=N*N+z*z;while(P>=1);var w=Math.sqrt((1-y)/P);return F[0]=j*V,F[1]=j*X,F[2]=j*N*w,F[3]=j*z*w,F;}function W(F,j,V){var X=j[0],N=j[1],z=j[2],y=j[3];return F[0]=V[0]*X+V[4]*N+V[8]*z+V[12]*y,F[1]=V[1]*X+V[5]*N+V[9]*z+V[13]*y,F[2]=V[2]*X+V[6]*N+V[10]*z+V[14]*y,F[3]=V[3]*X+V[7]*N+V[11]*z+V[15]*y,F;}function G(F,j,V){var X=j[0],N=j[1],z=j[2],y=V[0],P=V[1],w=V[2],U=V[3],H=U*X+P*z-w*N,Y=U*N+w*X-y*z,k=U*z+y*N-P*X,rt=-y*X-P*N-w*z;return F[0]=H*U+rt*-y+Y*-w-k*-P,F[1]=Y*U+rt*-P+k*-y-H*-w,F[2]=k*U+rt*-w+H*-P-Y*-y,F[3]=j[3],F;}function K(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=0,F;}function J(F){return"vec4("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+")";}function Z(F,j){return F[0]===j[0]&&F[1]===j[1]&&F[2]===j[2]&&F[3]===j[3];}function B(F,j){var V=F[0],X=F[1],N=F[2],z=F[3],y=j[0],P=j[1],w=j[2],U=j[3];return Math.abs(V-y)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(y))&&Math.abs(X-P)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(P))&&Math.abs(N-w)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(w))&&Math.abs(z-U)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(U));}var $=p,Q=c,et=v,tt=u,ot=g,q=M,gt=A,dt=function(){var F=n();return function(j,V,X,N,z,y){var P,w;for(V||(V=4),X||(X=0),N?w=Math.min(N*V+X,j.length):w=j.length,P=X;P<w;P+=V)F[0]=j[P],F[1]=j[P+1],F[2]=j[P+2],F[3]=j[P+3],z(F,F,y),j[P]=F[0],j[P+1]=F[1],j[P+2]=F[2],j[P+3]=F[3];return j;};}();},/* 10 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return a;}),t.d(r,"clone",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"fromRotationTranslationValues",function(){return f;}),t.d(r,"fromRotationTranslation",function(){return p;}),t.d(r,"fromTranslation",function(){return c;}),t.d(r,"fromRotation",function(){return v;}),t.d(r,"fromMat4",function(){return S;}),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 l;}),t.d(r,"setReal",function(){return d;}),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 R;}),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 I;}),t.d(r,"multiply",function(){return C;}),t.d(r,"mul",function(){return W;}),t.d(r,"scale",function(){return G;}),t.d(r,"dot",function(){return K;}),t.d(r,"lerp",function(){return J;}),t.d(r,"invert",function(){return Z;}),t.d(r,"conjugate",function(){return B;}),t.d(r,"length",function(){return $;}),t.d(r,"len",function(){return Q;}),t.d(r,"squaredLength",function(){return et;}),t.d(r,"sqrLen",function(){return tt;}),t.d(r,"normalize",function(){return ot;}),t.d(r,"str",function(){return q;}),t.d(r,"exactEquals",function(){return gt;}),t.d(r,"equals",function(){return dt;});var e=t(2),n=t(7),i=t(6);function a(){var F=new e.ARRAY_TYPE(8);return e.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0,F[4]=0,F[5]=0,F[6]=0,F[7]=0),F[3]=1,F;}function o(F){var j=new e.ARRAY_TYPE(8);return j[0]=F[0],j[1]=F[1],j[2]=F[2],j[3]=F[3],j[4]=F[4],j[5]=F[5],j[6]=F[6],j[7]=F[7],j;}function s(F,j,V,X,N,z,y,P){var w=new e.ARRAY_TYPE(8);return w[0]=F,w[1]=j,w[2]=V,w[3]=X,w[4]=N,w[5]=z,w[6]=y,w[7]=P,w;}function f(F,j,V,X,N,z,y){var P=new e.ARRAY_TYPE(8);P[0]=F,P[1]=j,P[2]=V,P[3]=X;var w=N*0.5,U=z*0.5,H=y*0.5;return P[4]=w*X+U*V-H*j,P[5]=U*X+H*F-w*V,P[6]=H*X+w*j-U*F,P[7]=-w*F-U*j-H*V,P;}function p(F,j,V){var X=V[0]*0.5,N=V[1]*0.5,z=V[2]*0.5,y=j[0],P=j[1],w=j[2],U=j[3];return F[0]=y,F[1]=P,F[2]=w,F[3]=U,F[4]=X*U+N*w-z*P,F[5]=N*U+z*y-X*w,F[6]=z*U+X*P-N*y,F[7]=-X*y-N*P-z*w,F;}function c(F,j){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F[4]=j[0]*0.5,F[5]=j[1]*0.5,F[6]=j[2]*0.5,F[7]=0,F;}function v(F,j){return F[0]=j[0],F[1]=j[1],F[2]=j[2],F[3]=j[3],F[4]=0,F[5]=0,F[6]=0,F[7]=0,F;}function S(F,j){var V=n.create();i.getRotation(V,j);var X=new e.ARRAY_TYPE(3);return i.getTranslation(X,j),p(F,V,X),F;}function O(F,j){return F[0]=j[0],F[1]=j[1],F[2]=j[2],F[3]=j[3],F[4]=j[4],F[5]=j[5],F[6]=j[6],F[7]=j[7],F;}function x(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F[4]=0,F[5]=0,F[6]=0,F[7]=0,F;}function m(F,j,V,X,N,z,y,P,w){return F[0]=j,F[1]=V,F[2]=X,F[3]=N,F[4]=z,F[5]=y,F[6]=P,F[7]=w,F;}var T=n.copy;function l(F,j){return F[0]=j[4],F[1]=j[5],F[2]=j[6],F[3]=j[7],F;}var d=n.copy;function u(F,j){return F[4]=j[0],F[5]=j[1],F[6]=j[2],F[7]=j[3],F;}function g(F,j){var V=j[4],X=j[5],N=j[6],z=j[7],y=-j[0],P=-j[1],w=-j[2],U=j[3];return F[0]=(V*U+z*y+X*w-N*P)*2,F[1]=(X*U+z*P+N*y-V*w)*2,F[2]=(N*U+z*w+V*P-X*y)*2,F;}function M(F,j,V){var X=j[0],N=j[1],z=j[2],y=j[3],P=V[0]*0.5,w=V[1]*0.5,U=V[2]*0.5,H=j[4],Y=j[5],k=j[6],rt=j[7];return F[0]=X,F[1]=N,F[2]=z,F[3]=y,F[4]=y*P+N*U-z*w+H,F[5]=y*w+z*P-X*U+Y,F[6]=y*U+X*w-N*P+k,F[7]=-X*P-N*w-z*U+rt,F;}function A(F,j,V){var X=-j[0],N=-j[1],z=-j[2],y=j[3],P=j[4],w=j[5],U=j[6],H=j[7],Y=P*y+H*X+w*z-U*N,k=w*y+H*N+U*X-P*z,rt=U*y+H*z+P*N-w*X,it=H*y-P*X-w*N-U*z;return n.rotateX(F,j,V),X=F[0],N=F[1],z=F[2],y=F[3],F[4]=Y*y+it*X+k*z-rt*N,F[5]=k*y+it*N+rt*X-Y*z,F[6]=rt*y+it*z+Y*N-k*X,F[7]=it*y-Y*X-k*N-rt*z,F;}function R(F,j,V){var X=-j[0],N=-j[1],z=-j[2],y=j[3],P=j[4],w=j[5],U=j[6],H=j[7],Y=P*y+H*X+w*z-U*N,k=w*y+H*N+U*X-P*z,rt=U*y+H*z+P*N-w*X,it=H*y-P*X-w*N-U*z;return n.rotateY(F,j,V),X=F[0],N=F[1],z=F[2],y=F[3],F[4]=Y*y+it*X+k*z-rt*N,F[5]=k*y+it*N+rt*X-Y*z,F[6]=rt*y+it*z+Y*N-k*X,F[7]=it*y-Y*X-k*N-rt*z,F;}function b(F,j,V){var X=-j[0],N=-j[1],z=-j[2],y=j[3],P=j[4],w=j[5],U=j[6],H=j[7],Y=P*y+H*X+w*z-U*N,k=w*y+H*N+U*X-P*z,rt=U*y+H*z+P*N-w*X,it=H*y-P*X-w*N-U*z;return n.rotateZ(F,j,V),X=F[0],N=F[1],z=F[2],y=F[3],F[4]=Y*y+it*X+k*z-rt*N,F[5]=k*y+it*N+rt*X-Y*z,F[6]=rt*y+it*z+Y*N-k*X,F[7]=it*y-Y*X-k*N-rt*z,F;}function E(F,j,V){var X=V[0],N=V[1],z=V[2],y=V[3],P=j[0],w=j[1],U=j[2],H=j[3];return F[0]=P*y+H*X+w*z-U*N,F[1]=w*y+H*N+U*X-P*z,F[2]=U*y+H*z+P*N-w*X,F[3]=H*y-P*X-w*N-U*z,P=j[4],w=j[5],U=j[6],H=j[7],F[4]=P*y+H*X+w*z-U*N,F[5]=w*y+H*N+U*X-P*z,F[6]=U*y+H*z+P*N-w*X,F[7]=H*y-P*X-w*N-U*z,F;}function L(F,j,V){var X=j[0],N=j[1],z=j[2],y=j[3],P=V[0],w=V[1],U=V[2],H=V[3];return F[0]=X*H+y*P+N*U-z*w,F[1]=N*H+y*w+z*P-X*U,F[2]=z*H+y*U+X*w-N*P,F[3]=y*H-X*P-N*w-z*U,P=V[4],w=V[5],U=V[6],H=V[7],F[4]=X*H+y*P+N*U-z*w,F[5]=N*H+y*w+z*P-X*U,F[6]=z*H+y*U+X*w-N*P,F[7]=y*H-X*P-N*w-z*U,F;}function D(F,j,V,X){if(Math.abs(X)<e.EPSILON)return O(F,j);var N=Math.hypot(V[0],V[1],V[2]);X=X*0.5;var z=Math.sin(X),y=z*V[0]/N,P=z*V[1]/N,w=z*V[2]/N,U=Math.cos(X),H=j[0],Y=j[1],k=j[2],rt=j[3];F[0]=H*U+rt*y+Y*w-k*P,F[1]=Y*U+rt*P+k*y-H*w,F[2]=k*U+rt*w+H*P-Y*y,F[3]=rt*U-H*y-Y*P-k*w;var it=j[4],lt=j[5],ut=j[6],at=j[7];return F[4]=it*U+at*y+lt*w-ut*P,F[5]=lt*U+at*P+ut*y-it*w,F[6]=ut*U+at*w+it*P-lt*y,F[7]=at*U-it*y-lt*P-ut*w,F;}function I(F,j,V){return F[0]=j[0]+V[0],F[1]=j[1]+V[1],F[2]=j[2]+V[2],F[3]=j[3]+V[3],F[4]=j[4]+V[4],F[5]=j[5]+V[5],F[6]=j[6]+V[6],F[7]=j[7]+V[7],F;}function C(F,j,V){var X=j[0],N=j[1],z=j[2],y=j[3],P=V[4],w=V[5],U=V[6],H=V[7],Y=j[4],k=j[5],rt=j[6],it=j[7],lt=V[0],ut=V[1],at=V[2],st=V[3];return F[0]=X*st+y*lt+N*at-z*ut,F[1]=N*st+y*ut+z*lt-X*at,F[2]=z*st+y*at+X*ut-N*lt,F[3]=y*st-X*lt-N*ut-z*at,F[4]=X*H+y*P+N*U-z*w+Y*st+it*lt+k*at-rt*ut,F[5]=N*H+y*w+z*P-X*U+k*st+it*ut+rt*lt-Y*at,F[6]=z*H+y*U+X*w-N*P+rt*st+it*at+Y*ut-k*lt,F[7]=y*H-X*P-N*w-z*U+it*st-Y*lt-k*ut-rt*at,F;}var W=C;function G(F,j,V){return F[0]=j[0]*V,F[1]=j[1]*V,F[2]=j[2]*V,F[3]=j[3]*V,F[4]=j[4]*V,F[5]=j[5]*V,F[6]=j[6]*V,F[7]=j[7]*V,F;}var K=n.dot;function J(F,j,V,X){var N=1-X;return K(j,V)<0&&(X=-X),F[0]=j[0]*N+V[0]*X,F[1]=j[1]*N+V[1]*X,F[2]=j[2]*N+V[2]*X,F[3]=j[3]*N+V[3]*X,F[4]=j[4]*N+V[4]*X,F[5]=j[5]*N+V[5]*X,F[6]=j[6]*N+V[6]*X,F[7]=j[7]*N+V[7]*X,F;}function Z(F,j){var V=et(j);return F[0]=-j[0]/V,F[1]=-j[1]/V,F[2]=-j[2]/V,F[3]=j[3]/V,F[4]=-j[4]/V,F[5]=-j[5]/V,F[6]=-j[6]/V,F[7]=j[7]/V,F;}function B(F,j){return F[0]=-j[0],F[1]=-j[1],F[2]=-j[2],F[3]=j[3],F[4]=-j[4],F[5]=-j[5],F[6]=-j[6],F[7]=j[7],F;}var $=n.length,Q=$,et=n.squaredLength,tt=et;function ot(F,j){var V=et(j);if(V>0){V=Math.sqrt(V);var X=j[0]/V,N=j[1]/V,z=j[2]/V,y=j[3]/V,P=j[4],w=j[5],U=j[6],H=j[7],Y=X*P+N*w+z*U+y*H;F[0]=X,F[1]=N,F[2]=z,F[3]=y,F[4]=(P-X*Y)/V,F[5]=(w-N*Y)/V,F[6]=(U-z*Y)/V,F[7]=(H-y*Y)/V;}return F;}function q(F){return"quat2("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+", "+F[4]+", "+F[5]+", "+F[6]+", "+F[7]+")";}function gt(F,j){return F[0]===j[0]&&F[1]===j[1]&&F[2]===j[2]&&F[3]===j[3]&&F[4]===j[4]&&F[5]===j[5]&&F[6]===j[6]&&F[7]===j[7];}function dt(F,j){var V=F[0],X=F[1],N=F[2],z=F[3],y=F[4],P=F[5],w=F[6],U=F[7],H=j[0],Y=j[1],k=j[2],rt=j[3],it=j[4],lt=j[5],ut=j[6],at=j[7];return Math.abs(V-H)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(H))&&Math.abs(X-Y)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(Y))&&Math.abs(N-k)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(k))&&Math.abs(z-rt)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(rt))&&Math.abs(y-it)<=e.EPSILON*Math.max(1,Math.abs(y),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-at)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(at));}},/* 11 */ /***/function(h,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 o;}),t.d(r,"set",function(){return s;}),t.d(r,"add",function(){return f;}),t.d(r,"subtract",function(){return p;}),t.d(r,"multiply",function(){return c;}),t.d(r,"divide",function(){return v;}),t.d(r,"ceil",function(){return S;}),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 l;}),t.d(r,"scaleAndAdd",function(){return d;}),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 R;}),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 I;}),t.d(r,"random",function(){return C;}),t.d(r,"transformMat2",function(){return W;}),t.d(r,"transformMat2d",function(){return G;}),t.d(r,"transformMat3",function(){return K;}),t.d(r,"transformMat4",function(){return J;}),t.d(r,"rotate",function(){return Z;}),t.d(r,"angle",function(){return B;}),t.d(r,"zero",function(){return $;}),t.d(r,"str",function(){return Q;}),t.d(r,"exactEquals",function(){return et;}),t.d(r,"equals",function(){return tt;}),t.d(r,"len",function(){return ot;}),t.d(r,"sub",function(){return q;}),t.d(r,"mul",function(){return gt;}),t.d(r,"div",function(){return dt;}),t.d(r,"dist",function(){return F;}),t.d(r,"sqrDist",function(){return j;}),t.d(r,"sqrLen",function(){return V;}),t.d(r,"forEach",function(){return X;});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 z=new e.ARRAY_TYPE(2);return z[0]=N[0],z[1]=N[1],z;}function a(N,z){var y=new e.ARRAY_TYPE(2);return y[0]=N,y[1]=z,y;}function o(N,z){return N[0]=z[0],N[1]=z[1],N;}function s(N,z,y){return N[0]=z,N[1]=y,N;}function f(N,z,y){return N[0]=z[0]+y[0],N[1]=z[1]+y[1],N;}function p(N,z,y){return N[0]=z[0]-y[0],N[1]=z[1]-y[1],N;}function c(N,z,y){return N[0]=z[0]*y[0],N[1]=z[1]*y[1],N;}function v(N,z,y){return N[0]=z[0]/y[0],N[1]=z[1]/y[1],N;}function S(N,z){return N[0]=Math.ceil(z[0]),N[1]=Math.ceil(z[1]),N;}function O(N,z){return N[0]=Math.floor(z[0]),N[1]=Math.floor(z[1]),N;}function x(N,z,y){return N[0]=Math.min(z[0],y[0]),N[1]=Math.min(z[1],y[1]),N;}function m(N,z,y){return N[0]=Math.max(z[0],y[0]),N[1]=Math.max(z[1],y[1]),N;}function T(N,z){return N[0]=Math.round(z[0]),N[1]=Math.round(z[1]),N;}function l(N,z,y){return N[0]=z[0]*y,N[1]=z[1]*y,N;}function d(N,z,y,P){return N[0]=z[0]+y[0]*P,N[1]=z[1]+y[1]*P,N;}function u(N,z){var y=z[0]-N[0],P=z[1]-N[1];return Math.hypot(y,P);}function g(N,z){var y=z[0]-N[0],P=z[1]-N[1];return y*y+P*P;}function M(N){var z=N[0],y=N[1];return Math.hypot(z,y);}function A(N){var z=N[0],y=N[1];return z*z+y*y;}function R(N,z){return N[0]=-z[0],N[1]=-z[1],N;}function b(N,z){return N[0]=1/z[0],N[1]=1/z[1],N;}function E(N,z){var y=z[0],P=z[1],w=y*y+P*P;return w>0&&(w=1/Math.sqrt(w)),N[0]=z[0]*w,N[1]=z[1]*w,N;}function L(N,z){return N[0]*z[0]+N[1]*z[1];}function D(N,z,y){var P=z[0]*y[1]-z[1]*y[0];return N[0]=N[1]=0,N[2]=P,N;}function I(N,z,y,P){var w=z[0],U=z[1];return N[0]=w+P*(y[0]-w),N[1]=U+P*(y[1]-U),N;}function C(N,z){z=z||1;var y=e.RANDOM()*2*Math.PI;return N[0]=Math.cos(y)*z,N[1]=Math.sin(y)*z,N;}function W(N,z,y){var P=z[0],w=z[1];return N[0]=y[0]*P+y[2]*w,N[1]=y[1]*P+y[3]*w,N;}function G(N,z,y){var P=z[0],w=z[1];return N[0]=y[0]*P+y[2]*w+y[4],N[1]=y[1]*P+y[3]*w+y[5],N;}function K(N,z,y){var P=z[0],w=z[1];return N[0]=y[0]*P+y[3]*w+y[6],N[1]=y[1]*P+y[4]*w+y[7],N;}function J(N,z,y){var P=z[0],w=z[1];return N[0]=y[0]*P+y[4]*w+y[12],N[1]=y[1]*P+y[5]*w+y[13],N;}function Z(N,z,y,P){var w=z[0]-y[0],U=z[1]-y[1],H=Math.sin(P),Y=Math.cos(P);return N[0]=w*Y-U*H+y[0],N[1]=w*H+U*Y+y[1],N;}function B(N,z){var y=N[0],P=N[1],w=z[0],U=z[1],H=Math.sqrt(y*y+P*P)*Math.sqrt(w*w+U*U),Y=H&&(y*w+P*U)/H;return Math.acos(Math.min(Math.max(Y,-1),1));}function $(N){return N[0]=0,N[1]=0,N;}function Q(N){return"vec2("+N[0]+", "+N[1]+")";}function et(N,z){return N[0]===z[0]&&N[1]===z[1];}function tt(N,z){var y=N[0],P=N[1],w=z[0],U=z[1];return Math.abs(y-w)<=e.EPSILON*Math.max(1,Math.abs(y),Math.abs(w))&&Math.abs(P-U)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(U));}var ot=M,q=p,gt=c,dt=v,F=u,j=g,V=A,X=function(){var N=n();return function(z,y,P,w,U,H){var Y,k;for(y||(y=2),P||(P=0),w?k=Math.min(w*y+P,z.length):k=z.length,Y=P;Y<k;Y+=y)N[0]=z[Y],N[1]=z[Y+1],U(N,N,H),z[Y]=N[0],z[Y+1]=N[1];return z;};}();},/* 12 */ /***/function(h,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 o=t(23);t.d(r,"parseFont",function(){return o["default"];});var s=t(31);t.d(r,"parseColor",function(){return s["default"];});var f=t(21);t.d(r,"ENV",function(){return f["default"];}),t(1).glMatrix.setMatrixArrayType(Array);},/* 13 */ /***/function(h,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),o=t(25),s=t(40),f=t(56),p=t(29),c=t(59),v=t(21),S=t(63);t(1).glMatrix.setMatrixArrayType(Array);var O={autoUpdate:!1,// premultipliedAlpha: true,
36
+ preserveDrawingBuffer:!1,// depth: false,
37
+ // antialias: false,
38
+ bufferSize:1500},x="attribute vec3 a_vertexPosition;\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\nvoid main() {\n gl_PointSize = 1.0;\n vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0); \n vTextureCoord = a_vertexTextureCoord; \n}\n",m="precision mediump float;\nvarying vec3 vTextureCoord;\nuniform sampler2D u_texSampler;\nvoid main() {\n gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);\n}\n",T=Symbol("glRenderer"),l=Symbol("canvasRenderer"),d=Symbol("options"),u=Symbol("globalTransform"),g=Symbol("applyGlobalTransform"),M=Symbol("canvas");function A(E){var L=E.gl,D=E.fbo;D&&L.bindFramebuffer(L.FRAMEBUFFER,D),E._draw(),D&&L.bindFramebuffer(L.FRAMEBUFFER,null);}function R(E,L,D,I){var C=E.createTexture(L.canvas),W=[[[0,0],[D,0],[D,I],[0,I],[0,0]]];W.closed=!0;var G=new f["default"]({contours:W});G.setTexture(C),E.setMeshData([G.meshData]),A(E),C["delete"](),L.clearRect(0,0,D,I),delete L._filter;}var b=/*#__PURE__*/function(){function b(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,b);var I=D.contextType;if(I||(typeof WebGL2RenderingContext=="function"?I="webgl2":typeof WebGLRenderingContext=="function"?I="webgl":I="2d"),!L.getContext){var C=L;L={getContext:function getContext(){return C;},width:D.width,height:D.height},C.canvas=L,I="2d";}if(this[M]=L,I!=="webgl"&&I!=="webgl2"&&I!=="2d")throw new Error("Unknown context type ".concat(I));if(D.contextType=I,this[d]=Object.assign({},O,D),I==="webgl"||I==="webgl2"){I==="webgl2"&&(this[d].webgl2=!0);var _C=new e["default"](L,this[d]);I==="webgl2"&&!_C.isWebGL2&&(D.contextType="webgl"),Object(S.createShaders)(_C),Object(S.applyShader)(_C),Object(S.createCloudShaders)(_C);var 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[l]=new i["default"](L,this[d]);this[u]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(b,[{key:"canvas",get:function get(){return this[M];}},{key:"canvasRenderer",get:function get(){return this[l];}},{key:"glRenderer",get:function get(){return this[T];}},{key:"isWebGL2",get:function get(){return this[T]&&this[T].isWebGL2;}},{key:"options",get:function get(){return this[d];}},{key:"globalTransformMatrix",get:function get(){var L=this[u];return[L[0],L[1],L[3],L[4],L[6],L[7]];}},{key:"viewMatrix",get:function get(){return this[u];}},{key:g,value:function value(){var L=this[T]||this[l];if(this[T]){var _this$canvas=this.canvas,D=_this$canvas.width,I=_this$canvas.height;L.uniforms.viewMatrix=this.viewMatrix,L.uniforms.projectionMatrix=this.projectionMatrix,L.uniforms.u_resolution=[D,I];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,L=_this$canvas2.width,D=_this$canvas2.height,I=[// translation
39
+ 1,0,0,0,1,0,-L/2,-D/2,1],C=[// scale
40
+ 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,I);this.projectionMatrix=W,this[T]&&this[T].gl.viewport(0,0,L,D);}},{key:"createTexture",value:function createTexture(L,D){return(this[T]||this[l]).createTexture(L,D);}/* async */},{key:"loadTexture",value:function loadTexture(L){var _ref3=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref3$useImageBitmap=_ref3.useImageBitmap,D=_ref3$useImageBitmap===void 0?!1:_ref3$useImageBitmap;return(this[T]||this[l]).loadTexture(L,{useImageBitmap:D});}},{key:"createText",value:function createText(L){var _ref4=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref4$font=_ref4.font,D=_ref4$font===void 0?"16px arial":_ref4$font,_ref4$fillColor=_ref4.fillColor,I=_ref4$fillColor===void 0?null:_ref4$fillColor,_ref4$strokeColor=_ref4.strokeColor,C=_ref4$strokeColor===void 0?null:_ref4$strokeColor,_ref4$strokeWidth=_ref4.strokeWidth,W=_ref4$strokeWidth===void 0?1:_ref4$strokeWidth;if(this[T]){var G=v["default"].createText(L,{font:D,fillColor:I,strokeColor:C,strokeWidth:W});return{image:this.createTexture(G.image),rect:G.rect};}return{_img:{font:D,fillColor:I,strokeColor:C,strokeWidth:W,text:L}};}},{key:"createProgram",value:function createProgram(){var _ref5=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},L=_ref5.vertex,D=_ref5.fragment,I=_ref5.options;if(this[T]){var C=this[T].compileSync(D,L);return C._attribOpts=I,C;}throw new Error("Context 2D cannot create webgl program.");}},{key:"createPassProgram",value:function createPassProgram(){var _ref6=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref6$vertex=_ref6.vertex,L=_ref6$vertex===void 0?x:_ref6$vertex,_ref6$fragment=_ref6.fragment,D=_ref6$fragment===void 0?m:_ref6$fragment,I=_ref6.options;return this.createProgram({vertex:L,fragment:D,options:I});}},{key:"useProgram",value:function useProgram(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[T]){var I=Object.assign({},L._attribOpts,D);return this[T].useProgram(L,I);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(L){return(this[T]||this[l]).deleteTexture(L);}},{key:"clear",value:function clear(){var _this$l;if(this[T]){var D=this[T].gl;D.clear(D.COLOR_BUFFER_BIT);}else(_this$l=this[l]).clear.apply(_this$l,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(L){var _ref7=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref7$clear=_ref7.clear,D=_ref7$clear===void 0?!1:_ref7$clear,_ref7$program=_ref7.program,I=_ref7$program===void 0?null:_ref7$program;var C=this[T]||this[l],W=I||L.program;if(this[T]){var G=C.gl;if(D&&G.clear(G.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{var K=L.mesh.meshData,J=!!K.uniforms.u_texSampler,Z=!!K.uniforms.u_filterFlag,B=!!K.uniforms.u_radialGradientVector,$=L.hasCloudColor,Q=L.hasCloudFilter,et=!!K.uniforms.u_clipSampler;Object(S.applyCloudShader)(C,{hasTexture:J,hasFilter:Z,hasGradient:B,hasCloudColor:$,hasCloudFilter:Q,hasClipPath:et});}this[g](),C.setMeshData([L.meshData]),L.beforeRender&&L.beforeRender(G,L),A(C),L.afterRender&&L.afterRender(G,L);}else C.setTransform(this.globalTransformMatrix),C.drawMeshCloud(L,{clear:D,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(L){var _this3=this;var _ref8=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref8$clear=_ref8.clear,D=_ref8$clear===void 0?!1:_ref8$clear,_ref8$program=_ref8.program,I=_ref8$program===void 0?null:_ref8$program;var C=this[T]||this[l];if(this[T]){var W=C.fbo,G=Object(a["default"])(this,L,I==null),K=C.gl;D&&K.clear(K.COLOR_BUFFER_BIT);var J=!Object(c.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator=_createForOfIteratorHelper(G),_step;try{var _loop=function _loop(){var Z=_step.value;_this3._drawCalls++;var B=I||Z.program;if(Z instanceof p["default"])_this3.drawMeshCloud(Z,{clear:D,program:B});else{var _this3$canvas=_this3.canvas,$=_this3$canvas.width,Q=_this3$canvas.height;if(Z.beforeRender&&Z.beforeRender(K,Z),Z.pass.length&&((!_this3.fbo||_this3.fbo.width!==$||_this3.fbo.height!==Q)&&(_this3.fbo={width:$,height:Q,target:C.createFBO(),buffer:C.createFBO(),swap:function swap(){var _ref9=[this.buffer,this.target];this.target=_ref9[0];this.buffer=_ref9[1];}}),C.bindFBO(_this3.fbo.target)),!B&&Z.filterCanvas){Object(S.applyShader)(C,{hasTexture:!0});var et=_this3.filterContext;et||(et=v["default"].createCanvas($,Q).getContext("2d"),_this3.filterContext=et);var tt=L[Z.packIndex],ot=tt.filter,q=L[Z.packIndex+1],gt=L[Z.packIndex-1];(!gt||!gt.filterCanvas||gt.filter!==ot)&&(!q||!q.filterCanvas||q.filter!==ot)?(J?(et.save(),Object(o.drawMesh2D)(tt,et,!1),et.restore(),Object(o.applyFilter)(et,ot)):Object(o.drawMesh2D)(tt,et,!0),_this3[g](),R(C,et,$,Q)):(J&&et.save(),Object(o.drawMesh2D)(tt,et,!1),J&&et.restore(),(!q||!q.filterCanvas||tt.filter!==q.filter)&&(Object(o.applyFilter)(et,ot),_this3[g](),R(C,et,$,Q)));}else{if(B)C.program!==B&&_this3.useProgram(B,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _et=!!Z.uniforms.u_texSampler,_tt=!!Z.uniforms.u_filterFlag,_ot=!!Z.uniforms.u_radialGradientVector,_q=!!Z.uniforms.u_clipSampler;Object(S.applyShader)(C,{hasTexture:_et,hasFilter:_tt,hasGradient:_ot,hasClipPath:_q});}Z.filterCanvas&&console.warn("User program ignored some filter effects."),_this3[g](),C.setMeshData([Z]),A(C);}if(Z.pass.length){var _et2=Z.pass.length;Z.pass.forEach(function(tt,ot){tt.blend=Z.enableBlend,tt.setTexture(C.fbo.texture),ot===_et2-1?C.bindFBO(W):(_this3.fbo.swap(),C.bindFBO(_this3.fbo.target)),tt.program?C.useProgram(tt.program):(_this3.defaultPassProgram=_this3.defaultPassProgram||_this3.createPassProgram(),C.useProgram(_this3.defaultPassProgram)),C.setMeshData([tt.meshData]),K.clear(K.COLOR_BUFFER_BIT),A(C);});}Z.afterRender&&Z.afterRender(K,Z);}};for(_iterator.s();!(_step=_iterator.n()).done;){_loop();}}catch(err){_iterator.e(err);}finally{_iterator.f();}}else C.setTransform(this.globalTransformMatrix),C.drawMeshes(L,{clear:D});}},{key:"drawImage",value:function drawImage(L){for(var _len=arguments.length,D=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){D[_key-1]=arguments[_key];}var I=D.length;if(I<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat(D.length+1," present."));if(I!==2&&I!==4&&I!==8)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': Valid arities are: [3, 5, 9], but ".concat(D.length+1," arguments provided."));var C=null,W=null;I===2?C=[D[0],D[1],L.width,L.height]:I===4?C=D:I===8&&(W=D.slice(0,4),C=D.slice(4));var G=this.createTexture(L),_this$canvas3=this.canvas,K=_this$canvas3.width,J=_this$canvas3.height,Z=new s["default"]();Z.rect(C[0],C[1],K,J);var B=new f["default"](Z,{width:K,height:J});B.setTexture(G,{rect:C,srcRect:W}),this.drawMeshes([B]),this.deleteTexture(G);}},{key:"setGlobalTransform",value:function setGlobalTransform(){return this[u]=[arguments.length<=0?undefined:arguments[0],arguments.length<=1?undefined:arguments[1],0,arguments.length<=2?undefined:arguments[2],arguments.length<=3?undefined:arguments[3],0,arguments.length<=4?undefined:arguments[4],arguments.length<=5?undefined:arguments[5],1],this;}},{key:"globalTransform",value:function globalTransform(){var D=this[u];for(var _len2=arguments.length,L=new Array(_len2),_key2=0;_key2<_len2;_key2++){L[_key2]=arguments[_key2];}return this[u]=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),D,L),this;}},{key:"globalTranslate",value:function globalTranslate(L,D){var I=n.mat3.create();return I=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),I,[L,D]),this.globalTransform.apply(this,_toConsumableArray(I));}},{key:"globalRotate",value:function globalRotate(L){var _ref10=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref11=_slicedToArray(_ref10,2),D=_ref11[0],I=_ref11[1];var C=n.mat3.create();return C=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),C,[D,I]),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,-I]),this.globalTransform.apply(this,_toConsumableArray(C));}},{key:"globalScale",value:function globalScale(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:L;var _ref12=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref13=_slicedToArray(_ref12,2),I=_ref13[0],C=_ref13[1];var W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[I,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,[-I,-C]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"globalSkew",value:function globalSkew(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:L;var _ref14=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref15=_slicedToArray(_ref14,2),I=_ref15[0],C=_ref15[1];var W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[I,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,[-I,-C]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"transformPoint",value:function transformPoint(L,D,I){var C=this.globalTransformMatrix;I&&(C=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),C,I));var W=L*C[0]+D*C[2]+C[4],G=L*C[1]+D*C[3]+C[5];return[W,G];}}]);}();},/* 14 */ /***/function(h,r,t){t.r(r);var e=t(15);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e["default"];},/* 15 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return S;});var e=t(16),n=t(17),i=t(18),a=t(19);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;}var s={};function f(O){var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var m=[],T=O.length;for(var l=0;l<T;l++)l%x<2&&m.push(0.5*(O[l]+1));return m;}function p(O,x){var m=x._buffers;Object.values(m).forEach(function(T){O.deleteBuffer(T);}),x._buffers={};}function c(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;}var v={"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"};var S=/*#__PURE__*/function(){function S(x){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,S);this.options=Object.assign({},S.defaultOptions,m),this.canvas=x;var 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={};}return _createClass(S,[{key:"program",get:function get(){var x=this.gl;return x.getParameter(x.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()
41
+ // WebGLRenderingContext.uniformMatrix[234]fv()
42
+ },{key:"_declareUniform",value:function _declareUniform(x,m){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var l=this.gl,d=l.getUniformLocation(x,m);var u;var g=this;if(/^sampler/.test(T)){var M=x._samplerMap,A=x._bindTextures;Object.defineProperty(x.uniforms,m,{get:function get(){return u;},set:function set(R){u=R;var b=M[m]!=null?M[m]:A.length;A[b]=R,c(l,R,b),M[m]||(M[m]=b,l.uniform1i(d,b)),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}else{var _M=T.indexOf("Matrix")===0,_A=!_M&&/v$/.test(T),R=l["uniform".concat(T)].bind(l);Object.defineProperty(x.uniforms,m,{get:function get(){return u;},set:function set(b){u=b,typeof b=="number"&&(b=[b]),_M?R(d,!1,b):_A?R(d,b):R.apply(void 0,[d].concat(_toConsumableArray(b))),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this4=this;var x=this.program;x.meshData.forEach(function(m,T){var l=m.positions,d=m.cells,u=m.instanceCount,g=m.cellsCount,M=m.attributes,A=m.uniforms,R=m.textureCoord,b=m.enableBlend,E=_this4.gl;var 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,l,E.STATIC_DRAW),d&&(E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,x._buffers.cellsBuffer),E.bufferData(E.ELEMENT_ARRAY_BUFFER,d,E.STATIC_DRAW));var D=[];M&&Object.values(M).forEach(function(_ref16){var C=_ref16.name,W=_ref16.data,G=_ref16.divisor;if(E.bindBuffer(E.ARRAY_BUFFER,x._buffers[C]),E.bufferData(E.ARRAY_BUFFER,W,E.STATIC_DRAW),G!=null){var K=E.getAttribLocation(x,C);K>=0&&(E.enableVertexAttribArray(K),D.push(K),E.vertexAttribDivisor?E.vertexAttribDivisor(K,G):_this4.aia_ext&&_this4.aia_ext.vertexAttribDivisorANGLE(K,G));}}),A&&Object.entries(A).forEach(function(_ref17){var _ref18=_slicedToArray(_ref17,2),C=_ref18[0],W=_ref18[1];_this4.uniforms[C]=W;});var I;if(!d){var C=x._dimension;I=l.length/C;}if(x._enableTextures&&x._buffers.texCoordBuffer){var _C2=R||f(l,x._dimension);E.bindBuffer(E.ARRAY_BUFFER,x._buffers.texCoordBuffer),E.bufferData(E.ARRAY_BUFFER,S.FLOAT(_C2),E.STATIC_DRAW);}u!=null?(d?E.drawElementsInstanced?E.drawElementsInstanced(L,g,E.UNSIGNED_SHORT,0,u):_this4.aia_ext&&_this4.aia_ext.drawElementsInstancedANGLE(L,g,E.UNSIGNED_SHORT,0,u):E.drawArraysInstanced?E.drawArraysInstanced(L,0,I,u):_this4.aia_ext.drawArraysInstancedANGLE(L,0,I,u),D.forEach(function(C){E.vertexAttribDivisor?E.vertexAttribDivisor(C,null):_this4.aia_ext&&_this4.aia_ext.vertexAttribDivisorANGLE(C,null);})):d?E.drawElements(L,g,E.UNSIGNED_SHORT,0):E.drawArrays(L,0,I);});}},{key:"isWebGL2",get:function get(){return(typeof WebGL2RenderingContext==="undefined"?"undefined":_typeof(WebGL2RenderingContext))<"u"&&this.gl instanceof WebGL2RenderingContext;}},{key:"enableTextures",get:function get(){return this.program&&this.program._enableTextures;}},{key:"uniforms",get:function get(){var x=this.program;if(!x||!x.uniforms)throw Error("No avaliable program.");return x.uniforms;}},{key:"deleteProgram",value:function deleteProgram(x){var m=this.gl;this.program===x&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),m.useProgram(null));var T=this.programs.indexOf(x);T>=0&&this.programs.splice(T,1),p(m,x),m.deleteProgram(x);}/**
43
+ [{
44
+ positions: ...
45
+ cells: ...
46
+ textureCoord: ...
47
+ attributes: {name: {data:..., normalize: true}},
48
+ uniforms: ...
49
+ }]
50
+ */},{key:"setMeshData",value:function setMeshData(x){var _this5=this;Array.isArray(x)||(x=[x]);var m=this.program;m.meshData=x.map(function(_ref19){var T=_ref19.mode,l=_ref19.positions,d=_ref19.instanceCount,u=_ref19.cells,g=_ref19.cellsCount,M=_ref19.attributes,A=_ref19.uniforms,R=_ref19.textureCoord,b=_ref19.enableBlend;var E={positions:S.FLOAT(l),uniforms:A,enableBlend:!!b,textureCoord:S.FLOAT(R)};if(u&&(E.cells=S.USHORT(u),E.cellsCount=g||E.cells.length),T!=null&&(E.mode=T),d!=null){if(!_this5.isWebGL2&&!_this5.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");E.instanceCount=d;}if(M){var L={};Object.entries(M).forEach(function(_ref20){var _ref21=_slicedToArray(_ref20,2),D=_ref21[0],I=_ref21[1];if(!m._attribute[D])m._attribute[D]="ignored";else if(m._attribute[D]!=="ignored"){var _m$_attribute$D=m._attribute[D],C=_m$_attribute$D.name,W=_m$_attribute$D.type;var G=I.data||I;if(Array.isArray(G)&&(G=S[W](G)),L[D]={name:C,data:G},I.divisor!=null){if(!_this5.isWebGL2&&!_this5.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");L[D].divisor=I.divisor;}}}),E.attributes=L;}return E;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(x,m){var _this6=this;var T=/^\s*uniform\s+sampler/mg.test(x);x==null&&(x=i["default"]),m==null&&(m=T?a["default"]:n["default"]);var l=this.gl,d=Object(e.createProgram)(l,m,x);d.shaderText={vertexShader:m,fragmentShader:x},d._buffers={},d._attribute={},d.uniforms={},d._samplerMap={},d._bindTextures=[];var u=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexPosition),"im");var g=m.match(u);g&&(d._dimension=Number(g[1]));var M=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexTextureCoord),"im");g=m.match(M),g&&(d._texCoordSize=Number(g[1]));var A=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/gim;if(g=m.match(A),g)for(var E=0;E<g.length;E++){var 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){var _D=_slicedToArray(D,4),I=_D[1],C=_D[2],W=_D[3];I==="mat"&&(C=Math.pow(C,2)),d._buffers[W]=l.createBuffer(),d._attribute[W]={name:W,type:I,size:Number(C)||1};}}var R=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;g=m.match(R)||[],g=g.concat(x.match(R)||[]),g.forEach(function(E){var L=E.match(/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/);var _L$slice=L.slice(1),_L$slice2=_slicedToArray(_L$slice,3),D=_L$slice2[0],I=_L$slice2[1],C=_L$slice2[2];D=v[D],C=!!C,D.indexOf("Matrix")!==0&&C&&(D+="v"),_this6._declareUniform(d,I,D);}),d._buffers.verticesBuffer=l.createBuffer(),d._buffers.cellsBuffer=l.createBuffer();var b=l.getAttribLocation(d,this.options.vertexTextureCoord);return d._enableTextures=b>=0,d._enableTextures&&(d._buffers.texCoordBuffer=l.createBuffer()),this.programs.push(d),d;}},{key:"useProgram",value:function useProgram(x){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var T=this.gl;T.useProgram(x);var l=x._dimension;T.bindBuffer(T.ARRAY_BUFFER,x._buffers.verticesBuffer);var d=T.getAttribLocation(x,this.options.vertexPosition);if(T.vertexAttribPointer(d,l,T.FLOAT,!1,0,0),T.enableVertexAttribArray(d),x._enableTextures){T.bindBuffer(T.ARRAY_BUFFER,x._buffers.texCoordBuffer);var 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(function(_ref22){var _ref23=_slicedToArray(_ref22,2),u=_ref23[0],g=_ref23[1];if(g!=="ignored"){var M=g.size,A=m[u]||{},R=!!A.normalize;var b=A.type||"FLOAT";var 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]);var L=T.getAttribLocation(x,u);L>=0&&(T.vertexAttribPointer(L,M,T[b],R,0,0),T.enableVertexAttribArray(L));}}),!x.meshData){var _u2=[[-1,-1,0,1].slice(0,l),[1,-1,0,1].slice(0,l),[1,1,0,1].slice(0,l),[-1,1,0,1].slice(0,l)],g=[[0,1,3],[3,1,2]];this.setMeshData({positions:_u2,cells:g});}return x;}},{key:"compileSync",value:function compileSync(x,m){x=x||i["default"];var T={};function l(M){M=M.replace(/^\s*/mg,"");var A=[],R=M.match(/^#pragma\s+include\s+.*/mg);if(R){for(var b=0;b<R.length;b++){var L=R[b].match(/(?:<|")(.*)(?:>|")/);if(L){var D=L[0].indexOf("<")===0?"lib":"link";var I=L[1];if(I==="graph"&&(I="graphics"),T[I])A.push("/* included ".concat(I," */"));else if(T[I]=!0,D==="lib"){var C=l(s[I]);A.push(C);}else if(D==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}A.forEach(function(b){M=M.replace(/^#pragma\s+include\s+.*/m,b);});}return M;}var d=l(x),u=m?l(m):null;return this.createProgram(d,u);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(x,m){var T,l,_l4,d,u;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_l4=function _l6(){_l4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(M){var A,R,b,L,D,I,C,_C3;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:M=M.replace(/^\s*/mg,"");A=[],R=M.match(/^#pragma\s+include\s+.*/mg);if(!R){_context2.next=32;break;}b=0;case 4:if(!(b<R.length)){_context2.next=31;break;}L=R[b].match(/(?:<|")(.*)(?:>|")/);if(!L){_context2.next=28;break;}D=L[0].indexOf("<")===0?"lib":"link";I=L[1];if(!(I==="graph"&&(I="graphics"),T[I])){_context2.next=13;break;}A.push("/* included ".concat(I," */"));_context2.next=28;break;case 13:if(!(T[I]=!0,D==="lib")){_context2.next=20;break;}_context2.next=16;return l(s[I]);case 16:C=_context2.sent;A.push(C);_context2.next=28;break;case 20:if(!(D==="link")){_context2.next=28;break;}_context2.next=23;return S.fetchShader(I);case 23:_C3=_context2.sent;_context2.next=26;return l(_C3);case 26:_C3=_context2.sent;A.push(_C3);case 28:b++;_context2.next=4;break;case 31:A.forEach(function(b){M=M.replace(/^#pragma\s+include\s+.*/m,b);});case 32:return _context2.abrupt("return",M);case 33:case"end":return _context2.stop();}},_callee2);}));return _l4.apply(this,arguments);};l=function _l5(_x4){return _l4.apply(this,arguments);};x=x||i["default"];T={};_context3.next=6;return l(x);case 6:d=_context3.sent;if(!m){_context3.next=13;break;}_context3.next=10;return l(m);case 10:_context3.t0=_context3.sent;_context3.next=14;break;case 13:_context3.t0=null;case 14:u=_context3.t0;return _context3.abrupt("return",this.createProgram(d,u));case 16:case"end":return _context3.stop();}},_callee3,this);}));function compile(_x2,_x3){return _compile.apply(this,arguments);}return compile;}()},{key:"load",value:function(){var _load=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(x){var m,_args4=arguments;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:m=_args4.length>1&&_args4[1]!==undefined?_args4[1]:null;_context4.next=3;return S.fetchShader(x);case 3:x=_context4.sent;_context4.t0=m;if(!_context4.t0){_context4.next=9;break;}_context4.next=8;return S.fetchShader(m);case 8:m=_context4.sent;case 9:return _context4.abrupt("return",this.compile(x,m));case 10:case"end":return _context4.stop();}},_callee4,this);}));function load(_x5){return _load.apply(this,arguments);}return load;}()},{key:"createTexture",value:function createTexture(){var _this7=this;var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var _ref24=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref24$wrapS=_ref24.wrapS,m=_ref24$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref24$wrapS,_ref24$wrapT=_ref24.wrapT,T=_ref24$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref24$wrapT,_ref24$minFilter=_ref24.minFilter,l=_ref24$minFilter===void 0?this.gl.LINEAR:_ref24$minFilter,_ref24$magFilter=_ref24.magFilter,d=_ref24$magFilter===void 0?this.gl.LINEAR:_ref24$magFilter;var 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);var M=u.createTexture();u.bindTexture(g,M),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas4=this.canvas,A=_this$canvas4.width,R=_this$canvas4.height;if(x){if(g===u.TEXTURE_CUBE_MAP)for(var 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(var _b=0;_b<6;_b++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+_b,0,u.RGBA,A,R,0,u.RGBA,u.UNSIGNED_BYTE,null);else u.texImage2D(g,0,u.RGBA,A,R,0,u.RGBA,u.UNSIGNED_BYTE,null);return u.texParameteri(g,u.TEXTURE_MIN_FILTER,l),u.texParameteri(g,u.TEXTURE_MAG_FILTER,d),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:R},M["delete"]=function(){_this7.deleteTexture(M);},M;}},{key:"deleteTexture",value:function deleteTexture(x){var m=x._img;this.gl.deleteTexture(x),typeof m.close=="function"&&m.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(x){var _ref25,_ref25$useImageBitmap,m,T,_args5=arguments;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_ref25=_args5.length>1&&_args5[1]!==undefined?_args5[1]:{},_ref25$useImageBitmap=_ref25.useImageBitmap,m=_ref25$useImageBitmap===void 0?!0:_ref25$useImageBitmap;_context5.next=3;return S.loadImage(x,{useImageBitmap:m});case 3:T=_context5.sent;return _context5.abrupt("return",this.createTexture(T));case 5:case"end":return _context5.stop();}},_callee5,this);}));function loadTexture(_x6){return _loadTexture.apply(this,arguments);}return loadTexture;}()},{key:"createFBO",value:function createFBO(){var _ref26=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref26$color=_ref26.color,x=_ref26$color===void 0?1:_ref26$color,_ref26$blend=_ref26.blend,m=_ref26$blend===void 0?!1:_ref26$blend,_ref26$depth=_ref26.depth,T=_ref26$depth===void 0?this.options.depth!==!1:_ref26$depth,_ref26$stencil=_ref26.stencil,l=_ref26$stencil===void 0?!!this.options.stencil:_ref26$stencil;var d=this.gl,u=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,u);var g=[];for(var R=0;R<x;R++){var b=this.createTexture();d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0+R,d.TEXTURE_2D,b,0/* level */),g.push(b);}u.textures=g,u.texture=g[0],u.blend=m;var _this$canvas5=this.canvas,M=_this$canvas5.width,A=_this$canvas5.height;return T&&!l&&(u.depthBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,u.depthBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,M,A),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER,u.depthBuffer)),l&&!T&&(u.stencilBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,u.stencilBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.STENCIL_INDEX8,M,A),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.STENCIL_ATTACHMENT,d.RENDERBUFFER,u.stencilBuffer)),T&&l&&(u.depthStencilBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,u.depthStencilBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_STENCIL,M,A),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,u.depthStencilBuffer)),d.bindFramebuffer(d.FRAMEBUFFER,null),u;}},{key:"bindFBO",value:function bindFBO(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=x;}},{key:"render",value:function render(){var _ref27=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref27$clearBuffer=_ref27.clearBuffer,x=_ref27$clearBuffer===void 0?!0:_ref27$clearBuffer;this.startRender=!0;var m=this.gl;var T=this.program;T||(T=this.createProgram(),this.useProgram(T)),this.fbo&&m.bindFramebuffer(m.FRAMEBUFFER,this.fbo);var l=this.options.depth;l&&m.enable(m.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(l?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var d=this._renderFrameID;this._draw(),this.fbo&&m.bindFramebuffer(m.FRAMEBUFFER,null),this._renderFrameID===d&&(this._renderFrameID=null);}},{key:"update",value:function update(){this.startRender&&this._renderFrameID==null&&(this._renderFrameID=requestAnimationFrame(this.render.bind(this)));}}],[{key:"addLibs",value:function addLibs(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(s,x);}},{key:"FLOAT",value:function FLOAT(x,m){return Object(e.pointsToBuffer)(x,Float32Array,m);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(x,m){return Object(e.pointsToBuffer)(x,Uint8Array,m);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(x,m){return Object(e.pointsToBuffer)(x,Uint16Array,m);}},{key:"BYTE",value:function BYTE(x,m){return Object(e.pointsToBuffer)(x,Int8Array,m);}},{key:"SHORT",value:function SHORT(x,m){return Object(e.pointsToBuffer)(x,Int16Array,m);}}]);}();o(S,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),o(S,"UBYTE",S.UNSIGNED_BYTE),o(S,"USHORT",S.UNSIGNED_SHORT),o(S,"fetchShader",e.fetchShader),o(S,"loadImage",e.loadImage);},/* 16 */ /***/function(h,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 s;}),t.d(r,"fetchShader",function(){return p;}),t(1).glMatrix.setMatrixArrayType(Array);function e(c,v){var S=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var O=null;for(var x=0;x<S.length;++x){try{O=c.getContext(S[x],v);}catch(_unused6){}if(O)break;}return O;}function n(c,v){var S=e(c,v);if(!S)throw new Error("Sorry, your browser doesn't support WebGL.");return S;}function i(c,v,S){var O=c.createShader(c.VERTEX_SHADER);if(c.shaderSource(O,v),c.compileShader(O),!c.getShaderParameter(O,c.COMPILE_STATUS)){var _T7="Vertex shader failed to compile. The error log is:".concat(c.getShaderInfoLog(O));throw new Error(_T7);}var x=c.createShader(c.FRAGMENT_SHADER);if(c.shaderSource(x,S),c.compileShader(x),!c.getShaderParameter(x,c.COMPILE_STATUS)){var _T8="Fragment shader failed to compile. The error log is:".concat(c.getShaderInfoLog(x));throw new Error(_T8);}var m=c.createProgram();if(c.attachShader(m,O),c.attachShader(m,x),c.linkProgram(m),!c.getProgramParameter(m,c.LINK_STATUS)){var _T9="Shader program failed to link. The error log is:".concat(c.getProgramInfoLog(m));throw new Error(_T9);}return c.deleteShader(O),c.deleteShader(x),m;}function a(c){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Float32Array;var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(S&&!(S instanceof v))throw new TypeError("Wrong buffer type.");if(c==null||c instanceof v)return c;if(c[0]==null||c[0].length==null)return S?(S.set(c,0),S):new v(c);var O=c[0].length,x=c.length;S||(S=new v(O*x));var m=0;for(var _T10=0;_T10<x;_T10++)for(var _l7=0;_l7<O;_l7++)S[m++]=c[_T10][_l7];return S;}var o={};function s(c){var _ref28=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref28$useImageBitmap=_ref28.useImageBitmap,v=_ref28$useImageBitmap===void 0?!0:_ref28$useImageBitmap,_ref28$alias=_ref28.alias,S=_ref28$alias===void 0?null:_ref28$alias;if(!o[c]){if(typeof Image=="function"){var O=new Image();typeof c=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(c)&&(O.crossOrigin="anonymous"),o[c]=new Promise(function(x){O.onload=function(){v&&typeof createImageBitmap=="function"?createImageBitmap(O,{imageOrientation:"flipY"}).then(function(m){o[c]=m,S&&(o[S]=m),x(m);}):(o[c]=O,S&&(o[S]=O),x(O));},O.src=c;}),S&&(o[S]=o[c]);}else if(typeof fetch=="function")return fetch(c,{method:"GET",mode:"cors",cache:"default"}).then(function(O){return O.blob();}).then(function(O){return createImageBitmap(O,{imageOrientation:"flipY"}).then(function(x){return o[c]=x,S&&(o[S]=x),x;});});}return o[c];}var f={};function p(_x7){return _p.apply(this,arguments);}function _p(){_p=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(c){var v,S;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:if(!f[c]){_context6.next=2;break;}return _context6.abrupt("return",f[c]);case 2:_context6.next=4;return fetch(c);case 4:v=_context6.sent;if(!(v.status>=200&&v.status<300)){_context6.next=10;break;}_context6.next=8;return v.text();case 8:S=_context6.sent;return _context6.abrupt("return",(f[c]=S,S));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context6.stop();}},_callee6);}));return _p.apply(this,arguments);}},/* 17 */ /***/function(h,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\n\nvoid main() {\n gl_PointSize = 1.0;\n gl_Position = vec4(a_vertexPosition, 1);\n}";},/* 18 */ /***/function(h,r,t){t.r(r),r["default"]="#ifdef GL_ES\nprecision mediump float;\n#endif\n\nvoid main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.1);\n}";},/* 19 */ /***/function(h,r,t){t.r(r),r["default"]="attribute vec4 a_vertexPosition;\nattribute vec2 a_vertexTextureCoord;\nvarying vec2 vTextureCoord;\n\nvoid main() {\n gl_PointSize = 1.0;\n gl_Position = a_vertexPosition;\n vTextureCoord = a_vertexTextureCoord;\n}";},/* 20 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return a;});var e=t(21),n=t(25);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol("transform");var a=/*#__PURE__*/function(){function a(s,f){_classCallCheck(this,a);this.context=s.getContext("2d"),this.options=f,this[i]=[1,0,0,1,0,0];}return _createClass(a,[{key:"createTexture",value:function createTexture(s){return{_img:s};}},{key:"loadTexture",value:function(){var _loadTexture2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(s){var f;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e["default"].loadImage(s,{useImageBitmap:!1});case 2:f=_context7.sent;return _context7.abrupt("return",this.createTexture(f));case 4:case"end":return _context7.stop();}},_callee7,this);}));function loadTexture(_x8){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(s){return s;}},{key:"clear",value:function clear(s,f,p,c){var v=this.context;s=s||0,f=f||0,p=p||v.canvas.width-s,c=c||v.canvas.height-f,v.clearRect(s,f,p,c);}},{key:"drawMeshCloud",value:function drawMeshCloud(s){var _ref29=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref29$clear=_ref29.clear,f=_ref29$clear===void 0?!1:_ref29$clear;var p=[];for(var c=0;c<s.amount;c++){var v=s.getTransform(c);var S=s.getTextureFrame(c);S&&(S=S._img);var O=s.getFilter(c),_s$getCloudRGBA=s.getCloudRGBA(c),x=_s$getCloudRGBA.fill,m=_s$getCloudRGBA.stroke;p.push({mesh:s.mesh,_cloudOptions:[x,m,S,v,O]});}s.beforeRender&&s.beforeRender(this.context,s),this.drawMeshes(p,{clear:f,hook:!1}),s.afterRender&&s.afterRender(this.context,s);}},{key:"drawMeshes",value:function drawMeshes(s){var _this8=this;var _ref30=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref30$clear=_ref30.clear,f=_ref30$clear===void 0?!1:_ref30$clear,_ref30$hook=_ref30.hook,p=_ref30$hook===void 0?!0:_ref30$hook;var c=this.context;f&&c.clearRect(0,0,c.canvas.width,c.canvas.height);var v=null;var _c$canvas=c.canvas,S=_c$canvas.width,O=_c$canvas.height,x=s.length;s.forEach(function(m,T){var _m$_cloudOptions,_this8$filterBuffer;var l,d,u,g,M;p&&m.beforeRender&&m.beforeRender(c,m),m._cloudOptions&&((_m$_cloudOptions=_slicedToArray(m._cloudOptions,5),l=_m$_cloudOptions[0],d=_m$_cloudOptions[1],u=_m$_cloudOptions[2],g=_m$_cloudOptions[3],M=_m$_cloudOptions[4]),m=m.mesh);var A=m.filter;if(M&&(A=A?"".concat(A," ").concat(M):M),A&&!_this8.filterBuffer&&_this8.filterBuffer!==!1){var R=e["default"].createCanvas(S,O);R?_this8.filterBuffer=R.getContext("2d"):_this8.filterBuffer=!1;}v&&v!==A&&(Object(n.applyFilter)(_this8.filterBuffer,v),c.drawImage(_this8.filterBuffer.canvas,0,0,S,O),_this8.filterBuffer.clearRect(0,0,S,O),v=null),A&&_this8.filterBuffer?(_this8.filterBuffer.save(),(_this8$filterBuffer=_this8.filterBuffer).transform.apply(_this8$filterBuffer,_toConsumableArray(_this8[i])),Object(n.drawMesh2D)(m,_this8.filterBuffer,!1,l,d,u,g),_this8.filterBuffer.restore(),T===x-1?(Object(n.applyFilter)(_this8.filterBuffer,A),c.drawImage(_this8.filterBuffer.canvas,0,0,S,O),_this8.filterBuffer.clearRect(0,0,S,O)):v=A):(c.save(),c.transform.apply(c,_toConsumableArray(_this8[i])),Object(n.drawMesh2D)(m,c,!1,l,d,u,g),c.restore()),p&&m.afterRender&&m.afterRender(c,m);});}},{key:"setTransform",value:function setTransform(s){this[i]=s;}}]);}();},/* 21 */ /***/function(h,r,t){t.r(r),function(e){var n=t(14),i=t(23),a=t(24);t(1).glMatrix.setMatrixArrayType(Array);var o={};function s(S,O){var x=S.style,m=S.variant,T=S.weight,l=S.stretch,d=S.size,u=S.pxLineHeight,g=S.family;return l==="normal"?"".concat(x," ").concat(m," ").concat(T," ").concat(d*O,"px/").concat(u*O,"px ").concat(g):"".concat(x," ").concat(m," ").concat(T," ").concat(l," ").concat(d*O,"px/").concat(u*O,"px ").concat(g);}function f(S,_ref31){var O=_ref31.font,x=_ref31.fillColor,m=_ref31.strokeColor,T=_ref31.strokeWidth,_ref31$ratio=_ref31.ratio,l=_ref31$ratio===void 0?1:_ref31$ratio,d=_ref31.textCanvas,_ref31$cachable=_ref31.cachable,u=_ref31$cachable===void 0?!1:_ref31$cachable;var g;if(u){g=[S,O,String(x),String(m),String(T)].join("###");var G=o[g];if(G)return G;}d||(d=c(1,1));var M=d.getContext("2d");M.save(),M.font=O;var _M$measureText=M.measureText(S),A=_M$measureText.width;M.restore();var R=Object(i["default"])(O),b=Math.max(R.pxLineHeight,R.pxHeight*1.13);/italic|oblique/.test(O)&&(A+=b*Math.tan(15*Math.PI/180)),!x&&!m&&(x="#000");var E=M.canvas,L=Math.ceil(A),D=Math.ceil(b);E.width=Math.round(L*l),E.height=Math.round(D*l),M.save(),M.font=s(R,l),M.textAlign="center",M.textBaseline="middle";var I=E.height*0.5+R.pxHeight*0.05*l,C=E.width*0.5;if(x){if(Array.isArray(x))x=Object(a["default"])(x);else if(x.vector){var _G;var _x9=x,K=_x9.vector,J=_x9.colors;K.length===6?_G=M.createRadialGradient.apply(M,_toConsumableArray(K)):_G=M.createLinearGradient.apply(M,_toConsumableArray(K)),J.forEach(function(_ref32){var Z=_ref32.offset,B=_ref32.color;_G.addColorStop(Z,B);}),x=_G;}M.fillStyle=x,M.fillText(S,C,I);}if(m){if(M.lineWidth=T*l,Array.isArray(m))m=Object(a["default"])(m);else if(m.vector){var _G2;var _m=m,_K=_m.vector,_J=_m.colors;_K.length===6?_G2=M.createRadialGradient.apply(M,_toConsumableArray(_K)):_G2=M.createLinearGradient.apply(M,_toConsumableArray(_K)),_J.forEach(function(_ref33){var Z=_ref33.offset,B=_ref33.color;_G2.addColorStop(Z,B);}),m=_G2;}M.strokeStyle=m,M.strokeText(S,C,I);}M.restore();var W={image:d,rect:[0,0,L,D]};return u&&(o[g]=W),W;}var p=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var S=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);S&&(p=Number(S[1])<70);}function c(S,O){var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var m=x.offscreen||!p&&x.offscreen!==!1;var T;return _typeof(e)<"u"&&typeof e.createCanvas=="function"?T=e.createCanvas(S,O,x):m&&typeof OffscreenCanvas=="function"?T=new OffscreenCanvas(S,O):(T=document.createElement("canvas"),T.width=S,T.height=O),T;}var v={createCanvas:c,createText:f,loadImage:n["default"].loadImage};r["default"]=v;}.call(this,t(22));},/* 22 */ /***/function(h,r){var t;t=/* @__PURE__ */function(){return this;}();try{t=t||new Function("return this")();}catch(_unused7){(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&(t=window);}h.exports=t;},/* 23 */ /***/function(h,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"){var 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"};}var _m2=m,l=_m2.size,d=_m2.unit;if(d==="pt")l/=0.75;else if(d==="pc")l*=16;else if(d==="in")l*=96;else if(d==="cm")l*=96/2.54;else if(d==="mm")l*=96/25.4;else if(d==="em"||d==="rem"||d==="ex"){if(!T&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u3=getComputedStyle(document.documentElement).fontSize;T=e(_u3,16);}l*=T,d==="ex"&&(l/=2);}else if(d==="q")l*=96/25.4/4;else if(d==="vw"||d==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u4=d==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;l*=_u4/100;}}else if((d==="vmax"||d==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u5=document.documentElement.clientWidth,g=document.documentElement.clientHeight;d==="vmax"?l*=Math.max(_u5,g)/100:l*=Math.min(_u5,g)/100;}return l;}var n="bold|bolder|lighter|[1-9]00",i="italic|oblique",a="small-caps",o="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",s="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",f="'([^']+)'|\"([^\"]+)\"|([\\w-]|[\u4E00-\u9FA5])+",p=new RegExp("(".concat(n,") +"),"i"),c=new RegExp("(".concat(i,") +"),"i"),v=new RegExp("(".concat(a,") +"),"i"),S=new RegExp("(".concat(o,") +"),"i"),O=new RegExp("([\\d\\.]+)("+s+")(?:\\/([\\d\\.]+)("+s+"))? *((?:"+f+")( *, *(?:"+f+"))*)");function x(m,T){var l=O.exec(m);if(!l)return;var d=parseFloat(l[3]),u={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(l[1]),unit:l[2],lineHeight:Number.isFinite(d)?d:void 0,lineHeightUnit:l[4],family:l[5].replace(/ *, */g,",")},g=m.substring(0,l.index),M=p.exec(g),A=c.exec(g),R=v.exec(g),b=S.exec(g);return M&&(u.weight=M[1]),A&&(u.style=A[1]),R&&(u.variant=R[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;}},/* 24 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return"rgba(".concat(n.map(function(i,a){return a<3?Math.round(i*255):i;}).join(),")");}},/* 25 */ /***/function(h,r,t){t.r(r),t.d(r,"applyFilter",function(){return o;}),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 o(p,c){var v=p.canvas;p.save(),p.filter=c,p.drawImage(v,0,0,v.width,v.height),p.restore();}function s(p,c){var v=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;p=p.match(v).slice(1,5).map(Number),c=c.match(v).slice(1,5).map(Number);var S=[],O=c[3];for(var x=0;x<4;x++)S[x]=Object(a.mix)(p[x],c[x],O);return"rgba(".concat(S.join(),")");}function f(p,c){var v=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var S=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var O=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var x=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var m=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;c.save();var T=!1,l=!1;if(c.globalAlpha=p.getOpacity(),p._updateMatrix&&p.transformScale/p.contours.scale>1.5&&p.accurate(p.transformScale),p.lineWidth){var g=p.gradient&&p.gradient.stroke;if(g){var _g=g,M=_g.vector,A=_g.colors;if(M.length===6)g=c.createRadialGradient.apply(c,_toConsumableArray(M));else if(M.length===4)g=c.createLinearGradient.apply(c,_toConsumableArray(M));else if(M.length===3)g=c.createCircularGradient.apply(c,_toConsumableArray(M));else throw new TypeError("Invalid vector dimension.");A.forEach(function(_ref34){var R=_ref34.offset,b=_ref34.color;var E=Object(n["default"])(b);O&&(E=s(E,O)),g.addColorStop(R,E);}),c.strokeStyle=g,T=!0;}else p.strokeStyle&&(O?c.strokeStyle=s(p.strokeStyle,O):c.strokeStyle=p.strokeStyle,T=!0);}T&&(c.lineWidth=p.lineWidth,c.lineJoin=p.lineJoin,c.lineCap=p.lineCap,c.miterLimit=p.miterLimit,p.lineDash&&(c.setLineDash(p.lineDash),p.lineDashOffset&&(c.lineDashOffset=p.lineDashOffset)));var d=p.gradient&&p.gradient.fill;if(d){var _d3=d,_g2=_d3.vector,_M2=_d3.colors;if(_g2.length===6)d=c.createRadialGradient.apply(c,_toConsumableArray(_g2));else if(_g2.length===4)d=c.createLinearGradient.apply(c,_toConsumableArray(_g2));else if(_g2.length===3)d=c.createCircularGradient.apply(c,_toConsumableArray(_g2));else throw new TypeError("Invalid vector dimension.");_M2.forEach(function(_ref35){var A=_ref35.offset,R=_ref35.color;var b=Object(n["default"])(R);O&&(b=s(b,O)),d.addColorStop(A,b);}),c.fillStyle=d,l=!0;}else p.fillStyle&&(S?c.fillStyle=s(p.fillStyle,S):c.fillStyle=p.fillStyle,l=!0);if(m&&c.transform.apply(c,_toConsumableArray(m)),c.transform.apply(c,_toConsumableArray(p.transformMatrix)),p.clipPath){var _g3=p.clipPath,_M3=new Path2D(_g3);c.clip(_M3);}var u=p.contours.length;if(p.contours.forEach(function(g,M){var A=g.length,R=A>1&&e.vec2.equals(g[0],g[A-1]),b=M===u-1&&p.texture;if(g&&A>0){if(l||T||b){c.beginPath(),c.moveTo.apply(c,_toConsumableArray(g[0]));for(var E=1;E<A;E++)E===A-1&&R?c.closePath():c.lineTo.apply(c,_toConsumableArray(g[E]));}if(l&&c.fill(p.fillRule),b){c.save(),c.clip();var _p$texture=p.texture,_E=_p$texture.image,L=_p$texture.options;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.");var _E2=_E,D=_E2.font,I=_E2.fillColor,C=_E2.strokeColor,W=_E2.strokeWidth,G=_E2.text;!I&&!C&&(I="#000"),Array.isArray(I)&&(I=Object(n["default"])(I)),Array.isArray(C)&&(C=Object(n["default"])(C)),c.font=D;var _c$measureText=c.measureText(G),K=_c$measureText.width,J=Object(i["default"])(D),Z=Math.max(J.pxLineHeight,J.pxHeight*1.13);c.textAlign="center",c.textBaseline="middle";var B=L.rect,$=B[0]+Z*0.5+J.pxHeight*0.06,Q=B[1]+K*0.5;B[2]!=null&&c.scale(B[2]/K,B[3]/Z),I&&(c.fillStyle=I,c.fillText(G,Q,$)),C&&(c.lineWidth=W,c.strokeStyle=C,c.strokeText(G,Q,$));}else{var _D2=L.rect;var _I=L.srcRect;L.scale&&(_D2=[0,0,c.canvas.width,c.canvas.height]),L.rotated&&_D2&&(_D2=[-_D2[1],_D2[0],_D2[3],_D2[2]]),_I&&(_D2=_D2||[0,0,_I[2],_I[3]]),L.rotated&&(c.translate(0,_D2?_D2[2]:_E.width),c.rotate(-0.5*Math.PI)),_I?c.drawImage.apply(c,[_E].concat(_toConsumableArray(_I),_toConsumableArray(_D2))):_D2?c.drawImage.apply(c,[_E].concat(_toConsumableArray(_D2))):c.drawImage(_E,0,0);}c.restore();}T&&c.stroke();}}),c.restore(),v){var _g4=p.filter;_g4&&o(c,_g4);}}},/* 26 */ /***/function(h,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,o,s){var _ref36;return o>s&&(_ref36=[s,o],o=_ref36[0],s=_ref36[1],_ref36),a<o?o:a>s?s:a;}function n(a,o,s){return a*(1-s)+o*s;}function i(a,o){var _a2=_slicedToArray(a,2),s=_a2[0],f=_a2[1];return[s*o[0]+f*o[2]+o[4],s*o[1]+f*o[3]+o[5]];}},/* 27 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function i(f,p,c){var v=f.uniforms||{},S=p.uniforms||{};if(v.u_texSampler&&S.u_texSampler&&v.u_texSampler!==S.u_texSampler)return!1;var O=Object.keys(v),x=Object.keys(S),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;var l=O.every(function(d){var u=v[d],g=S[d];if(u===g)return!0;if(u.length&&g.length&&u.length===g.length){for(var M=0;M<u.length;M++)if(u[M]!==g[M])return!1;return!0;}return!1;});if(l){if(v.u_texSampler&&!S.u_texSampler)p.setTexture(v.u_texSampler,{hidden:!0});else if(!v.u_texSampler&&S.u_texSampler)for(var d=0;d<c.length;d++)c[d].setTexture(S.u_texSampler,{hidden:!0});}return l;}var a={};function o(f,p){if(f.length){var c=Object(e["default"])(f,a);return c.enableBlend=p,f[0].filterCanvas&&(c.filterCanvas=!0),c.packIndex=f[0].packIndex,c.packLength=f.length,c.beforeRender=f[0].beforeRender,c.pass=f[0].pass,c.afterRender=f[f.length-1].afterRender,f.length=0,c;}}function s(f,p){var c=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var v,S,O,x,m,_T11,_l8,u,d,_u6,g;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:v=[],S=f.options.bufferSize;O=0,x=!1;m=0;case 3:if(!(m<p.length)){_context8.next=47;break;}_T11=p[m];if(!(_T11 instanceof n["default"])){_context8.next=16;break;}_context8.t0=v.length;if(!_context8.t0){_context8.next=10;break;}_context8.next=10;return o(v,x);case 10:O=0;x=!1;_context8.next=14;return _T11;case 14:_context8.next=44;break;case 16:_l8=_T11.meshData;if(_l8.clipPath&&!_l8.uniforms.u_clipSampler){u=f.createTexture(_l8.clipPath);_l8.uniforms.u_clipSampler=u;}d=0;if(!((!c||!_T11.canIgnore())&&_l8&&_l8.positions.length)){_context8.next=40;break;}_T11.packIndex=m;_u6=_T11.filterCanvas;if(!(d=_l8.positions.length,_u6||O+d>S)){_context8.next=31;break;}_context8.t1=v.length;if(!_context8.t1){_context8.next=27;break;}_context8.next=27;return o(v,x);case 27:O=0;x=!1;_context8.next=39;break;case 31:if(!O){_context8.next=39;break;}g=v[v.length-1];_context8.t2=g&&(g.filterCanvas||g.afterRender||_T11.beforeRender||g.pass.length||_T11.pass.length||g.program!==_T11.program||!i(g,_T11,v));if(!_context8.t2){_context8.next=39;break;}_context8.next=37;return o(v,x);case 37:O=0;x=!1;case 39:v.push(_T11),x=x||_T11.enableBlend,O+=d;case 40:_context8.t3=m===p.length-1&&v.length;if(!_context8.t3){_context8.next=44;break;}_context8.next=44;return o(v,x);case 44:m++;_context8.next=3;break;case 47:case"end":return _context8.stop();}},_callee8);})();}},/* 28 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;}),t(1).glMatrix.setMatrixArrayType(Array);var e={UNSIGNED_BYTE:Uint8Array,UNSIGNED_SHORT:Uint16Array,BYTE:Int8Array,SHORT:Int16Array,FLOAT:Float32Array};function n(a,o){var s=0,f=0,p=0,c=0,v=0,S=0,O=0;var x=a[0].program;for(var m=0;m<a.length;m++){var _T12=a[m].meshData;if(_T12){O+=_T12.positions.length;var _l9=_T12.positions[0].length;s+=_T12.positions.length*_l9,f+=_T12.cells.length*3,S+=_T12.attributes.a_color.length*4;var d=_T12.textureCoord;d&&(p+=d.length*d[0].length);var u=_T12.attributes.a_sourceRect;u&&(c+=u.length*4);var g=_T12.attributes.a_clipUV;g&&(v+=g.length*2);}}if((!o.positions||o.positions.length<s)&&(o.positions=new Float32Array(s)),(!o.cells||o.cells.length<f)&&(o.cells=new Uint16Array(f)),p&&(!o.textureCoord||o.textureCoord.length<p)&&(o.textureCoord=new Float32Array(p)),(!o.a_color||o.a_color.length<S)&&(o.a_color=new Uint8Array(S)),c&&(!o.a_sourceRect||o.a_sourceRect.length<c)&&(o.a_sourceRect=new Float32Array(c)),v&&(!o.a_clipUV||o.a_clipUV.length<v)&&(o.a_clipUV=new Float32Array(v)),x){var _m3=Object.entries(x._attribute),_T13=x._attribOpts||{};for(var _l10=0;_l10<_m3.length;_l10++){var _m3$_l=_slicedToArray(_m3[_l10],2),_d4=_m3$_l[0],_u7=_m3$_l[1];if(_d4!=="a_color"&&_d4!=="a_sourceRect"&&_u7!=="ignored"){var _g5=_T13[_d4]?_T13[_d4].type:"FLOAT",M=e[_g5],A=_u7.size*O;(!o[_d4]||o[_d4].length<A)&&(o[_d4]=new M(A));}}}return o;}function i(a,o){var s=[],f=[],p=[],c=[],v=[],S=[],O=0,x=0;var m=a[0]?a[0].uniforms||{}:{},T=a[0]?a[0].program:null;o&&(n(a,o),f=o.cells,s=o.positions,p=o.textureCoord,c=o.a_color,v=o.a_sourceRect,S=o.a_clipUV);var l=!1,d=!1;var u={};for(var M=0;M<a.length;M++){var A=a[M];if(A){var _s2,_c2,_v,_S,_p2;if(A.meshData&&(A=A.meshData),o){var b=A.positions;for(var E=0;E<b.length;E++){var L=b[E],D=3*(O+E);for(var I=0;I<L.length;I++)s[D+I]=L[I];}}else(_s2=s).push.apply(_s2,_toConsumableArray(A.positions));var R=A.cells;for(var _b2=0;_b2<R.length;_b2++){var _E3=R[_b2];if(o){var _L2=3*(x+_b2);f[_L2]=_E3[0]+O,f[_L2+1]=_E3[1]+O,f[_L2+2]=_E3[2]+O;}else f.push([_E3[0]+O,_E3[1]+O,_E3[2]+O]);}if(o){var _b3=A.attributes.a_color;for(var _E4=0;_E4<_b3.length;_E4++){var _L3=_b3[_E4],_D3=4*(O+_E4);c[_D3]=_L3[0],c[_D3+1]=_L3[1],c[_D3+2]=_L3[2],c[_D3+3]=_L3[3];}}else(_c2=c).push.apply(_c2,_toConsumableArray(A.attributes.a_color));if(A.attributes.a_sourceRect)if(l=!0,o){var _b4=A.attributes.a_sourceRect;for(var _E5=0;_E5<_b4.length;_E5++){var _L4=_b4[_E5],_D4=4*(O+_E5);v[_D4]=_L4[0],v[_D4+1]=_L4[1],v[_D4+2]=_L4[2],v[_D4+3]=_L4[3];}}else(_v=v).push.apply(_v,_toConsumableArray(A.attributes.a_sourceRect));if(A.attributes.a_clipUV)if(d=!0,o){var _b5=A.attributes.a_clipUV;for(var _E6=0;_E6<_b5.length;_E6++){var _L5=_b5[_E6],_D5=2*(O+_E6);S[_D5]=_L5[0],S[_D5+1]=_L5[1];}}else(_S=S).push.apply(_S,_toConsumableArray(A.attributes.a_clipUV));if(A.textureCoord)if(o){var _b6=A.textureCoord;for(var _E7=0;_E7<_b6.length;_E7++){var _L6=_b6[_E7],_D6=3*(O+_E7);for(var _I2=0;_I2<_L6.length;_I2++)p[_D6+_I2]=_L6[_I2];}}else(_p2=p).push.apply(_p2,_toConsumableArray(A.textureCoord));if(T){var _b7=Object.entries(T._attribute);for(var _E8=0;_E8<_b7.length;_E8++){var _u$_L;var _b7$_E=_slicedToArray(_b7[_E8],2),_L7=_b7$_E[0],_D7=_b7$_E[1];if(_L7!=="a_color"&&_L7!=="a_sourceRect"&&_D7!=="ignored")if(u[_L7]=[],o){u[_L7]=o[_L7];var _I3=A.attributes[_L7],C=_I3[0].length;for(var W=0;W<_I3.length;W++){var G=_I3[W],K=C*(O+W);for(var J=0;J<G.length;J++)u[_L7][K+J]=G[J];}}else(_u$_L=u[_L7]).push.apply(_u$_L,_toConsumableArray(A.attributes[_L7]));}}O+=A.positions.length,x+=A.cells.length;}}u.a_color=c,l&&v&&v.length>0&&(u.a_sourceRect=v);var g={positions:s,cells:f,attributes:u,uniforms:m,cellsCount:x*3,program:T};return p&&p.length&&(g.textureCoord=p),d&&S.length>0&&(u.a_clipUV=S),g;}},/* 29 */ /***/function(h,r,t){t.r(r);var e=t(1),n=t(30),i=t(26),a=t(31);t(1).glMatrix.setMatrixArrayType(Array);function o(u,g){var M=Object.keys(u);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(u);g&&(A=A.filter(function(R){return Object.getOwnPropertyDescriptor(u,R).enumerable;})),M.push.apply(M,A);}return M;}function s(u){for(var g=1;g<arguments.length;g++){var M=arguments[g]!=null?arguments[g]:{};g%2?o(Object(M),!0).forEach(function(A){f(u,A,M[A]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(M)):o(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;}var p=Symbol("mesh"),c=Symbol("count"),v=Symbol("blend"),S=Symbol("filter"),O=Symbol("textures"),x=Symbol("textureOptions"),m=Symbol("cloudColor"),T=Symbol("cloudFilter"),l=Symbol("buffer");function d(u){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var M=new Float32Array(3*u),A=new Float32Array(3*u),R=new Float32Array(4*u),b=new Float32Array(4*u),E=new Float32Array(4*u),L=new Float32Array(4*u),D=new Float32Array(4*u),I=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),R.set(g.color0,0),b.set(g.color1,0),E.set(g.color2,0),L.set(g.color3,0),D.set(g.color4,0),I.set(g.frameIndex,0),C.set(g.fillColor,0),W.set(g.strokeColor,0)),{bufferSize:u,transform0:M,transform1:A,color0:R,color1:b,color2:E,color3:L,color4:D,frameIndex:I,fillColor:C,strokeColor:W};}r["default"]=/*#__PURE__*/function(){function _class(u){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _ref37=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref37$buffer=_ref37.buffer,M=_ref37$buffer===void 0?1e3:_ref37$buffer;_classCallCheck(this,_class);M=Math.max(M,g),this[c]=g,this[p]=u,this[l]=d(M),this[O]=[],this[S]=[],this[m]=!1,this[T]=!1,this[v]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var g=this[c];for(var M=u;M<g;M++)this[l].transform0.set([1,0,0],M*3),this[l].transform1.set([0,1,0],M*3),this[l].frameIndex.set([-1],M),this[l].fillColor.set([0,0,0,0],M*4),this[l].strokeColor.set([0,0,0,0],M*4),this.setColorTransform(M,null);}},{key:"bufferSize",get:function get(){return this[l].bufferSize;}},{key:"mesh",get:function get(){return this[p];},set:function set(u){this[p]=u,this[O]&&this.setTextureFrames(this[O],this[x]);}},{key:"hasCloudColor",get:function get(){return this[m];}},{key:"hasCloudFilter",get:function get(){return this[T];}},{key:"_getFilter",value:function _getFilter(u){return this[S][u]=this[S][u]||[],this[S][u];}},{key:"getFilter",value:function getFilter(u){return this._getFilter(u).join(" ");}},{key:"enableBlend",get:function get(){return this[p].enableBlend||this[v];}},{key:"canIgnore",value:function canIgnore(){return this[p].canIgnore();}},{key:"delete",value:function _delete(u){if(u>=this[c]||u<0)throw new Error("Out of range.");var _this$l2=this[l],g=_this$l2.transform0,M=_this$l2.transform1,A=_this$l2.color0,R=_this$l2.color1,b=_this$l2.color2,E=_this$l2.color3,L=_this$l2.color4,D=_this$l2.frameIndex,I=_this$l2.fillColor,C=_this$l2.strokeColor;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),R.set(R.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),I.set(I.subarray(4*(u+1)),4*u),C.set(C.subarray(4*(u+1)),4*u);for(var W in this[S])W===u?delete this[S][W]:W>u&&(this[S][W-1]=this[S][W],delete this[S][W]);this[c]--;}},{key:"setColorTransform",value:function setColorTransform(u,g){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=4;var _this$l3=this[l],M=_this$l3.color0,A=_this$l3.color1,R=_this$l3.color2,b=_this$l3.color3,E=_this$l3.color4;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),R.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[v]=this[v]||g[18]<1,this[T]=!0):(M.set([1,0,0,0],u),A.set([0,1,0,0],u),R.set([0,0,1,0],u),b.set([0,0,0,1],u),E.set([0,0,0,0],u)),this;}},{key:"getColorTransform",value:function getColorTransform(u){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=4;var _this$l4=this[l],g=_this$l4.color0,M=_this$l4.color1,A=_this$l4.color2,R=_this$l4.color3,b=_this$l4.color4;return[g[u],M[u],A[u],R[u],b[u],g[u+1],M[u+1],A[u+1],R[u+1],b[u+1],g[u+2],M[u+2],A[u+2],R[u+2],b[u+2],g[u+3],M[u+3],A[u+3],R[u+3],b[u+3]];}},{key:"transformColor",value:function transformColor(u,g){var M=this.getColorTransform(u);return M=Object(n.multiply)(M,g),this.setColorTransform(u,M),this;}},{key:"setFillColor",value:function setFillColor(u,g){if(u>=this[c]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[m]=!0),this[l].fillColor.set(g.map(function(M){return Math.round(255*M);}),4*u);}},{key:"setStrokeColor",value:function setStrokeColor(u,g){if(u>=this[c]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[m]=!0),this[l].strokeColor.set(g.map(function(M){return Math.round(255*M);}),4*u);}},{key:"getCloudRGBA",value:function getCloudRGBA(u){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=4;var _this$l5=this[l],g=_this$l5.fillColor,M=_this$l5.strokeColor,A=[g[u],g[u+1],g[u+2],g[u+3]],R=[M[u],M[u+1],M[u+2],M[u+3]];return A[3]/=255,R[3]/=255,{fill:"rgba(".concat(A.join(),")"),stroke:"rgba(".concat(R.join(),")")};}},{key:"grayscale",value:function grayscale(u,g){this.transformColor(u,Object(n.grayscale)(g)),this._getFilter(u).push("grayscale(".concat(100*g,"%)"));}},{key:"brightness",value:function brightness(u,g){this.transformColor(u,Object(n.brightness)(g)),this._getFilter(u).push("brightness(".concat(100*g,"%)"));}},{key:"saturate",value:function saturate(u,g){this.transformColor(u,Object(n.saturate)(g)),this._getFilter(u).push("saturate(".concat(100*g,"%)"));}},{key:"contrast",value:function contrast(u,g){this.transformColor(u,Object(n.contrast)(g)),this._getFilter(u).push("contrast(".concat(100*g,"%)"));}},{key:"invert",value:function invert(u,g){this.transformColor(u,Object(n.invert)(g)),this._getFilter(u).push("invert(".concat(100*g,"%)"));}},{key:"sepia",value:function sepia(u,g){this.transformColor(u,Object(n.sepia)(g)),this._getFilter(u).push("sepia(".concat(100*g,"%)"));}},{key:"opacity",value:function opacity(u,g){this.transformColor(u,Object(n.opacity)(g)),this._getFilter(u).push("opacity(".concat(100*g,"%)"));}},{key:"hueRotate",value:function hueRotate(u,g){this.transformColor(u,Object(n.hueRotate)(g)),this._getFilter(u).push("hue-rotate(".concat(g,"deg)"));}},{key:"setTransform",value:function setTransform(u,g){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=3,g==null&&(g=[1,0,0,1,0,0]);var _this$l6=this[l],M=_this$l6.transform0,A=_this$l6.transform1;return M.set([g[0],g[2],g[4]],u),A.set([g[1],g[3],g[5]],u),this;}},{key:"getTransform",value:function getTransform(u){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=3;var _this$l7=this[l],g=_this$l7.transform0,M=_this$l7.transform1;return[g[u],M[u],g[u+1],M[u+1],g[u+2],M[u+2]];}},{key:"getTextureFrame",value:function getTextureFrame(u){return this[O][this[l].frameIndex[u]];}},{key:"setTextureFrames",value:function setTextureFrames(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(u.length>12)throw new Error("Max frames exceed. Allow 12 frames.");u.length&&this[p].setTexture(u[0],g),this[O]=u,this[x]=g;}},{key:"setFrameIndex",value:function setFrameIndex(u,g){if(u>=this[c]||u<0)throw new Error("Out of range.");var M=this[O].length;if(M<=0)throw new Error("No frames");this[l].frameIndex[u]=g%M;}},{key:"amount",get:function get(){return this[c];},set:function set(u){var g=this[c];u!==g&&(u>this[l].bufferSize&&(this[l]=d(Math.max(u,this[l].bufferSize+1e3),this[l])),this[c]=u,u>g&&this.initBuffer(g));}},{key:"meshData",get:function get(){var _this$p$meshData=this[p].meshData,u=_this$p$meshData.attributes,g=_this$p$meshData.cells,M=_this$p$meshData.positions,A=_this$p$meshData.textureCoord,R=_this$p$meshData.uniforms,b=this[O],E={attributes:s({},u),cells:g,positions:M,textureCoord:A,uniforms:s({},R),instanceCount:this[c],enableBlend:this.enableBlend};b.length&&b.forEach(function($,Q){E.uniforms["u_texFrame".concat(Q)]=$;});var _this$l8=this[l],L=_this$l8.transform0,D=_this$l8.transform1,I=_this$l8.color0,C=_this$l8.color1,W=_this$l8.color2,G=_this$l8.color3,K=_this$l8.color4,J=_this$l8.fillColor,Z=_this$l8.strokeColor,B=_this$l8.frameIndex;return this[p].uniforms.u_texSampler&&(E.attributes.a_frameIndex={data:B,divisor:1}),E.attributes.a_transform0={data:L,divisor:1},E.attributes.a_transform1={data:D,divisor:1},E.attributes.a_colorCloud0={data:I,divisor:1},E.attributes.a_colorCloud1={data:C,divisor:1},E.attributes.a_colorCloud2={data:W,divisor:1},E.attributes.a_colorCloud3={data:G,divisor:1},E.attributes.a_colorCloud4={data:K,divisor:1},this.hasCloudColor&&(E.attributes.a_fillCloudColor={data:J,divisor:1},E.attributes.a_strokeCloudColor={data:Z,divisor:1}),E;}},{key:"setProgram",value:function setProgram(u){this[p].setProgram(u);}},{key:"program",get:function get(){return this[p].program;}},{key:"transform",value:function transform(u,g){var M=this.getTransform(u);return g=e.mat2d.multiply(Array.of(0,0,0,0,0,0),M,g),this.setTransform(u,g),this;}},{key:"translate",value:function translate(u,_ref38){var _ref39=_slicedToArray(_ref38,2),g=_ref39[0],M=_ref39[1];var A=e.mat2d.create();return A=e.mat2d.translate(Array.of(0,0,0,0,0,0),A,[g,M]),this.transform(u,A);}},{key:"rotate",value:function rotate(u,g){var _ref40=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref41=_slicedToArray(_ref40,2),M=_ref41[0],A=_ref41[1];var R=e.mat2d.create();return R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[M,A]),R=e.mat2d.rotate(Array.of(0,0,0,0,0,0),R,g),R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[-M,-A]),this.transform(u,R);}},{key:"scale",value:function scale(u,_ref42){var _ref43=_slicedToArray(_ref42,2),g=_ref43[0],_ref43$=_ref43[1],M=_ref43$===void 0?g:_ref43$;var _ref44=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref45=_slicedToArray(_ref44,2),A=_ref45[0],R=_ref45[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,R]),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,-R]),this.transform(u,b);}},{key:"skew",value:function skew(u,_ref46){var _ref47=_slicedToArray(_ref46,2),g=_ref47[0],_ref47$=_ref47[1],M=_ref47$===void 0?g:_ref47$;var _ref48=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref49=_slicedToArray(_ref48,2),A=_ref49[0],R=_ref49[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,R]),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,-R]),this.transform(u,b);}},{key:"isPointCollision",value:function isPointCollision(u,_ref50){var _this$p;var _ref51=_slicedToArray(_ref50,2),g=_ref51[0],M=_ref51[1];var A=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var R=this.getTransform(u),b=Object(i.transformPoint)([g,M],e.mat2d.invert(Array.of(0,0,0,0,0,0),R));return(_this$p=this[p]).isPointCollision.apply(_this$p,_toConsumableArray(b).concat([A]));}},{key:"isPointInFill",value:function isPointInFill(u,_ref52){var _ref53=_slicedToArray(_ref52,2),g=_ref53[0],M=_ref53[1];return this.isPointCollision(u,[g,M],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(u,_ref54){var _ref55=_slicedToArray(_ref54,2),g=_ref55[0],M=_ref55[1];return this.isPointCollision(u,[g,M],"stroke");}}]);}();},/* 30 */ /***/function(h,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 o;}),t.d(r,"contrast",function(){return s;}),t.d(r,"invert",function(){return f;}),t.d(r,"sepia",function(){return p;}),t.d(r,"opacity",function(){return c;}),t.d(r,"hueRotate",function(){return v;});var e=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(S,O){var x=[],m=S[0],T=S[1],l=S[2],d=S[3],u=S[4],g=S[5],M=S[6],A=S[7],R=S[8],b=S[9],E=S[10],L=S[11],D=S[12],I=S[13],C=S[14],W=S[15],G=S[16],K=S[17],J=S[18],Z=S[19];var B=O[0],$=O[1],Q=O[2],et=O[3],tt=O[4];return x[0]=B*m+$*g+Q*E+et*W,x[1]=B*T+$*M+Q*L+et*G,x[2]=B*l+$*A+Q*D+et*K,x[3]=B*d+$*R+Q*I+et*J,x[4]=B*u+$*b+Q*C+et*Z+tt,B=O[5],$=O[6],Q=O[7],et=O[8],tt=O[9],x[5]=B*m+$*g+Q*E+et*W,x[6]=B*T+$*M+Q*L+et*G,x[7]=B*l+$*A+Q*D+et*K,x[8]=B*d+$*R+Q*I+et*J,x[9]=B*u+$*b+Q*C+et*Z+tt,B=O[10],$=O[11],Q=O[12],et=O[13],tt=O[14],x[10]=B*m+$*g+Q*E+et*W,x[11]=B*T+$*M+Q*L+et*G,x[12]=B*l+$*A+Q*D+et*K,x[13]=B*d+$*R+Q*I+et*J,x[14]=B*u+$*b+Q*C+et*Z+tt,B=O[15],$=O[16],Q=O[17],et=O[18],tt=O[19],x[15]=B*m+$*g+Q*E+et*W,x[16]=B*T+$*M+Q*L+et*G,x[17]=B*l+$*A+Q*D+et*K,x[18]=B*d+$*R+Q*I+et*J,x[19]=B*u+$*b+Q*C+et*Z+tt,x;}function i(S){S=Object(e.clamp)(0,1,S);var O=0.2126*S,x=0.7152*S,m=0.0722*S;return[O+1-S,x,m,0,0,O,x+1-S,m,0,0,O,x,m+1-S,0,0,0,0,0,1,0];}function a(S){return[S,0,0,0,0,0,S,0,0,0,0,0,S,0,0,0,0,0,1,0];}function o(S){var O=0.2126*(1-S),x=0.7152*(1-S),m=0.0722*(1-S);return[O+S,x,m,0,0,O,x+S,m,0,0,O,x,m+S,0,0,0,0,0,1,0];}function s(S){var O=0.5*(1-S);return[S,0,0,0,O,0,S,0,0,O,0,0,S,0,O,0,0,0,1,0];}function f(S){var O=1-2*S;return[O,0,0,0,S,0,O,0,0,S,0,0,O,0,S,0,0,0,1,0];}function p(S){return[1-0.607*S,0.769*S,0.189*S,0,0,0.349*S,1-0.314*S,0.168*S,0,0,0.272*S,0.534*S,1-0.869*S,0,0,0,0,0,1,0];}function c(S){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,S,0];}function v(S){var O=S/180*Math.PI,x=Math.cos(O),m=Math.sin(O),T=0.2126,l=0.7152,d=0.0722;return[T+x*(1-T)+m*-T,l+x*-l+m*-l,d+x*-d+m*(1-d),0,0,T+x*-T+m*0.143,l+x*(1-l)+m*0.14,d+x*-d+m*-0.283,0,0,T+x*-T+m*-(1-T),l+x*-l+m*l,d+x*(1-d)+m*d,0,0,0,0,0,1,0];}},/* 31 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);function i(a){var o=n()(a);if(!o||!o.length)throw new TypeError("Invalid color value.");return[o[0]/255,o[1]/255,o[2]/255,o[3]];}},/* 32 */ /***/function(h,r,t){var e=t(33),n=t(37),i=t(39);h.exports=function(o){var s,f=e(o);return f.space?(s=Array(3),s[0]=i(f.values[0],0,255),s[1]=i(f.values[1],0,255),s[2]=i(f.values[2],0,255),f.space[0]==="h"&&(s=n.rgb(s)),s.push(i(f.alpha,0,1)),s):[];};},/* 33 */ /***/function(h,r,t){(function(e){var n=t(34),i=t(35),a=t(36);h.exports=s;var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function s(f){var p,c=[],v=1,S;if(typeof f=="string"){if(n[f])c=n[f].slice(),S="rgb";else if(f==="transparent")v=0,S="rgb",c=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(f)){var O=f.slice(1),x=O.length,m=x<=4;v=1,m?(c=[parseInt(O[0]+O[0],16),parseInt(O[1]+O[1],16),parseInt(O[2]+O[2],16)],x===4&&(v=parseInt(O[3]+O[3],16)/255)):(c=[parseInt(O[0]+O[1],16),parseInt(O[2]+O[3],16),parseInt(O[4]+O[5],16)],x===8&&(v=parseInt(O[6]+O[7],16)/255)),c[0]||(c[0]=0),c[1]||(c[1]=0),c[2]||(c[2]=0),S="rgb";}else if(p=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(f)){var T=p[1],l=T==="rgb",O=T.replace(/a$/,"");S=O;var x=O==="cmyk"?4:O==="gray"?1:3;c=p[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(o[M]!==void 0)return o[M];}return parseFloat(M);}),T===O&&c.push(1),v=l||c[x]===void 0?1:c[x],c=c.slice(0,x);}else f.length>10&&/[0-9](?:\s|\/)/.test(f)&&(c=f.match(/([0-9]+)/g).map(function(u){return parseFloat(u);}),S=f.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(f))S="rgb",c=[f>>>16,(f&65280)>>>8,f&255];else if(i(f)){var d=a(f.r,f.red,f.R,null);d!==null?(S="rgb",c=[d,a(f.g,f.green,f.G),a(f.b,f.blue,f.B)]):(S="hsl",c=[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)]),v=a(f.a,f.alpha,f.opacity,1),f.opacity!=null&&(v/=100);}else(Array.isArray(f)||e.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(f))&&(c=[f[0],f[1],f[2]],S="rgb",v=f.length===4?f[3]:1);return{space:S,values:c,alpha:v};}}).call(this,t(22));},/* 34 */ /***/function(h,r,t){h.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]};},/* 35 */ /***/function(h,r,t){var e=Object.prototype.toString;h.exports=function(n){var i;return e.call(n)==="[object Object]"&&(i=Object.getPrototypeOf(n),i===null||i===Object.getPrototypeOf({}));};},/* 36 */ /***/function(h,r){h.exports=function(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==void 0)return arguments[t];};},/* 37 */ /***/function(h,r,t){var e=t(38);h.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function rgb(n){var i=n[0]/360,a=n[1]/100,o=n[2]/100,s,f,p,c,v;if(a===0)return v=o*255,[v,v,v];o<0.5?f=o*(1+a):f=o+a-o*a,s=2*o-f,c=[0,0,0];for(var S=0;S<3;S++)p=i+1/3*-(S-1),p<0?p++:p>1&&p--,6*p<1?v=s+(f-s)*6*p:2*p<1?v=f:3*p<2?v=s+(f-s)*(2/3-p)*6:v=s,c[S]=v*255;return c;}},e.hsl=function(n){var i=n[0]/255,a=n[1]/255,o=n[2]/255,s=Math.min(i,a,o),f=Math.max(i,a,o),p=f-s,c,v,S;return f===s?c=0:i===f?c=(a-o)/p:a===f?c=2+(o-i)/p:o===f&&(c=4+(i-a)/p),c=Math.min(c*60,360),c<0&&(c+=360),S=(s+f)/2,f===s?v=0:S<=0.5?v=p/(f+s):v=p/(2-f-s),[c,v*100,S*100];};},/* 38 */ /***/function(h,r,t){h.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 */ /***/function(h,r){h.exports=t;function t(e,n,i){return n<i?e<n?n:e>i?i:e:e<i?i:e>n?n:e;}},/* 40 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return d;});var e=t(41),n=/* @__PURE__ */t.n(e),i=t(42),a=/* @__PURE__ */t.n(i),o=t(43),s=/* @__PURE__ */t.n(o),f=t(44),p=t(46),c=/* @__PURE__ */t.n(p),v=t(53),S=t(55);t(1).glMatrix.setMatrixArrayType(Array);var O=Symbol("contours"),x=Symbol("path"),m=Symbol("simplify"),T=Symbol("scale"),l=2*Math.PI;var d=/*#__PURE__*/function(){function d(){var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,d);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;}return _createClass(d,[{key:"contours",get:function get(){var g=null;if(!this[O]&&this[x]){var M=Object(f["default"])(s()(this[x]));this[O]=c()(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(function(M){return _toConsumableArray(M);}),g.path=this[O].path,g.simplify=this[O].simplify,g.scale=this[O].scale),g;}},{key:"path",get:function get(){return this[x];}},{key:"simplify",get:function get(){return this[m];}},{key:"boundingBox",get:function get(){var g=this.contours;if(g&&g.length){var M=g.reduce(function(A,R){return[].concat(_toConsumableArray(A),_toConsumableArray(R));});return a()(M);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var g=this.boundingBox;return g?[0.5*(g[0][0]+g[1][0]),0.5*(g[0][1]+g[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$x;var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var M=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var A=Object(f["default"])(s()(this[x])).map(function(_ref56){var _ref57=_toArray(_ref56),R=_ref57[0],b=_ref57.slice(1);var E=[R];for(var L=0;L<b.length;L+=2){var D=b[L]-g,I=b[L+1]-M;E.push(D,I);}return E;});return this.beginPath(),(_this$x=this[x]).push.apply(_this$x,_toConsumableArray(A)),this;}},{key:"getPointAtLength",value:function getPointAtLength(g){return this.contours?Object(v.getPointAtLength)(this[O],g):null;}},{key:"getTotalLength",value:function getTotalLength(){return this.contours?Object(v.getTotalLength)(this[O]):0;}},{key:"addPath",value:function addPath(g){var _this$x2;this[O]=null,typeof g=="string"&&(g=n()(g)),(_this$x2=this[x]).push.apply(_this$x2,_toConsumableArray(g));}},{key:"beginPath",value:function beginPath(){this[x]=[],this[O]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(g,M,A,R,b,E,L){var D=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(E+=b,L+=b,A<=0||R<=0||L===E)return;L<E&&(L=E+l+(L-E)%l),L-E>l&&(L=E+l);var I=L-E;I>=l&&(L-=1e-3);var C=this[x].length>0&&I<l?"L":"M";var W=Object(S.getPoint)(g,M,A,R,E),G=Object(S.getPoint)(g,M,A,R,L),K=+!D;var J=I>Math.PI?1:0;D&&(J=1-J),C+=W.join(" "),C+="A".concat(A," ").concat(R," 0 ").concat(J," ").concat(K," ").concat(G.join(" ")),I>=l&&(C+="Z"),this.addPath(C);}},{key:"arc",value:function arc(g,M,A,R,b){var E=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(g,M,A,A,0,R,b,E);}},{key:"arcTo",value:function arcTo(g,M,A,R,b,E,L){this[O]=null,this[x].push(["A",g,M,A,R,b,E,L]);}},{key:"moveTo",value:function moveTo(g,M){this[O]=null,this[x].push(["M",g,M]);}},{key:"lineTo",value:function lineTo(g,M){this[O]=null,this[x].push(["L",g,M]);}},{key:"bezierCurveTo",value:function bezierCurveTo(g,M,A,R,b,E){this[O]=null,this[x].push(["C",g,M,A,R,b,E]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(g,M,A,R){this[O]=null,this[x].push(["Q",g,M,A,R]);}},{key:"rect",value:function rect(g,M,A,R){var b="M".concat(g," ").concat(M,"L").concat(g+A," ").concat(M,"L").concat(g+A," ").concat(M+R,"L").concat(g," ").concat(M+R,"Z");this.addPath(b);}},{key:"closePath",value:function closePath(){this[O]=null;var g=[];var M=this[x].length;M>0&&(g=this[x][M-1]),g[0]!=="Z"&&g[0]!=="z"&&this[x].push(["Z"]);}}]);}();},/* 41 */ /***/function(h,r){h.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(o){var s=[];return o.replace(e,function(f,p,c){var v=p.toLowerCase();for(c=a(c),v=="m"&&c.length>2&&(s.push([p].concat(c.splice(0,2))),v="l",p=p=="m"?"l":"L");;){if(c.length==t[v])return c.unshift(p),s.push(c);if(c.length<t[v])throw new Error("malformed path data");s.push([p].concat(c.splice(0,t[v])));}}),s;}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function a(o){var s=o.match(i);return s?s.map(Number):[];}},/* 42 */ /***/function(h,r,t){h.exports=e;function e(n){var i=n.length;if(i===0)return[[],[]];for(var a=n[0].length,o=n[0].slice(),s=n[0].slice(),f=1;f<i;++f)for(var p=n[f],c=0;c<a;++c){var v=p[c];o[c]=Math.min(o[c],v),s[c]=Math.max(s[c],v);}return[o,s];}},/* 43 */ /***/function(h,r){h.exports=t;function t(e){var n=0,i=0,a=0,o=0;return e.map(function(s){s=s.slice();var f=s[0],p=f.toUpperCase();if(f!=p)switch(s[0]=p,f){case"a":s[6]+=a,s[7]+=o;break;case"v":s[1]+=o;break;case"h":s[1]+=a;break;default:for(var c=1;c<s.length;)s[c++]+=a,s[c++]+=o;}switch(p){case"Z":a=n,o=i;break;case"H":a=s[1];break;case"V":o=s[1];break;case"M":a=n=s[1],o=i=s[2];break;default:a=s[s.length-2],o=s[s.length-1];}return s;});}},/* 44 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(45);t(1).glMatrix.setMatrixArrayType(Array);function n(o){for(var s,f=[],p=0,c=0,v=0,S=0,O=null,x=null,m=0,T=0,l=0,d=o.length;l<d;l++){var u=o[l],g=u[0];switch(g){case"M":v=u[1],S=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(function(L){var _L8=_slicedToArray(L,8),D=_L8[0],I=_L8[1],C=_L8[2],W=_L8[3],G=_L8[4],K=_L8[5],J=_L8[6],Z=_L8[7];return{x1:C,y1:W,x2:G,y2:K,x:J,y:Z};});for(var A=0,R;A<M.length;A++)R=M[A],u=["C",R.x1,R.y1,R.x2,R.y2,R.x,R.y],A<M.length-1&&f.push(u);break;case"S":var b=m,E=T;(s=="C"||s=="S")&&(b+=b-p,E+=E-c),u=["C",b,E,u[1],u[2],u[3],u[4]];break;case"T":s=="Q"||s=="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,v,S);break;}s=g,m=u[u.length-2],T=u[u.length-1],u.length>4?(p=u[u.length-4],c=u[u.length-3]):(p=m,c=T),f.push(u);}return f;}function i(o,s,f,p){return["C",o,s,f,p,f,p];}function a(o,s,f,p,c,v){return["C",o/3+2/3*f,s/3+2/3*p,c/3+2/3*f,v/3+2/3*p,c,v];}},/* 45 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Math.PI*2;function n(s,f,p,c){var v=s*c-f*p<0?-1:1;var S=s*p+f*c;return S>1&&(S=1),S<-1&&(S=-1),v*Math.acos(S);}function i(s,f,p,c,v,S,O,x,m,T){var l=T*(s-p)/2+m*(f-c)/2,d=-m*(s-p)/2+T*(f-c)/2,u=O*O,g=x*x,M=l*l,A=d*d;var R=u*g-u*A-g*M;R<0&&(R=0),R/=u*A+g*M,R=Math.sqrt(R)*(v===S?-1:1);var b=R*O/x*d,E=R*-x/O*l,L=T*b-m*E+(s+p)/2,D=m*b+T*E+(f+c)/2,I=(l-b)/O,C=(d-E)/x,W=(-l-b)/O,G=(-d-E)/x,K=n(1,0,I,C);var J=n(I,C,W,G);return S===0&&J>0&&(J-=e),S===1&&J<0&&(J+=e),[L,D,K,J];}function a(s,f){var p=1.3333333333333333*Math.tan(f/4),c=Math.cos(s),v=Math.sin(s),S=Math.cos(s+f),O=Math.sin(s+f);return[c,v,c-v*p,v+c*p,S+O*p,O-S*p,S,O];}function o(s,f,p,c,v,S,O,x,m){var T=Math.sin(m*e/360),l=Math.cos(m*e/360),d=l*(s-p)/2+T*(f-c)/2,u=-T*(s-p)/2+l*(f-c)/2;if(d===0&&u===0)return[];if(O===0||x===0)return[];O=Math.abs(O),x=Math.abs(x);var g=d*d/(O*O)+u*u/(x*x);g>1&&(O*=Math.sqrt(g),x*=Math.sqrt(g));var M=i(s,f,p,c,v,S,O,x,T,l),A=[];var R=M[2],b=M[3];var E=Math.max(Math.ceil(Math.abs(b)/(e/4)),1);b/=E;for(var L=0;L<E;L++)A.push(a(R,b)),R+=b;return A.map(function(L){for(var D=0;D<L.length;D+=2){var I=L[D+0],C=L[D+1];I*=O,C*=x;var W=l*I-T*C,G=T*I+l*C;L[D+0]=W+M[0],L[D+1]=G+M[1];}return L;});}},/* 46 */ /***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(47),_t2=t(49),n=_t2.copy,i=t(50);function a(c,v,S){return c[0]=v,c[1]=S,c;}var o=[0,0],s=[0,0],f=[0,0];function p(c,v,S,O){e(S,a(o,O[1],O[2]),a(s,O[3],O[4]),a(f,O[5],O[6]),v,c);}h.exports=function(v,S,O){var x=[],m=[],T=[0,0];return v.forEach(function(l,d,u){if(l[0]==="M")n(T,l.slice(1)),m.length>0&&(x.push(m),m=[]);else if(l[0]==="C")p(m,S,T,l),a(T,l[5],l[6]);else throw new Error("illegal type in SVG: "+l[0]);}),m.length>0&&x.push(m),x.map(function(l){return i(l,O||0);});};},/* 47 */ /***/function(h,r,t){h.exports=t(48)();},/* 48 */ /***/function(h,r){function t(n){return[n[0],n[1]];}function e(n,i){return[n,i];}h.exports=function(i){i=i||{};var a=typeof i.recursion=="number"?i.recursion:8,o=typeof i.epsilon=="number"?i.epsilon:11920929e-14,s=typeof i.pathEpsilon=="number"?i.pathEpsilon:1,f=typeof i.angleEpsilon=="number"?i.angleEpsilon:0.01,p=i.angleTolerance||0,c=i.cuspLimit||0;return function(x,m,T,l,d,u){u||(u=[]),d=typeof d=="number"?d:1;var g=s/d;return g*=g,v(x,m,T,l,u,g),u;};function v(O,x,m,T,l,d){l.push(t(O));var u=O[0],g=O[1],M=x[0],A=x[1],R=m[0],b=m[1],E=T[0],L=T[1];S(u,g,M,A,R,b,E,L,l,d,0),l.push(t(T));}function S(O,x,m,T,l,d,u,g,M,A,R){if(!(R>a)){var b=Math.PI,E=(O+m)/2,L=(x+T)/2,D=(m+l)/2,I=(T+d)/2,C=(l+u)/2,W=(d+g)/2,G=(E+D)/2,K=(L+I)/2,J=(D+C)/2,Z=(I+W)/2,B=(G+J)/2,$=(K+Z)/2;if(R>0){var Q=u-O,et=g-x,tt=Math.abs((m-u)*et-(T-g)*Q),ot=Math.abs((l-u)*et-(d-g)*Q),q,gt;if(tt>o&&ot>o){if((tt+ot)*(tt+ot)<=A*(Q*Q+et*et)){if(p<f){M.push(e(B,$));return;}var dt=Math.atan2(d-T,l-m);if(q=Math.abs(dt-Math.atan2(T-x,m-O)),gt=Math.abs(Math.atan2(g-d,u-l)-dt),q>=b&&(q=2*b-q),gt>=b&&(gt=2*b-gt),q+gt<p){M.push(e(B,$));return;}if(c!==0){if(q>c){M.push(e(m,T));return;}if(gt>c){M.push(e(l,d));return;}}}}else if(tt>o){if(tt*tt<=A*(Q*Q+et*et)){if(p<f){M.push(e(B,$));return;}if(q=Math.abs(Math.atan2(d-T,l-m)-Math.atan2(T-x,m-O)),q>=b&&(q=2*b-q),q<p){M.push(e(m,T)),M.push(e(l,d));return;}if(c!==0&&q>c){M.push(e(m,T));return;}}}else if(ot>o){if(ot*ot<=A*(Q*Q+et*et)){if(p<f){M.push(e(B,$));return;}if(q=Math.abs(Math.atan2(g-d,u-l)-Math.atan2(d-T,l-m)),q>=b&&(q=2*b-q),q<p){M.push(e(m,T)),M.push(e(l,d));return;}if(c!==0&&q>c){M.push(e(l,d));return;}}}else if(Q=B-(O+u)/2,et=$-(x+g)/2,Q*Q+et*et<=A){M.push(e(B,$));return;}}S(O,x,E,L,G,K,B,$,M,A,R+1),S(B,$,J,Z,C,W,u,g,M,A,R+1);}}};},/* 49 */ /***/function(h,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 o;}),t.d(r,"dot",function(){return s;}),t.d(r,"rotate",function(){return f;}),t.d(r,"cross",function(){return p;}),t.d(r,"sub",function(){return c;}),t.d(r,"add",function(){return v;}),t.d(r,"computeMiter",function(){return m;}),t.d(r,"normal",function(){return T;}),t.d(r,"direction",function(){return l;});var e=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(d){return[d[0],d[1]];}function i(){return[0,0];}var a=e.vec2.copy,o=e.vec2.scaleAndAdd,s=e.vec2.dot,f=e.vec2.rotate,p=e.vec2.cross,c=e.vec2.sub,v=e.vec2.add,S=e.vec2.normalize,O=e.vec2.set,x=i();function m(d,u,g,M,A){v(d,g,M),S(d,d),O(u,-d[1],d[0]),O(x,-g[1],g[0]);var R=A/s(u,x);return Math.abs(R);}function T(d,u){return O(d,-u[1],u[0]),d;}function l(d,u,g){return c(d,u,g),S(d,d),d;}},/* 50 */ /***/function(h,r,t){var e=t(51),n=t(52);h.exports=function(a,o){return a=e(a,o),a=n(a,o),a;},h.exports.radialDistance=e,h.exports.douglasPeucker=n;},/* 51 */ /***/function(h,r){function t(e,n){var i=e[0]-n[0],a=e[1]-n[1];return i*i+a*a;}h.exports=function(n,i){if(n.length<=1)return n;i=typeof i=="number"?i:1;for(var a=i*i,o=n[0],s=[o],f,p=1,c=n.length;p<c;p++)f=n[p],t(f,o)>a&&(s.push(f),o=f);return o!==f&&s.push(f),s;};},/* 52 */ /***/function(h,r){function t(n,i,a){var o=i[0],s=i[1],f=a[0]-o,p=a[1]-s;if(f!==0||p!==0){var c=((n[0]-o)*f+(n[1]-s)*p)/(f*f+p*p);c>1?(o=a[0],s=a[1]):c>0&&(o+=f*c,s+=p*c);}return f=n[0]-o,p=n[1]-s,f*f+p*p;}function e(n,i,a,o,s){for(var f=o,p,c=i+1;c<a;c++){var v=t(n[c],n[i],n[a]);v>f&&(p=c,f=v);}f>o&&(p-i>1&&e(n,i,p,o,s),s.push(n[p]),a-p>1&&e(n,p,a,o,s));}h.exports=function(i,a){if(i.length<=1)return i;a=typeof a=="number"?a:1;var o=a*a,s=i.length-1,f=[i[0]];return e(i,0,s,o,f),f.push(i[s]),f;};},/* 53 */ /***/function(h,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 o;});var e=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(s){if(s.totalLength!=null)return s.totalLength;var f=0;return s.forEach(function(p){var c=p[0];for(var v=1;v<p.length;v++){var S=p[v];f+=Object(e.distance)(c,S),c=S;}}),s.totalLength=f,f;}function i(s,f){var p=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!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");var c=n(s);if(f>=c){var S=s[s.length-1],O=S[S.length-2],x=S[S.length-1],m=Math.atan2(x[1]-O[1],x[0]-O[0]);return{current:s.map(function(T){return _toConsumableArray(T);}),point:{x:x[0],y:x[1],angle:m}};}var v=[];for(var _S2=0;_S2<s.length;_S2++){v[_S2]=[];var _O=s[_S2];var _x10=_O[0];for(var _m4=1;_m4<_O.length;_m4++){var _T14=_O[_m4],_l11=Object(e.distance)(_x10,_T14);if(f<_l11){var d=f/_l11,u=Math.atan2(_T14[1]-_x10[1],_T14[0]-_x10[0]),g={x:_x10[0]*(1-d)+_T14[0]*d,y:_x10[1]*(1-d)+_T14[1]*d,angle:u};if(v[_S2].push(_x10),f>0&&v[_S2].push([g.x,g.y]),!p)return{current:v,point:g};var M=[],A=_S2;for(;_S2<s.length;_S2++){for(M[_S2-A]=[],_S2===A&&M[0].push([g.x,g.y]);_m4<_O.length;_m4++)M[_S2-A].push(_O[_m4]);_m4=0;}return{current:v,point:g,rest:M};}f-=_l11,v[_S2].push(_x10),_x10=_T14;}}}function a(s,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(s.length<=0)return{x:0,y:0,angle:0};if(f<=0){var p=s[0][0],c=s[0][1],v=Math.atan2(c[1]-p[1],c[0]-p[0]);return{x:p[0],y:p[1],angle:v};}return i(s,f,!1).point;}function o(s,f,p){var c=0,v=f[0],S=s;var O=[],x=f.length;if(p>0){do p-=f[c%x],c++;while(p>0);p<0&&(v=-p,c--);}else if(p<0){c=-1;do p+=f[c%x+x-1],c--;while(p<0);p>=0&&(c++,v=f[c%x+x-1]-p);}do{var m=i(S,v);S=m.rest,++c%2&&O.push.apply(O,_toConsumableArray(m.current));var _T15=c%x;_T15<0&&(_T15+=x),v=f[_T15];}while(S);return O;}},/* 54 */ /***/function(h,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(_ref58,s,f,p){var _ref59=_slicedToArray(_ref58,3),i=_ref59[0],a=_ref59[1],o=_ref59[2];return i=i*2/s-1,a=1-a*2/f,Number.isFinite(p)?(o=o*2/p-1,[i,a,o]):[i,a];}function n(_ref60,_ref61){var _ref62=_slicedToArray(_ref60,3),i=_ref62[0],a=_ref62[1],_ref62$=_ref62[2],o=_ref62$===void 0?0:_ref62$;var _ref63=_slicedToArray(_ref61,3),s=_ref63[0],f=_ref63[1],_ref63$=_ref63[2],p=_ref63$===void 0?0:_ref63$;return Math.hypot(s-i,f-a,p-o);}},/* 55 */ /***/function(h,r,t){t.r(r),t.d(r,"getPoint",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Math.PI*2;function n(i,a,o,s,f){f%=e,f<0&&(f+=e);var p=Math.tan(f);if(Math.abs(p)<1e5){var c=a-p*i,v=1/Math.pow(o,2)+Math.pow(p,2)/Math.pow(s,2);var S=-1;(f<=Math.PI/2||f>3*Math.PI/2)&&(S=1);var O=S*Math.sqrt(1/v)+i,x=p*O+c;return[O,x];}return f<Math.PI?[i,a+s]:[i,a-s];}},/* 56 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return V;});var e=t(1),n=t(42),i=/* @__PURE__ */t.n(n),a=t(57),o=t(28),s=t(24),f=t(30),p=t(59),c=t(53),v=t(60),S=/* @__PURE__ */t.n(v),O=t(46),x=/* @__PURE__ */t.n(O),m=t(31),T=t(40),l=t(21);t(1).glMatrix.setMatrixArrayType(Array);function d(X,N){if(X==null)return{};var z=u(X,N),y,P;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(X);for(P=0;P<w.length;P++)y=w[P],!(N.indexOf(y)>=0)&&Object.prototype.propertyIsEnumerable.call(X,y)&&(z[y]=X[y]);}return z;}function u(X,N){if(X==null)return{};var z={},y=Object.keys(X),P,w;for(w=0;w<y.length;w++)P=y[w],!(N.indexOf(P)>=0)&&(z[P]=X[P]);return z;}var g=Symbol("mesh"),M=Symbol("contours"),A=Symbol("stroke"),R=Symbol("fill"),b=Symbol("strokeColor"),E=Symbol("fillColor"),L=Symbol("transform"),D=Symbol("invertTransform"),I=Symbol("uniforms"),C=Symbol("texOptions"),W=Symbol("blend"),G=Symbol("applyTexture"),K=Symbol("applyTransform"),J=Symbol("applyGradientTransform"),Z=Symbol("applyProgram"),B=Symbol("gradient"),$=Symbol("filter"),Q=Symbol("opacity"),et=Symbol("program"),tt=Symbol("attributes"),ot=Symbol("pass"),q=Symbol("clipContext"),gt=Symbol("applyClipPath");function dt(X,N){var z=X[1][0]-X[0][0],y=X[1][1]-X[0][1],P=[];for(var w=0;w<N.length;w++){var U=N[w],H=[(U[0]-X[0][0])/z,1-(U[1]-X[0][1])/y];P.push(H);}return P;}function F(_ref64,_ref65,_ref66){var _ref67=_slicedToArray(_ref64,2),X=_ref67[0],N=_ref67[1];var _ref68=_slicedToArray(_ref65,4),z=_ref68[0],y=_ref68[1],P=_ref68[2],w=_ref68[3];var U=_ref66.scale;return U||(X/=P,N=1-N/w,X-=z,N+=y),[X,N,0];}function j(X,N,z){var y=x()(X,N,z);return y.path=X,y.simplify=z,y.scale=N,y;}var V=/*#__PURE__*/function(){function V(N){_classCallCheck(this,V);this[A]=null,this[R]=null,this[L]=[1,0,0,1,0,0],this[Q]=1,this[I]={},this[$]=[],this[W]=null,this[C]={},this.contours=N.contours,this[et]=null,this[tt]={},this[ot]=[];}return _createClass(V,[{key:"contours",get:function get(){return this[M];},set:function set(N){this[g]=null,this[M]=N;var z=N.scale;this.transformScale/z>1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(N){this[et]=N,this[g]&&this[Z](N);}},{key:"program",get:function get(){return this[et];}},{key:"setAttribute",value:function setAttribute(N,z){z==null?delete this[tt][N]:this[tt][N]=z;}},{key:"getOpacity",value:function getOpacity(){return this[Q];}},{key:"setOpacity",value:function setOpacity(N){if(N<0||N>1)throw new TypeError("Invalid opacity value.");this[g]&&this[g].positions.forEach(function(z){z[2]=1/z[2]>0?N:-N;}),this[Q]=N;}},{key:"setClipPath",value:function setClipPath(N){this.clipPath=N,this[I].u_clipSampler&&this[I].u_clipSampler["delete"](),this.setUniforms({u_clipSampler:null}),this[g]&&delete this[g].attributes.a_clipUV,N&&this[g]&&this[gt]();}},{key:gt,value:function value(){if(this.clipPath){this[q]||(this[q]=l["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),N=_this$boundingBox$[0],z=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),y=_this$boundingBox$2[0],P=_this$boundingBox$2[1];y&&P&&(this[q].width=y-N,this[q].height=P-z);var 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,-z),w.fillStyle="white",w.fill(U),w.restore(),this[g].clipPath=this[q];var H=dt(this.boundingBox,this[g].position0);this[g].attributes.a_clipUV=H;}}},{key:"getPointAtLength",value:function getPointAtLength(N){return Object(c.getPointAtLength)(this[M],N);}},{key:"getTotalLength",value:function getTotalLength(){return Object(c.getTotalLength)(this[M]);}},{key:"blend",get:function get(){return this[W]==null?"auto":this[W];}},{key:"blend",set:function set(N){this[W]=N,this[g]&&(this[g].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[g]&&this[g].boundingBox)return this[g].boundingBox;var N=this.meshData;if(N){var z=N.position0;if(z.length)N.boundingBox=i()(z);else return[[0,0],[0,0]];return N.boundingBox;}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var N=this.boundingBox;return N?[0.5*(N[0][0]+N[1][0]),0.5*(N[0][1]+N[1][1])]:[0,0];}},{key:"fillRule",get:function get(){return this[R]?this[R].rule:"nonzero";}},{key:"lineWidth",get:function get(){return this[A]?this[A].lineWidth:0;}},{key:"lineCap",get:function get(){return this[A]?this[A].lineCap:"";}},{key:"lineJoin",get:function get(){return this[A]?this[A].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[A]?this[A].miterLimit:0;}},{key:"strokeStyle",get:function get(){return this[b]&&this[b][3]!==0?Object(s["default"])(this[b]):"";}},{key:"lineDash",get:function get(){return this[A]?this[A].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[A]?this[A].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[E]&&this[E][3]!==0?Object(s["default"])(this[E]):"";}},{key:"gradient",get:function get(){return this[B];}},{key:"texture",get:function get(){return this[I].u_texSampler?{image:this[I].u_texSampler._img,options:this[C]}:null;}},{key:"enableBlend",get:function get(){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[I].u_colorMatrix!=null&&this[I].u_colorMatrix[18]<1||this[I].u_radialGradientVector!=null||this.beforeRender||this.afterRender;}},{key:"filterCanvas",get:function get(){return /blur|drop-shadow|url/.test(this.filter);}},{key:"filter",get:function get(){return this[$].join(" ");}},{key:"transformMatrix",get:function get(){return this[L];}},{key:"invertMatrix",get:function get(){if(!this[D]){var N=e.mat2d.invert(Array.of(0,0,0,0,0,0),this[L]);this[D]=N;}return this[D];}},{key:"transformScale",get:function get(){var N=this[L];return Math.max(Math.hypot(N[0],N[1]),Math.hypot(N[2],N[3]));}},{key:"uniforms",get:function get(){return this[I];}},{key:"pass",get:function get(){return this[ot];}},{key:Z,value:function value(N){var z=this[tt],y=this[g].position0,P=Object.entries(N._attribute);for(var w=0;w<P.length;w++){var _P$w=_slicedToArray(P[w],2),U=_P$w[0],H=_P$w[1];if(U!=="a_color"&&U!=="a_sourceRect"&&H!=="ignored"){var Y=z[U];if(U==="uv"&&!Y){var k=this[g].boundingBox||i()(y);this[g].attributes[U]=dt(k,y);}else{this[g].attributes[U]=[];for(var _k=0;_k<y.length;_k++){var rt=y[_k];this[g].attributes[U].push(Y?Y(rt,w,y):Array(H.size).fill(0));}}}}}// {stroke, fill}
51
+ },{key:"meshData",get:function get(){var _this9=this;if(this._updateMatrix&&this.transformScale/this.contours.scale>1.5&&this.accurate(this.transformScale),!this[g]){!this[R]&&!this[A]&&this.setFill();var N=this[M],z={};if(N&&N.length){if(this[R])try{var w=S()(N,this[R]);w.positions=w.positions.map(function(U){return U.push(_this9[Q]),U;}),w.attributes={a_color:Array.from({length:w.positions.length}).map(function(){return _this9[E].map(function(U){return Math.round(255*U);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),
52
+ },z.fill=w;}catch(_unused8){}if(this[A]){var _w=this[A].lineDash;var U=N;if(_w){var Y=this[A].lineDashOffset;U=Object(c.getDashContours)(N,_w,Y);}var H=U.map(function(Y,k){var rt=Y.length>1&&e.vec2.equals(Y[0],Y[Y.length-1]),it=_this9[A].build(Y,rt);return S()([it]);});H.forEach(function(Y){Y.positions=Y.positions.map(function(k){return k.push(-_this9[Q]),k;}),Y.attributes={a_color:Array.from({length:Y.positions.length}).map(function(){return _this9[b].map(function(k){return Math.round(255*k);});})};}),z.stroke=Object(o["default"])(H);}}var y=Object(o["default"])([z.fill,z.stroke]);y.fillPointCount=z.fill?z.fill.positions.length:0,y.enableBlend=this.enableBlend,y.position0=y.positions.map(function(_ref69){var _ref70=_slicedToArray(_ref69,3),w=_ref70[0],U=_ref70[1],H=_ref70[2];return[w,U,H];}),y.uniforms=this[I],this[g]=y,this[I].u_texSampler&&this[G](y,this[C]);var P=this[L];Object(p.isUnitTransform)(P)||(this[K](y,P),this[I].u_radialGradientVector&&this[J]()),this.clipPath&&this[gt](),this[et]&&this[Z](this[et]);}return this._updateMatrix&&(this[g].matrix=this[L],this[K](this[g],this[L]),this[I].u_radialGradientVector&&this[J]()),this[g];}},{key:K,value:function value(N,z){var y=N.positions,P=N.position0;for(var w=0;w<y.length;w++){var _P$w2=_slicedToArray(P[w],2),U=_P$w2[0],H=_P$w2[1],Y=y[w];Y[0]=U*z[0]+H*z[2]+z[4],Y[1]=U*z[1]+H*z[3]+z[5];}this._updateMatrix=!1;}},{key:J,value:function value(){var N=this[L],z=_toConsumableArray(this._radialGradientVector);if(z){var _z=_slicedToArray(z,5),y=_z[0],P=_z[1],w=_z[3],U=_z[4];z[0]=y*N[0]+P*N[2]+N[4],z[1]=y*N[1]+P*N[3]+N[5],z[3]=w*N[0]+U*N[2]+N[4],z[4]=w*N[1]+U*N[3]+N[5],this[I].u_radialGradientVector=z;}}},{key:G,value:function value(N,z){function y(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];}var P=this[I].u_texSampler;if(!P)return;var _P$_img=P._img,w=_P$_img.width,U=_P$_img.height,H=z.srcRect;var Y=z.rect||[0,0];if(z.rotated&&(Y=[-Y[1],Y[0],Y[3],Y[2]]),Y[2]==null&&(Y[2]=H?H[2]:w),Y[3]==null&&(Y[3]=H?H[3]:U),z.hidden)N.textureCoord=N.positions.map(function(){return[-1,-1,-1];});else if(!N.textureCoord||!y(this[C].rect,z.rect)||this[C].hidden!==z.hidden||this[C].rotated!==z.rotated){var k=null;z.rotated&&(k=e.mat2d.rotate(Array.of(0,0,0,0,0,0),e.mat2d.fromValues(1,0,0,1,0,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(function(_ref71){var _ref72=_slicedToArray(_ref71,3),rt=_ref72[0],it=_ref72[1],lt=_ref72[2];if(1/lt>0){if(z.rotated){var at=rt*k[0]+it*k[2]+k[4],st=rt*k[1]+it*k[3]+k[5];rt=at;it=st;}var ut=F([rt,it],[Y[0]/Y[2],Y[1]/Y[3],Y[2],Y[3]],z);return z.repeat&&(ut[2]=1),ut;}return[-1,-1,-1];});}if(H){var _k2=[H[0]/w,H[1]/U,H[2]/w,H[3]/U];N.attributes.a_sourceRect=N.positions.map(function(){return[].concat(_k2);});}else N.attributes.a_sourceRect=N.positions.map(function(){return[0,0,0,0];});}},{key:"accurate",value:function accurate(N){if(!this.contours)return;if(this.contours.path){var y=this.contours.simplify,P=j(this.contours.path,2*N,y);this[g]=null,this[M]=P;}}},{key:"canIgnore",value:function canIgnore(){var N=this[A]==null||this[A].lineWidth===0||this[b][3]===0,z=this[R]==null||this[E][3]===0,y=this[I].u_radialGradientVector==null,P=this[I].u_texSampler==null;return this[Q]===0||this[et]==null&&N&&z&&y&&P&&!this.beforeRender&&!this.afterRender;}// join: 'miter' or 'bevel'
53
+ // cap: 'butt' or 'square'
54
+ // lineDash: null
55
+ // lineDashOffset: 0
56
+ },{key:"setStroke",value:function setStroke(){var _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref73$thickness=_ref73.thickness,N=_ref73$thickness===void 0?1:_ref73$thickness,_ref73$cap=_ref73.cap,z=_ref73$cap===void 0?"butt":_ref73$cap,_ref73$join=_ref73.join,y=_ref73$join===void 0?"miter":_ref73$join,_ref73$miterLimit=_ref73.miterLimit,P=_ref73$miterLimit===void 0?10:_ref73$miterLimit,_ref73$color=_ref73.color,w=_ref73$color===void 0?[0,0,0,0]:_ref73$color,_ref73$lineDash=_ref73.lineDash,U=_ref73$lineDash===void 0?null:_ref73$lineDash,_ref73$lineDashOffset=_ref73.lineDashOffset,H=_ref73$lineDashOffset===void 0?0:_ref73$lineDashOffset,_ref73$roundSegments=_ref73.roundSegments,Y=_ref73$roundSegments===void 0?20:_ref73$roundSegments;return this[g]=null,this[A]=new a["default"]({lineWidth:N,lineCap:z,lineJoin:y,miterLimit:P,roundSegments:Y}),typeof w=="string"&&(w=Object(m["default"])(w)),this[b]=w,this[A].lineDash=U,this[A].lineDashOffset=H,this;}},{key:"setFill",value:function setFill(){var _ref74=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref74$rule=_ref74.rule,N=_ref74$rule===void 0?this.fillRule:_ref74$rule,_ref74$color=_ref74.color,z=_ref74$color===void 0?[0,0,0,0]:_ref74$color;return this[g]=null,this[R]={rule:N},typeof z=="string"&&(z=Object(m["default"])(z)),this[E]=z,this;}/**
57
+ options: {
58
+ scale: false,
59
+ repeat: false,
60
+ rotated: false,
61
+ rect: [10, 10],
62
+ srcRect: [...],
63
+ hidden: false,
64
+ }
65
+ */},{key:"setTexture",value:function setTexture(N){var z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(N&&N.image){var _N=N,y=_N.image,P=_N.rect;if(N=y,z.rect)for(var w=0;w<z.rect.length;w++)P[w]=z.rect[w];z.rect=P;}return this[R]||this.setFill(),this.setUniforms({u_texSampler:N}),this[g]&&this[G](this[g],z),this[C]=z,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref75=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref75.vector,z=_ref75.colors,_ref75$type=_ref75.type,y=_ref75$type===void 0?"fill":_ref75$type;if(N.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:z,type:y});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref76=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref76.vector,z=_ref76.colors,_ref76$type=_ref76.type,y=_ref76$type===void 0?"fill":_ref76$type;if(N.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:z,type:y});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref77=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref77.vector,z=_ref77.colors,_ref77$type=_ref77.type,y=_ref77$type===void 0?"fill":_ref77$type;if(N.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:N,colors:z,type:y});}/**
66
+ vector: [x0, y0, r0, x1, y1, r1],
67
+ colors: [{offset:0, color}, {offset:1, color}, ...],
68
+ */},{key:"setGradient",value:function setGradient(){var _ref78=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref78.vector,z=_ref78.colors,_ref78$type=_ref78.type,y=_ref78$type===void 0?"fill":_ref78$type;z=z.map(function(_ref79){var U=_ref79.offset,H=_ref79.color;return typeof H=="string"&&(H=Object(m["default"])(H)),{offset:U,color:H};}),this[B]=this[B]||{},this[B][y]={vector:N,colors:z},z.sort(function(U,H){return U.offset-H.offset;});var P=[];z.forEach(function(_ref80){var U=_ref80.offset,H=_ref80.color;P.push.apply(P,[U].concat(_toConsumableArray(H)));});var w;if(N.length===4?w=[N[0],N[1],0,N[2],N[3],0]:w=_toConsumableArray(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[I].u_colorSteps=P,y==="fill"?this[I].u_gradientType=1:this[I].u_gradientType=0,this[J](),this;}},{key:"setUniforms",value:function setUniforms(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Object.assign(this[I],N),this;}},{key:"setTransform",value:function setTransform(){var z=this[L];for(var _len3=arguments.length,N=new Array(_len3),_key3=0;_key3<_len3;_key3++){N[_key3]=arguments[_key3];}return e.mat2d.equals(N,z)||(this[L]=N,delete this[D],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var z=this[L];for(var _len4=arguments.length,N=new Array(_len4),_key4=0;_key4<_len4;_key4++){N[_key4]=arguments[_key4];}return this[L]=e.mat2d.multiply(Array.of(0,0,0,0,0,0),z,N),delete this[D],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(N,z){var y=e.mat2d.create();return y=e.mat2d.translate(Array.of(0,0,0,0,0,0),y,[N,z]),this.transform.apply(this,_toConsumableArray(y));}},{key:"rotate",value:function rotate(N){var _ref81=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref82=_slicedToArray(_ref81,2),z=_ref82[0],y=_ref82[1];var P=e.mat2d.create();return P=e.mat2d.translate(Array.of(0,0,0,0,0,0),P,[z,y]),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,[-z,-y]),this.transform.apply(this,_toConsumableArray(P));}},{key:"scale",value:function scale(N){var z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref83=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref84=_slicedToArray(_ref83,2),y=_ref84[0],P=_ref84[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[y,P]),w=e.mat2d.scale(Array.of(0,0,0,0,0,0),w,[N,z]),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-y,-P]),this.transform.apply(this,_toConsumableArray(w));}},{key:"skew",value:function skew(N){var z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref85=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref86=_slicedToArray(_ref85,2),y=_ref86[0],P=_ref86[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[y,P]),w=e.mat2d.multiply(Array.of(0,0,0,0,0,0),w,e.mat2d.fromValues(1,Math.tan(z),Math.tan(N),1,0,0)),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-y,-P]),this.transform.apply(this,_toConsumableArray(w));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[$].length=0,this;}},{key:"setColorTransform",value:function setColorTransform(){for(var _len5=arguments.length,N=new Array(_len5),_key5=0;_key5<_len5;_key5++){N[_key5]=arguments[_key5];}return N[0]===null?this.setUniforms({u_filterFlag:0,u_colorMatrix:0}):this.setUniforms({u_filterFlag:1,u_colorMatrix:N}),this;}// apply linear color transform
69
+ },{key:"transformColor",value:function transformColor(){var z=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,N=new Array(_len6),_key6=0;_key6<_len6;_key6++){N[_key6]=arguments[_key6];}return z?z=Object(f.multiply)(z,N):z=N,this.setColorTransform.apply(this,_toConsumableArray(z)),this;}},{key:"blur",value:function blur(N){return this[$].push("blur(".concat(N,"px)")),this;}},{key:"brightness",value:function brightness(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("brightness(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.brightness)(N)));}},{key:"contrast",value:function contrast(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("contrast(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.contrast)(N)));}},{key:"dropShadow",value:function dropShadow(N,z){var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var P=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0,0,1];return Array.isArray(P)&&(P=Object(s["default"])(P)),this[$].push("drop-shadow(".concat(N,"px ").concat(z,"px ").concat(y,"px ").concat(P,")")),this;}},{key:"grayscale",value:function grayscale(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("grayscale(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.grayscale)(N)));}// https://github.com/phoboslab/WebGLImageFilter/blob/master/webgl-image-filter.js#L371
70
+ },{key:"hueRotate",value:function hueRotate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this[$].push("hue-rotate(".concat(N,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(f.hueRotate)(N)));}},{key:"invert",value:function invert(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("invert(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.invert)(N)));}},{key:"opacity",value:function opacity(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("opacity(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.opacity)(N)));}},{key:"saturate",value:function saturate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("saturate(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.saturate)(N)));}},{key:"sepia",value:function sepia(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].push("sepia(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.sepia)(N)));}},{key:"url",value:function url(N){return this[$].push("url(".concat(N,")")),this;}},{key:"isPointCollision",value:function isPointCollision(N,z){var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var P=this.meshData,w=P.positions,U=P.cells,H=this.invertMatrix,Y=H[0]*N+H[2]*z+H[4],k=H[1]*N+H[3]*z+H[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(_ref87,_ref88,_ref89){var _ref90=_slicedToArray(_ref87,2),lt=_ref90[0],ut=_ref90[1];var _ref91=_slicedToArray(_ref88,2),at=_ref91[0],st=_ref91[1];var _ref92=_slicedToArray(_ref89,2),ft=_ref92[0],vt=_ref92[1];var mt=ft-at,pt=vt-st,St=((lt-at)*mt+(ut-st)*pt)/(Math.pow(mt,2)+Math.pow(pt,2));return St>=0&&St<=1;}for(var lt=0;lt<U.length;lt++){var ut=U[lt];if(y==="fill"&&ut[0]>=P.fillPointCount)break;if(y==="stroke"&&ut[0]<P.fillPointCount)continue;var _ut$map=ut.map(function(Pt){return w[Pt];}),_ut$map2=_slicedToArray(_ut$map,3),_ut$map2$=_slicedToArray(_ut$map2[0],2),at=_ut$map2$[0],st=_ut$map2$[1],_ut$map2$2=_slicedToArray(_ut$map2[1],2),ft=_ut$map2$2[0],vt=_ut$map2$2[1],_ut$map2$3=_slicedToArray(_ut$map2[2],2),mt=_ut$map2$3[0],pt=_ut$map2$3[1],St=Math.sign((N-at)*(vt-st)-(ft-at)*(z-st));if(St===0&&it([N,z],[at,st],[ft,vt]))return!0;var It=Math.sign((N-ft)*(pt-vt)-(mt-ft)*(z-vt));if(It===0&&it([N,z],[ft,vt],[mt,pt]))return!0;var Et=Math.sign((N-mt)*(st-pt)-(at-mt)*(z-pt));if(Et===0&&it([N,z],[mt,pt],[at,st])||St===1&&It===1&&Et===1||St===-1&&It===-1&&Et===-1)return!0;}return!1;}},{key:"isPointInFill",value:function isPointInFill(N,z){return this.isPointCollision(N,z,"fill");}},{key:"isPointInStroke",value:function isPointInStroke(N,z){return this.isPointCollision(N,z,"stroke");}},{key:"addPass",value:function addPass(N){var z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var y=z.width,P=z.height,w=d(z,["width","height"]);var U=new T["default"]();U.rect(0,0,y,P);var H=new V(U,{width:y,height:P});H.setUniforms(w),H.setProgram(N),this[ot].push(H);}}]);}();},/* 57 */ /***/function(h,r,t){t.r(r);var e=t(58);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e.Stroke;},/* 58 */ /***/function(h,r,t){t.r(r),t.d(r,"Stroke",function(){return p;});var e=t(49);t(1).glMatrix.setMatrixArrayType(Array);var n=Object(e.create)(),i=Object(e.create)(),a=Object(e.create)(),o=Object(e.create)(),s=Object(e.create)(),f=1e20;var p=/*#__PURE__*/function(){function p(){var _ref93=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref93$lineWidth=_ref93.lineWidth,x=_ref93$lineWidth===void 0?1:_ref93$lineWidth,_ref93$lineJoin=_ref93.lineJoin,m=_ref93$lineJoin===void 0?"miter":_ref93$lineJoin,_ref93$miterLimit=_ref93.miterLimit,T=_ref93$miterLimit===void 0?10:_ref93$miterLimit,_ref93$lineCap=_ref93.lineCap,l=_ref93$lineCap===void 0?"butt":_ref93$lineCap,_ref93$roundSegments=_ref93.roundSegments,d=_ref93$roundSegments===void 0?20:_ref93$roundSegments;_classCallCheck(this,p);this.lineWidth=x,this.lineJoin=m,this.miterLimit=T,this.lineCap=l,this.roundSegments=d,this._normal=null;}return _createClass(p,[{key:"build",value:function build(x){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var T=x.length;if(x=_toConsumableArray(x),T<2)return x;m&&((x[0][0]!==x[T-1][0]||x[0][1]!==x[T-1][1])&&x.push(_toConsumableArray(x[0])),x.push(_toConsumableArray(x[1]))),T=x.length,this._normal=null;var l={left:[],right:[]},d=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,d);var M=x.length-1;Object(e.direction)(i,x[M],x[M-1]),Object(e.scaleAndAdd)(x[M],x[M],i,d);}for(var _M4=1;_M4<T;_M4++){var A=x[_M4-1],R=x[_M4],b=x[_M4+1];this._seg(l,A,R,b,d,m);}return!m&&u==="round"&&S(l,this.roundSegments),[].concat(_toConsumableArray(l.left),_toConsumableArray(l.right.reverse()));}},{key:"_seg",value:function _seg(x,m,T,l,d,u){var 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||v(x,m,this._normal,d),!l)Object(e.normal)(this._normal,i),u?v(x,m,this._normal,d):v(x,T,this._normal,d);else{Object(e.direction)(a,l,T);var A=Object(e.computeMiter)(o,s,i,a,d);A=Math.min(A,f);var R=Object(e.dot)(o,this._normal)<0?-1:1;var b=g||M;if(!b&&this.lineJoin==="miter"&&A/d>this.miterLimit&&(b=!0),b){Object(e.scaleAndAdd)(n,T,this._normal,-d*R),c(x,n,R);var E=1/0;m&&(E=Math.min(E,Math.hypot(T[0]-m[0],T[1]-m[1]))),l&&(E=Math.min(E,Math.hypot(l[0]-T[0],l[1]-T[1])));var L=Math.max(d,Math.min(A,E));if(Object(e.scaleAndAdd)(n,T,s,L*R),c(x,n,-R),l)if(Object(e.normal)(n,a),Object(e.copy)(this._normal,n),Object(e.scaleAndAdd)(n,T,n,-d*R),M){var D=Object(e.clone)(n),I=R>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)(),I,C),G=Object(e.sub)(Object(e.create)(),D,C),K=Math.PI/this.roundSegments;for(var J=0;J<this.roundSegments&&(Object(e.rotate)(W,W,[0,0],R*K),Math.sign(Object(e.cross)(n,W,G)[2])===R);J++)Object(e.add)(n,W,C),c(x,n,R);c(x,D,R);}else c(x,n,R);}else v(x,T,s,A),Object(e.copy)(this._normal,s);}}}]);}();function c(O,x,m){m>0?O.left.push(Object(e.clone)(x)):O.right.push(Object(e.clone)(x));}function v(O,x,m,T){var l=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(e.scaleAndAdd)(n,x,m,-T),c(O,n,-l),Object(e.scaleAndAdd)(n,x,m,T),c(O,n,l);}function S(_ref94,m){var O=_ref94.left,x=_ref94.right;var T=Object(e.create)(),l=Object(e.create)();var d=O[0],u=x[0],g=[0.5*(d[0]+u[0]),0.5*(d[1]+u[1])];Object(e.sub)(l,d,g);for(var M=1;M<=m;M++){var A=-1*Math.PI*M/m;Object(e.rotate)(T,l,[0,0],A),Object(e.add)(n,g,T),O.unshift(Object(e.clone)(n));}d=x[x.length-1],u=O[O.length-1],g=[0.5*(d[0]+u[0]),0.5*(d[1]+u[1])],Object(e.sub)(l,d,g);for(var _M5=1;_M5<=m;_M5++){var _A2=-1*Math.PI*_M5/m;Object(e.rotate)(T,l,[0,0],_A2),Object(e.add)(n,g,T),x.push(Object(e.clone)(n));}}},/* 59 */ /***/function(h,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;}},/* 60 */ /***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(61),n=t(62);h.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,l){return T.concat(l);});});var o=a.rule==="evenodd"?e.WINDING_ODD:e.WINDING_NONZERO;for(var s=e.tesselate(n({contours:i,windingRule:o,elementType:e.POLYGONS,polySize:3,vertexSize:2},a)),f=[],p=0;p<s.vertices.length;p+=a.vertexSize){var c=s.vertices.slice(p,p+a.vertexSize);f.push(c);}var v=[];for(p=0;p<s.elements.length;p+=3){var S=s.elements[p],O=s.elements[p+1],x=s.elements[p+2];v.push([S,O,x]);}return{positions:f,cells:v};};},/* 61 */ /***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e={},n={};h.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(l){for(var d=l.debug||!1,u=new T(),g=0;g<l.contours.length;g++)u.addContour(l.vertexSize||2,l.contours[g]);return u.tesselate(l.windingRule||e.WINDING_ODD,l.elementType||e.POLYGONS,l.polySize||3,l.vertexSize||2,l.normal||[0,0,1]),{vertices:u.vertices,vertexIndices:u.vertexIndices,vertexCount:u.vertexCount,elements:u.elements,elementCount:u.elementCount,mesh:d?u.mesh:void 0};};var i=function i(l){if(!l)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 o(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1;}function s(l){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=l;}s.prototype={get Rface(){return this.Sym.Lface;},set Rface(l){this.Sym.Lface=l;},get Dst(){return this.Sym.Org;},set Dst(l){this.Sym.Org=l;},get Oprev(){return this.Sym.Lnext;},set Oprev(l){this.Sym.Lnext=l;},get Lprev(){return this.Onext.Sym;},set Lprev(l){this.Onext.Sym=l;},get Dprev(){return this.Lnext.Sym;},set Dprev(l){this.Lnext.Sym=l;},get Rprev(){return this.Sym.Onext;},set Rprev(l){this.Sym.Onext=l;},get Dnext(){return/*this.Rprev*/this.Sym.Onext.Sym;},/* 3 pointers */set Dnext(l){this.Sym.Onext.Sym=l;},/* 3 pointers */get Rnext(){return/*this.Oprev*/this.Sym.Lnext.Sym;},/* 3 pointers */set Rnext(l){this.Sym.Lnext.Sym=l;}/* 3 pointers */};function f(){var l=new a(),d=new o(),u=new s(0),g=new s(1);l.next=l.prev=l,l.anEdge=null,d.next=d.prev=d,d.anEdge=null,d.trail=null,d.marked=!1,d.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=l,this.fHead=d,this.eHead=u,this.eHeadSym=g;}f.prototype={/* MakeEdge creates a new pair of half-edges which form their own loop.
71
+ * No vertex or face structures are allocated, but these must be assigned
72
+ * before the current edge operation is completed.
73
+ */ //static TESShalfEdge *MakeEdge( TESSmesh* mesh, TESShalfEdge *eNext )
74
+ makeEdge_:function makeEdge_(l){var d=new s(0),u=new s(1);l.Sym.side<l.side&&(l=l.Sym);var g=l.Sym.next;return u.next=g,g.Sym.next=d,d.next=l,l.Sym.next=u,d.Sym=u,d.Onext=d,d.Lnext=u,d.Org=null,d.Lface=null,d.winding=0,d.activeRegion=null,u.Sym=d,u.Onext=u,u.Lnext=d,u.Org=null,u.Lface=null,u.winding=0,u.activeRegion=null,d;},/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
75
+ * CS348a notes (see mesh.h). Basically it modifies the mesh so that
76
+ * a->Onext and b->Onext are exchanged. This can have various effects
77
+ * depending on whether a and b belong to different face or vertex rings.
78
+ * For more explanation see tessMeshSplice() below.
79
+ */ // static void Splice( TESShalfEdge *a, TESShalfEdge *b )
80
+ splice_:function splice_(l,d){var u=l.Onext,g=d.Onext;u.Sym.Lnext=d,g.Sym.Lnext=l,l.Onext=g,d.Onext=u;},/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
81
+ * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
82
+ * a place to insert the new vertex in the global vertex list. We insert
83
+ * the new vertex *before* vNext so that algorithms which walk the vertex
84
+ * list will not see the newly created vertices.
85
+ */ //static void MakeVertex( TESSvertex *newVertex, TESShalfEdge *eOrig, TESSvertex *vNext )
86
+ makeVertex_:function makeVertex_(l,d,u){var g=l;i(g!==null);var M=u.prev;g.prev=M,M.next=g,g.next=u,u.prev=g,g.anEdge=d;var A=d;do A.Org=g,A=A.Onext;while(A!==d);},/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
87
+ * face of all edges in the face loop to which eOrig belongs. "fNext" gives
88
+ * a place to insert the new face in the global face list. We insert
89
+ * the new face *before* fNext so that algorithms which walk the face
90
+ * list will not see the newly created faces.
91
+ */ // static void MakeFace( TESSface *newFace, TESShalfEdge *eOrig, TESSface *fNext )
92
+ makeFace_:function makeFace_(l,d,u){var g=l;i(g!==null);var M=u.prev;g.prev=M,M.next=g,g.next=u,u.prev=g,g.anEdge=d,g.trail=null,g.marked=!1,g.inside=u.inside;var A=d;do A.Lface=g,A=A.Lnext;while(A!==d);},/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
93
+ * and removes from the global edge list.
94
+ */ //static void KillEdge( TESSmesh *mesh, TESShalfEdge *eDel )
95
+ killEdge_:function killEdge_(l){l.Sym.side<l.side&&(l=l.Sym);var d=l.next,u=l.Sym.next;d.Sym.next=u,u.Sym.next=d;},/* KillVertex( vDel ) destroys a vertex and removes it from the global
96
+ * vertex list. It updates the vertex loop to point to a given new vertex.
97
+ */ //static void KillVertex( TESSmesh *mesh, TESSvertex *vDel, TESSvertex *newOrg )
98
+ killVertex_:function killVertex_(l,d){var u=l.anEdge,g=u;do g.Org=d,g=g.Onext;while(g!==u);var M=l.prev,A=l.next;A.prev=M,M.next=A;},/* KillFace( fDel ) destroys a face and removes it from the global face
99
+ * list. It updates the face loop to point to a given new face.
100
+ */ //static void KillFace( TESSmesh *mesh, TESSface *fDel, TESSface *newLface )
101
+ killFace_:function killFace_(l,d){var u=l.anEdge,g=u;do g.Lface=d,g=g.Lnext;while(g!==u);var M=l.prev,A=l.next;A.prev=M,M.next=A;},/****************** Basic Edge Operations **********************/ /* tessMeshMakeEdge creates one edge, two vertices, and a loop (face).
102
+ * The loop consists of the two new half-edges.
103
+ */ //TESShalfEdge *tessMeshMakeEdge( TESSmesh *mesh )
104
+ makeEdge:function makeEdge(){var l=new a(),d=new a(),u=new o(),g=this.makeEdge_(this.eHead);return this.makeVertex_(l,g,this.vHead),this.makeVertex_(d,g.Sym,this.vHead),this.makeFace_(u,g,this.fHead),g;},/* tessMeshSplice( eOrg, eDst ) is the basic operation for changing the
105
+ * mesh connectivity and topology. It changes the mesh so that
106
+ * eOrg->Onext <- OLD( eDst->Onext )
107
+ * eDst->Onext <- OLD( eOrg->Onext )
108
+ * where OLD(...) means the value before the meshSplice operation.
109
+ *
110
+ * This can have two effects on the vertex structure:
111
+ * - if eOrg->Org != eDst->Org, the two vertices are merged together
112
+ * - if eOrg->Org == eDst->Org, the origin is split into two vertices
113
+ * In both cases, eDst->Org is changed and eOrg->Org is untouched.
114
+ *
115
+ * Similarly (and independently) for the face structure,
116
+ * - if eOrg->Lface == eDst->Lface, one loop is split into two
117
+ * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
118
+ * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
119
+ *
120
+ * Some special cases:
121
+ * If eDst == eOrg, the operation has no effect.
122
+ * If eDst == eOrg->Lnext, the new face will have a single edge.
123
+ * If eDst == eOrg->Lprev, the old face will have a single edge.
124
+ * If eDst == eOrg->Onext, the new vertex will have a single edge.
125
+ * If eDst == eOrg->Oprev, the old vertex will have a single edge.
126
+ */ //int tessMeshSplice( TESSmesh* mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst )
127
+ splice:function splice(l,d){var u=!1,g=!1;if(l!==d){if(d.Org!==l.Org&&(g=!0,this.killVertex_(d.Org,l.Org)),d.Lface!==l.Lface&&(u=!0,this.killFace_(d.Lface,l.Lface)),this.splice_(d,l),!g){var M=new a();this.makeVertex_(M,d,l.Org),l.Org.anEdge=l;}if(!u){var A=new o();this.makeFace_(A,d,l.Lface),l.Lface.anEdge=l;}}},/* tessMeshDelete( eDel ) removes the edge eDel. There are several cases:
128
+ * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
129
+ * eDel->Lface is deleted. Otherwise, we are splitting one loop into two;
130
+ * the newly created loop will contain eDel->Dst. If the deletion of eDel
131
+ * would create isolated vertices, those are deleted as well.
132
+ *
133
+ * This function could be implemented as two calls to tessMeshSplice
134
+ * plus a few calls to memFree, but this would allocate and delete
135
+ * unnecessary vertices and faces.
136
+ */ //int tessMeshDelete( TESSmesh *mesh, TESShalfEdge *eDel )
137
+ "delete":function _delete(l){var d=l.Sym,u=!1;if(l.Lface!==l.Rface&&(u=!0,this.killFace_(l.Lface,l.Rface)),l.Onext===l)this.killVertex_(l.Org,null);else if(l.Rface.anEdge=l.Oprev,l.Org.anEdge=l.Onext,this.splice_(l,l.Oprev),!u){var g=new o();this.makeFace_(g,l,l.Lface);}d.Onext===d?(this.killVertex_(d.Org,null),this.killFace_(d.Lface,null)):(l.Lface.anEdge=d.Oprev,d.Org.anEdge=d.Onext,this.splice_(d,d.Oprev)),this.killEdge_(l);},/******************** Other Edge Operations **********************/ /* All these routines can be implemented with the basic edge
138
+ * operations above. They are provided for convenience and efficiency.
139
+ */ /* tessMeshAddEdgeVertex( eOrg ) creates a new edge eNew such that
140
+ * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
141
+ * eOrg and eNew will have the same left face.
142
+ */ // TESShalfEdge *tessMeshAddEdgeVertex( TESSmesh *mesh, TESShalfEdge *eOrg );
143
+ addEdgeVertex:function addEdgeVertex(l){var d=this.makeEdge_(l),u=d.Sym;this.splice_(d,l.Lnext),d.Org=l.Dst;var g=new a();return this.makeVertex_(g,u,d.Org),d.Lface=u.Lface=l.Lface,d;},/* tessMeshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
144
+ * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.
145
+ * eOrg and eNew will have the same left face.
146
+ */ // TESShalfEdge *tessMeshSplitEdge( TESSmesh *mesh, TESShalfEdge *eOrg );
147
+ splitEdge:function splitEdge(l,d){var u=this.addEdgeVertex(l),g=u.Sym;return this.splice_(l.Sym,l.Sym.Oprev),this.splice_(l.Sym,g),l.Dst=g.Org,g.Dst.anEdge=g.Sym,g.Rface=l.Rface,g.winding=l.winding,g.Sym.winding=l.Sym.winding,g;},/* tessMeshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
148
+ * to eDst->Org, and returns the corresponding half-edge eNew.
149
+ * If eOrg->Lface == eDst->Lface, this splits one loop into two,
150
+ * and the newly created loop is eNew->Lface. Otherwise, two disjoint
151
+ * loops are merged into one, and the loop eDst->Lface is destroyed.
152
+ *
153
+ * If (eOrg == eDst), the new face will have only two edges.
154
+ * If (eOrg->Lnext == eDst), the old face is reduced to a single edge.
155
+ * If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.
156
+ */ // TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst );
157
+ connect:function connect(l,d){var u=!1,g=this.makeEdge_(l),M=g.Sym;if(d.Lface!==l.Lface&&(u=!0,this.killFace_(d.Lface,l.Lface)),this.splice_(g,l.Lnext),this.splice_(M,d),g.Org=l.Dst,M.Org=d.Org,g.Lface=M.Lface=l.Lface,l.Lface.anEdge=M,!u){var A=new o();this.makeFace_(A,g,l.Lface);}return g;},/* tessMeshZapFace( fZap ) destroys a face and removes it from the
158
+ * global face list. All edges of fZap will have a NULL pointer as their
159
+ * left face. Any edges which also have a NULL pointer as their right face
160
+ * are deleted entirely (along with any isolated vertices this produces).
161
+ * An entire mesh can be deleted by zapping its faces, one at a time,
162
+ * in any order. Zapped faces cannot be used in further mesh operations!
163
+ */zapFace:function zapFace(l){var d=l.anEdge,u,g,M,A,R;g=d.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!=d);A=l.prev,R=l.next,R.prev=A,A.next=R;},countFaceVerts_:function countFaceVerts_(l){var d=l.anEdge,u=0;do u++,d=d.Lnext;while(d!==l.anEdge);return u;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
164
+ mergeConvexFaces:function mergeConvexFaces(l){var d,u,g,M,A,R,b;for(d=this.fHead.next;d!==this.fHead;d=d.next)if(d.inside)for(u=d.anEdge,A=u.Org;g=u.Lnext,M=u.Sym,M&&M.Lface&&M.Lface.inside&&(R=this.countFaceVerts_(d),b=this.countFaceVerts_(M.Lface),R+b-2<=l&&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;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.
165
+ */check:function check(){var l=this.fHead,d=this.vHead,u=this.eHead,g,M,A,R,b,E;for(M=l,M=l;(g=M.next)!==l;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),R=d,R=d;(A=R.next)!==d;R=A){i(A.prev===R),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===R&&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(l,d){return l.s===d.s&&l.t===d.t;},n.vertLeq=function(l,d){return l.s<d.s||l.s===d.s&&l.t<=d.t;},n.transLeq=function(l,d){return l.t<d.t||l.t===d.t&&l.s<=d.s;},n.edgeGoesLeft=function(l){return n.vertLeq(l.Dst,l.Org);},n.edgeGoesRight=function(l){return n.vertLeq(l.Org,l.Dst);},n.vertL1dist=function(l,d){return Math.abs(l.s-d.s)+Math.abs(l.t-d.t);},n.edgeEval=function(l,d,u){i(n.vertLeq(l,d)&&n.vertLeq(d,u));var g=d.s-l.s,M=u.s-d.s;return g+M>0?g<M?d.t-l.t+(l.t-u.t)*(g/(g+M)):d.t-u.t+(u.t-l.t)*(M/(g+M)):0;},n.edgeSign=function(l,d,u){i(n.vertLeq(l,d)&&n.vertLeq(d,u));var g=d.s-l.s,M=u.s-d.s;return g+M>0?(d.t-u.t)*g+(d.t-l.t)*M:0;},n.transEval=function(l,d,u){i(n.transLeq(l,d)&&n.transLeq(d,u));var g=d.t-l.t,M=u.t-d.t;return g+M>0?g<M?d.s-l.s+(l.s-u.s)*(g/(g+M)):d.s-u.s+(u.s-l.s)*(M/(g+M)):0;},n.transSign=function(l,d,u){i(n.transLeq(l,d)&&n.transLeq(d,u));var g=d.t-l.t,M=u.t-d.t;return g+M>0?(d.s-u.s)*g+(d.s-l.s)*M:0;},n.vertCCW=function(l,d,u){return l.s*(d.t-u.t)+d.s*(u.t-l.t)+u.s*(l.t-d.t)>=0;},n.interpolate=function(l,d,u,g){return l=l<0?0:l,u=u<0?0:u,l<=u?u===0?(d+g)/2:d+(g-d)*(l/(l+u)):g+(d-g)*(u/(l+u));},n.intersect=function(l,d,u,g,M){var A,R,b;n.vertLeq(l,d)||(b=l,l=d,d=b),n.vertLeq(u,g)||(b=u,u=g,g=b),n.vertLeq(l,u)||(b=l,l=u,u=b,b=d,d=g,g=b),n.vertLeq(u,d)?n.vertLeq(d,g)?(A=n.edgeEval(l,u,d),R=n.edgeEval(u,d,g),A+R<0&&(A=-A,R=-R),M.s=n.interpolate(A,u.s,R,d.s)):(A=n.edgeSign(l,u,d),R=-n.edgeSign(l,g,d),A+R<0&&(A=-A,R=-R),M.s=n.interpolate(A,u.s,R,g.s)):M.s=(u.s+d.s)/2,n.transLeq(l,d)||(b=l,l=d,d=b),n.transLeq(u,g)||(b=u,u=g,g=b),n.transLeq(l,u)||(b=l,l=u,u=b,b=d,d=g,g=b),n.transLeq(u,d)?n.transLeq(d,g)?(A=n.transEval(l,u,d),R=n.transEval(u,d,g),A+R<0&&(A=-A,R=-R),M.t=n.interpolate(A,u.t,R,d.t)):(A=n.transSign(l,u,d),R=-n.transSign(l,g,d),A+R<0&&(A=-A,R=-R),M.t=n.interpolate(A,u.t,R,g.t)):M.t=(u.t+d.t)/2;};function p(){this.key=null,this.next=null,this.prev=null;}function c(l,d){this.head=new p(),this.head.next=this.head,this.head.prev=this.head,this.frame=l,this.leq=d;}c.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(l){return this.insertBefore(this.head,l);},search:function search(l){var d=this.head;do d=d.next;while(d.key!==null&&!this.leq(this.frame,l,d.key));return d;},insertBefore:function insertBefore(l,d){do l=l.prev;while(l.key!==null&&!this.leq(this.frame,l.key,d));var u=new p();return u.key=d,u.next=l.next,l.next.prev=u,u.prev=l,l.next=u,u;},"delete":function _delete(l){l.next.prev=l.prev,l.prev.next=l.next;}};function v(){this.handle=null;}function S(){this.key=null,this.node=null;}function O(l,d){this.size=0,this.max=l,this.nodes=[],this.nodes.length=l+1;var u;for(u=0;u<this.nodes.length;u++)this.nodes[u]=new v();for(this.handles=[],this.handles.length=l+1,u=0;u<this.handles.length;u++)this.handles[u]=new S();this.initialized=!1,this.freeList=0,this.leq=d,this.nodes[1].handle=1,this.handles[1].key=null;}O.prototype={floatDown_:function floatDown_(l){var d=this.nodes,u=this.handles,g,M,A;for(g=d[l].handle;;){if(A=l<<1,A<this.size&&this.leq(u[d[A+1].handle].key,u[d[A].handle].key)&&++A,i(A<=this.max),M=d[A].handle,A>this.size||this.leq(u[g].key,u[M].key)){d[l].handle=g,u[g].node=l;break;}d[l].handle=M,u[M].node=l,l=A;}},floatUp_:function floatUp_(l){var d=this.nodes,u=this.handles,g,M,A;for(g=d[l].handle;;){if(A=l>>1,M=d[A].handle,A===0||this.leq(u[M].key,u[g].key)){d[l].handle=g,u[g].node=l;break;}d[l].handle=M,u[M].node=l,l=A;}},init:function init(){for(var l=this.size;l>=1;--l)this.floatDown_(l);this.initialized=!0;},min:function min(){return this.handles[this.nodes[1].handle].key;},/* really pqHeapInsert */ /* returns INV_HANDLE iff out of memory */ //PQhandle pqHeapInsert( TESSalloc* alloc, PriorityQHeap *pq, PQkey keyNew )
166
+ insert:function insert(l){var d,u;if(d=++this.size,d*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 v();for(M=this.handles.length,this.handles.length=this.max+1,g=M;g<this.handles.length;g++)this.handles[g]=new S();}return this.freeList===0?u=d:(u=this.freeList,this.freeList=this.handles[u].node),this.nodes[d].handle=u,this.handles[u].node=d,this.handles[u].key=l,this.initialized&&this.floatUp_(d),u;},//PQkey pqHeapExtractMin( PriorityQHeap *pq )
167
+ extractMin:function extractMin(){var l=this.nodes,d=this.handles,u=l[1].handle,g=d[u].key;return this.size>0&&(l[1].handle=l[this.size].handle,d[l[1].handle].node=1,d[u].key=null,d[u].node=this.freeList,this.freeList=u,--this.size,this.size>0&&this.floatDown_(1)),g;},"delete":function _delete(l){var d=this.nodes,u=this.handles,g;i(l>=1&&l<=this.max&&u[l].key!==null),g=u[l].node,d[g].handle=d[this.size].handle,u[d[g].handle].node=g,--this.size,g<=this.size&&(g<=1||this.leq(u[d[g>>1].handle].key,u[d[g].handle].key)?this.floatDown_(g):this.floatUp_(g)),u[l].key=null,u[l].node=this.freeList,this.freeList=l;}};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(l){return l.nodeUp.prev.key;},m.regionAbove=function(l){return l.nodeUp.next.key;},m.debugEvent=function(l){},m.addWinding=function(l,d){l.winding+=d.winding,l.Sym.winding+=d.Sym.winding;},m.edgeLeq=function(l,d,u){var g=l.event,R,b,M=d.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 R=n.edgeEval(M.Dst,g,M.Org),b=n.edgeEval(A.Dst,g,A.Org);return R>=b;},m.deleteRegion=function(l,d){d.fixUpperEdge&&i(d.eUp.winding===0),d.eUp.activeRegion=null,l.dict["delete"](d.nodeUp);},m.fixUpperEdge=function(l,d,u){i(d.fixUpperEdge),l.mesh["delete"](d.eUp),d.fixUpperEdge=!1,d.eUp=u,u.activeRegion=d;},m.topLeftRegion=function(l,d){var u=d.eUp.Org,g;do d=m.regionAbove(d);while(d.eUp.Org===u);if(d.fixUpperEdge){if(g=l.mesh.connect(m.regionBelow(d).eUp.Sym,d.eUp.Lnext),g===null)return null;m.fixUpperEdge(l,d,g),d=m.regionAbove(d);}return d;},m.topRightRegion=function(l){var d=l.eUp.Dst;do l=m.regionAbove(l);while(l.eUp.Dst===d);return l;},m.addRegionBelow=function(l,d,u){var g=new x();return g.eUp=u,g.nodeUp=l.dict.insertBefore(d.nodeUp,g),g.fixUpperEdge=!1,g.sentinel=!1,g.dirty=!1,u.activeRegion=g,g;},m.isWindingInside=function(l,d){switch(l.windingRule){case e.WINDING_ODD:return(d&1)!==0;case e.WINDING_NONZERO:return d!==0;case e.WINDING_POSITIVE:return d>0;case e.WINDING_NEGATIVE:return d<0;case e.WINDING_ABS_GEQ_TWO:return d>=2||d<=-2;}return i(!1),!1;},m.computeWinding=function(l,d){d.windingNumber=m.regionAbove(d).windingNumber+d.eUp.winding,d.inside=m.isWindingInside(l,d.windingNumber);},m.finishRegion=function(l,d){var u=d.eUp,g=u.Lface;g.inside=d.inside,g.anEdge=u,m.deleteRegion(l,d);},m.finishLeftRegions=function(l,d,u){for(var g,R,M=null,A=d,R=d.eUp;A!==u;){if(A.fixUpperEdge=!1,M=m.regionBelow(A),g=M.eUp,g.Org!=R.Org){if(!M.fixUpperEdge){m.finishRegion(l,A);break;}g=l.mesh.connect(R.Lprev,g.Sym),m.fixUpperEdge(l,M,g);}R.Onext!==g&&(l.mesh.splice(g.Oprev,g),l.mesh.splice(R,g)),m.finishRegion(l,A),R=M.eUp,A=M;}return R;},m.addRightEdges=function(l,d,u,g,M,A){var R,b,E,L,D=!0;E=u;do i(n.vertLeq(E.Org,E.Dst)),m.addRegionBelow(l,d,E.Sym),E=E.Onext;while(E!==g);for(M===null&&(M=m.regionBelow(d).eUp.Rprev),b=d,L=M;R=m.regionBelow(b),E=R.eUp.Sym,E.Org===L.Org;)E.Onext!==L&&(l.mesh.splice(E.Oprev,E),l.mesh.splice(L.Oprev,E)),R.windingNumber=b.windingNumber-E.winding,R.inside=m.isWindingInside(l,R.windingNumber),b.dirty=!0,!D&&m.checkForRightSplice(l,b)&&(m.addWinding(E,L),m.deleteRegion(l,b),l.mesh["delete"](L)),D=!1,b=R,L=E;b.dirty=!0,i(b.windingNumber-E.winding===R.windingNumber),A&&m.walkDirtyRegions(l,b);},m.spliceMergeVertices=function(l,d,u){l.mesh.splice(d,u);},m.vertexWeights=function(l,d,u){var g=n.vertL1dist(d,l),M=n.vertL1dist(u,l),A=0.5*M/(g+M),R=0.5*g/(g+M);l.coords[0]+=A*d.coords[0]+R*u.coords[0],l.coords[1]+=A*d.coords[1]+R*u.coords[1],l.coords[2]+=A*d.coords[2]+R*u.coords[2];},m.getIntersectData=function(l,d,u,g,M,A){d.coords[0]=d.coords[1]=d.coords[2]=0,d.idx=-1,m.vertexWeights(d,u,g),m.vertexWeights(d,M,A);},m.checkForRightSplice=function(l,d){var u=m.regionBelow(d),g=d.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&&(l.pq["delete"](g.Org.pqHandle),m.spliceMergeVertices(l,M.Oprev,g)):(l.mesh.splitEdge(M.Sym),l.mesh.splice(g,M.Oprev),d.dirty=u.dirty=!0);}else{if(n.edgeSign(g.Dst,M.Org,g.Org)<0)return!1;m.regionAbove(d).dirty=d.dirty=!0,l.mesh.splitEdge(g.Sym),l.mesh.splice(M.Oprev,g);}return!0;},m.checkForLeftSplice=function(l,d){var u=m.regionBelow(d),g=d.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(d).dirty=d.dirty=!0,A=l.mesh.splitEdge(g),l.mesh.splice(M.Sym,A),A.Lface.inside=d.inside;}else{if(n.edgeSign(M.Dst,g.Dst,M.Org)>0)return!1;d.dirty=u.dirty=!0,A=l.mesh.splitEdge(M),l.mesh.splice(g.Lnext,M.Sym),A.Rface.inside=d.inside;}return!0;},m.checkForIntersect=function(l,d){var u=m.regionBelow(d),g=d.eUp,M=u.eUp,A=g.Org,R=M.Org,b=g.Dst,E=M.Dst,L,D,I=new a(),C,W;if(i(!n.vertEq(E,b)),i(n.edgeSign(b,l.event,A)<=0),i(n.edgeSign(E,l.event,R)>=0),i(A!==l.event&&R!==l.event),i(!d.fixUpperEdge&&!u.fixUpperEdge),A===R||(L=Math.min(A.t,b.t),D=Math.max(R.t,E.t),L>D))return!1;if(n.vertLeq(A,R)){if(n.edgeSign(E,A,R)>0)return!1;}else if(n.edgeSign(b,R,A)<0)return!1;return m.debugEvent(l),n.intersect(b,A,E,R,I),i(Math.min(A.t,b.t)<=I.t),i(I.t<=Math.max(R.t,E.t)),i(Math.min(E.s,b.s)<=I.s),i(I.s<=Math.max(R.s,A.s)),n.vertLeq(I,l.event)&&(I.s=l.event.s,I.t=l.event.t),C=n.vertLeq(A,R)?A:R,n.vertLeq(C,I)&&(I.s=C.s,I.t=C.t),n.vertEq(I,A)||n.vertEq(I,R)?(m.checkForRightSplice(l,d),!1):!n.vertEq(b,l.event)&&n.edgeSign(b,l.event,I)>=0||!n.vertEq(E,l.event)&&n.edgeSign(E,l.event,I)<=0?E===l.event?(l.mesh.splitEdge(g.Sym),l.mesh.splice(M.Sym,g),d=m.topLeftRegion(l,d),g=m.regionBelow(d).eUp,m.finishLeftRegions(l,m.regionBelow(d),u),m.addRightEdges(l,d,g.Oprev,g,g,!0),!0):b===l.event?(l.mesh.splitEdge(M.Sym),l.mesh.splice(g.Lnext,M.Oprev),u=d,d=m.topRightRegion(d),W=m.regionBelow(d).eUp.Rprev,u.eUp=M.Oprev,M=m.finishLeftRegions(l,u,null),m.addRightEdges(l,d,M.Onext,g.Rprev,W,!0),!0):(n.edgeSign(b,l.event,I)>=0&&(m.regionAbove(d).dirty=d.dirty=!0,l.mesh.splitEdge(g.Sym),g.Org.s=l.event.s,g.Org.t=l.event.t),n.edgeSign(E,l.event,I)<=0&&(d.dirty=u.dirty=!0,l.mesh.splitEdge(M.Sym),M.Org.s=l.event.s,M.Org.t=l.event.t),!1):(l.mesh.splitEdge(g.Sym),l.mesh.splitEdge(M.Sym),l.mesh.splice(M.Oprev,g),g.Org.s=I.s,g.Org.t=I.t,g.Org.pqHandle=l.pq.insert(g.Org),m.getIntersectData(l,g.Org,A,b,R,E),m.regionAbove(d).dirty=d.dirty=u.dirty=!0,!1);},m.walkDirtyRegions=function(l,d){for(var u=m.regionBelow(d),g,M;;){for(;u.dirty;)d=u,u=m.regionBelow(u);if(!d.dirty&&(u=d,d=m.regionAbove(d),d===null||!d.dirty))return;if(d.dirty=!1,g=d.eUp,M=u.eUp,g.Dst!==M.Dst&&m.checkForLeftSplice(l,d)&&(u.fixUpperEdge?(m.deleteRegion(l,u),l.mesh["delete"](M),u=m.regionBelow(d),M=u.eUp):d.fixUpperEdge&&(m.deleteRegion(l,d),l.mesh["delete"](g),d=m.regionAbove(u),g=d.eUp)),g.Org!==M.Org)if(g.Dst!==M.Dst&&!d.fixUpperEdge&&!u.fixUpperEdge&&(g.Dst===l.event||M.Dst===l.event)){if(m.checkForIntersect(l,d))return;}else m.checkForRightSplice(l,d);g.Org===M.Org&&g.Dst===M.Dst&&(m.addWinding(M,g),m.deleteRegion(l,d),l.mesh["delete"](g),d=m.regionAbove(u));}},m.connectRightVertex=function(l,d,u){var g,M=u.Onext,A=m.regionBelow(d),R=d.eUp,b=A.eUp,E=!1;if(R.Dst!==b.Dst&&m.checkForIntersect(l,d),n.vertEq(R.Org,l.event)&&(l.mesh.splice(M.Oprev,R),d=m.topLeftRegion(l,d),M=m.regionBelow(d).eUp,m.finishLeftRegions(l,m.regionBelow(d),A),E=!0),n.vertEq(b.Org,l.event)&&(l.mesh.splice(u,b.Oprev),u=m.finishLeftRegions(l,A,null),E=!0),E){m.addRightEdges(l,d,u.Onext,M,M,!0);return;}n.vertLeq(b.Org,R.Org)?g=b.Oprev:g=R,g=l.mesh.connect(u.Lprev,g),m.addRightEdges(l,d,g,g.Onext,g.Onext,!1),g.Sym.activeRegion.fixUpperEdge=!0,m.walkDirtyRegions(l,d);},m.connectLeftDegenerate=function(l,d,u){var g,M,A,R,b;if(g=d.eUp,n.vertEq(g.Org,u)){i(!1/*TOLERANCE_NONZERO*/),m.spliceMergeVertices(l,g,u.anEdge);return;}if(!n.vertEq(g.Dst,u)){l.mesh.splitEdge(g.Sym),d.fixUpperEdge&&(l.mesh["delete"](g.Onext),d.fixUpperEdge=!1),l.mesh.splice(u.anEdge,g),m.sweepEvent(l,u);return;}i(!1/*TOLERANCE_NONZERO*/),d=m.topRightRegion(d),b=m.regionBelow(d),A=b.eUp.Sym,M=R=A.Onext,b.fixUpperEdge&&(i(M!==A),m.deleteRegion(l,b),l.mesh["delete"](A),A=M.Oprev),l.mesh.splice(u.anEdge,A),n.edgeGoesLeft(M)||(M=null),m.addRightEdges(l,d,A.Onext,R,M,!0);},m.connectLeftVertex=function(l,d){var u,g,M,A,R,b,E=new x();if(E.eUp=d.anEdge.Sym,u=l.dict.search(E).key,g=m.regionBelow(u),!!g){if(A=u.eUp,R=g.eUp,n.edgeSign(A.Dst,d,A.Org)===0){m.connectLeftDegenerate(l,u,d);return;}if(M=n.vertLeq(R.Dst,A.Dst)?u:g,u.inside||M.fixUpperEdge){if(M===u)b=l.mesh.connect(d.anEdge.Sym,A.Lnext);else{var L=l.mesh.connect(R.Dnext,d.anEdge);b=L.Sym;}M.fixUpperEdge?m.fixUpperEdge(l,M,b):m.computeWinding(l,m.addRegionBelow(l,u,b)),m.sweepEvent(l,d);}else m.addRightEdges(l,u,d.anEdge,d.anEdge,null,!0);}},m.sweepEvent=function(l,d){l.event=d,m.debugEvent(l);for(var u=d.anEdge;u.activeRegion===null;)if(u=u.Onext,u===d.anEdge){m.connectLeftVertex(l,d);return;}var g=m.topLeftRegion(l,u.activeRegion);i(g!==null);var M=m.regionBelow(g),A=M.eUp,R=m.finishLeftRegions(l,M,null);R.Onext===A?m.connectRightVertex(l,g,R):m.addRightEdges(l,g,R.Onext,A,A,!0);},m.addSentinel=function(l,d,u,g){var M=new x(),A=l.mesh.makeEdge();A.Org.s=u,A.Org.t=g,A.Dst.s=d,A.Dst.t=g,l.event=A.Dst,M.eUp=A,M.windingNumber=0,M.inside=!1,M.fixUpperEdge=!1,M.sentinel=!0,M.dirty=!1,M.nodeUp=l.dict.insert(M);},m.initEdgeDict=function(l){l.dict=new c(l,m.edgeLeq);var d=l.bmax[0]-l.bmin[0],u=l.bmax[1]-l.bmin[1],g=l.bmin[0]-d,M=l.bmax[0]+d,A=l.bmin[1]-u,R=l.bmax[1]+u;m.addSentinel(l,g,M,A),m.addSentinel(l,g,M,R);},m.doneEdgeDict=function(l){for(var d,u=0;(d=l.dict.min().key)!==null;)d.sentinel||(i(d.fixUpperEdge),i(++u===1)),i(d.windingNumber===0),m.deleteRegion(l,d);},m.removeDegenerateEdges=function(l){var d,u,g,M=l.mesh.eHead;for(d=M.next;d!==M;d=u)u=d.next,g=d.Lnext,n.vertEq(d.Org,d.Dst)&&d.Lnext.Lnext!==d&&(m.spliceMergeVertices(l,g,d),l.mesh["delete"](d),d=g,g=d.Lnext),g.Lnext===d&&(g!==d&&((g===u||g===u.Sym)&&(u=u.next),l.mesh["delete"](g)),(d===u||d===u.Sym)&&(u=u.next),l.mesh["delete"](d));},m.initPriorityQ=function(l){var d,u,g,M=0;for(g=l.mesh.vHead,u=g.next;u!==g;u=u.next)M++;for(M+=8,d=l.pq=new O(M,n.vertLeq),g=l.mesh.vHead,u=g.next;u!==g;u=u.next)u.pqHandle=d.insert(u);return u!==g?!1:(d.init(),!0);},m.donePriorityQ=function(l){l.pq=null;},m.removeDegenerateFaces=function(l,d){var u,g,M;for(u=d.fHead.next;u!==d.fHead;u=g)g=u.next,M=u.anEdge,i(M.Lnext!==M),M.Lnext.Lnext===M&&(m.addWinding(M.Onext,M),l.mesh["delete"](M));return!0;},m.computeInterior=function(l){var d,u;if(m.removeDegenerateEdges(l),!m.initPriorityQ(l))return!1;for(m.initEdgeDict(l);(d=l.pq.extractMin())!==null;){for(;u=l.pq.min(),!(u===null||!n.vertEq(u,d));)u=l.pq.extractMin(),m.spliceMergeVertices(l,d.anEdge,u.anEdge);m.sweepEvent(l,d);}return l.event=l.dict.min().key.eUp.Org,m.debugEvent(l),m.doneEdgeDict(l),m.donePriorityQ(l),m.removeDegenerateFaces(l,l.mesh)?(l.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 dot_(l,d){return l[0]*d[0]+l[1]*d[1]+l[2]*d[2];},normalize_:function normalize_(l){var d=l[0]*l[0]+l[1]*l[1]+l[2]*l[2];i(d>0),d=Math.sqrt(d),l[0]/=d,l[1]/=d,l[2]/=d;},longAxis_:function longAxis_(l){var d=0;return Math.abs(l[1])>Math.abs(l[0])&&(d=1),Math.abs(l[2])>Math.abs(l[d])&&(d=2),d;},computeNormal_:function computeNormal_(l){var d,u,g,M,A,R,b=[0,0,0],E=[0,0,0],L=[0,0,0],D=[0,0,0],I=[0,0,0],C=[null,null,null],W=[null,null,null],G=this.mesh.vHead,K;for(d=G.next,K=0;K<3;++K)M=d.coords[K],E[K]=M,W[K]=d,b[K]=M,C[K]=d;for(d=G.next;d!==G;d=d.next)for(K=0;K<3;++K)M=d.coords[K],M<E[K]&&(E[K]=M,W[K]=d),M>b[K]&&(b[K]=M,C[K]=d);if(K=0,b[1]-E[1]>b[0]-E[0]&&(K=1),b[2]-E[2]>b[K]-E[K]&&(K=2),E[K]>=b[K]){l[0]=0,l[1]=0,l[2]=1;return;}for(R=0,u=W[K],g=C[K],L[0]=u.coords[0]-g.coords[0],L[1]=u.coords[1]-g.coords[1],L[2]=u.coords[2]-g.coords[2],d=G.next;d!==G;d=d.next)D[0]=d.coords[0]-g.coords[0],D[1]=d.coords[1]-g.coords[1],D[2]=d.coords[2]-g.coords[2],I[0]=L[1]*D[2]-L[2]*D[1],I[1]=L[2]*D[0]-L[0]*D[2],I[2]=L[0]*D[1]-L[1]*D[0],A=I[0]*I[0]+I[1]*I[1]+I[2]*I[2],A>R&&(R=A,l[0]=I[0],l[1]=I[1],l[2]=I[2]);R<=0&&(l[0]=l[1]=l[2]=0,l[this.longAxis_(L)]=1);},checkOrientation_:function checkOrientation_(){var l,d,u=this.mesh.fHead,g,M=this.mesh.vHead,A;for(l=0,d=u.next;d!==u;d=d.next)if(A=d.anEdge,!(A.winding<=0))do l+=(A.Org.s-A.Dst.s)*(A.Org.t+A.Dst.t),A=A.Lnext;while(A!==d.anEdge);if(l<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];}},/* #ifdef FOR_TRITE_TEST_PROGRAM
168
+ #include <stdlib.h>
169
+ extern int RandomSweep;
170
+ #define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0)
171
+ #define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0)
172
+ #else
173
+ #if defined(SLANTED_SWEEP) */ /* The "feature merging" is not intended to be complete. There are
174
+ * special cases where edges are nearly parallel to the sweep line
175
+ * which are not implemented. The algorithm should still behave
176
+ * robustly (ie. produce a reasonable tesselation) in the presence
177
+ * of such edges, however it may miss features which could have been
178
+ * merged. We could minimize this effect by choosing the sweep line
179
+ * direction to be something unusual (ie. not parallel to one of the
180
+ * coordinate axes).
181
+ */ /* #define S_UNIT_X (TESSreal)0.50941539564955385 // Pre-normalized
182
+ #define S_UNIT_Y (TESSreal)0.86052074622010633
183
+ #else
184
+ #define S_UNIT_X (TESSreal)1.0
185
+ #define S_UNIT_Y (TESSreal)0.0
186
+ #endif
187
+ #endif*/ /* Determine the polygon normal and project vertices onto the plane
188
+ * of the polygon.
189
+ */projectPolygon_:function projectPolygon_(){var l,d=this.mesh.vHead,u=[0,0,0],g,M,A,R,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,l=d.next;l!==d;l=l.next)l.s=this.dot_(l.coords,g),l.t=this.dot_(l.coords,M);for(b&&this.checkOrientation_(),R=!0,l=d.next;l!==d;l=l.next)R?(this.bmin[0]=this.bmax[0]=l.s,this.bmin[1]=this.bmax[1]=l.t,R=!1):(l.s<this.bmin[0]&&(this.bmin[0]=l.s),l.s>this.bmax[0]&&(this.bmax[0]=l.s),l.t<this.bmin[1]&&(this.bmin[1]=l.t),l.t>this.bmax[1]&&(this.bmax[1]=l.t));},addWinding_:function addWinding_(l,d){l.winding+=d.winding,l.Sym.winding+=d.Sym.winding;},/* tessMeshTessellateMonoRegion( face ) tessellates a monotone region
190
+ * (what else would it do??) The region must consist of a single
191
+ * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
192
+ * case means that any vertical line intersects the interior of the
193
+ * region in a single interval.
194
+ *
195
+ * Tessellation consists of adding interior edges (actually pairs of
196
+ * half-edges), to split the region into non-overlapping triangles.
197
+ *
198
+ * The basic idea is explained in Preparata and Shamos (which I don''t
199
+ * have handy right now), although their implementation is more
200
+ * complicated than this one. The are two edge chains, an upper chain
201
+ * and a lower chain. We process all vertices from both chains in order,
202
+ * from right to left.
203
+ *
204
+ * The algorithm ensures that the following invariant holds after each
205
+ * vertex is processed: the untessellated region consists of two
206
+ * chains, where one chain (say the upper) is a single edge, and
207
+ * the other chain is concave. The left vertex of the single edge
208
+ * is always to the left of all vertices in the concave chain.
209
+ *
210
+ * Each step consists of adding the rightmost unprocessed vertex to one
211
+ * of the two chains, and forming a fan of triangles from the rightmost
212
+ * of two chain endpoints. Determining whether we can add each triangle
213
+ * to the fan is a simple orientation test. By making the fan as large
214
+ * as possible, we restore the invariant (check it yourself).
215
+ */ // int tessMeshTessellateMonoRegion( TESSmesh *mesh, TESSface *face )
216
+ tessellateMonoRegion_:function tessellateMonoRegion_(l,d){var u,g;for(u=d.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=l.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=l.connect(u,u.Lprev);u=M.Sym;}u=u.Lnext;}for(i(g.Lnext!==u);g.Lnext.Lnext!==u;){var M=l.connect(g.Lnext,g);g=M.Sym;}return!0;},/* tessMeshTessellateInterior( mesh ) tessellates each region of
217
+ * the mesh which is marked "inside" the polygon. Each such region
218
+ * must be monotone.
219
+ */ //int tessMeshTessellateInterior( TESSmesh *mesh )
220
+ tessellateInterior_:function tessellateInterior_(l){var d,u;for(d=l.fHead.next;d!==l.fHead;d=u)if(u=d.next,d.inside&&!this.tessellateMonoRegion_(l,d))return!1;return!0;},/* tessMeshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
221
+ * which are not marked "inside" the polygon. Since further mesh operations
222
+ * on NULL faces are not allowed, the main purpose is to clean up the
223
+ * mesh so that exterior loops are not represented in the data structure.
224
+ */ //void tessMeshDiscardExterior( TESSmesh *mesh )
225
+ discardExterior_:function discardExterior_(l){var d,u;for(d=l.fHead.next;d!==l.fHead;d=u)u=d.next,d.inside||l.zapFace(d);},/* tessMeshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
226
+ * winding numbers on all edges so that regions marked "inside" the
227
+ * polygon have a winding number of "value", and regions outside
228
+ * have a winding number of 0.
229
+ *
230
+ * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
231
+ * separate an interior region from an exterior one.
232
+ */ // int tessMeshSetWindingNumber( TESSmesh *mesh, int value, int keepOnlyBoundary )
233
+ setWindingNumber_:function setWindingNumber_(l,d,u){var g,M;for(g=l.eHead.next;g!==l.eHead;g=M)M=g.next,g.Rface.inside!==g.Lface.inside?g.winding=g.Lface.inside?d:-d:u?l["delete"](g):g.winding=0;},getNeighbourFace_:function getNeighbourFace_(l){return!l.Rface||!l.Rface.inside?-1:l.Rface.n;},outputPolymesh_:function outputPolymesh_(l,d,u,g){var M,A,R,b=0,E=0,L,D;for(u>3&&l.mergeConvexFaces(u),M=l.vHead.next;M!==l.vHead;M=M.next)M.n=-1;for(A=l.fHead.next;A!==l.fHead;A=A.next)if(A.n=-1,!!A.inside){R=A.anEdge,L=0;do M=R.Org,M.n===-1&&(M.n=E,E++),L++,R=R.Lnext;while(R!==A.anEdge);i(L<=u),A.n=b,++b;}for(this.elementCount=b,d===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=l.vHead.next;M!==l.vHead;M=M.next)if(M.n!==-1){var I=M.n*g;this.vertices[I+0]=M.coords[0],this.vertices[I+1]=M.coords[1],g>2&&(this.vertices[I+2]=M.coords[2]),this.vertexIndices[M.n]=M.idx;}var C=0;for(A=l.fHead.next;A!==l.fHead;A=A.next)if(A.inside){R=A.anEdge,L=0;do M=R.Org,this.elements[C++]=M.n,L++,R=R.Lnext;while(R!==A.anEdge);for(D=L;D<u;++D)this.elements[C++]=-1;if(d===e.CONNECTED_POLYGONS){R=A.anEdge;do this.elements[C++]=this.getNeighbourFace_(R),R=R.Lnext;while(R!==A.anEdge);for(D=L;D<u;++D)this.elements[C++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
234
+ outputContours_:function outputContours_(l,d){var u,g,M,A=0,R=0;for(this.vertexCount=0,this.elementCount=0,u=l.fHead.next;u!==l.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*d,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var b=0,E=0,L=0;for(A=0,u=l.fHead.next;u!==l.fHead;u=u.next)if(u.inside){R=0,M=g=u.anEdge;do this.vertices[b++]=g.Org.coords[0],this.vertices[b++]=g.Org.coords[1],d>2&&(this.vertices[b++]=g.Org.coords[2]),this.vertexIndices[E++]=g.Org.idx,R++,g=g.Lnext;while(g!==M);this.elements[L++]=A,this.elements[L++]=R,A+=R;}},addContour:function addContour(l,d){var u,g;for(this.mesh===null&&(this.mesh=new f()),l<2&&(l=2),l>3&&(l=3),u=null,g=0;g<d.length;g+=l)u===null?(u=this.mesh.makeEdge(),this.mesh.splice(u,u.Sym)):(this.mesh.splitEdge(u),u=u.Lnext),u.Org.coords[0]=d[g+0],u.Org.coords[1]=d[g+1],l>2?u.Org.coords[2]=d[g+2]:u.Org.coords[2]=0,u.Org.idx=this.vertexIndexCounter++,u.winding=1,u.Sym.winding=-1;},// int tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )
235
+ tesselate:function tesselate(l,d,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=l,g<2&&(g=2),g>3&&(g=3),!this.mesh)return!1;this.projectPolygon_(),m.computeInterior(this);var A=this.mesh;return d===e.BOUNDARY_CONTOURS?this.setWindingNumber_(A,1,!0):this.tessellateInterior_(A),A.check(),d===e.BOUNDARY_CONTOURS?this.outputContours_(A,g):this.outputPolymesh_(A,d,u,g),!0;}};},/* 62 */ /***/function(h,r){h.exports=e;var t=Object.prototype.hasOwnProperty;function e(){for(var n={},i=0;i<arguments.length;i++){var a=arguments[i];for(var o in a)t.call(a,o)&&(n[o]=a[o]);}return n;}},/* 63 */ /***/function(h,r,t){t.r(r),t.d(r,"createShaders",function(){return s;}),t.d(r,"applyShader",function(){return f;}),t.d(r,"createCloudShaders",function(){return c;}),t.d(r,"applyCloudShader",function(){return v;});var e=t(64),n=t(65),i=t(66),a=t(67);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("shaders");function s(S){S[o]=[];for(var O=0;O<16;O++){var x=[],m=!!(O&1),_T16=!!(O&2),_l12=!!(O&4),d=!!(O&8);m&&x.push("#define TEXTURE 1"),_T16&&x.push("#define FILTER 1"),_l12&&x.push("#define GRADIENT 1"),d&&x.push("#define CLIPPATH 1");var u="".concat(x.join("\n"),"\n"),g=[];m&&g.push("uniform sampler2D u_texSampler;"),d&&g.push("uniform sampler2D u_clipSampler;"),S[o][O]=[u+g.join("\n")+n["default"],u+e["default"]];}}function f(S){var _ref95=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref95$hasTexture=_ref95.hasTexture,O=_ref95$hasTexture===void 0?!1:_ref95$hasTexture,_ref95$hasFilter=_ref95.hasFilter,x=_ref95$hasFilter===void 0?!1:_ref95$hasFilter,_ref95$hasGradient=_ref95.hasGradient,m=_ref95$hasGradient===void 0?!1:_ref95$hasGradient,_ref95$hasClipPath=_ref95.hasClipPath,T=_ref95$hasClipPath===void 0?!1:_ref95$hasClipPath;var l=O|x<<1|m<<2|T<<3;var d=S[o][l];Array.isArray(d)&&(d=S.createProgram.apply(S,_toConsumableArray(d)),S[o][l]=d),S.program!==d&&S.useProgram(d,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var p=[];function c(S){for(var O=0;O<64;O++){var x=[],m=!!(O&1),_T17=!!(O&2),_l13=!!(O&4),d=!!(O&8),u=!!(O&16),g=!!(O&32);m&&x.push("#define TEXTURE 1"),_T17&&x.push("#define FILTER 1"),_l13&&x.push("#define GRADIENT 1"),d&&x.push("#define CLOUDCOLOR 1"),u&&x.push("#define CLOUDFILTER 1"),g&&x.push("#define CLIPPATH 1");var M="".concat(x.join("\n"),"\n"),A=[];if(m){A.push("uniform sampler2D u_texSampler;");for(var R=0;R<12;R++)A.push("uniform sampler2D u_texFrame".concat(R,";"));}g&&A.push("uniform sampler2D u_clipSampler;"),p[O]=[M+A.join("\n")+a["default"],M+i["default"]];}}function v(S){var _ref96=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref96$hasTexture=_ref96.hasTexture,O=_ref96$hasTexture===void 0?!1:_ref96$hasTexture,_ref96$hasFilter=_ref96.hasFilter,x=_ref96$hasFilter===void 0?!1:_ref96$hasFilter,_ref96$hasGradient=_ref96.hasGradient,m=_ref96$hasGradient===void 0?!1:_ref96$hasGradient,_ref96$hasCloudColor=_ref96.hasCloudColor,T=_ref96$hasCloudColor===void 0?!1:_ref96$hasCloudColor,_ref96$hasCloudFilter=_ref96.hasCloudFilter,l=_ref96$hasCloudFilter===void 0?!1:_ref96$hasCloudFilter,_ref96$hasClipPath=_ref96.hasClipPath,d=_ref96$hasClipPath===void 0?!1:_ref96$hasClipPath;var u=O|x<<1|m<<2|T<<3|l<<4|d<<5;var g=p[u];Array.isArray(g)&&(g=S.createProgram.apply(S,_toConsumableArray(g)),p[u]=g),S.program!==g&&S.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}});}},/* 64 */ /***/function(h,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\nattribute vec4 a_color;\nvarying vec4 vColor;\nvarying float flagBackground;\nuniform vec2 u_resolution;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\n#ifdef TEXTURE\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nattribute vec4 a_sourceRect;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nattribute vec2 a_clipUV;\nvarying vec2 vClipUV;\n#endif\n\n#ifdef GRADIENT\nuniform float u_radialGradientVector[6];\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\n#endif\n\nvoid main() {\n gl_PointSize = 1.0;\n\n vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0);\n\n#ifdef GRADIENT\n vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);\n vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);\n float h = u_resolution.y;\n vg1.y = h - vg1.y;\n vg2.y = h - vg2.y;\n vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);\n vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);\n#endif\n \n flagBackground = a_vertexPosition.z;\n vColor = a_color;\n\n#ifdef TEXTURE\n vTextureCoord = a_vertexTextureCoord;\n vSourceRect = a_sourceRect;\n#endif\n\n#ifdef CLIPPATH\n vClipUV = a_clipUV;\n#endif\n}";},/* 65 */ /***/function(h,r,t){t.r(r),r["default"]="precision mediump float;\n\nvarying vec4 vColor;\nvarying float flagBackground;\n\n#ifdef TEXTURE\nvarying vec3 vTextureCoord;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nvarying vec2 vClipUV;\n#endif\n\n#ifdef FILTER\nuniform int u_filterFlag;\nuniform float u_colorMatrix[20];\n#endif\n\n#ifdef GRADIENT\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\nuniform float u_colorSteps[40];\nuniform int u_gradientType;\n// uniform float u_radialGradientVector[6];\n\nvoid gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {\n float t;\n // center circle radius\n float cr = gv1.z;\n // focal circle radius\n float fr = gv2.z;\n\n if(cr > 0.0 || fr > 0.0) {\n // radial gradient\n vec2 center = gv1.xy;\n vec2 focal = gv2.xy;\n float x = focal.x - gl_FragCoord.x;\n float y = focal.y - gl_FragCoord.y;\n float dx = focal.x - center.x;\n float dy = focal.y - center.y;\n float dr = cr - fr;\n float a = dx * dx + dy * dy - dr * dr;\n float b = -2.0 * (y * dy + x * dx + fr * dr);\n float c = x * x + y * y - fr * fr;\n t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));\n } else {\n // linear gradient\n vec2 v1 = gl_FragCoord.xy - gv1.xy;\n vec2 v2 = gv2.xy - gv1.xy;\n t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);\n }\n\n vec4 colors[8];\n colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);\n colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);\n colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);\n colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);\n colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);\n colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);\n colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);\n colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);\n \n float steps[8];\n steps[0] = colorSteps[0];\n steps[1] = colorSteps[5];\n steps[2] = colorSteps[10];\n steps[3] = colorSteps[15];\n steps[4] = colorSteps[20];\n steps[5] = colorSteps[25];\n steps[6] = colorSteps[30];\n steps[7] = colorSteps[35];\n\n color = colors[0];\n for (int i = 1; i < 8; i++) {\n if (steps[i] < 0.0 || steps[i] > 1.0) {\n break;\n }\n if(steps[i] == steps[i - 1]) {\n color = colors[i];\n } else {\n color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));\n }\n if (steps[i] >= t) {\n break;\n }\n }\n}\n#endif\n\n#ifdef FILTER\nvoid transformColor(inout vec4 color, in float colorMatrix[20]) {\n float r = color.r, g = color.g, b = color.b, a = color.a;\n color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];\n color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];\n color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];\n color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];\n}\n#endif\n\nvoid main() {\n vec4 color = vColor;\n float opacity = abs(flagBackground);\n\n#ifdef GRADIENT\n if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {\n gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);\n }\n#endif\n\n if(opacity < 1.0) {\n color.a *= opacity;\n }\n\n#ifdef TEXTURE\n if(flagBackground > 0.0) {\n vec3 texCoord = vTextureCoord;\n\n if(texCoord.z == 1.0) {\n texCoord = fract(texCoord);\n }\n\n if(texCoord.x <= 1.0 && texCoord.x >= 0.0\n && texCoord.y <= 1.0 && texCoord.y >= 0.0) {\n if(vSourceRect.z > 0.0) {\n texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;\n texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);\n }\n vec4 texColor = texture2D(u_texSampler, texCoord.xy);\n float alpha = texColor.a;\n if(opacity < 1.0) {\n texColor.a *= opacity;\n alpha *= mix(0.465, 1.0, opacity);\n }\n // color = mix(color, texColor, texColor.a);\n color.rgb = mix(color.rgb, texColor.rgb, alpha);\n // color.rgb = mix(texColor.rgb, color.rgb, color.a);\n color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));\n color.a = texColor.a + (1.0 - texColor.a) * color.a;\n }\n }\n#endif\n\n#ifdef FILTER\n if(u_filterFlag > 0) {\n transformColor(color, u_colorMatrix);\n }\n#endif\n\n#ifdef CLIPPATH\n float clip = texture2D(u_clipSampler, vClipUV).r;\n color *= clip;\n#endif\n\n gl_FragColor = color;\n}";},/* 66 */ /***/function(h,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\nattribute vec4 a_color;\nvarying vec4 vColor;\nvarying float flagBackground;\nattribute vec3 a_transform0;\nattribute vec3 a_transform1;\nuniform vec2 u_resolution;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\n#ifdef TEXTURE\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nattribute float a_frameIndex;\nvarying float frameIndex;\nattribute vec4 a_sourceRect;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nattribute vec2 a_clipUV;\nvarying vec2 vClipUV;\n#endif\n\n#ifdef CLOUDFILTER\nattribute vec4 a_colorCloud0;\nattribute vec4 a_colorCloud1;\nattribute vec4 a_colorCloud2;\nattribute vec4 a_colorCloud3;\nattribute vec4 a_colorCloud4;\nvarying vec4 colorCloud0;\nvarying vec4 colorCloud1;\nvarying vec4 colorCloud2;\nvarying vec4 colorCloud3;\nvarying vec4 colorCloud4;\n#endif\n\n#ifdef CLOUDCOLOR\nattribute vec4 a_fillCloudColor;\nattribute vec4 a_strokeCloudColor;\n#endif\n\n#ifdef GRADIENT\nuniform float u_radialGradientVector[6];\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\n#endif\n\nvoid main() {\n gl_PointSize = 1.0;\n\n mat3 modelMatrix = mat3(\n a_transform0.x, a_transform1.x, 0, \n a_transform0.y, a_transform1.y, 0,\n a_transform0.z, a_transform1.z, 1\n );\n\n vec3 pos = projectionMatrix * viewMatrix * modelMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0);\n\n#ifdef GRADIENT\n vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);\n vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);\n float h = u_resolution.y;\n vg1.y = h - vg1.y;\n vg2.y = h - vg2.y;\n vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);\n vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);\n#endif\n \n flagBackground = a_vertexPosition.z;\n\n#ifdef CLOUDCOLOR\n if(flagBackground > 0.0) {\n vColor = mix(a_color, a_fillCloudColor, a_fillCloudColor.a);\n } else {\n vColor = mix(a_color, a_strokeCloudColor, a_strokeCloudColor.a);\n }\n#else\n vColor = a_color;\n#endif\n\n#ifdef TEXTURE\n vTextureCoord = a_vertexTextureCoord;\n frameIndex = a_frameIndex;\n vSourceRect = a_sourceRect;\n#endif\n\n#ifdef CLIPPATH\n vClipUV = a_clipUV;\n#endif\n\n#ifdef CLOUDFILTER\n colorCloud0 = a_colorCloud0;\n colorCloud1 = a_colorCloud1;\n colorCloud2 = a_colorCloud2;\n colorCloud3 = a_colorCloud3;\n colorCloud4 = a_colorCloud4;\n#endif\n}";},/* 67 */ /***/function(h,r,t){t.r(r),r["default"]="precision mediump float;\n\nvarying vec4 vColor;\nvarying float flagBackground;\n\n#ifdef TEXTURE\nvarying float frameIndex;\nvarying vec3 vTextureCoord;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nvarying vec2 vClipUV;\n#endif\n\n#ifdef FILTER\nuniform int u_filterFlag;\nuniform float u_colorMatrix[20];\n#endif\n\n#ifdef CLOUDFILTER\nvarying vec4 colorCloud0;\nvarying vec4 colorCloud1;\nvarying vec4 colorCloud2;\nvarying vec4 colorCloud3;\nvarying vec4 colorCloud4;\n#endif\n\n#ifdef GRADIENT\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\nuniform float u_colorSteps[40];\nuniform int u_gradientType;\n\nvoid gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {\n float t;\n // center circle radius\n float cr = gv1.z;\n // focal circle radius\n float fr = gv2.z;\n\n if(cr > 0.0 || fr > 0.0) {\n // radial gradient\n vec2 center = gv1.xy;\n vec2 focal = gv2.xy;\n float x = focal.x - gl_FragCoord.x;\n float y = focal.y - gl_FragCoord.y;\n float dx = focal.x - center.x;\n float dy = focal.y - center.y;\n float dr = cr - fr;\n float a = dx * dx + dy * dy - dr * dr;\n float b = -2.0 * (y * dy + x * dx + fr * dr);\n float c = x * x + y * y - fr * fr;\n t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));\n } else {\n // linear gradient\n vec2 v1 = gl_FragCoord.xy - gv1.xy;\n vec2 v2 = gv2.xy - gv1.xy;\n t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);\n }\n\n vec4 colors[8];\n colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);\n colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);\n colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);\n colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);\n colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);\n colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);\n colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);\n colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);\n \n float steps[8];\n steps[0] = colorSteps[0];\n steps[1] = colorSteps[5];\n steps[2] = colorSteps[10];\n steps[3] = colorSteps[15];\n steps[4] = colorSteps[20];\n steps[5] = colorSteps[25];\n steps[6] = colorSteps[30];\n steps[7] = colorSteps[35];\n\n color = colors[0];\n for (int i = 1; i < 8; i++) {\n if (steps[i] < 0.0 || steps[i] > 1.0) {\n break;\n }\n if(steps[i] == steps[i - 1]) {\n color = colors[i];\n } else {\n color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));\n }\n if (steps[i] >= t) {\n break;\n }\n }\n}\n#endif\n\nvoid transformColor(inout vec4 color, in float colorMatrix[20]) {\n float r = color.r, g = color.g, b = color.b, a = color.a;\n color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];\n color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];\n color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];\n color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];\n}\n\n#ifdef CLOUDFILTER\nvoid buildCloudColor(inout float colorCloudMatrix[20]) {\n colorCloudMatrix[0] = colorCloud0[0];\n colorCloudMatrix[1] = colorCloud1[0];\n colorCloudMatrix[2] = colorCloud2[0];\n colorCloudMatrix[3] = colorCloud3[0];\n colorCloudMatrix[4] = colorCloud4[0];\n\n colorCloudMatrix[5] = colorCloud0[1];\n colorCloudMatrix[6] = colorCloud1[1];\n colorCloudMatrix[7] = colorCloud2[1];\n colorCloudMatrix[8] = colorCloud3[1];\n colorCloudMatrix[9] = colorCloud4[1];\n\n colorCloudMatrix[10] = colorCloud0[2];\n colorCloudMatrix[11] = colorCloud1[2];\n colorCloudMatrix[12] = colorCloud2[2];\n colorCloudMatrix[13] = colorCloud3[2];\n colorCloudMatrix[14] = colorCloud4[2];\n\n colorCloudMatrix[15] = colorCloud0[3];\n colorCloudMatrix[16] = colorCloud1[3];\n colorCloudMatrix[17] = colorCloud2[3];\n colorCloudMatrix[18] = colorCloud3[3];\n colorCloudMatrix[19] = colorCloud4[3];\n}\n#endif\n\nvoid main() {\n vec4 color = vColor;\n float opacity = abs(flagBackground);\n\n#ifdef GRADIENT\n if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {\n gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);\n }\n#endif\n\n if(opacity < 1.0) {\n color.a *= opacity;\n }\n\n#ifdef TEXTURE\n if(flagBackground > 0.0) {\n vec3 texCoord = vTextureCoord;\n\n if(texCoord.z == 1.0) {\n texCoord = fract(texCoord);\n }\n\n if(texCoord.x <= 1.0 && texCoord.x >= 0.0\n && texCoord.y <= 1.0 && texCoord.y >= 0.0) {\n if(vSourceRect.z > 0.0) {\n texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;\n texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);\n }\n if(frameIndex < 0.0) {\n vec4 texColor = texture2D(u_texSampler, texCoord.xy);\n color = mix(color, texColor, texColor.a);\n } else {\n int index = int(floor(clamp(0.0, 11.0, frameIndex)));\n vec4 texColor;\n if(index == 0) texColor = texture2D(u_texFrame0, texCoord.xy);\n else if(index == 1) texColor = texture2D(u_texFrame1, texCoord.xy);\n else if(index == 2) texColor = texture2D(u_texFrame2, texCoord.xy);\n else if(index == 3) texColor = texture2D(u_texFrame3, texCoord.xy);\n else if(index == 4) texColor = texture2D(u_texFrame4, texCoord.xy);\n else if(index == 5) texColor = texture2D(u_texFrame5, texCoord.xy);\n else if(index == 6) texColor = texture2D(u_texFrame6, texCoord.xy);\n else if(index == 7) texColor = texture2D(u_texFrame7, texCoord.xy);\n else if(index == 8) texColor = texture2D(u_texFrame8, texCoord.xy);\n else if(index == 9) texColor = texture2D(u_texFrame9, texCoord.xy);\n else if(index == 10) texColor = texture2D(u_texFrame10, texCoord.xy);\n else texColor = texture2D(u_texFrame11, texCoord.xy);\n float alpha = texColor.a;\n if(opacity < 1.0) {\n texColor.a *= opacity;\n alpha *= mix(0.465, 1.0, opacity);\n }\n // color = mix(color, texColor, texColor.a);\n color.rgb = mix(color.rgb, texColor.rgb, alpha);\n // color.rgb = mix(texColor.rgb, color.rgb, color.a);\n color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));\n color.a = texColor.a + (1.0 - texColor.a) * color.a;\n }\n }\n }\n#endif\n\n#ifdef FILTER\n if(u_filterFlag > 0) {\n transformColor(color, u_colorMatrix);\n }\n#endif\n\n#ifdef CLOUDFILTER\n float colorCloudMatrix[20];\n buildCloudColor(colorCloudMatrix);\n transformColor(color, colorCloudMatrix);\n#endif\n\n#ifdef CLIPPATH\n float clip = texture2D(u_clipSampler, vClipUV).r;\n color *= clip;\n#endif\n\n gl_FragColor = color;\n}";},/* 68 */ /***/function(h,r,t){t.r(r),function(e,n){t.d(r,"requestAnimationFrame",function(){return a;}),t.d(r,"cancelAnimationFrame",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function i(){if((typeof performance==="undefined"?"undefined":_typeof(performance))<"u"&&performance.now)return performance.now();if(_typeof(e)<"u"&&e.hrtime){var _e$hrtime=e.hrtime(),_e$hrtime2=_slicedToArray(_e$hrtime,2),s=_e$hrtime2[0],f=_e$hrtime2[1];return s*1e3+f*1e-6;}return Date.now?Date.now():(/* @__PURE__ */new Date()).getTime();}var a,o;_typeof(n)<"u"&&typeof n.requestAnimationFrame=="function"?(a=n.requestAnimationFrame,o=n.cancelAnimationFrame):(a=function a(s){return setTimeout(function(){s(i());},16);},o=function o(s){return clearTimeout(s);});}.call(this,t(69),t(22));},/* 69 */ /***/function(h,r){var t=h.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(_unused9){e=i;}try{typeof clearTimeout=="function"?n=clearTimeout:n=a;}catch(_unused10){n=a;}})();function o(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(_unused11){try{return e.call(null,T,0);}catch(_unused12){return e.call(this,T,0);}}}function s(T){if(n===clearTimeout)return clearTimeout(T);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(T);try{return n(T);}catch(_unused13){try{return n.call(null,T);}catch(_unused14){return n.call(this,T);}}}var f=[],p=!1,c,v=-1;function S(){!p||!c||(p=!1,c.length?f=c.concat(f):v=-1,f.length&&O());}function O(){if(!p){var T=o(S);p=!0;for(var l=f.length;l;){for(c=f,f=[];++v<l;)c&&c[v].run();v=-1,l=f.length;}c=null,p=!1,s(T);}}t.nextTick=function(T){var l=new Array(arguments.length-1);if(arguments.length>1)for(var d=1;d<arguments.length;d++)l[d-1]=arguments[d];f.push(new x(T,l)),f.length===1&&!p&&o(O);};function x(T,l){this.fun=T,this.array=l;}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;};},/* 70 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return R;});var e=t(1),n=t(71),i=t(73),a=t(213),o=t(214),s=t(215),f=t(216);t(1).glMatrix.setMatrixArrayType(Array);function p(b,E){var L=Object.keys(b);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(b);E&&(D=D.filter(function(I){return Object.getOwnPropertyDescriptor(b,I).enumerable;})),L.push.apply(L,D);}return L;}function c(b){for(var E=1;E<arguments.length;E++){var L=arguments[E]!=null?arguments[E]:{};E%2?p(Object(L),!0).forEach(function(D){v(b,D,L[D]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(L)):p(Object(L)).forEach(function(D){Object.defineProperty(b,D,Object.getOwnPropertyDescriptor(L,D));});}return b;}function v(b,E,L){return E in b?Object.defineProperty(b,E,{value:L,enumerable:!0,configurable:!0,writable:!0}):b[E]=L,b;}var S=Symbol["for"]("spritejs_changedAttrs"),O=Symbol["for"]("spritejs_attributes"),x=Symbol("resolution"),m=Symbol("animations"),T=Symbol("eventListeners"),l=Symbol("captureEventListeners"),d=Symbol("filters"),u=Symbol("display"),g=Symbol("program"),M=Symbol("shaderAttrs"),A=Symbol("uniforms");var R=/*#__PURE__*/function(){function R(){var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,R);this.attributes=new this.constructor.Attr(this),this[x]={width:300,height:150},Object.assign(this.attributes,E),this[m]=/* @__PURE__ */new Set(),this[T]={},this[l]={};}return _createClass(R,[{key:"ancestors",get:function get(){var E=this.parent;var L=[];for(;E;)L.push(E),E=E.parent;return L;}},{key:"animations",get:function get(){return this[m];}},{key:"filters",get:function get(){return this[d]||this.parent&&this.parent.filters;}},{key:"isVisible",get:function get(){return!1;}},{key:"layer",get:function get(){return this.parent?this.parent.layer:null;}},{key:"localMatrix",get:function get(){var E=this.transformMatrix,_this$attributes=this.attributes,L=_this$attributes.x,D=_this$attributes.y;return E[4]+=L,E[5]+=D,E;}},{key:"opacity",get:function get(){var E=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(E*=this.parent.opacity),E;}},{key:"parentNode",get:function get(){return this.parent;}},{key:"nextSibling",get:function get(){return this.getNodeNearBy(1);}},{key:"previousSibling",get:function get(){return this.getNodeNearBy(-1);}},{key:"program",get:function get(){return this[g];}/* get parent defined by connect method */},{key:"renderer",get:function get(){return this.parent?this.parent.renderer:null;}},{key:"renderMatrix",get:function get(){if(this.__cacheRenderMatrix)return this.__cacheRenderMatrix;var E=this.localMatrix;var L=this.parent;if(L){var D=L.__cacheRenderMatrix||L.renderMatrix;D&&(E=e.mat2d.multiply(Array.of(0,0,0,0,0,0),D,E));}return E;}},{key:"worldScaling",get:function get(){var E=this.renderMatrix;return[Math.hypot(E[0],E[1]),Math.hypot(E[2],E[3])];}},{key:"worldRotation",get:function get(){var E=this.renderMatrix;return Math.atan2(E[1],E[3]);}},{key:"worldPosition",get:function get(){var E=this.renderMatrix;return[E[4],E[5]];}},{key:"uniforms",get:function get(){return this[A];}/* get zOrder defined by connect method */ /* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(E){this.attributes.className=E;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(E){this.attributes.id=E;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(E){this.attributes.name=E;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(E){this.attributes.zIndex=E;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[M]||{};}},{key:"activateAnimations",value:function activateAnimations(){var E=this.layer;if(E){var L=this[m];L.forEach(function(I){I.baseTimeline=E.timeline,I.play(),I.finished.then(function(){L["delete"](I);});});var D=this.children;D&&D.forEach(function(I){I.activateAnimations&&I.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(E,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};E==="mousewheel"&&(E="wheel"),typeof D=="boolean"&&(D={capture:D});var _D8=D,I=_D8.capture,C=_D8.once,W=I?l:T;return this[W][E]=this[W][E]||[],this[W][E].push({listener:L,once:C}),this;}},{key:"animate",value:function animate(E,L){var _this10=this;var 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(function(){_this10[m]["delete"](D);})),this[m].add(D),D;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,E=new Array(_len7),_key7=0;_key7<_len7;_key7++){E[_key7]=arguments[_key7];}if(E.length===0)return this.attributes[O];if(E.length>1){var L=E[0],D=E[1];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);}},{key:"cloneNode",value:function cloneNode(){var E=new this.constructor(),L=this.attributes[S];return E.attr(L),E;}},{key:"connect",value:function 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}});}},{key:"contains",value:function contains(E){for(;E&&this!==E;)E=E.parent;return!!E;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[m].forEach(function(L){return L.cancel();});var E=this.children;E&&E.forEach(function(L){L.deactivateAnimations&&L.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var E=this.parent,L=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:E,zOrder:L}}),E&&E.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(E){var _this11=this;E instanceof o["default"]||(E=new o["default"](E)),E.target=this;var L=E.type;L==="mousewheel"&&(L="wheel");var D=[this];var I=this.parent;for(;E.bubbles&&I;)D.push(I),I=I.parent;for(var C=D.length-1;C>=0;C--){var W=D[C],G=W[l]&&W[l][L];if(G&&G.length&&(E.currentTarget=W,G.forEach(function(_ref97){var K=_ref97.listener,J=_ref97.once;K.call(_this11,E),J&&D.removeEventListener(K);}),delete E.currentTarget),!E.bubbles&&E.cancelBubble)break;}if(!E.cancelBubble)for(var _C4=0;_C4<D.length;_C4++){var _W=D[_C4],_G3=_W[T]&&_W[T][L];if(_G3&&_G3.length&&(E.currentTarget=_W,_G3.forEach(function(_ref98){var K=_ref98.listener,J=_ref98.once;K.call(_this11,E),J&&D.removeEventListener(K);}),delete E.currentTarget),!E.bubbles||E.cancelBubble)break;}}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(E){var L=E.layerX,D=E.layerY;return this.isPointCollision(L,D)?(this.dispatchEvent(E),!0):!1;}},{key:"draw",value:function draw(){var _this12=this;var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var L=this.mesh;if(L){if(Object(s.applyFilters)(L,this.filters),E.push(L),this[g]){L.setProgram(this[g]);var D=this[M];D&&Object.entries(D).forEach(function(_ref99){var _ref100=_slicedToArray(_ref99,2),C=_ref100[0],W=_ref100[1];L.setAttribute(C,W);});var I=this[A];if(this[A]){var C={};Object.entries(I).forEach(function(_ref101){var _ref102=_slicedToArray(_ref101,2),W=_ref102[0],G=_ref102[1];typeof G=="function"&&(G=G(_this12,W)),C[W]=G;}),L.setUniforms(C);}}Object(f["default"])(this,L);}return E;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(E){return this.attributes[E];}},{key:"getListeners",value:function getListeners(E){var _ref103=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref103$capture=_ref103.capture,L=_ref103$capture===void 0?!1:_ref103$capture;return _toConsumableArray(this[L?l:T][E]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(E===0)return this;var L=this.parent.children,D=L.indexOf(this);return L[D+E];}},{key:"getWorldPosition",value:function getWorldPosition(E,L){var D=this.renderMatrix,I=E*D[0]+L*D[2]+D[4],C=E*D[1]+L*D[3]+D[5];return[I,C];}},{key:"getOffsetPosition",value:function getOffsetPosition(E,L){var D=e.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),I=E*D[0]+L*D[2]+D[4],C=E*D[1]+L*D[3]+D[5];return[I,C];}},{key:"getResolution",value:function getResolution(){return c({},this[x]);}},{key:"isPointCollision",value:function isPointCollision(E,L){if(!this.mesh)return!1;var D=this.attributes.pointerEvents;if(D==="none"||D!=="all"&&!this.isVisible)return!1;var I="both";return D==="visibleFill"&&(I="fill"),D==="visibleStroke"&&(I="stroke"),this.mesh.isPointCollision(E,L,I);}},{key:"onPropertyChange",value:function onPropertyChange(E,L,D){E!=="id"&&E!=="name"&&E!=="className"&&E!=="pointerEvents"&&E!=="passEvents"&&this.forceUpdate(),E==="filter"&&(this[d]=Object(s.parseFilterString)(L)),E==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(E,L){E==="attrs"&&this.attr(L),this.attributes[E]=L;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)
236
+ },{key:"setProgram",value:function setProgram(E){this[g]=E,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(E,L){this[M]=this[M]||{},this[M][E]=L,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(E){this[A]=this[A]||{},Object.assign(this[A],E),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref104){var E=_ref104.width,L=_ref104.height;var _this$x3=this[x],D=_this$x3.width,I=_this$x3.height;(D!==E||I!==L)&&(this[x]={width:E,height:L},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:E,height:L}}));}},{key:"show",value:function show(){this.attributes.display==="none"&&(this.attributes.display=this[u]||"");}},{key:"hide",value:function hide(){this.attributes.display!=="none"&&(this[u]=this.attributes.display,this.attributes.display="none");}},{key:"releaseMouseCapture",value:function releaseMouseCapture(){this.layer&&this.layer.__mouseCapturedTarget===this&&(this.layer.__mouseCapturedTarget=null);}},{key:"remove",value:function remove(){return this.parent&&this.parent.removeChild?(this.parent.removeChild(this),!0):!1;}},{key:"removeAllListeners",value:function removeAllListeners(E){var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof L=="boolean"&&(L={capture:L});var I=L.capture?l:T;return this[I][E]&&(this[I][E]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(E){this.setAttribute(E,null);}},{key:"removeEventListener",value:function removeEventListener(E,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof D=="boolean"&&(D={capture:D});var C=D.capture?l:T;if(this[C][E]){var W=this[C][E];if(W)for(var G=0;G<W.length;G++){var K=W[G].listener;if(K===L){this[C][E].splice(G,1);break;}}}return this;}},{key:"transition",value:function transition(E){var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"linear";var D=this,I=Symbol("animation");L=L||"linear";var C=0;return _typeof(E)=="object"&&(C=E.delay||0,E=E.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},I,null),"cancel",function cancel(){var W=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var G=this[I];G&&G.cancel(W);}),"end",function end(){var W=this[I];W&&(W.playState==="running"||W.playState==="pending")&&W.finish();}),"reverse",function reverse(){var W=this[I];if(W)if(W.playState==="running"||W.playState==="pending")W.playbackRate=-W.playbackRate;else{var G=W.timing.direction;W.timing.direction=G==="reverse"?"normal":"reverse",W.play();}return W.finished;}),"attr",function attr(W,G){return this.end(),typeof W=="string"&&(W=_defineProperty({},W,G)),Object.entries(W).forEach(function(_ref105){var _ref106=_slicedToArray(_ref105,2),K=_ref106[0],J=_ref106[1];typeof J=="function"&&(W[K]=J(D.attr(K)));}),this[I]=D.animate([W],{duration:E*1e3,delay:C*1e3,fill:"forwards",easing:L}),this[I].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();v(R,"Attr",n["default"]),a["default"].registerNode(R,"node");},/* 71 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return R;});var e=t(1),n=t(12),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_declareAlias"),s=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),p=Symbol["for"]("spritejs_attributes"),c=Symbol["for"]("spritejs_changedAttrs"),v=Symbol("subject"),S=Symbol("attr"),O=Symbol("default"),x=Symbol("alias");function m(b,_ref108){var _ref109=_slicedToArray(_ref108,2),E=_ref109[0],L=_ref109[1];var D=e.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(b).forEach(function(_ref110){var _ref111=_slicedToArray(_ref110,2),I=_ref111[0],C=_ref111[1];if((E||L)&&(D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[E,L])),I==="matrix")D=e.mat2d.multiply(D,D,C);else if(I==="offsetTranslate")D[4]+=C[0],D[5]+=C[1];else if(I==="offsetRotate")D=e.mat2d.rotate(Array.of(0,0,0,0,0,0),D,C);else if(I==="skew"){var _C5=_slicedToArray(C,2),W=_C5[0],G=_C5[1];D=e.mat2d.multiply(D,D,e.mat2d.fromValues(1,Math.tan(G),Math.tan(W),1,0,0));}else e.mat2d[I](D,D,C);(E||L)&&(D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-E,-L]));}),D;}var T=Symbol("transformMatrix"),l=Symbol("transforms"),d=Symbol("changedAttrs"),u=Symbol("lastChangedAttr"),g=Symbol("offsetFigure");function M(b,E,L){var D=b[S][E];if(b[s](E,L,!1)||b[u]!==E){var C=b[l];C.has(E)&&C["delete"](E),L&&(E==="rotate"&&(L=Math.PI*L/180),E==="scale"&&(L=L.map(function(W){return Math.abs(W)>1e-5?W:1/W>0?1e-5:-1e-5;})),C.set(E,L)),b[T]=null,b[v].onPropertyChange(E,L,D,b);}}function A(b){var E=b[g],L=b.offsetDistance*E.getTotalLength(),D=E.getPointAtLength(L);if(D){var I=b[l];var C=b.offsetRotate;C==="auto"?C=D.angle:C==="reverse"?C=Math.PI+D.angle:C=Math.PI*C/180,I.set("offsetRotate",C),I.set("offsetTranslate",[D.x,D.y]),b[T]=null;}}var R=/*#__PURE__*/function(){function R(E){var _this13=this;_classCallCheck(this,R);this[v]=E,this[S]={},this[T]=e.mat2d.fromValues(1,0,0,1,0,0),this[l]=/* @__PURE__ */new Map(),this[O]={},this[x]=[],Object.defineProperty(E,"transformMatrix",{get:function get(){return _this13[T]||(_this13[T]=m(_this13[l],_this13.transformOrigin)),_toConsumableArray(_this13[T]);}}),this[a]({id:"",name:"",className:"",/* class */x:0,y:0,/* pos */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",// none | visible | visibleFill | visibleStroke | all
237
+ filter:"none",display:""}),this[o]("class","pos"),this[d]=/* @__PURE__ */new Set(),this[g]=new n.Figure2D({scale:5,simplify:0});}return _createClass(R,[{key:c,get:function get(){var _this14=this;var E={};return _toConsumableArray(this[d]).forEach(function(L){E[L]=_this14[S][L];}),E;}},{key:p,get:function get(){var E=Object.assign({},this[S]);for(var L=0;L<this[x].length;L++){var D=this[x][L];E[D]=this[D];}return E;}},{key:a,value:function value(E){Object.assign(this[O],E),Object.assign(this[S],E);}},{key:o,value:function value(){var _this$x4;(_this$x4=this[x]).push.apply(_this$x4,arguments);}},{key:s,value:function value(E,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var I=this[S][E],C=this[v];return L==null&&(L=this[O][E]),Object(i.compareValue)(I,L)?!1:(this[S][E]=L,this[d].has(E)&&this[d]["delete"](E),this[d].add(E),this[u]=E,D&&C.onPropertyChange(E,L,I,this),!0);}},{key:f,value:function value(E){return this[S][E];}},{key:"id",set:function set(E){this[s]("id",E);}},{key:"id",get:function get(){return this[f]("id");}},{key:"name",set:function set(E){this[s]("name",E);}},{key:"name",get:function get(){return this[f]("name");}},{key:"className",set:function set(E){this[s]("className",E);}},{key:"className",get:function get(){return this[f]("className");}},{key:"class",set:function set(E){this.className=E;}},{key:"class",get:function get(){return this.className;}},{key:"x",get:function get(){return this[f]("x");}},{key:"x",set:function set(E){this[s]("x",Object(i.toNumber)(E));}},{key:"y",get:function get(){return this[f]("y");}},{key:"y",set:function set(E){this[s]("y",Object(i.toNumber)(E));}},{key:"pos",get:function get(){return[this.x,this.y];}},{key:"pos",set:function set(E){E=Object(i.toArray)(E),Array.isArray(E)||(E=[E,E]),this.x=E[0],this.y=E[1];}},{key:"transform",get:function get(){return this[f]("transform");}},{key:"transform",set:function set(E){var L=null;if(Array.isArray(E)&&(L=E,E="matrix(".concat(E.map(i.toNumber).join(),")")),typeof E=="string")E=E.replace(/\s*,\s*/g,",");else if(E!=null)throw new TypeError("Invalid transform value.");var D=this[S].transform;if(this[s]("transform",E,!1)){var I=this[l];if(I.has("matrix")&&I["delete"]("matrix"),L)I.set("matrix",L);else if(E){var C=E.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(C){var W=e.mat2d.fromValues(1,0,0,1,0,0);for(var G=0;G<C.length;G++){var J=C[G].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(J){var _J2=_slicedToArray(J,3),Z=_J2[1],B=_J2[2];Z==="rotate"?B=Math.PI*parseFloat(B)/180:B=B.trim().split(/[\s,]+/).map(function($){return Object(i.toNumber)($);}),Z==="matrix"?W=e.mat2d.multiply(W,W,B):Z==="skew"?W=e.mat2d.multiply(W,W,e.mat2d.fromValues(1,Math.tan(B[1]),Math.tan(B[0]),1,0,0)):e.mat2d[Z](W,W,B),I.set("matrix",W);}}}else throw new TypeError("Invalid transform value.");}this[T]=null,this[v].onPropertyChange("transform",E,D,this);}}},{key:"transformOrigin",get:function get(){return this[f]("transformOrigin");}},{key:"transformOrigin",set:function set(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),this[s]("transformOrigin",E)&&(this[T]=null);}},{key:"rotate",get:function get(){return this[f]("rotate");}},{key:"rotate",set:function set(E){M(this,"rotate",E);}},{key:"translate",get:function get(){return this[f]("translate");}},{key:"translate",set:function set(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),M(this,"translate",E);}},{key:"scale",get:function get(){return this[f]("scale");}},{key:"scale",set:function set(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),M(this,"scale",E);}},{key:"skew",get:function get(){return this[f]("skew");}},{key:"skew",set:function set(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),M(this,"skew",E);}},{key:"opacity",get:function get(){return this[f]("opacity");}},{key:"opacity",set:function set(E){E!=null&&(E=Number(E)),this[s]("opacity",E);}},{key:"zIndex",get:function get(){return this[f]("zIndex");}},{key:"zIndex",set:function set(E){E!=null&&(E=Number(E)),this[s]("zIndex",E);}},{key:"offsetPath",get:function get(){return this[f]("offsetPath");}},{key:"offsetPath",set:function set(E){this[s]("offsetPath",E)&&(this[g].beginPath(),E!=null&&this[g].addPath(E),A(this));}},{key:"offsetDistance",get:function get(){return this[f]("offsetDistance");}},{key:"offsetDistance",set:function set(E){this[s]("offsetDistance",Object(i.toNumber)(E))&&A(this);}},{key:"offsetRotate",get:function get(){return this[f]("offsetRotate");}},{key:"offsetRotate",set:function set(E){this[s]("offsetRotate",E),A(this);}},{key:"pointerEvents",get:function get(){return this[f]("pointerEvents");}},{key:"pointerEvents",set:function set(E){if(E!=null&&E!=="none"&&E!=="visible"&&E!=="visibleFill"&&E!=="visibleStroke"&&E!=="all")throw new TypeError("Invalid pointerEvents type.");this[s]("pointerEvents",E);}},{key:"filter",get:function get(){return this[f]("filter");}},{key:"filter",set:function set(E){this[s]("filter",E);}},{key:"display",get:function get(){return this[f]("display");}},{key:"display",set:function set(E){this[s]("display",E);}/* istanbul ignore next */},{key:"offset",set:function set(E){}}],[{key:"setDefault",value:function setDefault(E){for(var _len8=arguments.length,L=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){L[_key8-1]=arguments[_key8];}return E[a].apply(E,L);}},{key:"declareAlias",value:function declareAlias(E){for(var _len9=arguments.length,L=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){L[_key9-1]=arguments[_key9];}return E[o].apply(E,L);}},{key:"setAttribute",value:function setAttribute(E){for(var _len10=arguments.length,L=new Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){L[_key10-1]=arguments[_key10];}return E[s].apply(E,L);}},{key:"getAttribute",value:function getAttribute(E){for(var _len11=arguments.length,L=new Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){L[_key11-1]=arguments[_key11];}return E[f].apply(E,L);}},{key:"getAttributes",value:function getAttributes(E){return E[p];}},{key:"getChangedAttributes",value:function getChangedAttributes(E){return E[c];}}]);}();},/* 72 */ /***/function(h,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 o;}),t(1).glMatrix.setMatrixArrayType(Array);function e(s,f){var p=s.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);p?s={size:parseFloat(p[1]),unit:p[2]}:s={size:parseFloat(s),unit:"px"};var _s3=s,c=_s3.size,v=_s3.unit;if(v==="pt")c/=0.75;else if(v==="pc")c*=16;else if(v==="in")c*=96;else if(v==="cm")c*=96/2.54;else if(v==="mm")c*=96/25.4;else if(v==="em"||v==="rem"||v==="ex"){if(!f&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var S=getComputedStyle(document.documentElement).fontSize;S?f=e(S,16):f=16;}c*=f,v==="ex"&&(c/=2);}else if(v==="q")c*=96/25.4/4;else if(v==="vw"||v==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _S3=v==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;c*=_S3/100;}}else if((v==="vmax"||v==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _S4=window.innerWidth||document.documentElement.clientWidth,O=window.innerHeight||document.documentElement.clientHeight;v==="vmax"?c*=Math.max(_S4,O)/100:c*=Math.min(_S4,O)/100;}return c;}function n(s){return s==null?s:String(s);}function i(s){if(s==null)return s;if(typeof s=="string"&&(s=e(s)),!Number.isFinite(s))throw new TypeError("Invalid value");return s;}function a(s){var f=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return s===""?null:(typeof s=="string"&&(s=s.split(/[\s,]+/g)),Array.isArray(s)&&(f&&(s=s.map(i)),s.length===1)?s[0]:s);}function o(s,f){if(Array.isArray(s)&&Array.isArray(f)){if(s.length!==f.length)return!1;for(var p=0;p<s.length;p++)if(s[p]!==f[p])return!1;return!0;}return s==null&&f==null||s===f;}},/* 73 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return v;});var e=t(74),n=t(32),i=/* @__PURE__ */t.n(n),a=t(68),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function s(){return s=Object.assign||function(S){for(var O=1;O<arguments.length;O++){var x=arguments[O];for(var m in x)Object.prototype.hasOwnProperty.call(x,m)&&(S[m]=x[m]);}return S;},s.apply(this,arguments);}function f(S){if(typeof S=="string"){if(S=S.trim(),/^[0-9.]+%$/.test(S))return parseFloat(S)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(S))return Object(o.sizeToPixel)(S);}return S;}function p(S,O,x,m,T){return typeof S=="string"&&(S=i()(S)),typeof O=="string"&&(O=i()(O)),e.Effects["default"](S,O,x,m,T);}function c(S,O,x,m,T){return e.Effects["default"](S,O,x,m,T);}e.Effects["default"]=function(S,O,x,m,T){return Array.isArray(S)&&Array.isArray(O)?S.map(function(l,d){return l+(x-m)/(T-m)*(O[d]-l);}):typeof S=="number"&&typeof O=="number"?S+(x-m)/(T-m)*(O-S):x-m>T-x?O:S;},e.Effects.fillColor=p,e.Effects.strokeColor=p,e.Effects.bgcolor=p,e.Effects.borderColor=p,e.Effects.text=c;var v=/*#__PURE__*/function(_e$Animator){function v(O,x,m){var _this15;_classCallCheck(this,v);var T=O.attr();Object.entries(T).forEach(function(_ref112){var _ref113=_slicedToArray(_ref112,2),l=_ref113[0],d=_ref113[1];T[l]=e.Effects[l]?d:f(d);}),x=x.map(function(l){var d=s({},l);var u={};return Object.entries(d).forEach(function(_ref114){var _ref115=_slicedToArray(_ref114,2),g=_ref115[0],M=_ref115[1];u[g]=e.Effects[g]?M:f(M);}),u;}),_this15=_callSuper(this,v,[T,x,m]),_this15.target=O,_this15.setter=function(l,d){d.attr(l);};return _this15;}_inherits(v,_e$Animator);return _createClass(v,[{key:"playState",get:function get(){return this.target.parent?_get(_getPrototypeOf(v.prototype),"playState",this):"idle";}},{key:"finished",get:function get(){var _this16=this;return _get(_getPrototypeOf(v.prototype),"finished",this).then(function(){var O=_this16;return new Promise(function(x){function m(){O.setter(O.frame,O.target);var T=O.playState;T==="finished"||T==="idle"?(Object(a.cancelAnimationFrame)(O.requestId),x()):Object(a.requestAnimationFrame)(m);}m();});});}},{key:"finish",value:function finish(){_get(_getPrototypeOf(v.prototype),"finish",this).call(this),Object(a.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_get(_getPrototypeOf(v.prototype),"play",this).call(this),this.setter(this.frame,this.target);var O=this;this.ready.then(function(){O.setter(O.frame,O.target),O.requestId=Object(a.requestAnimationFrame)(function x(){var m=O.target;if((typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.documentElement&&document.documentElement.contains&&m.layer&&m.layer.canvas&&!document.documentElement.contains(m.layer.canvas)){O.cancel();return;}var 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(function(){O.setter(O.frame,O.target),O.requestId=Object(a.requestAnimationFrame)(x);}));});});}},{key:"cancel",value:function cancel(){var O=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(a.cancelAnimationFrame)(this.requestId),O?(this.setter(this.frame,this.target),_get(_getPrototypeOf(v.prototype),"cancel",this).call(this)):(_get(_getPrototypeOf(v.prototype),"cancel",this).call(this),this.setter(this.frame,this.target));}}]);}(e.Animator);},/* 74 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.Timeline=r.Effects=r.Easings=r.Animator=void 0;var e=t(75),n=p(e),i=t(187),a=p(i),o=t(188),s=t(190),f=p(s);function p(c){return c&&c.__esModule?c:{"default":c};}r.Animator=f["default"],r.Easings=o.Easings,r.Effects=a["default"],r.Timeline=n["default"];},/* 75 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=l(e),i=t(133),a=l(i),o=t(141),s=l(o),f=t(164),p=l(f),c=t(170),v=l(c),S=t(171),O=l(S),x=t(175),m=l(x),T=t(186);function l(D){return D&&D.__esModule?D:{"default":D};}var d=(0,T.createNowTime)(),u={originTime:0,playbackRate:1},g=(0,m["default"])("timeMark"),M=(0,m["default"])("playbackRate"),A=(0,m["default"])("timers"),R=(0,m["default"])("originTime"),b=(0,m["default"])("setTimer"),E=(0,m["default"])("parent"),L=function(){function D(I,C){(0,v["default"])(this,D),I instanceof D&&(C=I,I={}),I=(0,p["default"])({},u,I),C&&(this[E]=C);var W=I.nowtime||d;if(C)Object.defineProperty(this,"globalTime",{get:function get(){return C.currentTime;}});else{var G=W();Object.defineProperty(this,"globalTime",{get:function get(){return W()-G;}});}this[g]=[{globalTime:this.globalTime,localTime:-I.originTime,entropy:-I.originTime,playbackRate:I.playbackRate,globalEntropy:0}],this[E]&&(this[g][0].globalEntropy=this[E].entropy),this[R]=I.originTime,this[M]=I.playbackRate,this[A]=new s["default"]();}return(0,O["default"])(D,[{key:"markTime",value:function value(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=C.time,G=W===void 0?this.currentTime:W,K=C.entropy,J=K===void 0?this.entropy:K,Z=C.playbackRate,B=Z===void 0?this.playbackRate:Z,$={globalTime:this.globalTime,localTime:G,entropy:J,playbackRate:B,globalEntropy:this.globalEntropy};this[g].push($);}},{key:"fork",value:function value(C){return new D(C,this);}},{key:"seekGlobalTime",value:function value(C){var W=this.seekTimeMark(C),G=this[g][W],K=G.entropy,J=G.playbackRate,Z=G.globalTime;return Z+(C-K)/Math.abs(J);}},{key:"seekLocalTime",value:function value(C){var W=this.seekTimeMark(C),G=this[g][W],K=G.localTime,J=G.entropy,Z=G.playbackRate;return Z>0?K+(C-J):K-(C-J);}},{key:"seekTimeMark",value:function value(C){var W=this[g],G=0,K=W.length-1;if(C<=W[G].entropy)return G;if(C>=W[K].entropy)return K;for(var J=Math.floor((G+K)/2);J>G&&J<K;){if(C===W[J].entropy)return J;C<W[J].entropy?K=J:C>W[J].entropy&&(G=J),J=Math.floor((G+K)/2);}return G;}},{key:"updateTimers",value:function value(){var C=this,W=[].concat((0,a["default"])(this[A]));W.forEach(function(G){var K=(0,n["default"])(G,2),J=K[0],Z=K[1];C[b](Z.handler,Z.time,J);});}},{key:"clearTimeout",value:function(I){function C(W){return I.apply(this,arguments);}return C.toString=function(){return I.toString();},C;}(function(I){var C=this[A].get(I);C&&C.timerID!=null&&(this[E]?this[E].clearTimeout(C.timerID):clearTimeout(C.timerID)),this[A]["delete"](I);})},{key:"clearInterval",value:function value(C){return this.clearTimeout(C);}},{key:"clear",value:function value(){var C=this,W=this[A];[].concat((0,a["default"])(W.keys())).forEach(function(G){C.clearTimeout(G);});}/*
238
+ setTimeout(func, {delay: 100, isEntropy: true})
239
+ setTimeout(func, {entropy: 100})
240
+ setTimeout(func, 100})
241
+ */},{key:"setTimeout",value:function value(C){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[b](C,W);}},{key:"setInterval",value:function value(C){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},G=this,K=this[b](function J(){G[b](J,W,K),C();},W);return K;}},{key:b,value:function value(C,W){var G=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,m["default"])("timerID");W=(0,T.formatDelay)(W);var J=this[A].get(K),Z=void 0,B=null,$=void 0,Q=void 0;J?(this.clearTimeout(K),W.isEntropy?Z=(W.delay-(this.entropy-J.startEntropy))/Math.abs(this.playbackRate):Z=(W.delay-(this.currentTime-J.startTime))/this.playbackRate,$=J.startTime,Q=J.startEntropy):(Z=W.delay/(W.isEntropy?Math.abs(this.playbackRate):this.playbackRate),$=this.currentTime,Q=this.entropy);var et=this[E],tt=et?et.setTimeout.bind(et):setTimeout,ot=W.heading;return!et&&ot===!1&&Z<0&&(Z=1/0),(isFinite(Z)||et)&&(Z=Math.ceil(Z),tt!==setTimeout&&(Z={delay:Z,heading:ot}),B=tt(function(){G[A]["delete"](K),C();},Z)),this[A].set(K,{timerID:B,handler:C,time:W,startTime:$,startEntropy:Q}),K;}},{key:"parent",get:function get(){return this[E];}},{key:"lastTimeMark",get:function get(){return this[g][this[g].length-1];}},{key:"currentTime",get:function get(){var C=this.lastTimeMark,W=C.localTime,G=C.globalTime;return W+(this.globalTime-G)*this.playbackRate;},set:function set(C){var W=this,G=this.currentTime,K=C,J=this[A];this.markTime({time:C}),[].concat((0,a["default"])(J)).forEach(function(Z){var B=(0,n["default"])(Z,2),$=B[0],Q=B[1];if(J.has($)){var et=Q.time,tt=et.isEntropy,ot=et.delay,q=et.heading,gt=Q.handler,dt=Q.startTime;if(tt)ot===0&&(gt(),W.clearTimeout($));else{var F=dt+ot;(ot===0||q!==!1&&(K-G)*ot<=0||G<=F&&F<=K||G>=F&&F>=K)&&(gt(),W.clearTimeout($));}}}),this.updateTimers();}// Both currentTime and entropy should be influenced by playbackRate.
242
+ // If current playbackRate is negative, the currentTime should go backwards
243
+ // while the entropy remain to go forwards.
244
+ // Both of the initial values is set to -originTime
245
+ },{key:"entropy",get:function get(){var C=this.lastTimeMark,W=C.entropy,G=C.globalEntropy;return W+Math.abs((this.globalEntropy-G)*this.playbackRate);},// get globalTime() {
246
+ // if(this[_parent]) {
247
+ // return this[_parent].currentTime;
248
+ // }
249
+ // return nowtime();
250
+ // }
251
+ // change entropy will NOT cause currentTime changing but may influence the pass
252
+ // and the future of the timeline. (It may change the result of seek***Time)
253
+ // While entropy is set, all the marks behind will be droped
254
+ set:function set(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 get(){return this[E]?this[E].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[M];},set:function set(C){C!==this.playbackRate&&(this.markTime({playbackRate:C}),this[M]=C,this.updateTimers());}},{key:"paused",get:function get(){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;},/* 76 */ /***/function(h,r,t){r.__esModule=!0;var e=t(77),n=o(e),i=t(129),a=o(i);function o(s){return s&&s.__esModule?s:{"default":s};}r["default"]=/* @__PURE__ */function(){function s(f,p){var c=[],v=!0,S=!1,O=void 0;try{for(var x=(0,a["default"])(f),m;!(v=(m=x.next()).done)&&(c.push(m.value),!(p&&c.length===p));v=!0);}catch(T){S=!0,O=T;}finally{try{!v&&x["return"]&&x["return"]();}finally{if(S)throw O;}}return c;}return function(f,p){if(Array.isArray(f))return f;if((0,n["default"])(Object(f)))return s(f,p);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}();},/* 77 */ /***/function(h,r,t){h.exports={"default":t(78),__esModule:!0};},/* 78 */ /***/function(h,r,t){t(79),t(125),h.exports=t(127);},/* 79 */ /***/function(h,r,t){t(80);for(var e=t(91),n=t(95),i=t(83),a=t(122)("toStringTag"),o="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(","),s=0;s<o.length;s++){var f=o[s],p=e[f],c=p&&p.prototype;c&&!c[a]&&n(c,a,f),i[f]=i.Array;}},/* 80 */ /***/function(h,r,t){var e=t(81),n=t(82),i=t(83),a=t(84);h.exports=t(88)(Array,"Array",function(o,s){this._t=a(o),this._i=0,this._k=s;},function(){var o=this._t,s=this._k,f=this._i++;return!o||f>=o.length?(this._t=void 0,n(1)):s=="keys"?n(0,f):s=="values"?n(0,o[f]):n(0,[f,o[f]]);},"values"),i.Arguments=i.Array,e("keys"),e("values"),e("entries");},/* 81 */ /***/function(h,r){h.exports=function(){};},/* 82 */ /***/function(h,r){h.exports=function(t,e){return{value:e,done:!!t};};},/* 83 */ /***/function(h,r){h.exports={};},/* 84 */ /***/function(h,r,t){var e=t(85),n=t(87);h.exports=function(i){return e(n(i));};},/* 85 */ /***/function(h,r,t){var e=t(86);h.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return e(n)=="String"?n.split(""):Object(n);};},/* 86 */ /***/function(h,r){var t={}.toString;h.exports=function(e){return t.call(e).slice(8,-1);};},/* 87 */ /***/function(h,r){h.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t;};},/* 88 */ /***/function(h,r,t){var e=t(89),n=t(90),i=t(106),a=t(95),o=t(83),s=t(107),f=t(121),p=t(123),c=t(122)("iterator"),v=!([].keys&&"next"in[].keys()),S="@@iterator",O="keys",x="values",m=function m(){return this;};h.exports=function(T,l,d,u,g,M,A){s(d,l,u);var R=function R(B){if(!v&&B in D)return D[B];switch(B){case O:return function(){return new d(this,B);};case x:return function(){return new d(this,B);};}return function(){return new d(this,B);};},b=l+" Iterator",E=g==x,L=!1,D=T.prototype,I=D[c]||D[S]||g&&D[g],C=I||R(g),W=g?E?R("entries"):C:void 0,G=l=="Array"&&D.entries||I,K,J,Z;if(G&&(Z=p(G.call(new T())),Z!==Object.prototype&&Z.next&&(f(Z,b,!0),!e&&typeof Z[c]!="function"&&a(Z,c,m))),E&&I&&I.name!==x&&(L=!0,C=function C(){return I.call(this);}),(!e||A)&&(v||L||!D[c])&&a(D,c,C),o[l]=C,o[b]=m,g)if(K={values:E?C:R(x),keys:M?C:R(O),entries:W},A)for(J in K)J in D||i(D,J,K[J]);else n(n.P+n.F*(v||L),l,K);return K;};},/* 89 */ /***/function(h,r){h.exports=!0;},/* 90 */ /***/function(h,r,t){var e=t(91),n=t(92),i=t(93),a=t(95),o=t(105),s="prototype",f=function f(p,c,v){var S=p&f.F,O=p&f.G,x=p&f.S,m=p&f.P,T=p&f.B,l=p&f.W,d=O?n:n[c]||(n[c]={}),u=d[s],g=O?e:x?e[c]:(e[c]||{})[s],M,A,R;O&&(v=c);for(M in v)A=!S&&g&&g[M]!==void 0,!(A&&o(d,M))&&(R=A?g[M]:v[M],d[M]=O&&typeof g[M]!="function"?v[M]:T&&A?i(R,e):l&&g[M]==R?function(b){var E=function E(L,D,I){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,I);}return b.apply(this,arguments);};return E[s]=b[s],E;}(R):m&&typeof R=="function"?i(Function.call,R):R,m&&((d.virtual||(d.virtual={}))[M]=R,p&f.R&&u&&!u[M]&&a(u,M,R)));};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,h.exports=f;},/* 91 */ /***/function(h,r){var t=h.exports=(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&window.Math==Math?window:(typeof self==="undefined"?"undefined":_typeof(self))<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=t);},/* 92 */ /***/function(h,r){var t=h.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t);},/* 93 */ /***/function(h,r,t){var e=t(94);h.exports=function(n,i,a){if(e(n),i===void 0)return n;switch(a){case 1:return function(o){return n.call(i,o);};case 2:return function(o,s){return n.call(i,o,s);};case 3:return function(o,s,f){return n.call(i,o,s,f);};}return function(){return n.apply(i,arguments);};};},/* 94 */ /***/function(h,r){h.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t;};},/* 95 */ /***/function(h,r,t){var e=t(96),n=t(104);h.exports=t(100)?function(i,a,o){return e.f(i,a,n(1,o));}:function(i,a,o){return i[a]=o,i;};},/* 96 */ /***/function(h,r,t){var e=t(97),n=t(99),i=t(103),a=Object.defineProperty;r.f=t(100)?Object.defineProperty:function(s,f,p){if(e(s),f=i(f,!0),e(p),n)try{return a(s,f,p);}catch(_unused15){}if("get"in p||"set"in p)throw TypeError("Accessors not supported!");return"value"in p&&(s[f]=p.value),s;};},/* 97 */ /***/function(h,r,t){var e=t(98);h.exports=function(n){if(!e(n))throw TypeError(n+" is not an object!");return n;};},/* 98 */ /***/function(h,r){h.exports=function(t){return _typeof(t)=="object"?t!==null:typeof t=="function";};},/* 99 */ /***/function(h,r,t){h.exports=!t(100)&&!t(101)(function(){return Object.defineProperty(t(102)("div"),"a",{get:function get(){return 7;}}).a!=7;});},/* 100 */ /***/function(h,r,t){h.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function get(){return 7;}}).a!=7;});},/* 101 */ /***/function(h,r){h.exports=function(t){try{return!!t();}catch(_unused16){return!0;}};},/* 102 */ /***/function(h,r,t){var e=t(98),n=t(91).document,i=e(n)&&e(n.createElement);h.exports=function(a){return i?n.createElement(a):{};};},/* 103 */ /***/function(h,r,t){var e=t(98);h.exports=function(n,i){if(!e(n))return n;var a,o;if(i&&typeof(a=n.toString)=="function"&&!e(o=a.call(n))||typeof(a=n.valueOf)=="function"&&!e(o=a.call(n))||!i&&typeof(a=n.toString)=="function"&&!e(o=a.call(n)))return o;throw TypeError("Can't convert object to primitive value");};},/* 104 */ /***/function(h,r){h.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e};};},/* 105 */ /***/function(h,r){var t={}.hasOwnProperty;h.exports=function(e,n){return t.call(e,n);};},/* 106 */ /***/function(h,r,t){h.exports=t(95);},/* 107 */ /***/function(h,r,t){var e=t(108),n=t(104),i=t(121),a={};t(95)(a,t(122)("iterator"),function(){return this;}),h.exports=function(o,s,f){o.prototype=e(a,{next:n(1,f)}),i(o,s+" Iterator");};},/* 108 */ /***/function(h,r,t){var e=t(97),n=t(109),i=t(119),a=t(116)("IE_PROTO"),o=function o(){},s="prototype",_f2=function f(){var p=t(102)("iframe"),c=i.length,v="<",S=">",O;for(p.style.display="none",t(120).appendChild(p),p.src="javascript:",O=p.contentWindow.document,O.open(),O.write(v+"script"+S+"document.F=Object"+v+"/script"+S),O.close(),_f2=O.F;c--;)delete _f2[s][i[c]];return _f2();};h.exports=Object.create||function(c,v){var S;return c!==null?(o[s]=e(c),S=new o(),o[s]=null,S[a]=c):S=_f2(),v===void 0?S:n(S,v);};},/* 109 */ /***/function(h,r,t){var e=t(96),n=t(97),i=t(110);h.exports=t(100)?Object.defineProperties:function(o,s){n(o);for(var f=i(s),p=f.length,c=0,v;p>c;)e.f(o,v=f[c++],s[v]);return o;};},/* 110 */ /***/function(h,r,t){var e=t(111),n=t(119);h.exports=Object.keys||function(a){return e(a,n);};},/* 111 */ /***/function(h,r,t){var e=t(105),n=t(84),i=t(112)(!1),a=t(116)("IE_PROTO");h.exports=function(o,s){var f=n(o),p=0,c=[],v;for(v in f)v!=a&&e(f,v)&&c.push(v);for(;s.length>p;)e(f,v=s[p++])&&(~i(c,v)||c.push(v));return c;};},/* 112 */ /***/function(h,r,t){var e=t(84),n=t(113),i=t(115);h.exports=function(a){return function(o,s,f){var p=e(o),c=n(p.length),v=i(f,c),S;if(a&&s!=s){for(;c>v;)if(S=p[v++],S!=S)return!0;}else for(;c>v;v++)if((a||v in p)&&p[v]===s)return a||v||0;return!a&&-1;};};},/* 113 */ /***/function(h,r,t){var e=t(114),n=Math.min;h.exports=function(i){return i>0?n(e(i),9007199254740991):0;};},/* 114 */ /***/function(h,r){var t=Math.ceil,e=Math.floor;h.exports=function(n){return isNaN(n=+n)?0:(n>0?e:t)(n);};},/* 115 */ /***/function(h,r,t){var e=t(114),n=Math.max,i=Math.min;h.exports=function(a,o){return a=e(a),a<0?n(a+o,0):i(a,o);};},/* 116 */ /***/function(h,r,t){var e=t(117)("keys"),n=t(118);h.exports=function(i){return e[i]||(e[i]=n(i));};},/* 117 */ /***/function(h,r,t){var e=t(92),n=t(91),i="__core-js_shared__",a=n[i]||(n[i]={});(h.exports=function(o,s){return a[o]||(a[o]=s!==void 0?s:{});})("versions",[]).push({version:e.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"});},/* 118 */ /***/function(h,r){var t=0,e=Math.random();h.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+e).toString(36));};},/* 119 */ /***/function(h,r){h.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},/* 120 */ /***/function(h,r,t){var e=t(91).document;h.exports=e&&e.documentElement;},/* 121 */ /***/function(h,r,t){var e=t(96).f,n=t(105),i=t(122)("toStringTag");h.exports=function(a,o,s){a&&!n(a=s?a:a.prototype,i)&&e(a,i,{configurable:!0,value:o});};},/* 122 */ /***/function(h,r,t){var e=t(117)("wks"),n=t(118),i=t(91).Symbol,a=typeof i=="function",o=h.exports=function(s){return e[s]||(e[s]=a&&i[s]||(a?i:n)("Symbol."+s));};o.store=e;},/* 123 */ /***/function(h,r,t){var e=t(105),n=t(124),i=t(116)("IE_PROTO"),a=Object.prototype;h.exports=Object.getPrototypeOf||function(o){return o=n(o),e(o,i)?o[i]:typeof o.constructor=="function"&&o instanceof o.constructor?o.constructor.prototype:o instanceof Object?a:null;};},/* 124 */ /***/function(h,r,t){var e=t(87);h.exports=function(n){return Object(e(n));};},/* 125 */ /***/function(h,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});});},/* 126 */ /***/function(h,r,t){var e=t(114),n=t(87);h.exports=function(i){return function(a,o){var s=String(n(a)),f=e(o),p=s.length,c,v;return f<0||f>=p?i?"":void 0:(c=s.charCodeAt(f),c<55296||c>56319||f+1===p||(v=s.charCodeAt(f+1))<56320||v>57343?i?s.charAt(f):c:i?s.slice(f,f+2):(c-55296<<10)+(v-56320)+65536);};};},/* 127 */ /***/function(h,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);h.exports=t(92).isIterable=function(a){var o=Object(a);return o[n]!==void 0||"@@iterator"in o||i.hasOwnProperty(e(o));};},/* 128 */ /***/function(h,r,t){var e=t(86),n=t(122)("toStringTag"),i=e(/* @__PURE__ */function(){return arguments;}())=="Arguments",a=function a(o,s){try{return o[s];}catch(_unused17){}};h.exports=function(o){var s,f,p;return o===void 0?"Undefined":o===null?"Null":typeof(f=a(s=Object(o),n))=="string"?f:i?e(s):(p=e(s))=="Object"&&typeof s.callee=="function"?"Arguments":p;};},/* 129 */ /***/function(h,r,t){h.exports={"default":t(130),__esModule:!0};},/* 130 */ /***/function(h,r,t){t(79),t(125),h.exports=t(131);},/* 131 */ /***/function(h,r,t){var e=t(97),n=t(132);h.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));};},/* 132 */ /***/function(h,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);h.exports=t(92).getIteratorMethod=function(a){if(a!=null)return a[n]||a["@@iterator"]||i[e(a)];};},/* 133 */ /***/function(h,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 o=0,s=Array(a.length);o<a.length;o++)s[o]=a[o];return s;}else return(0,n["default"])(a);};},/* 134 */ /***/function(h,r,t){h.exports={"default":t(135),__esModule:!0};},/* 135 */ /***/function(h,r,t){t(125),t(136),h.exports=t(92).Array.from;},/* 136 */ /***/function(h,r,t){var e=t(93),n=t(90),i=t(124),a=t(137),o=t(138),s=t(113),f=t(139),p=t(132);n(n.S+n.F*!t(140)(function(c){Array.from(c);}),"Array",{// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
255
+ from:function from(v){var S=i(v),O=typeof this=="function"?this:Array,x=arguments.length,m=x>1?arguments[1]:void 0,T=m!==void 0,l=0,d=p(S),u,g,M,A;if(T&&(m=e(m,x>2?arguments[2]:void 0,2)),d!=null&&!(O==Array&&o(d)))for(A=d.call(S),g=new O();!(M=A.next()).done;l++)f(g,l,T?a(A,m,[M.value,l],!0):M.value);else for(u=s(S.length),g=new O(u);u>l;l++)f(g,l,T?m(S[l],l):S[l]);return g.length=l,g;}});},/* 137 */ /***/function(h,r,t){var e=t(97);h.exports=function(n,i,a,o){try{return o?i(e(a)[0],a[1]):i(a);}catch(f){var s=n["return"];throw s!==void 0&&e(s.call(n)),f;}};},/* 138 */ /***/function(h,r,t){var e=t(83),n=t(122)("iterator"),i=Array.prototype;h.exports=function(a){return a!==void 0&&(e.Array===a||i[n]===a);};},/* 139 */ /***/function(h,r,t){var e=t(96),n=t(104);h.exports=function(i,a,o){a in i?e.f(i,a,n(0,o)):i[a]=o;};},/* 140 */ /***/function(h,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(_unused18){}h.exports=function(a,o){if(!o&&!n)return!1;var s=!1;try{var f=[7],p=f[e]();p.next=function(){return{done:s=!0};},f[e]=function(){return p;},a(f);}catch(_unused19){}return s;};},/* 141 */ /***/function(h,r,t){h.exports={"default":t(142),__esModule:!0};},/* 142 */ /***/function(h,r,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),h.exports=t(92).Map;},/* 143 */ /***/function(h,r){},/* 144 */ /***/function(h,r,t){var e=t(145),n=t(151),i="Map";h.exports=t(152)(i,function(a){return function(){return a(this,arguments.length>0?arguments[0]:void 0);};},{// 23.1.3.6 Map.prototype.get(key)
256
+ get:function get(o){var s=e.getEntry(n(this,i),o);return s&&s.v;},// 23.1.3.9 Map.prototype.set(key, value)
257
+ set:function set(o,s){return e.def(n(this,i),o===0?0:o,s);}},e,!0);},/* 145 */ /***/function(h,r,t){var e=t(96).f,n=t(108),i=t(146),a=t(93),o=t(147),s=t(148),f=t(88),p=t(82),c=t(149),v=t(100),S=t(150).fastKey,O=t(151),x=v?"_s":"size",m=function m(T,l){var d=S(l),u;if(d!=="F")return T._i[d];for(u=T._f;u;u=u.n)if(u.k==l)return u;};h.exports={getConstructor:function getConstructor(T,l,d,u){var g=T(function(M,A){o(M,g,l,"_i"),M._t=l,M._i=n(null),M._f=void 0,M._l=void 0,M[x]=0,A!=null&&s(A,d,M[u],M);});return i(g.prototype,{// 23.1.3.1 Map.prototype.clear()
258
+ // 23.2.3.2 Set.prototype.clear()
259
+ clear:function clear(){for(var A=O(this,l),R=A._i,b=A._f;b;b=b.n)b.r=!0,b.p&&(b.p=b.p.n=void 0),delete R[b.i];A._f=A._l=void 0,A[x]=0;},// 23.1.3.3 Map.prototype.delete(key)
260
+ // 23.2.3.4 Set.prototype.delete(value)
261
+ "delete":function _delete(M){var A=O(this,l),R=m(A,M);if(R){var b=R.n,E=R.p;delete A._i[R.i],R.r=!0,E&&(E.n=b),b&&(b.p=E),A._f==R&&(A._f=b),A._l==R&&(A._l=E),A[x]--;}return!!R;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
262
+ // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
263
+ forEach:function forEach(A){O(this,l);for(var R=a(A,arguments.length>1?arguments[1]:void 0,3),b;b=b?b.n:this._f;)for(R(b.v,b.k,this);b&&b.r;)b=b.p;},// 23.1.3.7 Map.prototype.has(key)
264
+ // 23.2.3.7 Set.prototype.has(value)
265
+ has:function has(A){return!!m(O(this,l),A);}}),v&&e(g.prototype,"size",{get:function get(){return O(this,l)[x];}}),g;},def:function def(T,l,d){var u=m(T,l),g,M;return u?u.v=d:(T._l=u={i:M=S(l,!0),// <- index
266
+ k:l,// <- key
267
+ v:d,// <- value
268
+ p:g=T._l,// <- previous entry
269
+ n:void 0,// <- next entry
270
+ r:!1// <- removed
271
+ },T._f||(T._f=u),g&&(g.n=u),T[x]++,M!=="F"&&(T._i[M]=u)),T;},getEntry:m,setStrong:function setStrong(T,l,d){f(T,l,function(u,g){this._t=O(u,l),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,p(1)):g=="keys"?p(0,M.k):g=="values"?p(0,M.v):p(0,[M.k,M.v]);},d?"entries":"values",!d,!0),c(l);}};},/* 146 */ /***/function(h,r,t){var e=t(95);h.exports=function(n,i,a){for(var o in i)a&&n[o]?n[o]=i[o]:e(n,o,i[o]);return n;};},/* 147 */ /***/function(h,r){h.exports=function(t,e,n,i){if(!(t instanceof e)||i!==void 0&&i in t)throw TypeError(n+": incorrect invocation!");return t;};},/* 148 */ /***/function(h,c,t){var e=t(93),n=t(137),i=t(138),a=t(97),o=t(113),s=t(132),f={},p={},c=h.exports=function(v,S,O,x,m){var T=m?function(){return v;}:s(v),l=e(O,x,S?2:1),d=0,u,g,M,A;if(typeof T!="function")throw TypeError(v+" is not iterable!");if(i(T)){for(u=o(v.length);u>d;d++)if(A=S?l(a(g=v[d])[0],g[1]):l(v[d]),A===f||A===p)return A;}else for(M=T.call(v);!(g=M.next()).done;)if(A=n(M,l,g.value,S),A===f||A===p)return A;};c.BREAK=f,c.RETURN=p;},/* 149 */ /***/function(h,r,t){var e=t(91),n=t(92),i=t(96),a=t(100),o=t(122)("species");h.exports=function(s){var f=typeof n[s]=="function"?n[s]:e[s];a&&f&&!f[o]&&i.f(f,o,{configurable:!0,get:function get(){return this;}});};},/* 150 */ /***/function(h,r,t){var e=t(118)("meta"),n=t(98),i=t(105),a=t(96).f,o=0,s=Object.isExtensible||function(){return!0;},f=!t(101)(function(){return s(Object.preventExtensions({}));}),p=function p(x){a(x,e,{value:{i:"O"+ ++o,// object ID
272
+ w:{}// weak collections IDs
273
+ }});},c=function c(x,m){if(!n(x))return _typeof(x)=="symbol"?x:(typeof x=="string"?"S":"P")+x;if(!i(x,e)){if(!s(x))return"F";if(!m)return"E";p(x);}return x[e].i;},v=function v(x,m){if(!i(x,e)){if(!s(x))return!0;if(!m)return!1;p(x);}return x[e].w;},S=function S(x){return f&&O.NEED&&s(x)&&!i(x,e)&&p(x),x;},O=h.exports={KEY:e,NEED:!1,fastKey:c,getWeak:v,onFreeze:S};},/* 151 */ /***/function(h,r,t){var e=t(98);h.exports=function(n,i){if(!e(n)||n._t!==i)throw TypeError("Incompatible receiver, "+i+" required!");return n;};},/* 152 */ /***/function(h,r,t){var e=t(91),n=t(90),i=t(150),a=t(101),o=t(95),s=t(146),f=t(148),p=t(147),c=t(98),v=t(121),S=t(96).f,O=t(153)(0),x=t(100);h.exports=function(m,T,l,d,u,g){var M=e[m],A=M,R=u?"set":"add",b=A&&A.prototype,E={};return!x||typeof A!="function"||!(g||b.forEach&&!a(function(){new A().entries().next();}))?(A=d.getConstructor(T,m,u,R),s(A.prototype,l),i.NEED=!0):(A=T(function(L,D){p(L,A,m,"_c"),L._c=new M(),D!=null&&f(D,u,L[R],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")&&o(A.prototype,L,function(I,C){if(p(this,A,L),!D&&g&&!c(I))return L=="get"?void 0:!1;var W=this._c[L](I===0?0:I,C);return D?this:W;});}),g||S(A.prototype,"size",{get:function get(){return this._c.size;}})),v(A,m),E[m]=A,n(n.G+n.W+n.F,E),g||d.setStrong(A,m,u),A;};},/* 153 */ /***/function(h,r,t){var e=t(93),n=t(85),i=t(124),a=t(113),o=t(154);h.exports=function(s,f){var p=s==1,c=s==2,v=s==3,S=s==4,O=s==6,x=s==5||O,m=f||o;return function(T,l,d){for(var u=i(T),g=n(u),M=e(l,d,3),A=a(g.length),R=0,b=p?m(T,A):c?m(T,0):void 0,E,L;A>R;R++)if((x||R in g)&&(E=g[R],L=M(E,R,u),s)){if(p)b[R]=L;else if(L)switch(s){case 3:return!0;case 5:return E;case 6:return R;case 2:b.push(E);}else if(S)return!1;}return O?-1:v||S?S:b;};};},/* 154 */ /***/function(h,r,t){var e=t(155);h.exports=function(n,i){return new(e(n))(i);};},/* 155 */ /***/function(h,r,t){var e=t(98),n=t(156),i=t(122)("species");h.exports=function(a){var o;return n(a)&&(o=a.constructor,typeof o=="function"&&(o===Array||n(o.prototype))&&(o=void 0),e(o)&&(o=o[i],o===null&&(o=void 0))),o===void 0?Array:o;};},/* 156 */ /***/function(h,r,t){var e=t(86);h.exports=Array.isArray||function(i){return e(i)=="Array";};},/* 157 */ /***/function(h,r,t){var e=t(90);e(e.P+e.R,"Map",{toJSON:t(158)("Map")});},/* 158 */ /***/function(h,r,t){var e=t(128),n=t(159);h.exports=function(i){return function(){if(e(this)!=i)throw TypeError(i+"#toJSON isn't generic");return n(this);};};},/* 159 */ /***/function(h,r,t){var e=t(148);h.exports=function(n,i){var a=[];return e(n,!1,a.push,a,i),a;};},/* 160 */ /***/function(h,r,t){t(161)("Map");},/* 161 */ /***/function(h,r,t){var e=t(90);h.exports=function(n){e(e.S,n,{of:function of(){for(var a=arguments.length,o=new Array(a);a--;)o[a]=arguments[a];return new this(o);}});};},/* 162 */ /***/function(h,r,t){t(163)("Map");},/* 163 */ /***/function(h,r,t){var e=t(90),n=t(94),i=t(93),a=t(148);h.exports=function(o){e(e.S,o,{from:function from(f){var p=arguments[1],c,v,S,O;return n(this),c=p!==void 0,c&&n(p),f==null?new this():(v=[],c?(S=0,O=i(p,arguments[2],2),a(f,!1,function(x){v.push(O(x,S++));})):a(f,!1,v.push,v),new this(v));}});};},/* 164 */ /***/function(h,r,t){h.exports={"default":t(165),__esModule:!0};},/* 165 */ /***/function(h,r,t){t(166),h.exports=t(92).Object.assign;},/* 166 */ /***/function(h,r,t){var e=t(90);e(e.S+e.F,"Object",{assign:t(167)});},/* 167 */ /***/function(h,r,t){var e=t(100),n=t(110),i=t(168),a=t(169),o=t(124),s=t(85),f=Object.assign;h.exports=!f||t(101)(function(){var p={},c={},v=Symbol(),S="abcdefghijklmnopqrst";return p[v]=7,S.split("").forEach(function(O){c[O]=O;}),f({},p)[v]!=7||Object.keys(f({},c)).join("")!=S;})?function(c,v){for(var S=o(c),O=arguments.length,x=1,m=i.f,T=a.f;O>x;)for(var l=s(arguments[x++]),d=m?n(l).concat(m(l)):n(l),u=d.length,g=0,M;u>g;)M=d[g++],(!e||T.call(l,M))&&(S[M]=l[M]);return S;}:f;},/* 168 */ /***/function(h,r){r.f=Object.getOwnPropertySymbols;},/* 169 */ /***/function(h,r){r.f={}.propertyIsEnumerable;},/* 170 */ /***/function(h,r,t){r.__esModule=!0,r["default"]=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function");};},/* 171 */ /***/function(h,r,t){r.__esModule=!0;var e=t(172),n=i(e);function i(a){return a&&a.__esModule?a:{"default":a};}r["default"]=/* @__PURE__ */function(){function a(o,s){for(var f=0;f<s.length;f++){var p=s[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),(0,n["default"])(o,p.key,p);}}return function(o,s,f){return s&&a(o.prototype,s),f&&a(o,f),o;};}();},/* 172 */ /***/function(h,r,t){h.exports={"default":t(173),__esModule:!0};},/* 173 */ /***/function(h,r,t){t(174);var e=t(92).Object;h.exports=function(i,a,o){return e.defineProperty(i,a,o);};},/* 174 */ /***/function(h,r,t){var e=t(90);e(e.S+e.F*!t(100),"Object",{defineProperty:t(96).f});},/* 175 */ /***/function(h,r,t){h.exports={"default":t(176),__esModule:!0};},/* 176 */ /***/function(h,r,t){t(177),t(143),t(184),t(185),h.exports=t(92).Symbol;},/* 177 */ /***/function(h,r,t){var e=t(91),n=t(105),i=t(100),a=t(90),o=t(106),s=t(150).KEY,f=t(101),p=t(117),c=t(121),v=t(118),S=t(122),O=t(178),x=t(179),m=t(180),T=t(156),l=t(97),d=t(98),u=t(124),g=t(84),M=t(103),A=t(104),R=t(108),b=t(181),E=t(183),L=t(168),D=t(96),I=t(110),C=E.f,W=D.f,G=b.f,_K2=e.Symbol,J=e.JSON,Z=J&&J.stringify,B="prototype",$=S("_hidden"),Q=S("toPrimitive"),et={}.propertyIsEnumerable,tt=p("symbol-registry"),ot=p("symbols"),q=p("op-symbols"),gt=Object[B],dt=typeof _K2=="function"&&!!L.f,F=e.QObject,j=!F||!F[B]||!F[B].findChild,V=i&&f(function(){return R(W({},"a",{get:function get(){return W(this,"a",{value:7}).a;}})).a!=7;})?function(at,st,ft){var vt=C(gt,st);vt&&delete gt[st],W(at,st,ft),vt&&at!==gt&&W(gt,st,vt);}:W,X=function X(at){var st=ot[at]=R(_K2[B]);return st._k=at,st;},N=dt&&_typeof(_K2.iterator)=="symbol"?function(at){return _typeof(at)=="symbol";}:function(at){return at instanceof _K2;},z=function z(st,ft,vt){return st===gt&&z(q,ft,vt),l(st),ft=M(ft,!0),l(vt),n(ot,ft)?(vt.enumerable?(n(st,$)&&st[$][ft]&&(st[$][ft]=!1),vt=R(vt,{enumerable:A(0,!1)})):(n(st,$)||W(st,$,A(1,{})),st[$][ft]=!0),V(st,ft,vt)):W(st,ft,vt);},y=function y(st,ft){l(st);for(var vt=m(ft=g(ft)),mt=0,pt=vt.length,St;pt>mt;)z(st,St=vt[mt++],ft[St]);return st;},P=function P(st,ft){return ft===void 0?R(st):y(R(st),ft);},w=function w(st){var ft=et.call(this,st=M(st,!0));return this===gt&&n(ot,st)&&!n(q,st)?!1:ft||!n(this,st)||!n(ot,st)||n(this,$)&&this[$][st]?ft:!0;},U=function U(st,ft){if(st=g(st),ft=M(ft,!0),!(st===gt&&n(ot,ft)&&!n(q,ft))){var vt=C(st,ft);return vt&&n(ot,ft)&&!(n(st,$)&&st[$][ft])&&(vt.enumerable=!0),vt;}},H=function H(st){for(var ft=G(g(st)),vt=[],mt=0,pt;ft.length>mt;)!n(ot,pt=ft[mt++])&&pt!=$&&pt!=s&&vt.push(pt);return vt;},Y=function Y(st){for(var ft=st===gt,vt=G(ft?q:g(st)),mt=[],pt=0,St;vt.length>pt;)n(ot,St=vt[pt++])&&(!ft||n(gt,St))&&mt.push(ot[St]);return mt;};dt||(_K2=function K(){if(this instanceof _K2)throw TypeError("Symbol is not a constructor!");var st=v(arguments.length>0?arguments[0]:void 0),ft=function ft(vt){this===gt&&ft.call(q,vt),n(this,$)&&n(this[$],st)&&(this[$][st]=!1),V(this,st,A(1,vt));};return i&&j&&V(gt,st,{configurable:!0,set:ft}),X(st);},o(_K2[B],"toString",function(){return this._k;}),E.f=U,D.f=z,t(182).f=b.f=H,t(169).f=w,L.f=Y,i&&!t(89)&&o(gt,"propertyIsEnumerable",w,!0),O.f=function(at){return X(S(at));}),a(a.G+a.W+a.F*!dt,{Symbol:_K2});for(var k=// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
274
+ "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;k.length>rt;)S(k[rt++]);for(var it=I(S.store),lt=0;it.length>lt;)x(it[lt++]);a(a.S+a.F*!dt,"Symbol",{// 19.4.2.1 Symbol.for(key)
275
+ "for":function _for(at){return n(tt,at+="")?tt[at]:tt[at]=_K2(at);},// 19.4.2.5 Symbol.keyFor(sym)
276
+ keyFor:function keyFor(st){if(!N(st))throw TypeError(st+" is not a symbol!");for(var ft in tt)if(tt[ft]===st)return ft;},useSetter:function useSetter(){j=!0;},useSimple:function useSimple(){j=!1;}}),a(a.S+a.F*!dt,"Object",{// 19.1.2.2 Object.create(O [, Properties])
277
+ create:P,// 19.1.2.4 Object.defineProperty(O, P, Attributes)
278
+ defineProperty:z,// 19.1.2.3 Object.defineProperties(O, Properties)
279
+ defineProperties:y,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
280
+ getOwnPropertyDescriptor:U,// 19.1.2.7 Object.getOwnPropertyNames(O)
281
+ getOwnPropertyNames:H,// 19.1.2.8 Object.getOwnPropertySymbols(O)
282
+ getOwnPropertySymbols:Y});var ut=f(function(){L.f(1);});a(a.S+a.F*ut,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(st){return L.f(u(st));}}),J&&a(a.S+a.F*(!dt||f(function(){var at=_K2();return Z([at])!="[null]"||Z({a:at})!="{}"||Z(Object(at))!="{}";})),"JSON",{stringify:function stringify(st){for(var ft=[st],vt=1,mt,pt;arguments.length>vt;)ft.push(arguments[vt++]);if(pt=mt=ft[1],!(!d(mt)&&st===void 0||N(st)))return T(mt)||(mt=function mt(St,It){if(typeof pt=="function"&&(It=pt.call(this,St,It)),!N(It))return It;}),ft[1]=mt,Z.apply(J,ft);}}),_K2[B][Q]||t(95)(_K2[B],Q,_K2[B].valueOf),c(_K2,"Symbol"),c(Math,"Math",!0),c(e.JSON,"JSON",!0);},/* 178 */ /***/function(h,r,t){r.f=t(122);},/* 179 */ /***/function(h,r,t){var e=t(91),n=t(92),i=t(89),a=t(178),o=t(96).f;h.exports=function(s){var f=n.Symbol||(n.Symbol=i?{}:e.Symbol||{});s.charAt(0)!="_"&&!(s in f)&&o(f,s,{value:a.f(s)});};},/* 180 */ /***/function(h,r,t){var e=t(110),n=t(168),i=t(169);h.exports=function(a){var o=e(a),s=n.f;if(s)for(var f=s(a),p=i.f,c=0,v;f.length>c;)p.call(a,v=f[c++])&&o.push(v);return o;};},/* 181 */ /***/function(h,r,t){var e=t(84),n=t(182).f,i={}.toString,a=(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function o(s){try{return n(s);}catch(_unused20){return a.slice();}};h.exports.f=function(f){return a&&i.call(f)=="[object Window]"?o(f):n(e(f));};},/* 182 */ /***/function(h,r,t){var e=t(111),n=t(119).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(a){return e(a,n);};},/* 183 */ /***/function(h,r,t){var e=t(169),n=t(104),i=t(84),a=t(103),o=t(105),s=t(99),f=Object.getOwnPropertyDescriptor;r.f=t(100)?f:function(c,v){if(c=i(c),v=a(v,!0),s)try{return f(c,v);}catch(_unused21){}if(o(c,v))return n(!e.f.call(c,v),c[v]);};},/* 184 */ /***/function(h,r,t){t(179)("asyncIterator");},/* 185 */ /***/function(h,r,t){t(179)("observable");},/* 186 */ /***/function(h,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 i(){return(/* @__PURE__ */new Date()).getTime();},i;}function n(i){return typeof i=="number"?i={delay:i}:"entropy"in i&&(i={delay:i.entropy,isEntropy:!0}),i;}},/* 187 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={// s - startFrame, e - endFrame
283
+ "default":function _default(n,i,a,o,s){return typeof n=="number"&&typeof i=="number"?n+(a-o)/(s-o)*(i-n):a-o>s-a?i:n;}};},/* 188 */ /***/function(h,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),o=t(141),s=f(o);function f(T){return T&&T.__esModule?T:{"default":T};}var p=t(189),c=new s["default"]();function v(){for(var T=arguments.length,l=Array(T),d=0;d<T;d++)l[d]=arguments[d];var u=c.get(l);return u||(u=p.apply(void 0,l),c.set(l,u),u);}function S(T){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"end";return function(d,u){for(var g=1;g<u.length;g++){var M=u[g].offset;if(d<=M){var A=u[g-1].offset,R=M,b=(d-A)/(R-A),E=1/T,L=b/E;return l==="end"?L=Math.floor(L):L=Math.ceil(L),E*L*(R-A)+A;}}return 0;};}function O(T){var l=/^cubic-bezier\((.*)\)/,d=T.match(l);if(d){var u=d[1].trim();return u=u.split(",").map(function(E){return parseFloat(E.trim());}),v.apply(void 0,(0,a["default"])(u));}if(l=/^steps\((.*)\)/,d=T.match(l),d){var g=d[1].trim();g=g.split(",").map(function(E){return E.trim();});var M=g,A=(0,n["default"])(M,2),R=A[0],b=A[1];return S(parseInt(R,10),b);}return T;}var x={linear:function linear(l){return l;},ease:v(0.25,0.1,0.25,1),"ease-in":v(0.42,0,1,1),"ease-out":v(0,0,0.58,1),"ease-in-out":v(0.42,0,0.58,1),// 'step-start': function(p, frames){
284
+ // let ret = 0
285
+ // for(let i = 0; i < frames.length; i++){
286
+ // const {offset} = frames[i]
287
+ // ret = offset
288
+ // if(p < offset){
289
+ // break
290
+ // }
291
+ // }
292
+ // return ret
293
+ // },
294
+ // 'step-end': function(p, frames){
295
+ // let ret = 0
296
+ // for(let i = 0; i < frames.length; i++){
297
+ // const {offset} = frames[i]
298
+ // if(p < offset){
299
+ // break
300
+ // }
301
+ // ret = offset
302
+ // }
303
+ // return ret
304
+ // }
305
+ "step-start":S(1,"start"),"step-end":S(1,"end")};function m(T){return typeof T=="string"?x[T]?T=x[T]:T=O(T):T.type==="cubic-bezier"?T=v.apply(void 0,(0,a["default"])(T.value)):T.type==="steps"&&(T=S(T.step,T.pos)),T;}r.Easings=x,r.parseEasing=m;},/* 189 */ /***/function(h,r){var t=4,e=1e-3,n=1e-7,i=10,a=11,o=1/(a-1),s=typeof Float32Array=="function";function f(T,l){return 1-3*l+3*T;}function p(T,l){return 3*l-6*T;}function c(T){return 3*T;}function v(T,l,d){return((f(l,d)*T+p(l,d))*T+c(l))*T;}function S(T,l,d){return 3*f(l,d)*T*T+2*p(l,d)*T+c(l);}function O(T,l,d,u,g){var M,A,R=0;do A=l+(d-l)/2,M=v(A,u,g)-T,M>0?d=A:l=A;while(Math.abs(M)>n&&++R<i);return A;}function x(T,l,d,u){for(var g=0;g<t;++g){var M=S(l,d,u);if(M===0)return l;var A=v(l,d,u)-T;l-=A/M;}return l;}function m(T){return T;}h.exports=function(l,d,u,g){if(!(0<=l&&l<=1&&0<=u&&u<=1))throw new Error("bezier x values must be in [0, 1] range");if(l===d&&u===g)return m;for(var M=s?new Float32Array(a):new Array(a),A=0;A<a;++A)M[A]=v(A*o,l,u);function R(b){for(var E=0,L=1,D=a-1;L!==D&&M[L]<=b;++L)E+=o;--L;var I=(b-M[L])/(M[L+1]-M[L]),C=E+I*o,W=S(C,l,u);return W>=e?x(b,C,l,u):W===0?C:O(b,E,E+o,l,u);}return function(E){return E===0?0:E===1?1:v(R(E),d,g);};};},/* 190 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(191),n=d(e),i=t(204),a=d(i),o=t(164),s=d(o),f=t(170),p=d(f),c=t(171),v=d(c),S=t(175),O=d(S),x=t(75),m=d(x),T=t(208),l=t(188);function d(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"),R=(0,O["default"])("finishedDefer"),b=(0,O["default"])("effects"),E=(0,O["default"])("activeReadyTimer"),L=(0,O["default"])("activeFinishTimer"),D=(0,O["default"])("removeDefer"),I={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},C=function(){function W(G,K,J){var Z=this;if((0,p["default"])(this,W),Array.isArray(G)){var B=[G[0],G,K];G=B[0],K=B[1],J=B[2];}typeof J=="number"&&(J={duration:J}),this[u]=(0,s["default"])({},I,J),this[u].easing=(0,l.parseEasing)(this[u].easing),this[g]=(0,T.calculateFramesOffset)(K);var $=this[g][this[g].length-1];this[M]={},(0,a["default"])($).forEach(function(Q){Object.prototype.hasOwnProperty.call(G,Q)&&Q!=="easing"&&Q!=="offset"&&(Z[M][Q]=G[Q]);}),this[g]=this[g].map(function(Q){return(0,s["default"])({},Z[M],Q);}),this[g][0].offset!==0&&this[g].unshift((0,s["default"])({},this[M],{offset:0})),$.offset<1&&this[g].push((0,s["default"])({},$,{offset:1})),this[b]={},this.timeline=null;}return(0,v["default"])(W,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:E,value:function value(){var K=this;this[A]&&!this[A].timerID&&(this.timeline.currentTime<0?this[A].timerID=this.timeline.setTimeout(function(){K[A].resolve(),delete K[A];},{delay:-this.timeline.currentTime,heading:!1}):this[A].timerID=this.timeline.setTimeout(function(){K[A].resolve(),delete K[A];},{delay:0,isEntropy:!0}));}},{key:L,value:function value(){var K=this,J=this[u],Z=J.duration,B=J.iterations,$=J.endDelay,Q=Math.ceil(Z*B+$-this.timeline.currentTime)+1;this[R]&&!this[R].timerID&&(this[R].timerID=this.timeline.setTimeout(function(){K[R].resolve(),K[D](A),K[D](R);},{delay:Q,heading:!1}),this[R].reverseTimerID=this.timeline.setTimeout(function(){K[R].resolve(),K[D](A),K[D](R),K.timeline=null;},{delay:-this[u].delay-1,heading:!1}));}},{key:"play",value:function value(){if(this.playState==="finished"&&this.cancel(),this.playState==="idle"){if(this.playbackRate<=0)return;var K=this[u],J=K.delay,Z=K.playbackRate,B=K.timeline;this.timeline=new m["default"]({originTime:J,playbackRate:Z},B),this[E](),this[L]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[E]());}},{key:D,value:function value(K){var J=this[K],Z=this.timeline;J&&Z&&(Z.clearTimeout(J.timerID),J.reverseTimerID&&Z.clearTimeout(J.reverseTimerID)),delete this[K];}},{key:"cancel",value:function value(){this[D](A),this[D](R),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[D](A),this[D](R);}},{key:"applyEffects",value:function value(K){return(0,s["default"])(this[b],K);}},{key:"playbackRate",get:function get(){return this[u].playbackRate;},set:function set(K){this.timeline&&(this.timeline.playbackRate=K),this[u].playbackRate=K;}},{key:"playState",get:function get(){var K=this.timeline,J=this[u],Z=J.iterations,B=J.duration,$=J.endDelay,Q="running";if(K==null)Q="idle";else if(K.paused)Q="paused";else if(K.currentTime<0)Q="pending";else{var et=K.currentTime-Z*B;et>0&&et<$?Q="pending":et>=$&&(Q="finished");}return Q;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var K=this[u],J=K.duration,Z=K.iterations,B=this.timeline,$=this.playState,Q=void 0;if($==="idle")Q=0;else if($==="paused"&&B.currentTime<0)Q=0;else if($==="pending"){if(B.currentTime<0)Q=0;else{var et=B.seekLocalTime(Z*J);Q=(0,T.periodicity)(et,J)[1]/J;}}else($==="running"||$==="paused")&&(Q=(0,T.periodicity)(B.currentTime,J)[1]/J);return $==="finished"&&(Q=(0,T.periodicity)(Z,1)[1]),Q;}},{key:"frame",get:function get(){var K=this.playState,J=this[M],Z=this[u].fill;if(K==="idle")return J;var B=this.timeline.currentTime,$=this[g].slice(0),Q=(0,T.getProgress)(this.timeline,this[u],this.progress),et=Q.p,tt=Q.inverted,ot=J;return B<0&&K==="pending"?(Z==="backwards"||Z==="both")&&(ot=tt?$[$.length-1]:$[0]):(K!=="pending"&&K!=="finished"||Z==="forwards"||Z==="both")&&(ot=(0,T.getCurrentFrame)(this[u],$,this[b],et)),ot;}},{key:"timing",get:function get(){return this[u];}},{key:"effects",get:function get(){return this[b];}},{key:"baseTimeline",set:function set(K){this[u].timeline=K;},get:function get(){return this[u].timeline;}},{key:"ready",get:function get(){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 get(){return this.playState==="finished"?n["default"].resolve():(this[R]||(this[R]=(0,T.defer)(),this.timeline&&this[L]()),this[R].promise);}}]),W;}();r["default"]=C;},/* 191 */ /***/function(h,r,t){h.exports={"default":t(192),__esModule:!0};},/* 192 */ /***/function(h,r,t){t(143),t(125),t(79),t(193),t(202),t(203),h.exports=t(92).Promise;},/* 193 */ /***/function(h,r,t){var e=t(89),n=t(91),i=t(93),a=t(128),o=t(90),s=t(98),f=t(94),p=t(147),c=t(148),v=t(194),S=t(195).set,O=t(197)(),x=t(198),m=t(199),T=t(200),l=t(201),d="Promise",u=n.TypeError,g=n.process,M=g&&g.versions,A=M&&M.v8||"",_R=n[d],b=a(g)=="process",E=function E(){},L,D,I,C,W=D=x.f,G=!!function(){try{var tt=_R.resolve(1),ot=(tt.constructor={})[t(122)("species")]=function(q){q(E,E);};return(b||typeof PromiseRejectionEvent=="function")&&tt.then(E)instanceof ot&&A.indexOf("6.6")!==0&&T.indexOf("Chrome/66")===-1;}catch(_unused22){}}(),K=function K(tt){var ot;return s(tt)&&typeof(ot=tt.then)=="function"?ot:!1;},J=function J(tt,ot){if(!tt._n){tt._n=!0;var q=tt._c;O(function(){for(var gt=tt._v,dt=tt._s==1,F=0,j=function j(V){var X=dt?V.ok:V.fail,N=V.resolve,z=V.reject,y=V.domain,P,w,U;try{X?(dt||(tt._h==2&&$(tt),tt._h=1),X===!0?P=gt:(y&&y.enter(),P=X(gt),y&&(y.exit(),U=!0)),P===V.promise?z(u("Promise-chain cycle")):(w=K(P))?w.call(P,N,z):N(P)):z(gt);}catch(H){y&&!U&&y.exit(),z(H);}};q.length>F;)j(q[F++]);tt._c=[],tt._n=!1,ot&&!tt._h&&Z(tt);});}},Z=function Z(tt){S.call(n,function(){var ot=tt._v,q=B(tt),gt,dt,F;if(q&&(gt=m(function(){b?g.emit("unhandledRejection",ot,tt):(dt=n.onunhandledrejection)?dt({promise:tt,reason:ot}):(F=n.console)&&F.error&&F.error("Unhandled promise rejection",ot);}),tt._h=b||B(tt)?2:1),tt._a=void 0,q&&gt.e)throw gt.v;});},B=function B(tt){return tt._h!==1&&(tt._a||tt._c).length===0;},$=function $(tt){S.call(n,function(){var ot;b?g.emit("rejectionHandled",tt):(ot=n.onrejectionhandled)&&ot({promise:tt,reason:tt._v});});},Q=function Q(tt){var ot=this;ot._d||(ot._d=!0,ot=ot._w||ot,ot._v=tt,ot._s=2,ot._a||(ot._a=ot._c.slice()),J(ot,!0));},et=function et(tt){var ot=this,q;if(!ot._d){ot._d=!0,ot=ot._w||ot;try{if(ot===tt)throw u("Promise can't be resolved itself");(q=K(tt))?O(function(){var gt={_w:ot,_d:!1};try{q.call(tt,i(et,gt,1),i(Q,gt,1));}catch(dt){Q.call(gt,dt);}}):(ot._v=tt,ot._s=1,J(ot,!1));}catch(gt){Q.call({_w:ot,_d:!1},gt);}}};G||(_R=function R(ot){p(this,_R,d,"_h"),f(ot),L.call(this);try{ot(i(et,this,1),i(Q,this,1));}catch(q){Q.call(this,q);}},L=function L(ot){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)(_R.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
306
+ then:function then(ot,q){var gt=W(v(this,_R));return gt.ok=typeof ot=="function"?ot:!0,gt.fail=typeof q=="function"&&q,gt.domain=b?g.domain:void 0,this._c.push(gt),this._a&&this._a.push(gt),this._s&&J(this,!1),gt.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)
307
+ "catch":function _catch(tt){return this.then(void 0,tt);}}),I=function I(){var tt=new L();this.promise=tt,this.resolve=i(et,tt,1),this.reject=i(Q,tt,1);},x.f=W=function W(tt){return tt===_R||tt===C?new I(tt):D(tt);}),o(o.G+o.W+o.F*!G,{Promise:_R}),t(121)(_R,d),t(149)(d),C=t(92)[d],o(o.S+o.F*!G,d,{// 25.4.4.5 Promise.reject(r)
308
+ reject:function reject(ot){var q=W(this),gt=q.reject;return gt(ot),q.promise;}}),o(o.S+o.F*(e||!G),d,{// 25.4.4.6 Promise.resolve(x)
309
+ resolve:function resolve(ot){return l(e&&this===C?_R:this,ot);}}),o(o.S+o.F*!(G&&t(140)(function(tt){_R.all(tt)["catch"](E);})),d,{// 25.4.4.1 Promise.all(iterable)
310
+ all:function all(ot){var q=this,gt=W(q),dt=gt.resolve,F=gt.reject,j=m(function(){var V=[],X=0,N=1;c(ot,!1,function(z){var y=X++,P=!1;V.push(void 0),N++,q.resolve(z).then(function(w){P||(P=!0,V[y]=w,--N||dt(V));},F);}),--N||dt(V);});return j.e&&F(j.v),gt.promise;},// 25.4.4.4 Promise.race(iterable)
311
+ race:function race(ot){var q=this,gt=W(q),dt=gt.reject,F=m(function(){c(ot,!1,function(j){q.resolve(j).then(gt.resolve,dt);});});return F.e&&dt(F.v),gt.promise;}});},/* 194 */ /***/function(h,r,t){var e=t(97),n=t(94),i=t(122)("species");h.exports=function(a,o){var s=e(a).constructor,f;return s===void 0||(f=e(s)[i])==null?o:n(f);};},/* 195 */ /***/function(h,r,t){var e=t(93),n=t(196),i=t(120),a=t(102),o=t(91),s=o.process,f=o.setImmediate,p=o.clearImmediate,c=o.MessageChannel,v=o.Dispatch,S=0,O={},x="onreadystatechange",m,T,l,d=function d(){var g=+this;if(O.hasOwnProperty(g)){var M=O[g];delete O[g],M();}},u=function u(g){d.call(g.data);};(!f||!p)&&(f=function f(M){for(var A=[],R=1;arguments.length>R;)A.push(arguments[R++]);return O[++S]=function(){n(typeof M=="function"?M:Function(M),A);},m(S),S;},p=function p(M){delete O[M];},t(86)(s)=="process"?m=function m(g){s.nextTick(e(d,g,1));}:v&&v.now?m=function m(g){v.now(e(d,g,1));}:c?(T=new c(),l=T.port2,T.port1.onmessage=u,m=e(l.postMessage,l,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(m=function m(g){o.postMessage(g+"","*");},o.addEventListener("message",u,!1)):x in a("script")?m=function m(g){i.appendChild(a("script"))[x]=function(){i.removeChild(this),d.call(g);};}:m=function m(g){setTimeout(e(d,g,1),0);}),h.exports={set:f,clear:p};},/* 196 */ /***/function(h,r){h.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);};},/* 197 */ /***/function(h,r,t){var e=t(91),n=t(195).set,i=e.MutationObserver||e.WebKitMutationObserver,a=e.process,o=e.Promise,s=t(86)(a)=="process";h.exports=function(){var f,p,c,v=function v(){var m,T;for(s&&(m=a.domain)&&m.exit();f;){T=f.fn,f=f.next;try{T();}catch(l){throw f?c():p=void 0,l;}}p=void 0,m&&m.enter();};if(s)c=function c(){a.nextTick(v);};else if(i&&!(e.navigator&&e.navigator.standalone)){var S=!0,O=document.createTextNode("");new i(v).observe(O,{characterData:!0}),c=function c(){O.data=S=!S;};}else if(o&&o.resolve){var x=o.resolve(void 0);c=function c(){x.then(v);};}else c=function c(){n.call(e,v);};return function(m){var T={fn:m,next:void 0};p&&(p.next=T),f||(f=T,c()),p=T;};};},/* 198 */ /***/function(h,r,t){var e=t(94);function n(i){var a,o;this.promise=new i(function(s,f){if(a!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");a=s,o=f;}),this.resolve=e(a),this.reject=e(o);}h.exports.f=function(i){return new n(i);};},/* 199 */ /***/function(h,r){h.exports=function(t){try{return{e:!1,v:t()};}catch(e){return{e:!0,v:e};}};},/* 200 */ /***/function(h,r,t){var e=t(91),n=e.navigator;h.exports=n&&n.userAgent||"";},/* 201 */ /***/function(h,r,t){var e=t(97),n=t(98),i=t(198);h.exports=function(a,o){if(e(a),n(o)&&o.constructor===a)return o;var s=i.f(a),f=s.resolve;return f(o),s.promise;};},/* 202 */ /***/function(h,r,t){var e=t(90),n=t(92),i=t(91),a=t(194),o=t(201);e(e.P+e.R,"Promise",{"finally":function _finally(s){var f=a(this,n.Promise||i.Promise),p=typeof s=="function";return this.then(p?function(c){return o(f,s()).then(function(){return c;});}:s,p?function(c){return o(f,s()).then(function(){throw c;});}:s);}});},/* 203 */ /***/function(h,r,t){var e=t(90),n=t(198),i=t(199);e(e.S,"Promise",{"try":function _try(a){var o=n.f(this),s=i(a);return(s.e?o.reject:o.resolve)(s.v),o.promise;}});},/* 204 */ /***/function(h,r,t){h.exports={"default":t(205),__esModule:!0};},/* 205 */ /***/function(h,r,t){t(206),h.exports=t(92).Object.keys;},/* 206 */ /***/function(h,r,t){var e=t(124),n=t(110);t(207)("keys",function(){return function(a){return n(e(a));};});},/* 207 */ /***/function(h,r,t){var e=t(90),n=t(92),i=t(101);h.exports=function(a,o){var s=(n.Object||{})[a]||Object[a],f={};f[a]=o(s),e(e.S+e.F*i(function(){s(1);}),"Object",f);};},/* 208 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=O(e),i=t(209),a=O(i),o=t(164),s=O(o),f=t(191),p=O(f);r.defer=x,r.periodicity=m,r.calculateFramesOffset=T,r.getProgress=l,r.getCurrentFrame=u;var c=t(188),v=t(187),S=O(v);function O(g){return g&&g.__esModule?g:{"default":g};}function x(){var g={};return g.promise=new p["default"](function(M,A){g.resolve=M,g.reject=A;}),g;}function m(g,M){var A=Math.floor(g/M),R=g-A*M;return R===0&&A>0&&(R=M,A--),[A,R];}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 R=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 I=(L.offset-R)/D,C=0;C<D-1;C++)g[b+C+1].offset=R+I*(C+1);R=L.offset,b=E;}if(L.easing!=null&&(L.easing=(0,c.parseEasing)(L.easing)),E>0){var W=g[E].easing!=null;g[E]=(0,s["default"])({},g[E-1],g[E]),W||delete g[E].easing;}}return g;}function l(g,M,A){var R=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(R/E);A===1&&D--,D%2^b==="alternate-reverse"&&(A=1-A,L=!0);}return{p:A,inverted:L};}function d(g,M,A,R){var b={};return(0,a["default"])(M).forEach(function(E){var L=(0,n["default"])(E,2),D=L[0],I=L[1];if(D!=="offset"&&D!=="easing"){var C=A[D]||A["default"],W=C(g[D],I,R,g.offset,M.offset);W!=null&&(b[D]=W);}}),b;}function u(g,M,A,R){var b=g.easing,E=g.effect;E||(A=(0,s["default"])({},S["default"],A));var L={};R=b(R,M);for(var D=1;D<M.length;D++){var I=M[D],C=I.offset;if(C>=R||D===M.length-1){var W=M[D-1],G=W.offset,K=W.easing,J=R;if(K){var Z=C-G;J=K((R-G)/Z)*Z+G;}E?L=E(W,I,J,G,C):L=d(W,I,A,J);break;}}return L;}},/* 209 */ /***/function(h,r,t){h.exports={"default":t(210),__esModule:!0};},/* 210 */ /***/function(h,r,t){t(211),h.exports=t(92).Object.entries;},/* 211 */ /***/function(h,r,t){var e=t(90),n=t(212)(!0);e(e.S,"Object",{entries:function entries(a){return n(a);}});},/* 212 */ /***/function(h,r,t){var e=t(100),n=t(110),i=t(84),a=t(169).f;h.exports=function(o){return function(s){for(var f=i(s),p=n(f),c=p.length,v=0,S=[],O;c>v;)O=p[v++],(!e||a.call(f,O))&&S.push(o?[O,f[O]]:f[O]);return S;};};},/* 213 */ /***/function(h,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array);var e=/* @__PURE__ */new Map();function n(a){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];a=a.toLowerCase();var f=e.get(a);if(!f)throw new TypeError("Invalid node: ".concat(a));var p=new f(o);return s.forEach(function(c){p.appendChild(c);}),p;}var i={registerNode:function registerNode(a,o){var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;if(o=o.toLowerCase(),e.has(o))throw new TypeError("Cannot registerNode, ".concat(o," has been taken."));e.set(o,a),Object.defineProperties(a.prototype,{nodeType:{value:s},tagName:{value:o.toUpperCase()},nodeName:{value:o},ownerDocument:{value:i},namespaceURI:{value:"http://spritejs.com/".concat(o)}});},createElement:n,createElementNS:function createElementNS(a,o){return n(o);},isSpriteNode:function isSpriteNode(a){return e.has(a.toLowerCase());}};r["default"]=i;},/* 214 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Symbol("type"),n=Symbol("bubbles"),i=Symbol("originalEvent"),a=Symbol("detail");var o=/*#__PURE__*/function(){function o(f){var _ref116=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref116$bubbles=_ref116.bubbles,p=_ref116$bubbles===void 0?null:_ref116$bubbles;_classCallCheck(this,o);if(typeof f=="string"?(this[e]=f,this[n]=!!p):(this[e]=f.type,this[i]=f,this[n]=p!=null?!!p:!!f.bubbles,f.detail&&(this[a]=f.detail)),!this[e])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(o,[{key:"setOriginalEvent",value:function setOriginalEvent(f){this[i]=f;}},{key:"originalEvent",get:function get(){return this[i];}},{key:"type",get:function get(){return this[e];}},{key:"bubbles",get:function get(){return this[n];}},{key:"detail",get:function get(){return this[a];}},{key:"stopPropagation",value:function stopPropagation(){this.cancelBubble=!0;}}]);}();},/* 215 */ /***/function(h,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;var o=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+$/i,s=a.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+?/ig),f=[];return s&&s.forEach(function(p){var c=p.match(o);if(!c)throw new TypeError("Invalid fitler string.");var _c3=_slicedToArray(c,3),v=_c3[1],S=_c3[2];v=v.toLowerCase(),S=S.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map(function(O,x){var m;return v==="url"||v==="drop-shadow"&&x===3?m=O:m=Object(e.toNumber)(O),/%$/.test(O)&&(m/=100),m;}),f.push({type:v,args:S});}),f;}function i(a,o){a.clearFilter(),o&&o.forEach(function(_ref117){var s=_ref117.type,f=_ref117.args;var p=s;p==="drop-shadow"?p="dropShadow":p==="hue-rotate"&&(p="hueRotate"),a[p].apply(a,_toConsumableArray(f));});}},/* 216 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n,i){if(!i)return;var a=n.getListeners("beforerender"),o=n.getListeners("afterrender");a.length&&!i.beforeRender?i.beforeRender=function(s){n.dispatchEvent({type:"beforerender",detail:{context:s}});}:a.length||(i.beforeRender=null),o.length&&!i.afterRender?i.afterRender=function(s){n.dispatchEvent({type:"afterrender",detail:{context:s}});}:o.length||(i.afterRender=null);}},/* 217 */ /***/function(h,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);var o=Symbol("amount"),s=Symbol("meshCloud");var f=/*#__PURE__*/function(_i$default){function f(c){var _this17;var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,f);_this17=_callSuper(this,f),_this17.meshNode=c,c.connect(_assertThisInitialized(_this17)),_this17[o]=v,_this17[s]=null;return _this17;}_inherits(f,_i$default);return _createClass(f,[{key:"meshCloud",get:function get(){var c=this.meshNode,v=this[o];return!this[s]&&c.mesh&&(this[s]=new e.MeshCloud(c.mesh,v)),this[s];}/* override */},{key:"isVisible",get:function get(){return!!this.meshNode&&this.meshNode.isVisible;}},{key:"amount",get:function get(){return this[o];},set:function set(c){this[o]=c,this[s]&&(this[s].amount=c);}},{key:"brightness",value:function brightness(c,v){this.meshCloud&&(this.meshCloud.brightness(c,v),this.forceUpdate());}},{key:"contrast",value:function contrast(c,v){this.meshCloud&&(this.meshCloud.contrast(c,v),this.forceUpdate());}},{key:"delete",value:function _delete(c){this.meshCloud&&(this.meshCloud["delete"](c),this[o]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this18=this;var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_get(_getPrototypeOf(f.prototype),"draw",this).call(this,c),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var v=this.shaderAttrs;v&&Object.entries(v).forEach(function(_ref118){var _ref119=_slicedToArray(_ref118,2),O=_ref119[0],x=_ref119[1];_this18.meshCloud.mesh.setAttribute(O,x);});var S=this.uniforms;if(this.uniforms){var O={};Object.entries(S).forEach(function(_ref120){var _ref121=_slicedToArray(_ref120,2),x=_ref121[0],m=_ref121[1];typeof m=="function"&&(m=m(_this18,x)),O[x]=m;}),this.meshCloud.mesh.setUniforms(O);}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),c.push(this.meshCloud);}return c;}},{key:"getTransform",value:function getTransform(c){if(this.meshCloud)return this.meshCloud.getTransform(c);}},{key:"grayscale",value:function grayscale(c,v){this.meshCloud&&(this.meshCloud.grayscale(c,v),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(c,v){this.meshCloud&&(this.meshCloud.hueRotate(c,v),this.forceUpdate());}},{key:"invert",value:function invert(c,v){this.meshCloud&&(this.meshCloud.invert(c,v),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(c,v){if(!this.meshCloud)return!1;var S=this.attributes.pointerEvents;if(S==="none"||S!=="all"&&!this.isVisible)return!1;var O="both";S==="visibleFill"&&(O="fill"),S==="visibleStroke"&&(O="stroke");for(var x=0;x<this[o];x++)if(!this.meshCloud.isPointCollision(x,[c,v],O))return!1;return!0;}},{key:"setOpacity",value:function setOpacity(c,v){this.meshCloud&&(this.meshCloud.opacity(c,v),this.forceUpdate());}},{key:"rotate",value:function rotate(c,v){var _ref122=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref123=_slicedToArray(_ref122,2),S=_ref123[0],O=_ref123[1];var x=Math.PI*v/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,m=_this$meshNode$attrib.x,_T18=_this$meshNode$attrib.y;this.meshCloud.rotate(c,x,[S+m,O+_T18]),this.forceUpdate();}}},{key:"saturate",value:function saturate(c,v){this.meshCloud&&(this.meshCloud.saturate(c,v),this.forceUpdate());}},{key:"scale",value:function scale(c,_ref124){var _ref125=_slicedToArray(_ref124,2),v=_ref125[0],_ref125$=_ref125[1],S=_ref125$===void 0?v:_ref125$;var _ref126=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref127=_slicedToArray(_ref126,2),O=_ref127[0],x=_ref127[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,m=_this$meshNode$attrib2.x,_T19=_this$meshNode$attrib2.y,_l14=1e-5;Math.abs(v)<_l14&&(v=1/v>0?_l14:-_l14),Math.abs(S)<_l14&&(S=1/S>0?_l14:-_l14),this.meshCloud.scale(c,[v,S],[O+m,x+_T19]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(c,v){this.meshCloud&&(this.meshCloud.setColorTransform(c,v),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(c,v){this.meshCloud&&(Array.isArray(v)&&(v=_toConsumableArray(v),v[0]/=255,v[1]/=255,v[2]/=255),this.meshCloud.setFillColor(c,v),this.forceUpdate());}},{key:"sepia",value:function sepia(c,v){this.meshCloud&&(this.meshCloud.sepia(c,v),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref128){var c=_ref128.width,v=_ref128.height;_get(_getPrototypeOf(f.prototype),"setResolution",this).call(this,{width:c,height:v}),this.meshNode.setResolution({width:c,height:v});}},{key:"setStrokeColor",value:function setStrokeColor(c,v){this.meshCloud&&(Array.isArray(v)&&(v=_toConsumableArray(v),v[0]/=255,v[1]/=255,v[2]/=255),this.meshCloud.setStrokeColor(c,v),this.forceUpdate());}},{key:"setTransform",value:function setTransform(c,v){this.meshCloud&&(this.meshCloud.setTransform(c,v),this.forceUpdate());}},{key:"skew",value:function skew(c,_ref129){var _ref130=_slicedToArray(_ref129,2),v=_ref130[0],_ref130$=_ref130[1],S=_ref130$===void 0?v:_ref130$;var _ref131=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref132=_slicedToArray(_ref131,2),O=_ref132[0],x=_ref132[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,m=_this$meshNode$attrib3.x,_T20=_this$meshNode$attrib3.y;this.meshCloud.skew(c,[v,S],[O+m,x+_T20]),this.forceUpdate();}}},{key:"transform",value:function transform(c,v){this.meshCloud&&(this.meshCloud.transform(c,v),this.forceUpdate());}},{key:"transformColor",value:function transformColor(c,v){this.meshCloud&&(this.meshCloud.transformColor(c,v),this.forceUpdate());}},{key:"translate",value:function translate(c,_ref133){var _ref134=_slicedToArray(_ref133,2),v=_ref134[0],S=_ref134[1];this.meshCloud&&(this.meshCloud.translate(c,[v,S]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[s]&&(this[s].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(i["default"]);a["default"].registerNode(f,"cloud");},/* 218 */ /***/function(h,r,t){t.r(r),t.d(r,"loadTexture",function(){return a;}),t.d(r,"applyTexture",function(){return o;}),t.d(r,"createTexture",function(){return f;}),t.d(r,"deleteTexture",function(){return p;}),t.d(r,"drawTexture",function(){return v;}),t.d(r,"loadFrames",function(){return S;});var e=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i={};function a(O,x){if(i[O])return i[O];var m=e.ENV.loadImage(O,{alias:x,useImageBitmap:!1});return m!==null&&m!==void 0?m:O;}function o(_x11,_x12,_x13){return _o2.apply(this,arguments);}function _o2(){_o2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(O,x,m){var T,_O$attributes,_l15,d,u,g;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:T=x;typeof x=="string"&&(T=a(x));_context9.t0=T&&typeof T.then=="function";if(!_context9.t0){_context9.next=7;break;}_context9.next=6;return T;case 6:T=_context9.sent;case 7:if(!(x===O.attributes.texture)){_context9.next=11;break;}T&&T.image&&(T.sourceRect&&(O.attributes.sourceRect=T.sourceRect),O.textureImageRotated=!!T.rotated,T=T.image);_O$attributes=O.attributes,_l15=_O$attributes.width,d=_O$attributes.height,u=_O$attributes.textureRect,g=O.textureImage;O.textureImage=T,m&&g!==T&&!u&&(_l15==null||d==null)&&O.updateContours(),O.forceUpdate();case 11:return _context9.abrupt("return",T);case 12:case"end":return _context9.stop();}},_callee9);}));return _o2.apply(this,arguments);}var s=Symbol("textureMap");function f(O,x){if(x[s]=x[s]||/* @__PURE__ */new Map(),x[s].has(O))return x[s].get(O);var m=x.createTexture(O);return!/^blob:/.test(O.src)&&typeof O.getContext!="function"&&x[s].set(O,m),m;}function p(O,x){if(x[s]&&x[s].has(O)){var m=x[s].get(O);return x.deleteTexture(m),x[s]["delete"](O),!0;}return!1;}var c=Symbol("textureContext");function v(O,x){var m=O.textureImage instanceof String?String(O.textureImage):O.textureImage,T=O.textureImageRotated,l=x.texture,d=O.renderer;if(m){var u=O.originalContentRect;var g=O.attributes.textureRect;var M=O.attributes.textureRepeat,A=O.attributes.sourceRect;if(!l||O[c]&&O[c]!==d||l.image!==m||l.options.repeat!==M||!Object(n.compareValue)(l.options.rect,g)||!Object(n.compareValue)(l.options.srcRect,A)){var R=f(m,d);g?(g[0]+=u[0],g[1]+=u[1]):g=u;var b=null;l&&!d[s].has(l.image)&&(!l.options||!l.options.hidden)&&(b=x.uniforms.u_texSampler),x.setTexture(R,{rect:g,repeat:M,srcRect:A,rotated:T}),b&&b["delete"]&&b["delete"](),O[c]=d;}}else if(l){var _u8=null;!d[s].has(l.image)&&(!l.options||!l.options.hidden)&&(_u8=x.uniforms.u_texSampler),x.setTexture(null),_u8&&_u8["delete"]&&_u8["delete"]();}}function S(_x14,_x15){return _S5.apply(this,arguments);}function _S5(){_S5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(O,x){var m,T;return _regeneratorRuntime().wrap(function _callee10$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.t0=typeof x=="string";if(!_context10.t0){_context10.next=7;break;}_context10.next=4;return fetch(x,{method:"GET",mode:"cors",cache:"default"});case 4:_context10.next=6;return _context10.sent.json();case 6:x=_context10.sent;case 7:_context10.next=9;return a(O);case 9:m=_context10.sent;T=x.frames;return _context10.abrupt("return",(Object.entries(T).forEach(function(_ref135){var _ref136=_slicedToArray(_ref135,2),l=_ref136[0],d=_ref136[1];var _d$frame=d.frame,u=_d$frame.x,g=_d$frame.y,M=_d$frame.w,A=_d$frame.h;var R=[u,g,M,A];var b=d.rotated;b&&(R=[R[0],R[1],R[3],R[2]]),i[l]={image:m,sourceRect:R,rotated:b};}),m));case 12:case"end":return _context10.stop();}},_callee10);}));return _S5.apply(this,arguments);}},/* 219 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return S;});var e=t(1),n=t(12),i=t(70),a=t(220),o=t(221),s=t(222),f=t(213),p=t(223);t(1).glMatrix.setMatrixArrayType(Array);function c(O,x,m){return x in O?Object.defineProperty(O,x,{value:m,enumerable:!0,configurable:!0,writable:!0}):O[x]=m,O;}var v=Symbol("mesh");var S=/*#__PURE__*/function(_i$default2){function S(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,S);return _callSuper(this,S,[x]);}_inherits(S,_i$default2);return _createClass(S,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,x=_this$attributes2.paddingTop,m=_this$attributes2.paddingRight,T=_this$attributes2.paddingBottom,l=_this$attributes2.paddingLeft,d=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),u=_this$contentSize[0],g=_this$contentSize[1];return[l+u+m+d,x+g+T+d];}// content + padding
312
+ },{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,x=_this$attributes3.paddingTop,m=_this$attributes3.paddingRight,T=_this$attributes3.paddingBottom,l=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),d=_this$contentSize2[0],u=_this$contentSize2[1];return[l+d+m,x+u+T];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,x=_this$attributes4.width,m=_this$attributes4.height,T=_this$attributes4.boxSizing,l=_this$attributes4.paddingTop,d=_this$attributes4.paddingRight,u=_this$attributes4.paddingBottom,g=_this$attributes4.paddingLeft;if(x=x||0,m=m||0,T==="border-box"){var M=2*this.attributes.borderWidth;x-=M+d+g,m-=M+l+u,x=Math.max(0,x),m=Math.max(0,m);}return[x,m];}},{key:"hasBorder",get:function get(){return this.attributes.borderWidth>0;}/* override */},{key:"isVisible",get:function get(){var _this$borderSize=_slicedToArray(this.borderSize,2),x=_this$borderSize[0],m=_this$borderSize[1];return x>0&&m>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var x=this.clientBox;if(x){var _m5;var m=this[v];if(m)m.box!==x&&(m.contours=x.contours,m.box=x);else{m=new n.Mesh2D(x),m.box=x;var _l16=this.attributes.bgcolor;if(Object(o.setFillColor)(m,{color:_l16}),this.hasBorder){var _this$attributes5=this.attributes,u=_this$attributes5.borderColor,g=_this$attributes5.borderWidth,M=_this$attributes5.borderDash,A=_this$attributes5.borderDashOffset;Object(o.setStrokeColor)(m,{color:u,lineWidth:g,lineDash:M,lineDashOffset:A});}this[v]=m;var d=this.attributes.clipPath;d&&this[v].setClipPath(d);}var _T21=this.opacity;return m.getOpacity()!==_T21&&m.setOpacity(_T21),(_m5=m).setTransform.apply(_m5,_toConsumableArray(this.renderMatrix)),m;}return null;}// content + padding + border
313
+ },{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,x=_this$attributes6.paddingTop,m=_this$attributes6.paddingRight,T=_this$attributes6.paddingBottom,l=_this$attributes6.paddingLeft,d=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),u=_this$contentSize3[0],g=_this$contentSize3[1],M=2*d;return[l+u+m+M,x+g+T+M];}},{key:"originalClientRect",get:function get(){if(this.mesh){var 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];}},{key:"originalContentRect",get:function get(){var _this$originalClientR=_slicedToArray(this.originalClientRect,4),x=_this$originalClientR[0],m=_this$originalClientR[1],T=_this$originalClientR[2],l=_this$originalClientR[3],d=this.attributes.padding;return[x+d[0],m+d[1],T-d[0]-d[2],l-d[1]-d[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var x=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(x=e.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,x));var m=null;if(this.mesh){m=_toConsumableArray(this.mesh.boundingBox);var _T22=this.attributes.borderWidth;_T22&&(m[0]=[m[0][0]-_T22,m[0][1]-_T22],m[1]=[m[1][0]+_T22,m[1][1]+_T22]);}return Object(p["default"])(m,x);}// transformPoint(x, y) {
314
+ // const m = mat2d.invert(this.renderMatrix);
315
+ // const newX = x * m[0] + y * m[2] + m[4];
316
+ // const newY = x * m[1] + y * m[3] + m[5];
317
+ // return [newX, newY];
318
+ // }
319
+ /* override */},{key:"onPropertyChange",value:function onPropertyChange(x,m,T){if(_get(_getPrototypeOf(S.prototype),"onPropertyChange",this).call(this,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[v]&&x==="clipPath"&&this[v].setClipPath(m),this[v]&&x==="bgcolor"&&Object(o.setFillColor)(this[v],{color:m}),this[v]&&(x==="borderColor"||x==="borderWidth"||x==="borderDash"||x==="borderDashOffset")){var _this$attributes7=this.attributes,_l17=_this$attributes7.borderColor,d=_this$attributes7.borderWidth,u=_this$attributes7.borderDash,g=_this$attributes7.borderDashOffset;Object(o.setStrokeColor)(this[v],{color:_l17,lineWidth:d,lineDash:d?u:0,lineDashOffset:g});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,x=_this$attributes8.anchorX,m=_this$attributes8.anchorY,T=_this$attributes8.borderWidth,l=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),d=_this$borderSize2[0],u=_this$borderSize2[1],g=this.offsetSize,M=0.5*T,A=-x*g[0]+M,R=-m*g[1]+M;this.clientBox=new n.Figure2D(),Object(s.createRadiusBox)(this.clientBox,[A,R,d,u],l);}}]);}(i["default"]);c(S,"Attr",a["default"]),f["default"].registerNode(S,"block");},/* 220 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return p;});var e=t(71),n=t(72),i=t(221);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_setAttributeDefault"),f=Symbol["for"]("spritejs_declareAlias");var p=/*#__PURE__*/function(_e$default){function p(v){var _this19;_classCallCheck(this,p);_this19=_callSuper(this,p,[v]),_this19[s]({anchorX:0,anchorY:0,/* anchor */width:void 0,height:void 0,/* size */borderWidth:0,borderColor:"rgba(0,0,0,1)",/* border */borderDash:void 0,borderDashOffset:0,borderTopLeftRadius:[0,0],borderTopRightRadius:[0,0],borderBottomRightRadius:[0,0],borderBottomLeftRadius:[0,0],/* borderRadius */bgcolor:"rgba(0,0,0,0)",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,/* padding */boxSizing:"content-box",clipPath:void 0}),_this19[f]("anchor","size","border","borderRadius","padding");return _this19;}_inherits(p,_e$default);return _createClass(p,[{key:"anchorX",get:function get(){return this[o]("anchorX");},set:function set(v){this[a]("anchorX",Object(n.toNumber)(v));}},{key:"anchorY",get:function get(){return this[o]("anchorY");},set:function set(v){this[a]("anchorY",Object(n.toNumber)(v));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.anchorX=v[0],this.anchorY=v[1];}},{key:"width",get:function get(){return this[o]("width");},set:function set(v){this[a]("width",Object(n.toNumber)(v));}},{key:"height",get:function get(){return this[o]("height");},set:function set(v){this[a]("height",Object(n.toNumber)(v));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.width=v[0],this.height=v[1];}},{key:"borderWidth",get:function get(){return this[o]("borderWidth");},set:function set(v){this[a]("borderWidth",Object(n.toNumber)(v));}},{key:"borderColor",get:function get(){return this[o]("borderColor");},set:function set(v){this[a]("borderColor",Object(i.parseColor)(v));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v]),this.borderWidth=v[0],v[1]!=null&&(this.borderColor=v[1]);}},{key:"borderDash",get:function get(){return this[o]("borderDash");},set:function set(v){v=Object(n.toArray)(v,!0),v!=null&&!Array.isArray(v)&&(v=[v]),this[a]("borderDash",v?v.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[o]("borderDashOffset");},set:function set(v){this[a]("borderDashOffset",Object(n.toNumber)(v));}},{key:"borderTopLeftRadius",get:function get(){return this[o]("borderTopLeftRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderTopLeftRadius",v.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[o]("borderTopRightRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderTopRightRadius",v.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[o]("borderBottomRightRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderBottomRightRadius",v.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[o]("borderBottomLeftRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderBottomLeftRadius",v.map(n.toNumber));}},{key:"borderRadius",get:function get(){return[].concat(_toConsumableArray(this.borderTopLeftRadius),_toConsumableArray(this.borderTopRightRadius),_toConsumableArray(this.borderBottomRightRadius),_toConsumableArray(this.borderBottomLeftRadius));},set:function set(v){if(v=Object(n.toArray)(v),!Array.isArray(v))v=Array(8).fill(v);else if(v.length===2)v=[v[0],v[1],v[0],v[1],v[0],v[1],v[0],v[1]];else if(v.length===4)v=[v[0],v[1],v[2],v[3],v[0],v[1],v[2],v[3]];else if(v.length===6)v=[v[0],v[1],v[2],v[3],v[4],v[5],v[2],v[3]];else if(v.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[v[0],v[1]],this.borderTopRightRadius=[v[2],v[3]],this.borderBottomRightRadius=[v[4],v[5]],this.borderBottomLeftRadius=[v[6],v[7]];}},{key:"bgcolor",get:function get(){return this[o]("bgcolor");},set:function set(v){this[a]("bgcolor",Object(i.parseColor)(v));}},{key:"paddingTop",get:function get(){return this[o]("paddingTop");},set:function set(v){this[a]("paddingTop",Object(n.toNumber)(v));}},{key:"paddingRight",get:function get(){return this[o]("paddingRight");},set:function set(v){this[a]("paddingRight",Object(n.toNumber)(v));}},{key:"paddingBottom",get:function get(){return this[o]("paddingBottom");},set:function set(v){this[a]("paddingBottom",Object(n.toNumber)(v));}},{key:"paddingLeft",get:function get(){return this[o]("paddingLeft");},set:function set(v){this[a]("paddingLeft",Object(n.toNumber)(v));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)?v.length===2?v=[v[0],v[1],v[0],v[1]]:v.length===3&&(v=[v[0],v[1],v[2],v[1]]):v=[v,v,v,v],this.paddingTop=v[0],this.paddingRight=v[1],this.paddingBottom=v[2],this.paddingLeft=v[3];}},{key:"clipPath",get:function get(){return this[o]("clipPath");},set:function set(v){this[a]("clipPath",v);}},{key:"boxSizing",get:function get(){return this[o]("boxSizing");},set:function set(v){if(v!=null&&v!=="border-box"&&v!=="content-box")throw new TypeError("Invalid boxSizing type.");this[a]("boxSizing",v);}}]);}(e["default"]);},/* 221 */ /***/function(h,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 o;}),t.d(r,"setFillColor",function(){return f;}),t.d(r,"setStrokeColor",function(){return p;}),t.d(r,"Color",function(){return c;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(){function i(_ref137){var S=_ref137.vector,O=_ref137.colors;_classCallCheck(this,i);if(!Array.isArray(S)||S.length!==4&&S.length!==6&&S.length!==3)throw new TypeError("Invalid gradient");this.vector=S,this.colors=O.map(function(_ref138){var x=_ref138.offset,m=_ref138.color;return{offset:x,color:o(m)};});}return _createClass(i,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function a(v){return v instanceof i?!1:v==null?!0:n()(v)[3]===0;}function o(v){if(v==null||(v||(v="transparent"),v instanceof i))return v;var S=n()(v);if(!S||!S.length)throw new TypeError("Invalid color value.");return"rgba(".concat(S.join(),")");}function s(v,S,O){var x=v.boundingBox[0];if(O.vector){var m=O.vector,_T23=O.colors;m.length===4?(m=[m[0]+x[0],m[1]+x[1],m[2]+x[0],m[3]+x[1]],v.setLinearGradient({vector:m,colors:_T23,type:S})):m.length===3?(m=[m[0]+x[0],m[1]+x[1],m[2]],v.setCircularGradient({vector:m,colors:_T23,type:S})):(m=[m[0]+x[0],m[1]+x[1],m[2],m[3]+x[0],m[4]+x[1],m[5]],v.setRadialGradient({vector:m,colors:_T23,type:S}));}else v.gradient&&v.gradient[S]&&(delete v.gradient[S],delete v.uniforms.u_radialGradientVector);}function f(v,_ref139){var S=_ref139.color,_ref139$rule=_ref139.rule,O=_ref139$rule===void 0?"nonzero":_ref139$rule;return s(v,"fill",S),S.vector||v.setFill({color:S,rule:O}),v;}function p(v,_ref140){var S=_ref140.color,O=_ref140.lineWidth,x=_ref140.lineCap,m=_ref140.lineJoin,T=_ref140.lineDash,l=_ref140.lineDashOffset,d=_ref140.miterLimit,u=_ref140.roundSegments;s(v,"stroke",S),S.vector&&(S=[0,0,0,1]),v.setStroke({color:S,thickness:O,cap:x,join:m,miterLimit:d,lineDash:T,lineDashOffset:l,roundSegments:u});}var c=/*#__PURE__*/function(_Array){function c(){var _S6,_S7,_n2,_n3;var _this20;var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var O=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var m=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,c);return _possibleConstructorReturn(_this20,(Array.isArray(S)&&(_S6=S,_S7=_slicedToArray(_S6,4),S=_S7[0],O=_S7[1],x=_S7[2],m=_S7[3],_S6),typeof S=="string"&&((_n2=n()(S),_n3=_slicedToArray(_n2,4),S=_n3[0],O=_n3[1],x=_n3[2],m=_n3[3]),S/=255,O/=255,x/=255),_this20=_callSuper(this,c,[S,O,x,m]),_assertThisInitialized(_this20)));}_inherits(c,_Array);return _createClass(c,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(S){this[0]=S/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(S){this[1]=S/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(S){this[2]=S/255;}},{key:"a",get:function get(){return this[3];},set:function set(S){this[3]=S;}},{key:"hex",get:function get(){var S="0".concat(this.r.toString(16)).slice(-2),O="0".concat(this.g.toString(16)).slice(-2),x="0".concat(this.b.toString(16)).slice(-2);var m;return this.a<1&&(m=Math.round(this[3]*255),m="0".concat(m.toString(16)).slice(-2)),"#".concat(S).concat(O).concat(x).concat(m||"");}},{key:"rgba",get:function get(){return"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")");}},{key:"fromColor",value:function fromColor(S){return typeof S=="string"&&(S=n()(S),S[0]/=255,S[1]/=255,S[2]/=255),this[0]=S[0],this[1]=S[1],this[2]=S[2],this[3]=S[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 */ /***/function(h,r,t){t.r(r),t.d(r,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(i,a,o,s,f){var p=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var c=0.5522848,v=s/2*c,S=f/2*c,O=a+s,x=o+f,m=a+s/2,T=o+f/2;p==="leftTop"?(i.moveTo(a,T),i.bezierCurveTo(a,T-S,m-v,o,m,o)):p==="rightTop"?i.bezierCurveTo(m+v,o,O,T-S,O,T):p==="rightBottom"?i.bezierCurveTo(O,T+S,m+v,x,m,x):p==="leftBottom"&&i.bezierCurveTo(m-v,x,a,T+S,a,T);}function n(i,_ref141,p){var _ref142=_slicedToArray(_ref141,4),a=_ref142[0],o=_ref142[1],s=_ref142[2],f=_ref142[3];if(!p||Array.isArray(p)&&p.every(function(c){return c===0;}))i.beginPath(),i.rect(a,o,s,f);else{typeof p=="number"&&(p=Array(8).fill(p));var _p$map=p.map(function(d,u){return u%2?Math.min(d,f/2):Math.min(d,s/2);}),_p$map2=_slicedToArray(_p$map,8),c=_p$map2[0],v=_p$map2[1],S=_p$map2[2],O=_p$map2[3],x=_p$map2[4],m=_p$map2[5],_T24=_p$map2[6],_l18=_p$map2[7];i.beginPath(),i.moveTo(a,o+v),e(i,a,o,c*2,v*2,"leftTop"),i.lineTo(a+s-S,o),e(i,a+s-S*2,o,S*2,O*2,"rightTop"),i.lineTo(a+s,o+f-m),e(i,a+s-x*2,o+f-m*2,x*2,m*2,"rightBottom"),i.lineTo(a+_T24,o+f),e(i,a,o+f-_l18*2,_T24*2,_l18*2,"leftBottom"),i.closePath();}return i;}},/* 223 */ /***/function(h,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};var _e3=_slicedToArray(e,2),_e3$=_slicedToArray(_e3[0],2),i=_e3$[0],a=_e3$[1],_e3$2=_slicedToArray(_e3[1],2),o=_e3$2[0],s=_e3$2[1],f=i*n[0]+a*n[2]+n[4],p=i*n[1]+a*n[3]+n[5],c=o*n[0]+a*n[2]+n[4],v=o*n[1]+a*n[3]+n[5],S=o*n[0]+s*n[2]+n[4],O=o*n[1]+s*n[3]+n[5],x=i*n[0]+s*n[2]+n[4],m=i*n[1]+s*n[3]+n[5],T=Math.min(f,c,S,x),l=Math.min(p,v,O,m),d=Math.max(f,c,S,x),u=Math.max(p,v,O,m);return{x:T,y:l,width:d-T,height:u-l,left:T,top:l,right:d,bottom:u};};},/* 224 */ /***/function(h,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 o(p,c,v){return c in p?Object.defineProperty(p,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):p[c]=v,p;}var s=Symbol("textureTask");var f=/*#__PURE__*/function(_n$default){function f(){var _this21;var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,f);typeof c=="string"&&(c={texture:c}),_this21=_callSuper(this,f,[c]);return _this21;}/* override */_inherits(f,_n$default);return _createClass(f,[{key:"contentSize",get:function get(){var _get2=_get(_getPrototypeOf(f.prototype),"contentSize",this),_get3=_slicedToArray(_get2,2),c=_get3[0],v=_get3[1];var _this$attributes9=this.attributes,S=_this$attributes9.width,O=_this$attributes9.height;if(S==null||O==null){var x=this.textureImage,m=this.attributes.textureRect,_T25=this.attributes.sourceRect;if(m)S==null&&(c=m[0]+m[2]),O==null&&(v=m[1]+m[3]);else if(_T25){var _l19=this.layer?this.layer.displayRatio:1;S==null&&(c=_T25[2]/_l19),O==null&&(v=_T25[3]/_l19);}else if(x){var _l20=this.layer?this.layer.displayRatio:1;S==null&&(c=x.width/_l20),O==null&&(v=x.height/_l20);}}return[c,v];}},{key:"textureImageReady",get:function get(){return this[s]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_get(_getPrototypeOf(f.prototype),"draw",this).call(this,c);var v=this.mesh;return v&&Object(e.drawTexture)(this,v),c;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(c,v,S){if(_get(_getPrototypeOf(f.prototype),"onPropertyChange",this).call(this,c,v,S),c==="texture"&&(this[s]=Object(e.applyTexture)(this,v,!0)),c==="textureRect"){var _this$attributes10=this.attributes,O=_this$attributes10.width,x=_this$attributes10.height;(O==null||x==null)&&this.updateContours();}}}]);}(n["default"]);o(f,"Attr",i["default"]),a["default"].registerNode(f,"sprite");},/* 225 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_setAttributeDefault"),i=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute");var o=/*#__PURE__*/function(_e$default2){function o(f){var _this22;_classCallCheck(this,o);_this22=_callSuper(this,o,[f]),_this22[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0});return _this22;}_inherits(o,_e$default2);return _createClass(o,[{key:"texture",get:function get(){return this[a]("texture");},set:function set(f){this[i]("texture",f);}},{key:"textureRect",get:function get(){return this[a]("textureRect");},set:function set(f){this[i]("textureRect",f);}},{key:"sourceRect",get:function get(){return this[a]("sourceRect");},set:function set(f){this[i]("sourceRect",f);}},{key:"textureRepeat",get:function get(){return this[a]("textureRepeat");},set:function set(f){this[i]("textureRepeat",!!f);}}]);}(e["default"]);},/* 226 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return O;});var e=t(12),n=t(227),i=/* @__PURE__ */t.n(n),a=t(70),o=t(228),s=t(221),f=t(218),p=t(213),c=t(223);t(1).glMatrix.setMatrixArrayType(Array);function v(x,m,T){return m in x?Object.defineProperty(x,m,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[m]=T,x;}var S=Symbol("mesh");var O=/*#__PURE__*/function(_a$default){function O(){var _this23;var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);typeof m=="string"&&(m={d:m}),_this23=_callSuper(this,O,[m]),_this23.effects={d:function d(T,l,_d5,u,g){var _i$a;var M=(_d5-u)/(g-u);if(M<=0)return T;if(M>=1)return l;var A=i.a._preprocessing(i.a.path2shapes(T),i.a.path2shapes(l)),R=(_i$a=i.a)._lerp.apply(_i$a,_toConsumableArray(A).concat([M]))[0];return R.reduce(function(E,L){return"".concat(E).concat(L.slice(2).join(" ")," ");},"M".concat(R[0][0]," ").concat(R[0][1],"C")).trim();}};return _this23;}/* override */_inherits(O,_a$default);return _createClass(O,[{key:"isVisible",get:function get(){return!!this.d;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var m=this.path;if(m){var _T27;var _T26=this[S];if(_T26)_T26.path!==m&&(_T26.contours=m.contours,_T26.path=m);else{_T26=new e.Mesh2D(this.path),_T26.path=m;var d=this.attributes.fillColor,u=this.attributes.fillRule;d&&Object(s.setFillColor)(_T26,{color:d,rule:u});var g=this.attributes.lineWidth,M=this.attributes.strokeColor;if(M&&g>0){var _this$attributes11=this.attributes,R=_this$attributes11.lineCap,b=_this$attributes11.lineJoin,E=_this$attributes11.miterLimit,L=_this$attributes11.lineDash,D=_this$attributes11.lineDashOffset,I=_this$attributes11.roundSegments;Object(s.setStrokeColor)(_T26,{color:M,lineWidth:g,lineCap:R,lineJoin:b,miterLimit:E,lineDash:L,lineDashOffset:D,roundSegments:I});}this[S]=_T26;var A=this.attributes.clipPath;A&&this[S].setClipPath(A);}var _l21=this.opacity;return _T26.getOpacity()!==_l21&&_T26.setOpacity(_l21),(_T27=_T26).setTransform.apply(_T27,_toConsumableArray(this.renderMatrix)),_T26;}return null;}},{key:"originalContentRect",get:function get(){if(this.path){var 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];}},{key:"originalClientRect",get:function get(){if(this.mesh){var 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];}},{key:"originalClientCenter",get:function get(){return this.mesh?this.mesh.boundingCenter:[0,0];}},{key:"d",get:function get(){return this.attributes.d;}/* override */,set:function set(m){this.attributes.d=m;}},{key:"draw",value:function draw(){var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_get(_getPrototypeOf(O.prototype),"draw",this).call(this,m);var T=this.mesh;return T&&Object(f.drawTexture)(this,T),m;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var m=null;return this.mesh&&(m=this.mesh.boundingBox),Object(c["default"])(m,this.renderMatrix);}},{key:"getPathLength",value:function getPathLength(){return this.mesh?this.mesh.getTotalLength():0;}},{key:"getPointAtLength",value:function getPointAtLength(m){if(this.mesh){var _T28=this.mesh.getPointAtLength(m);if(_T28)return[_T28.x,_T28.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(m,T,l){if(_get(_getPrototypeOf(O.prototype),"onPropertyChange",this).call(this,m,T,l),(m==="d"||m==="normalize")&&this.updateContours(),this[S]&&(m==="fillColor"||m==="fillRule")){var _this$attributes12=this.attributes,d=_this$attributes12.fillColor,u=_this$attributes12.fillRule;Object(s.setFillColor)(this[S],{color:d,rule:u});}if(this[S]&&(m==="strokeColor"||m==="lineWidth"||m==="lineCap"||m==="lineJoin"||m==="lineDash"||m==="lineDashOffset"||m==="roundSegments")){var _this$attributes13=this.attributes,_d6=_this$attributes13.strokeColor,_u9=_this$attributes13.lineWidth;if(_d6&&_u9>0){var _this$attributes14=this.attributes,g=_this$attributes14.lineCap,M=_this$attributes14.lineJoin,A=_this$attributes14.lineDash,R=_this$attributes14.lineDashOffset,b=_this$attributes14.miterLimit,E=_this$attributes14.roundSegments;Object(s.setStrokeColor)(this[S],{color:_d6,lineCap:g,lineJoin:M,lineWidth:_u9,lineDash:A,lineDashOffset:R,miterLimit:b,roundSegments:E});}}this[S]&&m==="clipPath"&&this[S].setClipPath(T),m==="texture"&&Object(f.applyTexture)(this,T);}/* override */},{key:"updateContours",value:function updateContours(){var _this$path;this.path=new e.Figure2D(),this.path.addPath(this.attributes.d),this.attributes.normalize&&(_this$path=this.path).normalize.apply(_this$path,_toConsumableArray(this.path.boundingCenter));}}]);}(a["default"]);v(O,"Attr",o["default"]),p["default"].registerNode(O,"path");},/* 227 */ /***/function(h,r,t){(function(e,n){h.exports=n();})(this,function(){var e=/* @__PURE__ */function(){function L(D,I){var C=[],W=!0,G=!1,K=void 0;try{for(var J=D[Symbol.iterator](),Z;!(W=(Z=J.next()).done)&&(C.push(Z.value),!(I&&C.length===I));W=!0);}catch(B){G=!0,K=B;}finally{try{!W&&J["return"]&&J["return"]();}finally{if(G)throw K;}}return C;}return function(D,I){if(Array.isArray(D))return D;if(Symbol.iterator in Object(D))return L(D,I);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,i=function i(D,I,C,W,G,K,J){var Z=D.x,B=D.y;Z*=I,B*=C;var $=W*Z-G*B,Q=G*Z+W*B;return{x:$+K,y:Q+J};},a=function a(D,I){var C=1.3333333333333333*Math.tan(I/4),W=Math.cos(D),G=Math.sin(D),K=Math.cos(D+I),J=Math.sin(D+I);return[{x:W-G*C,y:G+W*C},{x:K+J*C,y:J-K*C},{x:K,y:J}];},o=function o(D,I,C,W){var G=D*W-I*C<0?-1:1,K=Math.sqrt(D*D+I*I),J=Math.sqrt(D*D+I*I),Z=D*C+I*W,B=Z/(K*J);return B>1&&(B=1),B<-1&&(B=-1),G*Math.acos(B);},s=function s(D,I,C,W,G,K,J,Z,B,$,Q,et){var tt=Math.pow(G,2),ot=Math.pow(K,2),q=Math.pow(Q,2),gt=Math.pow(et,2),dt=tt*ot-tt*gt-ot*q;dt<0&&(dt=0),dt/=tt*gt+ot*q,dt=Math.sqrt(dt)*(J===Z?-1:1);var F=dt*G/K*et,j=dt*-K/G*Q,V=$*F-B*j+(D+C)/2,X=B*F+$*j+(I+W)/2,N=(Q-F)/G,z=(et-j)/K,y=(-Q-F)/G,P=(-et-j)/K,w=o(1,0,N,z),U=o(N,z,y,P);return Z===0&&U>0&&(U-=n),Z===1&&U<0&&(U+=n),[V,X,w,U];},f=function f(D){var I=D.px,C=D.py,W=D.cx,G=D.cy,K=D.rx,J=D.ry,Z=D.xAxisRotation,B=Z===void 0?0:Z,$=D.largeArcFlag,Q=$===void 0?0:$,et=D.sweepFlag,tt=et===void 0?0:et,ot=[];if(K===0||J===0)return[];var q=Math.sin(B*n/360),gt=Math.cos(B*n/360),dt=gt*(I-W)/2+q*(C-G)/2,F=-q*(I-W)/2+gt*(C-G)/2;if(dt===0&&F===0)return[];K=Math.abs(K),J=Math.abs(J);var j=Math.pow(dt,2)/Math.pow(K,2)+Math.pow(F,2)/Math.pow(J,2);j>1&&(K*=Math.sqrt(j),J*=Math.sqrt(j));var V=s(I,C,W,G,K,J,Q,tt,q,gt,dt,F),X=e(V,4),N=X[0],z=X[1],y=X[2],P=X[3],w=Math.max(Math.ceil(Math.abs(P)/(n/4)),1);P/=w;for(var U=0;U<w;U++)ot.push(a(y,P)),y+=P;return ot.map(function(H){var Y=i(H[0],K,J,gt,q,N,z),k=Y.x,rt=Y.y,it=i(H[1],K,J,gt,q,N,z),lt=it.x,ut=it.y,at=i(H[2],K,J,gt,q,N,z),st=at.x,ft=at.y;return{x1:k,y1:rt,x2:lt,y2:ut,x:st,y:ft};});},p={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0/**
320
+ * segment pattern
321
+ * @type {RegExp}
322
+ */},c=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function v(L){var D=[];return L.replace(c,function(I,C,W){var G=C.toLowerCase();for(W=O(W),G=="m"&&W.length>2&&(D.push([C].concat(W.splice(0,2))),G="l",C=C=="m"?"l":"L");;){if(W.length==p[G])return W.unshift(C),D.push(W);if(W.length<p[G])throw new Error("malformed path data");D.push([C].concat(W.splice(0,p[G])));}}),D;}var S=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function O(L){var D=L.match(S);return D?D.map(Number):[];}function x(L){var D=L[0][0],I=L[0][1],C=D,W=I;return L.forEach(function(G){var K=G[0],J=G[2],Z=G[4],B=G[6],$=G[1],Q=G[3],et=G[5],tt=G[7];D=Math.min(D,K,J,Z,B),I=Math.min(I,$,Q,et,tt),C=Math.max(C,K,J,Z,B),W=Math.max(W,$,Q,et,tt);}),[D,I,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 I=L[0],C=L[2],W=L[4],G=L[6],K=L[1],J=L[3],Z=L[5],B=L[7],$=D[0],Q=D[2],et=D[4],tt=D[6],ot=D[1],q=D[3],gt=D[5],dt=D[7];return Math.sqrt(Math.pow($-I,2)+Math.pow(ot-K,2))+Math.sqrt(Math.pow(Q-C,2)+Math.pow(q-J,2))+Math.sqrt(Math.pow(et-W,2)+Math.pow(gt-Z,2))+Math.sqrt(Math.pow(tt-G,2)+Math.pow(dt-B,2));}function l(L,D){var I=u(L.length),C=[];I.forEach(function(G){var K=0,J=0;G.forEach(function(Z){K+=T(L[Z],D[J++]);}),C.push({index:G,distance:K});}),C.sort(function(G,K){return G.distance-K.distance;});var W=[];return C[0].index.forEach(function(G){W.push(L[G]);}),W;}function d(L,D){var I=g(L.length),C=[];I.forEach(function(G){var K=0;G.forEach(function(J){K+=m(x(L[J]),x(D[J]));}),C.push({index:G,distance:K});}),C.sort(function(G,K){return G.distance-K.distance;});var W=[];return C[0].index.forEach(function(G){W.push(L[G]);}),W;}function u(L){for(var D=[],I=0;I<L;I++){for(var C=[],W=0;W<L;W++){var G=W+I;G>L-1&&(G-=L),C[G]=W;}D.push(C);}return D;}function g(L){for(var D=[],I=0;I<L;I++)D.push(I);return M(D);}function M(L){var D=[],I=[];function C(W){var G,K;for(G=0;G<W.length;G++)K=W.splice(G,1)[0],I.push(K),W.length==0&&D.push(I.slice()),C(W),W.splice(G,0,K),I.pop();return D;}return C(L);}var A={};A.parser=v,A.lerpCurve=function(L,D,I){return A.lerpPoints(L[0],L[1],D[0],D[1],I).concat(A.lerpPoints(L[2],L[3],D[2],D[3],I)).concat(A.lerpPoints(L[4],L[5],D[4],D[5],I)).concat(A.lerpPoints(L[6],L[7],D[6],D[7],I));},A.lerpPoints=function(L,D,I,C,W){return[L+(I-L)*W,D+(C-D)*W];},A.q2b=function(L,D,I,C,W,G){return[L,D,(L+2*I)/3,(D+2*C)/3,(W+2*I)/3,(G+2*C)/3,W,G];},A.path2shapes=function(L){for(var D=A.parser(L),I=0,C=0,W=0,G=D.length,K=[],J=null,Z=void 0,B=void 0,$=void 0,Q=void 0,et=void 0,tt=void 0,ot=void 0;W<G;W++){var q=D[W],gt=q[0],dt=D[W-1];switch(gt){case"m":et=K.length,K[et]=[],J=K[et],I=I+q[1],C=C+q[2];break;case"M":et=K.length,K[et]=[],J=K[et],I=q[1],C=q[2];break;case"l":J.push([I,C,I,C,I,C,I+q[1],C+q[2]]),I+=q[1],C+=q[2];break;case"L":J.push([I,C,q[1],q[2],q[1],q[2],q[1],q[2]]),I=q[1],C=q[2];break;case"h":J.push([I,C,I,C,I,C,I+q[1],C]),I+=q[1];break;case"H":J.push([I,C,q[1],C,q[1],C,q[1],C]),I=q[1];break;case"v":J.push([I,C,I,C,I,C,I,C+q[1]]),C+=q[1];break;case"V":J.push([I,C,I,q[1],I,q[1],I,q[1]]),C=q[1];break;case"C":J.push([I,C,q[1],q[2],q[3],q[4],q[5],q[6]]),I=q[5],C=q[6];break;case"S":dt[0]==="C"||dt[0]==="c"?J.push([I,C,I+dt[5]-dt[3],C+dt[6]-dt[4],q[1],q[2],q[3],q[4]]):(dt[0]==="S"||dt[0]==="s")&&J.push([I,C,I+dt[3]-dt[1],C+dt[4]-dt[2],q[1],q[2],q[3],q[4]]),I=q[3],C=q[4];break;case"c":J.push([I,C,I+q[1],C+q[2],I+q[3],C+q[4],I+q[5],C+q[6]]),I=I+q[5],C=C+q[6];break;case"s":dt[0]==="C"||dt[0]==="c"?J.push([I,C,I+dt[5]-dt[3],C+dt[6]-dt[4],I+q[1],C+q[2],I+q[3],C+q[4]]):(dt[0]==="S"||dt[0]==="s")&&J.push([I,C,I+dt[3]-dt[1],C+dt[4]-dt[2],I+q[1],C+q[2],I+q[3],C+q[4]]),I=I+q[3],C=C+q[4];break;case"a":tt=f({rx:q[1],ry:q[2],px:I,py:C,xAxisRotation:q[3],largeArcFlag:q[4],sweepFlag:q[5],cx:I+q[6],cy:C+q[7]}),ot=tt[tt.length-1],tt.forEach(function(F,j){j===0?J.push([I,C,F.x1,F.y1,F.x2,F.y2,F.x,F.y]):J.push([tt[j-1].x,tt[j-1].y,F.x1,F.y1,F.x2,F.y2,F.x,F.y]);}),I=ot.x,C=ot.y;break;case"A":tt=f({rx:q[1],ry:q[2],px:I,py:C,xAxisRotation:q[3],largeArcFlag:q[4],sweepFlag:q[5],cx:q[6],cy:q[7]}),ot=tt[tt.length-1],tt.forEach(function(F,j){j===0?J.push([I,C,F.x1,F.y1,F.x2,F.y2,F.x,F.y]):J.push([tt[j-1].x,tt[j-1].y,F.x1,F.y1,F.x2,F.y2,F.x,F.y]);}),I=ot.x,C=ot.y;break;case"Q":J.push(A.q2b(I,C,q[1],q[2],q[3],q[4])),I=q[3],C=q[4];break;case"q":J.push(A.q2b(I,C,I+q[1],C+q[2],q[3]+I,q[4]+C)),I+=q[3],C+=q[4];break;case"T":dt[0]==="Q"||dt[0]==="q"?($=I+dt[3]-dt[1],Q=C+dt[4]-dt[2],J.push(A.q2b(I,C,$,Q,q[1],q[2]))):(dt[0]==="T"||dt[0]==="t")&&(J.push(A.q2b(I,C,I+I-$,C+C-Q,q[1],q[2])),$=I+I-$,Q=C+C-Q),I=q[1],C=q[2];break;case"t":dt[0]==="Q"||dt[0]==="q"?($=I+dt[3]-dt[1],Q=C+dt[4]-dt[2],J.push(A.q2b(I,C,$,Q,I+q[1],C+q[2]))):(dt[0]==="T"||dt[0]==="t")&&(J.push(A.q2b(I,C,I+I-$,C+C-Q,I+q[1],C+q[2])),$=I+I-$,Q=C+C-Q),I+=q[1],C+=q[2];break;case"Z":Z=J[0][0],B=J[0][1],J.push([I,C,Z,B,Z,B,Z,B]);break;case"z":Z=J[0][0],B=J[0][1],J.push([I,C,Z,B,Z,B,Z,B]);break;}}return K;},A._upCurves=function(L,D){for(var I=0,C=0,W=L.length;I<D;I++)L.push(L[C].slice(0)),C++,C>W-1&&(C-=W);};function R(L,D,I,C,W,G,K,J,Z){return{left:b(L,D,I,C,W,G,K,J,Z),right:b(K,J,W,G,I,C,L,D,1-Z,!0)};}function b(L,D,I,C,W,G,K,J,Z,B){var $=(I-L)*Z+L,Q=(C-D)*Z+D,et=(W-I)*Z+I,tt=(G-C)*Z+C,ot=(K-W)*Z+W,q=(J-G)*Z+G,gt=(et-$)*Z+$,dt=(tt-Q)*Z+Q,F=(ot-et)*Z+et,j=(q-tt)*Z+tt,V=(F-gt)*Z+gt,X=(j-dt)*Z+dt;return B?[V,X,gt,dt,$,Q,L,D]:[L,D,$,Q,gt,dt,V,X];}A._splitCurves=function(L,D){for(var I=0,C=0;I<D;I++){var W=L[C],G=R(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],0.5);L.splice(C,1),L.splice(C,0,G.left,G.right),C+=2,C>=L.length-1&&(C=0);}};function E(L,D){for(var I=function I(G){var K=L[L.length-1],J=[];K.forEach(function(Z){J.push(Z.slice(0));}),L.push(J);},C=0;C<D;C++)I();}return A.lerp=function(L,D,I){return A._lerp(A.path2shapes(L),A.path2shapes(D),I);},A.MIM_CURVES_COUNT=100,A._preprocessing=function(L,D){var I=L.length,C=D.length,W=JSON.parse(JSON.stringify(L)),G=JSON.parse(JSON.stringify(D));return I>C?E(G,I-C):I<C&&E(W,C-I),W=d(W,G),W.forEach(function(K,J){var Z=K.length,B=G[J].length;Z>B?Z<A.MIM_CURVES_COUNT?(A._splitCurves(K,A.MIM_CURVES_COUNT-Z),A._splitCurves(G[J],A.MIM_CURVES_COUNT-B)):A._splitCurves(G[J],Z-B):Z<B&&(B<A.MIM_CURVES_COUNT?(A._splitCurves(K,A.MIM_CURVES_COUNT-Z),A._splitCurves(G[J],A.MIM_CURVES_COUNT-B)):A._splitCurves(K,B-Z));}),W.forEach(function(K,J){W[J]=l(K,G[J]);}),[W,G];},A._lerp=function(L,D,I){var C=[];return L.forEach(function(W,G){var K=[];W.forEach(function(J,Z){K.push(A.lerpCurve(J,D[G][Z],I));}),C.push(K);}),C;},A.animate=function(L){var D=A.path2shapes(L.from),I=A.path2shapes(L.to),C=A._preprocessing(D,I),W=/* @__PURE__ */new Date(),G=L.end||function(){},K=L.progress||function(){},J=L.begin||function(){},Z=L.easing||function(tt){return tt;},B=null,$=null,Q=L.time;J(D);var et=function tt(){var ot=/* @__PURE__ */new Date()-W;if(ot>=Q){$=I,K($,1),G($),cancelAnimationFrame(B);return;}var q=Z(ot/Q);$=A._lerp(C[0],C[1],q),K($,q),B=requestAnimationFrame(tt);};et();},A;});},/* 228 */ /***/function(h,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);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute");var f=/*#__PURE__*/function(_e$default3){function f(c){var _this24;_classCallCheck(this,f);_this24=_callSuper(this,f,[c]),_this24[a]({d:"",normalize:!1,fillColor:void 0,fillRule:"nonzero",strokeColor:void 0,lineWidth:1,lineJoin:"miter",// 'miter' or 'bevel' or 'round'
323
+ lineCap:"butt",// 'butt' or 'square' or 'round'
324
+ roundSegments:20,// default roundSegment if lineJoin or lineCap is round
325
+ lineDash:void 0,lineDashOffset:0,miterLimit:10,texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0,clipPath:void 0});return _this24;}_inherits(f,_e$default3);return _createClass(f,[{key:"d",get:function get(){return this[s]("d");},set:function set(c){this[o]("d",c);}},{key:"normalize",get:function get(){return this[s]("normalize");},set:function set(c){this[o]("normalize",!!c);}},{key:"fillColor",get:function get(){return this[s]("fillColor");},set:function set(c){this[o]("fillColor",Object(n.parseColor)(c));}},{key:"fillRule",get:function get(){return this[s]("fillRule");},set:function set(c){if(c!=null&&c!=="nonzero"&&c!=="evenodd")throw new TypeError("Invalid fill rule.");this[o]("fillRule",c);}},{key:"strokeColor",get:function get(){return this[s]("strokeColor");},set:function set(c){this[o]("strokeColor",Object(n.parseColor)(c));}},{key:"lineWidth",get:function get(){return this[s]("lineWidth");},set:function set(c){this[o]("lineWidth",Object(i.toNumber)(c));}},{key:"lineJoin",get:function get(){return this[s]("lineJoin");},set:function set(c){if(c!=null&&c!=="miter"&&c!=="bevel"&&c!=="round")throw new TypeError("Invalid lineJoin type.");this[o]("lineJoin",c);}},{key:"lineCap",get:function get(){return this[s]("lineCap");},set:function set(c){if(c!=null&&c!=="butt"&&c!=="square"&&c!=="round")throw new TypeError("Invalid lineCap type.");this[o]("lineCap",c);}},{key:"lineDash",get:function get(){return this[s]("lineDash");},set:function set(c){c=Object(i.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c]),this[o]("lineDash",c?c.map(i.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[s]("lineDashOffset");},set:function set(c){this[o]("lineDashOffset",Object(i.toNumber)(c));}},{key:"miterLimit",get:function get(){return this[s]("miterLimit");},set:function set(c){this[o]("miterLimit",Object(i.toNumber)(c));}},{key:"roundSegments",get:function get(){return this[s]("roundSegments");},set:function set(c){this[o]("roundSegments",c);}},{key:"texture",get:function get(){return this[s]("texture");},set:function set(c){this[o]("texture",c);}},{key:"textureRect",get:function get(){return this[s]("textureRect");},set:function set(c){this[o]("textureRect",c);}},{key:"sourceRect",get:function get(){return this[s]("sourceRect");},set:function set(c){this[o]("sourceRect",c);}},{key:"textureRepeat",get:function get(){return this[s]("textureRepeat");},set:function set(c){this[o]("textureRepeat",!!c);}},{key:"clipPath",get:function get(){return this[s]("clipPath");},set:function set(c){this[o]("clipPath",c);}}]);}(e["default"]);},/* 229 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(230);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default4){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default4);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes15=this.attributes,f=_this$attributes15.width,p=_this$attributes15.height;return f>0&&p>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"rect");},/* 230 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return p;});var e=t(228),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_declareAlias");function f(c){var v=c.width,S=c.height;return"M0 0L".concat(v," 0L").concat(v," ").concat(S,"L0 ").concat(S,"Z");}var p=/*#__PURE__*/function(_e$default5){function p(v){var _this25;_classCallCheck(this,p);_this25=_callSuper(this,p,[v]),_this25[i]({width:0,height:0/* size */}),_this25[s]("size");return _this25;}// readonly
326
+ _inherits(p,_e$default5);return _createClass(p,[{key:"d",get:function get(){return this[o]("d");},set:function set(v){}// eslint-disable-line no-empty-function
327
+ },{key:"width",get:function get(){return this[o]("width");},set:function set(v){if(v=Object(n.toNumber)(v),this[a]("width",v)){var S=f(this);this[a]("d",S);}}},{key:"height",get:function get(){return this[o]("height");},set:function set(v){if(v=Object(n.toNumber)(v),this[a]("height",v)){var S=f(this);this[a]("d",S);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.width=v[0],this.height=v[1];}}]);}(e["default"]);},/* 231 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(235);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default6){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default6);return _createClass(o,[{key:"isVisible",get:function get(){var f=this.attributes.sides;return f[0]>0&&f[1]>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"triangle");},/* 232 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(233);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default7){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default7);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var f=this.attributes.points;return f.length>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"polyline");},/* 233 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(228),n=t(72),i=t(234);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function p(v){var S=v.points,O=v.smooth,x=v.smoothRange,m=v.close,T=[];for(var d=0;d<S.length;d+=2)T.push([S[d],S[d+1]]);var l="";return O?l=Object(i.makeSmoothCurveLine)(T,x):T.length&&(l="M".concat(T.map(function(d){return d.join(" ");}).join("L"))),l&&m&&(l+="Z"),l;}var c=/*#__PURE__*/function(_e$default8){function c(S){var _this26;_classCallCheck(this,c);_this26=_callSuper(this,c,[S]),_this26[a]({points:[],smooth:!1,smoothRange:[0],closeType:"none"// none | normal
328
+ /* close */}),_this26[f]("close");return _this26;}// readonly
329
+ _inherits(c,_e$default8);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(S){}// eslint-disable-line no-empty-function
330
+ },{key:"close",get:function get(){return this.closeType!=="none";},set:function set(S){S=S?"normal":"none",this.closeType=S;}},{key:"closeType",get:function get(){return this[s]("closeType");},set:function set(S){if(S!=null&&S!=="none"&&S!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",S)){var O=p(this);this[o]("d",O);}}},{key:"smooth",get:function get(){return this[s]("smooth");},set:function set(S){if(this[o]("smooth",S)){var O=p(this);this[o]("d",O);}}},{key:"smoothRange",get:function get(){return this[s]("smoothRange");},set:function set(S){if(S&&!Array.isArray(S)&&(S=[S]),this[o]("smoothRange",S)&&this.smooth){var O=p(this);this[o]("d",O);}}},{key:"points",get:function get(){return this[s]("points");},set:function set(S){if(S=Object(n.toArray)(S),Array.isArray(S)&&(S=S.reduce(function(O,x){return Array.isArray(x)?[].concat(_toConsumableArray(O),_toConsumableArray(x.map(function(m){return Object(n.toNumber)(m);}))):[].concat(_toConsumableArray(O),[Object(n.toNumber)(x)]);},[])),this[o]("points",S)){var O=p(this);this[o]("d",O);}}}]);}(e["default"]);},/* 234 */ /***/function(h,r,t){t.r(r),t.d(r,"makeSmoothCurveLine",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0];function a(f){var p=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var c=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var v,S,O,x;if((n[f].x===n[f+1].x||n[f].y===n[f+1].y)&&(p=0,c=0),f<1?(v=n[0].x+(n[1].x-n[0].x)*p,S=n[0].y+(n[1].y-n[0].y)*p):(v=n[f].x+(n[f+1].x-n[f-1].x)*p,S=n[f].y+(n[f+1].y-n[f-1].y)*p),f>n.length-3){var m=n.length-1;O=n[m].x-(n[m].x-n[m-1].x)*c,x=n[m].y-(n[m].y-n[m-1].y)*c;}else O=n[f+1].x-(n[f+2].x-n[f].x)*c,x=n[f+1].y-(n[f+2].y-n[f].y)*c;return[{x:v,y:S},{x:O,y:x}];}n=n.map(function(_ref143){var _ref144=_slicedToArray(_ref143,2),f=_ref144[0],p=_ref144[1];return{x:f,y:p};});var o="",s=0;return n.forEach(function(f,p){if(p===0)o+="M".concat(f.x," ").concat(f.y);else{for(;p>i[s];)s++;if(s%2){var _a3=a(p-1),_a4=_slicedToArray(_a3,2),c=_a4[0],v=_a4[1];o+="C".concat([c.x,c.y,v.x,v.y,f.x,f.y].join(" "));}else o+="L".concat(f.x," ").concat(f.y);}}),o;}},/* 235 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var _p$sides=_slicedToArray(p.sides,2),c=_p$sides[0],v=_p$sides[1];var S=p.angle%360;return S<0&&(S+=360),S=Math.PI*S/180,[0,0,c,0,v*Math.cos(S),v*Math.sin(S)];}var f=/*#__PURE__*/function(_e$default9){function f(c){var _this27;_classCallCheck(this,f);_this27=_callSuper(this,f,[c]),_this27[i]({sides:[0,0],angle:60,closeType:"normal"});return _this27;}// readonly
331
+ _inherits(f,_e$default9);return _createClass(f,[{key:"points",get:function get(){return _get(_getPrototypeOf(f.prototype),"points",this);},set:function set(c){}// eslint-disable-line no-empty-function
332
+ },{key:"sides",get:function get(){return this[o]("sides");},set:function set(c){if(c=Object(n.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c,c]),this[a]("sides",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("angle",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 236 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(237);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default10){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default10);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var f=this.attributes.sides;return f[0]>0&&f[1]>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"parallel");},/* 237 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var _p$sides2=_slicedToArray(p.sides,2),c=_p$sides2[0],v=_p$sides2[1];var S=p.angle%360;S<0&&(S+=360),S=Math.PI*S/180;var O=v*Math.cos(S),x=v*Math.sin(S);return[0,0,c,0,O+c,x,O,x];}var f=/*#__PURE__*/function(_e$default11){function f(c){var _this28;_classCallCheck(this,f);_this28=_callSuper(this,f,[c]),_this28[i]({sides:[0,0],angle:90,closeType:"normal"});return _this28;}// readonly
333
+ _inherits(f,_e$default11);return _createClass(f,[{key:"points",get:function get(){return _get(_getPrototypeOf(f.prototype),"points",this);},set:function set(c){}// eslint-disable-line no-empty-function
334
+ },{key:"sides",get:function get(){return this[o]("sides");},set:function set(c){if(c=Object(n.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c,c]),this[a]("sides",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("angle",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 238 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(239);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default12){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default12);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"regular");},/* 239 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var c=p.edges,v=p.radius,S=p.offsetAngle,O=Math.PI*S/180-0.5*Math.PI;if(c<3||v<=0)return[];var x=[];for(var m=0;m<c;m++){var _T29=m*2*Math.PI/c+O,_l22=v*Math.cos(_T29),d=v*Math.sin(_T29);x.push(_l22,d);}return x;}var f=/*#__PURE__*/function(_e$default13){function f(c){var _this29;_classCallCheck(this,f);_this29=_callSuper(this,f,[c]),_this29[i]({edges:3,radius:0,offsetAngle:0,closeType:"normal"});return _this29;}// readonly
335
+ _inherits(f,_e$default13);return _createClass(f,[{key:"points",get:function get(){return _get(_getPrototypeOf(f.prototype),"points",this);},set:function set(c){}// eslint-disable-line no-empty-function
336
+ },{key:"edges",get:function get(){return this[o]("edges");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("edges",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"radius",get:function get(){return this[o]("radius");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("radius",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("offsetAngle",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 240 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(241);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default14){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default14);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"star");},/* 241 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var c=p.angles,v=p.innerRadius,S=p.outerRadius,O=p.offsetAngle,x=Math.PI*O/180-0.5*Math.PI;if(c<3||v<=0||S<=0)return[];var m=[];for(var _T30=0;_T30<c*2;_T30++){var _l23=_T30*Math.PI/c+x,d=_T30%2?v:S,u=d*Math.cos(_l23),g=d*Math.sin(_l23);m.push(u,g);}return m;}var f=/*#__PURE__*/function(_e$default15){function f(c){var _this30;_classCallCheck(this,f);_this30=_callSuper(this,f,[c]),_this30[i]({angles:5,innerRadius:0,outerRadius:0,/* radius */offsetAngle:0,closeType:"normal"});return _this30;}// readonly
337
+ _inherits(f,_e$default15);return _createClass(f,[{key:"points",get:function get(){return _get(_getPrototypeOf(f.prototype),"points",this);},set:function set(c){}// eslint-disable-line no-empty-function
338
+ },{key:"angles",get:function get(){return this[o]("angles");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("angles",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"innerRadius",get:function get(){return this[o]("innerRadius");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("innerRadius",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"outerRadius",get:function get(){return this[o]("outerRadius");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("outerRadius",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(c){c=Object(n.toArray)(c,!0),Array.isArray(c)||(c=[c,c]),this.innerRadius=c[0],this.outerRadius=c[1];}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("offsetAngle",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 242 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(243);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default16){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default16);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes16=this.attributes,f=_this$attributes16.radiusX,p=_this$attributes16.radiusY,c=_this$attributes16.startAngle,v=_this$attributes16.endAngle;return f>0&&p>0&&c!==v&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ellipse");},/* 243 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function p(v){var S=v.radiusX,O=v.radiusY,x=v.startAngle,m=v.endAngle,T=v.direction,l=v.closeType,d=T==="anitclockwise",u=new e.Figure2D();return l==="sector"&&u.moveTo(0,0),u.ellipse(0,0,S,O,0,Math.PI*x/180,Math.PI*m/180,d),l!=="none"&&u.closePath(),u.path.reduce(function(A,R){return A+R.join(" ");},"");}var c=/*#__PURE__*/function(_n$default2){function c(S){var _this31;_classCallCheck(this,c);_this31=_callSuper(this,c,[S]),_this31[a]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise
339
+ closeType:"none"// none | sector | normal
340
+ }),_this31[f]("radius","angle");return _this31;}// readonly
341
+ _inherits(c,_n$default2);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(S){}// eslint-disable-line no-empty-function
342
+ },{key:"radiusX",get:function get(){return this[s]("radiusX");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("radiusX",S)){var O=p(this);this[o]("d",O);}}},{key:"radiusY",get:function get(){return this[s]("radiusY");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("radiusY",S)){var O=p(this);this[o]("d",O);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(S){S=Object(i.toArray)(S,!0),Array.isArray(S)||(S=[S,S]),this.radiusX=S[0],this.radiusY=S[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(S){S=Object(i.toArray)(S),Array.isArray(S)||(S=[S,S]),this.startAngle=S[0],this.endAngle=S[1];}},{key:"direction",get:function get(){return this[s]("direction");},set:function set(S){if(S!=null&&S!=="clockwise"&&S!=="anticlockwise")throw new TypeError("Invalid direction type.");this[o]("direction",S);}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("startAngle",S)){var O=p(this);this[o]("d",O);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("endAngle",S)){var O=p(this);this[o]("d",O);}}},{key:"closeType",get:function get(){return this[s]("closeType");},set:function set(S){if(S!=null&&S!=="none"&&S!=="sector"&&S!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",S)){var O=p(this);this[o]("d",O);}}}]);}(n["default"]);},/* 244 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(242),n=t(213),i=t(245);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default17){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default17);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"arc");},/* 245 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;});var e=t(243),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(_e$default18){function i(){_classCallCheck(this,i);return _callSuper(this,i,arguments);}_inherits(i,_e$default18);return _createClass(i,[{key:"radius",get:function get(){return _get(_getPrototypeOf(i.prototype),"radiusX",this);},set:function set(o){o=Object(n.toNumber)(o),_set(_getPrototypeOf(i.prototype),"radiusX",o,this,true),_set(_getPrototypeOf(i.prototype),"radiusY",o,this,true);}}]);}(e["default"]);},/* 246 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(247);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default19){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default19);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes17=this.attributes,f=_this$attributes17.innerRadius,p=_this$attributes17.outerRadius,c=_this$attributes17.startAngle,v=_this$attributes17.endAngle;return(f>0||p>0)&&c!==v&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ring");},/* 247 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function p(v){var _ref145;var S=v.innerRadius,O=v.outerRadius,x=v.startAngle,m=v.endAngle;var T=new e.Figure2D();if(x=Math.PI*x/180,m=Math.PI*m/180,S>O&&(_ref145=[O,S],S=_ref145[0],O=_ref145[1],_ref145),S<=0&&T.moveTo(0,0),T.arc(0,0,O,x,m,!1),S>0){var u=Math.PI*2;m<x&&(m=x+u+(m-x)%u),m-x>=u&&(m=x+u-1e-6),T.arc(0,0,S,m,x,!0);}return T.closePath(),T.path.reduce(function(u,g){return u+g.join(" ");},"");}var c=/*#__PURE__*/function(_n$default3){function c(S){var _this32;_classCallCheck(this,c);_this32=_callSuper(this,c,[S]),_this32[a]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this32[f]("radius","angle");return _this32;}// readonly
343
+ _inherits(c,_n$default3);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(S){}// eslint-disable-line no-empty-function
344
+ },{key:"innerRadius",get:function get(){return this[s]("innerRadius");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("innerRadius",S)){var O=p(this);this[o]("d",O);}}},{key:"outerRadius",get:function get(){return this[s]("outerRadius");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("outerRadius",S)){var O=p(this);this[o]("d",O);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(S){S=Object(i.toArray)(S,!0),Array.isArray(S)||(S=[S,S]),this.innerRadius=S[0],this.outerRadius=S[1];}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("startAngle",S)){var O=p(this);this[o]("d",O);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("endAngle",S)){var O=p(this);this[o]("d",O);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(S){S=Object(i.toArray)(S),Array.isArray(S)||(S=[S,S]),this.startAngle=S[0],this.endAngle=S[1];}}]);}(n["default"]);},/* 248 */ /***/function(h,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),o=t(213);t(1).glMatrix.setMatrixArrayType(Array);function s(x,m,T){return m in x?Object.defineProperty(x,m,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[m]=T,x;}var f=Symbol("textImage"),p=Symbol("textImageTask"),c=Symbol("textureContext"),v=Symbol("updateTextureRect"),S=Symbol("textCanvas");var O=/*#__PURE__*/function(_i$default3){function O(){var _this33;var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);typeof m=="string"&&(m={text:m}),_this33=_callSuper(this,O,[m]);return _this33;}/* override */_inherits(O,_i$default3);return _createClass(O,[{key:"contentSize",get:function get(){var _get4=_get(_getPrototypeOf(O.prototype),"contentSize",this),_get5=_slicedToArray(_get4,2),m=_get5[0],T=_get5[1];var _this$attributes18=this.attributes,l=_this$attributes18.width,d=_this$attributes18.height;if(l==null||d==null){var u=this[f];u&&(l==null&&(m=u.rect[2]),d==null&&(T=u.rect[3]));}return[m,T];}},{key:"text",get:function get(){return this.attributes.text;},set:function set(m){this.attributes.text=m;}},{key:"textContent",get:function get(){return this.attributes.text;},set:function set(m){this.attributes.text=m;}},{key:"textImage",get:function get(){return this[f]||{};}},{key:"textImageReady",get:function get(){return this[p]||Promise.resolve();}/* override */},{key:"draw",value:function draw(m){_get(_getPrototypeOf(O.prototype),"draw",this).call(this,m);var T=this.mesh;if(T){var _l24=this[f];if(_l24){var d=T.texture;if(!d||this[c]&&this[c]!==this.renderer||_l24.needsUpdate?(_l24.needsUpdate=!1,Object(n.deleteTexture)(_l24.image,this.renderer),d=Object(n.createTexture)(_l24.image,this.renderer),this[v]=!0):d=T.uniforms.u_texSampler,this[v]){var _l24$rect$slice=_l24.rect.slice(2),_l24$rect$slice2=_slicedToArray(_l24$rect$slice,2),u=_l24$rect$slice2[0],g=_l24$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),M=_this$contentSize4[0],A=_this$contentSize4[1],R=this.attributes.textAlign,b=this.attributes.verticalAlign;var E=0;R==="center"?E=(M-u)/2:(R==="right"||R==="end")&&(E=M-u);var L=this.attributes.fontSize,D=this.attributes.lineHeight;var I=0;b==="top"?I=(L-D)/2:b==="bottom"&&(I=(D-L)/2);var _this$attributes19=this.attributes,C=_this$attributes19.paddingLeft,W=_this$attributes19.paddingTop,G=this.attributes.borderWidth;E+=C+G,I+=W+G;var _this$attributes20=this.attributes,K=_this$attributes20.anchorX,J=_this$attributes20.anchorY;E-=this.offsetSize[0]*K,I-=this.offsetSize[1]*J,T.setTexture(d,{rect:[E,I,u,g]}),this[v]=!1,this[c]=this.renderer;}}}return m;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(m,T,l){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[v]=!0),_get(_getPrototypeOf(O.prototype),"onPropertyChange",this).call(this,m,T,l));}/* override */},{key:"updateContours",value:function updateContours(){_get(_getPrototypeOf(O.prototype),"updateContours",this).call(this),this[v]=!0;}},{key:"updateText",value:function updateText(){var _this34=this;this[p]||(this[p]=Promise.resolve().then(function(){_this34[p]=null;var _this34$attributes=_this34.attributes,m=_this34$attributes.text,T=_this34$attributes.font,l=_this34$attributes.fillColor,d=_this34$attributes.strokeColor,u=_this34$attributes.strokeWidth,g=_this34.layer?_this34.layer.displayRatio:1;return _this34[S]=_this34[S]||e.ENV.createCanvas(1,1),_this34[f]=e.ENV.createText(m,{font:T,fillColor:l,strokeColor:d,strokeWidth:u,parseFont:e.parseFont,ratio:g,textCanvas:_this34[S]}),_this34[f].needsUpdate=!0,_this34.updateContours(),_this34.forceUpdate(),_this34[f];}));}}]);}(i["default"]);s(O,"Attr",a["default"]),o["default"].registerNode(O,"label");},/* 249 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(72),i=t(221),a=t(220);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),p=Symbol["for"]("spritejs_declareAlias");var c=/*#__PURE__*/function(_a$default2){function c(S){var _this35;_classCallCheck(this,c);_this35=_callSuper(this,c,[S]),_this35[o]({text:"",fontSize:16,fontFamily:"Helvetica,Arial,sans-serif",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fontStretch:"normal",lineHeight:"",/* font */textAlign:"left",strokeColor:void 0,strokeWidth:1,fillColor:void 0,verticalAlign:"middle"}),_this35[p]("font");return _this35;}_inherits(c,_a$default2);return _createClass(c,[{key:"text",get:function get(){return this[f]("text")||" ";},set:function set(S){this[s]("text",S);}},{key:"fontSize",get:function get(){return this[f]("fontSize");},set:function set(S){this[s]("fontSize",Object(n.toNumber)(S));}},{key:"fontFamily",get:function get(){return this[f]("fontFamily");},set:function set(S){this[s]("fontFamily",S);}},{key:"fontStyle",get:function get(){return this[f]("fontStyle");},set:function set(S){this[s]("fontStyle",S);}},{key:"fontVariant",get:function get(){return this[f]("fontVariant");},set:function set(S){this[s]("fontVariant",S);}},{key:"fontWeight",get:function get(){return this[f]("fontWeight");},set:function set(S){this[s]("fontWeight",S);}},{key:"fontStretch",get:function get(){return this[f]("fontStretch");},set:function set(S){this[s]("fontStretch",S);}},{key:"lineHeight",get:function get(){return this[f]("lineHeight")||this.fontSize;},set:function set(S){this[s]("lineHeight",Object(n.toNumber)(S));}},{key:"textAlign",get:function get(){return this[f]("textAlign");},set:function set(S){this[s]("textAlign",S);}},{key:"strokeColor",get:function get(){return this[f]("strokeColor");},set:function set(S){this[s]("strokeColor",Object(i.parseColor)(S));}},{key:"strokeWidth",get:function get(){return this[f]("strokeWidth");},set:function set(S){this[s]("strokeWidth",Object(n.toNumber)(S));}},{key:"verticalAlign",get:function get(){return this[f]("verticalAlign");},set:function set(S){this[s]("verticalAlign",S);}},{key:"fillColor",get:function get(){return this[f]("fillColor");},set:function set(S){this[s]("fillColor",Object(i.parseColor)(S));}},{key:"font",get:function get(){var S=this.fontStyle,O=this.fontVariant,x=this.fontWeight,m=this.fontStretch,T=this.fontSize,l=this.lineHeight,d=this.fontFamily;return"".concat(S," ").concat(O," ").concat(x," ").concat(m," ").concat(T,"px/").concat(l,"px ").concat(d);},set:function set(S){if(S==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{var O=Object(e.parseFont)(S);this.fontStyle=O.style,this.fontVariant=O.variant,this.fontWeight=O.weight,this.fontStretch=O.stretch,this.fontSize=Object(n.toNumber)("".concat(O.size).concat(O.unit)),O.lineHeight&&(this.lineHeight=O.pxLineHeight),this.fontFamily=O.family;}}}]);}(a["default"]);},/* 250 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return S;});var e=t(12),n=t(219),i=t(251),a=t(213),o=t(252);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;}var f=Symbol("zOrder"),p=Symbol("ordered"),c=Symbol("children"),v=Symbol("sealed");var S=/*#__PURE__*/function(_n$default4){function S(){var _this36;var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,S);_this36=_callSuper(this,S,[x]),_this36[c]=[],_this36[p]=null,_this36[f]=0;return _this36;}_inherits(S,_n$default4);return _createClass(S,[{key:"childNodes",get:function get(){return this[c];}},{key:"children",get:function get(){return this[c];}},{key:"orderedChildren",get:function get(){return this[p]||(this[p]=_toConsumableArray(this[c]),this[p].sort(function(x,m){return x.zIndex-m.zIndex||x.zOrder-m.zOrder;})),this[p];}},{key:"append",value:function append(){var _this37=this;for(var _len12=arguments.length,x=new Array(_len12),_key12=0;_key12<_len12;_key12++){x[_key12]=arguments[_key12];}return x.map(function(m){return _this37.appendChild(m);});}},{key:"appendChild",value:function appendChild(x){return x.remove(),this[c].push(x),x.connect(this,this[f]++),this[p]&&(this[p].length&&x.zIndex<this[p][this[p].length-1].zIndex?this.reorder():this[p].push(x)),x;}/* override */ // get isVisible() {
345
+ // return this.attributes.opacity > 0 && this[_children].length > 0;
346
+ // }
347
+ /* override */},{key:"cloneNode",value:function cloneNode(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var m=_get(_getPrototypeOf(S.prototype),"cloneNode",this).call(this);return x&&this[c].forEach(function(T){var l=T.cloneNode(x);m.appendChild(l);}),m;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(x){var m=this.orderedChildren;for(var _T31=m.length-1;_T31>=0;_T31--)if(m[_T31].dispatchPointerEvent(x))return!0;return _get(_getPrototypeOf(S.prototype),"dispatchPointerEvent",this).call(this,x);}/* override */},{key:"draw",value:function draw(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_get(_getPrototypeOf(S.prototype),"draw",this).call(this,x),!this[v]&&this.attributes.display!=="none"){var m=this.orderedChildren;for(var _T32=0;_T32<m.length;_T32++)m[_T32].draw(x);}return this.__cacheRenderMatrix=null,x;}},{key:"getElementById",value:function getElementById(x){return Object(o.querySelector)("#".concat(x),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(x){return Object(o.querySelectorAll)(".".concat(x),this);}},{key:"getElementsByName",value:function getElementsByName(x){return Object(o.querySelectorAll)("[name=\"".concat(x,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(x){return Object(o.querySelectorAll)(x,this);}},{key:"insertBefore",value:function insertBefore(x,m){if(m==null)return this.appendChild(x);x.remove();var T=this[c].indexOf(m);if(T<0)throw new Error("Invalid reference node.");var l=m.zOrder;for(var d=T;d<this[c].length;d++){var u=this[c][d].zOrder,g=this[c][d];delete g.zOrder,Object.defineProperty(g,"zOrder",{value:u+1,writable:!1,configurable:!0});}if(this[c].splice(T,0,x),x.connect(this,l),this[p])if(x.zIndex!==m.zIndex)this.reorder();else{var _d7=this[p].indexOf(m);this[p].splice(_d7,0,x);}return x;}},{key:"querySelector",value:function querySelector(x){return Object(o.querySelector)(x,this);}},{key:"querySelectorAll",value:function querySelectorAll(x){return Object(o.querySelectorAll)(x,this);}},{key:"replaceChild",value:function replaceChild(x,m){x.remove();var T=this[c].indexOf(m);if(T<0)throw new Error("Invalid reference node.");if(this[c][T]=x,x.connect(this,m.zOrder),this[p])if(x.zIndex!==m.zIndex)this.reorder();else{var _l25=this[p].indexOf(m);this[p][_l25]=x;}return m.disconnect(this),x;}},{key:"removeAllChildren",value:function removeAllChildren(){var x=this[c];for(var m=x.length-1;m>=0;m--)x[m].remove();}},{key:"removeChild",value:function removeChild(x){var m=this[c].indexOf(x);if(m>=0){if(this[c].splice(m,1),this[p]){var _T33=this[p].indexOf(x);this[p].splice(_T33,1);}return x.disconnect(this),x;}return null;}},{key:"reorder",value:function reorder(){this[p]=null;}},{key:"seal",value:function seal(){function x(d,u){var g=[];for(var M=0;M<d.length;M++){var A=_toConsumableArray(d[M]);for(var R=1;R<A.length;R+=2){var b=A[R],E=A[R+1];A[R]=b*u[0]+E*u[2]+u[4],A[R+1]=b*u[1]+E*u[3]+u[5];}g.push(A);}return g;}var m=this.orderedChildren,T=new e.Figure2D(),l=this.localMatrix;for(var d=0;d<m.length;d++){var u=m[d];if(u instanceof S&&(u=u.seal()),u.clientBox){var g=u.clientBox.contours.path;g=x(g,u.localMatrix),T.addPath(g);}if(u.path){var _g6=u.path.contours.path;_g6=x(_g6,u.localMatrix),T.addPath(_g6);}}return this[v]=!0,this.clientBox=T,{clientBox:T,localMatrix:l};}/* override */},{key:"setResolution",value:function setResolution(_ref146){var x=_ref146.width,m=_ref146.height;_get(_getPrototypeOf(S.prototype),"setResolution",this).call(this,{width:x,height:m}),this[c].forEach(function(T){T.setResolution({width:x,height:m});});}/* override */},{key:"updateContours",value:function updateContours(){this[v]||_get(_getPrototypeOf(S.prototype),"updateContours",this).call(this);}}]);}(n["default"]);s(S,"Attr",i["default"]),a["default"].registerNode(S,"group");},/* 251 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=/*#__PURE__*/function(_e$default20){function n(){_classCallCheck(this,n);return _callSuper(this,n,arguments);}_inherits(n,_e$default20);return _createClass(n);}(e["default"]);},/* 252 */ /***/function(h,r,t){t.r(r),t.d(r,"querySelectorAll",function(){return v;}),t.d(r,"querySelector",function(){return S;}),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);var i=t(253);function a(m){return m.nodeType===1||n["default"].isSpriteNode(m.nodeName);}function o(m){return Array.from(m.childNodes||[]);}function s(m){return n["default"].isSpriteNode(m.nodeName)?m.parent||m.canvas||m.container:m.parentElement;}function f(m){var T=m.length,l,d,u;for(;--T>-1;){for(l=d=m[T],m[T]=null,u=!0;d;){if(m.indexOf(d)>-1){u=!1,m.splice(T,1);break;}d=s(d);}u&&(m[T]=l);}return m;}var p={isTag:a,existsOne:function existsOne(m,T){return T.some(function(l){return a(l)?m(l)||p.existsOne(m,o(l)):!1;});},getSiblings:function getSiblings(m){var T=s(m);return T&&o(T);},getChildren:o,getParent:s,getAttributeValue:function getAttributeValue(m,T){if(m.nodeType===1&&T==="class"||T==="id")return m[T];if(this.hasAttrib(m,T)){var _l26=m.attributes[T];return Array.isArray(_l26)&&(_l26="[".concat(_l26.join(),"]")),String(_l26);}},hasAttrib:function hasAttrib(m,T){return m.attributes[T]!=null;},removeSubsets:f,getName:function getName(m){return m.tagName?m.tagName.toLowerCase():null;},findOne:function m(T,l){var d=null;for(var u=0,g=l.length;u<g&&!d;u++)if(T(l[u]))d=l[u];else{var M=o(l[u]);M&&M.length>0&&(d=m(T,M));}return d;},findAll:function m(T,l){var d=[];for(var u=0,g=l.length;u<g;u++){if(!a(l[u]))continue;T(l[u])&&d.push(l[u]);var M=o(l[u]);M&&(d=d.concat(m(T,M)));}return d;},getText:function m(T){return Array.isArray(T)?T.map(m).join(""):a(T)?m(o(T)):T.nodeType===3?T.nodeValue:n["default"].isSpriteNode(T.nodeName)?T.text:"";}};function c(m){if(typeof m!="string")return m;var T=m.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return T&&(T=T.map(function(l){var d=l.slice(1,-1).split("="),u=Object(e.parseColor)(d[1].replace(/['"]/g,""));return[l,"[".concat(d[0],"=\"").concat(u,"\"]")];}),T.forEach(function(_ref147){var _ref148=_slicedToArray(_ref147,2),l=_ref148[0],d=_ref148[1];m=m.replace(l,d);})),T=m.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),T&&(T=T.map(function(l){var d=l.slice(1,-1).split("="),u=d[1].slice(2,-2).split(/,/g).map(function(g){return g.trim();});return[l,"[".concat(d[0],"=\"[").concat(u,"]\"]")];}),T.forEach(function(_ref149){var _ref150=_slicedToArray(_ref149,2),l=_ref150[0],d=_ref150[1];m=m.replace(l,d);})),m;}function v(m,T){return i.selectAll(c(m),T,{adapter:p});}function S(m,T){return i.selectOne(c(m),T,{adapter:p});}function O(m,T){return i.is(m,c(T),{adapter:p});}function x(m){return i.compile(c(m),{adapter:p});}},/* 253 */ /***/function(h,r,t){h.exports=x;var e=t(254),n=t(273).falseFunc,i=t(274);function a(m){return function(l,d,u){return d=d||{},d.adapter=d.adapter||e,m(l,d,u);};}var o=a(i),s=a(i.compileUnsafe);function f(m){return function(l,d,u){return u=u||{},u.adapter=u.adapter||e,typeof l!="function"&&(l=s(l,u,d)),l.shouldTestNextSiblings&&(d=c(u&&u.context||d,u.adapter)),Array.isArray(d)?d=u.adapter.removeSubsets(d):d=u.adapter.getChildren(d),m(l,d,u);};}function p(m,T){var l=T.getSiblings(m);if(!Array.isArray(l))return[];for(l=l.slice(0);l.shift()!==m;);return l;}function c(m,T){Array.isArray(m)||(m=[m]);for(var l=m.slice(0),d=0,u=m.length;d<u;d++){var g=p(l[d],T);l.push.apply(l,g);}return l;}var v=f(function(T,l,d){return T===n||!l||l.length===0?[]:d.adapter.findAll(T,l);}),S=f(function(T,l,d){return T===n||!l||l.length===0?null:d.adapter.findOne(T,l);});function O(m,T,l){return l=l||{},l.adapter=l.adapter||e,(typeof T=="function"?T:o(T,l))(m);}function x(m,T,l){return v(m,T,l);}x.compile=o,x.filters=i.Pseudos.filters,x.pseudos=i.Pseudos.pseudos,x.selectAll=v,x.selectOne=S,x.is=O,x.parse=o,x.iterate=v,x._compileUnsafe=s,x._compileToken=i.compileToken;},/* 254 */ /***/function(h,r,t){var e=h.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);});});},/* 255 */ /***/function(h,r,t){var e=t(256),n=t(257),i=e.isTag;h.exports={getInnerHTML:a,getOuterHTML:n,getText:o};function a(s,f){return s.children?s.children.map(function(p){return n(p,f);}).join(""):"";}function o(s){return Array.isArray(s)?s.map(o).join(""):i(s)?s.name==="br"?"\n":o(s.children):s.type===e.CDATA?o(s.children):s.type===e.Text?s.data:"";}},/* 256 */ /***/function(h,r){h.exports={Text:"text",//Text
348
+ Directive:"directive",//<? ... ?>
349
+ Comment:"comment",//<!-- ... -->
350
+ Script:"script",//<script> tags
351
+ Style:"style",//<style> tags
352
+ Tag:"tag",//Any tag
353
+ CDATA:"cdata",//<![CDATA[ ... ]]>
354
+ Doctype:"doctype",isTag:function isTag(t){return t.type==="tag"||t.type==="script"||t.type==="style";}};},/* 257 */ /***/function(h,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 o(m,T){if(m){var l="",d;for(var u in m)d=m[u],l&&(l+=" "),T.xmlMode==="foreign"&&(u=i.attributeNames[u]||u),l+=u,(d!==null&&d!==""||T.xmlMode)&&(l+='="'+(T.decodeEntities?n.encodeXML(d):d.replace(/\"/g,"&quot;"))+'"');return l;}}var s={__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=h.exports=function(m,T){!Array.isArray(m)&&!m.cheerio&&(m=[m]),T=T||{};for(var l="",d=0;d<m.length;d++){var u=m[d];u.type==="root"?l+=f(u.children,T):e.isTag(u)?l+=c(u,T):u.type===e.Directive?l+=v(u):u.type===e.Comment?l+=x(u):u.type===e.CDATA?l+=O(u):l+=S(u,T);}return l;},p=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function c(m,T){T.xmlMode==="foreign"&&(m.name=i.elementNames[m.name]||m.name,m.parent&&p.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 l="<"+m.name,d=o(m.attribs,T);return d&&(l+=" "+d),T.xmlMode&&(!m.children||m.children.length===0)?l+="/>":(l+=">",m.children&&(l+=f(m.children,T)),(!s[m.name]||T.xmlMode)&&(l+="</"+m.name+">")),l;}function v(m){return"<"+m.data+">";}function S(m,T){var l=m.data||"";return T.decodeEntities&&!(m.parent&&m.parent.name in a)&&(l=n.encodeXML(l)),l;}function O(m){return"<![CDATA["+m.children[0].data+"]]>";}function x(m){return"<!--"+m.data+"-->";}},/* 258 */ /***/function(h,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";},/* 259 */ /***/function(h,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(p,c){return(!c||c<=0?e.decodeXML:e.decodeHTML)(p);}r.decode=i;function a(p,c){return(!c||c<=0?e.decodeXML:e.decodeHTMLStrict)(p);}r.decodeStrict=a;function o(p,c){return(!c||c<=0?n.encodeXML:n.encodeHTML)(p);}r.encode=o;var s=t(266);Object.defineProperty(r,"encodeXML",{enumerable:!0,get:function get(){return s.encodeXML;}}),Object.defineProperty(r,"encodeHTML",{enumerable:!0,get:function get(){return s.encodeHTML;}}),Object.defineProperty(r,"escape",{enumerable:!0,get:function get(){return s.escape;}}),Object.defineProperty(r,"encodeHTML4",{enumerable:!0,get:function get(){return s.encodeHTML;}}),Object.defineProperty(r,"encodeHTML5",{enumerable:!0,get:function get(){return s.encodeHTML;}});var f=t(260);Object.defineProperty(r,"decodeXML",{enumerable:!0,get:function get(){return f.decodeXML;}}),Object.defineProperty(r,"decodeHTML",{enumerable:!0,get:function get(){return f.decodeHTML;}}),Object.defineProperty(r,"decodeHTMLStrict",{enumerable:!0,get:function get(){return f.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeHTML4",{enumerable:!0,get:function get(){return f.decodeHTML;}}),Object.defineProperty(r,"decodeHTML5",{enumerable:!0,get:function get(){return f.decodeHTML;}}),Object.defineProperty(r,"decodeHTML4Strict",{enumerable:!0,get:function get(){return f.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeHTML5Strict",{enumerable:!0,get:function get(){return f.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeXMLStrict",{enumerable:!0,get:function get(){return f.decodeXML;}});},/* 260 */ /***/function(h,r,t){var e=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{"default":c};};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)),o=e(t(264));r.decodeXML=s(a["default"]),r.decodeHTMLStrict=s(n["default"]);function s(c){var v=Object.keys(c).join("|"),S=p(c);v+="|#[xX][\\da-fA-F]+|#\\d+";var O=new RegExp("&(?:"+v+");","g");return function(x){return String(x).replace(O,S);};}var f=function f(c,v){return c<v?1:-1;};r.decodeHTML=function(){for(var c=Object.keys(i["default"]).sort(f),v=Object.keys(n["default"]).sort(f),S=0,O=0;S<v.length;S++)c[O]===v[S]?(v[S]+=";?",O++):v[S]+=";";var x=new RegExp("&(?:"+v.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),m=p(n["default"]);function T(l){return l.substr(-1)!==";"&&(l+=";"),m(l);}return function(l){return String(l).replace(x,T);};}();function p(c){return function(S){if(S.charAt(1)==="#"){var O=S.charAt(2);return O==="X"||O==="x"?o["default"](parseInt(S.substr(3),16)):o["default"](parseInt(S.substr(2),10));}return c[S.slice(1,-1)];};}},/* 261 */ /***/function(h){h.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":"‌"}');},/* 262 */ /***/function(h){h.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":"ÿ"}');},/* 263 */ /***/function(h){h.exports=JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}");},/* 264 */ /***/function(h,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 o="";return a>65535&&(a-=65536,o+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),o+=String.fromCharCode(a),o;}r["default"]=i;},/* 265 */ /***/function(h){h.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}');},/* 266 */ /***/function(h,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=p(n["default"]),a=c(i);r.encodeXML=O(i,a);var o=e(t(261)),s=p(o["default"]),f=c(s);r.encodeHTML=O(s,f);function p(T){return Object.keys(T).sort().reduce(function(l,d){return l[T[d]]="&"+d+";",l;},{});}function c(T){for(var l=[],d=[],u=0,g=Object.keys(T);u<g.length;u++){var M=g[u];M.length===1?l.push("\\"+M):d.push(M);}l.sort();for(var A=0;A<l.length-1;A++){for(var R=A;R<l.length-1&&l[R].charCodeAt(1)+1===l[R+1].charCodeAt(1);)R+=1;var b=1+R-A;b<3||l.splice(A,b,l[A]+"-"+l[R]);}return d.unshift("["+l.join("")+"]"),new RegExp(d.join("|"),"g");}var v=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function S(T){return"&#x"+T.codePointAt(0).toString(16).toUpperCase()+";";}function O(T,l){return function(d){return d.replace(l,function(u){return T[u];}).replace(v,S);};}var x=c(i);function m(T){return T.replace(x,S).replace(v,S);}r.escape=m;},/* 267 */ /***/function(h){h.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"}}');},/* 268 */ /***/function(h,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;};},/* 269 */ /***/function(h,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 o=a.children;o[o.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;};},/* 270 */ /***/function(h,r,t){var e=t(256).isTag;h.exports={filter:n,find:i,findOneChild:a,findOne:o,existsOne:s,findAll:f};function n(p,c,v,S){return Array.isArray(c)||(c=[c]),(typeof S!="number"||!isFinite(S))&&(S=1/0),i(p,c,v!==!1,S);}function i(p,c,v,S){for(var O=[],x,m=0,T=c.length;m<T&&!(p(c[m])&&(O.push(c[m]),--S<=0)||(x=c[m].children,v&&x&&x.length>0&&(x=i(p,x,v,S),O=O.concat(x),S-=x.length,S<=0)));m++);return O;}function a(p,c){for(var v=0,S=c.length;v<S;v++)if(p(c[v]))return c[v];return null;}function o(p,c){for(var v=null,S=0,O=c.length;S<O&&!v;S++)if(e(c[S]))p(c[S])?v=c[S]:c[S].children.length>0&&(v=o(p,c[S].children));else continue;return v;}function s(p,c){for(var v=0,S=c.length;v<S;v++)if(e(c[v])&&(p(c[v])||c[v].children.length>0&&s(p,c[v].children)))return!0;return!1;}function f(p,c){for(var v=[],S=c.slice();S.length;){var O=S.shift();e(O)&&(O.children&&O.children.length>0&&S.unshift.apply(S,O.children),p(O)&&v.push(O));}return v;}},/* 271 */ /***/function(h,r,t){var e=t(256),n=r.isTag=e.isTag;r.testElement=function(s,f){for(var p in s)if(s.hasOwnProperty(p)){if(p==="tag_name"){if(!n(f)||!s.tag_name(f.name))return!1;}else if(p==="tag_type"){if(!s.tag_type(f.type))return!1;}else if(p==="tag_contains"){if(n(f)||!s.tag_contains(f.data))return!1;}else if(!f.attribs||!s[p](f.attribs[p]))return!1;}return!0;};var i={tag_name:function tag_name(s){return typeof s=="function"?function(f){return n(f)&&s(f.name);}:s==="*"?n:function(f){return n(f)&&f.name===s;};},tag_type:function tag_type(s){return typeof s=="function"?function(f){return s(f.type);}:function(f){return f.type===s;};},tag_contains:function tag_contains(s){return typeof s=="function"?function(f){return!n(f)&&s(f.data);}:function(f){return!n(f)&&f.data===s;};}};function a(s,f){return typeof f=="function"?function(p){return p.attribs&&f(p.attribs[s]);}:function(p){return p.attribs&&p.attribs[s]===f;};}function o(s,f){return function(p){return s(p)||f(p);};}r.getElements=function(s,f,p,c){var v=Object.keys(s).map(function(S){var O=s[S];return S in i?i[S](O):a(S,O);});return v.length===0?[]:this.filter(v.reduce(o),f,p,c);},r.getElementById=function(s,f,p){return Array.isArray(f)||(f=[f]),this.findOne(a("id",s),f,p!==!1);},r.getElementsByTagName=function(s,f,p,c){return this.filter(i.tag_name(s),f,p,c);},r.getElementsByTagType=function(s,f,p,c){return this.filter(i.tag_type(s),f,p,c);};},/* 272 */ /***/function(h,r){r.removeSubsets=function(n){for(var i=n.length,a,o,s;--i>-1;){for(a=o=n[i],n[i]=null,s=!0;o;){if(n.indexOf(o)>-1){s=!1,n.splice(i,1);break;}o=o.parent;}s&&(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=[],o=[],s,f,p,c,v,S;if(n===i)return 0;for(s=n;s;)a.unshift(s),s=s.parent;for(s=i;s;)o.unshift(s),s=s.parent;for(S=0;a[S]===o[S];)S++;return S===0?t.DISCONNECTED:(f=a[S-1],p=f.children,c=a[S],v=o[S],p.indexOf(c)>p.indexOf(v)?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,o;for(n=n.slice();--i>-1;)a=n[i],o=n.indexOf(a),o>-1&&o<i&&n.splice(i,1);return n.sort(function(s,f){var p=e(s,f);return p&t.PRECEDING?-1:p&t.FOLLOWING?1:0;}),n;};},/* 273 */ /***/function(h,r){h.exports={trueFunc:function trueFunc(){return!0;},falseFunc:function falseFunc(){return!1;}};},/* 274 */ /***/function(h,r,t){h.exports=v;var e=t(275).parse,n=t(273),i=t(278),a=t(279),o=t(280),s=t(282),f=n.trueFunc,p=n.falseFunc,c=s.filters;function v(E,L,D){var I=O(E,L,D);return S(I,L);}function S(E,L){var D=L.adapter;return function(C){return D.isTag(C)&&E(C);};}function O(E,L,D){var I=e(E,L);return g(I,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"},l={type:"pseudo",name:"scope"},d={};function u(E,L,D){var I=L.adapter,C=!!D&&!!D.length&&D.every(function(W){return W===d||!!I.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(l);});}function g(E,L,D){E=E.filter(function(G){return G.length>0;}),E.forEach(i);var I=Array.isArray(D);D=L&&L.context||D,D&&!I&&(D=[D]),u(E,L,D);var C=!1,W=E.map(function(G){if(G[0]&&G[1]&&G[0].name==="scope"){var K=G[1].type;I&&K==="descendant"?G[1]=T:(K==="adjacent"||K==="sibling")&&(C=!0);}return A(G,L,D);}).reduce(R,p);return W.shouldTestNextSiblings=C,W;}function M(E){return a[E.type]<0;}function A(E,L,D){return E.reduce(function(I,C){if(I===p)return I;if(!(C.type in o))throw new Error("Rule type "+C.type+" is not supported by css-select");return o[C.type](I,C,L,D);},L&&L.rootFunc||f);}function R(E,L){return L===p||E===f?E:E===p||L===f?L:function(I){return E(I)||L(I);};}function b(E){return E.some(M);}c.not=function(E,L,D,I){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,I);return W===p?E:W===f?p:function(K){return!W(K)&&E(K);};},c.has=function(E,L,D){var I=D.adapter,C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),adapter:I},W=L.some(b)?[d]:null,G=g(L,C,W);return G===p?p:G===f?function(J){return I.getChildren(J).some(I.isTag)&&E(J);}:(G=S(G,D),W?function(J){return E(J)&&(W[0]=J,I.existsOne(G,I.getChildren(J)));}:function(J){return E(J)&&I.existsOne(G,I.getChildren(J));});},c.matches=function(E,L,D,I){var C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),rootFunc:E,adapter:D.adapter};return g(L,C,I);},v.compileToken=g,v.compileUnsafe=O,v.Pseudos=s;},/* 275 */ /***/function(h,r,t){var e=this&&this.__createBinding||(Object.create?function(o,s,f,p){p===void 0&&(p=f),Object.defineProperty(o,p,{enumerable:!0,get:function get(){return s[f];}});}:function(o,s,f,p){p===void 0&&(p=f),o[p]=s[f];}),n=this&&this.__exportStar||function(o,s){for(var f in o)f!=="default"&&!s.hasOwnProperty(f)&&e(s,o,f);};Object.defineProperty(r,"__esModule",{value:!0}),n(t(276),r);var i=t(276);Object.defineProperty(r,"parse",{enumerable:!0,get:function get(){return i["default"];}});var a=t(277);Object.defineProperty(r,"stringify",{enumerable:!0,get:function get(){return a["default"];}});},/* 276 */ /***/function(h,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"},o={">":"child","<":"parent","~":"sibling","+":"adjacent"},s={"#":["id","equals"],".":["class","element"]},f=/* @__PURE__ */new Set(["has","not","matches"]),p=/* @__PURE__ */new Set(["contains","icontains"]),c=/* @__PURE__ */new Set(['"',"'"]);function v(l,d,u){var g=parseInt(d,16)-65536;return g!==g||u?d:g<0?// BMP codepoint
355
+ String.fromCharCode(g+65536):// Supplemental Plane codepoint (surrogate pair)
356
+ String.fromCharCode(g>>10|55296,g&1023|56320);}function S(l){return l.replace(n,v);}function O(l){return l===" "||l==="\n"||l===" "||l==="\f"||l==="\r";}function x(l,d){var u=[];if(l=m(u,""+l,d),l!=="")throw new Error("Unmatched selector: "+l);return u;}function m(l,d,u){var g=[],M=!1;function A(){var Q=d.match(e);if(!Q)throw new Error("Expected name, found "+d);var et=Q[0];return d=d.substr(et.length),S(et);}function R(Q){for(;O(d.charAt(Q));)Q++;d=d.substr(Q);}function b(Q){for(var et=0;d.charAt(--Q)==="\\";)et++;return(et&1)===1;}for(R(0);d!=="";){var E=d.charAt(0);if(O(E))M=!0,R(1);else if(E in o)g.push({type:o[E]}),M=!1,R(1);else if(E===","){if(g.length===0)throw new Error("Empty sub-selector");l.push(g),g=[],M=!1,R(1);}else if(M&&(g.length>0&&g.push({type:"descendant"}),M=!1),E==="*")d=d.substr(1),g.push({type:"universal"});else if(E in s){var L=s[E],D=L[0],I=L[1];d=d.substr(1),g.push({type:"attribute",name:D,action:I,value:A(),ignoreCase:!1});}else if(E==="["){d=d.substr(1);var C=d.match(i);if(!C)throw new Error("Malformed attribute selector: "+d);d=d.substr(C[0].length);var W=S(C[1]);(!u||("lowerCaseAttributeNames"in u?u.lowerCaseAttributeNames:!u.xmlMode))&&(W=W.toLowerCase()),g.push({type:"attribute",name:W,action:a[C[2]],value:S(C[4]||C[5]||""),ignoreCase:!!C[6]});}else if(E===":"){if(d.charAt(1)===":"){d=d.substr(2),g.push({type:"pseudo-element",name:A().toLowerCase()});continue;}d=d.substr(1);var G=A().toLowerCase(),C=null;if(d.charAt(0)==="(")if(f.has(G)){var K=d.charAt(1),J=c.has(K);if(d=d.substr(J?2:1),C=[],d=m(C,d,u),J){if(d.charAt(0)!==K)throw new Error("Unmatched quotes in :"+G);d=d.substr(1);}if(d.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+G+" ("+d+")");d=d.substr(1);}else{for(var Z=1,B=1;B>0&&Z<d.length;Z++)d.charAt(Z)==="("&&!b(Z)?B++:d.charAt(Z)===")"&&!b(Z)&&B--;if(B)throw new Error("Parenthesis not matched");if(C=d.substr(1,Z-2),d=d.substr(Z),p.has(G)){var K=C.charAt(0);K===C.slice(-1)&&c.has(K)&&(C=C.slice(1,-1)),C=S(C);}}g.push({type:"pseudo",name:G,data:C});}else if(e.test(d)){var $=A();(!u||("lowerCaseTags"in u?u.lowerCaseTags:!u.xmlMode))&&($=$.toLowerCase()),g.push({type:"tag",name:$});}else return g.length&&g[g.length-1].type==="descendant"&&g.pop(),T(l,g),d;}return T(l,g),d;}function T(l,d){if(l.length>0&&d.length===0)throw new Error("Empty sub-selector");l.push(d);}},/* 277 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"};function n(s){return s.map(i).join(", ");}r["default"]=n;function i(s){return s.map(a).join("");}function a(s){switch(s.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return"*";case"tag":return s.name;case"pseudo-element":return"::"+s.name;case"pseudo":return s.data===null?":"+s.name:typeof s.data=="string"?":"+s.name+"("+s.data+")":":"+s.name+"("+n(s.data)+")";case"attribute":return s.action==="exists"?"["+s.name+"]":s.name==="id"&&s.action==="equals"&&!s.ignoreCase?"#"+s.value:s.name==="class"&&s.action==="element"&&!s.ignoreCase?"."+s.value:"["+s.name+e[s.action]+"='"+s.value+"'"+(s.ignoreCase?"i":"")+"]";default:throw new Error("Unknown type");}}function o(s){return s;}},/* 278 */ /***/function(h,r,t){h.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(o){for(var s=o.map(a),f=1;f<o.length;f++){var p=s[f];if(!(p<0))for(var c=f-1;c>=0&&p<s[c];c--){var v=o[c+1];o[c+1]=o[c],o[c]=v,s[c+1]=s[c],s[c]=p;}}}function a(o){var s=e[o.type];if(s===e.attribute)s=n[o.action],s===n.equals&&o.name==="id"&&(s=9),o.ignoreCase&&(s>>=1);else if(s===e.pseudo)if(!o.data)s=3;else if(o.name==="has"||o.name==="contains")s=0;else if(o.name==="matches"||o.name==="not"){s=0;for(var f=0;f<o.data.length;f++)if(o.data[f].length===1){var p=a(o.data[f][0]);if(p===0){s=0;break;}p>s&&(s=p);}o.data.length>1&&s>0&&(s-=1);}else s=1;return s;}},/* 279 */ /***/function(h){h.exports=JSON.parse('{"universal":50,"tag":30,"attribute":1,"pseudo":0,"descendant":-1,"child":-1,"parent":-1,"sibling":-1,"adjacent":-1}');},/* 280 */ /***/function(h,r,t){var e=t(281),n=t(282);h.exports={__proto__:null,attribute:e.compile,pseudo:n.compile,//tags
357
+ tag:function tag(i,a,o){var s=a.name,f=o.adapter;return function(c){return f.getName(c)===s&&i(c);};},//traversal
358
+ descendant:function descendant(i,a,o){var s=(typeof WeakSet==="undefined"?"undefined":_typeof(WeakSet))<"u"?/* @__PURE__ */new WeakSet():null,f=o.adapter;return function(c){for(var v=!1;!v&&(c=f.getParent(c));)(!s||!s.has(c))&&(v=i(c),!v&&s&&s.add(c));return v;};},_flexibleDescendant:function _flexibleDescendant(i,a,o){var s=o.adapter;return function(p){for(var c=i(p);!c&&(p=s.getParent(p));)c=i(p);return c;};},parent:function parent(i,a,o){if(o&&o.strict)throw new Error("Parent selector isn't part of CSS3");var s=o.adapter;return function(c){return s.getChildren(c).some(f);};function f(p){return s.isTag(p)&&i(p);}},child:function child(i,a,o){var s=o.adapter;return function(p){var c=s.getParent(p);return!!c&&i(c);};},sibling:function sibling(i,a,o){var s=o.adapter;return function(p){for(var c=s.getSiblings(p),v=0;v<c.length;v++)if(s.isTag(c[v])){if(c[v]===p)break;if(i(c[v]))return!0;}return!1;};},adjacent:function adjacent(i,a,o){var s=o.adapter;return function(p){for(var c=s.getSiblings(p),v,S=0;S<c.length;S++)if(s.isTag(c[S])){if(c[S]===p)break;v=c[S];}return!!v&&i(v);};},universal:function universal(i){return i;}};},/* 281 */ /***/function(h,r,t){var e=t(273).falseFunc,n=/[-[\]{}()*+?.,\\^$|#\s]/g,i={__proto__:null,equals:function equals(a,o,s){var f=o.name,p=o.value,c=s.adapter;return o.ignoreCase?(p=p.toLowerCase(),function(S){var O=c.getAttributeValue(S,f);return O!=null&&O.toLowerCase()===p&&a(S);}):function(S){return c.getAttributeValue(S,f)===p&&a(S);};},hyphen:function hyphen(a,o,s){var f=o.name,p=o.value,c=p.length,v=s.adapter;return o.ignoreCase?(p=p.toLowerCase(),function(O){var x=v.getAttributeValue(O,f);return x!=null&&(x.length===c||x.charAt(c)==="-")&&x.substr(0,c).toLowerCase()===p&&a(O);}):function(O){var x=v.getAttributeValue(O,f);return x!=null&&x.substr(0,c)===p&&(x.length===c||x.charAt(c)==="-")&&a(O);};},element:function element(a,o,s){var f=o.name,p=o.value,c=s.adapter;if(/\s/.test(p))return e;p=p.replace(n,"\\$&");var v="(?:^|\\s)"+p+"(?:$|\\s)",S=o.ignoreCase?"i":"",O=new RegExp(v,S);return function(m){var T=c.getAttributeValue(m,f);return T!=null&&O.test(T)&&a(m);};},exists:function exists(a,o,s){var f=o.name,p=s.adapter;return function(v){return p.hasAttrib(v,f)&&a(v);};},start:function start(a,o,s){var f=o.name,p=o.value,c=p.length,v=s.adapter;return c===0?e:o.ignoreCase?(p=p.toLowerCase(),function(O){var x=v.getAttributeValue(O,f);return x!=null&&x.substr(0,c).toLowerCase()===p&&a(O);}):function(O){var x=v.getAttributeValue(O,f);return x!=null&&x.substr(0,c)===p&&a(O);};},end:function end(a,o,s){var f=o.name,p=o.value,c=-p.length,v=s.adapter;return c===0?e:o.ignoreCase?(p=p.toLowerCase(),function(O){var x=v.getAttributeValue(O,f);return x!=null&&x.substr(c).toLowerCase()===p&&a(O);}):function(O){var x=v.getAttributeValue(O,f);return x!=null&&x.substr(c)===p&&a(O);};},any:function any(a,o,s){var f=o.name,p=o.value,c=s.adapter;if(p==="")return e;if(o.ignoreCase){var v=new RegExp(p.replace(n,"\\$&"),"i");return function(O){var x=c.getAttributeValue(O,f);return x!=null&&v.test(x)&&a(O);};}return function(O){var x=c.getAttributeValue(O,f);return x!=null&&x.indexOf(p)>=0&&a(O);};},not:function not(a,o,s){var f=o.name,p=o.value,c=s.adapter;return p===""?function(S){return!!c.getAttributeValue(S,f)&&a(S);}:o.ignoreCase?(p=p.toLowerCase(),function(S){var O=c.getAttributeValue(S,f);return O!=null&&O.toLowerCase()!==p&&a(S);}):function(S){return c.getAttributeValue(S,f)!==p&&a(S);};}};h.exports={compile:function compile(a,o,s){if(s&&s.strict&&(o.ignoreCase||o.action==="not"))throw new Error("Unsupported attribute selector");return i[o.action](a,o,s);},rules:i};},/* 282 */ /***/function(h,r,t){var e=t(283),n=t(273),i=t(281),a=n.trueFunc,o=n.falseFunc,s=i.rules.equals;function f(T,l){var d={name:T,value:l};return function(g,M,A){return s(g,d,A);};}function p(T,l){return function(d){return!!l.getParent(d)&&T(d);};}var c={contains:function contains(T,l,d){var u=d.adapter;return function(M){return T(M)&&u.getText(M).indexOf(l)>=0;};},icontains:function icontains(T,l,d){var u=l.toLowerCase(),g=d.adapter;return function(A){return T(A)&&g.getText(A).toLowerCase().indexOf(u)>=0;};},//location specific methods
359
+ "nth-child":function nthChild(T,l,d){var u=e(l),g=d.adapter;return u===o?u:u===a?p(T,g):function(A){for(var R=g.getSiblings(A),b=0,E=0;b<R.length;b++)if(g.isTag(R[b])){if(R[b]===A)break;E++;}return u(E)&&T(A);};},"nth-last-child":function nthLastChild(T,l,d){var u=e(l),g=d.adapter;return u===o?u:u===a?p(T,g):function(A){for(var R=g.getSiblings(A),b=0,E=R.length-1;E>=0;E--)if(g.isTag(R[E])){if(R[E]===A)break;b++;}return u(b)&&T(A);};},"nth-of-type":function nthOfType(T,l,d){var u=e(l),g=d.adapter;return u===o?u:u===a?p(T,g):function(A){for(var R=g.getSiblings(A),b=0,E=0;E<R.length;E++)if(g.isTag(R[E])){if(R[E]===A)break;g.getName(R[E])===g.getName(A)&&b++;}return u(b)&&T(A);};},"nth-last-of-type":function nthLastOfType(T,l,d){var u=e(l),g=d.adapter;return u===o?u:u===a?p(T,g):function(A){for(var R=g.getSiblings(A),b=0,E=R.length-1;E>=0;E--)if(g.isTag(R[E])){if(R[E]===A)break;g.getName(R[E])===g.getName(A)&&b++;}return u(b)&&T(A);};},//TODO determine the actual root element
360
+ root:function root(T,l,d){var u=d.adapter;return function(g){return!u.getParent(g)&&T(g);};},scope:function scope(T,l,d,u){var g=d.adapter;if(!u||u.length===0)return c.root(T,l,d);function M(A,R){return typeof g.equals=="function"?g.equals(A,R):A===R;}return u.length===1?function(A){return M(u[0],A)&&T(A);}:function(A){return u.indexOf(A)>=0&&T(A);};},//jQuery extensions (others follow as pseudos)
361
+ 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"),//dynamic state pseudos. These depend on optional Adapter methods.
362
+ hover:function hover(T,l,d){var u=d.adapter;return typeof u.isHovered=="function"?function(M){return T(M)&&u.isHovered(M);}:o;},visited:function visited(T,l,d){var u=d.adapter;return typeof u.isVisited=="function"?function(M){return T(M)&&u.isVisited(M);}:o;},active:function active(T,l,d){var u=d.adapter;return typeof u.isActive=="function"?function(M){return T(M)&&u.isActive(M);}:o;}};function v(T,l){for(var d=0;T&&d<T.length;d++)if(l.isTag(T[d]))return T[d];}var S={empty:function empty(T,l){return!l.getChildren(T).some(function(d){return l.isTag(d)||d.type==="text";});},"first-child":function firstChild(T,l){return v(l.getSiblings(T),l)===T;},"last-child":function lastChild(T,l){for(var d=l.getSiblings(T),u=d.length-1;u>=0;u--){if(d[u]===T)return!0;if(l.isTag(d[u]))break;}return!1;},"first-of-type":function firstOfType(T,l){for(var d=l.getSiblings(T),u=0;u<d.length;u++)if(l.isTag(d[u])){if(d[u]===T)return!0;if(l.getName(d[u])===l.getName(T))break;}return!1;},"last-of-type":function lastOfType(T,l){for(var d=l.getSiblings(T),u=d.length-1;u>=0;u--)if(l.isTag(d[u])){if(d[u]===T)return!0;if(l.getName(d[u])===l.getName(T))break;}return!1;},"only-of-type":function onlyOfType(T,l){for(var d=l.getSiblings(T),u=0,g=d.length;u<g;u++)if(l.isTag(d[u])){if(d[u]===T)continue;if(l.getName(d[u])===l.getName(T))return!1;}return!0;},"only-child":function onlyChild(T,l){for(var d=l.getSiblings(T),u=0;u<d.length;u++)if(l.isTag(d[u])&&d[u]!==T)return!1;return!0;},//:matches(a, area, link)[href]
363
+ link:function link(T,l){return l.hasAttrib(T,"href");},//TODO: :any-link once the name is finalized (as an alias of :link)
364
+ //forms
365
+ //to consider: :target
366
+ //:matches([selected], select:not([multiple]):not(> option[selected]) > option:first-of-type)
367
+ selected:function selected(T,l){if(l.hasAttrib(T,"selected"))return!0;if(l.getName(T)!=="option")return!1;var d=l.getParent(T);if(!d||l.getName(d)!=="select"||l.hasAttrib(d,"multiple"))return!1;for(var u=l.getChildren(d),g=!1,M=0;M<u.length;M++)if(l.isTag(u[M]))if(u[M]===T)g=!0;else if(g){if(l.hasAttrib(u[M],"selected"))return!1;}else return!1;return g;},//https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
368
+ //:matches(
369
+ // :matches(button, input, select, textarea, menuitem, optgroup, option)[disabled],
370
+ // optgroup[disabled] > option),
371
+ // fieldset[disabled] * //TODO not child of first <legend>
372
+ //)
373
+ disabled:function disabled(T,l){return l.hasAttrib(T,"disabled");},enabled:function enabled(T,l){return!l.hasAttrib(T,"disabled");},//:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem)
374
+ checked:function checked(T,l){return l.hasAttrib(T,"checked")||S.selected(T,l);},//:matches(input, select, textarea)[required]
375
+ required:function required(T,l){return l.hasAttrib(T,"required");},//:matches(input, select, textarea):not([required])
376
+ optional:function optional(T,l){return!l.hasAttrib(T,"required");},//jQuery extensions
377
+ //:not(:empty)
378
+ parent:function parent(T,l){return!S.empty(T,l);},//:matches(h1, h2, h3, h4, h5, h6)
379
+ header:O(["h1","h2","h3","h4","h5","h6"]),//:matches(button, input[type=button])
380
+ button:function button(T,l){var d=l.getName(T);return d==="button"||d==="input"&&l.getAttributeValue(T,"type")==="button";},//:matches(input, textarea, select, button)
381
+ input:O(["input","textarea","select","button"]),//input:matches(:not([type!='']), [type='text' i])
382
+ text:function text(T,l){var d;return l.getName(T)==="input"&&(!(d=l.getAttributeValue(T,"type"))||d.toLowerCase()==="text");}};function O(T){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var l=new Set(T);return function(d,u){return l.has(u.getName(d));};}return function(d,u){return T.indexOf(u.getName(d))>=0;};}function x(T,l,d){if(d===null){if(T.length>2&&l!=="scope")throw new Error("pseudo-selector :"+l+" requires an argument");}else if(T.length===2)throw new Error("pseudo-selector :"+l+" doesn't have any arguments");}var m=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;h.exports={compile:function compile(T,l,d,u){var g=l.name,M=l.data,A=d.adapter;if(d&&d.strict&&!m.test(g))throw new Error(":"+g+" isn't part of CSS3");if(typeof c[g]=="function")return c[g](T,M,d,u);if(typeof S[g]=="function"){var R=S[g];return x(R,g,M),R===o?R:T===a?function(E){return R(E,A,M);}:function(E){return R(E,A,M)&&T(E);};}else throw new Error("unmatched pseudo-class :"+g);},filters:c,pseudos:S};},/* 283 */ /***/function(h,r,t){var e=t(284),n=t(285);h.exports=function(a){return n(e(a));},h.exports.parse=e,h.exports.compile=n;},/* 284 */ /***/function(h,r){h.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];}},/* 285 */ /***/function(h,r,t){h.exports=a;var e=t(273),n=e.trueFunc,i=e.falseFunc;function a(o){var s=o[0],f=o[1]-1;if(f<0&&s<=0)return i;if(s===-1)return function(c){return c<=f;};if(s===0)return function(c){return c===f;};if(s===1)return f<0?n:function(c){return c>=f;};var p=f%s;return p<0&&(p+=s),s>1?function(c){return c>=f&&c%s===p;}:(s*=-1,function(c){return c<=f&&c%s===p;});}},/* 286 */ /***/function(h,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),o=t(250),s=t(213),f=t(218);t(1).glMatrix.setMatrixArrayType(Array);function p(A,R){if(A==null)return{};var b=c(A,R),E,L;if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(A);for(L=0;L<D.length;L++)E=D[L],!(R.indexOf(E)>=0)&&Object.prototype.propertyIsEnumerable.call(A,E)&&(b[E]=A[E]);}return b;}function c(A,R){if(A==null)return{};var b={},E=Object.keys(A),L,D;for(D=0;D<E.length;D++)L=E[D],!(R.indexOf(L)>=0)&&(b[L]=A[L]);return b;}var v={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
383
+ },S=Symbol("autoRender"),O=Symbol("renderer"),x=Symbol("timeline"),m=Symbol("prepareRender"),T=Symbol("tickRender"),l=Symbol("pass"),d=Symbol("fbo"),u=Symbol("tickers"),g=Symbol("layerTransformInvert");var M=/*#__PURE__*/function(_o$default){function M(){var _this38;var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this38=_callSuper(this,M),!R.canvas){var _this38$getResolution=_this38.getResolution(),D=_this38$getResolution.width,I=_this38$getResolution.height,C=e.ENV.createCanvas(D,I,{offscreen:!!R.offscreen,id:R.id,extra:R.extra});C.style&&(C.style.position="absolute"),C.dataset&&(C.dataset.layerId=R.id),C.contextType&&(R.contextType=C.contextType),R.canvas=C;}var b=R.canvas,E=Object.assign({},v,R);_this38[S]=E.autoRender,delete R.autoRender;var L=E.Renderer||e.Renderer;_this38[O]=new L(b,E),_this38.options=R,_this38.id=R.id,_this38[l]=[],_this38.setResolution(b),_this38.canvas=b,_this38[x]=new n.Timeline(),_this38.__mouseCapturedTarget=null,_this38[g]=null;return _assertThisInitialized(_this38);}_inherits(M,_o$default);return _createClass(M,[{key:"autoRender",get:function get(){return this[S];}},{key:"displayRatio",get:function get(){return this.parent&&this.parent.options?this.parent.options.displayRatio:1;}},{key:"height",get:function get(){var _this$getResolution=this.getResolution(),R=_this$getResolution.height;return R/this.displayRatio;}},{key:"gl",get:function get(){return this.renderer.glRenderer?this.renderer.glRenderer.gl:null;}/* override */},{key:"layer",get:function get(){return this;}},{key:"offscreen",get:function get(){return!!this.options.offscreen||this.canvas._offscreen;}},{key:"pass",get:function get(){return this[l];}},{key:"prepareRender",get:function get(){return this[m]?this[m]:Promise.resolve();}/* override */},{key:"renderer",get:function get(){return this[O];}},{key:"renderOffset",get:function get(){if(this.parent&&this.parent.options){var _this$parent$options=this.parent.options,R=_this$parent$options.left,b=_this$parent$options.top;return[R,b];}return[this.options.left|0,this.options.top|0];}},{key:"timeline",get:function get(){return this[x];}},{key:"width",get:function get(){var _this$getResolution2=this.getResolution(),R=_this$getResolution2.width;return R/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes21=this.attributes,R=_this$attributes21.x,b=_this$attributes21.y;return[1,0,0,1,R,b];}},{key:"layerTransformInvert",get:function get(){if(this[g])return this[g];var R=this.transformMatrix;return R[0]===1&&R[1]===0&&R[2]===0&&R[3]===1&&R[4]===0&&R[5]===0?null:(this[g]=i.mat2d.invert(Array.of(0,0,0,0,0,0),R),this[g]);}},{key:"forceContextLoss",value:function forceContextLoss(){var R=this.renderer.glRenderer;if(R){var b=R.getExtension("WEBGL_lose_context");if(b)return b.loseContext(),!0;}return!1;}// isPointCollision(x, y) {
384
+ // return true;
385
+ // }
386
+ },{key:"addPass",value:function addPass(){var _ref151=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},R=_ref151.vertex,b=_ref151.fragment,E=_ref151.options,L=_ref151.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),D=_this$getResolution3.width,I=_this$getResolution3.height,C=this.renderer.createPassProgram({vertex:R,fragment:b,options:E}),W=new e.Figure2D();W.rect(0,0,D/this.displayRatio,I/this.displayRatio);var G=new e.Mesh2D(W);return G.setUniforms(L),G.setProgram(C),this[l].push(G),this.forceUpdate(),G;}return null;}// delete unused texture to release memory.
387
+ },{key:"deleteTexture",value:function deleteTexture(R){return Object(f.deleteTexture)(R,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(R){var b=R.type;if(b==="mousedown"||b==="mouseup"||b==="mousemove"){var C=this.__mouseCapturedTarget;if(C){if(C.layer===this)return C.dispatchEvent(R),!0;this.__mouseCapturedTarget=null;}}var E,L;var D=this.layerTransformInvert;if(D){E=R.x,L=R.y;var _C6=D,W=_C6[0]*E+_C6[2]*L+_C6[4],G=_C6[1]*E+_C6[3]*L+_C6[5];delete R.x,delete R.y,delete R.layerX,delete R.layerY,Object.defineProperties(R,{layerX:{value:W,configurable:!0},layerY:{value:G,configurable:!0},x:{value:W,configurable:!0},y:{value:G,configurable:!0}});}var I=_get(_getPrototypeOf(M.prototype),"dispatchPointerEvent",this).call(this,R);return D&&Object.defineProperties(R,{layerX:{value:E,configurable:!0},layerY:{value:L,configurable:!0},x:{value:E,configurable:!0},y:{value:L,configurable:!0}}),I;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this39=this;if(!this[m])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();var R=null;var b=new Promise(function(E){R=E;});b._resolve=R,this[m]=b;}else{var _R2=null,_b8=null;var E=new Promise(function(L){_R2=L,_this39[S]&&(_b8=Object(a.requestAnimationFrame)(function(){delete E._requestID,_this39.render();}));});E._resolve=_R2,E._requestID=_b8,this[m]=E;}}},{key:"getFBO",value:function getFBO(){var R=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),b=_this$getResolution4.width,E=_this$getResolution4.height;return R&&(!this[d]||this[d].width!==b||this[d].height!==E)?(this[d]={width:b,height:E,target:R.createFBO(),buffer:R.createFBO(),swap:function swap(){var _ref152=[this.buffer,this.target];this.target=_ref152[0];this.buffer=_ref152[1];}},this[d]):this[d]?this[d]:null;}},{key:"updateGlobalTransform",value:function updateGlobalTransform(){if(this.layerTransformInvert){var R=this.renderer,b=R.__globalTransformMatrix||R.globalTransformMatrix;R.__globalTransformMatrix=b;var E=i.mat2d.fromValues(1,0,0,1,0,0);R.setGlobalTransform.apply(R,_toConsumableArray(i.mat2d.multiply(E,b,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(R,b,E){if(_get(_getPrototypeOf(M.prototype),"onPropertyChange",this).call(this,R,b,E),R==="zIndex"&&(this.canvas.style.zIndex=b),R==="transform"||R==="translate"||R==="rotate"||R==="scale"||R==="skew"){var L=this[g];if(this[g]=null,this.updateGlobalTransform(),L&&!this.layerTransformInvert){var D=this.renderer,I=D.__globalTransformMatrix||D.globalTransformMatrix;D.setGlobalTransform.apply(D,_toConsumableArray(I));}}}},{key:"_prepareRenderFinished",value:function _prepareRenderFinished(){this[m]&&(this[m]._requestID&&Object(a.cancelAnimationFrame)(this[m]._requestID),this[m]._resolve(),delete this[m]);}},{key:"render",value:function render(){var _this40=this;var _ref153=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref153$clear=_ref153.clear,R=_ref153$clear===void 0?!0:_ref153$clear;var b=this[l].length?this.getFBO():null;b&&this.renderer.glRenderer.bindFBO(b.target),R&&this[O].clear();var E=this.draw();if(E&&E.length&&(this.renderer.drawMeshes(E),this.canvas.draw&&this.canvas.draw()),b){var L=this.renderer.glRenderer,D=this[l].length,_this$getResolution5=this.getResolution(),I=_this$getResolution5.width,C=_this$getResolution5.height,W=[0,0,I/this.displayRatio,C/this.displayRatio];this[l].forEach(function(G,K){G.blend=!0,G.setTexture(b.target.texture,{rect:W}),K===D-1?L.bindFBO(null):(b.swap(),L.bindFBO(b.target)),_this40[O].clear(),_this40.renderer.drawMeshes([G]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref154){var _this41=this;var R=_ref154.width,b=_ref154.height;var E=this.renderer,L=E.__globalTransformMatrix||E.globalTransformMatrix,D=L[4],I=L[5],C=L[0],_this$getResolution6=this.getResolution(),W=_this$getResolution6.width,G=_this$getResolution6.height;(W!==R||G!==b)&&(_get(_getPrototypeOf(M.prototype),"setResolution",this).call(this,{width:R,height:b}),this.canvas&&(this.canvas.width=R,this.canvas.height=b,E.updateResolution&&E.updateResolution()),this.attributes.size=[R,b],this[l].length&&this[l].forEach(function(B){var $=new e.Figure2D();$.rect(0,0,R/_this41.displayRatio,b/_this41.displayRatio),B.contours=$.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),K=_this$renderOffset[0],J=_this$renderOffset[1],Z=this.displayRatio;(D!==K||I!==J||C!==Z)&&(E.setGlobalTransform(Z,0,0,Z,K,J),E.__globalTransformMatrix=null,this[g]=null,this.updateGlobalTransform(),this.forceUpdate());}/**
388
+ * tick(handler, {originTime = 0, playbackRate = 1.0, duration = Infinity})
389
+ * @param {*} handler
390
+ * @param {*} options
391
+ */},{key:"tick",value:function tick(){var _this42=this;var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _b$duration=b.duration,E=_b$duration===void 0?1/0:_b$duration,L=p(b,["duration"]);var D=this.timeline.fork(L),I=this;this[u]=this[u]||[],this[u].push({handler:R,duration:E});var C=function C(){var W=null,G=null;var K=function K(){var J=_this42[u].map(function(_ref155){var Z=_ref155.handler,B=_ref155.duration;var $=Math.min(1,D.currentTime/B);return{value:Z?Z(D.currentTime,$):null,p:$};});I[T]||(I[T]=Promise.resolve().then(function(){I[S]&&I.render(),delete I[T];for(var Z=J.length-1;Z>=0;Z--){var _J$Z=J[Z],B=_J$Z.value,$=_J$Z.p;(B===!1||$>=1)&&_this42[u].splice(Z,1);}_this42[u].length>0&&C();}));};if(_this42[m]&&_this42[m]._type!=="ticker"&&(Object(a.cancelAnimationFrame)(_this42[m]._requestID),delete _this42[m]),!_this42[m]){var J=new Promise(function(Z){W=Z,G=Object(a.requestAnimationFrame)(K);});J._resolve=W,J._requestID=G,J._type="ticker",_this42[m]=J;}};C();}},{key:"toGlobalPos",value:function toGlobalPos(R,b){if(this.layerTransformInvert){var W=this.transformMatrix;R=W[0]*R+W[2]*b+W[4],b=W[1]*R+W[3]*b+W[5];}var _this$getResolution7=this.getResolution(),E=_this$getResolution7.width,L=_this$getResolution7.height,D=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];R=R*I[0]/E+D[0],b=b*I[1]/L+D[1];var C=this.displayRatio;return R*=C,b*=C,[R,b];}},{key:"toLocalPos",value:function toLocalPos(R,b){var _this$getResolution8=this.getResolution(),E=_this$getResolution8.width,L=_this$getResolution8.height,D=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];R=R*E/I[0]-D[0],b=b*L/I[1]-D[1];var C=this.displayRatio;R/=C,b/=C;var W=this.layerTransformInvert;return W&&(R=W[0]*R+W[2]*b+W[4],b=W[1]*R+W[3]*b+W[5]),[R,b];}}]);}(o["default"]);s["default"].registerNode(M,"layer");},/* 287 */ /***/function(h,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),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function s(T,l){if(T==null)return{};var d=f(T,l),u,g;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);for(g=0;g<M.length;g++)u=M[g],!(l.indexOf(u)>=0)&&Object.prototype.propertyIsEnumerable.call(T,u)&&(d[u]=T[u]);}return d;}function f(T,l){if(T==null)return{};var d={},u=Object.keys(T),g,M;for(M=0;M<u.length;M++)g=u[M],!(l.indexOf(g)>=0)&&(d[g]=T[g]);return d;}function p(T,l,d){return l in T?Object.defineProperty(T,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):T[l]=d,T;}var c="http://www.w3.org/2000/svg",v=Symbol["for"]("spritejs_setAttribute"),S=Symbol("root"),O=Symbol("task");function x(T){var l=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var d=T[S];if(d&&d.children[0]){var u=T.svg,g=T.layer?T.layer.displayRatio:1;if(!u.hasAttribute("data-original-width")){var R=u.getAttribute("width");R=R?Object(o.sizeToPixel)(R):300;var b=u.getAttribute("height");b=b?Object(o.sizeToPixel)(b):150,u.hasAttribute("viewBox")||u.setAttribute("viewBox","0 0 ".concat(Math.round(R)," ").concat(Math.round(b))),u.setAttribute("data-original-width",R),u.setAttribute("data-original-height",b);}var 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,l&&T.attributes.flexible){var _R3=T.attributes.scale[0];if(M*=_R3,A*=_R3,u.setAttribute("width",M),u.setAttribute("height",A),M&&A&&T.textureImage){var _b9=T.textureImage.width,E=T.textureImage.height,L=T.clientSize;T.attributes.textureRect=[0,0,Math.round(L[0]*_b9/M),Math.round(L[1]*E/A)];}}else T[O]||(u.setAttribute("width",M),u.setAttribute("height",A),T[O]=Promise.resolve().then(function(){delete T[O];var R=d.innerHTML,b=new Blob([R],{type:"image/svg+xml"}),E=URL.createObjectURL(b),L=new Image();L.onload=function(){L.width&&L.height?(T.attributes[v]("texture",L),T.attributes.flexible&&(T.attributes.textureRect=null)):T.attributes[v]("texture",null);},L.src=E;}));}}var m=/*#__PURE__*/function(_e$default21){function m(){var _this43;var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,m);typeof l=="string"&&(l={svgText:l});var _l27=l,d=_l27.svgText,u=s(l,["svgText"]);if(_this43=_callSuper(this,m,[u]),_this43[S]=document.createElement("div"),d){_this43[S].innerHTML=d;var g=_this43[S].children[0];g?g.setAttribute("xmlns",c):(fetch(d).then(function(M){return M.text();}).then(function(M){_this43[S].innerHTML=M,(!_this43.observer||_this43.attributes.flexible)&&x(_assertThisInitialized(_this43));}),d=null);}if(!d){var _g7=document.createElementNS(c,"svg");_g7.setAttribute("xmlns",c),_this43[S].appendChild(_g7);}if(typeof MutationObserver=="function"){var _g8=new MutationObserver(function(M){x(_assertThisInitialized(_this43),!1);});_g8.observe(_this43[S],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this43.observer=_g8;}return _assertThisInitialized(_this43);}_inherits(m,_e$default21);return _createClass(m,[{key:"children",get:function get(){return[this.svg];}},{key:"childNodes",get:function get(){return[this.svg];}},{key:"svg",get:function get(){return this[S]?this[S].children[0]:null;}/* override */},{key:"setResolution",value:function setResolution(_ref156){var l=_ref156.width,d=_ref156.height;_get(_getPrototypeOf(m.prototype),"setResolution",this).call(this,{width:l,height:d}),x(this);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(l){var d=_get(_getPrototypeOf(m.prototype),"dispatchPointerEvent",this).call(this,l);if(d&&this.attributes.passEvents&&typeof MouseEvent=="function"){var u=l.x,g=l.y;var _this$getOffsetPositi=this.getOffsetPosition(u,g),_this$getOffsetPositi2=_slicedToArray(_this$getOffsetPositi,2),M=_this$getOffsetPositi2[0],A=_this$getOffsetPositi2[1];var R=l.originalEvent,b=this.attributes.anchor,E=this.clientSize;M=(M+b[0]*E[0])/2,A=(A+b[1]*E[1])/2;var L=l.type;if(L===R.type){var D=null;if(R instanceof MouseEvent)D=new MouseEvent(L,{screenX:M,screenY:A,clientX:M,clientY:A,bubbles:R.bubbles,button:R.button,buttons:R.buttons,cancelBubble:R.cancelBubble,cancelable:R.cancelable,currentTarget:R.currentTarget,fromElement:R.fromElement,relatedTarget:R.relatedTarget,returnValue:R.returnValue,srcElement:R.srcElement,target:R.target,toElement:R.toElement,// view: originalEvent.view,
392
+ which:R.witch});else if(R instanceof TouchEvent){var I=null;var C=R.changedTouches||[R];for(var W=0;W<C.length;W++){var G=C[W];if(l.identifier===G.identifier){I=G;break;}}if(I){var _W3=new Touch({identifier:I.identifier,target:I.target,clientX:M,clientY:A,screenX:M,screenY:A,pageX:M,pageY:A,radiusX:I.radiusX,radiusY:I.radiusY,rotationAngle:I.rotationAngle,force:I.force});D=new TouchEvent(L,{cancelable:R.cancelable,bubbles:R.bubbles,composed:R.composed,touches:[_W3],targetTouches:[_W3],changedTouches:[_W3]});}}else D=R;D&&this.svg.dispatchEvent(D);}}return d;}},{key:"getElementById",value:function getElementById(l){return Object(a.querySelector)("#".concat(l),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(l){return Object(a.querySelectorAll)(".".concat(l),this);}},{key:"getElementsByName",value:function getElementsByName(l){return Object(a.querySelectorAll)("[name=\"".concat(l,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(l){return Object(a.querySelectorAll)(l,this);}},{key:"querySelector",value:function querySelector(l){return Object(a.querySelector)(l,this);}},{key:"querySelectorAll",value:function querySelectorAll(l){return Object(a.querySelectorAll)(l,this);}/* override */},{key:"onPropertyChange",value:function onPropertyChange(l,d,u){_get(_getPrototypeOf(m.prototype),"onPropertyChange",this).call(this,l,d,u),l==="flexible"&&x(this),this.attributes.flexible&&(l==="width"||l==="height"||l==="scale"||l==="transform")&&x(this);}}]);}(e["default"]);p(m,"Attr",n["default"]),i["default"].registerNode(m,"spritesvg");},/* 288 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(225);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_getAttribute"),i=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_setAttributeDefault");var o=/*#__PURE__*/function(_e$default22){function o(f){var _this44;_classCallCheck(this,o);_this44=_callSuper(this,o,[f]),_this44[a]({passEvents:!1,flexible:!1});return _this44;}// readonly
393
+ _inherits(o,_e$default22);return _createClass(o,[{key:"texture",get:function get(){return this[n]("texture");},set:function set(f){}// eslint-disable-line no-empty-function
394
+ },{key:"passEvents",get:function get(){return this[n]("passEvents");},set:function set(f){return this[i]("passEvents",f);}},{key:"flexible",get:function get(){return this[n]("flexible");},set:function set(f){return this[i]("flexible",f);}}]);}(e["default"]);},/* 289 */ /***/function(h,r,t){t.r(r);var e=t(12);t(1).glMatrix.setMatrixArrayType(Array);function n(f,p){var c=Object.keys(f);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(f);p&&(v=v.filter(function(S){return Object.getOwnPropertyDescriptor(f,S).enumerable;})),c.push.apply(c,v);}return c;}function i(f){for(var p=1;p<arguments.length;p++){var c=arguments[p]!=null?arguments[p]:{};p%2?n(Object(c),!0).forEach(function(v){a(f,v,c[v]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(c)):n(Object(c)).forEach(function(v){Object.defineProperty(f,v,Object.getOwnPropertyDescriptor(c,v));});}return f;}function a(f,p,c){return p in f?Object.defineProperty(f,p,{value:c,enumerable:!0,configurable:!0,writable:!0}):f[p]=c,f;}var o=Symbol("inited");var s=null;typeof Worker=="function"&&(s=/*#__PURE__*/function(_Worker){function s(f){var _this45;_classCallCheck(this,s);if(f.worker===!0&&(f.worker="./".concat(f.id,".worker.js")),_this45=_callSuper(this,s,[f.worker]),_this45.options=f,!f.canvas){var _this45$getResolution=_this45.getResolution(),p=_this45$getResolution.width,c=_this45$getResolution.height,v=e.ENV.createCanvas(p,c,{offscreen:!1});v.style&&(v.style.position="absolute"),v.dataset&&(v.dataset.layerId=f.id),f.canvas=v;}_this45.canvas=f.canvas;return _assertThisInitialized(_this45);}_inherits(s,_Worker);return _createClass(s,[{key:"id",get:function get(){return this.options.id;}},{key:"setResolution",value:function setResolution(_ref157){var f=_ref157.width,p=_ref157.height;if(this[o])this.postMessage({type:"resolution_change",width:f,height:p});else{this.canvas.width=f,this.canvas.height=p;var c=this.options,v=c.canvas.transferControlToOffscreen(),S=i({},c);delete S.container,S.canvas=v,this.postMessage({type:"create",options:S},[v]),this[o]=!0;}}},{key:"getResolution",value:function getResolution(){if(this.canvas){var _this$canvas6=this.canvas,f=_this$canvas6.width,p=_this$canvas6.height;return{width:f,height:p};}return{width:300,height:150};}},{key:"remove",value:function remove(){return this.parent&&this.parent.removeChild?(this.parent.removeChild(this),!0):!1;}},{key:"connect",value:function connect(f,p){Object.defineProperty(this,"parent",{value:f,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:p,writable:!1,configurable:!0});}},{key:"disconnect",value:function disconnect(){delete this.parent,delete this.zOrder;}},{key:"dispatchPointerEvent",value:function 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}});}}]);}(/*#__PURE__*/_wrapNativeSuper(Worker))),r["default"]=s;},/* 290 */ /***/function(h,r,t){t.r(r),function(e){t.d(r,"default",function(){return M;});var n=t(12),i=t(68),a=t(70),o=t(286),s=t(289),f=t(250),p=t(291),c=t(214),v=t(218),S=t(213);t(1).glMatrix.setMatrixArrayType(Array);var O=Symbol("enteredTargets");function x(A){return A.id=A.id||"_layer".concat(Math.random().toString(36).slice(2,12)),A.dataset||(A.dataset={}),A.dataset.layerId=A.id,A.connect=function(R,b){A.parent=R,Object.defineProperty(A,"zOrder",{value:b,writable:!1,configurable:!0});},A.disconnect=function(R){delete A.zOrder;},A.canvas=A,A.getResolution=function(){return{width:0,height:0};},A.setResolution=function(){return!1;},A.options={handleEvent:!1},A;}function m(A,R){var b=A.children;var E=null;for(var L=0;L<b.length;L++){var D=b[L];if((R===D||E!=null)&&(E=D),E&&E!==R&&!E.offscreen)return E.canvas;}return null;}function T(A,R){var _A$renderOffset=_slicedToArray(A.renderOffset,2),b=_A$renderOffset[0],E=_A$renderOffset[1],_A$getResolution=A.getResolution(),L=_A$getResolution.width,D=_A$getResolution.height,I=A.displayRatio;A.renderer.drawImage(R.canvas,-b/I,-E/I,L/I,D/I);}var l={};function d(A){var R=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],b=A.container;b.addEventListener("mouseleave",function(E){var L=A[O];if(L.size){var D=new c["default"]("mouseleave");D.setOriginalEvent(E),_toConsumableArray(L).forEach(function(I){I.dispatchEvent(D);}),A[O].clear();}},{passive:!0}),R.forEach(function(E){b.addEventListener(E,function(L){var _A$options=A.options,D=_A$options.left,I=_A$options.top,C=_A$options.displayRatio,W=A.orderedChildren;Object(p["default"])(L,{offsetLeft:D,offsetTop:I,displayRatio:C}).forEach(function(K){var J=K.identifier;if(K.type==="touchmove"||K.type==="touchend"){var B=l[J];B&&B.dispatchEvent(K),K.type==="touchend"&&delete l[J];}else{for(var _B=W.length-1;_B>=0;_B--){var $=W[_B];if($.options.handleEvent!==!1){if($.dispatchPointerEvent(K)&&K.target!==$)break;K.cancelBubble=!1;}}if(K.target===W[0])for(var _B2=W.length-1;_B2>=0;_B2--){var _$=W[_B2];if(_$.options.handleEvent!==!1){K.target=_$;break;}}}var Z=K.target;if(K.type==="touchstart"&&(l[J]=K.target),K.type==="mousemove"){var _B3=A[O];var _$2;if(Z){var tt=Z.ancestors||[];_$2=/* @__PURE__ */new Set([Z].concat(_toConsumableArray(tt)));}else _$2=/* @__PURE__ */new Set();var Q=Object.entries(L);if(!_B3.has(Z)&&Z){var _tt2=new c["default"]("mouseenter");_tt2.setOriginalEvent(L),Q.forEach(function(_ref158){var _ref159=_slicedToArray(_ref158,2),q=_ref159[0],gt=_ref159[1];_tt2[q]=gt;}),_B3.add(Z),Z.dispatchEvent(_tt2);var ot=Z.ancestors;ot&&ot.forEach(function(q){q instanceof a["default"]&&!_B3.has(q)&&(_B3.add(q),q.dispatchEvent(_tt2));});}var et=new c["default"]("mouseleave");et.setOriginalEvent(L),Q.forEach(function(_ref160){var _ref161=_slicedToArray(_ref160,2),tt=_ref161[0],ot=_ref161[1];et[tt]=ot;}),_toConsumableArray(_B3).forEach(function(tt){_$2.has(tt)||(_B3["delete"](tt),tt.dispatchEvent(et));});}});},{passive:E!=="contextmenu"});});}function u(A,R){if(R&&R.style){var b=A.width,E=A.height,L=A.mode,D=A.container;var I=D.clientWidth,C=D.clientHeight;b=b||I,E=E||C,L==="static"?(R.style.width="".concat(b,"px"),R.style.height="".concat(E,"px")):(R.style.top="0",R.style.left="0",R.style.width="".concat(I,"px"),R.style.height="".concat(C,"px"),R.style.transform="",R.style.webkitTransform="");}}var g=Symbol("offscreenLayerCount");var M=/*#__PURE__*/function(_f$default){/**
395
+ width
396
+ height
397
+ mode: 'static', 'scale', 'stickyWidth', 'stickyHeight', 'stickyTop', 'stickyBottom', 'stickyLeft', 'stickyRight'
398
+ */function M(){var _this46;var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this46=_callSuper(this,M),!R.container)if(typeof n.ENV.Container=="function")R.container=new n.ENV.Container(R.width||300,R.height||150);else throw new Error("No container specified.");if(_this46.container=R.container,_this46.container.style&&(_this46.container.style.overflow||(_this46.container.style.overflow="hidden"),_this46.container.style.position||(_this46.container.style.position="relative")),_this46.options=R,R.displayRatio=R.displayRatio||1,R.mode=R.mode||"scale",R.left=0,R.top=0,R.autoResize=R.autoResize!==!1,R.autoResize){var b;if((typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?b=globalThis:b=(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:e,b.addEventListener){var E=_assertThisInitialized(_this46);b.addEventListener("resize",function L(){(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.contains(E.container)?E.resize():b.removeEventListener("resize",L);});}}_this46[O]=/* @__PURE__ */new Set(),_this46.setResolution(R),d(_assertThisInitialized(_this46)),_this46[g]=0;return _assertThisInitialized(_this46);}_inherits(M,_f$default);return _createClass(M,[{key:"hasOffscreenCanvas",get:function get(){return this[g]>0;}},{key:"displayRatio",get:function get(){return this.options.displayRatio;},set:function set(R){this.options.displayRatio!==R&&(this.options.displayRatio=R,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(R){this.options.height!==R&&(this.options.height=R,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(R){this.options.mode!==R&&(this.options.mode=R,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(R){this.options.width!==R&&(this.options.width=R,this.resize());}},{key:"appendChild",value:function appendChild(R){!(R instanceof o["default"])&&!(R instanceof s["default"])&&x(R);var b=_get(_getPrototypeOf(M.prototype),"appendChild",this).call(this,R),E=R.canvas;return R.offscreen?this[g]++:this.container.appendChild(E),u(this.options,E),R.setResolution(this.getResolution()),b;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this47=this;this.hasOffscreenCanvas&&!this._requestID&&(this._requestID=Object(i.requestAnimationFrame)(function(){delete _this47._requestID,_this47.render();}));}/* override */},{key:"insertBefore",value:function insertBefore(R,b){!(R instanceof o["default"])&&!(R instanceof s["default"])&&x(R);var E=_get(_getPrototypeOf(M.prototype),"insertBefore",this).call(this,R,b),L=R.canvas;if(!R.offscreen){var D=m(this,R);this.container.insertBefore(L,D);}return u(this.options,L),R.setResolution(this.getResolution()),E;}},{key:"layer",value:function layer(){var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default";var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};b=Object.assign({},this.options,b),b.id=R;var E=this.orderedChildren;for(var I=0;I<E.length;I++)if(E[I].id===R)return E[I];var L=b.worker;var D;return L?D=new s["default"](b):D=new o["default"](b),this.appendChild(D),D;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(){var _this48=this;var _len13,R,_key13,b,E,L,_loop2,D,_args12=arguments;return _regeneratorRuntime().wrap(function _callee11$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:for(_len13=_args12.length,R=new Array(_len13),_key13=0;_key13<_len13;_key13++){R[_key13]=_args12[_key13];}b=[],E=[],L=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(D){var I,C,W,G;return _regeneratorRuntime().wrap(function _loop2$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:I=R[D];if(typeof I=="string")C=Object(v.loadTexture)(I);else if(Array.isArray(I))C=Object(v.loadFrames).apply(void 0,_toConsumableArray(I));else{W=I.id,G=I.src;C=Object(v.loadTexture)(G,W);}C instanceof Promise||(C=Promise.resolve(C)),E.push(C.then(function(W){b.push(W),L[D]=W;var G=new c["default"]({type:"preload",detail:{current:W,loaded:b,resources:R}});_this48.dispatchEvent(G);}));case 3:case"end":return _context11.stop();}},_loop2);});D=0;case 4:if(!(D<R.length)){_context12.next=9;break;}return _context12.delegateYield(_loop2(D),"t0",6);case 6:D++;_context12.next=4;break;case 9:_context12.next=11;return Promise.all(E);case 11:return _context12.abrupt("return",L);case 12:case"end":return _context12.stop();}},_callee11);}));function preload(){return _preload.apply(this,arguments);}return preload;}()/* override */},{key:"removeChild",value:function removeChild(R){var b=_get(_getPrototypeOf(M.prototype),"removeChild",this).call(this,R);if(b){R._prepareRenderFinished&&R._prepareRenderFinished();var E=R.canvas;E&&E.remove&&E.remove(),R.offscreen&&this[g]--;}return b;}// for offscreen mode rendering
399
+ },{key:"render",value:function render(){var R=this.orderedChildren;var b=null;var E=[];for(var L=0;L<R.length;L++){var D=R[L],I=E.length>0;if(D instanceof o["default"]&&!D.offscreen){if(!D.autoRender)I&&(console.warn("Some offscreen canvas will not be rendered."),E.length=0);else if(b=D,I){D.renderer.clear();for(var C=0;C<E.length;C++){var 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 s["default"]&&I&&(console.warn("Some offscreen canvas will not be rendered."),E.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(R,b){var E=_get(_getPrototypeOf(M.prototype),"replaceChild",this).call(this,R,b);b.canvas.remove&&b.canvas.remove(),b.offscreen&&this[g]--;var L=R.canvas;if(!R.offscreen){var D=m(this,R);this.container.insertBefore(L,D);}return u(this.options,L),R.setResolution(this.getResolution()),E;}},{key:"resize",value:function resize(){var R=this.options;this.children.forEach(function(b){u(R,b.canvas);}),this.setResolution(R),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _R4,_b10;var _ref162=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},R=_ref162.width,b=_ref162.height;var E=this.container,L=E.clientWidth,D=E.clientHeight;(R==null||b==null)&&(R=(_R4=R)!==null&&_R4!==void 0?_R4:L,b=(_b10=b)!==null&&_b10!==void 0?_b10:D);var _this$options=this.options,I=_this$options.mode,C=_this$options.displayRatio;if(R*=C,b*=C,this.options.left=0,this.options.top=0,I==="stickyHeight"||I==="stickyLeft"||I==="stickyRight"){var W=R;R=L*b/D,I==="stickyHeight"&&(this.options.left=0.5*(R-W)),I==="stickyRight"&&(this.options.left=R-W);}else if(I==="stickyWidth"||I==="stickyTop"||I==="stickyBottom"){var _W4=b;b=D*R/L,I==="stickyWidth"&&(this.options.top=0.5*(b-_W4)),I==="stickyBottom"&&(this.options.top=b-_W4);}_get(_getPrototypeOf(M.prototype),"setResolution",this).call(this,{width:R,height:b});}},{key:"snapshot",value:function snapshot(){var _ref163=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref163$offscreen=_ref163.offscreen,R=_ref163$offscreen===void 0?!1:_ref163$offscreen,b=_ref163.layers;var E=R?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),L=_this$getResolution9.width,D=_this$getResolution9.height;this[E]=this[E]||n.ENV.createCanvas(L,D,{offscreen:R});var I=this[E].getContext("2d");b=b||this.orderedChildren,this[E].width=L,this[E].height=D;for(var C=0;C<b.length;C++){var W=b[C];if(!W.options.ignoreSnapshot){W.render&&W.render();var G=W.canvas;G&&G!==W&&I.drawImage(G,0,0,L,D);}}return this[E];}}]);}(f["default"]);(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(M.prototype.layer3d=function(A){var _this49=this;var R=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var b=R.url||"https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.min.js";return new Promise(function(E,L){var D=document.createElement("script");D.async=!1,D.src=b,D.onload=function(){try{E(_this49.layer3d(A,R));}catch(I){L(I);}},document.documentElement.appendChild(D);});}),S["default"].registerNode(M,"scene");}.call(this,t(22));},/* 291 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(214);t(1).glMatrix.setMatrixArrayType(Array);function n(i){var _ref164=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref164$offsetTop=_ref164.offsetTop,a=_ref164$offsetTop===void 0?0:_ref164$offsetTop,_ref164$offsetLeft=_ref164.offsetLeft,o=_ref164$offsetLeft===void 0?0:_ref164$offsetLeft,_ref164$displayRatio=_ref164.displayRatio,s=_ref164$displayRatio===void 0?1:_ref164$displayRatio;var f,p;var c=[],_i$target$getBounding=i.target.getBoundingClientRect(),v=_i$target$getBounding.left,S=_i$target$getBounding.top,O=_i$target$getBounding.width,x=_i$target$getBounding.height,m=i.target.width,T=i.target.height,l=i.changedTouches||[i];for(var u=0;u<l.length;u++){var g=l[u],M=g.identifier,A=g.clientX,R=g.clientY;A!=null&&R!=null&&c.push({x:Math.round((A|0)-v),y:Math.round((R|0)-S),identifier:M});}c.length<=0&&c.push({x:f,y:p});var d=[];return c.forEach(function(u){u.x!=null&&u.y!=null&&(f=(u.x*m/O-o)/s,p=(u.y*T/x-a)/s);var g=new e["default"](i);Object.defineProperties(g,{layerX:{value:f,configurable:!0},layerY:{value:p,configurable:!0},originalX:{value:u.x},originalY:{value:u.y},x:{value:f,configurable:!0},y:{value:p,configurable:!0},identifier:{value:u.identifier}}),d.push(g);}),d;}}/******/]);Dt.version;Dt.Arc;Dt.Block;Dt.Cloud;Dt.Color;var Vh=Dt.Ellipse;Dt.Gradient;var ne=Dt.Group,Yh=Dt.Label;Dt.Layer;Dt.LayerWorker;Dt.Node;Dt.Parallel;var he=Dt.Path,ce=Dt.Polyline,or=Dt.Rect;Dt.Regular;Dt.Ring;var Xh=Dt.Scene,Jh=Dt.Sprite;Dt.SpriteSvg;Dt.Star;Dt.Triangle;Dt.helpers;Dt.createElement;Dt.isSpriteNode;Dt.registerNode;Dt.requestAnimationFrame;Dt.cancelAnimationFrame;Dt.ENV;function me(h){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var t=h.length;if(t<2)return"";var e=h[0],n=h[1];if(t===2)return"M".concat(de(e),"L").concat(de(n));var i="";for(var a=2,o=t-1;a<o;a++)e=h[a],n=h[a+1],i+=ge(e,n);return r?"M".concat(ge(h[0],h[1]),"Q").concat(de(h[1])).concat(ge(h[1],h[2]),"T").concat(i).concat(ge(h[t-1],h[0])).concat(ge(h[0],h[1]),"Z"):"M".concat(de(h[0]),"Q").concat(de(h[1])).concat(ge(h[1],h[2])).concat(h.length>3?"T":"").concat(i,"L").concat(de(h[t-1]));}var yr={exports:{}};yr.exports;(function(h){var r=function(){var t=String.fromCharCode,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function a(s,f){if(!i[s]){i[s]={};for(var p=0;p<s.length;p++)i[s][s.charAt(p)]=p;}return i[s][f];}var o={compressToBase64:function compressToBase64(s){if(s==null)return"";var f=o._compress(s,6,function(p){return e.charAt(p);});switch(f.length%4){default:case 0:return f;case 1:return f+"===";case 2:return f+"==";case 3:return f+"=";}},decompressFromBase64:function decompressFromBase64(s){return s==null?"":s==""?null:o._decompress(s.length,32,function(f){return a(e,s.charAt(f));});},compressToUTF16:function compressToUTF16(s){return s==null?"":o._compress(s,15,function(f){return t(f+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(s){return s==null?"":s==""?null:o._decompress(s.length,16384,function(f){return s.charCodeAt(f)-32;});},//compress into uint8array (UCS-2 big endian format)
400
+ compressToUint8Array:function compressToUint8Array(s){for(var f=o.compress(s),p=new Uint8Array(f.length*2),c=0,v=f.length;c<v;c++){var S=f.charCodeAt(c);p[c*2]=S>>>8,p[c*2+1]=S%256;}return p;},//decompress from uint8array (UCS-2 big endian format)
401
+ decompressFromUint8Array:function decompressFromUint8Array(s){if(s==null)return o.decompress(s);for(var f=new Array(s.length/2),p=0,c=f.length;p<c;p++)f[p]=s[p*2]*256+s[p*2+1];var v=[];return f.forEach(function(S){v.push(t(S));}),o.decompress(v.join(""));},//compress into a string that is already URI encoded
402
+ compressToEncodedURIComponent:function compressToEncodedURIComponent(s){return s==null?"":o._compress(s,6,function(f){return n.charAt(f);});},//decompress from an output of compressToEncodedURIComponent
403
+ decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(s){return s==null?"":s==""?null:(s=s.replace(/ /g,"+"),o._decompress(s.length,32,function(f){return a(n,s.charAt(f));}));},compress:function compress(s){return o._compress(s,16,function(f){return t(f);});},_compress:function _compress(s,f,p){if(s==null)return"";var c,v,S={},O={},x="",m="",T="",l=2,d=3,u=2,g=[],M=0,A=0,R;for(R=0;R<s.length;R+=1)if(x=s.charAt(R),Object.prototype.hasOwnProperty.call(S,x)||(S[x]=d++,O[x]=!0),m=T+x,Object.prototype.hasOwnProperty.call(S,m))T=m;else{if(Object.prototype.hasOwnProperty.call(O,T)){if(T.charCodeAt(0)<256){for(c=0;c<u;c++)M=M<<1,A==f-1?(A=0,g.push(p(M)),M=0):A++;for(v=T.charCodeAt(0),c=0;c<8;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;}else{for(v=1,c=0;c<u;c++)M=M<<1|v,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=0;for(v=T.charCodeAt(0),c=0;c<16;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;}l--,l==0&&(l=Math.pow(2,u),u++),delete O[T];}else for(v=S[T],c=0;c<u;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;l--,l==0&&(l=Math.pow(2,u),u++),S[m]=d++,T=String(x);}if(T!==""){if(Object.prototype.hasOwnProperty.call(O,T)){if(T.charCodeAt(0)<256){for(c=0;c<u;c++)M=M<<1,A==f-1?(A=0,g.push(p(M)),M=0):A++;for(v=T.charCodeAt(0),c=0;c<8;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;}else{for(v=1,c=0;c<u;c++)M=M<<1|v,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=0;for(v=T.charCodeAt(0),c=0;c<16;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;}l--,l==0&&(l=Math.pow(2,u),u++),delete O[T];}else for(v=S[T],c=0;c<u;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;l--,l==0&&(l=Math.pow(2,u),u++);}for(v=2,c=0;c<u;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;for(;;)if(M=M<<1,A==f-1){g.push(p(M));break;}else A++;return g.join("");},decompress:function decompress(s){return s==null?"":s==""?null:o._decompress(s.length,32768,function(f){return s.charCodeAt(f);});},_decompress:function _decompress(s,f,p){var c=[],v=4,S=4,O=3,x="",m=[],T,l,d,u,g,M,A,R={val:p(0),position:f,index:1};for(T=0;T<3;T+=1)c[T]=T;for(d=0,g=Math.pow(2,2),M=1;M!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=f,R.val=p(R.index++)),d|=(u>0?1:0)*M,M<<=1;switch(d){case 0:for(d=0,g=Math.pow(2,8),M=1;M!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=f,R.val=p(R.index++)),d|=(u>0?1:0)*M,M<<=1;A=t(d);break;case 1:for(d=0,g=Math.pow(2,16),M=1;M!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=f,R.val=p(R.index++)),d|=(u>0?1:0)*M,M<<=1;A=t(d);break;case 2:return"";}for(c[3]=A,l=A,m.push(A);;){if(R.index>s)return"";for(d=0,g=Math.pow(2,O),M=1;M!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=f,R.val=p(R.index++)),d|=(u>0?1:0)*M,M<<=1;switch(A=d){case 0:for(d=0,g=Math.pow(2,8),M=1;M!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=f,R.val=p(R.index++)),d|=(u>0?1:0)*M,M<<=1;c[S++]=t(d),A=S-1,v--;break;case 1:for(d=0,g=Math.pow(2,16),M=1;M!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=f,R.val=p(R.index++)),d|=(u>0?1:0)*M,M<<=1;c[S++]=t(d),A=S-1,v--;break;case 2:return m.join("");}if(v==0&&(v=Math.pow(2,O),O++),c[A])x=c[A];else if(A===S)x=l+l.charAt(0);else return null;m.push(x),c[S++]=l+x.charAt(0),v--,l=x,v==0&&(v=Math.pow(2,O),O++);}}};return o;}();h!=null?h.exports=r:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return r;});})(yr);var jn=yr.exports;function Le(h){return JSON.parse(jn.decompress(h));}function qt(h){return jn.compress(JSON.stringify(h));}var Un=/*#__PURE__*/function(_yt){function Un(t){var _this50;_classCallCheck(this,Un);_this50=_callSuper(this,Un,[t]);nt(_this50,"canRotate",!0);nt(_this50,"scaleType",$t.all);nt(_this50,"toolsType",ht.Pencil);nt(_this50,"syncTimestamp");nt(_this50,"syncIndex",0);nt(_this50,"tmpPoints",[]);nt(_this50,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */nt(_this50,"uniThickness");nt(_this50,"workOptions");nt(_this50,"centerPos",[0,0]);_this50.workOptions=t.toolsOpt,_this50.uniThickness=_this50.MAX_REPEAR/_this50.workOptions.thickness/10,_this50.syncTimestamp=0;return _this50;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Un,_yt);return _createClass(Un,[{key:"combineConsume",value:function combineConsume(){var o;var t=(o=this.workId)==null?void 0:o.toString(),e=this.transformDataAll(!0),n={name:t};var i;var 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:Mt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_get(_getPrototypeOf(Un.prototype),"setWorkOptions",this).call(this,t),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var _this51=this;var l;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=t.drawCount,s=t.replaceId;if(((l=e.op)==null?void 0:l.length)===0)return{type:ct.None};var f=e.workId,_this$transformData=this.transformData(e,!1),p=_this$transformData.tasks,c=_this$transformData.effects,v=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,v,Math.max(0,this.tmpPoints.length-2));var S={name:f==null?void 0:f.toString(),id:o==null?void 0:o.toString()};var O,x=!1;var m=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),p.length&&(p[0].taskId-this.syncTimestamp>this.syncUnitTime&&(x=!0,this.syncTimestamp=p[0].taskId,this.syncIndex=this.tmpPoints.length),i||a)){var d=n?this.fullLayer:this.drawLayer||this.fullLayer;O=this.draw({attrs:S,tasks:p,effects:c,layer:d,replaceId:s});}if(i)return v>10&&this.tmpPoints.splice(0,v-10),{rect:O,type:ct.DrawWork,dataType:Mt.Local};var T=[];return this.tmpPoints.slice(m).forEach(function(d){T.push(d.x,d.y,_this51.computRadius(d.z,_this51.workOptions.thickness));}),{rect:O,type:ct.DrawWork,dataType:Mt.Local,workId:x?f:void 0,op:x?T:void 0,index:x?m*3:void 0};}},{key:"consumeAll",value:function consumeAll(t){var _this52=this;var p,c;if(t.data){var _t$data=t.data,v=_t$data.op,S=_t$data.workState;v!=null&&v.length&&S===Rt.Done&&this.workOptions.strokeType===Vt.Stroke&&this.updateTempPointsWithPressureWhenDone(v);}var e=(p=this.workId)==null?void 0:p.toString();if(!e)return{type:ct.None};var n=this.transformDataAll(!0),i={name:e};var a;var o=this.fullLayer;n.length&&(a=this.draw({attrs:i,tasks:n,replaceId:e,layer:o}));var s=[];this.tmpPoints.map(function(v){s.push(v.x,v.y,_this52.computRadius(v.z,_this52.workOptions.thickness));}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var f=qt(s);return(c=this.vNodes)==null||c.setInfo(e,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,o)}),{rect:a,type:ct.FullWork,dataType:Mt.Local,workId:e,ops:f,updateNodeOpt:{pos:this.centerPos,useAnimation:!0},opt:this.workOptions};}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(t){var p,c;var e=t.op,n=t.isFullWork,i=t.replaceId;this.tmpPoints.length=0;for(var v=0;v<e.length;v+=3){var S=new Tt(e[v],e[v+1],e[v+2]);if(this.tmpPoints.length>0){var O=this.tmpPoints[this.tmpPoints.length-1],x=_.Sub(S,O).uni();S.setv(x);}this.tmpPoints.push(S);}var a=this.transformDataAll(!1),o=(p=this.workId)==null?void 0:p.toString(),s={name:o};var f;if(o&&a.length){var _v2=n?this.fullLayer:this.drawLayer||this.fullLayer;f=this.draw({attrs:s,tasks:a,replaceId:i,layer:_v2}),(c=this.vNodes)==null||c.setInfo(o,{rect:f,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&yt.getCenterPos(f,_v2)});}return f;}},{key:"transformDataAll",value:function transformDataAll(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;return this.getTaskPoints(this.tmpPoints,t&&this.workOptions.thickness||void 0);}},{key:"draw",value:function draw(t){var _this53=this;var e=t.attrs,n=t.tasks,i=t.replaceId,a=t.effects,o=t.layer,_this$workOptions=this.workOptions,s=_this$workOptions.strokeColor,f=_this$workOptions.strokeType,p=_this$workOptions.thickness,c=_this$workOptions.zIndex,v=_this$workOptions.scale,S=_this$workOptions.rotate,O=_this$workOptions.translate;a!=null&&a.size&&(a.forEach(function(u){var g;(g=o.getElementById(u+""))==null||g.remove();}),a.clear());var x;var m=[],T=o.worldPosition,l=o.worldScaling;for(var u=0;u<n.length;u++){var _n$u=n[u],g=_n$u.pos,M=_n$u.points,_this$computDrawPoint=this.computDrawPoints(M),A=_this$computDrawPoint.ps,R=_this$computDrawPoint.rect;var b=void 0;var E=M.length===1;f===Vt.Stroke||E?b=me(A,!0):b=me(A,!1);var L={pos:g,d:b,fillColor:f===Vt.Stroke||E?s:void 0,lineDash:f===Vt.Dotted&&!E?[1,p*2]:f===Vt.LongDotted&&!E?[p,p*2]:void 0,strokeColor:s,lineCap:f===Vt.Stroke||E?void 0:"round",lineWidth:f===Vt.Stroke||E?0:p};x=Ot(x,{x:Math.floor((R.x+g[0])*l[0]+T[0]-yt.SafeBorderPadding),y:Math.floor((R.y+g[1])*l[1]+T[1]-yt.SafeBorderPadding),w:Math.floor(R.w*l[0]+2*yt.SafeBorderPadding),h:Math.floor(R.h*l[1]+2*yt.SafeBorderPadding)}),m.push(L);}v&&(e.scale=v),S&&(e.rotate=S),O&&(e.translate=O);var d=new ne();if(x){this.centerPos=yt.getCenterPos(x,o),d.attr(_objectSpread(_objectSpread({},e),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:f===Vt.Stroke?s:void 0,pos:this.centerPos,size:[(x.w-2*yt.SafeBorderPadding)/l[0],(x.h-2*yt.SafeBorderPadding)/l[1]],zIndex:c}));var _u10=m.map(function(g){return g.pos=[g.pos[0]-_this53.centerPos[0],g.pos[1]-_this53.centerPos[1]],new he(g);});d.append.apply(d,_toConsumableArray(_u10)),f===Vt.Stroke&&d.seal(),this.replace(o,i||e.workId,d);}if(v||S||O){var _u11=d==null?void 0:d.getBoundingClientRect();if(_u11)return{x:Math.floor(_u11.x-yt.SafeBorderPadding),y:Math.floor(_u11.y-yt.SafeBorderPadding),w:Math.floor(_u11.width+yt.SafeBorderPadding*2),h:Math.floor(_u11.height+yt.SafeBorderPadding*2)};}return x;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.workOptions.strokeType===Vt.Stroke||t.length===1?this.computStroke(t):this.computNomal(t);}},{key:"computNomal",value:function computNomal(t){var e=this.workOptions.thickness;var n=t.map(function(i){return e=Math.max(e,i.radius),i.point;});return{ps:n,rect:Wt(n,e)};}},{key:"computStroke",value:function computStroke(t){return t.length===1?this.computDotStroke(t[0]):this.computLineStroke(t);}},{key:"computLineStroke",value:function computLineStroke(t){var e=[],n=[];for(var f=0;f<t.length;f++){var _t$f=t[f],p=_t$f.point,c=_t$f.radius;var v=p.v;f===0&&t.length>1&&(v=t[f+1].point.v);var S=_.Per(v).mul(c);e.push(Tt.Sub(p,S)),n.push(Tt.Add(p,S));}var i=t[t.length-1],a=Tt.GetSemicircleStroke(i.point,e[e.length-1],-1,8),o=Tt.GetSemicircleStroke(t[0].point,n[0],-1,8),s=e.concat(a,n.reverse(),o);return{ps:s,rect:Wt(s)};}},{key:"computDotStroke",value:function computDotStroke(t){var e=t.point,n=t.radius,i={x:e.x-n,y:e.y-n,w:n*2,h:n*2};return{ps:Tt.GetDotStroke(e,n,8),rect:i};}},{key:"transformData",value:function transformData(t,e){var n=t.op,i=t.workState;var a=this.tmpPoints.length-1,o=[];if(n!=null&&n.length&&i){var _this$workOptions2=this.workOptions,s=_this$workOptions2.strokeType,f=_this$workOptions2.thickness,p=/* @__PURE__ */new Set();a=s===Vt.Stroke?this.updateTempPointsWithPressure(n,f,p):this.updateTempPoints(n,f,p);var c=e?this.tmpPoints:this.tmpPoints.slice(a);return o=this.getTaskPoints(c,f),{tasks:o,effects:p,consumeIndex:a};}return{tasks:o,consumeIndex:a};}/** 压力渐变公式 */},{key:"computRadius",value:function computRadius(t,e){return t*0.03*e+e*0.5;}},{key:"getMinZ",value:function getMinZ(t,e){return((e||Math.max(1,Math.floor(t*0.3)))-t*0.5)*100/t/3;}},{key:"getTaskPoints",value:function getTaskPoints(t,e){var c;var n=[];if(t.length===0)return[];var i=0,a=t[0].x,o=t[0].y,s=[a,o],f=[],p=t[0].t;for(;i<t.length;){var v=t[i],S=v.x-a,O=v.y-o,x=v.z,m=e?this.computRadius(x,e):x;if(f.push({point:new Tt(S,O,x,t[i].v),radius:m}),i>0&&i<t.length-1){var _T34=t[i].getAngleByPoints(t[i-1],t[i+1]);if(_T34<90||_T34>270){var _l28=(c=f.pop())==null?void 0:c.point.clone();_l28&&n.push({taskId:p,pos:s,points:[].concat(_toConsumableArray(f),[{point:_l28,radius:m}])}),a=t[i].x,o=t[i].y,s=[a,o];var d=v.x-a,u=v.y-o;f=[{point:new Tt(d,u,x),radius:m}],p=Date.now();}}i++;}return n.push({taskId:p,pos:s,points:f}),n;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(t,e,n){var i=Date.now(),a=this.tmpPoints.length;var o=a;for(var f=0;f<t.length;f+=2){o=Math.min(o,a);var p=this.tmpPoints.length,c=new Tt(t[f],t[f+1]);if(p===0){this.tmpPoints.push(c);continue;}var v=p-1,S=this.tmpPoints[v],O=_.Sub(c,S).uni();if(c.isNear(S,e)){if(S.z<this.MAX_REPEAR){if(S.setz(Math.min(S.z+1,this.MAX_REPEAR)),o=Math.min(o,v),p>1){var _T35=p-1;for(;_T35>0;){var _l29=this.tmpPoints[_T35].distance(this.tmpPoints[_T35-1]),d=Math.max(this.tmpPoints[_T35].z-this.uniThickness*_l29,0);if(this.tmpPoints[_T35-1].z>=d)break;this.tmpPoints[_T35-1].setz(d),o=Math.min(o,_T35-1),_T35--;}}}else o=1/0;continue;}c.setv(O);var x=c.distance(S),m=Math.max(S.z-this.uniThickness*x,0);p>1&&_.Equals(O,S.v,0.02)&&(m>0||S.z<=0)&&(n&&S.t&&n.add(S.t),this.tmpPoints.pop(),o=Math.min(v,o)),c.setz(m),this.tmpPoints.push(c);}if(o===1/0)return this.tmpPoints.length;var s=a;if(o===a){s=Math.max(s-1,0);var _f3=this.tmpPoints[s].t;_f3&&(n==null||n.add(_f3));}else{var _f4=a-1;for(s=o;_f4>=0;){var _p3=this.tmpPoints[_f4].t;if(_p3&&(n==null||n.add(_p3),_f4<=o)){s=_f4,_f4=-1;break;}_f4--;}}return this.tmpPoints[s].setT(i),s;}},{key:"updateTempPoints",value:function updateTempPoints(t,e,n){var f;var i=Date.now(),a=this.tmpPoints.length;var o=a;for(var p=0;p<t.length;p+=2){var c=this.tmpPoints.length,v=new Tt(t[p],t[p+1]);if(c===0){this.tmpPoints.push(v);continue;}var S=c-1,O=this.tmpPoints[S],x=_.Sub(v,O).uni();if(v.isNear(O,e/2)){o=Math.min(S,o);continue;}_.Equals(x,O.v,0.02)&&(n&&O.t&&n.add(O.t),this.tmpPoints.pop(),o=Math.min(S,o)),v.setv(x),this.tmpPoints.push(v);}var s=a;if(o===a){s=Math.max(s-1,0);var _p4=this.tmpPoints[s].t;_p4&&(n==null||n.add(_p4));}else{var _p5=Math.min(a-1,o);for(s=o;_p5>=0;){var _c4=(f=this.tmpPoints[_p5])==null?void 0:f.t;if(_c4&&(n==null||n.add(_c4),_p5<=o)){s=_p5,_p5=-1;break;}_p5--;}}return this.tmpPoints[s].setT(i),s;}},{key:"updateTempPointsWithPressureWhenDone",value:function updateTempPointsWithPressureWhenDone(t){var e=this.workOptions.thickness,n=t.length,i=this.getMinZ(e);for(var a=0;a<n;a+=2){var o=this.tmpPoints.length,s=new Tt(t[a],t[a+1]);if(o===0){this.tmpPoints.push(s);continue;}var f=o-1,p=this.tmpPoints[f],c=_.Sub(s,p).uni(),v=s.distance(p);if(o>1&&p.z===i)break;if(s.isNear(p,e/2)){if(n<3&&p.z<this.MAX_REPEAR&&(p.setz(Math.min(p.z+1,this.MAX_REPEAR)),o>1)){var O=o-1;for(;O>0;){var 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;}s.setv(c);var S=Math.max(p.z-this.uniThickness*v,i);o>1&&_.Equals(c,p.v,0.02)&&p.z<=0&&this.tmpPoints.pop(),s.setz(S),this.tmpPoints.push(s);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var s;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=i.get(e.name);return a&&(e.tagName==="GROUP"?jh(e)?e.setAttribute("bgcolor",a):e.children.forEach(function(f){f.setAttribute("strokeColor",a),f.getAttribute("fillColor")&&f.setAttribute("fillColor",a);}):(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a)),(s=o==null?void 0:o.opt)!=null&&s.strokeColor&&(o.opt.strokeColor=a)),o&&i.setInfo(e.name,o),yt.updateNodeOpt(t);}}]);}(yt);var zn=/*#__PURE__*/function(_yt2){function zn(t){var _this54;_classCallCheck(this,zn);_this54=_callSuper(this,zn,[t]);nt(_this54,"toolsType",ht.LaserPen);nt(_this54,"canRotate",!1);nt(_this54,"scaleType",$t.none);nt(_this54,"syncTimestamp");nt(_this54,"syncIndex",0);nt(_this54,"tmpPoints",[]);nt(_this54,"workOptions");nt(_this54,"consumeIndex",0);_this54.workOptions=t.toolsOpt,_this54.syncTimestamp=0;return _this54;}_inherits(zn,_yt2);return _createClass(zn,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_get(_getPrototypeOf(zn.prototype),"setWorkOptions",this).call(this,t),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var e=t.data,n=t.isSubWorker,i=e.workId,a=e.op;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};var _this$workOptions3=this.workOptions,o=_this$workOptions3.strokeColor,s=_this$workOptions3.thickness,f=_this$workOptions3.strokeType,p=Wt(this.tmpPoints,s);var c=!1;var v=this.syncIndex,S=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var O={name:i==null?void 0:i.toString(),opacity:1,lineDash:f===Vt.Dotted?[1,s*2]:f===Vt.LongDotted?[s,s*2]:void 0,strokeColor:o,lineCap:"round",lineWidth:s,anchor:[0.5,0.5]},x=this.getTaskPoints(S);if(x.length){var _T36=Date.now();_T36-this.syncTimestamp>this.syncUnitTime&&(c=!0,this.syncTimestamp=_T36,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:O,tasks:x,isDot:!1,layer:this.drawLayer||this.fullLayer});}var m=[];return this.tmpPoints.slice(v).forEach(function(T){m.push(T.x,T.y);}),{rect:{x:p.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:p.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:p.w*this.fullLayer.worldScaling[0],h:p.h*this.fullLayer.worldScaling[1]},type:ct.DrawWork,dataType:Mt.Local,workId:c?i:void 0,op:c?m:void 0,index:c?v*2:void 0};}},{key:"consumeAll",value:function consumeAll(){var a;var t=(a=this.workId)==null?void 0:a.toString();var e;if(this.tmpPoints.length-1>this.consumeIndex){var o=this.tmpPoints.slice(this.consumeIndex);var s=o.length===1,_this$workOptions4=this.workOptions,f=_this$workOptions4.strokeColor,p=_this$workOptions4.thickness,c=_this$workOptions4.strokeType;if(s){var O=this.computDotStroke({point:o[0],radius:p/2});o=O.ps,e=O.rect;}else e=Wt(this.tmpPoints,p);var v={name:t==null?void 0:t.toString(),fillColor:s?f:void 0,opacity:1,lineDash:c===Vt.Dotted&&!s?[1,p*2]:c===Vt.LongDotted&&!s?[p,p*2]:void 0,strokeColor:f,lineCap:s?void 0:"round",lineWidth:s?0:p,anchor:[0.5,0.5]},S=this.getTaskPoints(o);S.length&&this.draw({attrs:v,tasks:S,isDot:s,layer:this.drawLayer||this.fullLayer});}var n=[];this.tmpPoints.forEach(function(o){n.push(o.x,o.y);});var 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:Mt.Local,workId:t,ops:i,index:this.syncIndex*2};}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(t){var x;var e=t.op,n=t.replaceId,i=t.isFullWork,_this$workOptions5=this.workOptions,a=_this$workOptions5.strokeColor,o=_this$workOptions5.thickness,s=_this$workOptions5.strokeType;if(!e.length){var m=Wt(this.tmpPoints,o);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]};}var f=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(e||[]);var p,c=this.tmpPoints.slice(f);var v=c.length===1;if(v){var _m6=this.computDotStroke({point:c[0],radius:o/2});c=_m6.ps,p=_m6.rect;}else p=Wt(this.tmpPoints,o);var S={name:(x=this.workId)==null?void 0:x.toString(),fillColor:v?a:void 0,opacity:1,lineDash:s===Vt.Dotted&&!v?[1,o*2]:s===Vt.LongDotted&&!v?[o,o*2]:void 0,strokeColor:a,lineCap:v?void 0:"round",lineWidth:v?0:o,anchor:[0.5,0.5]},O=this.getTaskPoints(c);if(O.length){var _m7=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:S,tasks:O,isDot:v,replaceId:n,layer:_m7});}return{x:p.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:p.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:p.w*this.fullLayer.worldScaling[0],h:p.h*this.fullLayer.worldScaling[1]};}},{key:"computDotStroke",value:function computDotStroke(t){var e=t.point,n=t.radius,i={x:e.x-n,y:e.y-n,w:n*2,h:n*2};return{ps:Tt.GetDotStroke(e,n,8),rect:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=this.tmpPoints.length;for(var n=0;n<t.length;n+=2){if(e){var i=this.tmpPoints.slice(-1)[0];i&&i.x===t[n]&&i.y===t[n+1]&&this.tmpPoints.pop();}this.tmpPoints.push(new Tt(t[n],t[n+1]));}}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(t){var _this55=this;var e,n,i,a,o,_iterator2,_step2,_loop3;return _regeneratorRuntime().wrap(function _callee12$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:e=t.attrs,n=t.tasks,i=t.isDot,a=t.layer,o=this.workOptions.duration;_iterator2=_createForOfIteratorHelper(n);_context14.prev=2;_loop3=/*#__PURE__*/_regeneratorRuntime().mark(function _loop3(){var s,f,p,c,v,_this55$workOptions,S,O,x,_a$getResolution,m,_T37;return _regeneratorRuntime().wrap(function _loop3$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:s=_step2.value;f=new he(),p=s.pos,c=s.points;i?v=me(c,!0):v=me(c,!1),f.attr(_objectSpread(_objectSpread({},e),{},{pos:p,d:v}));_this55$workOptions=_this55.workOptions,S=_this55$workOptions.vertex,O=_this55$workOptions.fragment;if(S&&O){x=a.renderer.createProgram({vertex:S,fragment:O}),_a$getResolution=a.getResolution(),m=_a$getResolution.width,_T37=_a$getResolution.height;f.setUniforms({u_time:0,u_resolution:[m,_T37]}),f.setProgram(x);}a.appendChild(f),f.transition(o).attr({scale:i?[0.1,0.1]:[1,1],lineWidth:i?0:1}).then(function(){f.remove();});case 6:case"end":return _context13.stop();}},_loop3);});_iterator2.s();case 5:if((_step2=_iterator2.n()).done){_context14.next=9;break;}return _context14.delegateYield(_loop3(),"t0",7);case 7:_context14.next=5;break;case 9:_context14.next=14;break;case 11:_context14.prev=11;_context14.t1=_context14["catch"](2);_iterator2.e(_context14.t1);case 14:_context14.prev=14;_iterator2.f();return _context14.finish(14);case 17:case"end":return _context14.stop();}},_callee12,this,[[2,11,14,17]]);}));function draw(_x16){return _draw2.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(t){var f;var e=[];if(t.length===0)return[];var n=0,i=t[0].x,a=t[0].y,o=[i,a],s=[];for(;n<t.length;){var p=t[n],c=p.x-i,v=p.y-a;if(s.push(new Tt(c,v)),n>0&&n<t.length-1){var S=t[n].getAngleByPoints(t[n-1],t[n+1]);if(S<90||S>270){var O=(f=s.pop())==null?void 0:f.clone();O&&e.push({pos:o,points:[].concat(_toConsumableArray(s),[O])}),i=t[n].x,a=t[n].y,o=[i,a];var x=p.x-i,m=p.y-a;s=[new Tt(x,m)];}}n++;}return e.push({pos:o,points:s}),e;}},{key:"removeLocal",value:function removeLocal(){}},{key:"removeService",value:function removeService(t){var e;var n=[];return this.fullLayer.getElementsByName(t).forEach(function(i){if(i.name===t){var 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(function(i){return i.remove();}),e;}}]);}(yt);var Qh=Ue;Ue.polyline=Ue;Ue.polygon=Zh;function Ue(h,r,t){var e=h.length,n=pe(h[0],r),i=[],a,o,s,f,p;for(t||(t=[]),a=1;a<e;a++){for(o=h[a-1],s=h[a],f=p=pe(s,r);;)if(n|f){if(n&f)break;n?(o=ar(o,s,n,r),n=pe(o,r)):(s=ar(o,s,f,r),f=pe(s,r));}else{i.push(o),f!==p?(i.push(s),a<e-1&&(t.push(i),i=[])):a===e-1&&i.push(s);break;}n=p;}return i.length&&t.push(i),t;}function Zh(h,r){var t,e,n,i,a,o,s;for(e=1;e<=8;e*=2){for(t=[],n=h[h.length-1],i=!(pe(n,r)&e),a=0;a<h.length;a++)o=h[a],s=!(pe(o,r)&e),s!==i&&t.push(ar(n,o,e,r)),s&&t.push(o),n=o,i=s;if(h=t,!h.length)break;}return t;}function ar(h,r,t,e){return t&8?[h[0]+(r[0]-h[0])*(e[3]-h[1])/(r[1]-h[1]),e[3]]:// top
404
+ t&4?[h[0]+(r[0]-h[0])*(e[1]-h[1])/(r[1]-h[1]),e[1]]:// bottom
405
+ t&2?[e[2],h[1]+(r[1]-h[1])*(e[2]-h[0])/(r[0]-h[0])]:// right
406
+ t&1?[e[0],h[1]+(r[1]-h[1])*(e[0]-h[0])/(r[0]-h[0])]:// left
407
+ null;}function pe(h,r){var t=0;return h[0]<r[0]?t|=1:h[0]>r[2]&&(t|=2),h[1]<r[1]?t|=4:h[1]>r[3]&&(t|=8),t;}var kh=/* @__PURE__ */ye(Qh);var ve=/*#__PURE__*/function(_yt3){function ve(t,e){var _this56;_classCallCheck(this,ve);_this56=_callSuper(this,ve,[t]);nt(_this56,"canRotate",!1);nt(_this56,"scaleType",$t.none);nt(_this56,"toolsType",ht.Eraser);nt(_this56,"serviceWork");nt(_this56,"tmpPoints",[]);nt(_this56,"workOptions");nt(_this56,"worldPosition");nt(_this56,"worldScaling");nt(_this56,"eraserRect");nt(_this56,"eraserPolyline");_this56.serviceWork=e,_this56.workOptions=t.toolsOpt,_this56.worldPosition=_this56.fullLayer.worldPosition,_this56.worldScaling=_this56.fullLayer.worldScaling;return _this56;}_inherits(ve,_yt3);return _createClass(ve,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_get(_getPrototypeOf(ve.prototype),"setWorkOptions",this).call(this,t);}},{key:"createEraserRect",value:function createEraserRect(t){var e=t[0]*this.worldScaling[0]+this.worldPosition[0],n=t[1]*this.worldScaling[1]+this.worldPosition[1],_ve$eraserSizes$this$=ve.eraserSizes[this.workOptions.thickness],i=_ve$eraserSizes$this$.width,a=_ve$eraserSizes$this$.height;this.eraserRect={x:e-i*0.5,y:n-a*0.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];}},{key:"computRectCenterPoints",value:function computRectCenterPoints(){var t=this.tmpPoints.slice(-2);if(this.tmpPoints.length===4){var _e4=new _(this.tmpPoints[0],this.tmpPoints[1]),n=new _(this.tmpPoints[2],this.tmpPoints[3]),i=_.Sub(n,_e4).uni(),a=_.Dist(_e4,n),_ve$eraserSizes$this$2=ve.eraserSizes[this.workOptions.thickness],o=_ve$eraserSizes$this$2.width,s=_ve$eraserSizes$this$2.height,f=Math.min(o,s),p=Math.round(a/f);if(p>1){var c=[];for(var v=0;v<p;v++){var S=_.Mul(i,v*f);c.push(this.tmpPoints[0]+S.x,this.tmpPoints[1]+S.y);}return c.concat(t);}}return t;}},{key:"isNear",value:function isNear(t,e){var n=new _(t[0],t[1]),i=new _(e[0],e[1]),_ve$eraserSizes$this$3=ve.eraserSizes[this.workOptions.thickness],a=_ve$eraserSizes$this$3.width,o=_ve$eraserSizes$this$3.height;return _.Dist(n,i)<Math.hypot(a,o)*0.5;}},{key:"cutPolyline",value:function cutPolyline(t,e){var n=[e],i=0;for(;i<t.length;){var s=t[i];if(s.length<2)break;n=a(n,s),i++;}return n;function a(s,f){var p=s;var _loop4=function _loop4(){var v=s[c],S=v.findIndex(function(O,x){return x<v.length-1?o([O,v[x+1]],[f[0],f[1]]):!1;});if(S!==-1&&S>-1){var O=[],x=v.slice(0,S+1);if(_.Equals(v[S],f[0])||x.push(f[0].clone().setz(v[S].z)),x.length>1&&O.push(x),S+f.length-1<v.length-1){var m=S+f.length-1,_T38=v.slice(m),_l30=f[f.length-1];_.Equals(v[m],_l30)||_T38.unshift(_l30.clone().setz(v[m].z)),_T38.length>1&&O.push(_T38);}return{v:(p.splice.apply(p,[c,1].concat(O)),p)};}},_ret;for(var c=0;c<s.length;c++){_ret=_loop4();if(_ret)return _ret.v;}return p;}function o(s,f){var p=_.Sub(s[1],s[0]),c=_.Sub(f[1],f[0]),v=_.Sub(f[0],s[0]);return Math.abs(_.Cpr(p,c))<0.1&&Math.abs(_.Cpr(p,v))<0.1;}}},{key:"isSamePoint",value:function isSamePoint(t,e){return t[0]===e[0]&&t[1]===e[1];}},{key:"translateIntersect",value:function translateIntersect(t){var _this57=this;var e=[];for(var n=0;n<t.length;n++){var i=t[n].filter(function(s,f,p){return!(f>0&&_this57.isSamePoint(s,p[f-1]));}),a=[];var o=0;for(;o<i.length;){var s=i[o],f=new _(s[0],s[1]);a.push(f),o++;}e.push(a);}return e;}},{key:"isLineEraser",value:function isLineEraser(t,e){return!(t===ht.Pencil&&!e);}},{key:"remove",value:function remove(t){var _this58=this;var e=t.curNodeMap,n=t.removeIds,i=t.newWorkDatas,a=this.workOptions.isLine;var o;var _iterator3=_createForOfIteratorHelper(e.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),s=_step3$value[0],f=_step3$value[1];if(f.rect&&this.eraserRect&&this.eraserPolyline&&Re(this.eraserRect,f.rect)){var p=f.op,c=f.toolsType,v=this.isLineEraser(c,a),S=[],O=[];for(var m=0;m<p.length;m+=3){var _T39=new _(p[m]*this.worldScaling[0]+this.worldPosition[0],p[m+1]*this.worldScaling[1]+this.worldPosition[1],p[m+2]);O.push(_T39),S.push(new Tt(_T39.x,_T39.y));}var x=S.length&&Wt(S)||f.rect;if(Re(x,this.eraserRect)){if(O.length>1){var _m8=kh.polyline(O.map(function(T){return T.XY;}),this.eraserPolyline);if(_m8.length&&(n.add(f.name),!v)){var _T40=this.translateIntersect(_m8),_l31=this.cutPolyline(_T40,O);var _loop5=function _loop5(){var u="".concat(s,"_s_").concat(d),g=[];_l31[d].forEach(function(M){g.push((M.x-_this58.worldPosition[0])/_this58.worldScaling[0],(M.y-_this58.worldPosition[1])/_this58.worldScaling[1],M.z);}),f.opt&&f.toolsType&&_this58.vNodes&&(_this58.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}));};for(var d=0;d<_l31.length;d++){_loop5();}}}else n.add(f.name);o=Ot(o,x);}}}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}return n.forEach(function(s){var f;return(f=_this58.vNodes)==null?void 0:f["delete"](s);}),o&&(o.x-=yt.SafeBorderPadding,o.y-=yt.SafeBorderPadding,o.w+=yt.SafeBorderPadding*2,o.h+=yt.SafeBorderPadding*2),o;}},{key:"consume",value:function consume(t){var e=t.data.op;if(!e||e.length===0)return{type:ct.None};var 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]);var i=this.computRectCenterPoints();var a;var o=/* @__PURE__ */new Set(),s=/* @__PURE__ */new Map();if(!this.vNodes)return{type:ct.None};this.vNodes.setTarget();var f=this.getUnLockNodeMap(this.vNodes.getLastTarget());for(var p=0;p<i.length-1;p+=2){this.createEraserRect(i.slice(p,p+2));var c=this.remove({curNodeMap:f,removeIds:o,newWorkDatas:s});a=Ot(a,c);}if(this.vNodes.deleteLastTarget(),a&&o.size){var _iterator4=_createForOfIteratorHelper(s.keys()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _p6=_step4.value;o.has(_p6)&&s["delete"](_p6);}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}return{type:ct.RemoveNode,dataType:Mt.Local,rect:a,removeIds:_toConsumableArray(o),newWorkDatas:s};}return{type:ct.None};}},{key:"consumeAll",value:function consumeAll(t){return this.consume(t);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"getUnLockNodeMap",value:function getUnLockNodeMap(t){var e;if(this.serviceWork){var n=Jt(t),i=this.serviceWork.selectorWorkShapes,a=this.serviceWork.workShapes;var _iterator5=_createForOfIteratorHelper(i.values()),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var o=_step5.value;if((e=o.selectIds)!=null&&e.length){var _iterator7=_createForOfIteratorHelper(o.selectIds),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var s=_step7.value;n["delete"](s);}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}var _iterator6=_createForOfIteratorHelper(a.keys()),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _o3=_step6.value;n["delete"](_o3);}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}return n;}return t;}}]);}(yt);nt(ve,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var ie=ve;var Sr="++",qh="selector",_h="all";var td="__lodash_hash_undefined__";function ed(h){return this.__data__.set(h,td),this;}var rd=ed;function nd(h){return this.__data__.has(h);}var id=nd,sd=dn,od=rd,ad=id;function ze(h){var r=-1,t=h==null?0:h.length;for(this.__data__=new sd();++r<t;)this.add(h[r]);}ze.prototype.add=ze.prototype.push=od;ze.prototype.has=ad;var ld=ze;function cd(h,r){for(var t=-1,e=h==null?0:h.length;++t<e;)if(r(h[t],t,h))return!0;return!1;}var fd=cd;function ud(h,r){return h.has(r);}var hd=ud,dd=ld,gd=fd,pd=hd,vd=1,md=2;function yd(h,r,t,e,n,i){var a=t&vd,o=h.length,s=r.length;if(o!=s&&!(a&&s>o))return!1;var f=i.get(h),p=i.get(r);if(f&&p)return f==r&&p==h;var c=-1,v=!0,S=t&md?new dd():void 0;for(i.set(h,r),i.set(r,h);++c<o;){var O=h[c],x=r[c];if(e)var m=a?e(x,O,c,r,h,i):e(O,x,c,h,r,i);if(m!==void 0){if(m)continue;v=!1;break;}if(S){if(!gd(r,function(T,l){if(!pd(S,l)&&(O===T||n(O,T,t,e,i)))return S.push(l);})){v=!1;break;}}else if(!(O===x||n(O,x,t,e,i))){v=!1;break;}}return i["delete"](h),i["delete"](r),v;}var $n=yd;function Sd(h){var r=-1,t=Array(h.size);return h.forEach(function(e,n){t[++r]=[n,e];}),t;}var xd=Sd;function Td(h){var r=-1,t=Array(h.size);return h.forEach(function(e){t[++r]=e;}),t;}var Md=Td,Jr=Ke,Qr=Ln,Od=lr,Ed=$n,Pd=xd,Ad=Md,Cd=1,Rd=2,Id="[object Boolean]",Ld="[object Date]",bd="[object Error]",Dd="[object Map]",wd="[object Number]",Nd="[object RegExp]",Wd="[object Set]",Bd="[object String]",Fd="[object Symbol]",jd="[object ArrayBuffer]",Ud="[object DataView]",Zr=Jr?Jr.prototype:void 0,qe=Zr?Zr.valueOf:void 0;function zd(h,r,t,e,n,i,a){switch(t){case Ud:if(h.byteLength!=r.byteLength||h.byteOffset!=r.byteOffset)return!1;h=h.buffer,r=r.buffer;case jd:return!(h.byteLength!=r.byteLength||!i(new Qr(h),new Qr(r)));case Id:case Ld:case wd:return Od(+h,+r);case bd:return h.name==r.name&&h.message==r.message;case Nd:case Bd:return h==r+"";case Dd:var o=Pd;case Wd:var s=e&Cd;if(o||(o=Ad),h.size!=r.size&&!s)return!1;var f=a.get(h);if(f)return f==r;e|=Rd,a.set(h,r);var p=Ed(o(h),o(r),e,n,i,a);return a["delete"](h),p;case Fd:if(qe)return qe.call(h)==qe.call(r);}return!1;}var $d=zd,kr=Rn,Gd=1,Hd=Object.prototype,Kd=Hd.hasOwnProperty;function Vd(h,r,t,e,n,i){var a=t&Gd,o=kr(h),s=o.length,f=kr(r),p=f.length;if(s!=p&&!a)return!1;for(var c=s;c--;){var v=o[c];if(!(a?v in r:Kd.call(r,v)))return!1;}var S=i.get(h),O=i.get(r);if(S&&O)return S==r&&O==h;var x=!0;i.set(h,r),i.set(r,h);for(var m=a;++c<s;){v=o[c];var T=h[v],l=r[v];if(e)var d=a?e(l,T,v,r,h,i):e(T,l,v,h,r,i);if(!(d===void 0?T===l||n(T,l,t,e,i):d)){x=!1;break;}m||(m=v=="constructor");}if(x&&!m){var u=h.constructor,g=r.constructor;u!=g&&"constructor"in h&&"constructor"in r&&!(typeof u=="function"&&u instanceof u&&typeof g=="function"&&g instanceof g)&&(x=!1);}return i["delete"](h),i["delete"](r),x;}var Yd=Vd,_e=gn,Xd=$n,Jd=$d,Qd=Yd,qr=Qe,_r=Je,tn=fr,Zd=Sn,kd=1,en="[object Arguments]",rn="[object Array]",we="[object Object]",qd=Object.prototype,nn=qd.hasOwnProperty;function _d(h,r,t,e,n,i){var a=_r(h),o=_r(r),s=a?rn:qr(h),f=o?rn:qr(r);s=s==en?we:s,f=f==en?we:f;var p=s==we,c=f==we,v=s==f;if(v&&tn(h)){if(!tn(r))return!1;a=!0,p=!1;}if(v&&!p)return i||(i=new _e()),a||Zd(h)?Xd(h,r,t,e,n,i):Jd(h,r,s,t,e,n,i);if(!(t&kd)){var S=p&&nn.call(h,"__wrapped__"),O=c&&nn.call(r,"__wrapped__");if(S||O){var x=S?h.value():h,m=O?r.value():r;return i||(i=new _e()),n(x,m,t,e,i);}}return v?(i||(i=new _e()),Qd(h,r,t,e,n,i)):!1;}var t0=_d,e0=t0,sn=re;function Gn(h,r,t,e,n){return h===r?!0:h==null||r==null||!sn(h)&&!sn(r)?h!==h&&r!==r:e0(h,r,t,e,Gn,n);}var r0=Gn,n0=r0;function i0(h,r){return n0(h,r);}var s0=i0,oe=/* @__PURE__ */ye(s0);var ee=/*#__PURE__*/function(_yt4){function ee(t){var _this59;_classCallCheck(this,ee);_this59=_callSuper(this,ee,[t]);nt(_this59,"toolsType",ht.Selector);nt(_this59,"tmpPoints",[]);nt(_this59,"workOptions");nt(_this59,"vNodes");nt(_this59,"selectIds");nt(_this59,"selectorColor");nt(_this59,"strokeColor");nt(_this59,"fillColor");nt(_this59,"oldSelectRect");nt(_this59,"canRotate",!1);nt(_this59,"canTextEdit",!1);nt(_this59,"canLock",!1);nt(_this59,"scaleType",$t.all);nt(_this59,"toolsTypes");nt(_this59,"shapeOpt");nt(_this59,"textOpt");nt(_this59,"isLocked");_this59.workOptions=t.toolsOpt,_this59.vNodes=t.vNodes;return _this59;}_inherits(ee,_yt4);return _createClass(ee,[{key:"computSelector",value:function computSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var e=Wt(this.tmpPoints);if(e.w===0||e.h===0)return{selectIds:[],intersectRect:void 0,subNodeMap:/* @__PURE__ */new Map()};var _this$vNodes$getRectI=this.vNodes.getRectIntersectRange(e,t),n=_this$vNodes$getRectI.rectRange,i=_this$vNodes$getRectI.nodeRange;return{selectIds:_toConsumableArray(i.keys()),intersectRect:n,subNodeMap:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=this.tmpPoints.length,n=t.length;if(n>1){var i=new Tt(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);}}},{key:"drawSelector",value:function drawSelector(t){var _this60=this;var e=t.drawRect,n=t.subNodeMap,i=t.selectorId,a=t.layer,o=t.isService,s=new ne({pos:[e.x,e.y],anchor:[0,0],size:[e.w,e.h],id:i,name:i,zIndex:1e3}),f=[];if(o){var p=new or({normalize:!0,pos:[e.w/2,e.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:e.w,height:e.h,name:ee.selectorBorderId});f.push(p);}n.forEach(function(p,c){var v=[p.rect.x+p.rect.w/2-e.x,p.rect.y+p.rect.h/2-e.y],S=new or({normalize:!0,pos:v,lineWidth:1,strokeColor:n.size>1?_this60.selectorColor||_this60.workOptions.strokeColor:void 0,width:p.rect.w,height:p.rect.h,id:"selector-".concat(c),name:"selector-".concat(c)});f.push(S);}),f&&s.append.apply(s,f),(a==null?void 0:a.parent).appendChild(s);}},{key:"draw",value:function draw(t,e,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var s,f;var a=n.intersectRect,o=n.subNodeMap;(f=(s=e.parent)==null?void 0:s.getElementById(t))==null||f.remove(),a&&this.drawSelector({drawRect:a,subNodeMap:o,selectorId:t,layer:e,isService:i});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(t){this.scaleType=$t.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;var e=/* @__PURE__ */new Set();var n;var _iterator8=_createForOfIteratorHelper(t.values()),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var i=_step8.value;var a=i.opt,o=i.canRotate,s=i.scaleType,f=i.toolsType;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=o,this.scaleType=s),s===$t.none&&(this.scaleType=s),f===ht.Image&&(n=i);}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}e.size&&(this.toolsTypes=_toConsumableArray(e)),n&&(t.size===1?(this.canLock=!0,n.opt.locked&&(this.isLocked=!0,this.scaleType=$t.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));}},{key:"getChildrenPoints",value:function getChildrenPoints(){var t,e;if(this.scaleType===$t.both&&((t=this.selectIds)==null?void 0:t.length)===1){var n=this.selectIds[0],i=(e=this.vNodes.get(n))==null?void 0:e.op;if(i){var a=[];for(var o=0;o<i.length;o+=3)a.push([i[o],i[o+1]]);return a;}}}},{key:"consume",value:function consume(t){var _t$data2=t.data,e=_t$data2.op,n=_t$data2.workState;var 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);var a=this.computSelector();if(this.selectIds&&oe(this.selectIds,a.selectIds))return{type:ct.None};this.selectIds=a.selectIds;var o=a.intersectRect;this.getSelecteorInfo(a.subNodeMap),this.draw(ee.selectorId,this.fullLayer,a),this.oldSelectRect=o;var s=this.getChildrenPoints();return{type:ct.Select,dataType:Mt.Local,rect:Ot(o,i),selectIds:a.selectIds,opt:this.workOptions,selectRect:o,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:s,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt};}},{key:"consumeAll",value:function consumeAll(){var e,n;var t=this.oldSelectRect;if(!((e=this.selectIds)!=null&&e.length)&&this.tmpPoints[0]&&this.selectSingleTool(this.tmpPoints[0].XY,ee.selectorId,!1),(n=this.selectIds)!=null&&n.length&&(t=this.selectedByIds(this.selectIds)),t){var i=this.getChildrenPoints();return{type:ct.Select,dataType:Mt.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};}},{key:"consumeService",value:function consumeService(){}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"clearSelectData",value:function clearSelectData(){this.selectIds=void 0,this.oldSelectRect=void 0;}},{key:"selectSingleTool",value:function selectSingleTool(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:ee.selectorId;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(t.length===2){var i=t[0],a=t[1];var o;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:i,y:a,w:0,h:0},!1),s=_this$vNodes$getRectI2.nodeRange,f=_toConsumableArray(s.values()).sort(function(p,c){return(c.opt.zIndex||0)-(p.opt.zIndex||0);});var _iterator9=_createForOfIteratorHelper(f),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _p7=_step9.value;var _c5=this.fullLayer.getElementsByName(_p7.name);if(kn(_c5).find(function(S){return S.isPointCollision(i,a);})){o=_p7;break;}}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}if(o){var p=o.name;if(!oe(this.oldSelectRect,o.rect)){var c=/* @__PURE__ */new Map([[p,o]]);this.getSelecteorInfo(c),this.draw(e,this.fullLayer,{intersectRect:o.rect,subNodeMap:c,selectIds:this.selectIds||[]},n);}this.selectIds=[p],this.oldSelectRect=o.rect;}}}},{key:"unSelectedAllIds",value:function unSelectedAllIds(){var t;var _iterator10=_createForOfIteratorHelper(this.vNodes.curNodeMap.entries()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _step10$value=_slicedToArray(_step10.value,2),_e5=_step10$value[0],n=_step10$value[1];n.isSelected&&(t=Ot(t,n.rect),this.vNodes.unSelected(_e5));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}return t;}},{key:"unSelectedByIds",value:function unSelectedByIds(t){var e;var _iterator11=_createForOfIteratorHelper(t),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var n=_step11.value;var i=this.vNodes.get(n);i&&i.isSelected&&(e=Ot(e,i.rect),this.vNodes.unSelected(n));}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}return e;}},{key:"selectedByIds",value:function selectedByIds(t){var e;var _iterator12=_createForOfIteratorHelper(t),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var n=_step12.value;var i=this.vNodes.get(n);i&&(e=Ot(e,i.rect),this.vNodes.selected(n));}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}return e;}},{key:"getSelectorRect",value:function getSelectorRect(t,e){var o;var n;var i=(o=t.parent)==null?void 0:o.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;}},{key:"isCanFillColor",value:function isCanFillColor(t){return t===ht.Ellipse||t===ht.Triangle||t===ht.Rectangle||t===ht.Polygon||t===ht.Star||t===ht.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(t){var e,n,i,a,o,s,f,p,c,v,S,O,x,m,T,l,d,u,g,M,b,_iterator13,_step13,_b11,E,L,D,I,C,G,K,W,_G4,_K3,A,_b12,_E9,_E10,_E11,_E12,_E13,_E14,_E15,R;return _regeneratorRuntime().wrap(function _callee13$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:e=t.updateSelectorOpt,n=t.selectIds,i=t.vNodes,a=t.willSerializeData,o=t.worker,s=t.offset,f=t.scene,p=t.isMainThread,c=this.fullLayer;if(c){_context15.next=3;break;}return _context15.abrupt("return");case 3:S=/* @__PURE__ */new Map(),O=e.box,x=e.workState,m=e.angle,T=e.translate;l=[0,0],d=[1,1],u=[0,0];if(!(O||T||kt(m))){_context15.next=9;break;}if(!(x===Rt.Start)){_context15.next=8;break;}return _context15.abrupt("return",(i.setTarget(),{type:ct.Select,dataType:Mt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:if(g=i.getLastTarget(),g&&O){n==null||n.forEach(function(E){var L=g==null?void 0:g.get(E);b=Ot(b,L==null?void 0:L.rect);}),b&&(d=[O.w/b.w,O.h/b.h],l=[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;}case 9:if(!n){_context15.next=55;break;}_iterator13=_createForOfIteratorHelper(n);_context15.prev=11;_iterator13.s();case 13:if((_step13=_iterator13.n()).done){_context15.next=47;break;}_b11=_step13.value;E=i.get(_b11);if(!E){_context15.next=45;break;}L=E.toolsType;D=(c==null?void 0:c.getElementsByName(_b11))[0];if(!D){_context15.next=45;break;}I=_objectSpread({},e);C=void 0;if(!L){_context15.next=45;break;}if(C=g==null?void 0:g.get(_b11),C&&O){I.boxScale=d;G=[C.rect.x+C.rect.w/2,C.rect.y+C.rect.h/2],K=[G[0]-u[0],G[1]-u[1]];I.boxTranslate=[K[0]*(d[0]-1)+l[0]+(s&&s[0]||0),K[1]*(d[1]-1)+l[1]+(s&&s[1]||0)];}W=Zn(L);if(!(W==null||W.updateNodeOpt({node:D,opt:I,vNodes:i,willSerializeData:a,targetNode:C}),E&&o&&(// itemOpt.angle || itemOpt.translate || itemOpt.boxScale ||
408
+ a&&(I.angle||I.translate)||I.box&&I.workState!==Rt.Start||I.pointMap&&I.pointMap.has(_b11)||L===ht.Text&&(I.fontSize||I.translate||I.textInfos&&I.textInfos.get(_b11))||L===ht.Image&&(I.angle||I.translate||I.boxScale)||L===I.toolsType&&I.willRefresh))){_context15.next=44;break;}_G4=o.createWorkShapeNode({toolsType:L,toolsOpt:E.opt});_G4==null||_G4.setWorkId(_b11);_K3=void 0;if(!(L===ht.Image&&f)){_context15.next=35;break;}_context15.next=32;return _G4.consumeServiceAsync({isFullWork:!0,replaceId:_b11,scene:f,isMainThread:p});case 32:_K3=_context15.sent;_context15.next=42;break;case 35:if(!(L===ht.Text)){_context15.next=41;break;}_context15.next=38;return _G4.consumeServiceAsync({isFullWork:!0,replaceId:_b11});case 38:_K3=_context15.sent;_context15.next=42;break;case 41:_K3=_G4==null?void 0:_G4.consumeService({op:E.op,isFullWork:!0,replaceId:_b11});case 42:_K3&&(E.rect=_K3);D=(c==null?void 0:c.getElementsByName(_b11))[0];case 44:E&&(S.set(_b11,E),v=Ot(v,E.rect));case 45:_context15.next=13;break;case 47:_context15.next=52;break;case 49:_context15.prev=49;_context15.t0=_context15["catch"](11);_iterator13.e(_context15.t0);case 52:_context15.prev=52;_iterator13.f();return _context15.finish(52);case 55:g&&x===Rt.Done&&(i.deleteLastTarget(),g=void 0);A=v;if(!(M&&e.dir&&A&&!s)){_context15.next=89;break;}_b12=[0,0];_context15.t1=e.dir;_context15.next=_context15.t1==="top"?62:_context15.t1==="topLeft"?65:_context15.t1==="topRight"?68:_context15.t1==="bottom"?71:_context15.t1==="bottomLeft"?74:_context15.t1==="bottomRight"?77:_context15.t1==="right"?80:83;break;case 62:_E9=[M.x,M.y+M.h];e.reverseY?_b12[1]=_E9[1]-A.y:_b12[1]=_E9[1]-(A.y+A.h);return _context15.abrupt("break",83);case 65:_E10=[M.x+M.w,M.y+M.h];e.reverseY?_b12[1]=_E10[1]-A.y:_b12[1]=_E10[1]-(A.y+A.h),e.reverseX?_b12[0]=_E10[0]-A.x:_b12[0]=_E10[0]-(A.x+A.w);return _context15.abrupt("break",83);case 68:_E11=[M.x,M.y+M.h];e.reverseY?_b12[1]=_E11[1]-A.y:_b12[1]=_E11[1]-(A.y+A.h),e.reverseX?_b12[0]=_E11[0]-(A.x+A.w):_b12[0]=_E11[0]-A.x;return _context15.abrupt("break",83);case 71:_E12=[M.x,M.y];e.reverseY?_b12[1]=_E12[1]-(A.y+A.h):_b12[1]=_E12[1]-A.y;return _context15.abrupt("break",83);case 74:_E13=[M.x+M.w,M.y];e.reverseY?_b12[1]=_E13[1]-(A.y+A.h):_b12[1]=_E13[1]-A.y,e.reverseX?_b12[0]=_E13[0]-A.x:_b12[0]=_E13[0]-(A.x+A.w);return _context15.abrupt("break",83);case 77:_E14=[M.x,M.y];e.reverseY?_b12[1]=_E14[1]-(A.y+A.h):_b12[1]=_E14[1]-A.y,e.reverseX?_b12[0]=_E14[0]-(A.x+A.w):_b12[0]=_E14[0]-A.x;return _context15.abrupt("break",83);case 80:_E15=[M.x,M.y];e.reverseX?_b12[0]=_E15[0]-(A.x+A.w):_b12[0]=_E15[0]-A.x;return _context15.abrupt("break",83);case 83:if(!(_b12[0]||_b12[1])){_context15.next=89;break;}A.x=A.x+_b12[0];A.y=A.y+_b12[1];_context15.next=88;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{offset:_b12}));case 88:return _context15.abrupt("return",_context15.sent);case 89:this.getSelecteorInfo(S),this.draw(ee.selectorId,c,{selectIds:n||[],subNodeMap:S,intersectRect:A});R=Ot(this.oldSelectRect,A);return _context15.abrupt("return",(this.oldSelectRect=A,{type:ct.Select,dataType:Mt.Local,selectRect:A,renderRect:v,rect:Ot(R,A)}));case 92:case"end":return _context15.stop();}},_callee13,this,[[11,49,52,55]]);}));function updateSelector(_x17){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:ct.Select,dataType:Mt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(Sr,"-");}},{key:"selectServiceNode",value:function selectServiceNode(t,e,n){var _this61=this;var i=e.selectIds,a=this.getRightServiceId(t),o=this.getSelectorRect(this.fullLayer,a);var s;var f=/* @__PURE__ */new Map();return i==null||i.forEach(function(p){var c=_this61.vNodes.get(p);c&&(s=Ot(s,c.rect),f.set(p,c));}),this.getSelecteorInfo(f),this.draw(a,this.fullLayer,{intersectRect:s,selectIds:i||[],subNodeMap:f},n),Ot(s,o);}},{key:"reRenderSelector",value:function reRenderSelector(){var _this62=this;var n;var t;var e=/* @__PURE__ */new Map();return(n=this.selectIds)==null||n.forEach(function(i){var a=_this62.vNodes.get(i);a&&(t=Ot(t,a.rect),e.set(i,a));},this),this.getSelecteorInfo(e),this.draw(ee.selectorId,this.fullLayer,{intersectRect:t,subNodeMap:e,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t;}},{key:"updateSelectIds",value:function updateSelectIds(t){var a;var e;var n=(a=this.selectIds)==null?void 0:a.filter(function(o){return!t.includes(o);});if(n!=null&&n.length&&(e=this.unSelectedByIds(n)),t.length){var o=this.selectedByIds(t);e=Ot(e,o);}this.selectIds=t;var i=this.reRenderSelector();return{bgRect:e,selectRect:i};}},{key:"cursorHover",value:function cursorHover(t){var a,o;var e=this.oldSelectRect;this.selectIds=[];var 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&&!oe(e,this.oldSelectRect))return{type:ct.CursorHover,dataType:Mt.Local,rect:Ot(e,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((o=this.selectIds)!=null&&o.length||(this.oldSelectRect=void 0),e&&!this.oldSelectRect)return this.cursorBlur(),{type:ct.CursorHover,dataType:Mt.Local,rect:e,selectorColor:this.selectorColor,willSyncService:!1};}},{key:"cursorBlur",value:function cursorBlur(){var e,n;this.selectIds=[];var t=(e=this.workId)==null?void 0:e.toString();((n=this.fullLayer)==null?void 0:n.parent).children.forEach(function(i){i.name===t&&i.remove();});}}]);}(yt);nt(ee,"selectorId",qh),nt(ee,"selectorBorderId","selector-border");var Nt=ee;var Hn=/*#__PURE__*/function(_yt5){function Hn(t){var _this63;_classCallCheck(this,Hn);_this63=_callSuper(this,Hn,[t]);nt(_this63,"canRotate",!1);nt(_this63,"scaleType",$t.both);nt(_this63,"toolsType",ht.Arrow);nt(_this63,"tmpPoints",[]);nt(_this63,"workOptions");nt(_this63,"oldRect");nt(_this63,"arrowTipWidth");nt(_this63,"syncTimestamp");_this63.workOptions=t.toolsOpt,_this63.arrowTipWidth=_this63.workOptions.thickness*4,_this63.syncTimestamp=0,_this63.syncUnitTime=50;return _this63;}_inherits(Hn,_yt5);return _createClass(Hn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({workId:o,layer:x});}if(!i){var _x18=Date.now();return _x18-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x18,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var S=Ot(v,this.oldRect);return this.oldRect=v,{rect:S,type:ct.DrawWork,dataType:Mt.Local,workId:o};}},{key:"consumeAll",value:function consumeAll(t){var f,p;var e=t.data,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]};var i=this.fullLayer,a=this.draw({workId:n,layer:i});this.oldRect=a;var o=this.tmpPoints.map(function(c){return[].concat(_toConsumableArray(c.XY),[0]);}).flat(1),s=qt(o);return(p=this.vNodes)==null||p.setInfo(n,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Mt.Local,workId:n,ops:s,isSync:!0,opt:this.workOptions};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_this$workOptions6=this.workOptions,i=_this$workOptions6.strokeColor,a=_this$workOptions6.thickness,o=_this$workOptions6.zIndex,s=_this$workOptions6.scale,f=_this$workOptions6.rotate,p=_this$workOptions6.translate,c=n.worldPosition,v=n.worldScaling,_this$computDrawPoint2=this.computDrawPoints(a),S=_this$computDrawPoint2.points,O=_this$computDrawPoint2.rect,m={pos:[O.x+O.w/2,O.y+O.h/2],name:e,id:e,close:!0,points:S,fillColor:i,strokeColor:i,lineWidth:0,normalize:!0,zIndex:o};s&&(m.scale=s),f&&(m.rotate=f),p&&(m.translate=p);var T=new ce(m);if(this.replace(n,e,T),s||f||p){var _l32=T.getBoundingClientRect();return{x:Math.floor(_l32.x-yt.SafeBorderPadding),y:Math.floor(_l32.y-yt.SafeBorderPadding),w:Math.floor(_l32.width+yt.SafeBorderPadding*2),h:Math.floor(_l32.height+yt.SafeBorderPadding*2)};}return{x:Math.floor(O.x*v[0]+c[0]-yt.SafeBorderPadding),y:Math.floor(O.y*v[1]+c[1]-yt.SafeBorderPadding),w:Math.floor(O.w*v[0]+2*yt.SafeBorderPadding),h:Math.floor(O.h*v[1]+2*yt.SafeBorderPadding)};}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.arrowTipWidth?this.computFullArrowPoints(t):this.computTrianglePoints();}},{key:"computFullArrowPoints",value:function computFullArrowPoints(t){var _this64=this;var e=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=_.Per(e).mul(t/2),i=Tt.Sub(this.tmpPoints[0],n),a=Tt.Add(this.tmpPoints[0],n),o=_.Mul(e,this.arrowTipWidth),s=_.Sub(this.tmpPoints[1],o),f=Tt.Sub(s,n),p=Tt.Add(s,n),c=_.Per(e).mul(t*1.5),v=Tt.Sub(s,c),S=Tt.Add(s,c),O=[i,f,v,this.tmpPoints[1],S,p,a];return{points:O.map(function(x){return Tt.Sub(x,_this64.tmpPoints[0]).XY;}).flat(1),rect:Wt(O),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this65=this;var 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=Tt.Sub(this.tmpPoints[0],n),a=Tt.Add(this.tmpPoints[0],n),o=[i,this.tmpPoints[1],a];return{points:o.map(function(s){return Tt.Sub(s,_this65.tmpPoints[0]).XY;}).flat(1),rect:Wt(o),isTriangle:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Tt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;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;}},{key:"consumeService",value:function consumeService(t){var s,f;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Tt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a});return this.oldRect=o,(f=this.vNodes)==null||f.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var s;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=i.get(e.name);return a&&(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a),(s=o==null?void 0:o.opt)!=null&&s.strokeColor&&(o.opt.strokeColor=a),o&&i.setInfo(e.name,o)),yt.updateNodeOpt(t);}}]);}(yt);var Kn=/*#__PURE__*/function(_yt6){function Kn(t){var _this66;_classCallCheck(this,Kn);_this66=_callSuper(this,Kn,[t]);nt(_this66,"canRotate",!1);nt(_this66,"scaleType",$t.all);nt(_this66,"toolsType",ht.Ellipse);nt(_this66,"tmpPoints",[]);nt(_this66,"workOptions");nt(_this66,"oldRect");nt(_this66,"syncTimestamp");_this66.workOptions=t.toolsOpt,_this66.syncTimestamp=0,_this66.syncUnitTime=50;return _this66;}_inherits(Kn,_yt6);return _createClass(Kn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({workId:o,layer:x,isDrawing:!0});}if(!i){var _x19=Date.now();return _x19-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x19,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var S=Ot(v,this.oldRect);return this.oldRect=v,{rect:S,type:ct.DrawWork,dataType:Mt.Local,workId:o};}},{key:"consumeAll",value:function consumeAll(t){var f,p;var e=t.data,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]};var i=this.fullLayer,a=this.draw({workId:n,layer:i,isDrawing:!1});this.oldRect=a;var o=this.tmpPoints.map(function(c){return[].concat(_toConsumableArray(c.XY),[0]);}).flat(1),s=qt(o);return(p=this.vNodes)==null||p.setInfo(n,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Mt.Local,workId:n,ops:s,isSync:!0,opt:this.workOptions};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_this$workOptions7=this.workOptions,a=_this$workOptions7.strokeColor,o=_this$workOptions7.fillColor,s=_this$workOptions7.thickness,f=_this$workOptions7.zIndex,p=_this$workOptions7.scale,c=_this$workOptions7.rotate,v=_this$workOptions7.translate,S=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(s),O=_this$computDrawPoint3.radius,x=_this$computDrawPoint3.rect,m=_this$computDrawPoint3.pos,T={pos:m,name:e,id:e,radius:O,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0},l={name:e,id:e,zIndex:f,pos:m,anchor:[0.5,0.5],size:[x.w,x.h]};p&&(l.scale=p),c&&(l.rotate=c),v&&(l.translate=v);var d=new ne(l);if(i){var M=new he({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/S[0],1/S[1]]});d.append(M);}var u=new Vh(_objectSpread(_objectSpread({},T),{},{pos:[0,0]}));d.append(u),this.replace(n,e,d);var g=d.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)};}},{key:"computDrawPoints",value:function computDrawPoints(t){var 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)]};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Tt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;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;}},{key:"consumeService",value:function consumeService(t){var s,f;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Tt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(f=this.vNodes)==null||f.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var p,c;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=i.get(e.name);var f=e;return e.tagName==="GROUP"&&(f=e.children[0]),a&&(f.setAttribute("strokeColor",a),(p=s==null?void 0:s.opt)!=null&&p.strokeColor&&(s.opt.strokeColor=a)),o&&(o==="transparent"?f.setAttribute("fillColor","rgba(0,0,0,0)"):f.setAttribute("fillColor",o),(c=s==null?void 0:s.opt)!=null&&c.fillColor&&(s.opt.fillColor=o)),s&&i.setInfo(e.name,s),yt.updateNodeOpt(t);}}]);}(yt);var o0=fe,a0=re,l0="[object Boolean]";function c0(h){return h===!0||h===!1||a0(h)&&o0(h)==l0;}var f0=c0,se=/* @__PURE__ */ye(f0);var Vn=/*#__PURE__*/function(_yt7){function Vn(t){var _this67;_classCallCheck(this,Vn);_this67=_callSuper(this,Vn,[t]);nt(_this67,"canRotate",!0);nt(_this67,"scaleType",$t.all);nt(_this67,"toolsType",ht.Rectangle);nt(_this67,"tmpPoints",[]);nt(_this67,"workOptions");nt(_this67,"oldRect");nt(_this67,"syncTimestamp");_this67.workOptions=t.toolsOpt,_this67.syncTimestamp=0,_this67.syncUnitTime=50;return _this67;}_inherits(Vn,_yt7);return _createClass(Vn,[{key:"transformData",value:function transformData(){var 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]];}},{key:"computDrawPoints",value:function computDrawPoints(t){var e=this.workOptions.thickness,n=[];var _iterator14=_createForOfIteratorHelper(t),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var o=_step14.value;n.push(_construct(_,_toConsumableArray(o)));}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}var i=Wt(n,e),a=[i.x+i.w/2,i.y+i.h/2];return{rect:i,pos:a,points:n.map(function(o){return o.XY;}).flat(1)};}},{key:"consume",value:function consume(t){var x;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(x=e==null?void 0:e.workId)==null?void 0:x.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v=this.transformData();var S;if(i||a){var m=n?this.fullLayer:this.drawLayer||this.fullLayer;S=this.draw({ps:v,workId:o,layer:m,isDrawing:!0});}if(!i){var _m9=Date.now();return _m9-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_m9,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:v.flat(1),isSync:!0,index:0}):{type:ct.None};}var O=Ot(S,this.oldRect);return this.oldRect=S,{rect:O,type:ct.DrawWork,dataType:Mt.Local,workId:o};}},{key:"consumeAll",value:function consumeAll(t){var p,c;var e=t.data,n=(p=e==null?void 0:e.workId)==null?void 0:p.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};var i=this.transformData(),a=this.fullLayer,o=this.draw({ps:i,workId:n,layer:a,isDrawing:!1});this.oldRect=o;var s=i.flat(1),f=qt(s);return(c=this.vNodes)==null||c.setInfo(n,{rect:o,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),{rect:o,type:ct.FullWork,dataType:Mt.Local,workId:n,ops:f,opt:this.workOptions,isSync:!0};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,a=t.ps,o=t.replaceId,_this$workOptions8=this.workOptions,s=_this$workOptions8.strokeColor,f=_this$workOptions8.fillColor,p=_this$workOptions8.thickness,c=_this$workOptions8.zIndex,v=_this$workOptions8.scale,S=_this$workOptions8.rotate,O=_this$workOptions8.translate,x=_this$workOptions8.textOpt,m=n.worldPosition,T=n.worldScaling,_this$computDrawPoint4=this.computDrawPoints(a),l=_this$computDrawPoint4.points,d=_this$computDrawPoint4.rect,u=_this$computDrawPoint4.pos,g={close:!0,normalize:!0,points:l,lineWidth:p,fillColor:f!=="transparent"&&f||void 0,strokeColor:s,lineJoin:"round"},M={x:Math.floor(d.x*T[0]+m[0]-yt.SafeBorderPadding),y:Math.floor(d.y*T[1]+m[1]-yt.SafeBorderPadding),w:Math.floor(d.w*T[0]+2*yt.SafeBorderPadding),h:Math.floor(d.h*T[0]+2*yt.SafeBorderPadding)},A=new ne({name:e,id:e,zIndex:c,pos:u,anchor:[0.5,0.5],size:[d.w,d.h],scale:v,rotate:S,translate:O}),R=new ce(_objectSpread(_objectSpread({},g),{},{pos:[0,0]}));if(A.appendChild(R),i){var b=new he({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:s,lineWidth:1,scale:[1/T[0],1/T[1]]});A.appendChild(b);}if(this.replace(n,o||e,A),v||S||O){var _b13=A.getBoundingClientRect();return{x:Math.floor(_b13.x-yt.SafeBorderPadding),y:Math.floor(_b13.y-yt.SafeBorderPadding),w:Math.floor(_b13.width+2*yt.SafeBorderPadding),h:Math.floor(_b13.height+2*yt.SafeBorderPadding)};}return M;}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Tt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;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;}},{key:"consumeService",value:function consumeService(t){var p,c;var e=t.op,n=t.isFullWork,i=t.replaceId,a=(p=this.workId)==null?void 0:p.toString();if(!a)return;var o=[];for(var v=0;v<e.length;v+=3)o.push([e[v],e[v+1],e[v+2]]);var s=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({ps:o,workId:a,layer:s,isDrawing:!1,replaceId:i});return this.oldRect=f,(c=this.vNodes)==null||c.setInfo(a,{rect:f,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&yt.getCenterPos(f,s)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var T,l;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.fontColor,f=n.fontBgColor,p=n.bold,c=n.italic,v=n.lineThrough,S=n.underline,O=n.fontSize,x=i.get(e.name);var 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)),o&&(o==="transparent"?m.setAttribute("fillColor","rgba(0,0,0,0)"):m.setAttribute("fillColor",o),(l=x==null?void 0:x.opt)!=null&&l.fillColor&&(x.opt.fillColor=o)),x!=null&&x.opt.textOpt){var d=x.opt.textOpt;s&&d.fontColor&&(d.fontColor=s),f&&d.fontBgColor&&(d.fontBgColor=f),p&&(d.bold=p),c&&(d.italic=c),se(v)&&(d.lineThrough=v),se(S)&&(d.underline=S),O&&(d.fontSize=O);}return x&&i.setInfo(e.name,x),yt.updateNodeOpt(t);}}]);}(yt);var Yn=/*#__PURE__*/function(_yt8){function Yn(t){var _this68;_classCallCheck(this,Yn);_this68=_callSuper(this,Yn,[t]);nt(_this68,"canRotate",!1);nt(_this68,"scaleType",$t.all);nt(_this68,"toolsType",ht.Star);nt(_this68,"tmpPoints",[]);nt(_this68,"workOptions");nt(_this68,"oldRect");nt(_this68,"syncTimestamp");_this68.workOptions=t.toolsOpt,_this68.syncTimestamp=0,_this68.syncUnitTime=50;return _this68;}_inherits(Yn,_yt8);return _createClass(Yn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({workId:o,layer:x,isDrawing:!0});}if(!i){var _x20=Date.now();return _x20-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x20,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var S=Ot(v,this.oldRect);return this.oldRect=v,{rect:S,type:ct.DrawWork,dataType:Mt.Local,workId:o// op: this.tmpPoints.map(c=>[...c.XY,0]).flat(1)
409
+ };}},{key:"consumeAll",value:function consumeAll(t){var f,p;var e=t.data,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]};var i=this.fullLayer,a=this.draw({workId:n,layer:i,isDrawing:!1});this.oldRect=a;var o=this.tmpPoints.map(function(c){return[].concat(_toConsumableArray(c.XY),[0]);}).flat(1),s=qt(o);return(p=this.vNodes)==null||p.setInfo(n,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Mt.Local,workId:n,ops:s,isSync:!0,opt:this.workOptions};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_this$workOptions9=this.workOptions,a=_this$workOptions9.strokeColor,o=_this$workOptions9.fillColor,s=_this$workOptions9.thickness,f=_this$workOptions9.zIndex,p=_this$workOptions9.vertices,c=_this$workOptions9.innerVerticeStep,v=_this$workOptions9.innerRatio,S=_this$workOptions9.scale,O=_this$workOptions9.rotate,x=_this$workOptions9.translate,m=n.worldScaling,_this$computDrawPoint5=this.computDrawPoints(s,p,c,v),T=_this$computDrawPoint5.rect,l=_this$computDrawPoint5.pos,d=_this$computDrawPoint5.points,u={close:!0,points:d,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0,lineJoin:"round"},g={name:e,id:e,zIndex:f,pos:l,anchor:[0.5,0.5],size:[T.w,T.h],className:"".concat(l[0],",").concat(l[1])};S&&(g.scale=S),O&&(g.rotate=O),x&&(g.translate=x);var M=new ne(g);if(i){var b=new he({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/m[0],1/m[1]]});M.append(b);}var A=new ce(_objectSpread(_objectSpread({},u),{},{pos:[0,0]}));M.append(A),this.replace(n,e,M);var R=M.getBoundingClientRect();return{x:Math.floor(R.x-yt.SafeBorderPadding),y:Math.floor(R.y-yt.SafeBorderPadding),w:Math.floor(R.width+yt.SafeBorderPadding*2),h:Math.floor(R.height+yt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e,n,i){var a=Wt(this.tmpPoints),o=[Math.floor(a.x+a.w/2),Math.floor(a.y+a.h/2)],s=Fn(a.w,a.h),f=Math.floor(Math.min(a.w,a.h)/2),p=i*f,c=[],v=2*Math.PI/e;for(var O=0;O<e;O++){var x=O*v-0.5*Math.PI;var m=void 0,_T41=void 0;O%n===1?(m=p*s[0]*Math.cos(x),_T41=p*s[1]*Math.sin(x)):(m=f*s[0]*Math.cos(x),_T41=f*s[1]*Math.sin(x),c.push(m,_T41)),c.push(m,_T41);}return{rect:Wt(this.tmpPoints,t),pos:o,points:c};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Tt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||Tt.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;}},{key:"consumeService",value:function consumeService(t){var s,f;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Tt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(f=this.vNodes)==null||f.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,f=n.vertices,p=n.innerVerticeStep,c=n.innerRatio,v=i.get(e.name),S=v==null?void 0:v.opt;var O=e;return e.tagName==="GROUP"&&(O=e.children[0]),a&&(O.setAttribute("strokeColor",a),S!=null&&S.strokeColor&&(S.strokeColor=a)),o&&(o==="transparent"?O.setAttribute("fillColor","rgba(0,0,0,0)"):O.setAttribute("fillColor",o),S!=null&&S.fillColor&&(S.fillColor=o)),s===ht.Star&&(f&&(S.vertices=f),p&&(S.innerVerticeStep=p),c&&(S.innerRatio=c)),v&&i.setInfo(e.name,_objectSpread(_objectSpread({},v),{},{opt:S})),yt.updateNodeOpt(t);}}]);}(yt);var Xn=/*#__PURE__*/function(_yt9){function Xn(t){var _this69;_classCallCheck(this,Xn);_this69=_callSuper(this,Xn,[t]);nt(_this69,"canRotate",!1);nt(_this69,"scaleType",$t.all);nt(_this69,"toolsType",ht.Polygon);nt(_this69,"tmpPoints",[]);nt(_this69,"workOptions");nt(_this69,"oldRect");nt(_this69,"syncTimestamp");_this69.workOptions=t.toolsOpt,_this69.syncTimestamp=0,_this69.syncUnitTime=50;return _this69;}_inherits(Xn,_yt9);return _createClass(Xn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({workId:o,layer:x,isDrawing:!0});}if(!i){var _x21=Date.now();return _x21-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x21,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var S=Ot(v,this.oldRect);return this.oldRect=v,{rect:S,type:ct.DrawWork,dataType:Mt.Local,workId:o};}},{key:"consumeAll",value:function consumeAll(t){var f,p;var e=t.data,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]};var i=this.fullLayer,a=this.draw({workId:n,layer:i,isDrawing:!1});this.oldRect=a;var o=this.tmpPoints.map(function(c){return[].concat(_toConsumableArray(c.XY),[0]);}).flat(1),s=qt(o);return(p=this.vNodes)==null||p.setInfo(n,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Mt.Local,workId:n,ops:s,isSync:!0,opt:this.workOptions};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_this$workOptions10=this.workOptions,a=_this$workOptions10.strokeColor,o=_this$workOptions10.fillColor,s=_this$workOptions10.thickness,f=_this$workOptions10.zIndex,p=_this$workOptions10.vertices,c=_this$workOptions10.scale,v=_this$workOptions10.rotate,S=_this$workOptions10.translate,O=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(s,p),x=_this$computDrawPoint6.rect,m=_this$computDrawPoint6.pos,T=_this$computDrawPoint6.points,l={close:!0,points:T,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0,lineJoin:"round"},d={name:e,id:e,zIndex:f,pos:m,anchor:[0.5,0.5],size:[x.w,x.h]};c&&(d.scale=c),v&&(d.rotate=v),S&&(d.translate=S);var u=new ne(d);if(i){var A=new he({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/O[0],1/O[1]]});u.append(A);}var g=new ce(_objectSpread(_objectSpread({},l),{},{pos:[0,0]}));u.append(g),this.replace(n,e,u);var 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)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e){var n=Wt(this.tmpPoints),i=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],a=Fn(n.w,n.h),o=Math.floor(Math.min(n.w,n.h)/2),s=[],f=2*Math.PI/e;for(var c=0;c<e;c++){var v=c*f-0.5*Math.PI,S=o*a[0]*Math.cos(v),O=o*a[1]*Math.sin(v);s.push(S,O);}return{rect:Wt(this.tmpPoints,t),pos:i,points:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Tt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||Tt.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;}},{key:"consumeService",value:function consumeService(t){var s,f;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Tt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(f=this.vNodes)==null||f.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,f=n.vertices,p=i.get(e.name),c=p==null?void 0:p.opt;var v=e;return e.tagName==="GROUP"&&(v=e.children[0]),a&&(v.setAttribute("strokeColor",a),c!=null&&c.strokeColor&&(c.strokeColor=a)),o&&(o==="transparent"?v.setAttribute("fillColor","rgba(0,0,0,0)"):v.setAttribute("fillColor",o),c!=null&&c.fillColor&&(c.fillColor=o)),s===ht.Polygon&&f&&(c.vertices=f),p&&i.setInfo(e.name,_objectSpread(_objectSpread({},p),{},{opt:c})),yt.updateNodeOpt(t);}}]);}(yt);var Zt=/*#__PURE__*/function(){function Zt(){_classCallCheck(this,Zt);}return _createClass(Zt,null,[{key:"bezier",value:function bezier(r,t){var e=[];for(var n=0;n<t.length;n+=4){var i=t[n],a=t[n+1],o=t[n+2],s=t[n+3];i&&a&&o&&s?e.push.apply(e,_toConsumableArray(Zt.getBezierPoints(r,i,a,o,s))):i&&a&&o?e.push.apply(e,_toConsumableArray(Zt.getBezierPoints(r,i,a,o))):i&&a?e.push.apply(e,_toConsumableArray(Zt.getBezierPoints(r,i,a))):i&&e.push(i);}return e;}/**
410
+ * @desc 获取点,这里可以设置点的个数
411
+ * @param {number} num 点个数
412
+ * @param {Vec2d} p1 点坐标
413
+ * @param {Vec2d} p2 点坐标
414
+ * @param {Vec2d} p3 点坐标
415
+ * @param {Vec2d} p4 点坐标
416
+ * 如果参数是 num, p1, p2 为一阶贝塞尔
417
+ * 如果参数是 num, p1, c1, p2 为二阶贝塞尔
418
+ * 如果参数是 num, p1, c1, c2, p2 为三阶贝塞尔
419
+ */},{key:"getBezierPoints",value:function getBezierPoints(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:10;var t=arguments.length>1?arguments[1]:undefined;var e=arguments.length>2?arguments[2]:undefined;var n=arguments.length>3?arguments[3]:undefined;var i=arguments.length>4?arguments[4]:undefined;var a=null;var o=[];!n&&!i?a=Zt.oneBezier:n&&!i?a=Zt.twoBezier:n&&i&&(a=Zt.threeBezier);for(var s=0;s<r;s++)a&&o.push(a(s/r,t,e,n,i));return i?o.push(i):n&&o.push(n),o;}/**
420
+ * @desc 一阶贝塞尔
421
+ * @param {number} t 当前百分比
422
+ * @param {Vec2d} p1 起点坐标
423
+ * @param {Vec2d} p2 终点坐标
424
+ */},{key:"oneBezier",value:function oneBezier(r,t,e){var n=t.x+(e.x-t.x)*r,i=t.y+(e.y-t.y)*r;return new _(n,i);}/**
425
+ * @desc 二阶贝塞尔
426
+ * @param {number} t 当前百分比
427
+ * @param {Array} p1 起点坐标
428
+ * @param {Array} p2 终点坐标
429
+ * @param {Array} cp 控制点
430
+ */},{key:"twoBezier",value:function twoBezier(r,t,e,n){var 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);}/**
431
+ * @desc 三阶贝塞尔
432
+ * @param {number} t 当前百分比
433
+ * @param {Array} p1 起点坐标
434
+ * @param {Array} p2 终点坐标
435
+ * @param {Array} cp1 控制点1
436
+ * @param {Array} cp2 控制点2
437
+ */},{key:"threeBezier",value:function threeBezier(r,t,e,n,i){var 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,o=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,o);}}]);}();var Jn=/*#__PURE__*/function(_yt10){function Jn(t){var _this70;_classCallCheck(this,Jn);_this70=_callSuper(this,Jn,[t]);nt(_this70,"canRotate",!1);nt(_this70,"scaleType",$t.all);nt(_this70,"toolsType",ht.SpeechBalloon);nt(_this70,"ratio",0.8);nt(_this70,"tmpPoints",[]);nt(_this70,"workOptions");nt(_this70,"oldRect");nt(_this70,"syncTimestamp");_this70.workOptions=t.toolsOpt,_this70.syncTimestamp=0,_this70.syncUnitTime=50;return _this70;}_inherits(Jn,_yt10);return _createClass(Jn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({workId:o,layer:x,isDrawing:!0});}if(!i){var _x22=Date.now();return _x22-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x22,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var S=Ot(v,this.oldRect);return this.oldRect=v,{rect:S,type:ct.DrawWork,dataType:Mt.Local,workId:o};}},{key:"consumeAll",value:function consumeAll(t){var f,p;var e=t.data,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]};var i=this.fullLayer,a=this.draw({workId:n,layer:i,isDrawing:!1});this.oldRect=a;var o=this.tmpPoints.map(function(c){return[].concat(_toConsumableArray(c.XY),[0]);}).flat(1),s=qt(o);return(p=this.vNodes)==null||p.setInfo(n,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Mt.Local,workId:n,ops:s,isSync:!0,opt:this.workOptions};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_this$workOptions11=this.workOptions,i=_this$workOptions11.strokeColor,a=_this$workOptions11.fillColor,o=_this$workOptions11.thickness,s=_this$workOptions11.zIndex,f=_this$workOptions11.placement,p=_this$workOptions11.scale,c=_this$workOptions11.rotate,v=_this$workOptions11.translate,_this$computDrawPoint7=this.computDrawPoints(o,f),S=_this$computDrawPoint7.rect,O=_this$computDrawPoint7.pos,x=_this$computDrawPoint7.points,m={points:x.map(function(g){return g.XY;}),lineWidth:o,fillColor:a!=="transparent"&&a||void 0,strokeColor:i,normalize:!0,className:"".concat(O[0],",").concat(O[1]),lineJoin:"round",close:!0},T={name:e,id:e,zIndex:s,pos:O,anchor:[0.5,0.5],size:[S.w,S.h]};p&&(T.scale=p),c&&(T.rotate=c),v&&(T.translate=v);var l=new ne(T),d=new ce(_objectSpread(_objectSpread({},m),{},{pos:[0,0]}));l.append(d),this.replace(n,e,l);var u=l.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)};}},{key:"transformControlPoints",value:function transformControlPoints(t){var e=Wt(this.tmpPoints);switch(t){case"bottom":case"bottomLeft":case"bottomRight":{var 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":{var _n4=e.y+e.h*(1-this.ratio);return[new _(e.x,_n4,0),new _(e.x+e.w,_n4,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":{var _n5=e.x+e.w*(1-this.ratio);return[new _(_n5,e.y,0),new _(e.x+e.w,e.y,0),new _(e.x+e.w,e.y+e.h,0),new _(_n5,e.y+e.h,0)];}case"right":case"rightBottom":case"rightTop":{var _n6=e.x+e.w*this.ratio;return[new _(e.x,e.y,0),new _(_n6,e.y,0),new _(_n6,e.y+e.h,0),new _(e.x,e.y+e.h,0)];}}}},{key:"computDrawPoints",value:function computDrawPoints(t,e){var n=Wt(this.tmpPoints),i=this.transformControlPoints(e),a=Math.floor(n.w*0.1),o=Math.floor(n.h*0.1),s=[],f=_.Add(i[0],new _(0,o,0)),p=_.Add(i[0],new _(a,0,0)),c=Zt.getBezierPoints(10,f,i[0],p),v=_.Sub(i[1],new _(a,0,0)),S=_.Add(i[1],new _(0,o,0)),O=Zt.getBezierPoints(10,v,i[1],S),x=_.Sub(i[2],new _(0,o,0)),m=_.Sub(i[2],new _(a,0,0)),T=Zt.getBezierPoints(10,x,i[2],m),l=_.Add(i[3],new _(a,0,0)),d=_.Sub(i[3],new _(0,o,0)),u=Zt.getBezierPoints(10,l,i[3],d),g=a*(1-this.ratio)*10,M=o*(1-this.ratio)*10;switch(e){case"bottom":{var 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));s.push.apply(s,[E,L].concat(_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(O),_toConsumableArray(T),[b]));break;}case"bottomRight":{var _b14=_.Sub(i[2],new _(a*1.1,0,0)),_E16=_.Sub(i[2],new _(a*1.1+g/2,-M,0)),_L9=_.Sub(i[2],new _(a*1.1+g,0,0));s.push.apply(s,[_E16,_L9].concat(_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(O),_toConsumableArray(T),[_b14]));break;}case"bottomLeft":{var _b15=_.Add(i[3],new _(a*1.1+g,0,0)),_E17=_.Add(i[3],new _(a*1.1+g/2,M,0)),_L10=_.Add(i[3],new _(a*1.1,0,0));s.push.apply(s,[_E17,_L10].concat(_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(O),_toConsumableArray(T),[_b15]));break;}case"top":{var _b16=_.Sub(i[1],new _(a*5-g/2,0,0)),_E18=_.Sub(i[1],new _(a*5,M,0)),_L11=_.Sub(i[1],new _(a*5+g/2,0,0));s.push.apply(s,[_E18,_b16].concat(_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),[_L11]));break;}case"topRight":{var _b17=_.Sub(i[1],new _(a*1.1,0,0)),_E19=_.Sub(i[1],new _(a*1.1+g/2,M,0)),_L12=_.Sub(i[1],new _(a*1.1+g,0,0));s.push.apply(s,[_E19,_b17].concat(_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),[_L12]));break;}case"topLeft":{var _b18=_.Add(i[0],new _(a*1.1+g,0,0)),_E20=_.Add(i[0],new _(a*1.1+g/2,-M,0)),_L13=_.Add(i[0],new _(a*1.1,0,0));s.push.apply(s,[_E20,_b18].concat(_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),[_L13]));break;}case"left":{var _b19=_.Add(i[0],new _(0,o*5-M/2,0)),_E21=_.Add(i[0],new _(-g,o*5,0)),_L14=_.Add(i[0],new _(0,o*5+M/2,0));s.push.apply(s,[_E21,_b19].concat(_toConsumableArray(c),_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),[_L14]));break;}case"leftTop":{var _b20=_.Add(i[0],new _(0,o*1.1,0)),_E22=_.Add(i[0],new _(-g,o*1.1+M/2,0)),_L15=_.Add(i[0],new _(0,o*1.1+M,0));s.push.apply(s,[_E22,_b20].concat(_toConsumableArray(c),_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),[_L15]));break;}case"leftBottom":{var _b21=_.Sub(i[3],new _(0,o*1.1+M,0)),_E23=_.Sub(i[3],new _(g,o*1.1+M/2,0)),_L16=_.Sub(i[3],new _(0,o*1.1,0));s.push.apply(s,[_E23,_b21].concat(_toConsumableArray(c),_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),[_L16]));break;}case"right":{var _b22=_.Add(i[1],new _(0,o*5-M/2,0)),_E24=_.Add(i[1],new _(g,o*5,0)),_L17=_.Add(i[1],new _(0,o*5+M/2,0));s.push.apply(s,[_E24,_L17].concat(_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(O),[_b22]));break;}case"rightTop":{var _b23=_.Add(i[1],new _(0,o*1.1,0)),_E25=_.Add(i[1],new _(g,o*1.1+M/2,0)),_L18=_.Add(i[1],new _(0,o*1.1+M,0));s.push.apply(s,[_E25,_L18].concat(_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(O),[_b23]));break;}case"rightBottom":{var _b24=_.Sub(i[2],new _(0,o*1.1+M,0)),_E26=_.Sub(i[2],new _(-g,o*1.1+M/2,0)),_L19=_.Sub(i[2],new _(0,o*1.1,0));s.push.apply(s,[_E26,_L19].concat(_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(O),[_b24]));break;}}var A=Wt(this.tmpPoints,t),R=[Math.floor(A.x+A.w/2),Math.floor(A.y+A.h/2)];return{rect:A,pos:R,points:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Tt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||Tt.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;}},{key:"consumeService",value:function consumeService(t){var s,f;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Tt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(f=this.vNodes)==null||f.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.toolsType,f=n.placement,p=i.get(e.name),c=p==null?void 0:p.opt;var v=e;return e.tagName==="GROUP"&&(v=e.children[0]),a&&(v.setAttribute("strokeColor",a),c!=null&&c.strokeColor&&(c.strokeColor=a)),o&&(o==="transparent"?v.setAttribute("fillColor","rgba(0,0,0,0)"):v.setAttribute("fillColor",o),c!=null&&c.fillColor&&(c.fillColor=o)),s===ht.SpeechBalloon&&f&&(c.placement=f),p&&i.setInfo(e.name,_objectSpread(_objectSpread({},p),{},{opt:c})),yt.updateNodeOpt(t);}}]);}(yt);var be=/*#__PURE__*/function(_yt11){function be(t){var _this71;_classCallCheck(this,be);_this71=_callSuper(this,be,[t]);nt(_this71,"canRotate",!0);nt(_this71,"scaleType",$t.all);nt(_this71,"toolsType",ht.Image);nt(_this71,"tmpPoints",[]);nt(_this71,"workOptions");nt(_this71,"oldRect");_this71.workOptions=t.toolsOpt,_this71.scaleType=be.getScaleType(_this71.workOptions);return _this71;}_inherits(be,_yt11);return _createClass(be,[{key:"consume",value:function consume(){return{type:ct.None};}},{key:"consumeAll",value:function consumeAll(){return{type:ct.None};}},{key:"draw",value:function draw(t){var e=t.layer,n=t.workId,i=t.replaceId,a=t.imageBitmap,o=t.isMainThread,_this$workOptions12=this.workOptions,s=_this$workOptions12.centerX,f=_this$workOptions12.centerY,p=_this$workOptions12.width,c=_this$workOptions12.height,v=_this$workOptions12.rotate,S=_this$workOptions12.zIndex,O=!!e.parent.gl,x={anchor:[0.5,0.5],pos:[s,f],name:n,size:[p,c],zIndex:S,rotate:!o&&!O&&180+(v||0)||v,// rotate,
438
+ texture:a},m=new Jh(x);this.replace(e,i||n,m);var T=m.getBoundingClientRect();if(T)return{x:Math.floor(T.x-yt.SafeBorderPadding),y:Math.floor(T.y-yt.SafeBorderPadding),w:Math.floor(T.width+yt.SafeBorderPadding*2),h:Math.floor(T.height+yt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(t){var c,v,S,O,e,n,i,a,_this$workOptions13,o,s,f,p,x,m;return _regeneratorRuntime().wrap(function _callee14$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:e=t.isFullWork,n=t.replaceId,i=t.scene,a=t.isMainThread,_this$workOptions13=this.workOptions,o=_this$workOptions13.src,s=_this$workOptions13.uuid,f=((c=this.workId)==null?void 0:c.toString())||s,p=e?this.fullLayer:this.drawLayer||this.fullLayer;if(!o){_context16.next=7;break;}_context16.next=4;return i.preload({id:s,src:this.workOptions.src});case 4:x=_context16.sent;m=this.draw({workId:f,layer:p,replaceId:n,imageBitmap:x[0],isMainThread:a});return _context16.abrupt("return",(this.oldRect=f&&((S=(v=this.vNodes)==null?void 0:v.get(f))==null?void 0:S.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,p)}),m));case 7:case"end":return _context16.stop();}},_callee14,this);}));function consumeServiceAsync(_x23){return _consumeServiceAsync.apply(this,arguments);}return consumeServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getScaleType",value:function getScaleType(t){var e=t.uniformScale,n=t.rotate;return e!==!1||n&&Math.abs(n)%90>0?$t.proportional:$t.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=t.targetNode,o=n.translate,s=n.box,f=n.boxScale,p=n.boxTranslate,c=n.angle,v=n.isLocked,S=n.zIndex,O=a&&Jt(a)||i.get(e.name);if(!O)return;var x=e.parent;if(x){if(kt(S)&&(e.setAttribute("zIndex",S),O.opt.zIndex=S),se(v)&&(O.opt.locked=v),s&&p&&f){var _O$opt=O.opt,m=_O$opt.centerX,_T42=_O$opt.centerY,_l33=_O$opt.width,d=_O$opt.height,u=_O$opt.uniformScale,g=_O$opt.rotate,M=Math.min(f[0],f[1]),A=u!==!1?[M,M]:f,R=Nn({x:m-_l33/2,y:_T42-d/2,w:_l33,h:d},g||0),b=wh(R,new _(m,_T42),A),E=Nh(b,new _(m,_T42),-(g||0)),L=Wt(E);O.opt.width=Math.round(L.w),O.opt.height=Math.round(L.h);var D=[p[0]/x.worldScaling[0],p[1]/x.worldScaling[1]];O.opt.centerX=m+D[0],O.opt.centerY=_T42+D[1];var I=[O.centerPos[0]+D[0],O.centerPos[1]+D[1]];if(O.centerPos=I,a){var C=Bn(O.rect,f);C=Ie(C,D),O.rect=C;}else{var _C7=yt.getRectFromLayer(x,e.name);O.rect=_C7||O.rect;}}else if(o){if(O.opt.centerX=O.opt.centerX+o[0],O.opt.centerY=O.opt.centerY+o[1],O.centerPos=[O.centerPos[0]+o[0],O.centerPos[1]+o[1]],a){var _m10=[o[0]*x.worldScaling[0],o[1]*x.worldScaling[1]],_T43=Ie(O.rect,_m10);O.rect=_T43;}else{var _m11=yt.getRectFromLayer(x,e.name);O.rect=_m11||O.rect;}}else if(kt(c))if(O.opt.rotate=c,O.scaleType=be.getScaleType(O.opt),a){var _m12=Wn(O.rect,c);O.rect=_m12;}else{var _m13=yt.getRectFromLayer(x,e.name);O.rect=_m13||O.rect;}return O&&i.setInfo(e.name,O),O==null?void 0:O.rect;}}}]);}(yt);var Qn=/*#__PURE__*/function(_yt12){function Qn(t){var _this72;_classCallCheck(this,Qn);_this72=_callSuper(this,Qn,[t]);nt(_this72,"canRotate",!1);nt(_this72,"scaleType",$t.both);nt(_this72,"toolsType",ht.Straight);nt(_this72,"tmpPoints",[]);nt(_this72,"workOptions");nt(_this72,"oldRect");nt(_this72,"straightTipWidth");nt(_this72,"syncTimestamp");_this72.workOptions=t.toolsOpt,_this72.straightTipWidth=_this72.workOptions.thickness/2,_this72.syncTimestamp=0,_this72.syncUnitTime=50;return _this72;}_inherits(Qn,_yt12);return _createClass(Qn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({workId:o,layer:x});}if(!i){var _x24=Date.now();return _x24-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x24,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var S=Ot(v,this.oldRect);return this.oldRect=v,{rect:S,type:ct.DrawWork,dataType:Mt.Local,workId:o};}},{key:"consumeAll",value:function consumeAll(t){var f,p;var e=t.data,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]};var i=this.fullLayer,a=this.draw({workId:n,layer:i});this.oldRect=a;var o=this.tmpPoints.map(function(c){return[].concat(_toConsumableArray(c.XY),[0]);}).flat(1),s=qt(o);return(p=this.vNodes)==null||p.setInfo(n,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Mt.Local,workId:n,ops:s,isSync:!0,opt:this.workOptions};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_this$workOptions14=this.workOptions,i=_this$workOptions14.strokeColor,a=_this$workOptions14.thickness,o=_this$workOptions14.zIndex,s=_this$workOptions14.scale,f=_this$workOptions14.rotate,p=_this$workOptions14.translate,c=n.worldPosition,v=n.worldScaling,_this$computDrawPoint8=this.computDrawPoints(a),S=_this$computDrawPoint8.d,O=_this$computDrawPoint8.rect,x=[O.x+O.w/2,O.y+O.h/2],m={pos:x,name:e,id:e,d:S,fillColor:i,strokeColor:i,lineWidth:0,className:"".concat(x[0],",").concat(x[1]),normalize:!0,zIndex:o};s&&(m.scale=s),f&&(m.rotate=f),p&&(m.translate=p);var T=new he(m);if(this.replace(n,e,T),f||s||p){var d=T.getBoundingClientRect();return{x:Math.floor(d.x-yt.SafeBorderPadding),y:Math.floor(d.y-yt.SafeBorderPadding),w:Math.floor(d.width+yt.SafeBorderPadding*2),h:Math.floor(d.height+yt.SafeBorderPadding*2)};}return{x:Math.floor(O.x*v[0]+c[0]-yt.SafeBorderPadding),y:Math.floor(O.y*v[1]+c[1]-yt.SafeBorderPadding),w:Math.floor(O.w*v[0]+2*yt.SafeBorderPadding),h:Math.floor(O.h*v[1]+2*yt.SafeBorderPadding)};}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(t):this.computDotPoints(t);}},{key:"computFullPoints",value:function computFullPoints(t){var e=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=_.Per(e).mul(t/2),i=Tt.Sub(this.tmpPoints[0],n),a=Tt.Add(this.tmpPoints[0],n),o=Tt.Sub(this.tmpPoints[1],n),s=Tt.Add(this.tmpPoints[1],n),f=Tt.GetSemicircleStroke(this.tmpPoints[1],o,-1,8),p=Tt.GetSemicircleStroke(this.tmpPoints[0],a,-1,8),c=[i,o].concat(_toConsumableArray(f),[s,a],_toConsumableArray(p));return{d:me(c,!0),rect:Wt(c),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(t){var e=Tt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:me(e,!0),rect:Wt(e),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Tt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;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;}},{key:"consumeService",value:function consumeService(t){var s,f;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Tt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a});return this.oldRect=o,(f=this.vNodes)==null||f.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var s;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=i.get(e.name);return a&&(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a),(s=o==null?void 0:o.opt)!=null&&s.strokeColor&&(o.opt.strokeColor=a)),o&&i.setInfo(e.name,o),yt.updateNodeOpt(t);}}]);}(yt);var Ze=/*#__PURE__*/function(_yt13){function Ze(t){var _this73;_classCallCheck(this,Ze);_this73=_callSuper(this,Ze,[t]);nt(_this73,"canRotate",!1);nt(_this73,"scaleType",$t.all);nt(_this73,"toolsType",ht.Text);nt(_this73,"tmpPoints",[]);nt(_this73,"workOptions");nt(_this73,"oldRect");_this73.workOptions=t.toolsOpt;return _this73;}_inherits(Ze,_yt13);return _createClass(Ze,[{key:"consume",value:function consume(){return{type:ct.None};}},{key:"consumeAll",value:function consumeAll(){return{type:ct.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(t){var e,n,i,_this$workOptions15,a,o,s,f,p,c,v,S,O,x;return _regeneratorRuntime().wrap(function _callee15$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:e=t.workId,n=t.layer,i=t.isDrawLabel,_this$workOptions15=this.workOptions,a=_this$workOptions15.boxSize,o=_this$workOptions15.boxPoint,s=_this$workOptions15.zIndex,f=n.worldPosition,p=n.worldScaling;if(!(!o||!a)){_context17.next=3;break;}return _context17.abrupt("return");case 3:c={name:e,id:e,pos:[o[0]+a[0]/2,o[1]+a[1]/2],anchor:[0.5,0.5],size:a,zIndex:s// bgcolor:"rgba(109,212,0,0.5)"
439
+ },v=new ne(c),S={x:o[0],y:o[1],w:a[0],h:a[1]},O=new or({normalize:!0,pos:[0,0],size:a});if(!(v.append(O),i)){_context17.next=15;break;}_context17.t1=i;if(!_context17.t1){_context17.next=10;break;}_context17.next=9;return Ze.createLabels(this.workOptions,v,n);case 9:_context17.t1=_context17.sent;case 10:_context17.t0=_context17.t1;if(_context17.t0){_context17.next=13;break;}_context17.t0=[];case 13:x=_context17.t0;v.append.apply(v,_toConsumableArray(x));case 15:return _context17.abrupt("return",(this.replace(n,e,v),{x:Math.floor(S.x*p[0]+f[0]),y:Math.floor(S.y*p[1]+f[1]),w:Math.floor(S.w*p[0]),h:Math.floor(S.h*p[1])}));case 16:case"end":return _context17.stop();}},_callee15,this);}));function draw(_x25){return _draw3.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(t){var f,p,c,v,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee16$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:e=(f=this.workId)==null?void 0:f.toString();if(e){_context18.next=3;break;}return _context18.abrupt("return");case 3:n=t.isFullWork,i=t.replaceId,a=t.isDrawLabel;this.oldRect=i&&((c=(p=this.vNodes)==null?void 0:p.get(i))==null?void 0:c.rect)||void 0;o=n?this.fullLayer:this.drawLayer||this.fullLayer;_context18.next=8;return this.draw({workId:e,layer:o,isDrawLabel:a||this.workOptions.workState===Rt.Done});case 8:s=_context18.sent;return _context18.abrupt("return",((v=this.vNodes)==null||v.setInfo(e,{rect:s,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,o)}),s));case 10:case"end":return _context18.stop();}},_callee16,this);}));function consumeServiceAsync(_x26){return _consumeServiceAsync2.apply(this,arguments);}return consumeServiceAsync;}()},{key:"updataOptService",value:function updataOptService(){}},{key:"updataOptServiceAsync",value:function(){var _updataOptServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(t){var S,O,e,n,i,a,o,s,f,p,c,v;return _regeneratorRuntime().wrap(function _callee17$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:if(this.workId){_context19.next=2;break;}return _context19.abrupt("return");case 2:e=this.workId.toString(),n=t.fontColor,i=t.fontBgColor,a=t.bold,o=t.italic,s=t.lineThrough,f=t.underline,p=t.zIndex,c=(S=this.vNodes)==null?void 0:S.get(e);if(c){_context19.next=5;break;}return _context19.abrupt("return");case 5:n&&(c.opt.fontColor=n),i&&(c.opt.fontBgColor=i),a&&(c.opt.bold=a),o&&(c.opt.italic=o),se(s)&&(c.opt.lineThrough=s),se(f)&&(c.opt.underline=f),kt(p)&&(c.opt.zIndex=p),this.oldRect=c.rect;_context19.next=8;return this.draw({workId:e,layer:this.fullLayer,isDrawLabel:this.workOptions.workState===Rt.Done});case 8:v=_context19.sent;return _context19.abrupt("return",((O=this.vNodes)==null||O.setInfo(e,{rect:v,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:v&&yt.getCenterPos(v,this.fullLayer)}),v));case 10:case"end":return _context19.stop();}},_callee17,this);}));function updataOptServiceAsync(_x27){return _updataOptServiceAsync.apply(this,arguments);}return updataOptServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(t,e,n){var i,a,o,s,f,p,c,v,S,O,x,m,T,l,d,u,g,M,A,R,b,E,D,_D9,L,_M6,_e$worldScaling,_A3,_R5,_i$_R5$getBoundingCli,_b25,_E27,_L20,_D10,_L21,_D11;return _regeneratorRuntime().wrap(function _callee18$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:i=[],a=t.text.split(","),o=a.length,s=t.fontSize,f=t.lineHeight,p=t.bold,c=t.textAlign,v=t.italic,S=t.boxSize,O=t.fontFamily,x=t.verticalAlign,m=t.fontColor,T=t.fontBgColor,l=t.underline,d=t.lineThrough,u=((n==null?void 0:n.parent).displayRatio||1)*((n==null?void 0:n.worldScaling[0])||1),g=s*u;for(M=0;M<o;M++){A=a[M],R=f||g*1.2;if(A){b={anchor:[0,0.5],text:A,fontSize:g,lineHeight:R,fontFamily:O,fontWeight:p,fillColor:m,bgcolor:T,textAlign:c,fontStyle:v,name:M.toString(),className:"label",scale:[1/u,1/u]},E=[0,0];if(x==="middle"){D=(o-1)/2;E[1]=(M-D)*(f||s*1.2);}if(c==="left"){_D9=S&&-S[0]/2||0;E[0]=v==="italic"&&_D9||_D9+5;}b.pos=E;L=new Yh(b);i.push(L);}}_context20.next=4;return new Promise(function(M){setTimeout(M,0);});case 4:if(!(l||d)){_context20.next=8;break;}_M6=[],_e$worldScaling=_slicedToArray(e.worldScaling,1),_A3=_e$worldScaling[0];for(_R5=0;_R5<i.length;_R5++){_i$_R5$getBoundingCli=i[_R5].getBoundingClientRect(),_b25=_i$_R5$getBoundingCli.width;if(_b25){_E27=i[_R5].getAttribute("pos");if(l){_L20={normalize:!1,pos:[_E27[0],_E27[1]+s/2],lineWidth:Math.floor(s/10),points:[0,0,_b25/_A3,0],strokeColor:m,name:"".concat(_R5,"_underline"),className:"underline"},_D10=new ce(_L20);_M6.push(_D10);}if(d){_L21={normalize:!1,pos:_E27,lineWidth:Math.floor(s/10),points:[0,0,_b25/_A3,0],strokeColor:m,name:"".concat(_R5,"_lineThrough"),className:"lineThrough"},_D11=new ce(_L21);_M6.push(_D11);}}}return _context20.abrupt("return",i.concat(_M6));case 8:return _context20.abrupt("return",i);case 9:case"end":return _context20.stop();}},_callee18);}));function createLabels(_x28,_x29,_x30){return _createLabels.apply(this,arguments);}return createLabels;}()},{key:"updateLabels",value:function(){var _updateLabels=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(t,e,n){var i,a,o;return _regeneratorRuntime().wrap(function _callee19$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:i=t.opt.fontSize,a=((n==null?void 0:n.parent).displayRatio||1)*((n==null?void 0:n.worldScaling[0])||1),o=i*a;e.children.forEach(function(s){s.tagName==="LABEL"&&(s.setAttribute("fontSize",o),s.setAttribute("scale",[1/a,1/a]),s.setAttribute("lineHeight",o*1.2));});case 2:case"end":return _context21.stop();}},_callee19);}));function updateLabels(_x31,_x32,_x33){return _updateLabels.apply(this,arguments);}return updateLabels;}()},{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=t.targetNode,o=n.fontBgColor,s=n.fontColor,f=n.translate,p=n.box,c=n.boxScale,v=n.boxTranslate,S=n.bold,O=n.italic,x=n.lineThrough,m=n.underline,T=n.fontSize,l=n.textInfos,d=n.zIndex,u=a&&Jt(a)||i.get(e.name);if(!u)return;var g=e.parent;if(!g)return;var M=u.opt;if(kt(d)&&(e.setAttribute("zIndex",d),u.opt.zIndex=d),s&&M.fontColor&&(M.fontColor=s,e.children.forEach(function(A){A.tagName==="LABEL"?A.setAttribute("fillColor",s):A.tagName==="POLYLINE"&&A.setAttribute("strokeColor",s);})),o&&M.fontBgColor&&(M.fontBgColor=o,e.children.forEach(function(A){A.tagName==="LABEL"&&A.setAttribute("bgcolor",o);})),S&&(M.bold=S),O&&(M.italic=O),se(x)&&(M.lineThrough=x),se(m)&&(M.underline=m),T&&(M.fontSize=T),p&&v&&c){var A=l==null?void 0:l.get(e.name);if(A){var E=A.fontSize,L=A.boxSize;M.boxSize=L||M.boxSize,M.fontSize=E||M.fontSize;}var R=u.rect,b=Ie(Bn(R,c),v);M.boxPoint=b&&[(b.x-g.worldPosition[0])/g.worldScaling[0],(b.y-g.worldPosition[1])/g.worldScaling[1]];}else if(f&&M.boxPoint&&(M.boxPoint=[M.boxPoint[0]+f[0],M.boxPoint[1]+f[1]],u.centerPos=[u.centerPos[0]+f[0],u.centerPos[1]+f[1]],a)){var _A4=[f[0]/g.worldScaling[0],f[1]/g.worldScaling[1]];u.rect=Ie(u.rect,_A4);}return u&&i.setInfo(e.name,u),u==null?void 0:u.rect;}},{key:"getRectFromLayer",value:function getRectFromLayer(t,e){var n=t.getElementsByName(e)[0];if(n){var i=n.getBoundingClientRect();return{x:Math.floor(i.x),y:Math.floor(i.y),w:Math.floor(i.width),h:Math.floor(i.height)};}}}]);}(yt);function Zn(h){switch(h){case ht.Arrow:return Hn;case ht.Pencil:return Un;case ht.Straight:return Qn;case ht.Ellipse:return Kn;case ht.Polygon:case ht.Triangle:return Xn;case ht.Star:case ht.Rhombus:return Yn;case ht.Rectangle:return Vn;case ht.SpeechBalloon:return Jn;case ht.Text:return Ze;case ht.LaserPen:return zn;case ht.Eraser:return ie;case ht.Selector:return Nt;case ht.Image:return be;}}function xr(h,r){var t=h.toolsType,e=_objectWithoutProperties(h,_excluded);switch(t){case ht.Arrow:return new Hn(e);case ht.Pencil:return new Un(e);case ht.Straight:return new Qn(e);case ht.Ellipse:return new Kn(e);case ht.Polygon:case ht.Triangle:return new Xn(e);case ht.Star:case ht.Rhombus:return new Yn(e);case ht.Rectangle:return new Vn(e);case ht.SpeechBalloon:return new Jn(e);case ht.Text:return new Ze(e);case ht.LaserPen:return new zn(e);case ht.Eraser:return new ie(e,r);case ht.Selector:return e.vNodes?new Nt(_objectSpread(_objectSpread({},e),{},{vNodes:e.vNodes,drawLayer:e.fullLayer})):void 0;case ht.Image:return new be(e);default:return;}}function kn(h){var r=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE"];var _iterator15=_createForOfIteratorHelper(h),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var _e6=_step15.value;if(_e6.tagName==="GROUP"&&_e6.children.length)return kn(_e6.children);_e6.tagName&&t.includes(_e6.tagName)&&r.push(_e6);}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}return r;}var u0=/*#__PURE__*/function(_te2){function u0(){var _this74;_classCallCheck(this,u0);_this74=_callSuper(this,u0,arguments);nt(_this74,"emitEventType",Lt.SetColorNode);return _this74;}_inherits(u0,_te2);return _createClass(u0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(t){var f,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee20$(_context22){while(1)switch(_context22.prev=_context22.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context22.t0=e===Nt.selectorId&&n;if(!_context22.t0){_context22.next=5;break;}_context22.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context22.stop();}},_callee20,this);}));function consumeForLocalWorker(_x34){return _consumeForLocalWorker2.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,o=e.isSync,s=e.textUpdateForWoker,f=n.render||[],p=n.sp||[];if(a){var _iterator16=_createForOfIteratorHelper(i.entries()),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var _step16$value=_slicedToArray(_step16.value,2),c=_step16$value[0],v=_step16$value[1];s&&v.toolsType===ht.Text?p.push(_objectSpread(_objectSpread({},v),{},{workId:c,type:ct.TextUpdate,dataType:Mt.Local,willSyncService:!0})):p.push(_objectSpread(_objectSpread({},v),{},{workId:c,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}}return{render:f,sp:p};}}]);}(te);var h0=/*#__PURE__*/function(_te3){function h0(){var _this75;_classCallCheck(this,h0);_this75=_callSuper(this,h0,arguments);nt(_this75,"emitEventType",Lt.ZIndexNode);return _this75;}_inherits(h0,_te3);return _createClass(h0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee21$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context23.t0=e===Nt.selectorId&&n;if(!_context23.t0){_context23.next=5;break;}_context23.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context23.stop();}},_callee21,this);}));function consumeForLocalWorker(_x35){return _consumeForLocalWorker3.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,o=e.isSync,s=n.render||[],f=n.sp||[];if(a&&f){var _iterator17=_createForOfIteratorHelper(i.entries()),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var _step17$value=_slicedToArray(_step17.value,2),p=_step17$value[0],c=_step17$value[1];f.push(_objectSpread(_objectSpread({},c),{},{workId:p,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}}return{render:s,sp:f};}}]);}(te);var d0=/*#__PURE__*/function(_te4){function d0(){var _this76;_classCallCheck(this,d0);_this76=_callSuper(this,d0,arguments);nt(_this76,"emitEventType",Lt.TranslateNode);return _this76;}_inherits(d0,_te4);return _createClass(d0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(t){var p,c,e,n,i,a,o,s,f;return _regeneratorRuntime().wrap(function _callee22$(_context24){while(1)switch(_context24.prev=_context24.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker,f=t.emitEventType;_context24.t0=e===Nt.selectorId&&n;if(!_context24.t0){_context24.next=9;break;}if(!(n.workState===Rt.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==Rt.Done)){_context24.next=8;break;}_context24.next=6;return(p=this.localWork)==null?void 0:p.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,isSync:!0,textUpdateForWoker:s,emitEventType:f,scene:this.scene,callback:this.updateSelectorCallback});case 6:_context24.next=9;break;case 8:n.workState===Rt.Done&&((c=this.localWork)==null||c.vNodes.deleteLastTarget());case 9:case"end":return _context24.stop();}},_callee22,this);}));function consumeForLocalWorker(_x36){return _consumeForLocalWorker4.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,f=e.isSync,p=e.updateSelectorOpt,c=e.textUpdateForWoker,v=p.workState,S=n.render||[],O=n.sp||[];if(v===Rt.Start)return{sp:[],render:[]};var x=o==null?void 0:o.selectRect;if(s){v===Rt.Doing&&O.push({type:ct.Select,selectIds:a.selectIds,selectRect:x,willSyncService:!0,isSync:!0,points:a.getChildrenPoints(),textOpt:a.textOpt});var _iterator18=_createForOfIteratorHelper(i.entries()),_step18;try{for(_iterator18.s();!(_step18=_iterator18.n()).done;){var _step18$value=_slicedToArray(_step18.value,2),m=_step18$value[0],_T44=_step18$value[1];c&&_T44.toolsType===ht.Text?O.push(_objectSpread(_objectSpread({},_T44),{},{workId:m,type:ct.TextUpdate,dataType:Mt.Local,willSyncService:!0})):O.push(_objectSpread(_objectSpread({},_T44),{},{workId:m,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}}return{render:S,sp:O};}}]);}(te);var g0=/*#__PURE__*/function(_te5){function g0(){var _this77;_classCallCheck(this,g0);_this77=_callSuper(this,g0,arguments);nt(_this77,"emitEventType",Lt.DeleteNode);return _this77;}_inherits(g0,_te5);return _createClass(g0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.RemoveNode){if(n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;if(n===Mt.Service&&i===this.emitEventType)return this.consumeForServiceWorker(t),!0;}}},{key:"consumeForLocalWorker",value:function consumeForLocalWorker(t){if(!this.localWork)return;var e=t.removeIds,n=t.willRefresh,i=t.willSyncService,a=t.viewId;if(!(e!=null&&e.length))return;var o;var s=[],f=[],p=[];var _iterator19=_createForOfIteratorHelper(e),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var c=_step19.value;if(c===Nt.selectorId){var S=this.localWork.workShapes.get(Nt.selectorId);if(!S)return;var O=S.selectIds&&_toConsumableArray(S.selectIds)||[];var _iterator20=_createForOfIteratorHelper(O),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var m=_step20.value;if(this.localWork.vNodes.get(m)){var _l34=this.commandDeleteText(m);_l34&&s.push(_l34);}o=Ot(o,this.localWork.removeNode(m)),p.push(m);}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}var x=S==null?void 0:S.updateSelectIds([]);o=Ot(o,x.bgRect),this.localWork.clearWorkShapeNodeCache(Nt.selectorId),this.localWork.workShapes["delete"](Nt.selectorId),s.push({type:ct.Select,selectIds:[],willSyncService:i});continue;}var v=this.commandDeleteText(c);v&&s.push(v),o=Ot(o,this.localWork.removeNode(c)),p.push(c);}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}i&&s.push({type:ct.RemoveNode,removeIds:p}),o&&n&&f.push({rect:wt(o),clearCanvas:xt.Bg,isClear:!0,viewId:a},{rect:wt(o),drawCanvas:xt.Bg,viewId:a}),(f.length||s.length)&&this.localWork._post({render:f,sp:s});}},{key:"consumeForServiceWorker",value:function consumeForServiceWorker(t){this.serviceWork&&this.serviceWork.removeSelectWork(t);}},{key:"commandDeleteText",value:function commandDeleteText(t){var n;var 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:Mt.Local};}}]);}(te);var p0=/*#__PURE__*/function(_te6){function p0(){var _this78;_classCallCheck(this,p0);_this78=_callSuper(this,p0,arguments);nt(_this78,"emitEventType",Lt.ScaleNode);return _this78;}_inherits(p0,_te6);return _createClass(p0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(t){var o,e,n,i,a;return _regeneratorRuntime().wrap(function _callee23$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willSyncService,a=t.willSerializeData;_context25.t0=e===Nt.selectorId&&n;if(!_context25.t0){_context25.next=5;break;}_context25.next=5;return(o=this.localWork)==null?void 0:o.updateSelector({updateSelectorOpt:n,willSyncService:i,willSerializeData:a,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback.bind(this)});case 5:case"end":return _context25.stop();}},_callee23,this);}));function consumeForLocalWorker(_x37){return _consumeForLocalWorker5.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.workShapeNode,a=t.res,o=t.newServiceStore,s=e.updateSelectorOpt,f=e.willSyncService,p=e.willSerializeData,c=s.workState,v=n.render||[],S=n.sp||[],O=a==null?void 0:a.selectRect;if(c===Rt.Start)return{sp:[],render:[]};if(f){c===Rt.Doing&&S.push({type:ct.Select,selectIds:i.selectIds,selectRect:O,willSyncService:!0,isSync:!0,points:i.getChildrenPoints(),textOpt:i.textOpt}),p&&c===Rt.Done&&S.push({type:ct.Select,selectIds:i.selectIds,selectRect:O,willSyncService:!1,isSync:!0,points:i.getChildrenPoints(),textOpt:i.textOpt});var _iterator21=_createForOfIteratorHelper(o.entries()),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _step21$value=_slicedToArray(_step21.value,2),x=_step21$value[0],m=_step21$value[1];m.toolsType===ht.Text?S.push(_objectSpread(_objectSpread({},m),{},{workId:x,type:ct.TextUpdate,dataType:Mt.Local,willSyncService:!0})):S.push(_objectSpread(_objectSpread({},m),{},{workId:x,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}));}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}}return{render:v,sp:S};}}]);}(te);var v0=/*#__PURE__*/function(_te7){function v0(){var _this79;_classCallCheck(this,v0);_this79=_callSuper(this,v0,arguments);nt(_this79,"emitEventType",Lt.RotateNode);return _this79;}_inherits(v0,_te7);return _createClass(v0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(t){var f,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee24$(_context26){while(1)switch(_context26.prev=_context26.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.emitEventType;_context26.t0=e===Nt.selectorId&&n;if(!_context26.t0){_context26.next=5;break;}_context26.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,emitEventType:s,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback});case 5:case"end":return _context26.stop();}},_callee24,this);}));function consumeForLocalWorker(_x38){return _consumeForLocalWorker6.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.workShapeNode,a=t.res,o=t.newServiceStore,s=e.updateSelectorOpt,f=e.willSyncService,p=e.willSerializeData,c=e.isSync,v=s.workState,S=n.render||[],O=n.sp||[],x=a==null?void 0:a.selectRect;if(f){p&&v===Rt.Done&&O.push({type:ct.Select,selectIds:i.selectIds,selectRect:x,willSyncService:!0,isSync:c,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});var _iterator22=_createForOfIteratorHelper(o.entries()),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var _step22$value=_slicedToArray(_step22.value,2),m=_step22$value[0],_T45=_step22$value[1];O.push(_objectSpread(_objectSpread({},_T45),{},{workId:m,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}}return{render:S,sp:O};}}]);}(te);var m0=/*#__PURE__*/function(_te8){function m0(){var _this80;_classCallCheck(this,m0);_this80=_callSuper(this,m0,arguments);nt(_this80,"emitEventType",Lt.SetFontStyle);return _this80;}_inherits(m0,_te8);return _createClass(m0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(t){var f,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee25$(_context27){while(1)switch(_context27.prev=_context27.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context27.t0=e===Nt.selectorId&&n;if(!_context27.t0){_context27.next=5;break;}_context27.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context27.stop();}},_callee25,this);}));function consumeForLocalWorker(_x39){return _consumeForLocalWorker7.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,f=e.isSync,p=e.updateSelectorOpt,c=e.textUpdateForWoker,v=n.render||[],S=n.sp||[],O=o==null?void 0:o.selectRect;if(s&&S){p.fontSize&&S.push({type:ct.Select,selectIds:a.selectIds,selectRect:O,willSyncService:s,isSync:f,points:a.getChildrenPoints()});var _iterator23=_createForOfIteratorHelper(i.entries()),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var _step23$value=_slicedToArray(_step23.value,2),x=_step23$value[0],m=_step23$value[1];c&&m.toolsType===ht.Text?S.push(_objectSpread(_objectSpread({},m),{},{workId:x,type:ct.TextUpdate,dataType:Mt.Local,willSyncService:!0})):S.push(_objectSpread(_objectSpread({},m),{},{workId:x,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}}return{render:v,sp:S};}}]);}(te);var y0=/*#__PURE__*/function(_te9){function y0(){var _this81;_classCallCheck(this,y0);_this81=_callSuper(this,y0,arguments);nt(_this81,"emitEventType",Lt.SetPoint);return _this81;}_inherits(y0,_te9);return _createClass(y0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26(t){var f,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee26$(_context28){while(1)switch(_context28.prev=_context28.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData,s=t.textUpdateForWoker;_context28.t0=e===Nt.selectorId&&n;if(!_context28.t0){_context28.next=5;break;}_context28.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,emitEventType:this.emitEventType,willSerializeData:o,isSync:!0,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context28.stop();}},_callee26,this);}));function consumeForLocalWorker(_x40){return _consumeForLocalWorker8.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,f=e.isSync,p=n.render||[],c=n.sp||[],v=o==null?void 0:o.selectRect;if(s&&c){var _iterator24=_createForOfIteratorHelper(i.entries()),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var _step24$value=_slicedToArray(_step24.value,2),S=_step24$value[0],O=_step24$value[1];c.push(_objectSpread(_objectSpread({},O),{},{workId:S,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}c.push({type:ct.Select,selectIds:a.selectIds,selectRect:v,willSyncService:s,isSync:f,points:a.getChildrenPoints()});}return{render:p,sp:c};}}]);}(te);var S0=/*#__PURE__*/function(_te10){function S0(){var _this82;_classCallCheck(this,S0);_this82=_callSuper(this,S0,arguments);nt(_this82,"emitEventType",Lt.SetLock);return _this82;}_inherits(S0,_te10);return _createClass(S0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee27$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context29.t0=e===Nt.selectorId&&n;if(!_context29.t0){_context29.next=5;break;}_context29.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context29.stop();}},_callee27,this);}));function consumeForLocalWorker(_x41){return _consumeForLocalWorker9.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,o=t.res,s=e.willSyncService,f=e.isSync,p=e.updateSelectorOpt,c=n.render||[],v=n.sp||[],S=o==null?void 0:o.selectRect;if(s&&v){var _iterator25=_createForOfIteratorHelper(i.entries()),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var _step25$value=_slicedToArray(_step25.value,2),O=_step25$value[0],x=_step25$value[1];v.push(_objectSpread(_objectSpread({},x),{},{workId:O,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}v.push({isLocked:p.isLocked,selectorColor:a.selectorColor,scaleType:a.scaleType,canRotate:a.canRotate,type:ct.Select,selectIds:a.selectIds,selectRect:S,willSyncService:s,isSync:f});}return{render:c,sp:v};}}]);}(te);var x0=/*#__PURE__*/function(_te11){function x0(){var _this83;_classCallCheck(this,x0);_this83=_callSuper(this,x0,arguments);nt(_this83,"emitEventType",Lt.SetShapeOpt);return _this83;}_inherits(x0,_te11);return _createClass(x0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee28$(_context30){while(1)switch(_context30.prev=_context30.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context30.t0=e===Nt.selectorId&&n;if(!_context30.t0){_context30.next=5;break;}_context30.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context30.stop();}},_callee28,this);}));function consumeForLocalWorker(_x42){return _consumeForLocalWorker10.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,o=e.isSync,s=n.render||[],f=n.sp||[];if(a&&f){var _iterator26=_createForOfIteratorHelper(i.entries()),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var _step26$value=_slicedToArray(_step26.value,2),p=_step26$value[0],c=_step26$value[1];f.push(_objectSpread(_objectSpread({},c),{},{workId:p,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}}return{render:s,sp:f};}}]);}(te);var T0=/*#__PURE__*/function(){function T0(r){var _this84=this;_classCallCheck(this,T0);nt(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(r.map(function(t){return[t,_this84.build(t)];}));}return _createClass(T0,[{key:"build",value:function build(r){switch(r){case Lt.TranslateNode:return new d0();case Lt.ZIndexNode:return new h0();case Lt.CopyNode:return new Lh();case Lt.SetColorNode:return new u0();case Lt.DeleteNode:return new g0();case Lt.ScaleNode:return new p0();case Lt.RotateNode:return new v0();case Lt.SetFontStyle:return new m0();case Lt.SetPoint:return new y0();case Lt.SetLock:return new S0();case Lt.SetShapeOpt:return new x0();}}},{key:"registerForWorker",value:function registerForWorker(r,t,e){return this.builders.forEach(function(n){n&&n.registerForWorker(r,t,e);}),this;}},{key:"consumeForWorker",value:function consumeForWorker(r){var _iterator27=_createForOfIteratorHelper(this.builders.values()),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var t=_step27.value;if(t!=null&&t.consume(r))return!0;}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return!1;}}]);}();var $e="cursorhover";var M0=/*#__PURE__*/function(){function M0(r,t){_classCallCheck(this,M0);nt(this,"viewId");nt(this,"scene");nt(this,"scenePath");nt(this,"fullLayer");nt(this,"curNodeMap",/* @__PURE__ */new Map());nt(this,"targetNodeMap",[]);this.viewId=r,this.scene=t;}return _createClass(M0,[{key:"init",value:function init(r){this.fullLayer=r;}},{key:"get",value:function get(r){return this.curNodeMap.get(r);}},{key:"hasRenderNodes",value:function hasRenderNodes(){var r=!1;var _iterator28=_createForOfIteratorHelper(this.curNodeMap.values()),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var t=_step28.value;Uh(t)&&(r=!0);}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return r;}},{key:"has",value:function has(r){return this.curNodeMap.has(r);}},{key:"setInfo",value:function setInfo(r,t){var 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)),se(t.isSelected)&&(e.isSelected=t.isSelected),e.rect?this.curNodeMap.set(r,e):this.curNodeMap["delete"](r);}},{key:"selected",value:function selected(r){this.setInfo(r,{isSelected:!0});}},{key:"unSelected",value:function unSelected(r){this.setInfo(r,{isSelected:!1});}},{key:"delete",value:function _delete(r){this.curNodeMap["delete"](r);}},{key:"clear",value:function clear(){this.curNodeMap.clear(),this.targetNodeMap.length=0;}},{key:"hasRectIntersectRange",value:function hasRectIntersectRange(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var _iterator29=_createForOfIteratorHelper(this.curNodeMap.values()),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var _e7=_step29.value;if(Re(r,_e7.rect)){if(t&&_e7.toolsType===ht.Image&&_e7.opt.locked||t&&_e7.toolsType===ht.Text&&(_e7.opt.workState===Rt.Doing||_e7.opt.workState===Rt.Start))continue;return!0;}}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}return!1;}},{key:"getRectIntersectRange",value:function getRectIntersectRange(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var e;var n=/* @__PURE__ */new Map();var _iterator30=_createForOfIteratorHelper(this.curNodeMap.entries()),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var _step30$value=_slicedToArray(_step30.value,2),i=_step30$value[0],a=_step30$value[1];if(Re(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);}}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}return{rectRange:e,nodeRange:n};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(r,t){var i;var e=Zn(t.toolsType);if(t.toolsType===ht.Text){var a=(i=this.fullLayer)==null?void 0:i.getElementsByName(r)[0];a&&e.updateLabels(t,a,this.fullLayer);}return this.fullLayer&&(e==null?void 0:e.getRectFromLayer(this.fullLayer,r));}},{key:"updateNodesRect",value:function updateNodesRect(){var _iterator31=_createForOfIteratorHelper(this.curNodeMap.entries()),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var _step31$value=_slicedToArray(_step31.value,2),r=_step31$value[0],t=_step31$value[1];var _e8=this.getNodeRectFormShape(r,t);_e8?(t.rect=_e8,this.curNodeMap.set(r,t)):this.curNodeMap["delete"](r);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}}},{key:"combineIntersectRect",value:function combineIntersectRect(r){var t=r;return this.curNodeMap.forEach(function(e){Re(t,e.rect)&&(t=Ot(t,e.rect));}),t;}},{key:"setTarget",value:function setTarget(){return this.targetNodeMap.push(Jt(this.curNodeMap)),this.targetNodeMap.length-1;}},{key:"getLastTarget",value:function getLastTarget(){return this.targetNodeMap[this.targetNodeMap.length-1];}},{key:"deleteLastTarget",value:function deleteLastTarget(){this.targetNodeMap.length&&(this.targetNodeMap.length=this.targetNodeMap.length-1);}},{key:"getTarget",value:function getTarget(r){return this.targetNodeMap[r];}},{key:"deleteTarget",value:function deleteTarget(r){this.targetNodeMap.length=r;}},{key:"clearTarget",value:function clearTarget(){this.targetNodeMap.length=0;}}]);}();var qn=/*#__PURE__*/function(){function qn(r,t){_classCallCheck(this,qn);nt(this,"viewId");nt(this,"fullLayer");nt(this,"vNodes");nt(this,"dpr");nt(this,"contextType");nt(this,"opt");nt(this,"cameraOpt");nt(this,"scene");nt(this,"isSafari",!1);nt(this,"combinePostMsg",/* @__PURE__ */new Set());nt(this,"workerTaskId");nt(this,"protectedTask");if(this.viewId=r,this.opt=t,this.dpr=t.dpr,this.contextType=this.getSupportContextType(),!this.contextType)throw new Error("Sorry, your browser doesn't support canvas context type 2d or webgl");this.scene=this.createScene(t.offscreenCanvasOpt),this.fullLayer=this.createLayer("fullLayer",this.scene,_objectSpread(_objectSpread({},t.layerOpt),{},{bufferSize:this.viewId==="mainView"?6e3:3e3})),this.vNodes=new M0(r,this.scene);}return _createClass(qn,[{key:"setIsSafari",value:function setIsSafari(r){this.isSafari=r;}},{key:"on",value:function(){var _on=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(r){var t,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee29$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:t=r.msgType,e=r.toolsType,n=r.opt,i=r.workId,a=r.workState,o=r.dataType;_context31.t0=t;_context31.next=_context31.t0===ct.Destroy?4:_context31.t0===ct.Clear?6:_context31.t0===ct.UpdateTools?8:_context31.t0===ct.CreateWork?10:_context31.t0===ct.DrawWork?12:14;break;case 4:this.destroy();return _context31.abrupt("break",14);case 6:this.clearAll();return _context31.abrupt("break",14);case 8:if(e&&n){s={toolsType:e,toolsOpt:n};this.localWork.setToolsOpt(s);}return _context31.abrupt("break",14);case 10:i&&n&&(!this.localWork.getTmpWorkShapeNode()&&e&&this.setToolsOpt({toolsType:e,toolsOpt:n}),this.setWorkOpt({workId:i,toolsOpt:n}));return _context31.abrupt("break",14);case 12:a===Rt.Done&&o===Mt.Local?this.consumeDrawAll(o,r):this.consumeDraw(o,r);return _context31.abrupt("break",14);case 14:case"end":return _context31.stop();}},_callee29,this);}));function on(_x43){return _on.apply(this,arguments);}return on;}()},{key:"updateScene",value:function updateScene(r){this.scene.attr(_objectSpread({},r));var t=r.width,e=r.height;this.scene.container.width=t,this.scene.container.height=e,this.scene.width=t,this.scene.height=e,this.updateLayer({width:t,height:e});}},{key:"updateLayer",value:function updateLayer(r){var t=r.width,e=r.height;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*0.5,e*0.5]));}},{key:"getSupportContextType",value:function getSupportContextType(){var r=new OffscreenCanvas(100,100),t=this.viewId==="mainView"?[Ce.Webgl2,Ce.Webgl,Ce.Canvas2d]:[Ce.Canvas2d];for(var _i2=0,_t3=t;_i2<_t3.length;_i2++){var _e9=_t3[_i2];if(r.getContext(_e9))return _e9;}}},{key:"createScene",value:function createScene(r){var t=r.width,e=r.height,n=new OffscreenCanvas(t,e);r.contextType&&delete r.contextType;var i=new Xh(_objectSpread(_objectSpread({container:n,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},r),{},{contextType:this.contextType,id:this.viewId}));return i.setAttribute("id",this.viewId),i;}},{key:"createLayer",value:function createLayer(r,t,e){var n=e.width,i=e.height,a="offscreen-".concat(r),o=t.layer(a,e),s=new ne({anchor:[0.5,0.5],pos:[n*0.5,i*0.5],size:[n,i],name:"viewport",id:r});return o.append(s),s;}},{key:"clearAll",value:function clearAll(){var r;this.fullLayer&&(this.fullLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.fullLayer.removeAllChildren()),this.localWork.destroy(),(r=this.serviceWork)==null||r.destroy();}},{key:"setToolsOpt",value:function setToolsOpt(r){this.localWork.setToolsOpt(r);}},{key:"setWorkOpt",value:function setWorkOpt(r){var t=r.workId,e=r.toolsOpt;t&&e&&this.localWork.setWorkOptions(t.toString(),e);}},{key:"destroy",value:function destroy(){var r;this.vNodes.clear(),this.fullLayer.remove(),this.scene.remove(),this.localWork.destroy(),(r=this.serviceWork)==null||r.destroy();}},{key:"post",value:function post(r){this.combinePostMsg.add(r),this.runBatchPostData();}},{key:"runBatchPostData",value:function runBatchPostData(){this.workerTaskId||(this.workerTaskId=requestAnimationFrame(this.combinePost.bind(this)));}},{key:"combinePostData",value:function combinePostData(){var _this85=this;var i,a;this.workerTaskId=void 0;var r=[],t=[];var e;var n=/* @__PURE__ */new Set();var _iterator32=_createForOfIteratorHelper(this.combinePostMsg.values()),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var o=_step32.value;if((i=o.render)!=null&&i.length){var _iterator33=_createForOfIteratorHelper(o.render),_step33;try{var _loop6=function _loop6(){var s=_step33.value;var f=!1;if(s.workId&&n.add(s.workId),s.isClearAll&&(s.rect=_this85.getSceneRect(),s.isClear=!0,delete s.isClearAll),s.drawCanvas){var p=_this85.getLayer(s.drawCanvas);if(!p)return 1;// continue
440
+ if(p.parent.render(),s.isDrawAll){var c=_this85.getSceneRect(),_this85$vNodes$getRec=_this85.vNodes.getRectIntersectRange(c,!1),v=_this85$vNodes$getRec.rectRange;s.rect=v,delete s.isDrawAll;}}var _iterator34=_createForOfIteratorHelper(r),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _p9=_step34.value;if(s.viewId===_p9.viewId){s.isClear&&_p9.clearCanvas&&_p9.isClear&&_p9.clearCanvas===s.clearCanvas&&(_p9.rect=Ot(_p9.rect,s.rect),f=!0),_p9.drawCanvas&&_p9.drawCanvas===s.drawCanvas&&(_p9.rect=Ot(_p9.rect,s.rect),f=!0);continue;}}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}if(!f)if(s.isClear&&!s.drawCanvas){var _p8=r.find(function(c){return c.drawCanvas===s.clearCanvas&&oe(c.rect,s.rect);});_p8!=null&&_p8.rect&&(_p8.rect=wt(_p8.rect,2)),r.unshift(s);}else s.drawCanvas&&!s.clearCanvas&&s.rect&&r.find(function(p){return p.isClear&&p.clearCanvas===s.drawCanvas&&oe(p.rect,s.rect);})&&(s.rect=wt(s.rect,2)),r.push(s);};for(_iterator33.s();!(_step33=_iterator33.n()).done;){if(_loop6())continue;}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}}if((a=o.sp)!=null&&a.length){var _iterator35=_createForOfIteratorHelper(o.sp),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var s=_step35.value;var f=!1;var _iterator36=_createForOfIteratorHelper(t),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var p=_step36.value;if(oe(s,p)){f=!0;break;}}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}f||t.push(s);}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}}kt(o.drawCount)&&(e=o.drawCount);}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}return this.combinePostMsg.clear(),{render:r,sp:t,drawCount:e,workIds:n};}},{key:"safariFixRect",value:function safariFixRect(r){if(r.w+r.x<=0||r.h+r.y<=0||r.w<=0||r.h<=0)return;var 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;}},{key:"getSceneRect",value:function getSceneRect(){var _this$scene=this.scene,r=_this$scene.width,t=_this$scene.height;return{x:0,y:0,w:Math.floor(r),h:Math.floor(t)};}}]);}();var _n=/*#__PURE__*/function(){function _n(r){_classCallCheck(this,_n);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",/* @__PURE__ */new Map());nt(this,"workShapeState",/* @__PURE__ */new Map());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);}return _createClass(_n,[{key:"destroy",value:function destroy(){this.workShapeState.clear(),this.workShapes.clear();}},{key:"getWorkShapes",value:function getWorkShapes(){return this.workShapes;}},{key:"getWorkShape",value:function getWorkShape(r){return this.workShapes.get(r);}},{key:"getTmpWorkShapeNode",value:function getTmpWorkShapeNode(){return this.tmpWorkShapeNode;}},{key:"setTmpWorkId",value:function setTmpWorkId(r){if(r&&this.tmpWorkShapeNode){this.tmpWorkShapeNode.setWorkId(r),this.workShapes.set(r,this.tmpWorkShapeNode),this.tmpOpt&&this.setToolsOpt(this.tmpOpt);return;}}},{key:"setWorkOptions",value:function setWorkOptions(r,t){var n;this.workShapes.get(r)||this.setTmpWorkId(r),(n=this.workShapes.get(r))==null||n.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(r){var t;return xr(_objectSpread(_objectSpread({},r),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(t=this.thread)==null?void 0:t.serviceWork);}},{key:"setToolsOpt",value:function 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);}},{key:"clearWorkShapeNodeCache",value:function clearWorkShapeNodeCache(r){var t,e;(t=this.getWorkShape(r))==null||t.clearTmpPoints(),this.workShapes["delete"](r),this.workShapeState["delete"](r),((e=this.tmpWorkShapeNode)==null?void 0:e.getWorkId())===r&&this.setTmpWorkId(void 0);}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.workShapes.forEach(function(r){return r.clearTmpPoints();}),this.workShapes.clear(),this.workShapeState.clear();}},{key:"setFullWork",value:function setFullWork(r){var t=r.workId,e=r.opt,n=r.toolsType;if(t&&e&&n){var i=t.toString(),a=t&&this.workShapes.get(i)||this.createWorkShapeNode({toolsOpt:e,toolsType:n,workId:i});return a?(a.setWorkId(i),this.workShapes.set(i,a),a):void 0;}}// abstract consumeDraw(data:IWorkerMessage): IMainMessage | undefined;
441
+ // abstract consumeDrawAll(data:IWorkerMessage): IMainMessage | undefined;
442
+ }]);}();var O0=_t,E0=function E0(){return O0.Date.now();},P0=E0,A0=/\s/;function C0(h){for(var r=h.length;r--&&A0.test(h.charAt(r)););return r;}var R0=C0,I0=R0,L0=/^\s+/;function b0(h){return h&&h.slice(0,I0(h)+1).replace(L0,"");}var D0=b0,w0=fe,N0=re,W0="[object Symbol]";function B0(h){return _typeof(h)=="symbol"||N0(h)&&w0(h)==W0;}var F0=B0,j0=D0,on=ae,U0=F0,an=NaN,z0=/^[-+]0x[0-9a-f]+$/i,$0=/^0b[01]+$/i,G0=/^0o[0-7]+$/i,H0=parseInt;function K0(h){if(typeof h=="number")return h;if(U0(h))return an;if(on(h)){var r=typeof h.valueOf=="function"?h.valueOf():h;h=on(r)?r+"":r;}if(typeof h!="string")return h===0?h:+h;h=j0(h);var t=$0.test(h);return t||G0.test(h)?H0(h.slice(2),t?2:8):z0.test(h)?an:+h;}var V0=K0,Y0=ae,tr=P0,ln=V0,X0="Expected a function",J0=Math.max,Q0=Math.min;function Z0(h,r,t){var e,n,i,a,o,s,f=0,p=!1,c=!1,v=!0;if(typeof h!="function")throw new TypeError(X0);r=ln(r)||0,Y0(t)&&(p=!!t.leading,c="maxWait"in t,i=c?J0(ln(t.maxWait)||0,r):i,v="trailing"in t?!!t.trailing:v);function S(M){var A=e,R=n;return e=n=void 0,f=M,a=h.apply(R,A),a;}function O(M){return f=M,o=setTimeout(T,r),p?S(M):a;}function x(M){var A=M-s,R=M-f,b=r-A;return c?Q0(b,i-R):b;}function m(M){var A=M-s,R=M-f;return s===void 0||A>=r||A<0||c&&R>=i;}function T(){var M=tr();if(m(M))return l(M);o=setTimeout(T,x(M));}function l(M){return o=void 0,v&&e?S(M):(e=n=void 0,a);}function d(){o!==void 0&&clearTimeout(o),f=0,e=s=n=o=void 0;}function u(){return o===void 0?a:l(tr());}function g(){var M=tr(),A=m(M);if(e=arguments,n=this,s=M,A){if(o===void 0)return O(s);if(c)return clearTimeout(o),o=setTimeout(T,r),S(s);}return o===void 0&&(o=setTimeout(T,r)),a;}return g.cancel=d,g.flush=u,g;}var k0=Z0,q0=k0,_0=ae,tg="Expected a function";function eg(h,r,t){var e=!0,n=!0;if(typeof h!="function")throw new TypeError(tg);return _0(t)&&(e="leading"in t?!!t.leading:e,n="trailing"in t?!!t.trailing:n),q0(h,r,{leading:e,maxWait:r,trailing:n});}var rg=eg,ng=/* @__PURE__ */ye(rg);var ig=/*#__PURE__*/function(_n7){function ig(t){var _this86;_classCallCheck(this,ig);_this86=_callSuper(this,ig,[t]);nt(_this86,"combineUnitTime",600);nt(_this86,"combineTimerId");nt(_this86,"effectSelectNodeData",/* @__PURE__ */new Set());nt(_this86,"batchEraserWorks",/* @__PURE__ */new Set());nt(_this86,"batchEraserRemoveNodes",/* @__PURE__ */new Set());nt(_this86,"batchEraserCombine",ng(function(){var t=_this86.updateBatchEraserCombineNode(_this86.batchEraserWorks,_this86.batchEraserRemoveNodes);_this86.batchEraserWorks.clear(),_this86.batchEraserRemoveNodes.clear(),t.length&&_this86._post({render:t});},100,{leading:!1}));return _this86;}_inherits(ig,_n7);return _createClass(ig,[{key:"consumeDraw",value:function consumeDraw(t,e){var _this87=this;var n=t.op,i=t.workId;if(n!=null&&n.length&&i){var a=this.workShapes.get(i.toString());if(!a)return;var o=a.toolsType;if(o===ht.LaserPen)return;var s=a.consume({data:t,isFullWork:!0});switch(o){case ht.Selector:s.type===ct.Select&&(s.selectIds&&e.runReverseSelectWork(s.selectIds),this.drawSelector(s));break;case ht.Eraser:s!=null&&s.rect&&this.drawEraser(s);break;case ht.Arrow:case ht.Straight:case ht.Ellipse:case ht.Rectangle:case ht.Star:case ht.Polygon:case ht.SpeechBalloon:s&&(this.drawCount++,this.drawPencil(s));break;case ht.Pencil:this.combineTimerId||(this.combineTimerId=setTimeout(function(){_this87.combineTimerId=void 0,_this87.drawPencilCombine(i.toString());},Math.floor(a.getWorkOptions().syncUnitTime||this.combineUnitTime/2))),s&&(this.drawCount++,this.drawPencil(s));break;}}}},{key:"consumeDrawAll",value:function consumeDrawAll(t,e){var a,o,s;this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0);var n=t.workId,i=t.scenePath;if(n){var f=n.toString(),p=this.workShapes.get(f);if(!p)return;var c=p.toolsType;if(c===ht.LaserPen)return;var v=this.workShapes.get($e),S=(a=v==null?void 0:v.selectIds)==null?void 0:a[0],O=p.consumeAll({data:t}),x=this.workShapeState.get(f);switch(c){case ht.Selector:O.selectIds&&S&&(o=O.selectIds)!=null&&o.includes(S)&&v.cursorBlur(),O.selectIds&&e.runReverseSelectWork(O.selectIds),this.drawSelector(_objectSpread(_objectSpread({},O),{},{scenePath:i})),(s=p.selectIds)!=null&&s.length?p.clearTmpPoints():this.clearWorkShapeNodeCache(f);break;case ht.Eraser:O!=null&&O.rect&&this.drawEraser(_objectSpread(_objectSpread({},O),{},{scenePath:i})),p.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(_objectSpread(_objectSpread({},O),{},{scenePath:i}),p.getWorkOptions(),x),this.drawCount=0,this.clearWorkShapeNodeCache(f);break;case ht.Pencil:O!=null&&O.rect&&(this.drawPencilFull(_objectSpread(_objectSpread({},O),{},{scenePath:i}),p.getWorkOptions(),x),this.drawCount=0),this.clearWorkShapeNodeCache(f);break;}}}},{key:"workShapesDone",value:function workShapesDone(t,e){var _iterator37=_createForOfIteratorHelper(this.workShapes.keys()),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var n=_step37.value;this.consumeDrawAll({workId:n,scenePath:t,viewId:this.viewId,msgType:ct.DrawWork,dataType:Mt.Local},e);}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}}},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(t,e){var a,o,n,i,s,f,p,c,v,S,O;return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:n=this.setFullWork(t),i=t.ops&&Le(t.ops);if(!n){_context32.next=23;break;}s=(a=t.workId)==null?void 0:a.toString();if(s){_context32.next=5;break;}return _context32.abrupt("return");case 5:f=(o=this.vNodes.get(s))==null?void 0:o.rect;if(!(n.toolsType===ht.Image&&e)){_context32.next=13;break;}_context32.next=9;return n.consumeServiceAsync({scene:e,isFullWork:!0,replaceId:s});case 9:p=_context32.sent;c=(t==null?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt);_context32.next=20;break;case 13:if(!(n.toolsType===ht.Text)){_context32.next=19;break;}_context32.next=16;return n.consumeServiceAsync({isFullWork:!0,replaceId:s});case 16:p=_context32.sent;_context32.next=20;break;case 19:p=n.consumeService({op:i,isFullWork:!0,replaceId:s}),c=(t==null?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt);case 20:p=Ot(p,c);v=[],S=[];if(t.workId&&this.workShapes["delete"](t.workId.toString()),p&&t.willRefresh&&(f&&v.push({rect:p,isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId}),v.push({rect:p,drawCanvas:xt.Bg,viewId:this.viewId})),t.willSyncService&&S.push({opt:t.opt,toolsType:t.toolsType,type:ct.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),v.length||S.length){O={render:v,sp:S};this._post(O);}case 23:case"end":return _context32.stop();}},_callee30,this);}));function consumeFull(_x44,_x45){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"removeWork",value:function removeWork(t){var e=t.workId,n=e==null?void 0:e.toString();if(n){var i=this.removeNode(n);if(i){var a=[];a.push({rect:wt(i),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(i),drawCanvas:xt.Bg,viewId:this.viewId}),a.length&&this._post({render:a});}}}},{key:"removeNode",value:function removeNode(t){var n;var e=this.vNodes.get(t);return e&&((n=this.fullLayer)==null||n.getElementsByName(t).forEach(function(i){i.remove();}),this.vNodes["delete"](t)),this.clearWorkShapeNodeCache(t),e==null?void 0:e.rect;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(t){var e,n,i,a,_iterator38,_step38,o,s,f,p,c,v,S;return _regeneratorRuntime().wrap(function _callee31$(_context33){while(1)switch(_context33.prev=_context33.next){case 0:e=t.op,n=t.viewId,i=t.dataType;if(!(e!=null&&e.length)){_context33.next=26;break;}_iterator38=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context33.prev=3;_iterator38.s();case 5:if((_step38=_iterator38.n()).done){_context33.next=13;break;}o=_step38.value;s=o.rect,f=o.name,p=o.toolsType,c=o.opt,v=e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],S=e[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];if(!(p===ht.Text&&Fh([v,S],s)&&c.workState===Rt.Done)){_context33.next=11;break;}a=f;return _context33.abrupt("break",13);case 11:_context33.next=5;break;case 13:_context33.next=18;break;case 15:_context33.prev=15;_context33.t0=_context33["catch"](3);_iterator38.e(_context33.t0);case 18:_context33.prev=18;_iterator38.f();return _context33.finish(18);case 21:_context33.t1=a;if(!_context33.t1){_context33.next=26;break;}_context33.next=25;return this.blurSelector({viewId:n,msgType:ct.Select,dataType:i,isSync:!0});case 25:this._post({sp:[{type:ct.GetTextActive,toolsType:ht.Text,workId:a}]});case 26:case"end":return _context33.stop();}},_callee31,this,[[3,15,18,21]]);}));function checkTextActive(_x46){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(t){var _this88=this;var e,n,i;return _regeneratorRuntime().wrap(function _callee32$(_context34){while(1)switch(_context34.prev=_context34.next){case 0:e=this.workShapes.get(Nt.selectorId),n=t.workId,i=t.msgType;if(!(e&&n&&e.selectIds&&e.selectIds.includes(n.toString()))){_context34.next=8;break;}i===ct.RemoveNode?e.selectIds=e.selectIds.filter(function(a){return a!==n.toString();}):this.effectSelectNodeData.add(t);_context34.next=5;return new Promise(function(a){setTimeout(function(){a(!0);},0);});case 5:_context34.next=7;return this.runEffectSelectWork(!0).then(function(){var a;(a=_this88.effectSelectNodeData)==null||a.clear();});case 7:return _context34.abrupt("return");case 8:return _context34.abrupt("return",t);case 9:case"end":return _context34.stop();}},_callee32,this);}));function colloctEffectSelectWork(_x47){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(t){var _this89=this;var O,e,n,i,a,o,s,f,p,c,v,S;return _regeneratorRuntime().wrap(function _callee33$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:e=this.workShapes.get(Nt.selectorId);if((O=e==null?void 0:e.selectIds)!=null&&O.length){_context35.next=3;break;}return _context35.abrupt("return");case 3:n=t.callback;i=_objectWithoutProperties(t,_excluded2);a=i.updateSelectorOpt;o=i.willSerializeData;s=i.scene;_context35.next=10;return e==null?void 0:e.updateSelector({updateSelectorOpt:a,selectIds:e.selectIds,vNodes:this.vNodes,willSerializeData:o,worker:this,scene:s});case 10:f=_context35.sent;p=/* @__PURE__ */new Map();e.selectIds.forEach(function(x){var m=_this89.vNodes.get(x);if(m){var _T46=m.toolsType,_l35=m.op,d=m.opt;p.set(x,{opt:d,toolsType:_T46,ops:(_l35==null?void 0:_l35.length)&&qt(_l35)||void 0});}});c=[],v=[];f!=null&&f.rect&&c.push({rect:wt(f.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(f.rect),drawCanvas:xt.Bg,viewId:this.viewId});S=n&&n({res:f,workShapeNode:e,param:i,postData:{render:c,sp:v},newServiceStore:p})||{render:c,sp:v};(S.render.length||S.sp.length)&&this._post(S);case 17:case"end":return _context35.stop();}},_callee33,this);}));function updateSelector(_x48){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(t){var i,e,n,a;return _regeneratorRuntime().wrap(function _callee34$(_context36){while(1)switch(_context36.prev=_context36.next){case 0: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(function(a){a.name===Nt.selectorId&&a.remove();}),n){a=[];a.push(_objectSpread(_objectSpread({},n),{},{isSync:t==null?void 0:t.isSync})),this._post({render:(n==null?void 0:n.rect)&&[{rect:wt(n.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(n.rect),drawCanvas:xt.Bg,viewId:this.viewId}],sp:a});}case 2:case"end":return _context36.stop();}},_callee34,this);}));function blurSelector(_x49){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"reRenderSelector",value:function reRenderSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var a;var e=this.workShapes.get(Nt.selectorId);if(!e)return;if(e&&!((a=e.selectIds)!=null&&a.length))return this.blurSelector();var n=e.oldSelectRect,i=e.reRenderSelector();if(i){var o=Ot(n,i)||i;this._post({render:[{rect:wt(o),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(o),drawCanvas:xt.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}]});}}},{key:"updateFullSelectWork",value:function updateFullSelectWork(t){var i,a,o,s,f,p,c;var e=this.workShapes.get(Nt.selectorId),n=t.selectIds;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.toString()),this.updateFullSelectWork(t);return;}if(e&&n!=null&&n.length){var _e$updateSelectIds=e.updateSelectIds(n),v=_e$updateSelectIds.bgRect,S=_e$updateSelectIds.selectRect,O={render:[],sp:[]};v&&((a=O.render)==null||a.push({rect:wt(v),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(v),drawCanvas:xt.Bg,viewId:this.viewId})),(c=O.sp)==null||c.push(_objectSpread(_objectSpread({},t),{},{selectorColor:((o=t.opt)==null?void 0:o.strokeColor)||e.selectorColor,strokeColor:((s=t.opt)==null?void 0:s.strokeColor)||e.strokeColor,fillColor:((f=t.opt)==null?void 0:f.fillColor)||e.fillColor,textOpt:((p=t.opt)==null?void 0:p.textOpt)||e.textOpt,canTextEdit:e.canTextEdit,canRotate:e.canRotate,scaleType:e.scaleType,type:ct.Select,selectRect:S,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);}}},{key:"destroy",value:function destroy(){this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0),_get(_getPrototypeOf(ig.prototype),"destroy",this).call(this),this.effectSelectNodeData.clear(),this.batchEraserWorks.clear(),this.batchEraserRemoveNodes.clear();}},{key:"drawPencilCombine",value:function drawPencilCombine(t){var n,i,a;var e=(n=this.workShapes.get(t))==null?void 0:n.combineConsume();if(e){var o={render:[],drawCount:this.drawCount};if(e!=null&&e.rect){var s=wt(e.rect);(i=o.render)==null||i.push({rect:s,isClear:!0,clearCanvas:xt.Float,viewId:this.viewId}),(a=o.render)==null||a.push({rect:s,drawCanvas:xt.Float,viewId:this.viewId});}this._post(o);}}},{key:"drawSelector",value:function drawSelector(t){var n;var e={render:[],sp:[t]};t.rect&&((n=e.render)==null||n.push({rect:wt(t.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(t.rect),drawCanvas:xt.Bg,viewId:this.viewId})),this._post(e);}},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(t){var _this90=this;var n,i,e,_iterator39,_step39,a,o;return _regeneratorRuntime().wrap(function _callee35$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:e=[];if((n=t.newWorkDatas)!=null&&n.size){_iterator39=_createForOfIteratorHelper(t.newWorkDatas.values());try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){a=_step39.value;o=a.workId.toString();this.batchEraserWorks.add(o),e.push({type:ct.FullWork,workId:o,ops:qt(a.op),opt:a.opt,toolsType:a.toolsType,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}delete t.newWorkDatas;}(i=t.removeIds)==null||i.forEach(function(a){_this90.batchEraserRemoveNodes.add(a);}),e.push(t),this._post({sp:e}),this.batchEraserCombine();case 3:case"end":return _context37.stop();}},_callee35,this);}));function drawEraser(_x50){return _drawEraser.apply(this,arguments);}return drawEraser;}()},{key:"drawPencil",value:function drawPencil(t){this._post({drawCount:this.drawCount,sp:(t==null?void 0:t.op)&&[t]});}},{key:"drawPencilFull",value:function drawPencilFull(t,e,n){var o;var i=(n==null?void 0:n.willClear)||(e==null?void 0:e.isOpacity)||!1;!i&&t.rect&&(i=this.vNodes.hasRectIntersectRange(t.rect));var a={drawCount:1/0,render:[],sp:[t]};(o=a.render)==null||o.push({isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId},{rect:t.rect,isClear:i,clearCanvas:xt.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:xt.Bg,viewId:this.viewId}),this._post(a);}},{key:"updateBatchEraserCombineNode",value:function updateBatchEraserCombineNode(t,e){var _this91=this;var n=[];var i;var _iterator40=_createForOfIteratorHelper(e.keys()),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var a=_step40.value;this.fullLayer.getElementsByName(a).forEach(function(o){var s=o.getBoundingClientRect();i=Ot(i,{x:s.x-ie.SafeBorderPadding,y:s.y-ie.SafeBorderPadding,w:s.width+ie.SafeBorderPadding*2,h:s.height+ie.SafeBorderPadding*2}),o.remove();});}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}return t.forEach(function(a){var o=_this91.vNodes.get(a);if(o)if(_this91.fullLayer.getElementsByName(a)[0])i=Ot(i,o.rect);else{var f=_this91.setFullWork(_objectSpread(_objectSpread({},o),{},{workId:a})),p=f&&f.consumeService({op:o.op,isFullWork:!0});p&&(o.rect=p,i=Ot(i,p));}}),i&&n.push({rect:i,isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId},{rect:i,drawCanvas:xt.Bg,viewId:this.viewId}),n;}},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(t){var e,n,i,_iterator41,_step41,a,o,s,f;return _regeneratorRuntime().wrap(function _callee36$(_context38){while(1)switch(_context38.prev=_context38.next){case 0:_iterator41=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context38.prev=1;_iterator41.s();case 3:if((_step41=_iterator41.n()).done){_context38.next=23;break;}a=_step41.value;o=this.setFullWork(a);if(!o){_context38.next=21;break;}s=(e=o.getWorkId())==null?void 0:e.toString();if(!(o.toolsType===ht.Image)){_context38.next=13;break;}_context38.next=11;return o.consumeServiceAsync({scene:(i=(n=this.drawLayer)==null?void 0:n.parent)==null?void 0:i.parent,isFullWork:!0,replaceId:s});case 11:_context38.next=20;break;case 13:if(!(o.toolsType===ht.Text)){_context38.next=18;break;}_context38.next=16;return o.consumeServiceAsync({isFullWork:!0,replaceId:s});case 16:_context38.next=20;break;case 18:f=a.ops&&Le(a.ops);o.consumeService({op:f,isFullWork:!0,replaceId:s}),a!=null&&a.updateNodeOpt&&o.updataOptService(a.updateNodeOpt);case 20:a.workId&&this.workShapes["delete"](a.workId.toString());case 21:_context38.next=3;break;case 23:_context38.next=28;break;case 25:_context38.prev=25;_context38.t0=_context38["catch"](1);_iterator41.e(_context38.t0);case 28:_context38.prev=28;_iterator41.f();return _context38.finish(28);case 31:this.reRenderSelector(t);case 32:case"end":return _context38.stop();}},_callee36,this,[[1,25,28,31]]);}));function runEffectSelectWork(_x51){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function cursorHover(t){var o;var e=t.opt,n=t.toolsType,i=t.point,a=this.setFullWork({workId:$e,toolsType:n,opt:e});if(a&&i){var s=a.cursorHover(i),f={render:[]};s&&s.type===ct.CursorHover&&s.rect&&((o=f.render)==null||o.push({rect:wt(s.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(s.rect),drawCanvas:xt.Bg,viewId:this.viewId}),this._post(f));}}}]);}(_n);var sg=/*#__PURE__*/function(){function sg(r){_classCallCheck(this,sg);nt(this,"viewId");nt(this,"vNodes");nt(this,"fullLayer");nt(this,"drawLayer");nt(this,"workShapes",/* @__PURE__ */new Map());nt(this,"selectorWorkShapes",/* @__PURE__ */new Map());nt(this,"animationId");nt(this,"willRunEffectSelectorIds",/* @__PURE__ */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);}return _createClass(sg,[{key:"destroy",value:function destroy(){this.workShapes.clear(),this.selectorWorkShapes.clear(),this.willRunEffectSelectorIds.clear();}},{key:"consumeDraw",value:function consumeDraw(r){this.activeWorkShape(r),this.runAnimation();}},{key:"consumeFull",value:function consumeFull(r){this.activeWorkShape(r),this.runAnimation();}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){var _this92=this;this.workShapes.forEach(function(r,t){r.toolsType===ht.LaserPen?setTimeout(function(){_this92.workShapes["delete"](t);},2e3):_this92.workShapes["delete"](t);});}},{key:"runSelectWork",value:function runSelectWork(r){this.activeSelectorShape(r);var t=r.workId,e=t==null?void 0:t.toString();e&&this.willRunEffectSelectorIds.add(e),this.runEffect();}},{key:"setNodeKey",value:function setNodeKey(r,t,e){return r.toolsType=t,r.node=xr({toolsType:t,toolsOpt:e,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),r;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(r){var _this93=this;r.forEach(function(t){_this93.selectorWorkShapes.forEach(function(e,n){var i;if((i=e.selectIds)!=null&&i.length){var a=e.selectIds.indexOf(t);a>-1&&(e.selectIds.splice(a,1),_this93.willRunEffectSelectorIds.add(n));}});}),this.willRunEffectSelectorIds.size&&this.runEffect();}},{key:"removeWork",value:function removeWork(r){var t=r.workId,e=t==null?void 0:t.toString();if(e){var 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);}}},{key:"removeSelectWork",value:function removeSelectWork(r){var t=r.workId,e=t==null?void 0:t.toString();e&&(this.activeSelectorShape(r),this.willRunEffectSelectorIds.add(e)),this.runEffect();}},{key:"removeNode",value:function removeNode(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var o;r.indexOf(Nt.selectorId)>-1&&this.removeSelectWork(t);var i=e;var a=(o=this.vNodes.get(r))==null?void 0:o.rect;a&&(i=Ot(a,i)),this.fullLayer.getElementsByName(r).forEach(function(s){s.remove();}),this.drawLayer.getElementsByName(r).forEach(function(s){s.remove();}),this.vNodes["delete"](r),i&&this.post({render:[{rect:wt(i),isClear:!0,clearCanvas:n?xt.Bg:xt.ServiceFloat,workerType:n?void 0:Mt.Service,viewId:this.viewId},{rect:wt(i),drawCanvas:n?xt.Bg:xt.ServiceFloat,workerType:n?void 0:Mt.Service,viewId:this.viewId}]});}},{key:"activeWorkShape",value:function activeWorkShape(r){var S,O,x,m;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,o=r.ops,s=r.op,f=r.useAnimation;if(!t)return;var p=t.toString(),c=(S=this.vNodes.get(p))==null?void 0:S.rect;if(!((O=this.workShapes)!=null&&O.has(p))){var _T47={toolsType:n,animationWorkData:s||[],animationIndex:0,type:i,updateNodeOpt:a,ops:o,useAnimation:_typeof(f)<"u"?f:_typeof(a==null?void 0:a.useAnimation)<"u"?a==null?void 0:a.useAnimation:!0,oldRect:c,isDiff:!1};n&&e&&(_T47=this.setNodeKey(_T47,n,e)),(x=this.workShapes)==null||x.set(p,_T47);}var v=(m=this.workShapes)==null?void 0:m.get(p);i&&(v.type=i),o&&(v.animationWorkData=Le(o),v.ops=o),a&&(v.updateNodeOpt=a),s&&(v.isDiff=this.hasDiffData(v.animationWorkData||[],s,v.toolsType),v.animationWorkData=s),v.node&&v.node.getWorkId()!==p&&v.node.setWorkId(p),c&&(v.oldRect=c),n&&e&&(v.toolsType!==n&&n&&e&&this.setNodeKey(v,n,e),v.node&&v.node.setWorkOptions(e));}},{key:"hasDiffData",value:function hasDiffData(r,t,e){var n=r.length;if(t.length<n)return!0;switch(e){case ht.Pencil:{for(var i=0;i<n;i+=3)if(t[i]!==r[i]||t[i+1]!==r[i+1])return!0;break;}case ht.LaserPen:{for(var _i3=0;_i3<n;_i3+=2)if(t[_i3]!==r[_i3]||t[_i3+1]!==r[_i3+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(){var _this94=this;var n,i,a,o,s,f,p,c,v,S,O,x,m,T,l,d,u,g,M,A,R,b,E,L,D,I,C,W,G,K,J,r,t,e,_iterator42,_step42,_loop7;return _regeneratorRuntime().wrap(function _callee37$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:this.animationId=void 0;r=!1;t={render:[]},e=/* @__PURE__ */new Map();_iterator42=_createForOfIteratorHelper(this.workShapes.entries());_context40.prev=4;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var _step42$value,Z,B,$,Q,_$3,_Q,_$4,_Q2,et,tt,_$5,_Q3,_$6,_Q4,_et3,_tt3,ot,q,gt,_q2;return _regeneratorRuntime().wrap(function _loop7$(_context39){while(1)switch(_context39.prev=_context39.next){case 0:_step42$value=_slicedToArray(_step42.value,2),Z=_step42$value[0],B=_step42$value[1];_context39.t0=B.toolsType;_context39.next=_context39.t0===ht.Image?4:_context39.t0===ht.Text?11:_context39.t0===ht.Arrow?19:_context39.t0===ht.Straight?19:_context39.t0===ht.Rectangle?19:_context39.t0===ht.Ellipse?19:_context39.t0===ht.Star?19:_context39.t0===ht.Polygon?19:_context39.t0===ht.SpeechBalloon?19:_context39.t0===ht.Pencil?22:37;break;case 4:$=B.oldRect;$&&((n=t.render)==null||n.push({rect:$,isClear:!0,clearCanvas:xt.Bg,viewId:_this94.viewId}),(i=t.render)==null||i.push({rect:$,drawCanvas:xt.Bg,viewId:_this94.viewId}));_context39.next=8;return(o=B.node)==null?void 0:o.consumeServiceAsync({isFullWork:!0,scene:(a=_this94.fullLayer.parent)==null?void 0:a.parent});case 8:Q=_context39.sent;_this94.selectorWorkShapes.forEach(function(et,tt){var ot;(ot=et.selectIds)!=null&&ot.includes(Z)&&(_this94.willRunEffectSelectorIds.add(tt),_this94.noAnimationRect=Ot(_this94.noAnimationRect,$),_this94.noAnimationRect=Ot(_this94.noAnimationRect,Q),_this94.runEffect());}),_this94.workShapes["delete"](Z),(s=t.render)==null||s.push({rect:Q,drawCanvas:xt.Bg,viewId:_this94.viewId});return _context39.abrupt("break",37);case 11:if(!B.node){_context39.next=18;break;}_$3=B.oldRect;_$3&&((f=t.render)==null||f.push({rect:_$3,isClear:!0,clearCanvas:xt.Bg,viewId:_this94.viewId}),(p=t.render)==null||p.push({rect:_$3,drawCanvas:xt.Bg,viewId:_this94.viewId}));_context39.next=16;return B.node.consumeServiceAsync({isFullWork:!0,replaceId:Z});case 16:_Q=_context39.sent;_this94.selectorWorkShapes.forEach(function(et,tt){var ot;(ot=et.selectIds)!=null&&ot.includes(Z)&&(_this94.willRunEffectSelectorIds.add(tt),_this94.noAnimationRect=Ot(_this94.noAnimationRect,_$3),_this94.noAnimationRect=Ot(_this94.noAnimationRect,_Q),_this94.runEffect());}),(c=B.node)==null||c.clearTmpPoints(),_this94.workShapes["delete"](Z),(v=t.render)==null||v.push({rect:_Q,drawCanvas:xt.Bg,viewId:_this94.viewId});case 18:return _context39.abrupt("break",37);case 19:_$4=!!B.ops;if((S=B.animationWorkData)!=null&&S.length){_Q2=B.oldRect,et=B.node.oldRect;_Q2&&((O=t.render)==null||O.push({rect:_Q2,isClear:!0,clearCanvas:xt.Bg,viewId:_this94.viewId}),(x=t.render)==null||x.push({rect:_Q2,drawCanvas:xt.Bg,viewId:_this94.viewId})),et&&((m=t.render)==null||m.push({rect:et,isClear:!0,clearCanvas:xt.ServiceFloat,viewId:_this94.viewId}));tt=(T=B.node)==null?void 0:T.consumeService({op:B.animationWorkData,isFullWork:_$4});e.set(Z,{workState:_Q2?B.ops?Rt.Done:Rt.Doing:Rt.Start,op:B.animationWorkData.filter(function(ot,q){if(q%3!==2)return!0;}).slice(-2)}),_$4?(_this94.selectorWorkShapes.forEach(function(ot,q){var gt;(gt=ot.selectIds)!=null&&gt.includes(Z)&&(_this94.willRunEffectSelectorIds.add(q),_this94.noAnimationRect=Ot(_this94.noAnimationRect,_Q2),_this94.noAnimationRect=Ot(_this94.noAnimationRect,et),_this94.noAnimationRect=Ot(_this94.noAnimationRect,tt),_this94.runEffect());}),(l=B.node)==null||l.clearTmpPoints(),_this94.workShapes["delete"](Z),(d=t.render)==null||d.push({rect:tt,drawCanvas:xt.Bg,viewId:_this94.viewId})):(u=t.render)==null||u.push({rect:tt,drawCanvas:xt.ServiceFloat,workerType:_$4?void 0:Mt.Service,viewId:_this94.viewId}),B.animationWorkData.length=0;}return _context39.abrupt("break",37);case 22:if(!(!B.useAnimation&&B.ops)){_context39.next=28;break;}_$5=(g=B.node)==null?void 0:g.consumeService({op:B.animationWorkData||[],isFullWork:!0,replaceId:Z});_Q3=(M=B.node)==null?void 0:M.updataOptService(B.updateNodeOpt);_$5=Ot(_$5,_Q3),(A=t.render)==null||A.push({isClear:!0,rect:Ot(B.oldRect,_$5),clearCanvas:xt.Bg,viewId:_this94.viewId}),(R=t.render)==null||R.push({rect:Ot(B.oldRect,_$5),drawCanvas:xt.Bg,viewId:_this94.viewId}),_this94.selectorWorkShapes.forEach(function(et,tt){var ot;(ot=et.selectIds)!=null&&ot.includes(Z)&&(_this94.willRunEffectSelectorIds.add(tt),_this94.noAnimationRect=Ot(_this94.noAnimationRect,_$5),_this94.runEffect());}),(b=B.node)==null||b.clearTmpPoints(),_this94.workShapes["delete"](Z);_context39.next=36;break;case 28:if(!B.useAnimation){_context39.next=36;break;}if(!B.isDel){_context39.next=32;break;}(E=B.node)==null||E.clearTmpPoints(),_this94.workShapes["delete"](Z);return _context39.abrupt("break",37);case 32:_$6=3,_Q4=_this94.computNextAnimationIndex(B,_$6),_et3=B.isDiff?0:Math.max(0,(B.animationIndex||0)-_$6),_tt3=(B.animationWorkData||[]).slice(_et3,_Q4),ot=(D=(L=B.node)==null?void 0:L.getWorkId())==null?void 0:D.toString();if((B.animationIndex||0)<_Q4||B.isDiff){q=(I=B.node)==null?void 0:I.consumeService({op:_tt3,isFullWork:!1});if((C=t.render)==null||C.push({rect:q,drawCanvas:xt.ServiceFloat,viewId:_this94.viewId}),B.animationIndex=_Q4,B.isDiff&&(B.isDiff=!1),_tt3.length){gt=_tt3.filter(function(dt,F){if(F%_$6!==_$6-1)return!0;}).slice(-2);e.set(Z,{workState:_et3===0?Rt.Start:_Q4===((W=B.animationWorkData)==null?void 0:W.length)?Rt.Done:Rt.Doing,op:gt});}}else if(B.ops){_q2=(G=B.node)==null?void 0:G.consumeService({op:B.animationWorkData||[],isFullWork:!0,replaceId:ot});B.isDel=!0,(K=t.render)==null||K.push({isClear:!0,rect:_q2,clearCanvas:xt.ServiceFloat,viewId:_this94.viewId},{rect:_q2,drawCanvas:xt.ServiceFloat,viewId:_this94.viewId},{isClear:!0,rect:_q2,clearCanvas:xt.Bg,viewId:_this94.viewId},{rect:_q2,drawCanvas:xt.Bg,viewId:_this94.viewId}),e.set(Z,{workState:Rt.Done,op:_tt3.filter(function(gt,dt){if(dt%_$6!==_$6-1)return!0;}).slice(-2)});}r=!0;return _context39.abrupt("break",37);case 36:return _context39.abrupt("break",37);case 37:case"end":return _context39.stop();}},_loop7);});_iterator42.s();case 7:if((_step42=_iterator42.n()).done){_context40.next=11;break;}return _context40.delegateYield(_loop7(),"t0",9);case 9:_context40.next=7;break;case 11:_context40.next=16;break;case 13:_context40.prev=13;_context40.t1=_context40["catch"](4);_iterator42.e(_context40.t1);case 16:_context40.prev=16;_iterator42.f();return _context40.finish(16);case 19:r&&this.runAnimation(),e.size&&(t.sp=[],e.forEach(function(Z,B){var $;($=t.sp)==null||$.push({type:ct.Cursor,uid:B.split(Sr)[0],op:Z.op,workState:Z.workState,viewId:_this94.viewId});})),(J=t.render)!=null&&J.length&&this.post(t);case 20:case"end":return _context40.stop();}},_callee37,this,[[4,13,16,19]]);}));function animationDraw(){return _animationDraw.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){this.animationId||(this.animationId=requestAnimationFrame(this.animationDraw.bind(this)));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(r,t){var n;var 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);}},{key:"runEffect",value:function runEffect(){this.runEffectId||(this.runEffectId=setTimeout(this.effectRunSelector.bind(this),0));}},{key:"effectRunSelector",value:function effectRunSelector(){var _this95=this;this.runEffectId=void 0;var r=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(t){var i,a;var e=_this95.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||_this95.selectorWorkShapes["delete"](t);}),r&&this.post({render:[{rect:wt(r),isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId},{rect:wt(r),drawCanvas:xt.Bg,viewId:this.viewId}]}),this.willRunEffectSelectorIds.clear(),this.noAnimationRect=void 0;}},{key:"activeSelectorShape",value:function activeSelectorShape(r){var f,p,c;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.selectIds;if(!t)return;var o=t.toString();if(!((f=this.selectorWorkShapes)!=null&&f.has(o))){var v={toolsType:n,selectIds:a,type:i,opt:e};n&&e&&(v=this.setNodeKey(v,n,e)),(p=this.selectorWorkShapes)==null||p.set(o,v);}var s=(c=this.selectorWorkShapes)==null?void 0:c.get(o);i&&(s.type=i),s.node&&s.node.getWorkId()!==o&&s.node.setWorkId(o),s.selectIds=a||[];}}]);}();var og=/*#__PURE__*/function(_n8){function og(t){var _this96;_classCallCheck(this,og);_this96=_callSuper(this,og,[t]);nt(_this96,"combineDrawTimer");return _this96;}_inherits(og,_n8);return _createClass(og,[{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(t){var i,a,e,n,o,s,f;return _regeneratorRuntime().wrap(function _callee38$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:e=this.setFullWork(t),n=t.ops&&Le(t.ops);if(!e){_context41.next=18;break;}f=(i=e.getWorkId())==null?void 0:i.toString();if(!(e.toolsType===ht.Image)){_context41.next=9;break;}_context41.next=6;return e.consumeServiceAsync({isFullWork:!0,scene:(a=this.fullLayer.parent)==null?void 0:a.parent});case 6:o=_context41.sent;_context41.next=16;break;case 9:if(!(e.toolsType===ht.Text)){_context41.next=15;break;}_context41.next=12;return e.consumeServiceAsync({isFullWork:!0,replaceId:f,isDrawLabel:!0});case 12:o=_context41.sent;_context41.next=16;break;case 15:o=e.consumeService({op:n,isFullWork:!0,replaceId:f}),s=(t==null?void 0:t.updateNodeOpt)&&e.updataOptService(t.updateNodeOpt);case 16:t.workId&&this.workShapes["delete"](t.workId.toString());return _context41.abrupt("return",Ot(o,s));case 18:case"end":return _context41.stop();}},_callee38,this);}));function runFullWork(_x52){return _runFullWork.apply(this,arguments);}return runFullWork;}()},{key:"runSelectWork",value:function runSelectWork(t){var n;var e=this.setFullWork(t);e&&(n=t.selectIds)!=null&&n.length&&t.workId&&e.selectServiceNode(t.workId.toString(),{selectIds:t.selectIds},!1);}},{key:"workShapesDone",value:function workShapesDone(){var _iterator43=_createForOfIteratorHelper(this.workShapes.keys()),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var t=_step43.value;this.clearWorkShapeNodeCache(t);}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}this.fullLayer.removeAllChildren();}},{key:"consumeDraw",value:function consumeDraw(t){var e=t.workId,n=e&&this.workShapes.get(e.toString());if(!n)return;var 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;}}}},{key:"consumeDrawAll",value:function consumeDrawAll(t){var e=t.workId;if(e){var n=e.toString(),i=this.workShapes.get(n);if(!i)return;switch(i.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(n);break;}}}},{key:"updateLabels",value:function updateLabels(t,e){t.children.forEach(function(n){if(n.tagName==="LABEL"){var i=n.name,_n$getBoundingClientR=n.getBoundingClientRect(),a=_n$getBoundingClientR.width,_t$worldScaling=_slicedToArray(t.worldScaling,1),o=_t$worldScaling[0],_e$opt=e.opt,s=_e$opt.underline,f=_e$opt.lineThrough;s&&t.getElementsByName("".concat(i,"_underline"))[0].attr({points:[0,0,a/o,0]}),f&&t.getElementsByName("".concat(i,"_lineThrough"))[0].attr({points:[0,0,a/o,0]});}});}},{key:"removeWork",value:function removeWork(t){var e=t.workId,n=e==null?void 0:e.toString();if(n){var i=this.removeNode(n);if(i){var a=[];a.push({rect:wt(i),clearCanvas:xt.Float,isClear:!0,viewId:this.viewId},{rect:wt(i),drawCanvas:xt.Float,viewId:this.viewId}),this._post({render:a});}}}},{key:"removeNode",value:function removeNode(t){var e=this.workShapes.has(t);var n;return e&&(this.fullLayer.getElementsByName(t).forEach(function(i){var a=i.getBoundingClientRect();n=Ot(n,{x:a.x-yt.SafeBorderPadding,y:a.y-yt.SafeBorderPadding,w:a.width+yt.SafeBorderPadding*2,h:a.height+yt.SafeBorderPadding*2}),i.remove();}),n&&this.clearWorkShapeNodeCache(t)),n;}},{key:"drawPencil",value:function drawPencil(t,e){this._post({drawCount:this.drawCount,render:[{rect:t==null?void 0:t.rect,workId:e,drawCanvas:xt.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});}},{key:"drawArrow",value:function drawArrow(t){this._post({drawCount:this.drawCount,render:[{rect:(t==null?void 0:t.rect)&&wt(t.rect),isClear:!0,clearCanvas:xt.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&wt(t.rect),drawCanvas:xt.Float,viewId:this.viewId}]});}}]);}(_n);var ag=/*#__PURE__*/function(){function ag(r){_classCallCheck(this,ag);nt(this,"viewId");nt(this,"vNodes");nt(this,"topLayer");nt(this,"post");nt(this,"serviceWorkShapes",/* @__PURE__ */new Map());nt(this,"localWorkShapes",/* @__PURE__ */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);}return _createClass(ag,[{key:"getWorkShape",value:function getWorkShape(r){return this.localWorkShapes.get(r);}},{key:"getTmpWorkShapeNode",value:function getTmpWorkShapeNode(){return this.tmpWorkShapeNode;}},{key:"setTmpWorkId",value:function 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;}}},{key:"setWorkOptions",value:function 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);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(r){var t=r.toolsType;if(t===ht.LaserPen)return xr(_objectSpread(_objectSpread({},r),{},{vNodes:this.vNodes,fullLayer:this.topLayer,drawLayer:this.topLayer}));}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.localWorkShapes.forEach(function(r){var t;return(t=r.node)==null?void 0:t.clearTmpPoints();}),this.localWorkShapes.clear();}},{key:"setToolsOpt",value:function setToolsOpt(r){this.tmpOpt=r,this.tmpWorkShapeNode=this.createWorkShapeNode(r);}},{key:"consumeDraw",value:function consumeDraw(r){var t=r.workId,e=r.dataType;if(e===Mt.Service)this.activeServiceWorkShape(r);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var a=i.node.consume({data:r,isFullWork:!1,isSubWorker:!0});a.rect&&(i.totalRect=Ot(a.rect,i.totalRect),i.result=a,i.workState=Rt.Doing,n&&this.localWorkShapes.set(n,i));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(r){var t=r.workId,e=r.dataType;if(e===Mt.Service)this.activeServiceWorkShape(r);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var a=i.node.consumeAll({data:r});i.totalRect=Ot(a.rect,i.totalRect),i.result=a,i.workState=Rt.Done,n&&this.localWorkShapes.set(n,i);}this.runAnimation();}},{key:"destroy",value:function destroy(){this.serviceWorkShapes.clear(),this.localWorkShapes.clear();}},{key:"setNodeKey",value:function setNodeKey(r,t,e){return r.toolsType=t,r.node=this.createWorkShapeNode({toolsType:t,toolsOpt:e}),r;}},{key:"activeServiceWorkShape",value:function activeServiceWorkShape(r){var v,S;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,o=r.ops,s=r.op;if(!t)return;var f=t.toString(),p=(v=this.vNodes.get(f))==null?void 0:v.rect;if(!((S=this.serviceWorkShapes)!=null&&S.has(f))){var O={toolsType:n,animationWorkData:s||[],animationIndex:0,type:i,updateNodeOpt:a,ops:o,oldRect:p};n&&e&&(O=this.setNodeKey(O,n,e)),this.serviceWorkShapes.set(f,O);}var c=this.serviceWorkShapes.get(f);i&&(c.type=i),o&&(c.animationWorkData=Le(o),c.ops=o),a&&(c.updateNodeOpt=a),s&&(c.animationWorkData=s),c.node&&c.node.getWorkId()!==f&&c.node.setWorkId(f),p&&(c.oldRect=p),n&&e&&(c.toolsType!==n&&n&&e&&this.setNodeKey(c,n,e),c.node&&c.node.setWorkOptions(e));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(r,t){var n;var 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);}},{key:"animationDraw",value:function(){var _animationDraw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(){var _this97=this;var a,o,s,f,r,t,e,n,i,_iterator44,_step44,_step44$value,p,c,S,O,x,m,_iterator45,_step45,_step45$value,_p10,_c6,v,_S8,_O2,_x53,_m14;return _regeneratorRuntime().wrap(function _callee39$(_context42){while(1)switch(_context42.prev=_context42.next){case 0:this.animationId=void 0;r=!1;t=/* @__PURE__ */new Map(),e=[],n=[],i=[];_iterator44=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context42.prev=4;_iterator44.s();case 6:if((_step44=_iterator44.n()).done){_context42.next=20;break;}_step44$value=_slicedToArray(_step44.value,2),p=_step44$value[0],c=_step44$value[1];_context42.t0=c.toolsType;_context42.next=_context42.t0===ht.LaserPen?11:18;break;case 11:S=this.computNextAnimationIndex(c,8),O=Math.max(0,c.animationIndex||0),x=(c.animationWorkData||[]).slice(O,S);if((c.animationIndex||0)<S){m=(a=c.node)==null?void 0:a.consumeService({op:x,isFullWork:!1});c.totalRect=Ot(c.totalRect,m),c.animationIndex=S,x.length&&t.set(p,{workState:O===0?Rt.Start:S===((o=c.animationWorkData)==null?void 0:o.length)?Rt.Done:Rt.Doing,op:x.slice(-2)});}if(!(n.push({isClear:!0,rect:c.totalRect,clearCanvas:xt.TopFloat,viewId:this.viewId}),e.push({rect:c.totalRect,drawCanvas:xt.TopFloat,viewId:this.viewId}),c.isDel)){_context42.next=16;break;}(s=c.node)==null||s.clearTmpPoints(),this.serviceWorkShapes["delete"](p);return _context42.abrupt("break",18);case 16:c.ops&&c.animationIndex===((f=c.animationWorkData)==null?void 0:f.length)&&!c.isDel&&(this.topLayer.getElementsByName(p.toString())[0]||(c.isDel=!0,this.serviceWorkShapes.set(p,c))),r=!0;return _context42.abrupt("break",18);case 18:_context42.next=6;break;case 20:_context42.next=25;break;case 22:_context42.prev=22;_context42.t1=_context42["catch"](4);_iterator44.e(_context42.t1);case 25:_context42.prev=25;_iterator44.f();return _context42.finish(25);case 28:_iterator45=_createForOfIteratorHelper(this.localWorkShapes.entries());_context42.prev=29;_iterator45.s();case 31:if((_step45=_iterator45.n()).done){_context42.next=44;break;}_step45$value=_slicedToArray(_step45.value,2),_p10=_step45$value[0],_c6=_step45$value[1];v=_c6.result,_S8=_c6.toolsType,_O2=_c6.totalRect,_x53=_c6.isDel,_m14=_c6.workState;_context42.t2=_S8;_context42.next=_context42.t2===ht.LaserPen?37:42;break;case 37:if(!(_O2&&(n.push({isClear:!0,rect:_O2,clearCanvas:xt.TopFloat,viewId:this.viewId}),e.push({rect:_O2,drawCanvas:xt.TopFloat,viewId:this.viewId})),_x53)){_context42.next=40;break;}_c6.node.clearTmpPoints(),this.localWorkShapes["delete"](_p10),i.push({removeIds:[_p10.toString()],viewId:this.viewId,type:ct.RemoveNode});return _context42.abrupt("break",42);case 40:v&&((v.op||v.ops)&&i.push(v),_c6.result=void 0),!this.topLayer.getElementsByName(_p10.toString())[0]&&_m14===Rt.Done&&(_c6.isDel=!0,this.localWorkShapes.set(_p10,_c6)),r=!0;return _context42.abrupt("break",42);case 42:_context42.next=31;break;case 44:_context42.next=49;break;case 46:_context42.prev=46;_context42.t3=_context42["catch"](29);_iterator45.e(_context42.t3);case 49:_context42.prev=49;_iterator45.f();return _context42.finish(49);case 52:r&&this.runAnimation(),t.size&&t.forEach(function(p,c){i.push({type:ct.Cursor,uid:c.split(Sr)[0],op:p.op,workState:p.workState,viewId:_this97.viewId});}),(e.length||n.length||i.length)&&this.post({render:[].concat(n,e),sp:i});case 53:case"end":return _context42.stop();}},_callee39,this,[[4,22,25,28],[29,46,49,52]]);}));function animationDraw(){return _animationDraw2.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){this.animationId||(this.animationId=requestAnimationFrame(this.animationDraw.bind(this)));}}]);}();var ti=/* @__PURE__ */function(h){return h.Full="full",h.Sub="sub",h;}(ti||{});var lg=/*#__PURE__*/function(){function lg(r,t){_classCallCheck(this,lg);nt(this,"_self");nt(this,"type");nt(this,"workThreadMap",/* @__PURE__ */new Map());this._self=r,this.type=t,this.register();}return _createClass(lg,[{key:"init",value:function init(r){var t=r.viewId,e=r.dpr,n=r.offscreenCanvasOpt,i=r.layerOpt,a=r.isSafari;if(!e||!n||!i)return;var o;this.type==="full"&&(o=new cg(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),this.type==="sub"&&(o=new fg(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),o&&a&&o.setIsSafari(a),o&&r.cameraOpt&&o.setCameraOpt(r.cameraOpt),o&&this.workThreadMap.set(t,o);}},{key:"register",value:function register(){var _this98=this;onmessage=/*#__PURE__*/function(){var _ref165=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(r){var t,_iterator46,_step46,_e10,n,i,a,o,_iterator47,_step47,_step47$value,f,p,c,_iterator48,_step48,_f5,s;return _regeneratorRuntime().wrap(function _callee40$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:t=r.data;if(!t){_context43.next=50;break;}_iterator46=_createForOfIteratorHelper(t.values());_context43.prev=3;_iterator46.s();case 5:if((_step46=_iterator46.n()).done){_context43.next=42;break;}_e10=_step46.value;n=_e10.msgType,i=_e10.viewId,a=_e10.tasksqueue,o=_e10.mainTasksqueueCount;if(!(n===ct.Init)){_context43.next=11;break;}_this98.init(_e10);return _context43.abrupt("continue",40);case 11:if(!(n===ct.TasksQueue&&a!=null&&a.size)){_context43.next=34;break;}_iterator47=_createForOfIteratorHelper(_this98.workThreadMap.entries());_context43.prev=13;_iterator47.s();case 15:if((_step47=_iterator47.n()).done){_context43.next=24;break;}_step47$value=_slicedToArray(_step47.value,2),f=_step47$value[0],p=_step47$value[1];c=a.get(f);_context43.t0=c;if(!_context43.t0){_context43.next=22;break;}_context43.next=22;return p.on(c);case 22:_context43.next=15;break;case 24:_context43.next=29;break;case 26:_context43.prev=26;_context43.t1=_context43["catch"](13);_iterator47.e(_context43.t1);case 29:_context43.prev=29;_iterator47.f();return _context43.finish(29);case 32:_this98.type==="full"&&kt(o)&&_this98.post({workerTasksqueueCount:o});return _context43.abrupt("continue",40);case 34:if(!(i===_h)){_context43.next=38;break;}_iterator48=_createForOfIteratorHelper(_this98.workThreadMap.values());try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){_f5=_step48.value;_f5.on(_e10),n===ct.Destroy&&_this98.workThreadMap["delete"](i);}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}return _context43.abrupt("continue",40);case 38:s=_this98.workThreadMap.get(i);s&&(s.on(_e10),n===ct.Destroy&&_this98.workThreadMap["delete"](i));case 40:_context43.next=5;break;case 42:_context43.next=47;break;case 44:_context43.prev=44;_context43.t2=_context43["catch"](3);_iterator46.e(_context43.t2);case 47:_context43.prev=47;_iterator46.f();return _context43.finish(47);case 50:case"end":return _context43.stop();}},_callee40,null,[[3,44,47,50],[13,26,29,32]]);}));return function onmessage(_x54){return _ref165.apply(this,arguments);};}();}},{key:"post",value:function post(r,t){t?this._self.postMessage(r,t):this._self.postMessage(r);}}]);}();var cg=/*#__PURE__*/function(_qn){function cg(t,e,n){var _this99;_classCallCheck(this,cg);_this99=_callSuper(this,cg,[t,e]);nt(_this99,"serviceDrawLayer");nt(_this99,"localDrawLayer");nt(_this99,"snapshotFullLayer");nt(_this99,"methodBuilder");nt(_this99,"localWork");nt(_this99,"serviceWork");nt(_this99,"_post");_this99._post=n,_this99.serviceDrawLayer=_this99.createLayer("serviceDrawLayer",_this99.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:1e3})),_this99.localDrawLayer=_this99.createLayer("localDrawLayer",_this99.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:1e3}));var i={thread:_this99,viewId:_this99.viewId,vNodes:_this99.vNodes,fullLayer:_this99.fullLayer};_this99.localWork=new ig(_objectSpread(_objectSpread({},i),{},{drawLayer:_this99.localDrawLayer})),_this99.serviceWork=new sg(_objectSpread(_objectSpread({},i),{},{drawLayer:_this99.serviceDrawLayer})),_this99.methodBuilder=new T0([Lt.CopyNode,Lt.SetColorNode,Lt.DeleteNode,Lt.RotateNode,Lt.ScaleNode,Lt.TranslateNode,Lt.ZIndexNode,Lt.SetFontStyle,Lt.SetPoint,Lt.SetLock,Lt.SetShapeOpt]).registerForWorker(_this99.localWork,_this99.serviceWork,_this99.scene),_this99.vNodes.init(_this99.fullLayer);return _this99;}_inherits(cg,_qn);return _createClass(cg,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(){var _this100=this;var a,o,s,f,_this$combinePostData,t,e,n,p,_iterator49,_step49,c,v,i;return _regeneratorRuntime().wrap(function _callee41$(_context44){while(1)switch(_context44.prev=_context44.next){case 0:_this$combinePostData=this.combinePostData(),t=_this$combinePostData.render,e=_objectWithoutProperties(_this$combinePostData,_excluded3);if(!(t!=null&&t.length)){_context44.next=28;break;}p=[];_iterator49=_createForOfIteratorHelper(t);_context44.prev=4;_iterator49.s();case 6:if((_step49=_iterator49.n()).done){_context44.next=19;break;}c=_step49.value;if(!c.rect){_context44.next=17;break;}if(!(c.drawCanvas&&(c.rect=this.safariFixRect(Jt(c.rect))),!c.rect)){_context44.next=11;break;}return _context44.abrupt("continue",17);case 11:if(!(c.drawCanvas&&c.rect&&c.rect.w>0&&c.rect.h>0)){_context44.next=16;break;}_context44.next=14;return this.getRectImageBitmap(c);case 14:v=_context44.sent;c.imageBitmap=v,n||(n=[]),n.push(v);case 16:p.push(c);case 17:_context44.next=6;break;case 19:_context44.next=24;break;case 21:_context44.prev=21;_context44.t0=_context44["catch"](4);_iterator49.e(_context44.t0);case 24:_context44.prev=24;_iterator49.f();return _context44.finish(24);case 27:e.render=p;case 28:i=(a=e.sp)==null?void 0:a.filter(function(p){return p.type!==ct.None||Object.keys(p).filter(function(c){return c==="type";}).length;});i!=null&&i.length&&(e.sp=i.map(function(p){return _objectSpread(_objectSpread({},p),{},{viewId:_this100.viewId});})),((o=e.sp)==null?void 0:o.length)===0&&delete e.sp,e.drawCount===void 0&&delete e.drawCount,(e!=null&&e.drawCount||(s=e.sp)!=null&&s.length||(f=e.render)!=null&&f.length)&&this._post(e,n);case 30:case"end":return _context44.stop();}},_callee41,this,[[4,21,24,27]]);}));function combinePost(){return _combinePost.apply(this,arguments);}return combinePost;}()},{key:"on",value:function(){var _on2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee42$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context45.next=2;break;}return _context45.abrupt("return");case 2:e=t.msgType,n=t.dataType,i=t.workId;_context45.t0=e;_context45.next=_context45.t0===ct.UpdateCamera?6:_context45.t0===ct.Select?9:_context45.t0===ct.UpdateNode?11:_context45.t0===ct.FullWork?11:_context45.t0===ct.RemoveNode?14:_context45.t0===ct.GetTextActive?17:_context45.t0===ct.CursorHover?19:21;break;case 6:_context45.next=8;return this.updateCamera(t);case 8:return _context45.abrupt("return");case 9:n===Mt.Service&&(i===Nt.selectorId?this.localWork.updateFullSelectWork(t):this.serviceWork.runSelectWork(t));return _context45.abrupt("return");case 11:_context45.next=13;return this.consumeFull(n,t);case 13:return _context45.abrupt("return");case 14:_context45.next=16;return this.removeNode(t);case 16:return _context45.abrupt("return");case 17:this.checkTextActive(t);return _context45.abrupt("return");case 19:this.cursorHover(t);return _context45.abrupt("return");case 21:_context45.next=23;return _get(_getPrototypeOf(cg.prototype),"on",this).call(this,t);case 23:case"end":return _context45.stop();}},_callee42,this);}));function on(_x55){return _on2.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(t){var e,n;return _regeneratorRuntime().wrap(function _callee43$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:e=t.dataType,n=t.workId;if(!(n===Nt.selectorId)){_context46.next=4;break;}this.localWork.blurSelector(t);return _context46.abrupt("return");case 4:_context46.t0=e===Mt.Local;if(!_context46.t0){_context46.next=9;break;}this.localWork.removeWork(t);_context46.next=9;return this.localWork.colloctEffectSelectWork(t);case 9:_context46.t1=e===Mt.Service;if(!_context46.t1){_context46.next=14;break;}this.serviceWork.removeWork(t);_context46.next=14;return this.localWork.colloctEffectSelectWork(t);case 14:case"end":return _context46.stop();}},_callee43,this);}));function removeNode(_x56){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function checkTextActive(t){var e=t.dataType;e===Mt.Local&&this.localWork.checkTextActive(t);}},{key:"clearAll",value:function clearAll(){this.vNodes.clear(),_get(_getPrototypeOf(cg.prototype),"clearAll",this).call(this),this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.localDrawLayer.removeAllChildren()),this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.serviceDrawLayer.removeAllChildren()),this.post({render:[{isClearAll:!0,clearCanvas:xt.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:xt.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId}],sp:[{type:ct.Clear}]});}},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_get(_getPrototypeOf(cg.prototype),"updateLayer",this).call(this,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*0.5,n*0.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*0.5,n*0.5]));}},{key:"setCameraOpt",value:function setCameraOpt(t){this.cameraOpt=t;var e=t.scale,n=t.centerX,i=t.centerY,a=t.width,o=t.height;(a!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:a,height:o}),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]));}},{key:"getLayer",value:function getLayer(t){switch(t){case xt.Bg:return this.fullLayer;case xt.ServiceFloat:return this.serviceDrawLayer;case xt.Float:return this.localDrawLayer;}}},{key:"getOffscreen",value:function getOffscreen(t){return this.getLayer(t).parent.canvas;}},{key:"consumeFull",value:function(){var _consumeFull2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(t,e){var n;return _regeneratorRuntime().wrap(function _callee44$(_context47){while(1)switch(_context47.prev=_context47.next){case 0:_context47.next=2;return this.localWork.colloctEffectSelectWork(e);case 2:n=_context47.sent;_context47.t0=n&&t===Mt.Local;if(!_context47.t0){_context47.next=7;break;}_context47.next=7;return this.localWork.consumeFull(n,this.scene);case 7:n&&t===Mt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context47.stop();}},_callee44,this);}));function consumeFull(_x57,_x58){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function consumeDraw(t,e){t===Mt.Local&&this.localWork.consumeDraw(e,this.serviceWork),t===Mt.Service&&this.serviceWork.consumeDraw(e);}},{key:"consumeDrawAll",value:function consumeDrawAll(t,e){t===Mt.Local&&this.localWork.consumeDrawAll(e,this.serviceWork);}},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(t){var _this101=this;var a,e,n,i,o,s,f,_iterator50,_step50,_step50$value,p,c;return _regeneratorRuntime().wrap(function _callee45$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:e=[],n=t.cameraOpt,i=t.scenePath;if(!(n&&!oe(this.cameraOpt,n))){_context48.next=20;break;}o=this.localWork.getWorkShape($e);o&&(a=o.selectIds)!=null&&a.length&&o.cursorBlur();s=!!this.localDrawLayer.children.length;f=!!this.serviceDrawLayer.children.length;i&&_toConsumableArray(this.localWork.getWorkShapes().keys()).filter(function(c){return c!==$e;}).length&&(this.localWork.workShapesDone(i,this.serviceWork),s=!0);this.setCameraOpt(n);this.localWork.workShapes.forEach(function(p,c){(p.toolsType===ht.Pencil||p.toolsType===ht.Arrow||p.toolsType===ht.Straight||p.toolsType===ht.Ellipse||p.toolsType===ht.Rectangle||p.toolsType===ht.Star||p.toolsType===ht.Polygon||p.toolsType===ht.SpeechBalloon||p.toolsType===ht.Text)&&_this101.localWork.workShapeState.set(c,{willClear:!0});});_context48.t0=this.vNodes.curNodeMap.size;if(!_context48.t0){_context48.next=16;break;}this.vNodes.clearTarget();this.vNodes.updateNodesRect();_context48.next=15;return this.localWork.reRenderSelector();case 15:_context48.t0=this.serviceWork.selectorWorkShapes.size;case 16:if(!_context48.t0){_context48.next=19;break;}_iterator50=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){_step50$value=_slicedToArray(_step50.value,2),p=_step50$value[0],c=_step50$value[1];this.serviceWork.runSelectWork({workId:p,selectIds:c.selectIds,msgType:ct.Select,dataType:Mt.Service,viewId:this.viewId});}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}case 19:s&&e.push({isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId}),f&&e.push({isClearAll:!0,clearCanvas:xt.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&e.push({isClearAll:!0,clearCanvas:xt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:xt.Bg,viewId:this.viewId}),e.length&&this.post({render:e});case 20:case"end":return _context48.stop();}},_callee45,this);}));function updateCamera(_x59){return _updateCamera.apply(this,arguments);}return updateCamera;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var e=t.rect,n=t.drawCanvas,i=e.x*this.dpr,a=e.y*this.dpr,o=e.w*this.dpr||1,s=e.h*this.dpr||1;return createImageBitmap(this.getOffscreen(n),i,a,o,s,{resizeQuality:"low"});}// private checkRightRectBoundingBox(rect:IRectType){
443
+ // return this.vNodes.combineIntersectRect(rect);
444
+ // }
445
+ },{key:"cursorHover",value:function cursorHover(t){this.localWork.cursorHover(t);}}]);}(qn);var fg=/*#__PURE__*/function(_qn2){function fg(t,e,n){var _this102;_classCallCheck(this,fg);_this102=_callSuper(this,fg,[t,e]);nt(_this102,"_post");nt(_this102,"topLayer");nt(_this102,"snapshotFullLayer");nt(_this102,"serviceWork");nt(_this102,"localWork");nt(_this102,"topLayerWork");_this102._post=n,_this102.topLayer=_this102.createLayer("topLayer",_this102.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:1500}));var i={thread:_this102,viewId:_this102.viewId,vNodes:_this102.vNodes,fullLayer:_this102.fullLayer,topLayer:_this102.topLayer};_this102.localWork=new og(i),_this102.topLayerWork=new ag(i),_this102.vNodes.init(_this102.fullLayer);return _this102;}_inherits(fg,_qn2);return _createClass(fg,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46(){var _this103=this;var a,o,s,f,p,_this$combinePostData2,t,e,n,c,_iterator51,_step51,v,S,_iterator52,_step52,_c7,i;return _regeneratorRuntime().wrap(function _callee46$(_context49){while(1)switch(_context49.prev=_context49.next){case 0:_this$combinePostData2=this.combinePostData(),t=_this$combinePostData2.render,e=_objectWithoutProperties(_this$combinePostData2,_excluded4);if(!(t!=null&&t.length)){_context49.next=28;break;}c=[];_iterator51=_createForOfIteratorHelper(t);_context49.prev=4;_iterator51.s();case 6:if((_step51=_iterator51.n()).done){_context49.next=19;break;}v=_step51.value;if(!v.rect){_context49.next=17;break;}if(!(v.drawCanvas&&(v.rect=this.safariFixRect(Jt(v.rect))),!v.rect)){_context49.next=11;break;}return _context49.abrupt("continue",17);case 11:if(!(v.drawCanvas&&v.rect&&v.rect.w>0&&v.rect.h>0)){_context49.next=16;break;}_context49.next=14;return this.getRectImageBitmap(v);case 14:S=_context49.sent;v.imageBitmap=S,n||(n=[]),n.push(S);case 16:c.push(v);case 17:_context49.next=6;break;case 19:_context49.next=24;break;case 21:_context49.prev=21;_context49.t0=_context49["catch"](4);_iterator51.e(_context49.t0);case 24:_context49.prev=24;_iterator51.f();return _context49.finish(24);case 27:e.render=c;case 28:if((a=e.workIds)!=null&&a.size&&e.drawCount){_iterator52=_createForOfIteratorHelper(e.workIds.values());try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){_c7=_step52.value;this.fullLayer.getElementsByName(_c7).forEach(function(v){v.id&&e.drawCount&&Number(v.id)<e.drawCount&&v.remove();});}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}}i=(o=e.sp)==null?void 0:o.filter(function(c){return c.type!==ct.None||Object.keys(c).filter(function(v){return v==="type";}).length;});i!=null&&i.length&&(e.sp=i.map(function(c){return _objectSpread(_objectSpread({},c),{},{viewId:_this103.viewId});})),((s=e.sp)==null?void 0:s.length)===0&&delete e.sp,e.drawCount===void 0&&delete e.drawCount,((f=e.sp)!=null&&f.length||e.drawCount||(p=e==null?void 0:e.render)!=null&&p.length)&&this._post(e,n);case 31:case"end":return _context49.stop();}},_callee46,this,[[4,21,24,27]]);}));function combinePost(){return _combinePost2.apply(this,arguments);}return combinePost;}()},{key:"getLayer",value:function getLayer(t,e){if(e&&this.snapshotFullLayer)return this.snapshotFullLayer;switch(t){case xt.TopFloat:return this.topLayer;default:return this.fullLayer;}}},{key:"on",value:function(){var _on3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(t){var e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee47$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:e=t.msgType,n=t.toolsType,i=t.opt,a=t.workId,o=t.dataType;_context50.t0=e;_context50.next=_context50.t0===ct.UpdateCamera?4:_context50.t0===ct.UpdateTools?7:_context50.t0===ct.CreateWork?12:_context50.t0===ct.RemoveNode?16:_context50.t0===ct.FullWork?19:_context50.t0===ct.Snapshot?23:_context50.t0===ct.BoundingBox?30:37;break;case 4:_context50.next=6;return this.updateCamera(t);case 6:return _context50.abrupt("break",37);case 7:if(!(n===ht.LaserPen&&i)){_context50.next=11;break;}s={toolsType:n,toolsOpt:i};this.topLayerWork.setToolsOpt(s);return _context50.abrupt("return");case 11:return _context50.abrupt("break",37);case 12:if(!(n===ht.LaserPen&&a&&i)){_context50.next=15;break;}this.topLayerWork.getTmpWorkShapeNode()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:i}),this.topLayerWork.setWorkOptions(a.toString(),i);return _context50.abrupt("return");case 15:return _context50.abrupt("break",37);case 16:_context50.next=18;return this.removeNode(t);case 18:return _context50.abrupt("return");case 19:if(!(n===ht.LaserPen)){_context50.next=22;break;}this.consumeDrawAll(o,t);return _context50.abrupt("return");case 22:return _context50.abrupt("break",37);case 23:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId==="mainView"?6e3:3e3}));_context50.t1=this.snapshotFullLayer;if(!_context50.t1){_context50.next=29;break;}_context50.next=28;return this.getSnapshot(t);case 28:this.snapshotFullLayer=void 0;case 29:return _context50.abrupt("return");case 30:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId==="mainView"?6e3:3e3}));_context50.t2=this.snapshotFullLayer;if(!_context50.t2){_context50.next=36;break;}_context50.next=35;return this.getBoundingRect(t);case 35:this.snapshotFullLayer=void 0;case 36:return _context50.abrupt("return");case 37:_context50.next=39;return _get(_getPrototypeOf(fg.prototype),"on",this).call(this,t);case 39:case"end":return _context50.stop();}},_callee47,this);}));function on(_x60){return _on3.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(t){var e;return _regeneratorRuntime().wrap(function _callee48$(_context51){while(1)switch(_context51.prev=_context51.next){case 0:e=t.dataType;e===Mt.Local&&this.localWork.removeWork(t);case 2:case"end":return _context51.stop();}},_callee48,this);}));function removeNode(_x61){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"getOffscreen",value:function getOffscreen(t,e){return this.getLayer(t,e).parent.canvas;}},{key:"consumeDraw",value:function consumeDraw(t,e){var n=e.op,i=e.workId;if(n!=null&&n.length&&i){if(this.localWork.workShapes.get(i.toString())){this.localWork.consumeDraw(e);return;}if(this.topLayerWork.localWorkShapes.get(i.toString())){this.topLayerWork.consumeDraw(e);return;}}}},{key:"consumeDrawAll",value:function consumeDrawAll(t,e){var n=e.ops,i=e.op,a=e.workId;if((n||i!=null&&i.length)&&a){if(this.localWork.workShapes.get(a.toString())){this.localWork.consumeDrawAll(e);return;}if(this.topLayerWork.localWorkShapes.get(a.toString())){this.topLayerWork.consumeDrawAll(e);return;}}}},{key:"clearAll",value:function clearAll(){this.vNodes.clear(),_get(_getPrototypeOf(fg.prototype),"clearAll",this).call(this),this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.topLayer.removeAllChildren()),this.post({render:[{isClearAll:!0,clearCanvas:xt.TopFloat,viewId:this.viewId}],sp:[{type:ct.Clear}]});}},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var n=arguments.length>2?arguments[2]:undefined;var i=t.rect,a=t.drawCanvas,o=i.x*this.dpr,s=i.y*this.dpr,f=i.w*this.dpr||1,p=i.h*this.dpr||1;return createImageBitmap(this.getOffscreen(a,e),o,s,f,p,n);}},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_get(_getPrototypeOf(fg.prototype),"updateLayer",this).call(this,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*0.5,n*0.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*0.5,n*0.5]));}},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee49(t){var _this104=this;var e,n,i,a,_iterator53,_step53,_loop8;return _regeneratorRuntime().wrap(function _callee49$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:e=[],n=t.cameraOpt;if(!(n&&!oe(this.cameraOpt,n))){_context53.next=22;break;}i=!!this.topLayerWork.localWorkShapes.size,a=!!this.localWork.getWorkShapes().size;if(!(a&&this.localWork.workShapesDone(),this.setCameraOpt(n),a&&e.push({isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId}),i)){_context53.next=21;break;}e.push({isClearAll:!0,clearCanvas:xt.TopFloat,viewId:this.viewId});_iterator53=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries());_context53.prev=6;_loop8=/*#__PURE__*/_regeneratorRuntime().mark(function _loop8(){var _step53$value,o,s,f;return _regeneratorRuntime().wrap(function _loop8$(_context52){while(1)switch(_context52.prev=_context52.next){case 0:_step53$value=_slicedToArray(_step53.value,2),o=_step53$value[0],s=_step53$value[1];if(s.totalRect){_this104.topLayer.getElementsByName(o.toString()).forEach(function(p){var c=p.getBoundingClientRect(),v=wt({x:c.x,y:c.y,w:c.width,h:c.height});f=Ot(f,v);}),s.totalRect=f,_this104.topLayerWork.localWorkShapes.set(o,s);}case 2:case"end":return _context52.stop();}},_loop8);});_iterator53.s();case 9:if((_step53=_iterator53.n()).done){_context53.next=13;break;}return _context53.delegateYield(_loop8(),"t0",11);case 11:_context53.next=9;break;case 13:_context53.next=18;break;case 15:_context53.prev=15;_context53.t1=_context53["catch"](6);_iterator53.e(_context53.t1);case 18:_context53.prev=18;_iterator53.f();return _context53.finish(18);case 21:e.length&&this.post({render:e});case 22:case"end":return _context53.stop();}},_callee49,this,[[6,15,18,21]]);}));function updateCamera(_x62){return _updateCamera2.apply(this,arguments);}return updateCamera;}()},{key:"setCameraOpt",value:function setCameraOpt(t,e){this.cameraOpt=t;var n=t.scale,i=t.centerX,a=t.centerY,o=t.width,s=t.height;(o!==this.scene.width||s!==this.scene.height)&&this.updateScene({width:o,height:s}),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]));}},{key:"getSnapshot",value:function(){var _getSnapshot=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee50(t){var e,n,i,a,o,s,f,_i4,_Object$entries,_Object$entries$_i,c,v,S,O,p;return _regeneratorRuntime().wrap(function _callee50$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt,a=t.w,o=t.h;if(!(e&&n&&i&&this.snapshotFullLayer)){_context54.next=27;break;}s=Jt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i4=0,_Object$entries=Object.entries(n);case 5:if(!(_i4<_Object$entries.length)){_context54.next=20;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i4],2),c=_Object$entries$_i[0],v=_Object$entries$_i[1];if(!(v!=null&&v.type)){_context54.next=17;break;}_context54.t0=v==null?void 0:v.type;_context54.next=_context54.t0===ct.UpdateNode?11:_context54.t0===ct.FullWork?11:17;break;case 11:S=v.opt;_context54.next=14;return this.localWork.runFullWork(_objectSpread(_objectSpread({},v),{},{opt:S,workId:c,msgType:ct.FullWork,dataType:Mt.Service,viewId:this.viewId}));case 14:O=_context54.sent;f=Ot(f,O);return _context54.abrupt("break",17);case 17:_i4++;_context54.next=5;break;case 20:a&&o&&(p={resizeWidth:a,resizeHeight:o});_context54.next=23;return new Promise(function(c){setTimeout(c,500);});case 23:_context54.next=25;return this.getSnapshotRender({scenePath:e,curCameraOpt:s,options:p});case 25:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;case 27:case"end":return _context54.stop();}},_callee50,this);}));function getSnapshot(_x63){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()// private willRenderSpecialLabel(willRenderMap:Map<string,BaseCollectorReducerAction>){
446
+ // for (const [key,value] of willRenderMap.entries()) {
447
+ // const labelGroup = this.snapshotFullLayer?.getElementsByName(key)[0] as Group;
448
+ // if (labelGroup && value.opt) {
449
+ // this.localWork.updateLabels(labelGroup, value);
450
+ // }
451
+ // }
452
+ // }
453
+ },{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51(t){var o,s,e,n,i,a;return _regeneratorRuntime().wrap(function _callee51$(_context55){while(1)switch(_context55.prev=_context55.next){case 0:e=t.scenePath,n=t.curCameraOpt,i=t.options;((o=this.snapshotFullLayer)==null?void 0:o.parent).render();_context55.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:xt.None},!0,i);case 4:a=_context55.sent;a&&(this._post({sp:[{type:ct.Snapshot,scenePath:e,imageBitmap:a,viewId:this.viewId}]},[a]),a.close(),(s=this.snapshotFullLayer)==null||s.removeAllChildren(),this.setCameraOpt(n,this.fullLayer));case 6:case"end":return _context55.stop();}},_callee51,this);}));function getSnapshotRender(_x64){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52(t){var e,n,i,a,o,_i5,_Object$entries2,_Object$entries2$_i,s,f,p;return _regeneratorRuntime().wrap(function _callee52$(_context56){while(1)switch(_context56.prev=_context56.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt;if(!(e&&n&&i&&this.snapshotFullLayer)){_context56.next=20;break;}a=Jt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i5=0,_Object$entries2=Object.entries(n);case 5:if(!(_i5<_Object$entries2.length)){_context56.next=19;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i5],2),s=_Object$entries2$_i[0],f=_Object$entries2$_i[1];if(!(f!=null&&f.type)){_context56.next=16;break;}_context56.t0=f==null?void 0:f.type;_context56.next=_context56.t0===ct.UpdateNode?11:_context56.t0===ct.FullWork?11:16;break;case 11:_context56.next=13;return this.localWork.runFullWork(_objectSpread(_objectSpread({},f),{},{workId:s,msgType:ct.FullWork,dataType:Mt.Service,viewId:this.viewId}));case 13:p=_context56.sent;o=Ot(o,p);return _context56.abrupt("break",16);case 16:_i5++;_context56.next=5;break;case 19:o&&this.post({sp:[{type:ct.BoundingBox,scenePath:e,rect:o}]}),this.localWork.fullLayer=this.fullLayer,this.localWork.drawLayer=void 0,this.snapshotFullLayer.removeAllChildren(),this.setCameraOpt(a,this.fullLayer);case 20:case"end":return _context56.stop();}},_callee52,this);}));function getBoundingRect(_x65){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(qn);var ug=self;new lg(ug,ti.Full);