@rubytech/create-realagent 1.0.866 → 1.0.867

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/lib/graph-search/dist/index.d.ts +51 -0
  3. package/payload/platform/lib/graph-search/dist/index.d.ts.map +1 -1
  4. package/payload/platform/lib/graph-search/dist/index.js +77 -7
  5. package/payload/platform/lib/graph-search/dist/index.js.map +1 -1
  6. package/payload/platform/lib/graph-search/src/__tests__/bm25-strong-bypass-threshold.test.ts +126 -0
  7. package/payload/platform/lib/graph-search/src/__tests__/vector-threshold.test.ts +170 -0
  8. package/payload/platform/lib/graph-search/src/index.ts +129 -9
  9. package/payload/platform/templates/agents/admin/IDENTITY.md +1 -1
  10. package/payload/platform/templates/specialists/agents/database-operator.md +1 -1
  11. package/payload/server/chunk-DHSBEMWW.js +11319 -0
  12. package/payload/server/maxy-edge.js +1 -1
  13. package/payload/server/public/assets/{Checkbox-BySsatDO.js → Checkbox-B9hff9s8.js} +1 -1
  14. package/payload/server/public/assets/{admin-CLp1xGlJ.js → admin-Cpi6L_g7.js} +3 -3
  15. package/payload/server/public/assets/data-Da6iYRW1.js +1 -0
  16. package/payload/server/public/assets/graph-BHq-JYwV.js +1 -0
  17. package/payload/server/public/assets/{useAdminFetch-B3MO55eB.js → graph-labels-ChinGFwI.js} +1 -1
  18. package/payload/server/public/assets/{jsx-runtime-O5ef8xK8.css → jsx-runtime-CVA1ZrPS.css} +1 -1
  19. package/payload/server/public/assets/page-DqPf65sS.js +50 -0
  20. package/payload/server/public/assets/page-OVrxtgOZ.js +1 -0
  21. package/payload/server/public/assets/{public-DRrf63wm.js → public-CJN5KAiK.js} +1 -1
  22. package/payload/server/public/assets/{useVoiceRecorder-CR8gcELb.js → useVoiceRecorder-DyVx7e7a.js} +1 -1
  23. package/payload/server/public/data.html +5 -5
  24. package/payload/server/public/graph.html +6 -6
  25. package/payload/server/public/index.html +8 -8
  26. package/payload/server/public/public.html +5 -5
  27. package/payload/server/server.js +80 -11
  28. package/payload/server/public/assets/data-BuuqlV4L.js +0 -1
  29. package/payload/server/public/assets/graph-CtVITeok.js +0 -1
  30. package/payload/server/public/assets/page-Ddc_nKh8.js +0 -1
  31. package/payload/server/public/assets/page-IQBQoOdT.js +0 -50
  32. /package/payload/server/public/assets/{jsx-runtime-DnY0498s.js → jsx-runtime-nxP_2eNo.js} +0 -0
@@ -0,0 +1,50 @@
1
+ import{o as e,t}from"./chunk-DD-I1_y5.js";import{n,o as r,r as i,t as a}from"./jsx-runtime-nxP_2eNo.js";import{a as o,c as s,d as c,f as l,i as u,l as d,n as f,p,r as m,s as h,u as g}from"./graph-labels-ChinGFwI.js";import{t as _}from"./Checkbox-B9hff9s8.js";var v=i(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),y=i(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),b=i(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),x=i(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),S=i(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),ee=i(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),C=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.vis=n.vis||{}))})(e,(function(e){function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i={exports:{}},a=function(e){return e&&e.Math===Math&&e},o=a(typeof globalThis==`object`&&globalThis)||a(typeof window==`object`&&window)||a(typeof self==`object`&&self)||a(typeof n==`object`&&n)||(function(){return this})()||n||Function(`return this`)(),s=function(e){try{return!!e()}catch{return!0}},c=!s(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),l=c,u=Function.prototype,d=u.apply,f=u.call,p=typeof Reflect==`object`&&Reflect.apply||(l?f.bind(d):function(){return f.apply(d,arguments)}),m=c,h=Function.prototype,g=h.call,_=m&&h.bind.bind(g,g),v=m?_:function(e){return function(){return g.apply(e,arguments)}},y=v,b=y({}.toString),x=y(``.slice),S=function(e){return x(b(e),8,-1)},ee=S,C=v,te=function(e){if(ee(e)===`Function`)return C(e)},ne=typeof document==`object`&&document.all,re={all:ne,IS_HTMLDDA:ne===void 0&&ne!==void 0},w=re,T=w.all,E=w.IS_HTMLDDA?function(e){return typeof e==`function`||e===T}:function(e){return typeof e==`function`},D={},O=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ie=c,k=Function.prototype.call,A=ie?k.bind(k):function(){return k.apply(k,arguments)},ae={},oe={}.propertyIsEnumerable,se=Object.getOwnPropertyDescriptor;ae.f=se&&!oe.call({1:2},1)?function(e){var t=se(this,e);return!!t&&t.enumerable}:oe;var ce=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},le=v,ue=s,de=S,fe=Object,pe=le(``.split),me=ue(function(){return!fe(`z`).propertyIsEnumerable(0)})?function(e){return de(e)===`String`?pe(e,``):fe(e)}:fe,he=function(e){return e==null},ge=he,_e=TypeError,ve=function(e){if(ge(e))throw new _e(`Can't call method on `+e);return e},ye=me,be=ve,xe=function(e){return ye(be(e))},Se=E,Ce=re,j=Ce.all,M=Ce.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:Se(e)||e===j}:function(e){return typeof e==`object`?e!==null:Se(e)},we={},N=we,Te=o,Ee=E,P=function(e){return Ee(e)?e:void 0},F=function(e,t){return arguments.length<2?P(N[e])||P(Te[e]):N[e]&&N[e][t]||Te[e]&&Te[e][t]},De=v({}.isPrototypeOf),Oe=typeof navigator<`u`&&String(navigator.userAgent)||``,ke=o,Ae=Oe,je=ke.process,Me=ke.Deno,Ne=je&&je.versions||Me&&Me.version,Pe=Ne&&Ne.v8,Fe,Ie;Pe&&(Fe=Pe.split(`.`),Ie=Fe[0]>0&&Fe[0]<4?1:+(Fe[0]+Fe[1])),!Ie&&Ae&&(Fe=Ae.match(/Edge\/(\d+)/),(!Fe||Fe[1]>=74)&&(Fe=Ae.match(/Chrome\/(\d+)/),Fe&&(Ie=+Fe[1])));var Le=Ie,Re=Le,ze=s,Be=o.String,Ve=!!Object.getOwnPropertySymbols&&!ze(function(){var e=Symbol(`symbol detection`);return!Be(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Re&&Re<41}),He=Ve&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,Ue=F,We=E,Ge=De,Ke=He,qe=Object,Je=Ke?function(e){return typeof e==`symbol`}:function(e){var t=Ue(`Symbol`);return We(t)&&Ge(t.prototype,qe(e))},Ye=String,Xe=function(e){try{return Ye(e)}catch{return`Object`}},Ze=E,Qe=Xe,$e=TypeError,et=function(e){if(Ze(e))return e;throw new $e(Qe(e)+` is not a function`)},tt=et,nt=he,rt=function(e,t){var n=e[t];return nt(n)?void 0:tt(n)},it=A,at=E,ot=M,st=TypeError,ct=function(e,t){var n,r;if(t===`string`&&at(n=e.toString)&&!ot(r=it(n,e))||at(n=e.valueOf)&&!ot(r=it(n,e))||t!==`string`&&at(n=e.toString)&&!ot(r=it(n,e)))return r;throw new st(`Can't convert object to primitive value`)},lt={exports:{}},ut=!0,dt=o,ft=Object.defineProperty,pt=function(e,t){try{ft(dt,e,{value:t,configurable:!0,writable:!0})}catch{dt[e]=t}return t},mt=o,ht=pt,gt=`__core-js_shared__`,_t=mt[gt]||ht(gt,{}),vt=_t;(lt.exports=function(e,t){return vt[e]||(vt[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.33.2`,mode:`pure`,copyright:`© 2014-2023 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE`,source:`https://github.com/zloirock/core-js`});var yt=lt.exports,bt=ve,xt=Object,St=function(e){return xt(bt(e))},Ct=v,wt=St,Tt=Ct({}.hasOwnProperty),Et=Object.hasOwn||function(e,t){return Tt(wt(e),t)},Dt=v,Ot=0,kt=Math.random(),At=Dt(1 .toString),jt=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+At(++Ot+kt,36)},Mt=o,Nt=yt,Pt=Et,Ft=jt,It=Ve,Lt=He,Rt=Mt.Symbol,zt=Nt(`wks`),Bt=Lt?Rt.for||Rt:Rt&&Rt.withoutSetter||Ft,Vt=function(e){return Pt(zt,e)||(zt[e]=It&&Pt(Rt,e)?Rt[e]:Bt(`Symbol.`+e)),zt[e]},Ht=A,Ut=M,Wt=Je,Gt=rt,Kt=ct,qt=Vt,Jt=TypeError,Yt=qt(`toPrimitive`),Xt=function(e,t){if(!Ut(e)||Wt(e))return e;var n=Gt(e,Yt),r;if(n){if(t===void 0&&(t=`default`),r=Ht(n,e,t),!Ut(r)||Wt(r))return r;throw new Jt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Kt(e,t)},Zt=Je,Qt=function(e){var t=Xt(e,`string`);return Zt(t)?t:t+``},$t=o,en=M,tn=$t.document,nn=en(tn)&&en(tn.createElement),rn=function(e){return nn?tn.createElement(e):{}},an=O,on=s,sn=rn,cn=!an&&!on(function(){return Object.defineProperty(sn(`div`),`a`,{get:function(){return 7}}).a!==7}),ln=O,un=A,dn=ae,fn=ce,pn=xe,mn=Qt,hn=Et,gn=cn,_n=Object.getOwnPropertyDescriptor;D.f=ln?_n:function(e,t){if(e=pn(e),t=mn(t),gn)try{return _n(e,t)}catch{}if(hn(e,t))return fn(!un(dn.f,e,t),e[t])};var vn=s,yn=E,bn=/#|\.prototype\./,xn=function(e,t){var n=Cn[Sn(e)];return n===Tn?!0:n===wn?!1:yn(t)?vn(t):!!t},Sn=xn.normalize=function(e){return String(e).replace(bn,`.`).toLowerCase()},Cn=xn.data={},wn=xn.NATIVE=`N`,Tn=xn.POLYFILL=`P`,En=xn,Dn=te,On=et,kn=c,An=Dn(Dn.bind),jn=function(e,t){return On(e),t===void 0?e:kn?An(e,t):function(){return e.apply(t,arguments)}},Mn={},Nn=O&&s(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Pn=M,Fn=String,In=TypeError,Ln=function(e){if(Pn(e))return e;throw new In(Fn(e)+` is not an object`)},Rn=O,zn=cn,Bn=Nn,Vn=Ln,Hn=Qt,Un=TypeError,Wn=Object.defineProperty,Gn=Object.getOwnPropertyDescriptor,Kn=`enumerable`,I=`configurable`,L=`writable`;Mn.f=Rn?Bn?function(e,t,n){if(Vn(e),t=Hn(t),Vn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&L in n&&!n[L]){var r=Gn(e,t);r&&r[L]&&(e[t]=n.value,n={configurable:I in n?n[I]:r[I],enumerable:Kn in n?n[Kn]:r[Kn],writable:!1})}return Wn(e,t,n)}:Wn:function(e,t,n){if(Vn(e),t=Hn(t),Vn(n),zn)try{return Wn(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Un(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var qn=O,Jn=Mn,Yn=ce,Xn=qn?function(e,t,n){return Jn.f(e,t,Yn(1,n))}:function(e,t,n){return e[t]=n,e},Zn=o,Qn=p,$n=te,er=E,tr=D.f,nr=En,rr=we,ir=jn,ar=Xn,or=Et,sr=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return Qn(e,this,arguments)};return t.prototype=e.prototype,t},R=function(e,t){var n=e.target,r=e.global,i=e.stat,a=e.proto,o=r?Zn:i?Zn[n]:(Zn[n]||{}).prototype,s=r?rr:rr[n]||ar(rr,n,{})[n],c=s.prototype,l,u,d,f,p,m,h,g,_;for(f in t)l=nr(r?f:n+(i?`.`:`#`)+f,e.forced),u=!l&&o&&or(o,f),m=s[f],u&&(e.dontCallGetSet?(_=tr(o,f),h=_&&_.value):h=o[f]),p=u&&h?h:t[f],!(u&&typeof m==typeof p)&&(g=e.bind&&u?ir(p,Zn):e.wrap&&u?sr(p):a&&er(p)?$n(p):p,(e.sham||p&&p.sham||m&&m.sham)&&ar(g,`sham`,!0),ar(s,f,g),a&&(d=n+`Prototype`,or(rr,d)||ar(rr,d,{}),ar(rr[d],f,p),e.real&&c&&(l||!c[f])&&ar(c,f,p)))},cr=R,lr=O,ur=Mn.f;cr({target:`Object`,stat:!0,forced:Object.defineProperty!==ur,sham:!lr},{defineProperty:ur});var dr=we.Object,fr=i.exports=function(e,t,n){return dr.defineProperty(e,t,n)};dr.defineProperty.sham&&(fr.sham=!0);var pr=i.exports,mr=pr,hr=r(mr),gr=S,_r=Array.isArray||function(e){return gr(e)===`Array`},vr=Math.ceil,yr=Math.floor,br=Math.trunc||function(e){var t=+e;return(t>0?yr:vr)(t)},xr=function(e){var t=+e;return t!==t||t===0?0:br(t)},Sr=xr,Cr=Math.min,wr=function(e){return e>0?Cr(Sr(e),9007199254740991):0},Tr=function(e){return wr(e.length)},Er=TypeError,Dr=9007199254740991,Or=function(e){if(e>Dr)throw Er(`Maximum allowed index exceeded`);return e},kr=Qt,Ar=Mn,jr=ce,Mr=function(e,t,n){var r=kr(t);r in e?Ar.f(e,r,jr(0,n)):e[r]=n},Nr=Vt(`toStringTag`),Pr={};Pr[Nr]=`z`;var Fr=String(Pr)===`[object z]`,Ir=Fr,Lr=E,Rr=S,zr=Vt(`toStringTag`),Br=Object,Vr=Rr(function(){return arguments}())===`Arguments`,Hr=function(e,t){try{return e[t]}catch{}},Ur=Ir?Rr:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=Hr(t=Br(e),zr))==`string`?n:Vr?Rr(t):(r=Rr(t))===`Object`&&Lr(t.callee)?`Arguments`:r},Wr=v,Gr=E,Kr=_t,qr=Wr(Function.toString);Gr(Kr.inspectSource)||(Kr.inspectSource=function(e){return qr(e)});var Jr=Kr.inspectSource,Yr=v,Xr=s,Zr=E,Qr=Ur,$r=F,z=Jr,ei=function(){},ti=[],ni=$r(`Reflect`,`construct`),ri=/^\s*(?:class|function)\b/,ii=Yr(ri.exec),ai=!ri.test(ei),oi=function(e){if(!Zr(e))return!1;try{return ni(ei,ti,e),!0}catch{return!1}},si=function(e){if(!Zr(e))return!1;switch(Qr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return ai||!!ii(ri,z(e))}catch{return!0}};si.sham=!0;var ci=!ni||Xr(function(){var e;return oi(oi.call)||!oi(Object)||!oi(function(){e=!0})||e})?si:oi,li=_r,ui=ci,di=M,fi=Vt(`species`),pi=Array,mi=function(e){var t;return li(e)&&(t=e.constructor,ui(t)&&(t===pi||li(t.prototype))?t=void 0:di(t)&&(t=t[fi],t===null&&(t=void 0))),t===void 0?pi:t},hi=function(e,t){return new(mi(e))(t===0?0:t)},gi=s,_i=Vt,vi=Le,yi=_i(`species`),bi=function(e){return vi>=51||!gi(function(){var t=[],n=t.constructor={};return n[yi]=function(){return{foo:1}},t[e](Boolean).foo!==1})},xi=R,Si=s,Ci=_r,wi=M,Ti=St,Ei=Tr,Di=Or,Oi=Mr,ki=hi,Ai=bi,ji=Vt,Mi=Le,Ni=ji(`isConcatSpreadable`),Pi=Mi>=51||!Si(function(){var e=[];return e[Ni]=!1,e.concat()[0]!==e}),Fi=function(e){if(!wi(e))return!1;var t=e[Ni];return t===void 0?Ci(e):!!t};xi({target:`Array`,proto:!0,arity:1,forced:!Pi||!Ai(`concat`)},{concat:function(e){var t=Ti(this),n=ki(t,0),r=0,i,a,o,s,c;for(i=-1,o=arguments.length;i<o;i++)if(c=i===-1?t:arguments[i],Fi(c))for(s=Ei(c),Di(r+s),a=0;a<s;a++,r++)a in c&&Oi(n,r,c[a]);else Di(r+1),Oi(n,r++,c);return n.length=r,n}});var Ii=Ur,Li=String,Ri=function(e){if(Ii(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return Li(e)},zi={},Bi=xr,Vi=Math.max,Hi=Math.min,Ui=function(e,t){var n=Bi(e);return n<0?Vi(n+t,0):Hi(n,t)},Wi=xe,Gi=Ui,Ki=Tr,qi=function(e){return function(t,n,r){var i=Wi(t),a=Ki(i),o=Gi(r,a),s;if(e&&n!==n){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},Ji={includes:qi(!0),indexOf:qi(!1)},Yi={},Xi=v,Zi=Et,Qi=xe,$i=Ji.indexOf,ea=Yi,ta=Xi([].push),na=function(e,t){var n=Qi(e),r=0,i=[],a;for(a in n)!Zi(ea,a)&&Zi(n,a)&&ta(i,a);for(;t.length>r;)Zi(n,a=t[r++])&&(~$i(i,a)||ta(i,a));return i},ra=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],ia=na,aa=ra,oa=Object.keys||function(e){return ia(e,aa)},sa=O,ca=Nn,la=Mn,ua=Ln,da=xe,fa=oa;zi.f=sa&&!ca?Object.defineProperties:function(e,t){ua(e);for(var n=da(t),r=fa(t),i=r.length,a=0,o;i>a;)la.f(e,o=r[a++],n[o]);return e};var pa=F(`document`,`documentElement`),ma=yt,ha=jt,ga=ma(`keys`),_a=function(e){return ga[e]||(ga[e]=ha(e))},va=Ln,ya=zi,ba=ra,xa=Yi,Sa=pa,Ca=rn,wa=_a,Ta=`>`,Ea=`<`,Da=`prototype`,Oa=`script`,ka=wa(`IE_PROTO`),Aa=function(){},ja=function(e){return Ea+Oa+Ta+e+Ea+`/`+Oa+Ta},Ma=function(e){e.write(ja(``)),e.close();var t=e.parentWindow.Object;return e=null,t},Na=function(){var e=Ca(`iframe`),t=`java`+Oa+`:`,n;return e.style.display=`none`,Sa.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(ja(`document.F=Object`)),n.close(),n.F},Pa,Fa=function(){try{Pa=new ActiveXObject(`htmlfile`)}catch{}Fa=typeof document<`u`?document.domain&&Pa?Ma(Pa):Na():Ma(Pa);for(var e=ba.length;e--;)delete Fa[Da][ba[e]];return Fa()};xa[ka]=!0;var Ia=Object.create||function(e,t){var n;return e===null?n=Fa():(Aa[Da]=va(e),n=new Aa,Aa[Da]=null,n[ka]=e),t===void 0?n:ya.f(n,t)},La={},Ra=na,za=ra.concat(`length`,`prototype`);La.f=Object.getOwnPropertyNames||function(e){return Ra(e,za)};var Ba={},Va=Ui,Ha=Tr,Ua=Mr,Wa=Array,Ga=Math.max,Ka=function(e,t,n){for(var r=Ha(e),i=Va(t,r),a=Va(n===void 0?r:n,r),o=Wa(Ga(a-i,0)),s=0;i<a;i++,s++)Ua(o,s,e[i]);return o.length=s,o},qa=S,Ja=xe,Ya=La.f,Xa=Ka,Za=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Qa=function(e){try{return Ya(e)}catch{return Xa(Za)}};Ba.f=function(e){return Za&&qa(e)===`Window`?Qa(e):Ya(Ja(e))};var $a={};$a.f=Object.getOwnPropertySymbols;var eo=Xn,to=function(e,t,n,r){return r&&r.enumerable?e[t]=n:eo(e,t,n),e},no=Mn,ro=function(e,t,n){return no.f(e,t,n)},io={};io.f=Vt;var ao=we,oo=Et,so=io,co=Mn.f,lo=function(e){var t=ao.Symbol||={};oo(t,e)||co(t,e,{value:so.f(e)})},uo=A,fo=F,po=Vt,mo=to,ho=function(){var e=fo(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=po(`toPrimitive`);t&&!t[r]&&mo(t,r,function(e){return uo(n,this)},{arity:1})},go=Fr,_o=Ur,vo=go?{}.toString:function(){return`[object `+_o(this)+`]`},yo=Fr,bo=Mn.f,xo=Xn,So=Et,Co=vo,wo=Vt(`toStringTag`),To=function(e,t,n,r){if(e){var i=n?e:e.prototype;So(i,wo)||bo(i,wo,{configurable:!0,value:t}),r&&!yo&&xo(i,`toString`,Co)}},Eo=o,Do=E,Oo=Eo.WeakMap,ko=Do(Oo)&&/native code/.test(String(Oo)),Ao=o,jo=M,Mo=Xn,No=Et,Po=_t,Fo=_a,Io=Yi,Lo=`Object already initialized`,Ro=Ao.TypeError,zo=Ao.WeakMap,Bo,Vo,Ho,Uo=function(e){return Ho(e)?Vo(e):Bo(e,{})},Wo=function(e){return function(t){var n;if(!jo(t)||(n=Vo(t)).type!==e)throw new Ro(`Incompatible receiver, `+e+` required`);return n}};if(ko||Po.state){var Go=Po.state||=new zo;Go.get=Go.get,Go.has=Go.has,Go.set=Go.set,Bo=function(e,t){if(Go.has(e))throw new Ro(Lo);return t.facade=e,Go.set(e,t),t},Vo=function(e){return Go.get(e)||{}},Ho=function(e){return Go.has(e)}}else{var Ko=Fo(`state`);Io[Ko]=!0,Bo=function(e,t){if(No(e,Ko))throw new Ro(Lo);return t.facade=e,Mo(e,Ko,t),t},Vo=function(e){return No(e,Ko)?e[Ko]:{}},Ho=function(e){return No(e,Ko)}}var qo={set:Bo,get:Vo,has:Ho,enforce:Uo,getterFor:Wo},Jo=jn,Yo=v,Xo=me,Zo=St,Qo=Tr,$o=hi,es=Yo([].push),ts=function(e){var t=e===1,n=e===2,r=e===3,i=e===4,a=e===6,o=e===7,s=e===5||a;return function(c,l,u,d){for(var f=Zo(c),p=Xo(f),m=Jo(l,u),h=Qo(p),g=0,_=d||$o,v=t?_(c,h):n||o?_(c,0):void 0,y,b;h>g;g++)if((s||g in p)&&(y=p[g],b=m(y,g,f),e))if(t)v[g]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return g;case 2:es(v,y)}else switch(e){case 4:return!1;case 7:es(v,y)}return a?-1:r||i?i:v}},ns={forEach:ts(0),map:ts(1),filter:ts(2),some:ts(3),every:ts(4),find:ts(5),findIndex:ts(6),filterReject:ts(7)},rs=R,is=o,as=A,os=v,ss=O,cs=Ve,ls=s,us=Et,ds=De,fs=Ln,ps=xe,ms=Qt,hs=Ri,gs=ce,_s=Ia,vs=oa,ys=La,bs=Ba,xs=$a,Ss=D,Cs=Mn,ws=zi,Ts=ae,Es=to,Ds=ro,Os=yt,ks=_a,As=Yi,js=jt,Ms=Vt,Ns=io,Ps=lo,Fs=ho,Is=To,Ls=qo,Rs=ns.forEach,zs=ks(`hidden`),Bs=`Symbol`,Vs=`prototype`,Hs=Ls.set,Us=Ls.getterFor(Bs),Ws=Object[Vs],Gs=is.Symbol,Ks=Gs&&Gs[Vs],qs=is.RangeError,Js=is.TypeError,Ys=is.QObject,Xs=Ss.f,Zs=Cs.f,Qs=bs.f,$s=Ts.f,ec=os([].push),tc=Os(`symbols`),nc=Os(`op-symbols`),rc=Os(`wks`),ic=!Ys||!Ys[Vs]||!Ys[Vs].findChild,ac=function(e,t,n){var r=Xs(Ws,t);r&&delete Ws[t],Zs(e,t,n),r&&e!==Ws&&Zs(Ws,t,r)},oc=ss&&ls(function(){return _s(Zs({},`a`,{get:function(){return Zs(this,`a`,{value:7}).a}})).a!==7})?ac:Zs,sc=function(e,t){var n=tc[e]=_s(Ks);return Hs(n,{type:Bs,tag:e,description:t}),ss||(n.description=t),n},cc=function(e,t,n){e===Ws&&cc(nc,t,n),fs(e);var r=ms(t);return fs(n),us(tc,r)?(n.enumerable?(us(e,zs)&&e[zs][r]&&(e[zs][r]=!1),n=_s(n,{enumerable:gs(0,!1)})):(us(e,zs)||Zs(e,zs,gs(1,{})),e[zs][r]=!0),oc(e,r,n)):Zs(e,r,n)},lc=function(e,t){fs(e);var n=ps(t);return Rs(vs(n).concat(mc(n)),function(t){(!ss||as(dc,n,t))&&cc(e,t,n[t])}),e},uc=function(e,t){return t===void 0?_s(e):lc(_s(e),t)},dc=function(e){var t=ms(e),n=as($s,this,t);return this===Ws&&us(tc,t)&&!us(nc,t)?!1:n||!us(this,t)||!us(tc,t)||us(this,zs)&&this[zs][t]?n:!0},fc=function(e,t){var n=ps(e),r=ms(t);if(!(n===Ws&&us(tc,r)&&!us(nc,r))){var i=Xs(n,r);return i&&us(tc,r)&&!(us(n,zs)&&n[zs][r])&&(i.enumerable=!0),i}},pc=function(e){var t=Qs(ps(e)),n=[];return Rs(t,function(e){!us(tc,e)&&!us(As,e)&&ec(n,e)}),n},mc=function(e){var t=e===Ws,n=Qs(t?nc:ps(e)),r=[];return Rs(n,function(e){us(tc,e)&&(!t||us(Ws,e))&&ec(r,tc[e])}),r};cs||(Gs=function(){if(ds(Ks,this))throw new Js(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:hs(arguments[0]),t=js(e),n=function(e){var r=this===void 0?is:this;r===Ws&&as(n,nc,e),us(r,zs)&&us(r[zs],t)&&(r[zs][t]=!1);var i=gs(1,e);try{oc(r,t,i)}catch(e){if(!(e instanceof qs))throw e;ac(r,t,i)}};return ss&&ic&&oc(Ws,t,{configurable:!0,set:n}),sc(t,e)},Ks=Gs[Vs],Es(Ks,`toString`,function(){return Us(this).tag}),Es(Gs,`withoutSetter`,function(e){return sc(js(e),e)}),Ts.f=dc,Cs.f=cc,ws.f=lc,Ss.f=fc,ys.f=bs.f=pc,xs.f=mc,Ns.f=function(e){return sc(Ms(e),e)},ss&&Ds(Ks,`description`,{configurable:!0,get:function(){return Us(this).description}})),rs({global:!0,constructor:!0,wrap:!0,forced:!cs,sham:!cs},{Symbol:Gs}),Rs(vs(rc),function(e){Ps(e)}),rs({target:Bs,stat:!0,forced:!cs},{useSetter:function(){ic=!0},useSimple:function(){ic=!1}}),rs({target:`Object`,stat:!0,forced:!cs,sham:!ss},{create:uc,defineProperty:cc,defineProperties:lc,getOwnPropertyDescriptor:fc}),rs({target:`Object`,stat:!0,forced:!cs},{getOwnPropertyNames:pc}),Fs(),Is(Gs,Bs),As[zs]=!0;var hc=Ve&&!!Symbol.for&&!!Symbol.keyFor,gc=R,_c=F,vc=Et,yc=Ri,bc=yt,xc=hc,Sc=bc(`string-to-symbol-registry`),B=bc(`symbol-to-string-registry`);gc({target:`Symbol`,stat:!0,forced:!xc},{for:function(e){var t=yc(e);if(vc(Sc,t))return Sc[t];var n=_c(`Symbol`)(t);return Sc[t]=n,B[n]=t,n}});var Cc=R,wc=Et,Tc=Je,Ec=Xe,Dc=yt,Oc=hc,kc=Dc(`symbol-to-string-registry`);Cc({target:`Symbol`,stat:!0,forced:!Oc},{keyFor:function(e){if(!Tc(e))throw TypeError(Ec(e)+` is not a symbol`);if(wc(kc,e))return kc[e]}});var Ac=v([].slice),jc=v,Mc=_r,Nc=E,Pc=S,Fc=Ri,Ic=jc([].push),Lc=function(e){if(Nc(e))return e;if(Mc(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Ic(n,i):(typeof i==`number`||Pc(i)===`Number`||Pc(i)===`String`)&&Ic(n,Fc(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(Mc(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Rc=R,zc=F,Bc=p,Vc=A,Hc=v,Uc=s,Wc=E,Gc=Je,Kc=Ac,qc=Lc,Jc=Ve,Yc=String,Xc=zc(`JSON`,`stringify`),Zc=Hc(/./.exec),Qc=Hc(``.charAt),$c=Hc(``.charCodeAt),el=Hc(``.replace),tl=Hc(1 .toString),nl=/[\uD800-\uDFFF]/g,rl=/^[\uD800-\uDBFF]$/,il=/^[\uDC00-\uDFFF]$/,al=!Jc||Uc(function(){var e=zc(`Symbol`)(`stringify detection`);return Xc([e])!==`[null]`||Xc({a:e})!==`{}`||Xc(Object(e))!==`{}`}),ol=Uc(function(){return Xc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Xc(`\udead`)!==`"\\udead"`}),sl=function(e,t){var n=Kc(arguments),r=qc(t);if(!(!Wc(r)&&(e===void 0||Gc(e))))return n[1]=function(e,t){if(Wc(r)&&(t=Vc(r,this,Yc(e),t)),!Gc(t))return t},Bc(Xc,null,n)},cl=function(e,t,n){var r=Qc(n,t-1),i=Qc(n,t+1);return Zc(rl,e)&&!Zc(il,i)||Zc(il,e)&&!Zc(rl,r)?`\\u`+tl($c(e,0),16):e};Xc&&Rc({target:`JSON`,stat:!0,arity:3,forced:al||ol},{stringify:function(e,t,n){var r=Kc(arguments),i=Bc(al?sl:Xc,null,r);return ol&&typeof i==`string`?el(i,nl,cl):i}});var ll=R,ul=Ve,dl=s,fl=$a,pl=St;ll({target:`Object`,stat:!0,forced:!ul||dl(function(){fl.f(1)})},{getOwnPropertySymbols:function(e){var t=fl.f;return t?t(pl(e)):[]}}),lo(`asyncIterator`),lo(`hasInstance`),lo(`isConcatSpreadable`),lo(`iterator`),lo(`match`),lo(`matchAll`),lo(`replace`),lo(`search`),lo(`species`),lo(`split`);var ml=lo,hl=ho;ml(`toPrimitive`),hl();var gl=F,_l=lo,vl=To;_l(`toStringTag`),vl(gl(`Symbol`),`Symbol`),lo(`unscopables`),To(o.JSON,`JSON`,!0);var yl=we.Symbol,bl={},xl=O,Sl=Et,Cl=Function.prototype,wl=xl&&Object.getOwnPropertyDescriptor,Tl=Sl(Cl,`name`),El={EXISTS:Tl,PROPER:Tl&&(function(){}).name===`something`,CONFIGURABLE:Tl&&(!xl||xl&&wl(Cl,`name`).configurable)},Dl=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ol=Et,kl=E,Al=St,jl=_a,Ml=Dl,Nl=jl(`IE_PROTO`),Pl=Object,Fl=Pl.prototype,Il=Ml?Pl.getPrototypeOf:function(e){var t=Al(e);if(Ol(t,Nl))return t[Nl];var n=t.constructor;return kl(n)&&t instanceof n?n.prototype:t instanceof Pl?Fl:null},Ll=s,Rl=E,zl=M,Bl=Ia,Vl=Il,Hl=to,Ul=Vt(`iterator`),Wl=!1,Gl,Kl,ql;[].keys&&(ql=[].keys(),`next`in ql?(Kl=Vl(Vl(ql)),Kl!==Object.prototype&&(Gl=Kl)):Wl=!0),Gl=!zl(Gl)||Ll(function(){var e={};return Gl[Ul].call(e)!==e})?{}:Bl(Gl),Rl(Gl[Ul])||Hl(Gl,Ul,function(){return this});var Jl={IteratorPrototype:Gl,BUGGY_SAFARI_ITERATORS:Wl},Yl=Jl.IteratorPrototype,Xl=Ia,Zl=ce,Ql=To,$l=bl,eu=function(){return this},tu=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=Xl(Yl,{next:Zl(+!r,n)}),Ql(e,i,!1,!0),$l[i]=eu,e},nu=v,ru=et,iu=function(e,t,n){try{return nu(ru(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},au=E,ou=String,su=TypeError,cu=function(e){if(typeof e==`object`||au(e))return e;throw new su(`Can't set `+ou(e)+` as a prototype`)},lu=iu,uu=Ln,du=cu,fu=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=lu(Object.prototype,`__proto__`,`set`),n(t,[]),e=t instanceof Array}catch{}return function(t,r){return uu(t),du(r),e?n(t,r):t.__proto__=r,t}}():void 0),pu=R,mu=A,hu=El,gu=tu,_u=Il,vu=To,yu=to,bu=Vt,xu=bl,Su=Jl,Cu=hu.PROPER;hu.CONFIGURABLE,Su.IteratorPrototype;var wu=Su.BUGGY_SAFARI_ITERATORS,Tu=bu(`iterator`),Eu=`keys`,Du=`values`,Ou=`entries`,ku=function(){return this},Au=function(e,t,n,r,i,a,o){gu(n,t,r);var s=function(e){if(e===i&&f)return f;if(!wu&&e&&e in u)return u[e];switch(e){case Eu:return function(){return new n(this,e)};case Du:return function(){return new n(this,e)};case Ou:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+` Iterator`,l=!1,u=e.prototype,d=u[Tu]||u[`@@iterator`]||i&&u[i],f=!wu&&d||s(i),p=t===`Array`&&u.entries||d,m,h,g;if(p&&(m=_u(p.call(new e)),m!==Object.prototype&&m.next&&(vu(m,c,!0,!0),xu[c]=ku)),Cu&&i===Du&&d&&d.name!==Du&&(l=!0,f=function(){return mu(d,this)}),i)if(h={values:s(Du),keys:a?f:s(Eu),entries:s(Ou)},o)for(g in h)(wu||l||!(g in u))&&yu(u,g,h[g]);else pu({target:t,proto:!0,forced:wu||l},h);return o&&u[Tu]!==f&&yu(u,Tu,f,{name:i}),xu[t]=f,h},ju=function(e,t){return{value:e,done:t}},Mu=xe,Nu=bl,Pu=qo;Mn.f;var Fu=Au,Iu=ju,Lu=`Array Iterator`,Ru=Pu.set,zu=Pu.getterFor(Lu);Fu(Array,`Array`,function(e,t){Ru(this,{type:Lu,target:Mu(e),index:0,kind:t})},function(){var e=zu(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Iu(void 0,!0);switch(e.kind){case`keys`:return Iu(n,!1);case`values`:return Iu(t[n],!1)}return Iu([n,t[n]],!1)},`values`),Nu.Arguments=Nu.Array;var Bu={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},Vu=o,Hu=Ur,Uu=Xn,Wu=bl,Gu=Vt(`toStringTag`);for(var Ku in Bu){var qu=Vu[Ku],Ju=qu&&qu.prototype;Ju&&Hu(Ju)!==Gu&&Uu(Ju,Gu,Ku),Wu[Ku]=Wu.Array}var Yu=yl,Xu=Vt,Zu=Mn.f,Qu=Xu(`metadata`),$u=Function.prototype;$u[Qu]===void 0&&Zu($u,Qu,{value:null}),lo(`asyncDispose`),lo(`dispose`),lo(`metadata`);var ed=Yu,td=F,nd=v,rd=td(`Symbol`),id=rd.keyFor,ad=nd(rd.prototype.valueOf),od=rd.isRegisteredSymbol||function(e){try{return id(ad(e))!==void 0}catch{return!1}};R({target:`Symbol`,stat:!0},{isRegisteredSymbol:od});for(var sd=yt,cd=F,ld=v,ud=Je,dd=Vt,fd=cd(`Symbol`),pd=fd.isWellKnownSymbol,md=cd(`Object`,`getOwnPropertyNames`),hd=ld(fd.prototype.valueOf),gd=sd(`wks`),_d=0,vd=md(fd),yd=vd.length;_d<yd;_d++)try{var bd=vd[_d];ud(fd[bd])&&dd(bd)}catch{}var xd=function(e){if(pd&&pd(e))return!0;try{for(var t=hd(e),n=0,r=md(gd),i=r.length;n<i;n++)if(gd[r[n]]==t)return!0}catch{}return!1};R({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:xd}),lo(`matcher`),lo(`observable`),R({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:od}),R({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:xd}),lo(`metadataKey`),lo(`patternMatch`),lo(`replaceAll`);var Sd=ed,Cd=r(Sd),wd=v,Td=xr,Ed=Ri,Dd=ve,Od=wd(``.charAt),kd=wd(``.charCodeAt),Ad=wd(``.slice),jd=function(e){return function(t,n){var r=Ed(Dd(t)),i=Td(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=kd(r,i),o<55296||o>56319||i+1===a||(s=kd(r,i+1))<56320||s>57343?e?Od(r,i):o:e?Ad(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},Md={codeAt:jd(!1),charAt:jd(!0)}.charAt,Nd=Ri,Pd=qo,Fd=Au,Id=ju,Ld=`String Iterator`,Rd=Pd.set,zd=Pd.getterFor(Ld);Fd(String,`String`,function(e){Rd(this,{type:Ld,string:Nd(e),index:0})},function(){var e=zd(this),t=e.string,n=e.index,r;return n>=t.length?Id(void 0,!0):(r=Md(t,n),e.index+=r.length,Id(r,!1))});var Bd=io.f(`iterator`),Vd=Bd,Hd=r(Vd);function Ud(e){"@babel/helpers - typeof";return Ud=typeof Cd==`function`&&typeof Hd==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Cd==`function`&&e.constructor===Cd&&e!==Cd.prototype?`symbol`:typeof e},Ud(e)}var Wd=r(io.f(`toPrimitive`));function Gd(e,t){if(Ud(e)!==`object`||e===null)return e;var n=e[Wd];if(n!==void 0){var r=n.call(e,t||`default`);if(Ud(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Kd(e){var t=Gd(e,`string`);return Ud(t)===`symbol`?t:String(t)}function qd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),hr(e,Kd(r.key),r)}}function Jd(e,t,n){return t&&qd(e.prototype,t),n&&qd(e,n),hr(e,`prototype`,{writable:!1}),e}function Yd(e,t,n){return t=Kd(t),t in e?hr(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Xd=v,Zd=et,Qd=M,$d=Et,ef=Ac,tf=c,nf=Function,rf=Xd([].concat),af=Xd([].join),of={},sf=function(e,t,n){if(!$d(of,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;of[t]=nf(`C,a`,`return new C(`+af(r,`,`)+`)`)}return of[t](e,n)},cf=tf?nf.bind:function(e){var t=Zd(this),n=t.prototype,r=ef(arguments,1),i=function(){var n=rf(r,ef(arguments));return this instanceof i?sf(t,n.length,n):t.apply(e,n)};return Qd(n)&&(i.prototype=n),i},lf=R,uf=cf;lf({target:`Function`,proto:!0,forced:Function.bind!==uf},{bind:uf});var df=o,ff=we,pf=function(e,t){var n=ff[e+`Prototype`],r=n&&n[t];if(r)return r;var i=df[e],a=i&&i.prototype;return a&&a[t]},mf=pf(`Function`,`bind`),hf=De,gf=mf,_f=Function.prototype,vf=function(e){var t=e.bind;return e===_f||hf(_f,e)&&t===_f.bind?gf:t},yf=r(vf),bf=et,xf=St,Sf=me,Cf=Tr,wf=TypeError,Tf=function(e){return function(t,n,r,i){bf(n);var a=xf(t),o=Sf(a),s=Cf(a),c=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw new wf(`Reduce of empty array with no initial value`)}for(;e?c>=0:s>c;c+=l)c in o&&(i=n(i,o[c],c,a));return i}},Ef={left:Tf(!1),right:Tf(!0)},V=s,Df=function(e,t){var n=[][e];return!!n&&V(function(){n.call(null,t||function(){return 1},1)})},Of=S(o.process)===`process`,kf=R,Af=Ef.left,jf=Df,Mf=Le;kf({target:`Array`,proto:!0,forced:!Of&&Mf>79&&Mf<83||!jf(`reduce`)},{reduce:function(e){var t=arguments.length;return Af(this,e,t,t>1?arguments[1]:void 0)}});var Nf=pf(`Array`,`reduce`),Pf=De,Ff=Nf,If=Array.prototype,Lf=r(function(e){var t=e.reduce;return e===If||Pf(If,e)&&t===If.reduce?Ff:t}),Rf=R,zf=ns.filter;Rf({target:`Array`,proto:!0,forced:!bi(`filter`)},{filter:function(e){return zf(this,e,arguments.length>1?arguments[1]:void 0)}});var Bf=pf(`Array`,`filter`),Vf=De,Hf=Bf,Uf=Array.prototype,Wf=r(function(e){var t=e.filter;return e===Uf||Vf(Uf,e)&&t===Uf.filter?Hf:t}),Gf=R,Kf=ns.map;Gf({target:`Array`,proto:!0,forced:!bi(`map`)},{map:function(e){return Kf(this,e,arguments.length>1?arguments[1]:void 0)}});var qf=pf(`Array`,`map`),Jf=De,Yf=qf,Xf=Array.prototype,Zf=r(function(e){var t=e.map;return e===Xf||Jf(Xf,e)&&t===Xf.map?Yf:t}),Qf=_r,$f=Tr,ep=Or,tp=jn,np=function(e,t,n,r,i,a,o,s){for(var c=i,l=0,u=o?tp(o,s):!1,d,f;l<r;)l in n&&(d=u?u(n[l],l,t):n[l],a>0&&Qf(d)?(f=$f(d),c=np(e,t,d,f,c,a-1)-1):(ep(c+1),e[c]=d),c++),l++;return c},rp=np,ip=R,ap=rp,op=et,sp=St,cp=Tr,lp=hi;ip({target:`Array`,proto:!0},{flatMap:function(e){var t=sp(this),n=cp(t),r;return op(e),r=lp(t,0),r.length=ap(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}});var up=pf(`Array`,`flatMap`),dp=De,fp=up,pp=Array.prototype,mp=r(function(e){var t=e.flatMap;return e===pp||dp(pp,e)&&t===pp.flatMap?fp:t});function hp(e){return new _p(e)}var gp=function(){function e(n,r,i){var a,o,s;t(this,e),Yd(this,`_listeners`,{add:yf(a=this._add).call(a,this),remove:yf(o=this._remove).call(o,this),update:yf(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return Jd(e,[{key:`all`,value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:`start`,value:function(){return this._source.on(`add`,this._listeners.add),this._source.on(`remove`,this._listeners.remove),this._source.on(`update`,this._listeners.update),this}},{key:`stop`,value:function(){return this._source.off(`add`,this._listeners.add),this._source.off(`remove`,this._listeners.remove),this._source.off(`update`,this._listeners.update),this}},{key:`_transformItems`,value:function(e){var t;return Lf(t=this._transformers).call(t,function(e,t){return t(e)},e)}},{key:`_add`,value:function(e,t){t!=null&&this._target.add(this._transformItems(this._source.get(t.items)))}},{key:`_update`,value:function(e,t){t!=null&&this._target.update(this._transformItems(this._source.get(t.items)))}},{key:`_remove`,value:function(e,t){t!=null&&this._target.remove(this._transformItems(t.oldData))}}]),e}(),_p=function(){function e(n){t(this,e),Yd(this,`_transformers`,[]),this._source=n}return Jd(e,[{key:`filter`,value:function(e){return this._transformers.push(function(t){return Wf(t).call(t,e)}),this}},{key:`map`,value:function(e){return this._transformers.push(function(t){return Zf(t).call(t,e)}),this}},{key:`flatMap`,value:function(e){return this._transformers.push(function(t){return mp(t).call(t,e)}),this}},{key:`to`,value:function(e){return new gp(this._source,this._transformers,e)}}]),e}(),vp=A,yp=Ln,bp=rt,xp=function(e,t,n){var r,i;yp(e);try{if(r=bp(e,`return`),!r){if(t===`throw`)throw n;return n}r=vp(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return yp(r),n},Sp=Ln,Cp=xp,wp=function(e,t,n,r){try{return r?t(Sp(n)[0],n[1]):t(n)}catch(t){Cp(e,`throw`,t)}},Tp=Vt,Ep=bl,Dp=Tp(`iterator`),Op=Array.prototype,kp=function(e){return e!==void 0&&(Ep.Array===e||Op[Dp]===e)},Ap=Ur,jp=rt,Mp=he,Np=bl,Pp=Vt(`iterator`),Fp=function(e){if(!Mp(e))return jp(e,Pp)||jp(e,`@@iterator`)||Np[Ap(e)]},Ip=A,Lp=et,Rp=Ln,zp=Xe,Bp=Fp,Vp=TypeError,Hp=function(e,t){var n=arguments.length<2?Bp(e):t;if(Lp(n))return Rp(Ip(n,e));throw new Vp(zp(e)+` is not iterable`)},Up=jn,Wp=A,Gp=St,Kp=wp,qp=kp,Jp=ci,Yp=Tr,Xp=Mr,Zp=Hp,Qp=Fp,$p=Array,em=function(e){var t=Gp(e),n=Jp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Up(i,r>2?arguments[2]:void 0));var o=Qp(t),s=0,c,l,u,d,f,p;if(o&&!(this===$p&&qp(o)))for(d=Zp(t,o),f=d.next,l=n?new this:[];!(u=Wp(f,d)).done;s++)p=a?Kp(d,i,[u.value,s],!0):u.value,Xp(l,s,p);else for(c=Yp(t),l=n?new this(c):$p(c);c>s;s++)p=a?i(t[s],s):t[s],Xp(l,s,p);return l.length=s,l},tm=Vt(`iterator`),nm=!1;try{var rm=0,im={next:function(){return{done:!!rm++}},return:function(){nm=!0}};im[tm]=function(){return this},Array.from(im,function(){throw 2})}catch{}var am=function(e,t){try{if(!t&&!nm)return!1}catch{return!1}var n=!1;try{var r={};r[tm]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},om=R,sm=em;om({target:`Array`,stat:!0,forced:!am(function(e){Array.from(e)})},{from:sm});var cm=we.Array.from,lm=r(cm),um=Fp,dm=r(um),fm=r(um);R({target:`Array`,stat:!0},{isArray:_r});var pm=we.Array.isArray,mm=r(pm);function hm(e){if(mm(e))return e}var gm=O,_m=_r,vm=TypeError,ym=Object.getOwnPropertyDescriptor,bm=gm&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(_m(e)&&!ym(e,`length`).writable)throw new vm(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},xm=R,Sm=St,Cm=Tr,wm=bm,Tm=Or;xm({target:`Array`,proto:!0,arity:1,forced:s(function(){return[].push.call({length:4294967296},1)!==4294967297})||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=Sm(this),n=Cm(t),r=arguments.length;Tm(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return wm(t,n),n}});var Em=pf(`Array`,`push`),Dm=De,Om=Em,km=Array.prototype,Am=function(e){var t=e.push;return e===km||Dm(km,e)&&t===km.push?Om:t},jm=r(Am);function Mm(e,t){var n=e==null?null:Cd!==void 0&&dm(e)||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(jm(s).call(s,r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}var Nm=R,Pm=_r,Fm=ci,Im=M,Lm=Ui,Rm=Tr,zm=xe,Bm=Mr,Vm=Vt,Hm=bi,Um=Ac,Wm=Hm(`slice`),Gm=Vm(`species`),Km=Array,qm=Math.max;Nm({target:`Array`,proto:!0,forced:!Wm},{slice:function(e,t){var n=zm(this),r=Rm(n),i=Lm(e,r),a=Lm(t===void 0?r:t,r),o,s,c;if(Pm(n)&&(o=n.constructor,Fm(o)&&(o===Km||Pm(o.prototype))?o=void 0:Im(o)&&(o=o[Gm],o===null&&(o=void 0)),o===Km||o===void 0))return Um(n,i,a);for(s=new(o===void 0?Km:o)(qm(a-i,0)),c=0;i<a;i++,c++)i in n&&Bm(s,c,n[i]);return s.length=c,s}});var Jm=pf(`Array`,`slice`),Ym=De,Xm=Jm,Zm=Array.prototype,Qm=function(e){var t=e.slice;return e===Zm||Ym(Zm,e)&&t===Zm.slice?Xm:t},$m=Qm,eh=r($m),th=r(cm);function nh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rh(e,t){var n;if(e){if(typeof e==`string`)return nh(e,t);var r=eh(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return th(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nh(e,t)}}function ih(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ah(e,t){return hm(e)||Mm(e,t)||rh(e,t)||ih()}function oh(e){if(mm(e))return nh(e)}function sh(e){if(Cd!==void 0&&dm(e)!=null||e[`@@iterator`]!=null)return th(e)}function ch(){throw TypeError(`Invalid attempt to spread non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lh(e){return oh(e)||sh(e)||rh(e)||ch()}var uh=r(Yu),dh=pf(`Array`,`concat`),fh=De,ph=dh,mh=Array.prototype,hh=r(function(e){var t=e.concat;return e===mh||fh(mh,e)&&t===mh.concat?ph:t}),gh=r(Qm),_h=F,vh=v,yh=La,bh=$a,xh=Ln,Sh=vh([].concat),Ch=_h(`Reflect`,`ownKeys`)||function(e){var t=yh.f(xh(e)),n=bh.f;return n?Sh(t,n(e)):t};R({target:`Reflect`,stat:!0},{ownKeys:Ch});var wh=we.Reflect.ownKeys,Th=r(wh),Eh=r(pm),Dh=R,Oh=St,kh=oa;Dh({target:`Object`,stat:!0,forced:s(function(){kh(1)})},{keys:function(e){return kh(Oh(e))}});var Ah=we.Object.keys,jh=r(Ah),Mh=ns.forEach,Nh=Df(`forEach`)?[].forEach:function(e){return Mh(this,e,arguments.length>1?arguments[1]:void 0)},Ph=R,Fh=Nh;Ph({target:`Array`,proto:!0,forced:[].forEach!==Fh},{forEach:Fh});var Ih=pf(`Array`,`forEach`),Lh=Ur,H=Et,Rh=De,zh=Ih,Bh=Array.prototype,Vh={DOMTokenList:!0,NodeList:!0},Hh=function(e){var t=e.forEach;return e===Bh||Rh(Bh,e)&&t===Bh.forEach||H(Vh,Lh(e))?zh:t},Uh=r(Hh),Wh=R,Gh=v,Kh=_r,qh=Gh([].reverse),Jh=[1,2];Wh({target:`Array`,proto:!0,forced:String(Jh)===String(Jh.reverse())},{reverse:function(){return Kh(this)&&(this.length=this.length),qh(this)}});var Yh=pf(`Array`,`reverse`),Xh=De,Zh=Yh,Qh=Array.prototype,$h=function(e){var t=e.reverse;return e===Qh||Xh(Qh,e)&&t===Qh.reverse?Zh:t},eg=r($h),tg=Xe,ng=TypeError,rg=function(e,t){if(!delete e[t])throw new ng(`Cannot delete property `+tg(t)+` of `+tg(e))},ig=R,ag=St,og=Ui,sg=xr,cg=Tr,lg=bm,ug=Or,dg=hi,fg=Mr,pg=rg,mg=bi(`splice`),hg=Math.max,gg=Math.min;ig({target:`Array`,proto:!0,forced:!mg},{splice:function(e,t){var n=ag(this),r=cg(n),i=og(e,r),a=arguments.length,o,s,c,l,u,d;for(a===0?o=s=0:a===1?(o=0,s=r-i):(o=a-2,s=gg(hg(sg(t),0),r-i)),ug(r+o-s),c=dg(n,s),l=0;l<s;l++)u=i+l,u in n&&fg(c,l,n[u]);if(c.length=s,o<s){for(l=i;l<r-s;l++)u=l+s,d=l+o,u in n?n[d]=n[u]:pg(n,d);for(l=r;l>r-s+o;l--)pg(n,l-1)}else if(o>s)for(l=r-s;l>i;l--)u=l+s-1,d=l+o-1,u in n?n[d]=n[u]:pg(n,d);for(l=0;l<o;l++)n[l+i]=arguments[l+2];return lg(n,r-s+o),c}});var _g=pf(`Array`,`splice`),vg=De,yg=_g,bg=Array.prototype,xg=r(function(e){var t=e.splice;return e===bg||vg(bg,e)&&t===bg.splice?yg:t}),Sg=O,Cg=v,wg=A,Tg=s,Eg=oa,Dg=$a,Og=ae,kg=St,Ag=me,jg=Object.assign,Mg=Object.defineProperty,Ng=Cg([].concat),Pg=!jg||Tg(function(){if(Sg&&jg({b:1},jg(Mg({},`a`,{enumerable:!0,get:function(){Mg(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},n=Symbol(`assign detection`),r=`abcdefghijklmnopqrst`;return e[n]=7,r.split(``).forEach(function(e){t[e]=e}),jg({},e)[n]!==7||Eg(jg({},t)).join(``)!==r})?function(e,t){for(var n=kg(e),r=arguments.length,i=1,a=Dg.f,o=Og.f;r>i;)for(var s=Ag(arguments[i++]),c=a?Ng(Eg(s),a(s)):Eg(s),l=c.length,u=0,d;l>u;)d=c[u++],(!Sg||wg(o,s,d))&&(n[d]=s[d]);return n}:jg,Fg=R,Ig=Pg;Fg({target:`Object`,stat:!0,arity:2,forced:Object.assign!==Ig},{assign:Ig});var Lg=we.Object.assign,Rg=r(Lg),zg=R,Bg=s,Vg=St,Hg=Il,Ug=Dl;zg({target:`Object`,stat:!0,forced:Bg(function(){Hg(1)}),sham:!Ug},{getPrototypeOf:function(e){return Hg(Vg(e))}});var Wg=we.Object.getPrototypeOf;R({target:`Object`,stat:!0,sham:!O},{create:Ia});var Gg=we.Object,Kg=function(e,t){return Gg.create(e,t)},qg=r(Kg),Jg=we,Yg=p;Jg.JSON||={stringify:JSON.stringify};var Xg=r(function(e,t,n){return Yg(Jg.JSON.stringify,null,arguments)}),Zg=typeof Bun==`function`&&Bun&&typeof Bun.version==`string`,Qg=TypeError,$g=function(e,t){if(e<t)throw new Qg(`Not enough arguments`);return e},e_=o,t_=p,n_=E,r_=Zg,i_=Oe,a_=Ac,o_=$g,s_=e_.Function,c_=/MSIE .\./.test(i_)||r_&&(function(){var e=e_.Bun.version.split(`.`);return e.length<3||e[0]===`0`&&(e[1]<3||e[1]===`3`&&e[2]===`0`)})(),l_=function(e,t){var n=t?2:1;return c_?function(r,i){var a=o_(arguments.length,1)>n,o=n_(r)?r:s_(r),s=a?a_(arguments,n):[],c=a?function(){t_(o,this,s)}:o;return t?e(c,i):e(c)}:e},u_=R,d_=o,f_=l_(d_.setInterval,!0);u_({global:!0,bind:!0,forced:d_.setInterval!==f_},{setInterval:f_});var p_=R,m_=o,h_=l_(m_.setTimeout,!0);p_({global:!0,bind:!0,forced:m_.setTimeout!==h_},{setTimeout:h_});var g_=we.setTimeout,__=r(g_),v_={exports:{}};(function(e){function t(e){if(e)return n(e);this._callbacks=new Map}function n(e){return Object.assign(e,t.prototype),e._callbacks=new Map,e}t.prototype.on=function(e,t){let n=this._callbacks.get(e)??[];return n.push(t),this._callbacks.set(e,n),this},t.prototype.once=function(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.fn=t,this.on(e,n),this},t.prototype.off=function(e,t){if(e===void 0&&t===void 0)return this._callbacks.clear(),this;if(t===void 0)return this._callbacks.delete(e),this;let n=this._callbacks.get(e);if(n){for(let[e,r]of n.entries())if(r===t||r.fn===t){n.splice(e,1);break}n.length===0?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},t.prototype.emit=function(e,...t){let n=this._callbacks.get(e);if(n){let e=[...n];for(let n of e)n.apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks.get(e)??[]},t.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;let t=0;for(let e of this._callbacks.values())t+=e.length;return t},t.prototype.hasListeners=function(e){return this.listenerCount(e)>0},t.prototype.addEventListener=t.prototype.on,t.prototype.removeListener=t.prototype.off,t.prototype.removeEventListener=t.prototype.off,t.prototype.removeAllListeners=t.prototype.off,e.exports=t})(v_);var y_=v_.exports,b_=r(y_);function x_(){return x_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x_.apply(this,arguments)}function S_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function C_(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var w_=typeof Object.assign==`function`?Object.assign:function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t},T_=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],E_=typeof document>`u`?{style:{}}:document.createElement(`div`),D_=`function`,O_=Math.round,k_=Math.abs,A_=Date.now;function j_(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<T_.length;){if(n=T_[a],r=n?n+i:t,r in e)return r;a++}}var M_=typeof window>`u`?{}:window,N_=j_(E_.style,`touchAction`),P_=N_!==void 0;function F_(){if(!P_)return!1;var e={},t=M_.CSS&&M_.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(n){return e[n]=t?M_.CSS.supports(`touch-action`,n):!0}),e}var I_=`compute`,L_=`auto`,R_=`manipulation`,z_=`none`,B_=`pan-x`,V_=`pan-y`,H_=F_(),U_=/mobile|tablet|ip(ad|hone|od)|android/i,W_=`ontouchstart`in M_,G_=j_(M_,`PointerEvent`)!==void 0,K_=W_&&U_.test(navigator.userAgent),q_=`touch`,J_=`pen`,Y_=`mouse`,X_=`kinect`,Z_=25,Q_=1,$_=2,ev=4,tv=8,nv=1,rv=2,iv=4,av=8,ov=16,sv=rv|iv,cv=av|ov,lv=sv|cv,uv=[`x`,`y`],dv=[`clientX`,`clientY`];function fv(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==void 0)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function pv(e,t){return typeof e===D_?e.apply(t&&t[0]||void 0,t):e}function mv(e,t){return e.indexOf(t)>-1}function hv(e){if(mv(e,z_))return z_;var t=mv(e,B_),n=mv(e,V_);return t&&n?z_:t||n?t?B_:V_:mv(e,R_)?R_:L_}var gv=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===I_&&(e=this.compute()),P_&&this.manager.element.style&&H_[e]&&(this.manager.element.style[N_]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return fv(this.manager.recognizers,function(t){pv(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),hv(e.join(` `))},t.preventDefaults=function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented){t.preventDefault();return}var r=this.actions,i=mv(r,z_)&&!H_[z_],a=mv(r,V_)&&!H_[V_],o=mv(r,B_)&&!H_[B_];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!(o&&a)&&(i||a&&n&sv||o&&n&cv))return this.preventSrc(t)},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function _v(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function vv(e){var t=e.length;if(t===1)return{x:O_(e[0].clientX),y:O_(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:O_(n/t),y:O_(r/t)}}function yv(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:O_(e.pointers[n].clientX),clientY:O_(e.pointers[n].clientY)},n++;return{timeStamp:A_(),pointers:t,center:vv(t),deltaX:e.deltaX,deltaY:e.deltaY}}function bv(e,t,n){n||=uv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function xv(e,t,n){n||=uv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function Sv(e,t){return e===t?nv:k_(e)>=k_(t)?e<0?rv:iv:t<0?av:ov}function Cv(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===Q_||a.eventType===ev)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function wv(e,t,n){return{x:t/e||0,y:n/e||0}}function Tv(e,t){return bv(t[0],t[1],dv)/bv(e[0],e[1],dv)}function Ev(e,t){return xv(t[1],t[0],dv)+xv(e[1],e[0],dv)}function Dv(e,t){var n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,i,a,o,s;if(t.eventType!==tv&&(r>Z_||n.velocity===void 0)){var c=t.deltaX-n.deltaX,l=t.deltaY-n.deltaY,u=wv(r,c,l);a=u.x,o=u.y,i=k_(u.x)>k_(u.y)?u.x:u.y,s=Sv(c,l),e.lastInterval=t}else i=n.velocity,a=n.velocityX,o=n.velocityY,s=n.direction;t.velocity=i,t.velocityX=a,t.velocityY=o,t.direction=s}function Ov(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||=yv(t),i>1&&!n.firstMultiple?n.firstMultiple=yv(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=vv(r);t.timeStamp=A_(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=xv(s,c),t.distance=bv(s,c),Cv(n,t),t.offsetDirection=Sv(t.deltaX,t.deltaY);var l=wv(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=k_(l.x)>k_(l.y)?l.x:l.y,t.scale=o?Tv(o.pointers,r):1,t.rotation=o?Ev(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,Dv(n,t);var u=e.element,d=t.srcEvent,f=d.composedPath?d.composedPath()[0]:d.path?d.path[0]:d.target;_v(f,u)&&(u=f),t.target=u}function kv(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&Q_&&r-i===0,o=t&(ev|tv)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,Ov(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function Av(e){return e.trim().split(/\s+/g)}function jv(e,t,n){fv(Av(t),function(t){e.addEventListener(t,n,!1)})}function U(e,t,n){fv(Av(t),function(t){e.removeEventListener(t,n,!1)})}function Mv(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}var Nv=function(){function e(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){pv(e.options.enable,[e])&&n.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&jv(this.element,this.evEl,this.domHandler),this.evTarget&&jv(this.target,this.evTarget,this.domHandler),this.evWin&&jv(Mv(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&U(this.element,this.evEl,this.domHandler),this.evTarget&&U(this.target,this.evTarget,this.domHandler),this.evWin&&U(Mv(this.element),this.evWin,this.domHandler)},e}();function Pv(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}var Fv={pointerdown:Q_,pointermove:$_,pointerup:ev,pointercancel:tv,pointerout:tv},Iv={2:q_,3:J_,4:Y_,5:X_},Lv=`pointerdown`,Rv=`pointermove pointerup pointercancel`;M_.MSPointerEvent&&!M_.PointerEvent&&(Lv=`MSPointerDown`,Rv=`MSPointerMove MSPointerUp MSPointerCancel`);var zv=function(e){S_(t,e);function t(){var n,r=t.prototype;return r.evEl=Lv,r.evWin=Rv,n=e.apply(this,arguments)||this,n.store=n.manager.session.pointerEvents=[],n}var n=t.prototype;return n.handler=function(e){var t=this.store,n=!1,r=Fv[e.type.toLowerCase().replace(`ms`,``)],i=Iv[e.pointerType]||e.pointerType,a=i===q_,o=Pv(t,e.pointerId,`pointerId`);r&Q_&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&(ev|tv)&&(n=!0),!(o<0)&&(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))},t}(Nv);function Bv(e){return Array.prototype.slice.call(e,0)}function Vv(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];Pv(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}var Hv={touchstart:Q_,touchmove:$_,touchend:ev,touchcancel:tv},Uv=`touchstart touchmove touchend touchcancel`,Wv=function(e){S_(t,e);function t(){var n;return t.prototype.evTarget=Uv,n=e.apply(this,arguments)||this,n.targetIds={},n}var n=t.prototype;return n.handler=function(e){var t=Hv[e.type],n=Gv.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:q_,srcEvent:e})},t}(Nv);function Gv(e,t){var n=Bv(e.touches),r=this.targetIds;if(t&(Q_|$_)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=Bv(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return _v(e.target,c)}),t===Q_)for(i=0;i<a.length;)r[a[i].identifier]=!0,i++;for(i=0;i<o.length;)r[o[i].identifier]&&s.push(o[i]),t&(ev|tv)&&delete r[o[i].identifier],i++;if(s.length)return[Vv(a.concat(s),`identifier`,!0),s]}var Kv={mousedown:Q_,mousemove:$_,mouseup:ev},qv=`mousedown`,Jv=`mousemove mouseup`,Yv=function(e){S_(t,e);function t(){var n,r=t.prototype;return r.evEl=qv,r.evWin=Jv,n=e.apply(this,arguments)||this,n.pressed=!1,n}var n=t.prototype;return n.handler=function(e){var t=Kv[e.type];t&Q_&&e.button===0&&(this.pressed=!0),t&$_&&e.which!==1&&(t=ev),this.pressed&&(t&ev&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:Y_,srcEvent:e}))},t}(Nv),Xv=2500,Zv=25;function Qv(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY},r=this.lastTouches;this.lastTouches.push(n),setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},Xv)}}function $v(e,t){e&Q_?(this.primaryTouch=t.changedPointers[0].identifier,Qv.call(this,t)):e&(ev|tv)&&Qv.call(this,t)}function ey(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=Zv&&o<=Zv)return!0}return!1}var ty=function(){return function(e){S_(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.handler=function(e,t,n){var i=n.pointerType===q_,a=n.pointerType===Y_;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)$v.call(C_(C_(r)),t,n);else if(a&&ey.call(C_(C_(r)),n))return;r.callback(e,t,n)}},r.touch=new Wv(r.manager,r.handler),r.mouse=new Yv(r.manager,r.handler),r.primaryTouch=null,r.lastTouches=[],r}var n=t.prototype;return n.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Nv)}();function ny(e){var t;return t=e.options.inputClass||(G_?zv:K_?Wv:W_?ty:Yv),new t(e,kv)}function ry(e,t,n){return Array.isArray(e)?(fv(e,n[t],n),!0):!1}var iy=1,ay=2,oy=4,sy=8,cy=sy,ly=16,uy=32,dy=1;function fy(){return dy++}function W(e,t){var n=t.manager;return n?n.get(e):e}function G(e){return e&ly?`cancel`:e&sy?`end`:e&oy?`move`:e&ay?`start`:``}var py=function(){function e(e){e===void 0&&(e={}),this.options=x_({enable:!0},e),this.id=fy(),this.manager=null,this.state=iy,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return w_(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(ry(e,`recognizeWith`,this))return this;var t=this.simultaneous;return e=W(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return ry(e,`dropRecognizeWith`,this)?this:(e=W(e,this),delete this.simultaneous[e.id],this)},t.requireFailure=function(e){if(ry(e,`requireFailure`,this))return this;var t=this.requireFail;return e=W(e,this),Pv(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(ry(e,`dropRequireFailure`,this))return this;e=W(e,this);var t=Pv(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<sy&&r(t.options.event+G(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=sy&&r(t.options.event+G(n))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=uy},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(uy|iy)))return!1;e++}return!0},t.recognize=function(e){var t=w_({},e);if(!pv(this.options.enable,[this,t])){this.reset(),this.state=uy;return}this.state&(cy|ly|uy)&&(this.state=iy),this.state=this.process(t),this.state&(ay|oy|sy|ly)&&this.tryEmit(t)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),my=function(e){S_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,x_({event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var n=t.prototype;return n.getTouchAction=function(){return[R_]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime<n.time;if(this.reset(),e.eventType&Q_&&this.count===0)return this.failTimeout();if(i&&a&&r){if(e.eventType!==ev)return this.failTimeout();var o=this.pTime?e.timeStamp-this.pTime<n.interval:!0,s=!this.pCenter||bv(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!s||!o?this.count=1:this.count+=1,this._input=e,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){t.state=cy,t.tryEmit()},n.interval),ay):cy}return uy},n.failTimeout=function(){var e=this;return this._timer=setTimeout(function(){e.state=uy},this.options.interval),uy},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){this.state===cy&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(py),hy=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({pointers:1},t))||this}var n=t.prototype;return n.attrTest=function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},n.process=function(e){var t=this.state,n=e.eventType,r=t&(ay|oy),i=this.attrTest(e);return r&&(n&tv||!i)?t|ly:r||i?n&ev?t|sy:t&ay?t|oy:ay:uy},t}(py);function gy(e){return e===ov?`down`:e===av?`up`:e===rv?`left`:e===iv?`right`:``}var _y=function(e){S_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,x_({event:`pan`,threshold:10,pointers:1,direction:lv},t))||this,n.pX=null,n.pY=null,n}var n=t.prototype;return n.getTouchAction=function(){var e=this.options.direction,t=[];return e&sv&&t.push(V_),e&cv&&t.push(B_),t},n.directionTest=function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&sv?(i=a===0?nv:a<0?rv:iv,n=a!==this.pX,r=Math.abs(e.deltaX)):(i=o===0?nv:o<0?av:ov,n=o!==this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},n.attrTest=function(e){return hy.prototype.attrTest.call(this,e)&&(this.state&ay||!(this.state&ay)&&this.directionTest(e))},n.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var n=gy(t.direction);n&&(t.additionalEvent=this.options.event+n),e.prototype.emit.call(this,t)},t}(hy),vy=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({event:`swipe`,threshold:10,velocity:.3,direction:sv|cv,pointers:1},t))||this}var n=t.prototype;return n.getTouchAction=function(){return _y.prototype.getTouchAction.call(this)},n.attrTest=function(t){var n=this.options.direction,r;return n&(sv|cv)?r=t.overallVelocity:n&sv?r=t.overallVelocityX:n&cv&&(r=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&k_(r)>this.options.velocity&&t.eventType&ev},n.emit=function(e){var t=gy(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(hy),yy=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({event:`pinch`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[z_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ay)},n.emit=function(t){if(t.scale!==1){var n=t.scale<1?`in`:`out`;t.additionalEvent=this.options.event+n}e.prototype.emit.call(this,t)},t}(hy),by=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({event:`rotate`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[z_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ay)},t}(hy),xy=function(e){S_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,x_({event:`press`,pointers:1,time:251,threshold:9},t))||this,n._timer=null,n._input=null,n}var n=t.prototype;return n.getTouchAction=function(){return[L_]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime>n.time;if(this._input=e,!i||!r||e.eventType&(ev|tv)&&!a)this.reset();else if(e.eventType&Q_)this.reset(),this._timer=setTimeout(function(){t.state=cy,t.tryEmit()},n.time);else if(e.eventType&ev)return cy;return uy},n.reset=function(){clearTimeout(this._timer)},n.emit=function(e){this.state===cy&&(e&&e.eventType&ev?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=A_(),this.manager.emit(this.options.event,this._input)))},t}(py),Sy={domEvents:!1,touchAction:I_,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}},Cy=[[by,{enable:!1}],[yy,{enable:!1},[`rotate`]],[vy,{direction:sv}],[_y,{direction:sv},[`swipe`]],[my],[my,{event:`doubletap`,taps:2},[`tap`]],[xy]],wy=1,Ty=2;function Ey(e,t){var n=e.element;if(n.style){var r;fv(e.options.cssProps,function(i,a){r=j_(n.style,a),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||``}),t||(e.oldCssProps={})}}function Dy(e,t){var n=document.createEvent(`Event`);n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var Oy=function(){function e(e,t){var n=this;this.options=w_({},Sy,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=ny(this),this.touchAction=new gv(this,this.options.touchAction),Ey(this,!0),fv(this.options.recognizers,function(e){var t=n.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}var t=e.prototype;return t.set=function(e){return w_(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?Ty:wy},t.recognize=function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&cy)&&(t.curRecognizer=null,i=null);for(var a=0;a<r.length;)n=r[a],t.stopped!==Ty&&(!i||n===i||n.canRecognizeWith(i))?n.recognize(e):n.reset(),!i&&n.state&(ay|oy|sy)&&(t.curRecognizer=n,i=n),a++}},t.get=function(e){if(e instanceof py)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event===e)return t[n];return null},t.add=function(e){if(ry(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(ry(e,`remove`,this))return this;var t=this.get(e);if(e){var n=this.recognizers,r=Pv(n,t);r!==-1&&(n.splice(r,1),this.touchAction.update())}return this},t.on=function(e,t){if(e===void 0||t===void 0)return this;var n=this.handlers;return fv(Av(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this},t.off=function(e,t){if(e===void 0)return this;var n=this.handlers;return fv(Av(e),function(e){t?n[e]&&n[e].splice(Pv(n[e],t),1):delete n[e]}),this},t.emit=function(e,t){this.options.domEvents&&Dy(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(!(!n||!n.length)){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},t.destroy=function(){this.element&&Ey(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),ky={touchstart:Q_,touchmove:$_,touchend:ev,touchcancel:tv},Ay=`touchstart`,jy=`touchstart touchmove touchend touchcancel`,My=function(e){S_(t,e);function t(){var n,r=t.prototype;return r.evTarget=Ay,r.evWin=jy,n=e.apply(this,arguments)||this,n.started=!1,n}var n=t.prototype;return n.handler=function(e){var t=ky[e.type];if(t===Q_&&(this.started=!0),this.started){var n=Ny.call(this,e,t);t&(ev|tv)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:q_,srcEvent:e})}},t}(Nv);function Ny(e,t){var n=Bv(e.touches),r=Bv(e.changedTouches);return t&(ev|tv)&&(n=Vv(n.concat(r),`identifier`,!0)),[n,r]}function Py(e,t,n){var r=`DEPRECATED METHOD: `+t+`
4
+ `+n+` AT
5
+ `;return function(){var t=Error(`get-stack-trace`),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,``).replace(/^\s+at\s+/gm,``).replace(/^Object.<anonymous>\s*\(/gm,`{anonymous}()@`):`Unknown Stack Trace`,i=window.console&&(window.console.warn||window.console.log);return i&&i.call(window.console,r,n),e.apply(this,arguments)}}var Fy=Py(function(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;)(!n||n&&e[r[i]]===void 0)&&(e[r[i]]=t[r[i]]),i++;return e},`extend`,"Use `assign`."),Iy=Py(function(e,t){return Fy(e,t,!0)},`merge`,"Use `assign`.");function Ly(e,t,n){var r=t.prototype,i=e.prototype=Object.create(r);i.constructor=e,i._super=r,n&&w_(i,n)}function Ry(e,t){return function(){return e.apply(t,arguments)}}var zy=function(){var e=function(e,t){return t===void 0&&(t={}),new Oy(e,x_({recognizers:Cy.concat()},t))};return e.VERSION=`2.0.17-rc`,e.DIRECTION_ALL=lv,e.DIRECTION_DOWN=ov,e.DIRECTION_LEFT=rv,e.DIRECTION_RIGHT=iv,e.DIRECTION_UP=av,e.DIRECTION_HORIZONTAL=sv,e.DIRECTION_VERTICAL=cv,e.DIRECTION_NONE=nv,e.DIRECTION_DOWN=ov,e.INPUT_START=Q_,e.INPUT_MOVE=$_,e.INPUT_END=ev,e.INPUT_CANCEL=tv,e.STATE_POSSIBLE=iy,e.STATE_BEGAN=ay,e.STATE_CHANGED=oy,e.STATE_ENDED=sy,e.STATE_RECOGNIZED=cy,e.STATE_CANCELLED=ly,e.STATE_FAILED=uy,e.Manager=Oy,e.Input=Nv,e.TouchAction=gv,e.TouchInput=Wv,e.MouseInput=Yv,e.PointerEventInput=zv,e.TouchMouseInput=ty,e.SingleTouchInput=My,e.Recognizer=py,e.AttrRecognizer=hy,e.Tap=my,e.Pan=_y,e.Swipe=vy,e.Pinch=yy,e.Rotate=by,e.Press=xy,e.on=jv,e.off=U,e.each=fv,e.merge=Iy,e.extend=Fy,e.bindFn=Ry,e.assign=w_,e.inherit=Ly,e.bindFn=Ry,e.prefixed=j_,e.toArray=Bv,e.inArray=Pv,e.uniqueArray=Vv,e.splitStr=Av,e.boolOrFn=pv,e.hasParent=_v,e.addEventListeners=jv,e.removeEventListeners=U,e.defaults=w_({},Sy,{preset:Cy}),e}();function By(e,t){var n=uh!==void 0&&fm(e)||e[`@@iterator`];if(!n){if(Eh(e)||(n=Vy(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
6
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(o)throw s}}}}function Vy(e,t){var n;if(e){if(typeof e==`string`)return Hy(e,t);var r=gh(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return lm(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hy(e,t)}}function Hy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Uy=uh(`DELETE`);function Wy(e){var t,n=[...arguments].slice(1);return Gy.apply(void 0,hh(t=[{},e]).call(t,n))}function Gy(){var e=Ky.apply(void 0,arguments);return Jy(e),e}function Ky(){var e=[...arguments];if(e.length<2)return e[0];if(e.length>2){var t;return Ky.apply(void 0,hh(t=[Gy(e[0],e[1])]).call(t,lh(gh(e).call(e,2))))}var n=e[0],r=e[1];if(n instanceof Date&&r instanceof Date)return n.setTime(r.getTime()),n;var i=By(Th(r)),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;Object.prototype.propertyIsEnumerable.call(r,o)&&(r[o]===Uy?delete n[o]:n[o]!==null&&r[o]!==null&&typeof n[o]==`object`&&typeof r[o]==`object`&&!Eh(n[o])&&!Eh(r[o])?n[o]=Ky(n[o],r[o]):n[o]=qy(r[o]))}}catch(e){i.e(e)}finally{i.f()}return n}function qy(e){return Eh(e)?Zf(e).call(e,function(e){return qy(e)}):typeof e==`object`&&e?e instanceof Date?new Date(e.getTime()):Ky({},e):e}function Jy(e){for(var t=0,n=jh(e);t<n.length;t++){var r=n[t];e[r]===Uy?delete e[r]:typeof e[r]==`object`&&e[r]!==null&&Jy(e[r])}}function Yy(){var e=function(){};return{on:e,off:e,destroy:e,emit:e,get(){return{set:e}}}}var Xy=typeof window<`u`?window.Hammer||zy:function(){return Yy()};function Zy(e){var t=this,n;this._cleanupQueue=[],this.active=!1,this._dom={container:e,overlay:document.createElement(`div`)},this._dom.overlay.classList.add(`vis-overlay`),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(function(){t._dom.overlay.parentNode.removeChild(t._dom.overlay)});var r=Xy(this._dom.overlay);r.on(`tap`,yf(n=this._onTapOverlay).call(n,this)),this._cleanupQueue.push(function(){r.destroy()});var i=[`tap`,`doubletap`,`press`,`pinch`,`pan`,`panstart`,`panmove`,`panend`];Uh(i).call(i,function(e){r.on(e,function(e){e.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=function(n){Qy(n.target,e)||t.deactivate()},document.body.addEventListener(`click`,this._onClick),this._cleanupQueue.push(function(){document.body.removeEventListener(`click`,t._onClick)})),this._escListener=function(e){(`key`in e?e.key===`Escape`:e.keyCode===27)&&t.deactivate()}}b_(Zy.prototype),Zy.current=null,Zy.prototype.destroy=function(){var e,t;this.deactivate();var n=By(eg(e=xg(t=this._cleanupQueue).call(t,0)).call(e)),r;try{for(n.s();!(r=n.n()).done;){var i=r.value;i()}}catch(e){n.e(e)}finally{n.f()}},Zy.prototype.activate=function(){Zy.current&&Zy.current.deactivate(),Zy.current=this,this.active=!0,this._dom.overlay.style.display=`none`,this._dom.container.classList.add(`vis-active`),this.emit(`change`),this.emit(`activate`),document.body.addEventListener(`keydown`,this._escListener)},Zy.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display=`block`,this._dom.container.classList.remove(`vis-active`),document.body.removeEventListener(`keydown`,this._escListener),this.emit(`change`),this.emit(`deactivate`)},Zy.prototype._onTapOverlay=function(e){this.activate(),e.srcEvent.stopPropagation()};function Qy(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}var $y=ci,eb=Xe,tb=TypeError,nb=function(e){if($y(e))return e;throw new tb(eb(e)+` is not a constructor`)},rb=R,ib=F,ab=p,ob=cf,sb=nb,cb=Ln,lb=M,ub=Ia,db=s,fb=ib(`Reflect`,`construct`),pb=Object.prototype,mb=[].push,hb=db(function(){function e(){}return!(fb(function(){},[],e)instanceof e)}),gb=!db(function(){fb(function(){})}),_b=hb||gb;rb({target:`Reflect`,stat:!0,forced:_b,sham:_b},{construct:function(e,t){sb(e),cb(t);var n=arguments.length<3?e:sb(arguments[2]);if(gb&&!hb)return fb(e,t,n);if(e===n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return ab(mb,r,t),new(ab(ob,e,r))}var i=n.prototype,a=ub(lb(i)?i:pb),o=ab(e,a,t);return lb(o)?o:a}});var vb=we.Reflect.construct,yb=r(vb),bb=we.Object.getOwnPropertySymbols,xb=r(bb),Sb={exports:{}},Cb=R,wb=s,Tb=xe,Eb=D.f,Db=O;Cb({target:`Object`,stat:!0,forced:!Db||wb(function(){Eb(1)}),sham:!Db},{getOwnPropertyDescriptor:function(e,t){return Eb(Tb(e),t)}});var Ob=we.Object,kb=Sb.exports=function(e,t){return Ob.getOwnPropertyDescriptor(e,t)};Ob.getOwnPropertyDescriptor.sham&&(kb.sham=!0);var Ab=Sb.exports,jb=r(Ab),Mb=R,Nb=O,Pb=Ch,Fb=xe,Ib=D,Lb=Mr;Mb({target:`Object`,stat:!0,sham:!Nb},{getOwnPropertyDescriptors:function(e){for(var t=Fb(e),n=Ib.f,r=Pb(t),i={},a=0,o,s;r.length>a;)s=n(t,o=r[a++]),s!==void 0&&Lb(i,o,s);return i}});var Rb=we.Object.getOwnPropertyDescriptors,zb=r(Rb),Bb={exports:{}},Vb=R,Hb=O,Ub=zi.f;Vb({target:`Object`,stat:!0,forced:Object.defineProperties!==Ub,sham:!Hb},{defineProperties:Ub});var Wb=we.Object,Gb=Bb.exports=function(e,t){return Wb.defineProperties(e,t)};Wb.defineProperties.sham&&(Gb.sham=!0);var Kb=Bb.exports,qb=r(Kb),Jb=r(pr);function Yb(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var Xb=Kg,Zb=r(Xb);R({target:`Object`,stat:!0},{setPrototypeOf:fu});var Qb=we.Object.setPrototypeOf,$b=r(Qb),ex=r(vf);function tx(e,t){var n;return tx=$b?ex(n=$b).call(n):function(e,t){return e.__proto__=t,e},tx(e,t)}function nx(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Zb(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),hr(e,`prototype`,{writable:!1}),t&&tx(e,t)}function rx(e,t){if(t&&(Ud(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Yb(e)}var ix=Wg,ax=r(ix);function ox(e){var t;return ox=$b?ex(t=ax).call(t):function(e){return e.__proto__||ax(e)},ox(e)}var sx={exports:{}},cx={exports:{}};(function(e){var t=Sd,n=Vd;function r(i){"@babel/helpers - typeof";return e.exports=r=typeof t==`function`&&typeof n==`symbol`?function(e){return typeof e}:function(e){return e&&typeof t==`function`&&e.constructor===t&&e!==t.prototype?`symbol`:typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(cx);var lx=cx.exports,ux=Hh,dx=Et,fx=Ch,px=D,mx=Mn,hx=function(e,t,n){for(var r=fx(t),i=mx.f,a=px.f,o=0;o<r.length;o++){var s=r[o];!dx(e,s)&&!(n&&dx(n,s))&&i(e,s,a(t,s))}},gx=M,_x=Xn,vx=function(e,t){gx(t)&&`cause`in t&&_x(e,`cause`,t.cause)},yx=v,bx=Error,xx=yx(``.replace),Sx=(function(e){return String(new bx(e).stack)})(`zxcasd`),Cx=/\n\s*at [^:]*:[^\n]*/,wx=Cx.test(Sx),Tx=function(e,t){if(wx&&typeof e==`string`&&!bx.prepareStackTrace)for(;t--;)e=xx(e,Cx,``);return e},Ex=s,Dx=ce,Ox=!Ex(function(){var e=Error(`a`);return`stack`in e?(Object.defineProperty(e,`stack`,Dx(1,7)),e.stack!==7):!0}),kx=Xn,Ax=Tx,jx=Ox,Mx=Error.captureStackTrace,Nx=function(e,t,n,r){jx&&(Mx?Mx(e,t):kx(e,`stack`,Ax(n,r)))},Px=jn,Fx=A,Ix=Ln,Lx=Xe,Rx=kp,zx=Tr,Bx=De,Vx=Hp,Hx=Fp,Ux=xp,Wx=TypeError,Gx=function(e,t){this.stopped=e,this.result=t},Kx=Gx.prototype,qx=function(e,t,n){var r=n&&n.that,i=!!(n&&n.AS_ENTRIES),a=!!(n&&n.IS_RECORD),o=!!(n&&n.IS_ITERATOR),s=!!(n&&n.INTERRUPTED),c=Px(t,r),l,u,d,f,p,m,h,g=function(e){return l&&Ux(l,`normal`,e),new Gx(!0,e)},_=function(e){return i?(Ix(e),s?c(e[0],e[1],g):c(e[0],e[1])):s?c(e,g):c(e)};if(a)l=e.iterator;else if(o)l=e;else{if(u=Hx(e),!u)throw new Wx(Lx(e)+` is not iterable`);if(Rx(u)){for(d=0,f=zx(e);f>d;d++)if(p=_(e[d]),p&&Bx(Kx,p))return p;return new Gx(!1)}l=Vx(e,u)}for(m=a?e.next:l.next;!(h=Fx(m,l)).done;){try{p=_(h.value)}catch(e){Ux(l,`throw`,e)}if(typeof p==`object`&&p&&Bx(Kx,p))return p}return new Gx(!1)},Jx=Ri,Yx=function(e,t){return e===void 0?arguments.length<2?``:t:Jx(e)},Xx=R,Zx=De,Qx=Il,$x=fu,eS=hx,tS=Ia,nS=Xn,rS=ce,iS=vx,aS=Nx,oS=qx,sS=Yx,cS=Vt(`toStringTag`),lS=Error,uS=[].push,dS=function(e,t){var n=Zx(fS,this),r;$x?r=$x(new lS,n?Qx(this):fS):(r=n?this:tS(fS),nS(r,cS,`Error`)),t!==void 0&&nS(r,`message`,sS(t)),aS(r,dS,r.stack,1),arguments.length>2&&iS(r,arguments[2]);var i=[];return oS(e,uS,{that:i}),nS(r,`errors`,i),r};$x?$x(dS,lS):eS(dS,lS,{name:!0});var fS=dS.prototype=tS(lS.prototype,{constructor:rS(1,dS),message:rS(1,``),name:rS(1,`AggregateError`)});Xx({global:!0,constructor:!0,arity:2},{AggregateError:dS});var pS=F,mS=ro,hS=Vt,gS=O,_S=hS(`species`),vS=function(e){var t=pS(e);gS&&t&&!t[_S]&&mS(t,_S,{configurable:!0,get:function(){return this}})},yS=De,bS=TypeError,xS=function(e,t){if(yS(t,e))return e;throw new bS(`Incorrect invocation`)},SS=Ln,CS=nb,wS=he,TS=Vt(`species`),ES=function(e,t){var n=SS(e).constructor,r;return n===void 0||wS(r=SS(n)[TS])?t:CS(r)},DS=Oe,OS=/(?:ipad|iphone|ipod).*applewebkit/i.test(DS),kS=o,AS=p,jS=jn,MS=E,NS=Et,PS=s,FS=pa,IS=Ac,LS=rn,RS=$g,zS=OS,BS=Of,VS=kS.setImmediate,HS=kS.clearImmediate,US=kS.process,K=kS.Dispatch,WS=kS.Function,GS=kS.MessageChannel,KS=kS.String,qS=0,q={},JS=`onreadystatechange`,YS,J,XS,ZS;PS(function(){YS=kS.location});var QS=function(e){if(NS(q,e)){var t=q[e];delete q[e],t()}},$S=function(e){return function(){QS(e)}},eC=function(e){QS(e.data)},tC=function(e){kS.postMessage(KS(e),YS.protocol+`//`+YS.host)};(!VS||!HS)&&(VS=function(e){RS(arguments.length,1);var t=MS(e)?e:WS(e),n=IS(arguments,1);return q[++qS]=function(){AS(t,void 0,n)},J(qS),qS},HS=function(e){delete q[e]},BS?J=function(e){US.nextTick($S(e))}:K&&K.now?J=function(e){K.now($S(e))}:GS&&!zS?(XS=new GS,ZS=XS.port2,XS.port1.onmessage=eC,J=jS(ZS.postMessage,ZS)):kS.addEventListener&&MS(kS.postMessage)&&!kS.importScripts&&YS&&YS.protocol!==`file:`&&!PS(tC)?(J=tC,kS.addEventListener(`message`,eC,!1)):J=JS in LS(`script`)?function(e){FS.appendChild(LS(`script`))[JS]=function(){FS.removeChild(this),QS(e)}}:function(e){setTimeout($S(e),0)});var nC={set:VS,clear:HS},rC=function(){this.head=null,this.tail=null};rC.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return(this.head=e.next)===null&&(this.tail=null),e.item}};var iC=rC,aC=Oe,oC=/ipad|iphone|ipod/i.test(aC)&&typeof Pebble<`u`,sC=Oe,cC=/web0s(?!.*chrome)/i.test(sC),lC=o,uC=jn,dC=D.f,fC=nC.set,pC=iC,mC=OS,hC=oC,gC=cC,_C=Of,vC=lC.MutationObserver||lC.WebKitMutationObserver,yC=lC.document,bC=lC.process,xC=lC.Promise,SC=dC(lC,`queueMicrotask`),CC=SC&&SC.value,wC,TC,EC,DC,OC;if(!CC){var kC=new pC,AC=function(){var e,t;for(_C&&(e=bC.domain)&&e.exit();t=kC.get();)try{t()}catch(e){throw kC.head&&wC(),e}e&&e.enter()};!mC&&!_C&&!gC&&vC&&yC?(TC=!0,EC=yC.createTextNode(``),new vC(AC).observe(EC,{characterData:!0}),wC=function(){EC.data=TC=!TC}):!hC&&xC&&xC.resolve?(DC=xC.resolve(void 0),DC.constructor=xC,OC=uC(DC.then,DC),wC=function(){OC(AC)}):_C?wC=function(){bC.nextTick(AC)}:(fC=uC(fC,lC),wC=function(){fC(AC)}),CC=function(e){kC.head||wC(),kC.add(e)}}var jC=CC,MC=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},NC=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},PC=o.Promise,FC=typeof Deno==`object`&&Deno&&typeof Deno.version==`object`,IC=!FC&&!Of&&typeof window==`object`&&typeof document==`object`,LC=o,RC=PC,zC=E,BC=En,VC=Jr,HC=Vt,UC=IC,WC=FC,GC=Le,KC=RC&&RC.prototype,qC=HC(`species`),JC=!1,YC=zC(LC.PromiseRejectionEvent),XC={CONSTRUCTOR:BC(`Promise`,function(){var e=VC(RC),t=e!==String(RC);if(!t&&GC===66||!(KC.catch&&KC.finally))return!0;if(!GC||GC<51||!/native code/.test(e)){var n=new RC(function(e){e(1)}),r=function(e){e(function(){},function(){})},i=n.constructor={};if(i[qC]=r,JC=n.then(function(){})instanceof r,!JC)return!0}return!t&&(UC||WC)&&!YC}),REJECTION_EVENT:YC,SUBCLASSING:JC},ZC={},QC=et,$C=TypeError,ew=function(e){var t,n;this.promise=new e(function(e,r){if(t!==void 0||n!==void 0)throw new $C(`Bad Promise constructor`);t=e,n=r}),this.resolve=QC(t),this.reject=QC(n)};ZC.f=function(e){return new ew(e)};var tw=R,nw=Of,rw=o,iw=A,aw=to,ow=To,sw=vS,cw=et,lw=E,uw=M,dw=xS,fw=ES,pw=nC.set,mw=jC,hw=MC,gw=NC,_w=iC,vw=qo,yw=PC,bw=XC,xw=ZC,Sw=`Promise`,Cw=bw.CONSTRUCTOR,ww=bw.REJECTION_EVENT;bw.SUBCLASSING;var Tw=vw.getterFor(Sw),Ew=vw.set,Dw=yw&&yw.prototype,Ow=yw,kw=Dw,Aw=rw.TypeError,jw=rw.document,Mw=rw.process,Nw=xw.f,Pw=Nw,Fw=!!(jw&&jw.createEvent&&rw.dispatchEvent),Iw=`unhandledrejection`,Lw=`rejectionhandled`,Rw=0,zw=1,Bw=2,Vw=1,Hw=2,Uw,Ww,Gw,Kw=function(e){var t;return uw(e)&&lw(t=e.then)?t:!1},qw=function(e,t){var n=t.value,r=t.state===zw,i=r?e.ok:e.fail,a=e.resolve,o=e.reject,s=e.domain,c,l,u;try{i?(r||(t.rejection===Hw&&Qw(t),t.rejection=Vw),i===!0?c=n:(s&&s.enter(),c=i(n),s&&(s.exit(),u=!0)),c===e.promise?o(new Aw(`Promise-chain cycle`)):(l=Kw(c))?iw(l,c,a,o):a(c)):o(n)}catch(e){s&&!u&&s.exit(),o(e)}},Jw=function(e,t){e.notified||(e.notified=!0,mw(function(){for(var n=e.reactions,r;r=n.get();)qw(r,e);e.notified=!1,t&&!e.rejection&&Xw(e)}))},Yw=function(e,t,n){var r,i;Fw?(r=jw.createEvent(`Event`),r.promise=t,r.reason=n,r.initEvent(e,!1,!0),rw.dispatchEvent(r)):r={promise:t,reason:n},!ww&&(i=rw[`on`+e])?i(r):e===Iw&&hw(`Unhandled promise rejection`,n)},Xw=function(e){iw(pw,rw,function(){var t=e.facade,n=e.value,r=Zw(e),i;if(r&&(i=gw(function(){nw?Mw.emit(`unhandledRejection`,n,t):Yw(Iw,t,n)}),e.rejection=nw||Zw(e)?Hw:Vw,i.error))throw i.value})},Zw=function(e){return e.rejection!==Vw&&!e.parent},Qw=function(e){iw(pw,rw,function(){var t=e.facade;nw?Mw.emit(`rejectionHandled`,t):Yw(Lw,t,e.value)})},$w=function(e,t,n){return function(r){e(t,r,n)}},eT=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=Bw,Jw(e,!0))},tT=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new Aw(`Promise can't be resolved itself`);var r=Kw(t);r?mw(function(){var n={done:!1};try{iw(r,t,$w(tT,n,e),$w(eT,n,e))}catch(t){eT(n,t,e)}}):(e.value=t,e.state=zw,Jw(e,!1))}catch(t){eT({done:!1},t,e)}}};Cw&&(Ow=function(e){dw(this,kw),cw(e),iw(Uw,this);var t=Tw(this);try{e($w(tT,t),$w(eT,t))}catch(e){eT(t,e)}},kw=Ow.prototype,Uw=function(e){Ew(this,{type:Sw,done:!1,notified:!1,parent:!1,reactions:new _w,rejection:!1,state:Rw,value:void 0})},Uw.prototype=aw(kw,`then`,function(e,t){var n=Tw(this),r=Nw(fw(this,Ow));return n.parent=!0,r.ok=lw(e)?e:!0,r.fail=lw(t)&&t,r.domain=nw?Mw.domain:void 0,n.state===Rw?n.reactions.add(r):mw(function(){qw(r,n)}),r.promise}),Ww=function(){var e=new Uw,t=Tw(e);this.promise=e,this.resolve=$w(tT,t),this.reject=$w(eT,t)},xw.f=Nw=function(e){return e===Ow||e===Gw?new Ww(e):Pw(e)}),tw({global:!0,constructor:!0,wrap:!0,forced:Cw},{Promise:Ow}),ow(Ow,Sw,!1,!0),sw(Sw);var nT=PC,rT=am,iT=XC.CONSTRUCTOR||!rT(function(e){nT.all(e).then(void 0,function(){})}),aT=R,oT=A,sT=et,cT=ZC,lT=NC,uT=qx;aT({target:`Promise`,stat:!0,forced:iT},{all:function(e){var t=this,n=cT.f(t),r=n.resolve,i=n.reject,a=lT(function(){var n=sT(t.resolve),a=[],o=0,s=1;uT(e,function(e){var c=o++,l=!1;s++,oT(n,t,e).then(function(e){l||(l=!0,a[c]=e,--s||r(a))},i)}),--s||r(a)});return a.error&&i(a.value),n.promise}});var dT=R,fT=XC.CONSTRUCTOR,pT=PC;pT&&pT.prototype,dT({target:`Promise`,proto:!0,forced:fT,real:!0},{catch:function(e){return this.then(void 0,e)}});var mT=R,hT=A,gT=et,_T=ZC,vT=NC,yT=qx;mT({target:`Promise`,stat:!0,forced:iT},{race:function(e){var t=this,n=_T.f(t),r=n.reject,i=vT(function(){var i=gT(t.resolve);yT(e,function(e){hT(i,t,e).then(n.resolve,r)})});return i.error&&r(i.value),n.promise}});var bT=R,xT=A,ST=ZC,CT=XC.CONSTRUCTOR;bT({target:`Promise`,stat:!0,forced:CT},{reject:function(e){var t=ST.f(this);return xT(t.reject,void 0,e),t.promise}});var wT=Ln,TT=M,ET=ZC,DT=function(e,t){if(wT(e),TT(t)&&t.constructor===e)return t;var n=ET.f(e),r=n.resolve;return r(t),n.promise},OT=R,kT=F,AT=ut,jT=PC,MT=XC.CONSTRUCTOR,NT=DT,PT=kT(`Promise`),FT=!MT;OT({target:`Promise`,stat:!0,forced:AT},{resolve:function(e){return NT(FT&&this===PT?jT:this,e)}});var IT=R,LT=A,RT=et,zT=ZC,BT=NC,VT=qx;IT({target:`Promise`,stat:!0,forced:iT},{allSettled:function(e){var t=this,n=zT.f(t),r=n.resolve,i=n.reject,a=BT(function(){var n=RT(t.resolve),i=[],a=0,o=1;VT(e,function(e){var s=a++,c=!1;o++,LT(n,t,e).then(function(e){c||(c=!0,i[s]={status:`fulfilled`,value:e},--o||r(i))},function(e){c||(c=!0,i[s]={status:`rejected`,reason:e},--o||r(i))})}),--o||r(i)});return a.error&&i(a.value),n.promise}});var HT=R,UT=A,WT=et,GT=F,KT=ZC,qT=NC,JT=qx,YT=iT,XT=`No one promise resolved`;HT({target:`Promise`,stat:!0,forced:YT},{any:function(e){var t=this,n=GT(`AggregateError`),r=KT.f(t),i=r.resolve,a=r.reject,o=qT(function(){var r=WT(t.resolve),o=[],s=0,c=1,l=!1;JT(e,function(e){var u=s++,d=!1;c++,UT(r,t,e).then(function(e){d||l||(l=!0,i(e))},function(e){d||l||(d=!0,o[u]=e,--c||a(new n(o,XT)))})}),--c||a(new n(o,XT))});return o.error&&a(o.value),r.promise}});var ZT=R,QT=PC,$T=s,eE=F,tE=E,nE=ES,rE=DT,iE=QT&&QT.prototype;ZT({target:`Promise`,proto:!0,real:!0,forced:!!QT&&$T(function(){iE.finally.call({then:function(){}},function(){})})},{finally:function(e){var t=nE(this,eE(`Promise`)),n=tE(e);return this.then(n?function(n){return rE(t,e()).then(function(){return n})}:e,n?function(n){return rE(t,e()).then(function(){throw n})}:e)}});var aE=we.Promise,oE=R,sE=ZC;oE({target:`Promise`,stat:!0},{withResolvers:function(){var e=sE.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}});var cE=aE,lE=R,uE=ZC,dE=NC;lE({target:`Promise`,stat:!0,forced:!0},{try:function(e){var t=uE.f(this),n=dE(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}});var fE=cE,pE=$h;(function(e){var t=lx.default,n=mr,r=Sd,i=Xb,a=ix,o=ux,s=Am,c=Qb,l=fE,u=pE,d=$m;function f(){e.exports=f=function(){return m},e.exports.__esModule=!0,e.exports.default=e.exports;var p,m={},h=Object.prototype,g=h.hasOwnProperty,_=n||function(e,t,n){e[t]=n.value},v=typeof r==`function`?r:{},y=v.iterator||`@@iterator`,b=v.asyncIterator||`@@asyncIterator`,x=v.toStringTag||`@@toStringTag`;function S(e,t,r){return n(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{S({},``)}catch{S=function(e,t,n){return e[t]=n}}function ee(e,t,n,r){var a=i((t&&t.prototype instanceof E?t:E).prototype);return _(a,`_invoke`,{value:ce(e,n,new fe(r||[]))}),a}function C(e,t,n){try{return{type:`normal`,arg:e.call(t,n)}}catch(e){return{type:`throw`,arg:e}}}m.wrap=ee;var te=`suspendedStart`,ne=`suspendedYield`,re=`executing`,w=`completed`,T={};function E(){}function D(){}function O(){}var ie={};S(ie,y,function(){return this});var k=a,A=k&&k(k(pe([])));A&&A!==h&&g.call(A,y)&&(ie=A);var ae=O.prototype=E.prototype=i(ie);function oe(e){var t;o(t=[`next`,`throw`,`return`]).call(t,function(t){S(e,t,function(e){return this._invoke(t,e)})})}function se(e,n){function r(i,a,o,s){var c=C(e[i],e,a);if(c.type!==`throw`){var l=c.arg,u=l.value;return u&&t(u)==`object`&&g.call(u,`__await`)?n.resolve(u.__await).then(function(e){r(`next`,e,o,s)},function(e){r(`throw`,e,o,s)}):n.resolve(u).then(function(e){l.value=e,o(l)},function(e){return r(`throw`,e,o,s)})}s(c.arg)}var i;_(this,`_invoke`,{value:function(e,t){function a(){return new n(function(n,i){r(e,t,n,i)})}return i=i?i.then(a,a):a()}})}function ce(e,t,n){var r=te;return function(i,a){if(r===re)throw Error(`Generator is already running`);if(r===w){if(i===`throw`)throw a;return{value:p,done:!0}}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=le(o,n);if(s){if(s===T)continue;return s}}if(n.method===`next`)n.sent=n._sent=n.arg;else if(n.method===`throw`){if(r===te)throw r=w,n.arg;n.dispatchException(n.arg)}else n.method===`return`&&n.abrupt(`return`,n.arg);r=re;var c=C(e,t,n);if(c.type===`normal`){if(r=n.done?w:ne,c.arg===T)continue;return{value:c.arg,done:n.done}}c.type===`throw`&&(r=w,n.method=`throw`,n.arg=c.arg)}}}function le(e,t){var n=t.method,r=e.iterator[n];if(r===p)return t.delegate=null,n===`throw`&&e.iterator.return&&(t.method=`return`,t.arg=p,le(e,t),t.method===`throw`)||n!==`return`&&(t.method=`throw`,t.arg=TypeError(`The iterator does not provide a '`+n+`' method`)),T;var i=C(r,e.iterator,t.arg);if(i.type===`throw`)return t.method=`throw`,t.arg=i.arg,t.delegate=null,T;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,t.method!==`return`&&(t.method=`next`,t.arg=p),t.delegate=null,T):a:(t.method=`throw`,t.arg=TypeError(`iterator result is not an object`),t.delegate=null,T)}function ue(e){var t,n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),s(t=this.tryEntries).call(t,n)}function de(e){var t=e.completion||{};t.type=`normal`,delete t.arg,e.completion=t}function fe(e){this.tryEntries=[{tryLoc:`root`}],o(e).call(e,ue,this),this.reset(!0)}function pe(e){if(e||e===``){var n=e[y];if(n)return n.call(e);if(typeof e.next==`function`)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(g.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=p,t.done=!0,t};return i.next=i}}throw TypeError(t(e)+` is not iterable`)}return D.prototype=O,_(ae,`constructor`,{value:O,configurable:!0}),_(O,`constructor`,{value:D,configurable:!0}),D.displayName=S(O,x,`GeneratorFunction`),m.isGeneratorFunction=function(e){var t=typeof e==`function`&&e.constructor;return!!t&&(t===D||(t.displayName||t.name)===`GeneratorFunction`)},m.mark=function(e){return c?c(e,O):(e.__proto__=O,S(e,x,`GeneratorFunction`)),e.prototype=i(ae),e},m.awrap=function(e){return{__await:e}},oe(se.prototype),S(se.prototype,b,function(){return this}),m.AsyncIterator=se,m.async=function(e,t,n,r,i){i===void 0&&(i=l);var a=new se(ee(e,t,n,r),i);return m.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},oe(ae),S(ae,x,`Generator`),S(ae,y,function(){return this}),S(ae,`toString`,function(){return`[object Generator]`}),m.keys=function(e){var t=Object(e),n=[];for(var r in t)s(n).call(n,r);return u(n).call(n),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},m.values=pe,fe.prototype={constructor:fe,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=p,this.done=!1,this.delegate=null,this.method=`next`,this.arg=p,o(t=this.tryEntries).call(t,de),!e)for(var n in this)n.charAt(0)===`t`&&g.call(this,n)&&!isNaN(+d(n).call(n,1))&&(this[n]=p)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type===`throw`)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type=`throw`,a.arg=e,t.next=n,r&&(t.method=`next`,t.arg=p),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if(i.tryLoc===`root`)return n(`end`);if(i.tryLoc<=this.prev){var o=g.call(i,`catchLoc`),s=g.call(i,`finallyLoc`);if(o&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw Error(`try statement without catch or finally`);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&g.call(r,`finallyLoc`)&&this.prev<r.finallyLoc){var i=r;break}}i&&(e===`break`||e===`continue`)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method=`next`,this.next=i.finallyLoc,T):this.complete(a)},complete:function(e,t){if(e.type===`throw`)throw e.arg;return e.type===`break`||e.type===`continue`?this.next=e.arg:e.type===`return`?(this.rval=this.arg=e.arg,this.method=`return`,this.next=`end`):e.type===`normal`&&t&&(this.next=t),T},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),de(n),T}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if(r.type===`throw`){var i=r.arg;de(n)}return i}}throw Error(`illegal catch attempt`)},delegateYield:function(e,t,n){return this.delegate={iterator:pe(e),resultName:t,nextLoc:n},this.method===`next`&&(this.arg=p),T}},m}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports})(sx);var mE=sx.exports,hE=mE(),gE=hE;try{regeneratorRuntime=hE}catch{typeof globalThis==`object`?globalThis.regeneratorRuntime=hE:Function(`r`,`regeneratorRuntime = r`)(hE)}var _E=r(gE),vE={exports:{}},yE=s(function(){if(typeof ArrayBuffer==`function`){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,`a`,{value:8})}}),bE=s,xE=M,SE=S,CE=yE,wE=Object.isExtensible,TE=bE(function(){wE(1)})||CE?function(e){return!xE(e)||CE&&SE(e)===`ArrayBuffer`?!1:wE?wE(e):!0}:wE,EE=!s(function(){return Object.isExtensible(Object.preventExtensions({}))}),DE=R,OE=v,kE=Yi,AE=M,jE=Et,ME=Mn.f,NE=La,PE=Ba,FE=TE,IE=jt,LE=EE,RE=!1,zE=IE(`meta`),BE=0,VE=function(e){ME(e,zE,{value:{objectID:`O`+ BE++,weakData:{}}})},HE=vE.exports={enable:function(){HE.enable=function(){},RE=!0;var e=NE.f,t=OE([].splice),n={};n[zE]=1,e(n).length&&(NE.f=function(n){for(var r=e(n),i=0,a=r.length;i<a;i++)if(r[i]===zE){t(r,i,1);break}return r},DE({target:`Object`,stat:!0,forced:!0},{getOwnPropertyNames:PE.f}))},fastKey:function(e,t){if(!AE(e))return typeof e==`symbol`?e:(typeof e==`string`?`S`:`P`)+e;if(!jE(e,zE)){if(!FE(e))return`F`;if(!t)return`E`;VE(e)}return e[zE].objectID},getWeakData:function(e,t){if(!jE(e,zE)){if(!FE(e))return!0;if(!t)return!1;VE(e)}return e[zE].weakData},onFreeze:function(e){return LE&&RE&&FE(e)&&!jE(e,zE)&&VE(e),e}};kE[zE]=!0;var UE=vE.exports,WE=R,GE=o,KE=UE,qE=s,JE=Xn,YE=qx,XE=xS,ZE=E,QE=M,$E=he,eD=To,tD=Mn.f,nD=ns.forEach,rD=O,iD=qo,aD=iD.set,oD=iD.getterFor,sD=function(e,t,n){var r=e.indexOf(`Map`)!==-1,i=e.indexOf(`Weak`)!==-1,a=r?`set`:`add`,o=GE[e],s=o&&o.prototype,c={},l;if(!rD||!ZE(o)||!(i||s.forEach&&!qE(function(){new o().entries().next()})))l=n.getConstructor(t,e,r,a),KE.enable();else{l=t(function(t,n){aD(XE(t,u),{type:e,collection:new o}),$E(n)||YE(n,t[a],{that:t,AS_ENTRIES:r})});var u=l.prototype,d=oD(e);nD([`add`,`clear`,`delete`,`forEach`,`get`,`has`,`set`,`keys`,`values`,`entries`],function(e){var t=e===`add`||e===`set`;e in s&&!(i&&e===`clear`)&&JE(u,e,function(n,r){var a=d(this).collection;if(!t&&i&&!QE(n))return e===`get`?void 0:!1;var o=a[e](n===0?0:n,r);return t?this:o})}),i||tD(u,`size`,{configurable:!0,get:function(){return d(this).collection.size}})}return eD(l,e,!1,!0),c[e]=l,WE({global:!0,forced:!0},c),i||n.setStrong(l,e,r),l},cD=to,lD=function(e,t,n){for(var r in t)n&&n.unsafe&&e[r]?e[r]=t[r]:cD(e,r,t[r],n);return e},uD=Ia,dD=ro,fD=lD,pD=jn,mD=xS,hD=he,gD=qx,_D=Au,vD=ju,yD=vS,bD=O,xD=UE.fastKey,SD=qo,CD=SD.set,wD=SD.getterFor,TD={getConstructor:function(e,t,n,r){var i=e(function(e,i){mD(e,a),CD(e,{type:t,index:uD(null),first:void 0,last:void 0,size:0}),bD||(e.size=0),hD(i)||gD(i,e[r],{that:e,AS_ENTRIES:n})}),a=i.prototype,o=wD(t),s=function(e,t,n){var r=o(e),i=c(e,t),a,s;return i?i.value=n:(r.last=i={index:s=xD(t,!0),key:t,value:n,previous:a=r.last,next:void 0,removed:!1},r.first||=i,a&&(a.next=i),bD?r.size++:e.size++,s!==`F`&&(r.index[s]=i)),e},c=function(e,t){var n=o(e),r=xD(t),i;if(r!==`F`)return n.index[r];for(i=n.first;i;i=i.next)if(i.key===t)return i};return fD(a,{clear:function(){for(var e=this,t=o(e),n=t.index,r=t.first;r;)r.removed=!0,r.previous&&=r.previous.next=void 0,delete n[r.index],r=r.next;t.first=t.last=void 0,bD?t.size=0:e.size=0},delete:function(e){var t=this,n=o(t),r=c(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first===r&&(n.first=i),n.last===r&&(n.last=a),bD?n.size--:t.size--}return!!r},forEach:function(e){for(var t=o(this),n=pD(e,arguments.length>1?arguments[1]:void 0),r;r=r?r.next:t.first;)for(n(r.value,r.key,this);r&&r.removed;)r=r.previous},has:function(e){return!!c(this,e)}}),fD(a,n?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,e===0?0:e,t)}}:{add:function(e){return s(this,e=e===0?0:e,e)}}),bD&&dD(a,`size`,{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(e,t,n){var r=t+` Iterator`,i=wD(t),a=wD(r);_D(e,t,function(e,t){CD(this,{type:r,target:e,state:i(e),kind:t,last:void 0})},function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return!e.target||!(e.last=n=n?n.next:e.state.first)?(e.target=void 0,vD(void 0,!0)):vD(t===`keys`?n.key:t===`values`?n.value:[n.key,n.value],!1)},n?`entries`:`values`,!n,!0),yD(t)}};sD(`Map`,function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},TD);var ED=we.Map,DD=r(ED),OD=R,kD=ns.some;OD({target:`Array`,proto:!0,forced:!Df(`some`)},{some:function(e){return kD(this,e,arguments.length>1?arguments[1]:void 0)}});var AD=pf(`Array`,`some`),jD=De,MD=AD,ND=Array.prototype,PD=r(function(e){var t=e.some;return e===ND||jD(ND,e)&&t===ND.some?MD:t}),FD=pf(`Array`,`keys`),ID=Ur,LD=Et,RD=De,zD=FD,BD=Array.prototype,Y={DOMTokenList:!0,NodeList:!0},X=r(function(e){var t=e.keys;return e===BD||RD(BD,e)&&t===BD.keys||LD(Y,ID(e))?zD:t}),Z=Ka,VD=Math.floor,Q=function(e,t){var n=e.length,r=VD(n/2);return n<8?HD(e,t):UD(e,Q(Z(e,0,r),t),Q(Z(e,r),t),t)},HD=function(e,t){for(var n=e.length,r=1,i,a;r<n;){for(a=r,i=e[r];a&&t(e[a-1],i)>0;)e[a]=e[--a];a!==r++&&(e[a]=i)}return e},UD=function(e,t,n,r){for(var i=t.length,a=n.length,o=0,s=0;o<i||s<a;)e[o+s]=o<i&&s<a?r(t[o],n[s])<=0?t[o++]:n[s++]:o<i?t[o++]:n[s++];return e},WD=Q,GD=Oe.match(/firefox\/(\d+)/i),KD=!!GD&&+GD[1],qD=Oe,JD=/MSIE|Trident/.test(qD),YD=Oe.match(/AppleWebKit\/(\d+)\./),$=!!YD&&+YD[1],XD=R,ZD=v,QD=et,$D=St,eO=Tr,tO=rg,nO=Ri,rO=s,iO=WD,aO=Df,oO=KD,sO=JD,cO=Le,lO=$,uO=[],dO=ZD(uO.sort),fO=ZD(uO.push),pO=rO(function(){uO.sort(void 0)}),mO=rO(function(){uO.sort(null)}),hO=aO(`sort`),gO=!rO(function(){if(cO)return cO<70;if(!(oO&&oO>3)){if(sO)return!0;if(lO)return lO<603;var e=``,t,n,r,i;for(t=65;t<76;t++){switch(n=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(i=0;i<47;i++)uO.push({k:n+i,v:r})}for(uO.sort(function(e,t){return t.v-e.v}),i=0;i<uO.length;i++)n=uO[i].k.charAt(0),e.charAt(e.length-1)!==n&&(e+=n);return e!==`DGBEFHACIJK`}}),_O=pO||!mO||!hO||!gO,vO=function(e){return function(t,n){return n===void 0?-1:t===void 0?1:e===void 0?nO(t)>nO(n)?1:-1:+e(t,n)||0}};XD({target:`Array`,proto:!0,forced:_O},{sort:function(e){e!==void 0&&QD(e);var t=$D(this);if(gO)return e===void 0?dO(t):dO(t,e);var n=[],r=eO(t),i,a;for(a=0;a<r;a++)a in t&&fO(n,t[a]);for(iO(n,vO(e)),i=eO(n),a=0;a<i;)t[a]=n[a++];for(;a<r;)tO(t,a++);return t}});var yO=pf(`Array`,`sort`),bO=De,xO=yO,SO=Array.prototype,CO=r(function(e){var t=e.sort;return e===SO||bO(SO,e)&&t===SO.sort?xO:t}),wO=pf(`Array`,`values`),TO=Ur,EO=Et,DO=De,OO=wO,kO=Array.prototype,AO={DOMTokenList:!0,NodeList:!0},jO=r(function(e){var t=e.values;return e===kO||DO(kO,e)&&t===kO.values||EO(AO,TO(e))?OO:t}),MO=r(Bd),NO=pf(`Array`,`entries`),PO=Ur,FO=Et,IO=De,LO=NO,RO=Array.prototype,zO={DOMTokenList:!0,NodeList:!0},BO=r(function(e){var t=e.entries;return e===RO||IO(RO,e)&&t===RO.entries||FO(zO,PO(e))?LO:t});let VO,HO=new Uint8Array(16);function UO(){if(!VO&&(VO=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!VO))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return VO(HO)}let WO=[];for(let e=0;e<256;++e)WO.push((e+256).toString(16).slice(1));function GO(e,t=0){return WO[e[t+0]]+WO[e[t+1]]+WO[e[t+2]]+WO[e[t+3]]+`-`+WO[e[t+4]]+WO[e[t+5]]+`-`+WO[e[t+6]]+WO[e[t+7]]+`-`+WO[e[t+8]]+WO[e[t+9]]+`-`+WO[e[t+10]]+WO[e[t+11]]+WO[e[t+12]]+WO[e[t+13]]+WO[e[t+14]]+WO[e[t+15]]}var KO={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function qO(e,t,n){if(KO.randomUUID&&!t&&!e)return KO.randomUUID();e||={};let r=e.random||(e.rng||UO)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n||=0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return GO(r)}function JO(e){return typeof e==`string`||typeof e==`number`}var YO=function(){function e(n){t(this,e),Yd(this,`_queue`,[]),Yd(this,`_timeout`,null),Yd(this,`_extended`,null),this.delay=null,this.max=1/0,this.setOptions(n)}return Jd(e,[{key:`setOptions`,value:function(e){e&&e.delay!==void 0&&(this.delay=e.delay),e&&e.max!==void 0&&(this.max=e.max),this._flushIfNeeded()}},{key:`destroy`,value:function(){if(this.flush(),this._extended){for(var e=this._extended.object,t=this._extended.methods,n=0;n<t.length;n++){var r=t[n];r.original?e[r.name]=r.original:delete e[r.name]}this._extended=null}}},{key:`replace`,value:function(e,t){var n=this,r=e[t];if(!r)throw Error(`Method `+t+` undefined`);e[t]=function(){var e=[...arguments];n.queue({args:e,fn:r,context:this})}}},{key:`queue`,value:function(e){typeof e==`function`?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}},{key:`_flushIfNeeded`,value:function(){var e=this;this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay==`number`&&(this._timeout=__(function(){e.flush()},this.delay))}},{key:`flush`,value:function(){var e,t;Uh(e=xg(t=this._queue).call(t,0)).call(e,function(e){e.fn.apply(e.context||e.fn,e.args||[])})}}],[{key:`extend`,value:function(t,n){var r=new e(n);if(t.flush!==void 0)throw Error(`Target object already has a property flush`);t.flush=function(){r.flush()};var i=[{name:`flush`,original:void 0}];if(n&&n.replace)for(var a=0;a<n.replace.length;a++){var o=n.replace[a];i.push({name:o,original:t[o]}),r.replace(t,o)}return r._extended={object:t,methods:i},r}}]),e}(),XO=function(){function e(){t(this,e),Yd(this,`_subscribers`,{"*":[],add:[],remove:[],update:[]}),Yd(this,`subscribe`,e.prototype.on),Yd(this,`unsubscribe`,e.prototype.off)}return Jd(e,[{key:`_trigger`,value:function(e,t,n){var r,i;if(e===`*`)throw Error(`Cannot trigger event *`);Uh(r=hh(i=[]).call(i,lh(this._subscribers[e]),lh(this._subscribers[`*`]))).call(r,function(r){r(e,t,n??null)})}},{key:`on`,value:function(e,t){typeof t==`function`&&this._subscribers[e].push(t)}},{key:`off`,value:function(e,t){var n;this._subscribers[e]=Wf(n=this._subscribers[e]).call(n,function(e){return e!==t})}}]),e}();sD(`Set`,function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},TD);var ZO=we.Set,QO=r(ZO),$O=r(Hp);function ek(e,t){var n=uh!==void 0&&fm(e)||e[`@@iterator`];if(!n){if(Eh(e)||(n=tk(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
7
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(o)throw s}}}}function tk(e,t){var n;if(e){if(typeof e==`string`)return nk(e,t);var r=gh(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return lm(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nk(e,t)}}function nk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var rk=function(e){function n(e){t(this,n),this._pairs=e}return Jd(n,[{key:e,value:_E.mark(function e(){var t,n,r,i,a;return _E.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=ek(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=ah(n.value,2),i=r[0],a=r[1],e.next=7,[i,a];case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}},e,this,[[1,11,14,17]])})},{key:`entries`,value:_E.mark(function e(){var t,n,r,i,a;return _E.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=ek(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=ah(n.value,2),i=r[0],a=r[1],e.next=7,[i,a];case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}},e,this,[[1,11,14,17]])})},{key:`keys`,value:_E.mark(function e(){var t,n,r,i;return _E.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=ek(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=ah(n.value,1),i=r[0],e.next=7,i;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}},e,this,[[1,11,14,17]])})},{key:`values`,value:_E.mark(function e(){var t,n,r,i;return _E.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=ek(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=ah(n.value,2),i=r[1],e.next=7,i;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}},e,this,[[1,11,14,17]])})},{key:`toIdArray`,value:function(){var e;return Zf(e=lh(this._pairs)).call(e,function(e){return e[0]})}},{key:`toItemArray`,value:function(){var e;return Zf(e=lh(this._pairs)).call(e,function(e){return e[1]})}},{key:`toEntryArray`,value:function(){return lh(this._pairs)}},{key:`toObjectMap`,value:function(){var e=qg(null),t=ek(this._pairs),n;try{for(t.s();!(n=t.n()).done;){var r=ah(n.value,2),i=r[0];e[i]=r[1]}}catch(e){t.e(e)}finally{t.f()}return e}},{key:`toMap`,value:function(){return new DD(this._pairs)}},{key:`toIdSet`,value:function(){return new QO(this.toIdArray())}},{key:`toItemSet`,value:function(){return new QO(this.toItemArray())}},{key:`cache`,value:function(){return new n(lh(this._pairs))}},{key:`distinct`,value:function(e){var t=new QO,n=ek(this._pairs),r;try{for(n.s();!(r=n.n()).done;){var i=ah(r.value,2),a=i[0],o=i[1];t.add(e(o,a))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:`filter`,value:function(e){var t=this._pairs;return new n({[MO](){return _E.mark(function n(){var r,i,a,o,s;return _E.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:r=ek(t),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=10;break}if(a=ah(i.value,2),o=a[0],s=a[1],!e(s,o)){n.next=8;break}return n.next=8,[o,s];case 8:n.next=3;break;case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(1),r.e(n.t0);case 15:return n.prev=15,r.f(),n.finish(15);case 18:case`end`:return n.stop()}},n,null,[[1,12,15,18]])})()}})}},{key:`forEach`,value:function(e){var t=ek(this._pairs),n;try{for(t.s();!(n=t.n()).done;){var r=ah(n.value,2),i=r[0],a=r[1];e(a,i)}}catch(e){t.e(e)}finally{t.f()}}},{key:`map`,value:function(e){var t=this._pairs;return new n({[MO](){return _E.mark(function n(){var r,i,a,o,s;return _E.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:r=ek(t),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=9;break}return a=ah(i.value,2),o=a[0],s=a[1],n.next=7,[o,e(s,o)];case 7:n.next=3;break;case 9:n.next=14;break;case 11:n.prev=11,n.t0=n.catch(1),r.e(n.t0);case 14:return n.prev=14,r.f(),n.finish(14);case 17:case`end`:return n.stop()}},n,null,[[1,11,14,17]])})()}})}},{key:`max`,value:function(e){var t=$O(this._pairs),n=t.next();if(n.done)return null;for(var r=n.value[1],i=e(n.value[1],n.value[0]);!(n=t.next()).done;){var a=ah(n.value,2),o=a[0],s=a[1],c=e(s,o);c>i&&(i=c,r=s)}return r}},{key:`min`,value:function(e){var t=$O(this._pairs),n=t.next();if(n.done)return null;for(var r=n.value[1],i=e(n.value[1],n.value[0]);!(n=t.next()).done;){var a=ah(n.value,2),o=a[0],s=a[1],c=e(s,o);c<i&&(i=c,r=s)}return r}},{key:`reduce`,value:function(e,t){var n=ek(this._pairs),r;try{for(n.s();!(r=n.n()).done;){var i=ah(r.value,2),a=i[0],o=i[1];t=e(t,o,a)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:`sort`,value:function(e){var t=this;return new n({[MO]:function(){var n;return $O(CO(n=lh(t._pairs)).call(n,function(t,n){var r=ah(t,2),i=r[0],a=r[1],o=ah(n,2),s=o[0],c=o[1];return e(a,c,i,s)}))}})}}]),n}(MO);function ik(e,t){var n=jh(e);if(xb){var r=xb(e);t&&(r=Wf(r).call(r,function(t){return jb(e,t).enumerable})),n.push.apply(n,r)}return n}function ak(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?Uh(n=ik(Object(i),!0)).call(n,function(t){Yd(e,t,i[t])}):zb?qb(e,zb(i)):Uh(r=ik(Object(i))).call(r,function(t){Jb(e,t,jb(i,t))})}return e}function ok(e,t){var n=uh!==void 0&&fm(e)||e[`@@iterator`];if(!n){if(Eh(e)||(n=sk(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
8
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(o)throw s}}}}function sk(e,t){var n;if(e){if(typeof e==`string`)return ck(e,t);var r=gh(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return lm(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ck(e,t)}}function ck(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lk(e){var t=uk();return function(){var n=ox(e),r;if(t){var i=ox(this).constructor;r=yb(n,arguments,i)}else r=n.apply(this,arguments);return rx(this,r)}}function uk(){if(typeof Reflect>`u`||!yb||yb.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(yb(Boolean,[],function(){})),!0}catch{return!1}}function dk(e,t){return e[t]??(e[t]=qO()),e}var fk=function(e){nx(r,e);var n=lk(r);function r(e,i){var a;return t(this,r),a=n.call(this),Yd(Yb(a),`_queue`,null),e&&!Eh(e)&&(i=e,e=[]),a._options=i||{},a._data=new DD,a.length=0,a._idProp=a._options.fieldId||`id`,e&&e.length&&a.add(e),a.setOptions(i),a}return Jd(r,[{key:`idProp`,get:function(){return this._idProp}},{key:`setOptions`,value:function(e){e&&e.queue!==void 0&&(e.queue===!1?this._queue&&=(this._queue.destroy(),null):(this._queue||=YO.extend(this,{replace:[`add`,`update`,`remove`]}),e.queue&&typeof e.queue==`object`&&this._queue.setOptions(e.queue)))}},{key:`add`,value:function(e,t){var n=this,r=[],i;if(Eh(e)){var a=Zf(e).call(e,function(e){return e[n._idProp]});if(PD(a).call(a,function(e){return n._data.has(e)}))throw Error(`A duplicate id was found in the parameter array.`);for(var o=0,s=e.length;o<s;o++)i=this._addItem(e[o]),r.push(i)}else if(e&&typeof e==`object`)i=this._addItem(e),r.push(i);else throw Error(`Unknown dataType`);return r.length&&this._trigger(`add`,{items:r},t),r}},{key:`update`,value:function(e,t){var n=this,r=[],i=[],a=[],o=[],s=this._idProp,c=function(e){var t=e[s];if(t!=null&&n._data.has(t)){var c=e,l=Rg({},n._data.get(t)),u=n._updateItem(c);i.push(u),o.push(c),a.push(l)}else{var d=n._addItem(e);r.push(d)}};if(Eh(e))for(var l=0,u=e.length;l<u;l++)e[l]&&typeof e[l]==`object`?c(e[l]):console.warn(`Ignoring input item, which is not an object at index `+l);else if(e&&typeof e==`object`)c(e);else throw Error(`Unknown dataType`);if(r.length&&this._trigger(`add`,{items:r},t),i.length){var d={items:i,oldData:a,data:o};this._trigger(`update`,d,t)}return hh(r).call(r,i)}},{key:`updateOnly`,value:function(e,t){var n,r=this;Eh(e)||(e=[e]);var i=Zf(n=Zf(e).call(e,function(e){var t=r._data.get(e[r._idProp]);if(t==null)throw Error(`Updating non-existent items is not allowed.`);return{oldData:t,update:e}})).call(n,function(e){var t=e.oldData,n=e.update,i=t[r._idProp],a=Wy(t,n);return r._data.set(i,a),{id:i,oldData:t,updatedData:a}});if(i.length){var a={items:Zf(i).call(i,function(e){return e.id}),oldData:Zf(i).call(i,function(e){return e.oldData}),data:Zf(i).call(i,function(e){return e.updatedData})};return this._trigger(`update`,a,t),a.items}else return[]}},{key:`get`,value:function(e,t){var n=void 0,r=void 0,i=void 0;JO(e)?(n=e,i=t):Eh(e)?(r=e,i=t):i=e;var a=i&&i.returnType===`Object`?`Object`:`Array`,o=i&&Wf(i),s=[],c=void 0,l=void 0,u=void 0;if(n!=null)c=this._data.get(n),c&&o&&!o(c)&&(c=void 0);else if(r!=null)for(var d=0,f=r.length;d<f;d++)c=this._data.get(r[d]),c!=null&&(!o||o(c))&&s.push(c);else{var p;l=lh(X(p=this._data).call(p));for(var m=0,h=l.length;m<h;m++)u=l[m],c=this._data.get(u),c!=null&&(!o||o(c))&&s.push(c)}if(i&&i.order&&n==null&&this._sort(s,i.order),i&&i.fields){var g=i.fields;if(n!=null&&c!=null)c=this._filterFields(c,g);else for(var _=0,v=s.length;_<v;_++)s[_]=this._filterFields(s[_],g)}if(a==`Object`){for(var y={},b=0,x=s.length;b<x;b++){var S=s[b],ee=S[this._idProp];y[ee]=S}return y}else if(n!=null)return c??null;else return s}},{key:`getIds`,value:function(e){var t=this._data,n=e&&Wf(e),r=e&&e.order,i=lh(X(t).call(t)),a=[];if(n)if(r){for(var o=[],s=0,c=i.length;s<c;s++){var l=i[s],u=this._data.get(l);u!=null&&n(u)&&o.push(u)}this._sort(o,r);for(var d=0,f=o.length;d<f;d++)a.push(o[d][this._idProp])}else for(var p=0,m=i.length;p<m;p++){var h=i[p],g=this._data.get(h);g!=null&&n(g)&&a.push(g[this._idProp])}else if(r){for(var _=[],v=0,y=i.length;v<y;v++){var b=i[v];_.push(t.get(b))}this._sort(_,r);for(var x=0,S=_.length;x<S;x++)a.push(_[x][this._idProp])}else for(var ee=0,C=i.length;ee<C;ee++){var te=i[ee],ne=t.get(te);ne!=null&&a.push(ne[this._idProp])}return a}},{key:`getDataSet`,value:function(){return this}},{key:`forEach`,value:function(e,t){var n=t&&Wf(t),r=this._data,i=lh(X(r).call(r));if(t&&t.order)for(var a=this.get(t),o=0,s=a.length;o<s;o++){var c=a[o],l=c[this._idProp];e(c,l)}else for(var u=0,d=i.length;u<d;u++){var f=i[u],p=this._data.get(f);p!=null&&(!n||n(p))&&e(p,f)}}},{key:`map`,value:function(e,t){for(var n=t&&Wf(t),r=[],i=this._data,a=lh(X(i).call(i)),o=0,s=a.length;o<s;o++){var c=a[o],l=this._data.get(c);l!=null&&(!n||n(l))&&r.push(e(l,c))}return t&&t.order&&this._sort(r,t.order),r}},{key:`_filterFields`,value:function(e,t){var n;return e&&Lf(n=Eh(t)?t:jh(t)).call(n,function(t,n){return t[n]=e[n],t},{})}},{key:`_sort`,value:function(e,t){if(typeof t==`string`){var n=t;CO(e).call(e,function(e,t){var r=e[n],i=t[n];return r>i?1:r<i?-1:0})}else if(typeof t==`function`)CO(e).call(e,t);else throw TypeError(`Order must be a function or a string`)}},{key:`remove`,value:function(e,t){for(var n=[],r=[],i=Eh(e)?e:[e],a=0,o=i.length;a<o;a++){var s=this._remove(i[a]);if(s){var c=s[this._idProp];c!=null&&(n.push(c),r.push(s))}}return n.length&&this._trigger(`remove`,{items:n,oldData:r},t),n}},{key:`_remove`,value:function(e){var t;if(JO(e)?t=e:e&&typeof e==`object`&&(t=e[this._idProp]),t!=null&&this._data.has(t)){var n=this._data.get(t)||null;return this._data.delete(t),--this.length,n}return null}},{key:`clear`,value:function(e){for(var t,n=lh(X(t=this._data).call(t)),r=[],i=0,a=n.length;i<a;i++)r.push(this._data.get(n[i]));return this._data.clear(),this.length=0,this._trigger(`remove`,{items:n,oldData:r},e),n}},{key:`max`,value:function(e){var t,n=null,r=null,i=ok(jO(t=this._data).call(t)),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=o[e];typeof s==`number`&&(r==null||s>r)&&(n=o,r=s)}}catch(e){i.e(e)}finally{i.f()}return n||null}},{key:`min`,value:function(e){var t,n=null,r=null,i=ok(jO(t=this._data).call(t)),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=o[e];typeof s==`number`&&(r==null||s<r)&&(n=o,r=s)}}catch(e){i.e(e)}finally{i.f()}return n||null}},{key:`distinct`,value:function(e){for(var t=this._data,n=lh(X(t).call(t)),r=[],i=0,a=0,o=n.length;a<o;a++){for(var s=n[a],c=t.get(s)[e],l=!1,u=0;u<i;u++)if(r[u]==c){l=!0;break}!l&&c!==void 0&&(r[i]=c,i++)}return r}},{key:`_addItem`,value:function(e){var t=dk(e,this._idProp),n=t[this._idProp];if(this._data.has(n))throw Error(`Cannot add item: item with id `+n+` already exists`);return this._data.set(n,t),++this.length,n}},{key:`_updateItem`,value:function(e){var t=e[this._idProp];if(t==null)throw Error(`Cannot update item: item has no id (item: `+Xg(e)+`)`);var n=this._data.get(t);if(!n)throw Error(`Cannot update item: no item with id `+t+` found`);return this._data.set(t,ak(ak({},n),e)),t}},{key:`stream`,value:function(e){if(e){var t=this._data;return new rk({[MO](){return _E.mark(function n(){var r,i,a,o;return _E.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:r=ok(e),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=11;break}if(a=i.value,o=t.get(a),o==null){n.next=9;break}return n.next=9,[a,o];case 9:n.next=3;break;case 11:n.next=16;break;case 13:n.prev=13,n.t0=n.catch(1),r.e(n.t0);case 16:return n.prev=16,r.f(),n.finish(16);case 19:case`end`:return n.stop()}},n,null,[[1,13,16,19]])})()}})}else{var n;return new rk({[MO]:yf(n=BO(this._data)).call(n,this._data)})}}}]),r}(XO);function pk(e,t){var n=uh!==void 0&&fm(e)||e[`@@iterator`];if(!n){if(Eh(e)||(n=mk(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(o)throw s}}}}function mk(e,t){var n;if(e){if(typeof e==`string`)return hk(e,t);var r=gh(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return lm(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hk(e,t)}}function hk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gk(e){var t=_k();return function(){var n=ox(e),r;if(t){var i=ox(this).constructor;r=yb(n,arguments,i)}else r=n.apply(this,arguments);return rx(this,r)}}function _k(){if(typeof Reflect>`u`||!yb||yb.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(yb(Boolean,[],function(){})),!0}catch{return!1}}var vk=function(e){nx(r,e);var n=gk(r);function r(e,i){var a,o;return t(this,r),o=n.call(this),Yd(Yb(o),`length`,0),Yd(Yb(o),`_ids`,new QO),o._options=i||{},o._listener=yf(a=o._onEvent).call(a,Yb(o)),o.setData(e),o}return Jd(r,[{key:`idProp`,get:function(){return this.getDataSet().idProp}},{key:`setData`,value:function(e){if(this._data){this._data.off&&this._data.off(`*`,this._listener);var t=this._data.getIds({filter:Wf(this._options)}),n=this._data.get(t);this._ids.clear(),this.length=0,this._trigger(`remove`,{items:t,oldData:n})}if(e!=null){this._data=e;for(var r=this._data.getIds({filter:Wf(this._options)}),i=0,a=r.length;i<a;i++){var o=r[i];this._ids.add(o)}this.length=r.length,this._trigger(`add`,{items:r})}else this._data=new fk;this._data.on&&this._data.on(`*`,this._listener)}},{key:`refresh`,value:function(){for(var e=this._data.getIds({filter:Wf(this._options)}),t=lh(this._ids),n={},r=[],i=[],a=[],o=0,s=e.length;o<s;o++){var c=e[o];n[c]=!0,this._ids.has(c)||(r.push(c),this._ids.add(c))}for(var l=0,u=t.length;l<u;l++){var d=t[l],f=this._data.get(d);f==null?console.error(`If you see this, report it please.`):n[d]||(i.push(d),a.push(f),this._ids.delete(d))}this.length+=r.length-i.length,r.length&&this._trigger(`add`,{items:r}),i.length&&this._trigger(`remove`,{items:i,oldData:a})}},{key:`get`,value:function(e,t){if(this._data==null)return null;var n=null,r;JO(e)||Eh(e)?(n=e,r=t):r=e;var i=Rg({},this._options,r),a=Wf(this._options),o=r&&Wf(r);return a&&o&&(i.filter=function(e){return a(e)&&o(e)}),n==null?this._data.get(i):this._data.get(n,i)}},{key:`getIds`,value:function(e){if(this._data.length){var t=Wf(this._options),n=e==null?null:Wf(e),r=n?t?function(e){return t(e)&&n(e)}:n:t;return this._data.getIds({filter:r,order:e&&e.order})}else return[]}},{key:`forEach`,value:function(e,t){if(this._data){var n,r=Wf(this._options),i=t&&Wf(t),a=i?r?function(e){return r(e)&&i(e)}:i:r;Uh(n=this._data).call(n,e,{filter:a,order:t&&t.order})}}},{key:`map`,value:function(e,t){if(this._data){var n,r=Wf(this._options),i=t&&Wf(t),a=i?r?function(e){return r(e)&&i(e)}:i:r;return Zf(n=this._data).call(n,e,{filter:a,order:t&&t.order})}else return[]}},{key:`getDataSet`,value:function(){return this._data.getDataSet()}},{key:`stream`,value:function(e){var t;return this._data.stream(e||{[MO]:yf(t=X(this._ids)).call(t,this._ids)})}},{key:`dispose`,value:function(){var e;(e=this._data)!=null&&e.off&&this._data.off(`*`,this._listener);var t=`This data view has already been disposed of.`,n={get:function(){throw Error(t)},set:function(){throw Error(t)},configurable:!1},i=pk(Th(r.prototype)),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;Jb(this,o,n)}}catch(e){i.e(e)}finally{i.f()}}},{key:`_onEvent`,value:function(e,t,n){if(!(!t||!t.items||!this._data)){var r=t.items,i=[],a=[],o=[],s=[],c=[],l=[];switch(e){case`add`:for(var u=0,d=r.length;u<d;u++){var f=r[u];this.get(f)&&(this._ids.add(f),i.push(f))}break;case`update`:for(var p=0,m=r.length;p<m;p++){var h=r[p];this.get(h)?this._ids.has(h)?(a.push(h),c.push(t.data[p]),s.push(t.oldData[p])):(this._ids.add(h),i.push(h)):this._ids.has(h)&&(this._ids.delete(h),o.push(h),l.push(t.oldData[p]))}break;case`remove`:for(var g=0,_=r.length;g<_;g++){var v=r[g];this._ids.has(v)&&(this._ids.delete(v),o.push(v),l.push(t.oldData[g]))}break}this.length+=i.length-o.length,i.length&&this._trigger(`add`,{items:i},n),a.length&&this._trigger(`update`,{items:a,oldData:s,data:c},n),o.length&&this._trigger(`remove`,{items:o,oldData:l},n)}}}]),r}(XO);function yk(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof t.add==`function`&&typeof t.clear==`function`&&typeof t.distinct==`function`&&typeof Uh(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Zf(t)==`function`&&typeof t.max==`function`&&typeof t.min==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.remove==`function`&&typeof t.setOptions==`function`&&typeof t.stream==`function`&&typeof t.update==`function`&&typeof t.updateOnly==`function`}function bk(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof Uh(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Zf(t)==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.stream==`function`&&yk(e,t.getDataSet())}e.DELETE=Uy,e.DataSet=fk,e.DataStream=rk,e.DataView=vk,e.Queue=YO,e.createNewDataPipeFrom=hp,e.isDataSetLike=yk,e.isDataViewLike=bk}))})),te=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e,C()):typeof define==`function`&&define.amd?define([`exports`,`vis-data/peer/umd/vis-data.js`],r):r((n=typeof globalThis<`u`?globalThis:n||self).vis=n.vis||{},n.vis)})(e,(function(e,t){var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i=function(e){return e&&e.Math===Math&&e},a=i(typeof globalThis==`object`&&globalThis)||i(typeof window==`object`&&window)||i(typeof self==`object`&&self)||i(typeof n==`object`&&n)||function(){return this}()||n||Function(`return this`)(),o=function(e){try{return!!e()}catch{return!0}},s=!o((function(){var e=function(){}.bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)})),c=s,l=Function.prototype,u=l.apply,d=l.call,f=typeof Reflect==`object`&&Reflect.apply||(c?d.bind(u):function(){return d.apply(u,arguments)}),p=s,m=Function.prototype,h=m.call,g=p&&m.bind.bind(h,h),_=p?g:function(e){return function(){return h.apply(e,arguments)}},v=_,y=v({}.toString),b=v(``.slice),x=function(e){return b(y(e),8,-1)},S=x,ee=_,C=function(e){if(S(e)===`Function`)return ee(e)},te=typeof document==`object`&&document.all,ne={all:te,IS_HTMLDDA:te===void 0&&te!==void 0},re=ne.all,w=ne.IS_HTMLDDA?function(e){return typeof e==`function`||e===re}:function(e){return typeof e==`function`},T={},E=!o((function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})),D=s,O=Function.prototype.call,ie=D?O.bind(O):function(){return O.apply(O,arguments)},k={},A={}.propertyIsEnumerable,ae=Object.getOwnPropertyDescriptor;k.f=ae&&!A.call({1:2},1)?function(e){var t=ae(this,e);return!!t&&t.enumerable}:A;var oe,se,ce=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},le=o,ue=x,de=Object,fe=_(``.split),pe=le((function(){return!de(`z`).propertyIsEnumerable(0)}))?function(e){return ue(e)===`String`?fe(e,``):de(e)}:de,me=function(e){return e==null},he=me,ge=TypeError,_e=function(e){if(he(e))throw new ge(`Can't call method on `+e);return e},ve=pe,ye=_e,be=function(e){return ve(ye(e))},xe=w,Se=ne.all,Ce=ne.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:xe(e)||e===Se}:function(e){return typeof e==`object`?e!==null:xe(e)},j={},M=j,we=a,N=w,Te=function(e){return N(e)?e:void 0},Ee=function(e,t){return arguments.length<2?Te(M[e])||Te(we[e]):M[e]&&M[e][t]||we[e]&&we[e][t]},P=_({}.isPrototypeOf),F=typeof navigator<`u`&&String(navigator.userAgent)||``,De=a,Oe=F,ke=De.process,Ae=De.Deno,je=ke&&ke.versions||Ae&&Ae.version,Me=je&&je.v8;Me&&(se=(oe=Me.split(`.`))[0]>0&&oe[0]<4?1:+(oe[0]+oe[1])),!se&&Oe&&(!(oe=Oe.match(/Edge\/(\d+)/))||oe[1]>=74)&&(oe=Oe.match(/Chrome\/(\d+)/))&&(se=+oe[1]);var Ne=se,Pe=Ne,Fe=o,Ie=a.String,Le=!!Object.getOwnPropertySymbols&&!Fe((function(){var e=Symbol(`symbol detection`);return!Ie(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Pe&&Pe<41})),Re=Le&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,ze=Ee,Be=w,Ve=P,He=Object,Ue=Re?function(e){return typeof e==`symbol`}:function(e){var t=ze(`Symbol`);return Be(t)&&Ve(t.prototype,He(e))},We=String,Ge=function(e){try{return We(e)}catch{return`Object`}},Ke=w,qe=Ge,Je=TypeError,Ye=function(e){if(Ke(e))return e;throw new Je(qe(e)+` is not a function`)},Xe=Ye,Ze=me,Qe=function(e,t){var n=e[t];return Ze(n)?void 0:Xe(n)},$e=ie,et=w,tt=Ce,nt=TypeError,rt={exports:{}},it=a,at=Object.defineProperty,ot=function(e,t){try{at(it,e,{value:t,configurable:!0,writable:!0})}catch{it[e]=t}return t},st=`__core-js_shared__`,ct=a[st]||ot(st,{}),lt=ct;(rt.exports=function(e,t){return lt[e]||(lt[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.33.0`,mode:`pure`,copyright:`© 2014-2023 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE`,source:`https://github.com/zloirock/core-js`});var ut=rt.exports,dt=_e,ft=Object,pt=function(e){return ft(dt(e))},mt=pt,ht=_({}.hasOwnProperty),gt=Object.hasOwn||function(e,t){return ht(mt(e),t)},_t=_,vt=0,yt=Math.random(),bt=_t(1 .toString),xt=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+bt(++vt+yt,36)},St=ut,Ct=gt,wt=xt,Tt=Le,Et=Re,Dt=a.Symbol,Ot=St(`wks`),kt=Et?Dt.for||Dt:Dt&&Dt.withoutSetter||wt,At=function(e){return Ct(Ot,e)||(Ot[e]=Tt&&Ct(Dt,e)?Dt[e]:kt(`Symbol.`+e)),Ot[e]},jt=ie,Mt=Ce,Nt=Ue,Pt=Qe,Ft=function(e,t){var n,r;if(t===`string`&&et(n=e.toString)&&!tt(r=$e(n,e))||et(n=e.valueOf)&&!tt(r=$e(n,e))||t!==`string`&&et(n=e.toString)&&!tt(r=$e(n,e)))return r;throw new nt(`Can't convert object to primitive value`)},It=TypeError,Lt=At(`toPrimitive`),Rt=function(e,t){if(!Mt(e)||Nt(e))return e;var n,r=Pt(e,Lt);if(r){if(t===void 0&&(t=`default`),n=jt(r,e,t),!Mt(n)||Nt(n))return n;throw new It(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Ft(e,t)},zt=Ue,Bt=function(e){var t=Rt(e,`string`);return zt(t)?t:t+``},Vt=Ce,Ht=a.document,Ut=Vt(Ht)&&Vt(Ht.createElement),Wt=function(e){return Ut?Ht.createElement(e):{}},Gt=Wt,Kt=!E&&!o((function(){return Object.defineProperty(Gt(`div`),`a`,{get:function(){return 7}}).a!==7})),qt=E,Jt=ie,Yt=k,Xt=ce,Zt=be,Qt=Bt,$t=gt,en=Kt,tn=Object.getOwnPropertyDescriptor;T.f=qt?tn:function(e,t){if(e=Zt(e),t=Qt(t),en)try{return tn(e,t)}catch{}if($t(e,t))return Xt(!Jt(Yt.f,e,t),e[t])};var nn=o,rn=w,an=/#|\.prototype\./,on=function(e,t){var n=cn[sn(e)];return n===un||n!==ln&&(rn(t)?nn(t):!!t)},sn=on.normalize=function(e){return String(e).replace(an,`.`).toLowerCase()},cn=on.data={},ln=on.NATIVE=`N`,un=on.POLYFILL=`P`,dn=on,fn=Ye,pn=s,mn=C(C.bind),hn=function(e,t){return fn(e),t===void 0?e:pn?mn(e,t):function(){return e.apply(t,arguments)}},gn={},_n=E&&o((function(){return Object.defineProperty((function(){}),`prototype`,{value:42,writable:!1}).prototype!==42})),vn=Ce,yn=String,bn=TypeError,xn=function(e){if(vn(e))return e;throw new bn(yn(e)+` is not an object`)},Sn=E,Cn=Kt,wn=_n,Tn=xn,En=Bt,Dn=TypeError,On=Object.defineProperty,kn=Object.getOwnPropertyDescriptor,An=`enumerable`,jn=`configurable`,Mn=`writable`;gn.f=Sn?wn?function(e,t,n){if(Tn(e),t=En(t),Tn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&Mn in n&&!n[Mn]){var r=kn(e,t);r&&r[Mn]&&(e[t]=n.value,n={configurable:jn in n?n[jn]:r[jn],enumerable:An in n?n[An]:r[An],writable:!1})}return On(e,t,n)}:On:function(e,t,n){if(Tn(e),t=En(t),Tn(n),Cn)try{return On(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Dn(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Nn=gn,Pn=ce,Fn=E?function(e,t,n){return Nn.f(e,t,Pn(1,n))}:function(e,t,n){return e[t]=n,e},In=a,Ln=f,Rn=C,zn=w,Bn=T.f,Vn=dn,Hn=j,Un=hn,Wn=Fn,Gn=gt,Kn=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return Ln(e,this,arguments)};return t.prototype=e.prototype,t},I=function(e,t){var n,r,i,a,o,s,c,l,u,d=e.target,f=e.global,p=e.stat,m=e.proto,h=f?In:p?In[d]:(In[d]||{}).prototype,g=f?Hn:Hn[d]||Wn(Hn,d,{})[d],_=g.prototype;for(a in t)r=!(n=Vn(f?a:d+(p?`.`:`#`)+a,e.forced))&&h&&Gn(h,a),s=g[a],r&&(c=e.dontCallGetSet?(u=Bn(h,a))&&u.value:h[a]),o=r&&c?c:t[a],r&&typeof s==typeof o||(l=e.bind&&r?Un(o,In):e.wrap&&r?Kn(o):m&&zn(o)?Rn(o):o,(e.sham||o&&o.sham||s&&s.sham)&&Wn(l,`sham`,!0),Wn(g,a,l),m&&(Gn(Hn,i=d+`Prototype`)||Wn(Hn,i,{}),Wn(Hn[i],a,o),e.real&&_&&(n||!_[a])&&Wn(_,a,o)))},L=Math.ceil,qn=Math.floor,Jn=Math.trunc||function(e){var t=+e;return(t>0?qn:L)(t)},Yn=function(e){var t=+e;return t!=t||t===0?0:Jn(t)},Xn=Yn,Zn=Math.max,Qn=Math.min,$n=function(e,t){var n=Xn(e);return n<0?Zn(n+t,0):Qn(n,t)},er=Yn,tr=Math.min,nr=function(e){return e>0?tr(er(e),9007199254740991):0},rr=function(e){return nr(e.length)},ir=be,ar=$n,or=rr,sr=function(e){return function(t,n,r){var i,a=ir(t),o=or(a),s=ar(r,o);if(e&&n!=n){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===n)return e||s||0;return!e&&-1}},R={includes:sr(!0),indexOf:sr(!1)},cr={},lr=gt,ur=be,dr=R.indexOf,fr=cr,pr=_([].push),mr=function(e,t){var n,r=ur(e),i=0,a=[];for(n in r)!lr(fr,n)&&lr(r,n)&&pr(a,n);for(;t.length>i;)lr(r,n=t[i++])&&(~dr(a,n)||pr(a,n));return a},hr=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],gr=mr,_r=hr,vr=Object.keys||function(e){return gr(e,_r)},yr={};yr.f=Object.getOwnPropertySymbols;var br=E,xr=_,Sr=ie,Cr=o,wr=vr,Tr=yr,Er=k,Dr=pt,Or=pe,kr=Object.assign,Ar=Object.defineProperty,jr=xr([].concat),Mr=!kr||Cr((function(){if(br&&kr({b:1},kr(Ar({},`a`,{enumerable:!0,get:function(){Ar(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},n=Symbol(`assign detection`),r=`abcdefghijklmnopqrst`;return e[n]=7,r.split(``).forEach((function(e){t[e]=e})),kr({},e)[n]!==7||wr(kr({},t)).join(``)!==r}))?function(e,t){for(var n=Dr(e),r=arguments.length,i=1,a=Tr.f,o=Er.f;r>i;)for(var s,c=Or(arguments[i++]),l=a?jr(wr(c),a(c)):wr(c),u=l.length,d=0;u>d;)s=l[d++],br&&!Sr(o,c,s)||(n[s]=c[s]);return n}:kr;I({target:`Object`,stat:!0,arity:2,forced:Object.assign!==Mr},{assign:Mr});var Nr=r(j.Object.assign),Pr=_([].slice),Fr=_,Ir=Ye,Lr=Ce,Rr=gt,zr=Pr,Br=s,Vr=Function,Hr=Fr([].concat),Ur=Fr([].join),Wr={},Gr=Br?Vr.bind:function(e){var t=Ir(this),n=t.prototype,r=zr(arguments,1),i=function(){var n=Hr(r,zr(arguments));return this instanceof i?function(e,t,n){if(!Rr(Wr,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;Wr[t]=Vr(`C,a`,`return new C(`+Ur(r,`,`)+`)`)}return Wr[t](e,n)}(t,n.length,n):t.apply(e,n)};return Lr(n)&&(i.prototype=n),i},Kr=Gr;I({target:`Function`,proto:!0,forced:Function.bind!==Kr},{bind:Kr});var qr=j,Jr=function(e){return qr[e+`Prototype`]},Yr=Jr(`Function`).bind,Xr=P,Zr=Yr,Qr=Function.prototype,$r=function(e){var t=e.bind;return e===Qr||Xr(Qr,e)&&t===Qr.bind?Zr:t},z=r($r);function ei(e,t,n,r){e.beginPath(),e.arc(t,n,r,0,2*Math.PI,!1),e.closePath()}function ti(e,t,n,r,i,a){var o=Math.PI/180;r-2*a<0&&(a=r/2),i-2*a<0&&(a=i/2),e.beginPath(),e.moveTo(t+a,n),e.lineTo(t+r-a,n),e.arc(t+r-a,n+a,a,270*o,360*o,!1),e.lineTo(t+r,n+i-a),e.arc(t+r-a,n+i-a,a,0,90*o,!1),e.lineTo(t+a,n+i),e.arc(t+a,n+i-a,a,90*o,180*o,!1),e.lineTo(t,n+a),e.arc(t+a,n+a,a,180*o,270*o,!1),e.closePath()}function ni(e,t,n,r,i){var a=.5522848,o=r/2*a,s=i/2*a,c=t+r,l=n+i,u=t+r/2,d=n+i/2;e.beginPath(),e.moveTo(t,d),e.bezierCurveTo(t,d-s,u-o,n,u,n),e.bezierCurveTo(u+o,n,c,d-s,c,d),e.bezierCurveTo(c,d+s,u+o,l,u,l),e.bezierCurveTo(u-o,l,t,d+s,t,d),e.closePath()}function ri(e,t,n,r,i){var a=1/3*i,o=.5522848,s=r/2*o,c=a/2*o,l=t+r,u=n+a,d=t+r/2,f=n+a/2,p=n+(i-a/2),m=n+i;e.beginPath(),e.moveTo(l,f),e.bezierCurveTo(l,f+c,d+s,u,d,u),e.bezierCurveTo(d-s,u,t,f+c,t,f),e.bezierCurveTo(t,f-c,d-s,n,d,n),e.bezierCurveTo(d+s,n,l,f-c,l,f),e.lineTo(l,p),e.bezierCurveTo(l,p+c,d+s,m,d,m),e.bezierCurveTo(d-s,m,t,p+c,t,p),e.lineTo(t,f)}function ii(e,t,n,r,i,a){e.beginPath(),e.moveTo(t,n);for(var o=a.length,s=r-t,c=i-n,l=c/s,u=Math.sqrt(s*s+c*c),d=0,f=!0,p=0,m=+a[0];u>=.1;)(m=+a[d++%o])>u&&(m=u),p=Math.sqrt(m*m/(1+l*l)),t+=p=s<0?-p:p,n+=l*p,!0===f?e.lineTo(t,n):e.moveTo(t,n),u-=m,f=!f}var ai={circle:ei,dashedLine:ii,database:ri,diamond:function(e,t,n,r){e.beginPath(),e.lineTo(t,n+r),e.lineTo(t+r,n),e.lineTo(t,n-r),e.lineTo(t-r,n),e.closePath()},ellipse:ni,ellipse_vis:ni,hexagon:function(e,t,n,r){e.beginPath();var i=2*Math.PI/6;e.moveTo(t+r,n);for(var a=1;a<6;a++)e.lineTo(t+r*Math.cos(i*a),n+r*Math.sin(i*a));e.closePath()},roundRect:ti,square:function(e,t,n,r){e.beginPath(),e.rect(t-r,n-r,2*r,2*r),e.closePath()},star:function(e,t,n,r){e.beginPath(),n+=.1*(r*=.82);for(var i=0;i<10;i++){var a=i%2==0?1.3*r:.5*r;e.lineTo(t+a*Math.sin(2*i*Math.PI/10),n-a*Math.cos(2*i*Math.PI/10))}e.closePath()},triangle:function(e,t,n,r){e.beginPath(),n+=.275*(r*=1.15);var i=2*r,a=i/2,o=Math.sqrt(3)/6*i,s=Math.sqrt(i*i-a*a);e.moveTo(t,n-(s-o)),e.lineTo(t+a,n+o),e.lineTo(t-a,n+o),e.lineTo(t,n-(s-o)),e.closePath()},triangleDown:function(e,t,n,r){e.beginPath(),n-=.275*(r*=1.15);var i=2*r,a=i/2,o=Math.sqrt(3)/6*i,s=Math.sqrt(i*i-a*a);e.moveTo(t,n+(s-o)),e.lineTo(t+a,n-o),e.lineTo(t-a,n-o),e.lineTo(t,n+(s-o)),e.closePath()}},oi={exports:{}};(function(e){function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[`$`+e]=this._callbacks[`$`+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n,r=this._callbacks[`$`+e];if(!r)return this;if(arguments.length==1)return delete this._callbacks[`$`+e],this;for(var i=0;i<r.length;i++)if((n=r[i])===t||n.fn===t){r.splice(i,1);break}return r.length===0&&delete this._callbacks[`$`+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),n=this._callbacks[`$`+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[`$`+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}})(oi);var si=r(oi.exports),ci={};ci[At(`toStringTag`)]=`z`;var li,ui,di,fi=String(ci)===`[object z]`,pi=fi,mi=w,hi=x,gi=At(`toStringTag`),_i=Object,vi=hi(function(){return arguments}())===`Arguments`,yi=pi?hi:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=function(e,t){try{return e[t]}catch{}}(t=_i(e),gi))==`string`?n:vi?hi(t):(r=hi(t))===`Object`&&mi(t.callee)?`Arguments`:r},bi=yi,xi=String,Si=function(e){if(bi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return xi(e)},Ci=_,wi=Yn,Ti=Si,Ei=_e,Di=Ci(``.charAt),Oi=Ci(``.charCodeAt),ki=Ci(``.slice),Ai=function(e){return function(t,n){var r,i,a=Ti(Ei(t)),o=wi(n),s=a.length;return o<0||o>=s?e?``:void 0:(r=Oi(a,o))<55296||r>56319||o+1===s||(i=Oi(a,o+1))<56320||i>57343?e?Di(a,o):r:e?ki(a,o,o+2):i-56320+(r-55296<<10)+65536}},ji={codeAt:Ai(!1),charAt:Ai(!0)},Mi=w,Ni=a.WeakMap,Pi=Mi(Ni)&&/native code/.test(String(Ni)),Fi=xt,Ii=ut(`keys`),Li=function(e){return Ii[e]||(Ii[e]=Fi(e))},Ri=Pi,zi=a,Bi=Ce,Vi=Fn,Hi=gt,Ui=ct,Wi=Li,Gi=cr,Ki=`Object already initialized`,qi=zi.TypeError,Ji=zi.WeakMap;if(Ri||Ui.state){var Yi=Ui.state||=new Ji;Yi.get=Yi.get,Yi.has=Yi.has,Yi.set=Yi.set,li=function(e,t){if(Yi.has(e))throw new qi(Ki);return t.facade=e,Yi.set(e,t),t},ui=function(e){return Yi.get(e)||{}},di=function(e){return Yi.has(e)}}else{var Xi=Wi(`state`);Gi[Xi]=!0,li=function(e,t){if(Hi(e,Xi))throw new qi(Ki);return t.facade=e,Vi(e,Xi,t),t},ui=function(e){return Hi(e,Xi)?e[Xi]:{}},di=function(e){return Hi(e,Xi)}}var Zi={set:li,get:ui,has:di,enforce:function(e){return di(e)?ui(e):li(e,{})},getterFor:function(e){return function(t){var n;if(!Bi(t)||(n=ui(t)).type!==e)throw new qi(`Incompatible receiver, `+e+` required`);return n}}},Qi=E,$i=gt,ea=Function.prototype,ta=Qi&&Object.getOwnPropertyDescriptor,na=$i(ea,`name`),ra={EXISTS:na,PROPER:na&&function(){}.name===`something`,CONFIGURABLE:na&&(!Qi||Qi&&ta(ea,`name`).configurable)},ia={},aa=E,oa=_n,sa=gn,ca=xn,la=be,ua=vr;ia.f=aa&&!oa?Object.defineProperties:function(e,t){ca(e);for(var n,r=la(t),i=ua(t),a=i.length,o=0;a>o;)sa.f(e,n=i[o++],r[n]);return e};var da,fa=Ee(`document`,`documentElement`),pa=xn,ma=ia,ha=hr,ga=cr,_a=fa,va=Wt,ya=`prototype`,ba=`script`,xa=Li(`IE_PROTO`),Sa=function(){},Ca=function(e){return`<`+ba+`>`+e+`</`+ba+`>`},wa=function(e){e.write(Ca(``)),e.close();var t=e.parentWindow.Object;return e=null,t},Ta=function(){try{da=new ActiveXObject(`htmlfile`)}catch{}var e,t,n;Ta=typeof document<`u`?document.domain&&da?wa(da):(t=va(`iframe`),n=`java`+ba+`:`,t.style.display=`none`,_a.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(Ca(`document.F=Object`)),e.close(),e.F):wa(da);for(var r=ha.length;r--;)delete Ta[ya][ha[r]];return Ta()};ga[xa]=!0;var Ea,Da,Oa,ka=Object.create||function(e,t){var n;return e===null?n=Ta():(Sa[ya]=pa(e),n=new Sa,Sa[ya]=null,n[xa]=e),t===void 0?n:ma.f(n,t)},Aa=!o((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ja=gt,Ma=w,Na=pt,Pa=Aa,Fa=Li(`IE_PROTO`),Ia=Object,La=Ia.prototype,Ra=Pa?Ia.getPrototypeOf:function(e){var t=Na(e);if(ja(t,Fa))return t[Fa];var n=t.constructor;return Ma(n)&&t instanceof n?n.prototype:t instanceof Ia?La:null},za=Fn,Ba=function(e,t,n,r){return r&&r.enumerable?e[t]=n:za(e,t,n),e},Va=o,Ha=w,Ua=Ce,Wa=ka,Ga=Ra,Ka=Ba,qa=At(`iterator`),Ja=!1;[].keys&&(`next`in(Oa=[].keys())?(Da=Ga(Ga(Oa)))!==Object.prototype&&(Ea=Da):Ja=!0),Ha((Ea=!Ua(Ea)||Va((function(){var e={};return Ea[qa].call(e)!==e}))?{}:Wa(Ea))[qa])||Ka(Ea,qa,(function(){return this}));var Ya={IteratorPrototype:Ea,BUGGY_SAFARI_ITERATORS:Ja},Xa=yi,Za=fi?{}.toString:function(){return`[object `+Xa(this)+`]`},Qa=fi,$a=gn.f,eo=Fn,to=gt,no=Za,ro=At(`toStringTag`),io=function(e,t,n,r){if(e){var i=n?e:e.prototype;to(i,ro)||$a(i,ro,{configurable:!0,value:t}),r&&!Qa&&eo(i,`toString`,no)}},ao={},oo=Ya.IteratorPrototype,so=ka,co=ce,lo=io,uo=ao,fo=function(){return this},po=_,mo=Ye,ho=w,go=String,_o=TypeError,vo=function(e,t,n){try{return po(mo(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},yo=xn,bo=function(e){if(typeof e==`object`||ho(e))return e;throw new _o(`Can't set `+go(e)+` as a prototype`)},xo=Object.setPrototypeOf||(`__proto__`in{}?function(){var e,t=!1,n={};try{(e=vo(Object.prototype,`__proto__`,`set`))(n,[]),t=n instanceof Array}catch{}return function(n,r){return yo(n),bo(r),t?e(n,r):n.__proto__=r,n}}():void 0),So=I,Co=ie,wo=ra,To=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=so(oo,{next:co(+!r,n)}),lo(e,i,!1,!0),uo[i]=fo,e},Eo=Ra,Do=io,Oo=Ba,ko=ao,Ao=Ya,jo=wo.PROPER,Mo=Ao.BUGGY_SAFARI_ITERATORS,No=At(`iterator`),Po=`keys`,Fo=`values`,Io=`entries`,Lo=function(){return this},Ro=function(e,t,n,r,i,a,o){To(n,t,r);var s,c,l,u=function(e){if(e===i&&h)return h;if(!Mo&&e&&e in p)return p[e];switch(e){case Po:case Fo:case Io:return function(){return new n(this,e)}}return function(){return new n(this)}},d=t+` Iterator`,f=!1,p=e.prototype,m=p[No]||p[`@@iterator`]||i&&p[i],h=!Mo&&m||u(i),g=t===`Array`&&p.entries||m;if(g&&(s=Eo(g.call(new e)))!==Object.prototype&&s.next&&(Do(s,d,!0,!0),ko[d]=Lo),jo&&i===Fo&&m&&m.name!==Fo&&(f=!0,h=function(){return Co(m,this)}),i)if(c={values:u(Fo),keys:a?h:u(Po),entries:u(Io)},o)for(l in c)(Mo||f||!(l in p))&&Oo(p,l,c[l]);else So({target:t,proto:!0,forced:Mo||f},c);return o&&p[No]!==h&&Oo(p,No,h,{name:i}),ko[t]=h,c},zo=function(e,t){return{value:e,done:t}},Bo=ji.charAt,Vo=Si,Ho=Zi,Uo=Ro,Wo=zo,Go=`String Iterator`,Ko=Ho.set,qo=Ho.getterFor(Go);Uo(String,`String`,(function(e){Ko(this,{type:Go,string:Vo(e),index:0})}),(function(){var e,t=qo(this),n=t.string,r=t.index;return r>=n.length?Wo(void 0,!0):(e=Bo(n,r),t.index+=e.length,Wo(e,!1))}));var Jo=ie,Yo=xn,Xo=Qe,Zo=function(e,t,n){var r,i;Yo(e);try{if(!(r=Xo(e,`return`))){if(t===`throw`)throw n;return n}r=Jo(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return Yo(r),n},Qo=xn,$o=Zo,es=ao,ts=At(`iterator`),ns=Array.prototype,rs=function(e){return e!==void 0&&(es.Array===e||ns[ts]===e)},is=w,as=ct,os=_(Function.toString);is(as.inspectSource)||(as.inspectSource=function(e){return os(e)});var ss=as.inspectSource,cs=_,ls=o,us=w,ds=yi,fs=ss,ps=function(){},ms=[],hs=Ee(`Reflect`,`construct`),gs=/^\s*(?:class|function)\b/,_s=cs(gs.exec),vs=!gs.test(ps),ys=function(e){if(!us(e))return!1;try{return hs(ps,ms,e),!0}catch{return!1}},bs=function(e){if(!us(e))return!1;switch(ds(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return vs||!!_s(gs,fs(e))}catch{return!0}};bs.sham=!0;var xs=!hs||ls((function(){var e;return ys(ys.call)||!ys(Object)||!ys((function(){e=!0}))||e}))?bs:ys,Ss=Bt,Cs=gn,ws=ce,Ts=function(e,t,n){var r=Ss(t);r in e?Cs.f(e,r,ws(0,n)):e[r]=n},Es=yi,Ds=Qe,Os=me,ks=ao,As=At(`iterator`),js=function(e){if(!Os(e))return Ds(e,As)||Ds(e,`@@iterator`)||ks[Es(e)]},Ms=ie,Ns=Ye,Ps=xn,Fs=Ge,Is=js,Ls=TypeError,Rs=function(e,t){var n=arguments.length<2?Is(e):t;if(Ns(n))return Ps(Ms(n,e));throw new Ls(Fs(e)+` is not iterable`)},zs=hn,Bs=ie,Vs=pt,Hs=function(e,t,n,r){try{return r?t(Qo(n)[0],n[1]):t(n)}catch(t){$o(e,`throw`,t)}},Us=rs,Ws=xs,Gs=rr,Ks=Ts,qs=Rs,Js=js,Ys=Array,Xs=At(`iterator`),Zs=!1;try{var Qs=0,$s={next:function(){return{done:!!Qs++}},return:function(){Zs=!0}};$s[Xs]=function(){return this},Array.from($s,(function(){throw 2}))}catch{}I({target:`Array`,stat:!0,forced:!function(e,t){try{if(!t&&!Zs)return!1}catch{return!1}var n=!1;try{var r={};r[Xs]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n}((function(e){Array.from(e)}))},{from:function(e){var t=Vs(e),n=Ws(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=zs(i,r>2?arguments[2]:void 0));var o,s,c,l,u,d,f=Js(t),p=0;if(!f||this===Ys&&Us(f))for(o=Gs(t),s=n?new this(o):Ys(o);o>p;p++)d=a?i(t[p],p):t[p],Ks(s,p,d);else for(u=(l=qs(t,f)).next,s=n?new this:[];!(c=Bs(u,l)).done;p++)d=a?Hs(l,i,[c.value,p],!0):c.value,Ks(s,p,d);return s.length=p,s}});var ec=j.Array.from,tc=r(ec),nc=be,rc=ao,ic=Zi;gn.f;var ac=Ro,oc=zo,sc=`Array Iterator`,cc=ic.set,lc=ic.getterFor(sc);ac(Array,`Array`,(function(e,t){cc(this,{type:sc,target:nc(e),index:0,kind:t})}),(function(){var e=lc(this),t=e.target,n=e.kind,r=e.index++;if(!t||r>=t.length)return e.target=void 0,oc(void 0,!0);switch(n){case`keys`:return oc(r,!1);case`values`:return oc(t[r],!1)}return oc([r,t[r]],!1)}),`values`),rc.Arguments=rc.Array;var uc=js,dc={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},fc=a,pc=yi,mc=Fn,hc=ao,gc=At(`toStringTag`);for(var _c in dc){var vc=fc[_c],yc=vc&&vc.prototype;yc&&pc(yc)!==gc&&mc(yc,gc,_c),hc[_c]=hc.Array}var bc=uc,xc=r(bc),Sc=r(bc);function B(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var Cc={exports:{}},wc=I,Tc=E,Ec=gn.f;wc({target:`Object`,stat:!0,forced:Object.defineProperty!==Ec,sham:!Tc},{defineProperty:Ec});var Dc=j.Object,Oc=Cc.exports=function(e,t,n){return Dc.defineProperty(e,t,n)};Dc.defineProperty.sham&&(Oc.sham=!0);var kc=Cc.exports,Ac=r(kc),jc=x,Mc=Array.isArray||function(e){return jc(e)===`Array`},Nc=TypeError,Pc=function(e){if(e>9007199254740991)throw Nc(`Maximum allowed index exceeded`);return e},Fc=Mc,Ic=xs,Lc=Ce,Rc=At(`species`),zc=Array,Bc=function(e){var t;return Fc(e)&&(t=e.constructor,(Ic(t)&&(t===zc||Fc(t.prototype))||Lc(t)&&(t=t[Rc])===null)&&(t=void 0)),t===void 0?zc:t},Vc=function(e,t){return new(Bc(e))(t===0?0:t)},Hc=o,Uc=Ne,Wc=At(`species`),Gc=function(e){return Uc>=51||!Hc((function(){var t=[];return(t.constructor={})[Wc]=function(){return{foo:1}},t[e](Boolean).foo!==1}))},Kc=I,qc=o,Jc=Mc,Yc=Ce,Xc=pt,Zc=rr,Qc=Pc,$c=Ts,el=Vc,tl=Gc,nl=Ne,rl=At(`isConcatSpreadable`),il=nl>=51||!qc((function(){var e=[];return e[rl]=!1,e.concat()[0]!==e})),al=function(e){if(!Yc(e))return!1;var t=e[rl];return t===void 0?Jc(e):!!t};Kc({target:`Array`,proto:!0,arity:1,forced:!il||!tl(`concat`)},{concat:function(e){var t,n,r,i,a,o=Xc(this),s=el(o,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(al(a=t===-1?o:arguments[t]))for(i=Zc(a),Qc(c+i),n=0;n<i;n++,c++)n in a&&$c(s,c,a[n]);else Qc(c+1),$c(s,c++,a);return s.length=c,s}});var ol={},sl=mr,cl=hr.concat(`length`,`prototype`);ol.f=Object.getOwnPropertyNames||function(e){return sl(e,cl)};var ll={},ul=$n,dl=rr,fl=Ts,pl=Array,ml=Math.max,hl=function(e,t,n){for(var r=dl(e),i=ul(t,r),a=ul(n===void 0?r:n,r),o=pl(ml(a-i,0)),s=0;i<a;i++,s++)fl(o,s,e[i]);return o.length=s,o},gl=x,_l=be,vl=ol.f,yl=hl,bl=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ll.f=function(e){return bl&&gl(e)===`Window`?function(e){try{return vl(e)}catch{return yl(bl)}}(e):vl(_l(e))};var xl=gn,Sl=function(e,t,n){return xl.f(e,t,n)},Cl={};Cl.f=At;var wl=j,Tl=gt,El=Cl,Dl=gn.f,Ol=function(e){var t=wl.Symbol||={};Tl(t,e)||Dl(t,e,{value:El.f(e)})},kl=ie,Al=Ee,jl=At,Ml=Ba,Nl=function(){var e=Al(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=jl(`toPrimitive`);t&&!t[r]&&Ml(t,r,(function(e){return kl(n,this)}),{arity:1})},Pl=hn,Fl=pe,Il=pt,Ll=rr,Rl=Vc,zl=_([].push),Bl=function(e){var t=e===1,n=e===2,r=e===3,i=e===4,a=e===6,o=e===7,s=e===5||a;return function(c,l,u,d){for(var f,p,m=Il(c),h=Fl(m),g=Pl(l,u),_=Ll(h),v=0,y=d||Rl,b=t?y(c,_):n||o?y(c,0):void 0;_>v;v++)if((s||v in h)&&(p=g(f=h[v],v,m),e))if(t)b[v]=p;else if(p)switch(e){case 3:return!0;case 5:return f;case 6:return v;case 2:zl(b,f)}else switch(e){case 4:return!1;case 7:zl(b,f)}return a?-1:r||i?i:b}},Vl={forEach:Bl(0),map:Bl(1),filter:Bl(2),some:Bl(3),every:Bl(4),find:Bl(5),findIndex:Bl(6),filterReject:Bl(7)},Hl=I,Ul=a,Wl=ie,Gl=_,Kl=E,ql=Le,Jl=o,Yl=gt,Xl=P,Zl=xn,Ql=be,$l=Bt,eu=Si,tu=ce,nu=ka,ru=vr,iu=ol,au=ll,ou=yr,su=T,cu=gn,lu=ia,uu=k,du=Ba,fu=Sl,pu=ut,mu=cr,hu=xt,gu=At,_u=Cl,vu=Ol,yu=Nl,bu=io,xu=Zi,Su=Vl.forEach,Cu=Li(`hidden`),wu=`Symbol`,Tu=`prototype`,Eu=xu.set,Du=xu.getterFor(wu),Ou=Object[Tu],ku=Ul.Symbol,Au=ku&&ku[Tu],ju=Ul.RangeError,Mu=Ul.TypeError,Nu=Ul.QObject,Pu=su.f,Fu=cu.f,Iu=au.f,Lu=uu.f,Ru=Gl([].push),zu=pu(`symbols`),Bu=pu(`op-symbols`),Vu=pu(`wks`),Hu=!Nu||!Nu[Tu]||!Nu[Tu].findChild,Uu=function(e,t,n){var r=Pu(Ou,t);r&&delete Ou[t],Fu(e,t,n),r&&e!==Ou&&Fu(Ou,t,r)},Wu=Kl&&Jl((function(){return nu(Fu({},`a`,{get:function(){return Fu(this,`a`,{value:7}).a}})).a!==7}))?Uu:Fu,Gu=function(e,t){var n=zu[e]=nu(Au);return Eu(n,{type:wu,tag:e,description:t}),Kl||(n.description=t),n},Ku=function(e,t,n){e===Ou&&Ku(Bu,t,n),Zl(e);var r=$l(t);return Zl(n),Yl(zu,r)?(n.enumerable?(Yl(e,Cu)&&e[Cu][r]&&(e[Cu][r]=!1),n=nu(n,{enumerable:tu(0,!1)})):(Yl(e,Cu)||Fu(e,Cu,tu(1,{})),e[Cu][r]=!0),Wu(e,r,n)):Fu(e,r,n)},qu=function(e,t){Zl(e);var n=Ql(t);return Su(ru(n).concat(Zu(n)),(function(t){Kl&&!Wl(Ju,n,t)||Ku(e,t,n[t])})),e},Ju=function(e){var t=$l(e),n=Wl(Lu,this,t);return!(this===Ou&&Yl(zu,t)&&!Yl(Bu,t))&&(!(n||!Yl(this,t)||!Yl(zu,t)||Yl(this,Cu)&&this[Cu][t])||n)},Yu=function(e,t){var n=Ql(e),r=$l(t);if(n!==Ou||!Yl(zu,r)||Yl(Bu,r)){var i=Pu(n,r);return!i||!Yl(zu,r)||Yl(n,Cu)&&n[Cu][r]||(i.enumerable=!0),i}},Xu=function(e){var t=Iu(Ql(e)),n=[];return Su(t,(function(e){Yl(zu,e)||Yl(mu,e)||Ru(n,e)})),n},Zu=function(e){var t=e===Ou,n=Iu(t?Bu:Ql(e)),r=[];return Su(n,(function(e){!Yl(zu,e)||t&&!Yl(Ou,e)||Ru(r,zu[e])})),r};ql||(ku=function(){if(Xl(Au,this))throw new Mu(`Symbol is not a constructor`);var e=arguments.length&&arguments[0]!==void 0?eu(arguments[0]):void 0,t=hu(e),n=function(e){this===Ou&&Wl(n,Bu,e),Yl(this,Cu)&&Yl(this[Cu],t)&&(this[Cu][t]=!1);var r=tu(1,e);try{Wu(this,t,r)}catch(e){if(!(e instanceof ju))throw e;Uu(this,t,r)}};return Kl&&Hu&&Wu(Ou,t,{configurable:!0,set:n}),Gu(t,e)},du(Au=ku[Tu],`toString`,(function(){return Du(this).tag})),du(ku,`withoutSetter`,(function(e){return Gu(hu(e),e)})),uu.f=Ju,cu.f=Ku,lu.f=qu,su.f=Yu,iu.f=au.f=Xu,ou.f=Zu,_u.f=function(e){return Gu(gu(e),e)},Kl&&fu(Au,`description`,{configurable:!0,get:function(){return Du(this).description}})),Hl({global:!0,constructor:!0,wrap:!0,forced:!ql,sham:!ql},{Symbol:ku}),Su(ru(Vu),(function(e){vu(e)})),Hl({target:wu,stat:!0,forced:!ql},{useSetter:function(){Hu=!0},useSimple:function(){Hu=!1}}),Hl({target:`Object`,stat:!0,forced:!ql,sham:!Kl},{create:function(e,t){return t===void 0?nu(e):qu(nu(e),t)},defineProperty:Ku,defineProperties:qu,getOwnPropertyDescriptor:Yu}),Hl({target:`Object`,stat:!0,forced:!ql},{getOwnPropertyNames:Xu}),yu(),bu(ku,wu),mu[Cu]=!0;var Qu=Le&&!!Symbol.for&&!!Symbol.keyFor,$u=I,ed=Ee,td=gt,nd=Si,rd=ut,id=Qu,ad=rd(`string-to-symbol-registry`),od=rd(`symbol-to-string-registry`);$u({target:`Symbol`,stat:!0,forced:!id},{for:function(e){var t=nd(e);if(td(ad,t))return ad[t];var n=ed(`Symbol`)(t);return ad[t]=n,od[n]=t,n}});var sd=I,cd=gt,ld=Ue,ud=Ge,dd=Qu,fd=ut(`symbol-to-string-registry`);sd({target:`Symbol`,stat:!0,forced:!dd},{keyFor:function(e){if(!ld(e))throw TypeError(ud(e)+` is not a symbol`);if(cd(fd,e))return fd[e]}});var pd=Mc,md=w,hd=x,gd=Si,_d=_([].push),vd=I,yd=Ee,bd=f,xd=ie,Sd=_,Cd=o,wd=w,Td=Ue,Ed=Pr,Dd=function(e){if(md(e))return e;if(pd(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?_d(n,i):typeof i!=`number`&&hd(i)!==`Number`&&hd(i)!==`String`||_d(n,gd(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(pd(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Od=Le,kd=String,Ad=yd(`JSON`,`stringify`),jd=Sd(/./.exec),Md=Sd(``.charAt),Nd=Sd(``.charCodeAt),Pd=Sd(``.replace),Fd=Sd(1 .toString),Id=/[\uD800-\uDFFF]/g,Ld=/^[\uD800-\uDBFF]$/,Rd=/^[\uDC00-\uDFFF]$/,zd=!Od||Cd((function(){var e=yd(`Symbol`)(`stringify detection`);return Ad([e])!==`[null]`||Ad({a:e})!==`{}`||Ad(Object(e))!==`{}`})),Bd=Cd((function(){return Ad(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Ad(`\udead`)!==`"\\udead"`})),Vd=function(e,t){var n=Ed(arguments),r=Dd(t);if(wd(r)||e!==void 0&&!Td(e))return n[1]=function(e,t){if(wd(r)&&(t=xd(r,this,kd(e),t)),!Td(t))return t},bd(Ad,null,n)},Hd=function(e,t,n){var r=Md(n,t-1),i=Md(n,t+1);return jd(Ld,e)&&!jd(Rd,i)||jd(Rd,e)&&!jd(Ld,r)?`\\u`+Fd(Nd(e,0),16):e};Ad&&vd({target:`JSON`,stat:!0,arity:3,forced:zd||Bd},{stringify:function(e,t,n){var r=Ed(arguments),i=bd(zd?Vd:Ad,null,r);return Bd&&typeof i==`string`?Pd(i,Id,Hd):i}});var Ud=yr,Wd=pt;I({target:`Object`,stat:!0,forced:!Le||o((function(){Ud.f(1)}))},{getOwnPropertySymbols:function(e){var t=Ud.f;return t?t(Wd(e)):[]}}),Ol(`asyncIterator`),Ol(`hasInstance`),Ol(`isConcatSpreadable`),Ol(`iterator`),Ol(`match`),Ol(`matchAll`),Ol(`replace`),Ol(`search`),Ol(`species`),Ol(`split`);var Gd=Nl;Ol(`toPrimitive`),Gd();var Kd=Ee,qd=io;Ol(`toStringTag`),qd(Kd(`Symbol`),`Symbol`),Ol(`unscopables`),io(a.JSON,`JSON`,!0);var Jd=j.Symbol,Yd=At,Xd=gn.f,Zd=Yd(`metadata`),Qd=Function.prototype;Qd[Zd]===void 0&&Xd(Qd,Zd,{value:null}),Ol(`asyncDispose`),Ol(`dispose`),Ol(`metadata`);var $d=Jd,ef=_,tf=Ee(`Symbol`),nf=tf.keyFor,rf=ef(tf.prototype.valueOf),af=tf.isRegisteredSymbol||function(e){try{return nf(rf(e))!==void 0}catch{return!1}};I({target:`Symbol`,stat:!0},{isRegisteredSymbol:af});for(var of=ut,sf=Ee,cf=_,lf=Ue,uf=At,df=sf(`Symbol`),ff=df.isWellKnownSymbol,pf=sf(`Object`,`getOwnPropertyNames`),mf=cf(df.prototype.valueOf),hf=of(`wks`),gf=0,_f=pf(df),vf=_f.length;gf<vf;gf++)try{var yf=_f[gf];lf(df[yf])&&uf(yf)}catch{}var bf=function(e){if(ff&&ff(e))return!0;try{for(var t=mf(e),n=0,r=pf(hf),i=r.length;n<i;n++)if(hf[r[n]]==t)return!0}catch{}return!1};I({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:bf}),Ol(`matcher`),Ol(`observable`),I({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:af}),I({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:bf}),Ol(`metadataKey`),Ol(`patternMatch`),Ol(`replaceAll`);var xf=r($d),Sf=r(Cl.f(`iterator`));function Cf(e){return Cf=typeof xf==`function`&&typeof Sf==`symbol`?function(e){return typeof e}:function(e){return e&&typeof xf==`function`&&e.constructor===xf&&e!==xf.prototype?`symbol`:typeof e},Cf(e)}var wf=r(Cl.f(`toPrimitive`));function Tf(e){var t=function(e,t){if(Cf(e)!==`object`||e===null)return e;var n=e[wf];if(n!==void 0){var r=n.call(e,t||`default`);if(Cf(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return Cf(t)===`symbol`?t:String(t)}function Ef(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Ac(e,Tf(r.key),r)}}function V(e,t,n){return t&&Ef(e.prototype,t),n&&Ef(e,n),Ac(e,`prototype`,{writable:!1}),e}I({target:`Array`,stat:!0},{isArray:Mc});var Df=j.Array.isArray,Of=r(Df),kf=E,Af=Mc,jf=TypeError,Mf=Object.getOwnPropertyDescriptor,Nf=kf&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(Af(e)&&!Mf(e,`length`).writable)throw new jf(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},Pf=pt,Ff=rr,If=Nf,Lf=Pc;I({target:`Array`,proto:!0,arity:1,forced:o((function(){return[].push.call({length:4294967296},1)!==4294967297}))||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=Pf(this),n=Ff(t),r=arguments.length;Lf(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return If(t,n),n}});var Rf=Jr(`Array`).push,zf=P,Bf=Rf,Vf=Array.prototype,Hf=r(function(e){var t=e.push;return e===Vf||zf(Vf,e)&&t===Vf.push?Bf:t}),Uf=I,Wf=Mc,Gf=xs,Kf=Ce,qf=$n,Jf=rr,Yf=be,Xf=Ts,Zf=At,Qf=Pr,$f=Gc(`slice`),ep=Zf(`species`),tp=Array,np=Math.max;Uf({target:`Array`,proto:!0,forced:!$f},{slice:function(e,t){var n,r,i,a=Yf(this),o=Jf(a),s=qf(e,o),c=qf(t===void 0?o:t,o);if(Wf(a)&&(n=a.constructor,(Gf(n)&&(n===tp||Wf(n.prototype))||Kf(n)&&(n=n[ep])===null)&&(n=void 0),n===tp||n===void 0))return Qf(a,s,c);for(r=new(n===void 0?tp:n)(np(c-s,0)),i=0;s<c;s++,i++)s in a&&Xf(r,i,a[s]);return r.length=i,r}});var rp=Jr(`Array`).slice,ip=P,ap=rp,op=Array.prototype,sp=function(e){var t=e.slice;return e===op||ip(op,e)&&t===op.slice?ap:t},cp=r(sp),lp=r(ec);function up(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dp(e,t){var n;if(e){if(typeof e==`string`)return up(e,t);var r=cp(n=Object.prototype.toString.call(e)).call(n,8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?lp(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?up(e,t):void 0}}function fp(e,t){return function(e){if(Of(e))return e}(e)||function(e,t){var n=e==null?null:xf!==void 0&&xc(e)||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(Hf(s).call(s,r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||dp(e,t)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function pp(e){return function(e){if(Of(e))return up(e)}(e)||function(e){if(xf!==void 0&&xc(e)!=null||e[`@@iterator`]!=null)return lp(e)}(e)||dp(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var mp=r(Jd),hp=Jr(`Array`).concat,gp=P,_p=hp,vp=Array.prototype,yp=r(function(e){var t=e.concat;return e===vp||gp(vp,e)&&t===vp.concat?_p:t}),bp=r(sp),xp=Ee,Sp=ol,Cp=yr,wp=xn,Tp=_([].concat),Ep=xp(`Reflect`,`ownKeys`)||function(e){var t=Sp.f(wp(e)),n=Cp.f;return n?Tp(t,n(e)):t},Dp=r(Df),Op=Vl.map;I({target:`Array`,proto:!0,forced:!Gc(`map`)},{map:function(e){return Op(this,e,arguments.length>1?arguments[1]:void 0)}});var kp=Jr(`Array`).map,Ap=P,jp=kp,Mp=Array.prototype,Np=r(function(e){var t=e.map;return e===Mp||Ap(Mp,e)&&t===Mp.map?jp:t}),Pp=pt,Fp=vr;I({target:`Object`,stat:!0,forced:o((function(){Fp(1)}))},{keys:function(e){return Fp(Pp(e))}});var Ip=r(j.Object.keys),Lp=I,Rp=Date,zp=_(Rp.prototype.getTime);Lp({target:`Date`,stat:!0},{now:function(){return zp(new Rp)}});var Bp=r(j.Date.now),Vp=o,Hp=function(e,t){var n=[][e];return!!n&&Vp((function(){n.call(null,t||function(){return 1},1)}))},Up=Vl.forEach,Wp=Hp(`forEach`)?[].forEach:function(e){return Up(this,e,arguments.length>1?arguments[1]:void 0)};I({target:`Array`,proto:!0,forced:[].forEach!==Wp},{forEach:Wp});var Gp=Jr(`Array`).forEach,Kp=yi,qp=gt,Jp=P,Yp=Gp,Xp=Array.prototype,Zp={DOMTokenList:!0,NodeList:!0},Qp=r(function(e){var t=e.forEach;return e===Xp||Jp(Xp,e)&&t===Xp.forEach||qp(Zp,Kp(e))?Yp:t}),$p=I,em=Mc,tm=_([].reverse),nm=[1,2];$p({target:`Array`,proto:!0,forced:String(nm)===String(nm.reverse())},{reverse:function(){return em(this)&&(this.length=this.length),tm(this)}});var rm=Jr(`Array`).reverse,im=P,am=rm,om=Array.prototype,sm=r(function(e){var t=e.reverse;return e===om||im(om,e)&&t===om.reverse?am:t}),cm=Ge,lm=TypeError,um=function(e,t){if(!delete e[t])throw new lm(`Cannot delete property `+cm(t)+` of `+cm(e))},dm=I,fm=pt,pm=$n,mm=Yn,hm=rr,gm=Nf,_m=Pc,vm=Vc,ym=Ts,bm=um,xm=Gc(`splice`),Sm=Math.max,Cm=Math.min;dm({target:`Array`,proto:!0,forced:!xm},{splice:function(e,t){var n,r,i,a,o,s,c=fm(this),l=hm(c),u=pm(e,l),d=arguments.length;for(d===0?n=r=0:d===1?(n=0,r=l-u):(n=d-2,r=Cm(Sm(mm(t),0),l-u)),_m(l+n-r),i=vm(c,r),a=0;a<r;a++)(o=u+a)in c&&ym(i,a,c[o]);if(i.length=r,n<r){for(a=u;a<l-r;a++)s=a+n,(o=a+r)in c?c[s]=c[o]:bm(c,s);for(a=l;a>l-r+n;a--)bm(c,a-1)}else if(n>r)for(a=l-r;a>u;a--)s=a+n-1,(o=a+r-1)in c?c[s]=c[o]:bm(c,s);for(a=0;a<n;a++)c[a+u]=arguments[a+2];return gm(c,l-r+n),i}});var wm=Jr(`Array`).splice,Tm=P,Em=wm,Dm=Array.prototype,Om=r(function(e){var t=e.splice;return e===Dm||Tm(Dm,e)&&t===Dm.splice?Em:t}),km=R.includes;I({target:`Array`,proto:!0,forced:o((function(){return![,].includes()}))},{includes:function(e){return km(this,e,arguments.length>1?arguments[1]:void 0)}});var Am=Jr(`Array`).includes,jm=Ce,Mm=x,Nm=At(`match`),Pm=function(e){var t;return jm(e)&&((t=e[Nm])===void 0?Mm(e)===`RegExp`:!!t)},Fm=TypeError,Im=At(`match`),Lm=I,Rm=function(e){if(Pm(e))throw new Fm(`The method doesn't accept regular expressions`);return e},zm=_e,Bm=Si,Vm=function(e){var t=/./;try{`/./`[e](t)}catch{try{return t[Im]=!1,`/./`[e](t)}catch{}}return!1},Hm=_(``.indexOf);Lm({target:`String`,proto:!0,forced:!Vm(`includes`)},{includes:function(e){return!!~Hm(Bm(zm(this)),Bm(Rm(e)),arguments.length>1?arguments[1]:void 0)}});var Um=Jr(`String`).includes,Wm=P,Gm=Am,Km=Um,qm=Array.prototype,Jm=String.prototype,Ym=r(function(e){var t=e.includes;return e===qm||Wm(qm,e)&&t===qm.includes?Gm:typeof e==`string`||e===Jm||Wm(Jm,e)&&t===Jm.includes?Km:t}),Xm=pt,Zm=Ra,Qm=Aa;I({target:`Object`,stat:!0,forced:o((function(){Zm(1)})),sham:!Qm},{getPrototypeOf:function(e){return Zm(Xm(e))}});var $m=j.Object.getPrototypeOf,eh=r($m),th=Vl.filter;I({target:`Array`,proto:!0,forced:!Gc(`filter`)},{filter:function(e){return th(this,e,arguments.length>1?arguments[1]:void 0)}});var nh=Jr(`Array`).filter,rh=P,ih=nh,ah=Array.prototype,oh=r(function(e){var t=e.filter;return e===ah||rh(ah,e)&&t===ah.filter?ih:t}),sh=`
12
+ \v\f\r \xA0               \u2028\u2029`,ch=_e,lh=Si,uh=sh,dh=_(``.replace),fh=RegExp(`^[`+uh+`]+`),ph=RegExp(`(^|[^`+uh+`])[`+uh+`]+$`),mh=function(e){return function(t){var n=lh(ch(t));return 1&e&&(n=dh(n,fh,``)),2&e&&(n=dh(n,ph,`$1`)),n}},hh={start:mh(1),end:mh(2),trim:mh(3)},gh=a,_h=o,vh=_,yh=Si,bh=hh.trim,xh=sh,Sh=gh.parseInt,Ch=gh.Symbol,wh=Ch&&Ch.iterator,Th=/^[+-]?0x/i,Eh=vh(Th.exec),Dh=Sh(xh+`08`)!==8||Sh(xh+`0x16`)!==22||wh&&!_h((function(){Sh(Object(wh))}))?function(e,t){var n=bh(yh(e));return Sh(n,t>>>0||(Eh(Th,n)?16:10))}:Sh;I({global:!0,forced:parseInt!==Dh},{parseInt:Dh});var Oh=r(j.parseInt),kh=I,Ah=R.indexOf,jh=Hp,Mh=C([].indexOf),Nh=!!Mh&&1/Mh([1],1,-0)<0;kh({target:`Array`,proto:!0,forced:Nh||!jh(`indexOf`)},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return Nh?Mh(this,e,t)||0:Ah(this,e,t)}});var Ph=Jr(`Array`).indexOf,Fh=P,Ih=Ph,Lh=Array.prototype,H=r(function(e){var t=e.indexOf;return e===Lh||Fh(Lh,e)&&t===Lh.indexOf?Ih:t});I({target:`Object`,stat:!0,sham:!E},{create:ka});var Rh=j.Object,zh=function(e,t){return Rh.create(e,t)},Bh=r(zh),Vh=j,Hh=f;Vh.JSON||={stringify:JSON.stringify};var Uh=r(function(e,t,n){return Hh(Vh.JSON.stringify,null,arguments)}),Wh=typeof Bun==`function`&&Bun&&typeof Bun.version==`string`,Gh=TypeError,Kh=a,qh=f,Jh=w,Yh=Wh,Xh=F,Zh=Pr,Qh=function(e,t){if(e<t)throw new Gh(`Not enough arguments`);return e},$h=Kh.Function,eg=/MSIE .\./.test(Xh)||Yh&&function(){var e=Kh.Bun.version.split(`.`);return e.length<3||e[0]===`0`&&(e[1]<3||e[1]===`3`&&e[2]===`0`)}(),tg=function(e,t){var n=t?2:1;return eg?function(r,i){var a=Qh(arguments.length,1)>n,o=Jh(r)?r:$h(r),s=a?Zh(arguments,n):[],c=a?function(){qh(o,this,s)}:o;return t?e(c,i):e(c)}:e},ng=I,rg=a,ig=tg(rg.setInterval,!0);ng({global:!0,bind:!0,forced:rg.setInterval!==ig},{setInterval:ig});var ag=I,og=a,sg=tg(og.setTimeout,!0);ag({global:!0,bind:!0,forced:og.setTimeout!==sg},{setTimeout:sg});var cg=r(j.setTimeout),lg=pt,ug=$n,dg=rr;I({target:`Array`,proto:!0},{fill:function(e){for(var t=lg(this),n=dg(t),r=arguments.length,i=ug(r>1?arguments[1]:void 0,n),a=r>2?arguments[2]:void 0,o=a===void 0?n:ug(a,n);o>i;)t[i++]=e;return t}});var fg,pg=Jr(`Array`).fill,mg=P,hg=pg,gg=Array.prototype,_g=r(function(e){var t=e.fill;return e===gg||mg(gg,e)&&t===gg.fill?hg:t});function vg(){return vg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vg.apply(this,arguments)}function yg(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function bg(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}fg=typeof Object.assign==`function`?Object.assign:function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t};var xg,Sg=fg,Cg=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],wg=typeof document>`u`?{style:{}}:document.createElement(`div`),Tg=Math.round,Eg=Math.abs,Dg=Date.now;function Og(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<Cg.length;){if((r=(n=Cg[a])?n+i:t)in e)return r;a++}}xg=typeof window>`u`?{}:window;var kg=Og(wg.style,`touchAction`),Ag=kg!==void 0,jg=`compute`,Mg=`auto`,Ng=`manipulation`,Pg=`none`,Fg=`pan-x`,Ig=`pan-y`,Lg=function(){if(!Ag)return!1;var e={},t=xg.CSS&&xg.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach((function(n){return e[n]=!t||xg.CSS.supports(`touch-action`,n)})),e}(),Rg=`ontouchstart`in xg,zg=Og(xg,`PointerEvent`)!==void 0,Bg=Rg&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),Vg=`touch`,Hg=`mouse`,Ug=25,Wg=1,Gg=4,Kg=8,qg=1,Jg=2,Yg=4,Xg=8,Zg=16,Qg=Jg|Yg,$g=Xg|Zg,e_=Qg|$g,t_=[`x`,`y`],n_=[`clientX`,`clientY`];function r_(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==void 0)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function i_(e,t){return typeof e==`function`?e.apply(t&&t[0]||void 0,t):e}function a_(e,t){return e.indexOf(t)>-1}var o_=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===jg&&(e=this.compute()),Ag&&this.manager.element.style&&Lg[e]&&(this.manager.element.style[kg]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return r_(this.manager.recognizers,(function(t){i_(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(a_(e,Pg))return Pg;var t=a_(e,Fg),n=a_(e,Ig);return t&&n?Pg:t||n?t?Fg:Ig:a_(e,Ng)?Ng:Mg}(e.join(` `))},t.preventDefaults=function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=a_(r,Pg)&&!Lg[Pg],a=a_(r,Ig)&&!Lg[Ig],o=a_(r,Fg)&&!Lg[Fg];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!o||!a)return i||a&&n&Qg||o&&n&$g?this.preventSrc(t):void 0}},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function s_(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function c_(e){var t=e.length;if(t===1)return{x:Tg(e[0].clientX),y:Tg(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:Tg(n/t),y:Tg(r/t)}}function l_(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:Tg(e.pointers[n].clientX),clientY:Tg(e.pointers[n].clientY)},n++;return{timeStamp:Dg(),pointers:t,center:c_(t),deltaX:e.deltaX,deltaY:e.deltaY}}function u_(e,t,n){n||=t_;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function d_(e,t,n){n||=t_;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}function f_(e,t){return e===t?qg:Eg(e)>=Eg(t)?e<0?Jg:Yg:t<0?Xg:Zg}function p_(e,t,n){return{x:t/e||0,y:n/e||0}}function m_(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||=l_(t),i>1&&!n.firstMultiple?n.firstMultiple=l_(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=c_(r);t.timeStamp=Dg(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=d_(s,c),t.distance=u_(s,c),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};t.eventType!==Wg&&a.eventType!==Gg||(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=f_(t.deltaX,t.deltaY);var l,u,d=p_(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=Eg(d.x)>Eg(d.y)?d.x:d.y,t.scale=o?(l=o.pointers,u_((u=r)[0],u[1],n_)/u_(l[0],l[1],n_)):1,t.rotation=o?function(e,t){return d_(t[1],t[0],n_)+d_(e[1],e[0],n_)}(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,i,a,o=e.lastInterval||t,s=t.timeStamp-o.timeStamp;if(t.eventType!==Kg&&(s>Ug||o.velocity===void 0)){var c=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,u=p_(s,c,l);r=u.x,i=u.y,n=Eg(u.x)>Eg(u.y)?u.x:u.y,a=f_(c,l),e.lastInterval=t}else n=o.velocity,r=o.velocityX,i=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=a}(n,t);var f,p=e.element,m=t.srcEvent;s_(f=m.composedPath?m.composedPath()[0]:m.path?m.path[0]:m.target,p)&&(p=f),t.target=p}function h_(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&Wg&&r-i==0,o=t&(Gg|Kg)&&r-i==0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,m_(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function g_(e){return e.trim().split(/\s+/g)}function __(e,t,n){r_(g_(t),(function(t){e.addEventListener(t,n,!1)}))}function v_(e,t,n){r_(g_(t),(function(t){e.removeEventListener(t,n,!1)}))}function y_(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}var b_=function(){function e(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){i_(e.options.enable,[e])&&n.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&__(this.element,this.evEl,this.domHandler),this.evTarget&&__(this.target,this.evTarget,this.domHandler),this.evWin&&__(y_(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&v_(this.element,this.evEl,this.domHandler),this.evTarget&&v_(this.target,this.evTarget,this.domHandler),this.evWin&&v_(y_(this.element),this.evWin,this.domHandler)},e}();function x_(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}var S_={pointerdown:Wg,pointermove:2,pointerup:Gg,pointercancel:Kg,pointerout:Kg},C_={2:Vg,3:`pen`,4:Hg,5:`kinect`},w_=`pointerdown`,T_=`pointermove pointerup pointercancel`;xg.MSPointerEvent&&!xg.PointerEvent&&(w_=`MSPointerDown`,T_=`MSPointerMove MSPointerUp MSPointerCancel`);var E_=function(e){function t(){var n,r=t.prototype;return r.evEl=w_,r.evWin=T_,(n=e.apply(this,arguments)||this).store=n.manager.session.pointerEvents=[],n}return yg(t,e),t.prototype.handler=function(e){var t=this.store,n=!1,r=S_[e.type.toLowerCase().replace(`ms`,``)],i=C_[e.pointerType]||e.pointerType,a=i===Vg,o=x_(t,e.pointerId,`pointerId`);r&Wg&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&(Gg|Kg)&&(n=!0),o<0||(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))},t}(b_);function D_(e){return Array.prototype.slice.call(e,0)}function O_(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];x_(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}var k_={touchstart:Wg,touchmove:2,touchend:Gg,touchcancel:Kg},A_=function(e){function t(){var n;return t.prototype.evTarget=`touchstart touchmove touchend touchcancel`,(n=e.apply(this,arguments)||this).targetIds={},n}return yg(t,e),t.prototype.handler=function(e){var t=k_[e.type],n=j_.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:Vg,srcEvent:e})},t}(b_);function j_(e,t){var n,r,i=D_(e.touches),a=this.targetIds;if(t&(2|Wg)&&i.length===1)return a[i[0].identifier]=!0,[i,i];var o=D_(e.changedTouches),s=[],c=this.target;if(r=i.filter((function(e){return s_(e.target,c)})),t===Wg)for(n=0;n<r.length;)a[r[n].identifier]=!0,n++;for(n=0;n<o.length;)a[o[n].identifier]&&s.push(o[n]),t&(Gg|Kg)&&delete a[o[n].identifier],n++;return s.length?[O_(r.concat(s),`identifier`,!0),s]:void 0}var M_={mousedown:Wg,mousemove:2,mouseup:Gg},N_=function(e){function t(){var n,r=t.prototype;return r.evEl=`mousedown`,r.evWin=`mousemove mouseup`,(n=e.apply(this,arguments)||this).pressed=!1,n}return yg(t,e),t.prototype.handler=function(e){var t=M_[e.type];t&Wg&&e.button===0&&(this.pressed=!0),2&t&&e.which!==1&&(t=Gg),this.pressed&&(t&Gg&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:Hg,srcEvent:e}))},t}(b_),P_=2500;function F_(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY},r=this.lastTouches;this.lastTouches.push(n),setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),P_)}}function I_(e,t){e&Wg?(this.primaryTouch=t.changedPointers[0].identifier,F_.call(this,t)):e&(Gg|Kg)&&F_.call(this,t)}function L_(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=25&&o<=25)return!0}return!1}var R_=function(){return function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).handler=function(e,t,n){var i=n.pointerType===Vg,a=n.pointerType===Hg;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)I_.call(bg(bg(r)),t,n);else if(a&&L_.call(bg(bg(r)),n))return;r.callback(e,t,n)}},r.touch=new A_(r.manager,r.handler),r.mouse=new N_(r.manager,r.handler),r.primaryTouch=null,r.lastTouches=[],r}return yg(t,e),t.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(b_)}();function z_(e,t,n){return!!Array.isArray(e)&&(r_(e,n[t],n),!0)}var B_=32,V_=1;function H_(e,t){var n=t.manager;return n?n.get(e):e}function U_(e){return 16&e?`cancel`:8&e?`end`:4&e?`move`:2&e?`start`:``}var W_=function(){function e(e){e===void 0&&(e={}),this.options=vg({enable:!0},e),this.id=V_++,this.manager=null,this.state=1,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return Sg(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(z_(e,`recognizeWith`,this))return this;var t=this.simultaneous;return t[(e=H_(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return z_(e,`dropRecognizeWith`,this)||(e=H_(e,this),delete this.simultaneous[e.id]),this},t.requireFailure=function(e){if(z_(e,`requireFailure`,this))return this;var t=this.requireFail;return x_(t,e=H_(e,this))===-1&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(z_(e,`dropRequireFailure`,this))return this;e=H_(e,this);var t=x_(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+U_(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+U_(n))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=B_},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},t.recognize=function(e){var t=Sg({},e);if(!i_(this.options.enable,[this,t]))return this.reset(),void(this.state=B_);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),G_=function(e){function t(t){var n;return t===void 0&&(t={}),(n=e.call(this,vg({event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this).pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}yg(t,e);var n=t.prototype;return n.getTouchAction=function(){return[Ng]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime<n.time;if(this.reset(),e.eventType&Wg&&this.count===0)return this.failTimeout();if(i&&a&&r){if(e.eventType!==Gg)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<n.interval,s=!this.pCenter||u_(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout((function(){t.state=8,t.tryEmit()}),n.interval),2):8}return B_},n.failTimeout=function(){var e=this;return this._timer=setTimeout((function(){e.state=B_}),this.options.interval),B_},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){this.state===8&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(W_),K_=function(e){function t(t){return t===void 0&&(t={}),e.call(this,vg({pointers:1},t))||this}yg(t,e);var n=t.prototype;return n.attrTest=function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},n.process=function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(n&Kg||!i)?16|t:r||i?n&Gg?8|t:2&t?4|t:2:B_},t}(W_);function q_(e){return e===Zg?`down`:e===Xg?`up`:e===Jg?`left`:e===Yg?`right`:``}var J_=function(e){function t(t){var n;return t===void 0&&(t={}),(n=e.call(this,vg({event:`pan`,threshold:10,pointers:1,direction:e_},t))||this).pX=null,n.pY=null,n}yg(t,e);var n=t.prototype;return n.getTouchAction=function(){var e=this.options.direction,t=[];return e&Qg&&t.push(Ig),e&$g&&t.push(Fg),t},n.directionTest=function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&Qg?(i=a===0?qg:a<0?Jg:Yg,n=a!==this.pX,r=Math.abs(e.deltaX)):(i=o===0?qg:o<0?Xg:Zg,n=o!==this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},n.attrTest=function(e){return K_.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},n.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var n=q_(t.direction);n&&(t.additionalEvent=this.options.event+n),e.prototype.emit.call(this,t)},t}(K_),Y_=function(e){function t(t){return t===void 0&&(t={}),e.call(this,vg({event:`swipe`,threshold:10,velocity:.3,direction:Qg|$g,pointers:1},t))||this}yg(t,e);var n=t.prototype;return n.getTouchAction=function(){return J_.prototype.getTouchAction.call(this)},n.attrTest=function(t){var n,r=this.options.direction;return r&(Qg|$g)?n=t.overallVelocity:r&Qg?n=t.overallVelocityX:r&$g&&(n=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&r&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&Eg(n)>this.options.velocity&&t.eventType&Gg},n.emit=function(e){var t=q_(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(K_),X_=function(e){function t(t){return t===void 0&&(t={}),e.call(this,vg({event:`pinch`,threshold:0,pointers:2},t))||this}yg(t,e);var n=t.prototype;return n.getTouchAction=function(){return[Pg]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},n.emit=function(t){if(t.scale!==1){var n=t.scale<1?`in`:`out`;t.additionalEvent=this.options.event+n}e.prototype.emit.call(this,t)},t}(K_),Z_=function(e){function t(t){return t===void 0&&(t={}),e.call(this,vg({event:`rotate`,threshold:0,pointers:2},t))||this}yg(t,e);var n=t.prototype;return n.getTouchAction=function(){return[Pg]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)},t}(K_),Q_=function(e){function t(t){var n;return t===void 0&&(t={}),(n=e.call(this,vg({event:`press`,pointers:1,time:251,threshold:9},t))||this)._timer=null,n._input=null,n}yg(t,e);var n=t.prototype;return n.getTouchAction=function(){return[Mg]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime>n.time;if(this._input=e,!i||!r||e.eventType&(Gg|Kg)&&!a)this.reset();else if(e.eventType&Wg)this.reset(),this._timer=setTimeout((function(){t.state=8,t.tryEmit()}),n.time);else if(e.eventType&Gg)return 8;return B_},n.reset=function(){clearTimeout(this._timer)},n.emit=function(e){this.state===8&&(e&&e.eventType&Gg?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=Dg(),this.manager.emit(this.options.event,this._input)))},t}(W_),$_={domEvents:!1,touchAction:jg,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}},ev=[[Z_,{enable:!1}],[X_,{enable:!1},[`rotate`]],[Y_,{direction:Qg}],[J_,{direction:Qg},[`swipe`]],[G_],[G_,{event:`doubletap`,taps:2},[`tap`]],[Q_]];function tv(e,t){var n,r=e.element;r.style&&(r_(e.options.cssProps,(function(i,a){n=Og(r.style,a),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||``})),t||(e.oldCssProps={}))}var nv=function(){function e(e,t){var n,r=this;this.options=Sg({},$_,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(zg?E_:Bg?A_:Rg?R_:N_))(n,h_),this.touchAction=new o_(this,this.options.touchAction),tv(this,!0),r_(this.options.recognizers,(function(e){var t=r.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}var t=e.prototype;return t.set=function(e){return Sg(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?2:1},t.recognize=function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(t.curRecognizer=null,i=null);for(var a=0;a<r.length;)n=r[a],t.stopped===2||i&&n!==i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(t.curRecognizer=n,i=n),a++}},t.get=function(e){if(e instanceof W_)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event===e)return t[n];return null},t.add=function(e){if(z_(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(z_(e,`remove`,this))return this;var t=this.get(e);if(e){var n=this.recognizers,r=x_(n,t);r!==-1&&(n.splice(r,1),this.touchAction.update())}return this},t.on=function(e,t){if(e===void 0||t===void 0)return this;var n=this.handlers;return r_(g_(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this},t.off=function(e,t){if(e===void 0)return this;var n=this.handlers;return r_(g_(e),(function(e){t?n[e]&&n[e].splice(x_(n[e],t),1):delete n[e]})),this},t.emit=function(e,t){this.options.domEvents&&function(e,t){var n=document.createEvent(`Event`);n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},t.destroy=function(){this.element&&tv(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),rv={touchstart:Wg,touchmove:2,touchend:Gg,touchcancel:Kg},iv=function(e){function t(){var n,r=t.prototype;return r.evTarget=`touchstart`,r.evWin=`touchstart touchmove touchend touchcancel`,(n=e.apply(this,arguments)||this).started=!1,n}return yg(t,e),t.prototype.handler=function(e){var t=rv[e.type];if(t===Wg&&(this.started=!0),this.started){var n=av.call(this,e,t);t&(Gg|Kg)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:Vg,srcEvent:e})}},t}(b_);function av(e,t){var n=D_(e.touches),r=D_(e.changedTouches);return t&(Gg|Kg)&&(n=O_(n.concat(r),`identifier`,!0)),[n,r]}function ov(e,t,n){var r=`DEPRECATED METHOD: `+t+`
13
+ `+n+` AT
14
+ `;return function(){var t=Error(`get-stack-trace`),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,``).replace(/^\s+at\s+/gm,``).replace(/^Object.<anonymous>\s*\(/gm,`{anonymous}()@`):`Unknown Stack Trace`,i=window.console&&(window.console.warn||window.console.log);return i&&i.call(window.console,r,n),e.apply(this,arguments)}}var sv=ov((function(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;)(!n||n&&e[r[i]]===void 0)&&(e[r[i]]=t[r[i]]),i++;return e}),`extend`,"Use `assign`."),cv=ov((function(e,t){return sv(e,t,!0)}),`merge`,"Use `assign`.");function lv(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&Sg(r,n)}function uv(e,t){return function(){return e.apply(t,arguments)}}var dv=function(){var e=function(e,t){return t===void 0&&(t={}),new nv(e,vg({recognizers:ev.concat()},t))};return e.VERSION=`2.0.17-rc`,e.DIRECTION_ALL=e_,e.DIRECTION_DOWN=Zg,e.DIRECTION_LEFT=Jg,e.DIRECTION_RIGHT=Yg,e.DIRECTION_UP=Xg,e.DIRECTION_HORIZONTAL=Qg,e.DIRECTION_VERTICAL=$g,e.DIRECTION_NONE=qg,e.DIRECTION_DOWN=Zg,e.INPUT_START=Wg,e.INPUT_MOVE=2,e.INPUT_END=Gg,e.INPUT_CANCEL=Kg,e.STATE_POSSIBLE=1,e.STATE_BEGAN=2,e.STATE_CHANGED=4,e.STATE_ENDED=8,e.STATE_RECOGNIZED=8,e.STATE_CANCELLED=16,e.STATE_FAILED=B_,e.Manager=nv,e.Input=b_,e.TouchAction=o_,e.TouchInput=A_,e.MouseInput=N_,e.PointerEventInput=E_,e.TouchMouseInput=R_,e.SingleTouchInput=iv,e.Recognizer=W_,e.AttrRecognizer=K_,e.Tap=G_,e.Pan=J_,e.Swipe=Y_,e.Pinch=X_,e.Rotate=Z_,e.Press=Q_,e.on=__,e.off=v_,e.each=r_,e.merge=cv,e.extend=sv,e.bindFn=uv,e.assign=Sg,e.inherit=lv,e.bindFn=uv,e.prefixed=Og,e.toArray=D_,e.inArray=x_,e.uniqueArray=O_,e.splitStr=g_,e.boolOrFn=i_,e.hasParent=s_,e.addEventListeners=__,e.removeEventListeners=v_,e.defaults=Sg({},$_,{preset:ev}),e}();dv.defaults;var fv=dv;function pv(e,t){var n=mp!==void 0&&Sc(e)||e[`@@iterator`];if(!n){if(Dp(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return mv(e,t);var r=bp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return tc(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mv(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
15
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function mv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hv(){var e=[...arguments];return function(e){var t=fp(function(){for(var e=function(){var e=4022871197;return function(t){for(var n=t.toString(),r=0;r<n.length;r++){var i=.02519603282416938*(e+=n.charCodeAt(r));i-=e=i>>>0,e=(i*=e)>>>0,e+=4294967296*(i-=e)}return 23283064365386963e-26*(e>>>0)}}(),t=e(` `),n=e(` `),r=e(` `),i=0;i<arguments.length;i++)(t-=e(i<0||arguments.length<=i?void 0:arguments[i]))<0&&(t+=1),(n-=e(i<0||arguments.length<=i?void 0:arguments[i]))<0&&(n+=1),(r-=e(i<0||arguments.length<=i?void 0:arguments[i]))<0&&(r+=1);return[t,n,r]}(e),3),n=t[0],r=t[1],i=t[2],a=1,o=function(){var e=2091639*n+23283064365386963e-26*a;return n=r,r=i,i=e-(a=0|e)};return o.uint32=function(){return 4294967296*o()},o.fract53=function(){return o()+11102230246251565e-32*(2097152*o()|0)},o.algorithm=`Alea`,o.seed=e,o.version=`0.9`,o}(e.length?e:[Bp()])}mp(`DELETE`);var gv=typeof window<`u`?window.Hammer||fv:function(){return function(){var e=function(){};return{on:e,off:e,destroy:e,emit:e,get:function(){return{set:e}}}}()};function _v(e){var t,n=this;this._cleanupQueue=[],this.active=!1,this._dom={container:e,overlay:document.createElement(`div`)},this._dom.overlay.classList.add(`vis-overlay`),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push((function(){n._dom.overlay.parentNode.removeChild(n._dom.overlay)}));var r=gv(this._dom.overlay);r.on(`tap`,z(t=this._onTapOverlay).call(t,this)),this._cleanupQueue.push((function(){r.destroy()}));var i=[`tap`,`doubletap`,`press`,`pinch`,`pan`,`panstart`,`panmove`,`panend`];Qp(i).call(i,(function(e){r.on(e,(function(e){e.srcEvent.stopPropagation()}))})),document&&document.body&&(this._onClick=function(t){(function(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1})(t.target,e)||n.deactivate()},document.body.addEventListener(`click`,this._onClick),this._cleanupQueue.push((function(){document.body.removeEventListener(`click`,n._onClick)}))),this._escListener=function(e){(`key`in e?e.key===`Escape`:e.keyCode===27)&&n.deactivate()}}si(_v.prototype),_v.current=null,_v.prototype.destroy=function(){var e,t;this.deactivate();var n,r=pv(sm(e=Om(t=this._cleanupQueue).call(t,0)).call(e));try{for(r.s();!(n=r.n()).done;)(0,n.value)()}catch(e){r.e(e)}finally{r.f()}},_v.prototype.activate=function(){_v.current&&_v.current.deactivate(),_v.current=this,this.active=!0,this._dom.overlay.style.display=`none`,this._dom.container.classList.add(`vis-active`),this.emit(`change`),this.emit(`activate`),document.body.addEventListener(`keydown`,this._escListener)},_v.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display=`block`,this._dom.container.classList.remove(`vis-active`),document.body.removeEventListener(`keydown`,this._escListener),this.emit(`change`),this.emit(`deactivate`)},_v.prototype._onTapOverlay=function(e){this.activate(),e.srcEvent.stopPropagation()};var vv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,yv=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,bv=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,xv=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function Sv(e){if(e)for(;!0===e.hasChildNodes();){var t=e.firstChild;t&&(Sv(t),e.removeChild(t))}}function Cv(e){return e instanceof String||typeof e==`string`}function wv(e){return Cf(e)===`object`&&e!==null}function Tv(e,t,n,r){var i=!1;!0===r&&(i=t[n]===null&&e[n]!==void 0),i?delete e[n]:e[n]=t[n]}function Ev(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];for(var r in e)if(t[r]!==void 0)if(t[r]===null||Cf(t[r])!==`object`)Tv(e,t,r,n);else{var i=e[r],a=t[r];wv(i)&&wv(a)&&Ev(i,a,n)}}function Dv(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(Dp(n))throw TypeError(`Arrays are not supported by deepExtend`);for(var i=0;i<e.length;i++){var a=e[i];if(Object.prototype.hasOwnProperty.call(n,a))if(n[a]&&n[a].constructor===Object)t[a]===void 0&&(t[a]={}),t[a].constructor===Object?kv(t[a],n[a],!1,r):Tv(t,n,a,r);else{if(Dp(n[a]))throw TypeError(`Arrays are not supported by deepExtend`);Tv(t,n,a,r)}}return t}function Ov(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(Dp(n))throw TypeError(`Arrays are not supported by deepExtend`);for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&!Ym(e).call(e,i))if(n[i]&&n[i].constructor===Object)t[i]===void 0&&(t[i]={}),t[i].constructor===Object?kv(t[i],n[i]):Tv(t,n,i,r);else if(Dp(n[i])){t[i]=[];for(var a=0;a<n[i].length;a++)t[i].push(n[i][a])}else Tv(t,n,i,r);return t}function kv(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)||!0===n)if(Cf(t[i])===`object`&&t[i]!==null&&eh(t[i])===Object.prototype)e[i]===void 0?e[i]=kv({},t[i],n):Cf(e[i])===`object`&&e[i]!==null&&eh(e[i])===Object.prototype?kv(e[i],t[i],n):Tv(e,t,i,r);else if(Dp(t[i])){var a;e[i]=bp(a=t[i]).call(a)}else Tv(e,t,i,r);return e}function Av(e,t){var n;return yp(n=[]).call(n,pp(e),[t])}function jv(e){return e.getBoundingClientRect().top}function U(e,t){if(Dp(e))for(var n=e.length,r=0;r<n;r++)t(e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t(e[i],i,e)}function Mv(e){var t;switch(e.length){case 3:case 4:return(t=yv.exec(e))?{r:Oh(t[1]+t[1],16),g:Oh(t[2]+t[2],16),b:Oh(t[3]+t[3],16)}:null;case 6:case 7:return(t=vv.exec(e))?{r:Oh(t[1],16),g:Oh(t[2],16),b:Oh(t[3],16)}:null;default:return null}}function Nv(e,t){if(Ym(e).call(e,`rgba`))return e;if(Ym(e).call(e,`rgb`)){var n=e.substr(H(e).call(e,`(`)+1).replace(`)`,``).split(`,`);return`rgba(`+n[0]+`,`+n[1]+`,`+n[2]+`,`+t+`)`}var r=Mv(e);return r==null?e:`rgba(`+r.r+`,`+r.g+`,`+r.b+`,`+t+`)`}function Pv(e,t,n){var r;return`#`+bp(r=((1<<24)+(e<<16)+(t<<8)+n).toString(16)).call(r,1)}function Fv(e,t){if(Cv(e)){var n=e;if(Bv(n)){var r,i=Np(r=n.substr(4).substr(0,n.length-5).split(`,`)).call(r,(function(e){return Oh(e)}));n=Pv(i[0],i[1],i[2])}if(!0===zv(n)){var a=function(e){var t=Mv(e);if(!t)throw TypeError(`'${e}' is not a valid color.`);return Iv(t.r,t.g,t.b)}(n),o={h:a.h,s:.8*a.s,v:Math.min(1,1.02*a.v)},s={h:a.h,s:Math.min(1,1.25*a.s),v:.8*a.v},c=Rv(s.h,s.s,s.v),l=Rv(o.h,o.s,o.v);return{background:n,border:c,highlight:{background:l,border:c},hover:{background:l,border:c}}}return{background:n,border:n,highlight:{background:n,border:n},hover:{background:n,border:n}}}return t?{background:e.background||t.background,border:e.border||t.border,highlight:Cv(e.highlight)?{border:e.highlight,background:e.highlight}:{background:e.highlight&&e.highlight.background||t.highlight.background,border:e.highlight&&e.highlight.border||t.highlight.border},hover:Cv(e.hover)?{border:e.hover,background:e.hover}:{border:e.hover&&e.hover.border||t.hover.border,background:e.hover&&e.hover.background||t.hover.background}}:{background:e.background||void 0,border:e.border||void 0,highlight:Cv(e.highlight)?{border:e.highlight,background:e.highlight}:{background:e.highlight&&e.highlight.background||void 0,border:e.highlight&&e.highlight.border||void 0},hover:Cv(e.hover)?{border:e.hover,background:e.hover}:{border:e.hover&&e.hover.border||void 0,background:e.hover&&e.hover.background||void 0}}}function Iv(e,t,n){e/=255,t/=255,n/=255;var r=Math.min(e,Math.min(t,n)),i=Math.max(e,Math.max(t,n));return r===i?{h:0,s:0,v:r}:{h:60*((e===r?3:n===r?1:5)-(e===r?t-n:n===r?e-t:n-e)/(i-r))/360,s:(i-r)/i,v:i}}function Lv(e,t,n){var r,i,a,o=Math.floor(6*e),s=6*e-o,c=n*(1-t),l=n*(1-s*t),u=n*(1-(1-s)*t);switch(o%6){case 0:r=n,i=u,a=c;break;case 1:r=l,i=n,a=c;break;case 2:r=c,i=n,a=u;break;case 3:r=c,i=l,a=n;break;case 4:r=u,i=c,a=n;break;case 5:r=n,i=c,a=l}return{r:Math.floor(255*r),g:Math.floor(255*i),b:Math.floor(255*a)}}function Rv(e,t,n){var r=Lv(e,t,n);return Pv(r.r,r.g,r.b)}function zv(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)}function Bv(e){return bv.test(e)}function Vv(e){if(e===null||Cf(e)!==`object`)return null;if(e instanceof Element)return e;var t=Bh(e);for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&Cf(e[n])==`object`&&(t[n]=Vv(e[n]));return t}function Hv(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=function(e){return e!=null},a=function(e){return e!==null&&Cf(e)===`object`};if(!a(e))throw Error(`Parameter mergeTarget must be an object`);if(!a(t))throw Error(`Parameter options must be an object`);if(!i(n))throw Error(`Parameter option must have a value`);if(!a(r))throw Error(`Parameter globalOptions must be an object`);var o=t[n],s=a(r)&&!function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(r)?r[n]:void 0,c=s?s.enabled:void 0;if(o!==void 0){if(typeof o==`boolean`)return a(e[n])||(e[n]={}),void(e[n].enabled=o);if(o===null&&!a(e[n])){if(!i(s))return;e[n]=Bh(s)}if(a(o)){var l=!0;o.enabled===void 0?c!==void 0&&(l=s.enabled):l=o.enabled,function(e,t,n){a(e[n])||(e[n]={});var r=t[n],i=e[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o])}(e,t,n),e[n].enabled=l}}}var Uv={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}};function Wv(e,t){var n;Dp(t)||(t=[t]);var r,i=pv(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a){n=a[t[0]];for(var o=1;o<t.length;o++)n&&=n[t[o]];if(n!==void 0)break}}}catch(e){i.e(e)}finally{i.f()}return n}var Gv={black:`#000000`,navy:`#000080`,darkblue:`#00008B`,mediumblue:`#0000CD`,blue:`#0000FF`,darkgreen:`#006400`,green:`#008000`,teal:`#008080`,darkcyan:`#008B8B`,deepskyblue:`#00BFFF`,darkturquoise:`#00CED1`,mediumspringgreen:`#00FA9A`,lime:`#00FF00`,springgreen:`#00FF7F`,aqua:`#00FFFF`,cyan:`#00FFFF`,midnightblue:`#191970`,dodgerblue:`#1E90FF`,lightseagreen:`#20B2AA`,forestgreen:`#228B22`,seagreen:`#2E8B57`,darkslategray:`#2F4F4F`,limegreen:`#32CD32`,mediumseagreen:`#3CB371`,turquoise:`#40E0D0`,royalblue:`#4169E1`,steelblue:`#4682B4`,darkslateblue:`#483D8B`,mediumturquoise:`#48D1CC`,indigo:`#4B0082`,darkolivegreen:`#556B2F`,cadetblue:`#5F9EA0`,cornflowerblue:`#6495ED`,mediumaquamarine:`#66CDAA`,dimgray:`#696969`,slateblue:`#6A5ACD`,olivedrab:`#6B8E23`,slategray:`#708090`,lightslategray:`#778899`,mediumslateblue:`#7B68EE`,lawngreen:`#7CFC00`,chartreuse:`#7FFF00`,aquamarine:`#7FFFD4`,maroon:`#800000`,purple:`#800080`,olive:`#808000`,gray:`#808080`,skyblue:`#87CEEB`,lightskyblue:`#87CEFA`,blueviolet:`#8A2BE2`,darkred:`#8B0000`,darkmagenta:`#8B008B`,saddlebrown:`#8B4513`,darkseagreen:`#8FBC8F`,lightgreen:`#90EE90`,mediumpurple:`#9370D8`,darkviolet:`#9400D3`,palegreen:`#98FB98`,darkorchid:`#9932CC`,yellowgreen:`#9ACD32`,sienna:`#A0522D`,brown:`#A52A2A`,darkgray:`#A9A9A9`,lightblue:`#ADD8E6`,greenyellow:`#ADFF2F`,paleturquoise:`#AFEEEE`,lightsteelblue:`#B0C4DE`,powderblue:`#B0E0E6`,firebrick:`#B22222`,darkgoldenrod:`#B8860B`,mediumorchid:`#BA55D3`,rosybrown:`#BC8F8F`,darkkhaki:`#BDB76B`,silver:`#C0C0C0`,mediumvioletred:`#C71585`,indianred:`#CD5C5C`,peru:`#CD853F`,chocolate:`#D2691E`,tan:`#D2B48C`,lightgrey:`#D3D3D3`,palevioletred:`#D87093`,thistle:`#D8BFD8`,orchid:`#DA70D6`,goldenrod:`#DAA520`,crimson:`#DC143C`,gainsboro:`#DCDCDC`,plum:`#DDA0DD`,burlywood:`#DEB887`,lightcyan:`#E0FFFF`,lavender:`#E6E6FA`,darksalmon:`#E9967A`,violet:`#EE82EE`,palegoldenrod:`#EEE8AA`,lightcoral:`#F08080`,khaki:`#F0E68C`,aliceblue:`#F0F8FF`,honeydew:`#F0FFF0`,azure:`#F0FFFF`,sandybrown:`#F4A460`,wheat:`#F5DEB3`,beige:`#F5F5DC`,whitesmoke:`#F5F5F5`,mintcream:`#F5FFFA`,ghostwhite:`#F8F8FF`,salmon:`#FA8072`,antiquewhite:`#FAEBD7`,linen:`#FAF0E6`,lightgoldenrodyellow:`#FAFAD2`,oldlace:`#FDF5E6`,red:`#FF0000`,fuchsia:`#FF00FF`,magenta:`#FF00FF`,deeppink:`#FF1493`,orangered:`#FF4500`,tomato:`#FF6347`,hotpink:`#FF69B4`,coral:`#FF7F50`,darkorange:`#FF8C00`,lightsalmon:`#FFA07A`,orange:`#FFA500`,lightpink:`#FFB6C1`,pink:`#FFC0CB`,gold:`#FFD700`,peachpuff:`#FFDAB9`,navajowhite:`#FFDEAD`,moccasin:`#FFE4B5`,bisque:`#FFE4C4`,mistyrose:`#FFE4E1`,blanchedalmond:`#FFEBCD`,papayawhip:`#FFEFD5`,lavenderblush:`#FFF0F5`,seashell:`#FFF5EE`,cornsilk:`#FFF8DC`,lemonchiffon:`#FFFACD`,floralwhite:`#FFFAF0`,snow:`#FFFAFA`,yellow:`#FFFF00`,lightyellow:`#FFFFE0`,ivory:`#FFFFF0`,white:`#FFFFFF`},Kv=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;B(this,e),this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return V(e,[{key:`insertTo`,value:function(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:`setUpdateCallback`,value:function(e){if(typeof e!=`function`)throw Error(`Function attempted to set as colorPicker update callback is not a function.`);this.updateCallback=e}},{key:`setCloseCallback`,value:function(e){if(typeof e!=`function`)throw Error(`Function attempted to set as colorPicker closing callback is not a function.`);this.closeCallback=e}},{key:`_isColorString`,value:function(e){if(typeof e==`string`)return Gv[e]}},{key:`setColor`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(e!==`none`){var n,r=this._isColorString(e);if(r!==void 0&&(e=r),!0===Cv(e)){if(!0===Bv(e)){var i=e.substr(4).substr(0,e.length-5).split(`,`);n={r:i[0],g:i[1],b:i[2],a:1}}else if(!0===function(e){return xv.test(e)}(e)){var a=e.substr(5).substr(0,e.length-6).split(`,`);n={r:a[0],g:a[1],b:a[2],a:a[3]}}else if(!0===zv(e)){var o=Mv(e);n={r:o.r,g:o.g,b:o.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){var s=e.a===void 0?`1.0`:e.a;n={r:e.r,g:e.g,b:e.b,a:s}}if(n===void 0)throw Error(`Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: `+Uh(e));this._setColor(n,t)}}},{key:`show`,value:function(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display=`block`,this._generateHueCircle()}},{key:`_hide`,value:function(){var e=this;!0===(!(arguments.length>0&&arguments[0]!==void 0)||arguments[0])&&(this.previousColor=Nr({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display=`none`,cg((function(){e.closeCallback!==void 0&&(e.closeCallback(),e.closeCallback=void 0)}),0)}},{key:`_save`,value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:`_apply`,value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:`_loadLast`,value:function(){this.previousColor===void 0?alert(`There is no last color to load...`):this.setColor(this.previousColor,!1)}},{key:`_setColor`,value:function(e){!0===(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&(this.initialColor=Nr({},e)),this.color=e;var t=Iv(e.r,e.g,e.b),n=2*Math.PI,r=this.r*t.s,i=this.centerCoordinates.x+r*Math.sin(n*t.h),a=this.centerCoordinates.y+r*Math.cos(n*t.h);this.colorPickerSelector.style.left=i-.5*this.colorPickerSelector.clientWidth+`px`,this.colorPickerSelector.style.top=a-.5*this.colorPickerSelector.clientHeight+`px`,this._updatePicker(e)}},{key:`_setOpacity`,value:function(e){this.color.a=e/100,this._updatePicker(this.color)}},{key:`_setBrightness`,value:function(e){var t=Iv(this.color.r,this.color.g,this.color.b);t.v=e/100;var n=Lv(t.h,t.s,t.v);n.a=this.color.a,this.color=n,this._updatePicker()}},{key:`_updatePicker`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color,t=Iv(e.r,e.g,e.b),n=this.colorPickerCanvas.getContext(`2d`);this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1)),n.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var r=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;n.clearRect(0,0,r,i),n.putImageData(this.hueCircle,0,0),n.fillStyle=`rgba(0,0,0,`+(1-t.v)+`)`,n.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),_g(n).call(n),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor=`rgba(`+this.initialColor.r+`,`+this.initialColor.g+`,`+this.initialColor.b+`,`+this.initialColor.a+`)`,this.newColorDiv.style.backgroundColor=`rgba(`+this.color.r+`,`+this.color.g+`,`+this.color.b+`,`+this.color.a+`)`}},{key:`_setSize`,value:function(){this.colorPickerCanvas.style.width=`100%`,this.colorPickerCanvas.style.height=`100%`,this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:`_create`,value:function(){var e,t,n,r;if(this.frame=document.createElement(`div`),this.frame.className=`vis-color-picker`,this.colorPickerDiv=document.createElement(`div`),this.colorPickerSelector=document.createElement(`div`),this.colorPickerSelector.className=`vis-selector`,this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement(`canvas`),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){var i=this.colorPickerCanvas.getContext(`2d`);this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1),this.colorPickerCanvas.getContext(`2d`).setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var a=document.createElement(`DIV`);a.style.color=`red`,a.style.fontWeight=`bold`,a.style.padding=`10px`,a.innerText=`Error: your browser does not support HTML canvas`,this.colorPickerCanvas.appendChild(a)}this.colorPickerDiv.className=`vis-color`,this.opacityDiv=document.createElement(`div`),this.opacityDiv.className=`vis-opacity`,this.brightnessDiv=document.createElement(`div`),this.brightnessDiv.className=`vis-brightness`,this.arrowDiv=document.createElement(`div`),this.arrowDiv.className=`vis-arrow`,this.opacityRange=document.createElement(`input`);try{this.opacityRange.type=`range`,this.opacityRange.min=`0`,this.opacityRange.max=`100`}catch{}this.opacityRange.value=`100`,this.opacityRange.className=`vis-range`,this.brightnessRange=document.createElement(`input`);try{this.brightnessRange.type=`range`,this.brightnessRange.min=`0`,this.brightnessRange.max=`100`}catch{}this.brightnessRange.value=`100`,this.brightnessRange.className=`vis-range`,this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var o=this;this.opacityRange.onchange=function(){o._setOpacity(this.value)},this.opacityRange.oninput=function(){o._setOpacity(this.value)},this.brightnessRange.onchange=function(){o._setBrightness(this.value)},this.brightnessRange.oninput=function(){o._setBrightness(this.value)},this.brightnessLabel=document.createElement(`div`),this.brightnessLabel.className=`vis-label vis-brightness`,this.brightnessLabel.innerText=`brightness:`,this.opacityLabel=document.createElement(`div`),this.opacityLabel.className=`vis-label vis-opacity`,this.opacityLabel.innerText=`opacity:`,this.newColorDiv=document.createElement(`div`),this.newColorDiv.className=`vis-new-color`,this.newColorDiv.innerText=`new`,this.initialColorDiv=document.createElement(`div`),this.initialColorDiv.className=`vis-initial-color`,this.initialColorDiv.innerText=`initial`,this.cancelButton=document.createElement(`div`),this.cancelButton.className=`vis-button vis-cancel`,this.cancelButton.innerText=`cancel`,this.cancelButton.onclick=z(e=this._hide).call(e,this,!1),this.applyButton=document.createElement(`div`),this.applyButton.className=`vis-button vis-apply`,this.applyButton.innerText=`apply`,this.applyButton.onclick=z(t=this._apply).call(t,this),this.saveButton=document.createElement(`div`),this.saveButton.className=`vis-button vis-save`,this.saveButton.innerText=`save`,this.saveButton.onclick=z(n=this._save).call(n,this),this.loadButton=document.createElement(`div`),this.loadButton.className=`vis-button vis-load`,this.loadButton.innerText=`load last`,this.loadButton.onclick=z(r=this._loadLast).call(r,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:`_bindHammer`,value:function(){var e=this;this.drag={},this.pinch={},this.hammer=new gv(this.colorPickerCanvas),this.hammer.get(`pinch`).set({enable:!0}),this.hammer.on(`hammer.input`,(function(t){t.isFirst&&e._moveSelector(t)})),this.hammer.on(`tap`,(function(t){e._moveSelector(t)})),this.hammer.on(`panstart`,(function(t){e._moveSelector(t)})),this.hammer.on(`panmove`,(function(t){e._moveSelector(t)})),this.hammer.on(`panend`,(function(t){e._moveSelector(t)}))}},{key:`_generateHueCircle`,value:function(){if(!1===this.generated){var e=this.colorPickerCanvas.getContext(`2d`);this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var t,n,r,i,a=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,a,o),this.centerCoordinates={x:.5*a,y:.5*o},this.r=.49*a;var s,c=2*Math.PI/360,l=1/this.r;for(r=0;r<360;r++)for(i=0;i<this.r;i++)t=this.centerCoordinates.x+i*Math.sin(c*r),n=this.centerCoordinates.y+i*Math.cos(c*r),s=Lv(.002777777777777778*r,i*l,1),e.fillStyle=`rgb(`+s.r+`,`+s.g+`,`+s.b+`)`,e.fillRect(t-.5,n-.5,2,2);e.strokeStyle=`rgba(0,0,0,1)`,e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,a,o)}this.generated=!0}},{key:`_moveSelector`,value:function(e){var t=this.colorPickerDiv.getBoundingClientRect(),n=e.center.x-t.left,r=e.center.y-t.top,i=.5*this.colorPickerDiv.clientHeight,a=.5*this.colorPickerDiv.clientWidth,o=n-a,s=r-i,c=Math.atan2(o,s),l=.98*Math.min(Math.sqrt(o*o+s*s),a),u=Math.cos(c)*l+i,d=Math.sin(c)*l+a;this.colorPickerSelector.style.top=u-.5*this.colorPickerSelector.clientHeight+`px`,this.colorPickerSelector.style.left=d-.5*this.colorPickerSelector.clientWidth+`px`;var f=c/(2*Math.PI);f=f<0?f+1:f;var p=l/this.r,m=Iv(this.color.r,this.color.g,this.color.b);m.h=f,m.s=p;var h=Lv(m.h,m.s,m.v);h.a=this.color.a,this.color=h,this.initialColorDiv.style.backgroundColor=`rgba(`+this.initialColor.r+`,`+this.initialColor.g+`,`+this.initialColor.b+`,`+this.initialColor.a+`)`,this.newColorDiv.style.backgroundColor=`rgba(`+this.color.r+`,`+this.color.g+`,`+this.color.b+`,`+this.color.a+`)`}}]),e}();function qv(){var e=[...arguments];if(e.length<1)throw TypeError(`Invalid arguments.`);if(e.length===1)return document.createTextNode(e[0]);var t=document.createElement(e[0]);return t.appendChild(qv.apply(void 0,pp(bp(e).call(e,1)))),t}var Jv,Yv=function(){function e(t,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:function(){return!1};B(this,e),this.parent=t,this.changedOptions=[],this.container=n,this.allowCreation=!1,this.hideOption=a,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Nr(this.options,this.defaultOptions),this.configureOptions=r,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new Kv(i),this.wrapper=void 0}return V(e,[{key:`setOptions`,value:function(e){if(e!==void 0){this.popupHistory={},this._removePopup();var t=!0;if(typeof e==`string`)this.options.filter=e;else if(Dp(e))this.options.filter=e.join();else if(Cf(e)===`object`){if(e==null)throw TypeError(`options cannot be null`);e.container!==void 0&&(this.options.container=e.container),oh(e)!==void 0&&(this.options.filter=oh(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(t=e.enabled)}else typeof e==`boolean`?(this.options.filter=!0,t=e):typeof e==`function`&&(this.options.filter=e,t=!0);!1===oh(this.options)&&(t=!1),this.options.enabled=t}this._clean()}},{key:`setModuleOptions`,value:function(e){this.moduleOptions=e,!0===this.options.enabled&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}},{key:`_create`,value:function(){this._clean(),this.changedOptions=[];var e=oh(this.options),t=0,n=!1;for(var r in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,r)&&(this.allowCreation=!1,n=!1,typeof e==`function`?n=(n=e(r,[]))||this._handleObject(this.configureOptions[r],[r],!0):!0!==e&&H(e).call(e,r)===-1||(n=!0),!1!==n&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(r),this._handleObject(this.configureOptions[r],[r])),t++);this._makeButton(),this._push()}},{key:`_push`,value:function(){this.wrapper=document.createElement(`div`),this.wrapper.className=`vis-configuration-wrapper`,this.container.appendChild(this.wrapper);for(var e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}},{key:`_clean`,value:function(){for(var e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);this.wrapper!==void 0&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}},{key:`_getValue`,value:function(e){for(var t=this.moduleOptions,n=0;n<e.length;n++){if(t[e[n]]===void 0){t=void 0;break}t=t[e[n]]}return t}},{key:`_makeItem`,value:function(e){if(!0===this.allowCreation){var t=document.createElement(`div`);t.className=`vis-configuration vis-config-item vis-config-s`+e.length;var n=[...arguments].slice(1);return Qp(n).call(n,(function(e){t.appendChild(e)})),this.domElements.push(t),this.domElements.length}return 0}},{key:`_makeHeader`,value:function(e){var t=document.createElement(`div`);t.className=`vis-configuration vis-config-header`,t.innerText=e,this._makeItem([],t)}},{key:`_makeLabel`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=document.createElement(`div`);if(r.className=`vis-configuration vis-config-label vis-config-s`+t.length,!0===n){for(;r.firstChild;)r.removeChild(r.firstChild);r.appendChild(qv(`i`,`b`,e))}else r.innerText=e+`:`;return r}},{key:`_makeDropdown`,value:function(e,t,n){var r=document.createElement(`select`);r.className=`vis-configuration vis-config-select`;var i=0;t!==void 0&&H(e).call(e,t)!==-1&&(i=H(e).call(e,t));for(var a=0;a<e.length;a++){var o=document.createElement(`option`);o.value=e[a],a===i&&(o.selected=`selected`),o.innerText=e[a],r.appendChild(o)}var s=this;r.onchange=function(){s._update(this.value,n)};var c=this._makeLabel(n[n.length-1],n);this._makeItem(n,c,r)}},{key:`_makeRange`,value:function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=document.createElement(`input`);s.className=`vis-configuration vis-config-range`;try{s.type=`range`,s.min=i,s.max=a}catch{}s.step=o;var c=``,l=0;if(t!==void 0){var u=1.2;t<0&&t*u<i?(s.min=Math.ceil(t*u),l=s.min,c=`range increased`):t/u<i&&(s.min=Math.ceil(t/u),l=s.min,c=`range increased`),t*u>a&&a!==1&&(s.max=Math.ceil(t*u),l=s.max,c=`range increased`),s.value=t}else s.value=r;var d=document.createElement(`input`);d.className=`vis-configuration vis-config-rangeinput`,d.value=s.value;var f=this;s.onchange=function(){d.value=this.value,f._update(Number(this.value),n)},s.oninput=function(){d.value=this.value};var p=this._makeLabel(n[n.length-1],n),m=this._makeItem(n,p,s,d);c!==``&&this.popupHistory[m]!==l&&(this.popupHistory[m]=l,this._setupPopup(c,m))}},{key:`_makeButton`,value:function(){var e=this;if(!0===this.options.showButton){var t=document.createElement(`div`);t.className=`vis-configuration vis-config-button`,t.innerText=`generate options`,t.onclick=function(){e._printOptions()},t.onmouseover=function(){t.className=`vis-configuration vis-config-button hover`},t.onmouseout=function(){t.className=`vis-configuration vis-config-button`},this.optionsContainer=document.createElement(`div`),this.optionsContainer.className=`vis-configuration vis-config-option-container`,this.domElements.push(this.optionsContainer),this.domElements.push(t)}}},{key:`_setupPopup`,value:function(e,t){var n=this;if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter<this.popupLimit){var r=document.createElement(`div`);r.id=`vis-configuration-popup`,r.className=`vis-configuration-popup`,r.innerText=e,r.onclick=function(){n._removePopup()},this.popupCounter+=1,this.popupDiv={html:r,index:t}}}},{key:`_removePopup`,value:function(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}},{key:`_showPopupIfNeeded`,value:function(){var e=this;if(this.popupDiv.html!==void 0){var t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+`px`,this.popupDiv.html.style.top=t.top-30+`px`,document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=cg((function(){e.popupDiv.html.style.opacity=0}),1500),this.popupDiv.deleteTimeout=cg((function(){e._removePopup()}),1800)}}},{key:`_makeCheckbox`,value:function(e,t,n){var r=document.createElement(`input`);r.type=`checkbox`,r.className=`vis-configuration vis-config-checkbox`,r.checked=e,t!==void 0&&(r.checked=t,t!==e&&(Cf(e)===`object`?t!==e.enabled&&this.changedOptions.push({path:n,value:t}):this.changedOptions.push({path:n,value:t})));var i=this;r.onchange=function(){i._update(this.checked,n)};var a=this._makeLabel(n[n.length-1],n);this._makeItem(n,a,r)}},{key:`_makeTextInput`,value:function(e,t,n){var r=document.createElement(`input`);r.type=`text`,r.className=`vis-configuration vis-config-text`,r.value=t,t!==e&&this.changedOptions.push({path:n,value:t});var i=this;r.onchange=function(){i._update(this.value,n)};var a=this._makeLabel(n[n.length-1],n);this._makeItem(n,a,r)}},{key:`_makeColorField`,value:function(e,t,n){var r=this,i=e[1],a=document.createElement(`div`);(t=t===void 0?i:t)===`none`?a.className=`vis-configuration vis-config-colorBlock none`:(a.className=`vis-configuration vis-config-colorBlock`,a.style.backgroundColor=t),t=t===void 0?i:t,a.onclick=function(){r._showColorPicker(t,a,n)};var o=this._makeLabel(n[n.length-1],n);this._makeItem(n,o,a)}},{key:`_showColorPicker`,value:function(e,t,n){var r=this;t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback((function(e){var i=`rgba(`+e.r+`,`+e.g+`,`+e.b+`,`+e.a+`)`;t.style.backgroundColor=i,r._update(i,n)})),this.colorPicker.setCloseCallback((function(){t.onclick=function(){r._showColorPicker(e,t,n)}}))}},{key:`_handleObject`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=!1,i=oh(this.options),a=!1;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){r=!0;var s=e[o],c=Av(t,o);if(typeof i==`function`&&!1===(r=i(o,t))&&!Dp(s)&&typeof s!=`string`&&typeof s!=`boolean`&&s instanceof Object&&(this.allowCreation=!1,r=this._handleObject(s,c,!0),this.allowCreation=!1===n),!1!==r){a=!0;var l=this._getValue(c);if(Dp(s))this._handleArray(s,l,c);else if(typeof s==`string`)this._makeTextInput(s,l,c);else if(typeof s==`boolean`)this._makeCheckbox(s,l,c);else if(s instanceof Object){if(!this.hideOption(t,o,this.moduleOptions))if(s.enabled!==void 0){var u=Av(c,`enabled`),d=this._getValue(u);if(!0===d){var f=this._makeLabel(o,c,!0);this._makeItem(c,f),a=this._handleObject(s,c)||a}else this._makeCheckbox(s,d,c)}else{var p=this._makeLabel(o,c,!0);this._makeItem(c,p),a=this._handleObject(s,c)||a}}else console.error(`dont know how to handle`,s,o,c)}}return a}},{key:`_handleArray`,value:function(e,t,n){typeof e[0]==`string`&&e[0]===`color`?(this._makeColorField(e,t,n),e[1]!==t&&this.changedOptions.push({path:n,value:t})):typeof e[0]==`string`?(this._makeDropdown(e,t,n),e[0]!==t&&this.changedOptions.push({path:n,value:t})):typeof e[0]==`number`&&(this._makeRange(e,t,n),e[0]!==t&&this.changedOptions.push({path:n,value:Number(t)}))}},{key:`_update`,value:function(e,t){var n=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit(`configChange`,n),this.initialized=!0,this.parent.setOptions(n)}},{key:`_constructOptions`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n;e=(e=e===`true`||e)!==`false`&&e;for(var i=0;i<t.length;i++)t[i]!==`global`&&(r[t[i]]===void 0&&(r[t[i]]={}),i===t.length-1?r[t[i]]=e:r=r[t[i]]);return n}},{key:`_printOptions`,value:function(){for(var e=this.getOptions();this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(qv(`pre`,`const options = `+Uh(e,null,2)))}},{key:`getOptions`,value:function(){for(var e={},t=0;t<this.changedOptions.length;t++)this._constructOptions(this.changedOptions[t].value,this.changedOptions[t].path,e);return e}}]),e}(),Xv=function(){function e(t,n){B(this,e),this.container=t,this.overflowMethod=n||`cap`,this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement(`div`),this.frame.className=`vis-tooltip`,this.container.appendChild(this.frame)}return V(e,[{key:`setPosition`,value:function(e,t){this.x=Oh(e),this.y=Oh(t)}},{key:`setText`,value:function(e){if(e instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(e)}else this.frame.innerText=e}},{key:`show`,value:function(e){if(e===void 0&&(e=!0),!0===e){var t=this.frame.clientHeight,n=this.frame.clientWidth,r=this.frame.parentNode.clientHeight,i=this.frame.parentNode.clientWidth,a=0,o=0;if(this.overflowMethod==`flip`){var s=!1,c=!0;this.y-t<this.padding&&(c=!1),this.x+n>i-this.padding&&(s=!0),a=s?this.x-n:this.x,o=c?this.y-t:this.y}else (o=this.y-t)+t+this.padding>r&&(o=r-t-this.padding),o<this.padding&&(o=this.padding),(a=this.x)+n+this.padding>i&&(a=i-n-this.padding),a<this.padding&&(a=this.padding);this.frame.style.left=a+`px`,this.frame.style.top=o+`px`,this.frame.style.visibility=`visible`,this.hidden=!1}else this.hide()}},{key:`hide`,value:function(){this.hidden=!0,this.frame.style.left=`0`,this.frame.style.top=`0`,this.frame.style.visibility=`hidden`}},{key:`destroy`,value:function(){this.frame.parentNode.removeChild(this.frame)}}]),e}(),Zv=!1,Qv=`background: #FFeeee; color: #dd0000`,$v=function(){function e(){B(this,e)}return V(e,null,[{key:`validate`,value:function(t,n,r){Zv=!1,Jv=n;var i=n;return r!==void 0&&(i=n[r]),e.parse(t,i,[]),Zv}},{key:`parse`,value:function(t,n,r){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.check(i,t,n,r)}},{key:`check`,value:function(t,n,r,i){if(r[t]!==void 0||r.__any__!==void 0){var a=t,o=!0;r[t]===void 0&&r.__any__!==void 0&&(a=`__any__`,o=e.getType(n[t])===`object`);var s=r[a];o&&s.__type__!==void 0&&(s=s.__type__),e.checkFields(t,n,r,a,s,i)}else e.getSuggestion(t,r,i)}},{key:`checkFields`,value:function(t,n,r,i,a,o){var s=function(n){console.error(`%c`+n+e.printLocation(o,t),Qv)},c=e.getType(n[t]),l=a[c];l===void 0?a.any===void 0&&(s(`Invalid type received for "`+t+`". Expected: `+e.print(Ip(a))+`. Received [`+c+`] "`+n[t]+`"`),Zv=!0):e.getType(l)===`array`&&H(l).call(l,n[t])===-1?(s(`Invalid option detected in "`+t+`". Allowed values are:`+e.print(l)+` not "`+n[t]+`". `),Zv=!0):c===`object`&&i!==`__any__`&&(o=Av(o,t),e.parse(n[t],r[i],o))}},{key:`getType`,value:function(e){var t=Cf(e);return t===`object`?e===null?`null`:e instanceof Boolean?`boolean`:e instanceof Number?`number`:e instanceof String?`string`:Dp(e)?`array`:e instanceof Date?`date`:e.nodeType===void 0?!0===e._isAMomentObject?`moment`:`object`:`dom`:t===`number`?`number`:t===`boolean`?`boolean`:t===`string`?`string`:t===void 0?`undefined`:t}},{key:`getSuggestion`,value:function(t,n,r){var i,a=e.findInOptions(t,n,r,!1),o=e.findInOptions(t,Jv,[],!0);i=a.indexMatch===void 0?o.distance<=4&&a.distance>o.distance?` in `+e.printLocation(a.path,t,``)+`Perhaps it was misplaced? Matching option found at: `+e.printLocation(o.path,o.closestMatch,``):a.distance<=8?`. Did you mean "`+a.closestMatch+`"?`+e.printLocation(a.path,t):`. Did you mean one of these: `+e.print(Ip(n))+e.printLocation(r,t):` in `+e.printLocation(a.path,t,``)+`Perhaps it was incomplete? Did you mean: "`+a.indexMatch+`"?
16
+
17
+ `,console.error(`%cUnknown option detected: "`+t+`"`+i,Qv),Zv=!0}},{key:`findInOptions`,value:function(t,n,r){var i,a=arguments.length>3&&arguments[3]!==void 0&&arguments[3],o=1e9,s=``,c=[],l=t.toLowerCase(),u=void 0;for(var d in n){var f=void 0;if(n[d].__type__!==void 0&&!0===a){var p=e.findInOptions(t,n[d],Av(r,d));o>p.distance&&(s=p.closestMatch,c=p.path,o=p.distance,u=p.indexMatch)}else{var m;H(m=d.toLowerCase()).call(m,l)!==-1&&(u=d),o>(f=e.levenshteinDistance(t,d))&&(s=d,c=bp(i=r).call(i),o=f)}}return{closestMatch:s,path:c,distance:o,indexMatch:u}}},{key:`printLocation`,value:function(e,t){for(var n=`
18
+
19
+ `+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at:
20
+ `)+`options = {
21
+ `,r=0;r<e.length;r++){for(var i=0;i<r+1;i++)n+=` `;n+=e[r]+`: {
22
+ `}for(var a=0;a<e.length+1;a++)n+=` `;n+=t+`
23
+ `;for(var o=0;o<e.length+1;o++){for(var s=0;s<e.length-o;s++)n+=` `;n+=`}
24
+ `}return n+`
25
+
26
+ `}},{key:`print`,value:function(e){return Uh(e).replace(/(")|(\[)|(\])|(,"__type__")/g,``).replace(/(,)/g,`, `)}},{key:`levenshteinDistance`,value:function(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;var n,r,i=[];for(n=0;n<=t.length;n++)i[n]=[n];for(r=0;r<=e.length;r++)i[0][r]=r;for(n=1;n<=t.length;n++)for(r=1;r<=e.length;r++)t.charAt(n-1)==e.charAt(r-1)?i[n][r]=i[n-1][r-1]:i[n][r]=Math.min(i[n-1][r-1]+1,Math.min(i[n][r-1]+1,i[n-1][r]+1));return i[t.length][e.length]}}]),e}(),ey=_v,ty=Yv,ny=gv,ry=Xv,iy=Qv,ay=$v;function oy(e){return dy=e,function(){var e={};if(fy=0,W=dy.charAt(0),Sy(),G===`strict`&&(e.strict=!0,Sy()),G!==`graph`&&G!==`digraph`||(e.type=G,Sy()),py===ly.IDENTIFIER&&(e.id=G,Sy()),G!=`{`)throw Oy(`Angle bracket { expected`);if(Sy(),Cy(e),G!=`}`)throw Oy(`Angle bracket } expected`);if(Sy(),G!==``)throw Oy(`End of file expected`);return Sy(),delete e.node,delete e.edge,delete e.graph,e}()}var sy={fontsize:`font.size`,fontcolor:`font.color`,labelfontcolor:`font.color`,fontname:`font.face`,color:[`color.border`,`color.background`],fillcolor:`color.background`,tooltip:`title`,labeltooltip:`title`},cy=Bh(sy);cy.color=`color.color`,cy.style=`dashes`;var ly={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},uy={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},dy=``,fy=0,W=``,G=``,py=ly.NULL;function my(){fy++,W=dy.charAt(fy)}function hy(){return dy.charAt(fy+1)}function gy(e){var t=e.charCodeAt(0);return t<47?t===35||t===46:t<59?t>47:t<91?t>64:t<96?t===95:t<123&&t>96}function _y(e,t){if(e||={},t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function vy(e,t,n){for(var r=t.split(`.`),i=e;r.length;){var a=r.shift();r.length?(i[a]||(i[a]={}),i=i[a]):i[a]=n}}function yy(e,t){for(var n,r,i=null,a=[e],o=e;o.parent;)a.push(o.parent),o=o.parent;if(o.nodes){for(n=0,r=o.nodes.length;n<r;n++)if(t.id===o.nodes[n].id){i=o.nodes[n];break}}for(i||(i={id:t.id},e.node&&(i.attr=_y(i.attr,e.node))),n=a.length-1;n>=0;n--){var s,c=a[n];c.nodes||=[],H(s=c.nodes).call(s,i)===-1&&c.nodes.push(i)}t.attr&&(i.attr=_y(i.attr,t.attr))}function by(e,t){e.edges||=[],e.edges.push(t),e.edge&&(t.attr=_y(_y({},e.edge),t.attr))}function xy(e,t,n,r,i){var a={from:t,to:n,type:r};return e.edge&&(a.attr=_y({},e.edge)),a.attr=_y(a.attr||{},i),i!=null&&i.hasOwnProperty(`arrows`)&&i.arrows!=null&&(a.arrows={to:{enabled:!0,type:i.arrows.type}},i.arrows=null),a}function Sy(){for(py=ly.NULL,G=``;W===` `||W===` `||W===`
27
+ `||W===`\r`;)my();do{var e=!1;if(W===`#`){for(var t=fy-1;dy.charAt(t)===` `||dy.charAt(t)===` `;)t--;if(dy.charAt(t)===`
28
+ `||dy.charAt(t)===``){for(;W!=``&&W!=`
29
+ `;)my();e=!0}}if(W===`/`&&hy()===`/`){for(;W!=``&&W!=`
30
+ `;)my();e=!0}if(W===`/`&&hy()===`*`){for(;W!=``;){if(W===`*`&&hy()===`/`){my(),my();break}my()}e=!0}for(;W===` `||W===` `||W===`
31
+ `||W===`\r`;)my()}while(e);if(W!==``){var n=W+hy();if(uy[n])return py=ly.DELIMITER,G=n,my(),void my();if(uy[W])return py=ly.DELIMITER,G=W,void my();if(gy(W)||W===`-`){for(G+=W,my();gy(W);)G+=W,my();G===`false`?G=!1:G===`true`?G=!0:isNaN(Number(G))||(G=Number(G)),py=ly.IDENTIFIER;return}if(W===`"`){for(my();W!=``&&(W!=`"`||W===`"`&&hy()===`"`);)W===`"`?(G+=W,my()):W===`\\`&&hy()===`n`?(G+=`
32
+ `,my()):G+=W,my();if(W!=`"`)throw Oy(`End of string " expected`);my(),py=ly.IDENTIFIER;return}for(py=ly.UNKNOWN;W!=``;)G+=W,my();throw SyntaxError(`Syntax error in part "`+ky(G,30)+`"`)}py=ly.DELIMITER}function Cy(e){for(;G!==``&&G!=`}`;)wy(e),G===`;`&&Sy()}function wy(e){var t=Ty(e);if(t)Ey(e,t);else if(!function(e){return G===`node`?(Sy(),e.node=Dy(),`node`):G===`edge`?(Sy(),e.edge=Dy(),`edge`):G===`graph`?(Sy(),e.graph=Dy(),`graph`):null}(e)){if(py!=ly.IDENTIFIER)throw Oy(`Identifier expected`);var n=G;if(Sy(),G===`=`){if(Sy(),py!=ly.IDENTIFIER)throw Oy(`Identifier expected`);e[n]=G,Sy()}else (function(e,t){var n={id:t},r=Dy();r&&(n.attr=r),yy(e,n),Ey(e,t)})(e,n)}}function Ty(e){var t=null;if(G===`subgraph`&&((t={}).type=`subgraph`,Sy(),py===ly.IDENTIFIER&&(t.id=G,Sy())),G===`{`){if(Sy(),t||={},t.parent=e,t.node=e.node,t.edge=e.edge,t.graph=e.graph,Cy(t),G!=`}`)throw Oy(`Angle bracket } expected`);Sy(),delete t.node,delete t.edge,delete t.graph,delete t.parent,e.subgraphs||=[],e.subgraphs.push(t)}return t}function Ey(e,t){for(;G===`->`||G===`--`;){var n,r=G;Sy();var i=Ty(e);if(i)n=i;else{if(py!=ly.IDENTIFIER)throw Oy(`Identifier or subgraph expected`);yy(e,{id:n=G}),Sy()}by(e,xy(e,t,n,r,Dy())),t=n}}function Dy(){for(var e,t,n=null,r={dashed:!0,solid:!1,dotted:[1,5]},i={dot:`circle`,box:`box`,crow:`crow`,curve:`curve`,icurve:`inv_curve`,normal:`triangle`,inv:`inv_triangle`,diamond:`diamond`,tee:`bar`,vee:`vee`},a=[],o=[];G===`[`;){for(Sy(),n={};G!==``&&G!=`]`;){if(py!=ly.IDENTIFIER)throw Oy(`Attribute name expected`);var s=G;if(Sy(),G!=`=`)throw Oy(`Equal sign = expected`);if(Sy(),py!=ly.IDENTIFIER)throw Oy(`Attribute value expected`);var c=G;s===`style`&&(c=r[c]),s===`arrowhead`&&(s=`arrows`,c={to:{enabled:!0,type:i[c]}}),s===`arrowtail`&&(s=`arrows`,c={from:{enabled:!0,type:i[c]}}),a.push({attr:n,name:s,value:c}),o.push(s),Sy(),G==`,`&&Sy()}if(G!=`]`)throw Oy(`Bracket ] expected`);Sy()}if(Ym(o).call(o,`dir`)){var l={arrows:{}};for(e=0;e<a.length;e++)if(a[e].name===`arrows`)if(a[e].value.to!=null)l.arrows.to=e;else{if(a[e].value.from==null)throw Oy(`Invalid value of arrows`);l.arrows.from=e}else a[e].name===`dir`&&(l.dir=e);var u,d,f=a[l.dir].value;if(!Ym(o).call(o,`arrows`))if(f===`both`)a.push({attr:a[l.dir].attr,name:`arrows`,value:{to:{enabled:!0}}}),l.arrows.to=a.length-1,a.push({attr:a[l.dir].attr,name:`arrows`,value:{from:{enabled:!0}}}),l.arrows.from=a.length-1;else if(f===`forward`)a.push({attr:a[l.dir].attr,name:`arrows`,value:{to:{enabled:!0}}}),l.arrows.to=a.length-1;else if(f===`back`)a.push({attr:a[l.dir].attr,name:`arrows`,value:{from:{enabled:!0}}}),l.arrows.from=a.length-1;else{if(f!==`none`)throw Oy(`Invalid dir type "`+f+`"`);a.push({attr:a[l.dir].attr,name:`arrows`,value:``}),l.arrows.to=a.length-1}if(f===`both`)l.arrows.to&&l.arrows.from?(d=a[l.arrows.to].value.to.type,u=a[l.arrows.from].value.from.type,a[l.arrows.to]={attr:a[l.arrows.to].attr,name:a[l.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:u}}},Om(a).call(a,l.arrows.from,1)):l.arrows.to?(d=a[l.arrows.to].value.to.type,u=`arrow`,a[l.arrows.to]={attr:a[l.arrows.to].attr,name:a[l.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:u}}}):l.arrows.from&&(d=`arrow`,u=a[l.arrows.from].value.from.type,a[l.arrows.from]={attr:a[l.arrows.from].attr,name:a[l.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:u}}});else if(f===`back`)l.arrows.to&&l.arrows.from?(d=``,u=a[l.arrows.from].value.from.type,a[l.arrows.from]={attr:a[l.arrows.from].attr,name:a[l.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:u}}}):l.arrows.to?(d=``,u=`arrow`,l.arrows.from=l.arrows.to,a[l.arrows.from]={attr:a[l.arrows.from].attr,name:a[l.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:u}}}):l.arrows.from&&(d=``,u=a[l.arrows.from].value.from.type,a[l.arrows.to]={attr:a[l.arrows.from].attr,name:a[l.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:u}}}),a[l.arrows.from]={attr:a[l.arrows.from].attr,name:a[l.arrows.from].name,value:{from:{enabled:!0,type:a[l.arrows.from].value.from.type}}};else if(f===`none`){var p;a[p=l.arrows.to?l.arrows.to:l.arrows.from]={attr:a[p].attr,name:a[p].name,value:``}}else{if(f!==`forward`)throw Oy(`Invalid dir type "`+f+`"`);l.arrows.to&&l.arrows.from||l.arrows.to?(d=a[l.arrows.to].value.to.type,u=``,a[l.arrows.to]={attr:a[l.arrows.to].attr,name:a[l.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:u}}}):l.arrows.from&&(d=`arrow`,u=``,l.arrows.to=l.arrows.from,a[l.arrows.to]={attr:a[l.arrows.to].attr,name:a[l.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:u}}}),a[l.arrows.to]={attr:a[l.arrows.to].attr,name:a[l.arrows.to].name,value:{to:{enabled:!0,type:a[l.arrows.to].value.to.type}}}}Om(a).call(a,l.dir,1)}if(Ym(o).call(o,`penwidth`)){var m=[];for(t=a.length,e=0;e<t;e++)a[e].name!==`width`&&(a[e].name===`penwidth`&&(a[e].name=`width`),m.push(a[e]));a=m}for(t=a.length,e=0;e<t;e++)vy(a[e].attr,a[e].name,a[e].value);return n}function Oy(e){return SyntaxError(e+`, got "`+ky(G,30)+`" (char `+fy+`)`)}function ky(e,t){return e.length<=t?e:e.substr(0,27)+`...`}function Ay(e,t,n){for(var r=t.split(`.`),i=r.pop(),a=e,o=0;o<r.length;o++){var s=r[o];s in a||(a[s]={}),a=a[s]}return a[i]=n,e}function jy(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=t[r];Dp(i)?Qp(i).call(i,(function(t){Ay(n,t,e[r])})):Ay(n,typeof i==`string`?i:r,e[r])}return n}function My(e){var t,n=oy(e),r={nodes:[],edges:[],options:{}};if(n.nodes&&Qp(t=n.nodes).call(t,(function(e){var t={id:e.id,label:String(e.label||e.id)};_y(t,jy(e.attr,sy)),t.image&&(t.shape=`image`),r.nodes.push(t)})),n.edges){var i,a=function(e){var t={from:e.from,to:e.to};return _y(t,jy(e.attr,cy)),t.arrows==null&&e.type===`->`&&(t.arrows=`to`),t};Qp(i=n.edges).call(i,(function(e){var t,n,i,o,s,c,l;(t=e.from instanceof Object?e.from.nodes:{id:e.from},n=e.to instanceof Object?e.to.nodes:{id:e.to},e.from instanceof Object&&e.from.edges)&&Qp(i=e.from.edges).call(i,(function(e){var t=a(e);r.edges.push(t)})),(s=n,c=function(t,n){var i=a(xy(r,t.id,n.id,e.type,e.attr));r.edges.push(i)},Dp(o=t)?Qp(o).call(o,(function(e){Dp(s)?Qp(s).call(s,(function(t){c(e,t)})):c(e,s)})):Dp(s)?Qp(s).call(s,(function(e){c(o,e)})):c(o,s),e.to instanceof Object&&e.to.edges)&&Qp(l=e.to.edges).call(l,(function(e){var t=a(e);r.edges.push(t)}))}))}return n.attr&&(r.options=n.attr),r}var Ny=Object.freeze({__proto__:null,DOTToGraph:My,parseDOT:oy});function Py(e,t){var n,r={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};t!=null&&(t.fixed!=null&&(r.nodes.fixed=t.fixed),t.parseColor!=null&&(r.nodes.parseColor=t.parseColor),t.inheritColor!=null&&(r.edges.inheritColor=t.inheritColor));var i=e.edges,a=Np(i).call(i,(function(e){var t={from:e.source,id:e.id,to:e.target};return e.attributes!=null&&(t.attributes=e.attributes),e.label!=null&&(t.label=e.label),e.attributes!=null&&e.attributes.title!=null&&(t.title=e.attributes.title),e.type===`Directed`&&(t.arrows=`to`),e.color&&!1===r.edges.inheritColor&&(t.color=e.color),t}));return{nodes:Np(n=e.nodes).call(n,(function(e){var t={id:e.id,fixed:r.nodes.fixed&&e.x!=null&&e.y!=null};return e.attributes!=null&&(t.attributes=e.attributes),e.label!=null&&(t.label=e.label),e.size!=null&&(t.size=e.size),e.attributes!=null&&e.attributes.title!=null&&(t.title=e.attributes.title),e.title!=null&&(t.title=e.title),e.x!=null&&(t.x=e.x),e.y!=null&&(t.y=e.y),e.color!=null&&(!0===r.nodes.parseColor?t.color=e.color:t.color={background:e.color,border:e.color,highlight:{background:e.color,border:e.color},hover:{background:e.color,border:e.color}}),t})),edges:a}}var Fy=Object.freeze({__proto__:null,parseGephi:Py}),Iy=Object.freeze({__proto__:null,cn:{addDescription:`单击空白处放置新节点。`,addEdge:`添加连接线`,addNode:`添加节点`,back:`返回`,close:`關閉`,createEdgeError:`无法将连接线连接到群集。`,del:`删除选定`,deleteClusterError:`无法删除群集。`,edgeDescription:`单击某个节点并将该连接线拖动到另一个节点以连接它们。`,edit:`编辑`,editClusterError:`无法编辑群集。`,editEdge:`编辑连接线`,editEdgeDescription:`单击控制节点并将它们拖到节点上连接。`,editNode:`编辑节点`},cs:{addDescription:`Kluknutím do prázdného prostoru můžete přidat nový vrchol.`,addEdge:`Přidat hranu`,addNode:`Přidat vrchol`,back:`Zpět`,close:`Zavřít`,createEdgeError:`Nelze připojit hranu ke shluku.`,del:`Smazat výběr`,deleteClusterError:`Nelze mazat shluky.`,edgeDescription:`Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.`,edit:`Upravit`,editClusterError:`Nelze upravovat shluky.`,editEdge:`Upravit hranu`,editEdgeDescription:`Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.`,editNode:`Upravit vrchol`},de:{addDescription:`Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.`,addEdge:`Kante hinzufügen`,addNode:`Knoten hinzufügen`,back:`Zurück`,close:`Schließen`,createEdgeError:`Es ist nicht möglich, Kanten mit Clustern zu verbinden.`,del:`Lösche Auswahl`,deleteClusterError:`Cluster können nicht gelöscht werden.`,edgeDescription:`Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.`,edit:`Editieren`,editClusterError:`Cluster können nicht editiert werden.`,editEdge:`Kante editieren`,editEdgeDescription:`Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.`,editNode:`Knoten editieren`},en:{addDescription:`Click in an empty space to place a new node.`,addEdge:`Add Edge`,addNode:`Add Node`,back:`Back`,close:`Close`,createEdgeError:`Cannot link edges to a cluster.`,del:`Delete selected`,deleteClusterError:`Clusters cannot be deleted.`,edgeDescription:`Click on a node and drag the edge to another node to connect them.`,edit:`Edit`,editClusterError:`Clusters cannot be edited.`,editEdge:`Edit Edge`,editEdgeDescription:`Click on the control points and drag them to a node to connect to it.`,editNode:`Edit Node`},es:{addDescription:`Haga clic en un lugar vacío para colocar un nuevo nodo.`,addEdge:`Añadir arista`,addNode:`Añadir nodo`,back:`Atrás`,close:`Cerrar`,createEdgeError:`No se puede conectar una arista a un grupo.`,del:`Eliminar selección`,deleteClusterError:`No es posible eliminar grupos.`,edgeDescription:`Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.`,edit:`Editar`,editClusterError:`No es posible editar grupos.`,editEdge:`Editar arista`,editEdgeDescription:`Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.`,editNode:`Editar nodo`},fr:{addDescription:`Cliquez dans un endroit vide pour placer un nœud.`,addEdge:`Ajouter un lien`,addNode:`Ajouter un nœud`,back:`Retour`,close:`Fermer`,createEdgeError:`Impossible de créer un lien vers un cluster.`,del:`Effacer la sélection`,deleteClusterError:`Les clusters ne peuvent pas être effacés.`,edgeDescription:`Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.`,edit:`Éditer`,editClusterError:`Les clusters ne peuvent pas être édités.`,editEdge:`Éditer le lien`,editEdgeDescription:`Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.`,editNode:`Éditer le nœud`},it:{addDescription:`Clicca per aggiungere un nuovo nodo`,addEdge:`Aggiungi un vertice`,addNode:`Aggiungi un nodo`,back:`Indietro`,close:`Chiudere`,createEdgeError:`Non si possono collegare vertici ad un cluster`,del:`Cancella la selezione`,deleteClusterError:`I cluster non possono essere cancellati`,edgeDescription:`Clicca su un nodo e trascinalo ad un altro nodo per connetterli.`,edit:`Modifica`,editClusterError:`I clusters non possono essere modificati.`,editEdge:`Modifica il vertice`,editEdgeDescription:`Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.`,editNode:`Modifica il nodo`},nl:{addDescription:`Klik op een leeg gebied om een nieuwe node te maken.`,addEdge:`Link toevoegen`,addNode:`Node toevoegen`,back:`Terug`,close:`Sluiten`,createEdgeError:`Kan geen link maken naar een cluster.`,del:`Selectie verwijderen`,deleteClusterError:`Clusters kunnen niet worden verwijderd.`,edgeDescription:`Klik op een node en sleep de link naar een andere node om ze te verbinden.`,edit:`Wijzigen`,editClusterError:`Clusters kunnen niet worden aangepast.`,editEdge:`Link wijzigen`,editEdgeDescription:`Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.`,editNode:`Node wijzigen`},pt:{addDescription:`Clique em um espaço em branco para adicionar um novo nó`,addEdge:`Adicionar aresta`,addNode:`Adicionar nó`,back:`Voltar`,close:`Fechar`,createEdgeError:`Não foi possível linkar arestas a um cluster.`,del:`Remover selecionado`,deleteClusterError:`Clusters não puderam ser removidos.`,edgeDescription:`Clique em um nó e arraste a aresta até outro nó para conectá-los`,edit:`Editar`,editClusterError:`Clusters não puderam ser editados.`,editEdge:`Editar aresta`,editEdgeDescription:`Clique nos pontos de controle e os arraste para um nó para conectá-los`,editNode:`Editar nó`},ru:{addDescription:`Кликните в свободное место, чтобы добавить новый узел.`,addEdge:`Добавить ребро`,addNode:`Добавить узел`,back:`Назад`,close:`Закрывать`,createEdgeError:`Невозможно соединить ребра в кластер.`,del:`Удалить выбранное`,deleteClusterError:`Кластеры не могут быть удалены`,edgeDescription:`Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.`,edit:`Редактировать`,editClusterError:`Кластеры недоступны для редактирования.`,editEdge:`Редактировать ребро`,editEdgeDescription:`Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.`,editNode:`Редактировать узел`},uk:{addDescription:`Kлікніть на вільне місце, щоб додати новий вузол.`,addEdge:`Додати край`,addNode:`Додати вузол`,back:`Назад`,close:`Закрити`,createEdgeError:`Не можливо об'єднати краї в групу.`,del:`Видалити обране`,deleteClusterError:`Групи не можуть бути видалені.`,edgeDescription:`Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.`,edit:`Редагувати`,editClusterError:`Групи недоступні для редагування.`,editEdge:`Редагувати край`,editEdgeDescription:`Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.`,editNode:`Редагувати вузол`}}),Ly=function(){function e(){B(this,e),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement(`canvas`)}return V(e,[{key:`init`,value:function(){if(!this.initialized()){this.src=this.image.src;var e=this.image.width,t=this.image.height;this.width=e,this.height=t;var n=Math.floor(t/2),r=Math.floor(t/4),i=Math.floor(t/8),a=Math.floor(t/16),o=Math.floor(e/2),s=Math.floor(e/4),c=Math.floor(e/8),l=Math.floor(e/16);this.canvas.width=3*s,this.canvas.height=n,this.coordinates=[[0,0,o,n],[o,0,s,r],[o,r,c,i],[5*c,r,l,a]],this._fillMipMap()}}},{key:`initialized`,value:function(){return this.coordinates!==void 0}},{key:`_fillMipMap`,value:function(){var e=this.canvas.getContext(`2d`),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(var n=1;n<this.NUM_ITERATIONS;n++){var r=this.coordinates[n-1],i=this.coordinates[n];e.drawImage(this.canvas,r[0],r[1],r[2],r[3],i[0],i[1],i[2],i[3])}}},{key:`drawImageAtPosition`,value:function(e,t,n,r,i,a){if(this.initialized())if(t>2){t*=.5;for(var o=0;t>2&&o<this.NUM_ITERATIONS;)t*=.5,o+=1;o>=this.NUM_ITERATIONS&&(o=this.NUM_ITERATIONS-1);var s=this.coordinates[o];e.drawImage(this.canvas,s[0],s[1],s[2],s[3],n,r,i,a)}else e.drawImage(this.image,n,r,i,a)}}]),e}(),Ry=function(){function e(t){B(this,e),this.images={},this.imageBroken={},this.callback=t}return V(e,[{key:`_tryloadBrokenUrl`,value:function(e,t,n){e!==void 0&&n!==void 0&&(t===void 0?console.warn(`No broken url image defined`):(n.image.onerror=function(){console.error(`Could not load brokenImage:`,t)},n.image.src=t))}},{key:`_redrawWithImage`,value:function(e){this.callback&&this.callback(e)}},{key:`load`,value:function(e,t){var n=this,r=this.images[e];if(r)return r;var i=new Ly;return this.images[e]=i,i.image.onload=function(){n._fixImageCoordinates(i.image),i.init(),n._redrawWithImage(i)},i.image.onerror=function(){console.error(`Could not load image:`,e),n._tryloadBrokenUrl(e,t,i)},i.image.src=e,i}},{key:`_fixImageCoordinates`,value:function(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}]),e}(),zy={exports:{}},By=o((function(){if(typeof ArrayBuffer==`function`){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,`a`,{value:8})}})),Vy=o,Hy=Ce,Uy=x,Wy=By,Gy=Object.isExtensible,Ky=Vy((function(){Gy(1)}))||Wy?function(e){return!!Hy(e)&&(!Wy||Uy(e)!==`ArrayBuffer`)&&(!Gy||Gy(e))}:Gy,qy=!o((function(){return Object.isExtensible(Object.preventExtensions({}))})),Jy=I,Yy=_,Xy=cr,Zy=Ce,Qy=gt,$y=gn.f,eb=ol,tb=ll,nb=Ky,rb=qy,ib=!1,ab=xt(`meta`),ob=0,sb=function(e){$y(e,ab,{value:{objectID:`O`+ ob++,weakData:{}}})},cb=zy.exports={enable:function(){cb.enable=function(){},ib=!0;var e=eb.f,t=Yy([].splice),n={};n[ab]=1,e(n).length&&(eb.f=function(n){for(var r=e(n),i=0,a=r.length;i<a;i++)if(r[i]===ab){t(r,i,1);break}return r},Jy({target:`Object`,stat:!0,forced:!0},{getOwnPropertyNames:tb.f}))},fastKey:function(e,t){if(!Zy(e))return typeof e==`symbol`?e:(typeof e==`string`?`S`:`P`)+e;if(!Qy(e,ab)){if(!nb(e))return`F`;if(!t)return`E`;sb(e)}return e[ab].objectID},getWeakData:function(e,t){if(!Qy(e,ab)){if(!nb(e))return!0;if(!t)return!1;sb(e)}return e[ab].weakData},onFreeze:function(e){return rb&&ib&&nb(e)&&!Qy(e,ab)&&sb(e),e}};Xy[ab]=!0;var lb=zy.exports,ub=hn,db=ie,fb=xn,pb=Ge,mb=rs,hb=rr,gb=P,_b=Rs,vb=js,yb=Zo,bb=TypeError,xb=function(e,t){this.stopped=e,this.result=t},Sb=xb.prototype,Cb=function(e,t,n){var r,i,a,o,s,c,l,u=n&&n.that,d=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_RECORD),p=!(!n||!n.IS_ITERATOR),m=!(!n||!n.INTERRUPTED),h=ub(t,u),g=function(e){return r&&yb(r,`normal`,e),new xb(!0,e)},_=function(e){return d?(fb(e),m?h(e[0],e[1],g):h(e[0],e[1])):m?h(e,g):h(e)};if(f)r=e.iterator;else if(p)r=e;else{if(!(i=vb(e)))throw new bb(pb(e)+` is not iterable`);if(mb(i)){for(a=0,o=hb(e);o>a;a++)if((s=_(e[a]))&&gb(Sb,s))return s;return new xb(!1)}r=_b(e,i)}for(c=f?e.next:r.next;!(l=db(c,r)).done;){try{s=_(l.value)}catch(e){yb(r,`throw`,e)}if(typeof s==`object`&&s&&gb(Sb,s))return s}return new xb(!1)},wb=P,Tb=TypeError,Eb=function(e,t){if(wb(t,e))return e;throw new Tb(`Incorrect invocation`)},Db=I,Ob=a,kb=lb,Ab=o,jb=Fn,Mb=Cb,Nb=Eb,Pb=w,Fb=Ce,Ib=me,Lb=io,Rb=gn.f,zb=Vl.forEach,Bb=E,Vb=Zi.set,Hb=Zi.getterFor,Ub=function(e,t,n){var r,i=e.indexOf(`Map`)!==-1,a=e.indexOf(`Weak`)!==-1,o=i?`set`:`add`,s=Ob[e],c=s&&s.prototype,l={};if(Bb&&Pb(s)&&(a||c.forEach&&!Ab((function(){new s().entries().next()})))){var u=(r=t((function(t,n){Vb(Nb(t,u),{type:e,collection:new s}),Ib(n)||Mb(n,t[o],{that:t,AS_ENTRIES:i})}))).prototype,d=Hb(e);zb([`add`,`clear`,`delete`,`forEach`,`get`,`has`,`set`,`keys`,`values`,`entries`],(function(e){var t=e===`add`||e===`set`;!(e in c)||a&&e===`clear`||jb(u,e,(function(n,r){var i=d(this).collection;if(!t&&a&&!Fb(n))return e===`get`&&void 0;var o=i[e](n===0?0:n,r);return t?this:o}))})),a||Rb(u,`size`,{configurable:!0,get:function(){return d(this).collection.size}})}else r=n.getConstructor(t,e,i,o),kb.enable();return Lb(r,e,!1,!0),l[e]=r,Db({global:!0,forced:!0},l),a||n.setStrong(r,e,i),r},Wb=Ba,Gb=function(e,t,n){for(var r in t)n&&n.unsafe&&e[r]?e[r]=t[r]:Wb(e,r,t[r],n);return e},Kb=Ee,qb=Sl,Jb=E,Yb=At(`species`),Xb=ka,Zb=Sl,Qb=Gb,$b=hn,ex=Eb,tx=me,nx=Cb,rx=Ro,ix=zo,ax=function(e){var t=Kb(e);Jb&&t&&!t[Yb]&&qb(t,Yb,{configurable:!0,get:function(){return this}})},ox=E,sx=lb.fastKey,cx=Zi.set,lx=Zi.getterFor,ux={getConstructor:function(e,t,n,r){var i=e((function(e,i){ex(e,a),cx(e,{type:t,index:Xb(null),first:void 0,last:void 0,size:0}),ox||(e.size=0),tx(i)||nx(i,e[r],{that:e,AS_ENTRIES:n})})),a=i.prototype,o=lx(t),s=function(e,t,n){var r,i,a=o(e),s=c(e,t);return s?s.value=n:(a.last=s={index:i=sx(t,!0),key:t,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||=s,r&&(r.next=s),ox?a.size++:e.size++,i!==`F`&&(a.index[i]=s)),e},c=function(e,t){var n,r=o(e),i=sx(t);if(i!==`F`)return r.index[i];for(n=r.first;n;n=n.next)if(n.key===t)return n};return Qb(a,{clear:function(){for(var e=o(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&=n.previous.next=void 0,delete t[n.index],n=n.next;e.first=e.last=void 0,ox?e.size=0:this.size=0},delete:function(e){var t=this,n=o(t),r=c(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first===r&&(n.first=i),n.last===r&&(n.last=a),ox?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=o(this),r=$b(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),Qb(a,n?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,e===0?0:e,t)}}:{add:function(e){return s(this,e=e===0?0:e,e)}}),ox&&Zb(a,`size`,{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(e,t,n){var r=t+` Iterator`,i=lx(t),a=lx(r);rx(e,t,(function(e,t){cx(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?ix(t===`keys`?n.key:t===`values`?n.value:[n.key,n.value],!1):(e.target=void 0,ix(void 0,!0))}),n?`entries`:`values`,!n,!0),ax(t)}};Ub(`Map`,(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),ux);var dx=r(j.Map),fx=function(){function e(){B(this,e),this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:`#2B7CE9`,background:`#97C2FC`,highlight:{border:`#2B7CE9`,background:`#D2E5FF`},hover:{border:`#2B7CE9`,background:`#D2E5FF`}},{border:`#FFA500`,background:`#FFFF00`,highlight:{border:`#FFA500`,background:`#FFFFA3`},hover:{border:`#FFA500`,background:`#FFFFA3`}},{border:`#FA0A10`,background:`#FB7E81`,highlight:{border:`#FA0A10`,background:`#FFAFB1`},hover:{border:`#FA0A10`,background:`#FFAFB1`}},{border:`#41A906`,background:`#7BE141`,highlight:{border:`#41A906`,background:`#A1EC76`},hover:{border:`#41A906`,background:`#A1EC76`}},{border:`#E129F0`,background:`#EB7DF4`,highlight:{border:`#E129F0`,background:`#F0B3F5`},hover:{border:`#E129F0`,background:`#F0B3F5`}},{border:`#7C29F0`,background:`#AD85E4`,highlight:{border:`#7C29F0`,background:`#D3BDF0`},hover:{border:`#7C29F0`,background:`#D3BDF0`}},{border:`#C37F00`,background:`#FFA807`,highlight:{border:`#C37F00`,background:`#FFCA66`},hover:{border:`#C37F00`,background:`#FFCA66`}},{border:`#4220FB`,background:`#6E6EFD`,highlight:{border:`#4220FB`,background:`#9B9BFD`},hover:{border:`#4220FB`,background:`#9B9BFD`}},{border:`#FD5A77`,background:`#FFC0CB`,highlight:{border:`#FD5A77`,background:`#FFD1D9`},hover:{border:`#FD5A77`,background:`#FFD1D9`}},{border:`#4AD63A`,background:`#C2FABC`,highlight:{border:`#4AD63A`,background:`#E6FFE3`},hover:{border:`#4AD63A`,background:`#E6FFE3`}},{border:`#990000`,background:`#EE0000`,highlight:{border:`#BB0000`,background:`#FF3333`},hover:{border:`#BB0000`,background:`#FF3333`}},{border:`#FF6000`,background:`#FF6000`,highlight:{border:`#FF6000`,background:`#FF6000`},hover:{border:`#FF6000`,background:`#FF6000`}},{border:`#97C2FC`,background:`#2B7CE9`,highlight:{border:`#D2E5FF`,background:`#2B7CE9`},hover:{border:`#D2E5FF`,background:`#2B7CE9`}},{border:`#399605`,background:`#255C03`,highlight:{border:`#399605`,background:`#255C03`},hover:{border:`#399605`,background:`#255C03`}},{border:`#B70054`,background:`#FF007E`,highlight:{border:`#B70054`,background:`#FF007E`},hover:{border:`#B70054`,background:`#FF007E`}},{border:`#AD85E4`,background:`#7C29F0`,highlight:{border:`#D3BDF0`,background:`#7C29F0`},hover:{border:`#D3BDF0`,background:`#7C29F0`}},{border:`#4557FA`,background:`#000EA1`,highlight:{border:`#6E6EFD`,background:`#000EA1`},hover:{border:`#6E6EFD`,background:`#000EA1`}},{border:`#FFC0CB`,background:`#FD5A77`,highlight:{border:`#FFD1D9`,background:`#FD5A77`},hover:{border:`#FFD1D9`,background:`#FD5A77`}},{border:`#C2FABC`,background:`#74D66A`,highlight:{border:`#E6FFE3`,background:`#74D66A`},hover:{border:`#E6FFE3`,background:`#74D66A`}},{border:`#EE0000`,background:`#990000`,highlight:{border:`#FF3333`,background:`#BB0000`},hover:{border:`#FF3333`,background:`#BB0000`}}],this.options={},this.defaultOptions={useDefaultGroups:!0},Nr(this.options,this.defaultOptions)}return V(e,[{key:`setOptions`,value:function(e){var t=[`useDefaultGroups`];if(e!==void 0){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&H(t).call(t,n)===-1){var r=e[n];this.add(n,r)}}}},{key:`clear`,value:function(){this._groups=new dx,this._groupNames=[]}},{key:`get`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this._groups.get(e);if(n===void 0&&t)if(!1===this.options.useDefaultGroups&&this._groupNames.length>0){var r=this._groupIndex%this._groupNames.length;++this._groupIndex,(n={}).color=this._groups.get(this._groupNames[r]),this._groups.set(e,n)}else{var i=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,(n={}).color=this._defaultGroups[i],this._groups.set(e,n)}return n}},{key:`add`,value:function(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}}]),e}();I({target:`Number`,stat:!0},{isNaN:function(e){return e!=e}});var px=r(j.Number.isNaN),mx=a.isFinite;I({target:`Number`,stat:!0},{isFinite:Number.isFinite||function(e){return typeof e==`number`&&mx(e)}});var hx=r(j.Number.isFinite),gx=Vl.some;I({target:`Array`,proto:!0,forced:!Hp(`some`)},{some:function(e){return gx(this,e,arguments.length>1?arguments[1]:void 0)}});var _x=Jr(`Array`).some,vx=P,yx=_x,bx=Array.prototype,xx=r(function(e){var t=e.some;return e===bx||vx(bx,e)&&t===bx.some?yx:t}),Sx=r(j.Object.getOwnPropertySymbols),Cx={exports:{}},wx=I,Tx=o,Ex=be,Dx=T.f,Ox=E;wx({target:`Object`,stat:!0,forced:!Ox||Tx((function(){Dx(1)})),sham:!Ox},{getOwnPropertyDescriptor:function(e,t){return Dx(Ex(e),t)}});var kx=j.Object,Ax=Cx.exports=function(e,t){return kx.getOwnPropertyDescriptor(e,t)};kx.getOwnPropertyDescriptor.sham&&(Ax.sham=!0);var jx=Cx.exports,Mx=r(jx),Nx=Ep,Px=be,Fx=T,Ix=Ts;I({target:`Object`,stat:!0,sham:!E},{getOwnPropertyDescriptors:function(e){for(var t,n,r=Px(e),i=Fx.f,a=Nx(r),o={},s=0;a.length>s;)(n=i(r,t=a[s++]))!==void 0&&Ix(o,t,n);return o}});var Lx=r(j.Object.getOwnPropertyDescriptors),Rx={exports:{}},zx=I,Bx=E,Vx=ia.f;zx({target:`Object`,stat:!0,forced:Object.defineProperties!==Vx,sham:!Bx},{defineProperties:Vx});var Hx=j.Object,Ux=Rx.exports=function(e,t){return Hx.defineProperties(e,t)};Hx.defineProperties.sham&&(Ux.sham=!0);var Wx=r(Rx.exports),Gx=r(kc);function Kx(e,t,n){return(t=Tf(t))in e?Ac(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qx=a,Jx=o,Yx=Si,Xx=hh.trim,Zx=sh,Qx=_(``.charAt),$x=qx.parseFloat,eS=qx.Symbol,tS=eS&&eS.iterator,nS=1/$x(Zx+`-0`)!=-1/0||tS&&!Jx((function(){$x(Object(tS))}))?function(e){var t=Xx(Yx(e)),n=$x(t);return n===0&&Qx(t,0)===`-`?-0:n}:$x;I({global:!0,forced:parseFloat!==nS},{parseFloat:nS});var rS=r(j.parseFloat),iS=I,aS=o,oS=ll.f;iS({target:`Object`,stat:!0,forced:aS((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:oS});var sS=j.Object,cS=r(function(e){return sS.getOwnPropertyNames(e)});function lS(e,t){var n=[`node`,`edge`,`label`],r=!0,i=Wv(t,`chosen`);if(typeof i==`boolean`)r=i;else if(Cf(i)===`object`){if(H(n).call(n,e)===-1)throw Error(`choosify: subOption '`+e+`' should be one of '`+n.join(`', '`)+`'`);var a=Wv(t,[`chosen`,e]);typeof a!=`boolean`&&typeof a!=`function`||(r=a)}return r}function uS(e,t,n){if(e.width<=0||e.height<=0)return!1;if(n!==void 0){var r={x:t.x-n.x,y:t.y-n.y};if(n.angle!==0){var i=-n.angle;t={x:Math.cos(i)*r.x-Math.sin(i)*r.y,y:Math.sin(i)*r.x+Math.cos(i)*r.y}}else t=r}var a=e.x+e.width,o=e.y+e.width;return e.left<t.x&&a>t.x&&e.top<t.y&&o>t.y}function dS(e){return typeof e==`string`&&e!==``}function fS(e,t,n,r){var i=r.x,a=r.y;if(typeof r.distanceToBorder==`function`){var o=r.distanceToBorder(e,t),s=Math.sin(t)*o,c=Math.cos(t)*o;c===o?(i+=o,a=r.y):s===o?(i=r.x,a-=o):(i+=c,a-=s)}else r.shape.width>r.shape.height?(i=r.x+.5*r.shape.width,a=r.y-n):(i=r.x+n,a=r.y-.5*r.shape.height);return{x:i,y:a}}var pS=Jr(`Array`).values,mS=yi,hS=gt,gS=P,_S=pS,vS=Array.prototype,yS={DOMTokenList:!0,NodeList:!0},bS=r(function(e){var t=e.values;return e===vS||gS(vS,e)&&t===vS.values||hS(yS,mS(e))?_S:t}),xS=function(){function e(t){B(this,e),this.measureText=t,this.current=0,this.width=0,this.height=0,this.lines=[]}return V(e,[{key:`_add`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`normal`;this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});var r=t;t!==void 0&&t!==``||(r=` `);var i=this.measureText(r,n),a=Nr({},bS(i));a.text=t,a.width=i.width,a.mod=n,t!==void 0&&t!==``||(a.width=0),this.lines[e].blocks.push(a),this.lines[e].width+=a.width}},{key:`curWidth`,value:function(){var e=this.lines[this.current];return e===void 0?0:e.width}},{key:`append`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`normal`;this._add(this.current,e,t)}},{key:`newLine`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`normal`;this._add(this.current,e,t),this.current++}},{key:`determineLineHeights`,value:function(){for(var e=0;e<this.lines.length;e++){var t=this.lines[e],n=0;if(t.blocks!==void 0)for(var r=0;r<t.blocks.length;r++){var i=t.blocks[r];n<i.height&&(n=i.height)}t.height=n}}},{key:`determineLabelSize`,value:function(){for(var e=0,t=0,n=0;n<this.lines.length;n++){var r=this.lines[n];r.width>e&&(e=r.width),t+=r.height}this.width=e,this.height=t}},{key:`removeEmptyBlocks`,value:function(){for(var e=[],t=0;t<this.lines.length;t++){var n=this.lines[t];if(n.blocks.length!==0&&(t!==this.lines.length-1||n.width!==0)){var r={};Nr(r,n),r.blocks=[];for(var i=void 0,a=[],o=0;o<n.blocks.length;o++){var s=n.blocks[o];s.width===0?i===void 0&&(i=s):a.push(s)}a.length===0&&i!==void 0&&a.push(i),r.blocks=a,e.push(r)}}return e}},{key:`finalize`,value:function(){this.determineLineHeights(),this.determineLabelSize();var e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}}]),e}(),SS={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},CS=function(){function e(t){B(this,e),this.text=t,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer=``,this.modStack=[],this.blocks=[]}return V(e,[{key:`mod`,value:function(){return this.modStack.length===0?`normal`:this.modStack[0]}},{key:`modName`,value:function(){return this.modStack.length===0?`normal`:this.modStack[0]===`mono`?`mono`:this.bold&&this.ital?`boldital`:this.bold?`bold`:this.ital?`ital`:void 0}},{key:`emitBlock`,value:function(){this.spacing&&=(this.add(` `),!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer=``)}},{key:`add`,value:function(e){e===` `&&(this.spacing=!0),this.spacing&&=(this.buffer+=` `,!1),e!=` `&&(this.buffer+=e)}},{key:`parseWS`,value:function(e){return!!/[ \t]/.test(e)&&(this.mono?this.add(e):this.spacing=!0,!0)}},{key:`setTag`,value:function(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}},{key:`unsetTag`,value:function(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}},{key:`parseStartTag`,value:function(e,t){return!(this.mono||this[e]||!this.match(t))&&(this.setTag(e),!0)}},{key:`match`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=fp(this.prepareRegExp(e),2),r=n[0],i=n[1],a=r.test(this.text.substr(this.position,i));return a&&t&&(this.position+=i-1),a}},{key:`parseEndTag`,value:function(e,t,n){var r=this.mod()===e;return!(!(r=e===`mono`?r&&this.mono:r&&!this.mono)||!this.match(t))&&((n===void 0||this.position===this.text.length-1||this.match(n,!1))&&this.unsetTag(e),!0)}},{key:`replace`,value:function(e,t){return!!this.match(e)&&(this.add(t),this.position+=length-1,!0)}},{key:`prepareRegExp`,value:function(e){var t,n;if(e instanceof RegExp)n=e,t=1;else{var r=SS[e];n=r===void 0?new RegExp(e):r,t=e.length}return[n,t]}}]),e}(),wS=function(){function e(t,n,r,i){var a=this;B(this,e),this.ctx=t,this.parent=n,this.selected=r,this.hover=i,this.lines=new xS((function(e,n){if(e===void 0)return 0;var o=a.parent.getFormattingValues(t,r,i,n),s=0;return e!==``&&(s=a.ctx.measureText(e).width),{width:s,values:o}}))}return V(e,[{key:`process`,value:function(e){if(!dS(e))return this.lines.finalize();var t=this.parent.fontOptions;e=(e=e.replace(/\r\n/g,`
33
+ `)).replace(/\r/g,`
34
+ `);var n=String(e).split(`
35
+ `),r=n.length;if(t.multi)for(var i=0;i<r;i++){var a=this.splitBlocks(n[i],t.multi);if(a!==void 0)if(a.length!==0){if(t.maxWdt>0)for(var o=0;o<a.length;o++){var s=a[o].mod,c=a[o].text;this.splitStringIntoLines(c,s,!0)}else for(var l=0;l<a.length;l++){var u=a[l].mod,d=a[l].text;this.lines.append(d,u)}this.lines.newLine()}else this.lines.newLine(``)}else if(t.maxWdt>0)for(var f=0;f<r;f++)this.splitStringIntoLines(n[f]);else for(var p=0;p<r;p++)this.lines.newLine(n[p]);return this.lines.finalize()}},{key:`decodeMarkupSystem`,value:function(e){var t=`none`;return e===`markdown`||e===`md`?t=`markdown`:!0!==e&&e!==`html`||(t=`html`),t}},{key:`splitHtmlBlocks`,value:function(e){for(var t=new CS(e),n=function(e){return!!/&/.test(e)&&(t.replace(t.text,`&lt;`,`<`)||t.replace(t.text,`&amp;`,`&`)||t.add(`&`),!0)};t.position<t.text.length;){var r=t.text.charAt(t.position);t.parseWS(r)||/</.test(r)&&(t.parseStartTag(`bold`,`<b>`)||t.parseStartTag(`ital`,`<i>`)||t.parseStartTag(`mono`,`<code>`)||t.parseEndTag(`bold`,`</b>`)||t.parseEndTag(`ital`,`</i>`)||t.parseEndTag(`mono`,`</code>`))||n(r)||t.add(r),t.position++}return t.emitBlock(),t.blocks}},{key:`splitMarkdownBlocks`,value:function(e){for(var t=this,n=new CS(e),r=!0,i=function(e){return!!/\\/.test(e)&&(n.position<t.text.length+1&&(n.position++,e=t.text.charAt(n.position),/ \t/.test(e)?n.spacing=!0:(n.add(e),r=!1)),!0)};n.position<n.text.length;){var a=n.text.charAt(n.position);n.parseWS(a)||i(a)||(r||n.spacing)&&(n.parseStartTag(`bold`,`*`)||n.parseStartTag(`ital`,`_`)||n.parseStartTag(`mono`,"`"))||n.parseEndTag(`bold`,`*`,`afterBold`)||n.parseEndTag(`ital`,`_`,`afterItal`)||n.parseEndTag(`mono`,"`",`afterMono`)||(n.add(a),r=!1),n.position++}return n.emitBlock(),n.blocks}},{key:`splitBlocks`,value:function(e,t){var n=this.decodeMarkupSystem(t);return n===`none`?[{text:e,mod:`normal`}]:n===`markdown`?this.splitMarkdownBlocks(e):n===`html`?this.splitHtmlBlocks(e):void 0}},{key:`overMaxWidth`,value:function(e){var t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}},{key:`getLongestFit`,value:function(e){for(var t=``,n=0;n<e.length;){var r=t+(t===``?``:` `)+e[n];if(this.overMaxWidth(r))break;t=r,n++}return n}},{key:`getLongestFitWord`,value:function(e){for(var t=0;t<e.length&&!this.overMaxWidth(bp(e).call(e,0,t));)t++;return t}},{key:`splitStringIntoLines`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`normal`,n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t);for(var r=(e=(e=e.replace(/^( +)/g,`$1\r`)).replace(/([^\r][^ ]*)( +)/g,`$1\r$2\r`)).split(`\r`);r.length>0;){var i=this.getLongestFit(r);if(i===0){var a=r[0],o=this.getLongestFitWord(a);this.lines.newLine(bp(a).call(a,0,o),t),r[0]=bp(a).call(a,o)}else{var s=i;r[i-1]===` `?i--:r[s]===` `&&s++;var c=bp(r).call(r,0,i).join(``);i==r.length&&n?this.lines.append(c,t):this.lines.newLine(c,t),r=bp(r).call(r,s)}}}}]),e}(),TS=[`bold`,`ital`,`boldital`,`mono`],ES=function(){function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];B(this,e),this.body=t,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(n),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=r}return V(e,[{key:`setOptions`,value:function(e){if(this.elementOptions=e,this.initFontOptions(e.font),dS(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font==`string`)this.baseSize=this.fontOptions.size;else if(Cf(e.font)===`object`){var t=e.font.size;t!==void 0&&(this.baseSize=t)}}}},{key:`initFontOptions`,value:function(t){var n=this;U(TS,(function(e){n.fontOptions[e]={}})),e.parseFontString(this.fontOptions,t)?this.fontOptions.vadjust=0:U(t,(function(e,t){e!=null&&Cf(e)!==`object`&&(n.fontOptions[t]=e)}))}},{key:`constrain`,value:function(e){var t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:`middle`},n=Wv(e,`widthConstraint`);if(typeof n==`number`)t.maxWdt=Number(n),t.minWdt=Number(n);else if(Cf(n)===`object`){var r=Wv(e,[`widthConstraint`,`maximum`]);typeof r==`number`&&(t.maxWdt=Number(r));var i=Wv(e,[`widthConstraint`,`minimum`]);typeof i==`number`&&(t.minWdt=Number(i))}var a=Wv(e,`heightConstraint`);if(typeof a==`number`)t.minHgt=Number(a);else if(Cf(a)===`object`){var o=Wv(e,[`heightConstraint`,`minimum`]);typeof o==`number`&&(t.minHgt=Number(o));var s=Wv(e,[`heightConstraint`,`valign`]);typeof s==`string`&&(s!==`top`&&s!==`bottom`||(t.valign=s))}return t}},{key:`update`,value:function(e,t){this.setOptions(e,!0),this.propagateFonts(t),kv(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=lS(`label`,t)}},{key:`adjustSizes`,value:function(e){var t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);var n=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=n)}},{key:`addFontOptionsToPile`,value:function(e,t){for(var n=0;n<t.length;++n)this.addFontToPile(e,t[n])}},{key:`addFontToPile`,value:function(e,t){if(t!==void 0&&t.font!==void 0&&t.font!==null){var n=t.font;e.push(n)}}},{key:`getBasicOptions`,value:function(t){for(var n={},r=0;r<t.length;++r){var i=t[r],a={};e.parseFontString(a,i)&&(i=a),U(i,(function(e,t){e!==void 0&&(Object.prototype.hasOwnProperty.call(n,t)||(H(TS).call(TS,t)===-1?n[t]=e:n[t]={}))}))}return n}},{key:`getFontOption`,value:function(t,n,r){for(var i,a=0;a<t.length;++a){var o=t[a];if(Object.prototype.hasOwnProperty.call(o,n)){if((i=o[n])==null)continue;var s={};if(e.parseFontString(s,i)&&(i=s),Object.prototype.hasOwnProperty.call(i,r))return i[r]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,r))return this.fontOptions[r];throw Error(`Did not find value for multi-font for property: '`+r+`'`)}},{key:`getFontOptions`,value:function(e,t){for(var n={},r=[`color`,`size`,`face`,`mod`,`vadjust`],i=0;i<r.length;++i){var a=r[i];n[a]=this.getFontOption(e,t,a)}return n}},{key:`propagateFonts`,value:function(e){var t=this,n=[];this.addFontOptionsToPile(n,e),this.fontOptions=this.getBasicOptions(n);for(var r=function(){var e=TS[i],r=t.fontOptions[e];U(t.getFontOptions(n,e),(function(e,t){r[t]=e})),r.size=Number(r.size),r.vadjust=Number(r.vadjust)},i=0;i<TS.length;++i)r()}},{key:`draw`,value:function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:`middle`;if(this.elementOptions.label!==void 0){var o=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&o<this.elementOptions.scaling.label.drawThreshold-1||(o>=this.elementOptions.scaling.label.maxVisible&&(o=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,r,i,t,n,a),this._drawBackground(e),this._drawText(e,t,this.size.yLine,a,o))}}},{key:`_drawBackground`,value:function(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!==`none`){e.fillStyle=this.fontOptions.background;var t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}},{key:`_drawText`,value:function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`middle`,i=arguments.length>4?arguments[4]:void 0,a=fp(this._setAlignment(e,t,n,r),2);t=a[0],n=a[1],e.textAlign=`left`,t-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign===`top`&&(n-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign===`bottom`&&(n+=(this.size.height-this.size.labelHeight)/2));for(var o=0;o<this.lineCount;o++){var s=this.lines[o];if(s&&s.blocks){var c=0;this.isEdgeLabel||this.fontOptions.align===`center`?c+=(this.size.width-s.width)/2:this.fontOptions.align===`right`&&(c+=this.size.width-s.width);for(var l=0;l<s.blocks.length;l++){var u=s.blocks[l];e.font=u.font;var d=fp(this._getColor(u.color,i,u.strokeColor),2),f=d[0],p=d[1];u.strokeWidth>0&&(e.lineWidth=u.strokeWidth,e.strokeStyle=p,e.lineJoin=`round`),e.fillStyle=f,u.strokeWidth>0&&e.strokeText(u.text,t+c,n+u.vadjust),e.fillText(u.text,t+c,n+u.vadjust),c+=u.width}n+=s.height}}}},{key:`_setAlignment`,value:function(e,t,n,r){return this.isEdgeLabel&&this.fontOptions.align!==`horizontal`&&!1===this.pointToSelf?(t=0,n=0,this.fontOptions.align===`top`?(e.textBaseline=`alphabetic`,n-=4):this.fontOptions.align===`bottom`?(e.textBaseline=`hanging`,n+=4):e.textBaseline=`middle`):e.textBaseline=r,[t,n]}},{key:`_getColor`,value:function(e,t,n){var r=e||`#000000`,i=n||`#ffffff`;if(t<=this.elementOptions.scaling.label.drawThreshold){var a=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));r=Nv(r,a),i=Nv(i,a)}return[r,i]}},{key:`getTextSize`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return this._processLabel(e,t,n),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:`getSize`,value:function(){var e=this.size.left,t=this.size.top-1;if(this.isEdgeLabel){var n=.5*-this.size.width;switch(this.fontOptions.align){case`middle`:e=n,t=.5*-this.size.height;break;case`top`:e=n,t=-(this.size.height+2);break;case`bottom`:e=n,t=2}}return{left:e,top:t,width:this.size.width,height:this.size.height}}},{key:`calculateLabelSize`,value:function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:`middle`;this._processLabel(e,t,n),this.size.left=r-.5*this.size.width,this.size.top=i-.5*this.size.height,this.size.yLine=i+.5*(1-this.lineCount)*this.fontOptions.size,a===`hanging`&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:`getFormattingValues`,value:function(e,t,n,r){var i=function(e,t,n){return t===`normal`?n===`mod`?``:e[n]:e[t][n]===void 0?e[n]:e[t][n]},a={color:i(this.fontOptions,r,`color`),size:i(this.fontOptions,r,`size`),face:i(this.fontOptions,r,`face`),mod:i(this.fontOptions,r,`mod`),vadjust:i(this.fontOptions,r,`vadjust`),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||n)&&(r===`normal`&&!0===this.fontOptions.chooser&&this.elementOptions.labelHighlightBold?a.mod=`bold`:typeof this.fontOptions.chooser==`function`&&this.fontOptions.chooser(a,this.elementOptions.id,t,n));var o=``;return a.mod!==void 0&&a.mod!==``&&(o+=a.mod+` `),o+=a.size+`px `+a.face,e.font=o.replace(/"/g,``),a.font=e.font,a.height=a.size,a}},{key:`differentState`,value:function(e,t){return e!==this.selectedState||t!==this.hoverState}},{key:`_processLabelText`,value:function(e,t,n,r){return new wS(e,this,t,n).process(r)}},{key:`_processLabel`,value:function(e,t,n){if(!1!==this.labelDirty||this.differentState(t,n)){var r=this._processLabelText(e,t,n,this.elementOptions.label);this.fontOptions.minWdt>0&&r.width<this.fontOptions.minWdt&&(r.width=this.fontOptions.minWdt),this.size.labelHeight=r.height,this.fontOptions.minHgt>0&&r.height<this.fontOptions.minHgt&&(r.height=this.fontOptions.minHgt),this.lines=r.lines,this.lineCount=r.lines.length,this.size.width=r.width,this.size.height=r.height,this.selectedState=t,this.hoverState=n,this.labelDirty=!1}}},{key:`visible`,value:function(){return this.size.width!==0&&this.size.height!==0&&this.elementOptions.label!==void 0&&!(this.fontOptions.size*this.body.view.scale<this.elementOptions.scaling.label.drawThreshold-1)}}],[{key:`parseFontString`,value:function(e,t){if(!t||typeof t!=`string`)return!1;var n=t.split(` `);return e.size=+n[0].replace(`px`,``),e.face=n[1],e.color=n[2],!0}}]),e}(),DS=xs,OS=Ge,kS=TypeError,AS=I,jS=f,MS=Gr,NS=function(e){if(DS(e))return e;throw new kS(OS(e)+` is not a constructor`)},PS=xn,FS=Ce,IS=ka,LS=o,RS=Ee(`Reflect`,`construct`),zS=Object.prototype,BS=[].push,VS=LS((function(){function e(){}return!(RS((function(){}),[],e)instanceof e)})),HS=!LS((function(){RS((function(){}))})),US=VS||HS;AS({target:`Reflect`,stat:!0,forced:US,sham:US},{construct:function(e,t){NS(e),PS(t);var n=arguments.length<3?e:NS(arguments[2]);if(HS&&!VS)return RS(e,t,n);if(e===n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return jS(BS,r,t),new(jS(MS,e,r))}var i=n.prototype,a=IS(FS(i)?i:zS),o=jS(e,a,t);return FS(o)?o:a}});var K=r(j.Reflect.construct),WS=r(zh);I({target:`Object`,stat:!0},{setPrototypeOf:xo});var GS=r(j.Object.setPrototypeOf),KS=r($r);function qS(e,t){var n;return qS=GS?KS(n=GS).call(n):function(e,t){return e.__proto__=t,e},qS(e,t)}function q(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=WS(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Ac(e,`prototype`,{writable:!1}),t&&qS(e,t)}function JS(e,t){if(t&&(Cf(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return function(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}(e)}var YS=r($m);function J(e){var t;return J=GS?KS(t=YS).call(t):function(e){return e.__proto__||YS(e)},J(e)}var XS=function(){function e(t,n,r){B(this,e),this.body=n,this.labelModule=r,this.setOptions(t),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}return V(e,[{key:`setOptions`,value:function(e){this.options=e}},{key:`_setMargins`,value:function(e){this.margin={},this.options.margin&&(Cf(this.options.margin)==`object`?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}},{key:`_distanceToBorder`,value:function(e,t){var n=this.options.borderWidth;return e&&this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+n}},{key:`enableShadow`,value:function(e,t){t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}},{key:`disableShadow`,value:function(e,t){t.shadow&&(e.shadowColor=`rgba(0,0,0,0)`,e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:`enableBorderDashes`,value:function(e,t){if(!1!==t.borderDashes)if(e.setLineDash!==void 0){var n=t.borderDashes;!0===n&&(n=[5,15]),e.setLineDash(n)}else console.warn(`setLineDash is not supported in this browser. The dashed borders cannot be used.`),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1}},{key:`disableBorderDashes`,value:function(e,t){!1!==t.borderDashes&&(e.setLineDash===void 0?(console.warn(`setLineDash is not supported in this browser. The dashed borders cannot be used.`),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1):e.setLineDash([0]))}},{key:`needsRefresh`,value:function(e,t){return!0===this.refreshNeeded?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,t)}},{key:`initContextForDraw`,value:function(e,t){var n=t.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,n),e.strokeStyle=t.borderColor,e.fillStyle=t.color}},{key:`performStroke`,value:function(e,t){var n=t.borderWidth/this.body.view.scale;e.save(),n>0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}},{key:`performFill`,value:function(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),_g(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}},{key:`_addBoundingBoxMargin`,value:function(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}},{key:`_updateBoundingBox`,value:function(e,t,n,r,i){n!==void 0&&this.resize(n,r,i),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:`updateBoundingBox`,value:function(e,t,n,r,i){this._updateBoundingBox(e,t,n,r,i)}},{key:`getDimensionsFromLabel`,value:function(e,t,n){this.textSize=this.labelModule.getTextSize(e,t,n);var r=this.textSize.width,i=this.textSize.height;return r===0&&(r=14,i=14),{width:r,height:i}}}]),e}();function ZS(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var QS=function(e){q(n,e);var t=ZS(n);function n(e,r,i){var a;return B(this,n),(a=t.call(this,e,r,i))._setMargins(i),a}return V(n,[{key:`resize`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,n)){var r=this.getDimensionsFromLabel(e,t,n);this.width=r.width+this.margin.right+this.margin.left,this.height=r.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:`draw`,value:function(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width/2,this.top=n-this.height/2,this.initContextForDraw(e,a),ti(e,this.left,this.top,this.width,this.height,a.borderRadius),this.performFill(e,a),this.updateBoundingBox(t,n,e,r,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,r,i)}},{key:`updateBoundingBox`,value:function(e,t,n,r,i){this._updateBoundingBox(e,t,n,r,i);var a=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(a)}},{key:`distanceToBorder`,value:function(e,t){e&&this.resize(e);var n=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+n}}]),n}(XS);function $S(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var eC=function(e){q(n,e);var t=$S(n);function n(e,r,i){var a;return B(this,n),(a=t.call(this,e,r,i)).labelOffset=0,a.selected=!1,a}return V(n,[{key:`setOptions`,value:function(e,t,n){this.options=e,t===void 0&&n===void 0||this.setImages(t,n)}},{key:`setImages`,value:function(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}},{key:`switchImages`,value:function(e){var t=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&t){var n=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=n}}},{key:`_getImagePadding`,value:function(){var e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){var t=this.options.imagePadding;Cf(t)==`object`?(e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left):(e.top=t,e.right=t,e.bottom=t,e.left=t)}return e}},{key:`_resizeImage`,value:function(){var e,t;if(!1===this.options.shapeProperties.useImageSize){var n=1,r=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?n=this.imageObj.width/this.imageObj.height:r=this.imageObj.height/this.imageObj.width),e=2*this.options.size*n,t=2*this.options.size*r}else{var i=this._getImagePadding();e=this.imageObj.width+i.left+i.right,t=this.imageObj.height+i.top+i.bottom}this.width=e,this.height=t,this.radius=.5*this.width}},{key:`_drawRawCircle`,value:function(e,t,n,r){this.initContextForDraw(e,r),ei(e,t,n,r.size),this.performFill(e,r)}},{key:`_drawImageAtPosition`,value:function(e,t){if(this.imageObj.width!=0){e.globalAlpha=t.opacity===void 0?1:t.opacity,this.enableShadow(e,t);var n=1;!0===this.options.shapeProperties.interpolation&&(n=this.imageObj.width/this.width/this.body.view.scale);var r=this._getImagePadding(),i=this.left+r.left,a=this.top+r.top,o=this.width-r.left-r.right,s=this.height-r.top-r.bottom;this.imageObj.drawImageAtPosition(e,n,i,a,o,s),this.disableShadow(e,t)}}},{key:`_drawImageLabel`,value:function(e,t,n,r,i){var a=0;if(this.height!==void 0){a=.5*this.height;var o=this.labelModule.getTextSize(e,r,i);o.lineCount>=1&&(a+=o.height/2)}var s=n+a;this.options.label&&(this.labelOffset=a),this.labelModule.draw(e,t,s,r,i,`hanging`)}}]),n}(XS);function tC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var nC=function(e){q(n,e);var t=tC(n);function n(e,r,i){var a;return B(this,n),(a=t.call(this,e,r,i))._setMargins(i),a}return V(n,[{key:`resize`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,n)){var r=this.getDimensionsFromLabel(e,t,n),i=Math.max(r.width+this.margin.right+this.margin.left,r.height+this.margin.top+this.margin.bottom);this.options.size=i/2,this.width=i,this.height=i,this.radius=this.width/2}}},{key:`draw`,value:function(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width/2,this.top=n-this.height/2,this._drawRawCircle(e,t,n,a),this.updateBoundingBox(t,n),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,n,r,i)}},{key:`updateBoundingBox`,value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}},{key:`distanceToBorder`,value:function(e){return e&&this.resize(e),.5*this.width}}]),n}(eC);function rC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var iC=function(e){q(n,e);var t=rC(n);function n(e,r,i,a,o){var s;return B(this,n),(s=t.call(this,e,r,i)).setImages(a,o),s}return V(n,[{key:`resize`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){var r=2*this.options.size;this.width=r,this.height=r,this.radius=.5*this.width;return}this.needsRefresh(t,n)&&this._resizeImage()}},{key:`draw`,value:function(e,t,n,r,i,a){this.switchImages(r),this.resize();var o=t,s=n;this.options.shapeProperties.coordinateOrigin===`top-left`?(this.left=t,this.top=n,o+=this.width/2,s+=this.height/2):(this.left=t-this.width/2,this.top=n-this.height/2),this._drawRawCircle(e,o,s,a),e.save(),e.clip(),this._drawImageAtPosition(e,a),e.restore(),this._drawImageLabel(e,o,s,r,i),this.updateBoundingBox(t,n)}},{key:`updateBoundingBox`,value:function(e,t){this.options.shapeProperties.coordinateOrigin===`top-left`?(this.boundingBox.top=t,this.boundingBox.left=e,this.boundingBox.right=e+2*this.options.size,this.boundingBox.bottom=t+2*this.options.size):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}},{key:`distanceToBorder`,value:function(e){return e&&this.resize(e),.5*this.width}}]),n}(eC);function aC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var oC=function(e){q(n,e);var t=aC(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`resize`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,n)){this.labelModule.getTextSize(e,t,n);var i=2*r.size;this.width=this.customSizeWidth??i,this.height=this.customSizeHeight??i,this.radius=.5*this.width}}},{key:`_drawShape`,value:function(e,t,n,r,i,a,o,s){var c,l=this;return this.resize(e,a,o,s),this.left=r-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,s),(c=t,Object.prototype.hasOwnProperty.call(ai,c)?ai[c]:function(e){var t=[...arguments].slice(1);CanvasRenderingContext2D.prototype[c].call(e,t)})(e,r,i,s.size),this.performFill(e,s),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(a?`bold `:``)+this.height/2+`px `+(this.options.icon.face||`FontAwesome`),e.fillStyle=this.options.icon.color||`black`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(this.options.icon.code,r,i)),{drawExternalLabel:function(){if(l.options.label!==void 0){l.labelModule.calculateLabelSize(e,a,o,r,i,`hanging`);var t=i+.5*l.height+.5*l.labelModule.size.height;l.labelModule.draw(e,r,t,a,o,`hanging`)}l.updateBoundingBox(r,i)}}}},{key:`updateBoundingBox`,value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}]),n}(XS);function sC(e,t){var n=Ip(e);if(Sx){var r=Sx(e);t&&(r=oh(r).call(r,(function(t){return Mx(e,t).enumerable}))),n.push.apply(n,r)}return n}function cC(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?Qp(n=sC(Object(i),!0)).call(n,(function(t){Kx(e,t,i[t])})):Lx?Wx(e,Lx(i)):Qp(r=sC(Object(i))).call(r,(function(t){Gx(e,t,Mx(i,t))}))}return e}function lC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var uC=function(e){q(n,e);var t=lC(n);function n(e,r,i,a){var o;return B(this,n),(o=t.call(this,e,r,i,a)).ctxRenderer=a,o}return V(n,[{key:`draw`,value:function(e,t,n,r,i,a){this.resize(e,r,i,a),this.left=t-this.width/2,this.top=n-this.height/2,e.save();var o=this.ctxRenderer({ctx:e,id:this.options.id,x:t,y:n,state:{selected:r,hover:i},style:cC({},a),label:this.options.label});if(o.drawNode!=null&&o.drawNode(),e.restore(),o.drawExternalLabel){var s=o.drawExternalLabel;o.drawExternalLabel=function(){e.save(),s(),e.restore()}}return o.nodeDimensions&&(this.customSizeWidth=o.nodeDimensions.width,this.customSizeHeight=o.nodeDimensions.height),o}},{key:`distanceToBorder`,value:function(e,t){return this._distanceToBorder(e,t)}}]),n}(oC);function dC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var fC=function(e){q(n,e);var t=dC(n);function n(e,r,i){var a;return B(this,n),(a=t.call(this,e,r,i))._setMargins(i),a}return V(n,[{key:`resize`,value:function(e,t,n){if(this.needsRefresh(t,n)){var r=this.getDimensionsFromLabel(e,t,n).width+this.margin.right+this.margin.left;this.width=r,this.height=r,this.radius=this.width/2}}},{key:`draw`,value:function(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width/2,this.top=n-this.height/2,this.initContextForDraw(e,a),ri(e,t-this.width/2,n-this.height/2,this.width,this.height),this.performFill(e,a),this.updateBoundingBox(t,n,e,r,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,r,i)}},{key:`distanceToBorder`,value:function(e,t){return this._distanceToBorder(e,t)}}]),n}(XS);function pC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var mC=function(e){q(n,e);var t=pC(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`draw`,value:function(e,t,n,r,i,a){return this._drawShape(e,`diamond`,4,t,n,r,i,a)}},{key:`distanceToBorder`,value:function(e,t){return this._distanceToBorder(e,t)}}]),n}(oC);function hC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var gC=function(e){q(n,e);var t=hC(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`draw`,value:function(e,t,n,r,i,a){return this._drawShape(e,`circle`,2,t,n,r,i,a)}},{key:`distanceToBorder`,value:function(e){return e&&this.resize(e),this.options.size}}]),n}(oC);function _C(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var vC=function(e){q(n,e);var t=_C(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`resize`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,n)){var r=this.getDimensionsFromLabel(e,t,n);this.height=2*r.height,this.width=r.width+r.height,this.radius=.5*this.width}}},{key:`draw`,value:function(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-.5*this.width,this.top=n-.5*this.height,this.initContextForDraw(e,a),ni(e,this.left,this.top,this.width,this.height),this.performFill(e,a),this.updateBoundingBox(t,n,e,r,i),this.labelModule.draw(e,t,n,r,i)}},{key:`distanceToBorder`,value:function(e,t){e&&this.resize(e);var n=.5*this.width,r=.5*this.height,i=Math.sin(t)*n,a=Math.cos(t)*r;return n*r/Math.sqrt(i*i+a*a)}}]),n}(XS);function yC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var bC=function(e){q(n,e);var t=yC(n);function n(e,r,i){var a;return B(this,n),(a=t.call(this,e,r,i))._setMargins(i),a}return V(n,[{key:`resize`,value:function(e,t,n){this.needsRefresh(t,n)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:`draw`,value:function(e,t,n,r,i,a){var o=this;return this.resize(e,r,i),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=n-this.height/2,this._icon(e,t,n,r,i,a),{drawExternalLabel:function(){o.options.label!==void 0&&o.labelModule.draw(e,o.left+o.iconSize.width/2+o.margin.left,n+o.height/2+5,r),o.updateBoundingBox(t,n)}}}},{key:`updateBoundingBox`,value:function(e,t){this.boundingBox.top=t-.5*this.options.icon.size,this.boundingBox.left=e-.5*this.options.icon.size,this.boundingBox.right=e+.5*this.options.icon.size,this.boundingBox.bottom=t+.5*this.options.icon.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5))}},{key:`_icon`,value:function(e,t,n,r,i,a){var o=Number(this.options.icon.size);this.options.icon.code===void 0?console.error(`When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.`):(e.font=[this.options.icon.weight==null?r?`bold`:``:this.options.icon.weight,(this.options.icon.weight!=null&&r?5:0)+o+`px`,this.options.icon.face].join(` `),e.fillStyle=this.options.icon.color||`black`,e.textAlign=`center`,e.textBaseline=`middle`,this.enableShadow(e,a),e.fillText(this.options.icon.code,t,n),this.disableShadow(e,a))}},{key:`distanceToBorder`,value:function(e,t){return this._distanceToBorder(e,t)}}]),n}(XS);function xC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var SC=function(e){q(n,e);var t=xC(n);function n(e,r,i,a,o){var s;return B(this,n),(s=t.call(this,e,r,i)).setImages(a,o),s}return V(n,[{key:`resize`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){var r=2*this.options.size;this.width=r,this.height=r;return}this.needsRefresh(t,n)&&this._resizeImage()}},{key:`draw`,value:function(e,t,n,r,i,a){e.save(),this.switchImages(r),this.resize();var o=t,s=n;if(this.options.shapeProperties.coordinateOrigin===`top-left`?(this.left=t,this.top=n,o+=this.width/2,s+=this.height/2):(this.left=t-this.width/2,this.top=n-this.height/2),!0===this.options.shapeProperties.useBorderWithImage){var c=this.options.borderWidth,l=this.options.borderWidthSelected||2*this.options.borderWidth,u=(r?l:c)/this.body.view.scale;e.lineWidth=Math.min(this.width,u),e.beginPath();var d=r?this.options.color.highlight.border:i?this.options.color.hover.border:this.options.color.border,f=r?this.options.color.highlight.background:i?this.options.color.hover.background:this.options.color.background;a.opacity!==void 0&&(d=Nv(d,a.opacity),f=Nv(f,a.opacity)),e.strokeStyle=d,e.fillStyle=f,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),_g(e).call(e),this.performStroke(e,a),e.closePath()}this._drawImageAtPosition(e,a),this._drawImageLabel(e,o,s,r,i),this.updateBoundingBox(t,n),e.restore()}},{key:`updateBoundingBox`,value:function(e,t){this.resize(),this.options.shapeProperties.coordinateOrigin===`top-left`?(this.left=e,this.top=t):(this.left=e-this.width/2,this.top=t-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:`distanceToBorder`,value:function(e,t){return this._distanceToBorder(e,t)}}]),n}(eC);function CC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var wC=function(e){q(n,e);var t=CC(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`draw`,value:function(e,t,n,r,i,a){return this._drawShape(e,`square`,2,t,n,r,i,a)}},{key:`distanceToBorder`,value:function(e,t){return this._distanceToBorder(e,t)}}]),n}(oC);function TC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var EC=function(e){q(n,e);var t=TC(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`draw`,value:function(e,t,n,r,i,a){return this._drawShape(e,`hexagon`,4,t,n,r,i,a)}},{key:`distanceToBorder`,value:function(e,t){return this._distanceToBorder(e,t)}}]),n}(oC);function DC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var OC=function(e){q(n,e);var t=DC(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`draw`,value:function(e,t,n,r,i,a){return this._drawShape(e,`star`,4,t,n,r,i,a)}},{key:`distanceToBorder`,value:function(e,t){return this._distanceToBorder(e,t)}}]),n}(oC);function kC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var AC=function(e){q(n,e);var t=kC(n);function n(e,r,i){var a;return B(this,n),(a=t.call(this,e,r,i))._setMargins(i),a}return V(n,[{key:`resize`,value:function(e,t,n){this.needsRefresh(t,n)&&(this.textSize=this.labelModule.getTextSize(e,t,n),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:`draw`,value:function(e,t,n,r,i,a){this.resize(e,r,i),this.left=t-this.width/2,this.top=n-this.height/2,this.enableShadow(e,a),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,r,i),this.disableShadow(e,a),this.updateBoundingBox(t,n,e,r,i)}},{key:`distanceToBorder`,value:function(e,t){return this._distanceToBorder(e,t)}}]),n}(XS);function jC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var MC=function(e){q(n,e);var t=jC(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`draw`,value:function(e,t,n,r,i,a){return this._drawShape(e,`triangle`,3,t,n,r,i,a)}},{key:`distanceToBorder`,value:function(e,t){return this._distanceToBorder(e,t)}}]),n}(oC);function NC(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var PC=function(e){q(n,e);var t=NC(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`draw`,value:function(e,t,n,r,i,a){return this._drawShape(e,`triangleDown`,3,t,n,r,i,a)}},{key:`distanceToBorder`,value:function(e,t){return this._distanceToBorder(e,t)}}]),n}(oC);function FC(e,t){var n=Ip(e);if(Sx){var r=Sx(e);t&&(r=oh(r).call(r,(function(t){return Mx(e,t).enumerable}))),n.push.apply(n,r)}return n}function IC(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?Qp(n=FC(Object(i),!0)).call(n,(function(t){Kx(e,t,i[t])})):Lx?Wx(e,Lx(i)):Qp(r=FC(Object(i))).call(r,(function(t){Gx(e,t,Mx(i,t))}))}return e}var LC=function(){function e(t,n,r,i,a,o){B(this,e),this.options=Vv(a),this.globalOptions=a,this.defaultOptions=o,this.body=n,this.edges=[],this.id=void 0,this.imagelist=r,this.grouplist=i,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new ES(this.body,this.options,!1),this.setOptions(t)}return V(e,[{key:`attachEdge`,value:function(e){var t;H(t=this.edges).call(t,e)===-1&&this.edges.push(e)}},{key:`detachEdge`,value:function(e){var t,n,r=H(t=this.edges).call(t,e);r!=-1&&Om(n=this.edges).call(n,r,1)}},{key:`setOptions`,value:function(t){var n=this.options.shape;if(t){if(t.color!==void 0&&(this._localColor=t.color),t.id!==void 0&&(this.id=t.id),this.id===void 0)throw Error(`Node must have an id`);return e.checkMass(t,this.id),t.x!==void 0&&(t.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=Oh(t.x),this.predefinedPosition=!0)),t.y!==void 0&&(t.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=Oh(t.y),this.predefinedPosition=!0)),t.size!==void 0&&(this.baseSize=t.size),t.value!==void 0&&(t.value=rS(t.value)),e.parseOptions(this.options,t,!0,this.globalOptions,this.grouplist),this.chooser=lS(`node`,[t,this.options,this.defaultOptions]),this._load_images(),this.updateLabelModule(t),t.opacity!==void 0&&e.checkOpacity(t.opacity)&&(this.options.opacity=t.opacity),this.updateShape(n),t.hidden!==void 0||t.physics!==void 0}}},{key:`_load_images`,value:function(){if((this.options.shape===`circularImage`||this.options.shape===`image`)&&this.options.image===void 0)throw Error(`Option image must be defined for node type '`+this.options.shape+`'`);if(this.options.image!==void 0){if(this.imagelist===void 0)throw Error(`Internal Error: No images provided`);if(typeof this.options.image==`string`)this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(this.options.image.unselected===void 0)throw Error(`No unselected image provided`);this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),this.options.image.selected===void 0?this.imageObjAlt=void 0:this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id)}}}},{key:`getFormattingValues`,value:function(){var e={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?!0===this.chooser?this.selected?(this.options.borderWidthSelected==null?e.borderWidth*=2:e.borderWidth=this.options.borderWidthSelected,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser==`function`&&(this.chooser(e,this.options.id,this.selected,this.hover),!1===e.shadow&&(e.shadowColor===this.options.shadow.color&&e.shadowSize===this.options.shadow.size&&e.shadowX===this.options.shadow.x&&e.shadowY===this.options.shadow.y||(e.shadow=!0))):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){var t=this.options.opacity;e.borderColor=Nv(e.borderColor,t),e.color=Nv(e.color,t),e.shadowColor=Nv(e.shadowColor,t)}return e}},{key:`updateLabelModule`,value:function(t){this.options.label!==void 0&&this.options.label!==null||(this.options.label=``),e.updateGroupOptions(this.options,IC(IC({},t),{},{color:t&&t.color||this._localColor||void 0}),this.grouplist);var n=this.grouplist.get(this.options.group,!1),r=[t,this.options,n,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,r),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}},{key:`updateShape`,value:function(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case`box`:this.shape=new QS(this.options,this.body,this.labelModule);break;case`circle`:this.shape=new nC(this.options,this.body,this.labelModule);break;case`circularImage`:this.shape=new iC(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case`custom`:this.shape=new uC(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case`database`:this.shape=new fC(this.options,this.body,this.labelModule);break;case`diamond`:this.shape=new mC(this.options,this.body,this.labelModule);break;case`dot`:this.shape=new gC(this.options,this.body,this.labelModule);break;case`ellipse`:default:this.shape=new vC(this.options,this.body,this.labelModule);break;case`icon`:this.shape=new bC(this.options,this.body,this.labelModule);break;case`image`:this.shape=new SC(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case`square`:this.shape=new wC(this.options,this.body,this.labelModule);break;case`hexagon`:this.shape=new EC(this.options,this.body,this.labelModule);break;case`star`:this.shape=new OC(this.options,this.body,this.labelModule);break;case`text`:this.shape=new AC(this.options,this.body,this.labelModule);break;case`triangle`:this.shape=new MC(this.options,this.body,this.labelModule);break;case`triangleDown`:this.shape=new PC(this.options,this.body,this.labelModule)}this.needsRefresh()}},{key:`select`,value:function(){this.selected=!0,this.needsRefresh()}},{key:`unselect`,value:function(){this.selected=!1,this.needsRefresh()}},{key:`needsRefresh`,value:function(){this.shape.refreshNeeded=!0}},{key:`getTitle`,value:function(){return this.options.title}},{key:`distanceToBorder`,value:function(e,t){return this.shape.distanceToBorder(e,t)}},{key:`isFixed`,value:function(){return this.options.fixed.x&&this.options.fixed.y}},{key:`isSelected`,value:function(){return this.selected}},{key:`getValue`,value:function(){return this.options.value}},{key:`getLabelSize`,value:function(){return this.labelModule.size()}},{key:`setValueRange`,value:function(e,t,n){if(this.options.value!==void 0){var r=this.options.scaling.customScalingFunction(e,t,n,this.options.value),i=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var a=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+r*a}this.options.size=this.options.scaling.min+r*i}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}},{key:`draw`,value:function(e){var t=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)||{}}},{key:`updateBoundingBox`,value:function(e){this.shape.updateBoundingBox(this.x,this.y,e)}},{key:`resize`,value:function(e){var t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}},{key:`getItemsOnPoint`,value:function(e){var t=[];return this.labelModule.visible()&&uS(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),uS(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}},{key:`isOverlappingWith`,value:function(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}},{key:`isBoundingBoxOverlappingWith`,value:function(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}}],[{key:`checkOpacity`,value:function(e){return 0<=e&&e<=1}},{key:`checkCoordinateOrigin`,value:function(e){return e===void 0||e===`center`||e===`top-left`}},{key:`updateGroupOptions`,value:function(t,n,r){var i;if(r!==void 0){var a=t.group;if(n!==void 0&&n.group!==void 0&&a!==n.group)throw Error(`updateGroupOptions: group values in options don't match.`);if(typeof a==`number`||typeof a==`string`&&a!=``){var o=r.get(a);o.opacity!==void 0&&n.opacity===void 0&&(e.checkOpacity(o.opacity)||(console.error(`Invalid option for node opacity. Value must be between 0 and 1, found: `+o.opacity),o.opacity=void 0));var s=oh(i=cS(n)).call(i,(function(e){return n[e]!=null}));s.push(`font`),Ov(s,t,o),t.color=Fv(t.color)}}}},{key:`parseOptions`,value:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=arguments.length>4?arguments[4]:void 0;if(Ov([`color`,`fixed`,`shadow`],t,n,r),e.checkMass(n),t.opacity!==void 0&&(e.checkOpacity(t.opacity)||(console.error(`Invalid option for node opacity. Value must be between 0 and 1, found: `+t.opacity),t.opacity=void 0)),n.opacity!==void 0&&(e.checkOpacity(n.opacity)||(console.error(`Invalid option for node opacity. Value must be between 0 and 1, found: `+n.opacity),n.opacity=void 0)),n.shapeProperties&&!e.checkCoordinateOrigin(n.shapeProperties.coordinateOrigin)&&console.error(`Invalid option for node coordinateOrigin, found: `+n.shapeProperties.coordinateOrigin),Hv(t,n,`shadow`,i),n.color!==void 0&&n.color!==null){var o=Fv(n.color);Ev(t.color,o)}else !0===r&&n.color===null&&(t.color=Vv(i.color));n.fixed!==void 0&&n.fixed!==null&&(typeof n.fixed==`boolean`?(t.fixed.x=n.fixed,t.fixed.y=n.fixed):(n.fixed.x!==void 0&&typeof n.fixed.x==`boolean`&&(t.fixed.x=n.fixed.x),n.fixed.y!==void 0&&typeof n.fixed.y==`boolean`&&(t.fixed.y=n.fixed.y))),!0===r&&n.font===null&&(t.font=Vv(i.font)),e.updateGroupOptions(t,n,a),n.scaling!==void 0&&Hv(t.scaling,n.scaling,`label`,i.scaling)}},{key:`checkMass`,value:function(e,t){if(e.mass!==void 0&&e.mass<=0){var n=``;t!==void 0&&(n=` in node id: `+t),console.error(`%cNegative or zero mass disallowed`+n+`, setting mass to 1.`,iy),e.mass=1}}}]),e}();function RC(e,t){var n=mp!==void 0&&Sc(e)||e[`@@iterator`];if(!n){if(Dp(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return zC(e,t);var r=bp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return tc(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zC(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
36
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function zC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var BC=function(){function e(t,n,r,i){var a,o=this;if(B(this,e),this.body=t,this.images=n,this.groups=r,this.layoutEngine=i,this.body.functions.createNode=z(a=this.create).call(a,this),this.nodesListeners={add:function(e,t){o.add(t.items)},update:function(e,t){o.update(t.items,t.data,t.oldData)},remove:function(e,t){o.remove(t.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:`#2B7CE9`,background:`#97C2FC`,highlight:{border:`#2B7CE9`,background:`#D2E5FF`},hover:{border:`#2B7CE9`,background:`#D2E5FF`}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:`#343434`,size:14,face:`arial`,background:`none`,strokeWidth:0,strokeColor:`#ffffff`,align:`center`,vadjust:0,multi:!1,bold:{mod:`bold`},boldital:{mod:`bold italic`},ital:{mod:`italic`},mono:{mod:``,size:15,face:`monospace`,vadjust:2}},group:void 0,hidden:!1,icon:{face:`FontAwesome`,code:void 0,size:50,color:`#2B7CE9`},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,n,r){if(t===e)return .5;var i=1/(t-e);return Math.max(0,(r-e)*i)}},shadow:{enabled:!1,color:`rgba(0,0,0,0.5)`,size:10,x:5,y:5},shape:`ellipse`,shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:`center`},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw`Internal error: mass in defaultOptions of NodesHandler may not be zero or negative`;this.options=Vv(this.defaultOptions),this.bindEventListeners()}return V(e,[{key:`bindEventListeners`,value:function(){var e,t,n=this;this.body.emitter.on(`refreshNodes`,z(e=this.refresh).call(e,this)),this.body.emitter.on(`refresh`,z(t=this.refresh).call(t,this)),this.body.emitter.on(`destroy`,(function(){U(n.nodesListeners,(function(e,t){n.body.data.nodes&&n.body.data.nodes.off(t,e)})),delete n.body.functions.createNode,delete n.nodesListeners.add,delete n.nodesListeners.update,delete n.nodesListeners.remove,delete n.nodesListeners}))}},{key:`setOptions`,value:function(e){if(e!==void 0){if(LC.parseOptions(this.options,e),e.opacity!==void 0&&(px(e.opacity)||!hx(e.opacity)||e.opacity<0||e.opacity>1?console.error(`Invalid option for node opacity. Value must be between 0 and 1, found: `+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(var t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(e.font!==void 0||e.widthConstraint!==void 0||e.heightConstraint!==void 0)for(var n=0,r=Ip(this.body.nodes);n<r.length;n++){var i=r[n];this.body.nodes[i].updateLabelModule(),this.body.nodes[i].needsRefresh()}if(e.size!==void 0)for(var a in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,a)&&this.body.nodes[a].needsRefresh();e.hidden===void 0&&e.physics===void 0||this.body.emitter.emit(`_dataChanged`)}}},{key:`setData`,value:function(e){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=this.body.data.nodes;if(t.isDataViewLike(`id`,e))this.body.data.nodes=e;else if(Dp(e))this.body.data.nodes=new t.DataSet,this.body.data.nodes.add(e);else{if(e)throw TypeError(`Array or DataSet expected`);this.body.data.nodes=new t.DataSet}if(r&&U(this.nodesListeners,(function(e,t){r.off(t,e)})),this.body.nodes={},this.body.data.nodes){var i=this;U(this.nodesListeners,(function(e,t){i.body.data.nodes.on(t,e)}));var a=this.body.data.nodes.getIds();this.add(a,!0)}!1===n&&this.body.emitter.emit(`_dataChanged`)}},{key:`add`,value:function(e){for(var t,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=[],i=0;i<e.length;i++){t=e[i];var a=this.body.data.nodes.get(t),o=this.create(a);r.push(o),this.body.nodes[t]=o}this.layoutEngine.positionInitially(r),!1===n&&this.body.emitter.emit(`_dataChanged`)}},{key:`update`,value:function(e,t,n){for(var r=this.body.nodes,i=!1,a=0;a<e.length;a++){var o=e[a],s=r[o],c=t[a];s===void 0?(i=!0,s=this.create(c),r[o]=s):s.setOptions(c)&&(i=!0)}i||n===void 0||(i=xx(t).call(t,(function(e,t){var r=n[t];return r&&r.level!==e.level}))),!0===i?this.body.emitter.emit(`_dataChanged`):this.body.emitter.emit(`_dataUpdated`)}},{key:`remove`,value:function(e){for(var t=this.body.nodes,n=0;n<e.length;n++)delete t[e[n]];this.body.emitter.emit(`_dataChanged`)}},{key:`create`,value:function(e){return new(arguments.length>1&&arguments[1]!==void 0?arguments[1]:LC)(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:`refresh`,value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];U(this.body.nodes,(function(n,r){var i=e.body.data.nodes.get(r);i!==void 0&&(!0===t&&n.setOptions({x:null,y:null}),n.setOptions({fixed:!1}),n.setOptions(i))}))}},{key:`getPositions`,value:function(e){var t={};if(e!==void 0){if(!0===Dp(e)){for(var n=0;n<e.length;n++)if(this.body.nodes[e[n]]!==void 0){var r=this.body.nodes[e[n]];t[e[n]]={x:Math.round(r.x),y:Math.round(r.y)}}}else if(this.body.nodes[e]!==void 0){var i=this.body.nodes[e];t[e]={x:Math.round(i.x),y:Math.round(i.y)}}}else for(var a=0;a<this.body.nodeIndices.length;a++){var o=this.body.nodes[this.body.nodeIndices[a]];t[this.body.nodeIndices[a]]={x:Math.round(o.x),y:Math.round(o.y)}}return t}},{key:`getPosition`,value:function(e){if(e==null)throw TypeError(`No id was specified for getPosition method.`);if(this.body.nodes[e]==null)throw ReferenceError(`NodeId provided for getPosition does not exist. Provided: ${e}`);return{x:Math.round(this.body.nodes[e].x),y:Math.round(this.body.nodes[e].y)}}},{key:`storePositions`,value:function(){var e,t=[],n=this.body.data.nodes.getDataSet(),r=RC(n.get());try{for(r.s();!(e=r.n()).done;){var i=e.value,a=i.id,o=this.body.nodes[a],s=Math.round(o.x),c=Math.round(o.y);i.x===s&&i.y===c||t.push({id:a,x:s,y:c})}}catch(e){r.e(e)}finally{r.f()}n.update(t)}},{key:`getBoundingBox`,value:function(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}},{key:`getConnectedNodes`,value:function(e,t){var n=[];if(this.body.nodes[e]!==void 0)for(var r=this.body.nodes[e],i={},a=0;a<r.edges.length;a++){var o=r.edges[a];t!==`to`&&o.toId==r.id?i[o.fromId]===void 0&&(n.push(o.fromId),i[o.fromId]=!0):t!==`from`&&o.fromId==r.id&&i[o.toId]===void 0&&(n.push(o.toId),i[o.toId]=!0)}return n}},{key:`getConnectedEdges`,value:function(e){var t=[];if(this.body.nodes[e]!==void 0)for(var n=this.body.nodes[e],r=0;r<n.edges.length;r++)t.push(n.edges[r].id);else console.error(`NodeId provided for getConnectedEdges does not exist. Provided: `,e);return t}},{key:`moveNode`,value:function(e,t,n){var r=this;this.body.nodes[e]===void 0?console.error(`Node id supplied to moveNode does not exist. Provided: `,e):(this.body.nodes[e].x=Number(t),this.body.nodes[e].y=Number(n),cg((function(){r.body.emitter.emit(`startSimulation`)}),0))}}]),e}(),VC=gt,HC=ie,UC=Ce,WC=xn,GC=function(e){return e!==void 0&&(VC(e,`value`)||VC(e,`writable`))},KC=T,qC=Ra;I({target:`Reflect`,stat:!0},{get:function e(t,n){var r,i,a=arguments.length<3?t:arguments[2];return WC(t)===a?t[n]:(r=KC.f(t,n))?GC(r)?r.value:r.get===void 0?void 0:HC(r.get,a):UC(i=qC(t))?e(i,n,a):void 0}});var JC=r(j.Reflect.get),YC=r(jx);function XC(){var e;return XC=typeof Reflect<`u`&&JC?KS(e=JC).call(e):function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=J(e))!==null;);return e}(e,t);if(r){var i=YC(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},XC.apply(this,arguments)}var ZC=I,QC=Math.hypot,$C=Math.abs,ew=Math.sqrt;ZC({target:`Math`,stat:!0,arity:2,forced:!!QC&&QC(1/0,NaN)!==1/0},{hypot:function(e,t){for(var n,r,i=0,a=0,o=arguments.length,s=0;a<o;)s<(n=$C(arguments[a++]))?(i=i*(r=s/n)*r+1,s=n):i+=n>0?(r=n/s)*r:n;return s===1/0?1/0:s*ew(i)}});var tw=r(j.Math.hypot);function nw(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var rw=function(){function e(){B(this,e)}return V(e,null,[{key:`transform`,value:function(e,t){Dp(e)||(e=[e]);for(var n=t.point.x,r=t.point.y,i=t.angle,a=t.length,o=0;o<e.length;++o){var s=e[o],c=s.x*Math.cos(i)-s.y*Math.sin(i),l=s.x*Math.sin(i)+s.y*Math.cos(i);s.x=n+a*c,s.y=r+a*l}}},{key:`drawPath`,value:function(e,t){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(var n=1;n<t.length;++n)e.lineTo(t[n].x,t[n].y);e.closePath()}}]),e}(),iw=function(e){q(n,e);var t=nw(n);function n(){return B(this,n),t.apply(this,arguments)}return V(n,null,[{key:`draw`,value:function(e,t){if(t.image){e.save(),e.translate(t.point.x,t.point.y),e.rotate(Math.PI/2+t.angle);var n=t.imageWidth==null?t.image.width:t.imageWidth,r=t.imageHeight==null?t.image.height:t.imageHeight;t.image.drawImageAtPosition(e,1,-n/2,0,n,r),e.restore()}return!1}}]),n}(rw),aw=function(e){q(n,e);var t=nw(n);function n(){return B(this,n),t.apply(this,arguments)}return V(n,null,[{key:`draw`,value:function(e,t){var n=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return rw.transform(n,t),rw.drawPath(e,n),!0}}]),n}(rw),ow=function(){function e(){B(this,e)}return V(e,null,[{key:`draw`,value:function(e,t){var n=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return rw.transform(n,t),rw.drawPath(e,n),!0}}]),e}(),sw=function(){function e(){B(this,e)}return V(e,null,[{key:`draw`,value:function(e,t){var n={x:-.4,y:0};rw.transform(n,t),e.strokeStyle=e.fillStyle,e.fillStyle=`rgba(0, 0, 0, 0)`;var r=Math.PI,i=t.angle-r/2,a=t.angle+r/2;return e.beginPath(),e.arc(n.x,n.y,.4*t.length,i,a,!1),e.stroke(),!0}}]),e}(),cw=function(){function e(){B(this,e)}return V(e,null,[{key:`draw`,value:function(e,t){var n={x:-.3,y:0};rw.transform(n,t),e.strokeStyle=e.fillStyle,e.fillStyle=`rgba(0, 0, 0, 0)`;var r=Math.PI,i=t.angle+r/2,a=t.angle+3*r/2;return e.beginPath(),e.arc(n.x,n.y,.4*t.length,i,a,!1),e.stroke(),!0}}]),e}(),lw=function(){function e(){B(this,e)}return V(e,null,[{key:`draw`,value:function(e,t){var n=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return rw.transform(n,t),rw.drawPath(e,n),!0}}]),e}(),uw=function(){function e(){B(this,e)}return V(e,null,[{key:`draw`,value:function(e,t){var n=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return rw.transform(n,t),rw.drawPath(e,n),!0}}]),e}(),dw=function(){function e(){B(this,e)}return V(e,null,[{key:`draw`,value:function(e,t){var n={x:-.4,y:0};return rw.transform(n,t),ei(e,n.x,n.y,.4*t.length),!0}}]),e}(),fw=function(){function e(){B(this,e)}return V(e,null,[{key:`draw`,value:function(e,t){var n=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return rw.transform(n,t),rw.drawPath(e,n),!0}}]),e}(),pw=function(){function e(){B(this,e)}return V(e,null,[{key:`draw`,value:function(e,t){var n=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return rw.transform(n,t),rw.drawPath(e,n),!0}}]),e}(),mw=function(){function e(){B(this,e)}return V(e,null,[{key:`draw`,value:function(e,t){var n=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return rw.transform(n,t),rw.drawPath(e,n),!0}}]),e}(),hw=function(){function e(){B(this,e)}return V(e,null,[{key:`draw`,value:function(e,t){var n=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return rw.transform(n,t),rw.drawPath(e,n),!0}}]),e}(),gw=function(){function e(){B(this,e)}return V(e,null,[{key:`draw`,value:function(e,t){var n;switch(t.type&&(n=t.type.toLowerCase()),n){case`image`:return iw.draw(e,t);case`circle`:return dw.draw(e,t);case`box`:return pw.draw(e,t);case`crow`:return ow.draw(e,t);case`curve`:return sw.draw(e,t);case`diamond`:return mw.draw(e,t);case`inv_curve`:return cw.draw(e,t);case`triangle`:return lw.draw(e,t);case`inv_triangle`:return uw.draw(e,t);case`bar`:return fw.draw(e,t);case`vee`:return hw.draw(e,t);default:return aw.draw(e,t)}}}]),e}();function _w(e,t){var n=Ip(e);if(Sx){var r=Sx(e);t&&(r=oh(r).call(r,(function(t){return Mx(e,t).enumerable}))),n.push.apply(n,r)}return n}function vw(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?Qp(n=_w(Object(i),!0)).call(n,(function(t){Kx(e,t,i[t])})):Lx?Wx(e,Lx(i)):Qp(r=_w(Object(i))).call(r,(function(t){Gx(e,t,Mx(i,t))}))}return e}var yw=function(){function e(t,n,r){B(this,e),this._body=n,this._labelModule=r,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(t),this.fromPoint=this.from,this.toPoint=this.to}return V(e,[{key:`connect`,value:function(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}},{key:`cleanup`,value:function(){return!1}},{key:`setOptions`,value:function(e){this.options=e,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}},{key:`drawLine`,value:function(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,!1===t.dashes?this._drawLine(e,t,i):this._drawDashedLine(e,t,i)}},{key:`_drawLine`,value:function(e,t,n,r,i){if(this.from!=this.to)this._line(e,t,n,r,i);else{var a=fp(this._getCircleData(e),3),o=a[0],s=a[1],c=a[2];this._circle(e,t,o,s,c)}}},{key:`_drawDashedLine`,value:function(e,t,n,r,i){e.lineCap=`round`;var a=Dp(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(a),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,n);else{var o=fp(this._getCircleData(e),3),s=o[0],c=o[1],l=o[2];this._circle(e,t,s,c,l)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)ii(e,this.from.x,this.from.y,this.to.x,this.to.y,a);else{var u=fp(this._getCircleData(e),3),d=u[0],f=u[1],p=u[2];this._circle(e,t,d,f,p)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}},{key:`findBorderPosition`,value:function(e,t,n){return this.from==this.to?this._findBorderPositionCircle(e,t,n):this._findBorderPosition(e,t,n)}},{key:`findBorderPositions`,value:function(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};var t,n=fp(bp(t=this._getCircleData(e)).call(t,0,2),2),r=n[0],i=n[1];return{from:this._findBorderPositionCircle(this.from,e,{x:r,y:i,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:r,y:i,low:.6,high:.8,direction:1})}}},{key:`_getCircleData`,value:function(e){var t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);var n=fS(e,this.options.selfReference.angle,t,this.from);return[n.x,n.y,t]}},{key:`_pointOnCircle`,value:function(e,t,n,r){var i=2*r*Math.PI;return{x:e+n*Math.cos(i),y:t-n*Math.sin(i)}}},{key:`_findBorderPositionCircle`,value:function(e,t,n){var r,i=n.x,a=n.y,o=n.low,s=n.high,c=n.direction,l=this.options.selfReference.size,u=.5*(o+s),d=0;!0===this.options.arrowStrikethrough&&(c===-1?d=this.options.endPointOffset.from:c===1&&(d=this.options.endPointOffset.to));var f=0;do{u=.5*(o+s),r=this._pointOnCircle(i,a,l,u);var p=Math.atan2(e.y-r.y,e.x-r.x),m=e.distanceToBorder(t,p)+d-Math.sqrt((r.x-e.x)**2+(r.y-e.y)**2);if(Math.abs(m)<.05)break;m>0?c>0?o=u:s=u:c>0?s=u:o=u,++f}while(o<=s&&f<10);return vw(vw({},r),{},{t:u})}},{key:`getLineWidth`,value:function(e,t){return Math.max(!0===e?this.selectionWidth:!0===t?this.hoverWidth:this.options.width,.3/this._body.view.scale)}},{key:`getColor`,value:function(e,t){if(!1!==t.inheritsColor){if(t.inheritsColor===`both`&&this.from.id!==this.to.id){var n=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),r=this.from.options.color.highlight.border,i=this.to.options.color.highlight.border;return!1===this.from.selected&&!1===this.to.selected?(r=Nv(this.from.options.color.border,t.opacity),i=Nv(this.to.options.color.border,t.opacity)):!0===this.from.selected&&!1===this.to.selected?i=this.to.options.color.border:!1===this.from.selected&&!0===this.to.selected&&(r=this.from.options.color.border),n.addColorStop(0,r),n.addColorStop(1,i),n}return t.inheritsColor===`to`?Nv(this.to.options.color.border,t.opacity):Nv(this.from.options.color.border,t.opacity)}return Nv(t.color,t.opacity)}},{key:`_circle`,value:function(e,t,n,r,i){this.enableShadow(e,t);var a=0,o=2*Math.PI;if(!this.options.selfReference.renderBehindTheNode){var s=this.options.selfReference.angle,c=this.options.selfReference.angle+Math.PI,l=this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:s,high:c,direction:-1}),u=this._findBorderPositionCircle(this.from,e,{x:n,y:r,low:s,high:c,direction:1});a=Math.atan2(l.y-r,l.x-n),o=Math.atan2(u.y-r,u.x-n)}e.beginPath(),e.arc(n,r,i,a,o,!1),e.stroke(),this.disableShadow(e,t)}},{key:`getDistanceToEdge`,value:function(e,t,n,r,i,a){if(this.from!=this.to)return this._getDistanceToEdge(e,t,n,r,i,a);var o=fp(this._getCircleData(void 0),3),s=o[0],c=o[1],l=o[2],u=s-i,d=c-a;return Math.abs(Math.sqrt(u*u+d*d)-l)}},{key:`_getDistanceToLine`,value:function(e,t,n,r,i,a){var o=n-e,s=r-t,c=((i-e)*o+(a-t)*s)/(o*o+s*s);c>1?c=1:c<0&&(c=0);var l=e+c*o-i,u=t+c*s-a;return Math.sqrt(l*l+u*u)}},{key:`getArrowData`,value:function(e,t,n,r,i,a){var o,s,c,l,u,d,f,p=a.width;t===`from`?(c=this.from,l=this.to,u=a.fromArrowScale<0,d=Math.abs(a.fromArrowScale),f=a.fromArrowType):t===`to`?(c=this.to,l=this.from,u=a.toArrowScale<0,d=Math.abs(a.toArrowScale),f=a.toArrowType):(c=this.to,l=this.from,u=a.middleArrowScale<0,d=Math.abs(a.middleArrowScale),f=a.middleArrowType);var m=15*d+3*p;if(c!=l){var h=m/tw(c.x-l.x,c.y-l.y);if(t!==`middle`)if(!0===this.options.smooth.enabled){var g=this._findBorderPosition(c,e,{via:n}),_=this.getPoint(g.t+h*(t===`from`?1:-1),n);o=Math.atan2(g.y-_.y,g.x-_.x),s=g}else o=Math.atan2(c.y-l.y,c.x-l.x),s=this._findBorderPosition(c,e);else{var v=(u?-h:h)/2,y=this.getPoint(.5+v,n),b=this.getPoint(.5-v,n);o=Math.atan2(y.y-b.y,y.x-b.x),s=this.getPoint(.5,n)}}else{var x=fp(this._getCircleData(e),3),S=x[0],ee=x[1],C=x[2];if(t===`from`){var te=this.options.selfReference.angle,ne=this.options.selfReference.angle+Math.PI,re=this._findBorderPositionCircle(this.from,e,{x:S,y:ee,low:te,high:ne,direction:-1});o=-2*re.t*Math.PI+1.5*Math.PI+.1*Math.PI,s=re}else if(t===`to`){var w=this.options.selfReference.angle,T=this.options.selfReference.angle+Math.PI,E=this._findBorderPositionCircle(this.from,e,{x:S,y:ee,low:w,high:T,direction:1});o=-2*E.t*Math.PI+1.5*Math.PI-1.1*Math.PI,s=E}else{var D=this.options.selfReference.angle/(2*Math.PI);s=this._pointOnCircle(S,ee,C,D),o=-2*D*Math.PI+1.5*Math.PI+.1*Math.PI}}return{point:s,core:{x:s.x-.9*m*Math.cos(o),y:s.y-.9*m*Math.sin(o)},angle:o,length:m,type:f}}},{key:`drawArrowHead`,value:function(e,t,n,r,i){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,gw.draw(e,i)&&(this.enableShadow(e,t),_g(e).call(e),this.disableShadow(e,t))}},{key:`enableShadow`,value:function(e,t){!0===t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}},{key:`disableShadow`,value:function(e,t){!0===t.shadow&&(e.shadowColor=`rgba(0,0,0,0)`,e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:`drawBackground`,value:function(e,t){if(!1!==t.background){var n={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=n.strokeStyle,e.lineWidth=n.lineWidth,e.dashes=n.dashes,this.setStrokeDashed(e,t.dashes)}}},{key:`setStrokeDashed`,value:function(e,t){if(!1!==t)if(e.setLineDash!==void 0){var n=Dp(t)?t:[5,5];e.setLineDash(n)}else console.warn(`setLineDash is not supported in this browser. The dashed stroke cannot be used.`);else e.setLineDash===void 0?console.warn(`setLineDash is not supported in this browser. The dashed stroke cannot be used.`):e.setLineDash([])}}]),e}();function bw(e,t){var n=Ip(e);if(Sx){var r=Sx(e);t&&(r=oh(r).call(r,(function(t){return Mx(e,t).enumerable}))),n.push.apply(n,r)}return n}function xw(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?Qp(n=bw(Object(i),!0)).call(n,(function(t){Kx(e,t,i[t])})):Lx?Wx(e,Lx(i)):Qp(r=bw(Object(i))).call(r,(function(t){Gx(e,t,Mx(i,t))}))}return e}function Sw(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var Cw=function(e){q(n,e);var t=Sw(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`_findBorderPositionBezier`,value:function(e,t){var n,r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),a=!1,o=1,s=0,c=this.to,l=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(c=this.from,a=!0,l=this.options.endPointOffset?this.options.endPointOffset.from:0),!1===this.options.arrowStrikethrough&&(l=0);var u=0;do{r=.5*(s+o),n=this.getPoint(r,i);var d=Math.atan2(c.y-n.y,c.x-n.x),f=c.distanceToBorder(t,d)+l-Math.sqrt((n.x-c.x)**2+(n.y-c.y)**2);if(Math.abs(f)<.2)break;f<0?!1===a?s=r:o=r:!1===a?o=r:s=r,++u}while(s<=o&&u<10);return xw(xw({},n),{},{t:r})}},{key:`_getDistanceToBezierEdge`,value:function(e,t,n,r,i,a,o){var s,c,l,u,d,f=1e9,p=e,m=t;for(c=1;c<10;c++)l=.1*c,u=(1-l)**2*e+2*l*(1-l)*o.x+l**2*n,d=(1-l)**2*t+2*l*(1-l)*o.y+l**2*r,c>0&&(f=(s=this._getDistanceToLine(p,m,u,d,i,a))<f?s:f),p=u,m=d;return f}},{key:`_bezierCurve`,value:function(e,t,n,r){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),n!=null&&n.x!=null?r!=null&&r.x!=null?e.bezierCurveTo(n.x,n.y,r.x,r.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(n.x,n.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(e,t),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}},{key:`getViaNode`,value:function(){return this._getViaCoordinates()}}]),n}(yw);function ww(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var Tw=function(e){q(n,e);var t=ww(n);function n(e,r,i){var a;return B(this,n),(a=t.call(this,e,r,i)).via=a.via,a._boundFunction=function(){a.positionBezierNode()},a._body.emitter.on(`_repositionBezierNodes`,a._boundFunction),a}return V(n,[{key:`setOptions`,value:function(e){XC(J(n.prototype),`setOptions`,this).call(this,e);var t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),!0===t&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}},{key:`connect`,value:function(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||!1===this.options.physics||this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}},{key:`cleanup`,value:function(){return this._body.emitter.off(`_repositionBezierNodes`,this._boundFunction),this.via!==void 0&&(delete this._body.nodes[this.via.id],this.via=void 0,!0)}},{key:`setupSupportNode`,value:function(){if(this.via===void 0){var e=`edgeId:`+this.id,t=this._body.functions.createNode({id:e,shape:`circle`,physics:!0,hidden:!0});this._body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}},{key:`positionBezierNode`,value:function(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}},{key:`_line`,value:function(e,t,n){this._bezierCurve(e,t,n)}},{key:`_getViaCoordinates`,value:function(){return this.via}},{key:`getViaNode`,value:function(){return this.via}},{key:`getPoint`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){var n=fp(this._getCircleData(),3),r=n[0],i=n[1],a=n[2],o=2*Math.PI*(1-e);return{x:r+a*Math.sin(o),y:i+a-a*(1-Math.cos(o))}}return{x:(1-e)**2*this.fromPoint.x+2*e*(1-e)*t.x+e**2*this.toPoint.x,y:(1-e)**2*this.fromPoint.y+2*e*(1-e)*t.y+e**2*this.toPoint.y}}},{key:`_findBorderPosition`,value:function(e,t){return this._findBorderPositionBezier(e,t,this.via)}},{key:`_getDistanceToEdge`,value:function(e,t,n,r,i,a){return this._getDistanceToBezierEdge(e,t,n,r,i,a,this.via)}}]),n}(Cw);function Ew(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var Dw=function(e){q(n,e);var t=Ew(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`_line`,value:function(e,t,n){this._bezierCurve(e,t,n)}},{key:`getViaNode`,value:function(){return this._getViaCoordinates()}},{key:`_getViaCoordinates`,value:function(){var e,t,n=this.options.smooth.roundness,r=this.options.smooth.type,i=Math.abs(this.from.x-this.to.x),a=Math.abs(this.from.y-this.to.y);if(r===`discrete`||r===`diagonalCross`){var o=s=i<=a?n*a:n*i,s;this.from.x>this.to.x&&(o=-o),this.from.y>=this.to.y&&(s=-s);var c=this.from.x+o,l=this.from.y+s;return r===`discrete`&&(i<=a?c=i<n*a?this.from.x:c:l=a<n*i?this.from.y:l),{x:c,y:l}}if(r===`straightCross`){var u=(1-n)*i,d=(1-n)*a;return i<=a?(u=0,this.from.y<this.to.y&&(d=-d)):(this.from.x<this.to.x&&(u=-u),d=0),{x:this.to.x+u,y:this.to.y+d}}if(r===`horizontal`){var f=(1-n)*i;return this.from.x<this.to.x&&(f=-f),{x:this.to.x+f,y:this.from.y}}if(r===`vertical`){var p=(1-n)*a;return this.from.y<this.to.y&&(p=-p),{x:this.from.x,y:this.to.y+p}}if(r===`curvedCW`){i=this.to.x-this.from.x,a=this.from.y-this.to.y;var m=Math.sqrt(i*i+a*a),h=Math.PI,g=(Math.atan2(a,i)+(.5*n+.5)*h)%(2*h);return{x:this.from.x+(.5*n+.5)*m*Math.sin(g),y:this.from.y+(.5*n+.5)*m*Math.cos(g)}}if(r===`curvedCCW`){i=this.to.x-this.from.x,a=this.from.y-this.to.y;var _=Math.sqrt(i*i+a*a),v=Math.PI,y=(Math.atan2(a,i)+(.5*-n+.5)*v)%(2*v);return{x:this.from.x+(.5*n+.5)*_*Math.sin(y),y:this.from.y+(.5*n+.5)*_*Math.cos(y)}}e=t=i<=a?n*a:n*i,this.from.x>this.to.x&&(e=-e),this.from.y>=this.to.y&&(t=-t);var b=this.from.x+e,x=this.from.y+t;return i<=a?b=this.from.x<=this.to.x?this.to.x<b?this.to.x:b:this.to.x>b?this.to.x:b:x=this.from.y>=this.to.y?this.to.y>x?this.to.y:x:this.to.y<x?this.to.y:x,{x:b,y:x}}},{key:`_findBorderPosition`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,t,n.via)}},{key:`_getDistanceToEdge`,value:function(e,t,n,r,i,a){var o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,n,r,i,a,o)}},{key:`getPoint`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),n=e;return{x:(1-n)**2*this.fromPoint.x+2*n*(1-n)*t.x+n**2*this.toPoint.x,y:(1-n)**2*this.fromPoint.y+2*n*(1-n)*t.y+n**2*this.toPoint.y}}}]),n}(Cw);function Ow(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var kw=function(e){q(n,e);var t=Ow(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`_getDistanceToBezierEdge2`,value:function(e,t,n,r,i,a,o,s){for(var c=1e9,l=e,u=t,d=[0,0,0,0],f=1;f<10;f++){var p=.1*f;d[0]=(1-p)**3,d[1]=3*p*(1-p)**2,d[2]=3*p**2*(1-p),d[3]=p**3;var m=d[0]*e+d[1]*o.x+d[2]*s.x+d[3]*n,h=d[0]*t+d[1]*o.y+d[2]*s.y+d[3]*r;if(f>0){var g=this._getDistanceToLine(l,u,m,h,i,a);c=g<c?g:c}l=m,u=h}return c}}]),n}(Cw);function Aw(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var jw=function(e){q(n,e);var t=Aw(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`_line`,value:function(e,t,n){var r=n[0],i=n[1];this._bezierCurve(e,t,r,i)}},{key:`_getViaCoordinates`,value:function(){var e,t,n,r,i=this.from.x-this.to.x,a=this.from.y-this.to.y,o=this.options.smooth.roundness;return(Math.abs(i)>Math.abs(a)||!0===this.options.smooth.forceDirection||this.options.smooth.forceDirection===`horizontal`)&&this.options.smooth.forceDirection!==`vertical`?(t=this.from.y,r=this.to.y,e=this.from.x-o*i,n=this.to.x+o*i):(t=this.from.y-o*a,r=this.to.y+o*a,e=this.from.x,n=this.to.x),[{x:e,y:t},{x:n,y:r}]}},{key:`getViaNode`,value:function(){return this._getViaCoordinates()}},{key:`_findBorderPosition`,value:function(e,t){return this._findBorderPositionBezier(e,t)}},{key:`_getDistanceToEdge`,value:function(e,t,n,r,i,a){var o=fp(arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates(),2),s=o[0],c=o[1];return this._getDistanceToBezierEdge2(e,t,n,r,i,a,s,c)}},{key:`getPoint`,value:function(e){var t=fp(arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),2),n=t[0],r=t[1],i=e,a=[(1-i)**3,3*i*(1-i)**2,3*i**2*(1-i),i**3];return{x:a[0]*this.fromPoint.x+a[1]*n.x+a[2]*r.x+a[3]*this.toPoint.x,y:a[0]*this.fromPoint.y+a[1]*n.y+a[2]*r.y+a[3]*this.toPoint.y}}}]),n}(kw);function Mw(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var Nw=function(e){q(n,e);var t=Mw(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`_line`,value:function(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}},{key:`getViaNode`,value:function(){}},{key:`getPoint`,value:function(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}},{key:`_findBorderPosition`,value:function(e,t){var n=this.to,r=this.from;e.id===this.from.id&&(n=this.from,r=this.to);var i=Math.atan2(n.y-r.y,n.x-r.x),a=n.x-r.x,o=n.y-r.y,s=Math.sqrt(a*a+o*o),c=(s-e.distanceToBorder(t,i))/s;return{x:(1-c)*r.x+c*n.x,y:(1-c)*r.y+c*n.y,t:0}}},{key:`_getDistanceToEdge`,value:function(e,t,n,r,i,a){return this._getDistanceToLine(e,t,n,r,i,a)}}]),n}(yw),Pw=function(){function e(t,n,r,i,a){if(B(this,e),n===void 0)throw Error(`No body provided`);this.options=Vv(i),this.globalOptions=i,this.defaultOptions=a,this.body=n,this.imagelist=r,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new ES(this.body,this.options,!0),this.setOptions(t)}return V(e,[{key:`setOptions`,value:function(t){if(t){var n=t.physics!==void 0&&this.options.physics!==t.physics||t.hidden!==void 0&&(this.options.hidden||!1)!==(t.hidden||!1)||t.from!==void 0&&this.options.from!==t.from||t.to!==void 0&&this.options.to!==t.to;return e.parseOptions(this.options,t,!0,this.globalOptions),t.id!==void 0&&(this.id=t.id),t.from!==void 0&&(this.fromId=t.from),t.to!==void 0&&(this.toId=t.to),t.title!==void 0&&(this.title=t.title),t.value!==void 0&&(t.value=rS(t.value)),this.chooser=lS(`edge`,[t,this.options,this.defaultOptions]),this.updateLabelModule(t),n=this.updateEdgeType()||n,this._setInteractionWidths(),this.connect(),n}}},{key:`getFormattingValues`,value:function(){var e=!0===this.options.arrows.to||!0===this.options.arrows.to.enabled,t=!0===this.options.arrows.from||!0===this.options.arrows.from.enabled,n=!0===this.options.arrows.middle||!0===this.options.arrows.middle.enabled,r=this.options.color.inherit,i={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:n,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:r?void 0:this.options.color.color,inheritsColor:r,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(!0===this.chooser){if(this.selected){var a=this.options.selectionWidth;typeof a==`function`?i.width=a(i.width):typeof a==`number`&&(i.width+=a),i.width=Math.max(i.width,.3/this.body.view.scale),i.color=this.options.color.highlight,i.shadow=this.options.shadow.enabled}else if(this.hover){var o=this.options.hoverWidth;typeof o==`function`?i.width=o(i.width):typeof o==`number`&&(i.width+=o),i.width=Math.max(i.width,.3/this.body.view.scale),i.color=this.options.color.hover,i.shadow=this.options.shadow.enabled}}else typeof this.chooser==`function`&&(this.chooser(i,this.options.id,this.selected,this.hover),i.color!==void 0&&(i.inheritsColor=!1),!1===i.shadow&&(i.shadowColor===this.options.shadow.color&&i.shadowSize===this.options.shadow.size&&i.shadowX===this.options.shadow.x&&i.shadowY===this.options.shadow.y||(i.shadow=!0)));else i.shadow=this.options.shadow.enabled,i.width=Math.max(i.width,.3/this.body.view.scale);return i}},{key:`updateLabelModule`,value:function(e){var t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}},{key:`updateEdgeType`,value:function(){var e=this.options.smooth,t=!1,n=!0;return this.edgeType!==void 0&&((this.edgeType instanceof Tw&&!0===e.enabled&&e.type===`dynamic`||this.edgeType instanceof jw&&!0===e.enabled&&e.type===`cubicBezier`||this.edgeType instanceof Dw&&!0===e.enabled&&e.type!==`dynamic`&&e.type!==`cubicBezier`||this.edgeType instanceof Nw&&!1===e.type.enabled)&&(n=!1),!0===n&&(t=this.cleanup())),!0===n?!0===e.enabled?e.type===`dynamic`?(t=!0,this.edgeType=new Tw(this.options,this.body,this.labelModule)):e.type===`cubicBezier`?this.edgeType=new jw(this.options,this.body,this.labelModule):this.edgeType=new Dw(this.options,this.body,this.labelModule):this.edgeType=new Nw(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}},{key:`connect`,value:function(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,!0===this.connected?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{key:`disconnect`,value:function(){this.from&&=(this.from.detachEdge(this),void 0),this.to&&=(this.to.detachEdge(this),void 0),this.connected=!1}},{key:`getTitle`,value:function(){return this.title}},{key:`isSelected`,value:function(){return this.selected}},{key:`getValue`,value:function(){return this.options.value}},{key:`setValueRange`,value:function(e,t,n){if(this.options.value!==void 0){var r=this.options.scaling.customScalingFunction(e,t,n,this.options.value),i=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var a=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+r*a}this.options.width=this.options.scaling.min+r*i}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:`_setInteractionWidths`,value:function(){typeof this.options.hoverWidth==`function`?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth==`function`?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}},{key:`draw`,value:function(e){var t=this.getFormattingValues();if(!t.hidden){var n=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,n),this.drawLabel(e,n)}}},{key:`drawArrows`,value:function(e){var t=this.getFormattingValues();if(!t.hidden){var n=this.edgeType.getViaNode(),r={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(r.from=this.edgeType.getArrowData(e,`from`,n,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.fromPoint=r.from.core),t.fromArrowSrc&&(r.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(r.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(r.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(r.to=this.edgeType.getArrowData(e,`to`,n,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.toPoint=r.to.core),t.toArrowSrc&&(r.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(r.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(r.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(r.middle=this.edgeType.getArrowData(e,`middle`,n,this.selected,this.hover,t),t.middleArrowSrc&&(r.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(r.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(r.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,r.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,r.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,r.to)}}},{key:`drawLabel`,value:function(e,t){if(this.options.label!==void 0){var n,r=this.from,i=this.to;if(this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover),r.id!=i.id){this.labelModule.pointToSelf=!1,n=this.edgeType.getPoint(.5,t),e.save();var a=this._getRotation(e);a.angle!=0&&(e.translate(a.x,a.y),e.rotate(a.angle)),this.labelModule.draw(e,n.x,n.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;var o=fS(e,this.options.selfReference.angle,this.options.selfReference.size,r);n=this._pointOnCircle(o.x,o.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,n.x,n.y,this.selected,this.hover)}}}},{key:`getItemsOnPoint`,value:function(e){var t=[];if(this.labelModule.visible()){var n=this._getRotation();uS(this.labelModule.getSize(),e,n)&&t.push({edgeId:this.id,labelId:0})}var r={left:e.x,top:e.y};return this.isOverlappingWith(r)&&t.push({edgeId:this.id}),t}},{key:`isOverlappingWith`,value:function(e){if(this.connected){var t=this.from.x,n=this.from.y,r=this.to.x,i=this.to.y,a=e.left,o=e.top;return this.edgeType.getDistanceToEdge(t,n,r,i,a,o)<10}return!1}},{key:`_getRotation`,value:function(e){var t=this.edgeType.getViaNode(),n=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,n.x,n.y);var r={x:n.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align===`horizontal`)return r;var i=this.from.y-this.to.y,a=this.from.x-this.to.x,o=Math.atan2(i,a);return(o<-1&&a<0||o>0&&a<0)&&(o+=Math.PI),r.angle=o,r}},{key:`_pointOnCircle`,value:function(e,t,n,r){return{x:e+n*Math.cos(r),y:t-n*Math.sin(r)}}},{key:`select`,value:function(){this.selected=!0}},{key:`unselect`,value:function(){this.selected=!1}},{key:`cleanup`,value:function(){return this.edgeType.cleanup()}},{key:`remove`,value:function(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}},{key:`endPointsValid`,value:function(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}}],[{key:`parseOptions`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=arguments.length>4&&arguments[4]!==void 0&&arguments[4];if(Dv([`endPointOffset`,`arrowStrikethrough`,`id`,`from`,`hidden`,`hoverWidth`,`labelHighlightBold`,`length`,`line`,`opacity`,`physics`,`scaling`,`selectionWidth`,`selfReferenceSize`,`selfReference`,`to`,`title`,`value`,`width`,`font`,`chosen`,`widthConstraint`],e,t,n),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(hx(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=r.endPointOffset.from===void 0?0:r.endPointOffset.from,console.error(`endPointOffset.from is not a valid number`))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(hx(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=r.endPointOffset.to===void 0?0:r.endPointOffset.to,console.error(`endPointOffset.to is not a valid number`))),dS(t.label)?e.label=t.label:dS(e.label)||(e.label=void 0),Hv(e,t,`smooth`,r),Hv(e,t,`shadow`,r),Hv(e,t,`background`,r),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:!0===n&&t.dashes===null&&(e.dashes=Bh(r.dashes)),t.scaling!==void 0&&t.scaling!==null?(t.scaling.min!==void 0&&(e.scaling.min=t.scaling.min),t.scaling.max!==void 0&&(e.scaling.max=t.scaling.max),Hv(e.scaling,t.scaling,`label`,r.scaling)):!0===n&&t.scaling===null&&(e.scaling=Bh(r.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows==`string`){var a=t.arrows.toLowerCase();e.arrows.to.enabled=H(a).call(a,`to`)!=-1,e.arrows.middle.enabled=H(a).call(a,`middle`)!=-1,e.arrows.from.enabled=H(a).call(a,`from`)!=-1}else{if(Cf(t.arrows)!==`object`)throw Error(`The arrow newOptions can only be an object or a string. Refer to the documentation. You used:`+Uh(t.arrows));Hv(e.arrows,t.arrows,`to`,r.arrows),Hv(e.arrows,t.arrows,`middle`,r.arrows),Hv(e.arrows,t.arrows,`from`,r.arrows)}else !0===n&&t.arrows===null&&(e.arrows=Bh(r.arrows));if(t.color!==void 0&&t.color!==null){var o=Cv(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,s=e.color;if(i)kv(s,r.color,!1,n);else for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&delete s[c];if(Cv(s))s.color=s,s.highlight=s,s.hover=s,s.inherit=!1,o.opacity===void 0&&(s.opacity=1);else{var l=!1;o.color!==void 0&&(s.color=o.color,l=!0),o.highlight!==void 0&&(s.highlight=o.highlight,l=!0),o.hover!==void 0&&(s.hover=o.hover,l=!0),o.inherit!==void 0&&(s.inherit=o.inherit),o.opacity!==void 0&&(s.opacity=Math.min(1,Math.max(0,o.opacity))),!0===l?s.inherit=!1:s.inherit===void 0&&(s.inherit=`from`)}}else !0===n&&t.color===null&&(e.color=Vv(r.color));!0===n&&t.font===null&&(e.font=Vv(r.font)),Object.prototype.hasOwnProperty.call(t,`selfReferenceSize`)&&(console.warn(`The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}`),e.selfReference.size=t.selfReferenceSize)}}]),e}(),Fw=function(){function e(t,n,r){var i,a=this;B(this,e),this.body=t,this.images=n,this.groups=r,this.body.functions.createEdge=z(i=this.create).call(i,this),this.edgesListeners={add:function(e,t){a.add(t.items)},update:function(e,t){a.update(t.items)},remove:function(e,t){a.remove(t.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:`arrow`},middle:{enabled:!1,scaleFactor:1,type:`arrow`},from:{enabled:!1,scaleFactor:1,type:`arrow`}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:`#848484`,highlight:`#848484`,hover:`#848484`,inherit:`from`,opacity:1},dashes:!1,font:{color:`#343434`,size:14,face:`arial`,background:`none`,strokeWidth:2,strokeColor:`#ffffff`,align:`horizontal`,multi:!1,vadjust:0,bold:{mod:`bold`},boldital:{mod:`bold italic`},ital:{mod:`italic`},mono:{mod:``,size:15,face:`courier new`,vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,n,r){if(t===e)return .5;var i=1/(t-e);return Math.max(0,(r-e)*i)}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:`rgba(0,0,0,0.5)`,size:10,x:5,y:5},background:{enabled:!1,color:`rgba(111,111,111,1)`,size:10,dashes:!1},smooth:{enabled:!0,type:`dynamic`,forceDirection:`none`,roundness:.5},title:void 0,width:1,value:void 0},kv(this.options,this.defaultOptions),this.bindEventListeners()}return V(e,[{key:`bindEventListeners`,value:function(){var e,t,n=this;this.body.emitter.on(`_forceDisableDynamicCurves`,(function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];e===`dynamic`&&(e=`continuous`);var r=!1;for(var i in n.body.edges)if(Object.prototype.hasOwnProperty.call(n.body.edges,i)){var a=n.body.edges[i],o=n.body.data.edges.get(i);if(o!=null){var s=o.smooth;s!==void 0&&!0===s.enabled&&s.type===`dynamic`&&(e===void 0?a.setOptions({smooth:!1}):a.setOptions({smooth:{type:e}}),r=!0)}}!0===t&&!0===r&&n.body.emitter.emit(`_dataChanged`)})),this.body.emitter.on(`_dataUpdated`,(function(){n.reconnectEdges()})),this.body.emitter.on(`refreshEdges`,z(e=this.refresh).call(e,this)),this.body.emitter.on(`refresh`,z(t=this.refresh).call(t,this)),this.body.emitter.on(`destroy`,(function(){U(n.edgesListeners,(function(e,t){n.body.data.edges&&n.body.data.edges.off(t,e)})),delete n.body.functions.createEdge,delete n.edgesListeners.add,delete n.edgesListeners.update,delete n.edgesListeners.remove,delete n.edgesListeners}))}},{key:`setOptions`,value:function(e){if(e!==void 0){Pw.parseOptions(this.options,e,!0,this.defaultOptions,!0);var t=!1;if(e.smooth!==void 0)for(var n in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,n)&&(t=this.body.edges[n].updateEdgeType()||t);if(e.font!==void 0)for(var r in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,r)&&this.body.edges[r].updateLabelModule();e.hidden===void 0&&e.physics===void 0&&!0!==t||this.body.emitter.emit(`_dataChanged`)}}},{key:`setData`,value:function(e){var n=this,r=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=this.body.data.edges;if(t.isDataViewLike(`id`,e))this.body.data.edges=e;else if(Dp(e))this.body.data.edges=new t.DataSet,this.body.data.edges.add(e);else{if(e)throw TypeError(`Array or DataSet expected`);this.body.data.edges=new t.DataSet}if(i&&U(this.edgesListeners,(function(e,t){i.off(t,e)})),this.body.edges={},this.body.data.edges){U(this.edgesListeners,(function(e,t){n.body.data.edges.on(t,e)}));var a=this.body.data.edges.getIds();this.add(a,!0)}this.body.emitter.emit(`_adjustEdgesForHierarchicalLayout`),!1===r&&this.body.emitter.emit(`_dataChanged`)}},{key:`add`,value:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.body.edges,r=this.body.data.edges,i=0;i<e.length;i++){var a=e[i],o=n[a];o&&o.disconnect();var s=r.get(a,{showInternalIds:!0});n[a]=this.create(s)}this.body.emitter.emit(`_adjustEdgesForHierarchicalLayout`),!1===t&&this.body.emitter.emit(`_dataChanged`)}},{key:`update`,value:function(e){for(var t=this.body.edges,n=this.body.data.edges,r=!1,i=0;i<e.length;i++){var a=e[i],o=n.get(a),s=t[a];s===void 0?(this.body.edges[a]=this.create(o),r=!0):(s.disconnect(),r=s.setOptions(o)||r,s.connect())}!0===r?(this.body.emitter.emit(`_adjustEdgesForHierarchicalLayout`),this.body.emitter.emit(`_dataChanged`)):this.body.emitter.emit(`_dataUpdated`)}},{key:`remove`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(e.length!==0){var n=this.body.edges;U(e,(function(e){var t=n[e];t!==void 0&&t.remove()})),t&&this.body.emitter.emit(`_dataChanged`)}}},{key:`refresh`,value:function(){var e=this;U(this.body.edges,(function(t,n){var r=e.body.data.edges.get(n);r!==void 0&&t.setOptions(r)}))}},{key:`create`,value:function(e){return new Pw(e,this.body,this.images,this.options,this.defaultOptions)}},{key:`reconnectEdges`,value:function(){var e,t=this.body.nodes,n=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){var r=n[e];r.from=null,r.to=null,r.connect()}}},{key:`getConnectedNodes`,value:function(e){var t=[];if(this.body.edges[e]!==void 0){var n=this.body.edges[e];n.fromId!==void 0&&t.push(n.fromId),n.toId!==void 0&&t.push(n.toId)}return t}},{key:`_updateState`,value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:`_removeInvalidEdges`,value:function(){var e=this,t=[];U(this.body.edges,(function(n,r){var i=e.body.nodes[n.toId],a=e.body.nodes[n.fromId];i!==void 0&&!0===i.isCluster||a!==void 0&&!0===a.isCluster||i!==void 0&&a!==void 0||t.push(r)})),this.remove(t,!1)}},{key:`_addMissingEdges`,value:function(){var e=this.body.data.edges;if(e!=null){var t=this.body.edges,n=[];Qp(e).call(e,(function(e,r){t[r]===void 0&&n.push(r)})),this.add(n,!0)}}}]),e}(),Iw=function(){function e(t,n,r){B(this,e),this.body=t,this.physicsBody=n,this.barnesHutTree,this.setOptions(r),this._rng=hv(`BARNES HUT SOLVER`)}return V(e,[{key:`setOptions`,value:function(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:`solve`,value:function(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){var e,t=this.body.nodes,n=this.physicsBody.physicsNodeIndices,r=n.length,i=this._formBarnesHutTree(t,n);this.barnesHutTree=i;for(var a=0;a<r;a++)(e=t[n[a]]).options.mass>0&&this._getForceContributions(i.root,e)}}},{key:`_getForceContributions`,value:function(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}},{key:`_getForceContribution`,value:function(e,t){if(e.childrenCount>0){var n=e.centerOfMass.x-t.x,r=e.centerOfMass.y-t.y,i=Math.sqrt(n*n+r*r);i*e.calcSize>this.thetaInversed?this._calculateForces(i,n,r,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(i,n,r,t,e)}}},{key:`_calculateForces`,value:function(e,t,n,r,i){e===0&&(t=e=.1),this.overlapAvoidanceFactor<1&&r.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*r.shape.radius,e-r.shape.radius));var a=this.options.gravitationalConstant*i.mass*r.options.mass/e**3,o=t*a,s=n*a;this.physicsBody.forces[r.id].x+=o,this.physicsBody.forces[r.id].y+=s}},{key:`_formBarnesHutTree`,value:function(e,t){for(var n,r=t.length,i=e[t[0]].x,a=e[t[0]].y,o=e[t[0]].x,s=e[t[0]].y,c=1;c<r;c++){var l=e[t[c]],u=l.x,d=l.y;l.options.mass>0&&(u<i&&(i=u),u>o&&(o=u),d<a&&(a=d),d>s&&(s=d))}var f=Math.abs(o-i)-Math.abs(s-a);f>0?(a-=.5*f,s+=.5*f):(i+=.5*f,o-=.5*f);var p=Math.max(1e-5,Math.abs(o-i)),m=.5*p,h=.5*(i+o),g=.5*(a+s),_={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:h-m,maxX:h+m,minY:g-m,maxY:g+m},size:p,calcSize:1/p,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(_.root);for(var v=0;v<r;v++)(n=e[t[v]]).options.mass>0&&this._placeInTree(_.root,n);return _}},{key:`_updateBranchMass`,value:function(e,t){var n=e.centerOfMass,r=e.mass+t.options.mass,i=1/r;n.x=n.x*e.mass+t.x*t.options.mass,n.x*=i,n.y=n.y*e.mass+t.y*t.options.mass,n.y*=i,e.mass=r;var a=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<a?a:e.maxWidth}},{key:`_placeInTree`,value:function(e,t,n){n==1&&n!==void 0||this._updateBranchMass(e,t);var r,i=e.children.NW.range;r=i.maxX>t.x?i.maxY>t.y?`NW`:`SW`:i.maxY>t.y?`NE`:`SE`,this._placeInRegion(e,t,r)}},{key:`_placeInRegion`,value:function(e,t,n){var r=e.children[n];switch(r.childrenCount){case 0:r.children.data=t,r.childrenCount=1,this._updateBranchMass(r,t);break;case 1:r.children.data.x===t.x&&r.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(r),this._placeInTree(r,t));break;case 4:this._placeInTree(r,t)}}},{key:`_splitBranch`,value:function(e){var t=null;e.childrenCount===1&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,`NW`),this._insertRegion(e,`NE`),this._insertRegion(e,`SW`),this._insertRegion(e,`SE`),t!=null&&this._placeInTree(e,t)}},{key:`_insertRegion`,value:function(e,t){var n,r,i,a,o=.5*e.size;switch(t){case`NW`:n=e.range.minX,r=e.range.minX+o,i=e.range.minY,a=e.range.minY+o;break;case`NE`:n=e.range.minX+o,r=e.range.maxX,i=e.range.minY,a=e.range.minY+o;break;case`SW`:n=e.range.minX,r=e.range.minX+o,i=e.range.minY+o,a=e.range.maxY;break;case`SE`:n=e.range.minX+o,r=e.range.maxX,i=e.range.minY+o,a=e.range.maxY}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:n,maxX:r,minY:i,maxY:a},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:`_debug`,value:function(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}},{key:`_drawBranch`,value:function(e,t,n){n===void 0&&(n=`#FF0000`),e.childrenCount===4&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=n,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}]),e}(),Lw=function(){function e(t,n,r){B(this,e),this._rng=hv(`REPULSION SOLVER`),this.body=t,this.physicsBody=n,this.setOptions(r)}return V(e,[{key:`setOptions`,value:function(e){this.options=e}},{key:`solve`,value:function(){for(var e,t,n,r,i,a,o,s,c=this.body.nodes,l=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,d=this.options.nodeDistance,f=-2/3/d,p=0;p<l.length-1;p++){o=c[l[p]];for(var m=p+1;m<l.length;m++)e=(s=c[l[m]]).x-o.x,t=s.y-o.y,(n=Math.sqrt(e*e+t*t))===0&&(e=n=.1*this._rng()),n<2*d&&(a=n<.5*d?1:f*n+1.3333333333333333,r=e*(a/=n),i=t*a,u[o.id].x-=r,u[o.id].y-=i,u[s.id].x+=r,u[s.id].y+=i)}}}]),e}(),Rw=function(){function e(t,n,r){B(this,e),this.body=t,this.physicsBody=n,this.setOptions(r)}return V(e,[{key:`setOptions`,value:function(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}},{key:`solve`,value:function(){for(var e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,n=this.physicsBody.forces,r=this.options.nodeDistance,i=0;i<t.length-1;i++)for(var a=e[t[i]],o=i+1;o<t.length;o++){var s=e[t[o]];if(a.level===s.level){var c=r+this.overlapAvoidanceFactor*((a.shape.radius||0)/2+(s.shape.radius||0)/2),l=s.x-a.x,u=s.y-a.y,d=Math.sqrt(l*l+u*u),f=void 0;f=d<c?-((.05*d)**2)+(.05*c)**2:0,d!==0&&(f/=d);var p=l*f,m=u*f;n[a.id].x-=p,n[a.id].y-=m,n[s.id].x+=p,n[s.id].y+=m}}}}]),e}(),zw=function(){function e(t,n,r){B(this,e),this.body=t,this.physicsBody=n,this.setOptions(r)}return V(e,[{key:`setOptions`,value:function(e){this.options=e}},{key:`solve`,value:function(){for(var e,t,n,r,i,a=this.physicsBody.physicsEdgeIndices,o=this.body.edges,s=0;s<a.length;s++)!0===(t=o[a[s]]).connected&&t.toId!==t.fromId&&this.body.nodes[t.toId]!==void 0&&this.body.nodes[t.fromId]!==void 0&&(t.edgeType.via===void 0?(e=t.options.length===void 0?1.5*this.options.springLength:t.options.length,this._calculateSpringForce(t.from,t.to,e)):(e=t.options.length===void 0?this.options.springLength:t.options.length,n=t.to,r=t.edgeType.via,i=t.from,this._calculateSpringForce(n,r,.5*e),this._calculateSpringForce(r,i,.5*e)))}},{key:`_calculateSpringForce`,value:function(e,t,n){var r=e.x-t.x,i=e.y-t.y,a=Math.max(Math.sqrt(r*r+i*i),.01),o=this.options.springConstant*(n-a)/a,s=r*o,c=i*o;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=s,this.physicsBody.forces[e.id].y+=c),this.physicsBody.forces[t.id]!==void 0&&(this.physicsBody.forces[t.id].x-=s,this.physicsBody.forces[t.id].y-=c)}}]),e}(),Bw=function(){function e(t,n,r){B(this,e),this.body=t,this.physicsBody=n,this.setOptions(r)}return V(e,[{key:`setOptions`,value:function(e){this.options=e}},{key:`solve`,value:function(){for(var e,t,n,r,i,a,o,s,c,l,u=this.body.edges,d=.5,f=this.physicsBody.physicsEdgeIndices,p=this.physicsBody.physicsNodeIndices,m=this.physicsBody.forces,h=0;h<p.length;h++){var g=p[h];m[g].springFx=0,m[g].springFy=0}for(var _=0;_<f.length;_++)!0===(t=u[f[_]]).connected&&(e=t.options.length===void 0?this.options.springLength:t.options.length,n=t.from.x-t.to.x,r=t.from.y-t.to.y,s=(s=Math.sqrt(n*n+r*r))===0?.01:s,i=n*(o=this.options.springConstant*(e-s)/s),a=r*o,t.to.level==t.from.level?(m[t.toId]!==void 0&&(m[t.toId].x-=d*i,m[t.toId].y-=d*a),m[t.fromId]!==void 0&&(m[t.fromId].x+=d*i,m[t.fromId].y+=d*a)):(m[t.toId]!==void 0&&(m[t.toId].springFx-=i,m[t.toId].springFy-=a),m[t.fromId]!==void 0&&(m[t.fromId].springFx+=i,m[t.fromId].springFy+=a)));o=1;for(var v=0;v<p.length;v++){var y=p[v];c=Math.min(o,Math.max(-o,m[y].springFx)),l=Math.min(o,Math.max(-o,m[y].springFy)),m[y].x+=c,m[y].y+=l}for(var b=0,x=0,S=0;S<p.length;S++){var ee=p[S];b+=m[ee].x,x+=m[ee].y}for(var C=b/p.length,te=x/p.length,ne=0;ne<p.length;ne++){var re=p[ne];m[re].x-=C,m[re].y-=te}}}]),e}(),Vw=function(){function e(t,n,r){B(this,e),this.body=t,this.physicsBody=n,this.setOptions(r)}return V(e,[{key:`setOptions`,value:function(e){this.options=e}},{key:`solve`,value:function(){for(var e,t,n,r,i=this.body.nodes,a=this.physicsBody.physicsNodeIndices,o=this.physicsBody.forces,s=0;s<a.length;s++)e=-(r=i[a[s]]).x,t=-r.y,n=Math.sqrt(e*e+t*t),this._calculateForces(n,e,t,o,r)}},{key:`_calculateForces`,value:function(e,t,n,r,i){var a=e===0?0:this.options.centralGravity/e;r[i.id].x=t*a,r[i.id].y=n*a}}]),e}();function Hw(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var Uw=function(e){q(n,e);var t=Hw(n);function n(e,r,i){var a;return B(this,n),(a=t.call(this,e,r,i))._rng=hv(`FORCE ATLAS 2 BASED REPULSION SOLVER`),a}return V(n,[{key:`_calculateForces`,value:function(e,t,n,r,i){e===0&&(t=e=.1*this._rng()),this.overlapAvoidanceFactor<1&&r.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*r.shape.radius,e-r.shape.radius));var a=r.edges.length+1,o=this.options.gravitationalConstant*i.mass*r.options.mass*a/e**2,s=t*o,c=n*o;this.physicsBody.forces[r.id].x+=s,this.physicsBody.forces[r.id].y+=c}}]),n}(Iw);function Ww(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var Gw=function(e){q(n,e);var t=Ww(n);function n(e,r,i){return B(this,n),t.call(this,e,r,i)}return V(n,[{key:`_calculateForces`,value:function(e,t,n,r,i){if(e>0){var a=i.edges.length+1,o=this.options.centralGravity*a*i.options.mass;r[i.id].x=t*o,r[i.id].y=n*o}}}]),n}(Vw),Kw=function(){function e(t){B(this,e),this.body=t,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:`barnesHut`,stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},Nr(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return V(e,[{key:`bindEventListeners`,value:function(){var e=this;this.body.emitter.on(`initPhysics`,(function(){e.initPhysics()})),this.body.emitter.on(`_layoutFailed`,(function(){e.layoutFailed=!0})),this.body.emitter.on(`resetPhysics`,(function(){e.stopSimulation(),e.ready=!1})),this.body.emitter.on(`disablePhysics`,(function(){e.physicsEnabled=!1,e.stopSimulation()})),this.body.emitter.on(`restorePhysics`,(function(){e.setOptions(e.options),!0===e.ready&&e.startSimulation()})),this.body.emitter.on(`startSimulation`,(function(){!0===e.ready&&e.startSimulation()})),this.body.emitter.on(`stopSimulation`,(function(){e.stopSimulation()})),this.body.emitter.on(`destroy`,(function(){e.stopSimulation(!1),e.body.emitter.off()})),this.body.emitter.on(`_dataChanged`,(function(){e.updatePhysicsData()}))}},{key:`setOptions`,value:function(e){if(e!==void 0)if(!1===e)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(!0===e)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,Ov([`stabilization`],this.options,e),Hv(this.options,e,`stabilization`),e.enabled===void 0&&(this.options.enabled=!0),!1===this.options.enabled&&(this.physicsEnabled=!1,this.stopSimulation());var t=this.options.wind;t&&((typeof t.x!=`number`||px(t.x))&&(t.x=0),(typeof t.y!=`number`||px(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}},{key:`init`,value:function(){var e;this.options.solver===`forceAtlas2Based`?(e=this.options.forceAtlas2Based,this.nodesSolver=new Uw(this.body,this.physicsBody,e),this.edgesSolver=new zw(this.body,this.physicsBody,e),this.gravitySolver=new Gw(this.body,this.physicsBody,e)):this.options.solver===`repulsion`?(e=this.options.repulsion,this.nodesSolver=new Lw(this.body,this.physicsBody,e),this.edgesSolver=new zw(this.body,this.physicsBody,e),this.gravitySolver=new Vw(this.body,this.physicsBody,e)):this.options.solver===`hierarchicalRepulsion`?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new Rw(this.body,this.physicsBody,e),this.edgesSolver=new Bw(this.body,this.physicsBody,e),this.gravitySolver=new Vw(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new Iw(this.body,this.physicsBody,e),this.edgesSolver=new zw(this.body,this.physicsBody,e),this.gravitySolver=new Vw(this.body,this.physicsBody,e)),this.modelOptions=e}},{key:`initPhysics`,value:function(){!0===this.physicsEnabled&&!0===this.options.enabled?!0===this.options.stabilization.enabled?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit(`fit`,{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit(`fit`))}},{key:`startSimulation`,value:function(){var e;!0===this.physicsEnabled&&!0===this.options.enabled?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit(`_resizeNodes`),this.viewFunction===void 0&&(this.viewFunction=z(e=this.simulationStep).call(e,this),this.body.emitter.on(`initRedraw`,this.viewFunction),this.body.emitter.emit(`_startRendering`))):this.body.emitter.emit(`_redraw`)}},{key:`stopSimulation`,value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.stabilized=!0,!0===e&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off(`initRedraw`,this.viewFunction),this.viewFunction=void 0,!0===e&&this.body.emitter.emit(`_stopRendering`))}},{key:`simulationStep`,value:function(){var e=Bp();this.physicsTick(),(Bp()-e<.4*this.simulationInterval||!0===this.runDoubleSpeed)&&!1===this.stabilized&&(this.physicsTick(),this.runDoubleSpeed=!0),!0===this.stabilized&&this.stopSimulation()}},{key:`_emitStabilized`,value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||!0===this.startedStabilization)&&cg((function(){e.body.emitter.emit(`stabilized`,{iterations:t}),e.startedStabilization=!1,e.stabilizationIterations=0}),0)}},{key:`physicsStep`,value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:`adjustTimeStep`,value:function(){!0===this._evaluateStepQuality()?this.timestep=1.2*this.timestep:this.timestep/1.2<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/1.2))}},{key:`physicsTick`,value:function(){this._startStabilizing(),!0!==this.stabilized&&(!0===this.adaptiveTimestep&&!0===this.adaptiveTimestepEnabled?(this.adaptiveCounter%this.adaptiveInterval==0?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1):(this.timestep=this.options.timestep,this.physicsStep()),!0===this.stabilized&&this.revert(),this.stabilizationIterations++)}},{key:`updatePhysicsData`,value:function(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];var e=this.body.nodes,t=this.body.edges;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&!0===e[n].options.physics&&this.physicsBody.physicsNodeIndices.push(e[n].id);for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&!0===t[r].options.physics&&this.physicsBody.physicsEdgeIndices.push(t[r].id);for(var i=0;i<this.physicsBody.physicsNodeIndices.length;i++){var a=this.physicsBody.physicsNodeIndices[i];this.physicsBody.forces[a]={x:0,y:0},this.physicsBody.velocities[a]===void 0&&(this.physicsBody.velocities[a]={x:0,y:0})}for(var o in this.physicsBody.velocities)e[o]===void 0&&delete this.physicsBody.velocities[o]}},{key:`revert`,value:function(){var e=Ip(this.previousStates),t=this.body.nodes,n=this.physicsBody.velocities;this.referenceState={};for(var r=0;r<e.length;r++){var i=e[r];t[i]===void 0?delete this.previousStates[i]:!0===t[i].options.physics&&(this.referenceState[i]={positions:{x:t[i].x,y:t[i].y}},n[i].x=this.previousStates[i].vx,n[i].y=this.previousStates[i].vy,t[i].x=this.previousStates[i].x,t[i].y=this.previousStates[i].y)}}},{key:`_evaluateStepQuality`,value:function(){var e,t,n=this.body.nodes,r=this.referenceState;for(var i in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,i)&&n[i]!==void 0&&(e=n[i].x-r[i].positions.x,t=n[i].y-r[i].positions.y,Math.sqrt(e**2+t**2)>.3))return!1;return!0}},{key:`moveNodes`,value:function(){for(var e=this.physicsBody.physicsNodeIndices,t=0,n=0,r=0;r<e.length;r++){var i=e[r],a=this._performStep(i);t=Math.max(t,a),n+=a}this.adaptiveTimestepEnabled=n/e.length<5,this.stabilized=t<this.options.minVelocity}},{key:`calculateComponentVelocity`,value:function(e,t,n){e+=(t-this.modelOptions.damping*e)/n*this.timestep;var r=this.options.maxVelocity||1e9;return Math.abs(e)>r&&(e=e>0?r:-r),e}},{key:`_performStep`,value:function(e){var t=this.body.nodes[e],n=this.physicsBody.forces[e];this.options.wind&&(n.x+=this.options.wind.x,n.y+=this.options.wind.y);var r=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:r.x,vy:r.y},!1===t.options.fixed.x?(r.x=this.calculateComponentVelocity(r.x,n.x,t.options.mass),t.x+=r.x*this.timestep):(n.x=0,r.x=0),!1===t.options.fixed.y?(r.y=this.calculateComponentVelocity(r.y,n.y,t.options.mass),t.y+=r.y*this.timestep):(n.y=0,r.y=0),Math.sqrt(r.x**2+r.y**2)}},{key:`_freezeNodes`,value:function(){var e=this.body.nodes;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){var n=e[t].options.fixed;this.freezeCache[t]={x:n.x,y:n.y},n.x=!0,n.y=!0}}},{key:`_restoreFrozenNodes`,value:function(){var e=this.body.nodes;for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.freezeCache[t]!==void 0&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}},{key:`stabilize`,value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;typeof t!=`number`&&(t=this.options.stabilization.iterations,console.error(`The stabilize method needs a numeric amount of iterations. Switching to default: `,t)),this.physicsBody.physicsNodeIndices.length===0?this.ready=!0:(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit(`_resizeNodes`),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit(`_blockRedraw`),this.targetIterations=t,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,cg((function(){return e._stabilizationBatch()}),0))}},{key:`_startStabilizing`,value:function(){return!0!==this.startedStabilization&&(this.body.emitter.emit(`startStabilizing`),this.startedStabilization=!0,!0)}},{key:`_stabilizationBatch`,value:function(){var e=this,t=function(){return!1===e.stabilized&&e.stabilizationIterations<e.targetIterations},n=function(){e.body.emitter.emit(`stabilizationProgress`,{iterations:e.stabilizationIterations,total:e.targetIterations})};this._startStabilizing()&&n();for(var r,i=0;t()&&i<this.options.stabilization.updateInterval;)this.physicsTick(),i++;n(),t()?cg(z(r=this._stabilizationBatch).call(r,this),0):this._finalizeStabilization()}},{key:`_finalizeStabilization`,value:function(){this.body.emitter.emit(`_allowRedraw`),!0===this.options.stabilization.fit&&this.body.emitter.emit(`fit`),!0===this.options.stabilization.onlyDynamicEdges&&this._restoreFrozenNodes(),this.body.emitter.emit(`stabilizationIterationsDone`),this.body.emitter.emit(`_requestRedraw`),!0===this.stabilized?this._emitStabilized():this.startSimulation(),this.ready=!0}},{key:`_drawForces`,value:function(e){for(var t=0;t<this.physicsBody.physicsNodeIndices.length;t++){var n=this.physicsBody.physicsNodeIndices[t],r=this.body.nodes[n],i=this.physicsBody.forces[n],a=Math.sqrt(i.x**2+i.x**2),o=Math.min(Math.max(5,a),15),s=3*o,c=Rv((180-180*Math.min(1,Math.max(0,.03*a)))/360,1,1),l={x:r.x+20*i.x,y:r.y+20*i.y};e.lineWidth=o,e.strokeStyle=c,e.beginPath(),e.moveTo(r.x,r.y),e.lineTo(l.x,l.y),e.stroke();var u=Math.atan2(i.y,i.x);e.fillStyle=c,gw.draw(e,{type:`arrow`,point:l,angle:u,length:s}),_g(e).call(e)}}}]),e}();let qw,Jw=new Uint8Array(16);function Yw(){if(!qw&&(qw=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qw))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return qw(Jw)}let Xw=[];for(let e=0;e<256;++e)Xw.push((e+256).toString(16).slice(1));var Zw={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Qw(e,t,n){if(Zw.randomUUID&&!t&&!e)return Zw.randomUUID();let r=(e||={}).random||(e.rng||Yw)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n||=0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return Xw[e[t+0]]+Xw[e[t+1]]+Xw[e[t+2]]+Xw[e[t+3]]+`-`+Xw[e[t+4]]+Xw[e[t+5]]+`-`+Xw[e[t+6]]+Xw[e[t+7]]+`-`+Xw[e[t+8]]+Xw[e[t+9]]+`-`+Xw[e[t+10]]+Xw[e[t+11]]+Xw[e[t+12]]+Xw[e[t+13]]+Xw[e[t+14]]+Xw[e[t+15]]}(r)}var $w=function(){function e(){B(this,e)}return V(e,null,[{key:`getRange`,value:function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=1e9,i=-1e9,a=1e9,o=-1e9;if(n.length>0)for(var s=0;s<n.length;s++)a>(t=e[n[s]]).shape.boundingBox.left&&(a=t.shape.boundingBox.left),o<t.shape.boundingBox.right&&(o=t.shape.boundingBox.right),r>t.shape.boundingBox.top&&(r=t.shape.boundingBox.top),i<t.shape.boundingBox.bottom&&(i=t.shape.boundingBox.bottom);return a===1e9&&o===-1e9&&r===1e9&&i===-1e9&&(r=0,i=0,a=0,o=0),{minX:a,maxX:o,minY:r,maxY:i}}},{key:`getRangeCore`,value:function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=1e9,i=-1e9,a=1e9,o=-1e9;if(n.length>0)for(var s=0;s<n.length;s++)a>(t=e[n[s]]).x&&(a=t.x),o<t.x&&(o=t.x),r>t.y&&(r=t.y),i<t.y&&(i=t.y);return a===1e9&&o===-1e9&&r===1e9&&i===-1e9&&(r=0,i=0,a=0,o=0),{minX:a,maxX:o,minY:r,maxY:i}}},{key:`findCenter`,value:function(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}},{key:`cloneOptions`,value:function(e,t){var n={};return t===void 0||t===`node`?(kv(n,e.options,!0),n.x=e.x,n.y=e.y,n.amountOfConnections=e.edges.length):kv(n,e.options,!0),n}}]),e}();function eT(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var tT=function(e){q(n,e);var t=eT(n);function n(e,r,i,a,o,s){var c;return B(this,n),(c=t.call(this,e,r,i,a,o,s)).isCluster=!0,c.containedNodes={},c.containedEdges={},c}return V(n,[{key:`_openChildCluster`,value:function(e){var t=this,n=this.body.nodes[e];if(this.containedNodes[e]===void 0)throw Error(`node with id: `+e+` not in current cluster`);if(!n.isCluster)throw Error(`node with id: `+e+` is not a cluster`);delete this.containedNodes[e],U(n.edges,(function(e){delete t.containedEdges[e.id]})),U(n.containedNodes,(function(e,n){t.containedNodes[n]=e})),n.containedNodes={},U(n.containedEdges,(function(e,n){t.containedEdges[n]=e})),n.containedEdges={},U(n.edges,(function(e){U(t.edges,(function(n){var r,i,a=H(r=n.clusteringEdgeReplacingIds).call(r,e.id);a!==-1&&(U(e.clusteringEdgeReplacingIds,(function(e){n.clusteringEdgeReplacingIds.push(e),t.body.edges[e].edgeReplacedById=n.id})),Om(i=n.clusteringEdgeReplacingIds).call(i,a,1))}))})),n.edges=[]}}]),n}(LC),nT=function(){function e(t){var n=this;B(this,e),this.body=t,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},Nr(this.options,this.defaultOptions),this.body.emitter.on(`_resetData`,(function(){n.clusteredNodes={},n.clusteredEdges={}}))}return V(e,[{key:`clusterByHubsize`,value:function(e,t){e===void 0?e=this._getHubSize():Cf(e)===`object`&&(t=this._checkOptions(e),e=this._getHubSize());for(var n=[],r=0;r<this.body.nodeIndices.length;r++){var i=this.body.nodes[this.body.nodeIndices[r]];i.edges.length>=e&&n.push(i.id)}for(var a=0;a<n.length;a++)this.clusterByConnection(n[a],t,!0);this.body.emitter.emit(`_dataChanged`)}},{key:`cluster`,value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(t.joinCondition===void 0)throw Error(`Cannot call clusterByNodeData without a joinCondition function in the options.`);t=this._checkOptions(t);var r={},i={};U(this.body.nodes,(function(n,a){n.options&&!0===t.joinCondition(n.options)&&(r[a]=n,U(n.edges,(function(t){e.clusteredEdges[t.id]===void 0&&(i[t.id]=t)})))})),this._cluster(r,i,t,n)}},{key:`clusterByEdgeCount`,value:function(e,t){var n=this,r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];t=this._checkOptions(t);for(var i,a,o,s=[],c={},l=function(){var r={},l={},d=n.body.nodeIndices[u],f=n.body.nodes[d];if(c[d]===void 0){o=0,a=[];for(var p=0;p<f.edges.length;p++)i=f.edges[p],n.clusteredEdges[i.id]===void 0&&(i.toId!==i.fromId&&o++,a.push(i));if(o===e){for(var m=function(e){if(t.joinCondition===void 0||t.joinCondition===null)return!0;var n=$w.cloneOptions(e);return t.joinCondition(n)},h=!0,g=0;g<a.length;g++){i=a[g];var _=n._getConnectedId(i,d);if(!m(f)){h=!1;break}l[i.id]=i,r[d]=f,r[_]=n.body.nodes[_],c[d]=!0}if(Ip(r).length>0&&Ip(l).length>0&&!0===h){var v=function(){for(var e=0;e<s.length;++e)for(var t in r)if(s[e].nodes[t]!==void 0)return s[e]}();if(v!==void 0){for(var y in r)v.nodes[y]===void 0&&(v.nodes[y]=r[y]);for(var b in l)v.edges[b]===void 0&&(v.edges[b]=l[b])}else s.push({nodes:r,edges:l})}}}},u=0;u<this.body.nodeIndices.length;u++)l();for(var d=0;d<s.length;d++)this._cluster(s[d].nodes,s[d].edges,t,!1);!0===r&&this.body.emitter.emit(`_dataChanged`)}},{key:`clusterOutliers`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.clusterByEdgeCount(1,e,t)}},{key:`clusterBridges`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.clusterByEdgeCount(2,e,t)}},{key:`clusterByConnection`,value:function(e,t){var n,r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(e===void 0)throw Error(`No nodeId supplied to clusterByConnection!`);if(this.body.nodes[e]===void 0)throw Error(`The nodeId given to clusterByConnection does not exist!`);var i=this.body.nodes[e];(t=this._checkOptions(t,i)).clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=i.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=i.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=i.options.fixed.x,t.clusterNodeProperties.fixed.y=i.options.fixed.y);var a={},o={},s=i.id,c=$w.cloneOptions(i);a[s]=i;for(var l=0;l<i.edges.length;l++){var u=i.edges[l];if(this.clusteredEdges[u.id]===void 0){var d=this._getConnectedId(u,s);if(this.clusteredNodes[d]===void 0)if(d!==s)if(t.joinCondition===void 0)o[u.id]=u,a[d]=this.body.nodes[d];else{var f=$w.cloneOptions(this.body.nodes[d]);!0===t.joinCondition(c,f)&&(o[u.id]=u,a[d]=this.body.nodes[d])}else o[u.id]=u}}var p=Np(n=Ip(a)).call(n,(function(e){return a[e].id}));for(var m in a)if(Object.prototype.hasOwnProperty.call(a,m))for(var h=a[m],g=0;g<h.edges.length;g++){var _=h.edges[g];H(p).call(p,this._getConnectedId(_,h.id))>-1&&(o[_.id]=_)}this._cluster(a,o,t,r)}},{key:`_createClusterEdges`,value:function(e,t,n,r){for(var i,a,o,s,c,l,u=Ip(e),d=[],f=0;f<u.length;f++){o=e[a=u[f]];for(var p=0;p<o.edges.length;p++)i=o.edges[p],this.clusteredEdges[i.id]===void 0&&(i.toId==i.fromId?t[i.id]=i:i.toId==a?(s=n.id,l=c=i.fromId):(s=i.toId,c=n.id,l=s),e[l]===void 0&&d.push({edge:i,fromId:c,toId:s}))}for(var m=[],h=function(e){for(var t=0;t<m.length;t++){var n=m[t],r=e.fromId===n.fromId&&e.toId===n.toId,i=e.fromId===n.toId&&e.toId===n.fromId;if(r||i)return n}return null},g=0;g<d.length;g++){var _=d[g],v=_.edge,y=h(_);y===null?(y=this._createClusteredEdge(_.fromId,_.toId,v,r),m.push(y)):y.clusteringEdgeReplacingIds.push(v.id),this.body.edges[v.id].edgeReplacedById=y.id,this._backupEdgeOptions(v),v.setOptions({physics:!1})}}},{key:`_checkOptions`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}},{key:`_cluster`,value:function(e,t,n){var r=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],i=[];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&this.clusteredNodes[a]!==void 0&&i.push(a);for(var o=0;o<i.length;++o)delete e[i[o]];if(Ip(e).length!=0&&(Ip(e).length!=1||n.clusterNodeProperties.allowSingleNodeCluster==1)){var s=kv({},n.clusterNodeProperties);if(n.processProperties!==void 0){var c=[];for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var u=$w.cloneOptions(e[l]);c.push(u)}var d=[];for(var f in t)if(Object.prototype.hasOwnProperty.call(t,f)&&f.substr(0,12)!==`clusterEdge:`){var p=$w.cloneOptions(t[f],`edge`);d.push(p)}if(!(s=n.processProperties(s,c,d)))throw Error(`The processProperties function does not return properties!`)}s.id===void 0&&(s.id=`cluster:`+Qw());var m=s.id;s.label===void 0&&(s.label=`cluster`);var h=void 0;s.x===void 0&&(h=this._getClusterPosition(e),s.x=h.x),s.y===void 0&&(h===void 0&&(h=this._getClusterPosition(e)),s.y=h.y),s.id=m;var g=this.body.functions.createNode(s,tT);g.containedNodes=e,g.containedEdges=t,g.clusterEdgeProperties=n.clusterEdgeProperties,this.body.nodes[s.id]=g,this._clusterEdges(e,t,s,n.clusterEdgeProperties),s.id=void 0,!0===r&&this.body.emitter.emit(`_dataChanged`)}}},{key:`_backupEdgeOptions`,value:function(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}},{key:`_restoreEdge`,value:function(e){var t=this.clusteredEdges[e.id];t!==void 0&&(e.setOptions({physics:t.physics}),delete this.clusteredEdges[e.id])}},{key:`isCluster`,value:function(e){return this.body.nodes[e]===void 0?(console.error(`Node does not exist.`),!1):!0===this.body.nodes[e].isCluster}},{key:`_getClusterPosition`,value:function(e){for(var t,n=Ip(e),r=e[n[0]].x,i=e[n[0]].x,a=e[n[0]].y,o=e[n[0]].y,s=1;s<n.length;s++)r=(t=e[n[s]]).x<r?t.x:r,i=t.x>i?t.x:i,a=t.y<a?t.y:a,o=t.y>o?t.y:o;return{x:.5*(r+i),y:.5*(a+o)}}},{key:`openCluster`,value:function(e,t){var n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(e===void 0)throw Error(`No clusterNodeId supplied to openCluster.`);var r=this.body.nodes[e];if(r===void 0)throw Error(`The clusterNodeId supplied to openCluster does not exist.`);if(!0!==r.isCluster||r.containedNodes===void 0||r.containedEdges===void 0)throw Error(`The node:`+e+` is not a valid cluster.`);var i=this.findNode(e),a=H(i).call(i,e)-1;if(a>=0){var o=i[a];this.body.nodes[o]._openChildCluster(e),delete this.body.nodes[e],!0===n&&this.body.emitter.emit(`_dataChanged`);return}var s=r.containedNodes,c=r.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction==`function`){var l={},u={x:r.x,y:r.y};for(var d in s)if(Object.prototype.hasOwnProperty.call(s,d)){var f=this.body.nodes[d];l[d]={x:f.x,y:f.y}}var p=t.releaseFunction(u,l);for(var m in s)if(Object.prototype.hasOwnProperty.call(s,m)){var h=this.body.nodes[m];p[m]!==void 0&&(h.x=p[m].x===void 0?r.x:p[m].x,h.y=p[m].y===void 0?r.y:p[m].y)}}else U(s,(function(e){!1===e.options.fixed.x&&(e.x=r.x),!1===e.options.fixed.y&&(e.y=r.y)}));for(var g in s)if(Object.prototype.hasOwnProperty.call(s,g)){var _=this.body.nodes[g];_.vx=r.vx,_.vy=r.vy,_.setOptions({physics:!0}),delete this.clusteredNodes[g]}for(var v=[],y=0;y<r.edges.length;y++)v.push(r.edges[y]);for(var b=0;b<v.length;b++){for(var x=v[b],S=this._getConnectedId(x,e),ee=this.clusteredNodes[S],C=0;C<x.clusteringEdgeReplacingIds.length;C++){var te=x.clusteringEdgeReplacingIds[C],ne=this.body.edges[te];if(ne!==void 0)if(ee!==void 0){var re=this.body.nodes[ee.clusterId];re.containedEdges[ne.id]=ne,delete c[ne.id];var w=ne.fromId,T=ne.toId;ne.toId==S?T=ee.clusterId:w=ee.clusterId,this._createClusteredEdge(w,T,ne,re.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(ne)}x.remove()}for(var E in c)Object.prototype.hasOwnProperty.call(c,E)&&this._restoreEdge(c[E]);delete this.body.nodes[e],!0===n&&this.body.emitter.emit(`_dataChanged`)}},{key:`getNodesInCluster`,value:function(e){var t=[];if(!0===this.isCluster(e)){var n=this.body.nodes[e].containedNodes;for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.push(this.body.nodes[r].id)}return t}},{key:`findNode`,value:function(e){for(var t,n=[],r=0;this.clusteredNodes[e]!==void 0&&r<100;){if((t=this.body.nodes[e])===void 0)return[];n.push(t.id),e=this.clusteredNodes[e].clusterId,r++}return(t=this.body.nodes[e])===void 0?[]:(n.push(t.id),sm(n).call(n),n)}},{key:`updateClusteredNode`,value:function(e,t){if(e===void 0)throw Error(`No clusteredNodeId supplied to updateClusteredNode.`);if(t===void 0)throw Error(`No newOptions supplied to updateClusteredNode.`);if(this.body.nodes[e]===void 0)throw Error(`The clusteredNodeId supplied to updateClusteredNode does not exist.`);this.body.nodes[e].setOptions(t),this.body.emitter.emit(`_dataChanged`)}},{key:`updateEdge`,value:function(e,t){if(e===void 0)throw Error(`No startEdgeId supplied to updateEdge.`);if(t===void 0)throw Error(`No newOptions supplied to updateEdge.`);if(this.body.edges[e]===void 0)throw Error(`The startEdgeId supplied to updateEdge does not exist.`);for(var n=this.getClusteredEdges(e),r=0;r<n.length;r++)this.body.edges[n[r]].setOptions(t);this.body.emitter.emit(`_dataChanged`)}},{key:`getClusteredEdges`,value:function(e){for(var t=[],n=0;e!==void 0&&this.body.edges[e]!==void 0&&n<100;)t.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,n++;return sm(t).call(t),t}},{key:`getBaseEdge`,value:function(e){return this.getBaseEdges(e)[0]}},{key:`getBaseEdges`,value:function(e){for(var t=[e],n=[],r=[],i=0;t.length>0&&i<100;){var a=t.pop();if(a!==void 0){var o=this.body.edges[a];if(o!==void 0){i++;var s=o.clusteringEdgeReplacingIds;if(s===void 0)r.push(a);else for(var c=0;c<s.length;++c){var l=s[c];H(t).call(t,s)===-1&&H(n).call(n,s)===-1&&t.push(l)}n.push(a)}}}return r}},{key:`_getConnectedId`,value:function(e,t){return e.toId==t?(e.fromId,e.fromId):e.toId}},{key:`_getHubSize`,value:function(){for(var e=0,t=0,n=0,r=0,i=0;i<this.body.nodeIndices.length;i++){var a=this.body.nodes[this.body.nodeIndices[i]];a.edges.length>r&&(r=a.edges.length),e+=a.edges.length,t+=a.edges.length**2,n+=1}e/=n;var o=(t/=n)-e**2,s=Math.floor(e+2*Math.sqrt(o));return s>r&&(s=r),s}},{key:`_createClusteredEdge`,value:function(e,t,n,r,i){var a=$w.cloneOptions(n,`edge`);kv(a,r),a.from=e,a.to=t,a.id=`clusterEdge:`+Qw(),i!==void 0&&kv(a,i);var o=this.body.functions.createEdge(a);return o.clusteringEdgeReplacingIds=[n.id],o.connect(),this.body.edges[o.id]=o,o}},{key:`_clusterEdges`,value:function(e,t,n,r){if(t instanceof Pw){var i=t,a={};a[i.id]=i,t=a}if(e instanceof LC){var o=e,s={};s[o.id]=o,e=s}if(n==null)throw Error(`_clusterEdges: parameter clusterNode required`);for(var c in r===void 0&&(r=n.clusterEdgeProperties),this._createClusterEdges(e,t,n,r),t)if(Object.prototype.hasOwnProperty.call(t,c)&&this.body.edges[c]!==void 0){var l=this.body.edges[c];this._backupEdgeOptions(l),l.setOptions({physics:!1})}for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&(this.clusteredNodes[u]={clusterId:n.id,node:this.body.nodes[u]},this.body.nodes[u].setOptions({physics:!1}))}},{key:`_getClusterNodeForNode`,value:function(e){if(e!==void 0){var t=this.clusteredNodes[e];if(t!==void 0){var n=t.clusterId;if(n!==void 0)return this.body.nodes[n]}}}},{key:`_filter`,value:function(e,t){var n=[];return U(e,(function(e){t(e)&&n.push(e)})),n}},{key:`_updateState`,value:function(){var e,t=this,n=[],r={},i=function(e){U(t.body.nodes,(function(t){!0===t.isCluster&&e(t)}))};for(e in this.clusteredNodes)Object.prototype.hasOwnProperty.call(this.clusteredNodes,e)&&this.body.nodes[e]===void 0&&n.push(e);i((function(e){for(var t=0;t<n.length;t++)delete e.containedNodes[n[t]]}));for(var a=0;a<n.length;a++)delete this.clusteredNodes[n[a]];U(this.clusteredEdges,(function(e){var n=t.body.edges[e];n!==void 0&&n.endPointsValid()||(r[e]=e)})),i((function(e){U(e.containedEdges,(function(e,t){e.endPointsValid()||r[t]||(r[t]=t)}))})),U(this.body.edges,(function(e,n){var i=!0,a=e.clusteringEdgeReplacingIds;if(a!==void 0){var o=0;U(a,(function(e){var n=t.body.edges[e];n!==void 0&&n.endPointsValid()&&(o+=1)})),i=o>0}e.endPointsValid()&&i||(r[n]=n)})),i((function(e){U(r,(function(n){delete e.containedEdges[n],U(e.edges,(function(i,a){i.id===n?e.edges[a]=null:i.clusteringEdgeReplacingIds=t._filter(i.clusteringEdgeReplacingIds,(function(e){return!r[e]}))})),e.edges=t._filter(e.edges,(function(e){return e!==null}))}))})),U(r,(function(e){delete t.clusteredEdges[e]})),U(r,(function(e){delete t.body.edges[e]})),U(Ip(this.body.edges),(function(e){var n=t.body.edges[e],r=t._isClusteredNode(n.fromId)||t._isClusteredNode(n.toId);if(r!==t._isClusteredEdge(n.id))if(r){var i=t._getClusterNodeForNode(n.fromId);i!==void 0&&t._clusterEdges(t.body.nodes[n.fromId],n,i);var a=t._getClusterNodeForNode(n.toId);a!==void 0&&t._clusterEdges(t.body.nodes[n.toId],n,a)}else delete t._clusterEdges[e],t._restoreEdge(n)}));for(var o=!1,s=!0,c=function(){var e=[];i((function(t){var n=Ip(t.containedNodes).length,r=!0===t.options.allowSingleNodeCluster;(r&&n<1||!r&&n<2)&&e.push(t.id)}));for(var n=0;n<e.length;++n)t.openCluster(e[n],{},!1);s=e.length>0,o||=s};s;)c();o&&this._updateState()}},{key:`_isClusteredNode`,value:function(e){return this.clusteredNodes[e]!==void 0}},{key:`_isClusteredEdge`,value:function(e){return this.clusteredEdges[e]!==void 0}}]),e}(),rT=function(){function e(t,n){var r;B(this,e),window!==void 0&&(r=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),window.requestAnimationFrame=r===void 0?function(e){e()}:r,this.body=t,this.canvas=n,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},Nr(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return V(e,[{key:`bindEventListeners`,value:function(){var e,t=this;this.body.emitter.on(`dragStart`,(function(){t.dragging=!0})),this.body.emitter.on(`dragEnd`,(function(){t.dragging=!1})),this.body.emitter.on(`zoom`,(function(){t.zooming=!0,window.clearTimeout(t.zoomTimeoutId),t.zoomTimeoutId=cg((function(){var e;t.zooming=!1,z(e=t._requestRedraw).call(e,t)()}),250)})),this.body.emitter.on(`_resizeNodes`,(function(){t._resizeNodes()})),this.body.emitter.on(`_redraw`,(function(){!1===t.renderingActive&&t._redraw()})),this.body.emitter.on(`_blockRedraw`,(function(){t.allowRedraw=!1})),this.body.emitter.on(`_allowRedraw`,(function(){t.allowRedraw=!0,t.redrawRequested=!1})),this.body.emitter.on(`_requestRedraw`,z(e=this._requestRedraw).call(e,this)),this.body.emitter.on(`_startRendering`,(function(){t.renderRequests+=1,t.renderingActive=!0,t._startRendering()})),this.body.emitter.on(`_stopRendering`,(function(){--t.renderRequests,t.renderingActive=t.renderRequests>0,t.renderTimer=void 0})),this.body.emitter.on(`destroy`,(function(){t.renderRequests=0,t.allowRedraw=!1,t.renderingActive=!1,!0===t.requiresTimeout?clearTimeout(t.renderTimer):window.cancelAnimationFrame(t.renderTimer),t.body.emitter.off()}))}},{key:`setOptions`,value:function(e){e!==void 0&&Dv([`hideEdgesOnDrag`,`hideEdgesOnZoom`,`hideNodesOnDrag`],this.options,e)}},{key:`_requestNextFrame`,value:function(e,t){if(typeof window<`u`){var n,r=window;return!0===this.requiresTimeout?n=cg(e,t):r.requestAnimationFrame&&(n=r.requestAnimationFrame(e)),n}}},{key:`_startRendering`,value:function(){var e;!0===this.renderingActive&&this.renderTimer===void 0&&(this.renderTimer=this._requestNextFrame(z(e=this._renderStep).call(e,this),this.simulationInterval))}},{key:`_renderStep`,value:function(){!0===this.renderingActive&&(this.renderTimer=void 0,!0===this.requiresTimeout&&this._startRendering(),this._redraw(),!1===this.requiresTimeout&&this._startRendering())}},{key:`redraw`,value:function(){this.body.emitter.emit(`setSize`),this._redraw()}},{key:`_requestRedraw`,value:function(){var e=this;!0!==this.redrawRequested&&!1===this.renderingActive&&!0===this.allowRedraw&&(this.redrawRequested=!0,this._requestNextFrame((function(){e._redraw(!1)}),0))}},{key:`_redraw`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(!0===this.allowRedraw){this.body.emitter.emit(`initRedraw`),this.redrawRequested=!1;var t={drawExternalLabels:null};this.canvas.frame.canvas.width!==0&&this.canvas.frame.canvas.height!==0||this.canvas.setSize(),this.canvas.setTransform();var n=this.canvas.getContext(),r=this.canvas.frame.canvas.clientWidth,i=this.canvas.frame.canvas.clientHeight;if(n.clearRect(0,0,r,i),this.canvas.frame.clientWidth===0)return;n.save(),n.translate(this.body.view.translation.x,this.body.view.translation.y),n.scale(this.body.view.scale,this.body.view.scale),n.beginPath(),this.body.emitter.emit(`beforeDrawing`,n),n.closePath(),!1===e&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawEdges(n),(!1===this.dragging||!0===this.dragging&&!1===this.options.hideNodesOnDrag)&&(t.drawExternalLabels=this._drawNodes(n,e).drawExternalLabels),!1===e&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawArrows(n),t.drawExternalLabels!=null&&t.drawExternalLabels(),!1===e&&this._drawSelectionBox(n),n.beginPath(),this.body.emitter.emit(`afterDrawing`,n),n.closePath(),n.restore(),!0===e&&n.clearRect(0,0,r,i)}}},{key:`_resizeNodes`,value:function(){this.canvas.setTransform();var e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);var t,n=this.body.nodes;for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&((t=n[r]).resize(e),t.updateBoundingBox(e,t.selected));e.restore()}},{key:`_drawNodes`,value:function(e){for(var t,n,r=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=this.body.nodes,a=this.body.nodeIndices,o=[],s=[],c=this.canvas.DOMtoCanvas({x:-20,y:-20}),l=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),u={top:c.y,left:c.x,bottom:l.y,right:l.x},d=[],f=0;f<a.length;f++)if((t=i[a[f]]).hover)s.push(a[f]);else if(t.isSelected())o.push(a[f]);else if(!0===r){var p=t.draw(e);p.drawExternalLabel!=null&&d.push(p.drawExternalLabel)}else if(!0===t.isBoundingBoxOverlappingWith(u)){var m=t.draw(e);m.drawExternalLabel!=null&&d.push(m.drawExternalLabel)}else t.updateBoundingBox(e,t.selected);var h=o.length,g=s.length;for(n=0;n<h;n++){var _=(t=i[o[n]]).draw(e);_.drawExternalLabel!=null&&d.push(_.drawExternalLabel)}for(n=0;n<g;n++){var v=(t=i[s[n]]).draw(e);v.drawExternalLabel!=null&&d.push(v.drawExternalLabel)}return{drawExternalLabels:function(){for(var e=0,t=d;e<t.length;e++)(0,t[e])()}}}},{key:`_drawEdges`,value:function(e){for(var t=this.body.edges,n=this.body.edgeIndices,r=0;r<n.length;r++){var i=t[n[r]];!0===i.connected&&i.draw(e)}}},{key:`_drawArrows`,value:function(e){for(var t=this.body.edges,n=this.body.edgeIndices,r=0;r<n.length;r++){var i=t[n[r]];!0===i.connected&&i.drawArrows(e)}}},{key:`_determineBrowserMethod`,value:function(){if(typeof window<`u`){var e=navigator.userAgent.toLowerCase();this.requiresTimeout=!1,(H(e).call(e,`msie 9.0`)!=-1||H(e).call(e,`safari`)!=-1&&H(e).call(e,`chrome`)<=-1)&&(this.requiresTimeout=!0)}else this.requiresTimeout=!0}},{key:`_drawSelectionBox`,value:function(e){if(this.body.selectionBox.show){e.beginPath();var t=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,n=this.body.selectionBox.position.end.y-this.body.selectionBox.position.start.y;e.rect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,n),e.fillStyle=`rgba(151, 194, 252, 0.2)`,e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,n),e.strokeStyle=`rgba(151, 194, 252, 1)`,e.stroke()}else e.closePath()}}]),e}(),iT=r(j.setInterval);function aT(e,t){t.inputHandler=function(e){e.isFirst&&t(e)},e.on(`hammer.input`,t.inputHandler)}function oT(e,t){return t.inputHandler=function(e){e.isFinal&&t(e)},e.on(`hammer.input`,t.inputHandler)}var sT=function(){function e(t){B(this,e),this.body=t,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:`100%`,width:`100%`},Nr(this.options,this.defaultOptions),this.bindEventListeners()}return V(e,[{key:`bindEventListeners`,value:function(){var e,t=this;this.body.emitter.once(`resize`,(function(e){e.width!==0&&(t.body.view.translation.x=.5*e.width),e.height!==0&&(t.body.view.translation.y=.5*e.height)})),this.body.emitter.on(`setSize`,z(e=this.setSize).call(e,this)),this.body.emitter.on(`destroy`,(function(){t.hammerFrame.destroy(),t.hammer.destroy(),t._cleanUp()}))}},{key:`setOptions`,value:function(e){var t=this;if(e!==void 0&&Dv([`width`,`height`,`autoResize`],this.options,e),this._cleanUp(),!0===this.options.autoResize){var n;if(window.ResizeObserver){var r=new ResizeObserver((function(){!0===t.setSize()&&t.body.emitter.emit(`_requestRedraw`)})),i=this.frame;r.observe(i),this._cleanupCallbacks.push((function(){r.unobserve(i)}))}else{var a=iT((function(){!0===t.setSize()&&t.body.emitter.emit(`_requestRedraw`)}),1e3);this._cleanupCallbacks.push((function(){clearInterval(a)}))}var o=z(n=this._onResize).call(n,this);window.addEventListener(`resize`,o),this._cleanupCallbacks.push((function(){window.removeEventListener(`resize`,o)}))}}},{key:`_cleanUp`,value:function(){var e,t,n;Qp(e=sm(t=Om(n=this._cleanupCallbacks).call(n,0)).call(t)).call(e,(function(e){try{e()}catch(e){console.error(e)}}))}},{key:`_onResize`,value:function(){this.setSize(),this.body.emitter.emit(`_redraw`)}},{key:`_getCameraState`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;!0===this.initialized&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}},{key:`_setCameraState`,value:function(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){var e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,n=this.cameraState.scale;e!=1&&t!=1?n=.5*this.cameraState.scale*(e+t):e==1?t!=1&&(n=this.cameraState.scale*t):n=this.cameraState.scale*e,this.body.view.scale=n;var r=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),i={x:r.x-this.cameraState.position.x,y:r.y-this.cameraState.position.y};this.body.view.translation.x+=i.x*this.body.view.scale,this.body.view.translation.y+=i.y*this.body.view.scale}}},{key:`_prepareValue`,value:function(e){if(typeof e==`number`)return e+`px`;if(typeof e==`string`){if(H(e).call(e,`%`)!==-1||H(e).call(e,`px`)!==-1)return e;if(H(e).call(e,`%`)===-1)return e+`px`}throw Error(`Could not use the value supplied for width or height:`+e)}},{key:`_create`,value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement(`div`),this.frame.className=`vis-network`,this.frame.style.position=`relative`,this.frame.style.overflow=`hidden`,this.frame.tabIndex=0,this.frame.canvas=document.createElement(`canvas`),this.frame.canvas.style.position=`relative`,this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{var e=document.createElement(`DIV`);e.style.color=`red`,e.style.fontWeight=`bold`,e.style.padding=`10px`,e.innerText=`Error: your browser does not support HTML canvas`,this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:`_bindHammer`,value:function(){var e=this;this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new ny(this.frame.canvas),this.hammer.get(`pinch`).set({enable:!0}),this.hammer.get(`pan`).set({threshold:5,direction:ny.DIRECTION_ALL}),aT(this.hammer,(function(t){e.body.eventListeners.onTouch(t)})),this.hammer.on(`tap`,(function(t){e.body.eventListeners.onTap(t)})),this.hammer.on(`doubletap`,(function(t){e.body.eventListeners.onDoubleTap(t)})),this.hammer.on(`press`,(function(t){e.body.eventListeners.onHold(t)})),this.hammer.on(`panstart`,(function(t){e.body.eventListeners.onDragStart(t)})),this.hammer.on(`panmove`,(function(t){e.body.eventListeners.onDrag(t)})),this.hammer.on(`panend`,(function(t){e.body.eventListeners.onDragEnd(t)})),this.hammer.on(`pinch`,(function(t){e.body.eventListeners.onPinch(t)})),this.frame.canvas.addEventListener(`wheel`,(function(t){e.body.eventListeners.onMouseWheel(t)})),this.frame.canvas.addEventListener(`mousemove`,(function(t){e.body.eventListeners.onMouseMove(t)})),this.frame.canvas.addEventListener(`contextmenu`,(function(t){e.body.eventListeners.onContext(t)})),this.hammerFrame=new ny(this.frame),oT(this.hammerFrame,(function(t){e.body.eventListeners.onRelease(t)}))}},{key:`setSize`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);var n=!1,r=this.frame.canvas.width,i=this.frame.canvas.height,a=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(a),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width=`100%`,this.frame.canvas.style.height=`100%`,this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},n=!0;else{var o=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),s=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);this.frame.canvas.width===o&&this.frame.canvas.height===s||this._getCameraState(a),this.frame.canvas.width!==o&&(this.frame.canvas.width=o,n=!0),this.frame.canvas.height!==s&&(this.frame.canvas.height=s,n=!0)}return!0===n&&(this.body.emitter.emit(`resize`,{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(r/this.pixelRatio),oldHeight:Math.round(i/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,n}},{key:`getContext`,value:function(){return this.frame.canvas.getContext(`2d`)}},{key:`_determinePixelRatio`,value:function(){var e=this.getContext();if(e===void 0)throw Error(`Could not get canvax context`);var t=1;return typeof window<`u`&&(t=window.devicePixelRatio||1),t/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}},{key:`_setPixelRatio`,value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:`setTransform`,value:function(){var e=this.getContext();if(e===void 0)throw Error(`Could not get canvax context`);e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}},{key:`_XconvertDOMtoCanvas`,value:function(e){return(e-this.body.view.translation.x)/this.body.view.scale}},{key:`_XconvertCanvasToDOM`,value:function(e){return e*this.body.view.scale+this.body.view.translation.x}},{key:`_YconvertDOMtoCanvas`,value:function(e){return(e-this.body.view.translation.y)/this.body.view.scale}},{key:`_YconvertCanvasToDOM`,value:function(e){return e*this.body.view.scale+this.body.view.translation.y}},{key:`canvasToDOM`,value:function(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}},{key:`DOMtoCanvas`,value:function(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}]),e}(),cT=function(){function e(t,n){var r,i,a=this;B(this,e),this.body=t,this.canvas=n,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction=`easeInOutQuint`,this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on(`fit`,z(r=this.fit).call(r,this)),this.body.emitter.on(`animationFinished`,(function(){a.body.emitter.emit(`_stopRendering`)})),this.body.emitter.on(`unlockNode`,z(i=this.releaseNode).call(i,this))}return V(e,[{key:`setOptions`,value:function(){this.options=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}}},{key:`fit`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];e=function(e,t){var n=Nr({nodes:t,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},e??{});if(!Dp(n.nodes))throw TypeError(`Nodes has to be an array of ids.`);if(n.nodes.length===0&&(n.nodes=t),!(typeof n.minZoomLevel==`number`&&n.minZoomLevel>0))throw TypeError(`Min zoom level has to be a number higher than zero.`);if(!(typeof n.maxZoomLevel==`number`&&n.minZoomLevel<=n.maxZoomLevel))throw TypeError(`Max zoom level has to be a number higher than min zoom level.`);return n}(e,this.body.nodeIndices);var n,r,i=this.canvas.frame.canvas.clientWidth,a=this.canvas.frame.canvas.clientHeight;if(i===0||a===0)r=1,n=$w.getRange(this.body.nodes,e.nodes);else if(!0===t){var o=0;for(var s in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,s)&&!0===this.body.nodes[s].predefinedPosition&&(o+=1);if(o>.5*this.body.nodeIndices.length)return void this.fit(e,!1);n=$w.getRange(this.body.nodes,e.nodes),r=12.662/(this.body.nodeIndices.length+7.4147)+.0964822,r*=Math.min(i/600,a/600)}else{this.body.emitter.emit(`_resizeNodes`),n=$w.getRange(this.body.nodes,e.nodes);var c=i/(1.1*Math.abs(n.maxX-n.minX)),l=a/(1.1*Math.abs(n.maxY-n.minY));r=c<=l?c:l}r>e.maxZoomLevel?r=e.maxZoomLevel:r<e.minZoomLevel&&(r=e.minZoomLevel);var u={position:$w.findCenter(n),scale:r,animation:e.animation};this.moveTo(u)}},{key:`focus`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.body.nodes[e]===void 0?console.error(`Node: `+e+` cannot be found.`):(t.position={x:this.body.nodes[e].x,y:this.body.nodes[e].y},t.lockedOnNode=e,this.moveTo(t))}},{key:`moveTo`,value:function(e){if(e!==void 0){if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!hx(e.offset.x))throw TypeError(`The option "offset.x" has to be a finite number.`)}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!hx(e.offset.y))throw TypeError(`The option "offset.y" has to be a finite number.`)}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!hx(e.position.x))throw TypeError(`The option "position.x" has to be a finite number.`)}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!hx(e.position.y))throw TypeError(`The option "position.y" has to be a finite number.`)}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw TypeError(`The option "scale" has to be a number greater than zero.`)}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),!1===e.animation&&(e.animation={duration:0}),!0===e.animation&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction=`easeInOutQuad`),this.animateView(e)}else e={}}},{key:`animateView`,value:function(e){if(e!==void 0){this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),!0===e.locked&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;var t,n,r=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i=r.x-e.position.x,a=r.y-e.position.y;this.targetTranslation={x:this.sourceTranslation.x+i*this.targetScale+e.offset.x,y:this.sourceTranslation.y+a*this.targetScale+e.offset.y},e.animation.duration===0?this.lockedOnNodeId==null?(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit(`_requestRedraw`)):(this.viewFunction=z(t=this._lockedRedraw).call(t,this),this.body.emitter.on(`initRedraw`,this.viewFunction)):(this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=z(n=this._transitionRedraw).call(n,this),this.body.emitter.on(`initRedraw`,this.viewFunction),this.body.emitter.emit(`_startRendering`))}}},{key:`_lockedRedraw`,value:function(){var e=this.body.nodes[this.lockedOnNodeId].x,t=this.body.nodes[this.lockedOnNodeId].y,n=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),r=n.x-e,i=n.y-t,a=this.body.view.translation,o={x:a.x+r*this.body.view.scale+this.lockedOnNodeOffset.x,y:a.y+i*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=o}},{key:`releaseNode`,value:function(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off(`initRedraw`,this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:`_transitionRedraw`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=!0===e?1:this.easingTime;var t=Uv[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){var n;this.body.emitter.off(`initRedraw`,this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null&&(this.viewFunction=z(n=this._lockedRedraw).call(n,this),this.body.emitter.on(`initRedraw`,this.viewFunction)),this.body.emitter.emit(`animationFinished`)}}},{key:`getScale`,value:function(){return this.body.view.scale}},{key:`getViewPosition`,value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),e}();function lT(e){var t,n=e&&e.preventDefault||!1,r=e&&e.container||window,i={},a={keydown:{},keyup:{}},o={};for(t=97;t<=122;t++)o[String.fromCharCode(t)]={code:t-97+65,shift:!1};for(t=65;t<=90;t++)o[String.fromCharCode(t)]={code:t,shift:!0};for(t=0;t<=9;t++)o[``+t]={code:48+t,shift:!1};for(t=1;t<=12;t++)o[`F`+t]={code:111+t,shift:!1};for(t=0;t<=9;t++)o[`num`+t]={code:96+t,shift:!1};o[`num*`]={code:106,shift:!1},o[`num+`]={code:107,shift:!1},o[`num-`]={code:109,shift:!1},o[`num/`]={code:111,shift:!1},o[`num.`]={code:110,shift:!1},o.left={code:37,shift:!1},o.up={code:38,shift:!1},o.right={code:39,shift:!1},o.down={code:40,shift:!1},o.space={code:32,shift:!1},o.enter={code:13,shift:!1},o.shift={code:16,shift:void 0},o.esc={code:27,shift:!1},o.backspace={code:8,shift:!1},o.tab={code:9,shift:!1},o.ctrl={code:17,shift:!1},o.alt={code:18,shift:!1},o.delete={code:46,shift:!1},o.pageup={code:33,shift:!1},o.pagedown={code:34,shift:!1},o[`=`]={code:187,shift:!1},o[`-`]={code:189,shift:!1},o[`]`]={code:221,shift:!1},o[`[`]={code:219,shift:!1};var s=function(e){l(e,`keydown`)},c=function(e){l(e,`keyup`)},l=function(e,t){if(a[t][e.keyCode]!==void 0){for(var r=a[t][e.keyCode],i=0;i<r.length;i++)(r[i].shift===void 0||r[i].shift==1&&e.shiftKey==1||r[i].shift==0&&e.shiftKey==0)&&r[i].fn(e);n==1&&e.preventDefault()}};return i.bind=function(e,t,n){if(n===void 0&&(n=`keydown`),o[e]===void 0)throw Error(`unsupported key: `+e);a[n][o[e].code]===void 0&&(a[n][o[e].code]=[]),a[n][o[e].code].push({fn:t,shift:o[e].shift})},i.bindAll=function(e,t){for(var n in t===void 0&&(t=`keydown`),o)o.hasOwnProperty(n)&&i.bind(n,e,t)},i.getKey=function(e){for(var t in o)if(o.hasOwnProperty(t)&&(e.shiftKey==1&&o[t].shift==1&&e.keyCode==o[t].code||e.shiftKey==0&&o[t].shift==0&&e.keyCode==o[t].code||e.keyCode==o[t].code&&t==`shift`))return t;return`unknown key, currently not supported`},i.unbind=function(e,t,n){if(n===void 0&&(n=`keydown`),o[e]===void 0)throw Error(`unsupported key: `+e);if(t!==void 0){var r=[],i=a[n][o[e].code];if(i!==void 0)for(var s=0;s<i.length;s++)i[s].fn==t&&i[s].shift==o[e].shift||r.push(a[n][o[e].code][s]);a[n][o[e].code]=r}else a[n][o[e].code]=[]},i.reset=function(){a={keydown:{},keyup:{}}},i.destroy=function(){a={keydown:{},keyup:{}},r.removeEventListener(`keydown`,s,!0),r.removeEventListener(`keyup`,c,!0)},r.addEventListener(`keydown`,s,!0),r.addEventListener(`keyup`,c,!0),i}var uT=function(){function e(t,n){var r=this;B(this,e),this.body=t,this.canvas=n,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on(`activate`,(function(){r.activated=!0,r.configureKeyboardBindings()})),this.body.emitter.on(`deactivate`,(function(){r.activated=!1,r.configureKeyboardBindings()})),this.body.emitter.on(`destroy`,(function(){r.keycharm!==void 0&&r.keycharm.destroy()})),this.options={}}return V(e,[{key:`setOptions`,value:function(e){e!==void 0&&(this.options=e,this.create())}},{key:`create`,value:function(){!0===this.options.navigationButtons?!1===this.iconsCreated&&this.loadNavigationElements():!0===this.iconsCreated&&this.cleanNavigation(),this.configureKeyboardBindings()}},{key:`cleanNavigation`,value:function(){if(this.navigationHammers.length!=0){for(var e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}},{key:`loadNavigationElements`,value:function(){var e=this;this.cleanNavigation(),this.navigationDOM={};var t=[`up`,`down`,`left`,`right`,`zoomIn`,`zoomOut`,`zoomExtends`],n=[`_moveUp`,`_moveDown`,`_moveLeft`,`_moveRight`,`_zoomIn`,`_zoomOut`,`_fit`];this.navigationDOM.wrapper=document.createElement(`div`),this.navigationDOM.wrapper.className=`vis-navigation`,this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(var r=0;r<t.length;r++){this.navigationDOM[t[r]]=document.createElement(`div`),this.navigationDOM[t[r]].className=`vis-button vis-`+t[r],this.navigationDOM.wrapper.appendChild(this.navigationDOM[t[r]]);var i,a,o=new ny(this.navigationDOM[t[r]]);n[r]===`_fit`?aT(o,z(i=this._fit).call(i,this)):aT(o,z(a=this.bindToRedraw).call(a,this,n[r])),this.navigationHammers.push(o)}var s=new ny(this.canvas.frame);oT(s,(function(){e._stopMovement()})),this.navigationHammers.push(s),this.iconsCreated=!0}},{key:`bindToRedraw`,value:function(e){var t;this.boundFunctions[e]===void 0&&(this.boundFunctions[e]=z(t=this[e]).call(t,this),this.body.emitter.on(`initRedraw`,this.boundFunctions[e]),this.body.emitter.emit(`_startRendering`))}},{key:`unbindFromRedraw`,value:function(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off(`initRedraw`,this.boundFunctions[e]),this.body.emitter.emit(`_stopRendering`),delete this.boundFunctions[e])}},{key:`_fit`,value:function(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit(`fit`,{duration:700}),this.touchTime=new Date().valueOf())}},{key:`_stopMovement`,value:function(){for(var e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off(`initRedraw`,this.boundFunctions[e]),this.body.emitter.emit(`_stopRendering`));this.boundFunctions={}}},{key:`_moveUp`,value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:`_moveDown`,value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:`_moveLeft`,value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:`_moveRight`,value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:`_zoomIn`,value:function(){var e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,r=t/e,i=(1-r)*this.canvas.canvasViewCenter.x+n.x*r,a=(1-r)*this.canvas.canvasViewCenter.y+n.y*r;this.body.view.scale=t,this.body.view.translation={x:i,y:a},this.body.emitter.emit(`zoom`,{direction:`+`,scale:this.body.view.scale,pointer:null})}},{key:`_zoomOut`,value:function(){var e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,r=t/e,i=(1-r)*this.canvas.canvasViewCenter.x+n.x*r,a=(1-r)*this.canvas.canvasViewCenter.y+n.y*r;this.body.view.scale=t,this.body.view.translation={x:i,y:a},this.body.emitter.emit(`zoom`,{direction:`-`,scale:this.body.view.scale,pointer:null})}},{key:`configureKeyboardBindings`,value:function(){var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,ee,C=this;(this.keycharm!==void 0&&this.keycharm.destroy(),!0===this.options.keyboard.enabled)&&(!0===this.options.keyboard.bindToWindow?this.keycharm=lT({container:window,preventDefault:!0}):this.keycharm=lT({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),!0===this.activated&&(z(e=this.keycharm).call(e,`up`,(function(){C.bindToRedraw(`_moveUp`)}),`keydown`),z(t=this.keycharm).call(t,`down`,(function(){C.bindToRedraw(`_moveDown`)}),`keydown`),z(n=this.keycharm).call(n,`left`,(function(){C.bindToRedraw(`_moveLeft`)}),`keydown`),z(r=this.keycharm).call(r,`right`,(function(){C.bindToRedraw(`_moveRight`)}),`keydown`),z(i=this.keycharm).call(i,`=`,(function(){C.bindToRedraw(`_zoomIn`)}),`keydown`),z(a=this.keycharm).call(a,`num+`,(function(){C.bindToRedraw(`_zoomIn`)}),`keydown`),z(o=this.keycharm).call(o,`num-`,(function(){C.bindToRedraw(`_zoomOut`)}),`keydown`),z(s=this.keycharm).call(s,`-`,(function(){C.bindToRedraw(`_zoomOut`)}),`keydown`),z(c=this.keycharm).call(c,`[`,(function(){C.bindToRedraw(`_zoomOut`)}),`keydown`),z(l=this.keycharm).call(l,`]`,(function(){C.bindToRedraw(`_zoomIn`)}),`keydown`),z(u=this.keycharm).call(u,`pageup`,(function(){C.bindToRedraw(`_zoomIn`)}),`keydown`),z(d=this.keycharm).call(d,`pagedown`,(function(){C.bindToRedraw(`_zoomOut`)}),`keydown`),z(f=this.keycharm).call(f,`up`,(function(){C.unbindFromRedraw(`_moveUp`)}),`keyup`),z(p=this.keycharm).call(p,`down`,(function(){C.unbindFromRedraw(`_moveDown`)}),`keyup`),z(m=this.keycharm).call(m,`left`,(function(){C.unbindFromRedraw(`_moveLeft`)}),`keyup`),z(h=this.keycharm).call(h,`right`,(function(){C.unbindFromRedraw(`_moveRight`)}),`keyup`),z(g=this.keycharm).call(g,`=`,(function(){C.unbindFromRedraw(`_zoomIn`)}),`keyup`),z(_=this.keycharm).call(_,`num+`,(function(){C.unbindFromRedraw(`_zoomIn`)}),`keyup`),z(v=this.keycharm).call(v,`num-`,(function(){C.unbindFromRedraw(`_zoomOut`)}),`keyup`),z(y=this.keycharm).call(y,`-`,(function(){C.unbindFromRedraw(`_zoomOut`)}),`keyup`),z(b=this.keycharm).call(b,`[`,(function(){C.unbindFromRedraw(`_zoomOut`)}),`keyup`),z(x=this.keycharm).call(x,`]`,(function(){C.unbindFromRedraw(`_zoomIn`)}),`keyup`),z(S=this.keycharm).call(S,`pageup`,(function(){C.unbindFromRedraw(`_zoomIn`)}),`keyup`),z(ee=this.keycharm).call(ee,`pagedown`,(function(){C.unbindFromRedraw(`_zoomOut`)}),`keyup`)))}}]),e}();function dT(e,t){var n=mp!==void 0&&Sc(e)||e[`@@iterator`];if(!n){if(Dp(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return fT(e,t);var r=bp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return tc(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fT(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
37
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function fT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var pT=function(){function e(t,n,r){var i,a,o,s,c,l,u,d,f,p,m,h,g;B(this,e),this.body=t,this.canvas=n,this.selectionHandler=r,this.navigationHandler=new uT(t,n),this.body.eventListeners.onTap=z(i=this.onTap).call(i,this),this.body.eventListeners.onTouch=z(a=this.onTouch).call(a,this),this.body.eventListeners.onDoubleTap=z(o=this.onDoubleTap).call(o,this),this.body.eventListeners.onHold=z(s=this.onHold).call(s,this),this.body.eventListeners.onDragStart=z(c=this.onDragStart).call(c,this),this.body.eventListeners.onDrag=z(l=this.onDrag).call(l,this),this.body.eventListeners.onDragEnd=z(u=this.onDragEnd).call(u,this),this.body.eventListeners.onMouseWheel=z(d=this.onMouseWheel).call(d,this),this.body.eventListeners.onPinch=z(f=this.onPinch).call(f,this),this.body.eventListeners.onMouseMove=z(p=this.onMouseMove).call(p,this),this.body.eventListeners.onRelease=z(m=this.onRelease).call(m,this),this.body.eventListeners.onContext=z(h=this.onContext).call(h,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=z(g=this.getPointer).call(g,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},Nr(this.options,this.defaultOptions),this.bindEventListeners()}return V(e,[{key:`bindEventListeners`,value:function(){var e=this;this.body.emitter.on(`destroy`,(function(){clearTimeout(e.popupTimer),delete e.body.functions.getPointer}))}},{key:`setOptions`,value:function(e){e!==void 0&&(Ov([`hideEdgesOnDrag`,`hideEdgesOnZoom`,`hideNodesOnDrag`,`keyboard`,`multiselect`,`selectable`,`selectConnectedEdges`],this.options,e),Hv(this.options,e,`keyboard`),e.tooltip&&(Nr(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=Fv(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}},{key:`getPointer`,value:function(e){return{x:e.x-(t=this.canvas.frame.canvas,t.getBoundingClientRect().left),y:e.y-jv(this.canvas.frame.canvas)};var t}},{key:`onTouch`,value:function(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}},{key:`onTap`,value:function(e){var t=this.getPointer(e.center),n=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,n),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent(`click`,e,t)}},{key:`onDoubleTap`,value:function(e){var t=this.getPointer(e.center);this.selectionHandler.generateClickEvent(`doubleClick`,e,t)}},{key:`onHold`,value:function(e){var t=this.getPointer(e.center),n=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,n),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent(`click`,e,t),this.selectionHandler.generateClickEvent(`hold`,e,t)}},{key:`onRelease`,value:function(e){if(new Date().valueOf()-this.touchTime>10){var t=this.getPointer(e.center);this.selectionHandler.generateClickEvent(`release`,e,t),this.touchTime=new Date().valueOf()}}},{key:`onContext`,value:function(e){var t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent(`oncontext`,e,t)}},{key:`checkSelectionChanges`,value:function(e){!0===(arguments.length>1&&arguments[1]!==void 0&&arguments[1])?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}},{key:`_determineDifference`,value:function(e,t){var n=function(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];H(t).call(t,i)===-1&&n.push(i)}return n};return{nodes:n(e.nodes,t.nodes),edges:n(e.edges,t.edges)}}},{key:`onDragStart`,value:function(e){if(!this.drag.dragging){this.drag.pointer===void 0&&this.onTouch(e);var t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=Nr({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;var n=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(n.x),y:this.canvas._YconvertDOMtoCanvas(n.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(n.x),y:this.canvas._YconvertDOMtoCanvas(n.y)}}else if(t!==void 0&&!0===this.options.dragNodes){this.drag.nodeId=t.id,!1===t.isSelected()&&this.selectionHandler.setSelection({nodes:[t.id]}),this.selectionHandler.generateClickEvent(`dragStart`,e,this.drag.pointer);var r,i=dT(this.selectionHandler.getSelectedNodes());try{for(i.s();!(r=i.n()).done;){var a=r.value,o={id:a.id,node:a,x:a.x,y:a.y,xFixed:a.options.fixed.x,yFixed:a.options.fixed.y};a.options.fixed.x=!0,a.options.fixed.y=!0,this.drag.selection.push(o)}}catch(e){i.e(e)}finally{i.f()}}else this.selectionHandler.generateClickEvent(`dragStart`,e,this.drag.pointer,void 0,!0)}}},{key:`onDrag`,value:function(e){var t=this;if(!0!==this.drag.pinched){this.body.emitter.emit(`unlockNode`);var n=this.getPointer(e.center),r=this.drag.selection;if(r&&r.length&&!0===this.options.dragNodes){this.selectionHandler.generateClickEvent(`dragging`,e,n);var i=n.x-this.drag.pointer.x,a=n.y-this.drag.pointer.y;Qp(r).call(r,(function(e){var n=e.node;!1===e.xFixed&&(n.x=t.canvas._XconvertDOMtoCanvas(t.canvas._XconvertCanvasToDOM(e.x)+i)),!1===e.yFixed&&(n.y=t.canvas._YconvertDOMtoCanvas(t.canvas._YconvertCanvasToDOM(e.y)+a))})),this.body.emitter.emit(`startSimulation`)}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent(`dragging`,e,n,void 0,!0),this.drag.pointer===void 0)return void this.onDragStart(e);this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(n.x),y:this.canvas._YconvertDOMtoCanvas(n.y)},this.body.emitter.emit(`_requestRedraw`)}if(!0===this.options.dragView&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent(`dragging`,e,n,void 0,!0),this.drag.pointer===void 0)return void this.onDragStart(e);var o=n.x-this.drag.pointer.x,s=n.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+o,y:this.drag.translation.y+s},this.body.emitter.emit(`_requestRedraw`)}}}}},{key:`onDragEnd`,value:function(e){var t=this;if(this.drag.dragging=!1,this.body.selectionBox.show){var n;this.body.selectionBox.show=!1;var r=this.body.selectionBox.position,i={minX:Math.min(r.start.x,r.end.x),minY:Math.min(r.start.y,r.end.y),maxX:Math.max(r.start.x,r.end.x),maxY:Math.max(r.start.y,r.end.y)},a=oh(n=this.body.nodeIndices).call(n,(function(e){var n=t.body.nodes[e];return n.x>=i.minX&&n.x<=i.maxX&&n.y>=i.minY&&n.y<=i.maxY}));Qp(a).call(a,(function(e){return t.selectionHandler.selectObject(t.body.nodes[e])}));var o=this.getPointer(e.center);this.selectionHandler.commitAndEmit(o,e),this.selectionHandler.generateClickEvent(`dragEnd`,e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit(`_requestRedraw`)}else{var s=this.drag.selection;s&&s.length?(Qp(s).call(s,(function(e){e.node.options.fixed.x=e.xFixed,e.node.options.fixed.y=e.yFixed})),this.selectionHandler.generateClickEvent(`dragEnd`,e,this.getPointer(e.center)),this.body.emitter.emit(`startSimulation`)):(this.selectionHandler.generateClickEvent(`dragEnd`,e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit(`_requestRedraw`))}}},{key:`onPinch`,value:function(e){var t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);var n=this.pinch.scale*e.scale;this.zoom(n,t)}},{key:`zoom`,value:function(e,t){if(!0===this.options.zoomView){var n=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);var r=void 0;this.drag!==void 0&&!0===this.drag.dragging&&(r=this.canvas.DOMtoCanvas(this.drag.pointer));var i=this.body.view.translation,a=e/n,o=(1-a)*t.x+i.x*a,s=(1-a)*t.y+i.y*a;if(this.body.view.scale=e,this.body.view.translation={x:o,y:s},r!=null){var c=this.canvas.canvasToDOM(r);this.drag.pointer.x=c.x,this.drag.pointer.y=c.y}this.body.emitter.emit(`_requestRedraw`),n<e?this.body.emitter.emit(`zoom`,{direction:`+`,scale:this.body.view.scale,pointer:t}):this.body.emitter.emit(`zoom`,{direction:`-`,scale:this.body.view.scale,pointer:t})}}},{key:`onMouseWheel`,value:function(e){if(!0===this.options.zoomView){if(e.deltaY!==0){var t=this.body.view.scale;t*=1+(e.deltaY<0?1:-1)*(.1*this.options.zoomSpeed);var n=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(t,n)}e.preventDefault()}}},{key:`onMouseMove`,value:function(e){var t=this,n=this.getPointer({x:e.clientX,y:e.clientY}),r=!1;this.popup!==void 0&&(!1===this.popup.hidden&&this._checkHidePopup(n),!1===this.popup.hidden&&(r=!0,this.popup.setPosition(n.x+3,n.y-5),this.popup.show())),this.options.keyboard.autoFocus&&!1===this.options.keyboard.bindToWindow&&!0===this.options.keyboard.enabled&&this.canvas.frame.focus(),!1===r&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=cg((function(){return t._checkShowPopup(n)}),this.options.tooltipDelay))),!0===this.options.hover&&this.selectionHandler.hoverObject(e,n)}},{key:`_checkShowPopup`,value:function(e){var t=this.canvas._XconvertDOMtoCanvas(e.x),n=this.canvas._YconvertDOMtoCanvas(e.y),r={left:t,top:n,right:t,bottom:n},i=this.popupObj===void 0?void 0:this.popupObj.id,a=!1,o=`node`;if(this.popupObj===void 0){for(var s,c=this.body.nodeIndices,l=this.body.nodes,u=[],d=0;d<c.length;d++)!0===(s=l[c[d]]).isOverlappingWith(r)&&(a=!0,s.getTitle()!==void 0&&u.push(c[d]));u.length>0&&(this.popupObj=l[u[u.length-1]],a=!0)}if(this.popupObj===void 0&&!1===a){for(var f,p=this.body.edgeIndices,m=this.body.edges,h=[],g=0;g<p.length;g++)!0===(f=m[p[g]]).isOverlappingWith(r)&&!0===f.connected&&f.getTitle()!==void 0&&h.push(p[g]);h.length>0&&(this.popupObj=m[h[h.length-1]],o=`edge`)}this.popupObj===void 0?this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit(`hidePopup`)):this.popupObj.id!==i&&(this.popup===void 0&&(this.popup=new ry(this.canvas.frame)),this.popup.popupTargetType=o,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit(`showPopup`,this.popupObj.id))}},{key:`_checkHidePopup`,value:function(e){var t=this.selectionHandler._pointerToPositionObject(e),n=!1;if(this.popup.popupTargetType===`node`){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&!0===(n=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t))){var r=this.selectionHandler.getNodeAt(e);n=r!==void 0&&r.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(n=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));!1===n&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit(`hidePopup`))}}]),e}();Ub(`Set`,(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),ux);var mT=r(j.Set),hT=_,gT=Gb,_T=lb.getWeakData,vT=Eb,yT=xn,bT=me,xT=Ce,ST=Cb,CT=gt,wT=Zi.set,TT=Zi.getterFor,ET=Vl.find,DT=Vl.findIndex,OT=hT([].splice),kT=0,AT=function(e){return e.frozen||=new jT},jT=function(){this.entries=[]},MT=function(e,t){return ET(e.entries,(function(e){return e[0]===t}))};jT.prototype={get:function(e){var t=MT(this,e);if(t)return t[1]},has:function(e){return!!MT(this,e)},set:function(e,t){var n=MT(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=DT(this.entries,(function(t){return t[0]===e}));return~t&&OT(this.entries,t,1),!!~t}};var NT,PT={getConstructor:function(e,t,n,r){var i=e((function(e,i){vT(e,a),wT(e,{type:t,id:kT++,frozen:void 0}),bT(i)||ST(i,e[r],{that:e,AS_ENTRIES:n})})),a=i.prototype,o=TT(t),s=function(e,t,n){var r=o(e),i=_T(yT(t),!0);return!0===i?AT(r).set(t,n):i[r.id]=n,e};return gT(a,{delete:function(e){var t=o(this);if(!xT(e))return!1;var n=_T(e);return!0===n?AT(t).delete(e):n&&CT(n,t.id)&&delete n[t.id]},has:function(e){var t=o(this);if(!xT(e))return!1;var n=_T(e);return!0===n?AT(t).has(e):n&&CT(n,t.id)}}),gT(a,n?{get:function(e){var t=o(this);if(xT(e)){var n=_T(e);return!0===n?AT(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return s(this,e,t)}}:{add:function(e){return s(this,e,!0)}}),i}},FT=qy,IT=a,LT=_,RT=Gb,zT=lb,BT=Ub,VT=PT,HT=Ce,UT=Zi.enforce,WT=o,GT=Pi,KT=Object,qT=Array.isArray,JT=KT.isExtensible,YT=KT.isFrozen,XT=KT.isSealed,ZT=KT.freeze,QT=KT.seal,$T={},eE={},tE=!IT.ActiveXObject&&`ActiveXObject`in IT,nE=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},rE=BT(`WeakMap`,nE,VT),iE=rE.prototype,aE=LT(iE.set);if(GT)if(tE){NT=VT.getConstructor(nE,`WeakMap`,!0),zT.enable();var oE=LT(iE.delete),sE=LT(iE.has),cE=LT(iE.get);RT(iE,{delete:function(e){if(HT(e)&&!JT(e)){var t=UT(this);return t.frozen||=new NT,oE(this,e)||t.frozen.delete(e)}return oE(this,e)},has:function(e){if(HT(e)&&!JT(e)){var t=UT(this);return t.frozen||=new NT,sE(this,e)||t.frozen.has(e)}return sE(this,e)},get:function(e){if(HT(e)&&!JT(e)){var t=UT(this);return t.frozen||=new NT,sE(this,e)?cE(this,e):t.frozen.get(e)}return cE(this,e)},set:function(e,t){if(HT(e)&&!JT(e)){var n=UT(this);n.frozen||=new NT,sE(this,e)?aE(this,e,t):n.frozen.set(e,t)}else aE(this,e,t);return this}})}else FT&&WT((function(){var e=ZT([]);return aE(new rE,e,1),!YT(e)}))&&RT(iE,{set:function(e,t){var n;return qT(e)&&(YT(e)?n=$T:XT(e)&&(n=eE)),aE(this,e,t),n===$T&&ZT(e),n===eE&&QT(e),this}});var lE,uE,dE,fE,pE,mE=r(j.WeakMap);function hE(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}function gE(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}function _E(e,t){var n=mp!==void 0&&Sc(e)||e[`@@iterator`];if(!n){if(Dp(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return vE(e,t);var r=bp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return tc(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vE(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
38
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function vE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yE(e,t){var n,r=new mT,i=_E(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;e.has(a)||r.add(a)}}catch(e){i.e(e)}finally{i.f()}return r}var bE=function(){function e(){B(this,e),lE.set(this,new mT),uE.set(this,new mT)}return V(e,[{key:`size`,get:function(){return hE(this,uE,`f`).size}},{key:`add`,value:function(){for(var e=[...arguments],t=0,n=e;t<n.length;t++){var r=n[t];hE(this,uE,`f`).add(r)}}},{key:`delete`,value:function(){for(var e=[...arguments],t=0,n=e;t<n.length;t++){var r=n[t];hE(this,uE,`f`).delete(r)}}},{key:`clear`,value:function(){hE(this,uE,`f`).clear()}},{key:`getSelection`,value:function(){return pp(hE(this,uE,`f`))}},{key:`getChanges`,value:function(){return{added:pp(yE(hE(this,lE,`f`),hE(this,uE,`f`))),deleted:pp(yE(hE(this,uE,`f`),hE(this,lE,`f`))),previous:pp(new mT(hE(this,lE,`f`))),current:pp(new mT(hE(this,uE,`f`)))}}},{key:`commit`,value:function(){var e=this.getChanges();gE(this,lE,hE(this,uE,`f`),`f`),gE(this,uE,new mT(hE(this,lE,`f`)),`f`);var t,n=_E(e.added);try{for(n.s();!(t=n.n()).done;)t.value.select()}catch(e){n.e(e)}finally{n.f()}var r,i=_E(e.deleted);try{for(i.s();!(r=i.n()).done;)r.value.unselect()}catch(e){i.e(e)}finally{i.f()}return e}}]),e}();lE=new mE,uE=new mE;var xE=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};B(this,e),dE.set(this,new bE),fE.set(this,new bE),pE.set(this,void 0),gE(this,pE,t,`f`)}return V(e,[{key:`sizeNodes`,get:function(){return hE(this,dE,`f`).size}},{key:`sizeEdges`,get:function(){return hE(this,fE,`f`).size}},{key:`getNodes`,value:function(){return hE(this,dE,`f`).getSelection()}},{key:`getEdges`,value:function(){return hE(this,fE,`f`).getSelection()}},{key:`addNodes`,value:function(){var e;(e=hE(this,dE,`f`)).add.apply(e,arguments)}},{key:`addEdges`,value:function(){var e;(e=hE(this,fE,`f`)).add.apply(e,arguments)}},{key:`deleteNodes`,value:function(e){hE(this,dE,`f`).delete(e)}},{key:`deleteEdges`,value:function(e){hE(this,fE,`f`).delete(e)}},{key:`clear`,value:function(){hE(this,dE,`f`).clear(),hE(this,fE,`f`).clear()}},{key:`commit`,value:function(){for(var e,t,n={nodes:hE(this,dE,`f`).commit(),edges:hE(this,fE,`f`).commit()},r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return(e=hE(this,pE,`f`)).call.apply(e,yp(t=[this,n]).call(t,i)),n}}]),e}();function SE(e,t){var n=mp!==void 0&&Sc(e)||e[`@@iterator`];if(!n){if(Dp(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return CE(e,t);var r=bp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return tc(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return CE(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
39
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function CE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}dE=new mE,fE=new mE,pE=new mE;var wE=function(){function e(t,n){var r=this;B(this,e),this.body=t,this.canvas=n,this._selectionAccumulator=new xE,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},Nr(this.options,this.defaultOptions),this.body.emitter.on(`_dataChanged`,(function(){r.updateSelection()}))}return V(e,[{key:`setOptions`,value:function(e){e!==void 0&&Dv([`multiselect`,`hoverConnectedEdges`,`selectable`,`selectConnectedEdges`],this.options,e)}},{key:`selectOnPoint`,value:function(e){var t=!1;if(!0===this.options.selectable){var n=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),n!==void 0&&(t=this.selectObject(n)),this.body.emitter.emit(`_requestRedraw`)}return t}},{key:`selectAdditionalOnPoint`,value:function(e){var t=!1;if(!0===this.options.selectable){var n=this.getNodeAt(e)||this.getEdgeAt(e);n!==void 0&&(t=!0,!0===n.isSelected()?this.deselectObject(n):this.selectObject(n),this.body.emitter.emit(`_requestRedraw`))}return t}},{key:`_initBaseEvent`,value:function(e,t){var n={};return n.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},n.event=e,n}},{key:`generateClickEvent`,value:function(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0&&arguments[4],a=this._initBaseEvent(t,n);if(!0===i)a.nodes=[],a.edges=[];else{var o=this.getSelection();a.nodes=o.nodes,a.edges=o.edges}r!==void 0&&(a.previousSelection=r),e==`click`&&(a.items=this.getClickedItems(n)),t.controlEdge!==void 0&&(a.controlEdge=t.controlEdge),this.body.emitter.emit(e,a)}},{key:`selectObject`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;if(e!==void 0){if(e instanceof LC){var n;!0===t&&(n=this._selectionAccumulator).addEdges.apply(n,pp(e.edges)),this._selectionAccumulator.addNodes(e)}else this._selectionAccumulator.addEdges(e);return!0}return!1}},{key:`deselectObject`,value:function(e){!0===e.isSelected()&&(e.selected=!1,this._removeFromSelection(e))}},{key:`_getAllNodesOverlappingWith`,value:function(e){for(var t=[],n=this.body.nodes,r=0;r<this.body.nodeIndices.length;r++){var i=this.body.nodeIndices[r];n[i].isOverlappingWith(e)&&t.push(i)}return t}},{key:`_pointerToPositionObject`,value:function(e){var t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}},{key:`getNodeAt`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this._pointerToPositionObject(e),r=this._getAllNodesOverlappingWith(n);return r.length>0?!0===t?this.body.nodes[r[r.length-1]]:r[r.length-1]:void 0}},{key:`_getEdgesOverlappingWith`,value:function(e,t){for(var n=this.body.edges,r=0;r<this.body.edgeIndices.length;r++){var i=this.body.edgeIndices[r];n[i].isOverlappingWith(e)&&t.push(i)}}},{key:`_getAllEdgesOverlappingWith`,value:function(e){var t=[];return this._getEdgesOverlappingWith(e,t),t}},{key:`getEdgeAt`,value:function(e){for(var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.canvas.DOMtoCanvas(e),r=10,i=null,a=this.body.edges,o=0;o<this.body.edgeIndices.length;o++){var s=this.body.edgeIndices[o],c=a[s];if(c.connected){var l=c.from.x,u=c.from.y,d=c.to.x,f=c.to.y,p=c.edgeType.getDistanceToEdge(l,u,d,f,n.x,n.y);p<r&&(i=s,r=p)}}return i===null?void 0:!0===t?this.body.edges[i]:i}},{key:`_addToHover`,value:function(e){e instanceof LC?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}},{key:`_removeFromSelection`,value:function(e){var t;e instanceof LC?(this._selectionAccumulator.deleteNodes(e),(t=this._selectionAccumulator).deleteEdges.apply(t,pp(e.edges))):this._selectionAccumulator.deleteEdges(e)}},{key:`unselectAll`,value:function(){this._selectionAccumulator.clear()}},{key:`getSelectedNodeCount`,value:function(){return this._selectionAccumulator.sizeNodes}},{key:`getSelectedEdgeCount`,value:function(){return this._selectionAccumulator.sizeEdges}},{key:`_hoverConnectedEdges`,value:function(e){for(var t=0;t<e.edges.length;t++){var n=e.edges[t];n.hover=!0,this._addToHover(n)}}},{key:`emitBlurEvent`,value:function(e,t,n){var r=this._initBaseEvent(e,t);!0===n.hover&&(n.hover=!1,n instanceof LC?(r.node=n.id,this.body.emitter.emit(`blurNode`,r)):(r.edge=n.id,this.body.emitter.emit(`blurEdge`,r)))}},{key:`emitHoverEvent`,value:function(e,t,n){var r=this._initBaseEvent(e,t),i=!1;return!1===n.hover&&(n.hover=!0,this._addToHover(n),i=!0,n instanceof LC?(r.node=n.id,this.body.emitter.emit(`hoverNode`,r)):(r.edge=n.id,this.body.emitter.emit(`hoverEdge`,r))),i}},{key:`hoverObject`,value:function(e,t){var n=this.getNodeAt(t);n===void 0&&(n=this.getEdgeAt(t));var r=!1;for(var i in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,i)&&(n===void 0||n instanceof LC&&n.id!=i||n instanceof Pw)&&(this.emitBlurEvent(e,t,this.hoverObj.nodes[i]),delete this.hoverObj.nodes[i],r=!0);for(var a in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,a)&&(!0===r?(this.hoverObj.edges[a].hover=!1,delete this.hoverObj.edges[a]):(n===void 0||n instanceof Pw&&n.id!=a||n instanceof LC&&!n.hover)&&(this.emitBlurEvent(e,t,this.hoverObj.edges[a]),delete this.hoverObj.edges[a],r=!0));if(n!==void 0){var o=Ip(this.hoverObj.edges).length,s=Ip(this.hoverObj.nodes).length;(r||n instanceof Pw&&o===0&&s===0||n instanceof LC&&o===0&&s===0)&&(r=this.emitHoverEvent(e,t,n)),n instanceof LC&&!0===this.options.hoverConnectedEdges&&this._hoverConnectedEdges(n)}!0===r&&this.body.emitter.emit(`_requestRedraw`)}},{key:`commitWithoutEmitting`,value:function(){this._selectionAccumulator.commit()}},{key:`commitAndEmit`,value:function(e,t){var n=!1,r=this._selectionAccumulator.commit(),i={nodes:r.nodes.previous,edges:r.edges.previous};r.edges.deleted.length>0&&(this.generateClickEvent(`deselectEdge`,t,e,i),n=!0),r.nodes.deleted.length>0&&(this.generateClickEvent(`deselectNode`,t,e,i),n=!0),r.nodes.added.length>0&&(this.generateClickEvent(`selectNode`,t,e),n=!0),r.edges.added.length>0&&(this.generateClickEvent(`selectEdge`,t,e),n=!0),!0===n&&this.generateClickEvent(`select`,t,e)}},{key:`getSelection`,value:function(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}},{key:`getSelectedNodes`,value:function(){return this._selectionAccumulator.getNodes()}},{key:`getSelectedEdges`,value:function(){return this._selectionAccumulator.getEdges()}},{key:`getSelectedNodeIds`,value:function(){var e;return Np(e=this._selectionAccumulator.getNodes()).call(e,(function(e){return e.id}))}},{key:`getSelectedEdgeIds`,value:function(){var e;return Np(e=this._selectionAccumulator.getEdges()).call(e,(function(e){return e.id}))}},{key:`setSelection`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw TypeError(`Selection must be an object with nodes and/or edges properties`);if((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes){var n,r=SE(e.nodes);try{for(r.s();!(n=r.n()).done;){var i=n.value,a=this.body.nodes[i];if(!a)throw RangeError(`Node with id "`+i+`" not found`);this.selectObject(a,t.highlightEdges)}}catch(e){r.e(e)}finally{r.f()}}if(e.edges){var o,s=SE(e.edges);try{for(s.s();!(o=s.n()).done;){var c=o.value,l=this.body.edges[c];if(!l)throw RangeError(`Edge with id "`+c+`" not found`);this.selectObject(l)}}catch(e){s.e(e)}finally{s.f()}}this.body.emitter.emit(`_requestRedraw`),this._selectionAccumulator.commit()}},{key:`selectNodes`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(!e||e.length===void 0)throw`Selection must be an array with ids`;this.setSelection({nodes:e},{highlightEdges:t})}},{key:`selectEdges`,value:function(e){if(!e||e.length===void 0)throw`Selection must be an array with ids`;this.setSelection({edges:e})}},{key:`updateSelection`,value:function(){for(var e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(var t in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,t.id)||this._selectionAccumulator.deleteEdges(t)}},{key:`getClickedItems`,value:function(e){for(var t=this.canvas.DOMtoCanvas(e),n=[],r=this.body.nodeIndices,i=this.body.nodes,a=r.length-1;a>=0;a--){var o=i[r[a]].getItemsOnPoint(t);n.push.apply(n,o)}for(var s=this.body.edgeIndices,c=this.body.edges,l=s.length-1;l>=0;l--){var u=c[s[l]].getItemsOnPoint(t);n.push.apply(n,u)}return n}}]),e}(),TE=hl,EE=Math.floor,DE=function(e,t){var n=e.length,r=EE(n/2);return n<8?OE(e,t):kE(e,DE(TE(e,0,r),t),DE(TE(e,r),t),t)},OE=function(e,t){for(var n,r,i=e.length,a=1;a<i;){for(r=a,n=e[a];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==a++&&(e[r]=n)}return e},kE=function(e,t,n,r){for(var i=t.length,a=n.length,o=0,s=0;o<i||s<a;)e[o+s]=o<i&&s<a?r(t[o],n[s])<=0?t[o++]:n[s++]:o<i?t[o++]:n[s++];return e},AE=DE,jE=F.match(/firefox\/(\d+)/i),ME=!!jE&&+jE[1],NE=/MSIE|Trident/.test(F),PE=F.match(/AppleWebKit\/(\d+)\./),FE=!!PE&&+PE[1],IE=I,LE=_,RE=Ye,zE=pt,BE=rr,VE=um,HE=Si,UE=o,WE=AE,GE=Hp,KE=ME,qE=NE,JE=Ne,YE=FE,XE=[],ZE=LE(XE.sort),QE=LE(XE.push),$E=UE((function(){XE.sort(void 0)})),eD=UE((function(){XE.sort(null)})),tD=GE(`sort`),nD=!UE((function(){if(JE)return JE<70;if(!(KE&&KE>3)){if(qE)return!0;if(YE)return YE<603;var e,t,n,r,i=``;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)XE.push({k:t+r,v:n})}for(XE.sort((function(e,t){return t.v-e.v})),r=0;r<XE.length;r++)t=XE[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return i!==`DGBEFHACIJK`}}));IE({target:`Array`,proto:!0,forced:$E||!eD||!tD||!nD},{sort:function(e){e!==void 0&&RE(e);var t=zE(this);if(nD)return e===void 0?ZE(t):ZE(t,e);var n,r,i=[],a=BE(t);for(r=0;r<a;r++)r in t&&QE(i,t[r]);for(WE(i,function(e){return function(t,n){return n===void 0?-1:t===void 0?1:e===void 0?HE(t)>HE(n)?1:-1:+e(t,n)||0}}(e)),n=BE(i),r=0;r<n;)t[r]=i[r++];for(;r<a;)VE(t,r++);return t}});var rD=Jr(`Array`).sort,iD=P,aD=rD,oD=Array.prototype,sD=r(function(e){var t=e.sort;return e===oD||iD(oD,e)&&t===oD.sort?aD:t}),cD=Ye,lD=pt,uD=pe,dD=rr,fD=TypeError,pD=function(e){return function(t,n,r,i){cD(n);var a=lD(t),o=uD(a),s=dD(a),c=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw new fD(`Reduce of empty array with no initial value`)}for(;e?c>=0:s>c;c+=l)c in o&&(i=n(i,o[c],c,a));return i}},mD={left:pD(!1),right:pD(!0)},hD=x(a.process)===`process`,gD=mD.left;I({target:`Array`,proto:!0,forced:!hD&&Ne>79&&Ne<83||!Hp(`reduce`)},{reduce:function(e){var t=arguments.length;return gD(this,e,t,t>1?arguments[1]:void 0)}});var _D=Jr(`Array`).reduce,vD=P,yD=_D,bD=Array.prototype,xD=r(function(e){var t=e.reduce;return e===bD||vD(bD,e)&&t===bD.reduce?yD:t});function SD(e){var t=function(){if(typeof Reflect>`u`||!K||K.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(K(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=J(e);if(t){var i=J(this).constructor;n=K(r,arguments,i)}else n=r.apply(this,arguments);return JS(this,n)}}var CD=function(){function e(){B(this,e)}return V(e,[{key:`abstract`,value:function(){throw Error(`Can't instantiate abstract class!`)}},{key:`fake_use`,value:function(){}},{key:`curveType`,value:function(){return this.abstract()}},{key:`getPosition`,value:function(e){return this.fake_use(e),this.abstract()}},{key:`setPosition`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,n),this.abstract()}},{key:`getTreeSize`,value:function(e){return this.fake_use(e),this.abstract()}},{key:`sort`,value:function(e){this.fake_use(e),this.abstract()}},{key:`fix`,value:function(e,t){this.fake_use(e,t),this.abstract()}},{key:`shift`,value:function(e,t){this.fake_use(e,t),this.abstract()}}]),e}(),wD=function(e){q(n,e);var t=SD(n);function n(e){var r;return B(this,n),(r=t.call(this)).layout=e,r}return V(n,[{key:`curveType`,value:function(){return`horizontal`}},{key:`getPosition`,value:function(e){return e.x}},{key:`setPosition`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;n!==void 0&&this.layout.hierarchical.addToOrdering(e,n),e.x=t}},{key:`getTreeSize`,value:function(e){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}},{key:`sort`,value:function(e){sD(e).call(e,(function(e,t){return e.x-t.x}))}},{key:`fix`,value:function(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}},{key:`shift`,value:function(e,t){this.layout.body.nodes[e].x+=t}}]),n}(CD),TD=function(e){q(n,e);var t=SD(n);function n(e){var r;return B(this,n),(r=t.call(this)).layout=e,r}return V(n,[{key:`curveType`,value:function(){return`vertical`}},{key:`getPosition`,value:function(e){return e.y}},{key:`setPosition`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;n!==void 0&&this.layout.hierarchical.addToOrdering(e,n),e.y=t}},{key:`getTreeSize`,value:function(e){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}},{key:`sort`,value:function(e){sD(e).call(e,(function(e,t){return e.y-t.y}))}},{key:`fix`,value:function(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}},{key:`shift`,value:function(e,t){this.layout.body.nodes[e].y+=t}}]),n}(CD),ED=Vl.every;I({target:`Array`,proto:!0,forced:!Hp(`every`)},{every:function(e){return ED(this,e,arguments.length>1?arguments[1]:void 0)}});var DD=Jr(`Array`).every,OD=P,kD=DD,AD=Array.prototype,jD=r(function(e){var t=e.every;return e===AD||OD(AD,e)&&t===AD.every?kD:t});function MD(e,t){var n=mp!==void 0&&Sc(e)||e[`@@iterator`];if(!n){if(Dp(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return ND(e,t);var r=bp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return tc(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ND(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
40
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function ND(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function PD(e,t){var n=new mT;return Qp(e).call(e,(function(e){var t;Qp(t=e.edges).call(t,(function(e){e.connected&&n.add(e)}))})),Qp(n).call(n,(function(e){var n=e.from.id,r=e.to.id;t[n]??(t[n]=0),(t[r]==null||t[n]>=t[r])&&(t[r]=t[n]+1)})),t}function FD(e,t,n,r){var i,a,o=Bh(null),s=xD(i=pp(bS(r).call(r))).call(i,(function(e,t){return e+1+t.edges.length}),0),c=n+`Id`,l=n===`to`?1:-1,u=MD(r);try{var d,f=function(){var i=fp(a.value,2),u=i[0],d=i[1];if(!r.has(u)||!e(d))return 0;o[u]=0;for(var f,p,m=[d],h=0,g=function(){var e,i;if(!r.has(u))return 0;var a=o[f.id]+l;if(Qp(e=oh(i=f.edges).call(i,(function(e){return e.connected&&e.to!==e.from&&e[n]!==f&&r.has(e.toId)&&r.has(e.fromId)}))).call(e,(function(e){var r=e[c],i=o[r];(i==null||t(a,i))&&(o[r]=a,m.push(e[n]))})),h>s)return{v:{v:PD(r,o)}};++h};f=m.pop();)if((p=g())!==0&&p)return p.v};for(u.s();!(a=u.n()).done;)if((d=f())!==0&&d)return d.v}catch(e){u.e(e)}finally{u.f()}return o}var ID=function(){function e(){B(this,e),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return V(e,[{key:`addRelation`,value:function(e,t){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),this.parentReference[t]===void 0&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}},{key:`checkIfTree`,value:function(){for(var e in this.parentReference)if(this.parentReference[e].length>1)return void(this.isTree=!1);this.isTree=!0}},{key:`numTrees`,value:function(){return this.treeIndex+1}},{key:`setTreeIndex`,value:function(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}},{key:`ensureLevel`,value:function(e){this.levels[e]===void 0&&(this.levels[e]=0)}},{key:`getMaxLevel`,value:function(e){var t=this,n={};return function e(r){if(n[r]!==void 0)return n[r];var i=t.levels[r];if(t.childrenReference[r]){var a=t.childrenReference[r];if(a.length>0)for(var o=0;o<a.length;o++)i=Math.max(i,e(a[o]))}return n[r]=i,i}(e)}},{key:`levelDownstream`,value:function(e,t){this.levels[t.id]===void 0&&(this.levels[e.id]===void 0&&(this.levels[e.id]=0),this.levels[t.id]=this.levels[e.id]+1)}},{key:`setMinLevelToZero`,value:function(e){var t=1e9;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.levels[n]!==void 0&&(t=Math.min(this.levels[n],t));for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.levels[r]!==void 0&&(this.levels[r]-=t)}},{key:`getTreeSize`,value:function(e,t){var n=1e9,r=-1e9,i=1e9,a=-1e9;for(var o in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,o)&&this.trees[o]===t){var s=e[o];n=Math.min(s.x,n),r=Math.max(s.x,r),i=Math.min(s.y,i),a=Math.max(s.y,a)}return{min_x:n,max_x:r,min_y:i,max_y:a}}},{key:`hasSameParent`,value:function(e,t){var n=this.parentReference[e.id],r=this.parentReference[t.id];if(n===void 0||r===void 0)return!1;for(var i=0;i<n.length;i++)for(var a=0;a<r.length;a++)if(n[i]==r[a])return!0;return!1}},{key:`inSameSubNetwork`,value:function(e,t){return this.trees[e.id]===this.trees[t.id]}},{key:`getLevels`,value:function(){return Ip(this.distributionOrdering)}},{key:`addToOrdering`,value:function(e,t){this.distributionOrdering[t]===void 0&&(this.distributionOrdering[t]=[]);var n=!1,r=this.distributionOrdering[t];for(var i in r)if(r[i]===e){n=!0;break}n||(this.distributionOrdering[t].push(e),this.distributionIndex[e.id]=this.distributionOrdering[t].length-1)}}]),e}(),LD=function(){function e(t){B(this,e),this.body=t,this._resetRNG(Math.random()+`:`+Bp()),this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,clusterThreshold:150,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:`UD`,sortMethod:`hubsize`}},Nr(this.options,this.defaultOptions),this.bindEventListeners()}return V(e,[{key:`bindEventListeners`,value:function(){var e=this;this.body.emitter.on(`_dataChanged`,(function(){e.setupHierarchicalLayout()})),this.body.emitter.on(`_dataLoaded`,(function(){e.layoutNetwork()})),this.body.emitter.on(`_resetHierarchicalLayout`,(function(){e.setupHierarchicalLayout()})),this.body.emitter.on(`_adjustEdgesForHierarchicalLayout`,(function(){if(!0===e.options.hierarchical.enabled){var t=e.direction.curveType();e.body.emitter.emit(`_forceDisableDynamicCurves`,t,!1)}}))}},{key:`setOptions`,value:function(e,t){if(e!==void 0){var n=this.options.hierarchical,r=n.enabled;if(Dv([`randomSeed`,`improvedLayout`,`clusterThreshold`],this.options,e),Hv(this.options,e,`hierarchical`),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),!0===n.enabled)return!0===r&&this.body.emitter.emit(`refresh`,!0),n.direction===`RL`||n.direction===`DU`?n.levelSeparation>0&&(n.levelSeparation*=-1):n.levelSeparation<0&&(n.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit(`_resetHierarchicalLayout`),this.adaptAllOptionsForHierarchicalLayout(t);if(!0===r)return this.body.emitter.emit(`refresh`),kv(t,this.optionsBackup)}return t}},{key:`_resetRNG`,value:function(e){this.initialRandomSeed=e,this._rng=hv(this.initialRandomSeed)}},{key:`adaptAllOptionsForHierarchicalLayout`,value:function(e){if(!0===this.options.hierarchical.enabled){var t=this.optionsBackup.physics;e.physics===void 0||!0===e.physics?(e.physics={enabled:t.enabled===void 0||t.enabled,solver:`hierarchicalRepulsion`},t.enabled=t.enabled===void 0||t.enabled,t.solver=t.solver||`barnesHut`):Cf(e.physics)===`object`?(t.enabled=e.physics.enabled===void 0||e.physics.enabled,t.solver=e.physics.solver||`barnesHut`,e.physics.solver=`hierarchicalRepulsion`):!1!==e.physics&&(t.solver=`barnesHut`,e.physics={solver:`hierarchicalRepulsion`});var n=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:`dynamic`}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:`dynamic`}},e.edges.smooth=!1;else if(typeof e.edges.smooth==`boolean`)this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:n};else{var r=e.edges.smooth;r.type!==void 0&&r.type!==`dynamic`&&(n=r.type),this.optionsBackup.edges={smooth:{enabled:r.enabled===void 0||r.enabled,type:r.type===void 0?`dynamic`:r.type,roundness:r.roundness===void 0?.5:r.roundness,forceDirection:r.forceDirection!==void 0&&r.forceDirection}},e.edges.smooth={enabled:r.enabled===void 0||r.enabled,type:n,roundness:r.roundness===void 0?.5:r.roundness,forceDirection:r.forceDirection!==void 0&&r.forceDirection}}this.body.emitter.emit(`_forceDisableDynamicCurves`,n)}return e}},{key:`positionInitially`,value:function(e){if(!0!==this.options.hierarchical.enabled){this._resetRNG(this.initialRandomSeed);for(var t=e.length+50,n=0;n<e.length;n++){var r=e[n],i=2*Math.PI*this._rng();r.x===void 0&&(r.x=t*Math.cos(i)),r.y===void 0&&(r.y=t*Math.sin(i))}}}},{key:`layoutNetwork`,value:function(){if(!0!==this.options.hierarchical.enabled&&!0===this.options.improvedLayout){for(var e=this.body.nodeIndices,t=0,n=0;n<e.length;n++)!0===this.body.nodes[e[n]].predefinedPosition&&(t+=1);if(t<.5*e.length){var r=0,i=this.options.clusterThreshold,a={clusterNodeProperties:{shape:`ellipse`,label:``,group:``,font:{multi:!1}},clusterEdgeProperties:{label:``,font:{multi:!1},smooth:{enabled:!1}}};if(e.length>i){for(var o=e.length;e.length>i&&r<=10;){r+=1;var s=e.length;if(r%3==0?this.body.modules.clustering.clusterBridges(a):this.body.modules.clustering.clusterOutliers(a),s==e.length&&r%3!=0)return this._declusterAll(),this.body.emitter.emit(`_layoutFailed`),void console.info(`This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.`)}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*o)})}r>10&&console.info(`The clustering didn't succeed within the amount of interations allowed, progressing with partial result.`),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();for(var c=0;c<e.length;c++){var l=this.body.nodes[e[c]];!1===l.predefinedPosition&&(l.x+=70*(.5-this._rng()),l.y+=70*(.5-this._rng()))}this._declusterAll(),this.body.emitter.emit(`_repositionBezierNodes`)}}}},{key:`_shiftToCenter`,value:function(){for(var e=$w.getRangeCore(this.body.nodes,this.body.nodeIndices),t=$w.findCenter(e),n=0;n<this.body.nodeIndices.length;n++){var r=this.body.nodes[this.body.nodeIndices[n]];r.x-=t.x,r.y-=t.y}}},{key:`_declusterAll`,value:function(){for(var e=!0;!0===e;){e=!1;for(var t=0;t<this.body.nodeIndices.length;t++)!0===this.body.nodes[this.body.nodeIndices[t]].isCluster&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[t],{},!1));!0===e&&this.body.emitter.emit(`_dataChanged`)}}},{key:`getSeed`,value:function(){return this.initialRandomSeed}},{key:`setupHierarchicalLayout`,value:function(){if(!0===this.options.hierarchical.enabled&&this.body.nodeIndices.length>0){var e,t,n=!1,r=!1;for(t in this.lastNodeOnLevel={},this.hierarchical=new ID,this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&((e=this.body.nodes[t]).options.level===void 0?r=!0:(n=!0,this.hierarchical.levels[t]=e.options.level));if(!0===r&&!0===n)throw Error(`To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.`);if(!0===r){var i=this.options.hierarchical.sortMethod;i===`hubsize`?this._determineLevelsByHubsize():i===`directed`?this._determineLevelsDirected():i===`custom`&&this._determineLevelsCustomCallback()}for(var a in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,a)&&this.hierarchical.ensureLevel(a);var o=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(o),this._condenseHierarchy(),this._shiftToCenter()}}},{key:`_condenseHierarchy`,value:function(){var e=this,t=!1,n={},r=function(t,n){var r=e.hierarchical.trees;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&r[i]===t&&e.direction.shift(i,n)},i=function(){for(var t=[],n=0;n<e.hierarchical.numTrees();n++)t.push(e.direction.getTreeSize(n));return t},a=function t(n,r){if(!r[n.id]&&(r[n.id]=!0,e.hierarchical.childrenReference[n.id])){var i=e.hierarchical.childrenReference[n.id];if(i.length>0)for(var a=0;a<i.length;a++)t(e.body.nodes[i[a]],r)}},o=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,r=1e9,i=1e9,a=1e9,o=-1e9;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){var c=e.body.nodes[s],l=e.hierarchical.levels[c.id],u=e.direction.getPosition(c),d=fp(e._getSpaceAroundNode(c,t),2),f=d[0],p=d[1];r=Math.min(f,r),i=Math.min(p,i),l<=n&&(a=Math.min(u,a),o=Math.max(u,o))}return[a,o,r,i]},s=function(t,n,r){for(var i=e.hierarchical,a=0;a<n.length;a++){var o=n[a],s=i.distributionOrdering[o];if(s.length>1)for(var c=0;c<s.length-1;c++){var l=s[c],u=s[c+1];i.hasSameParent(l,u)&&i.inSameSubNetwork(l,u)&&t(l,u,r)}}},c=function(n,r){var i=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=e.direction.getPosition(n),c=e.direction.getPosition(r),l=Math.abs(c-s),u=e.options.hierarchical.nodeSpacing;if(l>u){var d={},f={};a(n,d),a(r,f);var p=function(t,n){var r=e.hierarchical.getMaxLevel(t.id),i=e.hierarchical.getMaxLevel(n.id);return Math.min(r,i)}(n,r),m=o(d,p),h=o(f,p),g=m[1],_=h[0],v=h[2];if(Math.abs(g-_)>u){var y=g-_+u;y<-v+u&&(y=-v+u),y<0&&(e._shiftBlock(r.id,y),t=!0,!0===i&&e._centerParent(r))}}},l=function(r,i){for(var s=i.id,c=i.edges,l=e.hierarchical.levels[i.id],u=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,d={},f=[],p=0;p<c.length;p++){var m=c[p];if(m.toId!=m.fromId){var h=m.toId==s?m.from:m.to;d[c[p].id]=h,e.hierarchical.levels[h.id]<l&&f.push(m)}}var g=function(t,n){for(var r=0,i=0;i<n.length;i++)if(d[n[i].id]!==void 0){var a=e.direction.getPosition(d[n[i].id])-t;r+=a/Math.sqrt(a*a+u)}return r},_=function(t,n){for(var r=0,i=0;i<n.length;i++)if(d[n[i].id]!==void 0){var a=e.direction.getPosition(d[n[i].id])-t;r-=u*(a*a+u)**-1.5}return r},v=function(t,n){for(var r=e.direction.getPosition(i),a={},o=0;o<t;o++){var s=g(r,n),c=_(r,n);if(a[r-=Math.max(-40,Math.min(40,Math.round(s/c)))]!==void 0)break;a[r]=o}return r},y=v(r,f);(function(r){var s=e.direction.getPosition(i);if(n[i.id]===void 0){var c={};a(i,c),n[i.id]=c}var l=o(n[i.id]),u=l[2],d=l[3],f=r-s,p=0;f>0?p=Math.min(f,d-e.options.hierarchical.nodeSpacing):f<0&&(p=-Math.min(-f,u-e.options.hierarchical.nodeSpacing)),p!=0&&(e._shiftBlock(i.id,p),t=!0)})(y),function(n){var r=e.direction.getPosition(i),a=fp(e._getSpaceAroundNode(i),2),o=a[0],s=a[1],c=n-r,l=r;c>0?l=Math.min(r+(s-e.options.hierarchical.nodeSpacing),n):c<0&&(l=Math.max(r-(o-e.options.hierarchical.nodeSpacing),n)),l!==r&&(e.direction.setPosition(i,l),t=!0)}(y=v(r,c))};!0===this.options.hierarchical.blockShifting&&(function(n){var r=e.hierarchical.getLevels();r=sm(r).call(r);for(var i=0;i<n&&(t=!1,s(c,r,!0),!0===t);i++);}(5),function(){for(var t in e.body.nodes)Object.prototype.hasOwnProperty.call(e.body.nodes,t)&&e._centerParent(e.body.nodes[t])}()),!0===this.options.hierarchical.edgeMinimization&&function(n){var r=e.hierarchical.getLevels();r=sm(r).call(r);for(var i=0;i<n;i++){t=!1;for(var a=0;a<r.length;a++)for(var o=r[a],s=e.hierarchical.distributionOrdering[o],c=0;c<s.length;c++)l(1e3,s[c]);if(!0!==t)break}}(20),!0===this.options.hierarchical.parentCentralization&&function(){var t=e.hierarchical.getLevels();t=sm(t).call(t);for(var n=0;n<t.length;n++)for(var r=t[n],i=e.hierarchical.distributionOrdering[r],a=0;a<i.length;a++)e._centerParent(i[a])}(),function(){for(var t=i(),n=0,a=0;a<t.length-1;a++)n+=t[a].max-t[a+1].min+e.options.hierarchical.treeSpacing,r(a+1,n)}()}},{key:`_getSpaceAroundNode`,value:function(e,t){var n=!0;t===void 0&&(n=!1);var r=this.hierarchical.levels[e.id];if(r!==void 0){var i=this.hierarchical.distributionIndex[e.id],a=this.direction.getPosition(e),o=this.hierarchical.distributionOrdering[r],s=1e9,c=1e9;if(i!==0){var l=o[i-1];(!0===n&&t[l.id]===void 0||!1===n)&&(s=a-this.direction.getPosition(l))}if(i!=o.length-1){var u=o[i+1];if(!0===n&&t[u.id]===void 0||!1===n){var d=this.direction.getPosition(u);c=Math.min(c,d-a)}}return[s,c]}return[0,0]}},{key:`_centerParent`,value:function(e){if(this.hierarchical.parentReference[e.id])for(var t=this.hierarchical.parentReference[e.id],n=0;n<t.length;n++){var r=t[n],i=this.body.nodes[r],a=this.hierarchical.childrenReference[r];if(a!==void 0){var o=this._getCenterPosition(a),s=this.direction.getPosition(i),c=fp(this._getSpaceAroundNode(i),2),l=c[0],u=c[1],d=s-o;(d<0&&Math.abs(d)<u-this.options.hierarchical.nodeSpacing||d>0&&Math.abs(d)<l-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(i,o)}}}},{key:`_placeNodesByHierarchy`,value:function(e){for(var t in this.positionedNodes={},e)if(Object.prototype.hasOwnProperty.call(e,t)){var n,r=Ip(e[t]);r=this._indexArrayToNodes(r),sD(n=this.direction).call(n,r);for(var i=0,a=0;a<r.length;a++){var o=r[a];if(this.positionedNodes[o.id]===void 0){var s=this.options.hierarchical.nodeSpacing,c=s*i;i>0&&(c=this.direction.getPosition(r[a-1])+s),this.direction.setPosition(o,c,t),this._validatePositionAndContinue(o,t,c),i++}}}}},{key:`_placeBranchNodes`,value:function(e,t){var n,r=this.hierarchical.childrenReference[e];if(r!==void 0){for(var i=[],a=0;a<r.length;a++)i.push(this.body.nodes[r[a]]);sD(n=this.direction).call(n,i);for(var o=0;o<i.length;o++){var s=i[o],c=this.hierarchical.levels[s.id];if(!(c>t&&this.positionedNodes[s.id]===void 0))return;var l=this.options.hierarchical.nodeSpacing,u=void 0;u=o===0?this.direction.getPosition(this.body.nodes[e]):this.direction.getPosition(i[o-1])+l,this.direction.setPosition(s,u,c),this._validatePositionAndContinue(s,c,u)}var d=this._getCenterPosition(i);this.direction.setPosition(this.body.nodes[e],d,t)}}},{key:`_validatePositionAndContinue`,value:function(e,t,n){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){var r=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(n-r<this.options.hierarchical.nodeSpacing){var i=r+this.options.hierarchical.nodeSpacing-n,a=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(a.withChild,i)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}}},{key:`_indexArrayToNodes`,value:function(e){for(var t=[],n=0;n<e.length;n++)t.push(this.body.nodes[e[n]]);return t}},{key:`_getDistribution`,value:function(){var e,t,n={};for(e in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,e)){t=this.body.nodes[e];var r=this.hierarchical.levels[e]===void 0?0:this.hierarchical.levels[e];this.direction.fix(t,r),n[r]===void 0&&(n[r]={}),n[r][e]=t}return n}},{key:`_getActiveEdges`,value:function(e){var t=this,n=[];return U(e.edges,(function(e){var r;H(r=t.body.edgeIndices).call(r,e.id)!==-1&&n.push(e)})),n}},{key:`_getHubSizes`,value:function(){var e=this,t={};U(this.body.nodeIndices,(function(n){var r=e.body.nodes[n],i=e._getActiveEdges(r).length;t[i]=!0}));var n=[];return U(t,(function(e){n.push(Number(e))})),sD(n).call(n,(function(e,t){return t-e})),n}},{key:`_determineLevelsByHubsize`,value:function(){for(var e=this,t=function(t,n){e.hierarchical.levelDownstream(t,n)},n=this._getHubSizes(),r=function(){var r=n[i];if(r===0)return 1;U(e.body.nodeIndices,(function(n){var i=e.body.nodes[n];r===e._getActiveEdges(i).length&&e._crawlNetwork(t,n)}))},i=0;i<n.length&&!r();++i);}},{key:`_determineLevelsCustomCallback`,value:function(){var e=this;this._crawlNetwork((function(t,n,r){var i=e.hierarchical.levels[t.id];i===void 0&&(i=e.hierarchical.levels[t.id]=1e5);var a=($w.cloneOptions(t,`node`),$w.cloneOptions(n,`node`),void $w.cloneOptions(r,`edge`));e.hierarchical.levels[n.id]=i+a})),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:`_determineLevelsDirected`,value:function(){var e,t=this,n=xD(e=this.body.nodeIndices).call(e,(function(e,n){return e.set(n,t.body.nodes[n]),e}),new dx);this.options.hierarchical.shakeTowards===`roots`?this.hierarchical.levels=function(e){return FD((function(t){var n,r;return jD(n=oh(r=t.edges).call(r,(function(t){return e.has(t.toId)}))).call(n,(function(e){return e.from===t}))}),(function(e,t){return t<e}),`to`,e)}(n):this.hierarchical.levels=function(e){return FD((function(t){var n,r;return jD(n=oh(r=t.edges).call(r,(function(t){return e.has(t.toId)}))).call(n,(function(e){return e.to===t}))}),(function(e,t){return t>e}),`from`,e)}(n),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:`_generateMap`,value:function(){var e=this;this._crawlNetwork((function(t,n){e.hierarchical.levels[n.id]>e.hierarchical.levels[t.id]&&e.hierarchical.addRelation(t.id,n.id)})),this.hierarchical.checkIfTree()}},{key:`_crawlNetwork`,value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},n=arguments.length>1?arguments[1]:void 0,r={},i=function n(i,a){if(r[i.id]===void 0){var o;e.hierarchical.setTreeIndex(i,a),r[i.id]=!0;for(var s=e._getActiveEdges(i),c=0;c<s.length;c++){var l=s[c];!0===l.connected&&(o=l.toId==i.id?l.from:l.to,i.id!=o.id&&(t(i,o,l),n(o,a)))}}};if(n===void 0)for(var a=0,o=0;o<this.body.nodeIndices.length;o++){var s=this.body.nodeIndices[o];r[s]===void 0&&(i(this.body.nodes[s],a),a+=1)}else{var c=this.body.nodes[n];if(c===void 0)return void console.error(`Node not found:`,n);i(c)}}},{key:`_shiftBlock`,value:function(e,t){var n=this,r={};(function e(i){if(!r[i]){r[i]=!0,n.direction.shift(i,t);var a=n.hierarchical.childrenReference[i];if(a!==void 0)for(var o=0;o<a.length;o++)e(a[o])}})(e)}},{key:`_findCommonParent`,value:function(e,t){var n=this,r={};return function e(t,r){var i=n.hierarchical.parentReference[r];if(i!==void 0)for(var a=0;a<i.length;a++){var o=i[a];t[o]=!0,e(t,o)}}(r,e),function e(t,r){var i=n.hierarchical.parentReference[r];if(i!==void 0)for(var a=0;a<i.length;a++){var o=i[a];if(t[o]!==void 0)return{foundParent:o,withChild:r};var s=e(t,o);if(s.foundParent!==null)return s}return{foundParent:null,withChild:r}}(r,t)}},{key:`setDirectionStrategy`,value:function(){this.direction=this.options.hierarchical.direction===`UD`||this.options.hierarchical.direction===`DU`?new wD(this):new TD(this)}},{key:`_getCenterPosition`,value:function(e){for(var t=1e9,n=-1e9,r=0;r<e.length;r++){var i=void 0;if(e[r].id!==void 0)i=e[r];else{var a=e[r];i=this.body.nodes[a]}var o=this.direction.getPosition(i);t=Math.min(t,o),n=Math.max(n,o)}return .5*(t+n)}}]),e}();function RD(e,t){var n=mp!==void 0&&Sc(e)||e[`@@iterator`];if(!n){if(Dp(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return zD(e,t);var r=bp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return tc(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zD(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
41
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function zD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var BD=function(){function e(t,n,r,i){var a,o,s=this;B(this,e),this.body=t,this.canvas=n,this.selectionHandler=r,this.interactionHandler=i,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:`dot`,size:6,color:{background:`#ff0000`,border:`#3c3c3c`,highlight:{background:`#07f968`,border:`#3c3c3c`}},borderWidth:2,borderWidthSelected:2}},Nr(this.options,this.defaultOptions),this.body.emitter.on(`destroy`,(function(){s._clean()})),this.body.emitter.on(`_dataChanged`,z(a=this._restore).call(a,this)),this.body.emitter.on(`_resetData`,z(o=this._restore).call(o,this))}return V(e,[{key:`_restore`,value:function(){!1!==this.inMode&&(!0===this.options.initiallyActive?this.enableEditMode():this.disableEditMode())}},{key:`setOptions`,value:function(e,t,n){t!==void 0&&(t.locale===void 0?this.options.locale=n.locale:this.options.locale=t.locale,t.locales===void 0?this.options.locales=n.locales:this.options.locales=t.locales),e!==void 0&&(typeof e==`boolean`?this.options.enabled=e:(this.options.enabled=!0,kv(this.options,e)),!0===this.options.initiallyActive&&(this.editMode=!0),this._setup())}},{key:`toggleEditMode`,value:function(){!0===this.editMode?this.disableEditMode():this.enableEditMode()}},{key:`enableEditMode`,value:function(){this.editMode=!0,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display=`block`,this.closeDiv.style.display=`block`,this.editModeDiv.style.display=`none`,this.showManipulatorToolbar())}},{key:`disableEditMode`,value:function(){this.editMode=!1,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display=`none`,this.closeDiv.style.display=`none`,this.editModeDiv.style.display=`block`,this._createEditButton())}},{key:`showManipulatorToolbar`,value:function(){if(this._clean(),this.manipulationDOM={},!0===this.guiEnabled){var e,t;this.editMode=!0,this.manipulationDiv.style.display=`block`,this.closeDiv.style.display=`block`;var n=this.selectionHandler.getSelectedNodeCount(),r=this.selectionHandler.getSelectedEdgeCount(),i=n+r,a=this.options.locales[this.options.locale],o=!1;!1!==this.options.addNode&&(this._createAddNodeButton(a),o=!0),!1!==this.options.addEdge&&(!0===o?this._createSeperator(1):o=!0,this._createAddEdgeButton(a)),n===1&&typeof this.options.editNode==`function`?(!0===o?this._createSeperator(2):o=!0,this._createEditNodeButton(a)):r===1&&n===0&&!1!==this.options.editEdge&&(!0===o?this._createSeperator(3):o=!0,this._createEditEdgeButton(a)),i!==0&&(n>0&&!1!==this.options.deleteNode||n===0&&!1!==this.options.deleteEdge)&&(!0===o&&this._createSeperator(4),this._createDeleteButton(a)),this._bindElementEvents(this.closeDiv,z(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent(`select`,z(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit(`_redraw`)}},{key:`addNodeMode`,value:function(){var e;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode=`addNode`,!0===this.guiEnabled){var t,n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,z(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent(`click`,z(e=this._performAddNode).call(e,this))}},{key:`editNode`,value:function(){var e=this;!0!==this.editMode&&this.enableEditMode(),this._clean();var t=this.selectionHandler.getSelectedNodes()[0];if(t!==void 0){if(this.inMode=`editNode`,typeof this.options.editNode!=`function`)throw Error(`No function has been configured to handle the editing of nodes.`);if(!0!==t.isCluster){var n=kv({},t.options,!1);if(n.x=t.x,n.y=t.y,this.options.editNode.length!==2)throw Error(`The function for edit does not support two arguments (data, callback)`);this.options.editNode(n,(function(t){t!=null&&e.inMode===`editNode`&&e.body.data.nodes.getDataSet().update(t),e.showManipulatorToolbar()}))}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:`addEdgeMode`,value:function(){var e,t,n,r,i;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode=`addEdge`,!0===this.guiEnabled){var a,o=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(o),this._createSeperator(),this._createDescription(o.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,z(a=this.toggleEditMode).call(a,this))}this._temporaryBindUI(`onTouch`,z(e=this._handleConnect).call(e,this)),this._temporaryBindUI(`onDragEnd`,z(t=this._finishConnect).call(t,this)),this._temporaryBindUI(`onDrag`,z(n=this._dragControlNode).call(n,this)),this._temporaryBindUI(`onRelease`,z(r=this._finishConnect).call(r,this)),this._temporaryBindUI(`onDragStart`,z(i=this._dragStartEdge).call(i,this)),this._temporaryBindUI(`onHold`,(function(){}))}},{key:`editEdgeMode`,value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode=`editEdge`,Cf(this.options.editEdge)!==`object`||typeof this.options.editEdge.editWithoutDrag!=`function`||(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId===void 0)){if(!0===this.guiEnabled){var e,t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,z(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var n,r,i,a,o=this.body.edges[this.edgeBeingEditedId],s=this._getNewTargetNode(o.from.x,o.from.y),c=this._getNewTargetNode(o.to.x,o.to.y);this.temporaryIds.nodes.push(s.id),this.temporaryIds.nodes.push(c.id),this.body.nodes[s.id]=s,this.body.nodeIndices.push(s.id),this.body.nodes[c.id]=c,this.body.nodeIndices.push(c.id),this._temporaryBindUI(`onTouch`,z(n=this._controlNodeTouch).call(n,this)),this._temporaryBindUI(`onTap`,(function(){})),this._temporaryBindUI(`onHold`,(function(){})),this._temporaryBindUI(`onDragStart`,z(r=this._controlNodeDragStart).call(r,this)),this._temporaryBindUI(`onDrag`,z(i=this._controlNodeDrag).call(i,this)),this._temporaryBindUI(`onDragEnd`,z(a=this._controlNodeDragEnd).call(a,this)),this._temporaryBindUI(`onMouseMove`,(function(){})),this._temporaryBindEvent(`beforeDrawing`,(function(e){var t=o.edgeType.findBorderPositions(e);!1===s.selected&&(s.x=t.from.x,s.y=t.from.y),!1===c.selected&&(c.x=t.to.x,c.y=t.to.y)})),this.body.emitter.emit(`_redraw`)}else this.showManipulatorToolbar()}else{var l=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(l.from.id,l.to.id)}}},{key:`deleteSelected`,value:function(){var e=this;!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode=`delete`;var t=this.selectionHandler.getSelectedNodeIds(),n=this.selectionHandler.getSelectedEdgeIds(),r=void 0;if(t.length>0){for(var i=0;i<t.length;i++)if(!0===this.body.nodes[t[i]].isCluster)return void alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);typeof this.options.deleteNode==`function`&&(r=this.options.deleteNode)}else n.length>0&&typeof this.options.deleteEdge==`function`&&(r=this.options.deleteEdge);if(typeof r==`function`){var a={nodes:t,edges:n};if(r.length!==2)throw Error(`The function for delete does not support two arguments (data, callback)`);r(a,(function(t){t!=null&&e.inMode===`delete`?(e.body.data.edges.getDataSet().remove(t.edges),e.body.data.nodes.getDataSet().remove(t.nodes),e.body.emitter.emit(`startSimulation`),e.showManipulatorToolbar()):(e.body.emitter.emit(`startSimulation`),e.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().remove(n),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit(`startSimulation`),this.showManipulatorToolbar()}},{key:`_setup`,value:function(){!0===this.options.enabled?(this.guiEnabled=!0,this._createWrappers(),!1===this.editMode?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:`_createWrappers`,value:function(){(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement(`div`),this.manipulationDiv.className=`vis-manipulation`,!0===this.editMode?this.manipulationDiv.style.display=`block`:this.manipulationDiv.style.display=`none`,this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement(`div`),this.editModeDiv.className=`vis-edit-mode`,!0===this.editMode?this.editModeDiv.style.display=`none`:this.editModeDiv.style.display=`block`,this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0)&&(this.closeDiv=document.createElement(`button`),this.closeDiv.className=`vis-close`,this.closeDiv.setAttribute(`aria-label`,this.options.locales[this.options.locale]?.close??this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:`_getNewTargetNode`,value:function(e,t){var n=kv({},this.options.controlNodeStyle);n.id=`targetNode`+Qw(),n.hidden=!1,n.physics=!1,n.x=e,n.y=t;var r=this.body.functions.createNode(n);return r.shape.boundingBox={left:e,right:e,top:t,bottom:t},r}},{key:`_createEditButton`,value:function(){var e;this._clean(),this.manipulationDOM={},Sv(this.editModeDiv);var t=this.options.locales[this.options.locale],n=this._createButton(`editMode`,`vis-edit vis-edit-mode`,t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(n),this._bindElementEvents(n,z(e=this.toggleEditMode).call(e,this))}},{key:`_clean`,value:function(){this.inMode=!1,!0===this.guiEnabled&&(Sv(this.editModeDiv),Sv(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit(`restorePhysics`)}},{key:`_cleanupDOMEventListeners`,value:function(){var e,t,n=RD(Om(e=this._domEventListenerCleanupQueue).call(e,0));try{for(n.s();!(t=n.n()).done;)(0,t.value)()}catch(e){n.e(e)}finally{n.f()}}},{key:`_removeManipulationDOM`,value:function(){this._clean(),Sv(this.manipulationDiv),Sv(this.editModeDiv),Sv(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}},{key:`_createSeperator`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM[`seperatorLineDiv`+e]=document.createElement(`div`),this.manipulationDOM[`seperatorLineDiv`+e].className=`vis-separator-line`,this.manipulationDiv.appendChild(this.manipulationDOM[`seperatorLineDiv`+e])}},{key:`_createAddNodeButton`,value:function(e){var t,n=this._createButton(`addNode`,`vis-add`,e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,z(t=this.addNodeMode).call(t,this))}},{key:`_createAddEdgeButton`,value:function(e){var t,n=this._createButton(`addEdge`,`vis-connect`,e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,z(t=this.addEdgeMode).call(t,this))}},{key:`_createEditNodeButton`,value:function(e){var t,n=this._createButton(`editNode`,`vis-edit`,e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,z(t=this.editNode).call(t,this))}},{key:`_createEditEdgeButton`,value:function(e){var t,n=this._createButton(`editEdge`,`vis-edit`,e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,z(t=this.editEdgeMode).call(t,this))}},{key:`_createDeleteButton`,value:function(e){var t,n=this.options.rtl?`vis-delete-rtl`:`vis-delete`,r=this._createButton(`delete`,n,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,z(t=this.deleteSelected).call(t,this))}},{key:`_createBackButton`,value:function(e){var t,n=this._createButton(`back`,`vis-back`,e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,z(t=this.showManipulatorToolbar).call(t,this))}},{key:`_createButton`,value:function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`vis-label`;return this.manipulationDOM[e+`Div`]=document.createElement(`button`),this.manipulationDOM[e+`Div`].className=`vis-button `+t,this.manipulationDOM[e+`Label`]=document.createElement(`div`),this.manipulationDOM[e+`Label`].className=r,this.manipulationDOM[e+`Label`].innerText=n,this.manipulationDOM[e+`Div`].appendChild(this.manipulationDOM[e+`Label`]),this.manipulationDOM[e+`Div`]}},{key:`_createDescription`,value:function(e){this.manipulationDOM.descriptionLabel=document.createElement(`div`),this.manipulationDOM.descriptionLabel.className=`vis-none`,this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}},{key:`_temporaryBindEvent`,value:function(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}},{key:`_temporaryBindUI`,value:function(e,t){if(this.body.eventListeners[e]===void 0)throw Error(`This UI function does not exist. Typo? You tried: `+e+` possible are: `+Uh(Ip(this.body.eventListeners)));this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t}},{key:`_unbindTemporaryUIs`,value:function(){for(var e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}},{key:`_unbindTemporaryEvents`,value:function(){for(var e=0;e<this.temporaryEventFunctions.length;e++){var t=this.temporaryEventFunctions[e].event,n=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,n)}this.temporaryEventFunctions=[]}},{key:`_bindElementEvents`,value:function(e,t){var n=new ny(e,{});aT(n,t),this._domEventListenerCleanupQueue.push((function(){n.destroy()}));var r=function(e){var n=e.keyCode,r=e.key;r!==`Enter`&&r!==` `&&n!==13&&n!==32||t()};e.addEventListener(`keyup`,r,!1),this._domEventListenerCleanupQueue.push((function(){e.removeEventListener(`keyup`,r,!1)}))}},{key:`_cleanupTemporaryNodesAndEdges`,value:function(){for(var e=0;e<this.temporaryIds.edges.length;e++){var t;this.body.edges[this.temporaryIds.edges[e]].disconnect(),delete this.body.edges[this.temporaryIds.edges[e]];var n,r=H(t=this.body.edgeIndices).call(t,this.temporaryIds.edges[e]);r!==-1&&Om(n=this.body.edgeIndices).call(n,r,1)}for(var i=0;i<this.temporaryIds.nodes.length;i++){var a;delete this.body.nodes[this.temporaryIds.nodes[i]];var o,s=H(a=this.body.nodeIndices).call(a,this.temporaryIds.nodes[i]);s!==-1&&Om(o=this.body.nodeIndices).call(o,s,1)}this.temporaryIds={nodes:[],edges:[]}}},{key:`_controlNodeTouch`,value:function(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Nr({},this.body.view.translation)}},{key:`_controlNodeDragStart`,value:function(){var e=this.lastTouch,t=this.selectionHandler._pointerToPositionObject(e),n=this.body.nodes[this.temporaryIds.nodes[0]],r=this.body.nodes[this.temporaryIds.nodes[1]],i=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;var a=n.isOverlappingWith(t),o=r.isOverlappingWith(t);!0===a?(this.selectedControlNode=n,i.edgeType.from=n):!0===o&&(this.selectedControlNode=r,i.edgeType.to=r),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit(`_redraw`)}},{key:`_controlNodeDrag`,value:function(e){this.body.emitter.emit(`disablePhysics`);var t=this.body.functions.getPointer(e.center),n=this.canvas.DOMtoCanvas(t);this.selectedControlNode===void 0?this.interactionHandler.onDrag(e):(this.selectedControlNode.x=n.x,this.selectedControlNode.y=n.y),this.body.emitter.emit(`_redraw`)}},{key:`_controlNodeDragEnd`,value:function(e){var t=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(t),r=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode!==void 0){this.selectionHandler.unselectAll();for(var i=this.selectionHandler._getAllNodesOverlappingWith(n),a=void 0,o=i.length-1;o>=0;o--)if(i[o]!==this.selectedControlNode.id){a=this.body.nodes[i[o]];break}if(a!==void 0&&this.selectedControlNode!==void 0)if(!0===a.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var s=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===s.id?this._performEditEdge(a.id,r.to.id):this._performEditEdge(r.from.id,a.id)}else r.updateEdgeType(),this.body.emitter.emit(`restorePhysics`);this.body.emitter.emit(`_redraw`)}}},{key:`_handleConnect`,value:function(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Nr({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;var t=this.lastTouch,n=this.selectionHandler.getNodeAt(t);if(n!==void 0)if(!0===n.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var r=this._getNewTargetNode(n.x,n.y);this.body.nodes[r.id]=r,this.body.nodeIndices.push(r.id);var i=this.body.functions.createEdge({id:`connectionEdge`+Qw(),from:n.id,to:r.id,physics:!1,smooth:{enabled:!0,type:`continuous`,roundness:.5}});this.body.edges[i.id]=i,this.body.edgeIndices.push(i.id),this.temporaryIds.nodes.push(r.id),this.temporaryIds.edges.push(i.id)}this.touchTime=new Date().valueOf()}}},{key:`_dragControlNode`,value:function(e){var t=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(t),r=void 0;this.temporaryIds.edges[0]!==void 0&&(r=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var i=this.selectionHandler._getAllNodesOverlappingWith(n),a=void 0,o=i.length-1;o>=0;o--){var s;if(H(s=this.temporaryIds.nodes).call(s,i[o])===-1){a=this.body.nodes[i[o]];break}}if(e.controlEdge={from:r,to:a?a.id:void 0},this.selectionHandler.generateClickEvent(`controlNodeDragging`,e,t),this.temporaryIds.nodes[0]!==void 0){var c=this.body.nodes[this.temporaryIds.nodes[0]];c.x=this.canvas._XconvertDOMtoCanvas(t.x),c.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit(`_redraw`)}else this.interactionHandler.onDrag(e)}},{key:`_finishConnect`,value:function(e){var t=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(t),r=void 0;this.temporaryIds.edges[0]!==void 0&&(r=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var i=this.selectionHandler._getAllNodesOverlappingWith(n),a=void 0,o=i.length-1;o>=0;o--){var s;if(H(s=this.temporaryIds.nodes).call(s,i[o])===-1){a=this.body.nodes[i[o]];break}}this._cleanupTemporaryNodesAndEdges(),a!==void 0&&(!0===a.isCluster?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[r]!==void 0&&this.body.nodes[a.id]!==void 0&&this._performAddEdge(r,a.id)),e.controlEdge={from:r,to:a?a.id:void 0},this.selectionHandler.generateClickEvent(`controlNodeDragEnd`,e,t),this.body.emitter.emit(`_redraw`)}},{key:`_dragStartEdge`,value:function(e){var t=this.lastTouch;this.selectionHandler.generateClickEvent(`dragStart`,e,t,void 0,!0)}},{key:`_performAddNode`,value:function(e){var t=this,n={id:Qw(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:`new`};if(typeof this.options.addNode==`function`){if(this.options.addNode.length!==2)throw this.showManipulatorToolbar(),Error(`The function for add does not support two arguments (data,callback)`);this.options.addNode(n,(function(e){e!=null&&t.inMode===`addNode`&&t.body.data.nodes.getDataSet().add(e),t.showManipulatorToolbar()}))}else this.body.data.nodes.getDataSet().add(n),this.showManipulatorToolbar()}},{key:`_performAddEdge`,value:function(e,t){var n=this,r={from:e,to:t};if(typeof this.options.addEdge==`function`){if(this.options.addEdge.length!==2)throw Error(`The function for connect does not support two arguments (data,callback)`);this.options.addEdge(r,(function(e){e!=null&&n.inMode===`addEdge`&&(n.body.data.edges.getDataSet().add(e),n.selectionHandler.unselectAll(),n.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().add(r),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:`_performEditEdge`,value:function(e,t){var n=this,r={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label},i=this.options.editEdge;if(Cf(i)===`object`&&(i=i.editWithoutDrag),typeof i==`function`){if(i.length!==2)throw Error(`The function for edit does not support two arguments (data, callback)`);i(r,(function(e){e==null||n.inMode!==`editEdge`?(n.body.edges[r.id].updateEdgeType(),n.body.emitter.emit(`_redraw`),n.showManipulatorToolbar()):(n.body.data.edges.getDataSet().update(e),n.selectionHandler.unselectAll(),n.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().update(r),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),e}(),Y=`string`,X=`boolean`,Z=`number`,VD=`array`,Q=`object`,HD=[`arrow`,`bar`,`box`,`circle`,`crow`,`curve`,`diamond`,`image`,`inv_curve`,`inv_triangle`,`triangle`,`vee`],UD={borderWidth:{number:Z},borderWidthSelected:{number:Z,undefined:`undefined`},brokenImage:{string:Y,undefined:`undefined`},chosen:{label:{boolean:X,function:`function`},node:{boolean:X,function:`function`},__type__:{object:Q,boolean:X}},color:{border:{string:Y},background:{string:Y},highlight:{border:{string:Y},background:{string:Y},__type__:{object:Q,string:Y}},hover:{border:{string:Y},background:{string:Y},__type__:{object:Q,string:Y}},__type__:{object:Q,string:Y}},opacity:{number:Z,undefined:`undefined`},fixed:{x:{boolean:X},y:{boolean:X},__type__:{object:Q,boolean:X}},font:{align:{string:Y},color:{string:Y},size:{number:Z},face:{string:Y},background:{string:Y},strokeWidth:{number:Z},strokeColor:{string:Y},vadjust:{number:Z},multi:{boolean:X,string:Y},bold:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},boldital:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},ital:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},mono:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},__type__:{object:Q,string:Y}},group:{string:Y,number:Z,undefined:`undefined`},heightConstraint:{minimum:{number:Z},valign:{string:Y},__type__:{object:Q,boolean:X,number:Z}},hidden:{boolean:X},icon:{face:{string:Y},code:{string:Y},size:{number:Z},color:{string:Y},weight:{string:Y,number:Z},__type__:{object:Q}},id:{string:Y,number:Z},image:{selected:{string:Y,undefined:`undefined`},unselected:{string:Y,undefined:`undefined`},__type__:{object:Q,string:Y}},imagePadding:{top:{number:Z},right:{number:Z},bottom:{number:Z},left:{number:Z},__type__:{object:Q,number:Z}},label:{string:Y,undefined:`undefined`},labelHighlightBold:{boolean:X},level:{number:Z,undefined:`undefined`},margin:{top:{number:Z},right:{number:Z},bottom:{number:Z},left:{number:Z},__type__:{object:Q,number:Z}},mass:{number:Z},physics:{boolean:X},scaling:{min:{number:Z},max:{number:Z},label:{enabled:{boolean:X},min:{number:Z},max:{number:Z},maxVisible:{number:Z},drawThreshold:{number:Z},__type__:{object:Q,boolean:X}},customScalingFunction:{function:`function`},__type__:{object:Q}},shadow:{enabled:{boolean:X},color:{string:Y},size:{number:Z},x:{number:Z},y:{number:Z},__type__:{object:Q,boolean:X}},shape:{string:[`custom`,`ellipse`,`circle`,`database`,`box`,`text`,`image`,`circularImage`,`diamond`,`dot`,`star`,`triangle`,`triangleDown`,`square`,`icon`,`hexagon`]},ctxRenderer:{function:`function`},shapeProperties:{borderDashes:{boolean:X,array:VD},borderRadius:{number:Z},interpolation:{boolean:X},useImageSize:{boolean:X},useBorderWithImage:{boolean:X},coordinateOrigin:{string:[`center`,`top-left`]},__type__:{object:Q}},size:{number:Z},title:{string:Y,dom:`dom`,undefined:`undefined`},value:{number:Z,undefined:`undefined`},widthConstraint:{minimum:{number:Z},maximum:{number:Z},__type__:{object:Q,boolean:X,number:Z}},x:{number:Z},y:{number:Z},__type__:{object:Q}},WD={configure:{enabled:{boolean:X},filter:{boolean:X,string:Y,array:VD,function:`function`},container:{dom:`dom`},showButton:{boolean:X},__type__:{object:Q,boolean:X,string:Y,array:VD,function:`function`}},edges:{arrows:{to:{enabled:{boolean:X},scaleFactor:{number:Z},type:{string:HD},imageHeight:{number:Z},imageWidth:{number:Z},src:{string:Y},__type__:{object:Q,boolean:X}},middle:{enabled:{boolean:X},scaleFactor:{number:Z},type:{string:HD},imageWidth:{number:Z},imageHeight:{number:Z},src:{string:Y},__type__:{object:Q,boolean:X}},from:{enabled:{boolean:X},scaleFactor:{number:Z},type:{string:HD},imageWidth:{number:Z},imageHeight:{number:Z},src:{string:Y},__type__:{object:Q,boolean:X}},__type__:{string:[`from`,`to`,`middle`],object:Q}},endPointOffset:{from:{number:Z},to:{number:Z},__type__:{object:Q,number:Z}},arrowStrikethrough:{boolean:X},background:{enabled:{boolean:X},color:{string:Y},size:{number:Z},dashes:{boolean:X,array:VD},__type__:{object:Q,boolean:X}},chosen:{label:{boolean:X,function:`function`},edge:{boolean:X,function:`function`},__type__:{object:Q,boolean:X}},color:{color:{string:Y},highlight:{string:Y},hover:{string:Y},inherit:{string:[`from`,`to`,`both`],boolean:X},opacity:{number:Z},__type__:{object:Q,string:Y}},dashes:{boolean:X,array:VD},font:{color:{string:Y},size:{number:Z},face:{string:Y},background:{string:Y},strokeWidth:{number:Z},strokeColor:{string:Y},align:{string:[`horizontal`,`top`,`middle`,`bottom`]},vadjust:{number:Z},multi:{boolean:X,string:Y},bold:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},boldital:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},ital:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},mono:{color:{string:Y},size:{number:Z},face:{string:Y},mod:{string:Y},vadjust:{number:Z},__type__:{object:Q,string:Y}},__type__:{object:Q,string:Y}},hidden:{boolean:X},hoverWidth:{function:`function`,number:Z},label:{string:Y,undefined:`undefined`},labelHighlightBold:{boolean:X},length:{number:Z,undefined:`undefined`},physics:{boolean:X},scaling:{min:{number:Z},max:{number:Z},label:{enabled:{boolean:X},min:{number:Z},max:{number:Z},maxVisible:{number:Z},drawThreshold:{number:Z},__type__:{object:Q,boolean:X}},customScalingFunction:{function:`function`},__type__:{object:Q}},selectionWidth:{function:`function`,number:Z},selfReferenceSize:{number:Z},selfReference:{size:{number:Z},angle:{number:Z},renderBehindTheNode:{boolean:X},__type__:{object:Q}},shadow:{enabled:{boolean:X},color:{string:Y},size:{number:Z},x:{number:Z},y:{number:Z},__type__:{object:Q,boolean:X}},smooth:{enabled:{boolean:X},type:{string:[`dynamic`,`continuous`,`discrete`,`diagonalCross`,`straightCross`,`horizontal`,`vertical`,`curvedCW`,`curvedCCW`,`cubicBezier`]},roundness:{number:Z},forceDirection:{string:[`horizontal`,`vertical`,`none`],boolean:X},__type__:{object:Q,boolean:X}},title:{string:Y,undefined:`undefined`},width:{number:Z},widthConstraint:{maximum:{number:Z},__type__:{object:Q,boolean:X,number:Z}},value:{number:Z,undefined:`undefined`},__type__:{object:Q}},groups:{useDefaultGroups:{boolean:X},__any__:UD,__type__:{object:Q}},interaction:{dragNodes:{boolean:X},dragView:{boolean:X},hideEdgesOnDrag:{boolean:X},hideEdgesOnZoom:{boolean:X},hideNodesOnDrag:{boolean:X},hover:{boolean:X},keyboard:{enabled:{boolean:X},speed:{x:{number:Z},y:{number:Z},zoom:{number:Z},__type__:{object:Q}},bindToWindow:{boolean:X},autoFocus:{boolean:X},__type__:{object:Q,boolean:X}},multiselect:{boolean:X},navigationButtons:{boolean:X},selectable:{boolean:X},selectConnectedEdges:{boolean:X},hoverConnectedEdges:{boolean:X},tooltipDelay:{number:Z},zoomView:{boolean:X},zoomSpeed:{number:Z},__type__:{object:Q}},layout:{randomSeed:{undefined:`undefined`,number:Z,string:Y},improvedLayout:{boolean:X},clusterThreshold:{number:Z},hierarchical:{enabled:{boolean:X},levelSeparation:{number:Z},nodeSpacing:{number:Z},treeSpacing:{number:Z},blockShifting:{boolean:X},edgeMinimization:{boolean:X},parentCentralization:{boolean:X},direction:{string:[`UD`,`DU`,`LR`,`RL`]},sortMethod:{string:[`hubsize`,`directed`]},shakeTowards:{string:[`leaves`,`roots`]},__type__:{object:Q,boolean:X}},__type__:{object:Q}},manipulation:{enabled:{boolean:X},initiallyActive:{boolean:X},addNode:{boolean:X,function:`function`},addEdge:{boolean:X,function:`function`},editNode:{function:`function`},editEdge:{editWithoutDrag:{function:`function`},__type__:{object:Q,boolean:X,function:`function`}},deleteNode:{boolean:X,function:`function`},deleteEdge:{boolean:X,function:`function`},controlNodeStyle:UD,__type__:{object:Q,boolean:X}},nodes:UD,physics:{enabled:{boolean:X},barnesHut:{theta:{number:Z},gravitationalConstant:{number:Z},centralGravity:{number:Z},springLength:{number:Z},springConstant:{number:Z},damping:{number:Z},avoidOverlap:{number:Z},__type__:{object:Q}},forceAtlas2Based:{theta:{number:Z},gravitationalConstant:{number:Z},centralGravity:{number:Z},springLength:{number:Z},springConstant:{number:Z},damping:{number:Z},avoidOverlap:{number:Z},__type__:{object:Q}},repulsion:{centralGravity:{number:Z},springLength:{number:Z},springConstant:{number:Z},nodeDistance:{number:Z},damping:{number:Z},__type__:{object:Q}},hierarchicalRepulsion:{centralGravity:{number:Z},springLength:{number:Z},springConstant:{number:Z},nodeDistance:{number:Z},damping:{number:Z},avoidOverlap:{number:Z},__type__:{object:Q}},maxVelocity:{number:Z},minVelocity:{number:Z},solver:{string:[`barnesHut`,`repulsion`,`hierarchicalRepulsion`,`forceAtlas2Based`]},stabilization:{enabled:{boolean:X},iterations:{number:Z},updateInterval:{number:Z},onlyDynamicEdges:{boolean:X},fit:{boolean:X},__type__:{object:Q,boolean:X}},timestep:{number:Z},adaptiveTimestep:{boolean:X},wind:{x:{number:Z},y:{number:Z},__type__:{object:Q}},__type__:{object:Q,boolean:X}},autoResize:{boolean:X},clickToUse:{boolean:X},locale:{string:Y},locales:{__any__:{any:`any`},__type__:{object:Q}},height:{string:Y},width:{string:Y},__type__:{object:Q}},GD={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:[`color`,`#2B7CE9`],background:[`color`,`#97C2FC`],highlight:{border:[`color`,`#2B7CE9`],background:[`color`,`#D2E5FF`]},hover:{border:[`color`,`#2B7CE9`],background:[`color`,`#D2E5FF`]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:[`color`,`#343434`],size:[14,0,100,1],face:[`arial`,`verdana`,`tahoma`],background:[`color`,`none`],strokeWidth:[0,0,50,1],strokeColor:[`color`,`#ffffff`]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:`rgba(0,0,0,0.5)`,size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:[`ellipse`,`box`,`circle`,`database`,`diamond`,`dot`,`square`,`star`,`text`,`triangle`,`triangleDown`,`hexagon`],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:`arrow`},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:`arrow`},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:`arrow`}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:[`color`,`#848484`],highlight:[`color`,`#848484`],hover:[`color`,`#848484`],inherit:[`from`,`to`,`both`,!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:[`color`,`#343434`],size:[14,0,100,1],face:[`arial`,`verdana`,`tahoma`],background:[`color`,`none`],strokeWidth:[2,0,50,1],strokeColor:[`color`,`#ffffff`],align:[`horizontal`,`top`,`middle`,`bottom`]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:`rgba(0,0,0,0.5)`,size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:[`dynamic`,`continuous`,`discrete`,`diagonalCross`,`straightCross`,`horizontal`,`vertical`,`curvedCW`,`curvedCCW`,`cubicBezier`],forceDirection:[`horizontal`,`vertical`,`none`],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:[`UD`,`DU`,`LR`,`RL`],sortMethod:[`hubsize`,`directed`],shakeTowards:[`leaves`,`roots`]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:[`barnesHut`,`forceAtlas2Based`,`repulsion`,`hierarchicalRepulsion`],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},KD=function(e,t,n){var r;return!(!Ym(e).call(e,`physics`)||!Ym(r=GD.physics.solver).call(r,t)||n.physics.solver===t||t===`wind`)},qD=Object.freeze({__proto__:null,allOptions:WD,configuratorHideOption:KD,configureOptions:GD}),JD=function(){function e(){B(this,e)}return V(e,[{key:`getDistances`,value:function(e,t,n){for(var r={},i=e.edges,a=0;a<t.length;a++){var o={};r[t[a]]=o;for(var s=0;s<t.length;s++)o[t[s]]=a==s?0:1e9}for(var c=0;c<n.length;c++){var l=i[n[c]];!0===l.connected&&r[l.fromId]!==void 0&&r[l.toId]!==void 0&&(r[l.fromId][l.toId]=1,r[l.toId][l.fromId]=1)}for(var u=t.length,d=0;d<u;d++)for(var f=t[d],p=r[f],m=0;m<u-1;m++)for(var h=t[m],g=r[h],_=m+1;_<u;_++){var v=t[_],y=r[v],b=Math.min(g[v],g[f]+p[v]);g[v]=b,y[h]=b}return r}}]),e}(),YD=function(){function e(t,n,r){B(this,e),this.body=t,this.springLength=n,this.springConstant=r,this.distanceSolver=new JD}return V(e,[{key:`setOptions`,value:function(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}},{key:`solve`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(r),this._createK_matrix(r),this._createE_matrix();for(var i=0,a=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),o=1e9,s=0,c=0,l=0,u=0,d=0;o>.01&&i<a;){i+=1;var f=fp(this._getHighestEnergyNode(n),4);for(s=f[0],o=f[1],c=f[2],l=f[3],u=o,d=0;u>1&&d<5;){d+=1,this._moveNode(s,c,l);var p=fp(this._getEnergy(s),3);u=p[0],c=p[1],l=p[2]}}}},{key:`_getHighestEnergyNode`,value:function(e){for(var t=this.body.nodeIndices,n=this.body.nodes,r=0,i=t[0],a=0,o=0,s=0;s<t.length;s++){var c=t[s];if(!0!==n[c].predefinedPosition||!0===n[c].isCluster&&!0===e||!0!==n[c].options.fixed.x||!0!==n[c].options.fixed.y){var l=fp(this._getEnergy(c),3),u=l[0],d=l[1],f=l[2];r<u&&(r=u,i=c,a=d,o=f)}}return[i,r,a,o]}},{key:`_getEnergy`,value:function(e){var t=fp(this.E_sums[e],2),n=t[0],r=t[1];return[Math.sqrt(n**2+r**2),n,r]}},{key:`_moveNode`,value:function(e,t,n){for(var r=this.body.nodeIndices,i=this.body.nodes,a=0,o=0,s=0,c=i[e].x,l=i[e].y,u=this.K_matrix[e],d=this.L_matrix[e],f=0;f<r.length;f++){var p=r[f];if(p!==e){var m=i[p].x,h=i[p].y,g=u[p],_=d[p],v=1/((c-m)**2+(l-h)**2)**1.5;a+=g*(1-_*(l-h)**2*v),o+=g*(_*(c-m)*(l-h)*v),s+=g*(1-_*(c-m)**2*v)}}var y=(t/a+n/o)/(o/a-s/o),b=-(o*y+t)/a;i[e].x+=b,i[e].y+=y,this._updateE_matrix(e)}},{key:`_createL_matrix`,value:function(e){var t=this.body.nodeIndices,n=this.springLength;this.L_matrix=[];for(var r=0;r<t.length;r++){this.L_matrix[t[r]]={};for(var i=0;i<t.length;i++)this.L_matrix[t[r]][t[i]]=n*e[t[r]][t[i]]}}},{key:`_createK_matrix`,value:function(e){var t=this.body.nodeIndices,n=this.springConstant;this.K_matrix=[];for(var r=0;r<t.length;r++){this.K_matrix[t[r]]={};for(var i=0;i<t.length;i++)this.K_matrix[t[r]][t[i]]=n*e[t[r]][t[i]]**-2}}},{key:`_createE_matrix`,value:function(){var e=this.body.nodeIndices,t=this.body.nodes;this.E_matrix={},this.E_sums={};for(var n=0;n<e.length;n++)this.E_matrix[e[n]]=[];for(var r=0;r<e.length;r++){for(var i=e[r],a=t[i].x,o=t[i].y,s=0,c=0,l=r;l<e.length;l++){var u=e[l];if(u!==i){var d=t[u].x,f=t[u].y,p=1/Math.sqrt((a-d)**2+(o-f)**2);this.E_matrix[i][l]=[this.K_matrix[i][u]*(a-d-this.L_matrix[i][u]*(a-d)*p),this.K_matrix[i][u]*(o-f-this.L_matrix[i][u]*(o-f)*p)],this.E_matrix[u][r]=this.E_matrix[i][l],s+=this.E_matrix[i][l][0],c+=this.E_matrix[i][l][1]}}this.E_sums[i]=[s,c]}}},{key:`_updateE_matrix`,value:function(e){for(var t=this.body.nodeIndices,n=this.body.nodes,r=this.E_matrix[e],i=this.K_matrix[e],a=this.L_matrix[e],o=n[e].x,s=n[e].y,c=0,l=0,u=0;u<t.length;u++){var d=t[u];if(d!==e){var f=r[u],p=f[0],m=f[1],h=n[d].x,g=n[d].y,_=1/Math.sqrt((o-h)**2+(s-g)**2),v=i[d]*(o-h-a[d]*(o-h)*_),y=i[d]*(s-g-a[d]*(s-g)*_);r[u]=[v,y],c+=v,l+=y;var b=this.E_sums[d];b[0]+=v-p,b[1]+=y-m}}this.E_sums[e]=[c,l]}}]),e}();function $(e,t,n){var r,i,a,o,s=this;if(!(this instanceof $))throw SyntaxError(`Constructor must be called with the new operator`);this.options={},this.defaultOptions={locale:`en`,locales:Iy,clickToUse:!1},Nr(this.options,this.defaultOptions),this.body={container:e,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:z(r=this.on).call(r,this),off:z(i=this.off).call(i,this),emit:z(a=this.emit).call(a,this),once:z(o=this.once).call(o,this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}},selectionBox:{show:!1,position:{start:{x:0,y:0},end:{x:0,y:0}}}},this.bindEventListeners(),this.images=new Ry((function(){return s.body.emitter.emit(`_requestRedraw`)})),this.groups=new fx,this.canvas=new sT(this.body),this.selectionHandler=new wE(this.body,this.canvas),this.interactionHandler=new pT(this.body,this.canvas,this.selectionHandler),this.view=new cT(this.body,this.canvas),this.renderer=new rT(this.body,this.canvas),this.physics=new Kw(this.body),this.layoutEngine=new LD(this.body),this.clustering=new nT(this.body),this.manipulation=new BD(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new BC(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new Fw(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new YD(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(n),this.setData(t)}si($.prototype),$.prototype.setOptions=function(e){var t=this;if(e===null&&(e=void 0),e!==void 0){if(!0===ay.validate(e,WD)&&console.error(`%cErrors have been found in the supplied options object.`,iy),Dv([`locale`,`locales`,`clickToUse`],this.options,e),e.locale!==void 0&&(e.locale=function(e,t){try{var n=fp(t.split(/[-_ /]/,2),2),r=n[0],i=n[1],a=r==null?null:r.toLowerCase(),o=i==null?null:i.toUpperCase();if(a&&o){var s,c=a+`-`+o;if(Object.prototype.hasOwnProperty.call(e,c))return c;console.warn(yp(s=`Unknown variant ${o} of language `).call(s,a,`.`))}if(a){var l=a;if(Object.prototype.hasOwnProperty.call(e,l))return l;console.warn(`Unknown language ${a}`)}return console.warn(`Unknown locale ${t}, falling back to English.`),`en`}catch(e){return console.error(e),console.warn(`Unexpected error while normalizing locale ${t}, falling back to English.`),`en`}}(e.locales||this.options.locales,e.locale)),e=this.layoutEngine.setOptions(e.layout,e),this.canvas.setOptions(e),this.groups.setOptions(e.groups),this.nodesHandler.setOptions(e.nodes),this.edgesHandler.setOptions(e.edges),this.physics.setOptions(e.physics),this.manipulation.setOptions(e.manipulation,e,this.options),this.interactionHandler.setOptions(e.interaction),this.renderer.setOptions(e.interaction),this.selectionHandler.setOptions(e.interaction),e.groups!==void 0&&this.body.emitter.emit(`refreshNodes`),`configure`in e&&(this.configurator||=new ty(this,this.body.container,GD,this.canvas.pixelRatio,KD),this.configurator.setOptions(e.configure)),this.configurator&&!0===this.configurator.options.enabled){var n={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};kv(n.nodes,this.nodesHandler.options),kv(n.edges,this.edgesHandler.options),kv(n.layout,this.layoutEngine.options),kv(n.interaction,this.selectionHandler.options),kv(n.interaction,this.renderer.options),kv(n.interaction,this.interactionHandler.options),kv(n.manipulation,this.manipulation.options),kv(n.physics,this.physics.options),kv(n.global,this.canvas.options),kv(n.global,this.options),this.configurator.setModuleOptions(n)}e.clickToUse===void 0?this.body.emitter.emit(`activate`):!0===e.clickToUse?this.activator===void 0&&(this.activator=new ey(this.canvas.frame),this.activator.on(`change`,(function(){t.body.emitter.emit(`activate`)}))):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit(`activate`)),this.canvas.setSize(),this.body.emitter.emit(`startSimulation`)}},$.prototype._updateVisibleIndices=function(){var e=this.body.nodes,t=this.body.edges;for(var n in this.body.nodeIndices=[],this.body.edgeIndices=[],e)Object.prototype.hasOwnProperty.call(e,n)&&(this.clustering._isClusteredNode(n)||!1!==e[n].options.hidden||this.body.nodeIndices.push(e[n].id));for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r],a=e[i.fromId],o=e[i.toId],s=a!==void 0&&o!==void 0;!this.clustering._isClusteredEdge(r)&&!1===i.options.hidden&&s&&!1===a.options.hidden&&!1===o.options.hidden&&this.body.edgeIndices.push(i.id)}},$.prototype.bindEventListeners=function(){var e=this;this.body.emitter.on(`_dataChanged`,(function(){e.edgesHandler._updateState(),e.body.emitter.emit(`_dataUpdated`)})),this.body.emitter.on(`_dataUpdated`,(function(){e.clustering._updateState(),e._updateVisibleIndices(),e._updateValueRange(e.body.nodes),e._updateValueRange(e.body.edges),e.body.emitter.emit(`startSimulation`),e.body.emitter.emit(`_requestRedraw`)}))},$.prototype.setData=function(e){if(this.body.emitter.emit(`resetPhysics`),this.body.emitter.emit(`_resetData`),this.selectionHandler.unselectAll(),e&&e.dot&&(e.nodes||e.edges))throw SyntaxError(`Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.`);if(this.setOptions(e&&e.options),e&&e.dot){console.warn(`The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);`);var t=My(e.dot);this.setData(t)}else if(e&&e.gephi){console.warn(`The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);`);var n=Py(e.gephi);this.setData(n)}else this.nodesHandler.setData(e&&e.nodes,!0),this.edgesHandler.setData(e&&e.edges,!0),this.body.emitter.emit(`_dataChanged`),this.body.emitter.emit(`_dataLoaded`),this.body.emitter.emit(`initPhysics`)},$.prototype.destroy=function(){for(var e in this.body.emitter.emit(`destroy`),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images,this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&delete this.body.nodes[e];for(var t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&delete this.body.edges[t];Sv(this.body.container)},$.prototype._updateValueRange=function(e){var t,n=void 0,r=void 0,i=0;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var a=e[t].getValue();a!==void 0&&(n=n===void 0?a:Math.min(a,n),r=r===void 0?a:Math.max(a,r),i+=a)}if(n!==void 0&&r!==void 0)for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t].setValueRange(n,r,i)},$.prototype.isActive=function(){return!this.activator||this.activator.active},$.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},$.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},$.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},$.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},$.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},$.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},$.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},$.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},$.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},$.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},$.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)},$.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)},$.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)},$.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)},$.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)},$.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},$.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},$.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},$.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},$.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},$.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},$.prototype.editNodeMode=function(){return console.warn(`Deprecated: Please use editNode instead of editNodeMode.`),this.manipulation.editNode.apply(this.manipulation,arguments)},$.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},$.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},$.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},$.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},$.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)},$.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},$.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},$.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},$.prototype.getConnectedNodes=function(e){return this.body.nodes[e]===void 0?this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments):this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments)},$.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},$.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},$.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},$.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},$.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},$.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},$.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)},$.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)},$.prototype.getNodeAt=function(){var e=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return e!==void 0&&e.id!==void 0?e.id:e},$.prototype.getEdgeAt=function(){var e=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return e!==void 0&&e.id!==void 0?e.id:e},$.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},$.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},$.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()},$.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},$.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},$.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},$.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},$.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},$.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},$.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},$.prototype.getOptionsFromConfigurator=function(){var e={};return this.configurator&&(e=this.configurator.getOptions.apply(this.configurator)),e};var XD=My;e.Network=$,e.NetworkImages=Ry,e.networkDOTParser=Ny,e.networkGephiParser=Fy,e.networkOptions=qD,e.parseDOTNetwork=XD,e.parseGephiNetwork=Py}))})),ne=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):r((n=typeof globalThis<`u`?globalThis:n||self).vis=n.vis||{})})(e,(function(e){function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i={exports:{}},a=function(e){return e&&e.Math===Math&&e},o=a(typeof globalThis==`object`&&globalThis)||a(typeof window==`object`&&window)||a(typeof self==`object`&&self)||a(typeof n==`object`&&n)||function(){return this}()||n||Function(`return this`)(),s=function(e){try{return!!e()}catch{return!0}},c=!s((function(){var e=function(){}.bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)})),l=c,u=Function.prototype,d=u.apply,f=u.call,p=typeof Reflect==`object`&&Reflect.apply||(l?f.bind(d):function(){return f.apply(d,arguments)}),m=c,h=Function.prototype,g=h.call,_=m&&h.bind.bind(g,g),v=m?_:function(e){return function(){return g.apply(e,arguments)}},y=v,b=y({}.toString),x=y(``.slice),S=function(e){return x(b(e),8,-1)},ee=S,C=v,te=function(e){if(ee(e)===`Function`)return C(e)},ne=typeof document==`object`&&document.all,re={all:ne,IS_HTMLDDA:ne===void 0&&ne!==void 0},w=re.all,T=re.IS_HTMLDDA?function(e){return typeof e==`function`||e===w}:function(e){return typeof e==`function`},E={},D=!s((function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})),O=c,ie=Function.prototype.call,k=O?ie.bind(ie):function(){return ie.apply(ie,arguments)},A={},ae={}.propertyIsEnumerable,oe=Object.getOwnPropertyDescriptor;A.f=oe&&!ae.call({1:2},1)?function(e){var t=oe(this,e);return!!t&&t.enumerable}:ae;var se,ce,le=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},ue=s,de=S,fe=Object,pe=v(``.split),me=ue((function(){return!fe(`z`).propertyIsEnumerable(0)}))?function(e){return de(e)===`String`?pe(e,``):fe(e)}:fe,he=function(e){return e==null},ge=he,_e=TypeError,ve=function(e){if(ge(e))throw new _e(`Can't call method on `+e);return e},ye=me,be=ve,xe=function(e){return ye(be(e))},Se=T,Ce=re.all,j=re.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:Se(e)||e===Ce}:function(e){return typeof e==`object`?e!==null:Se(e)},M={},we=M,N=o,Te=T,Ee=function(e){return Te(e)?e:void 0},P=function(e,t){return arguments.length<2?Ee(we[e])||Ee(N[e]):we[e]&&we[e][t]||N[e]&&N[e][t]},F=v({}.isPrototypeOf),De=typeof navigator<`u`&&String(navigator.userAgent)||``,Oe=o,ke=De,Ae=Oe.process,je=Oe.Deno,Me=Ae&&Ae.versions||je&&je.version,Ne=Me&&Me.v8;Ne&&(ce=(se=Ne.split(`.`))[0]>0&&se[0]<4?1:+(se[0]+se[1])),!ce&&ke&&(!(se=ke.match(/Edge\/(\d+)/))||se[1]>=74)&&(se=ke.match(/Chrome\/(\d+)/))&&(ce=+se[1]);var Pe=ce,Fe=Pe,Ie=s,Le=o.String,Re=!!Object.getOwnPropertySymbols&&!Ie((function(){var e=Symbol(`symbol detection`);return!Le(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Fe&&Fe<41})),ze=Re&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,Be=P,Ve=T,He=F,Ue=Object,We=ze?function(e){return typeof e==`symbol`}:function(e){var t=Be(`Symbol`);return Ve(t)&&He(t.prototype,Ue(e))},Ge=String,Ke=function(e){try{return Ge(e)}catch{return`Object`}},qe=T,Je=Ke,Ye=TypeError,Xe=function(e){if(qe(e))return e;throw new Ye(Je(e)+` is not a function`)},Ze=Xe,Qe=he,$e=function(e,t){var n=e[t];return Qe(n)?void 0:Ze(n)},et=k,tt=T,nt=j,rt=TypeError,it={exports:{}},at=o,ot=Object.defineProperty,st=function(e,t){try{ot(at,e,{value:t,configurable:!0,writable:!0})}catch{at[e]=t}return t},ct=`__core-js_shared__`,lt=o[ct]||st(ct,{}),ut=lt;(it.exports=function(e,t){return ut[e]||(ut[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.33.2`,mode:`pure`,copyright:`© 2014-2023 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE`,source:`https://github.com/zloirock/core-js`});var dt=it.exports,ft=ve,pt=Object,mt=function(e){return pt(ft(e))},ht=mt,gt=v({}.hasOwnProperty),_t=Object.hasOwn||function(e,t){return gt(ht(e),t)},vt=v,yt=0,bt=Math.random(),xt=vt(1 .toString),St=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+xt(++yt+bt,36)},Ct=dt,wt=_t,Tt=St,Et=Re,Dt=ze,Ot=o.Symbol,kt=Ct(`wks`),At=Dt?Ot.for||Ot:Ot&&Ot.withoutSetter||Tt,jt=function(e){return wt(kt,e)||(kt[e]=Et&&wt(Ot,e)?Ot[e]:At(`Symbol.`+e)),kt[e]},Mt=k,Nt=j,Pt=We,Ft=$e,It=function(e,t){var n,r;if(t===`string`&&tt(n=e.toString)&&!nt(r=et(n,e))||tt(n=e.valueOf)&&!nt(r=et(n,e))||t!==`string`&&tt(n=e.toString)&&!nt(r=et(n,e)))return r;throw new rt(`Can't convert object to primitive value`)},Lt=TypeError,Rt=jt(`toPrimitive`),zt=function(e,t){if(!Nt(e)||Pt(e))return e;var n,r=Ft(e,Rt);if(r){if(t===void 0&&(t=`default`),n=Mt(r,e,t),!Nt(n)||Pt(n))return n;throw new Lt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),It(e,t)},Bt=We,Vt=function(e){var t=zt(e,`string`);return Bt(t)?t:t+``},Ht=j,Ut=o.document,Wt=Ht(Ut)&&Ht(Ut.createElement),Gt=function(e){return Wt?Ut.createElement(e):{}},Kt=Gt,qt=!D&&!s((function(){return Object.defineProperty(Kt(`div`),`a`,{get:function(){return 7}}).a!==7})),Jt=D,Yt=k,Xt=A,Zt=le,Qt=xe,$t=Vt,en=_t,tn=qt,nn=Object.getOwnPropertyDescriptor;E.f=Jt?nn:function(e,t){if(e=Qt(e),t=$t(t),tn)try{return nn(e,t)}catch{}if(en(e,t))return Zt(!Yt(Xt.f,e,t),e[t])};var rn=s,an=T,on=/#|\.prototype\./,sn=function(e,t){var n=ln[cn(e)];return n===dn||n!==un&&(an(t)?rn(t):!!t)},cn=sn.normalize=function(e){return String(e).replace(on,`.`).toLowerCase()},ln=sn.data={},un=sn.NATIVE=`N`,dn=sn.POLYFILL=`P`,fn=sn,pn=Xe,mn=c,hn=te(te.bind),gn=function(e,t){return pn(e),t===void 0?e:mn?hn(e,t):function(){return e.apply(t,arguments)}},_n={},vn=D&&s((function(){return Object.defineProperty((function(){}),`prototype`,{value:42,writable:!1}).prototype!==42})),yn=j,bn=String,xn=TypeError,Sn=function(e){if(yn(e))return e;throw new xn(bn(e)+` is not an object`)},Cn=D,wn=qt,Tn=vn,En=Sn,Dn=Vt,On=TypeError,kn=Object.defineProperty,An=Object.getOwnPropertyDescriptor,jn=`enumerable`,Mn=`configurable`,Nn=`writable`;_n.f=Cn?Tn?function(e,t,n){if(En(e),t=Dn(t),En(n),typeof e==`function`&&t===`prototype`&&`value`in n&&Nn in n&&!n[Nn]){var r=An(e,t);r&&r[Nn]&&(e[t]=n.value,n={configurable:Mn in n?n[Mn]:r[Mn],enumerable:jn in n?n[jn]:r[jn],writable:!1})}return kn(e,t,n)}:kn:function(e,t,n){if(En(e),t=Dn(t),En(n),wn)try{return kn(e,t,n)}catch{}if(`get`in n||`set`in n)throw new On(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Pn=_n,Fn=le,In=D?function(e,t,n){return Pn.f(e,t,Fn(1,n))}:function(e,t,n){return e[t]=n,e},Ln=o,Rn=p,zn=te,Bn=T,Vn=E.f,Hn=fn,Un=M,Wn=gn,Gn=In,Kn=_t,I=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return Rn(e,this,arguments)};return t.prototype=e.prototype,t},L=function(e,t){var n,r,i,a,o,s,c,l,u,d=e.target,f=e.global,p=e.stat,m=e.proto,h=f?Ln:p?Ln[d]:(Ln[d]||{}).prototype,g=f?Un:Un[d]||Gn(Un,d,{})[d],_=g.prototype;for(a in t)r=!(n=Hn(f?a:d+(p?`.`:`#`)+a,e.forced))&&h&&Kn(h,a),s=g[a],r&&(c=e.dontCallGetSet?(u=Vn(h,a))&&u.value:h[a]),o=r&&c?c:t[a],r&&typeof s==typeof o||(l=e.bind&&r?Wn(o,Ln):e.wrap&&r?I(o):m&&Bn(o)?zn(o):o,(e.sham||o&&o.sham||s&&s.sham)&&Gn(l,`sham`,!0),Gn(g,a,l),m&&(Kn(Un,i=d+`Prototype`)||Gn(Un,i,{}),Gn(Un[i],a,o),e.real&&_&&(n||!_[a])&&Gn(_,a,o)))},qn=L,Jn=D,Yn=_n.f;qn({target:`Object`,stat:!0,forced:Object.defineProperty!==Yn,sham:!Jn},{defineProperty:Yn});var Xn=M.Object,Zn=i.exports=function(e,t,n){return Xn.defineProperty(e,t,n)};Xn.defineProperty.sham&&(Zn.sham=!0);var Qn=i.exports,$n=Qn,er=r($n),tr=S,nr=Array.isArray||function(e){return tr(e)===`Array`},rr=Math.ceil,ir=Math.floor,ar=Math.trunc||function(e){var t=+e;return(t>0?ir:rr)(t)},or=function(e){var t=+e;return t!=t||t===0?0:ar(t)},sr=or,R=Math.min,cr=function(e){return e>0?R(sr(e),9007199254740991):0},lr=function(e){return cr(e.length)},ur=TypeError,dr=function(e){if(e>9007199254740991)throw ur(`Maximum allowed index exceeded`);return e},fr=Vt,pr=_n,mr=le,hr=function(e,t,n){var r=fr(t);r in e?pr.f(e,r,mr(0,n)):e[r]=n},gr={};gr[jt(`toStringTag`)]=`z`;var _r=String(gr)===`[object z]`,vr=_r,yr=T,br=S,xr=jt(`toStringTag`),Sr=Object,Cr=br(function(){return arguments}())===`Arguments`,wr=vr?br:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=function(e,t){try{return e[t]}catch{}}(t=Sr(e),xr))==`string`?n:Cr?br(t):(r=br(t))===`Object`&&yr(t.callee)?`Arguments`:r},Tr=T,Er=lt,Dr=v(Function.toString);Tr(Er.inspectSource)||(Er.inspectSource=function(e){return Dr(e)});var Or=Er.inspectSource,kr=v,Ar=s,jr=T,Mr=wr,Nr=Or,Pr=function(){},Fr=[],Ir=P(`Reflect`,`construct`),Lr=/^\s*(?:class|function)\b/,Rr=kr(Lr.exec),zr=!Lr.test(Pr),Br=function(e){if(!jr(e))return!1;try{return Ir(Pr,Fr,e),!0}catch{return!1}},Vr=function(e){if(!jr(e))return!1;switch(Mr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return zr||!!Rr(Lr,Nr(e))}catch{return!0}};Vr.sham=!0;var Hr=!Ir||Ar((function(){var e;return Br(Br.call)||!Br(Object)||!Br((function(){e=!0}))||e}))?Vr:Br,Ur=nr,Wr=Hr,Gr=j,Kr=jt(`species`),qr=Array,Jr=function(e){var t;return Ur(e)&&(t=e.constructor,(Wr(t)&&(t===qr||Ur(t.prototype))||Gr(t)&&(t=t[Kr])===null)&&(t=void 0)),t===void 0?qr:t},Yr=function(e,t){return new(Jr(e))(t===0?0:t)},Xr=s,Zr=Pe,Qr=jt(`species`),$r=function(e){return Zr>=51||!Xr((function(){var t=[];return(t.constructor={})[Qr]=function(){return{foo:1}},t[e](Boolean).foo!==1}))},z=L,ei=s,ti=nr,ni=j,ri=mt,ii=lr,ai=dr,oi=hr,si=Yr,ci=$r,li=Pe,ui=jt(`isConcatSpreadable`),di=li>=51||!ei((function(){var e=[];return e[ui]=!1,e.concat()[0]!==e})),fi=function(e){if(!ni(e))return!1;var t=e[ui];return t===void 0?ti(e):!!t};z({target:`Array`,proto:!0,arity:1,forced:!di||!ci(`concat`)},{concat:function(e){var t,n,r,i,a,o=ri(this),s=si(o,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(fi(a=t===-1?o:arguments[t]))for(i=ii(a),ai(c+i),n=0;n<i;n++,c++)n in a&&oi(s,c,a[n]);else ai(c+1),oi(s,c++,a);return s.length=c,s}});var pi=wr,mi=String,hi=function(e){if(pi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return mi(e)},gi={},_i=or,vi=Math.max,yi=Math.min,bi=function(e,t){var n=_i(e);return n<0?vi(n+t,0):yi(n,t)},xi=xe,Si=bi,Ci=lr,wi=function(e){return function(t,n,r){var i,a=xi(t),o=Ci(a),s=Si(r,o);if(e&&n!=n){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===n)return e||s||0;return!e&&-1}},Ti={includes:wi(!0),indexOf:wi(!1)},Ei={},Di=_t,Oi=xe,ki=Ti.indexOf,Ai=Ei,ji=v([].push),Mi=function(e,t){var n,r=Oi(e),i=0,a=[];for(n in r)!Di(Ai,n)&&Di(r,n)&&ji(a,n);for(;t.length>i;)Di(r,n=t[i++])&&(~ki(a,n)||ji(a,n));return a},Ni=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],Pi=Mi,Fi=Ni,Ii=Object.keys||function(e){return Pi(e,Fi)},Li=D,Ri=vn,zi=_n,Bi=Sn,Vi=xe,Hi=Ii;gi.f=Li&&!Ri?Object.defineProperties:function(e,t){Bi(e);for(var n,r=Vi(t),i=Hi(t),a=i.length,o=0;a>o;)zi.f(e,n=i[o++],r[n]);return e};var Ui,Wi=P(`document`,`documentElement`),Gi=St,Ki=dt(`keys`),qi=function(e){return Ki[e]||(Ki[e]=Gi(e))},Ji=Sn,Yi=gi,Xi=Ni,Zi=Ei,Qi=Wi,$i=Gt,ea=`prototype`,ta=`script`,na=qi(`IE_PROTO`),ra=function(){},ia=function(e){return`<`+ta+`>`+e+`</`+ta+`>`},aa=function(e){e.write(ia(``)),e.close();var t=e.parentWindow.Object;return e=null,t},oa=function(){try{Ui=new ActiveXObject(`htmlfile`)}catch{}var e,t,n;oa=typeof document<`u`?document.domain&&Ui?aa(Ui):(t=$i(`iframe`),n=`java`+ta+`:`,t.style.display=`none`,Qi.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(ia(`document.F=Object`)),e.close(),e.F):aa(Ui);for(var r=Xi.length;r--;)delete oa[ea][Xi[r]];return oa()};Zi[na]=!0;var sa=Object.create||function(e,t){var n;return e===null?n=oa():(ra[ea]=Ji(e),n=new ra,ra[ea]=null,n[na]=e),t===void 0?n:Yi.f(n,t)},ca={},la=Mi,ua=Ni.concat(`length`,`prototype`);ca.f=Object.getOwnPropertyNames||function(e){return la(e,ua)};var da={},fa=bi,pa=lr,ma=hr,ha=Array,ga=Math.max,_a=function(e,t,n){for(var r=pa(e),i=fa(t,r),a=fa(n===void 0?r:n,r),o=ha(ga(a-i,0)),s=0;i<a;i++,s++)ma(o,s,e[i]);return o.length=s,o},va=S,ya=xe,ba=ca.f,xa=_a,Sa=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];da.f=function(e){return Sa&&va(e)===`Window`?function(e){try{return ba(e)}catch{return xa(Sa)}}(e):ba(ya(e))};var Ca={};Ca.f=Object.getOwnPropertySymbols;var wa=In,Ta=function(e,t,n,r){return r&&r.enumerable?e[t]=n:wa(e,t,n),e},Ea=_n,Da=function(e,t,n){return Ea.f(e,t,n)},Oa={};Oa.f=jt;var ka,Aa,ja,Ma=M,Na=_t,Pa=Oa,Fa=_n.f,Ia=function(e){var t=Ma.Symbol||={};Na(t,e)||Fa(t,e,{value:Pa.f(e)})},La=k,Ra=P,za=jt,Ba=Ta,Va=function(){var e=Ra(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=za(`toPrimitive`);t&&!t[r]&&Ba(t,r,(function(e){return La(n,this)}),{arity:1})},Ha=wr,Ua=_r?{}.toString:function(){return`[object `+Ha(this)+`]`},Wa=_r,Ga=_n.f,Ka=In,qa=_t,Ja=Ua,Ya=jt(`toStringTag`),Xa=function(e,t,n,r){if(e){var i=n?e:e.prototype;qa(i,Ya)||Ga(i,Ya,{configurable:!0,value:t}),r&&!Wa&&Ka(i,`toString`,Ja)}},Za=T,Qa=o.WeakMap,$a=Za(Qa)&&/native code/.test(String(Qa)),eo=o,to=j,no=In,ro=_t,io=lt,ao=qi,oo=Ei,so=`Object already initialized`,co=eo.TypeError,lo=eo.WeakMap;if($a||io.state){var uo=io.state||=new lo;uo.get=uo.get,uo.has=uo.has,uo.set=uo.set,ka=function(e,t){if(uo.has(e))throw new co(so);return t.facade=e,uo.set(e,t),t},Aa=function(e){return uo.get(e)||{}},ja=function(e){return uo.has(e)}}else{var fo=ao(`state`);oo[fo]=!0,ka=function(e,t){if(ro(e,fo))throw new co(so);return t.facade=e,no(e,fo,t),t},Aa=function(e){return ro(e,fo)?e[fo]:{}},ja=function(e){return ro(e,fo)}}var po={set:ka,get:Aa,has:ja,enforce:function(e){return ja(e)?Aa(e):ka(e,{})},getterFor:function(e){return function(t){var n;if(!to(t)||(n=Aa(t)).type!==e)throw new co(`Incompatible receiver, `+e+` required`);return n}}},mo=gn,ho=me,go=mt,_o=lr,vo=Yr,yo=v([].push),bo=function(e){var t=e===1,n=e===2,r=e===3,i=e===4,a=e===6,o=e===7,s=e===5||a;return function(c,l,u,d){for(var f,p,m=go(c),h=ho(m),g=mo(l,u),_=_o(h),v=0,y=d||vo,b=t?y(c,_):n||o?y(c,0):void 0;_>v;v++)if((s||v in h)&&(p=g(f=h[v],v,m),e))if(t)b[v]=p;else if(p)switch(e){case 3:return!0;case 5:return f;case 6:return v;case 2:yo(b,f)}else switch(e){case 4:return!1;case 7:yo(b,f)}return a?-1:r||i?i:b}},xo={forEach:bo(0),map:bo(1),filter:bo(2),some:bo(3),every:bo(4),find:bo(5),findIndex:bo(6),filterReject:bo(7)},So=L,Co=o,wo=k,To=v,Eo=D,Do=Re,Oo=s,ko=_t,Ao=F,jo=Sn,Mo=xe,No=Vt,Po=hi,Fo=le,Io=sa,Lo=Ii,Ro=ca,zo=da,Bo=Ca,Vo=E,Ho=_n,Uo=gi,Wo=A,Go=Ta,Ko=Da,qo=dt,Jo=Ei,Yo=St,Xo=jt,Zo=Oa,Qo=Ia,$o=Va,es=Xa,ts=po,ns=xo.forEach,rs=qi(`hidden`),is=`Symbol`,as=`prototype`,os=ts.set,ss=ts.getterFor(is),cs=Object[as],ls=Co.Symbol,us=ls&&ls[as],ds=Co.RangeError,fs=Co.TypeError,ps=Co.QObject,ms=Vo.f,hs=Ho.f,gs=zo.f,_s=Wo.f,vs=To([].push),ys=qo(`symbols`),bs=qo(`op-symbols`),xs=qo(`wks`),Ss=!ps||!ps[as]||!ps[as].findChild,Cs=function(e,t,n){var r=ms(cs,t);r&&delete cs[t],hs(e,t,n),r&&e!==cs&&hs(cs,t,r)},ws=Eo&&Oo((function(){return Io(hs({},`a`,{get:function(){return hs(this,`a`,{value:7}).a}})).a!==7}))?Cs:hs,Ts=function(e,t){var n=ys[e]=Io(us);return os(n,{type:is,tag:e,description:t}),Eo||(n.description=t),n},Es=function(e,t,n){e===cs&&Es(bs,t,n),jo(e);var r=No(t);return jo(n),ko(ys,r)?(n.enumerable?(ko(e,rs)&&e[rs][r]&&(e[rs][r]=!1),n=Io(n,{enumerable:Fo(0,!1)})):(ko(e,rs)||hs(e,rs,Fo(1,{})),e[rs][r]=!0),ws(e,r,n)):hs(e,r,n)},Ds=function(e,t){jo(e);var n=Mo(t);return ns(Lo(n).concat(js(n)),(function(t){Eo&&!wo(Os,n,t)||Es(e,t,n[t])})),e},Os=function(e){var t=No(e),n=wo(_s,this,t);return!(this===cs&&ko(ys,t)&&!ko(bs,t))&&(!(n||!ko(this,t)||!ko(ys,t)||ko(this,rs)&&this[rs][t])||n)},ks=function(e,t){var n=Mo(e),r=No(t);if(n!==cs||!ko(ys,r)||ko(bs,r)){var i=ms(n,r);return!i||!ko(ys,r)||ko(n,rs)&&n[rs][r]||(i.enumerable=!0),i}},As=function(e){var t=gs(Mo(e)),n=[];return ns(t,(function(e){ko(ys,e)||ko(Jo,e)||vs(n,e)})),n},js=function(e){var t=e===cs,n=gs(t?bs:Mo(e)),r=[];return ns(n,(function(e){!ko(ys,e)||t&&!ko(cs,e)||vs(r,ys[e])})),r};Do||(ls=function(){if(Ao(us,this))throw new fs(`Symbol is not a constructor`);var e=arguments.length&&arguments[0]!==void 0?Po(arguments[0]):void 0,t=Yo(e),n=function(e){var r=this===void 0?Co:this;r===cs&&wo(n,bs,e),ko(r,rs)&&ko(r[rs],t)&&(r[rs][t]=!1);var i=Fo(1,e);try{ws(r,t,i)}catch(e){if(!(e instanceof ds))throw e;Cs(r,t,i)}};return Eo&&Ss&&ws(cs,t,{configurable:!0,set:n}),Ts(t,e)},Go(us=ls[as],`toString`,(function(){return ss(this).tag})),Go(ls,`withoutSetter`,(function(e){return Ts(Yo(e),e)})),Wo.f=Os,Ho.f=Es,Uo.f=Ds,Vo.f=ks,Ro.f=zo.f=As,Bo.f=js,Zo.f=function(e){return Ts(Xo(e),e)},Eo&&Ko(us,`description`,{configurable:!0,get:function(){return ss(this).description}})),So({global:!0,constructor:!0,wrap:!0,forced:!Do,sham:!Do},{Symbol:ls}),ns(Lo(xs),(function(e){Qo(e)})),So({target:is,stat:!0,forced:!Do},{useSetter:function(){Ss=!0},useSimple:function(){Ss=!1}}),So({target:`Object`,stat:!0,forced:!Do,sham:!Eo},{create:function(e,t){return t===void 0?Io(e):Ds(Io(e),t)},defineProperty:Es,defineProperties:Ds,getOwnPropertyDescriptor:ks}),So({target:`Object`,stat:!0,forced:!Do},{getOwnPropertyNames:As}),$o(),es(ls,is),Jo[rs]=!0;var Ms=Re&&!!Symbol.for&&!!Symbol.keyFor,Ns=L,Ps=P,Fs=_t,Is=hi,Ls=dt,Rs=Ms,zs=Ls(`string-to-symbol-registry`),Bs=Ls(`symbol-to-string-registry`);Ns({target:`Symbol`,stat:!0,forced:!Rs},{for:function(e){var t=Is(e);if(Fs(zs,t))return zs[t];var n=Ps(`Symbol`)(t);return zs[t]=n,Bs[n]=t,n}});var Vs=L,Hs=_t,Us=We,Ws=Ke,Gs=Ms,Ks=dt(`symbol-to-string-registry`);Vs({target:`Symbol`,stat:!0,forced:!Gs},{keyFor:function(e){if(!Us(e))throw TypeError(Ws(e)+` is not a symbol`);if(Hs(Ks,e))return Ks[e]}});var qs=v([].slice),Js=nr,Ys=T,Xs=S,Zs=hi,Qs=v([].push),$s=L,ec=P,tc=p,nc=k,rc=v,ic=s,ac=T,oc=We,sc=qs,cc=function(e){if(Ys(e))return e;if(Js(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Qs(n,i):typeof i!=`number`&&Xs(i)!==`Number`&&Xs(i)!==`String`||Qs(n,Zs(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(Js(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},lc=Re,uc=String,dc=ec(`JSON`,`stringify`),fc=rc(/./.exec),pc=rc(``.charAt),mc=rc(``.charCodeAt),hc=rc(``.replace),gc=rc(1 .toString),_c=/[\uD800-\uDFFF]/g,vc=/^[\uD800-\uDBFF]$/,yc=/^[\uDC00-\uDFFF]$/,bc=!lc||ic((function(){var e=ec(`Symbol`)(`stringify detection`);return dc([e])!==`[null]`||dc({a:e})!==`{}`||dc(Object(e))!==`{}`})),xc=ic((function(){return dc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||dc(`\udead`)!==`"\\udead"`})),Sc=function(e,t){var n=sc(arguments),r=cc(t);if(ac(r)||e!==void 0&&!oc(e))return n[1]=function(e,t){if(ac(r)&&(t=nc(r,this,uc(e),t)),!oc(t))return t},tc(dc,null,n)},B=function(e,t,n){var r=pc(n,t-1),i=pc(n,t+1);return fc(vc,e)&&!fc(yc,i)||fc(yc,e)&&!fc(vc,r)?`\\u`+gc(mc(e,0),16):e};dc&&$s({target:`JSON`,stat:!0,arity:3,forced:bc||xc},{stringify:function(e,t,n){var r=sc(arguments),i=tc(bc?Sc:dc,null,r);return xc&&typeof i==`string`?hc(i,_c,B):i}});var Cc=Ca,wc=mt;L({target:`Object`,stat:!0,forced:!Re||s((function(){Cc.f(1)}))},{getOwnPropertySymbols:function(e){var t=Cc.f;return t?t(wc(e)):[]}}),Ia(`asyncIterator`),Ia(`hasInstance`),Ia(`isConcatSpreadable`),Ia(`iterator`),Ia(`match`),Ia(`matchAll`),Ia(`replace`),Ia(`search`),Ia(`species`),Ia(`split`);var Tc=Va;Ia(`toPrimitive`),Tc();var Ec=P,Dc=Xa;Ia(`toStringTag`),Dc(Ec(`Symbol`),`Symbol`),Ia(`unscopables`),Xa(o.JSON,`JSON`,!0);var Oc,kc,Ac,jc=M.Symbol,Mc={},Nc=D,Pc=_t,Fc=Function.prototype,Ic=Nc&&Object.getOwnPropertyDescriptor,Lc=Pc(Fc,`name`),Rc={EXISTS:Lc,PROPER:Lc&&function(){}.name===`something`,CONFIGURABLE:Lc&&(!Nc||Nc&&Ic(Fc,`name`).configurable)},zc=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Bc=_t,Vc=T,Hc=mt,Uc=zc,Wc=qi(`IE_PROTO`),Gc=Object,Kc=Gc.prototype,qc=Uc?Gc.getPrototypeOf:function(e){var t=Hc(e);if(Bc(t,Wc))return t[Wc];var n=t.constructor;return Vc(n)&&t instanceof n?n.prototype:t instanceof Gc?Kc:null},Jc=s,Yc=T,Xc=j,Zc=sa,Qc=qc,$c=Ta,el=jt(`iterator`),tl=!1;[].keys&&(`next`in(Ac=[].keys())?(kc=Qc(Qc(Ac)))!==Object.prototype&&(Oc=kc):tl=!0),Yc((Oc=!Xc(Oc)||Jc((function(){var e={};return Oc[el].call(e)!==e}))?{}:Zc(Oc))[el])||$c(Oc,el,(function(){return this}));var nl={IteratorPrototype:Oc,BUGGY_SAFARI_ITERATORS:tl},rl=nl.IteratorPrototype,il=sa,al=le,ol=Xa,sl=Mc,cl=function(){return this},ll=v,ul=Xe,dl=T,fl=String,pl=TypeError,ml=function(e,t,n){try{return ll(ul(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},hl=Sn,gl=function(e){if(typeof e==`object`||dl(e))return e;throw new pl(`Can't set `+fl(e)+` as a prototype`)},_l=Object.setPrototypeOf||(`__proto__`in{}?function(){var e,t=!1,n={};try{(e=ml(Object.prototype,`__proto__`,`set`))(n,[]),t=n instanceof Array}catch{}return function(n,r){return hl(n),gl(r),t?e(n,r):n.__proto__=r,n}}():void 0),vl=L,yl=k,bl=Rc,xl=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=il(rl,{next:al(+!r,n)}),ol(e,i,!1,!0),sl[i]=cl,e},Sl=qc,Cl=Xa,wl=Ta,Tl=Mc,El=nl,Dl=bl.PROPER,Ol=El.BUGGY_SAFARI_ITERATORS,kl=jt(`iterator`),Al=`keys`,jl=`values`,Ml=`entries`,Nl=function(){return this},Pl=function(e,t,n,r,i,a,o){xl(n,t,r);var s,c,l,u=function(e){if(e===i&&h)return h;if(!Ol&&e&&e in p)return p[e];switch(e){case Al:case jl:case Ml:return function(){return new n(this,e)}}return function(){return new n(this)}},d=t+` Iterator`,f=!1,p=e.prototype,m=p[kl]||p[`@@iterator`]||i&&p[i],h=!Ol&&m||u(i),g=t===`Array`&&p.entries||m;if(g&&(s=Sl(g.call(new e)))!==Object.prototype&&s.next&&(Cl(s,d,!0,!0),Tl[d]=Nl),Dl&&i===jl&&m&&m.name!==jl&&(f=!0,h=function(){return yl(m,this)}),i)if(c={values:u(jl),keys:a?h:u(Al),entries:u(Ml)},o)for(l in c)(Ol||f||!(l in p))&&wl(p,l,c[l]);else vl({target:t,proto:!0,forced:Ol||f},c);return o&&p[kl]!==h&&wl(p,kl,h,{name:i}),Tl[t]=h,c},Fl=function(e,t){return{value:e,done:t}},Il=xe,Ll=Mc,Rl=po;_n.f;var zl=Pl,Bl=Fl,Vl=`Array Iterator`,Hl=Rl.set,Ul=Rl.getterFor(Vl);zl(Array,`Array`,(function(e,t){Hl(this,{type:Vl,target:Il(e),index:0,kind:t})}),(function(){var e=Ul(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Bl(void 0,!0);switch(e.kind){case`keys`:return Bl(n,!1);case`values`:return Bl(t[n],!1)}return Bl([n,t[n]],!1)}),`values`),Ll.Arguments=Ll.Array;var Wl={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},Gl=o,Kl=wr,ql=In,Jl=Mc,Yl=jt(`toStringTag`);for(var Xl in Wl){var Zl=Gl[Xl],Ql=Zl&&Zl.prototype;Ql&&Kl(Ql)!==Yl&&ql(Ql,Yl,Xl),Jl[Xl]=Jl.Array}var $l=jc,eu=jt,tu=_n.f,nu=eu(`metadata`),ru=Function.prototype;ru[nu]===void 0&&tu(ru,nu,{value:null}),Ia(`asyncDispose`),Ia(`dispose`),Ia(`metadata`);var iu=$l,au=v,ou=P(`Symbol`),su=ou.keyFor,cu=au(ou.prototype.valueOf),lu=ou.isRegisteredSymbol||function(e){try{return su(cu(e))!==void 0}catch{return!1}};L({target:`Symbol`,stat:!0},{isRegisteredSymbol:lu});for(var uu=dt,du=P,fu=v,pu=We,mu=jt,hu=du(`Symbol`),gu=hu.isWellKnownSymbol,_u=du(`Object`,`getOwnPropertyNames`),vu=fu(hu.prototype.valueOf),yu=uu(`wks`),bu=0,xu=_u(hu),Su=xu.length;bu<Su;bu++)try{var Cu=xu[bu];pu(hu[Cu])&&mu(Cu)}catch{}var wu=function(e){if(gu&&gu(e))return!0;try{for(var t=vu(e),n=0,r=_u(yu),i=r.length;n<i;n++)if(yu[r[n]]==t)return!0}catch{}return!1};L({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:wu}),Ia(`matcher`),Ia(`observable`),L({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:lu}),L({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:wu}),Ia(`metadataKey`),Ia(`patternMatch`),Ia(`replaceAll`);var Tu=iu,Eu=r(Tu),Du=v,Ou=or,ku=hi,Au=ve,ju=Du(``.charAt),Mu=Du(``.charCodeAt),Nu=Du(``.slice),Pu=function(e){return function(t,n){var r,i,a=ku(Au(t)),o=Ou(n),s=a.length;return o<0||o>=s?e?``:void 0:(r=Mu(a,o))<55296||r>56319||o+1===s||(i=Mu(a,o+1))<56320||i>57343?e?ju(a,o):r:e?Nu(a,o,o+2):i-56320+(r-55296<<10)+65536}},Fu={codeAt:Pu(!1),charAt:Pu(!0)}.charAt,Iu=hi,Lu=po,Ru=Pl,zu=Fl,Bu=`String Iterator`,Vu=Lu.set,Hu=Lu.getterFor(Bu);Ru(String,`String`,(function(e){Vu(this,{type:Bu,string:Iu(e),index:0})}),(function(){var e,t=Hu(this),n=t.string,r=t.index;return r>=n.length?zu(void 0,!0):(e=Fu(n,r),t.index+=e.length,zu(e,!1))}));var Uu=Oa.f(`iterator`),Wu=Uu,Gu=r(Wu);function Ku(e){return Ku=typeof Eu==`function`&&typeof Gu==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Eu==`function`&&e.constructor===Eu&&e!==Eu.prototype?`symbol`:typeof e},Ku(e)}var qu=r(Oa.f(`toPrimitive`));function Ju(e){var t=function(e,t){if(Ku(e)!==`object`||e===null)return e;var n=e[qu];if(n!==void 0){var r=n.call(e,t||`default`);if(Ku(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return Ku(t)===`symbol`?t:String(t)}function Yu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),er(e,Ju(r.key),r)}}function Xu(e,t,n){return t&&Yu(e.prototype,t),n&&Yu(e,n),er(e,`prototype`,{writable:!1}),e}function Zu(e,t,n){return(t=Ju(t))in e?er(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qu=v,$u=Xe,ed=j,td=_t,nd=qs,rd=c,id=Function,ad=Qu([].concat),od=Qu([].join),sd={},cd=rd?id.bind:function(e){var t=$u(this),n=t.prototype,r=nd(arguments,1),i=function(){var n=ad(r,nd(arguments));return this instanceof i?function(e,t,n){if(!td(sd,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;sd[t]=id(`C,a`,`return new C(`+od(r,`,`)+`)`)}return sd[t](e,n)}(t,n.length,n):t.apply(e,n)};return ed(n)&&(i.prototype=n),i},ld=cd;L({target:`Function`,proto:!0,forced:Function.bind!==ld},{bind:ld});var ud=o,dd=M,fd=function(e,t){var n=dd[e+`Prototype`],r=n&&n[t];if(r)return r;var i=ud[e],a=i&&i.prototype;return a&&a[t]},pd=fd(`Function`,`bind`),md=F,hd=pd,gd=Function.prototype,_d=function(e){var t=e.bind;return e===gd||md(gd,e)&&t===gd.bind?hd:t},vd=r(_d),yd=Xe,bd=mt,xd=me,Sd=lr,Cd=TypeError,wd=function(e){return function(t,n,r,i){yd(n);var a=bd(t),o=xd(a),s=Sd(a),c=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw new Cd(`Reduce of empty array with no initial value`)}for(;e?c>=0:s>c;c+=l)c in o&&(i=n(i,o[c],c,a));return i}},Td={left:wd(!1),right:wd(!0)},Ed=s,Dd=function(e,t){var n=[][e];return!!n&&Ed((function(){n.call(null,t||function(){return 1},1)}))},Od=S(o.process)===`process`,kd=Td.left;L({target:`Array`,proto:!0,forced:!Od&&Pe>79&&Pe<83||!Dd(`reduce`)},{reduce:function(e){var t=arguments.length;return kd(this,e,t,t>1?arguments[1]:void 0)}});var Ad=fd(`Array`,`reduce`),jd=F,Md=Ad,Nd=Array.prototype,Pd=r((function(e){var t=e.reduce;return e===Nd||jd(Nd,e)&&t===Nd.reduce?Md:t})),Fd=xo.filter;L({target:`Array`,proto:!0,forced:!$r(`filter`)},{filter:function(e){return Fd(this,e,arguments.length>1?arguments[1]:void 0)}});var Id=fd(`Array`,`filter`),Ld=F,Rd=Id,zd=Array.prototype,Bd=r((function(e){var t=e.filter;return e===zd||Ld(zd,e)&&t===zd.filter?Rd:t})),Vd=xo.map;L({target:`Array`,proto:!0,forced:!$r(`map`)},{map:function(e){return Vd(this,e,arguments.length>1?arguments[1]:void 0)}});var Hd=fd(`Array`,`map`),Ud=F,Wd=Hd,Gd=Array.prototype,Kd=r((function(e){var t=e.map;return e===Gd||Ud(Gd,e)&&t===Gd.map?Wd:t})),qd=nr,Jd=lr,Yd=dr,Xd=gn,Zd=function(e,t,n,r,i,a,o,s){for(var c,l,u=i,d=0,f=!!o&&Xd(o,s);d<r;)d in n&&(c=f?f(n[d],d,t):n[d],a>0&&qd(c)?(l=Jd(c),u=Zd(e,t,c,l,u,a-1)-1):(Yd(u+1),e[u]=c),u++),d++;return u},Qd=Zd,$d=Xe,ef=mt,tf=lr,nf=Yr;L({target:`Array`,proto:!0},{flatMap:function(e){var t,n=ef(this),r=tf(n);return $d(e),(t=nf(n,0)).length=Qd(t,n,n,r,0,1,e,arguments.length>1?arguments[1]:void 0),t}});var rf=fd(`Array`,`flatMap`),af=F,of=rf,sf=Array.prototype,cf=r((function(e){var t=e.flatMap;return e===sf||af(sf,e)&&t===sf.flatMap?of:t})),lf=function(){function e(n,r,i){var a,o,s;t(this,e),Zu(this,`_listeners`,{add:vd(a=this._add).call(a,this),remove:vd(o=this._remove).call(o,this),update:vd(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return Xu(e,[{key:`all`,value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:`start`,value:function(){return this._source.on(`add`,this._listeners.add),this._source.on(`remove`,this._listeners.remove),this._source.on(`update`,this._listeners.update),this}},{key:`stop`,value:function(){return this._source.off(`add`,this._listeners.add),this._source.off(`remove`,this._listeners.remove),this._source.off(`update`,this._listeners.update),this}},{key:`_transformItems`,value:function(e){var t;return Pd(t=this._transformers).call(t,(function(e,t){return t(e)}),e)}},{key:`_add`,value:function(e,t){t!=null&&this._target.add(this._transformItems(this._source.get(t.items)))}},{key:`_update`,value:function(e,t){t!=null&&this._target.update(this._transformItems(this._source.get(t.items)))}},{key:`_remove`,value:function(e,t){t!=null&&this._target.remove(this._transformItems(t.oldData))}}]),e}(),uf=function(){function e(n){t(this,e),Zu(this,`_transformers`,[]),this._source=n}return Xu(e,[{key:`filter`,value:function(e){return this._transformers.push((function(t){return Bd(t).call(t,e)})),this}},{key:`map`,value:function(e){return this._transformers.push((function(t){return Kd(t).call(t,e)})),this}},{key:`flatMap`,value:function(e){return this._transformers.push((function(t){return cf(t).call(t,e)})),this}},{key:`to`,value:function(e){return new lf(this._source,this._transformers,e)}}]),e}(),df=k,ff=Sn,pf=$e,mf=function(e,t,n){var r,i;ff(e);try{if(!(r=pf(e,`return`))){if(t===`throw`)throw n;return n}r=df(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return ff(r),n},hf=Sn,gf=mf,_f=Mc,vf=jt(`iterator`),yf=Array.prototype,bf=function(e){return e!==void 0&&(_f.Array===e||yf[vf]===e)},xf=wr,Sf=$e,Cf=he,wf=Mc,Tf=jt(`iterator`),Ef=function(e){if(!Cf(e))return Sf(e,Tf)||Sf(e,`@@iterator`)||wf[xf(e)]},V=k,Df=Xe,Of=Sn,kf=Ke,Af=Ef,jf=TypeError,Mf=function(e,t){var n=arguments.length<2?Af(e):t;if(Df(n))return Of(V(n,e));throw new jf(kf(e)+` is not iterable`)},Nf=gn,Pf=k,Ff=mt,If=function(e,t,n,r){try{return r?t(hf(n)[0],n[1]):t(n)}catch(t){gf(e,`throw`,t)}},Lf=bf,Rf=Hr,zf=lr,Bf=hr,Vf=Mf,Hf=Ef,Uf=Array,Wf=jt(`iterator`),Gf=!1;try{var Kf=0,qf={next:function(){return{done:!!Kf++}},return:function(){Gf=!0}};qf[Wf]=function(){return this},Array.from(qf,(function(){throw 2}))}catch{}var Jf=function(e,t){try{if(!t&&!Gf)return!1}catch{return!1}var n=!1;try{var r={};r[Wf]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n};L({target:`Array`,stat:!0,forced:!Jf((function(e){Array.from(e)}))},{from:function(e){var t=Ff(e),n=Rf(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Nf(i,r>2?arguments[2]:void 0));var o,s,c,l,u,d,f=Hf(t),p=0;if(!f||this===Uf&&Lf(f))for(o=zf(t),s=n?new this(o):Uf(o);o>p;p++)d=a?i(t[p],p):t[p],Bf(s,p,d);else for(u=(l=Vf(t,f)).next,s=n?new this:[];!(c=Pf(u,l)).done;p++)d=a?If(l,i,[c.value,p],!0):c.value,Bf(s,p,d);return s.length=p,s}});var Yf=M.Array.from,Xf=r(Yf),Zf=Ef,Qf=r(Zf),$f=r(Zf);L({target:`Array`,stat:!0},{isArray:nr});var ep=M.Array.isArray,tp=r(ep),np=D,rp=nr,ip=TypeError,ap=Object.getOwnPropertyDescriptor,op=np&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(rp(e)&&!ap(e,`length`).writable)throw new ip(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},sp=mt,cp=lr,lp=op,up=dr;L({target:`Array`,proto:!0,arity:1,forced:s((function(){return[].push.call({length:4294967296},1)!==4294967297}))||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=sp(this),n=cp(t),r=arguments.length;up(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return lp(t,n),n}});var dp=fd(`Array`,`push`),fp=F,pp=dp,mp=Array.prototype,hp=function(e){var t=e.push;return e===mp||fp(mp,e)&&t===mp.push?pp:t},gp=r(hp),_p=L,vp=nr,yp=Hr,bp=j,xp=bi,Sp=lr,Cp=xe,wp=hr,Tp=jt,Ep=qs,Dp=$r(`slice`),Op=Tp(`species`),kp=Array,Ap=Math.max;_p({target:`Array`,proto:!0,forced:!Dp},{slice:function(e,t){var n,r,i,a=Cp(this),o=Sp(a),s=xp(e,o),c=xp(t===void 0?o:t,o);if(vp(a)&&(n=a.constructor,(yp(n)&&(n===kp||vp(n.prototype))||bp(n)&&(n=n[Op])===null)&&(n=void 0),n===kp||n===void 0))return Ep(a,s,c);for(r=new(n===void 0?kp:n)(Ap(c-s,0)),i=0;s<c;s++,i++)s in a&&wp(r,i,a[s]);return r.length=i,r}});var jp=fd(`Array`,`slice`),Mp=F,Np=jp,Pp=Array.prototype,Fp=function(e){var t=e.slice;return e===Pp||Mp(Pp,e)&&t===Pp.slice?Np:t},Ip=Fp,Lp=r(Ip),Rp=r(Yf);function zp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Bp(e,t){var n;if(e){if(typeof e==`string`)return zp(e,t);var r=Lp(n=Object.prototype.toString.call(e)).call(n,8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Rp(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zp(e,t):void 0}}function Vp(e,t){return function(e){if(tp(e))return e}(e)||function(e,t){var n=e==null?null:Eu!==void 0&&Qf(e)||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(gp(s).call(s,r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||Bp(e,t)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
42
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Hp(e){return function(e){if(tp(e))return zp(e)}(e)||function(e){if(Eu!==void 0&&Qf(e)!=null||e[`@@iterator`]!=null)return Rp(e)}(e)||Bp(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
43
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var Up=r($l),Wp=fd(`Array`,`concat`),Gp=F,Kp=Wp,qp=Array.prototype,Jp=r((function(e){var t=e.concat;return e===qp||Gp(qp,e)&&t===qp.concat?Kp:t})),Yp=r(Fp),Xp=P,Zp=ca,Qp=Ca,$p=Sn,em=v([].concat),tm=Xp(`Reflect`,`ownKeys`)||function(e){var t=Zp.f($p(e)),n=Qp.f;return n?em(t,n(e)):t};L({target:`Reflect`,stat:!0},{ownKeys:tm});var nm=r(M.Reflect.ownKeys),rm=r(ep),im=mt,am=Ii;L({target:`Object`,stat:!0,forced:s((function(){am(1)}))},{keys:function(e){return am(im(e))}});var om=r(M.Object.keys),sm=xo.forEach,cm=Dd(`forEach`)?[].forEach:function(e){return sm(this,e,arguments.length>1?arguments[1]:void 0)};L({target:`Array`,proto:!0,forced:[].forEach!==cm},{forEach:cm});var lm=fd(`Array`,`forEach`),um=wr,dm=_t,fm=F,pm=lm,mm=Array.prototype,hm={DOMTokenList:!0,NodeList:!0},gm=function(e){var t=e.forEach;return e===mm||fm(mm,e)&&t===mm.forEach||dm(hm,um(e))?pm:t},_m=r(gm),vm=L,ym=nr,bm=v([].reverse),xm=[1,2];vm({target:`Array`,proto:!0,forced:String(xm)===String(xm.reverse())},{reverse:function(){return ym(this)&&(this.length=this.length),bm(this)}});var Sm=fd(`Array`,`reverse`),Cm=F,wm=Sm,Tm=Array.prototype,Em=function(e){var t=e.reverse;return e===Tm||Cm(Tm,e)&&t===Tm.reverse?wm:t},Dm=r(Em),Om=Ke,km=TypeError,Am=function(e,t){if(!delete e[t])throw new km(`Cannot delete property `+Om(t)+` of `+Om(e))},jm=L,Mm=mt,Nm=bi,Pm=or,Fm=lr,Im=op,Lm=dr,Rm=Yr,zm=hr,Bm=Am,Vm=$r(`splice`),Hm=Math.max,Um=Math.min;jm({target:`Array`,proto:!0,forced:!Vm},{splice:function(e,t){var n,r,i,a,o,s,c=Mm(this),l=Fm(c),u=Nm(e,l),d=arguments.length;for(d===0?n=r=0:d===1?(n=0,r=l-u):(n=d-2,r=Um(Hm(Pm(t),0),l-u)),Lm(l+n-r),i=Rm(c,r),a=0;a<r;a++)(o=u+a)in c&&zm(i,a,c[o]);if(i.length=r,n<r){for(a=u;a<l-r;a++)s=a+n,(o=a+r)in c?c[s]=c[o]:Bm(c,s);for(a=l;a>l-r+n;a--)Bm(c,a-1)}else if(n>r)for(a=l-r;a>u;a--)s=a+n-1,(o=a+r-1)in c?c[s]=c[o]:Bm(c,s);for(a=0;a<n;a++)c[a+u]=arguments[a+2];return Im(c,l-r+n),i}});var Wm=fd(`Array`,`splice`),Gm=F,Km=Wm,qm=Array.prototype,Jm=r((function(e){var t=e.splice;return e===qm||Gm(qm,e)&&t===qm.splice?Km:t})),Ym=D,Xm=v,Zm=k,Qm=s,$m=Ii,eh=Ca,th=A,nh=mt,rh=me,ih=Object.assign,ah=Object.defineProperty,oh=Xm([].concat),sh=!ih||Qm((function(){if(Ym&&ih({b:1},ih(ah({},`a`,{enumerable:!0,get:function(){ah(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},n=Symbol(`assign detection`),r=`abcdefghijklmnopqrst`;return e[n]=7,r.split(``).forEach((function(e){t[e]=e})),ih({},e)[n]!==7||$m(ih({},t)).join(``)!==r}))?function(e,t){for(var n=nh(e),r=arguments.length,i=1,a=eh.f,o=th.f;r>i;)for(var s,c=rh(arguments[i++]),l=a?oh($m(c),a(c)):$m(c),u=l.length,d=0;u>d;)s=l[d++],Ym&&!Zm(o,c,s)||(n[s]=c[s]);return n}:ih;L({target:`Object`,stat:!0,arity:2,forced:Object.assign!==sh},{assign:sh});var ch=r(M.Object.assign),lh=mt,uh=qc,dh=zc;L({target:`Object`,stat:!0,forced:s((function(){uh(1)})),sham:!dh},{getPrototypeOf:function(e){return uh(lh(e))}});var fh=M.Object.getPrototypeOf;L({target:`Object`,stat:!0,sham:!D},{create:sa});var ph=M.Object,mh=function(e,t){return ph.create(e,t)},hh=r(mh),gh=M,_h=p;gh.JSON||={stringify:JSON.stringify};var vh=r(function(e,t,n){return _h(gh.JSON.stringify,null,arguments)}),yh=typeof Bun==`function`&&Bun&&typeof Bun.version==`string`,bh=TypeError,xh=function(e,t){if(e<t)throw new bh(`Not enough arguments`);return e},Sh=o,Ch=p,wh=T,Th=yh,Eh=De,Dh=qs,Oh=xh,kh=Sh.Function,Ah=/MSIE .\./.test(Eh)||Th&&function(){var e=Sh.Bun.version.split(`.`);return e.length<3||e[0]===`0`&&(e[1]<3||e[1]===`3`&&e[2]===`0`)}(),jh=function(e,t){var n=t?2:1;return Ah?function(r,i){var a=Oh(arguments.length,1)>n,o=wh(r)?r:kh(r),s=a?Dh(arguments,n):[],c=a?function(){Ch(o,this,s)}:o;return t?e(c,i):e(c)}:e},Mh=L,Nh=o,Ph=jh(Nh.setInterval,!0);Mh({global:!0,bind:!0,forced:Nh.setInterval!==Ph},{setInterval:Ph});var Fh=L,Ih=o,Lh=jh(Ih.setTimeout,!0);Fh({global:!0,bind:!0,forced:Ih.setTimeout!==Lh},{setTimeout:Lh});var H=r(M.setTimeout),Rh={exports:{}};(function(e){function t(e){if(e)return function(e){return Object.assign(e,t.prototype),e._callbacks=new Map,e}(e);this._callbacks=new Map}t.prototype.on=function(e,t){let n=this._callbacks.get(e)??[];return n.push(t),this._callbacks.set(e,n),this},t.prototype.once=function(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.fn=t,this.on(e,n),this},t.prototype.off=function(e,t){if(e===void 0&&t===void 0)return this._callbacks.clear(),this;if(t===void 0)return this._callbacks.delete(e),this;let n=this._callbacks.get(e);if(n){for(let[e,r]of n.entries())if(r===t||r.fn===t){n.splice(e,1);break}n.length===0?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},t.prototype.emit=function(e,...t){let n=this._callbacks.get(e);if(n){let e=[...n];for(let n of e)n.apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks.get(e)??[]},t.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;let t=0;for(let e of this._callbacks.values())t+=e.length;return t},t.prototype.hasListeners=function(e){return this.listenerCount(e)>0},t.prototype.addEventListener=t.prototype.on,t.prototype.removeListener=t.prototype.off,t.prototype.removeEventListener=t.prototype.off,t.prototype.removeAllListeners=t.prototype.off,e.exports=t})(Rh);var zh,Bh=r(Rh.exports);function Vh(){return Vh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vh.apply(this,arguments)}function Hh(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Uh(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}zh=typeof Object.assign==`function`?Object.assign:function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t};var Wh,Gh=zh,Kh=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],qh=typeof document>`u`?{style:{}}:document.createElement(`div`),Jh=Math.round,Yh=Math.abs,Xh=Date.now;function Zh(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<Kh.length;){if((r=(n=Kh[a])?n+i:t)in e)return r;a++}}Wh=typeof window>`u`?{}:window;var Qh=Zh(qh.style,`touchAction`),$h=Qh!==void 0,eg=`compute`,tg=`auto`,ng=`manipulation`,rg=`none`,ig=`pan-x`,ag=`pan-y`,og=function(){if(!$h)return!1;var e={},t=Wh.CSS&&Wh.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach((function(n){return e[n]=!t||Wh.CSS.supports(`touch-action`,n)})),e}(),sg=`ontouchstart`in Wh,cg=Zh(Wh,`PointerEvent`)!==void 0,lg=sg&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),ug=`touch`,dg=`mouse`,fg=25,pg=1,mg=4,hg=8,gg=1,_g=2,vg=4,yg=8,bg=16,xg=_g|vg,Sg=yg|bg,Cg=xg|Sg,wg=[`x`,`y`],Tg=[`clientX`,`clientY`];function Eg(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==void 0)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function Dg(e,t){return typeof e==`function`?e.apply(t&&t[0]||void 0,t):e}function Og(e,t){return e.indexOf(t)>-1}var kg=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===eg&&(e=this.compute()),$h&&this.manager.element.style&&og[e]&&(this.manager.element.style[Qh]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return Eg(this.manager.recognizers,(function(t){Dg(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(Og(e,rg))return rg;var t=Og(e,ig),n=Og(e,ag);return t&&n?rg:t||n?t?ig:ag:Og(e,ng)?ng:tg}(e.join(` `))},t.preventDefaults=function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=Og(r,rg)&&!og[rg],a=Og(r,ag)&&!og[ag],o=Og(r,ig)&&!og[ig];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!o||!a)return i||a&&n&xg||o&&n&Sg?this.preventSrc(t):void 0}},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function Ag(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function jg(e){var t=e.length;if(t===1)return{x:Jh(e[0].clientX),y:Jh(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:Jh(n/t),y:Jh(r/t)}}function Mg(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:Jh(e.pointers[n].clientX),clientY:Jh(e.pointers[n].clientY)},n++;return{timeStamp:Xh(),pointers:t,center:jg(t),deltaX:e.deltaX,deltaY:e.deltaY}}function Ng(e,t,n){n||=wg;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Pg(e,t,n){n||=wg;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}function Fg(e,t){return e===t?gg:Yh(e)>=Yh(t)?e<0?_g:vg:t<0?yg:bg}function Ig(e,t,n){return{x:t/e||0,y:n/e||0}}function Lg(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||=Mg(t),i>1&&!n.firstMultiple?n.firstMultiple=Mg(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=jg(r);t.timeStamp=Xh(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Pg(s,c),t.distance=Ng(s,c),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};t.eventType!==pg&&a.eventType!==mg||(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=Fg(t.deltaX,t.deltaY);var l,u,d=Ig(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=Yh(d.x)>Yh(d.y)?d.x:d.y,t.scale=o?(l=o.pointers,Ng((u=r)[0],u[1],Tg)/Ng(l[0],l[1],Tg)):1,t.rotation=o?function(e,t){return Pg(t[1],t[0],Tg)+Pg(e[1],e[0],Tg)}(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,i,a,o=e.lastInterval||t,s=t.timeStamp-o.timeStamp;if(t.eventType!==hg&&(s>fg||o.velocity===void 0)){var c=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,u=Ig(s,c,l);r=u.x,i=u.y,n=Yh(u.x)>Yh(u.y)?u.x:u.y,a=Fg(c,l),e.lastInterval=t}else n=o.velocity,r=o.velocityX,i=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=a}(n,t);var f,p=e.element,m=t.srcEvent;Ag(f=m.composedPath?m.composedPath()[0]:m.path?m.path[0]:m.target,p)&&(p=f),t.target=p}function Rg(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&pg&&r-i==0,o=t&(mg|hg)&&r-i==0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,Lg(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function zg(e){return e.trim().split(/\s+/g)}function Bg(e,t,n){Eg(zg(t),(function(t){e.addEventListener(t,n,!1)}))}function Vg(e,t,n){Eg(zg(t),(function(t){e.removeEventListener(t,n,!1)}))}function Hg(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}var Ug=function(){function e(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){Dg(e.options.enable,[e])&&n.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&Bg(this.element,this.evEl,this.domHandler),this.evTarget&&Bg(this.target,this.evTarget,this.domHandler),this.evWin&&Bg(Hg(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&Vg(this.element,this.evEl,this.domHandler),this.evTarget&&Vg(this.target,this.evTarget,this.domHandler),this.evWin&&Vg(Hg(this.element),this.evWin,this.domHandler)},e}();function Wg(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}var Gg={pointerdown:pg,pointermove:2,pointerup:mg,pointercancel:hg,pointerout:hg},Kg={2:ug,3:`pen`,4:dg,5:`kinect`},qg=`pointerdown`,Jg=`pointermove pointerup pointercancel`;Wh.MSPointerEvent&&!Wh.PointerEvent&&(qg=`MSPointerDown`,Jg=`MSPointerMove MSPointerUp MSPointerCancel`);var Yg=function(e){function t(){var n,r=t.prototype;return r.evEl=qg,r.evWin=Jg,(n=e.apply(this,arguments)||this).store=n.manager.session.pointerEvents=[],n}return Hh(t,e),t.prototype.handler=function(e){var t=this.store,n=!1,r=Gg[e.type.toLowerCase().replace(`ms`,``)],i=Kg[e.pointerType]||e.pointerType,a=i===ug,o=Wg(t,e.pointerId,`pointerId`);r&pg&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&(mg|hg)&&(n=!0),o<0||(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))},t}(Ug);function Xg(e){return Array.prototype.slice.call(e,0)}function Zg(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];Wg(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}var Qg={touchstart:pg,touchmove:2,touchend:mg,touchcancel:hg},$g=function(e){function t(){var n;return t.prototype.evTarget=`touchstart touchmove touchend touchcancel`,(n=e.apply(this,arguments)||this).targetIds={},n}return Hh(t,e),t.prototype.handler=function(e){var t=Qg[e.type],n=e_.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:ug,srcEvent:e})},t}(Ug);function e_(e,t){var n,r,i=Xg(e.touches),a=this.targetIds;if(t&(2|pg)&&i.length===1)return a[i[0].identifier]=!0,[i,i];var o=Xg(e.changedTouches),s=[],c=this.target;if(r=i.filter((function(e){return Ag(e.target,c)})),t===pg)for(n=0;n<r.length;)a[r[n].identifier]=!0,n++;for(n=0;n<o.length;)a[o[n].identifier]&&s.push(o[n]),t&(mg|hg)&&delete a[o[n].identifier],n++;return s.length?[Zg(r.concat(s),`identifier`,!0),s]:void 0}var t_={mousedown:pg,mousemove:2,mouseup:mg},n_=function(e){function t(){var n,r=t.prototype;return r.evEl=`mousedown`,r.evWin=`mousemove mouseup`,(n=e.apply(this,arguments)||this).pressed=!1,n}return Hh(t,e),t.prototype.handler=function(e){var t=t_[e.type];t&pg&&e.button===0&&(this.pressed=!0),2&t&&e.which!==1&&(t=mg),this.pressed&&(t&mg&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:dg,srcEvent:e}))},t}(Ug),r_=2500;function i_(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY},r=this.lastTouches;this.lastTouches.push(n),setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),r_)}}function a_(e,t){e&pg?(this.primaryTouch=t.changedPointers[0].identifier,i_.call(this,t)):e&(mg|hg)&&i_.call(this,t)}function o_(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=25&&o<=25)return!0}return!1}var s_=function(){return function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).handler=function(e,t,n){var i=n.pointerType===ug,a=n.pointerType===dg;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)a_.call(Uh(Uh(r)),t,n);else if(a&&o_.call(Uh(Uh(r)),n))return;r.callback(e,t,n)}},r.touch=new $g(r.manager,r.handler),r.mouse=new n_(r.manager,r.handler),r.primaryTouch=null,r.lastTouches=[],r}return Hh(t,e),t.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Ug)}();function c_(e,t,n){return!!Array.isArray(e)&&(Eg(e,n[t],n),!0)}var l_=32,u_=1;function d_(e,t){var n=t.manager;return n?n.get(e):e}function f_(e){return 16&e?`cancel`:8&e?`end`:4&e?`move`:2&e?`start`:``}var p_=function(){function e(e){e===void 0&&(e={}),this.options=Vh({enable:!0},e),this.id=u_++,this.manager=null,this.state=1,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return Gh(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(c_(e,`recognizeWith`,this))return this;var t=this.simultaneous;return t[(e=d_(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return c_(e,`dropRecognizeWith`,this)||(e=d_(e,this),delete this.simultaneous[e.id]),this},t.requireFailure=function(e){if(c_(e,`requireFailure`,this))return this;var t=this.requireFail;return Wg(t,e=d_(e,this))===-1&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(c_(e,`dropRequireFailure`,this))return this;e=d_(e,this);var t=Wg(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+f_(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+f_(n))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=l_},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},t.recognize=function(e){var t=Gh({},e);if(!Dg(this.options.enable,[this,t]))return this.reset(),void(this.state=l_);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),m_=function(e){function t(t){var n;return t===void 0&&(t={}),(n=e.call(this,Vh({event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this).pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}Hh(t,e);var n=t.prototype;return n.getTouchAction=function(){return[ng]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime<n.time;if(this.reset(),e.eventType&pg&&this.count===0)return this.failTimeout();if(i&&a&&r){if(e.eventType!==mg)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<n.interval,s=!this.pCenter||Ng(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout((function(){t.state=8,t.tryEmit()}),n.interval),2):8}return l_},n.failTimeout=function(){var e=this;return this._timer=setTimeout((function(){e.state=l_}),this.options.interval),l_},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){this.state===8&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(p_),h_=function(e){function t(t){return t===void 0&&(t={}),e.call(this,Vh({pointers:1},t))||this}Hh(t,e);var n=t.prototype;return n.attrTest=function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},n.process=function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(n&hg||!i)?16|t:r||i?n&mg?8|t:2&t?4|t:2:l_},t}(p_);function g_(e){return e===bg?`down`:e===yg?`up`:e===_g?`left`:e===vg?`right`:``}var __=function(e){function t(t){var n;return t===void 0&&(t={}),(n=e.call(this,Vh({event:`pan`,threshold:10,pointers:1,direction:Cg},t))||this).pX=null,n.pY=null,n}Hh(t,e);var n=t.prototype;return n.getTouchAction=function(){var e=this.options.direction,t=[];return e&xg&&t.push(ag),e&Sg&&t.push(ig),t},n.directionTest=function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&xg?(i=a===0?gg:a<0?_g:vg,n=a!==this.pX,r=Math.abs(e.deltaX)):(i=o===0?gg:o<0?yg:bg,n=o!==this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},n.attrTest=function(e){return h_.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},n.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var n=g_(t.direction);n&&(t.additionalEvent=this.options.event+n),e.prototype.emit.call(this,t)},t}(h_),v_=function(e){function t(t){return t===void 0&&(t={}),e.call(this,Vh({event:`swipe`,threshold:10,velocity:.3,direction:xg|Sg,pointers:1},t))||this}Hh(t,e);var n=t.prototype;return n.getTouchAction=function(){return __.prototype.getTouchAction.call(this)},n.attrTest=function(t){var n,r=this.options.direction;return r&(xg|Sg)?n=t.overallVelocity:r&xg?n=t.overallVelocityX:r&Sg&&(n=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&r&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&Yh(n)>this.options.velocity&&t.eventType&mg},n.emit=function(e){var t=g_(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(h_),y_=function(e){function t(t){return t===void 0&&(t={}),e.call(this,Vh({event:`pinch`,threshold:0,pointers:2},t))||this}Hh(t,e);var n=t.prototype;return n.getTouchAction=function(){return[rg]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},n.emit=function(t){if(t.scale!==1){var n=t.scale<1?`in`:`out`;t.additionalEvent=this.options.event+n}e.prototype.emit.call(this,t)},t}(h_),b_=function(e){function t(t){return t===void 0&&(t={}),e.call(this,Vh({event:`rotate`,threshold:0,pointers:2},t))||this}Hh(t,e);var n=t.prototype;return n.getTouchAction=function(){return[rg]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)},t}(h_),x_=function(e){function t(t){var n;return t===void 0&&(t={}),(n=e.call(this,Vh({event:`press`,pointers:1,time:251,threshold:9},t))||this)._timer=null,n._input=null,n}Hh(t,e);var n=t.prototype;return n.getTouchAction=function(){return[tg]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime>n.time;if(this._input=e,!i||!r||e.eventType&(mg|hg)&&!a)this.reset();else if(e.eventType&pg)this.reset(),this._timer=setTimeout((function(){t.state=8,t.tryEmit()}),n.time);else if(e.eventType&mg)return 8;return l_},n.reset=function(){clearTimeout(this._timer)},n.emit=function(e){this.state===8&&(e&&e.eventType&mg?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=Xh(),this.manager.emit(this.options.event,this._input)))},t}(p_),S_={domEvents:!1,touchAction:eg,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}},C_=[[b_,{enable:!1}],[y_,{enable:!1},[`rotate`]],[v_,{direction:xg}],[__,{direction:xg},[`swipe`]],[m_],[m_,{event:`doubletap`,taps:2},[`tap`]],[x_]];function w_(e,t){var n,r=e.element;r.style&&(Eg(e.options.cssProps,(function(i,a){n=Zh(r.style,a),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||``})),t||(e.oldCssProps={}))}var T_=function(){function e(e,t){var n,r=this;this.options=Gh({},S_,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(cg?Yg:lg?$g:sg?s_:n_))(n,Rg),this.touchAction=new kg(this,this.options.touchAction),w_(this,!0),Eg(this.options.recognizers,(function(e){var t=r.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}var t=e.prototype;return t.set=function(e){return Gh(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?2:1},t.recognize=function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(t.curRecognizer=null,i=null);for(var a=0;a<r.length;)n=r[a],t.stopped===2||i&&n!==i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(t.curRecognizer=n,i=n),a++}},t.get=function(e){if(e instanceof p_)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event===e)return t[n];return null},t.add=function(e){if(c_(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(c_(e,`remove`,this))return this;var t=this.get(e);if(e){var n=this.recognizers,r=Wg(n,t);r!==-1&&(n.splice(r,1),this.touchAction.update())}return this},t.on=function(e,t){if(e===void 0||t===void 0)return this;var n=this.handlers;return Eg(zg(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this},t.off=function(e,t){if(e===void 0)return this;var n=this.handlers;return Eg(zg(e),(function(e){t?n[e]&&n[e].splice(Wg(n[e],t),1):delete n[e]})),this},t.emit=function(e,t){this.options.domEvents&&function(e,t){var n=document.createEvent(`Event`);n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},t.destroy=function(){this.element&&w_(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),E_={touchstart:pg,touchmove:2,touchend:mg,touchcancel:hg},D_=function(e){function t(){var n,r=t.prototype;return r.evTarget=`touchstart`,r.evWin=`touchstart touchmove touchend touchcancel`,(n=e.apply(this,arguments)||this).started=!1,n}return Hh(t,e),t.prototype.handler=function(e){var t=E_[e.type];if(t===pg&&(this.started=!0),this.started){var n=O_.call(this,e,t);t&(mg|hg)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:ug,srcEvent:e})}},t}(Ug);function O_(e,t){var n=Xg(e.touches),r=Xg(e.changedTouches);return t&(mg|hg)&&(n=Zg(n.concat(r),`identifier`,!0)),[n,r]}function k_(e,t,n){var r=`DEPRECATED METHOD: `+t+`
44
+ `+n+` AT
45
+ `;return function(){var t=Error(`get-stack-trace`),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,``).replace(/^\s+at\s+/gm,``).replace(/^Object.<anonymous>\s*\(/gm,`{anonymous}()@`):`Unknown Stack Trace`,i=window.console&&(window.console.warn||window.console.log);return i&&i.call(window.console,r,n),e.apply(this,arguments)}}var A_=k_((function(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;)(!n||n&&e[r[i]]===void 0)&&(e[r[i]]=t[r[i]]),i++;return e}),`extend`,"Use `assign`."),j_=k_((function(e,t){return A_(e,t,!0)}),`merge`,"Use `assign`.");function M_(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&Gh(r,n)}function N_(e,t){return function(){return e.apply(t,arguments)}}var P_=function(){var e=function(e,t){return t===void 0&&(t={}),new T_(e,Vh({recognizers:C_.concat()},t))};return e.VERSION=`2.0.17-rc`,e.DIRECTION_ALL=Cg,e.DIRECTION_DOWN=bg,e.DIRECTION_LEFT=_g,e.DIRECTION_RIGHT=vg,e.DIRECTION_UP=yg,e.DIRECTION_HORIZONTAL=xg,e.DIRECTION_VERTICAL=Sg,e.DIRECTION_NONE=gg,e.DIRECTION_DOWN=bg,e.INPUT_START=pg,e.INPUT_MOVE=2,e.INPUT_END=mg,e.INPUT_CANCEL=hg,e.STATE_POSSIBLE=1,e.STATE_BEGAN=2,e.STATE_CHANGED=4,e.STATE_ENDED=8,e.STATE_RECOGNIZED=8,e.STATE_CANCELLED=16,e.STATE_FAILED=l_,e.Manager=T_,e.Input=Ug,e.TouchAction=kg,e.TouchInput=$g,e.MouseInput=n_,e.PointerEventInput=Yg,e.TouchMouseInput=s_,e.SingleTouchInput=D_,e.Recognizer=p_,e.AttrRecognizer=h_,e.Tap=m_,e.Pan=__,e.Swipe=v_,e.Pinch=y_,e.Rotate=b_,e.Press=x_,e.on=Bg,e.off=Vg,e.each=Eg,e.merge=j_,e.extend=A_,e.bindFn=N_,e.assign=Gh,e.inherit=M_,e.bindFn=N_,e.prefixed=Zh,e.toArray=Xg,e.inArray=Wg,e.uniqueArray=Zg,e.splitStr=zg,e.boolOrFn=Dg,e.hasParent=Ag,e.addEventListeners=Bg,e.removeEventListeners=Vg,e.defaults=Gh({},S_,{preset:C_}),e}();function F_(e,t){var n=Up!==void 0&&$f(e)||e[`@@iterator`];if(!n){if(rm(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return I_(e,t);var r=Yp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Xf(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return I_(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
46
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function I_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var L_=Up(`DELETE`);function R_(){var e=z_.apply(void 0,arguments);return V_(e),e}function z_(){var e=[...arguments];if(e.length<2)return e[0];var t;if(e.length>2)return z_.apply(void 0,Jp(t=[R_(e[0],e[1])]).call(t,Hp(Yp(e).call(e,2))));var n=e[0],r=e[1];if(n instanceof Date&&r instanceof Date)return n.setTime(r.getTime()),n;var i,a=F_(nm(r));try{for(a.s();!(i=a.n()).done;){var o=i.value;Object.prototype.propertyIsEnumerable.call(r,o)&&(r[o]===L_?delete n[o]:n[o]===null||r[o]===null||typeof n[o]!=`object`||typeof r[o]!=`object`||rm(n[o])||rm(r[o])?n[o]=B_(r[o]):n[o]=z_(n[o],r[o]))}}catch(e){a.e(e)}finally{a.f()}return n}function B_(e){return rm(e)?Kd(e).call(e,(function(e){return B_(e)})):typeof e==`object`&&e?e instanceof Date?new Date(e.getTime()):z_({},e):e}function V_(e){for(var t=0,n=om(e);t<n.length;t++){var r=n[t];e[r]===L_?delete e[r]:typeof e[r]==`object`&&e[r]!==null&&V_(e[r])}}var H_=typeof window<`u`?window.Hammer||P_:function(){return function(){var e=function(){};return{on:e,off:e,destroy:e,emit:e,get:()=>({set:e})}}()};function U_(e){var t,n=this;this._cleanupQueue=[],this.active=!1,this._dom={container:e,overlay:document.createElement(`div`)},this._dom.overlay.classList.add(`vis-overlay`),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push((function(){n._dom.overlay.parentNode.removeChild(n._dom.overlay)}));var r=H_(this._dom.overlay);r.on(`tap`,vd(t=this._onTapOverlay).call(t,this)),this._cleanupQueue.push((function(){r.destroy()}));var i=[`tap`,`doubletap`,`press`,`pinch`,`pan`,`panstart`,`panmove`,`panend`];_m(i).call(i,(function(e){r.on(e,(function(e){e.srcEvent.stopPropagation()}))})),document&&document.body&&(this._onClick=function(t){(function(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1})(t.target,e)||n.deactivate()},document.body.addEventListener(`click`,this._onClick),this._cleanupQueue.push((function(){document.body.removeEventListener(`click`,n._onClick)}))),this._escListener=function(e){(`key`in e?e.key===`Escape`:e.keyCode===27)&&n.deactivate()}}Bh(U_.prototype),U_.current=null,U_.prototype.destroy=function(){var e,t;this.deactivate();var n,r=F_(Dm(e=Jm(t=this._cleanupQueue).call(t,0)).call(e));try{for(r.s();!(n=r.n()).done;)(0,n.value)()}catch(e){r.e(e)}finally{r.f()}},U_.prototype.activate=function(){U_.current&&U_.current.deactivate(),U_.current=this,this.active=!0,this._dom.overlay.style.display=`none`,this._dom.container.classList.add(`vis-active`),this.emit(`change`),this.emit(`activate`),document.body.addEventListener(`keydown`,this._escListener)},U_.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display=`block`,this._dom.container.classList.remove(`vis-active`),document.body.removeEventListener(`keydown`,this._escListener),this.emit(`change`),this.emit(`deactivate`)},U_.prototype._onTapOverlay=function(e){this.activate(),e.srcEvent.stopPropagation()};var W_=Hr,G_=Ke,K_=TypeError,q_=function(e){if(W_(e))return e;throw new K_(G_(e)+` is not a constructor`)},J_=L,Y_=p,X_=cd,Z_=q_,Q_=Sn,$_=j,ev=sa,tv=s,nv=P(`Reflect`,`construct`),rv=Object.prototype,iv=[].push,av=tv((function(){function e(){}return!(nv((function(){}),[],e)instanceof e)})),ov=!tv((function(){nv((function(){}))})),sv=av||ov;J_({target:`Reflect`,stat:!0,forced:sv,sham:sv},{construct:function(e,t){Z_(e),Q_(t);var n=arguments.length<3?e:Z_(arguments[2]);if(ov&&!av)return nv(e,t,n);if(e===n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return Y_(iv,r,t),new(Y_(X_,e,r))}var i=n.prototype,a=ev($_(i)?i:rv),o=Y_(e,a,t);return $_(o)?o:a}});var cv=r(M.Reflect.construct),lv=r(M.Object.getOwnPropertySymbols),uv={exports:{}},dv=L,fv=s,pv=xe,mv=E.f,hv=D;dv({target:`Object`,stat:!0,forced:!hv||fv((function(){mv(1)})),sham:!hv},{getOwnPropertyDescriptor:function(e,t){return mv(pv(e),t)}});var gv=M.Object,_v=uv.exports=function(e,t){return gv.getOwnPropertyDescriptor(e,t)};gv.getOwnPropertyDescriptor.sham&&(_v.sham=!0);var vv=r(uv.exports),yv=tm,bv=xe,xv=E,Sv=hr;L({target:`Object`,stat:!0,sham:!D},{getOwnPropertyDescriptors:function(e){for(var t,n,r=bv(e),i=xv.f,a=yv(r),o={},s=0;a.length>s;)(n=i(r,t=a[s++]))!==void 0&&Sv(o,t,n);return o}});var Cv=r(M.Object.getOwnPropertyDescriptors),wv={exports:{}},Tv=L,Ev=D,Dv=gi.f;Tv({target:`Object`,stat:!0,forced:Object.defineProperties!==Dv,sham:!Ev},{defineProperties:Dv});var Ov=M.Object,kv=wv.exports=function(e,t){return Ov.defineProperties(e,t)};Ov.defineProperties.sham&&(kv.sham=!0);var Av=r(wv.exports),jv=r(Qn);function U(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var Mv=mh,Nv=r(Mv);L({target:`Object`,stat:!0},{setPrototypeOf:_l});var Pv=M.Object.setPrototypeOf,Fv=r(Pv),Iv=r(_d);function Lv(e,t){var n;return Lv=Fv?Iv(n=Fv).call(n):function(e,t){return e.__proto__=t,e},Lv(e,t)}function Rv(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Nv(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),er(e,`prototype`,{writable:!1}),t&&Lv(e,t)}function zv(e,t){if(t&&(Ku(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return U(e)}var Bv=fh,Vv=r(Bv);function Hv(e){var t;return Hv=Fv?Iv(t=Vv).call(t):function(e){return e.__proto__||Vv(e)},Hv(e)}var Uv={exports:{}},Wv={exports:{}};(function(e){var t=Tu,n=Wu;function r(i){return e.exports=r=typeof t==`function`&&typeof n==`symbol`?function(e){return typeof e}:function(e){return e&&typeof t==`function`&&e.constructor===t&&e!==t.prototype?`symbol`:typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Wv);var Gv=Wv.exports,Kv=gm,qv=_t,Jv=tm,Yv=E,Xv=_n,Zv=j,Qv=In,$v=Error,ey=v(``.replace),ty=String(new $v(`zxcasd`).stack),ny=/\n\s*at [^:]*:[^\n]*/,ry=ny.test(ty),iy=le,ay=!s((function(){var e=Error(`a`);return!(`stack`in e)||(Object.defineProperty(e,`stack`,iy(1,7)),e.stack!==7)})),oy=In,sy=function(e,t){if(ry&&typeof e==`string`&&!$v.prepareStackTrace)for(;t--;)e=ey(e,ny,``);return e},cy=ay,ly=Error.captureStackTrace,uy=gn,dy=k,fy=Sn,W=Ke,G=bf,py=lr,my=F,hy=Mf,gy=Ef,_y=mf,vy=TypeError,yy=function(e,t){this.stopped=e,this.result=t},by=yy.prototype,xy=function(e,t,n){var r,i,a,o,s,c,l,u=n&&n.that,d=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_RECORD),p=!(!n||!n.IS_ITERATOR),m=!(!n||!n.INTERRUPTED),h=uy(t,u),g=function(e){return r&&_y(r,`normal`,e),new yy(!0,e)},_=function(e){return d?(fy(e),m?h(e[0],e[1],g):h(e[0],e[1])):m?h(e,g):h(e)};if(f)r=e.iterator;else if(p)r=e;else{if(!(i=gy(e)))throw new vy(W(e)+` is not iterable`);if(G(i)){for(a=0,o=py(e);o>a;a++)if((s=_(e[a]))&&my(by,s))return s;return new yy(!1)}r=hy(e,i)}for(c=f?e.next:r.next;!(l=dy(c,r)).done;){try{s=_(l.value)}catch(e){_y(r,`throw`,e)}if(typeof s==`object`&&s&&my(by,s))return s}return new yy(!1)},Sy=hi,Cy=L,wy=F,Ty=qc,Ey=_l,Dy=function(e,t,n){for(var r=Jv(t),i=Xv.f,a=Yv.f,o=0;o<r.length;o++){var s=r[o];qv(e,s)||n&&qv(n,s)||i(e,s,a(t,s))}},Oy=sa,ky=In,Ay=le,jy=function(e,t){Zv(t)&&`cause`in t&&Qv(e,`cause`,t.cause)},My=function(e,t,n,r){cy&&(ly?ly(e,t):oy(e,`stack`,sy(n,r)))},Ny=xy,Py=function(e,t){return e===void 0?arguments.length<2?``:t:Sy(e)},Fy=jt(`toStringTag`),Iy=Error,Ly=[].push,Ry=function(e,t){var n,r=wy(zy,this);Ey?n=Ey(new Iy,r?Ty(this):zy):(n=r?this:Oy(zy),ky(n,Fy,`Error`)),t!==void 0&&ky(n,`message`,Py(t)),My(n,Ry,n.stack,1),arguments.length>2&&jy(n,arguments[2]);var i=[];return Ny(e,Ly,{that:i}),ky(n,`errors`,i),n};Ey?Ey(Ry,Iy):Dy(Ry,Iy,{name:!0});var zy=Ry.prototype=Oy(Iy.prototype,{constructor:Ay(1,Ry),message:Ay(1,``),name:Ay(1,`AggregateError`)});Cy({global:!0,constructor:!0,arity:2},{AggregateError:Ry});var By,Vy,Hy,Uy,Wy=P,Gy=Da,Ky=D,qy=jt(`species`),Jy=function(e){var t=Wy(e);Ky&&t&&!t[qy]&&Gy(t,qy,{configurable:!0,get:function(){return this}})},Yy=F,Xy=TypeError,Zy=function(e,t){if(Yy(t,e))return e;throw new Xy(`Incorrect invocation`)},Qy=Sn,$y=q_,eb=he,tb=jt(`species`),nb=function(e,t){var n,r=Qy(e).constructor;return r===void 0||eb(n=Qy(r)[tb])?t:$y(n)},rb=/(?:ipad|iphone|ipod).*applewebkit/i.test(De),ib=o,ab=p,ob=gn,sb=T,cb=_t,lb=s,ub=Wi,db=qs,fb=Gt,pb=xh,mb=rb,hb=Od,gb=ib.setImmediate,_b=ib.clearImmediate,vb=ib.process,yb=ib.Dispatch,bb=ib.Function,xb=ib.MessageChannel,Sb=ib.String,Cb=0,wb={},Tb=`onreadystatechange`;lb((function(){By=ib.location}));var Eb=function(e){if(cb(wb,e)){var t=wb[e];delete wb[e],t()}},Db=function(e){return function(){Eb(e)}},Ob=function(e){Eb(e.data)},kb=function(e){ib.postMessage(Sb(e),By.protocol+`//`+By.host)};gb&&_b||(gb=function(e){pb(arguments.length,1);var t=sb(e)?e:bb(e),n=db(arguments,1);return wb[++Cb]=function(){ab(t,void 0,n)},Vy(Cb),Cb},_b=function(e){delete wb[e]},hb?Vy=function(e){vb.nextTick(Db(e))}:yb&&yb.now?Vy=function(e){yb.now(Db(e))}:xb&&!mb?(Uy=(Hy=new xb).port2,Hy.port1.onmessage=Ob,Vy=ob(Uy.postMessage,Uy)):ib.addEventListener&&sb(ib.postMessage)&&!ib.importScripts&&By&&By.protocol!==`file:`&&!lb(kb)?(Vy=kb,ib.addEventListener(`message`,Ob,!1)):Vy=Tb in fb(`script`)?function(e){ub.appendChild(fb(`script`))[Tb]=function(){ub.removeChild(this),Eb(e)}}:function(e){setTimeout(Db(e),0)});var Ab={set:gb,clear:_b},jb=function(){this.head=null,this.tail=null};jb.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return(this.head=e.next)===null&&(this.tail=null),e.item}};var Mb,Nb,Pb,Fb,Ib,Lb=jb,Rb=/ipad|iphone|ipod/i.test(De)&&typeof Pebble<`u`,zb=/web0s(?!.*chrome)/i.test(De),Bb=o,Vb=gn,Hb=E.f,Ub=Ab.set,Wb=Lb,Gb=rb,Kb=Rb,qb=zb,Jb=Od,Yb=Bb.MutationObserver||Bb.WebKitMutationObserver,Xb=Bb.document,Zb=Bb.process,Qb=Bb.Promise,$b=Hb(Bb,`queueMicrotask`),ex=$b&&$b.value;if(!ex){var tx=new Wb,nx=function(){var e,t;for(Jb&&(e=Zb.domain)&&e.exit();t=tx.get();)try{t()}catch(e){throw tx.head&&Mb(),e}e&&e.enter()};Gb||Jb||qb||!Yb||!Xb?!Kb&&Qb&&Qb.resolve?((Fb=Qb.resolve(void 0)).constructor=Qb,Ib=Vb(Fb.then,Fb),Mb=function(){Ib(nx)}):Jb?Mb=function(){Zb.nextTick(nx)}:(Ub=Vb(Ub,Bb),Mb=function(){Ub(nx)}):(Nb=!0,Pb=Xb.createTextNode(``),new Yb(nx).observe(Pb,{characterData:!0}),Mb=function(){Pb.data=Nb=!Nb}),ex=function(e){tx.head||Mb(),tx.add(e)}}var rx=ex,ix=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},ax=o.Promise,ox=typeof Deno==`object`&&Deno&&typeof Deno.version==`object`,sx=!ox&&!Od&&typeof window==`object`&&typeof document==`object`,cx=o,lx=ax,ux=T,dx=fn,fx=Or,px=jt,mx=sx,hx=ox,gx=Pe,_x=lx&&lx.prototype,vx=px(`species`),yx=!1,bx=ux(cx.PromiseRejectionEvent),xx={CONSTRUCTOR:dx(`Promise`,(function(){var e=fx(lx),t=e!==String(lx);if(!t&&gx===66||!_x.catch||!_x.finally)return!0;if(!gx||gx<51||!/native code/.test(e)){var n=new lx((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[vx]=r,!(yx=n.then((function(){}))instanceof r))return!0}return!t&&(mx||hx)&&!bx})),REJECTION_EVENT:bx,SUBCLASSING:yx},Sx={},Cx=Xe,wx=TypeError,Tx=function(e){var t,n;this.promise=new e((function(e,r){if(t!==void 0||n!==void 0)throw new wx(`Bad Promise constructor`);t=e,n=r})),this.resolve=Cx(t),this.reject=Cx(n)};Sx.f=function(e){return new Tx(e)};var Ex,Dx,Ox=L,kx=Od,Ax=o,jx=k,Mx=Ta,Nx=Xa,Px=Jy,Fx=Xe,Ix=T,Lx=j,Rx=Zy,zx=nb,Bx=Ab.set,Vx=rx,Hx=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},Ux=ix,Wx=Lb,Gx=po,Kx=ax,qx=xx,Jx=Sx,Yx=`Promise`,Xx=qx.CONSTRUCTOR,Zx=qx.REJECTION_EVENT,Qx=Gx.getterFor(Yx),$x=Gx.set,eS=Kx&&Kx.prototype,tS=Kx,nS=eS,rS=Ax.TypeError,iS=Ax.document,aS=Ax.process,oS=Jx.f,sS=oS,cS=!!(iS&&iS.createEvent&&Ax.dispatchEvent),lS=`unhandledrejection`,uS=function(e){var t;return!(!Lx(e)||!Ix(t=e.then))&&t},dS=function(e,t){var n,r,i,a=t.value,o=t.state===1,s=o?e.ok:e.fail,c=e.resolve,l=e.reject,u=e.domain;try{s?(o||(t.rejection===2&&gS(t),t.rejection=1),!0===s?n=a:(u&&u.enter(),n=s(a),u&&(u.exit(),i=!0)),n===e.promise?l(new rS(`Promise-chain cycle`)):(r=uS(n))?jx(r,n,c,l):c(n)):l(a)}catch(e){u&&!i&&u.exit(),l(e)}},fS=function(e,t){e.notified||(e.notified=!0,Vx((function(){for(var n,r=e.reactions;n=r.get();)dS(n,e);e.notified=!1,t&&!e.rejection&&mS(e)})))},pS=function(e,t,n){var r,i;cS?((r=iS.createEvent(`Event`)).promise=t,r.reason=n,r.initEvent(e,!1,!0),Ax.dispatchEvent(r)):r={promise:t,reason:n},!Zx&&(i=Ax[`on`+e])?i(r):e===lS&&Hx(`Unhandled promise rejection`,n)},mS=function(e){jx(Bx,Ax,(function(){var t,n=e.facade,r=e.value;if(hS(e)&&(t=Ux((function(){kx?aS.emit(`unhandledRejection`,r,n):pS(lS,n,r)})),e.rejection=kx||hS(e)?2:1,t.error))throw t.value}))},hS=function(e){return e.rejection!==1&&!e.parent},gS=function(e){jx(Bx,Ax,(function(){var t=e.facade;kx?aS.emit(`rejectionHandled`,t):pS(`rejectionhandled`,t,e.value)}))},_S=function(e,t,n){return function(r){e(t,r,n)}},vS=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,fS(e,!0))},yS=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new rS(`Promise can't be resolved itself`);var r=uS(t);r?Vx((function(){var n={done:!1};try{jx(r,t,_S(yS,n,e),_S(vS,n,e))}catch(t){vS(n,t,e)}})):(e.value=t,e.state=1,fS(e,!1))}catch(t){vS({done:!1},t,e)}}};Xx&&(nS=(tS=function(e){Rx(this,nS),Fx(e),jx(Ex,this);var t=Qx(this);try{e(_S(yS,t),_S(vS,t))}catch(e){vS(t,e)}}).prototype,(Ex=function(e){$x(this,{type:Yx,done:!1,notified:!1,parent:!1,reactions:new Wx,rejection:!1,state:0,value:void 0})}).prototype=Mx(nS,`then`,(function(e,t){var n=Qx(this),r=oS(zx(this,tS));return n.parent=!0,r.ok=!Ix(e)||e,r.fail=Ix(t)&&t,r.domain=kx?aS.domain:void 0,n.state===0?n.reactions.add(r):Vx((function(){dS(r,n)})),r.promise})),Dx=function(){var e=new Ex,t=Qx(e);this.promise=e,this.resolve=_S(yS,t),this.reject=_S(vS,t)},Jx.f=oS=function(e){return e===tS||e===void 0?new Dx(e):sS(e)}),Ox({global:!0,constructor:!0,wrap:!0,forced:Xx},{Promise:tS}),Nx(tS,Yx,!1,!0),Px(Yx);var bS=ax,xS=xx.CONSTRUCTOR||!Jf((function(e){bS.all(e).then(void 0,(function(){}))})),SS=k,CS=Xe,wS=Sx,TS=ix,ES=xy;L({target:`Promise`,stat:!0,forced:xS},{all:function(e){var t=this,n=wS.f(t),r=n.resolve,i=n.reject,a=TS((function(){var n=CS(t.resolve),a=[],o=0,s=1;ES(e,(function(e){var c=o++,l=!1;s++,SS(n,t,e).then((function(e){l||(l=!0,a[c]=e,--s||r(a))}),i)})),--s||r(a)}));return a.error&&i(a.value),n.promise}});var DS=L,OS=xx.CONSTRUCTOR;ax&&ax.prototype,DS({target:`Promise`,proto:!0,forced:OS,real:!0},{catch:function(e){return this.then(void 0,e)}});var kS=k,AS=Xe,jS=Sx,MS=ix,NS=xy;L({target:`Promise`,stat:!0,forced:xS},{race:function(e){var t=this,n=jS.f(t),r=n.reject,i=MS((function(){var i=AS(t.resolve);NS(e,(function(e){kS(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var PS=k,FS=Sx;L({target:`Promise`,stat:!0,forced:xx.CONSTRUCTOR},{reject:function(e){var t=FS.f(this);return PS(t.reject,void 0,e),t.promise}});var IS=Sn,LS=j,RS=Sx,zS=function(e,t){if(IS(e),LS(t)&&t.constructor===e)return t;var n=RS.f(e);return(0,n.resolve)(t),n.promise},BS=L,VS=ax,HS=xx.CONSTRUCTOR,US=zS,K=P(`Promise`),WS=!HS;BS({target:`Promise`,stat:!0,forced:!0},{resolve:function(e){return US(WS&&this===K?VS:this,e)}});var GS=k,KS=Xe,qS=Sx,q=ix,JS=xy;L({target:`Promise`,stat:!0,forced:xS},{allSettled:function(e){var t=this,n=qS.f(t),r=n.resolve,i=n.reject,a=q((function(){var n=KS(t.resolve),i=[],a=0,o=1;JS(e,(function(e){var s=a++,c=!1;o++,GS(n,t,e).then((function(e){c||(c=!0,i[s]={status:`fulfilled`,value:e},--o||r(i))}),(function(e){c||(c=!0,i[s]={status:`rejected`,reason:e},--o||r(i))}))})),--o||r(i)}));return a.error&&i(a.value),n.promise}});var YS=k,J=Xe,XS=P,ZS=Sx,QS=ix,$S=xy,eC=`No one promise resolved`;L({target:`Promise`,stat:!0,forced:xS},{any:function(e){var t=this,n=XS(`AggregateError`),r=ZS.f(t),i=r.resolve,a=r.reject,o=QS((function(){var r=J(t.resolve),o=[],s=0,c=1,l=!1;$S(e,(function(e){var u=s++,d=!1;c++,YS(r,t,e).then((function(e){d||l||(l=!0,i(e))}),(function(e){d||l||(d=!0,o[u]=e,--c||a(new n(o,eC)))}))})),--c||a(new n(o,eC))}));return o.error&&a(o.value),r.promise}});var tC=L,nC=ax,rC=s,iC=P,aC=T,oC=nb,sC=zS,cC=nC&&nC.prototype;tC({target:`Promise`,proto:!0,real:!0,forced:!!nC&&rC((function(){cC.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=oC(this,iC(`Promise`)),n=aC(e);return this.then(n?function(n){return sC(t,e()).then((function(){return n}))}:e,n?function(n){return sC(t,e()).then((function(){throw n}))}:e)}});var lC=M.Promise,uC=Sx;L({target:`Promise`,stat:!0},{withResolvers:function(){var e=uC.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}});var dC=lC,fC=Sx,pC=ix;L({target:`Promise`,stat:!0,forced:!0},{try:function(e){var t=fC.f(this),n=pC(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}});var mC=dC,hC=Em;(function(e){var t=Gv.default,n=$n,r=Tu,i=Mv,a=Bv,o=Kv,s=hp,c=Pv,l=mC,u=hC,d=Ip;function f(){e.exports=f=function(){return m},e.exports.__esModule=!0,e.exports.default=e.exports;var p,m={},h=Object.prototype,g=h.hasOwnProperty,_=n||function(e,t,n){e[t]=n.value},v=typeof r==`function`?r:{},y=v.iterator||`@@iterator`,b=v.asyncIterator||`@@asyncIterator`,x=v.toStringTag||`@@toStringTag`;function S(e,t,r){return n(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{S({},``)}catch{S=function(e,t,n){return e[t]=n}}function ee(e,t,n,r){var a=i((t&&t.prototype instanceof E?t:E).prototype);return _(a,`_invoke`,{value:se(e,n,new de(r||[]))}),a}function C(e,t,n){try{return{type:`normal`,arg:e.call(t,n)}}catch(e){return{type:`throw`,arg:e}}}m.wrap=ee;var te=`suspendedStart`,ne=`suspendedYield`,re=`executing`,w=`completed`,T={};function E(){}function D(){}function O(){}var ie={};S(ie,y,(function(){return this}));var k=a&&a(a(fe([])));k&&k!==h&&g.call(k,y)&&(ie=k);var A=O.prototype=E.prototype=i(ie);function ae(e){var t;o(t=[`next`,`throw`,`return`]).call(t,(function(t){S(e,t,(function(e){return this._invoke(t,e)}))}))}function oe(e,n){function r(i,a,o,s){var c=C(e[i],e,a);if(c.type!==`throw`){var l=c.arg,u=l.value;return u&&t(u)==`object`&&g.call(u,`__await`)?n.resolve(u.__await).then((function(e){r(`next`,e,o,s)}),(function(e){r(`throw`,e,o,s)})):n.resolve(u).then((function(e){l.value=e,o(l)}),(function(e){return r(`throw`,e,o,s)}))}s(c.arg)}var i;_(this,`_invoke`,{value:function(e,t){function a(){return new n((function(n,i){r(e,t,n,i)}))}return i=i?i.then(a,a):a()}})}function se(e,t,n){var r=te;return function(i,a){if(r===re)throw Error(`Generator is already running`);if(r===w){if(i===`throw`)throw a;return{value:p,done:!0}}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=ce(o,n);if(s){if(s===T)continue;return s}}if(n.method===`next`)n.sent=n._sent=n.arg;else if(n.method===`throw`){if(r===te)throw r=w,n.arg;n.dispatchException(n.arg)}else n.method===`return`&&n.abrupt(`return`,n.arg);r=re;var c=C(e,t,n);if(c.type===`normal`){if(r=n.done?w:ne,c.arg===T)continue;return{value:c.arg,done:n.done}}c.type===`throw`&&(r=w,n.method=`throw`,n.arg=c.arg)}}}function ce(e,t){var n=t.method,r=e.iterator[n];if(r===p)return t.delegate=null,n===`throw`&&e.iterator.return&&(t.method=`return`,t.arg=p,ce(e,t),t.method===`throw`)||n!==`return`&&(t.method=`throw`,t.arg=TypeError(`The iterator does not provide a '`+n+`' method`)),T;var i=C(r,e.iterator,t.arg);if(i.type===`throw`)return t.method=`throw`,t.arg=i.arg,t.delegate=null,T;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,t.method!==`return`&&(t.method=`next`,t.arg=p),t.delegate=null,T):a:(t.method=`throw`,t.arg=TypeError(`iterator result is not an object`),t.delegate=null,T)}function le(e){var t,n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),s(t=this.tryEntries).call(t,n)}function ue(e){var t=e.completion||{};t.type=`normal`,delete t.arg,e.completion=t}function de(e){this.tryEntries=[{tryLoc:`root`}],o(e).call(e,le,this),this.reset(!0)}function fe(e){if(e||e===``){var n=e[y];if(n)return n.call(e);if(typeof e.next==`function`)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(g.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=p,t.done=!0,t};return i.next=i}}throw TypeError(t(e)+` is not iterable`)}return D.prototype=O,_(A,`constructor`,{value:O,configurable:!0}),_(O,`constructor`,{value:D,configurable:!0}),D.displayName=S(O,x,`GeneratorFunction`),m.isGeneratorFunction=function(e){var t=typeof e==`function`&&e.constructor;return!!t&&(t===D||(t.displayName||t.name)===`GeneratorFunction`)},m.mark=function(e){return c?c(e,O):(e.__proto__=O,S(e,x,`GeneratorFunction`)),e.prototype=i(A),e},m.awrap=function(e){return{__await:e}},ae(oe.prototype),S(oe.prototype,b,(function(){return this})),m.AsyncIterator=oe,m.async=function(e,t,n,r,i){i===void 0&&(i=l);var a=new oe(ee(e,t,n,r),i);return m.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},ae(A),S(A,x,`Generator`),S(A,y,(function(){return this})),S(A,`toString`,(function(){return`[object Generator]`})),m.keys=function(e){var t=Object(e),n=[];for(var r in t)s(n).call(n,r);return u(n).call(n),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},m.values=fe,de.prototype={constructor:de,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=p,this.done=!1,this.delegate=null,this.method=`next`,this.arg=p,o(t=this.tryEntries).call(t,ue),!e)for(var n in this)n.charAt(0)===`t`&&g.call(this,n)&&!isNaN(+d(n).call(n,1))&&(this[n]=p)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type===`throw`)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type=`throw`,a.arg=e,t.next=n,r&&(t.method=`next`,t.arg=p),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if(i.tryLoc===`root`)return n(`end`);if(i.tryLoc<=this.prev){var o=g.call(i,`catchLoc`),s=g.call(i,`finallyLoc`);if(o&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw Error(`try statement without catch or finally`);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&g.call(r,`finallyLoc`)&&this.prev<r.finallyLoc){var i=r;break}}i&&(e===`break`||e===`continue`)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method=`next`,this.next=i.finallyLoc,T):this.complete(a)},complete:function(e,t){if(e.type===`throw`)throw e.arg;return e.type===`break`||e.type===`continue`?this.next=e.arg:e.type===`return`?(this.rval=this.arg=e.arg,this.method=`return`,this.next=`end`):e.type===`normal`&&t&&(this.next=t),T},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),ue(n),T}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if(r.type===`throw`){var i=r.arg;ue(n)}return i}}throw Error(`illegal catch attempt`)},delegateYield:function(e,t,n){return this.delegate={iterator:fe(e),resultName:t,nextLoc:n},this.method===`next`&&(this.arg=p),T}},m}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports})(Uv);var gC=(0,Uv.exports)(),_C=gC;try{regeneratorRuntime=gC}catch{typeof globalThis==`object`?globalThis.regeneratorRuntime=gC:Function(`r`,`regeneratorRuntime = r`)(gC)}var vC=r(_C),yC={exports:{}},bC=s((function(){if(typeof ArrayBuffer==`function`){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,`a`,{value:8})}})),xC=s,SC=j,CC=S,wC=bC,TC=Object.isExtensible,EC=xC((function(){TC(1)}))||wC?function(e){return!!SC(e)&&(!wC||CC(e)!==`ArrayBuffer`)&&(!TC||TC(e))}:TC,DC=!s((function(){return Object.isExtensible(Object.preventExtensions({}))})),OC=L,kC=v,AC=Ei,jC=j,MC=_t,NC=_n.f,PC=ca,FC=da,IC=EC,LC=DC,RC=!1,zC=St(`meta`),BC=0,VC=function(e){NC(e,zC,{value:{objectID:`O`+ BC++,weakData:{}}})},HC=yC.exports={enable:function(){HC.enable=function(){},RC=!0;var e=PC.f,t=kC([].splice),n={};n[zC]=1,e(n).length&&(PC.f=function(n){for(var r=e(n),i=0,a=r.length;i<a;i++)if(r[i]===zC){t(r,i,1);break}return r},OC({target:`Object`,stat:!0,forced:!0},{getOwnPropertyNames:FC.f}))},fastKey:function(e,t){if(!jC(e))return typeof e==`symbol`?e:(typeof e==`string`?`S`:`P`)+e;if(!MC(e,zC)){if(!IC(e))return`F`;if(!t)return`E`;VC(e)}return e[zC].objectID},getWeakData:function(e,t){if(!MC(e,zC)){if(!IC(e))return!0;if(!t)return!1;VC(e)}return e[zC].weakData},onFreeze:function(e){return LC&&RC&&IC(e)&&!MC(e,zC)&&VC(e),e}};AC[zC]=!0;var UC=yC.exports,WC=L,GC=o,KC=UC,qC=s,JC=In,YC=xy,XC=Zy,ZC=T,QC=j,$C=he,ew=Xa,tw=_n.f,nw=xo.forEach,rw=D,iw=po.set,aw=po.getterFor,ow=function(e,t,n){var r,i=e.indexOf(`Map`)!==-1,a=e.indexOf(`Weak`)!==-1,o=i?`set`:`add`,s=GC[e],c=s&&s.prototype,l={};if(rw&&ZC(s)&&(a||c.forEach&&!qC((function(){new s().entries().next()})))){var u=(r=t((function(t,n){iw(XC(t,u),{type:e,collection:new s}),$C(n)||YC(n,t[o],{that:t,AS_ENTRIES:i})}))).prototype,d=aw(e);nw([`add`,`clear`,`delete`,`forEach`,`get`,`has`,`set`,`keys`,`values`,`entries`],(function(e){var t=e===`add`||e===`set`;!(e in c)||a&&e===`clear`||JC(u,e,(function(n,r){var i=d(this).collection;if(!t&&a&&!QC(n))return e===`get`&&void 0;var o=i[e](n===0?0:n,r);return t?this:o}))})),a||tw(u,`size`,{configurable:!0,get:function(){return d(this).collection.size}})}else r=n.getConstructor(t,e,i,o),KC.enable();return ew(r,e,!1,!0),l[e]=r,WC({global:!0,forced:!0},l),a||n.setStrong(r,e,i),r},sw=Ta,cw=sa,lw=Da,uw=function(e,t,n){for(var r in t)n&&n.unsafe&&e[r]?e[r]=t[r]:sw(e,r,t[r],n);return e},dw=gn,fw=Zy,pw=he,mw=xy,hw=Pl,gw=Fl,_w=Jy,vw=D,yw=UC.fastKey,bw=po.set,xw=po.getterFor,Sw={getConstructor:function(e,t,n,r){var i=e((function(e,i){fw(e,a),bw(e,{type:t,index:cw(null),first:void 0,last:void 0,size:0}),vw||(e.size=0),pw(i)||mw(i,e[r],{that:e,AS_ENTRIES:n})})),a=i.prototype,o=xw(t),s=function(e,t,n){var r,i,a=o(e),s=c(e,t);return s?s.value=n:(a.last=s={index:i=yw(t,!0),key:t,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||=s,r&&(r.next=s),vw?a.size++:e.size++,i!==`F`&&(a.index[i]=s)),e},c=function(e,t){var n,r=o(e),i=yw(t);if(i!==`F`)return r.index[i];for(n=r.first;n;n=n.next)if(n.key===t)return n};return uw(a,{clear:function(){for(var e=o(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&=n.previous.next=void 0,delete t[n.index],n=n.next;e.first=e.last=void 0,vw?e.size=0:this.size=0},delete:function(e){var t=this,n=o(t),r=c(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first===r&&(n.first=i),n.last===r&&(n.last=a),vw?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=o(this),r=dw(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),uw(a,n?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,e===0?0:e,t)}}:{add:function(e){return s(this,e=e===0?0:e,e)}}),vw&&lw(a,`size`,{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(e,t,n){var r=t+` Iterator`,i=xw(t),a=xw(r);hw(e,t,(function(e,t){bw(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?gw(t===`keys`?n.key:t===`values`?n.value:[n.key,n.value],!1):(e.target=void 0,gw(void 0,!0))}),n?`entries`:`values`,!n,!0),_w(t)}};ow(`Map`,(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Sw);var Cw=r(M.Map),ww=xo.some;L({target:`Array`,proto:!0,forced:!Dd(`some`)},{some:function(e){return ww(this,e,arguments.length>1?arguments[1]:void 0)}});var Tw=fd(`Array`,`some`),Ew=F,Dw=Tw,Ow=Array.prototype,kw=r((function(e){var t=e.some;return e===Ow||Ew(Ow,e)&&t===Ow.some?Dw:t})),Aw=fd(`Array`,`keys`),jw=wr,Mw=_t,Nw=F,Pw=Aw,Fw=Array.prototype,Iw={DOMTokenList:!0,NodeList:!0},Lw=r((function(e){var t=e.keys;return e===Fw||Nw(Fw,e)&&t===Fw.keys||Mw(Iw,jw(e))?Pw:t})),Rw=_a,zw=Math.floor,Bw=function(e,t){var n=e.length,r=zw(n/2);return n<8?Vw(e,t):Hw(e,Bw(Rw(e,0,r),t),Bw(Rw(e,r),t),t)},Vw=function(e,t){for(var n,r,i=e.length,a=1;a<i;){for(r=a,n=e[a];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==a++&&(e[r]=n)}return e},Hw=function(e,t,n,r){for(var i=t.length,a=n.length,o=0,s=0;o<i||s<a;)e[o+s]=o<i&&s<a?r(t[o],n[s])<=0?t[o++]:n[s++]:o<i?t[o++]:n[s++];return e},Uw=Bw,Ww=De.match(/firefox\/(\d+)/i),Gw=!!Ww&&+Ww[1],Kw=/MSIE|Trident/.test(De),qw=De.match(/AppleWebKit\/(\d+)\./),Jw=!!qw&&+qw[1],Yw=L,Xw=v,Zw=Xe,Qw=mt,$w=lr,eT=Am,tT=hi,nT=s,rT=Uw,iT=Dd,aT=Gw,oT=Kw,sT=Pe,cT=Jw,lT=[],uT=Xw(lT.sort),dT=Xw(lT.push),fT=nT((function(){lT.sort(void 0)})),pT=nT((function(){lT.sort(null)})),mT=iT(`sort`),hT=!nT((function(){if(sT)return sT<70;if(!(aT&&aT>3)){if(oT)return!0;if(cT)return cT<603;var e,t,n,r,i=``;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)lT.push({k:t+r,v:n})}for(lT.sort((function(e,t){return t.v-e.v})),r=0;r<lT.length;r++)t=lT[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return i!==`DGBEFHACIJK`}}));Yw({target:`Array`,proto:!0,forced:fT||!pT||!mT||!hT},{sort:function(e){e!==void 0&&Zw(e);var t=Qw(this);if(hT)return e===void 0?uT(t):uT(t,e);var n,r,i=[],a=$w(t);for(r=0;r<a;r++)r in t&&dT(i,t[r]);for(rT(i,function(e){return function(t,n){return n===void 0?-1:t===void 0?1:e===void 0?tT(t)>tT(n)?1:-1:+e(t,n)||0}}(e)),n=$w(i),r=0;r<n;)t[r]=i[r++];for(;r<a;)eT(t,r++);return t}});var gT=fd(`Array`,`sort`),_T=F,vT=gT,yT=Array.prototype,bT=r((function(e){var t=e.sort;return e===yT||_T(yT,e)&&t===yT.sort?vT:t})),xT=fd(`Array`,`values`),ST=wr,CT=_t,wT=F,TT=xT,ET=Array.prototype,DT={DOMTokenList:!0,NodeList:!0},OT=r((function(e){var t=e.values;return e===ET||wT(ET,e)&&t===ET.values||CT(DT,ST(e))?TT:t})),kT=r(Uu),AT=fd(`Array`,`entries`),jT=wr,MT=_t,NT=F,PT=AT,FT=Array.prototype,IT={DOMTokenList:!0,NodeList:!0},LT=r((function(e){var t=e.entries;return e===FT||NT(FT,e)&&t===FT.entries||MT(IT,jT(e))?PT:t}));let RT,zT=new Uint8Array(16);function BT(){if(!RT&&(RT=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!RT))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return RT(zT)}let VT=[];for(let e=0;e<256;++e)VT.push((e+256).toString(16).slice(1));var HT={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function UT(e,t,n){if(HT.randomUUID&&!t&&!e)return HT.randomUUID();let r=(e||={}).random||(e.rng||BT)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n||=0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return VT[e[t+0]]+VT[e[t+1]]+VT[e[t+2]]+VT[e[t+3]]+`-`+VT[e[t+4]]+VT[e[t+5]]+`-`+VT[e[t+6]]+VT[e[t+7]]+`-`+VT[e[t+8]]+VT[e[t+9]]+`-`+VT[e[t+10]]+VT[e[t+11]]+VT[e[t+12]]+VT[e[t+13]]+VT[e[t+14]]+VT[e[t+15]]}(r)}function WT(e){return typeof e==`string`||typeof e==`number`}var GT=function(){function e(n){t(this,e),Zu(this,`_queue`,[]),Zu(this,`_timeout`,null),Zu(this,`_extended`,null),this.delay=null,this.max=1/0,this.setOptions(n)}return Xu(e,[{key:`setOptions`,value:function(e){e&&e.delay!==void 0&&(this.delay=e.delay),e&&e.max!==void 0&&(this.max=e.max),this._flushIfNeeded()}},{key:`destroy`,value:function(){if(this.flush(),this._extended){for(var e=this._extended.object,t=this._extended.methods,n=0;n<t.length;n++){var r=t[n];r.original?e[r.name]=r.original:delete e[r.name]}this._extended=null}}},{key:`replace`,value:function(e,t){var n=this,r=e[t];if(!r)throw Error(`Method `+t+` undefined`);e[t]=function(){var e=[...arguments];n.queue({args:e,fn:r,context:this})}}},{key:`queue`,value:function(e){typeof e==`function`?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}},{key:`_flushIfNeeded`,value:function(){var e=this;this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay==`number`&&(this._timeout=H((function(){e.flush()}),this.delay))}},{key:`flush`,value:function(){var e,t;_m(e=Jm(t=this._queue).call(t,0)).call(e,(function(e){e.fn.apply(e.context||e.fn,e.args||[])}))}}],[{key:`extend`,value:function(t,n){var r=new e(n);if(t.flush!==void 0)throw Error(`Target object already has a property flush`);t.flush=function(){r.flush()};var i=[{name:`flush`,original:void 0}];if(n&&n.replace)for(var a=0;a<n.replace.length;a++){var o=n.replace[a];i.push({name:o,original:t[o]}),r.replace(t,o)}return r._extended={object:t,methods:i},r}}]),e}(),KT=function(){function e(){t(this,e),Zu(this,`_subscribers`,{"*":[],add:[],remove:[],update:[]}),Zu(this,`subscribe`,e.prototype.on),Zu(this,`unsubscribe`,e.prototype.off)}return Xu(e,[{key:`_trigger`,value:function(e,t,n){var r,i;if(e===`*`)throw Error(`Cannot trigger event *`);_m(r=Jp(i=[]).call(i,Hp(this._subscribers[e]),Hp(this._subscribers[`*`]))).call(r,(function(r){r(e,t,n??null)}))}},{key:`on`,value:function(e,t){typeof t==`function`&&this._subscribers[e].push(t)}},{key:`off`,value:function(e,t){var n;this._subscribers[e]=Bd(n=this._subscribers[e]).call(n,(function(e){return e!==t}))}}]),e}();ow(`Set`,(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Sw);var qT=r(M.Set),JT=r(Mf);function YT(e,t){var n=Up!==void 0&&$f(e)||e[`@@iterator`];if(!n){if(rm(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return XT(e,t);var r=Yp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Xf(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return XT(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
47
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function XT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ZT=function(e){function n(e){t(this,n),this._pairs=e}return Xu(n,[{key:e,value:vC.mark((function e(){var t,n,r,i,a;return vC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=YT(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=Vp(n.value,2),i=r[0],a=r[1],e.next=7,[i,a];case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:`entries`,value:vC.mark((function e(){var t,n,r,i,a;return vC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=YT(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=Vp(n.value,2),i=r[0],a=r[1],e.next=7,[i,a];case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:`keys`,value:vC.mark((function e(){var t,n,r,i;return vC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=YT(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=Vp(n.value,1),i=r[0],e.next=7,i;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:`values`,value:vC.mark((function e(){var t,n,r,i;return vC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=YT(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=Vp(n.value,2),i=r[1],e.next=7,i;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:`toIdArray`,value:function(){var e;return Kd(e=Hp(this._pairs)).call(e,(function(e){return e[0]}))}},{key:`toItemArray`,value:function(){var e;return Kd(e=Hp(this._pairs)).call(e,(function(e){return e[1]}))}},{key:`toEntryArray`,value:function(){return Hp(this._pairs)}},{key:`toObjectMap`,value:function(){var e,t=hh(null),n=YT(this._pairs);try{for(n.s();!(e=n.n()).done;){var r=Vp(e.value,2),i=r[0];t[i]=r[1]}}catch(e){n.e(e)}finally{n.f()}return t}},{key:`toMap`,value:function(){return new Cw(this._pairs)}},{key:`toIdSet`,value:function(){return new qT(this.toIdArray())}},{key:`toItemSet`,value:function(){return new qT(this.toItemArray())}},{key:`cache`,value:function(){return new n(Hp(this._pairs))}},{key:`distinct`,value:function(e){var t,n=new qT,r=YT(this._pairs);try{for(r.s();!(t=r.n()).done;){var i=Vp(t.value,2),a=i[0],o=i[1];n.add(e(o,a))}}catch(e){r.e(e)}finally{r.f()}return n}},{key:`filter`,value:function(e){var t=this._pairs;return new n({[kT]:()=>vC.mark((function n(){var r,i,a,o,s;return vC.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=YT(t),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=10;break}if(a=Vp(i.value,2),o=a[0],s=a[1],!e(s,o)){n.next=8;break}return n.next=8,[o,s];case 8:n.next=3;break;case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(1),r.e(n.t0);case 15:return n.prev=15,r.f(),n.finish(15);case 18:case`end`:return n.stop()}}),n,null,[[1,12,15,18]])}))()})}},{key:`forEach`,value:function(e){var t,n=YT(this._pairs);try{for(n.s();!(t=n.n()).done;){var r=Vp(t.value,2),i=r[0];e(r[1],i)}}catch(e){n.e(e)}finally{n.f()}}},{key:`map`,value:function(e){var t=this._pairs;return new n({[kT]:()=>vC.mark((function n(){var r,i,a,o,s;return vC.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=YT(t),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=9;break}return a=Vp(i.value,2),o=a[0],s=a[1],n.next=7,[o,e(s,o)];case 7:n.next=3;break;case 9:n.next=14;break;case 11:n.prev=11,n.t0=n.catch(1),r.e(n.t0);case 14:return n.prev=14,r.f(),n.finish(14);case 17:case`end`:return n.stop()}}),n,null,[[1,11,14,17]])}))()})}},{key:`max`,value:function(e){var t=JT(this._pairs),n=t.next();if(n.done)return null;for(var r=n.value[1],i=e(n.value[1],n.value[0]);!(n=t.next()).done;){var a=Vp(n.value,2),o=a[0],s=a[1],c=e(s,o);c>i&&(i=c,r=s)}return r}},{key:`min`,value:function(e){var t=JT(this._pairs),n=t.next();if(n.done)return null;for(var r=n.value[1],i=e(n.value[1],n.value[0]);!(n=t.next()).done;){var a=Vp(n.value,2),o=a[0],s=a[1],c=e(s,o);c<i&&(i=c,r=s)}return r}},{key:`reduce`,value:function(e,t){var n,r=YT(this._pairs);try{for(r.s();!(n=r.n()).done;){var i=Vp(n.value,2),a=i[0];t=e(t,i[1],a)}}catch(e){r.e(e)}finally{r.f()}return t}},{key:`sort`,value:function(e){var t=this;return new n({[kT]:function(){var n;return JT(bT(n=Hp(t._pairs)).call(n,(function(t,n){var r=Vp(t,2),i=r[0],a=r[1],o=Vp(n,2),s=o[0],c=o[1];return e(a,c,i,s)})))}})}}]),n}(kT);function QT(e,t){var n=om(e);if(lv){var r=lv(e);t&&(r=Bd(r).call(r,(function(t){return vv(e,t).enumerable}))),n.push.apply(n,r)}return n}function $T(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?_m(n=QT(Object(i),!0)).call(n,(function(t){Zu(e,t,i[t])})):Cv?Av(e,Cv(i)):_m(r=QT(Object(i))).call(r,(function(t){jv(e,t,vv(i,t))}))}return e}function eE(e,t){var n=Up!==void 0&&$f(e)||e[`@@iterator`];if(!n){if(rm(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return tE(e,t);var r=Yp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Xf(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tE(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
48
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function tE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nE(e){var t=function(){if(typeof Reflect>`u`||!cv||cv.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(cv(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Hv(e);if(t){var i=Hv(this).constructor;n=cv(r,arguments,i)}else n=r.apply(this,arguments);return zv(this,n)}}var rE=function(e){Rv(r,e);var n=nE(r);function r(e,i){var a;return t(this,r),Zu(U(a=n.call(this)),`_queue`,null),e&&!rm(e)&&(i=e,e=[]),a._options=i||{},a._data=new Cw,a.length=0,a._idProp=a._options.fieldId||`id`,e&&e.length&&a.add(e),a.setOptions(i),a}return Xu(r,[{key:`idProp`,get:function(){return this._idProp}},{key:`setOptions`,value:function(e){e&&e.queue!==void 0&&(!1===e.queue?this._queue&&=(this._queue.destroy(),null):(this._queue||=GT.extend(this,{replace:[`add`,`update`,`remove`]}),e.queue&&typeof e.queue==`object`&&this._queue.setOptions(e.queue)))}},{key:`add`,value:function(e,t){var n,r=this,i=[];if(rm(e)){var a=Kd(e).call(e,(function(e){return e[r._idProp]}));if(kw(a).call(a,(function(e){return r._data.has(e)})))throw Error(`A duplicate id was found in the parameter array.`);for(var o=0,s=e.length;o<s;o++)n=this._addItem(e[o]),i.push(n)}else{if(!e||typeof e!=`object`)throw Error(`Unknown dataType`);n=this._addItem(e),i.push(n)}return i.length&&this._trigger(`add`,{items:i},t),i}},{key:`update`,value:function(e,t){var n=this,r=[],i=[],a=[],o=[],s=this._idProp,c=function(e){var t=e[s];if(t!=null&&n._data.has(t)){var c=e,l=ch({},n._data.get(t)),u=n._updateItem(c);i.push(u),o.push(c),a.push(l)}else{var d=n._addItem(e);r.push(d)}};if(rm(e))for(var l=0,u=e.length;l<u;l++)e[l]&&typeof e[l]==`object`?c(e[l]):console.warn(`Ignoring input item, which is not an object at index `+l);else{if(!e||typeof e!=`object`)throw Error(`Unknown dataType`);c(e)}if(r.length&&this._trigger(`add`,{items:r},t),i.length){var d={items:i,oldData:a,data:o};this._trigger(`update`,d,t)}return Jp(r).call(r,i)}},{key:`updateOnly`,value:function(e,t){var n,r=this;rm(e)||(e=[e]);var i=Kd(n=Kd(e).call(e,(function(e){var t=r._data.get(e[r._idProp]);if(t==null)throw Error(`Updating non-existent items is not allowed.`);return{oldData:t,update:e}}))).call(n,(function(e){var t=e.oldData,n=e.update,i=t[r._idProp],a=function(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return R_.apply(void 0,Jp(t=[{},e]).call(t,r))}(t,n);return r._data.set(i,a),{id:i,oldData:t,updatedData:a}}));if(i.length){var a={items:Kd(i).call(i,(function(e){return e.id})),oldData:Kd(i).call(i,(function(e){return e.oldData})),data:Kd(i).call(i,(function(e){return e.updatedData}))};return this._trigger(`update`,a,t),a.items}return[]}},{key:`get`,value:function(e,t){var n=void 0,r=void 0,i=void 0;WT(e)?(n=e,i=t):rm(e)?(r=e,i=t):i=e;var a=i&&i.returnType===`Object`?`Object`:`Array`,o=i&&Bd(i),s=[],c=void 0,l=void 0,u=void 0;if(n!=null)(c=this._data.get(n))&&o&&!o(c)&&(c=void 0);else if(r!=null)for(var d=0,f=r.length;d<f;d++)(c=this._data.get(r[d]))==null||o&&!o(c)||s.push(c);else for(var p,m=0,h=(l=Hp(Lw(p=this._data).call(p))).length;m<h;m++)u=l[m],(c=this._data.get(u))==null||o&&!o(c)||s.push(c);if(i&&i.order&&n==null&&this._sort(s,i.order),i&&i.fields){var g=i.fields;if(n!=null&&c!=null)c=this._filterFields(c,g);else for(var _=0,v=s.length;_<v;_++)s[_]=this._filterFields(s[_],g)}if(a==`Object`){for(var y={},b=0,x=s.length;b<x;b++){var S=s[b];y[S[this._idProp]]=S}return y}return n==null?s:c??null}},{key:`getIds`,value:function(e){var t=this._data,n=e&&Bd(e),r=e&&e.order,i=Hp(Lw(t).call(t)),a=[];if(n)if(r){for(var o=[],s=0,c=i.length;s<c;s++){var l=i[s],u=this._data.get(l);u!=null&&n(u)&&o.push(u)}this._sort(o,r);for(var d=0,f=o.length;d<f;d++)a.push(o[d][this._idProp])}else for(var p=0,m=i.length;p<m;p++){var h=i[p],g=this._data.get(h);g!=null&&n(g)&&a.push(g[this._idProp])}else if(r){for(var _=[],v=0,y=i.length;v<y;v++){var b=i[v];_.push(t.get(b))}this._sort(_,r);for(var x=0,S=_.length;x<S;x++)a.push(_[x][this._idProp])}else for(var ee=0,C=i.length;ee<C;ee++){var te=i[ee],ne=t.get(te);ne!=null&&a.push(ne[this._idProp])}return a}},{key:`getDataSet`,value:function(){return this}},{key:`forEach`,value:function(e,t){var n=t&&Bd(t),r=this._data,i=Hp(Lw(r).call(r));if(t&&t.order)for(var a=this.get(t),o=0,s=a.length;o<s;o++){var c=a[o];e(c,c[this._idProp])}else for(var l=0,u=i.length;l<u;l++){var d=i[l],f=this._data.get(d);f==null||n&&!n(f)||e(f,d)}}},{key:`map`,value:function(e,t){for(var n=t&&Bd(t),r=[],i=this._data,a=Hp(Lw(i).call(i)),o=0,s=a.length;o<s;o++){var c=a[o],l=this._data.get(c);l==null||n&&!n(l)||r.push(e(l,c))}return t&&t.order&&this._sort(r,t.order),r}},{key:`_filterFields`,value:function(e,t){var n;return e&&Pd(n=rm(t)?t:om(t)).call(n,(function(t,n){return t[n]=e[n],t}),{})}},{key:`_sort`,value:function(e,t){if(typeof t==`string`){var n=t;bT(e).call(e,(function(e,t){var r=e[n],i=t[n];return r>i?1:r<i?-1:0}))}else{if(typeof t!=`function`)throw TypeError(`Order must be a function or a string`);bT(e).call(e,t)}}},{key:`remove`,value:function(e,t){for(var n=[],r=[],i=rm(e)?e:[e],a=0,o=i.length;a<o;a++){var s=this._remove(i[a]);if(s){var c=s[this._idProp];c!=null&&(n.push(c),r.push(s))}}return n.length&&this._trigger(`remove`,{items:n,oldData:r},t),n}},{key:`_remove`,value:function(e){var t;if(WT(e)?t=e:e&&typeof e==`object`&&(t=e[this._idProp]),t!=null&&this._data.has(t)){var n=this._data.get(t)||null;return this._data.delete(t),--this.length,n}return null}},{key:`clear`,value:function(e){for(var t,n=Hp(Lw(t=this._data).call(t)),r=[],i=0,a=n.length;i<a;i++)r.push(this._data.get(n[i]));return this._data.clear(),this.length=0,this._trigger(`remove`,{items:n,oldData:r},e),n}},{key:`max`,value:function(e){var t,n,r=null,i=null,a=eE(OT(t=this._data).call(t));try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o[e];typeof s==`number`&&(i==null||s>i)&&(r=o,i=s)}}catch(e){a.e(e)}finally{a.f()}return r||null}},{key:`min`,value:function(e){var t,n,r=null,i=null,a=eE(OT(t=this._data).call(t));try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o[e];typeof s==`number`&&(i==null||s<i)&&(r=o,i=s)}}catch(e){a.e(e)}finally{a.f()}return r||null}},{key:`distinct`,value:function(e){for(var t=this._data,n=Hp(Lw(t).call(t)),r=[],i=0,a=0,o=n.length;a<o;a++){for(var s=n[a],c=t.get(s)[e],l=!1,u=0;u<i;u++)if(r[u]==c){l=!0;break}l||c===void 0||(r[i]=c,i++)}return r}},{key:`_addItem`,value:function(e){var t=function(e,t){return e[t]??(e[t]=UT()),e}(e,this._idProp),n=t[this._idProp];if(this._data.has(n))throw Error(`Cannot add item: item with id `+n+` already exists`);return this._data.set(n,t),++this.length,n}},{key:`_updateItem`,value:function(e){var t=e[this._idProp];if(t==null)throw Error(`Cannot update item: item has no id (item: `+vh(e)+`)`);var n=this._data.get(t);if(!n)throw Error(`Cannot update item: no item with id `+t+` found`);return this._data.set(t,$T($T({},n),e)),t}},{key:`stream`,value:function(e){if(e){var t=this._data;return new ZT({[kT]:()=>vC.mark((function n(){var r,i,a,o;return vC.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=eE(e),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=11;break}if(a=i.value,(o=t.get(a))==null){n.next=9;break}return n.next=9,[a,o];case 9:n.next=3;break;case 11:n.next=16;break;case 13:n.prev=13,n.t0=n.catch(1),r.e(n.t0);case 16:return n.prev=16,r.f(),n.finish(16);case 19:case`end`:return n.stop()}}),n,null,[[1,13,16,19]])}))()})}var n;return new ZT({[kT]:vd(n=LT(this._data)).call(n,this._data)})}}]),r}(KT);function iE(e,t){var n=Up!==void 0&&$f(e)||e[`@@iterator`];if(!n){if(rm(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return aE(e,t);var r=Yp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Xf(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return aE(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
49
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function aE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oE(e){var t=function(){if(typeof Reflect>`u`||!cv||cv.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(cv(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Hv(e);if(t){var i=Hv(this).constructor;n=cv(r,arguments,i)}else n=r.apply(this,arguments);return zv(this,n)}}var sE=function(e){Rv(r,e);var n=oE(r);function r(e,i){var a,o;return t(this,r),Zu(U(o=n.call(this)),`length`,0),Zu(U(o),`_ids`,new qT),o._options=i||{},o._listener=vd(a=o._onEvent).call(a,U(o)),o.setData(e),o}return Xu(r,[{key:`idProp`,get:function(){return this.getDataSet().idProp}},{key:`setData`,value:function(e){if(this._data){this._data.off&&this._data.off(`*`,this._listener);var t=this._data.getIds({filter:Bd(this._options)}),n=this._data.get(t);this._ids.clear(),this.length=0,this._trigger(`remove`,{items:t,oldData:n})}if(e!=null){this._data=e;for(var r=this._data.getIds({filter:Bd(this._options)}),i=0,a=r.length;i<a;i++){var o=r[i];this._ids.add(o)}this.length=r.length,this._trigger(`add`,{items:r})}else this._data=new rE;this._data.on&&this._data.on(`*`,this._listener)}},{key:`refresh`,value:function(){for(var e=this._data.getIds({filter:Bd(this._options)}),t=Hp(this._ids),n={},r=[],i=[],a=[],o=0,s=e.length;o<s;o++){var c=e[o];n[c]=!0,this._ids.has(c)||(r.push(c),this._ids.add(c))}for(var l=0,u=t.length;l<u;l++){var d=t[l],f=this._data.get(d);f==null?console.error(`If you see this, report it please.`):n[d]||(i.push(d),a.push(f),this._ids.delete(d))}this.length+=r.length-i.length,r.length&&this._trigger(`add`,{items:r}),i.length&&this._trigger(`remove`,{items:i,oldData:a})}},{key:`get`,value:function(e,t){if(this._data==null)return null;var n,r=null;WT(e)||rm(e)?(r=e,n=t):n=e;var i=ch({},this._options,n),a=Bd(this._options),o=n&&Bd(n);return a&&o&&(i.filter=function(e){return a(e)&&o(e)}),r==null?this._data.get(i):this._data.get(r,i)}},{key:`getIds`,value:function(e){if(this._data.length){var t,n=Bd(this._options),r=e==null?null:Bd(e);return t=r?n?function(e){return n(e)&&r(e)}:r:n,this._data.getIds({filter:t,order:e&&e.order})}return[]}},{key:`forEach`,value:function(e,t){if(this._data){var n,r,i=Bd(this._options),a=t&&Bd(t);r=a?i?function(e){return i(e)&&a(e)}:a:i,_m(n=this._data).call(n,e,{filter:r,order:t&&t.order})}}},{key:`map`,value:function(e,t){if(this._data){var n,r,i=Bd(this._options),a=t&&Bd(t);return r=a?i?function(e){return i(e)&&a(e)}:a:i,Kd(n=this._data).call(n,e,{filter:r,order:t&&t.order})}return[]}},{key:`getDataSet`,value:function(){return this._data.getDataSet()}},{key:`stream`,value:function(e){var t;return this._data.stream(e||{[kT]:vd(t=Lw(this._ids)).call(t,this._ids)})}},{key:`dispose`,value:function(){var e;(e=this._data)!=null&&e.off&&this._data.off(`*`,this._listener);var t,n=`This data view has already been disposed of.`,i={get:function(){throw Error(n)},set:function(){throw Error(n)},configurable:!1},a=iE(nm(r.prototype));try{for(a.s();!(t=a.n()).done;){var o=t.value;jv(this,o,i)}}catch(e){a.e(e)}finally{a.f()}}},{key:`_onEvent`,value:function(e,t,n){if(t&&t.items&&this._data){var r=t.items,i=[],a=[],o=[],s=[],c=[],l=[];switch(e){case`add`:for(var u=0,d=r.length;u<d;u++){var f=r[u];this.get(f)&&(this._ids.add(f),i.push(f))}break;case`update`:for(var p=0,m=r.length;p<m;p++){var h=r[p];this.get(h)?this._ids.has(h)?(a.push(h),c.push(t.data[p]),s.push(t.oldData[p])):(this._ids.add(h),i.push(h)):this._ids.has(h)&&(this._ids.delete(h),o.push(h),l.push(t.oldData[p]))}break;case`remove`:for(var g=0,_=r.length;g<_;g++){var v=r[g];this._ids.has(v)&&(this._ids.delete(v),o.push(v),l.push(t.oldData[g]))}}this.length+=i.length-o.length,i.length&&this._trigger(`add`,{items:i},n),a.length&&this._trigger(`update`,{items:a,oldData:s,data:c},n),o.length&&this._trigger(`remove`,{items:o,oldData:l},n)}}}]),r}(KT);function cE(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof t.add==`function`&&typeof t.clear==`function`&&typeof t.distinct==`function`&&typeof _m(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Kd(t)==`function`&&typeof t.max==`function`&&typeof t.min==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.remove==`function`&&typeof t.setOptions==`function`&&typeof t.stream==`function`&&typeof t.update==`function`&&typeof t.updateOnly==`function`}e.DELETE=L_,e.DataSet=rE,e.DataStream=ZT,e.DataView=sE,e.Queue=GT,e.createNewDataPipeFrom=function(e){return new uf(e)},e.isDataSetLike=cE,e.isDataViewLike=function(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof _m(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Kd(t)==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.stream==`function`&&cE(e,t.getDataSet())}}))}));function re(e,t){return e.length<10?[...e,t]:[e[0],...e.slice(e.length-8),t]}function w(e){return e.length<=1?e:e.slice(0,-1)}function T(e){return[e]}function E(e){let t=e[e.length-1];return t.kind===`filter`?`f:${[...t.selectedLabels].sort().join(`,`)}:${t.includeTrashed?1:0}:${t.includeAgentActions?1:0}`:`n:${t.rootElementId}`}function D(e){let t=e[0];if(t.kind!==`filter`)throw Error(`view-stack invariant: root must be filter view`);return t}var O=`admin-sessions`;function ie(){if(typeof window>`u`)return null;if(typeof BroadcastChannel>`u`)return console.warn(`[admin-sessions/broadcast] unsupported — manual refresh only`),null;try{return new BroadcastChannel(O)}catch(e){return console.warn(`[admin-sessions/broadcast] ctor failed: ${e instanceof Error?e.message:String(e)} — manual refresh only`),null}}function k(e){let t=ie();if(t)try{let n={type:`mutated`,reason:e};t.postMessage(n)}catch(e){console.warn(`[admin-sessions/broadcast] postMessage failed: ${e instanceof Error?e.message:String(e)}`)}finally{try{t.close()}catch{}}}function A(e){let t=ie();if(!t)return()=>{};let n=t=>{let n=t.data;!n||n.type!==`mutated`||(console.info(`[admin-sessions/broadcast] received reason=${n.reason}`),e(n))};return t.addEventListener(`message`,n),()=>{try{t.removeEventListener(`message`,n)}catch{}try{t.close()}catch{}}}function ae(e){return e.trashed===!0?`skip-trashed`:`pivot`}function oe(e,t,n,r){let i=[],a=[];for(let o of e){let e=t.get(o.nodeId);if(!e)continue;a.push(o.nodeId);let{colour:s}=n(e.labels),c=e.trashed?`${s}40`:s;i.push({id:o.nodeId,borderWidth:3,color:{background:c,border:r}})}return{updates:i,inWindow:a}}function se(e,t){let n=t.length>0?new Set(t):null,r=new Map,i=new Set,a=[];for(let t of e)n&&!t.labels.some(e=>n.has(e))||r.set(t.nodeId,{id:t.nodeId,labels:t.labels,properties:t.properties});for(let t of e)if(r.has(t.nodeId))for(let e of t.related){if(n&&!e.labels.some(e=>n.has(e)))continue;r.has(e.nodeId)||r.set(e.nodeId,{id:e.nodeId,labels:e.labels,properties:e.properties});let[o,s]=e.direction===`outgoing`?[t.nodeId,e.nodeId]:[e.nodeId,t.nodeId],c=`${o}|${s}|${e.relationship}`;i.has(c)||(i.add(c),a.push({id:c,from:o,to:s,type:e.relationship}))}return{nodes:[...r.values()],edges:a}}var ce=2e3;function le(e){let t=typeof e==`number`?e:Number(e);return!Number.isFinite(t)||t<=0?100:Math.min(Math.max(Math.floor(t),1),ce)}var ue=new Set([`Conversation`,`AdminConversation`,`PublicConversation`]),de=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})/,fe=/^\d{4}-\d{2}-\d{2}T(\d{2}:\d{2}:\d{2})/,pe=/^(\d{4}-\d{2}-\d{2})T/,me=24;function he(e){let t=e.match(de);return t?`${t[1]} ${t[2]}`:null}function ge(e){let t=e.match(fe);return t?t[1]:null}function _e(e){let t=e.match(pe);return t?t[1]:null}function ve(e){let t=e.properties,n=e.labels[0];if(n===`ToolCall`){let e=t.toolName;if(typeof e==`string`&&e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`WorkflowRun`){let e=t.startedAt;if(typeof e==`string`&&e.length>0){let t=he(e);if(t)return t}}else if(n===`WorkflowStep`){let e=t.label;if(typeof e==`string`&&e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`Person`){let e=[typeof t.givenName==`string`?t.givenName:``,typeof t.familyName==`string`?t.familyName:``].filter(e=>e.length>0).join(` `);if(e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`Agent`){let e=typeof t.displayName==`string`?t.displayName:``,n=typeof t.slug==`string`?t.slug:``,r=e.length>0?e:n;if(r.length>0)return r.length>24?r.slice(0,24)+`…`:r}else if(n===`Message`){let e=typeof t.role==`string`?t.role:``,n=e===`user`?`user`:e===`assistant`?`asst`:e===`system`?`sys`:e===`tool`?`tool`:null,r=typeof t.createdAt==`string`?t.createdAt:``;if(n&&r){let e=ge(r);if(e)return`${n} ${e}`}}else if(n===`ConversationArchive`){let e=typeof t.title==`string`?t.title:``;return e.length>0?e.length>24?e.slice(0,24)+`…`:e:n}for(let e of[`name`,`title`,`summary`,`givenName`,`subject`,`text`]){let n=t[e];if(typeof n==`string`&&n.length>0)return n.length>24?n.slice(0,24)+`…`:n}if(n===`Conversation`){let e=typeof t.conversationId==`string`?t.conversationId:null;if(e)return`Conv ${e.slice(0,8)}`}return n??`…`}function ye(e){let t=e.properties,n=e.labels[0];if(n===`ToolCall`){let e=t.toolName;if(typeof e==`string`&&e.length>0)return e}else if(n===`WorkflowRun`){let e=t.startedAt;if(typeof e==`string`&&e.length>0){let t=he(e);if(t)return t}}else if(n===`WorkflowStep`){let e=t.label;if(typeof e==`string`&&e.length>0)return e}else if(n===`Person`){let e=[typeof t.givenName==`string`?t.givenName:``,typeof t.familyName==`string`?t.familyName:``].filter(e=>e.length>0).join(` `);if(e.length>0)return e}else if(n===`Agent`){let e=typeof t.displayName==`string`?t.displayName:``,n=typeof t.slug==`string`?t.slug:``,r=e.length>0?e:n;if(r.length>0)return r}else if(n===`ConversationArchive`){let e=typeof t.title==`string`?t.title:``;return e.length>0?e:n}for(let e of[`name`,`title`,`summary`,`givenName`,`subject`,`text`]){let n=t[e];if(typeof n==`string`&&n.length>0)return n}if(n===`Conversation`){let e=typeof t.conversationId==`string`?t.conversationId:null;if(e)return`Conv ${e.slice(0,8)}`}return n??`…`}function be(e){if(e.length===0)return``;let t=e.split(/\s+/).filter(e=>e.length>0);if(t.length===0)return``;if(t.length===1){let e=t[0];return e.length<=me?e:e.slice(0,me-1)+`…`}let n=``,r=0;for(;r<t.length;){let e=n.length===0?t[r]:`${n} ${t[r]}`;if(e.length<=me)n=e,r++;else break}if(n.length===0)return n=t[0].slice(0,me-1)+`…`,n;if(r>=t.length)return n;let i=``;for(;r<t.length;){let e=i.length===0?t[r]:`${i} ${t[r]}`;if(e.length<=me)i=e,r++;else break}if(r<t.length){let e=t.slice(r).join(` `);i=(i.length===0?e:`${i} ${e}`).slice(0,me-1)+`…`}return`${n}\n${i}`}function xe(e,t){let n=e.labels[0];if(!n||!ue.has(n)||t<.7)return ve(e);let r=be(ye(e));if(t<1.3)return r;let i=e.properties,a=typeof i.createdAt==`string`?i.createdAt:``,o=typeof i.messageCount==`number`?i.messageCount:null;if(a.length===0||o===null)return r;let s=_e(a);return s===null?r:`${r}\n${s} · ${o} msgs`}function Se(e){let t=e.properties,n=typeof t.createdAt==`string`?t.createdAt:``,r=typeof t.updatedAt==`string`?t.updatedAt:``,i=e.labels.join(` · `);return[ye(e),i,`id: ${e.id}`,n?`createdAt: ${n}`:``,r?`updatedAt: ${r}`:``].filter(e=>e.length>0).join(`
50
+ `)}var Ce={solver:`barnesHut`,barnesHut:{gravitationalConstant:-2e3,centralGravity:.4,springLength:170,springConstant:.04},stabilization:{iterations:200}},j=220,M=3;function we(e){let t=new Set(e.nodes.map(e=>e.id)),n=new Set;for(let r of e.edges)t.has(r.from)&&t.has(r.to)&&(n.add(r.from),n.add(r.to));let r=0;for(let t of e.nodes)n.has(t.id)||r++;if(!(e.nodes.length<=5||e.nodes.length>0&&r===e.nodes.length))return{physics:Ce,nodePositions:new Map};let i=new Map,a=(M-1)*j/2,o=(Math.ceil(e.nodes.length/M)-1)*j/2;for(let t=0;t<e.nodes.length;t++){let n=t%M,r=Math.floor(t/M);i.set(e.nodes[t].id,{x:n*j-a,y:r*j-o})}return{physics:!1,nodePositions:i}}var N=e(r(),1),Te=te(),Ee=ne(),P=a();function F(e){return e<.7?`compact`:e<1.3?`wrapped`:`detailed`}var De=150,Oe=`#FBBF24`;function ke(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}var Ae=`maxy-graph-search-limit-v1`,je=250,Me=1200;function Ne(){let[e,t]=(0,N.useState)(null),[n,r]=(0,N.useState)(!1),i=(0,N.useMemo)(()=>{if(typeof window>`u`)return null;let e=new URLSearchParams(window.location.search),t=e.get(`nodeId`);return t?{nodeId:t,nodeLabel:e.get(`label`)}:null},[]);return(0,N.useEffect)(()=>{i&&Be(`deep-link`,{nodeId:i.nodeId.length>16?i.nodeId.slice(0,16)+`…`:i.nodeId,label:i.nodeLabel??``})},[i]),(0,N.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]),n?e?(0,P.jsxs)(`div`,{className:`data-page graph-page`,children:[(0,P.jsxs)(`header`,{className:`data-header`,children:[(0,P.jsxs)(`h1`,{className:`data-title`,children:[(0,P.jsx)(h,{size:18}),` Graph`]}),(0,P.jsx)(Pe,{})]}),(0,P.jsx)(`main`,{className:`graph-main`,children:(0,P.jsx)(Fe,{sessionKey:e,initialFocus:i})})]}):(0,P.jsxs)(`div`,{className:`data-page`,children:[(0,P.jsx)(`header`,{className:`data-header`,children:(0,P.jsxs)(`h1`,{className:`data-title`,children:[(0,P.jsx)(h,{size:18}),` Graph`]})}),(0,P.jsxs)(`div`,{className:`data-empty`,children:[(0,P.jsx)(`p`,{children:`You are not signed in.`}),(0,P.jsxs)(`p`,{children:[`Open the `,(0,P.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,P.jsx)(`div`,{className:`data-page`,children:(0,P.jsxs)(`div`,{className:`data-loading`,children:[(0,P.jsx)(c,{size:18,className:`spin`}),` Loading…`]})})}function Pe(){let[e,t]=(0,N.useState)(!1),n=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(!e)return;let r=e=>{n.current&&(n.current.contains(e.target)||t(!1))},i=e=>{e.key===`Escape`&&t(!1)};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]);let r=(0,N.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]);return(0,P.jsxs)(`div`,{className:`chat-burger-wrap`,ref:n,children:[(0,P.jsx)(`button`,{type:`button`,className:`chat-burger`,onClick:()=>t(e=>!e),"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":e,children:(0,P.jsx)(d,{size:20})}),e&&(0,P.jsxs)(`div`,{className:`chat-menu`,children:[(0,P.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/`},children:[(0,P.jsx)(l,{size:14}),` Chat`]}),(0,P.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/data`},children:[(0,P.jsx)(p,{size:14}),` Data`]}),(0,P.jsx)(`div`,{className:`chat-menu-divider`}),(0,P.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),r()},children:[(0,P.jsx)(g,{size:14}),` Log out`]})]})]})}function Fe({sessionKey:e,initialFocus:t=null,initialLabels:r=null}){let{adminFetch:i,sessionKey:a,sessionRefetchNonce:l,banner:d,reloadToLogin:p}=o({initialSessionKey:e,surface:`graph`}),h=(0,N.useRef)(null),g=(0,N.useRef)(null),x=(0,N.useRef)(null),C=(0,N.useRef)(null),te=(0,N.useRef)(new Map),ne=(0,N.useRef)([]),O=(0,N.useRef)(null),ie=(0,N.useRef)(null),A=(0,N.useRef)(null),ce=(0,N.useRef)(null),de=(0,N.useRef)(null),[fe,pe]=(0,N.useState)([{kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}]);(0,N.useEffect)(()=>{t?.nodeId&&pe(e=>{let n=e[e.length-1];return n.kind===`neighbourhood`&&n.rootElementId===t.nodeId?e:[e[0],{kind:`neighbourhood`,rootElementId:t.nodeId,rootLabel:t.nodeLabel}]})},[t?.nodeId,t?.nodeLabel]);let me=r&&r.length>0?[...r].sort().join(`,`):null;(0,N.useEffect)(()=>{me&&(Et.current=!0,pe([{kind:`filter`,selectedLabels:me.split(`,`),includeTrashed:!1,includeAgentActions:!1}]))},[me]);let[he,ge]=(0,N.useState)(!1),[_e,ye]=(0,N.useState)(null),[be,Ce]=(0,N.useState)(null),[j,M]=(0,N.useState)(0),[Ne,Pe]=(0,N.useState)(null),[Fe,Ve]=(0,N.useState)(!1),[He,Ue]=(0,N.useState)(!1),[We,Ge]=(0,N.useState)(null),[Ke,qe]=(0,N.useState)(``),[Je,Ye]=(0,N.useState)(``),[Xe,Ze]=(0,N.useState)(null),[Qe,$e]=(0,N.useState)(null),[et,tt]=(0,N.useState)(()=>{if(typeof window>`u`)return 100;let e=window.localStorage.getItem(Ae);return e?le(e):100}),[nt,rt]=(0,N.useState)(et),[it,at]=(0,N.useState)(`hybrid`),[ot,st]=(0,N.useState)(0),[ct,lt]=(0,N.useState)(!1),[ut,dt]=(0,N.useState)(0),[ft,pt]=(0,N.useState)(0),[mt,ht]=(0,N.useState)([]),[gt,_t]=(0,N.useState)({labels:[],includeTrashed:!1}),[vt,yt]=(0,N.useState)(!1),[bt,xt]=(0,N.useState)([]),[St,Ct]=(0,N.useState)([]),[wt,Tt]=(0,N.useState)(!1),Et=(0,N.useRef)(!1),Dt=(0,N.useRef)(null),Ot=(0,N.useMemo)(()=>{let e=new Set;for(let t of te.current.values()){let n=m(t.labels);n&&e.add(n)}return[...e].sort()},[j]);(0,N.useEffect)(()=>{let e=!1,t=i(`/api/admin/graph-labels-in-graph`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[]}}),n=i(`/api/admin/graph-default-view`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[],includeTrashed:!1}});return Promise.all([t,n]).then(([t,n])=>{if(!e&&(ht(t.labels),_t(n),!Et.current)){Et.current=!0;let e=new Set(t.labels.map(e=>e.label)),r=n.labels.filter(t=>e.has(t));(r.length>0||n.includeTrashed)&&pe(e=>[{kind:`filter`,selectedLabels:r,includeTrashed:n.includeTrashed,includeAgentActions:!1},...e.slice(1)])}}),()=>{e=!0}},[a,l,i]);let kt=fe[0].kind===`filter`?fe[0].includeAgentActions:!1;(0,N.useEffect)(()=>{if(!Et.current)return;let e=!1;return i(`/api/admin/graph-labels-in-graph?includeAgentActions=${kt?`1`:`0`}`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).then(t=>{e||ht(t.labels)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph-refetch`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}),()=>{e=!0}},[a,l,kt,ft,i]),(0,N.useEffect)(()=>{if(!vt)return;let e=e=>{Dt.current&&(Dt.current.contains(e.target)||yt(!1))},t=e=>{e.key===`Escape`&&yt(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[vt]);let At=(0,N.useCallback)(()=>{if(x.current)try{x.current.clear()}catch{}if(C.current)try{C.current.clear()}catch{}},[]),jt=(0,N.useCallback)((e,t)=>{Ge(null),i(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);Pe(null);try{g.current?.unselectAll()}catch{}pe(e=>[D(e)]),dt(e=>e+1),k(`graph-trash`)}).catch(n=>{let r=n instanceof Error?n.message:String(n);Ge(`Failed to delete: ${r}`),Ue(!0),window.setTimeout(()=>Ue(!1),Me);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete`,elementId:e,label:t,msg:r}),keepalive:!0}).catch(()=>{})}catch{}})},[i]),Mt=fe[fe.length-1],Nt=(0,N.useMemo)(()=>E(fe),[fe]),Pt=(0,N.useRef)(Nt);(0,N.useEffect)(()=>{Pt.current=Nt},[Nt]);let Ft=(0,N.useRef)(fe);(0,N.useEffect)(()=>{Ft.current=fe},[fe]),(0,N.useEffect)(()=>{if(Mt.kind===`filter`&&Mt.selectedLabels.length===0){O.current?.abort(),O.current=null,ge(!1),ye(null),Ce(null),M(0),te.current=new Map,At();return}if(Mt.kind===`filter`&&Je)return;let e=window.setTimeout(()=>{O.current?.abort();let e=new AbortController;O.current=e,ge(!0),ye(null),Ce(null),i(Le(Mt,{includeAgentActions:D(fe).includeAgentActions,search:null,channel:bt,messageSublabel:St}),{signal:e.signal}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(e.status===413)throw new Re(t);if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{e.signal.aborted||(te.current=new Map(t.nodes.map(e=>[e.id,e])),M(t.nodes.length),It(t.nodes,t.edges))}).catch(t=>{if(!e.signal.aborted){if(t instanceof Re){Ce(t.body),M(0),te.current=new Map,At();return}ye(t instanceof Error?t.message:String(t))}}).finally(()=>{e.signal.aborted||ge(!1)})},je);return()=>{window.clearTimeout(e)}},[a,Nt,ut,l,Je,nt,bt,St]),(0,N.useEffect)(()=>()=>{O.current?.abort(),g.current?.destroy(),g.current=null,de.current!==null&&(clearTimeout(de.current),de.current=null)},[]);let It=(0,N.useCallback)((e,t)=>{if(!h.current)return;ne.current=t;let n=new Set([`Message`,`UserMessage`,`AssistantMessage`]),r=e=>e.labels.some(e=>n.has(e)),i=new Map,a=e.filter(r);if(a.length>0){let e=new Set(a.map(e=>e.id)),n=new Map,r=new Set;for(let i of t)i.type===`NEXT`&&e.has(i.from)&&e.has(i.to)&&(n.set(i.from,i.to),r.add(i.to));let o=[],s=new Set;for(let e of a){if(r.has(e.id))continue;let t=e.id;for(;t&&!s.has(t);)s.add(t),o.push(t),t=n.get(t)}for(let e of a)s.has(e.id)||(o.push(e.id),s.add(e.id));let c=h.current?.clientWidth??1200,l=Math.max(c-160,300),u=Math.max(Math.floor(l/150),2);o.forEach((e,t)=>{let n=t%u,r=Math.floor(t/u);i.set(e,{x:n*150,y:r*90})})}let o=e.map(e=>{let t=e.labels[0]??`Unknown`,n=u(e.labels);n.displayLabel;let r=n.colour;n.driftCandidates;let a=i.get(e.id),o=a?{x:a.x,y:a.y,physics:!1}:{};return e.trashed?{id:e.id,label:ve(e),title:Se(e),color:{background:`${r}40`,border:r},borderWidth:2,shapeProperties:{borderDashes:[6,4]},group:t,...o}:{id:e.id,label:ve(e),title:Se(e),color:r,group:t,...o}}),s=new Set(o.map(e=>e.id)),c=t.filter(e=>e.type!==`PART_OF`||s.has(e.from)&&s.has(e.to)).map(e=>({id:e.id,from:e.from,to:e.to,label:e.type})),l=we({nodes:e,edges:t});x.current=new Ee.DataSet(l.nodePositions.size>0?o.map(e=>{if(e.x!==void 0||e.y!==void 0)return e;let t=l.nodePositions.get(e.id);return t?{...e,x:t.x,y:t.y,physics:!1}:e}):o),C.current=new Ee.DataSet(c);let d={autoResize:!0,layout:{improvedLayout:!1,randomSeed:ke(Pt.current)},physics:l.physics===!1?!1:{solver:l.physics.solver,barnesHut:l.physics.barnesHut,stabilization:l.physics.stabilization},nodes:{shape:`dot`,size:18,font:{color:`#1F2937`,size:12,face:`DM Sans, sans-serif`},scaling:{label:{enabled:!0,min:12,max:30,drawThreshold:0}},borderWidth:0,chosen:{node:e=>{e.size=20,e.borderWidth=3},label:e=>{e.size=14}}},edges:{arrows:{to:{enabled:!0,scaleFactor:.4}},color:{color:`#CBD5E1`,highlight:`#475569`},font:{color:`#64748B`,size:9,face:`DM Sans, sans-serif`,align:`middle`,strokeWidth:0},smooth:{enabled:!0,type:`continuous`,roundness:.4},width:1,chosen:{edge:!0,label:!1}},interaction:{hover:!0,tooltipDelay:150}};try{g.current?.destroy(),de.current!==null&&(clearTimeout(de.current),de.current=null),ce.current=null;let e=new Te.Network(h.current,{nodes:x.current,edges:C.current},d);g.current=e,e.on(`zoom`,()=>{de.current!==null&&clearTimeout(de.current),de.current=setTimeout(()=>{de.current=null;let e=g.current,t=x.current;if(!e||!t)return;let n;try{n=e.getScale()}catch{return}let r=F(n);if(r===ce.current)return;ce.current=r;let i=[];for(let e of te.current.values()){let t=e.labels[0];if(!t||!ue.has(t))continue;let{colour:r}=u(e.labels),a=e.trashed?{background:`${r}40`,border:r}:r;i.push({id:e.id,label:xe(e,n),color:a})}i.length>0&&t.update(i),console.error(`[graph-page] zoom-tier scale=${n.toFixed(3)} tier=${r} conversations=${i.length}`)},De)}),e.on(`click`,e=>{let t=e.nodes[0];if(!t)return;let n=te.current.get(t);if(!n)return;if(ae(n)===`skip-trashed`){Pe(n);return}let r=Ft.current[Ft.current.length-1];if(r.kind===`neighbourhood`&&r.rootElementId===t){Pe(e=>e?.id===t?null:n);return}Pe(null);let i={kind:`neighbourhood`,rootElementId:t,rootLabel:n.labels[0]??null};pe(e=>{let n=re(e,i),r=n.length-1;return n.length>e.length&&Be(`nav-push`,{depth:r,kind:i.kind,rootElementId:t}),n.length===10&&e.length===10&&Be(`view-stack-cap-hit`,{depth:10,rootElementId:t}),n})}),e.on(`deselectNode`,()=>{Pe(null)});let t=e=>{let t=h.current,n=ie.current;if(!t||!n)return!1;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=r.left+e.x,o=r.top+e.y;return a>=i.left&&a<=i.right&&o>=i.top&&o<=i.bottom},n=h.current?.parentElement??null;e.on(`dragStart`,e=>{let t=e.nodes[0];if(!t){A.current=null;return}A.current=t,n?.classList.add(`graph-dragging`)}),e.on(`dragging`,e=>{if(!A.current)return;let n=t(e.pointer.DOM);Ve(e=>e===n?e:n)}),e.on(`dragEnd`,e=>{let r=A.current;A.current=null,Ve(!1),n?.classList.remove(`graph-dragging`),r&&t(e.pointer.DOM)&&jt(r,te.current.get(r)?.labels[0]??`Unknown`)})}catch(e){let t=e instanceof Error?e.message:String(e);ye(`Visualisation failed to load: ${t}`);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-render`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}},[]);(0,N.useEffect)(()=>{let e=Ke.trim();if(!e){Ye(``),Ze(null),$e(null),at(`hybrid`),st(0),lt(!1),g.current?.unselectAll();return}lt(!1);let t=setTimeout(()=>Ye(e),300);return()=>clearTimeout(t)},[Ke]),(0,N.useEffect)(()=>{let e=setTimeout(()=>{let e=le(et);rt(e);try{window.localStorage.setItem(Ae,String(e))}catch{}},200);return()=>clearTimeout(e)},[et]);let Lt=(0,N.useCallback)(e=>{let t=g.current,n=x.current;if(!t||!n)return;let{updates:r,inWindow:i}=oe(e,te.current,u,Oe);r.length>0&&(n.update(r),t.fit({nodes:i,animation:{duration:400,easingFunction:`easeInOutQuad`}}))},[]),Rt=D(fe);(0,N.useEffect)(()=>{if(!Je||Mt.kind!==`filter`)return;let e=!1;$e(null);let t=encodeURIComponent(Rt.selectedLabels.join(`,`));return i(`/api/admin/graph-search?q=${encodeURIComponent(Je)}&labels=${t}&limit=${nt}${ct?`&threshold=0`:``}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{if(e)return;Ze(t.results);let n=t.mode===`bm25`?`bm25`:`hybrid`;if(at(n),st(typeof t.suppressed==`number`?t.suppressed:0),n===`bm25`)try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-page`,msg:`[graph-page] search-result-degraded mode=bm25 query="${Je}"`}),keepalive:!0}).catch(()=>{})}catch{}let{nodes:r,edges:i}=se(t.results,Rt.selectedLabels);te.current=new Map(r.map(e=>[e.id,e])),M(r.length),Ce(null),It(r,i),Lt(t.results)}).catch(t=>{e||$e(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[Je,nt,a,l,i,Lt,Mt.kind,Rt.selectedLabels,It,ct]);let zt=(0,N.useCallback)(e=>{pe(t=>{let n=D(t),r=new Set(n.selectedLabels);return r.has(e)?r.delete(e):r.add(e),T({kind:`filter`,selectedLabels:[...r].sort(),includeTrashed:n.includeTrashed,includeAgentActions:n.includeAgentActions})})},[]),Bt=(0,N.useCallback)(()=>{pe(e=>{let t=D(e);return T({...t,includeTrashed:!t.includeTrashed})})},[]),Vt=(0,N.useCallback)(()=>{pe(e=>{let t=D(e);return T({...t,includeAgentActions:!t.includeAgentActions})})},[]),Ht=(0,N.useCallback)(()=>{qe(``),Ye(``),Ze(null),$e(null),at(`hybrid`),st(0),lt(!1);try{g.current?.unselectAll()}catch{}},[]),Ut=(0,N.useCallback)(()=>{pe(()=>T({kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}))},[]),Wt=(0,N.useCallback)(()=>{Pe(null);try{g.current?.unselectAll()}catch{}pe(e=>{let t=w(e);return t!==e&&Be(`nav-pop`,{depth:t.length-1}),t})},[]),Gt=(0,N.useCallback)(()=>{let e=D(fe),t={labels:[...e.selectedLabels].sort(),includeTrashed:e.includeTrashed};Tt(!0),i(`/api/admin/graph-default-view`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}).then(async e=>{if(!e.ok){let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));throw Error(t.error??`HTTP ${e.status}`)}_t(t)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view-save`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}).finally(()=>Tt(!1))},[i,fe]),Kt=(0,N.useCallback)(()=>{Pe(null);try{g.current?.unselectAll()}catch{}dt(e=>e+1),k(`graph-restore`)},[]),qt=(0,N.useCallback)(()=>{Pe(null);try{g.current?.unselectAll()}catch{}pe(e=>[D(e)]),dt(e=>e+1),k(`graph-trash`)},[]),Jt=(0,N.useCallback)(()=>{dt(e=>e+1),pt(e=>e+1)},[]),Yt=Mt.kind===`neighbourhood`,Xt=D(fe),Zt=Xt.selectedLabels,Qt=Xt.includeTrashed,$t=Xt.includeAgentActions,en=bt.join(`,`),tn=St.join(`,`),nn=Zt.includes(`AdminConversation`)||Zt.includes(`PublicConversation`);(0,N.useEffect)(()=>{nn&&console.info(`[graph-filter] subfacet-render channel=[${en}] sublabel=[${tn}]`)},[en,tn,nn]);let rn=(0,N.useMemo)(()=>{if(Qt!==gt.includeTrashed||Zt.length!==gt.labels.length)return!0;for(let e=0;e<Zt.length;e++)if(Zt[e]!==gt.labels[e])return!0;return!1},[Qt,Zt,gt]);return(0,P.jsxs)(P.Fragment,{children:[d&&(0,P.jsx)(`button`,{type:`button`,className:`graph-session-banner`,onClick:p,"data-reason":d.reason,children:d.message}),(0,P.jsxs)(`div`,{className:`graph-toolbar`,children:[(0,P.jsxs)(`div`,{className:`data-search-input graph-search-input`,children:[(0,P.jsx)(s,{size:14}),(0,P.jsx)(`input`,{type:`text`,placeholder:`Search nodes…`,value:Ke,onChange:e=>qe(e.target.value),autoComplete:`off`,spellCheck:!1}),Je&&!Xe&&!Qe&&(0,P.jsx)(c,{size:14,className:`spin`}),Ke.length>0&&(0,P.jsx)(`button`,{type:`button`,className:`graph-search-clear`,onClick:Ht,"aria-label":`Clear search`,title:`Clear search`,children:(0,P.jsx)(ee,{size:14})})]}),Je&&!Yt&&(0,P.jsxs)(`div`,{className:`graph-search-limit`,title:`Show top ${et} matches (1-2000)`,children:[(0,P.jsxs)(`label`,{htmlFor:`graph-search-limit-slider`,className:`graph-search-limit-label`,children:[`Top `,et]}),(0,P.jsx)(`input`,{id:`graph-search-limit-slider`,type:`range`,min:1,max:2e3,step:1,value:et,onChange:e=>tt(le(e.target.value)),"aria-label":`Maximum search results to render`})]}),(0,P.jsx)(`button`,{type:`button`,className:`graph-refresh-button`,onClick:Jt,disabled:he,"aria-label":`Refresh graph`,title:`Refresh graph`,children:(0,P.jsx)(b,{size:14,className:he?`spin`:void 0})}),!Yt&&(0,P.jsxs)(`div`,{className:`graph-filter-wrap`,ref:Dt,children:[(0,P.jsxs)(`button`,{type:`button`,className:`graph-filter-toggle${vt?` is-open`:``}${Zt.length>0||Qt||$t?` has-selection`:``}`,onClick:()=>yt(e=>!e),"aria-haspopup":`true`,"aria-expanded":vt,"aria-label":`Filter node types`,children:[(0,P.jsx)(S,{size:14}),(0,P.jsx)(`span`,{children:`Filter`}),Zt.length>0&&(0,P.jsx)(`span`,{className:`graph-filter-count`,children:Zt.length})]}),vt&&(0,P.jsxs)(`div`,{className:`graph-filter-popover`,role:`dialog`,"aria-label":`Node type filter`,children:[(0,P.jsxs)(`div`,{className:`graph-filter-popover-header`,children:[(0,P.jsxs)(`button`,{type:`button`,className:`graph-toggle-trashed${Qt?` active`:``}`,onClick:Bt,"aria-pressed":Qt,title:`Show trashed nodes — restored with Restore button on each node`,children:[(0,P.jsx)(y,{size:14}),` Show trashed`]}),(Zt.length>0||Qt||$t)&&(0,P.jsx)(`button`,{type:`button`,className:`graph-filter-clear`,onClick:Ut,"aria-label":`Clear filter selection`,title:`Clear filter selection`,children:(0,P.jsx)(ee,{size:14})})]}),(0,P.jsx)(`div`,{className:`graph-toggle-agent-actions`,title:`Hide ToolCall, StepResult, WorkflowStep, WorkflowRun — agent-execution telemetry. Flip on for audit/debug.`,children:(0,P.jsx)(_,{checked:$t,onChange:Vt,label:`Include agent actions`})}),mt.length===0&&(0,P.jsx)(`p`,{className:`graph-filter-popover-empty`,children:`No node types in your graph yet.`}),(0,P.jsx)(`div`,{className:`graph-filter-rows`,role:`group`,"aria-label":`Node type filter`,children:mt.map(({label:e,nodeCount:t})=>{let n=Zt.includes(e),r=f(e);return(0,P.jsxs)(`button`,{type:`button`,className:`graph-filter-row${n?` active`:``}`,onClick:()=>zt(e),"aria-pressed":n,children:[(0,P.jsx)(`span`,{className:`graph-filter-row-swatch`,style:{backgroundColor:r}}),(0,P.jsx)(`span`,{className:`graph-filter-row-label`,children:e}),(0,P.jsx)(`span`,{className:`graph-filter-row-count`,children:t})]},e)})}),(Zt.includes(`AdminConversation`)||Zt.includes(`PublicConversation`))&&(0,P.jsxs)(`div`,{className:`graph-filter-subfacets`,children:[(0,P.jsxs)(`div`,{className:`graph-filter-subfacet-group`,role:`group`,"aria-label":`Conversation channel`,children:[(0,P.jsx)(`span`,{className:`graph-filter-subfacet-label`,children:`Channel`}),[`webchat`,`whatsapp`].map(e=>{let t=bt.includes(e);return(0,P.jsx)(`button`,{type:`button`,className:`graph-filter-subfacet-chip${t?` active`:``}`,onClick:()=>{xt(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},"aria-pressed":t,children:e===`webchat`?`Web`:`WhatsApp`},e)})]}),(0,P.jsxs)(`div`,{className:`graph-filter-subfacet-group`,role:`group`,"aria-label":`Message sublabel`,children:[(0,P.jsx)(`span`,{className:`graph-filter-subfacet-label`,children:`Message`}),[`UserMessage`,`AssistantMessage`,`WhatsAppMessage`].map(e=>{let t=St.includes(e);return(0,P.jsx)(`button`,{type:`button`,className:`graph-filter-subfacet-chip${t?` active`:``}`,onClick:()=>{Ct(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},"aria-pressed":t,children:e===`UserMessage`?`User`:e===`AssistantMessage`?`Assistant`:`WhatsApp`},e)})]})]}),(0,P.jsx)(`div`,{className:`graph-filter-popover-footer`,children:(0,P.jsx)(`button`,{type:`button`,className:`graph-filter-set-default`,onClick:Gt,disabled:!rn||wt,children:wt?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(c,{size:12,className:`spin`}),` Saving…`]}):`Set default view`})})]})]}),(0,P.jsxs)(`div`,{className:`graph-meta`,children:[fe.length>1&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-desktop`,onClick:Wt,children:`← Back`}),(0,P.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-mobile`,onClick:Wt,"aria-label":`Back`,children:(0,P.jsx)(v,{size:16})})]}),j>0&&(0,P.jsxs)(`span`,{className:`graph-meta-count`,children:[j,` node`,j===1?``:`s`]})]})]}),fe.length>1&&(0,P.jsx)(ze,{viewStack:fe}),Je&&it===`bm25`&&!Qe&&(0,P.jsx)(`div`,{className:`graph-error-banner graph-search-degraded`,role:`status`,children:`Vector ranking unavailable — showing keyword-only results.`}),Qe&&(0,P.jsxs)(`div`,{className:`data-error graph-error-banner`,children:[`Search unavailable: `,Qe]}),Je&&ot>0&&!ct&&!Qe&&(0,P.jsxs)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>lt(!0),children:[ot,` low-confidence match`,ot===1?``:`es`,` hidden — show all`]}),Je&&ct&&!Qe&&(0,P.jsx)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>lt(!1),children:`Showing all matches — hide low-confidence`}),Xe&&Xe.length===0&&!Qe&&(0,P.jsx)(`div`,{className:`graph-search-status`,children:`No matches in your graph.`}),(0,P.jsxs)(`div`,{className:`graph-canvas-wrap`,children:[he&&(0,P.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,P.jsx)(c,{size:20,className:`spin`}),` Loading your graph…`]}),_e&&!he&&(0,P.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,P.jsx)(`p`,{children:_e}),(0,P.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:()=>{ye(null),dt(e=>e+1)},children:`Retry`})]}),be&&!he&&(0,P.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,P.jsxs)(`p`,{children:[`Refine your filter — `,(0,P.jsx)(`strong`,{children:be.matched}),` matches exceed the 2000 cap.`]}),(0,P.jsx)(`p`,{className:`graph-canvas-hint`,children:`Pick a more specific label combination, or narrow your brand's data.`})]}),!he&&!_e&&!be&&j===0&&!Yt&&Zt.length===0&&(0,P.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,P.jsx)(S,{size:20}),(0,P.jsx)(`p`,{children:`Open Filter to pick a node type and see what's in your graph.`})]}),!he&&!_e&&!be&&j===0&&!Yt&&Zt.length>0&&(0,P.jsx)(`div`,{className:`graph-canvas-overlay`,children:(0,P.jsxs)(`p`,{children:[`No `,Zt.join(`, `),` nodes in your graph yet.`]})}),(0,P.jsx)(`div`,{ref:h,className:`graph-canvas`}),j>0&&(0,P.jsx)(`div`,{ref:ie,className:`graph-trash-drop-zone${Fe?` is-hover`:``}${He?` is-error`:``}`,"aria-hidden":`true`,children:(0,P.jsx)(n,{size:18})}),We&&(0,P.jsxs)(`div`,{className:`graph-drag-error-banner`,role:`alert`,children:[(0,P.jsx)(`span`,{children:We}),(0,P.jsx)(`button`,{type:`button`,className:`graph-drag-error-dismiss`,onClick:()=>Ge(null),"aria-label":`Dismiss`,children:(0,P.jsx)(ee,{size:14})})]})]}),Ne&&(0,P.jsx)(Ie,{node:Ne,edges:ne.current,nodesById:te.current,adminFetch:i,onClose:()=>{Pe(null);try{g.current?.unselectAll()}catch{}},onRestored:Kt,onTrashed:qt}),j>0&&Ot.length>0&&(0,P.jsx)(`div`,{className:`graph-legend`,children:Ot.map(e=>(0,P.jsxs)(`div`,{className:`graph-legend-item`,children:[(0,P.jsx)(`span`,{className:`graph-legend-swatch`,style:{backgroundColor:f(e)}}),(0,P.jsx)(`span`,{children:e})]},e))})]})}function Ie({node:e,edges:t,nodesById:r,adminFetch:i,onClose:a,onRestored:o,onTrashed:s}){let l=Object.entries(e.properties).filter(([,e])=>e!=null),u=t.filter(t=>t.from===e.id||t.to===e.id),[d,f]=(0,N.useState)(!1),[p,m]=(0,N.useState)(null),[h,g]=(0,N.useState)(!1),[_,v]=(0,N.useState)(null);(0,N.useEffect)(()=>{f(!1),m(null),g(!1),v(null)},[e.id]);let y=(0,N.useCallback)(()=>{f(!0),m(null),i(`/api/admin/graph-restore`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);o()}).catch(e=>{m(e instanceof Error?e.message:String(e)),f(!1)})},[e.id,o,i]),b=(0,N.useCallback)(()=>{g(!0),v(null),i(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id,by:`graph-side-panel-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);s()}).catch(e=>{v(e instanceof Error?e.message:String(e)),g(!1)})},[e.id,s,i]);return(0,P.jsxs)(`aside`,{className:`graph-side-panel${e.trashed?` graph-side-panel-trashed`:``}`,children:[(0,P.jsxs)(`header`,{className:`graph-side-header`,children:[(0,P.jsx)(`div`,{children:(()=>{if(e.labels.some(e=>ue.has(e))){let t=ye(e),n=e.properties.createdAt,r=typeof n==`string`?n:``,i=r?he(r):null,a=e.labels.join(` · `)+(e.trashed?` · Trashed`:``)+` · ${e.id}`;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`h2`,{className:`graph-side-name`,title:t,children:t}),i&&(0,P.jsx)(`div`,{className:`graph-side-created`,children:i}),(0,P.jsx)(`div`,{className:`graph-side-meta`,children:a})]})}return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`graph-side-labels`,children:[e.labels.join(` · `),e.trashed?` · Trashed`:``]}),(0,P.jsx)(`div`,{className:`graph-side-id`,children:e.id})]})})()}),(0,P.jsx)(`button`,{type:`button`,className:`graph-side-close`,onClick:a,"aria-label":`Close`,children:(0,P.jsx)(ee,{size:14})})]}),e.trashed&&(0,P.jsxs)(`dl`,{className:`graph-side-props graph-side-trash-meta`,children:[(0,P.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,P.jsx)(`dt`,{children:`trashedAt`}),(0,P.jsx)(`dd`,{children:He(e.properties.trashedAt)})]}),(0,P.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,P.jsx)(`dt`,{children:`trashedBy`}),(0,P.jsx)(`dd`,{children:He(e.properties.trashedBy)})]})]}),(0,P.jsxs)(`dl`,{className:`graph-side-props`,children:[l.length===0&&(0,P.jsx)(`div`,{className:`graph-side-empty`,children:`No properties.`}),l.map(([e,t])=>(0,P.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:He(t)})]},e))]}),u.length>0&&(0,P.jsxs)(`section`,{className:`graph-side-edges`,children:[(0,P.jsxs)(`h3`,{className:`graph-side-edges-heading`,children:[`Connections (`,u.length,`)`]}),u.map(t=>{let n=t.from===e.id,i=n?t.to:t.from,a=r.get(i),o=a?ve(a):i,s=n?`→`:`←`,c=Object.entries(t.properties??{}).filter(([,e])=>e!=null&&e!==``);return(0,P.jsxs)(`div`,{className:`graph-side-edge`,children:[(0,P.jsxs)(`div`,{className:`graph-side-edge-header`,children:[(0,P.jsx)(`span`,{className:`graph-side-edge-type`,children:t.type}),(0,P.jsx)(`span`,{className:`graph-side-edge-arrow`,children:s}),(0,P.jsx)(`span`,{className:`graph-side-edge-other`,title:o,children:o})]}),c.length>0&&(0,P.jsx)(`dl`,{className:`graph-side-edge-props`,children:c.map(([e,t])=>(0,P.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:He(t)})]},e))})]},t.id)})]}),e.trashed&&(0,P.jsxs)(`footer`,{className:`graph-side-footer`,children:[!d&&!p&&(0,P.jsxs)(`button`,{type:`button`,className:`graph-side-restore`,onClick:y,children:[(0,P.jsx)(x,{size:14}),` Restore`]}),d&&(0,P.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,P.jsxs)(`p`,{children:[(0,P.jsx)(c,{size:14,className:`spin`}),` Restoring…`]})}),p&&(0,P.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,P.jsxs)(`p`,{children:[`Restore failed: `,p]}),(0,P.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,P.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{m(null)},children:`Close`}),(0,P.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:y,children:`Retry`})]})]})]}),!e.trashed&&(0,P.jsxs)(`footer`,{className:`graph-side-footer`,children:[!h&&!_&&(0,P.jsxs)(`button`,{type:`button`,className:`graph-side-trash`,onClick:b,children:[(0,P.jsx)(n,{size:14}),` Trash`]}),h&&(0,P.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,P.jsxs)(`p`,{children:[(0,P.jsx)(c,{size:14,className:`spin`}),` Trashing…`]})}),_&&(0,P.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,P.jsxs)(`p`,{children:[`Trash failed: `,_]}),(0,P.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,P.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{v(null)},children:`Close`}),(0,P.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:b,children:`Retry`})]})]})]})]})}function Le(e,t){let n=`/api/admin/graph-subgraph`,r=t.includeAgentActions?`&includeAgentActions=1`:``;if(e.kind===`neighbourhood`){let i=t.search&&t.search.q?`&q=${encodeURIComponent(t.search.q)}&limit=${t.search.limit}`:``;return`${n}?mode=neighbourhood&elementId=${encodeURIComponent(e.rootElementId)}${r}${i}`}return`${n}?mode=default&labels=${encodeURIComponent(e.selectedLabels.join(`,`))}${e.includeTrashed?`&includeTrashed=1`:``}${r}${t.channel&&t.channel.length>0?`&channel=${encodeURIComponent(t.channel.join(`,`))}`:``}${t.messageSublabel&&t.messageSublabel.length>0?`&messageSublabel=${encodeURIComponent(t.messageSublabel.join(`,`))}`:``}`}var Re=class extends Error{body;constructor(e){super(e.error),this.body=e}};function ze({viewStack:e}){let t=e.map(e=>e.kind===`filter`?`Filter`:e.rootLabel??`Node`);return(0,P.jsx)(`div`,{className:`graph-breadcrumb`,role:`navigation`,"aria-label":`Graph navigation breadcrumb`,children:t.map((e,n)=>(0,P.jsxs)(`span`,{className:`graph-breadcrumb-item`,children:[n>0&&(0,P.jsx)(`span`,{className:`graph-breadcrumb-separator`,"aria-hidden":`true`,children:`›`}),(0,P.jsx)(`span`,{className:`graph-breadcrumb-label${n===t.length-1?` is-current`:``}`,children:e})]},n))})}function Be(e,t){let n=`[graph-page] ${e} ${Object.entries(t).map(([e,t])=>`${e}=${String(t)}`).join(` `)}`;try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-nav`,msg:n}),keepalive:!0}).catch(()=>{})}catch{}}function Ve(e){let t=t=>{let n=e[t];if(n&&typeof n==`object`&&`low`in n){let e=n.low;return typeof e==`number`?e:null}return null},n=t(`year`),r=t(`month`),i=t(`day`);if(n===null||r===null||i===null)return null;let a=`${String(n).padStart(4,`0`)}-${String(r).padStart(2,`0`)}-${String(i).padStart(2,`0`)}`;if(!(`hour`in e))return a;let o=t(`hour`),s=t(`minute`),c=t(`second`);return o===null||s===null||c===null?a:`${a} ${String(o).padStart(2,`0`)}:${String(s).padStart(2,`0`)}:${String(c).padStart(2,`0`)}`}function He(e){if(e==null)return``;if(Array.isArray(e))return e.length>8?`[${e.length} items]`:e.map(String).join(`, `);if(typeof e==`object`){if(`year`in e&&`month`in e&&`day`in e&&typeof e.year==`object`){let t=Ve(e);if(t)return t}return JSON.stringify(e)}return String(e)}export{x as a,ee as i,Ne as n,b as o,A as r,Fe as t};