123456789101112131415161718 |
- import{d as Yi}from"./index-DHnGGSqj.js";var Jt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _o(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var fe=function(i){return i&&i.Math===Math&&i},z=fe(typeof globalThis=="object"&&globalThis)||fe(typeof window=="object"&&window)||fe(typeof self=="object"&&self)||fe(typeof Jt=="object"&&Jt)||fe(typeof Jt=="object"&&Jt)||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}),Vh=D,xr=!Vh(function(){var i=(function(){}).bind();return typeof i!="function"||i.hasOwnProperty("prototype")}),Rh=xr,Ye=Function.prototype.call,W=Rh?Ye.bind(Ye):function(){return Ye.apply(Ye,arguments)},Lo={},Do={}.propertyIsEnumerable,jo=Object.getOwnPropertyDescriptor,Ih=jo&&!Do.call({1:2},1);Lo.f=Ih?function(i){var t=jo(this,i);return!!t&&t.enumerable}:Do;var br=function(i,t){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:t}},Fo=xr,Uo=Function.prototype,Wi=Uo.call,kh=Fo&&Uo.bind.bind(Wi,Wi),j=Fo?kh:function(i){return function(){return Wi.apply(i,arguments)}},Bo=j,_h=Bo({}.toString),Lh=Bo("".slice),Ut=function(i){return Lh(_h(i),8,-1)},Dh=j,jh=D,Fh=Ut,Jr=Object,Uh=Dh("".split),zo=jh(function(){return!Jr("z").propertyIsEnumerable(0)})?function(i){return Fh(i)==="String"?Uh(i,""):Jr(i)}:Jr,Bt=function(i){return i==null},Bh=Bt,zh=TypeError,pt=function(i){if(Bh(i))throw new zh("Can't call method on "+i);return i},Hh=zo,Xh=pt,Pe=function(i){return Hh(Xh(i))},qi=typeof document=="object"&&document.all,Yh=typeof qi>"u"&&qi!==void 0,Ho={all:qi,IS_HTMLDDA:Yh},Xo=Ho,Wh=Xo.all,_=Xo.IS_HTMLDDA?function(i){return typeof i=="function"||i===Wh}:function(i){return typeof i=="function"},ya=_,Yo=Ho,qh=Yo.all,wt=Yo.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:ya(i)||i===qh}:function(i){return typeof i=="object"?i!==null:ya(i)},ti=z,Gh=_,Qh=function(i){return Gh(i)?i:void 0},zt=function(i,t){return arguments.length<2?Qh(ti[i]):ti[i]&&ti[i][t]},$h=j,wr=$h({}.isPrototypeOf),Sr=typeof navigator<"u"&&String(navigator.userAgent)||"",Wo=z,ei=Sr,va=Wo.process,xa=Wo.Deno,ba=va&&va.versions||xa&&xa.version,wa=ba&&ba.v8,ut,fr;wa&&(ut=wa.split("."),fr=ut[0]>0&&ut[0]<4?1:+(ut[0]+ut[1]));!fr&&ei&&(ut=ei.match(/Edge\/(\d+)/),(!ut||ut[1]>=74)&&(ut=ei.match(/Chrome\/(\d+)/),ut&&(fr=+ut[1])));var On=fr,Sa=On,Zh=D,Kh=z,Jh=Kh.String,qo=!!Object.getOwnPropertySymbols&&!Zh(function(){var i=Symbol("symbol detection");return!Jh(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&Sa&&Sa<41}),tl=qo,Go=tl&&!Symbol.sham&&typeof Symbol.iterator=="symbol",el=zt,rl=_,il=wr,nl=Go,al=Object,Qo=nl?function(i){return typeof i=="symbol"}:function(i){var t=el("Symbol");return rl(t)&&il(t.prototype,al(i))},sl=String,Tr=function(i){try{return sl(i)}catch{return"Object"}},ol=_,ul=Tr,hl=TypeError,St=function(i){if(ol(i))return i;throw new hl(ul(i)+" is not a function")},ll=St,cl=Bt,he=function(i,t){var e=i[t];return cl(e)?void 0:ll(e)},ri=W,ii=_,ni=wt,gl=TypeError,fl=function(i,t){var e,r;if(t==="string"&&ii(e=i.toString)&&!ni(r=ri(e,i))||ii(e=i.valueOf)&&!ni(r=ri(e,i))||t!=="string"&&ii(e=i.toString)&&!ni(r=ri(e,i)))return r;throw new gl("Can't convert object to primitive value")},$o={exports:{}},Ta=z,pl=Object.defineProperty,An=function(i,t){try{pl(Ta,i,{value:t,configurable:!0,writable:!0})}catch{Ta[i]=t}return t},dl=z,ml=An,Oa="__core-js_shared__",yl=dl[Oa]||ml(Oa,{}),Cn=yl,Aa=Cn;($o.exports=function(i,t){return Aa[i]||(Aa[i]=t!==void 0?t:{})})("versions",[]).push({version:"3.34.0",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE",source:"https://github.com/zloirock/core-js"});var En=$o.exports,vl=pt,xl=Object,Or=function(i){return xl(vl(i))},bl=j,wl=Or,Sl=bl({}.hasOwnProperty),ht=Object.hasOwn||function(i,t){return Sl(wl(i),t)},Tl=j,Ol=0,Al=Math.random(),Cl=Tl(1 .toString),Zo=function(i){return"Symbol("+(i===void 0?"":i)+")_"+Cl(++Ol+Al,36)},El=z,Pl=En,Ca=ht,Ml=Zo,Nl=qo,Vl=Go,te=El.Symbol,ai=Pl("wks"),Rl=Vl?te.for||te:te&&te.withoutSetter||Ml,X=function(i){return Ca(ai,i)||(ai[i]=Nl&&Ca(te,i)?te[i]:Rl("Symbol."+i)),ai[i]},Il=W,Ea=wt,Pa=Qo,kl=he,_l=fl,Ll=X,Dl=TypeError,jl=Ll("toPrimitive"),Fl=function(i,t){if(!Ea(i)||Pa(i))return i;var e=kl(i,jl),r;if(e){if(t===void 0&&(t="default"),r=Il(e,i,t),!Ea(r)||Pa(r))return r;throw new Dl("Can't convert object to primitive value")}return t===void 0&&(t="number"),_l(i,t)},Ul=Fl,Bl=Qo,Pn=function(i){var t=Ul(i,"string");return Bl(t)?t:t+""},zl=z,Ma=wt,Gi=zl.document,Hl=Ma(Gi)&&Ma(Gi.createElement),Ar=function(i){return Hl?Gi.createElement(i):{}},Xl=ft,Yl=D,Wl=Ar,Ko=!Xl&&!Yl(function(){return Object.defineProperty(Wl("div"),"a",{get:function(){return 7}}).a!==7}),ql=ft,Gl=W,Ql=Lo,$l=br,Zl=Pe,Kl=Pn,Jl=ht,tc=Ko,Na=Object.getOwnPropertyDescriptor;ue.f=ql?Na:function(i,t){if(i=Zl(i),t=Kl(t),tc)try{return Na(i,t)}catch{}if(Jl(i,t))return $l(!Gl(Ql.f,i,t),i[t])};var dt={},ec=ft,rc=D,Jo=ec&&rc(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),ic=wt,nc=String,ac=TypeError,Z=function(i){if(ic(i))return i;throw new ac(nc(i)+" is not an object")},sc=ft,oc=Ko,uc=Jo,We=Z,Va=Pn,hc=TypeError,si=Object.defineProperty,lc=Object.getOwnPropertyDescriptor,oi="enumerable",ui="configurable",hi="writable";dt.f=sc?uc?function(i,t,e){if(We(i),t=Va(t),We(e),typeof i=="function"&&t==="prototype"&&"value"in e&&hi in e&&!e[hi]){var r=lc(i,t);r&&r[hi]&&(i[t]=e.value,e={configurable:ui in e?e[ui]:r[ui],enumerable:oi in e?e[oi]:r[oi],writable:!1})}return si(i,t,e)}:si:function(i,t,e){if(We(i),t=Va(t),We(e),oc)try{return si(i,t,e)}catch{}if("get"in e||"set"in e)throw new hc("Accessors not supported");return"value"in e&&(i[t]=e.value),i};var cc=ft,gc=dt,fc=br,Me=cc?function(i,t,e){return gc.f(i,t,fc(1,e))}:function(i,t,e){return i[t]=e,i},tu={exports:{}},Qi=ft,pc=ht,eu=Function.prototype,dc=Qi&&Object.getOwnPropertyDescriptor,Mn=pc(eu,"name"),mc=Mn&&(function(){}).name==="something",yc=Mn&&(!Qi||Qi&&dc(eu,"name").configurable),Cr={EXISTS:Mn,PROPER:mc,CONFIGURABLE:yc},vc=j,xc=_,$i=Cn,bc=vc(Function.toString);xc($i.inspectSource)||($i.inspectSource=function(i){return bc(i)});var Nn=$i.inspectSource,wc=z,Sc=_,Ra=wc.WeakMap,Tc=Sc(Ra)&&/native code/.test(String(Ra)),Oc=En,Ac=Zo,Ia=Oc("keys"),Vn=function(i){return Ia[i]||(Ia[i]=Ac(i))},Rn={},Cc=Tc,ru=z,Ec=wt,Pc=Me,li=ht,ci=Cn,Mc=Vn,Nc=Rn,ka="Object already initialized",Zi=ru.TypeError,Vc=ru.WeakMap,pr,Ae,dr,Rc=function(i){return dr(i)?Ae(i):pr(i,{})},Ic=function(i){return function(t){var e;if(!Ec(t)||(e=Ae(t)).type!==i)throw new Zi("Incompatible receiver, "+i+" required");return e}};if(Cc||ci.state){var gt=ci.state||(ci.state=new Vc);gt.get=gt.get,gt.has=gt.has,gt.set=gt.set,pr=function(i,t){if(gt.has(i))throw new Zi(ka);return t.facade=i,gt.set(i,t),t},Ae=function(i){return gt.get(i)||{}},dr=function(i){return gt.has(i)}}else{var qt=Mc("state");Nc[qt]=!0,pr=function(i,t){if(li(i,qt))throw new Zi(ka);return t.facade=i,Pc(i,qt,t),t},Ae=function(i){return li(i,qt)?i[qt]:{}},dr=function(i){return li(i,qt)}}var Er={set:pr,get:Ae,has:dr,enforce:Rc,getterFor:Ic},In=j,kc=D,_c=_,qe=ht,Ki=ft,Lc=Cr.CONFIGURABLE,Dc=Nn,iu=Er,jc=iu.enforce,Fc=iu.get,_a=String,or=Object.defineProperty,Uc=In("".slice),Bc=In("".replace),zc=In([].join),Hc=Ki&&!kc(function(){return or(function(){},"length",{value:8}).length!==8}),Xc=String(String).split("String"),Yc=tu.exports=function(i,t,e){Uc(_a(t),0,7)==="Symbol("&&(t="["+Bc(_a(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!qe(i,"name")||Lc&&i.name!==t)&&(Ki?or(i,"name",{value:t,configurable:!0}):i.name=t),Hc&&e&&qe(e,"arity")&&i.length!==e.arity&&or(i,"length",{value:e.arity});try{e&&qe(e,"constructor")&&e.constructor?Ki&&or(i,"prototype",{writable:!1}):i.prototype&&(i.prototype=void 0)}catch{}var r=jc(i);return qe(r,"source")||(r.source=zc(Xc,typeof t=="string"?t:"")),i};Function.prototype.toString=Yc(function(){return _c(this)&&Fc(this).source||Dc(this)},"toString");var nu=tu.exports,Wc=_,qc=dt,Gc=nu,Qc=An,Ht=function(i,t,e,r){r||(r={});var n=r.enumerable,a=r.name!==void 0?r.name:t;if(Wc(e)&&Gc(e,a,r),r.global)n?i[t]=e:Qc(t,e);else{try{r.unsafe?i[t]&&(n=!0):delete i[t]}catch{}n?i[t]=e:qc.f(i,t,{value:e,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return i},au={},$c=Math.ceil,Zc=Math.floor,Kc=Math.trunc||function(i){var t=+i;return(t>0?Zc:$c)(t)},Jc=Kc,Pr=function(i){var t=+i;return t!==t||t===0?0:Jc(t)},tg=Pr,eg=Math.max,rg=Math.min,su=function(i,t){var e=tg(i);return e<0?eg(e+t,0):rg(e,t)},ig=Pr,ng=Math.min,le=function(i){return i>0?ng(ig(i),9007199254740991):0},ag=le,Mr=function(i){return ag(i.length)},sg=Pe,og=su,ug=Mr,La=function(i){return function(t,e,r){var n=sg(t),a=ug(n),o=og(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}},ou={includes:La(!0),indexOf:La(!1)},hg=j,gi=ht,lg=Pe,cg=ou.indexOf,gg=Rn,Da=hg([].push),uu=function(i,t){var e=lg(i),r=0,n=[],a;for(a in e)!gi(gg,a)&&gi(e,a)&&Da(n,a);for(;t.length>r;)gi(e,a=t[r++])&&(~cg(n,a)||Da(n,a));return n},kn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],fg=uu,pg=kn,dg=pg.concat("length","prototype");au.f=Object.getOwnPropertyNames||function(i){return fg(i,dg)};var hu={};hu.f=Object.getOwnPropertySymbols;var mg=zt,yg=j,vg=au,xg=hu,bg=Z,wg=yg([].concat),Sg=mg("Reflect","ownKeys")||function(i){var t=vg.f(bg(i)),e=xg.f;return e?wg(t,e(i)):t},ja=ht,Tg=Sg,Og=ue,Ag=dt,Cg=function(i,t,e){for(var r=Tg(t),n=Ag.f,a=Og.f,o=0;o<r.length;o++){var s=r[o];!ja(i,s)&&!(e&&ja(e,s))&&n(i,s,a(t,s))}},Eg=D,Pg=_,Mg=/#|\.prototype\./,Ne=function(i,t){var e=Vg[Ng(i)];return e===Ig?!0:e===Rg?!1:Pg(t)?Eg(t):!!t},Ng=Ne.normalize=function(i){return String(i).replace(Mg,".").toLowerCase()},Vg=Ne.data={},Rg=Ne.NATIVE="N",Ig=Ne.POLYFILL="P",lu=Ne,fi=z,kg=ue.f,_g=Me,Lg=Ht,Dg=An,jg=Cg,Fg=lu,tt=function(i,t){var e=i.target,r=i.global,n=i.stat,a,o,s,u,h,l;if(r?o=fi:n?o=fi[e]||Dg(e,{}):o=(fi[e]||{}).prototype,o)for(s in t){if(h=t[s],i.dontCallGetSet?(l=kg(o,s),u=l&&l.value):u=o[s],a=Fg(r?s:e+(n?".":"#")+s,i.forced),!a&&u!==void 0){if(typeof h==typeof u)continue;jg(h,u)}(i.sham||u&&u.sham)&&_g(h,"sham",!0),Lg(o,s,h,i)}},Ug=z,Bg=Ut,Ve=Bg(Ug.process)==="process",zg=j,Hg=St,Xg=function(i,t,e){try{return zg(Hg(Object.getOwnPropertyDescriptor(i,t)[e]))}catch{}},Yg=_,Wg=String,qg=TypeError,Gg=function(i){if(typeof i=="object"||Yg(i))return i;throw new qg("Can't set "+Wg(i)+" as a prototype")},Qg=Xg,$g=Z,Zg=Gg,cu=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,t={},e;try{e=Qg(Object.prototype,"__proto__","set"),e(t,[]),i=t instanceof Array}catch{}return function(r,n){return $g(r),Zg(n),i?e(r,n):r.__proto__=n,r}}():void 0),Kg=dt.f,Jg=ht,tf=X,Fa=tf("toStringTag"),Nr=function(i,t,e){i&&!e&&(i=i.prototype),i&&!Jg(i,Fa)&&Kg(i,Fa,{configurable:!0,value:t})},Ua=nu,ef=dt,rf=function(i,t,e){return e.get&&Ua(e.get,t,{getter:!0}),e.set&&Ua(e.set,t,{setter:!0}),ef.f(i,t,e)},nf=zt,af=rf,sf=X,of=ft,Ba=sf("species"),uf=function(i){var t=nf(i);of&&t&&!t[Ba]&&af(t,Ba,{configurable:!0,get:function(){return this}})},hf=wr,lf=TypeError,cf=function(i,t){if(hf(t,i))return i;throw new lf("Incorrect invocation")},gf=X,ff=gf("toStringTag"),gu={};gu[ff]="z";var pf=String(gu)==="[object z]",df=pf,mf=_,ur=Ut,yf=X,vf=yf("toStringTag"),xf=Object,bf=ur(function(){return arguments}())==="Arguments",wf=function(i,t){try{return i[t]}catch{}},_n=df?ur:function(i){var t,e,r;return i===void 0?"Undefined":i===null?"Null":typeof(e=wf(t=xf(i),vf))=="string"?e:bf?ur(t):(r=ur(t))==="Object"&&mf(t.callee)?"Arguments":r},Sf=j,Tf=D,fu=_,Of=_n,Af=zt,Cf=Nn,pu=function(){},Ef=[],du=Af("Reflect","construct"),Ln=/^\s*(?:class|function)\b/,Pf=Sf(Ln.exec),Mf=!Ln.test(pu),pe=function(i){if(!fu(i))return!1;try{return du(pu,Ef,i),!0}catch{return!1}},mu=function(i){if(!fu(i))return!1;switch(Of(i)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Mf||!!Pf(Ln,Cf(i))}catch{return!0}};mu.sham=!0;var Nf=!du||Tf(function(){var i;return pe(pe.call)||!pe(Object)||!pe(function(){i=!0})||i})?mu:pe,Vf=Nf,Rf=Tr,If=TypeError,kf=function(i){if(Vf(i))return i;throw new If(Rf(i)+" is not a constructor")},za=Z,_f=kf,Lf=Bt,Df=X,jf=Df("species"),yu=function(i,t){var e=za(i).constructor,r;return e===void 0||Lf(r=za(e)[jf])?t:_f(r)},Ff=xr,vu=Function.prototype,Ha=vu.apply,Xa=vu.call,Dn=typeof Reflect=="object"&&Reflect.apply||(Ff?Xa.bind(Ha):function(){return Xa.apply(Ha,arguments)}),Uf=Ut,Bf=j,Re=function(i){if(Uf(i)==="Function")return Bf(i)},Ya=Re,zf=St,Hf=xr,Xf=Ya(Ya.bind),jn=function(i,t){return zf(i),t===void 0?i:Hf?Xf(i,t):function(){return i.apply(t,arguments)}},Yf=zt,xu=Yf("document","documentElement"),Wf=j,qf=Wf([].slice),Gf=TypeError,Qf=function(i,t){if(i<t)throw new Gf("Not enough arguments");return i},$f=Sr,bu=/(?:ipad|iphone|ipod).*applewebkit/i.test($f),it=z,Zf=Dn,Kf=jn,Wa=_,Jf=ht,wu=D,qa=xu,tp=qf,Ga=Ar,ep=Qf,rp=bu,ip=Ve,Ji=it.setImmediate,tn=it.clearImmediate,np=it.process,pi=it.Dispatch,ap=it.Function,Qa=it.MessageChannel,sp=it.String,di=0,Te={},$a="onreadystatechange",Ce,Rt,mi,yi;wu(function(){Ce=it.location});var Fn=function(i){if(Jf(Te,i)){var t=Te[i];delete Te[i],t()}},vi=function(i){return function(){Fn(i)}},Za=function(i){Fn(i.data)},Ka=function(i){it.postMessage(sp(i),Ce.protocol+"//"+Ce.host)};(!Ji||!tn)&&(Ji=function(i){ep(arguments.length,1);var t=Wa(i)?i:ap(i),e=tp(arguments,1);return Te[++di]=function(){Zf(t,void 0,e)},Rt(di),di},tn=function(i){delete Te[i]},ip?Rt=function(i){np.nextTick(vi(i))}:pi&&pi.now?Rt=function(i){pi.now(vi(i))}:Qa&&!rp?(mi=new Qa,yi=mi.port2,mi.port1.onmessage=Za,Rt=Kf(yi.postMessage,yi)):it.addEventListener&&Wa(it.postMessage)&&!it.importScripts&&Ce&&Ce.protocol!=="file:"&&!wu(Ka)?(Rt=Ka,it.addEventListener("message",Za,!1)):$a in Ga("script")?Rt=function(i){qa.appendChild(Ga("script"))[$a]=function(){qa.removeChild(this),Fn(i)}}:Rt=function(i){setTimeout(vi(i),0)});var Su={set:Ji,clear:tn},Tu=function(){this.head=null,this.tail=null};Tu.prototype={add:function(i){var t={item:i,next:null},e=this.tail;e?e.next=t:this.head=t,this.tail=t},get:function(){var i=this.head;if(i){var t=this.head=i.next;return t===null&&(this.tail=null),i.item}}};var Ou=Tu,op=Sr,up=/ipad|iphone|ipod/i.test(op)&&typeof Pebble<"u",hp=Sr,lp=/web0s(?!.*chrome)/i.test(hp),Dt=z,Ja=jn,cp=ue.f,xi=Su.set,gp=Ou,fp=bu,pp=up,dp=lp,bi=Ve,ts=Dt.MutationObserver||Dt.WebKitMutationObserver,es=Dt.document,rs=Dt.process,Ge=Dt.Promise,is=cp(Dt,"queueMicrotask"),en=is&&is.value,Gt,wi,Si,Qe,ns;if(!en){var $e=new gp,Ze=function(){var i,t;for(bi&&(i=rs.domain)&&i.exit();t=$e.get();)try{t()}catch(e){throw $e.head&&Gt(),e}i&&i.enter()};!fp&&!bi&&!dp&&ts&&es?(wi=!0,Si=es.createTextNode(""),new ts(Ze).observe(Si,{characterData:!0}),Gt=function(){Si.data=wi=!wi}):!pp&&Ge&&Ge.resolve?(Qe=Ge.resolve(void 0),Qe.constructor=Ge,ns=Ja(Qe.then,Qe),Gt=function(){ns(Ze)}):bi?Gt=function(){rs.nextTick(Ze)}:(xi=Ja(xi,Dt),Gt=function(){xi(Ze)}),en=function(i){$e.head||Gt(),$e.add(i)}}var mp=en,yp=function(i,t){try{arguments.length===1?console.error(i):console.error(i,t)}catch{}},Un=function(i){try{return{error:!1,value:i()}}catch(t){return{error:!0,value:t}}},vp=z,Vr=vp.Promise,Au=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",xp=Au,bp=Ve,wp=!xp&&!bp&&typeof window=="object"&&typeof document=="object",Sp=z,Oe=Vr,Tp=_,Op=lu,Ap=Nn,Cp=X,Ep=wp,Pp=Au,Ti=On;Oe&&Oe.prototype;var Mp=Cp("species"),rn=!1,Cu=Tp(Sp.PromiseRejectionEvent),Np=Op("Promise",function(){var i=Ap(Oe),t=i!==String(Oe);if(!t&&Ti===66)return!0;if(!Ti||Ti<51||!/native code/.test(i)){var e=new Oe(function(a){a(1)}),r=function(a){a(function(){},function(){})},n=e.constructor={};if(n[Mp]=r,rn=e.then(function(){})instanceof r,!rn)return!0}return!t&&(Ep||Pp)&&!Cu}),Ie={CONSTRUCTOR:Np,REJECTION_EVENT:Cu,SUBCLASSING:rn},ce={},as=St,Vp=TypeError,Rp=function(i){var t,e;this.promise=new i(function(r,n){if(t!==void 0||e!==void 0)throw new Vp("Bad Promise constructor");t=r,e=n}),this.resolve=as(t),this.reject=as(e)};ce.f=function(i){return new Rp(i)};var Ip=tt,mr=Ve,Ct=z,se=W,ss=Ht,os=cu,kp=Nr,_p=uf,Lp=St,hr=_,Dp=wt,jp=cf,Fp=yu,Eu=Su.set,Bn=mp,Up=yp,Bp=Un,zp=Ou,Pu=Er,yr=Vr,zn=Ie,Mu=ce,Rr="Promise",Nu=zn.CONSTRUCTOR,Hp=zn.REJECTION_EVENT,Xp=zn.SUBCLASSING,Oi=Pu.getterFor(Rr),Yp=Pu.set,Kt=yr&&yr.prototype,Lt=yr,Ke=Kt,Vu=Ct.TypeError,nn=Ct.document,Hn=Ct.process,an=Mu.f,Wp=an,qp=!!(nn&&nn.createEvent&&Ct.dispatchEvent),Ru="unhandledrejection",Gp="rejectionhandled",us=0,Iu=1,Qp=2,Xn=1,ku=2,Je,hs,$p,ls,_u=function(i){var t;return Dp(i)&&hr(t=i.then)?t:!1},Lu=function(i,t){var e=t.value,r=t.state===Iu,n=r?i.ok:i.fail,a=i.resolve,o=i.reject,s=i.domain,u,h,l;try{n?(r||(t.rejection===ku&&Kp(t),t.rejection=Xn),n===!0?u=e:(s&&s.enter(),u=n(e),s&&(s.exit(),l=!0)),u===i.promise?o(new Vu("Promise-chain cycle")):(h=_u(u))?se(h,u,a,o):a(u)):o(e)}catch(g){s&&!l&&s.exit(),o(g)}},Du=function(i,t){i.notified||(i.notified=!0,Bn(function(){for(var e=i.reactions,r;r=e.get();)Lu(r,i);i.notified=!1,t&&!i.rejection&&Zp(i)}))},ju=function(i,t,e){var r,n;qp?(r=nn.createEvent("Event"),r.promise=t,r.reason=e,r.initEvent(i,!1,!0),Ct.dispatchEvent(r)):r={promise:t,reason:e},!Hp&&(n=Ct["on"+i])?n(r):i===Ru&&Up("Unhandled promise rejection",e)},Zp=function(i){se(Eu,Ct,function(){var t=i.facade,e=i.value,r=cs(i),n;if(r&&(n=Bp(function(){mr?Hn.emit("unhandledRejection",e,t):ju(Ru,t,e)}),i.rejection=mr||cs(i)?ku:Xn,n.error))throw n.value})},cs=function(i){return i.rejection!==Xn&&!i.parent},Kp=function(i){se(Eu,Ct,function(){var t=i.facade;mr?Hn.emit("rejectionHandled",t):ju(Gp,t,i.value)})},ee=function(i,t,e){return function(r){i(t,r,e)}},ie=function(i,t,e){i.done||(i.done=!0,e&&(i=e),i.value=t,i.state=Qp,Du(i,!0))},sn=function(i,t,e){if(!i.done){i.done=!0,e&&(i=e);try{if(i.facade===t)throw new Vu("Promise can't be resolved itself");var r=_u(t);r?Bn(function(){var n={done:!1};try{se(r,t,ee(sn,n,i),ee(ie,n,i))}catch(a){ie(n,a,i)}}):(i.value=t,i.state=Iu,Du(i,!1))}catch(n){ie({done:!1},n,i)}}};if(Nu&&(Lt=function(i){jp(this,Ke),Lp(i),se(Je,this);var t=Oi(this);try{i(ee(sn,t),ee(ie,t))}catch(e){ie(t,e)}},Ke=Lt.prototype,Je=function(i){Yp(this,{type:Rr,done:!1,notified:!1,parent:!1,reactions:new zp,rejection:!1,state:us,value:void 0})},Je.prototype=ss(Ke,"then",function(i,t){var e=Oi(this),r=an(Fp(this,Lt));return e.parent=!0,r.ok=hr(i)?i:!0,r.fail=hr(t)&&t,r.domain=mr?Hn.domain:void 0,e.state===us?e.reactions.add(r):Bn(function(){Lu(r,e)}),r.promise}),hs=function(){var i=new Je,t=Oi(i);this.promise=i,this.resolve=ee(sn,t),this.reject=ee(ie,t)},Mu.f=an=function(i){return i===Lt||i===$p?new hs(i):Wp(i)},hr(yr)&&Kt!==Object.prototype)){ls=Kt.then,Xp||ss(Kt,"then",function(i,t){var e=this;return new Lt(function(r,n){se(ls,e,r,n)}).then(i,t)},{unsafe:!0});try{delete Kt.constructor}catch{}os&&os(Kt,Ke)}Ip({global:!0,constructor:!0,wrap:!0,forced:Nu},{Promise:Lt});kp(Lt,Rr,!1);_p(Rr);var ke={},Jp=X,td=ke,ed=Jp("iterator"),rd=Array.prototype,id=function(i){return i!==void 0&&(td.Array===i||rd[ed]===i)},nd=_n,gs=he,ad=Bt,sd=ke,od=X,ud=od("iterator"),Fu=function(i){if(!ad(i))return gs(i,ud)||gs(i,"@@iterator")||sd[nd(i)]},hd=W,ld=St,cd=Z,gd=Tr,fd=Fu,pd=TypeError,dd=function(i,t){var e=arguments.length<2?fd(i):t;if(ld(e))return cd(hd(e,i));throw new pd(gd(i)+" is not iterable")},md=W,fs=Z,yd=he,vd=function(i,t,e){var r,n;fs(i);try{if(r=yd(i,"return"),!r){if(t==="throw")throw e;return e}r=md(r,i)}catch(a){n=!0,r=a}if(t==="throw")throw e;if(n)throw r;return fs(r),e},xd=jn,bd=W,wd=Z,Sd=Tr,Td=id,Od=Mr,ps=wr,Ad=dd,Cd=Fu,ds=vd,Ed=TypeError,lr=function(i,t){this.stopped=i,this.result=t},ms=lr.prototype,Uu=function(i,t,e){var r=e&&e.that,n=!!(e&&e.AS_ENTRIES),a=!!(e&&e.IS_RECORD),o=!!(e&&e.IS_ITERATOR),s=!!(e&&e.INTERRUPTED),u=xd(t,r),h,l,g,f,c,d,p,m=function(b){return h&&ds(h,"normal",b),new lr(!0,b)},y=function(b){return n?(wd(b),s?u(b[0],b[1],m):u(b[0],b[1])):s?u(b,m):u(b)};if(a)h=i.iterator;else if(o)h=i;else{if(l=Cd(i),!l)throw new Ed(Sd(i)+" is not iterable");if(Td(l)){for(g=0,f=Od(i);f>g;g++)if(c=y(i[g]),c&&ps(ms,c))return c;return new lr(!1)}h=Ad(i,l)}for(d=a?i.next:h.next;!(p=bd(d,h)).done;){try{c=y(p.value)}catch(b){ds(h,"throw",b)}if(typeof c=="object"&&c&&ps(ms,c))return c}return new lr(!1)},Pd=X,Bu=Pd("iterator"),zu=!1;try{var Md=0,ys={next:function(){return{done:!!Md++}},return:function(){zu=!0}};ys[Bu]=function(){return this},Array.from(ys,function(){throw 2})}catch{}var Nd=function(i,t){try{if(!t&&!zu)return!1}catch{return!1}var e=!1;try{var r={};r[Bu]=function(){return{next:function(){return{done:e=!0}}}},i(r)}catch{}return e},Vd=Vr,Rd=Nd,Id=Ie.CONSTRUCTOR,Hu=Id||!Rd(function(i){Vd.all(i).then(void 0,function(){})}),kd=tt,_d=W,Ld=St,Dd=ce,jd=Un,Fd=Uu,Ud=Hu;kd({target:"Promise",stat:!0,forced:Ud},{all:function(i){var t=this,e=Dd.f(t),r=e.resolve,n=e.reject,a=jd(function(){var o=Ld(t.resolve),s=[],u=0,h=1;Fd(i,function(l){var g=u++,f=!1;h++,_d(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 Bd=tt,zd=Ie.CONSTRUCTOR,on=Vr,Hd=zt,Xd=_,Yd=Ht,vs=on&&on.prototype;Bd({target:"Promise",proto:!0,forced:zd,real:!0},{catch:function(i){return this.then(void 0,i)}});if(Xd(on)){var xs=Hd("Promise").prototype.catch;vs.catch!==xs&&Yd(vs,"catch",xs,{unsafe:!0})}var Wd=tt,qd=W,Gd=St,Qd=ce,$d=Un,Zd=Uu,Kd=Hu;Wd({target:"Promise",stat:!0,forced:Kd},{race:function(i){var t=this,e=Qd.f(t),r=e.reject,n=$d(function(){var a=Gd(t.resolve);Zd(i,function(o){qd(a,t,o).then(e.resolve,r)})});return n.error&&r(n.value),e.promise}});var Jd=tt,tm=W,em=ce,rm=Ie.CONSTRUCTOR;Jd({target:"Promise",stat:!0,forced:rm},{reject:function(i){var t=em.f(this);return tm(t.reject,void 0,i),t.promise}});var im=Z,nm=wt,am=ce,sm=function(i,t){if(im(i),nm(t)&&t.constructor===i)return t;var e=am.f(i),r=e.resolve;return r(t),e.promise},om=tt,um=zt,hm=Ie.CONSTRUCTOR,lm=sm;um("Promise");om({target:"Promise",stat:!0,forced:hm},{resolve:function(i){return lm(this,i)}});function bs(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){bs(a,r,n,o,s,"next",u)}function s(u){bs(a,r,n,o,s,"throw",u)}o(void 0)})}}var cm=_n,gm=String,mt=function(i){if(cm(i)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return gm(i)},fm=Z,Xu=function(){var i=fm(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},Yn=D,pm=z,Wn=pm.RegExp,qn=Yn(function(){var i=Wn("a","y");return i.lastIndex=2,i.exec("abcd")!==null}),dm=qn||Yn(function(){return!Wn("a","y").sticky}),mm=qn||Yn(function(){var i=Wn("^r","gy");return i.lastIndex=2,i.exec("str")!==null}),Yu={BROKEN_CARET:mm,MISSED_STICKY:dm,UNSUPPORTED_Y:qn},Wu={},ym=uu,vm=kn,xm=Object.keys||function(i){return ym(i,vm)},bm=ft,wm=Jo,Sm=dt,Tm=Z,Om=Pe,Am=xm;Wu.f=bm&&!wm?Object.defineProperties:function(i,t){Tm(i);for(var e=Om(t),r=Am(t),n=r.length,a=0,o;n>a;)Sm.f(i,o=r[a++],e[o]);return i};var Cm=Z,Em=Wu,ws=kn,Pm=Rn,Mm=xu,Nm=Ar,Vm=Vn,Ss=">",Ts="<",un="prototype",hn="script",qu=Vm("IE_PROTO"),Ai=function(){},Gu=function(i){return Ts+hn+Ss+i+Ts+"/"+hn+Ss},Os=function(i){i.write(Gu("")),i.close();var t=i.parentWindow.Object;return i=null,t},Rm=function(){var i=Nm("iframe"),t="java"+hn+":",e;return i.style.display="none",Mm.appendChild(i),i.src=String(t),e=i.contentWindow.document,e.open(),e.write(Gu("document.F=Object")),e.close(),e.F},tr,cr=function(){try{tr=new ActiveXObject("htmlfile")}catch{}cr=typeof document<"u"?document.domain&&tr?Os(tr):Rm():Os(tr);for(var i=ws.length;i--;)delete cr[un][ws[i]];return cr()};Pm[qu]=!0;var Gn=Object.create||function(i,t){var e;return i!==null?(Ai[un]=Cm(i),e=new Ai,Ai[un]=null,e[qu]=i):e=cr(),t===void 0?e:Em.f(e,t)},Im=D,km=z,_m=km.RegExp,Lm=Im(function(){var i=_m(".","s");return!(i.dotAll&&i.test(`
- `)&&i.flags==="s")}),Dm=D,jm=z,Fm=jm.RegExp,Um=Dm(function(){var i=Fm("(?<a>b)","g");return i.exec("b").groups.a!=="b"||"b".replace(i,"$<a>c")!=="bc"}),re=W,Ir=j,Bm=mt,zm=Xu,Hm=Yu,Xm=En,Ym=Gn,Wm=Er.get,qm=Lm,Gm=Um,Qm=Xm("native-string-replace",String.prototype.replace),vr=RegExp.prototype.exec,ln=vr,$m=Ir("".charAt),Zm=Ir("".indexOf),Km=Ir("".replace),Ci=Ir("".slice),cn=function(){var i=/a/,t=/b*/g;return re(vr,i,"a"),re(vr,t,"a"),i.lastIndex!==0||t.lastIndex!==0}(),Qu=Hm.BROKEN_CARET,gn=/()??/.exec("")[1]!==void 0,Jm=cn||gn||Qu||qm||Gm;Jm&&(ln=function(i){var t=this,e=Wm(t),r=Bm(i),n=e.raw,a,o,s,u,h,l,g;if(n)return n.lastIndex=t.lastIndex,a=re(ln,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=Km(d,"y",""),Zm(d,"g")===-1&&(d+="g"),y=Ci(r,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&$m(r,t.lastIndex-1)!==`
- `)&&(p="(?: "+p+")",y=" "+y,m++),o=new RegExp("^(?:"+p+")",d)),gn&&(o=new RegExp("^"+p+"$(?!\\s)",d)),cn&&(s=t.lastIndex),u=re(vr,c?o:t,y),c?u?(u.input=Ci(u.input,m),u[0]=Ci(u[0],m),u.index=t.lastIndex,t.lastIndex+=u[0].length):t.lastIndex=0:cn&&u&&(t.lastIndex=t.global?u.index+u[0].length:s),gn&&u&&u.length>1&&re(Qm,u[0],o,function(){for(h=1;h<arguments.length-2;h++)arguments[h]===void 0&&(u[h]=void 0)}),u&&f)for(u.groups=l=Ym(null),h=0;h<f.length;h++)g=f[h],l[g[0]]=u[g[1]];return u});var kr=ln,t0=tt,As=kr;t0({target:"RegExp",proto:!0,forced:/./.exec!==As},{exec:As});var Cs=Re,Es=Ht,e0=kr,Ps=D,$u=X,r0=Me,i0=$u("species"),Ei=RegExp.prototype,Qn=function(i,t,e,r){var n=$u(i),a=!Ps(function(){var h={};return h[n]=function(){return 7},""[i](h)!==7}),o=a&&!Ps(function(){var h=!1,l=/a/;return i==="split"&&(l={},l.constructor={},l.constructor[i0]=function(){return l},l.flags="",l[n]=/./[n]),l.exec=function(){return h=!0,null},l[n](""),!h});if(!a||!o||e){var s=Cs(/./[n]),u=t(n,""[i],function(h,l,g,f,c){var d=Cs(h),p=l.exec;return p===e0||p===Ei.exec?a&&!c?{done:!0,value:s(l,g,f)}:{done:!0,value:d(g,l,f)}:{done:!1}});Es(String.prototype,i,u[0]),Es(Ei,n,u[1])}r&&r0(Ei[n],"sham",!0)},$n=j,n0=Pr,a0=mt,s0=pt,o0=$n("".charAt),Ms=$n("".charCodeAt),u0=$n("".slice),Ns=function(i){return function(t,e){var r=a0(s0(t)),n=n0(e),a=r.length,o,s;return n<0||n>=a?i?"":void 0:(o=Ms(r,n),o<55296||o>56319||n+1===a||(s=Ms(r,n+1))<56320||s>57343?i?o0(r,n):o:i?u0(r,n,n+2):(o-55296<<10)+(s-56320)+65536)}},h0={codeAt:Ns(!1),charAt:Ns(!0)},l0=h0.charAt,Zn=function(i,t,e){return t+(e?l0(i,t).length:1)},Vs=W,c0=Z,g0=_,f0=Ut,p0=kr,d0=TypeError,Kn=function(i,t){var e=i.exec;if(g0(e)){var r=Vs(e,i,t);return r!==null&&c0(r),r}if(f0(i)==="RegExp")return Vs(p0,i,t);throw new d0("RegExp#exec called on incompatible receiver")},m0=W,y0=Qn,v0=Z,x0=Bt,b0=le,Pi=mt,w0=pt,S0=he,T0=Zn,Rs=Kn;y0("match",function(i,t,e){return[function(r){var n=w0(this),a=x0(r)?void 0:S0(r,i);return a?m0(a,r,n):new RegExp(r)[i](Pi(n))},function(r){var n=v0(this),a=Pi(r),o=e(t,n,a);if(o.done)return o.value;if(!n.global)return Rs(n,a);var s=n.unicode;n.lastIndex=0;for(var u=[],h=0,l;(l=Rs(n,a))!==null;){var g=Pi(l[0]);u[h]=g,g===""&&(n.lastIndex=T0(a,b0(n.lastIndex),s)),h++}return h===0?null:u}]});var Jn=j,O0=Or,A0=Math.floor,Mi=Jn("".charAt),C0=Jn("".replace),Ni=Jn("".slice),E0=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,P0=/\$([$&'`]|\d{1,2})/g,M0=function(i,t,e,r,n,a){var o=e+i.length,s=r.length,u=P0;return n!==void 0&&(n=O0(n),u=E0),C0(a,u,function(h,l){var g;switch(Mi(l,0)){case"$":return"$";case"&":return i;case"`":return Ni(t,0,e);case"'":return Ni(t,o);case"<":g=n[Ni(l,1,-1)];break;default:var f=+l;if(f===0)return h;if(f>s){var c=A0(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})},N0=Dn,Is=W,_r=j,V0=Qn,R0=D,I0=Z,k0=_,_0=Bt,L0=Pr,D0=le,Qt=mt,j0=pt,F0=Zn,U0=he,B0=M0,z0=Kn,H0=X,fn=H0("replace"),X0=Math.max,Y0=Math.min,W0=_r([].concat),Vi=_r([].push),ks=_r("".indexOf),_s=_r("".slice),q0=function(i){return i===void 0?i:String(i)},G0=function(){return"a".replace(/./,"$0")==="$0"}(),Ls=function(){return/./[fn]?/./[fn]("a","$0")==="":!1}(),Q0=!R0(function(){var i=/./;return i.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(i,"$<a>")!=="7"});V0("replace",function(i,t,e){var r=Ls?"$":"$0";return[function(n,a){var o=j0(this),s=_0(n)?void 0:U0(n,fn);return s?Is(s,n,o,a):Is(t,Qt(o),n,a)},function(n,a){var o=I0(this),s=Qt(n);if(typeof a=="string"&&ks(a,r)===-1&&ks(a,"$<")===-1){var u=e(t,o,s,a);if(u.done)return u.value}var h=k0(a);h||(a=Qt(a));var l=o.global,g;l&&(g=o.unicode,o.lastIndex=0);for(var f=[],c;c=z0(o,s),!(c===null||(Vi(f,c),!l));){var d=Qt(c[0]);d===""&&(o.lastIndex=F0(s,D0(o.lastIndex),g))}for(var p="",m=0,y=0;y<f.length;y++){c=f[y];for(var b=Qt(c[0]),x=X0(Y0(L0(c.index),s.length),0),w=[],A,O=1;O<c.length;O++)Vi(w,q0(c[O]));var S=c.groups;if(h){var E=W0([b],w,x,s);S!==void 0&&Vi(E,S),A=Qt(N0(a,void 0,E))}else A=B0(b,s,x,w,S,a);x>=m&&(p+=_s(s,m,x)+A,m=x+b.length)}return p+_s(s,m)}]},!Q0||!G0||Ls);var $0=wt,Z0=Ut,K0=X,J0=K0("match"),Zu=function(i){var t;return $0(i)&&((t=i[J0])!==void 0?!!t:Z0(i)==="RegExp")},ty=Zu,ey=TypeError,ta=function(i){if(ty(i))throw new ey("The method doesn't accept regular expressions");return i},ry=X,iy=ry("match"),ea=function(i){var t=/./;try{"/./"[i](t)}catch{try{return t[iy]=!1,"/./"[i](t)}catch{}}return!1},ny=tt,Ku=Re,ay=ue.f,sy=le,Ds=mt,oy=ta,uy=pt,hy=ea,js=Ku("".startsWith),ly=Ku("".slice),cy=Math.min,Ju=hy("startsWith"),gy=!Ju&&!!function(){var i=ay(String.prototype,"startsWith");return i&&!i.writable}();ny({target:"String",proto:!0,forced:!gy&&!Ju},{startsWith:function(i){var t=Ds(uy(this));oy(i);var e=sy(cy(arguments.length>1?arguments[1]:void 0,t.length)),r=Ds(i);return js?js(t,r,e):ly(t,e,e+r.length)===r}});var fy=X,py=Gn,dy=dt.f,pn=fy("unscopables"),dn=Array.prototype;dn[pn]===void 0&&dy(dn,pn,{configurable:!0,value:py(null)});var my=function(i){dn[pn][i]=!0},yy=D,vy=!yy(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype}),xy=ht,by=_,wy=Or,Sy=Vn,Ty=vy,Fs=Sy("IE_PROTO"),mn=Object,Oy=mn.prototype,th=Ty?mn.getPrototypeOf:function(i){var t=wy(i);if(xy(t,Fs))return t[Fs];var e=t.constructor;return by(e)&&t instanceof e?e.prototype:t instanceof mn?Oy:null},Ay=D,Cy=_,Ey=wt,Us=th,Py=Ht,My=X,yn=My("iterator"),eh=!1,jt,Ri,Ii;[].keys&&(Ii=[].keys(),"next"in Ii?(Ri=Us(Us(Ii)),Ri!==Object.prototype&&(jt=Ri)):eh=!0);var Ny=!Ey(jt)||Ay(function(){var i={};return jt[yn].call(i)!==i});Ny&&(jt={});Cy(jt[yn])||Py(jt,yn,function(){return this});var rh={IteratorPrototype:jt,BUGGY_SAFARI_ITERATORS:eh},Vy=rh.IteratorPrototype,Ry=Gn,Iy=br,ky=Nr,_y=ke,Ly=function(){return this},Dy=function(i,t,e,r){var n=t+" Iterator";return i.prototype=Ry(Vy,{next:Iy(+!r,e)}),ky(i,n,!1),_y[n]=Ly,i},jy=tt,Fy=W,ih=Cr,Uy=_,By=Dy,Bs=th,zs=cu,zy=Nr,Hy=Me,ki=Ht,Xy=X,Yy=ke,nh=rh,Wy=ih.PROPER,qy=ih.CONFIGURABLE,Hs=nh.IteratorPrototype,er=nh.BUGGY_SAFARI_ITERATORS,de=Xy("iterator"),Xs="keys",me="values",Ys="entries",Gy=function(){return this},Qy=function(i,t,e,r,n,a,o){By(e,t,r);var s=function(y){if(y===n&&f)return f;if(!er&&y&&y in l)return l[y];switch(y){case Xs:return function(){return new e(this,y)};case me:return function(){return new e(this,y)};case Ys:return function(){return new e(this,y)}}return function(){return new e(this)}},u=t+" Iterator",h=!1,l=i.prototype,g=l[de]||l["@@iterator"]||n&&l[n],f=!er&&g||s(n),c=t==="Array"&&l.entries||g,d,p,m;if(c&&(d=Bs(c.call(new i)),d!==Object.prototype&&d.next&&(Bs(d)!==Hs&&(zs?zs(d,Hs):Uy(d[de])||ki(d,de,Gy)),zy(d,u,!0))),Wy&&n===me&&g&&g.name!==me&&(qy?Hy(l,"name",me):(h=!0,f=function(){return Fy(g,this)})),n)if(p={values:s(me),keys:a?f:s(Xs),entries:s(Ys)},o)for(m in p)(er||h||!(m in l))&&ki(l,m,p[m]);else jy({target:t,proto:!0,forced:er||h},p);return l[de]!==f&&ki(l,de,f,{name:n}),Yy[t]=f,p},$y=function(i,t){return{value:i,done:t}},Zy=Pe,ra=my,Ws=ke,ah=Er,Ky=dt.f,Jy=Qy,rr=$y,tv=ft,sh="Array Iterator",ev=ah.set,rv=ah.getterFor(sh),iv=Jy(Array,"Array",function(i,t){ev(this,{type:sh,target:Zy(i),index:0,kind:t})},function(){var i=rv(this),t=i.target,e=i.index++;if(!t||e>=t.length)return i.target=void 0,rr(void 0,!0);switch(i.kind){case"keys":return rr(e,!1);case"values":return rr(t[e],!1)}return rr([e,t[e]],!1)},"values"),qs=Ws.Arguments=Ws.Array;ra("keys");ra("values");ra("entries");if(tv&&qs.name!=="values")try{Ky(qs,"name",{value:"values"})}catch{}var nv={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},av=Ar,_i=av("span").classList,Gs=_i&&_i.constructor&&_i.constructor.prototype,sv=Gs===Object.prototype?void 0:Gs,Qs=z,oh=nv,ov=sv,be=iv,$s=Me,uv=Nr,hv=X,Li=hv("iterator"),Di=be.values,uh=function(i,t){if(i){if(i[Li]!==Di)try{$s(i,Li,Di)}catch{i[Li]=Di}if(uv(i,t,!0),oh[t]){for(var e in be)if(i[e]!==be[e])try{$s(i,e,be[e])}catch{i[e]=be[e]}}}};for(var ji in oh)uh(Qs[ji]&&Qs[ji].prototype,ji);uh(ov,"DOMTokenList");function lv(i,t){if(Yi(i)!=="object"||i===null)return i;var e=i[Symbol.toPrimitive];if(e!==void 0){var r=e.call(i,t||"default");if(Yi(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function cv(i){var t=lv(i,"string");return Yi(t)==="symbol"?t:String(t)}function ia(i,t,e){return t=cv(t),t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var gv=St,fv=Or,pv=zo,dv=Mr,mv=TypeError,Zs=function(i){return function(t,e,r,n){var a=fv(t),o=pv(a),s=dv(a);gv(e);var 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 new mv("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}},yv={left:Zs(!1),right:Zs(!0)},vv=D,hh=function(i,t){var e=[][i];return!!e&&vv(function(){e.call(null,t||function(){return 1},1)})},xv=tt,bv=yv.left,wv=hh,Ks=On,Sv=Ve,Tv=!Sv&&Ks>79&&Ks<83,Ov=Tv||!wv("reduce");xv({target:"Array",proto:!0,forced:Ov},{reduce:function(i){var t=arguments.length;return bv(this,i,t,t>1?arguments[1]:void 0)}});var Av=tt,lh=Re,Cv=ue.f,Ev=le,Js=mt,Pv=ta,Mv=pt,Nv=ea,to=lh("".endsWith),Vv=lh("".slice),Rv=Math.min,ch=Nv("endsWith"),Iv=!ch&&!!function(){var i=Cv(String.prototype,"endsWith");return i&&!i.writable}();Av({target:"String",proto:!0,forced:!Iv&&!ch},{endsWith:function(i){var t=Js(Mv(this));Pv(i);var e=arguments.length>1?arguments[1]:void 0,r=t.length,n=e===void 0?r:Rv(Ev(e),r),a=Js(i);return to?to(t,a,n):Vv(t,n-a.length,n)===a}});var kv=Pn,_v=dt,Lv=br,Dv=function(i,t,e){var r=kv(t);r in i?_v.f(i,r,Lv(0,e)):i[r]=e},eo=su,jv=Mr,Fv=Dv,Uv=Array,Bv=Math.max,zv=function(i,t,e){for(var r=jv(i),n=eo(t,r),a=eo(e===void 0?r:e,r),o=Uv(Bv(a-n,0)),s=0;n<a;n++,s++)Fv(o,s,i[n]);return o.length=s,o},Hv=Dn,ye=W,na=j,Xv=Qn,Yv=Z,Wv=Bt,qv=Zu,ro=pt,Gv=yu,Qv=Zn,$v=le,Fi=mt,Zv=he,io=zv,no=Kn,Kv=kr,Jv=Yu,tx=D,$t=Jv.UNSUPPORTED_Y,ao=4294967295,ex=Math.min,gh=[].push,rx=na(/./.exec),Zt=na(gh),ve=na("".slice),ix=!tx(function(){var i=/(?:)/,t=i.exec;i.exec=function(){return t.apply(this,arguments)};var e="ab".split(i);return e.length!==2||e[0]!=="a"||e[1]!=="b"});Xv("split",function(i,t,e){var r;return"abbc".split(/(b)*/)[1]==="c"||"test".split(/(?:)/,-1).length!==4||"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||".".split(/()()/).length>1||"".split(/.?/).length?r=function(n,a){var o=Fi(ro(this)),s=a===void 0?ao:a>>>0;if(s===0)return[];if(n===void 0)return[o];if(!qv(n))return ye(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=ye(Kv,g,o))&&(c=g.lastIndex,!(c>l&&(Zt(u,ve(o,l,f.index)),f.length>1&&f.index<o.length&&Hv(gh,u,io(f,1)),d=f[0].length,l=c,u.length>=s)));)g.lastIndex===f.index&&g.lastIndex++;return l===o.length?(d||!rx(g,""))&&Zt(u,""):Zt(u,ve(o,l)),u.length>s?io(u,0,s):u}:"0".split(void 0,0).length?r=function(n,a){return n===void 0&&a===0?[]:ye(t,this,n,a)}:r=t,[function(n,a){var o=ro(this),s=Wv(n)?void 0:Zv(n,i);return s?ye(s,n,o,a):ye(r,Fi(o),n,a)},function(n,a){var o=Yv(this),s=Fi(n),u=e(r,o,s,a,r!==t);if(u.done)return u.value;var h=Gv(o,RegExp),l=o.unicode,g=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+($t?"g":"y"),f=new h($t?"^(?:"+o.source+")":o,g),c=a===void 0?ao:a>>>0;if(c===0)return[];if(s.length===0)return no(f,s)===null?[s]:[];for(var d=0,p=0,m=[];p<s.length;){f.lastIndex=$t?0:p;var y=no(f,$t?ve(s,p):s),b;if(y===null||(b=ex($v(f.lastIndex+($t?p:0)),s.length))===d)p=Qv(s,p,l);else{if(Zt(m,ve(s,d,p)),m.length===c)return m;for(var x=1;x<=y.length-1;x++)if(Zt(m,y[x]),m.length===c)return m;p=d=b}}return Zt(m,ve(s,d)),m}]},!ix,$t);var Lr={exports:{}},we={exports:{}};(function(){var i,t,e,r,n,a;typeof performance<"u"&&performance!==null&&performance.now?we.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(we.exports=function(){return(i()-n)/1e6},t=process.hrtime,i=function(){var o;return o=t(),o[0]*1e9+o[1]},r=i(),a=process.uptime()*1e9,n=r-a):Date.now?(we.exports=function(){return Date.now()-e},e=Date.now()):(we.exports=function(){return new Date().getTime()-e},e=new Date().getTime())}).call(Jt);var nx=we.exports,ax=nx,xt=typeof window>"u"?Jt:window,ir=["moz","webkit"],ne="AnimationFrame",oe=xt["request"+ne],Ee=xt["cancel"+ne]||xt["cancelRequest"+ne];for(var xe=0;!oe&&xe<ir.length;xe++)oe=xt[ir[xe]+"Request"+ne],Ee=xt[ir[xe]+"Cancel"+ne]||xt[ir[xe]+"CancelRequest"+ne];if(!oe||!Ee){var Ui=0,so=0,It=[],sx=1e3/60;oe=function(i){if(It.length===0){var t=ax(),e=Math.max(0,sx-(t-Ui));Ui=e+t,setTimeout(function(){var r=It.slice(0);It.length=0;for(var n=0;n<r.length;n++)if(!r[n].cancelled)try{r[n].callback(Ui)}catch(a){setTimeout(function(){throw a},0)}},Math.round(e))}return It.push({handle:++so,callback:i,cancelled:!1}),so},Ee=function(i){for(var t=0;t<It.length;t++)It[t].handle===i&&(It[t].cancelled=!0)}}Lr.exports=function(i){return oe.call(xt,i)};Lr.exports.cancel=function(){Ee.apply(xt,arguments)};Lr.exports.polyfill=function(i){i||(i=xt),i.requestAnimationFrame=oe,i.cancelAnimationFrame=Ee};var ox=Lr.exports;const Bi=_o(ox);var fh=`
- \v\f\r \u2028\u2029\uFEFF`,ux=j,hx=pt,lx=mt,vn=fh,oo=ux("".replace),cx=RegExp("^["+vn+"]+"),gx=RegExp("(^|[^"+vn+"])["+vn+"]+$"),zi=function(i){return function(t){var e=lx(hx(t));return i&1&&(e=oo(e,cx,"")),i&2&&(e=oo(e,gx,"$1")),e}},fx={start:zi(1),end:zi(2),trim:zi(3)},px=Cr.PROPER,dx=D,uo=fh,ho="
",mx=function(i){return dx(function(){return!!uo[i]()||ho[i]()!==ho||px&&uo[i].name!==i})},yx=tt,vx=fx.trim,xx=mx;yx({target:"String",proto:!0,forced:xx("trim")},{trim:function(){return vx(this)}});var bx=function(i){this.ok=!1,this.alpha=1,i.charAt(0)=="#"&&(i=i.substr(1,6)),i=i.replace(/ /g,""),i=i.toLowerCase();var t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};i=t[i]||i;for(var e=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(u){return[parseInt(u[1]),parseInt(u[2]),parseInt(u[3]),parseFloat(u[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(u){return[parseInt(u[1]),parseInt(u[2]),parseInt(u[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(u){return[parseInt(u[1],16),parseInt(u[2],16),parseInt(u[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(u){return[parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16),parseInt(u[3]+u[3],16)]}}],r=0;r<e.length;r++){var n=e[r].re,a=e[r].process,o=n.exec(i);if(o){var s=a(o);this.r=s[0],this.g=s[1],this.b=s[2],s.length>3&&(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<e.length;h++)for(var l=e[h].example,g=0;g<l.length;g++)u[u.length]=l[g];for(var f in t)u[u.length]=f;var c=document.createElement("ul");c.setAttribute("id","rgbcolor-examples");for(var h=0;h<u.length;h++)try{var d=document.createElement("li"),p=new RGBColor(u[h]),m=document.createElement("div");m.style.cssText="margin: 3px; border: 1px solid black; background:"+p.toHex()+"; color:"+p.toHex(),m.appendChild(document.createTextNode("test"));var y=document.createTextNode(" "+u[h]+" -> "+p.toRGB()+" -> "+p.toHex());d.appendChild(m),d.appendChild(y),c.appendChild(d)}catch{}return c}};const xn=_o(bx);var wx=tt,Sx=Re,Tx=ou.indexOf,Ox=hh,bn=Sx([].indexOf),ph=!!bn&&1/bn([1],1,-0)<0,Ax=ph||!Ox("indexOf");wx({target:"Array",proto:!0,forced:Ax},{indexOf:function(i){var t=arguments.length>1?arguments[1]:void 0;return ph?bn(this,i,t)||0:Tx(this,i,t)}});var Cx=tt,Ex=j,Px=ta,Mx=pt,lo=mt,Nx=ea,Vx=Ex("".indexOf);Cx({target:"String",proto:!0,forced:!Nx("includes")},{includes:function(i){return!!~Vx(lo(Mx(this)),lo(Px(i)),arguments.length>1?arguments[1]:void 0)}});var Rx=Ut,Ix=Array.isArray||function(i){return Rx(i)==="Array"},kx=tt,_x=j,Lx=Ix,Dx=_x([].reverse),co=[1,2];kx({target:"Array",proto:!0,forced:String(co)===String(co.reverse())},{reverse:function(){return Lx(this)&&(this.length=this.length),Dx(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 dh=function(i,t){return(dh=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 mh(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}dh(i,t),i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function jx(i){var t="";Array.isArray(i)||(i=[i]);for(var e=0;e<i.length;e++){var r=i[e];if(r.type===v.CLOSE_PATH)t+="z";else if(r.type===v.HORIZ_LINE_TO)t+=(r.relative?"h":"H")+r.x;else if(r.type===v.VERT_LINE_TO)t+=(r.relative?"v":"V")+r.y;else if(r.type===v.MOVE_TO)t+=(r.relative?"m":"M")+r.x+" "+r.y;else if(r.type===v.LINE_TO)t+=(r.relative?"l":"L")+r.x+" "+r.y;else if(r.type===v.CURVE_TO)t+=(r.relative?"c":"C")+r.x1+" "+r.y1+" "+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===v.SMOOTH_CURVE_TO)t+=(r.relative?"s":"S")+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===v.QUAD_TO)t+=(r.relative?"q":"Q")+r.x1+" "+r.y1+" "+r.x+" "+r.y;else if(r.type===v.SMOOTH_QUAD_TO)t+=(r.relative?"t":"T")+r.x+" "+r.y;else{if(r.type!==v.ARC)throw new Error('Unexpected command type "'+r.type+'" at index '+e+".");t+=(r.relative?"a":"A")+r.rX+" "+r.rY+" "+r.xRot+" "+ +r.lArcFlag+" "+ +r.sweepFlag+" "+r.x+" "+r.y}}return t}function wn(i,t){var e=i[0],r=i[1];return[e*Math.cos(t)-r*Math.sin(t),e*Math.sin(t)+r*Math.cos(t)]}function ot(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];for(var e=0;e<i.length;e++)if(typeof i[e]!="number")throw new Error("assertNumbers arguments["+e+"] is not a number. "+typeof i[e]+" == typeof "+i[e]);return!0}var Ot=Math.PI;function Hi(i,t,e){i.lArcFlag=i.lArcFlag===0?0:1,i.sweepFlag=i.sweepFlag===0?0:1;var r=i.rX,n=i.rY,a=i.x,o=i.y;r=Math.abs(i.rX),n=Math.abs(i.rY);var s=wn([(t-a)/2,(e-o)/2],-i.xRot/180*Ot),u=s[0],h=s[1],l=Math.pow(u,2)/Math.pow(r,2)+Math.pow(h,2)/Math.pow(n,2);1<l&&(r*=Math.sqrt(l),n*=Math.sqrt(l)),i.rX=r,i.rY=n;var g=Math.pow(r,2)*Math.pow(h,2)+Math.pow(n,2)*Math.pow(u,2),f=(i.lArcFlag!==i.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(n,2)-g)/g)),c=r*h/n*f,d=-n*u/r*f,p=wn([c,d],i.xRot/180*Ot);i.cX=p[0]+(t+a)/2,i.cY=p[1]+(e+o)/2,i.phi1=Math.atan2((h-d)/n,(u-c)/r),i.phi2=Math.atan2((-h-d)/n,(-u-c)/r),i.sweepFlag===0&&i.phi2>i.phi1&&(i.phi2-=2*Ot),i.sweepFlag===1&&i.phi2<i.phi1&&(i.phi2+=2*Ot),i.phi1*=180/Ot,i.phi2*=180/Ot}function go(i,t,e){ot(i,t,e);var r=i*i+t*t-e*e;if(0>r)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 fo(i,t,e){return(1-e)*i+e*t}function po(i,t,e,r){return i+Math.cos(r/180*Ot)*t+Math.sin(r/180*Ot)*e}function mo(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)<n?[-h/u]:function(l,g,f){f===void 0&&(f=1e-6);var c=l*l/4-g;if(c<-f)return[];if(c<=f)return[-l/2];var d=Math.sqrt(c);return[-l/2-d,-l/2+d]}(u/s,h/s,n)}function yo(i,t,e,r,n){var a=1-n;return i*(a*a*a)+t*(3*a*a*n)+e*(3*a*n*n)+r*(n*n*n)}(function(i){function t(){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=!1),s})}function e(){var s=NaN,u=NaN,h=NaN,l=NaN;return n(function(g,f,c){return g.type&v.SMOOTH_CURVE_TO&&(g.type=v.CURVE_TO,s=isNaN(s)?f:s,u=isNaN(u)?c:u,g.x1=g.relative?f-s:2*f-s,g.y1=g.relative?c-u:2*c-u),g.type&v.CURVE_TO?(s=g.relative?f+g.x2:g.x2,u=g.relative?c+g.y2:g.y2):(s=NaN,u=NaN),g.type&v.SMOOTH_QUAD_TO&&(g.type=v.QUAD_TO,h=isNaN(h)?f:h,l=isNaN(l)?c:l,g.x1=g.relative?f-h:2*f-h,g.y1=g.relative?c-l:2*c-l),g.type&v.QUAD_TO?(h=g.relative?f+g.x1:g.x1,l=g.relative?c+g.y1:g.y1):(h=NaN,l=NaN),g})}function r(){var s=NaN,u=NaN;return n(function(h,l,g){if(h.type&v.SMOOTH_QUAD_TO&&(h.type=v.QUAD_TO,s=isNaN(s)?l:s,u=isNaN(u)?g:u,h.x1=h.relative?l-s:2*l-s,h.y1=h.relative?g-u:2*g-u),h.type&v.QUAD_TO){s=h.relative?l+h.x1:h.x1,u=h.relative?g+h.y1:h.y1;var f=h.x1,c=h.y1;h.type=v.CURVE_TO,h.x1=((h.relative?0:l)+2*f)/3,h.y1=((h.relative?0:g)+2*c)/3,h.x2=(h.x+2*f)/3,h.y2=(h.y+2*c)/3}else s=NaN,u=NaN;return h})}function n(s){var u=0,h=0,l=NaN,g=NaN;return function(f){if(isNaN(l)&&!(f.type&v.MOVE_TO))throw new Error("path must start with moveto");var c=s(f,u,h,l,g);return f.type&v.CLOSE_PATH&&(u=l,h=g),f.x!==void 0&&(u=f.relative?u+f.x:f.x),f.y!==void 0&&(h=f.relative?h+f.y:f.y),f.type&v.MOVE_TO&&(l=u,g=h),c}}function a(s,u,h,l,g,f){return ot(s,u,h,l,g,f),n(function(c,d,p,m){var y=c.x1,b=c.x2,x=c.relative&&!isNaN(m),w=c.x!==void 0?c.x:x?0:d,A=c.y!==void 0?c.y:x?0:p;function O(at){return at*at}c.type&v.HORIZ_LINE_TO&&u!==0&&(c.type=v.LINE_TO,c.y=c.relative?0:p),c.type&v.VERT_LINE_TO&&h!==0&&(c.type=v.LINE_TO,c.x=c.relative?0:d),c.x!==void 0&&(c.x=c.x*s+A*h+(x?0:g)),c.y!==void 0&&(c.y=w*u+c.y*l+(x?0:f)),c.x1!==void 0&&(c.x1=c.x1*s+c.y1*h+(x?0:g)),c.y1!==void 0&&(c.y1=y*u+c.y1*l+(x?0:f)),c.x2!==void 0&&(c.x2=c.x2*s+c.y2*h+(x?0:g)),c.y2!==void 0&&(c.y2=b*u+c.y2*l+(x?0:f));var S=s*l-u*h;if(c.xRot!==void 0&&(s!==1||u!==0||h!==0||l!==1))if(S===0)delete c.rX,delete c.rY,delete c.xRot,delete c.lArcFlag,delete c.sweepFlag,c.type=v.LINE_TO;else{var E=c.xRot*Math.PI/180,R=Math.sin(E),k=Math.cos(E),F=1/O(c.rX),M=1/O(c.rY),q=O(k)*F+O(R)*M,G=2*R*k*(F-M),H=O(R)*F+O(k)*M,Q=q*l*l-G*u*l+H*u*u,Y=G*(s*l+u*h)-2*(q*h*l+H*s*u),$=q*h*h-G*s*h+H*s*s,N=(Math.atan2(Y,Q-$)+Math.PI)%Math.PI/2,I=Math.sin(N),K=Math.cos(N);c.rX=Math.abs(S)/Math.sqrt(Q*O(K)+Y*I*K+$*O(I)),c.rY=Math.abs(S)/Math.sqrt(Q*O(I)-Y*I*K+$*O(K)),c.xRot=180*N/Math.PI}return c.sweepFlag!==void 0&&0>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||Hi(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;S<x;S++){var E=fo(l.phi1,l.phi2,S/x),R=fo(l.phi1,l.phi2,(S+1)/x),k=R-E,F=4/3*Math.tan(k*yt/4),M=[Math.cos(E*yt)-F*Math.sin(E*yt),Math.sin(E*yt)+F*Math.cos(E*yt)],q=M[0],G=M[1],H=[Math.cos(R*yt),Math.sin(R*yt)],Q=H[0],Y=H[1],$=[Q+F*Math.sin(R*yt),Y-F*Math.cos(R*yt)],N=$[0],I=$[1];w[S]={relative:l.relative,type:v.CURVE_TO};var K=function(at,ct){var Tt=wn([at*l.rX,ct*l.rY],l.xRot),Yt=Tt[0],Le=Tt[1];return[l.cX+Yt,l.cY+Le]};c=K(q,G),w[S].x1=c[0],w[S].y1=c[1],d=K(N,I),w[S].x2=d[0],w[S].y2=d[1],p=K(Q,Y),w[S].x=p[0],w[S].y=p[1],l.relative&&(w[S].x1-=A,w[S].y1-=O,w[S].x2-=A,w[S].y2-=O,w[S].x-=A,w[S].y-=O),A=(m=[w[S].x,w[S].y])[0],O=m[1]}return w}(s,s.relative?0:u,s.relative?0:h):s})},i.ANNOTATE_ARCS=function(){return n(function(s,u,h){return s.relative&&(u=0,h=0),v.ARC===s.type&&Hi(s,u,h),s})},i.CLONE=o,i.CALCULATE_BOUNDS=function(){var s=function(f){var c={};for(var d in f)c[d]=f[d];return c},u=t(),h=r(),l=e(),g=n(function(f,c,d){var p=l(h(u(s(f))));function m(I){I>g.maxX&&(g.maxX=I),I<g.minX&&(g.minX=I)}function y(I){I>g.maxY&&(g.maxY=I),I<g.minY&&(g.minY=I)}if(p.type&v.DRAWING_COMMANDS&&(m(c),y(d)),p.type&v.HORIZ_LINE_TO&&m(p.x),p.type&v.VERT_LINE_TO&&y(p.y),p.type&v.LINE_TO&&(m(p.x),y(p.y)),p.type&v.CURVE_TO){m(p.x),y(p.y);for(var b=0,x=mo(c,p.x1,p.x2,p.x);b<x.length;b++)0<(N=x[b])&&1>N&&m(yo(c,p.x1,p.x2,p.x,N));for(var w=0,A=mo(d,p.y1,p.y2,p.y);w<A.length;w++)0<(N=A[w])&&1>N&&y(yo(d,p.y1,p.y2,p.y,N))}if(p.type&v.ARC){m(p.x),y(p.y),Hi(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,k=Math.cos(O)*p.rY,F=p.phi1<p.phi2?[p.phi1,p.phi2]:-180>p.phi2?[p.phi2+360,p.phi1+360]:[p.phi2,p.phi1],M=F[0],q=F[1],G=function(I){var K=I[0],at=I[1],ct=180*Math.atan2(at,K)/Math.PI;return ct<M?ct+360:ct},H=0,Q=go(R,-S,0).map(G);H<Q.length;H++)(N=Q[H])>M&&N<q&&m(po(p.cX,S,R,N));for(var Y=0,$=go(k,-E,0).map(G);Y<$.length;Y++){var N;(N=$[Y])>M&&N<q&&y(po(p.cY,E,k,N))}}return f});return g.minX=1/0,g.maxX=-1/0,g.minY=1/0,g.maxY=-1/0,g}})(B||(B={}));var st,yh=function(){function i(){}return i.prototype.round=function(t){return this.transform(B.ROUND(t))},i.prototype.toAbs=function(){return this.transform(B.TO_ABS())},i.prototype.toRel=function(){return this.transform(B.TO_REL())},i.prototype.normalizeHVZ=function(t,e,r){return this.transform(B.NORMALIZE_HVZ(t,e,r))},i.prototype.normalizeST=function(){return this.transform(B.NORMALIZE_ST())},i.prototype.qtToC=function(){return this.transform(B.QT_TO_C())},i.prototype.aToC=function(){return this.transform(B.A_TO_C())},i.prototype.sanitize=function(t){return this.transform(B.SANITIZE(t))},i.prototype.translate=function(t,e){return this.transform(B.TRANSLATE(t,e))},i.prototype.scale=function(t,e){return this.transform(B.SCALE(t,e))},i.prototype.rotate=function(t,e,r){return this.transform(B.ROTATE(t,e,r))},i.prototype.matrix=function(t,e,r,n,a,o){return this.transform(B.MATRIX(t,e,r,n,a,o))},i.prototype.skewX=function(t){return this.transform(B.SKEW_X(t))},i.prototype.skewY=function(t){return this.transform(B.SKEW_Y(t))},i.prototype.xSymmetry=function(t){return this.transform(B.X_AXIS_SYMMETRY(t))},i.prototype.ySymmetry=function(t){return this.transform(B.Y_AXIS_SYMMETRY(t))},i.prototype.annotateArcs=function(){return this.transform(B.ANNOTATE_ARCS())},i}(),Fx=function(i){return i===" "||i===" "||i==="\r"||i===`
- `},vo=function(i){return 48<=i.charCodeAt(0)&&i.charCodeAt(0)<=57},Ux=function(i){function t(){var e=i.call(this)||this;return e.curNumber="",e.curCommandType=-1,e.curCommandRelative=!1,e.canParseCommandOrComma=!0,e.curNumberHasExp=!1,e.curNumberHasExpDigits=!1,e.curNumberHasDecimal=!1,e.curArgs=[],e}return mh(t,i),t.prototype.finish=function(e){if(e===void 0&&(e=[]),this.parse(" ",e),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return e},t.prototype.parse=function(e,r){var n=this;r===void 0&&(r=[]);for(var a=function(g){r.push(g),n.curArgs.length=0,n.canParseCommandOrComma=!0},o=0;o<e.length;o++){var s=e[o],u=!(this.curCommandType!==v.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),h=vo(s)&&(this.curNumber==="0"&&s==="0"||u);if(!vo(s)||h)if(s!=="e"&&s!=="E")if(s!=="-"&&s!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(s!=="."||this.curNumberHasExp||this.curNumberHasDecimal||u){if(this.curNumber&&this.curCommandType!==-1){var l=Number(this.curNumber);if(isNaN(l))throw new SyntaxError("Invalid number ending at "+o);if(this.curCommandType===v.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>l)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===Bx[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(!Fx(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<o.length;a++){var s=o[a],u=e(s);Array.isArray(u)?n.push.apply(n,u):n.push(u)}return n}}})},t}(yh),v=function(i){function t(e){var r=i.call(this)||this;return r.commands=typeof e=="string"?t.parse(e):e,r}return mh(t,i),t.prototype.encode=function(){return t.encode(this.commands)},t.prototype.getBounds=function(){var e=B.CALCULATE_BOUNDS();return this.transform(e),e},t.prototype.transform=function(e){for(var r=[],n=0,a=this.commands;n<a.length;n++){var o=e(a[n]);Array.isArray(o)?r.push.apply(r,o):r.push(o)}return this.commands=r,this},t.encode=function(e){return jx(e)},t.parse=function(e){var r=new Ux,n=[];return r.parse(e,n),r.finish(n),n},t.CLOSE_PATH=1,t.MOVE_TO=2,t.HORIZ_LINE_TO=4,t.VERT_LINE_TO=8,t.LINE_TO=16,t.CURVE_TO=32,t.SMOOTH_CURVE_TO=64,t.QUAD_TO=128,t.SMOOTH_QUAD_TO=256,t.ARC=512,t.LINE_COMMANDS=t.LINE_TO|t.HORIZ_LINE_TO|t.VERT_LINE_TO,t.DRAWING_COMMANDS=t.HORIZ_LINE_TO|t.VERT_LINE_TO|t.LINE_TO|t.CURVE_TO|t.SMOOTH_CURVE_TO|t.QUAD_TO|t.SMOOTH_QUAD_TO|t.ARC,t}(yh),Bx=((st={})[v.MOVE_TO]=2,st[v.LINE_TO]=2,st[v.HORIZ_LINE_TO]=1,st[v.VERT_LINE_TO]=1,st[v.CLOSE_PATH]=0,st[v.QUAD_TO]=4,st[v.SMOOTH_QUAD_TO]=2,st[v.CURVE_TO]=6,st[v.SMOOTH_CURVE_TO]=4,st[v.ARC]=7,st),zx=W,Hx=ht,Xx=wr,Yx=Xu,xo=RegExp.prototype,Wx=function(i){var t=i.flags;return t===void 0&&!("flags"in xo)&&!Hx(i,"flags")&&Xx(xo,i)?zx(Yx,i):t},qx=Cr.PROPER,Gx=Ht,Qx=Z,bo=mt,$x=D,Zx=Wx,aa="toString",Kx=RegExp.prototype,vh=Kx[aa],Jx=$x(function(){return vh.call({source:"a",flags:"b"})!=="/a/b"}),t1=qx&&vh.name!==aa;(Jx||t1)&&Gx(RegExp.prototype,aa,function(){var i=Qx(this),t=bo(i.source),e=bo(Zx(i));return"/"+t+"/"+e},{unsafe:!0});function gr(i){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gr=function(t){return typeof t}:gr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gr(i)}function e1(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var r1=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],i1=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function n1(i,t,e,r,n){if(typeof i=="string"&&(i=document.getElementById(i)),!i||gr(i)!=="object"||!("getContext"in i))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var a=i.getContext("2d");try{return a.getImageData(t,e,r,n)}catch(o){throw new Error("unable to access image data: "+o)}}function a1(i,t,e,r,n,a){if(!(isNaN(a)||a<1)){a|=0;var o=n1(i,t,e,r,n);o=s1(o,t,e,r,n,a),i.getContext("2d").putImageData(o,t,e)}}function s1(i,t,e,r,n,a){for(var o=i.data,s=2*a+1,u=r-1,h=n-1,l=a+1,g=l*(l+1)/2,f=new wo,c=f,d,p=1;p<s;p++)c=c.next=new wo,p===l&&(d=c);c.next=f;for(var m=null,y=null,b=0,x=0,w=r1[a],A=i1[a],O=0;O<n;O++){c=f;for(var S=o[x],E=o[x+1],R=o[x+2],k=o[x+3],F=0;F<l;F++)c.r=S,c.g=E,c.b=R,c.a=k,c=c.next;for(var M=0,q=0,G=0,H=0,Q=l*S,Y=l*E,$=l*R,N=l*k,I=g*S,K=g*E,at=g*R,ct=g*k,Tt=1;Tt<l;Tt++){var Yt=x+((u<Tt?u:Tt)<<2),Le=o[Yt],ua=o[Yt+1],ha=o[Yt+2],la=o[Yt+3],De=l-Tt;I+=(c.r=Le)*De,K+=(c.g=ua)*De,at+=(c.b=ha)*De,ct+=(c.a=la)*De,M+=Le,q+=ua,G+=ha,H+=la,c=c.next}m=f,y=d;for(var Br=0;Br<r;Br++){var zr=ct*w>>A;if(o[x+3]=zr,zr!==0){var Hr=255/zr;o[x]=(I*w>>A)*Hr,o[x+1]=(K*w>>A)*Hr,o[x+2]=(at*w>>A)*Hr}else o[x]=o[x+1]=o[x+2]=0;I-=Q,K-=Y,at-=$,ct-=N,Q-=m.r,Y-=m.g,$-=m.b,N-=m.a;var Pt=Br+a+1;Pt=b+(Pt<u?Pt:u)<<2,M+=m.r=o[Pt],q+=m.g=o[Pt+1],G+=m.b=o[Pt+2],H+=m.a=o[Pt+3],I+=M,K+=q,at+=G,ct+=H,m=m.next;var je=y,ca=je.r,ga=je.g,fa=je.b,pa=je.a;Q+=ca,Y+=ga,$+=fa,N+=pa,M-=ca,q-=ga,G-=fa,H-=pa,y=y.next,x+=4}b+=r}for(var Wt=0;Wt<r;Wt++){x=Wt<<2;var Mt=o[x],Nt=o[x+1],Vt=o[x+2],et=o[x+3],Xr=l*Mt,Yr=l*Nt,Wr=l*Vt,qr=l*et,Fe=g*Mt,Ue=g*Nt,Be=g*Vt,ze=g*et;c=f;for(var da=0;da<l;da++)c.r=Mt,c.g=Nt,c.b=Vt,c.a=et,c=c.next;for(var ma=r,Gr=0,Qr=0,$r=0,Zr=0,He=1;He<=a;He++){x=ma+Wt<<2;var Xe=l-He;Fe+=(c.r=Mt=o[x])*Xe,Ue+=(c.g=Nt=o[x+1])*Xe,Be+=(c.b=Vt=o[x+2])*Xe,ze+=(c.a=et=o[x+3])*Xe,Zr+=Mt,Gr+=Nt,Qr+=Vt,$r+=et,c=c.next,He<h&&(ma+=r)}x=Wt,m=f,y=d;for(var Kr=0;Kr<n;Kr++){var rt=x<<2;o[rt+3]=et=ze*w>>A,et>0?(et=255/et,o[rt]=(Fe*w>>A)*et,o[rt+1]=(Ue*w>>A)*et,o[rt+2]=(Be*w>>A)*et):o[rt]=o[rt+1]=o[rt+2]=0,Fe-=Xr,Ue-=Yr,Be-=Wr,ze-=qr,Xr-=m.r,Yr-=m.g,Wr-=m.b,qr-=m.a,rt=Wt+((rt=Kr+l)<h?rt:h)*r<<2,Fe+=Zr+=m.r=o[rt],Ue+=Gr+=m.g=o[rt+1],Be+=Qr+=m.b=o[rt+2],ze+=$r+=m.a=o[rt+3],m=m.next,Xr+=Mt=y.r,Yr+=Nt=y.g,Wr+=Vt=y.b,qr+=et=y.a,Zr-=Mt,Gr-=Nt,Qr-=Vt,$r-=et,y=y.next,x+=r}}return i}var wo=function i(){e1(this,i),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function o1(){var{DOMParser:i}=arguments.length>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 u1(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 bb=Object.freeze({__proto__:null,offscreen:o1,node:u1});function ge(i){return i.replace(/(?!\u3000)\s+/gm," ")}function h1(i){return i.replace(/^[\n \t]+/,"")}function l1(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 c1=/^[A-Z-]+$/;function g1(i){return c1.test(i)?i.toLowerCase():i}function xh(i){var t=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(i)||[];return t[2]||t[3]||t[4]}function f1(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 p1=/(\[[^\]]+\])/g,d1=/(#[^\s+>~.[:]+)/g,m1=/(\.[^\s+>~.[:]+)/g,y1=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,v1=/(:[\w-]+\([^)]*\))/gi,x1=/(:[^\s+>~.[:]+)/g,b1=/([^\s+>~.[:]+)/g;function kt(i,t){var e=t.exec(i);return e?[i.replace(t," "),e.length]:[i,0]}function w1(i){var t=[0,0,0],e=i.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[e,r]=kt(e,p1),t[1]+=r,[e,r]=kt(e,d1),t[0]+=r,[e,r]=kt(e,m1),t[1]+=r,[e,r]=kt(e,y1),t[2]+=r,[e,r]=kt(e,v1),t[1]+=r,[e,r]=kt(e,x1),t[1]+=r,e=e.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[e,r]=kt(e,b1),t[2]+=r,t.join("")}var ae=1e-8;function So(i){return Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2))}function Sn(i,t){return(i[0]*t[0]+i[1]*t[1])/(So(i)*So(t))}function To(i,t){return(i[0]*t[1]<i[1]*t[0]?-1:1)*Math.acos(Sn(i,t))}function Oo(i){return i*i*i}function Ao(i){return 3*i*i*(1-i)}function Co(i){return 3*i*(1-i)*(1-i)}function Eo(i){return(1-i)*(1-i)*(1-i)}function Po(i){return i*i}function Mo(i){return 2*i*(1-i)}function No(i){return(1-i)*(1-i)}class T{constructor(t,e,r){this.document=t,this.name=e,this.value=r,this.isNormalizedColor=!1}static empty(t){return new T(t,"EMPTY","")}split(){var t=arguments.length>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=f1(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;a<r&&(e[a]===","&&n++,n!==3);a++);if(t.hasValue()&&this.isString()&&n!==3){var o=new xn(e);o.ok&&(o.alpha=t.getNumber(),e=o.toRGBA())}return new T(this.document,this.name,e)}}T.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class S1{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(t,e){this.viewPorts.push({width:t,height:e})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:t}=this;return t[t.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(t){return typeof t=="number"?t:t==="x"?this.width:t==="y"?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class L{constructor(t,e){this.x=t,this.y=e}static parse(t){var e=arguments.length>1&&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;a<r;a+=2)n.push(new L(e[a],e[a+1]));return n}angleTo(t){return Math.atan2(t.y-this.y,t.x-this.x)}applyTransform(t){var{x:e,y:r}=this,n=e*t[0]+r*t[2]+t[4],a=e*t[1]+r*t[3]+t[5];this.x=n,this.y=a}}class T1{constructor(t){this.screen=t,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:t,onClick:e,onMouseMove:r}=this,n=t.ctx.canvas;n.onclick=e,n.onmousemove=r,this.working=!0}}stop(){if(this.working){var t=this.screen.ctx.canvas;this.working=!1,t.onclick=null,t.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}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 bh=typeof window<"u"?window:null,wh=typeof fetch<"u"?fetch.bind(void 0):null;class Dr{constructor(t){var{fetch:e=wh,window:r=bh}=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 S1,this.mouse=new T1(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,k=u;w==="meet"&&(R*=S,k*=S),w==="slice"&&(R*=E,k*=E);var F=new T(e,"refX",g),M=new T(e,"refY",f),q=F.hasValue()&&M.hasValue();if(q&&r.translate(-S*F.getPixels("x"),-S*M.getPixels("y")),c){var G=S*d,H=S*p;r.beginPath(),r.moveTo(G,H),r.lineTo(a,H),r.lineTo(a,s),r.lineTo(G,s),r.closePath(),r.clip()}if(!q){var Q=w==="meet"&&S===O,Y=w==="slice"&&E===O,$=w==="meet"&&S===A,N=w==="slice"&&E===A;x.startsWith("xMid")&&(Q||Y)&&r.translate(a/2-R/2,0),x.endsWith("YMid")&&($||N)&&r.translate(0,s/2-k/2),x.startsWith("xMax")&&(Q||Y)&&r.translate(a-R,0),x.endsWith("YMax")&&($||N)&&r.translate(0,s-k)}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=Bi(b)};r||c.start(),this.intervalId=Bi(b)}}stop(){this.intervalId&&(Bi.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)}}Dr.defaultWindow=bh;Dr.defaultFetch=wh;var{defaultFetch:O1}=Dr,A1=typeof DOMParser<"u"?DOMParser:null;class Xi{constructor(){var{fetch:t=O1,DOMParser:e=A1}=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 C1{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 E1{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 P1{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 Sh{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 Th extends Sh{constructor(t,e,r){super(t,e,r),this.type="skew",this.angle=null,this.angle=new T(t,"angle",e)}}class M1 extends Th{constructor(t,e,r){super(t,e,r),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class N1 extends Th{constructor(t,e,r){super(t,e,r),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function V1(i){return ge(i).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function R1(i){var[t,e]=i.split("(");return[t.trim(),e.trim().replace(")","")]}class Ft{constructor(t,e,r){this.document=t,this.transforms=[];var n=V1(e);n.forEach(a=>{if(a!=="none"){var[o,s]=R1(a),u=Ft.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 Ft(t,r.getString(),o):null}apply(t){for(var{transforms:e}=this,r=e.length,n=0;n<r;n++)e[n].apply(t)}unapply(t){for(var{transforms:e}=this,r=e.length,n=r-1;n>=0;n--)e[n].unapply(t)}applyToPoint(t){for(var{transforms:e}=this,r=e.length,n=0;n<r;n++)e[n].applyToPoint(t)}}Ft.transformTypes={translate:C1,rotate:E1,scale:P1,matrix:Sh,skewX:M1,skewY:N1};class V{constructor(t,e){var r=arguments.length>2&&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=g1(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=Ft.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 I1 extends V{constructor(t,e,r){super(t,e,r)}}function k1(i){var t=i.trim();return/^('|")/.test(t)?t:'"'.concat(t,'"')}function _1(i){return typeof process>"u"?i:i.trim().split(",").map(k1).join(",")}function L1(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 D1(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[L1(this.fontStyle),this.fontVariant,D1(this.fontWeight),this.fontSize,_1(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),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),typeof e<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.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<h&&h<1&&(t?this.addX(this.sumCubic(h,e,r,n,a)):this.addY(this.sumCubic(h,e,r,n,a)));return}var l=Math.pow(o,2)-4*u*s;if(!(l<0)){var g=(-o+Math.sqrt(l))/(2*s);0<g&&g<1&&(t?this.addX(this.sumCubic(g,e,r,n,a)):this.addY(this.sumCubic(g,e,r,n,a)));var f=(-o-Math.sqrt(l))/(2*s);0<f&&f<1&&(t?this.addX(this.sumCubic(f,e,r,n,a)):this.addY(this.sumCubic(f,e,r,n,a)))}}addBezierCurve(t,e,r,n,a,o,s,u){this.addPoint(t,e),this.addPoint(s,u),this.bezierCurveAdd(!0,t,r,a,s),this.bezierCurveAdd(!1,e,n,o,u)}addQuadraticCurve(t,e,r,n,a,o){var s=t+.6666666666666666*(r-t),u=e+2/3*(n-e),h=s+1/3*(a-t),l=u+1/3*(o-e);this.addBezierCurve(t,e,s,h,u,l,a,o)}isPointInBox(t,e){var{x1:r,y1:n,x2:a,y2:o}=this;return r<=t&&t<=a&&n<=e&&e<=o}}class C extends v{constructor(t){super(t.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new L(0,0),this.control=new L(0,0),this.current=new L(0,0),this.points=[],this.angles=[]}isEnd(){var{i:t,commands:e}=this;return t>=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;r<e;r++)if(!t[r]){for(var n=r+1;n<e;n++)if(t[n]){t[r]=t[n];break}}return t}}class Xt extends V{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){for(var t=1,e=this;e;){var r=e.getStyle("opacity",!1,!0);r.hasValue(!0)&&(t*=r.getNumber()),e=e.parent}return t}setContext(t){var e=arguments.length>1&&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"),k=this.getStyle("font-size"),F=this.getStyle("font-family"),M=new J(S.getString(),E.getString(),R.getString(),k.hasValue()?"".concat(k.getPixels(!0),"px"):"",F.getString(),J.parse(O.getString(),t.font));S.setValue(M.fontStyle),E.setValue(M.fontVariant),R.setValue(M.fontWeight),k.setValue(M.fontSize),F.setValue(M.fontFamily),t.font=M.toString(),k.isPixels()&&(this.document.emSize=k.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 Xt{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;f<n;f++){var[c,d]=r[f];g.render(t,c,d)}if(s.isUrlDefinition()){var p=s.getDefinition(),[m,y]=r[n];p.render(t,m,y)}}}static pathM(t){var e=t.getAsCurrentPoint();return t.start=t.current,{point:e}}pathM(t,e){var{pathParser:r}=this,{point:n}=P.pathM(r),{x:a,y:o}=n;r.addMarker(n),e.addPoint(a,o),t&&t.moveTo(a,o)}static pathL(t){var{current:e}=t,r=t.getAsCurrentPoint();return{current:e,point:r}}pathL(t,e){var{pathParser:r}=this,{current:n,point:a}=P.pathL(r),{x:o,y:s}=a;r.addMarker(a,n),e.addPoint(o,s),t&&t.lineTo(o,s)}static pathH(t){var{current:e,command:r}=t,n=new L((r.relative?e.x:0)+r.x,e.y);return t.current=n,{current:e,point:n}}pathH(t,e){var{pathParser:r}=this,{current:n,point:a}=P.pathH(r),{x:o,y:s}=a;r.addMarker(a,n),e.addPoint(o,s),t&&t.lineTo(o,s)}static pathV(t){var{current:e,command:r}=t,n=new L(e.x,(r.relative?e.y:0)+r.y);return t.current=n,{current:e,point:n}}pathV(t,e){var{pathParser:r}=this,{current:n,point:a}=P.pathV(r),{x:o,y:s}=a;r.addMarker(a,n),e.addPoint(o,s),t&&t.lineTo(o,s)}static pathC(t){var{current:e}=t,r=t.getPoint("x1","y1"),n=t.getAsControlPoint("x2","y2"),a=t.getAsCurrentPoint();return{current:e,point:r,controlPoint:n,currentPoint:a}}pathC(t,e){var{pathParser:r}=this,{current:n,point:a,controlPoint:o,currentPoint:s}=P.pathC(r);r.addMarker(s,o,a),e.addBezierCurve(n.x,n.y,a.x,a.y,o.x,o.y,s.x,s.y),t&&t.bezierCurveTo(a.x,a.y,o.x,o.y,s.x,s.y)}static pathS(t){var{current:e}=t,r=t.getReflectedControlPoint(),n=t.getAsControlPoint("x2","y2"),a=t.getAsCurrentPoint();return{current:e,point:r,controlPoint:n,currentPoint:a}}pathS(t,e){var{pathParser:r}=this,{current:n,point:a,controlPoint:o,currentPoint:s}=P.pathS(r);r.addMarker(s,o,a),e.addBezierCurve(n.x,n.y,a.x,a.y,o.x,o.y,s.x,s.y),t&&t.bezierCurveTo(a.x,a.y,o.x,o.y,s.x,s.y)}static pathQ(t){var{current:e}=t,r=t.getAsControlPoint("x1","y1"),n=t.getAsCurrentPoint();return{current:e,controlPoint:r,currentPoint:n}}pathQ(t,e){var{pathParser:r}=this,{current:n,controlPoint:a,currentPoint:o}=P.pathQ(r);r.addMarker(o,a,a),e.addQuadraticCurve(n.x,n.y,a.x,a.y,o.x,o.y),t&&t.quadraticCurveTo(a.x,a.y,o.x,o.y)}static pathT(t){var{current:e}=t,r=t.getReflectedControlPoint();t.control=r;var n=t.getAsCurrentPoint();return{current:e,controlPoint:r,currentPoint:n}}pathT(t,e){var{pathParser:r}=this,{current:n,controlPoint:a,currentPoint:o}=P.pathT(r);r.addMarker(o,a,a),e.addQuadraticCurve(n.x,n.y,a.x,a.y,o.x,o.y),t&&t.quadraticCurveTo(a.x,a.y,o.x,o.y)}static pathA(t){var{current:e,command:r}=t,{rX:n,rY:a,xRot:o,lArcFlag:s,sweepFlag:u}=r,h=o*(Math.PI/180),l=t.getAsCurrentPoint(),g=new L(Math.cos(h)*(e.x-l.x)/2+Math.sin(h)*(e.y-l.y)/2,-Math.sin(h)*(e.x-l.x)/2+Math.cos(h)*(e.y-l.y)/2),f=Math.pow(g.x,2)/Math.pow(n,2)+Math.pow(g.y,2)/Math.pow(a,2);f>1&&(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=To([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=To(y,b);return Sn(y,b)<=-1&&(x=Math.PI),Sn(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 Oh 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 Xt{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===" ")&&r<o-1&&u!==" "&&(h="terminal"),r>0&&s!==" "&&r<o-1&&u!==" "&&(h="medial"),r>0&&s!==" "&&(r===o-1||u===" ")&&(h="initial"),typeof t.glyphs[n]<"u"){var l=t.glyphs[n];a=l instanceof Oh?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=h1(o)),n===a&&(o=l1(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<c;d++){var p=this.getGlyph(a,g,d);t.translate(this.x,this.y),t.scale(l,-l);var m=t.lineWidth;t.lineWidth=t.lineWidth*o/u,h==="italic"&&t.transform(1,0,.4,1,0,0),p.render(t),h==="italic"&&t.transform(1,0,-.4,1,0,0),t.lineWidth=m,t.scale(1/l,-1/l),t.translate(-this.x,-this.y),this.x+=u*(p.horizAdvX||a.horizAdvX)/o,typeof f[d]<"u"&&!isNaN(f[d])&&(this.x+=f[d])}return}var{x:y,y:b}=this;t.fillStyle&&t.fillText(n,y,b),t.strokeStyle&&t.strokeText(n,y,b)}applyAnchoring(){if(!(this.textChunkStart>=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.leafTexts.length;a++)this.leafTexts[a].x+=n;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(t){this.children.forEach((e,r)=>{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;l<u;l++){var g=this.getGlyph(n,o,l);h+=(g.horizAdvX||n.horizAdvX)*a/n.fontFace.unitsPerEm,typeof s[l]<"u"&&!isNaN(s[l])&&(h+=s[l])}return h}if(!t.measureText)return e.length*10;t.save(),this.setContext(t,!0);var{width:f}=t.measureText(e);return this.clearContext(t),t.restore(),f}getInheritedAttribute(t){for(var e=this;e instanceof Et&&e.isFirstChild();){var r=e.parent.getAttribute(t);if(r.hasValue(!0))return r.getValue("0");e=e.parent}return null}}class jr extends Et{constructor(t,e,r){super(t,e,new.target===jr?!0:r),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class j1 extends jr{constructor(){super(...arguments),this.type="textNode"}}class _e extends Xt{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 Ah 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 F1 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 U1 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 B1 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 Ch 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 z1 extends Ch{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 H1 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 _e(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 X1 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 _e(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 Y1 extends V{constructor(){super(...arguments),this.type="defs"}render(){}}class sa extends Xt{constructor(){super(...arguments),this.type="g"}getBoundingBox(t){var e=new lt;return this.children.forEach(r=>{e.addBoundingBox(r.getBoundingBox(t))}),e}}class Eh 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 Ah(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 sa(s,null);f.attributes.transform=new T(s,"transform",this.getAttribute("gradientTransform").getValue()),f.children=[g];var c=new _e(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 W1 extends Eh{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 q1 extends Eh{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 G1 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 oa 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<this.duration){var o=this.calcValue(),s=this.getAttribute("type");if(s.hasValue()){var u=s.getString();o="".concat(u,"(").concat(o,")")}r.setValue(o),a=!0}return a}getProgress(){var{document:t,values:e}=this,r={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(e.hasValue()){var n=r.progress*(e.getValue().length-1),a=Math.floor(n),o=Math.ceil(n);r.from=new T(t,"from",parseFloat(e.getValue()[a])),r.to=new T(t,"to",parseFloat(e.getValue()[o])),r.progress=(n-a)/(o-a)}else r.from=this.from,r.to=this.to;return r}}class Q1 extends oa{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:t,from:e,to:r}=this.getProgress(),n=new xn(e.getColor()),a=new xn(r.getColor());if(n.ok&&a.ok){var o=n.r+(a.r-n.r)*t,s=n.g+(a.g-n.g)*t,u=n.b+(a.b-n.b)*t;return"rgb(".concat(Math.floor(o),", ").concat(Math.floor(s),", ").concat(Math.floor(u),")")}return this.getAttribute("from").getColor()}}class $1 extends oa{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:t,from:e,to:r}=this.getProgress(),n=nt(e.getString()),a=nt(r.getString()),o=n.map((s,u)=>{var h=a[u];return s+(h-s)*t}).join(" ");return o}}class Z1 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 K1 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 J1 extends P{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class tb 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 eb 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 sa(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 Vo(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 nr(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Vo(Object(e),!0).forEach(function(r){ia(i,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):Vo(Object(e)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(e,r))})}return i}class rb extends Et{constructor(t,e,r){super(t,e,r),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var n=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(n)}getText(){return this.text}path(t){var{dataArray:e}=this;t&&t.beginPath(),e.forEach(r=>{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<n&&(g+=(n-r)/a),h>-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=nr(nr({},c),{},{x:c.x+y,y:c.y+b}),p.p1=nr(nr({},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;c<f;c++)g.push(typeof a[c]<"u"?a[c]:l);var d=g.reduce((w,A,O)=>O===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)<f&&(f=Math.abs(h-g)),o=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],h,0),l<0)for(u=h-f;u>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;u<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;return s=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],g,0),a+=this.getLineLength(o.x,o.y,s.x,s.y),a}}return 0}getPointOnLine(t,e,r,n,a){var o=arguments.length>5&&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));n<e&&(h*=-1);var l=u*h,g=null;if(n===e)g={x:o,y:s+l};else if((s-r)/(o-e+ae)===u)g={x:o+h,y:s+l};else{var f=0,c=0,d=this.getLineLength(e,r,n,a);if(d<ae)return null;var p=(o-e)*(n-e)+(s-r)*(a-r);p/=d*d,f=e+p*(n-e),c=r+p*(a-r);var m=this.getLineLength(o,s,f,c),y=Math.sqrt(t*t-m*m);h=Math.sqrt(y*y/(1+u*u)),n<e&&(h*=-1),l=u*h,g={x:f+h,y:c+l}}return g}getPointOnPath(t){var e=this.getPathLength(),r=0,n=null;if(t<-5e-5||t-5e-5>e)return null;var{dataArray:a}=this;for(var o of a){if(o&&(o.pathLength<5e-5||r+o.pathLength+5e-5<t)){r+=o.pathLength;continue}var s=t-r,u=0;switch(o.type){case C.LINE_TO:n=this.getPointOnLine(s,o.start.x,o.start.y,o.points[0],o.points[1],o.start.x,o.start.y);break;case C.ARC:{var h=o.points[4],l=o.points[5],g=o.points[4]+l;if(u=h+s/o.pathLength*l,l<0&&u<g||l>=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*Oo(t)+o*Ao(t)+n*Co(t)+e*Eo(t),g=h*Oo(t)+s*Ao(t)+a*Co(t)+r*Eo(t);return{x:l,y:g}}getPointOnQuadraticBezier(t,e,r,n,a,o,s){var u=o*Po(t)+n*Mo(t)+e*No(t),h=s*Po(t)+a*Mo(t)+r*No(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 ib=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class nb extends Xt{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=ib.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 ab extends Xt{constructor(){super(...arguments),this.type="symbol"}render(t){}}class sb{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 Ph 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]=w1(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=xh(m);y&&new sb(t).load(d,y)}})}}})}})}}Ph.parseExternalUrl=xh;class ob extends Xt{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 _e(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 Ft.fromElement(t,e)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function ar(i,t,e,r,n,a){return i[e*r*4+t*4+a]}function sr(i,t,e,r,n,a,o){i[e*r*4+t*4+a]=o}function U(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 Mh 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<a;h++)for(var l=0;l<n;l++){var g=ar(u.data,l,h,n,a,0),f=ar(u.data,l,h,n,a,1),c=ar(u.data,l,h,n,a,2),d=ar(u.data,l,h,n,a,3),p=U(s,0,g)+U(s,1,f)+U(s,2,c)+U(s,3,d)+U(s,4,1),m=U(s,5,g)+U(s,6,f)+U(s,7,c)+U(s,8,d)+U(s,9,1),y=U(s,10,g)+U(s,11,f)+U(s,12,c)+U(s,13,d)+U(s,14,1),b=U(s,15,g)+U(s,16,f)+U(s,17,c)+U(s,18,d)+U(s,19,1);o&&(p=0,m=0,y=0,b*=d/255),sr(u.data,l,h,n,a,0,p),sr(u.data,l,h,n,a,1,m),sr(u.data,l,h,n,a,2,y),sr(u.data,l,h,n,a,3,b)}t.clearRect(0,0,n,a),t.putImageData(u,0,0)}}class Fr extends V{constructor(){super(...arguments),this.type="mask"}apply(t,e){var{document:r}=this,n=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),o=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(!o&&!s){var u=new lt;this.children.forEach(d=>{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,Fr.ignoreStyles),l=r.createCanvas(n+o,a+s),g=l.getContext("2d");r.screen.setDefaults(g),this.renderChildren(g),new Mh(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){}}Fr.ignoreStyles=["mask","transform","clip-path"];var Ro=()=>{};class ub 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=Ro,r.closePath=Ro),Reflect.apply(n,t,[]),this.children.forEach(o=>{if(!(typeof o.path>"u")){var s=typeof o.elementTransform<"u"?o.elementTransform():null;s||(s=Ft.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 Ur 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,Ur.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){}}Ur.ignoreStyles=["filter","transform","clip-path"];class hb extends V{constructor(t,e,r){super(t,e,r),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(t,e,r,n,a){}}class lb extends V{constructor(){super(...arguments),this.type="feMorphology"}apply(t,e,r,n,a){}}class cb extends V{constructor(){super(...arguments),this.type="feComposite"}apply(t,e,r,n,a){}}class gb 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)),a1(h,e,r,n,a,s),u&&u.removeChild(h)}}class fb extends V{constructor(){super(...arguments),this.type="title"}}class pb extends V{constructor(){super(...arguments),this.type="desc"}}var db={svg:_e,rect:Ah,circle:F1,ellipse:U1,line:B1,polyline:Ch,polygon:z1,path:P,pattern:H1,marker:X1,defs:Y1,linearGradient:W1,radialGradient:q1,stop:G1,animate:oa,animateColor:Q1,animateTransform:$1,font:Z1,"font-face":K1,"missing-glyph":J1,glyph:Oh,text:Et,tspan:jr,tref:tb,a:eb,textPath:rb,image:nb,g:sa,symbol:ab,style:Ph,use:ob,mask:Fr,clipPath:ub,filter:Ur,feDropShadow:hb,feMorphology:lb,feComposite:cb,feColorMatrix:Mh,feGaussianBlur:gb,title:fb,desc:pb};function Io(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 mb(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Io(Object(e),!0).forEach(function(r){ia(i,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):Io(Object(e)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(e,r))})}return i}function yb(i,t){var e=document.createElement("canvas");return e.width=i,e.height=t,e}function vb(i){return Tn.apply(this,arguments)}function Tn(){return Tn=bt(function*(i){var t=arguments.length>1&&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})}),Tn.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 I1(this,t)}createTextNode(t){return new j1(this,t)}setViewBox(t){this.screen.setViewBox(mb({document:this},t))}}At.createCanvas=yb;At.createImage=vb;At.elementTypes=db;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 _t(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ko(Object(e),!0).forEach(function(r){ia(i,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):ko(Object(e)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(e,r))})}return i}class Se{constructor(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new Xi(r),this.screen=new Dr(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 Xi(n),o=yield a.parse(e);return new Se(t,o,n)})()}static fromString(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=new Xi(r),a=n.parseFromString(e);return new Se(t,a,r)}fork(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Se.from(t,e,_t(_t({},this.options),r))}forkString(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Se.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{eb as AElement,Q1 as AnimateColorElement,oa as AnimateElement,$1 as AnimateTransformElement,lt as BoundingBox,Oo as CB1,Ao as CB2,Co as CB3,Eo as CB4,Se as Canvg,F1 as CircleElement,ub as ClipPathElement,Y1 as DefsElement,pb as DescElement,At as Document,V as Element,U1 as EllipseElement,Mh as FeColorMatrixElement,cb as FeCompositeElement,hb as FeDropShadowElement,gb as FeGaussianBlurElement,lb as FeMorphologyElement,Ur as FilterElement,J as Font,Z1 as FontElement,K1 as FontFaceElement,sa as GElement,Oh as GlyphElement,Eh as GradientElement,nb as ImageElement,B1 as LineElement,W1 as LinearGradientElement,X1 as MarkerElement,Fr as MaskElement,Sh as Matrix,J1 as MissingGlyphElement,T1 as Mouse,ae as PSEUDO_ZERO,Xi as Parser,P as PathElement,C as PathParser,H1 as PatternElement,L as Point,z1 as PolygonElement,Ch as PolylineElement,T as Property,Po as QB1,Mo as QB2,No as QB3,q1 as RadialGradientElement,Ah as RectElement,Xt as RenderedElement,E1 as Rotate,_e as SVGElement,sb as SVGFontLoader,P1 as Scale,Dr as Screen,Th as Skew,M1 as SkewX,N1 as SkewY,G1 as StopElement,Ph as StyleElement,ab as SymbolElement,tb as TRefElement,jr as TSpanElement,Et as TextElement,rb as TextPathElement,fb as TitleElement,Ft as Transform,C1 as Translate,I1 as UnknownElement,ob as UseElement,S1 as ViewPort,ge as compressSpaces,Se as default,w1 as getSelectorSpecificity,g1 as normalizeAttributeName,f1 as normalizeColor,xh as parseExternalUrl,bb as presets,nt as toNumbers,h1 as trimLeft,l1 as trimRight,So as vectorMagnitude,To as vectorsAngle,Sn as vectorsRatio};
|