import{v as Gi}from"./MainStructChart-3a320821.js";import"./QTooltip-5ceb1b84.js";import"./index-3a2b6cd5.js";import"./position-engine-4e9b318c.js";import"./selection-8094913b.js";import"./QBreadcrumbs-8582ad34.js";import"./app.config-a8647d06.js";import"./index-932e35b0.js";import"./mixin-183f301b.js";import"./QSpinnerCube-b3e27bc1.js";var pr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Xe=function(i){return i&&i.Math==Math&&i},U=Xe(typeof globalThis=="object"&&globalThis)||Xe(typeof window=="object"&&window)||Xe(typeof self=="object"&&self)||Xe(typeof pr=="object"&&pr)||function(){return this}()||Function("return this")(),ue={},D=function(i){try{return!!i()}catch{return!0}},Nh=D,ft=!Nh(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Mh=D,Sr=!Mh(function(){var i=function(){}.bind();return typeof i!="function"||i.hasOwnProperty("prototype")}),Vh=Sr,Ye=Function.prototype.call,G=Vh?Ye.bind(Ye):function(){return Ye.apply(Ye,arguments)},Do={},jo={}.propertyIsEnumerable,Fo=Object.getOwnPropertyDescriptor,Rh=Fo&&!jo.call({1:2},1);Do.f=Rh?function(i){var t=Fo(this,i);return!!t&&t.enumerable}:jo;var Tr=function(i,t){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:t}},zo=Sr,Bo=Function.prototype,qi=Bo.call,kh=zo&&Bo.bind.bind(qi,qi),j=zo?kh:function(i){return function(){return qi.apply(i,arguments)}},Ho=j,Ih=Ho({}.toString),_h=Ho("".slice),Bt=function(i){return _h(Ih(i),8,-1)},Lh=j,Dh=D,jh=Bt,ti=Object,Fh=Lh("".split),Uo=Dh(function(){return!ti("z").propertyIsEnumerable(0)})?function(i){return jh(i)=="String"?Fh(i,""):ti(i)}:ti,Ht=function(i){return i==null},zh=Ht,Bh=TypeError,pt=function(i){if(zh(i))throw Bh("Can't call method on "+i);return i},Hh=Uo,Uh=pt,Ee=function(i){return Hh(Uh(i))},Wi=typeof document=="object"&&document.all,Xh=typeof Wi>"u"&&Wi!==void 0,Xo={all:Wi,IS_HTMLDDA:Xh},Yo=Xo,Yh=Yo.all,_=Yo.IS_HTMLDDA?function(i){return typeof i=="function"||i===Yh}:function(i){return typeof i=="function"},xa=_,Go=Xo,Gh=Go.all,wt=Go.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:xa(i)||i===Gh}:function(i){return typeof i=="object"?i!==null:xa(i)},ei=U,qh=_,Wh=function(i){return qh(i)?i:void 0},Ut=function(i,t){return arguments.length<2?Wh(ei[i]):ei[i]&&ei[i][t]},Qh=j,Or=Qh({}.isPrototypeOf),Ar=typeof navigator<"u"&&String(navigator.userAgent)||"",qo=U,ri=Ar,ba=qo.process,wa=qo.Deno,Sa=ba&&ba.versions||wa&&wa.version,Ta=Sa&&Sa.v8,ut,dr;Ta&&(ut=Ta.split("."),dr=ut[0]>0&&ut[0]<4?1:+(ut[0]+ut[1]));!dr&&ri&&(ut=ri.match(/Edge\/(\d+)/),(!ut||ut[1]>=74)&&(ut=ri.match(/Chrome\/(\d+)/),ut&&(dr=+ut[1])));var Cn=dr,Oa=Cn,$h=D,Wo=!!Object.getOwnPropertySymbols&&!$h(function(){var i=Symbol();return!String(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&Oa&&Oa<41}),Zh=Wo,Qo=Zh&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Kh=Ut,Jh=_,tl=Or,el=Qo,rl=Object,$o=el?function(i){return typeof i=="symbol"}:function(i){var t=Kh("Symbol");return Jh(t)&&tl(t.prototype,rl(i))},il=String,Cr=function(i){try{return il(i)}catch{return"Object"}},nl=_,al=Cr,sl=TypeError,St=function(i){if(nl(i))return i;throw sl(al(i)+" is not a function")},ol=St,ul=Ht,he=function(i,t){var e=i[t];return ul(e)?void 0:ol(e)},ii=G,ni=_,ai=wt,hl=TypeError,ll=function(i,t){var e,r;if(t==="string"&&ni(e=i.toString)&&!ai(r=ii(e,i))||ni(e=i.valueOf)&&!ai(r=ii(e,i))||t!=="string"&&ni(e=i.toString)&&!ai(r=ii(e,i)))return r;throw hl("Can't convert object to primitive value")},Te={},cl={get exports(){return Te},set exports(i){Te=i}},Aa=U,gl=Object.defineProperty,En=function(i,t){try{gl(Aa,i,{value:t,configurable:!0,writable:!0})}catch{Aa[i]=t}return t},fl=U,pl=En,Ca="__core-js_shared__",dl=fl[Ca]||pl(Ca,{}),Pn=dl,Ea=Pn;(cl.exports=function(i,t){return Ea[i]||(Ea[i]=t!==void 0?t:{})})("versions",[]).push({version:"3.30.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.1/LICENSE",source:"https://github.com/zloirock/core-js"});var ml=pt,yl=Object,Er=function(i){return yl(ml(i))},vl=j,xl=Er,bl=vl({}.hasOwnProperty),ht=Object.hasOwn||function(i,t){return bl(xl(i),t)},wl=j,Sl=0,Tl=Math.random(),Ol=wl(1 .toString),Zo=function(i){return"Symbol("+(i===void 0?"":i)+")_"+Ol(++Sl+Tl,36)},Al=U,Cl=Te,Pa=ht,El=Zo,Pl=Wo,Nl=Qo,te=Al.Symbol,si=Cl("wks"),Ml=Nl?te.for||te:te&&te.withoutSetter||El,X=function(i){return Pa(si,i)||(si[i]=Pl&&Pa(te,i)?te[i]:Ml("Symbol."+i)),si[i]},Vl=G,Na=wt,Ma=$o,Rl=he,kl=ll,Il=X,_l=TypeError,Ll=Il("toPrimitive"),Dl=function(i,t){if(!Na(i)||Ma(i))return i;var e=Rl(i,Ll),r;if(e){if(t===void 0&&(t="default"),r=Vl(e,i,t),!Na(r)||Ma(r))return r;throw _l("Can't convert object to primitive value")}return t===void 0&&(t="number"),kl(i,t)},jl=Dl,Fl=$o,Nn=function(i){var t=jl(i,"string");return Fl(t)?t:t+""},zl=U,Va=wt,Qi=zl.document,Bl=Va(Qi)&&Va(Qi.createElement),Pr=function(i){return Bl?Qi.createElement(i):{}},Hl=ft,Ul=D,Xl=Pr,Ko=!Hl&&!Ul(function(){return Object.defineProperty(Xl("div"),"a",{get:function(){return 7}}).a!=7}),Yl=ft,Gl=G,ql=Do,Wl=Tr,Ql=Ee,$l=Nn,Zl=ht,Kl=Ko,Ra=Object.getOwnPropertyDescriptor;ue.f=Yl?Ra:function(i,t){if(i=Ql(i),t=$l(t),Kl)try{return Ra(i,t)}catch{}if(Zl(i,t))return Wl(!Gl(ql.f,i,t),i[t])};var dt={},Jl=ft,tc=D,Jo=Jl&&tc(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ec=wt,rc=String,ic=TypeError,Z=function(i){if(ec(i))return i;throw ic(rc(i)+" is not an object")},nc=ft,ac=Ko,sc=Jo,Ge=Z,ka=Nn,oc=TypeError,oi=Object.defineProperty,uc=Object.getOwnPropertyDescriptor,ui="enumerable",hi="configurable",li="writable";dt.f=nc?sc?function(i,t,e){if(Ge(i),t=ka(t),Ge(e),typeof i=="function"&&t==="prototype"&&"value"in e&&li in e&&!e[li]){var r=uc(i,t);r&&r[li]&&(i[t]=e.value,e={configurable:hi in e?e[hi]:r[hi],enumerable:ui in e?e[ui]:r[ui],writable:!1})}return oi(i,t,e)}:oi:function(i,t,e){if(Ge(i),t=ka(t),Ge(e),ac)try{return oi(i,t,e)}catch{}if("get"in e||"set"in e)throw oc("Accessors not supported");return"value"in e&&(i[t]=e.value),i};var hc=ft,lc=dt,cc=Tr,Pe=hc?function(i,t,e){return lc.f(i,t,cc(1,e))}:function(i,t,e){return i[t]=e,i},mr={},gc={get exports(){return mr},set exports(i){mr=i}},$i=ft,fc=ht,tu=Function.prototype,pc=$i&&Object.getOwnPropertyDescriptor,Mn=fc(tu,"name"),dc=Mn&&function(){}.name==="something",mc=Mn&&(!$i||$i&&pc(tu,"name").configurable),Nr={EXISTS:Mn,PROPER:dc,CONFIGURABLE:mc},yc=j,vc=_,Zi=Pn,xc=yc(Function.toString);vc(Zi.inspectSource)||(Zi.inspectSource=function(i){return xc(i)});var Vn=Zi.inspectSource,bc=U,wc=_,Ia=bc.WeakMap,Sc=wc(Ia)&&/native code/.test(String(Ia)),Tc=Te,Oc=Zo,_a=Tc("keys"),Rn=function(i){return _a[i]||(_a[i]=Oc(i))},kn={},Ac=Sc,eu=U,Cc=wt,Ec=Pe,ci=ht,gi=Pn,Pc=Rn,Nc=kn,La="Object already initialized",Ki=eu.TypeError,Mc=eu.WeakMap,yr,Oe,vr,Vc=function(i){return vr(i)?Oe(i):yr(i,{})},Rc=function(i){return function(t){var e;if(!Cc(t)||(e=Oe(t)).type!==i)throw Ki("Incompatible receiver, "+i+" required");return e}};if(Ac||gi.state){var gt=gi.state||(gi.state=new Mc);gt.get=gt.get,gt.has=gt.has,gt.set=gt.set,yr=function(i,t){if(gt.has(i))throw Ki(La);return t.facade=i,gt.set(i,t),t},Oe=function(i){return gt.get(i)||{}},vr=function(i){return gt.has(i)}}else{var Wt=Pc("state");Nc[Wt]=!0,yr=function(i,t){if(ci(i,Wt))throw Ki(La);return t.facade=i,Ec(i,Wt,t),t},Oe=function(i){return ci(i,Wt)?i[Wt]:{}},vr=function(i){return ci(i,Wt)}}var Mr={set:yr,get:Oe,has:vr,enforce:Vc,getterFor:Rc},In=j,kc=D,Ic=_,qe=ht,Ji=ft,_c=Nr.CONFIGURABLE,Lc=Vn,ru=Mr,Dc=ru.enforce,jc=ru.get,Da=String,ur=Object.defineProperty,Fc=In("".slice),zc=In("".replace),Bc=In([].join),Hc=Ji&&!kc(function(){return ur(function(){},"length",{value:8}).length!==8}),Uc=String(String).split("String"),Xc=gc.exports=function(i,t,e){Fc(Da(t),0,7)==="Symbol("&&(t="["+zc(Da(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!qe(i,"name")||_c&&i.name!==t)&&(Ji?ur(i,"name",{value:t,configurable:!0}):i.name=t),Hc&&e&&qe(e,"arity")&&i.length!==e.arity&&ur(i,"length",{value:e.arity});try{e&&qe(e,"constructor")&&e.constructor?Ji&&ur(i,"prototype",{writable:!1}):i.prototype&&(i.prototype=void 0)}catch{}var r=Dc(i);return qe(r,"source")||(r.source=Bc(Uc,typeof t=="string"?t:"")),i};Function.prototype.toString=Xc(function(){return Ic(this)&&jc(this).source||Lc(this)},"toString");var Yc=_,Gc=dt,qc=mr,Wc=En,Xt=function(i,t,e,r){r||(r={});var n=r.enumerable,a=r.name!==void 0?r.name:t;if(Yc(e)&&qc(e,a,r),r.global)n?i[t]=e:Wc(t,e);else{try{r.unsafe?i[t]&&(n=!0):delete i[t]}catch{}n?i[t]=e:Gc.f(i,t,{value:e,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return i},iu={},Qc=Math.ceil,$c=Math.floor,Zc=Math.trunc||function(i){var t=+i;return(t>0?$c:Qc)(t)},Kc=Zc,Vr=function(i){var t=+i;return t!==t||t===0?0:Kc(t)},Jc=Vr,tg=Math.max,eg=Math.min,nu=function(i,t){var e=Jc(i);return e<0?tg(e+t,0):eg(e,t)},rg=Vr,ig=Math.min,le=function(i){return i>0?ig(rg(i),9007199254740991):0},ng=le,Rr=function(i){return ng(i.length)},ag=Ee,sg=nu,og=Rr,ja=function(i){return function(t,e,r){var n=ag(t),a=og(n),o=sg(r,a),s;if(i&&e!=e){for(;a>o;)if(s=n[o++],s!=s)return!0}else for(;a>o;o++)if((i||o in n)&&n[o]===e)return i||o||0;return!i&&-1}},au={includes:ja(!0),indexOf:ja(!1)},ug=j,fi=ht,hg=Ee,lg=au.indexOf,cg=kn,Fa=ug([].push),su=function(i,t){var e=hg(i),r=0,n=[],a;for(a in e)!fi(cg,a)&&fi(e,a)&&Fa(n,a);for(;t.length>r;)fi(e,a=t[r++])&&(~lg(n,a)||Fa(n,a));return n},_n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gg=su,fg=_n,pg=fg.concat("length","prototype");iu.f=Object.getOwnPropertyNames||function(i){return gg(i,pg)};var ou={};ou.f=Object.getOwnPropertySymbols;var dg=Ut,mg=j,yg=iu,vg=ou,xg=Z,bg=mg([].concat),wg=dg("Reflect","ownKeys")||function(i){var t=yg.f(xg(i)),e=vg.f;return e?bg(t,e(i)):t},za=ht,Sg=wg,Tg=ue,Og=dt,Ag=function(i,t,e){for(var r=Sg(t),n=Og.f,a=Tg.f,o=0;og;g++)if(c=y(i[g]),c&&ms(vs,c))return c;return new cr(!1)}h=Td(i,l)}for(d=a?i.next:h.next;!(p=vd(d,h)).done;){try{c=y(p.value)}catch(b){ys(h,"throw",b)}if(typeof c=="object"&&c&&ms(vs,c))return c}return new cr(!1)},Cd=X,Fu=Cd("iterator"),zu=!1;try{var Ed=0,xs={next:function(){return{done:!!Ed++}},return:function(){zu=!0}};xs[Fu]=function(){return this},Array.from(xs,function(){throw 2})}catch{}var Pd=function(i,t){if(!t&&!zu)return!1;var e=!1;try{var r={};r[Fu]=function(){return{next:function(){return{done:e=!0}}}},i(r)}catch{}return e},Nd=kr,Md=Pd,Vd=Re.CONSTRUCTOR,Bu=Vd||!Md(function(i){Nd.all(i).then(void 0,function(){})}),Rd=tt,kd=G,Id=St,_d=ce,Ld=Hn,Dd=ju,jd=Bu;Rd({target:"Promise",stat:!0,forced:jd},{all:function(i){var t=this,e=_d.f(t),r=e.resolve,n=e.reject,a=Ld(function(){var o=Id(t.resolve),s=[],u=0,h=1;Dd(i,function(l){var g=u++,f=!1;h++,kd(o,t,l).then(function(c){f||(f=!0,s[g]=c,--h||r(s))},n)}),--h||r(s)});return a.error&&n(a.value),e.promise}});var Fd=tt,zd=Re.CONSTRUCTOR,un=kr,Bd=Ut,Hd=_,Ud=Xt,bs=un&&un.prototype;Fd({target:"Promise",proto:!0,forced:zd,real:!0},{catch:function(i){return this.then(void 0,i)}});if(Hd(un)){var ws=Bd("Promise").prototype.catch;bs.catch!==ws&&Ud(bs,"catch",ws,{unsafe:!0})}var Xd=tt,Yd=G,Gd=St,qd=ce,Wd=Hn,Qd=ju,$d=Bu;Xd({target:"Promise",stat:!0,forced:$d},{race:function(i){var t=this,e=qd.f(t),r=e.reject,n=Wd(function(){var a=Gd(t.resolve);Qd(i,function(o){Yd(a,t,o).then(e.resolve,r)})});return n.error&&r(n.value),e.promise}});var Zd=tt,Kd=G,Jd=ce,tm=Re.CONSTRUCTOR;Zd({target:"Promise",stat:!0,forced:tm},{reject:function(i){var t=Jd.f(this);return Kd(t.reject,void 0,i),t.promise}});var em=Z,rm=wt,im=ce,nm=function(i,t){if(em(i),rm(t)&&t.constructor===i)return t;var e=im.f(i),r=e.resolve;return r(t),e.promise},am=tt,sm=Ut,om=Re.CONSTRUCTOR,um=nm;sm("Promise");am({target:"Promise",stat:!0,forced:om},{resolve:function(i){return um(this,i)}});function Ss(i,t,e,r,n,a,o){try{var s=i[a](o),u=s.value}catch(h){e(h);return}s.done?t(u):Promise.resolve(u).then(r,n)}function bt(i){return function(){var t=this,e=arguments;return new Promise(function(r,n){var a=i.apply(t,e);function o(u){Ss(a,r,n,o,s,"next",u)}function s(u){Ss(a,r,n,o,s,"throw",u)}o(void 0)})}}var hm=Dn,lm=String,mt=function(i){if(hm(i)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return lm(i)},cm=Z,Hu=function(){var i=cm(this),t="";return i.hasIndices&&(t+="d"),i.global&&(t+="g"),i.ignoreCase&&(t+="i"),i.multiline&&(t+="m"),i.dotAll&&(t+="s"),i.unicode&&(t+="u"),i.unicodeSets&&(t+="v"),i.sticky&&(t+="y"),t},qn=D,gm=U,Wn=gm.RegExp,Qn=qn(function(){var i=Wn("a","y");return i.lastIndex=2,i.exec("abcd")!=null}),fm=Qn||qn(function(){return!Wn("a","y").sticky}),pm=Qn||qn(function(){var i=Wn("^r","gy");return i.lastIndex=2,i.exec("str")!=null}),Uu={BROKEN_CARET:pm,MISSED_STICKY:fm,UNSUPPORTED_Y:Qn},Xu={},dm=su,mm=_n,ym=Object.keys||function(i){return dm(i,mm)},vm=ft,xm=Jo,bm=dt,wm=Z,Sm=Ee,Tm=ym;Xu.f=vm&&!xm?Object.defineProperties:function(i,t){wm(i);for(var e=Sm(t),r=Tm(t),n=r.length,a=0,o;n>a;)bm.f(i,o=r[a++],e[o]);return i};var Om=Z,Am=Xu,Ts=_n,Cm=kn,Em=yu,Pm=Pr,Nm=Rn,Os=">",As="<",hn="prototype",ln="script",Yu=Nm("IE_PROTO"),Ci=function(){},Gu=function(i){return As+ln+Os+i+As+"/"+ln+Os},Cs=function(i){i.write(Gu("")),i.close();var t=i.parentWindow.Object;return i=null,t},Mm=function(){var i=Pm("iframe"),t="java"+ln+":",e;return i.style.display="none",Em.appendChild(i),i.src=String(t),e=i.contentWindow.document,e.open(),e.write(Gu("document.F=Object")),e.close(),e.F},tr,gr=function(){try{tr=new ActiveXObject("htmlfile")}catch{}gr=typeof document<"u"?document.domain&&tr?Cs(tr):Mm():Cs(tr);for(var i=Ts.length;i--;)delete gr[hn][Ts[i]];return gr()};Cm[Yu]=!0;var $n=Object.create||function(i,t){var e;return i!==null?(Ci[hn]=Om(i),e=new Ci,Ci[hn]=null,e[Yu]=i):e=gr(),t===void 0?e:Am.f(e,t)},Vm=D,Rm=U,km=Rm.RegExp,Im=Vm(function(){var i=km(".","s");return!(i.dotAll&&i.exec(` `)&&i.flags==="s")}),_m=D,Lm=U,Dm=Lm.RegExp,jm=_m(function(){var i=Dm("(?b)","g");return i.exec("b").groups.a!=="b"||"b".replace(i,"$c")!=="bc"}),re=G,_r=j,Fm=mt,zm=Hu,Bm=Uu,Hm=Te,Um=$n,Xm=Mr.get,Ym=Im,Gm=jm,qm=Hm("native-string-replace",String.prototype.replace),wr=RegExp.prototype.exec,cn=wr,Wm=_r("".charAt),Qm=_r("".indexOf),$m=_r("".replace),Ei=_r("".slice),gn=function(){var i=/a/,t=/b*/g;return re(wr,i,"a"),re(wr,t,"a"),i.lastIndex!==0||t.lastIndex!==0}(),qu=Bm.BROKEN_CARET,fn=/()??/.exec("")[1]!==void 0,Zm=gn||fn||qu||Ym||Gm;Zm&&(cn=function(i){var t=this,e=Xm(t),r=Fm(i),n=e.raw,a,o,s,u,h,l,g;if(n)return n.lastIndex=t.lastIndex,a=re(cn,n,r),t.lastIndex=n.lastIndex,a;var f=e.groups,c=qu&&t.sticky,d=re(zm,t),p=t.source,m=0,y=r;if(c&&(d=$m(d,"y",""),Qm(d,"g")===-1&&(d+="g"),y=Ei(r,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&Wm(r,t.lastIndex-1)!==` `)&&(p="(?: "+p+")",y=" "+y,m++),o=new RegExp("^(?:"+p+")",d)),fn&&(o=new RegExp("^"+p+"$(?!\\s)",d)),gn&&(s=t.lastIndex),u=re(wr,c?o:t,y),c?u?(u.input=Ei(u.input,m),u[0]=Ei(u[0],m),u.index=t.lastIndex,t.lastIndex+=u[0].length):t.lastIndex=0:gn&&u&&(t.lastIndex=t.global?u.index+u[0].length:s),fn&&u&&u.length>1&&re(qm,u[0],o,function(){for(h=1;h=a?i?"":void 0:(o=Vs(r,n),o<55296||o>56319||n+1===a||(s=Vs(r,n+1))<56320||s>57343?i?a0(r,n):o:i?s0(r,n,n+2):(o-55296<<10)+(s-56320)+65536)}},o0={codeAt:Rs(!1),charAt:Rs(!0)},u0=o0.charAt,Jn=function(i,t,e){return t+(e?u0(i,t).length:1)},ks=G,h0=Z,l0=_,c0=Bt,g0=Lr,f0=TypeError,ta=function(i,t){var e=i.exec;if(l0(e)){var r=ks(e,i,t);return r!==null&&h0(r),r}if(c0(i)==="RegExp")return ks(g0,i,t);throw f0("RegExp#exec called on incompatible receiver")},p0=G,d0=Zn,m0=Z,y0=Ht,v0=le,Ni=mt,x0=pt,b0=he,w0=Jn,Is=ta;d0("match",function(i,t,e){return[function(r){var n=x0(this),a=y0(r)?void 0:b0(r,i);return a?p0(a,r,n):new RegExp(r)[i](Ni(n))},function(r){var n=m0(this),a=Ni(r),o=e(t,n,a);if(o.done)return o.value;if(!n.global)return Is(n,a);var s=n.unicode;n.lastIndex=0;for(var u=[],h=0,l;(l=Is(n,a))!==null;){var g=Ni(l[0]);u[h]=g,g===""&&(n.lastIndex=w0(a,v0(n.lastIndex),s)),h++}return h===0?null:u}]});var ea=j,S0=Er,T0=Math.floor,Mi=ea("".charAt),O0=ea("".replace),Vi=ea("".slice),A0=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,C0=/\$([$&'`]|\d{1,2})/g,E0=function(i,t,e,r,n,a){var o=e+i.length,s=r.length,u=C0;return n!==void 0&&(n=S0(n),u=A0),O0(a,u,function(h,l){var g;switch(Mi(l,0)){case"$":return"$";case"&":return i;case"`":return Vi(t,0,e);case"'":return Vi(t,o);case"<":g=n[Vi(l,1,-1)];break;default:var f=+l;if(f===0)return h;if(f>s){var c=T0(f/10);return c===0?h:c<=s?r[c-1]===void 0?Mi(l,1):r[c-1]+Mi(l,1):h}g=r[f-1]}return g===void 0?"":g})},P0=Fn,_s=G,Dr=j,N0=Zn,M0=D,V0=Z,R0=_,k0=Ht,I0=Vr,_0=le,$t=mt,L0=pt,D0=Jn,j0=he,F0=E0,z0=ta,B0=X,pn=B0("replace"),H0=Math.max,U0=Math.min,X0=Dr([].concat),Ri=Dr([].push),Ls=Dr("".indexOf),Ds=Dr("".slice),Y0=function(i){return i===void 0?i:String(i)},G0=function(){return"a".replace(/./,"$0")==="$0"}(),js=function(){return/./[pn]?/./[pn]("a","$0")==="":!1}(),q0=!M0(function(){var i=/./;return i.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(i,"$")!=="7"});N0("replace",function(i,t,e){var r=js?"$":"$0";return[function(n,a){var o=L0(this),s=k0(n)?void 0:j0(n,pn);return s?_s(s,n,o,a):_s(t,$t(o),n,a)},function(n,a){var o=V0(this),s=$t(n);if(typeof a=="string"&&Ls(a,r)===-1&&Ls(a,"$<")===-1){var u=e(t,o,s,a);if(u.done)return u.value}var h=R0(a);h||(a=$t(a));var l=o.global;if(l){var g=o.unicode;o.lastIndex=0}for(var f=[];;){var c=z0(o,s);if(c===null||(Ri(f,c),!l))break;var d=$t(c[0]);d===""&&(o.lastIndex=D0(s,_0(o.lastIndex),g))}for(var p="",m=0,y=0;y=m&&(p+=Ds(s,m,x)+E,m=x+b.length)}return p+Ds(s,m)}]},!q0||!G0||js);var W0=wt,Q0=Bt,$0=X,Z0=$0("match"),Qu=function(i){var t;return W0(i)&&((t=i[Z0])!==void 0?!!t:Q0(i)=="RegExp")},K0=Qu,J0=TypeError,ra=function(i){if(K0(i))throw J0("The method doesn't accept regular expressions");return i},ty=X,ey=ty("match"),ia=function(i){var t=/./;try{"/./"[i](t)}catch{try{return t[ey]=!1,"/./"[i](t)}catch{}}return!1},ry=tt,$u=Ve,iy=ue.f,ny=le,Fs=mt,ay=ra,sy=pt,oy=ia,zs=$u("".startsWith),uy=$u("".slice),hy=Math.min,Zu=oy("startsWith"),ly=!Zu&&!!function(){var i=iy(String.prototype,"startsWith");return i&&!i.writable}();ry({target:"String",proto:!0,forced:!ly&&!Zu},{startsWith:function(i){var t=Fs(sy(this));ay(i);var e=ny(hy(arguments.length>1?arguments[1]:void 0,t.length)),r=Fs(i);return zs?zs(t,r,e):uy(t,e,e+r.length)===r}});var cy=X,gy=$n,fy=dt.f,dn=cy("unscopables"),mn=Array.prototype;mn[dn]==null&&fy(mn,dn,{configurable:!0,value:gy(null)});var py=function(i){mn[dn][i]=!0},dy=D,my=!dy(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype}),yy=ht,vy=_,xy=Er,by=Rn,wy=my,Bs=by("IE_PROTO"),yn=Object,Sy=yn.prototype,Ku=wy?yn.getPrototypeOf:function(i){var t=xy(i);if(yy(t,Bs))return t[Bs];var e=t.constructor;return vy(e)&&t instanceof e?e.prototype:t instanceof yn?Sy:null},Ty=D,Oy=_,Ay=wt,Hs=Ku,Cy=Xt,Ey=X,vn=Ey("iterator"),Ju=!1,Ft,ki,Ii;[].keys&&(Ii=[].keys(),"next"in Ii?(ki=Hs(Hs(Ii)),ki!==Object.prototype&&(Ft=ki)):Ju=!0);var Py=!Ay(Ft)||Ty(function(){var i={};return Ft[vn].call(i)!==i});Py&&(Ft={});Oy(Ft[vn])||Cy(Ft,vn,function(){return this});var th={IteratorPrototype:Ft,BUGGY_SAFARI_ITERATORS:Ju},Ny=th.IteratorPrototype,My=$n,Vy=Tr,Ry=Ln,ky=ke,Iy=function(){return this},_y=function(i,t,e,r){var n=t+" Iterator";return i.prototype=My(Ny,{next:Vy(+!r,e)}),Ry(i,n,!1),ky[n]=Iy,i},Ly=tt,Dy=G,eh=Nr,jy=_,Fy=_y,Us=Ku,Xs=hu,zy=Ln,By=Pe,_i=Xt,Hy=X,Uy=ke,rh=th,Xy=eh.PROPER,Yy=eh.CONFIGURABLE,Ys=rh.IteratorPrototype,er=rh.BUGGY_SAFARI_ITERATORS,pe=Hy("iterator"),Gs="keys",de="values",qs="entries",Gy=function(){return this},qy=function(i,t,e,r,n,a,o){Fy(e,t,r);var s=function(y){if(y===n&&f)return f;if(!er&&y in l)return l[y];switch(y){case Gs:return function(){return new e(this,y)};case de:return function(){return new e(this,y)};case qs:return function(){return new e(this,y)}}return function(){return new e(this)}},u=t+" Iterator",h=!1,l=i.prototype,g=l[pe]||l["@@iterator"]||n&&l[n],f=!er&&g||s(n),c=t=="Array"&&l.entries||g,d,p,m;if(c&&(d=Us(c.call(new i)),d!==Object.prototype&&d.next&&(Us(d)!==Ys&&(Xs?Xs(d,Ys):jy(d[pe])||_i(d,pe,Gy)),zy(d,u,!0))),Xy&&n==de&&g&&g.name!==de&&(Yy?By(l,"name",de):(h=!0,f=function(){return Dy(g,this)})),n)if(p={values:s(de),keys:a?f:s(Gs),entries:s(qs)},o)for(m in p)(er||h||!(m in l))&&_i(l,m,p[m]);else Ly({target:t,proto:!0,forced:er||h},p);return l[pe]!==f&&_i(l,pe,f,{name:n}),Uy[t]=f,p},Wy=function(i,t){return{value:i,done:t}},Qy=Ee,na=py,Ws=ke,ih=Mr,$y=dt.f,Zy=qy,rr=Wy,Ky=ft,nh="Array Iterator",Jy=ih.set,tv=ih.getterFor(nh),ev=Zy(Array,"Array",function(i,t){Jy(this,{type:nh,target:Qy(i),index:0,kind:t})},function(){var i=tv(this),t=i.target,e=i.kind,r=i.index++;return!t||r>=t.length?(i.target=void 0,rr(void 0,!0)):e=="keys"?rr(r,!1):e=="values"?rr(t[r],!1):rr([r,t[r]],!1)},"values"),Qs=Ws.Arguments=Ws.Array;na("keys");na("values");na("entries");if(Ky&&Qs.name!=="values")try{$y(Qs,"name",{value:"values"})}catch{}var rv={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},iv=Pr,Li=iv("span").classList,$s=Li&&Li.constructor&&Li.constructor.prototype,nv=$s===Object.prototype?void 0:$s,Zs=U,ah=rv,av=nv,xe=ev,Di=Pe,sh=X,ji=sh("iterator"),Ks=sh("toStringTag"),Fi=xe.values,oh=function(i,t){if(i){if(i[ji]!==Fi)try{Di(i,ji,Fi)}catch{i[ji]=Fi}if(i[Ks]||Di(i,Ks,t),ah[t]){for(var e in xe)if(i[e]!==xe[e])try{Di(i,e,xe[e])}catch{i[e]=xe[e]}}}};for(var zi in ah)oh(Zs[zi]&&Zs[zi].prototype,zi);oh(av,"DOMTokenList");function sv(i,t){if(Gi(i)!=="object"||i===null)return i;var e=i[Symbol.toPrimitive];if(e!==void 0){var r=e.call(i,t||"default");if(Gi(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function ov(i){var t=sv(i,"string");return Gi(t)==="symbol"?t:String(t)}function aa(i,t,e){return t=ov(t),t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var uv=St,hv=Er,lv=Uo,cv=Rr,gv=TypeError,Js=function(i){return function(t,e,r,n){uv(e);var a=hv(t),o=lv(a),s=cv(a),u=i?s-1:0,h=i?-1:1;if(r<2)for(;;){if(u in o){n=o[u],u+=h;break}if(u+=h,i?u<0:s<=u)throw gv("Reduce of empty array with no initial value")}for(;i?u>=0:s>u;u+=h)u in o&&(n=e(n,o[u],u,a));return n}},fv={left:Js(!1),right:Js(!0)},pv=D,uh=function(i,t){var e=[][i];return!!e&&pv(function(){e.call(null,t||function(){return 1},1)})},dv=tt,mv=fv.left,yv=uh,to=Cn,vv=Me,xv=!vv&&to>79&&to<83,bv=xv||!yv("reduce");dv({target:"Array",proto:!0,forced:bv},{reduce:function(i){var t=arguments.length;return mv(this,i,t,t>1?arguments[1]:void 0)}});var wv=tt,hh=Ve,Sv=ue.f,Tv=le,eo=mt,Ov=ra,Av=pt,Cv=ia,ro=hh("".endsWith),Ev=hh("".slice),Pv=Math.min,lh=Cv("endsWith"),Nv=!lh&&!!function(){var i=Sv(String.prototype,"endsWith");return i&&!i.writable}();wv({target:"String",proto:!0,forced:!Nv&&!lh},{endsWith:function(i){var t=eo(Av(this));Ov(i);var e=arguments.length>1?arguments[1]:void 0,r=t.length,n=e===void 0?r:Pv(Tv(e),r),a=eo(i);return ro?ro(t,a,n):Ev(t,n-a.length,n)===a}});var Mv=Nn,Vv=dt,Rv=Tr,kv=function(i,t,e){var r=Mv(t);r in i?Vv.f(i,r,Rv(0,e)):i[r]=e},io=nu,Iv=Rr,_v=kv,Lv=Array,Dv=Math.max,jv=function(i,t,e){for(var r=Iv(i),n=io(t,r),a=io(e===void 0?r:e,r),o=Lv(Dv(a-n,0)),s=0;n1||"".split(/.?/).length?r=function(n,a){var o=Bi(no(this)),s=a===void 0?oo:a>>>0;if(s===0)return[];if(n===void 0)return[o];if(!Uv(n))return me(t,o,n,s);for(var u=[],h=(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.unicode?"u":"")+(n.sticky?"y":""),l=0,g=new RegExp(n.source,h+"g"),f,c,d;(f=me(Wv,g,o))&&(c=g.lastIndex,!(c>l&&(Kt(u,ye(o,l,f.index)),f.length>1&&f.index=s)));)g.lastIndex===f.index&&g.lastIndex++;return l===o.length?(d||!Kv(g,""))&&Kt(u,""):Kt(u,ye(o,l)),u.length>s?ao(u,0,s):u}:"0".split(void 0,0).length?r=function(n,a){return n===void 0&&a===0?[]:me(t,this,n,a)}:r=t,[function(n,a){var o=no(this),s=Hv(n)?void 0:qv(n,i);return s?me(s,n,o,a):me(r,Bi(o),n,a)},function(n,a){var o=Bv(this),s=Bi(n),u=e(r,o,s,a,r!==t);if(u.done)return u.value;var h=Xv(o,RegExp),l=o.unicode,g=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Zt?"g":"y"),f=new h(Zt?"^(?:"+o.source+")":o,g),c=a===void 0?oo:a>>>0;if(c===0)return[];if(s.length===0)return so(f,s)===null?[s]:[];for(var d=0,p=0,m=[];p"u"?pr:window,nr=["moz","webkit"],ne="AnimationFrame",oe=xt["request"+ne],Ce=xt["cancel"+ne]||xt["cancelRequest"+ne];for(var ve=0;!oe&&ve3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var u=this.r.toString(16),h=this.g.toString(16),l=this.b.toString(16);return u.length==1&&(u="0"+u),h.length==1&&(h="0"+h),l.length==1&&(l="0"+l),"#"+u+h+l},this.getHelpXML=function(){for(var u=new Array,h=0;h "+p.toRGB()+" -> "+p.toHex());d.appendChild(m),d.appendChild(y),c.appendChild(d)}catch{}return c}},dx=tt,mx=Ve,yx=au.indexOf,vx=uh,Sn=mx([].indexOf),fh=!!Sn&&1/Sn([1],1,-0)<0,xx=fh||!vx("indexOf");dx({target:"Array",proto:!0,forced:xx},{indexOf:function(i){var t=arguments.length>1?arguments[1]:void 0;return fh?Sn(this,i,t)||0:yx(this,i,t)}});var bx=tt,wx=j,Sx=ra,Tx=pt,go=mt,Ox=ia,Ax=wx("".indexOf);bx({target:"String",proto:!0,forced:!Ox("includes")},{includes:function(i){return!!~Ax(go(Tx(this)),go(Sx(i)),arguments.length>1?arguments[1]:void 0)}});var Cx=Bt,Ex=Array.isArray||function(i){return Cx(i)=="Array"},Px=tt,Nx=j,Mx=Ex,Vx=Nx([].reverse),fo=[1,2];Px({target:"Array",proto:!0,forced:String(fo)===String(fo.reverse())},{reverse:function(){return Mx(this)&&(this.length=this.length),Vx(this)}});/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var ph=function(i,t){return(ph=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])})(i,t)};function dh(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=i}ph(i,t),i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Rx(i){var t="";Array.isArray(i)||(i=[i]);for(var e=0;ei.phi1&&(i.phi2-=2*Ot),i.sweepFlag===1&&i.phi2r)return[];if(r===0)return[[i*e/(i*i+t*t),t*e/(i*i+t*t)]];var n=Math.sqrt(r);return[[(i*e+t*n)/(i*i+t*t),(t*e-i*n)/(i*i+t*t)],[(i*e-t*n)/(i*i+t*t),(t*e+i*n)/(i*i+t*t)]]}var B,yt=Math.PI/180;function mo(i,t,e){return(1-e)*i+e*t}function yo(i,t,e,r){return i+Math.cos(r/180*Ot)*t+Math.sin(r/180*Ot)*e}function vo(i,t,e,r){var n=1e-6,a=t-i,o=e-t,s=3*a+3*(r-e)-6*o,u=6*(o-a),h=3*a;return Math.abs(s)S&&(c.sweepFlag=+!c.sweepFlag),c})}function o(){return function(s){var u={};for(var h in s)u[h]=s[h];return u}}i.ROUND=function(s){function u(h){return Math.round(h*s)/s}return s===void 0&&(s=1e13),ot(s),function(h){return h.x1!==void 0&&(h.x1=u(h.x1)),h.y1!==void 0&&(h.y1=u(h.y1)),h.x2!==void 0&&(h.x2=u(h.x2)),h.y2!==void 0&&(h.y2=u(h.y2)),h.x!==void 0&&(h.x=u(h.x)),h.y!==void 0&&(h.y=u(h.y)),h.rX!==void 0&&(h.rX=u(h.rX)),h.rY!==void 0&&(h.rY=u(h.rY)),h}},i.TO_ABS=t,i.TO_REL=function(){return n(function(s,u,h){return s.relative||(s.x1!==void 0&&(s.x1-=u),s.y1!==void 0&&(s.y1-=h),s.x2!==void 0&&(s.x2-=u),s.y2!==void 0&&(s.y2-=h),s.x!==void 0&&(s.x-=u),s.y!==void 0&&(s.y-=h),s.relative=!0),s})},i.NORMALIZE_HVZ=function(s,u,h){return s===void 0&&(s=!0),u===void 0&&(u=!0),h===void 0&&(h=!0),n(function(l,g,f,c,d){if(isNaN(c)&&!(l.type&v.MOVE_TO))throw new Error("path must start with moveto");return u&&l.type&v.HORIZ_LINE_TO&&(l.type=v.LINE_TO,l.y=l.relative?0:f),h&&l.type&v.VERT_LINE_TO&&(l.type=v.LINE_TO,l.x=l.relative?0:g),s&&l.type&v.CLOSE_PATH&&(l.type=v.LINE_TO,l.x=l.relative?c-g:c,l.y=l.relative?d-f:d),l.type&v.ARC&&(l.rX===0||l.rY===0)&&(l.type=v.LINE_TO,delete l.rX,delete l.rY,delete l.xRot,delete l.lArcFlag,delete l.sweepFlag),l})},i.NORMALIZE_ST=e,i.QT_TO_C=r,i.INFO=n,i.SANITIZE=function(s){s===void 0&&(s=0),ot(s);var u=NaN,h=NaN,l=NaN,g=NaN;return n(function(f,c,d,p,m){var y=Math.abs,b=!1,x=0,w=0;if(f.type&v.SMOOTH_CURVE_TO&&(x=isNaN(u)?0:c-u,w=isNaN(h)?0:d-h),f.type&(v.CURVE_TO|v.SMOOTH_CURVE_TO)?(u=f.relative?c+f.x2:f.x2,h=f.relative?d+f.y2:f.y2):(u=NaN,h=NaN),f.type&v.SMOOTH_QUAD_TO?(l=isNaN(l)?c:2*c-l,g=isNaN(g)?d:2*d-g):f.type&v.QUAD_TO?(l=f.relative?c+f.x1:f.x1,g=f.relative?d+f.y1:f.y2):(l=NaN,g=NaN),f.type&v.LINE_COMMANDS||f.type&v.ARC&&(f.rX===0||f.rY===0||!f.lArcFlag)||f.type&v.CURVE_TO||f.type&v.SMOOTH_CURVE_TO||f.type&v.QUAD_TO||f.type&v.SMOOTH_QUAD_TO){var A=f.x===void 0?0:f.relative?f.x:f.x-c,O=f.y===void 0?0:f.relative?f.y:f.y-d;x=isNaN(l)?f.x1===void 0?x:f.relative?f.x:f.x1-c:l-c,w=isNaN(g)?f.y1===void 0?w:f.relative?f.y:f.y1-d:g-d;var S=f.x2===void 0?0:f.relative?f.x:f.x2-c,E=f.y2===void 0?0:f.relative?f.y:f.y2-d;y(A)<=s&&y(O)<=s&&y(x)<=s&&y(w)<=s&&y(S)<=s&&y(E)<=s&&(b=!0)}return f.type&v.CLOSE_PATH&&y(c-p)<=s&&y(d-m)<=s&&(b=!0),b?[]:f})},i.MATRIX=a,i.ROTATE=function(s,u,h){u===void 0&&(u=0),h===void 0&&(h=0),ot(s,u,h);var l=Math.sin(s),g=Math.cos(s);return a(g,l,-l,g,u-u*g+h*l,h-u*l-h*g)},i.TRANSLATE=function(s,u){return u===void 0&&(u=0),ot(s,u),a(1,0,0,1,s,u)},i.SCALE=function(s,u){return u===void 0&&(u=s),ot(s,u),a(s,0,0,u,0,0)},i.SKEW_X=function(s){return ot(s),a(1,0,Math.atan(s),1,0,0)},i.SKEW_Y=function(s){return ot(s),a(1,Math.atan(s),0,1,0,0)},i.X_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),ot(s),a(-1,0,0,1,s,0)},i.Y_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),ot(s),a(1,0,0,-1,0,s)},i.A_TO_C=function(){return n(function(s,u,h){return v.ARC===s.type?function(l,g,f){var c,d,p,m;l.cX||Xi(l,g,f);for(var y=Math.min(l.phi1,l.phi2),b=Math.max(l.phi1,l.phi2)-y,x=Math.ceil(b/90),w=new Array(x),A=g,O=f,S=0;Sg.maxX&&(g.maxX=k),kg.maxY&&(g.maxY=k),kM&&m(xo(c,p.x1,p.x2,p.x,M));for(var w=0,A=vo(d,p.y1,p.y2,p.y);wM&&y(xo(d,p.y1,p.y2,p.y,M))}if(p.type&v.ARC){m(p.x),y(p.y),Xi(p,c,d);for(var O=p.xRot/180*Math.PI,S=Math.cos(O)*p.rX,E=Math.sin(O)*p.rX,R=-Math.sin(O)*p.rY,I=Math.cos(O)*p.rY,F=p.phi1p.phi2?[p.phi2+360,p.phi1+360]:[p.phi2,p.phi1],N=F[0],q=F[1],W=function(k){var K=k[0],at=k[1],ct=180*Math.atan2(at,K)/Math.PI;return ctN&&MN&&Ml)throw new SyntaxError('Expected positive number, got "'+l+'" at index "'+o+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+o+'"')}this.curArgs.push(l),this.curArgs.length===_x[this.curCommandType]&&(v.HORIZ_LINE_TO===this.curCommandType?a({type:v.HORIZ_LINE_TO,relative:this.curCommandRelative,x:l}):v.VERT_LINE_TO===this.curCommandType?a({type:v.VERT_LINE_TO,relative:this.curCommandRelative,y:l}):this.curCommandType===v.MOVE_TO||this.curCommandType===v.LINE_TO||this.curCommandType===v.SMOOTH_QUAD_TO?(a({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),v.MOVE_TO===this.curCommandType&&(this.curCommandType=v.LINE_TO)):this.curCommandType===v.CURVE_TO?a({type:v.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===v.SMOOTH_CURVE_TO?a({type:v.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===v.QUAD_TO?a({type:v.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===v.ARC&&a({type:v.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!kx(s))if(s===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(s!=="+"&&s!=="-"&&s!==".")if(h)this.curNumber=s,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+o+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+s+'" at index '+o+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,s!=="z"&&s!=="Z")if(s==="h"||s==="H")this.curCommandType=v.HORIZ_LINE_TO,this.curCommandRelative=s==="h";else if(s==="v"||s==="V")this.curCommandType=v.VERT_LINE_TO,this.curCommandRelative=s==="v";else if(s==="m"||s==="M")this.curCommandType=v.MOVE_TO,this.curCommandRelative=s==="m";else if(s==="l"||s==="L")this.curCommandType=v.LINE_TO,this.curCommandRelative=s==="l";else if(s==="c"||s==="C")this.curCommandType=v.CURVE_TO,this.curCommandRelative=s==="c";else if(s==="s"||s==="S")this.curCommandType=v.SMOOTH_CURVE_TO,this.curCommandRelative=s==="s";else if(s==="q"||s==="Q")this.curCommandType=v.QUAD_TO,this.curCommandRelative=s==="q";else if(s==="t"||s==="T")this.curCommandType=v.SMOOTH_QUAD_TO,this.curCommandRelative=s==="t";else{if(s!=="a"&&s!=="A")throw new SyntaxError('Unexpected character "'+s+'" at index '+o+".");this.curCommandType=v.ARC,this.curCommandRelative=s==="a"}else r.push({type:v.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=s,this.curNumberHasDecimal=s==="."}else this.curNumber+=s,this.curNumberHasDecimal=!0;else this.curNumber+=s;else this.curNumber+=s,this.curNumberHasExp=!0;else this.curNumber+=s,this.curNumberHasExpDigits=this.curNumberHasExp}return r},t.prototype.transform=function(e){return Object.create(this,{parse:{value:function(r,n){n===void 0&&(n=[]);for(var a=0,o=Object.getPrototypeOf(this).parse.call(this,r);a>A;if(o[x+3]=Ur,Ur!==0){var Xr=255/Ur;o[x]=(k*w>>A)*Xr,o[x+1]=(K*w>>A)*Xr,o[x+2]=(at*w>>A)*Xr}else o[x]=o[x+1]=o[x+2]=0;k-=Q,K-=Y,at-=$,ct-=M,Q-=m.r,Y-=m.g,$-=m.b,M-=m.a;var Pt=Hr+a+1;Pt=b+(Pt>A,et>0?(et=255/et,o[rt]=(je*w>>A)*et,o[rt+1]=(Fe*w>>A)*et,o[rt+2]=(ze*w>>A)*et):o[rt]=o[rt+1]=o[rt+2]=0,je-=Yr,Fe-=Gr,ze-=qr,Be-=Wr,Yr-=m.r,Gr-=m.g,qr-=m.b,Wr-=m.a,rt=qt+((rt=Jr+l)0&&arguments[0]!==void 0?arguments[0]:{},t={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:i,createCanvas(e,r){return new OffscreenCanvas(e,r)},createImage(e){return bt(function*(){var r=yield fetch(e),n=yield r.blob(),a=yield createImageBitmap(n);return a})()}};return(typeof DOMParser<"u"||typeof i>"u")&&Reflect.deleteProperty(t,"DOMParser"),t}function r1(i){var{DOMParser:t,canvas:e,fetch:r}=i;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,fetch:r,createCanvas:e.createCanvas,createImage:e.loadImage}}var Tb=Object.freeze({__proto__:null,offscreen:e1,node:r1});function ge(i){return i.replace(/(?!\u3000)\s+/gm," ")}function i1(i){return i.replace(/^[\n \t]+/,"")}function n1(i){return i.replace(/[\n \t]+$/,"")}function nt(i){var t=(i||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return t.map(parseFloat)}var a1=/^[A-Z-]+$/;function s1(i){return a1.test(i)?i.toLowerCase():i}function vh(i){var t=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(i)||[];return t[2]||t[3]||t[4]}function o1(i){if(!i.startsWith("rgb"))return i;var t=3,e=i.replace(/\d+(\.\d+)?/g,(r,n)=>t--&&n?String(Math.round(parseFloat(r))):r);return e}var u1=/(\[[^\]]+\])/g,h1=/(#[^\s+>~.[:]+)/g,l1=/(\.[^\s+>~.[:]+)/g,c1=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,g1=/(:[\w-]+\([^)]*\))/gi,f1=/(:[^\s+>~.[:]+)/g,p1=/([^\s+>~.[:]+)/g;function It(i,t){var e=t.exec(i);return e?[i.replace(t," "),e.length]:[i,0]}function d1(i){var t=[0,0,0],e=i.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[e,r]=It(e,u1),t[1]+=r,[e,r]=It(e,h1),t[0]+=r,[e,r]=It(e,l1),t[1]+=r,[e,r]=It(e,c1),t[2]+=r,[e,r]=It(e,g1),t[1]+=r,[e,r]=It(e,f1),t[1]+=r,e=e.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[e,r]=It(e,p1),t[2]+=r,t.join("")}var ae=1e-8;function Oo(i){return Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2))}function On(i,t){return(i[0]*t[0]+i[1]*t[1])/(Oo(i)*Oo(t))}function Ao(i,t){return(i[0]*t[1]0&&arguments[0]!==void 0?arguments[0]:" ",{document:e,name:r}=this;return ge(this.getString()).trim().split(t).map(n=>new T(e,r,n))}hasValue(t){var{value:e}=this;return e!==null&&e!==""&&(t||e!==0)&&typeof e<"u"}isString(t){var{value:e}=this,r=typeof e=="string";return!r||!t?r:t.test(e)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var t=this.getString();switch(!0){case t.endsWith("px"):case/^[0-9]+$/.test(t):return!0;default:return!1}}setValue(t){return this.value=t,this}getValue(t){return typeof t>"u"||this.hasValue()?this.value:t}getNumber(t){if(!this.hasValue())return typeof t>"u"?0:parseFloat(t);var{value:e}=this,r=parseFloat(e);return this.isString(/%$/)&&(r/=100),r}getString(t){return typeof t>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(t)}getColor(t){var e=this.getString(t);return this.isNormalizedColor||(this.isNormalizedColor=!0,e=o1(e),this.value=e),e}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;var[r,n]=typeof t=="boolean"?[void 0,t]:[t],{viewPort:a}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(a.computeSize("x"),a.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(a.computeSize("x"),a.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*a.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*a.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&n):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*a.computeSize(r);default:{var o=this.getNumber();return e&&o<1?o*a.computeSize(r):o}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var t=this.getString(),e=/#([^)'"]+)/.exec(t);return e&&(e=e[1]),e||(e=t),this.document.definitions[e]}getFillStyleDefinition(t,e){var r=this.getDefinition();if(!r)return null;if(typeof r.createGradient=="function")return r.createGradient(this.document.ctx,t,e);if(typeof r.createPattern=="function"){if(r.getHrefAttribute().hasValue()){var n=r.getAttribute("patternTransform");r=r.getHrefAttribute().getDefinition(),n.hasValue()&&r.getAttribute("patternTransform",!0).setValue(n.value)}return r.createPattern(this.document.ctx,t,e)}return null}getTextBaseline(){return this.hasValue()?T.textBaselineMapping[this.getString()]:null}addOpacity(t){for(var e=this.getColor(),r=e.length,n=0,a=0;a1&&arguments[1]!==void 0?arguments[1]:0,[r=e,n=e]=nt(t);return new L(r,n)}static parseScale(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,[r=e,n=r]=nt(t);return new L(r,n)}static parsePath(t){for(var e=nt(t),r=e.length,n=[],a=0;a0}runEvents(){if(this.working){var{screen:t,events:e,eventElements:r}=this,{style:n}=t.ctx.canvas;n&&(n.cursor=""),e.forEach((a,o)=>{for(var{run:s}=a,u=r[o];u;)s(u),u=u.parent}),this.events=[],this.eventElements=[]}}checkPath(t,e){if(!(!this.working||!e)){var{events:r,eventElements:n}=this;r.forEach((a,o)=>{var{x:s,y:u}=a;!n[o]&&e.isPointInPath&&e.isPointInPath(s,u)&&(n[o]=t)})}}checkBoundingBox(t,e){if(!(!this.working||!e)){var{events:r,eventElements:n}=this;r.forEach((a,o)=>{var{x:s,y:u}=a;!n[o]&&e.isPointInBox(s,u)&&(n[o]=t)})}}mapXY(t,e){for(var{window:r,ctx:n}=this.screen,a=new L(t,e),o=n.canvas;o;)a.x-=o.offsetLeft,a.y-=o.offsetTop,o=o.offsetParent;return r.scrollX&&(a.x+=r.scrollX),r.scrollY&&(a.y+=r.scrollY),a}onClick(t){var{x:e,y:r}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onclick",x:e,y:r,run(n){n.onClick&&n.onClick()}})}onMouseMove(t){var{x:e,y:r}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onmousemove",x:e,y:r,run(n){n.onMouseMove&&n.onMouseMove()}})}}var xh=typeof window<"u"?window:null,bh=typeof fetch<"u"?fetch.bind(void 0):null;class jr{constructor(t){var{fetch:e=bh,window:r=xh}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.ctx=t,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new m1,this.mouse=new y1(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=r,this.fetch=e}wait(t){this.waits.push(t)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var t=this.waits.every(e=>e());return t&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=t,t}setDefaults(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4}setViewBox(t){var{document:e,ctx:r,aspectRatio:n,width:a,desiredWidth:o,height:s,desiredHeight:u,minX:h=0,minY:l=0,refX:g,refY:f,clip:c=!1,clipX:d=0,clipY:p=0}=t,m=ge(n).replace(/^defer\s/,""),[y,b]=m.split(" "),x=y||"xMidYMid",w=b||"meet",A=a/o,O=s/u,S=Math.min(A,O),E=Math.max(A,O),R=o,I=u;w==="meet"&&(R*=S,I*=S),w==="slice"&&(R*=E,I*=E);var F=new T(e,"refX",g),N=new T(e,"refY",f),q=F.hasValue()&&N.hasValue();if(q&&r.translate(-S*F.getPixels("x"),-S*N.getPixels("y")),c){var W=S*d,H=S*p;r.beginPath(),r.moveTo(W,H),r.lineTo(a,H),r.lineTo(a,s),r.lineTo(W,s),r.closePath(),r.clip()}if(!q){var Q=w==="meet"&&S===O,Y=w==="slice"&&E===O,$=w==="meet"&&S===A,M=w==="slice"&&E===A;x.startsWith("xMid")&&(Q||Y)&&r.translate(a/2-R/2,0),x.endsWith("YMid")&&($||M)&&r.translate(0,s/2-I/2),x.startsWith("xMax")&&(Q||Y)&&r.translate(a-R,0),x.endsWith("YMax")&&($||M)&&r.translate(0,s-I)}switch(!0){case x==="none":r.scale(A,O);break;case w==="meet":r.scale(S,S);break;case w==="slice":r.scale(E,E);break}r.translate(-h,-l)}start(t){var{enableRedraw:e=!1,ignoreMouse:r=!1,ignoreAnimation:n=!1,ignoreDimensions:a=!1,ignoreClear:o=!1,forceRedraw:s,scaleWidth:u,scaleHeight:h,offsetX:l,offsetY:g}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{FRAMERATE:f,mouse:c}=this,d=1e3/f;if(this.frameDuration=d,this.readyPromise=new Promise(x=>{this.resolveReady=x}),this.isReady()&&this.render(t,a,o,u,h,l,g),!!e){var p=Date.now(),m=p,y=0,b=()=>{p=Date.now(),y=p-m,y>=d&&(m=p-y%d,this.shouldUpdate(n,s)&&(this.render(t,a,o,u,h,l,g),c.runEvents())),this.intervalId=Dt(b)};r||c.start(),this.intervalId=Dt(b)}}stop(){this.intervalId&&(Dt.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(t,e){if(!t){var{frameDuration:r}=this,n=this.animations.reduce((a,o)=>o.update(r)||a,!1);if(n)return!0}return!!(typeof e=="function"&&e()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(t,e,r,n,a,o,s){var{CLIENT_WIDTH:u,CLIENT_HEIGHT:h,viewPort:l,ctx:g,isFirstRender:f}=this,c=g.canvas;l.clear(),c.width&&c.height?l.setCurrent(c.width,c.height):l.setCurrent(u,h);var d=t.getStyle("width"),p=t.getStyle("height");!e&&(f||typeof n!="number"&&typeof a!="number")&&(d.hasValue()&&(c.width=d.getPixels("x"),c.style&&(c.style.width="".concat(c.width,"px"))),p.hasValue()&&(c.height=p.getPixels("y"),c.style&&(c.style.height="".concat(c.height,"px"))));var m=c.clientWidth||c.width,y=c.clientHeight||c.height;if(e&&d.hasValue()&&p.hasValue()&&(m=d.getPixels("x"),y=p.getPixels("y")),l.setCurrent(m,y),typeof o=="number"&&t.getAttribute("x",!0).setValue(o),typeof s=="number"&&t.getAttribute("y",!0).setValue(s),typeof n=="number"||typeof a=="number"){var b=nt(t.getAttribute("viewBox").getString()),x=0,w=0;if(typeof n=="number"){var A=t.getStyle("width");A.hasValue()?x=A.getPixels("x")/n:isNaN(b[2])||(x=b[2]/n)}if(typeof a=="number"){var O=t.getStyle("height");O.hasValue()?w=O.getPixels("y")/a:isNaN(b[3])||(w=b[3]/a)}x||(x=w),w||(w=x),t.getAttribute("width",!0).setValue(n),t.getAttribute("height",!0).setValue(a);var S=t.getStyle("transform",!0,!0);S.setValue("".concat(S.getString()," scale(").concat(1/x,", ").concat(1/w,")"))}r||g.clearRect(0,0,m,y),t.render(g),f&&(this.isFirstRender=!1)}}jr.defaultWindow=xh;jr.defaultFetch=bh;var{defaultFetch:v1}=jr,x1=typeof DOMParser<"u"?DOMParser:null;class Yi{constructor(){var{fetch:t=v1,DOMParser:e=x1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fetch=t,this.DOMParser=e}parse(t){var e=this;return bt(function*(){return t.startsWith("<")?e.parseFromString(t):e.load(t)})()}parseFromString(t){var e=new this.DOMParser;try{return this.checkDocument(e.parseFromString(t,"image/svg+xml"))}catch{return this.checkDocument(e.parseFromString(t,"text/xml"))}}checkDocument(t){var e=t.getElementsByTagName("parsererror")[0];if(e)throw new Error(e.textContent);return t}load(t){var e=this;return bt(function*(){var r=yield e.fetch(t),n=yield r.text();return e.parseFromString(n)})()}}class b1{constructor(t,e){this.type="translate",this.point=null,this.point=L.parse(e)}apply(t){var{x:e,y:r}=this.point;t.translate(e||0,r||0)}unapply(t){var{x:e,y:r}=this.point;t.translate(-1*e||0,-1*r||0)}applyToPoint(t){var{x:e,y:r}=this.point;t.applyTransform([1,0,0,1,e||0,r||0])}}class w1{constructor(t,e,r){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var n=nt(e);this.angle=new T(t,"angle",n[0]),this.originX=r[0],this.originY=r[1],this.cx=n[1]||0,this.cy=n[2]||0}apply(t){var{cx:e,cy:r,originX:n,originY:a,angle:o}=this,s=e+n.getPixels("x"),u=r+a.getPixels("y");t.translate(s,u),t.rotate(o.getRadians()),t.translate(-s,-u)}unapply(t){var{cx:e,cy:r,originX:n,originY:a,angle:o}=this,s=e+n.getPixels("x"),u=r+a.getPixels("y");t.translate(s,u),t.rotate(-1*o.getRadians()),t.translate(-s,-u)}applyToPoint(t){var{cx:e,cy:r,angle:n}=this,a=n.getRadians();t.applyTransform([1,0,0,1,e||0,r||0]),t.applyTransform([Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0]),t.applyTransform([1,0,0,1,-e||0,-r||0])}}class S1{constructor(t,e,r){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var n=L.parseScale(e);(n.x===0||n.y===0)&&(n.x=ae,n.y=ae),this.scale=n,this.originX=r[0],this.originY=r[1]}apply(t){var{scale:{x:e,y:r},originX:n,originY:a}=this,o=n.getPixels("x"),s=a.getPixels("y");t.translate(o,s),t.scale(e,r||e),t.translate(-o,-s)}unapply(t){var{scale:{x:e,y:r},originX:n,originY:a}=this,o=n.getPixels("x"),s=a.getPixels("y");t.translate(o,s),t.scale(1/e,1/r||e),t.translate(-o,-s)}applyToPoint(t){var{x:e,y:r}=this.scale;t.applyTransform([e||0,0,0,r||0,0,0])}}class wh{constructor(t,e,r){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=nt(e),this.originX=r[0],this.originY=r[1]}apply(t){var{originX:e,originY:r,matrix:n}=this,a=e.getPixels("x"),o=r.getPixels("y");t.translate(a,o),t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),t.translate(-a,-o)}unapply(t){var{originX:e,originY:r,matrix:n}=this,a=n[0],o=n[2],s=n[4],u=n[1],h=n[3],l=n[5],g=0,f=0,c=1,d=1/(a*(h*c-l*f)-o*(u*c-l*g)+s*(u*f-h*g)),p=e.getPixels("x"),m=r.getPixels("y");t.translate(p,m),t.transform(d*(h*c-l*f),d*(l*g-u*c),d*(s*f-o*c),d*(a*c-s*g),d*(o*l-s*h),d*(s*u-a*l)),t.translate(-p,-m)}applyToPoint(t){t.applyTransform(this.matrix)}}class Sh extends wh{constructor(t,e,r){super(t,e,r),this.type="skew",this.angle=null,this.angle=new T(t,"angle",e)}}class T1 extends Sh{constructor(t,e,r){super(t,e,r),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class O1 extends Sh{constructor(t,e,r){super(t,e,r),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function A1(i){return ge(i).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function C1(i){var[t,e]=i.split("(");return[t.trim(),e.trim().replace(")","")]}class zt{constructor(t,e,r){this.document=t,this.transforms=[];var n=A1(e);n.forEach(a=>{if(a!=="none"){var[o,s]=C1(a),u=zt.transformTypes[o];typeof u<"u"&&this.transforms.push(new u(this.document,s,r))}})}static fromElement(t,e){var r=e.getStyle("transform",!1,!0),[n,a=n]=e.getStyle("transform-origin",!1,!0).split(),o=[n,a];return r.hasValue()?new zt(t,r.getString(),o):null}apply(t){for(var{transforms:e}=this,r=e.length,n=0;n=0;n--)e[n].unapply(t)}applyToPoint(t){for(var{transforms:e}=this,r=e.length,n=0;n2&&arguments[2]!==void 0?arguments[2]:!1;if(this.document=t,this.node=e,this.captureTextNodes=r,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!(!e||e.nodeType!==1)){if(Array.from(e.attributes).forEach(s=>{var u=s1(s.nodeName);this.attributes[u]=new T(t,u,s.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var n=this.getAttribute("style").getString().split(";").map(s=>s.trim());n.forEach(s=>{if(s){var[u,h]=s.split(":").map(l=>l.trim());this.styles[u]=new T(t,u,h)}})}var{definitions:a}=t,o=this.getAttribute("id");o.hasValue()&&(a[o.getString()]||(a[o.getString()]=this)),Array.from(e.childNodes).forEach(s=>{if(s.nodeType===1)this.addChild(s);else if(r&&(s.nodeType===3||s.nodeType===4)){var u=t.createTextNode(s);u.getText().length>0&&this.addChild(u)}})}}getAttribute(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.attributes[t];if(!r&&e){var n=new T(this.document,t,"");return this.attributes[t]=n,n}return r||T.empty(this.document)}getHrefAttribute(){for(var t in this.attributes)if(t==="href"||t.endsWith(":href"))return this.attributes[t];return T.empty(this.document)}getStyle(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=this.styles[t];if(n)return n;var a=this.getAttribute(t);if(a!=null&&a.hasValue())return this.styles[t]=a,a;if(!r){var{parent:o}=this;if(o){var s=o.getStyle(t);if(s!=null&&s.hasValue())return s}}if(e){var u=new T(this.document,t,"");return this.styles[t]=u,u}return n||T.empty(this.document)}render(t){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(t.save(),this.getStyle("mask").hasValue()){var e=this.getStyle("mask").getDefinition();e&&(this.applyEffects(t),e.apply(t,this))}else if(this.getStyle("filter").getValue("none")!=="none"){var r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(t),r.apply(t,this))}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}setContext(t){}applyEffects(t){var e=zt.fromElement(this.document,this);e&&e.apply(t);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var n=r.getDefinition();n&&n.apply(t)}}clearContext(t){}renderChildren(t){this.children.forEach(e=>{e.render(t)})}addChild(t){var e=t instanceof V?t:this.document.createElement(t);e.parent=this,V.ignoreChildTypes.includes(e.type)||this.children.push(e)}matchesSelector(t){var e,{node:r}=this;if(typeof r.matches=="function")return r.matches(t);var n=(e=r.getAttribute)===null||e===void 0?void 0:e.call(r,"class");return!n||n===""?!1:n.split(" ").some(a=>".".concat(a)===t)}addStylesFromStyleDefinition(){var{styles:t,stylesSpecificity:e}=this.document;for(var r in t)if(!r.startsWith("@")&&this.matchesSelector(r)){var n=t[r],a=e[r];if(n)for(var o in n){var s=this.stylesSpecificity[o];typeof s>"u"&&(s="000"),a>=s&&(this.styles[o]=n[o],this.stylesSpecificity[o]=a)}}}removeStyles(t,e){var r=e.reduce((n,a)=>{var o=t.getStyle(a);if(!o.hasValue())return n;var s=o.getString();return o.setValue(""),[...n,[a,s]]},[]);return r}restoreStyles(t,e){e.forEach(r=>{var[n,a]=r;t.getStyle(n,!0).setValue(a)})}isFirstChild(){var t;return((t=this.parent)===null||t===void 0?void 0:t.children.indexOf(this))===0}}V.ignoreChildTypes=["title"];class E1 extends V{constructor(t,e,r){super(t,e,r)}}function P1(i){var t=i.trim();return/^('|")/.test(t)?t:'"'.concat(t,'"')}function N1(i){return typeof process>"u"?i:i.trim().split(",").map(P1).join(",")}function M1(i){if(!i)return"";var t=i.trim().toLowerCase();switch(t){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return t;default:return/^oblique\s+(-|)\d+deg$/.test(t)?t:""}}function V1(i){if(!i)return"";var t=i.trim().toLowerCase();switch(t){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return t;default:return/^[\d.]+$/.test(t)?t:""}}class J{constructor(t,e,r,n,a,o){var s=o?typeof o=="string"?J.parse(o):o:{};this.fontFamily=a||s.fontFamily,this.fontSize=n||s.fontSize,this.fontStyle=t||s.fontStyle,this.fontWeight=r||s.fontWeight,this.fontVariant=e||s.fontVariant}static parse(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,r="",n="",a="",o="",s="",u=ge(t).trim().split(" "),h={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return u.forEach(l=>{switch(!0){case(!h.fontStyle&&J.styles.includes(l)):l!=="inherit"&&(r=l),h.fontStyle=!0;break;case(!h.fontVariant&&J.variants.includes(l)):l!=="inherit"&&(n=l),h.fontStyle=!0,h.fontVariant=!0;break;case(!h.fontWeight&&J.weights.includes(l)):l!=="inherit"&&(a=l),h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0;break;case!h.fontSize:l!=="inherit"&&([o]=l.split("/")),h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0,h.fontSize=!0;break;default:l!=="inherit"&&(s+=l)}}),new J(r,n,a,o,s,e)}toString(){return[M1(this.fontStyle),this.fontVariant,V1(this.fontWeight),this.fontSize,N1(this.fontFamily)].join(" ").trim()}}J.styles="normal|italic|oblique|inherit";J.variants="normal|small-caps|inherit";J.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class lt{constructor(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Number.NaN,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.NaN,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Number.NaN,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Number.NaN;this.x1=t,this.y1=e,this.x2=r,this.y2=n,this.addPoint(t,e),this.addPoint(r,n)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(t,e){typeof t<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),tthis.x2&&(this.x2=t)),typeof e<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),ethis.y2&&(this.y2=e))}addX(t){this.addPoint(t,null)}addY(t){this.addPoint(null,t)}addBoundingBox(t){if(t){var{x1:e,y1:r,x2:n,y2:a}=t;this.addPoint(e,r),this.addPoint(n,a)}}sumCubic(t,e,r,n,a){return Math.pow(1-t,3)*e+3*Math.pow(1-t,2)*t*r+3*(1-t)*Math.pow(t,2)*n+Math.pow(t,3)*a}bezierCurveAdd(t,e,r,n,a){var o=6*e-12*r+6*n,s=-3*e+9*r-9*n+3*a,u=3*r-3*e;if(s===0){if(o===0)return;var h=-u/o;0=e.length-1}next(){var t=this.commands[++this.i];return this.previousCommand=this.command,this.command=t,t}getPoint(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y",r=new L(this.command[t],this.command[e]);return this.makeAbsolute(r)}getAsControlPoint(t,e){var r=this.getPoint(t,e);return this.control=r,r}getAsCurrentPoint(t,e){var r=this.getPoint(t,e);return this.current=r,r}getReflectedControlPoint(){var t=this.previousCommand.type;if(t!==v.CURVE_TO&&t!==v.SMOOTH_CURVE_TO&&t!==v.QUAD_TO&&t!==v.SMOOTH_QUAD_TO)return this.current;var{current:{x:e,y:r},control:{x:n,y:a}}=this,o=new L(2*e-n,2*r-a);return o}makeAbsolute(t){if(this.command.relative){var{x:e,y:r}=this.current;t.x+=e,t.y+=r}return t}addMarker(t,e,r){var{points:n,angles:a}=this;r&&a.length>0&&!a[a.length-1]&&(a[a.length-1]=n[n.length-1].angleTo(r)),this.addMarkerAngle(t,e?e.angleTo(t):null)}addMarkerAngle(t,e){this.points.push(t),this.angles.push(e)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:t}=this,e=t.length,r=0;r1&&arguments[1]!==void 0?arguments[1]:!1;if(!e){var r=this.getStyle("fill"),n=this.getStyle("fill-opacity"),a=this.getStyle("stroke"),o=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var s=r.getFillStyleDefinition(this,n);s&&(t.fillStyle=s)}else if(r.hasValue()){r.getString()==="currentColor"&&r.setValue(this.getStyle("color").getColor());var u=r.getColor();u!=="inherit"&&(t.fillStyle=u==="none"?"rgba(0,0,0,0)":u)}if(n.hasValue()){var h=new T(this.document,"fill",t.fillStyle).addOpacity(n).getColor();t.fillStyle=h}if(a.isUrlDefinition()){var l=a.getFillStyleDefinition(this,o);l&&(t.strokeStyle=l)}else if(a.hasValue()){a.getString()==="currentColor"&&a.setValue(this.getStyle("color").getColor());var g=a.getString();g!=="inherit"&&(t.strokeStyle=g==="none"?"rgba(0,0,0,0)":g)}if(o.hasValue()){var f=new T(this.document,"stroke",t.strokeStyle).addOpacity(o).getString();t.strokeStyle=f}var c=this.getStyle("stroke-width");if(c.hasValue()){var d=c.getPixels();t.lineWidth=d||ae}var p=this.getStyle("stroke-linecap"),m=this.getStyle("stroke-linejoin"),y=this.getStyle("stroke-miterlimit"),b=this.getStyle("stroke-dasharray"),x=this.getStyle("stroke-dashoffset");if(p.hasValue()&&(t.lineCap=p.getString()),m.hasValue()&&(t.lineJoin=m.getString()),y.hasValue()&&(t.miterLimit=y.getNumber()),b.hasValue()&&b.getString()!=="none"){var w=nt(b.getString());typeof t.setLineDash<"u"?t.setLineDash(w):typeof t.webkitLineDash<"u"?t.webkitLineDash=w:typeof t.mozDash<"u"&&!(w.length===1&&w[0]===0)&&(t.mozDash=w);var A=x.getPixels();typeof t.lineDashOffset<"u"?t.lineDashOffset=A:typeof t.webkitLineDashOffset<"u"?t.webkitLineDashOffset=A:typeof t.mozDashOffset<"u"&&(t.mozDashOffset=A)}}if(this.modifiedEmSizeStack=!1,typeof t.font<"u"){var O=this.getStyle("font"),S=this.getStyle("font-style"),E=this.getStyle("font-variant"),R=this.getStyle("font-weight"),I=this.getStyle("font-size"),F=this.getStyle("font-family"),N=new J(S.getString(),E.getString(),R.getString(),I.hasValue()?"".concat(I.getPixels(!0),"px"):"",F.getString(),J.parse(O.getString(),t.font));S.setValue(N.fontStyle),E.setValue(N.fontVariant),R.setValue(N.fontWeight),I.setValue(N.fontSize),F.setValue(N.fontFamily),t.font=N.toString(),I.isPixels()&&(this.document.emSize=I.getPixels(),this.modifiedEmSizeStack=!0)}e||(this.applyEffects(t),t.globalAlpha=this.calculateOpacity())}clearContext(t){super.clearContext(t),this.modifiedEmSizeStack&&this.document.popEmSize()}}class P extends Yt{constructor(t,e,r){super(t,e,r),this.type="path",this.pathParser=null,this.pathParser=new C(this.getAttribute("d").getString())}path(t){var{pathParser:e}=this,r=new lt;for(e.reset(),t&&t.beginPath();!e.isEnd();)switch(e.next().type){case C.MOVE_TO:this.pathM(t,r);break;case C.LINE_TO:this.pathL(t,r);break;case C.HORIZ_LINE_TO:this.pathH(t,r);break;case C.VERT_LINE_TO:this.pathV(t,r);break;case C.CURVE_TO:this.pathC(t,r);break;case C.SMOOTH_CURVE_TO:this.pathS(t,r);break;case C.QUAD_TO:this.pathQ(t,r);break;case C.SMOOTH_QUAD_TO:this.pathT(t,r);break;case C.ARC:this.pathA(t,r);break;case C.CLOSE_PATH:this.pathZ(t,r);break}return r}getBoundingBox(t){return this.path()}getMarkers(){var{pathParser:t}=this,e=t.getMarkerPoints(),r=t.getMarkerAngles(),n=e.map((a,o)=>[a,r[o]]);return n}renderChildren(t){this.path(t),this.document.screen.mouse.checkPath(this,t);var e=this.getStyle("fill-rule");t.fillStyle!==""&&(e.getString("inherit")!=="inherit"?t.fill(e.getString()):t.fill()),t.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(t.save(),t.setTransform(1,0,0,1,0,0),t.stroke(),t.restore()):t.stroke());var r=this.getMarkers();if(r){var n=r.length-1,a=this.getStyle("marker-start"),o=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(a.isUrlDefinition()){var u=a.getDefinition(),[h,l]=r[0];u.render(t,h,l)}if(o.isUrlDefinition())for(var g=o.getDefinition(),f=1;f1&&(n*=Math.sqrt(f),a*=Math.sqrt(f));var c=(s===u?-1:1)*Math.sqrt((Math.pow(n,2)*Math.pow(a,2)-Math.pow(n,2)*Math.pow(g.y,2)-Math.pow(a,2)*Math.pow(g.x,2))/(Math.pow(n,2)*Math.pow(g.y,2)+Math.pow(a,2)*Math.pow(g.x,2)));isNaN(c)&&(c=0);var d=new L(c*n*g.y/a,c*-a*g.x/n),p=new L((e.x+l.x)/2+Math.cos(h)*d.x-Math.sin(h)*d.y,(e.y+l.y)/2+Math.sin(h)*d.x+Math.cos(h)*d.y),m=Ao([1,0],[(g.x-d.x)/n,(g.y-d.y)/a]),y=[(g.x-d.x)/n,(g.y-d.y)/a],b=[(-g.x-d.x)/n,(-g.y-d.y)/a],x=Ao(y,b);return On(y,b)<=-1&&(x=Math.PI),On(y,b)>=1&&(x=0),{currentPoint:l,rX:n,rY:a,sweepFlag:u,xAxisRotation:h,centp:p,a1:m,ad:x}}pathA(t,e){var{pathParser:r}=this,{currentPoint:n,rX:a,rY:o,sweepFlag:s,xAxisRotation:u,centp:h,a1:l,ad:g}=P.pathA(r),f=1-s?1:-1,c=l+f*(g/2),d=new L(h.x+a*Math.cos(c),h.y+o*Math.sin(c));if(r.addMarkerAngle(d,c-f*Math.PI/2),r.addMarkerAngle(n,c-f*Math.PI),e.addPoint(n.x,n.y),t&&!isNaN(l)&&!isNaN(g)){var p=a>o?a:o,m=a>o?1:a/o,y=a>o?o/a:1;t.translate(h.x,h.y),t.rotate(u),t.scale(m,y),t.arc(0,0,p,l,l+g,!!(1-s)),t.scale(1/m,1/y),t.rotate(-u),t.translate(-h.x,-h.y)}}static pathZ(t){t.current=t.start}pathZ(t,e){P.pathZ(this.pathParser),t&&e.x1!==e.x2&&e.y1!==e.y2&&t.closePath()}}class Th extends P{constructor(t,e,r){super(t,e,r),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class Et extends Yt{constructor(t,e,r){super(t,e,new.target===Et?!0:r),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(t,e);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(t.textBaseline=r)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(t){if(this.type!=="text")return this.getTElementBoundingBox(t);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t);var e=null;return this.children.forEach((r,n)=>{var a=this.getChildBoundingBox(t,this,this,n);e?e.addBoundingBox(a):e=a}),e}getFontSize(){var{document:t,parent:e}=this,r=J.parse(t.ctx.font).fontSize,n=e.getStyle("font-size").getNumber(r);return n}getTElementBoundingBox(t){var e=this.getFontSize();return new lt(this.x,this.y-e,this.x+this.measureText(t),this.y)}getGlyph(t,e,r){var n=e[r],a=null;if(t.isArabic){var o=e.length,s=e[r-1],u=e[r+1],h="isolated";if((r===0||s===" ")&&r0&&s!==" "&&r0&&s!==" "&&(r===o-1||u===" ")&&(h="initial"),typeof t.glyphs[n]<"u"){var l=t.glyphs[n];a=l instanceof Th?l:l[h]}}else a=t.glyphs[n];return a||(a=t.missingGlyph),a}getText(){return""}getTextFromNode(t){var e=t||this.node,r=Array.from(e.parentNode.childNodes),n=r.indexOf(e),a=r.length-1,o=ge(e.textContent||"");return n===0&&(o=i1(o)),n===a&&(o=n1(o)),o}renderChildren(t){if(this.type!=="text"){this.renderTElementChildren(t);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t),this.children.forEach((r,n)=>{this.renderChild(t,this,this,n)});var{mouse:e}=this.document.screen;e.isWorking()&&e.checkBoundingBox(this,this.getBoundingBox(t))}renderTElementChildren(t){var{document:e,parent:r}=this,n=this.getText(),a=r.getStyle("font-family").getDefinition();if(a){for(var{unitsPerEm:o}=a.fontFace,s=J.parse(e.ctx.font),u=r.getStyle("font-size").getNumber(s.fontSize),h=r.getStyle("font-style").getString(s.fontStyle),l=u/o,g=a.isRTL?n.split("").reverse().join(""):n,f=nt(r.getAttribute("dx").getString()),c=g.length,d=0;d=this.leafTexts.length)){var t=this.leafTexts[this.textChunkStart],e=t.getStyle("text-anchor").getString("start"),r=!1,n=0;e==="start"&&!r||e==="end"&&r?n=t.x-this.minX:e==="end"&&!r||e==="start"&&r?n=t.x-this.maxX:n=t.x-(this.minX+this.maxX)/2;for(var a=this.textChunkStart;a{this.adjustChildCoordinatesRecursiveCore(t,this,this,r)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(t,e,r,n){var a=r.children[n];a.children.length>0?a.children.forEach((o,s)=>{e.adjustChildCoordinatesRecursiveCore(t,e,a,s)}):this.adjustChildCoordinates(t,e,r,n)}adjustChildCoordinates(t,e,r,n){var a=r.children[n];if(typeof a.measureText!="function")return a;t.save(),a.setContext(t,!0);var o=a.getAttribute("x"),s=a.getAttribute("y"),u=a.getAttribute("dx"),h=a.getAttribute("dy"),l=a.getStyle("font-family").getDefinition(),g=!!l&&l.isRTL;n===0&&(o.hasValue()||o.setValue(a.getInheritedAttribute("x")),s.hasValue()||s.setValue(a.getInheritedAttribute("y")),u.hasValue()||u.setValue(a.getInheritedAttribute("dx")),h.hasValue()||h.setValue(a.getInheritedAttribute("dy")));var f=a.measureText(t);return g&&(e.x-=f),o.hasValue()?(e.applyAnchoring(),a.x=o.getPixels("x"),u.hasValue()&&(a.x+=u.getPixels("x"))):(u.hasValue()&&(e.x+=u.getPixels("x")),a.x=e.x),e.x=a.x,g||(e.x+=f),s.hasValue()?(a.y=s.getPixels("y"),h.hasValue()&&(a.y+=h.getPixels("y"))):(h.hasValue()&&(e.y+=h.getPixels("y")),a.y=e.y),e.y=a.y,e.leafTexts.push(a),e.minX=Math.min(e.minX,a.x,a.x+f),e.maxX=Math.max(e.maxX,a.x,a.x+f),a.clearContext(t),t.restore(),a}getChildBoundingBox(t,e,r,n){var a=r.children[n];if(typeof a.getBoundingBox!="function")return null;var o=a.getBoundingBox(t);return o?(a.children.forEach((s,u)=>{var h=e.getChildBoundingBox(t,e,a,u);o.addBoundingBox(h)}),o):null}renderChild(t,e,r,n){var a=r.children[n];a.render(t),a.children.forEach((o,s)=>{e.renderChild(t,e,a,s)})}measureText(t){var{measureCache:e}=this;if(~e)return e;var r=this.getText(),n=this.measureTargetText(t,r);return this.measureCache=n,n}measureTargetText(t,e){if(!e.length)return 0;var{parent:r}=this,n=r.getStyle("font-family").getDefinition();if(n){for(var a=this.getFontSize(),o=n.isRTL?e.split("").reverse().join(""):e,s=nt(r.getAttribute("dx").getString()),u=o.length,h=0,l=0;l0?"":this.getTextFromNode()}getText(){return this.text}}class R1 extends Fr{constructor(){super(...arguments),this.type="textNode"}}class Ie extends Yt{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(t){var e,{document:r}=this,{screen:n,window:a}=r,o=t.canvas;if(n.setDefaults(t),o.style&&typeof t.font<"u"&&a&&typeof a.getComputedStyle<"u"){t.font=a.getComputedStyle(o).getPropertyValue("font");var s=new T(r,"fontSize",J.parse(t.font).fontSize);s.hasValue()&&(r.rootEmSize=s.getPixels("y"),r.emSize=r.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:u,height:h}=n.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var l=this.getAttribute("refX"),g=this.getAttribute("refY"),f=this.getAttribute("viewBox"),c=f.hasValue()?nt(f.getString()):null,d=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible",p=0,m=0,y=0,b=0;c&&(p=c[0],m=c[1]),this.root||(u=this.getStyle("width").getPixels("x"),h=this.getStyle("height").getPixels("y"),this.type==="marker"&&(y=p,b=m,p=0,m=0)),n.viewPort.setCurrent(u,h),this.node&&(!this.parent||((e=this.node.parentNode)===null||e===void 0?void 0:e.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(t),t.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),c&&(u=c[2],h=c[3]),r.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:n.viewPort.width,desiredWidth:u,height:n.viewPort.height,desiredHeight:h,minX:p,minY:m,refX:l.getValue(),refY:g.getValue(),clip:d,clipX:y,clipY:b}),c&&(n.viewPort.removeCurrent(),n.viewPort.setCurrent(u,h))}clearContext(t){super.clearContext(t),this.document.screen.viewPort.removeCurrent()}resize(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=this.getAttribute("width",!0),a=this.getAttribute("height",!0),o=this.getAttribute("viewBox"),s=this.getAttribute("style"),u=n.getNumber(0),h=a.getNumber(0);if(r)if(typeof r=="string")this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var l=this.getAttribute("preserveAspectRatio");l.hasValue()&&l.setValue(l.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(n.setValue(t),a.setValue(e),o.hasValue()||o.setValue("0 0 ".concat(u||t," ").concat(h||e)),s.hasValue()){var g=this.getStyle("width"),f=this.getStyle("height");g.hasValue()&&g.setValue("".concat(t,"px")),f.hasValue()&&f.setValue("".concat(e,"px"))}}}class Oh extends P{constructor(){super(...arguments),this.type="rect"}path(t){var e=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),n=this.getStyle("width",!1,!0).getPixels("x"),a=this.getStyle("height",!1,!0).getPixels("y"),o=this.getAttribute("rx"),s=this.getAttribute("ry"),u=o.getPixels("x"),h=s.getPixels("y");if(o.hasValue()&&!s.hasValue()&&(h=u),s.hasValue()&&!o.hasValue()&&(u=h),u=Math.min(u,n/2),h=Math.min(h,a/2),t){var l=4*((Math.sqrt(2)-1)/3);t.beginPath(),a>0&&n>0&&(t.moveTo(e+u,r),t.lineTo(e+n-u,r),t.bezierCurveTo(e+n-u+l*u,r,e+n,r+h-l*h,e+n,r+h),t.lineTo(e+n,r+a-h),t.bezierCurveTo(e+n,r+a-h+l*h,e+n-u+l*u,r+a,e+n-u,r+a),t.lineTo(e+u,r+a),t.bezierCurveTo(e+u-l*u,r+a,e,r+a-h+l*h,e,r+a-h),t.lineTo(e,r+h),t.bezierCurveTo(e,r+h-l*h,e+u-l*u,r,e+u,r),t.closePath())}return new lt(e,r,e+n,r+a)}getMarkers(){return null}}class k1 extends P{constructor(){super(...arguments),this.type="circle"}path(t){var e=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),n=this.getAttribute("r").getPixels();return t&&n>0&&(t.beginPath(),t.arc(e,r,n,0,Math.PI*2,!1),t.closePath()),new lt(e-n,r-n,e+n,r+n)}getMarkers(){return null}}class I1 extends P{constructor(){super(...arguments),this.type="ellipse"}path(t){var e=4*((Math.sqrt(2)-1)/3),r=this.getAttribute("rx").getPixels("x"),n=this.getAttribute("ry").getPixels("y"),a=this.getAttribute("cx").getPixels("x"),o=this.getAttribute("cy").getPixels("y");return t&&r>0&&n>0&&(t.beginPath(),t.moveTo(a+r,o),t.bezierCurveTo(a+r,o+e*n,a+e*r,o+n,a,o+n),t.bezierCurveTo(a-e*r,o+n,a-r,o+e*n,a-r,o),t.bezierCurveTo(a-r,o-e*n,a-e*r,o-n,a,o-n),t.bezierCurveTo(a+e*r,o-n,a+r,o-e*n,a+r,o),t.closePath()),new lt(a-r,o-n,a+r,o+n)}getMarkers(){return null}}class _1 extends P{constructor(){super(...arguments),this.type="line"}getPoints(){return[new L(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new L(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(t){var[{x:e,y:r},{x:n,y:a}]=this.getPoints();return t&&(t.beginPath(),t.moveTo(e,r),t.lineTo(n,a)),new lt(e,r,n,a)}getMarkers(){var[t,e]=this.getPoints(),r=t.angleTo(e);return[[t,r],[e,r]]}}class Ah extends P{constructor(t,e,r){super(t,e,r),this.type="polyline",this.points=[],this.points=L.parsePath(this.getAttribute("points").getString())}path(t){var{points:e}=this,[{x:r,y:n}]=e,a=new lt(r,n);return t&&(t.beginPath(),t.moveTo(r,n)),e.forEach(o=>{var{x:s,y:u}=o;a.addPoint(s,u),t&&t.lineTo(s,u)}),a}getMarkers(){var{points:t}=this,e=t.length-1,r=[];return t.forEach((n,a)=>{a!==e&&r.push([n,n.angleTo(t[a+1])])}),r.length>0&&r.push([t[t.length-1],r[r.length-1][1]]),r}}class L1 extends Ah{constructor(){super(...arguments),this.type="polygon"}path(t){var e=super.path(t),[{x:r,y:n}]=this.points;return t&&(t.lineTo(r,n),t.closePath()),e}}class D1 extends V{constructor(){super(...arguments),this.type="pattern"}createPattern(t,e,r){var n=this.getStyle("width").getPixels("x",!0),a=this.getStyle("height").getPixels("y",!0),o=new Ie(this.document,null);o.attributes.viewBox=new T(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new T(this.document,"width","".concat(n,"px")),o.attributes.height=new T(this.document,"height","".concat(a,"px")),o.attributes.transform=new T(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;var s=this.document.createCanvas(n,a),u=s.getContext("2d"),h=this.getAttribute("x"),l=this.getAttribute("y");h.hasValue()&&l.hasValue()&&u.translate(h.getPixels("x",!0),l.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var g=-1;g<=1;g++)for(var f=-1;f<=1;f++)u.save(),o.attributes.x=new T(this.document,"x",g*s.width),o.attributes.y=new T(this.document,"y",f*s.height),o.render(u),u.restore();var c=t.createPattern(s,"repeat");return c}}class j1 extends V{constructor(){super(...arguments),this.type="marker"}render(t,e,r){if(e){var{x:n,y:a}=e,o=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");t.translate(n,a),o==="auto"&&t.rotate(r),s==="strokeWidth"&&t.scale(t.lineWidth,t.lineWidth),t.save();var u=new Ie(this.document,null);u.type=this.type,u.attributes.viewBox=new T(this.document,"viewBox",this.getAttribute("viewBox").getValue()),u.attributes.refX=new T(this.document,"refX",this.getAttribute("refX").getValue()),u.attributes.refY=new T(this.document,"refY",this.getAttribute("refY").getValue()),u.attributes.width=new T(this.document,"width",this.getAttribute("markerWidth").getValue()),u.attributes.height=new T(this.document,"height",this.getAttribute("markerHeight").getValue()),u.attributes.overflow=new T(this.document,"overflow",this.getAttribute("overflow").getValue()),u.attributes.fill=new T(this.document,"fill",this.getAttribute("fill").getColor("black")),u.attributes.stroke=new T(this.document,"stroke",this.getAttribute("stroke").getValue("none")),u.children=this.children,u.render(t),t.restore(),s==="strokeWidth"&&t.scale(1/t.lineWidth,1/t.lineWidth),o==="auto"&&t.rotate(-r),t.translate(-n,-a)}}}class F1 extends V{constructor(){super(...arguments),this.type="defs"}render(){}}class ua extends Yt{constructor(){super(...arguments),this.type="g"}getBoundingBox(t){var e=new lt;return this.children.forEach(r=>{e.addBoundingBox(r.getBoundingBox(t))}),e}}class Ch extends V{constructor(t,e,r){super(t,e,r),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:n,children:a}=this;a.forEach(o=>{o.type==="stop"&&n.push(o)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(t,e,r){var n=this;this.getHrefAttribute().hasValue()&&(n=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(n));var{stops:a}=n,o=this.getGradient(t,e);if(!o)return this.addParentOpacity(r,a[a.length-1].color);if(a.forEach(m=>{o.addColorStop(m.offset,this.addParentOpacity(r,m.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:u,viewPort:h}=s.screen,[l]=h.viewPorts,g=new Oh(s,null);g.attributes.x=new T(s,"x",-u/3),g.attributes.y=new T(s,"y",-u/3),g.attributes.width=new T(s,"width",u),g.attributes.height=new T(s,"height",u);var f=new ua(s,null);f.attributes.transform=new T(s,"transform",this.getAttribute("gradientTransform").getValue()),f.children=[g];var c=new Ie(s,null);c.attributes.x=new T(s,"x",0),c.attributes.y=new T(s,"y",0),c.attributes.width=new T(s,"width",l.width),c.attributes.height=new T(s,"height",l.height),c.children=[f];var d=s.createCanvas(l.width,l.height),p=d.getContext("2d");return p.fillStyle=o,c.render(p),p.createPattern(d,"no-repeat")}return o}inheritStopContainer(t){this.attributesToInherit.forEach(e=>{!this.getAttribute(e).hasValue()&&t.getAttribute(e).hasValue()&&this.getAttribute(e,!0).setValue(t.getAttribute(e).getValue())})}addParentOpacity(t,e){if(t.hasValue()){var r=new T(this.document,"color",e);return r.addOpacity(t).getColor()}return e}}class z1 extends Ch{constructor(t,e,r){super(t,e,r),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(t,e){var r=this.getGradientUnits()==="objectBoundingBox",n=r?e.getBoundingBox(t):null;if(r&&!n)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var a=r?n.x+n.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),o=r?n.y+n.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=r?n.x+n.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),u=r?n.y+n.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return a===s&&o===u?null:t.createLinearGradient(a,o,s,u)}}class B1 extends Ch{constructor(t,e,r){super(t,e,r),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(t,e){var r=this.getGradientUnits()==="objectBoundingBox",n=e.getBoundingBox(t);if(r&&!n)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var a=r?n.x+n.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),o=r?n.y+n.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=a,u=o;this.getAttribute("fx").hasValue()&&(s=r?n.x+n.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(u=r?n.y+n.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var h=r?(n.width+n.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),l=this.getAttribute("fr").getPixels();return t.createRadialGradient(s,u,l,a,o,h)}}class H1 extends V{constructor(t,e,r){super(t,e,r),this.type="stop";var n=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),a=this.getStyle("stop-opacity"),o=this.getStyle("stop-color",!0);o.getString()===""&&o.setValue("#000"),a.hasValue()&&(o=o.addOpacity(a)),this.offset=n,this.color=o.getColor()}}class ha extends V{constructor(t,e,r){super(t,e,r),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,t.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new T(t,"values",null);var n=this.getAttribute("values");n.hasValue()&&this.values.setValue(n.getString().split(";"))}getProperty(){var t=this.getAttribute("attributeType").getString(),e=this.getAttribute("attributeName").getString();return t==="CSS"?this.parent.getStyle(e,!0):this.parent.getAttribute(e,!0)}calcValue(){var{initialUnits:t}=this,{progress:e,from:r,to:n}=this.getProgress(),a=r.getNumber()+(n.getNumber()-r.getNumber())*e;return t==="%"&&(a*=100),"".concat(a).concat(t)}update(t){var{parent:e}=this,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var n=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(n==="freeze"&&!this.frozen)this.frozen=!0,e.animationFrozen=!0,e.animationFrozenValue=r.getString();else if(n==="remove"&&!this.removed)return this.removed=!0,r.setValue(e.animationFrozen?e.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=t;var a=!1;if(this.begin{var h=a[u];return s+(h-s)*t}).join(" ");return o}}class Y1 extends V{constructor(t,e,r){super(t,e,r),this.type="font",this.glyphs={},this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:n}=t,{children:a}=this;for(var o of a)switch(o.type){case"font-face":{this.fontFace=o;var s=o.getStyle("font-family");s.hasValue()&&(n[s.getString()]=this);break}case"missing-glyph":this.missingGlyph=o;break;case"glyph":{var u=o;u.arabicForm?(this.isRTL=!0,this.isArabic=!0,typeof this.glyphs[u.unicode]>"u"&&(this.glyphs[u.unicode]={}),this.glyphs[u.unicode][u.arabicForm]=u):this.glyphs[u.unicode]=u;break}}}render(){}}class G1 extends V{constructor(t,e,r){super(t,e,r),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class q1 extends P{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class W1 extends Et{constructor(){super(...arguments),this.type="tref"}getText(){var t=this.getHrefAttribute().getDefinition();if(t){var e=t.children[0];if(e)return e.getText()}return""}}class Q1 extends Et{constructor(t,e,r){super(t,e,r),this.type="a";var{childNodes:n}=e,a=n[0],o=n.length>0&&Array.from(n).every(s=>s.nodeType===3);this.hasText=o,this.text=o?this.getTextFromNode(a):""}getText(){return this.text}renderChildren(t){if(this.hasText){super.renderChildren(t);var{document:e,x:r,y:n}=this,{mouse:a}=e.screen,o=new T(e,"fontSize",J.parse(e.ctx.font).fontSize);a.isWorking()&&a.checkBoundingBox(this,new lt(r,n-o.getPixels("y"),r+this.measureText(t),n))}else if(this.children.length>0){var s=new ua(this.document,null);s.children=this.children,s.parent=this,s.render(t)}}onClick(){var{window:t}=this.document;t&&t.open(this.getHrefAttribute().getString())}onMouseMove(){var t=this.document.ctx;t.canvas.style.cursor="pointer"}}function ko(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),e.push.apply(e,r)}return e}function ar(i){for(var t=1;t{var{type:n,points:a}=r;switch(n){case C.LINE_TO:t&&t.lineTo(a[0],a[1]);break;case C.MOVE_TO:t&&t.moveTo(a[0],a[1]);break;case C.CURVE_TO:t&&t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case C.QUAD_TO:t&&t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case C.ARC:{var[o,s,u,h,l,g,f,c]=a,d=u>h?u:h,p=u>h?1:u/h,m=u>h?h/u:1;t&&(t.translate(o,s),t.rotate(f),t.scale(p,m),t.arc(0,0,d,l,l+g,!!(1-c)),t.scale(1/p,1/m),t.rotate(-f),t.translate(-o,-s));break}case C.CLOSE_PATH:t&&t.closePath();break}})}renderChildren(t){this.setTextData(t),t.save();var e=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),{glyphInfo:n}=this,a=t.fillStyle;e==="underline"&&t.beginPath(),n.forEach((o,s)=>{var{p0:u,p1:h,rotation:l,text:g}=o;t.save(),t.translate(u.x,u.y),t.rotate(l),t.fillStyle&&t.fillText(g,0,0),t.strokeStyle&&t.strokeText(g,0,0),t.restore(),e==="underline"&&(s===0&&t.moveTo(u.x,u.y+r/8),t.lineTo(h.x,h.y+r/5))}),e==="underline"&&(t.lineWidth=r/20,t.strokeStyle=a,t.stroke(),t.closePath()),t.restore()}getLetterSpacingAt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[t]||0}findSegmentToFitChar(t,e,r,n,a,o,s,u,h){var l=o,g=this.measureText(t,u);u===" "&&e==="justify"&&r-1&&(l+=this.getLetterSpacingAt(h));var f=this.textHeight/20,c=this.getEquidistantPointOnPath(l,f,0),d=this.getEquidistantPointOnPath(l+g,f,0),p={p0:c,p1:d},m=c&&d?Math.atan2(d.y-c.y,d.x-c.x):0;if(s){var y=Math.cos(Math.PI/2+m)*s,b=Math.cos(-m)*s;p.p0=ar(ar({},c),{},{x:c.x+y,y:c.y+b}),p.p1=ar(ar({},d),{},{x:d.x+y,y:d.y+b})}return l+=g,{offset:l,segment:p,rotation:m}}measureText(t,e){var{measuresCache:r}=this,n=e||this.getText();if(r.has(n))return r.get(n);var a=this.measureTargetText(t,n);return r.set(n,a),a}setTextData(t){if(!this.glyphInfo){var e=this.getText(),r=e.split(""),n=e.split(" ").length-1,a=this.parent.getAttribute("dx").split().map(w=>w.getPixels("x")),o=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),u=this.getStyle("letter-spacing"),h=this.parent.getStyle("letter-spacing"),l=0;!u.hasValue()||u.getValue()==="inherit"?l=h.getPixels():u.hasValue()&&u.getValue()!=="initial"&&u.getValue()!=="unset"&&(l=u.getPixels());var g=[],f=e.length;this.letterSpacingCache=g;for(var c=0;cO===0?0:w+A||0,0),p=this.measureText(t),m=Math.max(p+d,0);this.textWidth=p,this.textHeight=this.getFontSize(),this.glyphInfo=[];var y=this.getPathLength(),b=this.getStyle("startOffset").getNumber(0)*y,x=0;(s==="middle"||s==="center")&&(x=-m/2),(s==="end"||s==="right")&&(x=-m),x+=b,r.forEach((w,A)=>{var{offset:O,segment:S,rotation:E}=this.findSegmentToFitChar(t,s,m,y,n,x,o,w,A);x=O,!(!S.p0||!S.p1)&&this.glyphInfo.push({text:r[A],p0:S.p0,p1:S.p1,rotation:E})})}}parsePathData(t){if(this.pathLength=-1,!t)return[];var e=[],{pathParser:r}=t;for(r.reset();!r.isEnd();){var{current:n}=r,a=n?n.x:0,o=n?n.y:0,s=r.next(),u=s.type,h=[];switch(s.type){case C.MOVE_TO:this.pathM(r,h);break;case C.LINE_TO:u=this.pathL(r,h);break;case C.HORIZ_LINE_TO:u=this.pathH(r,h);break;case C.VERT_LINE_TO:u=this.pathV(r,h);break;case C.CURVE_TO:this.pathC(r,h);break;case C.SMOOTH_CURVE_TO:u=this.pathS(r,h);break;case C.QUAD_TO:this.pathQ(r,h);break;case C.SMOOTH_QUAD_TO:u=this.pathT(r,h);break;case C.ARC:h=this.pathA(r);break;case C.CLOSE_PATH:P.pathZ(r);break}s.type!==C.CLOSE_PATH?e.push({type:u,points:h,start:{x:a,y:o},pathLength:this.calcLength(a,o,u,h)}):e.push({type:C.CLOSE_PATH,points:[],pathLength:0})}return e}pathM(t,e){var{x:r,y:n}=P.pathM(t).point;e.push(r,n)}pathL(t,e){var{x:r,y:n}=P.pathL(t).point;return e.push(r,n),C.LINE_TO}pathH(t,e){var{x:r,y:n}=P.pathH(t).point;return e.push(r,n),C.LINE_TO}pathV(t,e){var{x:r,y:n}=P.pathV(t).point;return e.push(r,n),C.LINE_TO}pathC(t,e){var{point:r,controlPoint:n,currentPoint:a}=P.pathC(t);e.push(r.x,r.y,n.x,n.y,a.x,a.y)}pathS(t,e){var{point:r,controlPoint:n,currentPoint:a}=P.pathS(t);return e.push(r.x,r.y,n.x,n.y,a.x,a.y),C.CURVE_TO}pathQ(t,e){var{controlPoint:r,currentPoint:n}=P.pathQ(t);e.push(r.x,r.y,n.x,n.y)}pathT(t,e){var{controlPoint:r,currentPoint:n}=P.pathT(t);return e.push(r.x,r.y,n.x,n.y),C.QUAD_TO}pathA(t){var{rX:e,rY:r,sweepFlag:n,xAxisRotation:a,centp:o,a1:s,ad:u}=P.pathA(t);return n===0&&u>0&&(u-=2*Math.PI),n===1&&u<0&&(u+=2*Math.PI),[o.x,o.y,e,r,s,u,a,n]}calcLength(t,e,r,n){var a=0,o=null,s=null,u=0;switch(r){case C.LINE_TO:return this.getLineLength(t,e,n[0],n[1]);case C.CURVE_TO:for(a=0,o=this.getPointOnCubicBezier(0,t,e,n[0],n[1],n[2],n[3],n[4],n[5]),u=.01;u<=1;u+=.01)s=this.getPointOnCubicBezier(u,t,e,n[0],n[1],n[2],n[3],n[4],n[5]),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return a;case C.QUAD_TO:for(a=0,o=this.getPointOnQuadraticBezier(0,t,e,n[0],n[1],n[2],n[3]),u=.01;u<=1;u+=.01)s=this.getPointOnQuadraticBezier(u,t,e,n[0],n[1],n[2],n[3]),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return a;case C.ARC:{a=0;var h=n[4],l=n[5],g=n[4]+l,f=Math.PI/180;if(Math.abs(h-g)g;u-=f)s=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],u,0),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(u=h+f;u5&&arguments[5]!==void 0?arguments[5]:e,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:r,u=(a-r)/(n-e+ae),h=Math.sqrt(t*t/(1+u*u));ne)return null;var{dataArray:a}=this;for(var o of a){if(o&&(o.pathLength<5e-5||r+o.pathLength+5e-5=0&&u>g)break;n=this.getPointOnEllipticalArc(o.points[0],o.points[1],o.points[2],o.points[3],u,o.points[6]);break}case C.CURVE_TO:u=s/o.pathLength,u>1&&(u=1),n=this.getPointOnCubicBezier(u,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3],o.points[4],o.points[5]);break;case C.QUAD_TO:u=s/o.pathLength,u>1&&(u=1),n=this.getPointOnQuadraticBezier(u,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3]);break}if(n)return n;break}return null}getLineLength(t,e,r,n){return Math.sqrt((r-t)*(r-t)+(n-e)*(n-e))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((t,e)=>e.pathLength>0?t+e.pathLength:t,0)),this.pathLength}getPointOnCubicBezier(t,e,r,n,a,o,s,u,h){var l=u*Co(t)+o*Eo(t)+n*Po(t)+e*No(t),g=h*Co(t)+s*Eo(t)+a*Po(t)+r*No(t);return{x:l,y:g}}getPointOnQuadraticBezier(t,e,r,n,a,o,s){var u=o*Mo(t)+n*Vo(t)+e*Ro(t),h=s*Mo(t)+a*Vo(t)+r*Ro(t);return{x:u,y:h}}getPointOnEllipticalArc(t,e,r,n,a,o){var s=Math.cos(o),u=Math.sin(o),h={x:r*Math.cos(a),y:n*Math.sin(a)};return{x:t+(h.x*s-h.y*u),y:e+(h.x*u+h.y*s)}}buildEquidistantCache(t,e){var r=this.getPathLength(),n=e||.25,a=t||r/100;if(!this.equidistantCache||this.equidistantCache.step!==a||this.equidistantCache.precision!==n){this.equidistantCache={step:a,precision:n,points:[]};for(var o=0,s=0;s<=r;s+=n){var u=this.getPointOnPath(s),h=this.getPointOnPath(s+n);!u||!h||(o+=this.getLineLength(u.x,u.y,h.x,h.y),o>=a&&(this.equidistantCache.points.push({x:u.x,y:u.y,distance:s}),o-=a))}}}getEquidistantPointOnPath(t,e,r){if(this.buildEquidistantCache(e,r),t<0||t-this.getPathLength()>5e-5)return null;var n=Math.round(t/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[n]||null}}var Z1=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class K1 extends Yt{constructor(t,e,r){super(t,e,r),this.type="image",this.loaded=!1;var n=this.getHrefAttribute().getString();if(n){var a=n.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(n);t.images.push(this),a?this.loadSvg(n):this.loadImage(n),this.isSvg=a}}loadImage(t){var e=this;return bt(function*(){try{var r=yield e.document.createImage(t);e.image=r}catch(n){console.error('Error while loading image "'.concat(t,'":'),n)}e.loaded=!0})()}loadSvg(t){var e=this;return bt(function*(){var r=Z1.exec(t);if(r){var n=r[5];r[4]==="base64"?e.image=atob(n):e.image=decodeURIComponent(n)}else try{var a=yield e.document.fetch(t),o=yield a.text();e.image=o}catch(s){console.error('Error while loading image "'.concat(t,'":'),s)}e.loaded=!0})()}renderChildren(t){var{document:e,image:r,loaded:n}=this,a=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),u=this.getStyle("height").getPixels("y");if(!(!n||!r||!s||!u)){if(t.save(),t.translate(a,o),this.isSvg){var h=e.canvg.forkString(t,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:u});h.document.documentElement.parent=this,h.render()}else{var l=this.image;e.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:l.width,height:u,desiredHeight:l.height}),this.loaded&&(typeof l.complete>"u"||l.complete)&&t.drawImage(l,0,0)}t.restore()}}getBoundingBox(){var t=this.getAttribute("x").getPixels("x"),e=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),n=this.getStyle("height").getPixels("y");return new lt(t,e,t+r,e+n)}}class J1 extends Yt{constructor(){super(...arguments),this.type="symbol"}render(t){}}class tb{constructor(t){this.document=t,this.loaded=!1,t.fonts.push(this)}load(t,e){var r=this;return bt(function*(){try{var{document:n}=r,a=yield n.canvg.parser.load(e),o=a.getElementsByTagName("font");Array.from(o).forEach(s=>{var u=n.createElement(s);n.definitions[t]=u})}catch(s){console.error('Error while loading font "'.concat(e,'":'),s)}r.loaded=!0})()}}class Eh extends V{constructor(t,e,r){super(t,e,r),this.type="style";var n=ge(Array.from(e.childNodes).map(o=>o.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),a=n.split("}");a.forEach(o=>{var s=o.trim();if(s){var u=s.split("{"),h=u[0].split(","),l=u[1].split(";");h.forEach(g=>{var f=g.trim();if(f){var c=t.styles[f]||{};if(l.forEach(m=>{var y=m.indexOf(":"),b=m.substr(0,y).trim(),x=m.substr(y+1,m.length-y).trim();b&&x&&(c[b]=new T(t,b,x))}),t.styles[f]=c,t.stylesSpecificity[f]=d1(f),f==="@font-face"){var d=c["font-family"].getString().replace(/"|'/g,""),p=c.src.getString().split(",");p.forEach(m=>{if(m.indexOf('format("svg")')>0){var y=vh(m);y&&new tb(t).load(d,y)}})}}})}})}}Eh.parseExternalUrl=vh;class eb extends Yt{constructor(){super(...arguments),this.type="use"}setContext(t){super.setContext(t);var e=this.getAttribute("x"),r=this.getAttribute("y");e.hasValue()&&t.translate(e.getPixels("x"),0),r.hasValue()&&t.translate(0,r.getPixels("y"))}path(t){var{element:e}=this;e&&e.path(t)}renderChildren(t){var{document:e,element:r}=this;if(r){var n=r;if(r.type==="symbol"&&(n=new Ie(e,null),n.attributes.viewBox=new T(e,"viewBox",r.getAttribute("viewBox").getString()),n.attributes.preserveAspectRatio=new T(e,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),n.attributes.overflow=new T(e,"overflow",r.getAttribute("overflow").getString()),n.children=r.children,r.styles.opacity=new T(e,"opacity",this.calculateOpacity())),n.type==="svg"){var a=this.getStyle("width",!1,!0),o=this.getStyle("height",!1,!0);a.hasValue()&&(n.attributes.width=new T(e,"width",a.getString())),o.hasValue()&&(n.attributes.height=new T(e,"height",o.getString()))}var s=n.parent;n.parent=this,n.render(t),n.parent=s}}getBoundingBox(t){var{element:e}=this;return e?e.getBoundingBox(t):null}elementTransform(){var{document:t,element:e}=this;return zt.fromElement(t,e)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function sr(i,t,e,r,n,a){return i[e*r*4+t*4+a]}function or(i,t,e,r,n,a,o){i[e*r*4+t*4+a]=o}function z(i,t,e){var r=i[t];return r*e}function vt(i,t,e,r){return t+Math.cos(i)*e+Math.sin(i)*r}class Ph extends V{constructor(t,e,r){super(t,e,r),this.type="feColorMatrix";var n=nt(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{var a=n[0];n=[.213+.787*a,.715-.715*a,.072-.072*a,0,0,.213-.213*a,.715+.285*a,.072-.072*a,0,0,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{var o=n[0]*Math.PI/180;n=[vt(o,.213,.787,-.213),vt(o,.715,-.715,-.715),vt(o,.072,-.072,.928),0,0,vt(o,.213,-.213,.143),vt(o,.715,.285,.14),vt(o,.072,-.072,-.283),0,0,vt(o,.213,-.213,-.787),vt(o,.715,-.715,.715),vt(o,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=n,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(t,e,r,n,a){for(var{includeOpacity:o,matrix:s}=this,u=t.getImageData(0,0,n,a),h=0;h{u.addBoundingBox(d.getBoundingBox(t))}),n=Math.floor(u.x1),a=Math.floor(u.y1),o=Math.floor(u.width),s=Math.floor(u.height)}var h=this.removeStyles(e,zr.ignoreStyles),l=r.createCanvas(n+o,a+s),g=l.getContext("2d");r.screen.setDefaults(g),this.renderChildren(g),new Ph(r,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(g,0,0,n+o,a+s);var f=r.createCanvas(n+o,a+s),c=f.getContext("2d");r.screen.setDefaults(c),e.render(c),c.globalCompositeOperation="destination-in",c.fillStyle=g.createPattern(l,"no-repeat"),c.fillRect(0,0,n+o,a+s),t.fillStyle=c.createPattern(f,"no-repeat"),t.fillRect(0,0,n+o,a+s),this.restoreStyles(e,h)}render(t){}}zr.ignoreStyles=["mask","transform","clip-path"];var Io=()=>{};class rb extends V{constructor(){super(...arguments),this.type="clipPath"}apply(t){var{document:e}=this,r=Reflect.getPrototypeOf(t),{beginPath:n,closePath:a}=t;r&&(r.beginPath=Io,r.closePath=Io),Reflect.apply(n,t,[]),this.children.forEach(o=>{if(!(typeof o.path>"u")){var s=typeof o.elementTransform<"u"?o.elementTransform():null;s||(s=zt.fromElement(e,o)),s&&s.apply(t),o.path(t),r&&(r.closePath=a),s&&s.unapply(t)}}),Reflect.apply(a,t,[]),t.clip(),r&&(r.beginPath=n,r.closePath=a)}render(t){}}class Br extends V{constructor(){super(...arguments),this.type="filter"}apply(t,e){var{document:r,children:n}=this,a=e.getBoundingBox(t);if(a){var o=0,s=0;n.forEach(y=>{var b=y.extraFilterDistance||0;o=Math.max(o,b),s=Math.max(s,b)});var u=Math.floor(a.width),h=Math.floor(a.height),l=u+2*o,g=h+2*s;if(!(l<1||g<1)){var f=Math.floor(a.x),c=Math.floor(a.y),d=this.removeStyles(e,Br.ignoreStyles),p=r.createCanvas(l,g),m=p.getContext("2d");r.screen.setDefaults(m),m.translate(-f+o,-c+s),e.render(m),n.forEach(y=>{typeof y.apply=="function"&&y.apply(m,0,0,l,g)}),t.drawImage(p,0,0,l,g,f-o,c-s,l,g),this.restoreStyles(e,d)}}}render(t){}}Br.ignoreStyles=["filter","transform","clip-path"];class ib extends V{constructor(t,e,r){super(t,e,r),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(t,e,r,n,a){}}class nb extends V{constructor(){super(...arguments),this.type="feMorphology"}apply(t,e,r,n,a){}}class ab extends V{constructor(){super(...arguments),this.type="feComposite"}apply(t,e,r,n,a){}}class sb extends V{constructor(t,e,r){super(t,e,r),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(t,e,r,n,a){var{document:o,blurRadius:s}=this,u=o.window?o.window.document.body:null,h=t.canvas;h.id=o.getUniqueId(),u&&(h.style.display="none",u.appendChild(h)),Jx(h,e,r,n,a,s),u&&u.removeChild(h)}}class ob extends V{constructor(){super(...arguments),this.type="title"}}class ub extends V{constructor(){super(...arguments),this.type="desc"}}var hb={svg:Ie,rect:Oh,circle:k1,ellipse:I1,line:_1,polyline:Ah,polygon:L1,path:P,pattern:D1,marker:j1,defs:F1,linearGradient:z1,radialGradient:B1,stop:H1,animate:ha,animateColor:U1,animateTransform:X1,font:Y1,"font-face":G1,"missing-glyph":q1,glyph:Th,text:Et,tspan:Fr,tref:W1,a:Q1,textPath:$1,image:K1,g:ua,symbol:J1,style:Eh,use:eb,mask:zr,clipPath:rb,filter:Br,feDropShadow:ib,feMorphology:nb,feComposite:ab,feColorMatrix:Ph,feGaussianBlur:sb,title:ob,desc:ub};function _o(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),e.push.apply(e,r)}return e}function lb(i){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:!1,e=document.createElement("img");return t&&(e.crossOrigin="Anonymous"),new Promise((r,n)=>{e.onload=()=>{r(e)},e.onerror=(a,o,s,u,h)=>{n(h)},e.src=i})}),An.apply(this,arguments)}class At{constructor(t){var{rootEmSize:e=12,emSize:r=12,createCanvas:n=At.createCanvas,createImage:a=At.createImage,anonymousCrossOrigin:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.canvg=t,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=t.screen,this.rootEmSize=e,this.emSize=r,this.createCanvas=n,this.createImage=this.bindCreateImage(a,o),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(t,e){return typeof e=="boolean"?(r,n)=>t(r,typeof n=="boolean"?n:e):t}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:t}=this;return t[t.length-1]}set emSize(t){var{emSizeStack:e}=this;e.push(t)}popEmSize(){var{emSizeStack:t}=this;t.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(t=>t.loaded)}isFontsLoaded(){return this.fonts.every(t=>t.loaded)}createDocumentElement(t){var e=this.createElement(t.documentElement);return e.root=!0,e.addStylesFromStyleDefinition(),this.documentElement=e,e}createElement(t){var e=t.nodeName.replace(/^[^:]+:/,""),r=At.elementTypes[e];return typeof r<"u"?new r(this,t):new E1(this,t)}createTextNode(t){return new R1(this,t)}setViewBox(t){this.screen.setViewBox(lb({document:this},t))}}At.createCanvas=cb;At.createImage=gb;At.elementTypes=hb;function Lo(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),e.push.apply(e,r)}return e}function _t(i){for(var t=1;t2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new Yi(r),this.screen=new jr(t,r),this.options=r;var n=new At(this,r),a=n.createDocumentElement(e);this.document=n,this.documentElement=a}static from(t,e){var r=arguments;return bt(function*(){var n=r.length>2&&r[2]!==void 0?r[2]:{},a=new Yi(n),o=yield a.parse(e);return new be(t,o,n)})()}static fromString(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=new Yi(r),a=n.parseFromString(e);return new be(t,a,r)}fork(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return be.from(t,e,_t(_t({},this.options),r))}forkString(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return be.fromString(t,e,_t(_t({},this.options),r))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var t=arguments,e=this;return bt(function*(){var r=t.length>0&&t[0]!==void 0?t[0]:{};e.start(_t({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},r)),yield e.ready(),e.stop()})()}start(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{documentElement:e,screen:r,options:n}=this;r.start(e,_t(_t({enableRedraw:!0},n),t))}stop(){this.screen.stop()}resize(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(t,e,r)}}export{Q1 as AElement,U1 as AnimateColorElement,ha as AnimateElement,X1 as AnimateTransformElement,lt as BoundingBox,Co as CB1,Eo as CB2,Po as CB3,No as CB4,be as Canvg,k1 as CircleElement,rb as ClipPathElement,F1 as DefsElement,ub as DescElement,At as Document,V as Element,I1 as EllipseElement,Ph as FeColorMatrixElement,ab as FeCompositeElement,ib as FeDropShadowElement,sb as FeGaussianBlurElement,nb as FeMorphologyElement,Br as FilterElement,J as Font,Y1 as FontElement,G1 as FontFaceElement,ua as GElement,Th as GlyphElement,Ch as GradientElement,K1 as ImageElement,_1 as LineElement,z1 as LinearGradientElement,j1 as MarkerElement,zr as MaskElement,wh as Matrix,q1 as MissingGlyphElement,y1 as Mouse,ae as PSEUDO_ZERO,Yi as Parser,P as PathElement,C as PathParser,D1 as PatternElement,L as Point,L1 as PolygonElement,Ah as PolylineElement,T as Property,Mo as QB1,Vo as QB2,Ro as QB3,B1 as RadialGradientElement,Oh as RectElement,Yt as RenderedElement,w1 as Rotate,Ie as SVGElement,tb as SVGFontLoader,S1 as Scale,jr as Screen,Sh as Skew,T1 as SkewX,O1 as SkewY,H1 as StopElement,Eh as StyleElement,J1 as SymbolElement,W1 as TRefElement,Fr as TSpanElement,Et as TextElement,$1 as TextPathElement,ob as TitleElement,zt as Transform,b1 as Translate,E1 as UnknownElement,eb as UseElement,m1 as ViewPort,ge as compressSpaces,be as default,d1 as getSelectorSpecificity,s1 as normalizeAttributeName,o1 as normalizeColor,vh as parseExternalUrl,Tb as presets,nt as toNumbers,i1 as trimLeft,n1 as trimRight,Oo as vectorMagnitude,Ao as vectorsAngle,On as vectorsRatio};