147 lines
575 KiB
JavaScript
147 lines
575 KiB
JavaScript
function getImportPath(filename) {
|
||
return `./${filename}`;
|
||
}
|
||
import{r as ve,R as jT}from"./vendor-react-Dixhfmvb.js";import{j as E,M as LT,r as zT,a as HT,b as VT,c as WT}from"./vendor-markdown-CBmlBP6m.js";let tt=null;const Wv=location.pathname.split("/").slice(0,-1).join("/");let UT=null;async function Xde(){try{await Promise.all([import(Wv+"/scripts/api.js").then(i=>{UT=i?.api}),import(Wv+"/scripts/app.js").then(i=>{tt=i?.app})])}catch(i){console.error("waitForApp error",i)}}const Y1={messages:[],selectedNode:Object.keys(tt?.canvas?.selected_nodes??{})?.length?Object.values(tt?.canvas?.selected_nodes):null,installedNodes:[],loading:!1,sessionId:null,showChat:!1,activeTab:"chat",screenState:null,guiding:!1};function KT(i,e){switch(e.type){case"SET_MESSAGES":return{...i,messages:e.payload};case"ADD_MESSAGE":return{...i,messages:[...i.messages,e.payload]};case"UPDATE_MESSAGE":return{...i,messages:i.messages.map(t=>t.id===e.payload.id&&!t.finished?e.payload:t)};case"SET_SELECTED_NODE":return{...i,selectedNode:e.payload};case"SET_INSTALLED_NODES":return{...i,installedNodes:e.payload};case"SET_LOADING":return{...i,loading:e.payload};case"SET_SESSION_ID":return{...i,sessionId:e.payload};case"SET_SHOW_CHAT":return{...i,showChat:e.payload};case"SET_ACTIVE_TAB":return{...i,activeTab:e.payload};case"SET_SCREEN_STATE":return{...i,screenState:e.payload};case"SET_GUIDING":return{...i,guiding:e.payload};case"CLEAR_MESSAGES":return{...i,messages:[]};default:return i}}const X1=ve.createContext({state:Y1,dispatch:()=>null,isAutoScroll:{current:!0},showcasIng:{current:!1}});function Jde({children:i}){const[e,t]=ve.useReducer(KT,Y1),r=ve.useRef(!0),n=ve.useRef(!0);return jT.useEffect(()=>{e.sessionId&&e.messages.length>0&&localStorage.setItem(`messages_${e.sessionId}`,JSON.stringify(e.messages))},[e.messages,e.sessionId]),E.jsx(X1.Provider,{value:{state:e,dispatch:t,isAutoScroll:r,showcasIng:n},children:i})}function GT(){const i=ve.useContext(X1);if(!i)throw new Error("useChatContext must be used within a ChatProvider");return i}const vf={apiBaseUrl:"https://comfyui-copilot-server-pre.onrender.com"};function Jt(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){const e=Math.random()*16|0;return(i==="x"?e:e&3|8).toString(16)})}var qT="0123456789abcdefghijklmnopqrstuvwxyz";function dr(i){return qT.charAt(i)}function YT(i,e){return i&e}function ea(i,e){return i|e}function Uv(i,e){return i^e}function Kv(i,e){return i&~e}function XT(i){if(i==0)return-1;var e=0;return i&65535||(i>>=16,e+=16),i&255||(i>>=8,e+=8),i&15||(i>>=4,e+=4),i&3||(i>>=2,e+=2),i&1||++e,e}function JT(i){for(var e=0;i!=0;)i&=i-1,++e;return e}var cn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",J1="=";function cl(i){var e,t,r="";for(e=0;e+3<=i.length;e+=3)t=parseInt(i.substring(e,e+3),16),r+=cn.charAt(t>>6)+cn.charAt(t&63);for(e+1==i.length?(t=parseInt(i.substring(e,e+1),16),r+=cn.charAt(t<<2)):e+2==i.length&&(t=parseInt(i.substring(e,e+2),16),r+=cn.charAt(t>>2)+cn.charAt((t&3)<<4));(r.length&3)>0;)r+=J1;return r}function Gv(i){var e="",t,r=0,n=0;for(t=0;t<i.length&&i.charAt(t)!=J1;++t){var s=cn.indexOf(i.charAt(t));s<0||(r==0?(e+=dr(s>>2),n=s&3,r=1):r==1?(e+=dr(n<<2|s>>4),n=s&15,r=2):r==2?(e+=dr(n),e+=dr(s>>2),n=s&3,r=3):(e+=dr(n<<2|s>>4),e+=dr(s&15),r=0))}return r==1&&(e+=dr(n<<2)),e}var Xi,ZT={decode:function(i){var e;if(Xi===void 0){var t="0123456789ABCDEF",r=` \f
|
||
\r \u2028\u2029`;for(Xi={},e=0;e<16;++e)Xi[t.charAt(e)]=e;for(t=t.toLowerCase(),e=10;e<16;++e)Xi[t.charAt(e)]=e;for(e=0;e<r.length;++e)Xi[r.charAt(e)]=-1}var n=[],s=0,o=0;for(e=0;e<i.length;++e){var a=i.charAt(e);if(a=="=")break;if(a=Xi[a],a!=-1){if(a===void 0)throw new Error("Illegal character at offset "+e);s|=a,++o>=2?(n[n.length]=s,s=0,o=0):s<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return n}},ui,iu={decode:function(i){var e;if(ui===void 0){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=`= \f
|
||
\r \u2028\u2029`;for(ui=Object.create(null),e=0;e<64;++e)ui[t.charAt(e)]=e;for(ui["-"]=62,ui._=63,e=0;e<r.length;++e)ui[r.charAt(e)]=-1}var n=[],s=0,o=0;for(e=0;e<i.length;++e){var a=i.charAt(e);if(a=="=")break;if(a=ui[a],a!=-1){if(a===void 0)throw new Error("Illegal character at offset "+e);s|=a,++o>=4?(n[n.length]=s>>16,n[n.length]=s>>8&255,n[n.length]=s&255,s=0,o=0):s<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=s>>10;break;case 3:n[n.length]=s>>16,n[n.length]=s>>8&255;break}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(i){var e=iu.re.exec(i);if(e)if(e[1])i=e[1];else if(e[2])i=e[2];else throw new Error("RegExp out of sync");return iu.decode(i)}},Ji=1e13,_s=function(){function i(e){this.buf=[+e||0]}return i.prototype.mulAdd=function(e,t){var r=this.buf,n=r.length,s,o;for(s=0;s<n;++s)o=r[s]*e+t,o<Ji?t=0:(t=0|o/Ji,o-=t*Ji),r[s]=o;t>0&&(r[s]=t)},i.prototype.sub=function(e){var t=this.buf,r=t.length,n,s;for(n=0;n<r;++n)s=t[n]-e,s<0?(s+=Ji,e=1):e=0,t[n]=s;for(;t[t.length-1]===0;)t.pop()},i.prototype.toString=function(e){if((e||10)!=10)throw new Error("only base 10 is supported");for(var t=this.buf,r=t[t.length-1].toString(),n=t.length-2;n>=0;--n)r+=(Ji+t[n]).toString().substring(1);return r},i.prototype.valueOf=function(){for(var e=this.buf,t=0,r=e.length-1;r>=0;--r)t=t*Ji+e[r];return t},i.prototype.simplify=function(){var e=this.buf;return e.length==1?e[0]:this},i}(),Z1="…",QT=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,eO=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function Tn(i,e){return i.length>e&&(i=i.substring(0,e)+Z1),i}var Vh=function(){function i(e,t){this.hexDigits="0123456789ABCDEF",e instanceof i?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=t)}return i.prototype.get=function(e){if(e===void 0&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return typeof this.enc=="string"?this.enc.charCodeAt(e):this.enc[e]},i.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(e&15)},i.prototype.hexDump=function(e,t,r){for(var n="",s=e;s<t;++s)if(n+=this.hexByte(this.get(s)),r!==!0)switch(s&15){case 7:n+=" ";break;case 15:n+=`
|
||
`;break;default:n+=" "}return n},i.prototype.isASCII=function(e,t){for(var r=e;r<t;++r){var n=this.get(r);if(n<32||n>176)return!1}return!0},i.prototype.parseStringISO=function(e,t){for(var r="",n=e;n<t;++n)r+=String.fromCharCode(this.get(n));return r},i.prototype.parseStringUTF=function(e,t){for(var r="",n=e;n<t;){var s=this.get(n++);s<128?r+=String.fromCharCode(s):s>191&&s<224?r+=String.fromCharCode((s&31)<<6|this.get(n++)&63):r+=String.fromCharCode((s&15)<<12|(this.get(n++)&63)<<6|this.get(n++)&63)}return r},i.prototype.parseStringBMP=function(e,t){for(var r="",n,s,o=e;o<t;)n=this.get(o++),s=this.get(o++),r+=String.fromCharCode(n<<8|s);return r},i.prototype.parseTime=function(e,t,r){var n=this.parseStringISO(e,t),s=(r?QT:eO).exec(n);return s?(r&&(s[1]=+s[1],s[1]+=+s[1]<70?2e3:1900),n=s[1]+"-"+s[2]+"-"+s[3]+" "+s[4],s[5]&&(n+=":"+s[5],s[6]&&(n+=":"+s[6],s[7]&&(n+="."+s[7]))),s[8]&&(n+=" UTC",s[8]!="Z"&&(n+=s[8],s[9]&&(n+=":"+s[9]))),n):"Unrecognized time: "+n},i.prototype.parseInteger=function(e,t){for(var r=this.get(e),n=r>127,s=n?255:0,o,a="";r==s&&++e<t;)r=this.get(e);if(o=t-e,o===0)return n?-1:0;if(o>4){for(a=r,o<<=3;!((+a^s)&128);)a=+a<<1,--o;a="("+o+` bit)
|
||
`}n&&(r=r-256);for(var l=new _s(r),h=e+1;h<t;++h)l.mulAdd(256,this.get(h));return a+l.toString()},i.prototype.parseBitString=function(e,t,r){for(var n=this.get(e),s=(t-e-1<<3)-n,o="("+s+` bit)
|
||
`,a="",l=e+1;l<t;++l){for(var h=this.get(l),d=l==t-1?n:0,u=7;u>=d;--u)a+=h>>u&1?"1":"0";if(a.length>r)return o+Tn(a,r)}return o+a},i.prototype.parseOctetString=function(e,t,r){if(this.isASCII(e,t))return Tn(this.parseStringISO(e,t),r);var n=t-e,s="("+n+` byte)
|
||
`;r/=2,n>r&&(t=e+r);for(var o=e;o<t;++o)s+=this.hexByte(this.get(o));return n>r&&(s+=Z1),s},i.prototype.parseOID=function(e,t,r){for(var n="",s=new _s,o=0,a=e;a<t;++a){var l=this.get(a);if(s.mulAdd(128,l&127),o+=7,!(l&128)){if(n==="")if(s=s.simplify(),s instanceof _s)s.sub(80),n="2."+s.toString();else{var h=s<80?s<40?0:1:2;n=h+"."+(s-h*40)}else n+="."+s.toString();if(n.length>r)return Tn(n,r);s=new _s,o=0}}return o>0&&(n+=".incomplete"),n},i}(),tO=function(){function i(e,t,r,n,s){if(!(n instanceof qv))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=r,this.tag=n,this.sub=s}return i.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},i.prototype.content=function(e){if(this.tag===void 0)return null;e===void 0&&(e=1/0);var t=this.posContent(),r=Math.abs(this.length);if(!this.tag.isUniversal())return this.sub!==null?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+r,e);switch(this.tag.tagNumber){case 1:return this.stream.get(t)===0?"false":"true";case 2:return this.stream.parseInteger(t,t+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+r,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+r,e);case 6:return this.stream.parseOID(t,t+r,e);case 16:case 17:return this.sub!==null?"("+this.sub.length+" elem)":"(no elem)";case 12:return Tn(this.stream.parseStringUTF(t,t+r),e);case 18:case 19:case 20:case 21:case 22:case 26:return Tn(this.stream.parseStringISO(t,t+r),e);case 30:return Tn(this.stream.parseStringBMP(t,t+r),e);case 23:case 24:return this.stream.parseTime(t,t+r,this.tag.tagNumber==23)}return null},i.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(this.sub===null?"null":this.sub.length)+"]"},i.prototype.toPrettyString=function(e){e===void 0&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":this.tag.isUniversal()&&(this.tag.tagNumber==3||this.tag.tagNumber==4)&&this.sub!==null&&(t+=" (encapsulates)"),t+=`
|
||
`,this.sub!==null){e+=" ";for(var r=0,n=this.sub.length;r<n;++r)t+=this.sub[r].toPrettyString(e)}return t},i.prototype.posStart=function(){return this.stream.pos},i.prototype.posContent=function(){return this.stream.pos+this.header},i.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},i.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},i.decodeLength=function(e){var t=e.get(),r=t&127;if(r==t)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(r===0)return null;t=0;for(var n=0;n<r;++n)t=t*256+e.get();return t},i.prototype.getHexStringValue=function(){var e=this.toHexString(),t=this.header*2,r=this.length*2;return e.substr(t,r)},i.decode=function(e){var t;e instanceof Vh?t=e:t=new Vh(e,0);var r=new Vh(t),n=new qv(t),s=i.decodeLength(t),o=t.pos,a=o-r.pos,l=null,h=function(){var u=[];if(s!==null){for(var c=o+s;t.pos<c;)u[u.length]=i.decode(t);if(t.pos!=c)throw new Error("Content size is not correct for container starting at offset "+o)}else try{for(;;){var f=i.decode(t);if(f.tag.isEOC())break;u[u.length]=f}s=o-t.pos}catch(v){throw new Error("Exception while decoding undefined length content: "+v)}return u};if(n.tagConstructed)l=h();else if(n.isUniversal()&&(n.tagNumber==3||n.tagNumber==4))try{if(n.tagNumber==3&&t.get()!=0)throw new Error("BIT STRINGs with unused bits cannot encapsulate.");l=h();for(var d=0;d<l.length;++d)if(l[d].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch{l=null}if(l===null){if(s===null)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);t.pos=o+Math.abs(s)}return new i(r,a,s,n,l)},i}(),qv=function(){function i(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=(t&32)!==0,this.tagNumber=t&31,this.tagNumber==31){var r=new _s;do t=e.get(),r.mulAdd(128,t&127);while(t&128);this.tagNumber=r.simplify()}}return i.prototype.isUniversal=function(){return this.tagClass===0},i.prototype.isEOC=function(){return this.tagClass===0&&this.tagNumber===0},i}(),Vr,rO=0xdeadbeefcafe,Yv=(rO&16777215)==15715070,et=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],iO=(1<<26)/et[et.length-1],U=function(){function i(e,t,r){e!=null&&(typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}return i.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,n,s=!1,o="",a=this.t,l=this.DB-a*this.DB%t;if(a-- >0)for(l<this.DB&&(n=this[a]>>l)>0&&(s=!0,o=dr(n));a>=0;)l<t?(n=(this[a]&(1<<l)-1)<<t-l,n|=this[--a]>>(l+=this.DB-t)):(n=this[a]>>(l-=t)&r,l<=0&&(l+=this.DB,--a)),n>0&&(s=!0),s&&(o+=dr(n));return s?o:"0"},i.prototype.negate=function(){var e=J();return i.ZERO.subTo(this,e),e},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this[r]-e[r])!=0)return t;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+ta(this[this.t-1]^this.s&this.DM)},i.prototype.mod=function(e){var t=J();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(i.ZERO)>0&&e.subTo(t,t),t},i.prototype.modPowInt=function(e,t){var r;return e<256||t.isEven()?r=new Xv(t):r=new Jv(t),this.exp(e,r)},i.prototype.clone=function(){var e=J();return this.copyTo(e),e},i.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},i.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},i.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},i.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var r=this.DB-e*this.DB%8,n,s=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[s++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),n&128&&(n|=-256),s==0&&(this.s&128)!=(n&128)&&++s,(s>0||n!=this.s)&&(t[s++]=n);return t},i.prototype.equals=function(e){return this.compareTo(e)==0},i.prototype.min=function(e){return this.compareTo(e)<0?this:e},i.prototype.max=function(e){return this.compareTo(e)>0?this:e},i.prototype.and=function(e){var t=J();return this.bitwiseTo(e,YT,t),t},i.prototype.or=function(e){var t=J();return this.bitwiseTo(e,ea,t),t},i.prototype.xor=function(e){var t=J();return this.bitwiseTo(e,Uv,t),t},i.prototype.andNot=function(e){var t=J();return this.bitwiseTo(e,Kv,t),t},i.prototype.not=function(){for(var e=J(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},i.prototype.shiftLeft=function(e){var t=J();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},i.prototype.shiftRight=function(e){var t=J();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},i.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+XT(this[e]);return this.s<0?this.t*this.DB:-1},i.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=JT(this[r]^t);return e},i.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0},i.prototype.setBit=function(e){return this.changeBit(e,ea)},i.prototype.clearBit=function(e){return this.changeBit(e,Kv)},i.prototype.flipBit=function(e){return this.changeBit(e,Uv)},i.prototype.add=function(e){var t=J();return this.addTo(e,t),t},i.prototype.subtract=function(e){var t=J();return this.subTo(e,t),t},i.prototype.multiply=function(e){var t=J();return this.multiplyTo(e,t),t},i.prototype.divide=function(e){var t=J();return this.divRemTo(e,t,null),t},i.prototype.remainder=function(e){var t=J();return this.divRemTo(e,null,t),t},i.prototype.divideAndRemainder=function(e){var t=J(),r=J();return this.divRemTo(e,t,r),[t,r]},i.prototype.modPow=function(e,t){var r=e.bitLength(),n,s=kr(1),o;if(r<=0)return s;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?o=new Xv(t):t.isEven()?o=new sO(t):o=new Jv(t);var a=[],l=3,h=n-1,d=(1<<n)-1;if(a[1]=o.convert(this),n>1){var u=J();for(o.sqrTo(a[1],u);l<=d;)a[l]=J(),o.mulTo(u,a[l-2],a[l]),l+=2}var c=e.t-1,f,v=!0,g=J(),y;for(r=ta(e[c])-1;c>=0;){for(r>=h?f=e[c]>>r-h&d:(f=(e[c]&(1<<r+1)-1)<<h-r,c>0&&(f|=e[c-1]>>this.DB+r-h)),l=n;!(f&1);)f>>=1,--l;if((r-=l)<0&&(r+=this.DB,--c),v)a[f].copyTo(s),v=!1;else{for(;l>1;)o.sqrTo(s,g),o.sqrTo(g,s),l-=2;l>0?o.sqrTo(s,g):(y=s,s=g,g=y),o.mulTo(g,a[f],s)}for(;c>=0&&!(e[c]&1<<r);)o.sqrTo(s,g),y=s,s=g,g=y,--r<0&&(r=this.DB-1,--c)}return o.revert(s)},i.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return i.ZERO;for(var r=e.clone(),n=this.clone(),s=kr(1),o=kr(0),a=kr(0),l=kr(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!s.isEven()||!o.isEven())&&(s.addTo(this,s),o.subTo(e,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),t?((!a.isEven()||!l.isEven())&&(a.addTo(this,a),l.subTo(e,l)),a.rShiftTo(1,a)):l.isEven()||l.subTo(e,l),l.rShiftTo(1,l);r.compareTo(n)>=0?(r.subTo(n,r),t&&s.subTo(a,s),o.subTo(l,o)):(n.subTo(r,n),t&&a.subTo(s,a),l.subTo(o,l))}if(n.compareTo(i.ONE)!=0)return i.ZERO;if(l.compareTo(e)>=0)return l.subtract(e);if(l.signum()<0)l.addTo(e,l);else return l;return l.signum()<0?l.add(e):l},i.prototype.pow=function(e){return this.exp(e,new nO)},i.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var s=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(s<o&&(o=s),o>0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(s=t.getLowestSetBit())>0&&t.rShiftTo(s,t),(s=r.getLowestSetBit())>0&&r.rShiftTo(s,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},i.prototype.isProbablePrime=function(e){var t,r=this.abs();if(r.t==1&&r[0]<=et[et.length-1]){for(t=0;t<et.length;++t)if(r[0]==et[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<et.length;){for(var n=et[t],s=t+1;s<et.length&&n<iO;)n*=et[s++];for(n=r.modInt(n);t<s;)if(n%et[t++]==0)return!1}return r.millerRabin(e)},i.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},i.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},i.prototype.fromString=function(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var n=e.length,s=!1,o=0;--n>=0;){var a=r==8?+e[n]&255:Qv(e,n);if(a<0){e.charAt(n)=="-"&&(s=!0);continue}s=!1,o==0?this[this.t++]=a:o+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=r,o>=this.DB&&(o-=this.DB)}r==8&&+e[0]&128&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),s&&i.ZERO.subTo(this,this)},i.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},i.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},i.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},i.prototype.lShiftTo=function(e,t){for(var r=e%this.DB,n=this.DB-r,s=(1<<n)-1,o=Math.floor(e/this.DB),a=this.s<<r&this.DM,l=this.t-1;l>=0;--l)t[l+o+1]=this[l]>>n|a,a=(this[l]&s)<<r;for(var l=o-1;l>=0;--l)t[l]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()},i.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB,s=this.DB-n,o=(1<<n)-1;t[0]=this[r]>>n;for(var a=r+1;a<this.t;++a)t[a-r-1]|=(this[a]&o)<<s,t[a-r]=this[a]>>n;n>0&&(t[this.t-r-1]|=(this.s&o)<<s),t.t=this.t-r,t.clamp()},i.prototype.subTo=function(e,t){for(var r=0,n=0,s=Math.min(e.t,this.t);r<s;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},i.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),s=r.t;for(t.t=s+n.t;--s>=0;)t[s]=0;for(s=0;s<n.t;++s)t[s+r.t]=r.am(0,n[s],t,s,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&i.ZERO.subTo(t,t)},i.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},i.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t){t?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=J());var o=J(),a=this.s,l=e.s,h=this.DB-ta(n[n.t-1]);h>0?(n.lShiftTo(h,o),s.lShiftTo(h,r)):(n.copyTo(o),s.copyTo(r));var d=o.t,u=o[d-1];if(u!=0){var c=u*(1<<this.F1)+(d>1?o[d-2]>>this.F2:0),f=this.FV/c,v=(1<<this.F1)/c,g=1<<this.F2,y=r.t,p=y-d,m=t??J();for(o.dlShiftTo(p,m),r.compareTo(m)>=0&&(r[r.t++]=1,r.subTo(m,r)),i.ONE.dlShiftTo(d,m),m.subTo(o,o);o.t<d;)o[o.t++]=0;for(;--p>=0;){var w=r[--y]==u?this.DM:Math.floor(r[y]*f+(r[y-1]+g)*v);if((r[y]+=o.am(0,w,r,p,0,d))<w)for(o.dlShiftTo(p,m),r.subTo(m,r);r[y]<--w;)r.subTo(m,r)}t!=null&&(r.drShiftTo(d,t),a!=l&&i.ZERO.subTo(t,t)),r.t=d,r.clamp(),h>0&&r.rShiftTo(h,r),a<0&&i.ZERO.subTo(r,r)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(e&1))return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t},i.prototype.isEven=function(){return(this.t>0?this[0]&1:this.s)==0},i.prototype.exp=function(e,t){if(e>4294967295||e<1)return i.ONE;var r=J(),n=J(),s=t.convert(this),o=ta(e)-1;for(s.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<<o)>0)t.mulTo(n,s,r);else{var a=r;r=n,n=a}return t.revert(r)},i.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},i.prototype.toRadix=function(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=kr(r),s=J(),o=J(),a="";for(this.divRemTo(n,s,o);s.signum()>0;)a=(r+o.intValue()).toString(e).substr(1)+a,s.divRemTo(n,s,o);return o.intValue().toString(e)+a},i.prototype.fromRadix=function(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),s=!1,o=0,a=0,l=0;l<e.length;++l){var h=Qv(e,l);if(h<0){e.charAt(l)=="-"&&this.signum()==0&&(s=!0);continue}a=t*a+h,++o>=r&&(this.dMultiply(n),this.dAddOffset(a,0),o=0,a=0)}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),s&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(i.ONE.shiftLeft(e-1),ea,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(i.ONE.shiftLeft(e-1),this);else{var n=[],s=e&7;n.length=(e>>3)+1,t.nextBytes(n),s>0?n[0]&=(1<<s)-1:n[0]=0,this.fromString(n,256)}},i.prototype.bitwiseTo=function(e,t,r){var n,s,o=Math.min(e.t,this.t);for(n=0;n<o;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(s=e.s&this.DM,n=o;n<this.t;++n)r[n]=t(this[n],s);r.t=this.t}else{for(s=this.s&this.DM,n=o;n<e.t;++n)r[n]=t(s,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},i.prototype.changeBit=function(e,t){var r=i.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},i.prototype.addTo=function(e,t){for(var r=0,n=0,s=Math.min(e.t,this.t);r<s;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},i.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(e,t){if(e!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},i.prototype.multiplyLowerTo=function(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(var s=r.t-this.t;n<s;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(var s=Math.min(e.t,t);n<s;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()},i.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},i.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},i.prototype.millerRabin=function(e){var t=this.subtract(i.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>et.length&&(e=et.length);for(var s=J(),o=0;o<e;++o){s.fromInt(et[Math.floor(Math.random()*et.length)]);var a=s.modPow(n,this);if(a.compareTo(i.ONE)!=0&&a.compareTo(t)!=0){for(var l=1;l++<r&&a.compareTo(t)!=0;)if(a=a.modPowInt(2,this),a.compareTo(i.ONE)==0)return!1;if(a.compareTo(t)!=0)return!1}}return!0},i.prototype.square=function(){var e=J();return this.squareTo(e),e},i.prototype.gcda=function(e,t){var r=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(r.compareTo(n)<0){var s=r;r=n,n=s}var o=r.getLowestSetBit(),a=n.getLowestSetBit();if(a<0){t(r);return}o<a&&(a=o),a>0&&(r.rShiftTo(a,r),n.rShiftTo(a,n));var l=function(){(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n)),r.signum()>0?setTimeout(l,0):(a>0&&n.lShiftTo(a,n),setTimeout(function(){t(n)},0))};setTimeout(l,10)},i.prototype.fromNumberAsync=function(e,t,r,n){if(typeof t=="number")if(e<2)this.fromInt(1);else{this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(i.ONE.shiftLeft(e-1),ea,this),this.isEven()&&this.dAddOffset(1,0);var s=this,o=function(){s.dAddOffset(2,0),s.bitLength()>e&&s.subTo(i.ONE.shiftLeft(e-1),s),s.isProbablePrime(t)?setTimeout(function(){n()},0):setTimeout(o,0)};setTimeout(o,0)}else{var a=[],l=e&7;a.length=(e>>3)+1,t.nextBytes(a),l>0?a[0]&=(1<<l)-1:a[0]=0,this.fromString(a,256)}},i}(),nO=function(){function i(){}return i.prototype.convert=function(e){return e},i.prototype.revert=function(e){return e},i.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},i.prototype.sqrTo=function(e,t){e.squareTo(t)},i}(),Xv=function(){function i(e){this.m=e}return i.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},i.prototype.revert=function(e){return e},i.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},i.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},i.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},i}(),Jv=function(){function i(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return i.prototype.convert=function(e){var t=J();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(U.ZERO)>0&&this.m.subTo(t,t),t},i.prototype.revert=function(e){var t=J();return e.copyTo(t),this.reduce(t),t},i.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e[t]&32767,n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e[r]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},i.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},i.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},i}(),sO=function(){function i(e){this.m=e,this.r2=J(),this.q3=J(),U.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return i.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=J();return e.copyTo(t),this.reduce(t),t},i.prototype.revert=function(e){return e},i.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},i.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},i.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},i}();function J(){return new U(null)}function be(i,e){return new U(i,e)}var Zv=typeof navigator<"u";Zv&&Yv&&navigator.appName=="Microsoft Internet Explorer"?(U.prototype.am=function(e,t,r,n,s,o){for(var a=t&32767,l=t>>15;--o>=0;){var h=this[e]&32767,d=this[e++]>>15,u=l*h+d*a;h=a*h+((u&32767)<<15)+r[n]+(s&1073741823),s=(h>>>30)+(u>>>15)+l*d+(s>>>30),r[n++]=h&1073741823}return s},Vr=30):Zv&&Yv&&navigator.appName!="Netscape"?(U.prototype.am=function(e,t,r,n,s,o){for(;--o>=0;){var a=t*this[e++]+r[n]+s;s=Math.floor(a/67108864),r[n++]=a&67108863}return s},Vr=26):(U.prototype.am=function(e,t,r,n,s,o){for(var a=t&16383,l=t>>14;--o>=0;){var h=this[e]&16383,d=this[e++]>>14,u=l*h+d*a;h=a*h+((u&16383)<<14)+r[n]+s,s=(h>>28)+(u>>14)+l*d,r[n++]=h&268435455}return s},Vr=28);U.prototype.DB=Vr;U.prototype.DM=(1<<Vr)-1;U.prototype.DV=1<<Vr;var pf=52;U.prototype.FV=Math.pow(2,pf);U.prototype.F1=pf-Vr;U.prototype.F2=2*Vr-pf;var Bl=[],Un,Pt;Un=48;for(Pt=0;Pt<=9;++Pt)Bl[Un++]=Pt;Un=97;for(Pt=10;Pt<36;++Pt)Bl[Un++]=Pt;Un=65;for(Pt=10;Pt<36;++Pt)Bl[Un++]=Pt;function Qv(i,e){var t=Bl[i.charCodeAt(e)];return t??-1}function kr(i){var e=J();return e.fromInt(i),e}function ta(i){var e=1,t;return(t=i>>>16)!=0&&(i=t,e+=16),(t=i>>8)!=0&&(i=t,e+=8),(t=i>>4)!=0&&(i=t,e+=4),(t=i>>2)!=0&&(i=t,e+=2),(t=i>>1)!=0&&(i=t,e+=1),e}U.ZERO=kr(0);U.ONE=kr(1);var oO=function(){function i(){this.i=0,this.j=0,this.S=[]}return i.prototype.init=function(e){var t,r,n;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[r],this.S[r]=n;this.i=0,this.j=0},i.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},i}();function aO(){return new oO}var Q1=256,ra,jr=null,kt;if(jr==null){jr=[],kt=0;var ia=void 0;if(typeof window<"u"&&window.crypto&&window.crypto.getRandomValues){var Wh=new Uint32Array(256);for(window.crypto.getRandomValues(Wh),ia=0;ia<Wh.length;++ia)jr[kt++]=Wh[ia]&255}var na=0,sa=function(i){if(na=na||0,na>=256||kt>=Q1){window.removeEventListener?window.removeEventListener("mousemove",sa,!1):window.detachEvent&&window.detachEvent("onmousemove",sa);return}try{var e=i.x+i.y;jr[kt++]=e&255,na+=1}catch{}};typeof window<"u"&&(window.addEventListener?window.addEventListener("mousemove",sa,!1):window.attachEvent&&window.attachEvent("onmousemove",sa))}function lO(){if(ra==null){for(ra=aO();kt<Q1;){var i=Math.floor(65536*Math.random());jr[kt++]=i&255}for(ra.init(jr),kt=0;kt<jr.length;++kt)jr[kt]=0;kt=0}return ra.next()}var nu=function(){function i(){}return i.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=lO()},i}();function hO(i,e){if(e<i.length+22)return console.error("Message too long for RSA"),null;for(var t=e-i.length-6,r="",n=0;n<t;n+=2)r+="ff";var s="0001"+r+"00"+i;return be(s,16)}function dO(i,e){if(e<i.length+11)return console.error("Message too long for RSA"),null;for(var t=[],r=i.length-1;r>=0&&e>0;){var n=i.charCodeAt(r--);n<128?t[--e]=n:n>127&&n<2048?(t[--e]=n&63|128,t[--e]=n>>6|192):(t[--e]=n&63|128,t[--e]=n>>6&63|128,t[--e]=n>>12|224)}t[--e]=0;for(var s=new nu,o=[];e>2;){for(o[0]=0;o[0]==0;)s.nextBytes(o);t[--e]=o[0]}return t[--e]=2,t[--e]=0,new U(t)}var cO=function(){function i(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return i.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},i.prototype.doPrivate=function(e){if(this.p==null||this.q==null)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),r=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(r)<0;)t=t.add(this.p);return t.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},i.prototype.setPublic=function(e,t){e!=null&&t!=null&&e.length>0&&t.length>0?(this.n=be(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},i.prototype.encrypt=function(e){var t=this.n.bitLength()+7>>3,r=dO(e,t);if(r==null)return null;var n=this.doPublic(r);if(n==null)return null;for(var s=n.toString(16),o=s.length,a=0;a<t*2-o;a++)s="0"+s;return s},i.prototype.setPrivate=function(e,t,r){e!=null&&t!=null&&e.length>0&&t.length>0?(this.n=be(e,16),this.e=parseInt(t,16),this.d=be(r,16)):console.error("Invalid RSA private key")},i.prototype.setPrivateEx=function(e,t,r,n,s,o,a,l){e!=null&&t!=null&&e.length>0&&t.length>0?(this.n=be(e,16),this.e=parseInt(t,16),this.d=be(r,16),this.p=be(n,16),this.q=be(s,16),this.dmp1=be(o,16),this.dmq1=be(a,16),this.coeff=be(l,16)):console.error("Invalid RSA private key")},i.prototype.generate=function(e,t){var r=new nu,n=e>>1;this.e=parseInt(t,16);for(var s=new U(t,16);;){for(;this.p=new U(e-n,1,r),!(this.p.subtract(U.ONE).gcd(s).compareTo(U.ONE)==0&&this.p.isProbablePrime(10)););for(;this.q=new U(n,1,r),!(this.q.subtract(U.ONE).gcd(s).compareTo(U.ONE)==0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var a=this.p.subtract(U.ONE),l=this.q.subtract(U.ONE),h=a.multiply(l);if(h.gcd(s).compareTo(U.ONE)==0){this.n=this.p.multiply(this.q),this.d=s.modInverse(h),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(l),this.coeff=this.q.modInverse(this.p);break}}},i.prototype.decrypt=function(e){var t=be(e,16),r=this.doPrivate(t);return r==null?null:uO(r,this.n.bitLength()+7>>3)},i.prototype.generateAsync=function(e,t,r){var n=new nu,s=e>>1;this.e=parseInt(t,16);var o=new U(t,16),a=this,l=function(){var h=function(){if(a.p.compareTo(a.q)<=0){var c=a.p;a.p=a.q,a.q=c}var f=a.p.subtract(U.ONE),v=a.q.subtract(U.ONE),g=f.multiply(v);g.gcd(o).compareTo(U.ONE)==0?(a.n=a.p.multiply(a.q),a.d=o.modInverse(g),a.dmp1=a.d.mod(f),a.dmq1=a.d.mod(v),a.coeff=a.q.modInverse(a.p),setTimeout(function(){r()},0)):setTimeout(l,0)},d=function(){a.q=J(),a.q.fromNumberAsync(s,1,n,function(){a.q.subtract(U.ONE).gcda(o,function(c){c.compareTo(U.ONE)==0&&a.q.isProbablePrime(10)?setTimeout(h,0):setTimeout(d,0)})})},u=function(){a.p=J(),a.p.fromNumberAsync(e-s,1,n,function(){a.p.subtract(U.ONE).gcda(o,function(c){c.compareTo(U.ONE)==0&&a.p.isProbablePrime(10)?setTimeout(d,0):setTimeout(u,0)})})};setTimeout(u,0)};setTimeout(l,0)},i.prototype.sign=function(e,t,r){var n=fO(r),s=n+t(e).toString(),o=hO(s,this.n.bitLength()/4);if(o==null)return null;var a=this.doPrivate(o);if(a==null)return null;var l=a.toString(16);return l.length&1?"0"+l:l},i.prototype.verify=function(e,t,r){var n=be(t,16),s=this.doPublic(n);if(s==null)return null;var o=s.toString(16).replace(/^1f+00/,""),a=vO(o);return a==r(e).toString()},i}();function uO(i,e){for(var t=i.toByteArray(),r=0;r<t.length&&t[r]==0;)++r;if(t.length-r!=e-1||t[r]!=2)return null;for(++r;t[r]!=0;)if(++r>=t.length)return null;for(var n="";++r<t.length;){var s=t[r]&255;s<128?n+=String.fromCharCode(s):s>191&&s<224?(n+=String.fromCharCode((s&31)<<6|t[r+1]&63),++r):(n+=String.fromCharCode((s&15)<<12|(t[r+1]&63)<<6|t[r+2]&63),r+=2)}return n}var Ga={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function fO(i){return Ga[i]||""}function vO(i){for(var e in Ga)if(Ga.hasOwnProperty(e)){var t=Ga[e],r=t.length;if(i.substr(0,r)==t)return i.substr(r)}return i}/*!
|
||
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
|
||
Code licensed under the BSD License:
|
||
http://developer.yahoo.com/yui/license.html
|
||
version: 2.9.0
|
||
*/var xe={};xe.lang={extend:function(i,e,t){if(!e||!i)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var r=function(){};if(r.prototype=e.prototype,i.prototype=new r,i.prototype.constructor=i,i.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e),t){var n;for(n in t)i.prototype[n]=t[n];var s=function(){},o=["toString","valueOf"];try{/MSIE/.test(navigator.userAgent)&&(s=function(a,l){for(n=0;n<o.length;n=n+1){var h=o[n],d=l[h];typeof d=="function"&&d!=Object.prototype[h]&&(a[h]=d)}})}catch{}s(i.prototype,t)}}};/**
|
||
* @fileOverview
|
||
* @name asn1-1.0.js
|
||
* @author Kenji Urushima kenji.urushima@gmail.com
|
||
* @version asn1 1.0.13 (2017-Jun-02)
|
||
* @since jsrsasign 2.1
|
||
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
||
*/var S={};(typeof S.asn1>"u"||!S.asn1)&&(S.asn1={});S.asn1.ASN1Util=new function(){this.integerToByteHex=function(i){var e=i.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(i){var e=i.toString(16);if(e.substr(0,1)!="-")e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var t=e.substr(1),r=t.length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var n="",s=0;s<r;s++)n+="f";var o=new U(n,16),a=o.xor(i).add(U.ONE);e=a.toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(i,e){return hextopem(i,e)},this.newObject=function(i){var e=S,t=e.asn1,r=t.DERBoolean,n=t.DERInteger,s=t.DERBitString,o=t.DEROctetString,a=t.DERNull,l=t.DERObjectIdentifier,h=t.DEREnumerated,d=t.DERUTF8String,u=t.DERNumericString,c=t.DERPrintableString,f=t.DERTeletexString,v=t.DERIA5String,g=t.DERUTCTime,y=t.DERGeneralizedTime,p=t.DERSequence,m=t.DERSet,w=t.DERTaggedObject,$=t.ASN1Util.newObject,x=Object.keys(i);if(x.length!=1)throw"key of param shall be only one.";var _=x[0];if(":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+_+":")==-1)throw"undefined key: "+_;if(_=="bool")return new r(i[_]);if(_=="int")return new n(i[_]);if(_=="bitstr")return new s(i[_]);if(_=="octstr")return new o(i[_]);if(_=="null")return new a(i[_]);if(_=="oid")return new l(i[_]);if(_=="enum")return new h(i[_]);if(_=="utf8str")return new d(i[_]);if(_=="numstr")return new u(i[_]);if(_=="prnstr")return new c(i[_]);if(_=="telstr")return new f(i[_]);if(_=="ia5str")return new v(i[_]);if(_=="utctime")return new g(i[_]);if(_=="gentime")return new y(i[_]);if(_=="seq"){for(var A=i[_],R=[],B=0;B<A.length;B++){var G=$(A[B]);R.push(G)}return new p({array:R})}if(_=="set"){for(var A=i[_],R=[],B=0;B<A.length;B++){var G=$(A[B]);R.push(G)}return new m({array:R})}if(_=="tag"){var q=i[_];if(Object.prototype.toString.call(q)==="[object Array]"&&q.length==3){var ce=$(q[2]);return new w({tag:q[0],explicit:q[1],obj:ce})}else{var ue={};if(q.explicit!==void 0&&(ue.explicit=q.explicit),q.tag!==void 0&&(ue.tag=q.tag),q.obj===void 0)throw"obj shall be specified for 'tag'.";return ue.obj=$(q.obj),new w(ue)}}},this.jsonToASN1HEX=function(i){var e=this.newObject(i);return e.getEncodedHex()}};S.asn1.ASN1Util.oidHexToInt=function(i){for(var n="",e=parseInt(i.substr(0,2),16),t=Math.floor(e/40),r=e%40,n=t+"."+r,s="",o=2;o<i.length;o+=2){var a=parseInt(i.substr(o,2),16),l=("00000000"+a.toString(2)).slice(-8);if(s=s+l.substr(1,7),l.substr(0,1)=="0"){var h=new U(s,2);n=n+"."+h.toString(10),s=""}}return n};S.asn1.ASN1Util.oidIntToHex=function(i){var e=function(a){var l=a.toString(16);return l.length==1&&(l="0"+l),l},t=function(a){var l="",h=new U(a,10),d=h.toString(2),u=7-d.length%7;u==7&&(u=0);for(var c="",f=0;f<u;f++)c+="0";d=c+d;for(var f=0;f<d.length-1;f+=7){var v=d.substr(f,7);f!=d.length-7&&(v="1"+v),l+=e(parseInt(v,2))}return l};if(!i.match(/^[0-9.]+$/))throw"malformed oid string: "+i;var r="",n=i.split("."),s=parseInt(n[0])*40+parseInt(n[1]);r+=e(s),n.splice(0,2);for(var o=0;o<n.length;o++)r+=t(n[o]);return r};S.asn1.ASN1Object=function(){var i="";this.getLengthHexFromValue=function(){if(typeof this.hV>"u"||this.hV==null)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+i.length+",v="+this.hV;var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);var n=128+r;return n.toString(16)+t},this.getEncodedHex=function(){return(this.hTLV==null||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}};S.asn1.DERAbstractString=function(i){S.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(this.s)},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},typeof i<"u"&&(typeof i=="string"?this.setString(i):typeof i.str<"u"?this.setString(i.str):typeof i.hex<"u"&&this.setStringHex(i.hex))};xe.lang.extend(S.asn1.DERAbstractString,S.asn1.ASN1Object);S.asn1.DERAbstractTime=function(i){S.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){utc=e.getTime()+e.getTimezoneOffset()*6e4;var t=new Date(utc);return t},this.formatDate=function(e,t,r){var n=this.zeroPadding,s=this.localDateToUTC(e),o=String(s.getFullYear());t=="utc"&&(o=o.substr(2,2));var a=n(String(s.getMonth()+1),2),l=n(String(s.getDate()),2),h=n(String(s.getHours()),2),d=n(String(s.getMinutes()),2),u=n(String(s.getSeconds()),2),c=o+a+l+h+d+u;if(r===!0){var f=s.getMilliseconds();if(f!=0){var v=n(String(f),3);v=v.replace(/[0]+$/,""),c=c+"."+v}}return c+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,r,n,s,o){var a=new Date(Date.UTC(e,t-1,r,n,s,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}};xe.lang.extend(S.asn1.DERAbstractTime,S.asn1.ASN1Object);S.asn1.DERAbstractStructured=function(i){S.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,typeof i<"u"&&typeof i.array<"u"&&(this.asn1Array=i.array)};xe.lang.extend(S.asn1.DERAbstractStructured,S.asn1.ASN1Object);S.asn1.DERBoolean=function(){S.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"};xe.lang.extend(S.asn1.DERBoolean,S.asn1.ASN1Object);S.asn1.DERInteger=function(i){S.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=S.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new U(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},typeof i<"u"&&(typeof i.bigint<"u"?this.setByBigInteger(i.bigint):typeof i.int<"u"?this.setByInteger(i.int):typeof i=="number"?this.setByInteger(i):typeof i.hex<"u"&&this.setValueHex(i.hex))};xe.lang.extend(S.asn1.DERInteger,S.asn1.ASN1Object);S.asn1.DERBitString=function(i){if(i!==void 0&&typeof i.obj<"u"){var e=S.asn1.ASN1Util.newObject(i.obj);i.hex="00"+e.getEncodedHex()}S.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,r){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var n="0"+t;this.hTLV=null,this.isModified=!0,this.hV=n+r},this.setByBinaryString=function(t){t=t.replace(/0+$/,"");var r=8-t.length%8;r==8&&(r=0);for(var n=0;n<=r;n++)t+="0";for(var s="",n=0;n<t.length-1;n+=8){var o=t.substr(n,8),a=parseInt(o,2).toString(16);a.length==1&&(a="0"+a),s+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+r+s},this.setByBooleanArray=function(t){for(var r="",n=0;n<t.length;n++)t[n]==!0?r+="1":r+="0";this.setByBinaryString(r)},this.newFalseArray=function(t){for(var r=new Array(t),n=0;n<t;n++)r[n]=!1;return r},this.getFreshValueHex=function(){return this.hV},typeof i<"u"&&(typeof i=="string"&&i.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(i):typeof i.hex<"u"?this.setHexValueIncludingUnusedBits(i.hex):typeof i.bin<"u"?this.setByBinaryString(i.bin):typeof i.array<"u"&&this.setByBooleanArray(i.array))};xe.lang.extend(S.asn1.DERBitString,S.asn1.ASN1Object);S.asn1.DEROctetString=function(i){if(i!==void 0&&typeof i.obj<"u"){var e=S.asn1.ASN1Util.newObject(i.obj);i.hex=e.getEncodedHex()}S.asn1.DEROctetString.superclass.constructor.call(this,i),this.hT="04"};xe.lang.extend(S.asn1.DEROctetString,S.asn1.DERAbstractString);S.asn1.DERNull=function(){S.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"};xe.lang.extend(S.asn1.DERNull,S.asn1.ASN1Object);S.asn1.DERObjectIdentifier=function(i){var e=function(r){var n=r.toString(16);return n.length==1&&(n="0"+n),n},t=function(r){var n="",s=new U(r,10),o=s.toString(2),a=7-o.length%7;a==7&&(a=0);for(var l="",h=0;h<a;h++)l+="0";o=l+o;for(var h=0;h<o.length-1;h+=7){var d=o.substr(h,7);h!=o.length-7&&(d="1"+d),n+=e(parseInt(d,2))}return n};S.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(r){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueOidString=function(r){if(!r.match(/^[0-9.]+$/))throw"malformed oid string: "+r;var n="",s=r.split("."),o=parseInt(s[0])*40+parseInt(s[1]);n+=e(o),s.splice(0,2);for(var a=0;a<s.length;a++)n+=t(s[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(r){var n=S.asn1.x509.OID.name2oid(r);if(n!=="")this.setValueOidString(n);else throw"DERObjectIdentifier oidName undefined: "+r},this.getFreshValueHex=function(){return this.hV},i!==void 0&&(typeof i=="string"?i.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(i):this.setValueName(i):i.oid!==void 0?this.setValueOidString(i.oid):i.hex!==void 0?this.setValueHex(i.hex):i.name!==void 0&&this.setValueName(i.name))};xe.lang.extend(S.asn1.DERObjectIdentifier,S.asn1.ASN1Object);S.asn1.DEREnumerated=function(i){S.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=S.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new U(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},typeof i<"u"&&(typeof i.int<"u"?this.setByInteger(i.int):typeof i=="number"?this.setByInteger(i):typeof i.hex<"u"&&this.setValueHex(i.hex))};xe.lang.extend(S.asn1.DEREnumerated,S.asn1.ASN1Object);S.asn1.DERUTF8String=function(i){S.asn1.DERUTF8String.superclass.constructor.call(this,i),this.hT="0c"};xe.lang.extend(S.asn1.DERUTF8String,S.asn1.DERAbstractString);S.asn1.DERNumericString=function(i){S.asn1.DERNumericString.superclass.constructor.call(this,i),this.hT="12"};xe.lang.extend(S.asn1.DERNumericString,S.asn1.DERAbstractString);S.asn1.DERPrintableString=function(i){S.asn1.DERPrintableString.superclass.constructor.call(this,i),this.hT="13"};xe.lang.extend(S.asn1.DERPrintableString,S.asn1.DERAbstractString);S.asn1.DERTeletexString=function(i){S.asn1.DERTeletexString.superclass.constructor.call(this,i),this.hT="14"};xe.lang.extend(S.asn1.DERTeletexString,S.asn1.DERAbstractString);S.asn1.DERIA5String=function(i){S.asn1.DERIA5String.superclass.constructor.call(this,i),this.hT="16"};xe.lang.extend(S.asn1.DERIA5String,S.asn1.DERAbstractString);S.asn1.DERUTCTime=function(i){S.asn1.DERUTCTime.superclass.constructor.call(this,i),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return typeof this.date>"u"&&typeof this.s>"u"&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},i!==void 0&&(i.str!==void 0?this.setString(i.str):typeof i=="string"&&i.match(/^[0-9]{12}Z$/)?this.setString(i):i.hex!==void 0?this.setStringHex(i.hex):i.date!==void 0&&this.setByDate(i.date))};xe.lang.extend(S.asn1.DERUTCTime,S.asn1.DERAbstractTime);S.asn1.DERGeneralizedTime=function(i){S.asn1.DERGeneralizedTime.superclass.constructor.call(this,i),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},i!==void 0&&(i.str!==void 0?this.setString(i.str):typeof i=="string"&&i.match(/^[0-9]{14}Z$/)?this.setString(i):i.hex!==void 0?this.setStringHex(i.hex):i.date!==void 0&&this.setByDate(i.date),i.millis===!0&&(this.withMillis=!0))};xe.lang.extend(S.asn1.DERGeneralizedTime,S.asn1.DERAbstractTime);S.asn1.DERSequence=function(i){S.asn1.DERSequence.superclass.constructor.call(this,i),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e+=r.getEncodedHex()}return this.hV=e,this.hV}};xe.lang.extend(S.asn1.DERSequence,S.asn1.DERAbstractStructured);S.asn1.DERSet=function(i){S.asn1.DERSet.superclass.constructor.call(this,i),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e.push(r.getEncodedHex())}return this.sortFlag==!0&&e.sort(),this.hV=e.join(""),this.hV},typeof i<"u"&&typeof i.sortflag<"u"&&i.sortflag==!1&&(this.sortFlag=!1)};xe.lang.extend(S.asn1.DERSet,S.asn1.DERAbstractStructured);S.asn1.DERTaggedObject=function(i){S.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,r){this.hT=t,this.isExplicit=e,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},typeof i<"u"&&(typeof i.tag<"u"&&(this.hT=i.tag),typeof i.explicit<"u"&&(this.isExplicit=i.explicit),typeof i.obj<"u"&&(this.asn1Object=i.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))};xe.lang.extend(S.asn1.DERTaggedObject,S.asn1.ASN1Object);var pO=function(){var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},i(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ep=function(i){pO(e,i);function e(t){var r=i.call(this)||this;return t&&(typeof t=="string"?r.parseKey(t):(e.hasPrivateKeyProperty(t)||e.hasPublicKeyProperty(t))&&r.parsePropertiesFrom(t)),r}return e.prototype.parseKey=function(t){try{var r=0,n=0,s=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,o=s.test(t)?ZT.decode(t):iu.unarmor(t),a=tO.decode(o);if(a.sub.length===3&&(a=a.sub[2].sub[0]),a.sub.length===9){r=a.sub[1].getHexStringValue(),this.n=be(r,16),n=a.sub[2].getHexStringValue(),this.e=parseInt(n,16);var l=a.sub[3].getHexStringValue();this.d=be(l,16);var h=a.sub[4].getHexStringValue();this.p=be(h,16);var d=a.sub[5].getHexStringValue();this.q=be(d,16);var u=a.sub[6].getHexStringValue();this.dmp1=be(u,16);var c=a.sub[7].getHexStringValue();this.dmq1=be(c,16);var f=a.sub[8].getHexStringValue();this.coeff=be(f,16)}else if(a.sub.length===2)if(a.sub[0].sub){var v=a.sub[1],g=v.sub[0];r=g.sub[0].getHexStringValue(),this.n=be(r,16),n=g.sub[1].getHexStringValue(),this.e=parseInt(n,16)}else r=a.sub[0].getHexStringValue(),this.n=be(r,16),n=a.sub[1].getHexStringValue(),this.e=parseInt(n,16);else return!1;return!0}catch{return!1}},e.prototype.getPrivateBaseKey=function(){var t={array:[new S.asn1.DERInteger({int:0}),new S.asn1.DERInteger({bigint:this.n}),new S.asn1.DERInteger({int:this.e}),new S.asn1.DERInteger({bigint:this.d}),new S.asn1.DERInteger({bigint:this.p}),new S.asn1.DERInteger({bigint:this.q}),new S.asn1.DERInteger({bigint:this.dmp1}),new S.asn1.DERInteger({bigint:this.dmq1}),new S.asn1.DERInteger({bigint:this.coeff})]},r=new S.asn1.DERSequence(t);return r.getEncodedHex()},e.prototype.getPrivateBaseKeyB64=function(){return cl(this.getPrivateBaseKey())},e.prototype.getPublicBaseKey=function(){var t=new S.asn1.DERSequence({array:[new S.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new S.asn1.DERNull]}),r=new S.asn1.DERSequence({array:[new S.asn1.DERInteger({bigint:this.n}),new S.asn1.DERInteger({int:this.e})]}),n=new S.asn1.DERBitString({hex:"00"+r.getEncodedHex()}),s=new S.asn1.DERSequence({array:[t,n]});return s.getEncodedHex()},e.prototype.getPublicBaseKeyB64=function(){return cl(this.getPublicBaseKey())},e.wordwrap=function(t,r){if(r=r||64,!t)return t;var n="(.{1,"+r+`})( +|$
|
||
?)|(.{1,`+r+"})";return t.match(RegExp(n,"g")).join(`
|
||
`)},e.prototype.getPrivateKey=function(){var t=`-----BEGIN RSA PRIVATE KEY-----
|
||
`;return t+=e.wordwrap(this.getPrivateBaseKeyB64())+`
|
||
`,t+="-----END RSA PRIVATE KEY-----",t},e.prototype.getPublicKey=function(){var t=`-----BEGIN PUBLIC KEY-----
|
||
`;return t+=e.wordwrap(this.getPublicBaseKeyB64())+`
|
||
`,t+="-----END PUBLIC KEY-----",t},e.hasPublicKeyProperty=function(t){return t=t||{},t.hasOwnProperty("n")&&t.hasOwnProperty("e")},e.hasPrivateKeyProperty=function(t){return t=t||{},t.hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")},e.prototype.parsePropertiesFrom=function(t){this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)},e}(cO),gO={},Uh,yO=typeof process<"u"?(Uh=gO)===null||Uh===void 0?void 0:Uh.npm_package_version:void 0,mO=function(){function i(e){e===void 0&&(e={}),e=e||{},this.default_key_size=e.default_key_size?parseInt(e.default_key_size,10):1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=null}return i.prototype.setKey=function(e){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new ep(e)},i.prototype.setPrivateKey=function(e){this.setKey(e)},i.prototype.setPublicKey=function(e){this.setKey(e)},i.prototype.decrypt=function(e){try{return this.getKey().decrypt(Gv(e))}catch{return!1}},i.prototype.encrypt=function(e){try{return cl(this.getKey().encrypt(e))}catch{return!1}},i.prototype.sign=function(e,t,r){try{return cl(this.getKey().sign(e,t,r))}catch{return!1}},i.prototype.verify=function(e,t,r){try{return this.getKey().verify(e,Gv(t),r)}catch{return!1}},i.prototype.getKey=function(e){if(!this.key){if(this.key=new ep,e&&{}.toString.call(e)==="[object Function]"){this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);return}this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},i.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},i.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},i.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},i.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},i.version=yO,i}();async function Zde(){try{const e=await(await fetch(`${vf.apiBaseUrl}/api/chat/rsa_public_key`)).json();if(!e.success)throw new Error(e.message||"Failed to fetch RSA public key");return e.data}catch(i){throw console.error("Error fetching RSA public key:",i),i}}async function un(i,e){try{if(window.crypto&&window.crypto.subtle){const t="-----BEGIN PUBLIC KEY-----",n=e.substring(e.indexOf(t)+t.length,e.indexOf("-----END PUBLIC KEY-----")).replace(/\s/g,""),s=window.atob(n),o=new ArrayBuffer(s.length),a=new Uint8Array(o);for(let c=0;c<s.length;c++)a[c]=s.charCodeAt(c);const l=await window.crypto.subtle.importKey("spki",o,{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),d=new TextEncoder().encode(i),u=await window.crypto.subtle.encrypt({name:"RSA-OAEP"},l,d);return bO(u)}else{console.warn("Web Crypto API 不可用,使用 JSEncrypt 作为备选方案");const t=new mO;t.setPublicKey(e);const r=t.encrypt(i);if(!r)throw new Error("JSEncrypt 加密失败");return r}}catch(t){throw console.error("Error encrypting data with RSA public key:",t),t}}function bO(i){const e=new Uint8Array(i);let t="";const r=e.byteLength;for(let n=0;n<r;n++)t+=String.fromCharCode(e[n]);return window.btoa(t)}async function Qde(i,e,t){try{const r=await un(i,t),s=await(await fetch(`${vf.apiBaseUrl}/api/chat/verify_openai_key`,{method:"GET",headers:{"Encrypted-Openai-Api-Key":r,"Openai-Base-Url":e}})).json();return s.success&&s.data===!0}catch(r){return console.error("Error verifying OpenAI API key:",r),!1}}const Cr=vf.apiBaseUrl,Dr=()=>localStorage.getItem("chatApiKey"),gs=()=>{const i=localStorage.getItem("openaiApiKey"),e=localStorage.getItem("openaiBaseUrl")||"https://api.openai.com/v1",t=localStorage.getItem("rsaPublicKey");return{openaiApiKey:i||"",openaiBaseUrl:e,rsaPublicKey:t}},Ar=()=>navigator.language||"zh-CN",Zi=i=>{const e=i.headers.get("User-Api-Key");e&&!localStorage.getItem("chatApiKey")&&localStorage.setItem("chatApiKey",e)};var Wr;(i=>{async function e(h){try{const d=Dr(),u=Ar();h.session_id=localStorage.getItem("sessionId")||null,fetch(`${Cr}/api/chat/track_event`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${d}`,"trace-id":Jt(),"Accept-Language":u},body:JSON.stringify(h)}).catch(c=>{console.warn("Track event failed:",c)})}catch(d){console.warn("Error preparing track event:",d)}return Promise.resolve()}i.trackEvent=e;async function*t(h,d,u=[],c=null,f=null,v,g){try{const y=Dr(),p=Ar(),{openaiApiKey:m,openaiBaseUrl:w,rsaPublicKey:$}=gs(),x=Jt(),_=(u||[]).map(Q=>new Promise((K,Z)=>{const se=new FileReader;se.onloadend=()=>K(se.result),se.onerror=Z,se.readAsDataURL(Q)})),A=await Promise.all(_);let R=f?Array.isArray(f)?f:[f]:[];const B={"Content-Type":"application/json",accept:"application/json","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${y}`,"trace-id":v||Jt(),"Accept-Language":p};if(m&&m.trim()!==""&&$)try{const Q=await un(m,$);B["Encrypted-Openai-Api-Key"]=Q,B["Openai-Base-Url"]=w}catch(Q){console.error("Error encrypting OpenAI API key:",Q)}const G=new AbortController,q=setTimeout(()=>G.abort(),12e4);g&&g.addEventListener("abort",()=>{clearTimeout(q),G.abort()});const ce=await fetch(`${Cr}/api/chat/invoke`,{method:"POST",headers:B,body:JSON.stringify({session_id:h,prompt:d,mock:!1,intent:c,ext:R,images:A.map((Q,K)=>({filename:u[K].name,data:Q}))}),signal:G.signal});clearTimeout(q),Zi(ce);const ue=ce.body.getReader();let Fe="";for(;;){const{done:Q,value:K}=await ue.read();if(Q)break;Fe+=new TextDecoder().decode(K);const Z=Fe.split(`
|
||
`);Fe=Z.pop()||"";for(const se of Z)se.trim()&&(yield{...JSON.parse(se),message_id:x})}Fe.trim()&&(yield{...JSON.parse(Fe),message_id:x})}catch(y){if(console.error("Error in streamInvokeServer:",y),y instanceof Error&&y.name==="AbortError"){if(g?.aborted)throw y;alert("Request timed out after 2 minutes. Please try again.")}else alert(y instanceof Error?y.message:"An error occurred while streaming, please refresh the page and try again.");throw y}}i.streamInvokeServer=t;async function r(h,d){try{const u=Dr(),c=Ar(),{openaiApiKey:f,openaiBaseUrl:v,rsaPublicKey:g}=gs(),y={"Content-Type":"application/json",accept:"application/json","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${u}`,"trace-id":Jt(),"Accept-Language":c};if(f&&f.trim()!==""&&g)try{const w=await un(f,g);y["Encrypted-Openai-Api-Key"]=w,y["Openai-Base-Url"]=v}catch(w){console.error("Error encrypting OpenAI API key:",w)}const p=await fetch(`${Cr}/api/chat/get_optimized_workflow`,{method:"POST",headers:y,body:JSON.stringify({workflow_id:h,prompt:d})});Zi(p);const m=await p.json();if(!m.success){const w=m.message||"Failed to get optimized workflow";throw alert(w),new Error(w)}return m.data}catch(u){throw console.error("Error getting optimized workflow:",u),alert(u instanceof Error?u.message:"Failed to get optimized workflow"),u}}i.getOptimizedWorkflow=r;async function n(h){const d=Dr(),u=Ar(),{openaiApiKey:c,openaiBaseUrl:f,rsaPublicKey:v}=gs(),g={"Content-Type":"application/json",Authorization:`Bearer ${d}`,"trace-id":Jt(),"Accept-Language":u};if(c&&c.trim()!==""&&v)try{const m=await un(c,v);g["Encrypted-Openai-Api-Key"]=m,g["Openai-Base-Url"]=f}catch(m){console.error("Error encrypting OpenAI API key:",m)}const y=await fetch(`${Cr}/api/chat/get_node_info_by_types`,{method:"POST",headers:g,body:JSON.stringify({node_types:h})});Zi(y);const p=await y.json();if(!p.success){const m=p.message||"Failed to get node info by types";throw alert(m),new Error(m)}return p.data}i.batchGetNodeInfo=n;async function s(h){try{const d=localStorage.getItem(`messages_${h}`);if(d)return console.log("Using cached messages from localStorage"),JSON.parse(d);const u=Dr(),c=Ar(),{openaiApiKey:f,openaiBaseUrl:v,rsaPublicKey:g}=gs(),y={accept:"application/json",Authorization:`Bearer ${u}`,"trace-id":Jt(),"Accept-Language":c};if(f&&f.trim()!==""&&g)try{const $=await un(f,g);y["Encrypted-Openai-Api-Key"]=$,y["Openai-Base-Url"]=v}catch($){console.error("Error encrypting OpenAI API key:",$)}const p=await fetch(`${Cr}/api/chat/get_messages_by_session_id?session_id=${h}`,{method:"GET",headers:y});Zi(p);const m=await p.json();if(!m.success){const $=m.message||"Failed to fetch messages";throw alert($+", please refresh the page and try again."),new Error($)}const w=m.data.map($=>(console.log("msg.ext",$.ext),{id:$.id.toString(),content:$.role==="ai"?JSON.stringify({session_id:h,text:$.content,finished:$.finished||!1,format:$.format||"markdown",ext:$.ext}):$.content,role:$.role,name:$.role==="ai"?"Assistant":void 0,format:$.format||"markdown",finished:$.finished}));return localStorage.setItem(`messages_${h}`,JSON.stringify(w)),w}catch(d){throw console.error("Error fetching messages:",d),alert(d instanceof Error?d.message:"Failed to fetch messages, please refresh the page and try again."),d}}i.fetchMessages=s;async function o(){try{const h=Dr(),d=Ar(),{openaiApiKey:u,openaiBaseUrl:c,rsaPublicKey:f}=gs(),v={accept:"application/json",Authorization:`Bearer ${h}`,"trace-id":Jt(),"Accept-Language":d};if(u&&u.trim()!==""&&f)try{const p=await un(u,f);v["Encrypted-Openai-Api-Key"]=p,v["Openai-Base-Url"]=c}catch(p){console.error("Error encrypting OpenAI API key:",p)}const g=await fetch(`${Cr}/api/chat/announcement`,{method:"GET",headers:v});Zi(g);const y=await g.json();if(!y.success){const p=y.message||"Failed to fetch announcement";return console.error(p),""}return y.data}catch(h){return console.error("Error fetching announcement:",h),""}}i.fetchAnnouncement=o;async function a(h){let u=0,c;for(;u<3;)try{const f=Dr(),v=Ar(),g={"Content-Type":"application/json",accept:"application/json",Authorization:`Bearer ${f}`,"trace-id":Jt(),"Accept-Language":v},y=await fetch(`${Cr}/api/param_debug/generate_sd_prompts`,{method:"POST",headers:g,body:JSON.stringify({text:h})});Zi(y);const p=await y.json();if(!p.success){const m=p.message||"Failed to generate SD prompts";throw new Error(m)}return p.data}catch(f){if(c=f,u++,u>=3)throw console.error("Error generating SD prompts after 3 attempts:",f),f;console.warn(`Attempt ${u} failed, retrying... Error: ${f instanceof Error?f.message:"Unknown error"}`),await new Promise(v=>setTimeout(v,500*Math.pow(2,u-1)))}throw c}i.generateSDPrompts=a;async function l(){const h=Dr(),d=Ar(),u={"Content-Type":"application/json",accept:"application/json",Authorization:`Bearer ${h}`,"trace-id":Jt(),"Accept-Language":d};return await(await fetch(`${Cr}/v1/models`,{method:"GET",headers:u})).json()}i.listModels=l})(Wr||(Wr={}));function e$({name:i,isUser:e=!1,children:t}){return E.jsx("div",{className:"flex flex-col w-full items-start gap-2 py-2 animate-fadeIn",children:E.jsx("div",{className:"w-full",children:t})})}function $O({title:i,titleId:e,...t},r){return ve.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},t),i?ve.createElement("title",{id:e},i):null,ve.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const wO=ve.forwardRef($O);function ece({content:i,trace_id:e}){const[t,r]=ve.useState(!1),[n,s]=ve.useState(!1),o=async()=>{e&&(await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3))};return E.jsx(e$,{name:"User",isUser:!0,children:E.jsxs("div",{className:"w-full rounded-lg border border-gray-700 p-4 text-gray-700 text-sm break-words relative",children:[E.jsx("p",{className:"whitespace-pre-wrap leading-snug",children:i}),e&&E.jsxs("div",{className:"absolute bottom-1 right-1.5 cursor-pointer opacity-40 hover:opacity-100 transition-opacity",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onClick:o,children:[E.jsx(wO,{className:"h-3.5 w-3.5 text-gray-500 hover:!text-gray-700"}),t&&E.jsx("div",{className:"absolute right-0 -top-6 bg-gray-700 text-white text-[10px] py-0.5 px-1.5 rounded shadow-sm whitespace-nowrap",children:n?"Copied!":"Copy trace ID"})]})]})})}const EO=ve.memo(LT,(i,e)=>i.children===e.children&&i.className===e.className),SO=({content:i})=>E.jsxs("div",{className:"rounded-lg shadow-sm",children:[E.jsxs("div",{className:"flex items-center mb-1",children:[E.jsx("div",{className:"rounded-full mr-1",children:E.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:E.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),E.jsx("h3",{className:"text-base font-bold",children:"Node Usage Guide"})]}),E.jsx("div",{className:"markdown-content",children:i})]}),_O=({content:i})=>E.jsxs("div",{className:"rounded-lg border border-green-200 bg-green-50 p-1 shadow-sm",children:[E.jsxs("div",{className:"flex items-center mb-1",children:[E.jsx("div",{className:"bg-green-100 rounded-full p-1 mr-1",children:E.jsxs("svg",{className:"h-4 w-4 text-green-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[E.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),E.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),E.jsx("h3",{className:"text-sm font-medium text-green-800",children:"Node Parameter Reference"})]}),E.jsx("div",{className:"markdown-content text-green-900",children:i})]});function tce({content:i,name:e="Assistant",avatar:t,format:r,onOptionClick:n,extComponent:s,metadata:o}){const a=ve.useRef(null),l=(d,u)=>E.jsx(EO,{rehypePlugins:[[VT,{target:"_blank"}],WT],remarkPlugins:[zT,HT],className:`prose prose-xs prose-neutral prose-a:text-accent-foreground/50 break-words [&>*]:!my-1 leading-relaxed text-xs text-gray-700
|
||
prose-headings:font-semibold
|
||
prose-h1:text-base
|
||
prose-h2:text-sm
|
||
prose-h3:text-xs
|
||
prose-h4:text-xs
|
||
prose-p:text-xs
|
||
prose-ul:text-xs
|
||
prose-ol:text-xs
|
||
prose-li:text-xs
|
||
prose-code:text-xs
|
||
prose-pre:text-xs
|
||
`,components:{p:({children:c})=>E.jsx("p",{className:"!my-0.5 leading-relaxed text-xs",children:c}),strong:({children:c})=>E.jsx("strong",{className:"text-gray-900",children:c}),h1:({children:c})=>E.jsx("h1",{className:"text-base font-semibold !my-1",children:c}),h2:({children:c})=>E.jsx("h2",{className:"text-sm font-semibold !my-1",children:c}),h3:({children:c})=>E.jsx("h3",{className:"text-xs font-semibold !my-1",children:c}),h4:({children:c})=>E.jsx("h4",{className:"text-xs font-semibold !my-1",children:c}),table:({children:c})=>E.jsx("table",{className:"border-solid border w-[100%] text-xs",children:c}),th:({children:c})=>E.jsx("th",{className:"border-solid border text-center pt-2 text-xs",children:c}),td:({children:c})=>{if(Array.isArray(c)&&c?.length>0){const f=[],v=c.length;for(let g=0;g<v;g++)c[g]==="<br>"?f.push(E.jsx("br",{})):f.push(c[g]);c=f}return E.jsx("td",{className:"border-solid border border-[#979797] text-center text-xs",children:c})},code:({children:c})=>{const[f,v]=ve.useState(!1),g=async()=>{try{await navigator.clipboard.writeText(c),v(!0),setTimeout(()=>v(!1),2e3)}catch(y){console.error("Failed to copy text:",y)}};return E.jsxs("span",{className:"relative group inline-flex items-center",children:[E.jsx("code",{className:"text-xs bg-gray-100 text-gray-900 rounded px-1",children:c}),E.jsx("button",{onClick:g,className:"absolute top-0 right-0 bg-gray-200 rounded p-1 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-gray-300 z-10","aria-label":"Copy code",children:f?E.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:E.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):E.jsxs("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:[E.jsx("path",{d:"M8 2a1 1 0 000 2h2a1 1 0 100-2H8z"}),E.jsx("path",{d:"M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5z"})]})})]})},pre:({children:c})=>E.jsx("pre",{className:"text-xs bg-gray-100 text-gray-800 rounded p-2 overflow-x-auto",children:c}),img:({node:c,...f})=>{let v=!1;const g=f.src?.split("?");return g&&g.length>0&&(v=g[0]?.endsWith(".gif")||g[0]?.endsWith(".webp")),E.jsx("div",{className:`${v?"":"w-1/2"} mx-auto`,children:E.jsx("img",{...f,loading:"lazy",className:"w-full h-auto block",onError:y=>{console.warn("Image failed to load:",f.src,"Error:",y),y.currentTarget.style.opacity="0"}})})},a:({href:c,children:f})=>{let v="markdown",g=null;try{const y=JSON.parse(i);v=y.ext?.[0]?.type||"markdown",g=y?.message_id}catch(y){console.error("Error parsing content:",y)}return E.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",onClick:()=>{Wr.trackEvent({event_type:"markdown_link_click",message_type:v,message_id:g,data:{link_url:c,link_text:f}})},children:f})}},children:d}),h=()=>{try{const d=JSON.parse(i),u=d.ext?.find(c=>c.type==="guides")?.data||[];if(o?.intent){const c=o.intent;if(c==="node_explain")return E.jsx(SO,{content:l(d.text||"")});if(c==="node_params")return E.jsx(_O,{content:l(d.text||"")})}return E.jsxs("div",{className:"space-y-3",children:[r==="markdown"&&d.text?E.jsx("div",{ref:a,children:l(d.text)}):d.text?E.jsx("p",{className:"whitespace-pre-wrap text-left",children:d.text}):null,u.length>0&&E.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:u.map((c,f)=>E.jsx("button",{className:"px-3 py-1.5 text-gray-700 rounded-md hover:!bg-gray-50 transition-colors text-[12px] w-[calc(50%-0.25rem)] border border-gray-700",onClick:()=>n?.(c),children:c},f))}),s]})}catch{return E.jsx("p",{className:"whitespace-pre-wrap text-left",children:i})}};return E.jsx(e$,{name:e,children:E.jsx("div",{className:"w-full rounded-lg bg-gray-50 p-4 text-gray-900 text-sm break-words overflow-hidden",children:h()})})}const TO=LiteGraph;function t$(i,e={}){const t=TO.createNode(i,"",e);if(!e.pos){const r=tt.canvas.canvas.getBoundingClientRect(),n=r.width/2/tt.canvas.ds.scale+-tt.canvas.ds.offset[0]/tt.canvas.ds.scale,s=r.height/2/tt.canvas.ds.scale+-tt.canvas.ds.offset[1]/tt.canvas.ds.scale;t.pos=[n-t.size[0]/2,s-t.size[1]/2]}return tt.graph.add(t),t}function OO({content:i,name:e="Assistant",avatar:t,installedNodes:r,onFinishLoad:n}){const s=JSON.parse(i),[o,a]=ve.useState(null),[l,h]=ve.useState(null),d=s.ext?.find(p=>p.type==="node")?.data||[],u=p=>r.some(m=>m===p),c=d.filter(p=>u(p.name)),f=d.filter(p=>!u(p.name));ve.useEffect(()=>{n?.()},[]);const v=p=>p>=1e4?`${(p/1e4).toFixed(1)}w`:p>=1e3?`${(p/1e3).toFixed(1)}k`:p.toString(),g=p=>{a(p.name),h(p)},y=()=>{a(null),h(null)};return E.jsxs("div",{className:"rounded-lg bg-gray-50 p-3 text-gray-700 text-xs break-words overflow-visible",children:[c.length>0&&E.jsxs("div",{className:"space-y-3",children:[E.jsx("p",{className:"text-xs font-medium",children:"Installed nodes:"}),E.jsx("div",{className:"grid grid-cols-2 gap-3",children:c.map(p=>E.jsxs("div",{className:`w-full p-3 rounded-lg border border-gray-200
|
||
hover:shadow-sm transition-all duration-200 relative group`,onMouseEnter:()=>g(p),onMouseLeave:y,children:[E.jsx("h3",{className:"text-[12px] font-medium text-gray-800 mb-4",children:p.name}),E.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[E.jsxs("div",{className:"flex items-center gap-1 text-gray-600",children:[E.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:E.jsx("path",{d:"M12 .25a.75.75 0 0 1 .673.418l3.058 6.197 6.839.994a.75.75 0 0 1 .415 1.279l-4.948 4.823 1.168 6.811a.75.75 0 0 1-1.088.791L12 18.347l-6.117 3.216a.75.75 0 0 1-1.088-.79l1.168-6.812-4.948-4.823a.75.75 0 0 1 .416-1.28l6.838-.993L11.327.668A.75.75 0 0 1 12 .25z"})}),E.jsx("span",{children:v(p.github_stars||0)})]}),E.jsxs("button",{className:`px-2 py-1 bg-blue-500 text-white rounded-md
|
||
hover:bg-blue-600 transition-colors text-[10px] flex items-center gap-1`,onClick:()=>{const m=t$(p.name);m&&(m.connect(p.from_index,m,p.to_index),Wr.trackEvent({event_type:"node_add_to_canvas",message_type:"node",message_id:s.message_id,data:{node_name:p.name}}))},children:[E.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:E.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add to Canvas"]})]})]},p.name))})]}),f.length>0&&E.jsxs("div",{className:`space-y-3 ${c.length>0?"mt-4":""}`,children:[E.jsx("p",{className:"text-xs font-medium",children:"Uninstalled nodes:"}),E.jsx("div",{className:"grid grid-cols-2 gap-3",children:f.map(p=>E.jsxs("div",{className:`w-full p-3 rounded-lg border border-gray-200
|
||
hover:shadow-sm transition-all duration-200 relative group`,onMouseEnter:()=>g(p),onMouseLeave:y,children:[E.jsx("h3",{className:"text-[12px] font-medium text-gray-800 mb-4",children:p.name}),E.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[E.jsxs("div",{className:"flex items-center gap-1 text-gray-600",children:[E.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:E.jsx("path",{d:"M12 .25a.75.75 0 0 1 .673.418l3.058 6.197 6.839.994a.75.75 0 0 1 .415 1.279l-4.948 4.823 1.168 6.811a.75.75 0 0 1-1.088.791L12 18.347l-6.117 3.216a.75.75 0 0 1-1.088-.79l1.168-6.812-4.948-4.823a.75.75 0 0 1 .416-1.28l6.838-.993L11.327.668A.75.75 0 0 1 12 .25z"})}),E.jsx("span",{children:v(p.github_stars||0)})]}),p.github_url?E.jsxs("a",{href:p.github_url,target:"_blank",rel:"noopener noreferrer",className:`px-2 py-1 text-gray-900 rounded-md
|
||
border border-gray-900 hover:bg-gray-100
|
||
transition-colors text-[10px] flex items-center gap-1`,onClick:()=>{Wr.trackEvent({event_type:"node_download",message_type:"node",message_id:s.message_id,data:{node_name:p.name,github_url:p.github_url}})},children:[E.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:E.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download"]}):E.jsxs("a",{href:`https://www.google.com/search?q=${encodeURIComponent(p.name+" comfyui custom node")}`,target:"_blank",rel:"noopener noreferrer",className:`px-2 py-1 bg-gray-100 text-gray-500 rounded-md
|
||
border border-gray-300 text-[10px] flex items-center gap-1`,onClick:()=>{Wr.trackEvent({event_type:"node_search",message_type:"node",message_id:s.message_id,data:{node_name:p.name}})},children:[E.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:E.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 21h7a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v11m0 5l4.879-4.879m0 0a3 3 0 104.243-4.242 3 3 0 00-4.243 4.242z"})}),"Search on Google"]})]})]},p.name))})]}),o&&l?.description&&E.jsxs("div",{className:`fixed -translate-y-full z-[9999] w-64 p-2
|
||
bg-gray-800 text-white text-xs rounded-md shadow-lg mb-2`,style:{left:"calc(var(--mouse-x, 0) + 16px)",top:"calc(var(--mouse-y, 0) - 8px)"},children:[l.description,E.jsx("div",{className:`absolute -bottom-1 left-1/2 -translate-x-1/2
|
||
border-4 border-transparent border-t-gray-800`})]})]})}const rce=Object.freeze(Object.defineProperty({__proto__:null,NodeSearch:OO},Symbol.toStringTag,{value:"Module"}));/**
|
||
* vis-data
|
||
* http://visjs.org/
|
||
*
|
||
* Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
|
||
*
|
||
* @version 7.1.9
|
||
* @date 2023-11-24T17:53:34.179Z
|
||
*
|
||
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
||
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
||
*
|
||
* @license
|
||
* vis.js is dual licensed under both
|
||
*
|
||
* 1. The Apache 2.0 License
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* and
|
||
*
|
||
* 2. The MIT License
|
||
* http://opensource.org/licenses/MIT
|
||
*
|
||
* vis.js may be distributed under either license.
|
||
*/function jl(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var Kh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function L(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var r$={exports:{}},oa=function(i){return i&&i.Math===Math&&i},pe=oa(typeof globalThis=="object"&&globalThis)||oa(typeof window=="object"&&window)||oa(typeof self=="object"&&self)||oa(typeof Kh=="object"&&Kh)||function(){return this}()||Kh||Function("return this")(),ie=function(i){try{return!!i()}catch{return!0}},IO=ie,io=!IO(function(){var i=function(){}.bind();return typeof i!="function"||i.hasOwnProperty("prototype")}),xO=io,i$=Function.prototype,tp=i$.apply,rp=i$.call,Kn=typeof Reflect=="object"&&Reflect.apply||(xO?rp.bind(tp):function(){return rp.apply(tp,arguments)}),n$=io,s$=Function.prototype,su=s$.call,PO=n$&&s$.bind.bind(su,su),de=n$?PO:function(i){return function(){return su.apply(i,arguments)}},o$=de,CO=o$({}.toString),DO=o$("".slice),ii=function(i){return DO(CO(i),8,-1)},AO=ii,NO=de,a$=function(i){if(AO(i)==="Function")return NO(i)},ou=typeof document=="object"&&document.all,RO=typeof ou>"u"&&ou!==void 0,l$={all:ou,IS_HTMLDDA:RO},h$=l$,kO=h$.all,Ee=h$.IS_HTMLDDA?function(i){return typeof i=="function"||i===kO}:function(i){return typeof i=="function"},Bi={},MO=ie,Ve=!MO(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),FO=io,aa=Function.prototype.call,We=FO?aa.bind(aa):function(){return aa.apply(aa,arguments)},Ll={},d$={}.propertyIsEnumerable,c$=Object.getOwnPropertyDescriptor,BO=c$&&!d$.call({1:2},1);Ll.f=BO?function(e){var t=c$(this,e);return!!t&&t.enumerable}:d$;var ji=function(i,e){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:e}},jO=de,LO=ie,zO=ii,Gh=Object,HO=jO("".split),zl=LO(function(){return!Gh("z").propertyIsEnumerable(0)})?function(i){return zO(i)==="String"?HO(i,""):Gh(i)}:Gh,Gn=function(i){return i==null},VO=Gn,WO=TypeError,gf=function(i){if(VO(i))throw new WO("Can't call method on "+i);return i},UO=zl,KO=gf,sr=function(i){return UO(KO(i))},ip=Ee,u$=l$,GO=u$.all,Ge=u$.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:ip(i)||i===GO}:function(i){return typeof i=="object"?i!==null:ip(i)},ge={},qh=ge,Yh=pe,qO=Ee,np=function(i){return qO(i)?i:void 0},at=function(i,e){return arguments.length<2?np(qh[i])||np(Yh[i]):qh[i]&&qh[i][e]||Yh[i]&&Yh[i][e]},YO=de,Re=YO({}.isPrototypeOf),ni=typeof navigator<"u"&&String(navigator.userAgent)||"",f$=pe,Xh=ni,sp=f$.process,op=f$.Deno,ap=sp&&sp.versions||op&&op.version,lp=ap&&ap.v8,Mt,ul;lp&&(Mt=lp.split("."),ul=Mt[0]>0&&Mt[0]<4?1:+(Mt[0]+Mt[1]));!ul&&Xh&&(Mt=Xh.match(/Edge\/(\d+)/),(!Mt||Mt[1]>=74)&&(Mt=Xh.match(/Chrome\/(\d+)/),Mt&&(ul=+Mt[1])));var qn=ul,hp=qn,XO=ie,JO=pe,ZO=JO.String,Yn=!!Object.getOwnPropertySymbols&&!XO(function(){var i=Symbol("symbol detection");return!ZO(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&hp&&hp<41}),QO=Yn,v$=QO&&!Symbol.sham&&typeof Symbol.iterator=="symbol",eI=at,tI=Ee,rI=Re,iI=v$,nI=Object,no=iI?function(i){return typeof i=="symbol"}:function(i){var e=eI("Symbol");return tI(e)&&rI(e.prototype,nI(i))},sI=String,Xn=function(i){try{return sI(i)}catch{return"Object"}},oI=Ee,aI=Xn,lI=TypeError,mt=function(i){if(oI(i))return i;throw new lI(aI(i)+" is not a function")},hI=mt,dI=Gn,yf=function(i,e){var t=i[e];return dI(t)?void 0:hI(t)},Jh=We,Zh=Ee,Qh=Ge,cI=TypeError,uI=function(i,e){var t,r;if(e==="string"&&Zh(t=i.toString)&&!Qh(r=Jh(t,i))||Zh(t=i.valueOf)&&!Qh(r=Jh(t,i))||e!=="string"&&Zh(t=i.toString)&&!Qh(r=Jh(t,i)))return r;throw new cI("Can't convert object to primitive value")},p$={exports:{}},fI=!0,dp=pe,vI=Object.defineProperty,pI=function(i,e){try{vI(dp,i,{value:e,configurable:!0,writable:!0})}catch{dp[i]=e}return e},gI=pe,yI=pI,cp="__core-js_shared__",mI=gI[cp]||yI(cp,{}),mf=mI,up=mf;(p$.exports=function(i,e){return up[i]||(up[i]=e!==void 0?e:{})})("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 Jn=p$.exports,bI=gf,$I=Object,bt=function(i){return $I(bI(i))},wI=de,EI=bt,SI=wI({}.hasOwnProperty),ke=Object.hasOwn||function(e,t){return SI(EI(e),t)},_I=de,TI=0,OI=Math.random(),II=_I(1 .toString),Hl=function(i){return"Symbol("+(i===void 0?"":i)+")_"+II(++TI+OI,36)},xI=pe,PI=Jn,fp=ke,CI=Hl,DI=Yn,AI=v$,vn=xI.Symbol,ed=PI("wks"),NI=AI?vn.for||vn:vn&&vn.withoutSetter||CI,ye=function(i){return fp(ed,i)||(ed[i]=DI&&fp(vn,i)?vn[i]:NI("Symbol."+i)),ed[i]},RI=We,vp=Ge,pp=no,kI=yf,MI=uI,FI=ye,BI=TypeError,jI=FI("toPrimitive"),LI=function(i,e){if(!vp(i)||pp(i))return i;var t=kI(i,jI),r;if(t){if(e===void 0&&(e="default"),r=RI(t,i,e),!vp(r)||pp(r))return r;throw new BI("Can't convert object to primitive value")}return e===void 0&&(e="number"),MI(i,e)},zI=LI,HI=no,Vl=function(i){var e=zI(i,"string");return HI(e)?e:e+""},VI=pe,gp=Ge,au=VI.document,WI=gp(au)&&gp(au.createElement),bf=function(i){return WI?au.createElement(i):{}},UI=Ve,KI=ie,GI=bf,g$=!UI&&!KI(function(){return Object.defineProperty(GI("div"),"a",{get:function(){return 7}}).a!==7}),qI=Ve,YI=We,XI=Ll,JI=ji,ZI=sr,QI=Vl,ex=ke,tx=g$,yp=Object.getOwnPropertyDescriptor;Bi.f=qI?yp:function(e,t){if(e=ZI(e),t=QI(t),tx)try{return yp(e,t)}catch{}if(ex(e,t))return JI(!YI(XI.f,e,t),e[t])};var rx=ie,ix=Ee,nx=/#|\.prototype\./,so=function(i,e){var t=ox[sx(i)];return t===lx?!0:t===ax?!1:ix(e)?rx(e):!!e},sx=so.normalize=function(i){return String(i).replace(nx,".").toLowerCase()},ox=so.data={},ax=so.NATIVE="N",lx=so.POLYFILL="P",y$=so,mp=a$,hx=mt,dx=io,cx=mp(mp.bind),si=function(i,e){return hx(i),e===void 0?i:dx?cx(i,e):function(){return i.apply(e,arguments)}},$t={},ux=Ve,fx=ie,m$=ux&&fx(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),vx=Ge,px=String,gx=TypeError,St=function(i){if(vx(i))return i;throw new gx(px(i)+" is not an object")},yx=Ve,mx=g$,bx=m$,la=St,bp=Vl,$x=TypeError,td=Object.defineProperty,wx=Object.getOwnPropertyDescriptor,rd="enumerable",id="configurable",nd="writable";$t.f=yx?bx?function(e,t,r){if(la(e),t=bp(t),la(r),typeof e=="function"&&t==="prototype"&&"value"in r&&nd in r&&!r[nd]){var n=wx(e,t);n&&n[nd]&&(e[t]=r.value,r={configurable:id in r?r[id]:n[id],enumerable:rd in r?r[rd]:n[rd],writable:!1})}return td(e,t,r)}:td:function(e,t,r){if(la(e),t=bp(t),la(r),mx)try{return td(e,t,r)}catch{}if("get"in r||"set"in r)throw new $x("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Ex=Ve,Sx=$t,_x=ji,Tr=Ex?function(i,e,t){return Sx.f(i,e,_x(1,t))}:function(i,e,t){return i[e]=t,i},ha=pe,Tx=Kn,Ox=a$,Ix=Ee,xx=Bi.f,Px=y$,Qi=ge,Cx=si,en=Tr,$p=ke,Dx=function(i){var e=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new i;case 1:return new i(t);case 2:return new i(t,r)}return new i(t,r,n)}return Tx(i,this,arguments)};return e.prototype=i.prototype,e},F=function(i,e){var t=i.target,r=i.global,n=i.stat,s=i.proto,o=r?ha:n?ha[t]:(ha[t]||{}).prototype,a=r?Qi:Qi[t]||en(Qi,t,{})[t],l=a.prototype,h,d,u,c,f,v,g,y,p;for(c in e)h=Px(r?c:t+(n?".":"#")+c,i.forced),d=!h&&o&&$p(o,c),v=a[c],d&&(i.dontCallGetSet?(p=xx(o,c),g=p&&p.value):g=o[c]),f=d&&g?g:e[c],!(d&&typeof v==typeof f)&&(i.bind&&d?y=Cx(f,ha):i.wrap&&d?y=Dx(f):s&&Ix(f)?y=Ox(f):y=f,(i.sham||f&&f.sham||v&&v.sham)&&en(y,"sham",!0),en(a,c,y),s&&(u=t+"Prototype",$p(Qi,u)||en(Qi,u,{}),en(Qi[u],c,f),i.real&&l&&(h||!l[c])&&en(l,c,f)))},Ax=F,Nx=Ve,wp=$t.f;Ax({target:"Object",stat:!0,forced:Object.defineProperty!==wp,sham:!Nx},{defineProperty:wp});var Rx=ge,b$=Rx.Object,kx=r$.exports=function(e,t,r){return b$.defineProperty(e,t,r)};b$.defineProperty.sham&&(kx.sham=!0);var Mx=r$.exports,Fx=Mx,$$=Fx,Bx=$$,jx=Bx,Lx=jx,zx=Lx,w$=zx,Wl=L(w$),Hx=ii,oi=Array.isArray||function(e){return Hx(e)==="Array"},Vx=Math.ceil,Wx=Math.floor,Ux=Math.trunc||function(e){var t=+e;return(t>0?Wx:Vx)(t)},Kx=Ux,Ul=function(i){var e=+i;return e!==e||e===0?0:Kx(e)},Gx=Ul,qx=Math.min,Yx=function(i){return i>0?qx(Gx(i),9007199254740991):0},Xx=Yx,_t=function(i){return Xx(i.length)},Jx=TypeError,Zx=9007199254740991,Kl=function(i){if(i>Zx)throw Jx("Maximum allowed index exceeded");return i},Qx=Vl,eP=$t,tP=ji,Zn=function(i,e,t){var r=Qx(e);r in i?eP.f(i,r,tP(0,t)):i[r]=t},rP=ye,iP=rP("toStringTag"),E$={};E$[iP]="z";var $f=String(E$)==="[object z]",nP=$f,sP=Ee,qa=ii,oP=ye,aP=oP("toStringTag"),lP=Object,hP=qa(function(){return arguments}())==="Arguments",dP=function(i,e){try{return i[e]}catch{}},Or=nP?qa:function(i){var e,t,r;return i===void 0?"Undefined":i===null?"Null":typeof(t=dP(e=lP(i),aP))=="string"?t:hP?qa(e):(r=qa(e))==="Object"&&sP(e.callee)?"Arguments":r},cP=de,uP=Ee,lu=mf,fP=cP(Function.toString);uP(lu.inspectSource)||(lu.inspectSource=function(i){return fP(i)});var S$=lu.inspectSource,vP=de,pP=ie,_$=Ee,gP=Or,yP=at,mP=S$,T$=function(){},bP=[],O$=yP("Reflect","construct"),wf=/^\s*(?:class|function)\b/,$P=vP(wf.exec),wP=!wf.test(T$),ys=function(e){if(!_$(e))return!1;try{return O$(T$,bP,e),!0}catch{return!1}},I$=function(e){if(!_$(e))return!1;switch(gP(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return wP||!!$P(wf,mP(e))}catch{return!0}};I$.sham=!0;var Gl=!O$||pP(function(){var i;return ys(ys.call)||!ys(Object)||!ys(function(){i=!0})||i})?I$:ys,Ep=oi,EP=Gl,SP=Ge,_P=ye,TP=_P("species"),Sp=Array,OP=function(i){var e;return Ep(i)&&(e=i.constructor,EP(e)&&(e===Sp||Ep(e.prototype))?e=void 0:SP(e)&&(e=e[TP],e===null&&(e=void 0))),e===void 0?Sp:e},IP=OP,ql=function(i,e){return new(IP(i))(e===0?0:e)},xP=ie,PP=ye,CP=qn,DP=PP("species"),oo=function(i){return CP>=51||!xP(function(){var e=[],t=e.constructor={};return t[DP]=function(){return{foo:1}},e[i](Boolean).foo!==1})},AP=F,NP=ie,RP=oi,kP=Ge,MP=bt,FP=_t,_p=Kl,Tp=Zn,BP=ql,jP=oo,LP=ye,zP=qn,x$=LP("isConcatSpreadable"),HP=zP>=51||!NP(function(){var i=[];return i[x$]=!1,i.concat()[0]!==i}),VP=function(i){if(!kP(i))return!1;var e=i[x$];return e!==void 0?!!e:RP(i)},WP=!HP||!jP("concat");AP({target:"Array",proto:!0,forced:WP},{concat:function(e){var t=MP(this),r=BP(t,0),n=0,s,o,a,l,h;for(s=-1,a=arguments.length;s<a;s++)if(h=s===-1?t:arguments[s],VP(h))for(l=FP(h),_p(n+l),o=0;o<l;o++,n++)o in h&&Tp(r,n,h[o]);else _p(n+1),Tp(r,n++,h);return r.length=n,r}});var UP=Or,KP=String,Li=function(i){if(UP(i)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return KP(i)},Yl={},GP=Ul,qP=Math.max,YP=Math.min,Xl=function(i,e){var t=GP(i);return t<0?qP(t+e,0):YP(t,e)},XP=sr,JP=Xl,ZP=_t,QP=function(i){return function(e,t,r){var n=XP(e),s=ZP(n),o=JP(r,s),a;if(i&&t!==t){for(;s>o;)if(a=n[o++],a!==a)return!0}else for(;s>o;o++)if((i||o in n)&&n[o]===t)return i||o||0;return!i&&-1}},eC={indexOf:QP(!1)},ao={},tC=de,sd=ke,rC=sr,iC=eC.indexOf,nC=ao,Op=tC([].push),P$=function(i,e){var t=rC(i),r=0,n=[],s;for(s in t)!sd(nC,s)&&sd(t,s)&&Op(n,s);for(;e.length>r;)sd(t,s=e[r++])&&(~iC(n,s)||Op(n,s));return n},Ef=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],sC=P$,oC=Ef,Jl=Object.keys||function(e){return sC(e,oC)},aC=Ve,lC=m$,hC=$t,dC=St,cC=sr,uC=Jl;Yl.f=aC&&!lC?Object.defineProperties:function(e,t){dC(e);for(var r=cC(t),n=uC(t),s=n.length,o=0,a;s>o;)hC.f(e,a=n[o++],r[a]);return e};var fC=at,C$=fC("document","documentElement"),vC=Jn,pC=Hl,Ip=vC("keys"),Zl=function(i){return Ip[i]||(Ip[i]=pC(i))},gC=St,yC=Yl,xp=Ef,mC=ao,bC=C$,$C=bf,wC=Zl,Pp=">",Cp="<",hu="prototype",du="script",D$=wC("IE_PROTO"),od=function(){},A$=function(i){return Cp+du+Pp+i+Cp+"/"+du+Pp},Dp=function(i){i.write(A$("")),i.close();var e=i.parentWindow.Object;return i=null,e},EC=function(){var i=$C("iframe"),e="java"+du+":",t;return i.style.display="none",bC.appendChild(i),i.src=String(e),t=i.contentWindow.document,t.open(),t.write(A$("document.F=Object")),t.close(),t.F},da,Ya=function(){try{da=new ActiveXObject("htmlfile")}catch{}Ya=typeof document<"u"?document.domain&&da?Dp(da):EC():Dp(da);for(var i=xp.length;i--;)delete Ya[hu][xp[i]];return Ya()};mC[D$]=!0;var zi=Object.create||function(e,t){var r;return e!==null?(od[hu]=gC(e),r=new od,od[hu]=null,r[D$]=e):r=Ya(),t===void 0?r:yC.f(r,t)},lo={},SC=P$,_C=Ef,TC=_C.concat("length","prototype");lo.f=Object.getOwnPropertyNames||function(e){return SC(e,TC)};var Sf={},Ap=Xl,OC=_t,IC=Zn,xC=Array,PC=Math.max,N$=function(i,e,t){for(var r=OC(i),n=Ap(e,r),s=Ap(t===void 0?r:t,r),o=xC(PC(s-n,0)),a=0;n<s;n++,a++)IC(o,a,i[n]);return o.length=a,o},CC=ii,DC=sr,R$=lo.f,AC=N$,k$=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],NC=function(i){try{return R$(i)}catch{return AC(k$)}};Sf.f=function(e){return k$&&CC(e)==="Window"?NC(e):R$(DC(e))};var ho={};ho.f=Object.getOwnPropertySymbols;var RC=Tr,Qn=function(i,e,t,r){return r&&r.enumerable?i[e]=t:RC(i,e,t),i},kC=$t,_f=function(i,e,t){return kC.f(i,e,t)},co={},MC=ye;co.f=MC;var Np=ge,FC=ke,BC=co,jC=$t.f,Se=function(i){var e=Np.Symbol||(Np.Symbol={});FC(e,i)||jC(e,i,{value:BC.f(i)})},LC=We,zC=at,HC=ye,VC=Qn,M$=function(){var i=zC("Symbol"),e=i&&i.prototype,t=e&&e.valueOf,r=HC("toPrimitive");e&&!e[r]&&VC(e,r,function(n){return LC(t,this)},{})},WC=$f,UC=Or,KC=WC?{}.toString:function(){return"[object "+UC(this)+"]"},GC=$f,qC=$t.f,YC=Tr,XC=ke,JC=KC,ZC=ye,Rp=ZC("toStringTag"),Hi=function(i,e,t,r){if(i){var n=t?i:i.prototype;XC(n,Rp)||qC(n,Rp,{configurable:!0,value:e}),r&&!GC&&YC(n,"toString",JC)}},QC=pe,e2=Ee,kp=QC.WeakMap,t2=e2(kp)&&/native code/.test(String(kp)),r2=t2,F$=pe,i2=Ge,n2=Tr,ad=ke,ld=mf,s2=Zl,o2=ao,Mp="Object already initialized",cu=F$.TypeError,a2=F$.WeakMap,fl,js,vl,l2=function(i){return vl(i)?js(i):fl(i,{})},h2=function(i){return function(e){var t;if(!i2(e)||(t=js(e)).type!==i)throw new cu("Incompatible receiver, "+i+" required");return t}};if(r2||ld.state){var qt=ld.state||(ld.state=new a2);qt.get=qt.get,qt.has=qt.has,qt.set=qt.set,fl=function(i,e){if(qt.has(i))throw new cu(Mp);return e.facade=i,qt.set(i,e),e},js=function(i){return qt.get(i)||{}},vl=function(i){return qt.has(i)}}else{var tn=s2("state");o2[tn]=!0,fl=function(i,e){if(ad(i,tn))throw new cu(Mp);return e.facade=i,n2(i,tn,e),e},js=function(i){return ad(i,tn)?i[tn]:{}},vl=function(i){return ad(i,tn)}}var es={set:fl,get:js,has:vl,enforce:l2,getterFor:h2},d2=si,c2=de,u2=zl,f2=bt,v2=_t,p2=ql,Fp=c2([].push),ca=function(i){var e=i===1,t=i===2,r=i===3,n=i===4,s=i===6,o=i===7,a=i===5||s;return function(l,h,d,u){for(var c=f2(l),f=u2(c),v=d2(h,d),g=v2(f),y=0,p=u||p2,m=e?p(l,g):t||o?p(l,0):void 0,w,$;g>y;y++)if((a||y in f)&&(w=f[y],$=v(w,y,c),i))if(e)m[y]=$;else if($)switch(i){case 3:return!0;case 5:return w;case 6:return y;case 2:Fp(m,w)}else switch(i){case 4:return!1;case 7:Fp(m,w)}return s?-1:r||n?n:m}},ts={forEach:ca(0),map:ca(1),filter:ca(2),some:ca(3)},Ql=F,uo=pe,Tf=We,g2=de,Dn=Ve,An=Yn,y2=ie,ze=ke,m2=Re,uu=St,eh=sr,Of=Vl,b2=Li,fu=ji,Ls=zi,B$=Jl,$2=lo,j$=Sf,w2=ho,L$=Bi,z$=$t,E2=Yl,H$=Ll,Bp=Qn,S2=_f,If=Jn,_2=Zl,V$=ao,jp=Hl,T2=ye,O2=co,I2=Se,x2=M$,P2=Hi,W$=es,th=ts.forEach,ut=_2("hidden"),rh="Symbol",zs="prototype",C2=W$.set,Lp=W$.getterFor(rh),Lt=Object[zs],bi=uo.Symbol,Ts=bi&&bi[zs],D2=uo.RangeError,A2=uo.TypeError,hd=uo.QObject,U$=L$.f,$i=z$.f,K$=j$.f,N2=H$.f,G$=g2([].push),wr=If("symbols"),fo=If("op-symbols"),R2=If("wks"),vu=!hd||!hd[zs]||!hd[zs].findChild,q$=function(i,e,t){var r=U$(Lt,e);r&&delete Lt[e],$i(i,e,t),r&&i!==Lt&&$i(Lt,e,r)},pu=Dn&&y2(function(){return Ls($i({},"a",{get:function(){return $i(this,"a",{value:7}).a}})).a!==7})?q$:$i,dd=function(i,e){var t=wr[i]=Ls(Ts);return C2(t,{type:rh,tag:i,description:e}),Dn||(t.description=e),t},ih=function(e,t,r){e===Lt&&ih(fo,t,r),uu(e);var n=Of(t);return uu(r),ze(wr,n)?(r.enumerable?(ze(e,ut)&&e[ut][n]&&(e[ut][n]=!1),r=Ls(r,{enumerable:fu(0,!1)})):(ze(e,ut)||$i(e,ut,fu(1,{})),e[ut][n]=!0),pu(e,n,r)):$i(e,n,r)},xf=function(e,t){uu(e);var r=eh(t),n=B$(r).concat(Z$(r));return th(n,function(s){(!Dn||Tf(Y$,r,s))&&ih(e,s,r[s])}),e},k2=function(e,t){return t===void 0?Ls(e):xf(Ls(e),t)},Y$=function(e){var t=Of(e),r=Tf(N2,this,t);return this===Lt&&ze(wr,t)&&!ze(fo,t)?!1:r||!ze(this,t)||!ze(wr,t)||ze(this,ut)&&this[ut][t]?r:!0},X$=function(e,t){var r=eh(e),n=Of(t);if(!(r===Lt&&ze(wr,n)&&!ze(fo,n))){var s=U$(r,n);return s&&ze(wr,n)&&!(ze(r,ut)&&r[ut][n])&&(s.enumerable=!0),s}},J$=function(e){var t=K$(eh(e)),r=[];return th(t,function(n){!ze(wr,n)&&!ze(V$,n)&&G$(r,n)}),r},Z$=function(i){var e=i===Lt,t=K$(e?fo:eh(i)),r=[];return th(t,function(n){ze(wr,n)&&(!e||ze(Lt,n))&&G$(r,wr[n])}),r};An||(bi=function(){if(m2(Ts,this))throw new A2("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:b2(arguments[0]),t=jp(e),r=function(n){var s=this===void 0?uo:this;s===Lt&&Tf(r,fo,n),ze(s,ut)&&ze(s[ut],t)&&(s[ut][t]=!1);var o=fu(1,n);try{pu(s,t,o)}catch(a){if(!(a instanceof D2))throw a;q$(s,t,o)}};return Dn&&vu&&pu(Lt,t,{configurable:!0,set:r}),dd(t,e)},Ts=bi[zs],Bp(Ts,"toString",function(){return Lp(this).tag}),Bp(bi,"withoutSetter",function(i){return dd(jp(i),i)}),H$.f=Y$,z$.f=ih,E2.f=xf,L$.f=X$,$2.f=j$.f=J$,w2.f=Z$,O2.f=function(i){return dd(T2(i),i)},Dn&&S2(Ts,"description",{configurable:!0,get:function(){return Lp(this).description}}));Ql({global:!0,wrap:!0,forced:!An,sham:!An},{Symbol:bi});th(B$(R2),function(i){I2(i)});Ql({target:rh,stat:!0,forced:!An},{useSetter:function(){vu=!0},useSimple:function(){vu=!1}});Ql({target:"Object",stat:!0,forced:!An,sham:!Dn},{create:k2,defineProperty:ih,defineProperties:xf,getOwnPropertyDescriptor:X$});Ql({target:"Object",stat:!0,forced:!An},{getOwnPropertyNames:J$});x2();P2(bi,rh);V$[ut]=!0;var M2=Yn,Q$=M2&&!!Symbol.for&&!!Symbol.keyFor,F2=F,B2=at,j2=ke,L2=Li,e0=Jn,z2=Q$,cd=e0("string-to-symbol-registry"),H2=e0("symbol-to-string-registry");F2({target:"Symbol",stat:!0,forced:!z2},{for:function(i){var e=L2(i);if(j2(cd,e))return cd[e];var t=B2("Symbol")(e);return cd[e]=t,H2[t]=e,t}});var V2=F,W2=ke,U2=no,K2=Xn,G2=Jn,q2=Q$,zp=G2("symbol-to-string-registry");V2({target:"Symbol",stat:!0,forced:!q2},{keyFor:function(e){if(!U2(e))throw new TypeError(K2(e)+" is not a symbol");if(W2(zp,e))return zp[e]}});var Y2=de,vo=Y2([].slice),X2=de,Hp=oi,J2=Ee,Vp=ii,Z2=Li,Wp=X2([].push),Q2=function(i){if(J2(i))return i;if(Hp(i)){for(var e=i.length,t=[],r=0;r<e;r++){var n=i[r];typeof n=="string"?Wp(t,n):(typeof n=="number"||Vp(n)==="Number"||Vp(n)==="String")&&Wp(t,Z2(n))}var s=t.length,o=!0;return function(a,l){if(o)return o=!1,l;if(Hp(this))return l;for(var h=0;h<s;h++)if(t[h]===a)return l}}},eD=F,t0=at,r0=Kn,tD=We,po=de,i0=ie,Up=Ee,Kp=no,n0=vo,rD=Q2,iD=Yn,nD=String,Ur=t0("JSON","stringify"),ua=po(/./.exec),Gp=po("".charAt),sD=po("".charCodeAt),oD=po("".replace),aD=po(1 .toString),lD=/[\uD800-\uDFFF]/g,qp=/^[\uD800-\uDBFF]$/,Yp=/^[\uDC00-\uDFFF]$/,Xp=!iD||i0(function(){var i=t0("Symbol")("stringify detection");return Ur([i])!=="[null]"||Ur({a:i})!=="{}"||Ur(Object(i))!=="{}"}),Jp=i0(function(){return Ur("\uDF06\uD834")!=='"\\udf06\\ud834"'||Ur("\uDEAD")!=='"\\udead"'}),hD=function(i,e){var t=n0(arguments),r=rD(e);if(!(!Up(r)&&(i===void 0||Kp(i))))return t[1]=function(n,s){if(Up(r)&&(s=tD(r,this,nD(n),s)),!Kp(s))return s},r0(Ur,null,t)},dD=function(i,e,t){var r=Gp(t,e-1),n=Gp(t,e+1);return ua(qp,i)&&!ua(Yp,n)||ua(Yp,i)&&!ua(qp,r)?"\\u"+aD(sD(i,0),16):i};Ur&&eD({target:"JSON",stat:!0,forced:Xp||Jp},{stringify:function(e,t,r){var n=n0(arguments),s=r0(Xp?hD:Ur,null,n);return Jp&&typeof s=="string"?oD(s,lD,dD):s}});var cD=F,uD=Yn,fD=ie,s0=ho,vD=bt,pD=!uD||fD(function(){s0.f(1)});cD({target:"Object",stat:!0,forced:pD},{getOwnPropertySymbols:function(e){var t=s0.f;return t?t(vD(e)):[]}});var gD=Se;gD("asyncIterator");var yD=Se;yD("hasInstance");var mD=Se;mD("isConcatSpreadable");var bD=Se;bD("iterator");var $D=Se;$D("match");var wD=Se;wD("matchAll");var ED=Se;ED("replace");var SD=Se;SD("search");var _D=Se;_D("species");var TD=Se;TD("split");var OD=Se,ID=M$;OD("toPrimitive");ID();var xD=at,PD=Se,CD=Hi;PD("toStringTag");CD(xD("Symbol"),"Symbol");var DD=Se;DD("unscopables");var AD=pe,ND=Hi;ND(AD.JSON,"JSON",!0);var RD=ge,kD=RD.Symbol,rs={},gu=Ve,MD=ke,o0=Function.prototype,FD=gu&&Object.getOwnPropertyDescriptor,a0=MD(o0,"name"),BD=a0&&function(){}.name==="something";a0&&(!gu||gu&&FD(o0,"name").configurable);var jD={PROPER:BD},LD=ie,l0=!LD(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype}),zD=ke,HD=Ee,VD=bt,WD=Zl,UD=l0,Zp=WD("IE_PROTO"),yu=Object,KD=yu.prototype,nh=UD?yu.getPrototypeOf:function(i){var e=VD(i);if(zD(e,Zp))return e[Zp];var t=e.constructor;return HD(t)&&e instanceof t?t.prototype:e instanceof yu?KD:null},GD=ie,qD=Ee,YD=Ge,XD=zi,Qp=nh,JD=Qn,ZD=ye,mu=ZD("iterator"),h0=!1,ur,ud,fd;[].keys&&(fd=[].keys(),"next"in fd?(ud=Qp(Qp(fd)),ud!==Object.prototype&&(ur=ud)):h0=!0);var QD=!YD(ur)||GD(function(){var i={};return ur[mu].call(i)!==i});QD?ur={}:ur=XD(ur);qD(ur[mu])||JD(ur,mu,function(){return this});var d0={IteratorPrototype:ur,BUGGY_SAFARI_ITERATORS:h0},eA=d0.IteratorPrototype,tA=zi,rA=ji,iA=Hi,nA=rs,sA=function(){return this},oA=function(i,e,t,r){var n=e+" Iterator";return i.prototype=tA(eA,{next:rA(+!r,t)}),iA(i,n,!1,!0),nA[n]=sA,i},aA=de,lA=mt,hA=function(i,e,t){try{return aA(lA(Object.getOwnPropertyDescriptor(i,e)[t]))}catch{}},dA=Ee,cA=String,uA=TypeError,fA=function(i){if(typeof i=="object"||dA(i))return i;throw new uA("Can't set "+cA(i)+" as a prototype")},vA=hA,pA=St,gA=fA,c0=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,e={},t;try{t=vA(Object.prototype,"__proto__","set"),t(e,[]),i=e instanceof Array}catch{}return function(n,s){return pA(n),gA(s),i?t(n,s):n.__proto__=s,n}}():void 0),yA=F,mA=We,bA=jD,$A=oA,wA=nh,EA=Hi,eg=Qn,SA=ye,tg=rs,_A=d0,TA=bA.PROPER,fa=_A.BUGGY_SAFARI_ITERATORS,vd=SA("iterator"),rg="keys",va="values",ig="entries",OA=function(){return this},Pf=function(i,e,t,r,n,s,o){$A(t,e,r);var a=function(p){if(p===n&&c)return c;if(!fa&&p&&p in d)return d[p];switch(p){case rg:return function(){return new t(this,p)};case va:return function(){return new t(this,p)};case ig:return function(){return new t(this,p)}}return function(){return new t(this)}},l=e+" Iterator",h=!1,d=i.prototype,u=d[vd]||d["@@iterator"]||n&&d[n],c=!fa&&u||a(n),f=e==="Array"&&d.entries||u,v,g,y;if(f&&(v=wA(f.call(new i)),v!==Object.prototype&&v.next&&(EA(v,l,!0,!0),tg[l]=OA)),TA&&n===va&&u&&u.name!==va&&(h=!0,c=function(){return mA(u,this)}),n)if(g={values:a(va),keys:s?c:a(rg),entries:a(ig)},o)for(y in g)(fa||h||!(y in d))&&eg(d,y,g[y]);else yA({target:e,proto:!0,forced:fa||h},g);return o&&d[vd]!==c&&eg(d,vd,c,{}),tg[e]=c,g},Cf=function(i,e){return{value:i,done:e}},IA=sr,ng=rs,u0=es;$t.f;var xA=Pf,pa=Cf,f0="Array Iterator",PA=u0.set,CA=u0.getterFor(f0);xA(Array,"Array",function(i,e){PA(this,{type:f0,target:IA(i),index:0,kind:e})},function(){var i=CA(this),e=i.target,t=i.index++;if(!e||t>=e.length)return i.target=void 0,pa(void 0,!0);switch(i.kind){case"keys":return pa(t,!1);case"values":return pa(e[t],!1)}return pa([t,e[t]],!1)},"values");ng.Arguments=ng.Array;var DA={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},AA=DA,NA=pe,RA=Or,kA=Tr,sg=rs,MA=ye,og=MA("toStringTag");for(var pd in AA){var ag=NA[pd],gd=ag&&ag.prototype;gd&&RA(gd)!==og&&kA(gd,og,pd),sg[pd]=sg.Array}var FA=kD,v0=FA,BA=ye,jA=$t.f,lg=BA("metadata"),hg=Function.prototype;hg[lg]===void 0&&jA(hg,lg,{value:null});var LA=Se;LA("asyncDispose");var zA=Se;zA("dispose");var HA=Se;HA("metadata");var VA=v0,WA=VA,UA=at,KA=de,Df=UA("Symbol"),GA=Df.keyFor,qA=KA(Df.prototype.valueOf),p0=Df.isRegisteredSymbol||function(e){try{return GA(qA(e))!==void 0}catch{return!1}},YA=F,XA=p0;YA({target:"Symbol",stat:!0},{isRegisteredSymbol:XA});var JA=Jn,g0=at,ZA=de,QA=no,eN=ye,pl=g0("Symbol"),dg=pl.isWellKnownSymbol,y0=g0("Object","getOwnPropertyNames"),tN=ZA(pl.prototype.valueOf),cg=JA("wks");for(var yd=0,ug=y0(pl),rN=ug.length;yd<rN;yd++)try{var fg=ug[yd];QA(pl[fg])&&eN(fg)}catch{}var m0=function(e){if(dg&&dg(e))return!0;try{for(var t=tN(e),r=0,n=y0(cg),s=n.length;r<s;r++)if(cg[n[r]]==t)return!0}catch{}return!1},iN=F,nN=m0;iN({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:nN});var sN=Se;sN("matcher");var oN=Se;oN("observable");var aN=F,lN=p0;aN({target:"Symbol",stat:!0},{isRegistered:lN});var hN=F,dN=m0;hN({target:"Symbol",stat:!0,forced:!0},{isWellKnown:dN});var cN=Se;cN("metadataKey");var uN=Se;uN("patternMatch");var fN=Se;fN("replaceAll");var vN=WA,pN=vN,Af=pN,pn=L(Af),Nf=de,gN=Ul,yN=Li,mN=gf,bN=Nf("".charAt),vg=Nf("".charCodeAt),$N=Nf("".slice),wN=function(i){return function(e,t){var r=yN(mN(e)),n=gN(t),s=r.length,o,a;return n<0||n>=s?i?"":void 0:(o=vg(r,n),o<55296||o>56319||n+1===s||(a=vg(r,n+1))<56320||a>57343?i?bN(r,n):o:i?$N(r,n,n+2):(o-55296<<10)+(a-56320)+65536)}},EN={charAt:wN(!0)},SN=EN.charAt,_N=Li,b0=es,TN=Pf,pg=Cf,$0="String Iterator",ON=b0.set,IN=b0.getterFor($0);TN(String,"String",function(i){ON(this,{type:$0,string:_N(i),index:0})},function(){var e=IN(this),t=e.string,r=e.index,n;return r>=t.length?pg(void 0,!0):(n=SN(t,r),e.index+=n.length,pg(n,!1))});var xN=co,PN=xN.f("iterator"),CN=PN,w0=CN,DN=w0,AN=DN,NN=AN,RN=NN,E0=RN,kN=L(E0);function Nn(i){"@babel/helpers - typeof";return Nn=typeof pn=="function"&&typeof kN=="symbol"?function(e){return typeof e}:function(e){return e&&typeof pn=="function"&&e.constructor===pn&&e!==pn.prototype?"symbol":typeof e},Nn(i)}var MN=co,FN=MN.f("toPrimitive"),BN=FN,jN=BN,LN=jN,zN=LN,HN=zN,VN=HN,WN=VN,UN=L(WN);function KN(i,e){if(Nn(i)!=="object"||i===null)return i;var t=i[UN];if(t!==void 0){var r=t.call(i,e);if(Nn(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function S0(i){var e=KN(i,"string");return Nn(e)==="symbol"?e:String(e)}function gg(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Wl(i,S0(r.key),r)}}function sh(i,e,t){return e&&gg(i.prototype,e),t&&gg(i,t),Wl(i,"prototype",{writable:!1}),i}function Kr(i,e,t){return e=S0(e),e in i?Wl(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var _0=de,GN=mt,qN=Ge,YN=ke,yg=vo,XN=io,T0=Function,JN=_0([].concat),ZN=_0([].join),md={},QN=function(i,e,t){if(!YN(md,e)){for(var r=[],n=0;n<e;n++)r[n]="a["+n+"]";md[e]=T0("C,a","return new C("+ZN(r,",")+")")}return md[e](i,t)},O0=XN?T0.bind:function(e){var t=GN(this),r=t.prototype,n=yg(arguments,1),s=function(){var a=JN(n,yg(arguments));return this instanceof s?QN(t,a.length,a):t.apply(e,a)};return qN(r)&&(s.prototype=r),s},eR=F,mg=O0;eR({target:"Function",proto:!0,forced:Function.bind!==mg},{bind:mg});var tR=pe,rR=ge,Je=function(i,e){var t=rR[i+"Prototype"],r=t&&t[e];if(r)return r;var n=tR[i],s=n&&n.prototype;return s&&s[e]},iR=Je,nR=iR("Function","bind"),sR=Re,oR=nR,bd=Function.prototype,aR=function(i){var e=i.bind;return i===bd||sR(bd,i)&&e===bd.bind?oR:e},lR=aR,I0=lR,hR=I0,x0=L(hR),dR=mt,cR=bt,uR=zl,fR=_t,vR=TypeError,pR=function(i){return function(e,t,r,n){dR(t);var s=cR(e),o=uR(s),a=fR(s),l=i?a-1:0,h=i?-1:1;if(r<2)for(;;){if(l in o){n=o[l],l+=h;break}if(l+=h,i?l<0:a<=l)throw new vR("Reduce of empty array with no initial value")}for(;i?l>=0:a>l;l+=h)l in o&&(n=t(n,o[l],l,s));return n}},gR={left:pR(!1)},yR=ie,oh=function(i,e){var t=[][i];return!!t&&yR(function(){t.call(null,e||function(){return 1},1)})},mR=pe,bR=ii,go=bR(mR.process)==="process",$R=F,wR=gR.left,ER=oh,bg=qn,SR=go,_R=!SR&&bg>79&&bg<83,TR=_R||!ER("reduce");$R({target:"Array",proto:!0,forced:TR},{reduce:function(e){var t=arguments.length;return wR(this,e,t,t>1?arguments[1]:void 0)}});var OR=Je,IR=OR("Array","reduce"),xR=Re,PR=IR,$d=Array.prototype,CR=function(i){var e=i.reduce;return i===$d||xR($d,i)&&e===$d.reduce?PR:e},DR=CR,AR=DR,NR=AR,RR=L(NR),kR=F,MR=ts.filter,FR=oo,BR=FR("filter");kR({target:"Array",proto:!0,forced:!BR},{filter:function(e){return MR(this,e,arguments.length>1?arguments[1]:void 0)}});var jR=Je,LR=jR("Array","filter"),zR=Re,HR=LR,wd=Array.prototype,VR=function(i){var e=i.filter;return i===wd||zR(wd,i)&&e===wd.filter?HR:e},WR=VR,UR=WR,KR=UR,gn=L(KR),GR=F,qR=ts.map,YR=oo,XR=YR("map");GR({target:"Array",proto:!0,forced:!XR},{map:function(e){return qR(this,e,arguments.length>1?arguments[1]:void 0)}});var JR=Je,ZR=JR("Array","map"),QR=Re,ek=ZR,Ed=Array.prototype,tk=function(i){var e=i.map;return i===Ed||QR(Ed,i)&&e===Ed.map?ek:e},rk=tk,ik=rk,nk=ik,Ft=L(nk),sk=oi,ok=_t,ak=Kl,lk=si,P0=function(i,e,t,r,n,s,o,a){for(var l=n,h=0,d=o?lk(o,a):!1,u,c;h<r;)h in t&&(u=d?d(t[h],h,e):t[h],s>0&&sk(u)?(c=ok(u),l=P0(i,e,u,c,l,s-1)-1):(ak(l+1),i[l]=u),l++),h++;return l},hk=P0,dk=F,ck=hk,uk=mt,fk=bt,vk=_t,pk=ql;dk({target:"Array",proto:!0},{flatMap:function(e){var t=fk(this),r=vk(t),n;return uk(e),n=pk(t,0),n.length=ck(n,t,t,r,0,1,e,arguments.length>1?arguments[1]:void 0),n}});var gk=Je;gk("Array","flatMap");var yk=We,$g=St,mk=yf,C0=function(i,e,t){var r,n;$g(i);try{if(r=mk(i,"return"),!r){if(e==="throw")throw t;return t}r=yk(r,i)}catch(s){n=!0,r=s}if(e==="throw")throw t;if(n)throw r;return $g(r),t},bk=St,$k=C0,wk=function(i,e,t,r){try{return r?e(bk(t)[0],t[1]):e(t)}catch(n){$k(i,"throw",n)}},Ek=ye,Sk=rs,_k=Ek("iterator"),Tk=Array.prototype,D0=function(i){return i!==void 0&&(Sk.Array===i||Tk[_k]===i)},Ok=Or,wg=yf,Ik=Gn,xk=rs,Pk=ye,Ck=Pk("iterator"),ah=function(i){if(!Ik(i))return wg(i,Ck)||wg(i,"@@iterator")||xk[Ok(i)]},Dk=We,Ak=mt,Nk=St,Rk=Xn,kk=ah,Mk=TypeError,Rf=function(i,e){var t=arguments.length<2?kk(i):e;if(Ak(t))return Nk(Dk(t,i));throw new Mk(Rk(i)+" is not iterable")},Fk=si,Bk=We,jk=bt,Lk=wk,zk=D0,Hk=Gl,Vk=_t,Eg=Zn,Wk=Rf,Uk=ah,Sg=Array,Kk=function(e){var t=jk(e),r=Hk(this),n=arguments.length,s=n>1?arguments[1]:void 0,o=s!==void 0;o&&(s=Fk(s,n>2?arguments[2]:void 0));var a=Uk(t),l=0,h,d,u,c,f,v;if(a&&!(this===Sg&&zk(a)))for(c=Wk(t,a),f=c.next,d=r?new this:[];!(u=Bk(f,c)).done;l++)v=o?Lk(c,s,[u.value,l],!0):u.value,Eg(d,l,v);else for(h=Vk(t),d=r?new this(h):Sg(h);h>l;l++)v=o?s(t[l],l):t[l],Eg(d,l,v);return d.length=l,d},Gk=ye,A0=Gk("iterator"),N0=!1;try{var qk=0,_g={next:function(){return{done:!!qk++}},return:function(){N0=!0}};_g[A0]=function(){return this},Array.from(_g,function(){throw 2})}catch{}var R0=function(i,e){try{if(!e&&!N0)return!1}catch{return!1}var t=!1;try{var r={};r[A0]=function(){return{next:function(){return{done:t=!0}}}},i(r)}catch{}return t},Yk=F,Xk=Kk,Jk=R0,Zk=!Jk(function(i){Array.from(i)});Yk({target:"Array",stat:!0,forced:Zk},{from:Xk});var Qk=ge,eM=Qk.Array.from,tM=eM,k0=tM,rM=k0,kf=L(rM),iM=ah,nM=iM,sM=nM,oM=sM,aM=oM,lM=aM,hM=lM,dM=hM,M0=dM,F0=L(M0),cM=M0,Mf=L(cM),uM=F,fM=oi;uM({target:"Array",stat:!0},{isArray:fM});var vM=ge,pM=vM.Array.isArray,gM=pM,B0=gM,yM=B0,mM=yM,bM=mM,$M=bM,wM=$M,j0=L(wM);function EM(i){if(j0(i))return i}var SM=Ve,_M=oi,TM=TypeError,OM=Object.getOwnPropertyDescriptor,IM=SM&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(i){return i instanceof TypeError}}(),L0=IM?function(i,e){if(_M(i)&&!OM(i,"length").writable)throw new TM("Cannot set read only .length");return i.length=e}:function(i,e){return i.length=e},xM=F,PM=bt,CM=_t,DM=L0,AM=Kl,NM=ie,RM=NM(function(){return[].push.call({length:4294967296},1)!==4294967297}),kM=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(i){return i instanceof TypeError}},MM=RM||!kM();xM({target:"Array",proto:!0,forced:MM},{push:function(e){var t=PM(this),r=CM(t),n=arguments.length;AM(r+n);for(var s=0;s<n;s++)t[r]=arguments[s],r++;return DM(t,r),r}});var FM=Je,BM=FM("Array","push"),jM=Re,LM=BM,Sd=Array.prototype,zM=function(i){var e=i.push;return i===Sd||jM(Sd,i)&&e===Sd.push?LM:e},HM=zM,VM=HM,WM=VM,UM=WM,KM=UM,GM=KM,z0=GM,qM=L(z0);function YM(i,e){var t=i==null?null:typeof pn<"u"&&F0(i)||i["@@iterator"];if(t!=null){var r,n,s,o,a=[],l=!0,h=!1;try{if(s=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=s.call(t)).done)&&(qM(a).call(a,r.value),a.length!==e);l=!0);}catch(d){h=!0,n=d}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(h)throw n}}return a}}var XM=F,Tg=oi,JM=Gl,ZM=Ge,Og=Xl,QM=_t,eF=sr,tF=Zn,rF=ye,iF=oo,nF=vo,sF=iF("slice"),oF=rF("species"),_d=Array,aF=Math.max;XM({target:"Array",proto:!0,forced:!sF},{slice:function(e,t){var r=eF(this),n=QM(r),s=Og(e,n),o=Og(t===void 0?n:t,n),a,l,h;if(Tg(r)&&(a=r.constructor,JM(a)&&(a===_d||Tg(a.prototype))?a=void 0:ZM(a)&&(a=a[oF],a===null&&(a=void 0)),a===_d||a===void 0))return nF(r,s,o);for(l=new(a===void 0?_d:a)(aF(o-s,0)),h=0;s<o;s++,h++)s in r&&tF(l,h,r[s]);return l.length=h,l}});var lF=Je,hF=lF("Array","slice"),dF=Re,cF=hF,Td=Array.prototype,uF=function(i){var e=i.slice;return i===Td||dF(Td,i)&&e===Td.slice?cF:e},fF=uF,H0=fF,vF=H0,pF=vF,gF=pF,yF=gF,V0=yF,mF=L(V0),bF=k0,$F=bF,wF=$F,EF=wF,SF=EF,W0=L(SF);function bu(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}function U0(i,e){var t;if(i){if(typeof i=="string")return bu(i,e);var r=mF(t=Object.prototype.toString.call(i)).call(t,8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return W0(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bu(i,e)}}function _F(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ht(i,e){return EM(i)||YM(i,e)||U0(i,e)||_F()}function TF(i){if(j0(i))return bu(i)}function OF(i){if(typeof pn<"u"&&F0(i)!=null||i["@@iterator"]!=null)return W0(i)}function IF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ft(i){return TF(i)||OF(i)||U0(i)||IF()}var xF=v0,lh=L(xF),PF=Je,CF=PF("Array","concat"),DF=Re,AF=CF,Od=Array.prototype,NF=function(i){var e=i.concat;return i===Od||DF(Od,i)&&e===Od.concat?AF:e},RF=NF,kF=RF,MF=kF,hh=L(MF),FF=H0,dh=L(FF),BF=at,jF=de,LF=lo,zF=ho,HF=St,VF=jF([].concat),Ff=BF("Reflect","ownKeys")||function(e){var t=LF.f(HF(e)),r=zF.f;return r?VF(t,r(e)):t},WF=F,UF=Ff;WF({target:"Reflect",stat:!0},{ownKeys:UF});var KF=ge,GF=KF.Reflect.ownKeys,qF=GF,YF=qF,XF=YF,JF=L(XF),ZF=B0,wt=L(ZF),QF=F,eB=bt,K0=Jl,tB=ie,rB=tB(function(){K0(1)});QF({target:"Object",stat:!0,forced:rB},{keys:function(e){return K0(eB(e))}});var iB=ge,nB=iB.Object.keys,sB=nB,oB=sB,aB=oB,Bf=L(aB),lB=ts.forEach,hB=oh,dB=hB("forEach"),cB=dB?[].forEach:function(e){return lB(this,e,arguments.length>1?arguments[1]:void 0)},uB=F,Ig=cB;uB({target:"Array",proto:!0,forced:[].forEach!==Ig},{forEach:Ig});var fB=Je,vB=fB("Array","forEach"),pB=vB,gB=pB,yB=Or,mB=ke,bB=Re,$B=gB,Id=Array.prototype,wB={DOMTokenList:!0,NodeList:!0},G0=function(i){var e=i.forEach;return i===Id||bB(Id,i)&&e===Id.forEach||mB(wB,yB(i))?$B:e},EB=G0,Pi=L(EB),SB=F,_B=de,TB=oi,OB=_B([].reverse),xg=[1,2];SB({target:"Array",proto:!0,forced:String(xg)===String(xg.reverse())},{reverse:function(){return TB(this)&&(this.length=this.length),OB(this)}});var IB=Je,xB=IB("Array","reverse"),PB=Re,CB=xB,xd=Array.prototype,DB=function(i){var e=i.reverse;return i===xd||PB(xd,i)&&e===xd.reverse?CB:e},AB=DB,q0=AB,NB=q0,RB=L(NB),Pg=Xn,kB=TypeError,Y0=function(i,e){if(!delete i[e])throw new kB("Cannot delete property "+Pg(e)+" of "+Pg(i))},MB=F,FB=bt,BB=Xl,jB=Ul,LB=_t,zB=L0,HB=Kl,VB=ql,WB=Zn,Pd=Y0,UB=oo,KB=UB("splice"),GB=Math.max,qB=Math.min;MB({target:"Array",proto:!0,forced:!KB},{splice:function(e,t){var r=FB(this),n=LB(r),s=BB(e,n),o=arguments.length,a,l,h,d,u,c;for(o===0?a=l=0:o===1?(a=0,l=n-s):(a=o-2,l=qB(GB(jB(t),0),n-s)),HB(n+a-l),h=VB(r,l),d=0;d<l;d++)u=s+d,u in r&&WB(h,d,r[u]);if(h.length=l,a<l){for(d=s;d<n-l;d++)u=d+l,c=d+a,u in r?r[c]=r[u]:Pd(r,c);for(d=n;d>n-l+a;d--)Pd(r,d-1)}else if(a>l)for(d=n-l;d>s;d--)u=d+l-1,c=d+a-1,u in r?r[c]=r[u]:Pd(r,c);for(d=0;d<a;d++)r[d+s]=arguments[d+2];return zB(r,n-l+a),h}});var YB=Je,XB=YB("Array","splice"),JB=Re,ZB=XB,Cd=Array.prototype,QB=function(i){var e=i.splice;return i===Cd||JB(Cd,i)&&e===Cd.splice?ZB:e},ej=QB,tj=ej,rj=tj,X0=L(rj),Cg=Ve,ij=de,nj=We,sj=ie,Dd=Jl,oj=ho,aj=Ll,lj=bt,hj=zl,rn=Object.assign,Dg=Object.defineProperty,dj=ij([].concat),cj=!rn||sj(function(){if(Cg&&rn({b:1},rn(Dg({},"a",{enumerable:!0,get:function(){Dg(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var i={},e={},t=Symbol("assign detection"),r="abcdefghijklmnopqrst";return i[t]=7,r.split("").forEach(function(n){e[n]=n}),rn({},i)[t]!==7||Dd(rn({},e)).join("")!==r})?function(e,t){for(var r=lj(e),n=arguments.length,s=1,o=oj.f,a=aj.f;n>s;)for(var l=hj(arguments[s++]),h=o?dj(Dd(l),o(l)):Dd(l),d=h.length,u=0,c;d>u;)c=h[u++],(!Cg||nj(a,l,c))&&(r[c]=l[c]);return r}:rn,uj=F,Ag=cj;uj({target:"Object",stat:!0,forced:Object.assign!==Ag},{assign:Ag});var fj=ge,vj=fj.Object.assign,pj=vj,gj=pj,yj=gj,mj=L(yj),bj=F,$j=ie,wj=bt,J0=nh,Ej=l0,Sj=$j(function(){J0(1)});bj({target:"Object",stat:!0,forced:Sj,sham:!Ej},{getPrototypeOf:function(e){return J0(wj(e))}});var _j=ge,Tj=_j.Object.getPrototypeOf,Oj=Tj,Ij=Oj,xj=F,Pj=Ve,Cj=zi;xj({target:"Object",stat:!0,sham:!Pj},{create:Cj});var Dj=ge,Aj=Dj.Object,Nj=function(e,t){return Aj.create(e,t)},Rj=Nj,Z0=Rj,kj=Z0,Mj=L(kj),$u=ge,Fj=Kn;$u.JSON||($u.JSON={stringify:JSON.stringify});var Bj=function(e,t,r){return Fj($u.JSON.stringify,null,arguments)},jj=Bj,Lj=jj,zj=Lj,Hj=L(zj),Vj=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",Wj=TypeError,Q0=function(i,e){if(i<e)throw new Wj("Not enough arguments");return i},ew=pe,Uj=Kn,Kj=Ee,Gj=Vj,qj=ni,Yj=vo,Xj=Q0,Jj=ew.Function,Zj=/MSIE .\./.test(qj)||Gj&&function(){var i=ew.Bun.version.split(".");return i.length<3||i[0]==="0"&&(i[1]<3||i[1]==="3"&&i[2]==="0")}(),tw=function(i,e){var t=e?2:1;return Zj?function(r,n){var s=Xj(arguments.length,1)>t,o=Kj(r)?r:Jj(r),a=s?Yj(arguments,t):[],l=s?function(){Uj(o,this,a)}:o;return e?i(l,n):i(l)}:i},Qj=F,rw=pe,e3=tw,Ng=e3(rw.setInterval,!0);Qj({global:!0,bind:!0,forced:rw.setInterval!==Ng},{setInterval:Ng});var t3=F,iw=pe,r3=tw,Rg=r3(iw.setTimeout,!0);t3({global:!0,bind:!0,forced:iw.setTimeout!==Rg},{setTimeout:Rg});var i3=ge,n3=i3.setTimeout,s3=n3,o3=L(s3),nw={exports:{}};(function(i){function e(r){if(r)return t(r);this._callbacks=new Map}function t(r){return Object.assign(r,e.prototype),r._callbacks=new Map,r}e.prototype.on=function(r,n){const s=this._callbacks.get(r)??[];return s.push(n),this._callbacks.set(r,s),this},e.prototype.once=function(r,n){const s=(...o)=>{this.off(r,s),n.apply(this,o)};return s.fn=n,this.on(r,s),this},e.prototype.off=function(r,n){if(r===void 0&&n===void 0)return this._callbacks.clear(),this;if(n===void 0)return this._callbacks.delete(r),this;const s=this._callbacks.get(r);if(s){for(const[o,a]of s.entries())if(a===n||a.fn===n){s.splice(o,1);break}s.length===0?this._callbacks.delete(r):this._callbacks.set(r,s)}return this},e.prototype.emit=function(r,...n){const s=this._callbacks.get(r);if(s){const o=[...s];for(const a of o)a.apply(this,n)}return this},e.prototype.listeners=function(r){return this._callbacks.get(r)??[]},e.prototype.listenerCount=function(r){if(r)return this.listeners(r).length;let n=0;for(const s of this._callbacks.values())n+=s.length;return n},e.prototype.hasListeners=function(r){return this.listenerCount(r)>0},e.prototype.addEventListener=e.prototype.on,e.prototype.removeListener=e.prototype.off,e.prototype.removeEventListener=e.prototype.off,e.prototype.removeAllListeners=e.prototype.off,i.exports=e})(nw);var a3=nw.exports,l3=L(a3);/*! Hammer.JS - v2.0.17-rc - 2019-12-16
|
||
* http://naver.github.io/egjs
|
||
*
|
||
* Forked By Naver egjs
|
||
* Copyright (c) hammerjs
|
||
* Licensed under the MIT license */function Ht(){return Ht=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Ht.apply(this,arguments)}function At(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}function ga(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}var wu;typeof Object.assign!="function"?wu=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r<arguments.length;r++){var n=arguments[r];if(n!=null)for(var s in n)n.hasOwnProperty(s)&&(t[s]=n[s])}return t}:wu=Object.assign;var Ci=wu,kg=["","webkit","Moz","MS","ms","o"],h3=typeof document>"u"?{style:{}}:document.createElement("div"),d3="function",yn=Math.round,Di=Math.abs,jf=Date.now;function ch(i,e){for(var t,r,n=e[0].toUpperCase()+e.slice(1),s=0;s<kg.length;){if(t=kg[s],r=t?t+n:e,r in i)return r;s++}}var fr;typeof window>"u"?fr={}:fr=window;var sw=ch(h3.style,"touchAction"),ow=sw!==void 0;function c3(){if(!ow)return!1;var i={},e=fr.CSS&&fr.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return i[t]=e?fr.CSS.supports("touch-action",t):!0}),i}var aw="compute",lw="auto",Eu="manipulation",wi="none",Hs="pan-x",Vs="pan-y",ya=c3(),u3=/mobile|tablet|ip(ad|hone|od)|android/i,hw="ontouchstart"in fr,f3=ch(fr,"PointerEvent")!==void 0,v3=hw&&u3.test(navigator.userAgent),yo="touch",p3="pen",Lf="mouse",g3="kinect",y3=25,st=1,Vi=2,De=4,gt=8,gl=1,mo=2,bo=4,$o=8,Rn=16,rr=mo|bo,Ei=$o|Rn,dw=rr|Ei,cw=["x","y"],yl=["clientX","clientY"];function vr(i,e,t){var r;if(i)if(i.forEach)i.forEach(e,t);else if(i.length!==void 0)for(r=0;r<i.length;)e.call(t,i[r],r,i),r++;else for(r in i)i.hasOwnProperty(r)&&e.call(t,i[r],r,i)}function uh(i,e){return typeof i===d3?i.apply(e&&e[0]||void 0,e):i}function gi(i,e){return i.indexOf(e)>-1}function m3(i){if(gi(i,wi))return wi;var e=gi(i,Hs),t=gi(i,Vs);return e&&t?wi:e||t?e?Hs:Vs:gi(i,Eu)?Eu:lw}var uw=function(){function i(t,r){this.manager=t,this.set(r)}var e=i.prototype;return e.set=function(r){r===aw&&(r=this.compute()),ow&&this.manager.element.style&&ya[r]&&(this.manager.element.style[sw]=r),this.actions=r.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var r=[];return vr(this.manager.recognizers,function(n){uh(n.options.enable,[n])&&(r=r.concat(n.getTouchAction()))}),m3(r.join(" "))},e.preventDefaults=function(r){var n=r.srcEvent,s=r.offsetDirection;if(this.manager.session.prevented){n.preventDefault();return}var o=this.actions,a=gi(o,wi)&&!ya[wi],l=gi(o,Vs)&&!ya[Vs],h=gi(o,Hs)&&!ya[Hs];if(a){var d=r.pointers.length===1,u=r.distance<2,c=r.deltaTime<250;if(d&&u&&c)return}if(!(h&&l)&&(a||l&&s&rr||h&&s&Ei))return this.preventSrc(n)},e.preventSrc=function(r){this.manager.session.prevented=!0,r.preventDefault()},i}();function zf(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}function fw(i){var e=i.length;if(e===1)return{x:yn(i[0].clientX),y:yn(i[0].clientY)};for(var t=0,r=0,n=0;n<e;)t+=i[n].clientX,r+=i[n].clientY,n++;return{x:yn(t/e),y:yn(r/e)}}function Mg(i){for(var e=[],t=0;t<i.pointers.length;)e[t]={clientX:yn(i.pointers[t].clientX),clientY:yn(i.pointers[t].clientY)},t++;return{timeStamp:jf(),pointers:e,center:fw(e),deltaX:i.deltaX,deltaY:i.deltaY}}function ml(i,e,t){t||(t=cw);var r=e[t[0]]-i[t[0]],n=e[t[1]]-i[t[1]];return Math.sqrt(r*r+n*n)}function Su(i,e,t){t||(t=cw);var r=e[t[0]]-i[t[0]],n=e[t[1]]-i[t[1]];return Math.atan2(n,r)*180/Math.PI}function vw(i,e){return i===e?gl:Di(i)>=Di(e)?i<0?mo:bo:e<0?$o:Rn}function b3(i,e){var t=e.center,r=i.offsetDelta||{},n=i.prevDelta||{},s=i.prevInput||{};(e.eventType===st||s.eventType===De)&&(n=i.prevDelta={x:s.deltaX||0,y:s.deltaY||0},r=i.offsetDelta={x:t.x,y:t.y}),e.deltaX=n.x+(t.x-r.x),e.deltaY=n.y+(t.y-r.y)}function pw(i,e,t){return{x:e/i||0,y:t/i||0}}function $3(i,e){return ml(e[0],e[1],yl)/ml(i[0],i[1],yl)}function w3(i,e){return Su(e[1],e[0],yl)+Su(i[1],i[0],yl)}function E3(i,e){var t=i.lastInterval||e,r=e.timeStamp-t.timeStamp,n,s,o,a;if(e.eventType!==gt&&(r>y3||t.velocity===void 0)){var l=e.deltaX-t.deltaX,h=e.deltaY-t.deltaY,d=pw(r,l,h);s=d.x,o=d.y,n=Di(d.x)>Di(d.y)?d.x:d.y,a=vw(l,h),i.lastInterval=e}else n=t.velocity,s=t.velocityX,o=t.velocityY,a=t.direction;e.velocity=n,e.velocityX=s,e.velocityY=o,e.direction=a}function S3(i,e){var t=i.session,r=e.pointers,n=r.length;t.firstInput||(t.firstInput=Mg(e)),n>1&&!t.firstMultiple?t.firstMultiple=Mg(e):n===1&&(t.firstMultiple=!1);var s=t.firstInput,o=t.firstMultiple,a=o?o.center:s.center,l=e.center=fw(r);e.timeStamp=jf(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=Su(a,l),e.distance=ml(a,l),b3(t,e),e.offsetDirection=vw(e.deltaX,e.deltaY);var h=pw(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=h.x,e.overallVelocityY=h.y,e.overallVelocity=Di(h.x)>Di(h.y)?h.x:h.y,e.scale=o?$3(o.pointers,r):1,e.rotation=o?w3(o.pointers,r):0,e.maxPointers=t.prevInput?e.pointers.length>t.prevInput.maxPointers?e.pointers.length:t.prevInput.maxPointers:e.pointers.length,E3(t,e);var d=i.element,u=e.srcEvent,c;u.composedPath?c=u.composedPath()[0]:u.path?c=u.path[0]:c=u.target,zf(c,d)&&(d=c),e.target=d}function _3(i,e,t){var r=t.pointers.length,n=t.changedPointers.length,s=e&st&&r-n===0,o=e&(De|gt)&&r-n===0;t.isFirst=!!s,t.isFinal=!!o,s&&(i.session={}),t.eventType=e,S3(i,t),i.emit("hammer.input",t),i.recognize(t),i.session.prevInput=t}function Ws(i){return i.trim().split(/\s+/g)}function Ps(i,e,t){vr(Ws(e),function(r){i.addEventListener(r,t,!1)})}function Cs(i,e,t){vr(Ws(e),function(r){i.removeEventListener(r,t,!1)})}function Fg(i){var e=i.ownerDocument||i;return e.defaultView||e.parentWindow||window}var is=function(){function i(t,r){var n=this;this.manager=t,this.callback=r,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(s){uh(t.options.enable,[t])&&n.handler(s)},this.init()}var e=i.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Ps(this.element,this.evEl,this.domHandler),this.evTarget&&Ps(this.target,this.evTarget,this.domHandler),this.evWin&&Ps(Fg(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Cs(this.element,this.evEl,this.domHandler),this.evTarget&&Cs(this.target,this.evTarget,this.domHandler),this.evWin&&Cs(Fg(this.element),this.evWin,this.domHandler)},i}();function Ai(i,e,t){if(i.indexOf&&!t)return i.indexOf(e);for(var r=0;r<i.length;){if(t&&i[r][t]==e||!t&&i[r]===e)return r;r++}return-1}var T3={pointerdown:st,pointermove:Vi,pointerup:De,pointercancel:gt,pointerout:gt},O3={2:yo,3:p3,4:Lf,5:g3},gw="pointerdown",yw="pointermove pointerup pointercancel";fr.MSPointerEvent&&!fr.PointerEvent&&(gw="MSPointerDown",yw="MSPointerMove MSPointerUp MSPointerCancel");var mw=function(i){At(e,i);function e(){var r,n=e.prototype;return n.evEl=gw,n.evWin=yw,r=i.apply(this,arguments)||this,r.store=r.manager.session.pointerEvents=[],r}var t=e.prototype;return t.handler=function(n){var s=this.store,o=!1,a=n.type.toLowerCase().replace("ms",""),l=T3[a],h=O3[n.pointerType]||n.pointerType,d=h===yo,u=Ai(s,n.pointerId,"pointerId");l&st&&(n.button===0||d)?u<0&&(s.push(n),u=s.length-1):l&(De|gt)&&(o=!0),!(u<0)&&(s[u]=n,this.callback(this.manager,l,{pointers:s,changedPointers:[n],pointerType:h,srcEvent:n}),o&&s.splice(u,1))},e}(is);function Us(i){return Array.prototype.slice.call(i,0)}function Hf(i,e,t){for(var r=[],n=[],s=0;s<i.length;){var o=e?i[s][e]:i[s];Ai(n,o)<0&&r.push(i[s]),n[s]=o,s++}return t&&(e?r=r.sort(function(a,l){return a[e]>l[e]}):r=r.sort()),r}var I3={touchstart:st,touchmove:Vi,touchend:De,touchcancel:gt},x3="touchstart touchmove touchend touchcancel",Vf=function(i){At(e,i);function e(){var r;return e.prototype.evTarget=x3,r=i.apply(this,arguments)||this,r.targetIds={},r}var t=e.prototype;return t.handler=function(n){var s=I3[n.type],o=P3.call(this,n,s);o&&this.callback(this.manager,s,{pointers:o[0],changedPointers:o[1],pointerType:yo,srcEvent:n})},e}(is);function P3(i,e){var t=Us(i.touches),r=this.targetIds;if(e&(st|Vi)&&t.length===1)return r[t[0].identifier]=!0,[t,t];var n,s,o=Us(i.changedTouches),a=[],l=this.target;if(s=t.filter(function(h){return zf(h.target,l)}),e===st)for(n=0;n<s.length;)r[s[n].identifier]=!0,n++;for(n=0;n<o.length;)r[o[n].identifier]&&a.push(o[n]),e&(De|gt)&&delete r[o[n].identifier],n++;if(a.length)return[Hf(s.concat(a),"identifier",!0),a]}var C3={mousedown:st,mousemove:Vi,mouseup:De},D3="mousedown",A3="mousemove mouseup",Wf=function(i){At(e,i);function e(){var r,n=e.prototype;return n.evEl=D3,n.evWin=A3,r=i.apply(this,arguments)||this,r.pressed=!1,r}var t=e.prototype;return t.handler=function(n){var s=C3[n.type];s&st&&n.button===0&&(this.pressed=!0),s&Vi&&n.which!==1&&(s=De),this.pressed&&(s&De&&(this.pressed=!1),this.callback(this.manager,s,{pointers:[n],changedPointers:[n],pointerType:Lf,srcEvent:n}))},e}(is),N3=2500,Bg=25;function jg(i){var e=i.changedPointers,t=e[0];if(t.identifier===this.primaryTouch){var r={x:t.clientX,y:t.clientY},n=this.lastTouches;this.lastTouches.push(r);var s=function(){var a=n.indexOf(r);a>-1&&n.splice(a,1)};setTimeout(s,N3)}}function R3(i,e){i&st?(this.primaryTouch=e.changedPointers[0].identifier,jg.call(this,e)):i&(De|gt)&&jg.call(this,e)}function k3(i){for(var e=i.srcEvent.clientX,t=i.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var n=this.lastTouches[r],s=Math.abs(e-n.x),o=Math.abs(t-n.y);if(s<=Bg&&o<=Bg)return!0}return!1}var bw=function(){var i=function(e){At(t,e);function t(n,s){var o;return o=e.call(this,n,s)||this,o.handler=function(a,l,h){var d=h.pointerType===yo,u=h.pointerType===Lf;if(!(u&&h.sourceCapabilities&&h.sourceCapabilities.firesTouchEvents)){if(d)R3.call(ga(ga(o)),l,h);else if(u&&k3.call(ga(ga(o)),h))return;o.callback(a,l,h)}},o.touch=new Vf(o.manager,o.handler),o.mouse=new Wf(o.manager,o.handler),o.primaryTouch=null,o.lastTouches=[],o}var r=t.prototype;return r.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(is);return i}();function M3(i){var e,t=i.options.inputClass;return t?e=t:f3?e=mw:v3?e=Vf:hw?e=bw:e=Wf,new e(i,_3)}function mn(i,e,t){return Array.isArray(i)?(vr(i,t[e],t),!0):!1}var Xa=1,Ct=2,kn=4,Gr=8,pr=Gr,Ks=16,Qt=32,F3=1;function B3(){return F3++}function ma(i,e){var t=e.manager;return t?t.get(i):i}function Lg(i){return i&Ks?"cancel":i&Gr?"end":i&kn?"move":i&Ct?"start":""}var wo=function(){function i(t){t===void 0&&(t={}),this.options=Ht({enable:!0},t),this.id=B3(),this.manager=null,this.state=Xa,this.simultaneous={},this.requireFail=[]}var e=i.prototype;return e.set=function(r){return Ci(this.options,r),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(r){if(mn(r,"recognizeWith",this))return this;var n=this.simultaneous;return r=ma(r,this),n[r.id]||(n[r.id]=r,r.recognizeWith(this)),this},e.dropRecognizeWith=function(r){return mn(r,"dropRecognizeWith",this)?this:(r=ma(r,this),delete this.simultaneous[r.id],this)},e.requireFailure=function(r){if(mn(r,"requireFailure",this))return this;var n=this.requireFail;return r=ma(r,this),Ai(n,r)===-1&&(n.push(r),r.requireFailure(this)),this},e.dropRequireFailure=function(r){if(mn(r,"dropRequireFailure",this))return this;r=ma(r,this);var n=Ai(this.requireFail,r);return n>-1&&this.requireFail.splice(n,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(r){return!!this.simultaneous[r.id]},e.emit=function(r){var n=this,s=this.state;function o(a){n.manager.emit(a,r)}s<Gr&&o(n.options.event+Lg(s)),o(n.options.event),r.additionalEvent&&o(r.additionalEvent),s>=Gr&&o(n.options.event+Lg(s))},e.tryEmit=function(r){if(this.canEmit())return this.emit(r);this.state=Qt},e.canEmit=function(){for(var r=0;r<this.requireFail.length;){if(!(this.requireFail[r].state&(Qt|Xa)))return!1;r++}return!0},e.recognize=function(r){var n=Ci({},r);if(!uh(this.options.enable,[this,n])){this.reset(),this.state=Qt;return}this.state&(pr|Ks|Qt)&&(this.state=Xa),this.state=this.process(n),this.state&(Ct|kn|Gr|Ks)&&this.tryEmit(n)},e.process=function(r){},e.getTouchAction=function(){},e.reset=function(){},i}(),_u=function(i){At(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Ht({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},r))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var t=e.prototype;return t.getTouchAction=function(){return[Eu]},t.process=function(n){var s=this,o=this.options,a=n.pointers.length===o.pointers,l=n.distance<o.threshold,h=n.deltaTime<o.time;if(this.reset(),n.eventType&st&&this.count===0)return this.failTimeout();if(l&&h&&a){if(n.eventType!==De)return this.failTimeout();var d=this.pTime?n.timeStamp-this.pTime<o.interval:!0,u=!this.pCenter||ml(this.pCenter,n.center)<o.posThreshold;this.pTime=n.timeStamp,this.pCenter=n.center,!u||!d?this.count=1:this.count+=1,this._input=n;var c=this.count%o.taps;if(c===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){s.state=pr,s.tryEmit()},o.interval),Ct):pr}return Qt},t.failTimeout=function(){var n=this;return this._timer=setTimeout(function(){n.state=Qt},this.options.interval),Qt},t.reset=function(){clearTimeout(this._timer)},t.emit=function(){this.state===pr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(wo),Mn=function(i){At(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Ht({pointers:1},r))||this}var t=e.prototype;return t.attrTest=function(n){var s=this.options.pointers;return s===0||n.pointers.length===s},t.process=function(n){var s=this.state,o=n.eventType,a=s&(Ct|kn),l=this.attrTest(n);return a&&(o>||!l)?s|Ks:a||l?o&De?s|Gr:s&Ct?s|kn:Ct:Qt},e}(wo);function $w(i){return i===Rn?"down":i===$o?"up":i===mo?"left":i===bo?"right":""}var Uf=function(i){At(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Ht({event:"pan",threshold:10,pointers:1,direction:dw},r))||this,n.pX=null,n.pY=null,n}var t=e.prototype;return t.getTouchAction=function(){var n=this.options.direction,s=[];return n&rr&&s.push(Vs),n&Ei&&s.push(Hs),s},t.directionTest=function(n){var s=this.options,o=!0,a=n.distance,l=n.direction,h=n.deltaX,d=n.deltaY;return l&s.direction||(s.direction&rr?(l=h===0?gl:h<0?mo:bo,o=h!==this.pX,a=Math.abs(n.deltaX)):(l=d===0?gl:d<0?$o:Rn,o=d!==this.pY,a=Math.abs(n.deltaY))),n.direction=l,o&&a>s.threshold&&l&s.direction},t.attrTest=function(n){return Mn.prototype.attrTest.call(this,n)&&(this.state&Ct||!(this.state&Ct)&&this.directionTest(n))},t.emit=function(n){this.pX=n.deltaX,this.pY=n.deltaY;var s=$w(n.direction);s&&(n.additionalEvent=this.options.event+s),i.prototype.emit.call(this,n)},e}(Mn),ww=function(i){At(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Ht({event:"swipe",threshold:10,velocity:.3,direction:rr|Ei,pointers:1},r))||this}var t=e.prototype;return t.getTouchAction=function(){return Uf.prototype.getTouchAction.call(this)},t.attrTest=function(n){var s=this.options.direction,o;return s&(rr|Ei)?o=n.overallVelocity:s&rr?o=n.overallVelocityX:s&Ei&&(o=n.overallVelocityY),i.prototype.attrTest.call(this,n)&&s&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers===this.options.pointers&&Di(o)>this.options.velocity&&n.eventType&De},t.emit=function(n){var s=$w(n.offsetDirection);s&&this.manager.emit(this.options.event+s,n),this.manager.emit(this.options.event,n)},e}(Mn),Ew=function(i){At(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Ht({event:"pinch",threshold:0,pointers:2},r))||this}var t=e.prototype;return t.getTouchAction=function(){return[wi]},t.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&Ct)},t.emit=function(n){if(n.scale!==1){var s=n.scale<1?"in":"out";n.additionalEvent=this.options.event+s}i.prototype.emit.call(this,n)},e}(Mn),Sw=function(i){At(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Ht({event:"rotate",threshold:0,pointers:2},r))||this}var t=e.prototype;return t.getTouchAction=function(){return[wi]},t.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&Ct)},e}(Mn),_w=function(i){At(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Ht({event:"press",pointers:1,time:251,threshold:9},r))||this,n._timer=null,n._input=null,n}var t=e.prototype;return t.getTouchAction=function(){return[lw]},t.process=function(n){var s=this,o=this.options,a=n.pointers.length===o.pointers,l=n.distance<o.threshold,h=n.deltaTime>o.time;if(this._input=n,!l||!a||n.eventType&(De|gt)&&!h)this.reset();else if(n.eventType&st)this.reset(),this._timer=setTimeout(function(){s.state=pr,s.tryEmit()},o.time);else if(n.eventType&De)return pr;return Qt},t.reset=function(){clearTimeout(this._timer)},t.emit=function(n){this.state===pr&&(n&&n.eventType&De?this.manager.emit(this.options.event+"up",n):(this._input.timeStamp=jf(),this.manager.emit(this.options.event,this._input)))},e}(wo),Tw={domEvents:!1,touchAction:aw,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},zg=[[Sw,{enable:!1}],[Ew,{enable:!1},["rotate"]],[ww,{direction:rr}],[Uf,{direction:rr},["swipe"]],[_u],[_u,{event:"doubletap",taps:2},["tap"]],[_w]],j3=1,Hg=2;function Vg(i,e){var t=i.element;if(t.style){var r;vr(i.options.cssProps,function(n,s){r=ch(t.style,s),e?(i.oldCssProps[r]=t.style[r],t.style[r]=n):t.style[r]=i.oldCssProps[r]||""}),e||(i.oldCssProps={})}}function L3(i,e){var t=document.createEvent("Event");t.initEvent(i,!0,!0),t.gesture=e,e.target.dispatchEvent(t)}var Wg=function(){function i(t,r){var n=this;this.options=Ci({},Tw,r||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=M3(this),this.touchAction=new uw(this,this.options.touchAction),Vg(this,!0),vr(this.options.recognizers,function(s){var o=n.add(new s[0](s[1]));s[2]&&o.recognizeWith(s[2]),s[3]&&o.requireFailure(s[3])},this)}var e=i.prototype;return e.set=function(r){return Ci(this.options,r),r.touchAction&&this.touchAction.update(),r.inputTarget&&(this.input.destroy(),this.input.target=r.inputTarget,this.input.init()),this},e.stop=function(r){this.session.stopped=r?Hg:j3},e.recognize=function(r){var n=this.session;if(!n.stopped){this.touchAction.preventDefaults(r);var s,o=this.recognizers,a=n.curRecognizer;(!a||a&&a.state&pr)&&(n.curRecognizer=null,a=null);for(var l=0;l<o.length;)s=o[l],n.stopped!==Hg&&(!a||s===a||s.canRecognizeWith(a))?s.recognize(r):s.reset(),!a&&s.state&(Ct|kn|Gr)&&(n.curRecognizer=s,a=s),l++}},e.get=function(r){if(r instanceof wo)return r;for(var n=this.recognizers,s=0;s<n.length;s++)if(n[s].options.event===r)return n[s];return null},e.add=function(r){if(mn(r,"add",this))return this;var n=this.get(r.options.event);return n&&this.remove(n),this.recognizers.push(r),r.manager=this,this.touchAction.update(),r},e.remove=function(r){if(mn(r,"remove",this))return this;var n=this.get(r);if(r){var s=this.recognizers,o=Ai(s,n);o!==-1&&(s.splice(o,1),this.touchAction.update())}return this},e.on=function(r,n){if(r===void 0||n===void 0)return this;var s=this.handlers;return vr(Ws(r),function(o){s[o]=s[o]||[],s[o].push(n)}),this},e.off=function(r,n){if(r===void 0)return this;var s=this.handlers;return vr(Ws(r),function(o){n?s[o]&&s[o].splice(Ai(s[o],n),1):delete s[o]}),this},e.emit=function(r,n){this.options.domEvents&&L3(r,n);var s=this.handlers[r]&&this.handlers[r].slice();if(!(!s||!s.length)){n.type=r,n.preventDefault=function(){n.srcEvent.preventDefault()};for(var o=0;o<s.length;)s[o](n),o++}},e.destroy=function(){this.element&&Vg(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},i}(),z3={touchstart:st,touchmove:Vi,touchend:De,touchcancel:gt},H3="touchstart",V3="touchstart touchmove touchend touchcancel",W3=function(i){At(e,i);function e(){var r,n=e.prototype;return n.evTarget=H3,n.evWin=V3,r=i.apply(this,arguments)||this,r.started=!1,r}var t=e.prototype;return t.handler=function(n){var s=z3[n.type];if(s===st&&(this.started=!0),!!this.started){var o=U3.call(this,n,s);s&(De|gt)&&o[0].length-o[1].length===0&&(this.started=!1),this.callback(this.manager,s,{pointers:o[0],changedPointers:o[1],pointerType:yo,srcEvent:n})}},e}(is);function U3(i,e){var t=Us(i.touches),r=Us(i.changedTouches);return e&(De|gt)&&(t=Hf(t.concat(r),"identifier",!0)),[t,r]}function Ow(i,e,t){var r="DEPRECATED METHOD: "+e+`
|
||
`+t+` AT
|
||
`;return function(){var n=new Error("get-stack-trace"),s=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,r,s),i.apply(this,arguments)}}var Iw=Ow(function(i,e,t){for(var r=Object.keys(e),n=0;n<r.length;)(!t||t&&i[r[n]]===void 0)&&(i[r[n]]=e[r[n]]),n++;return i},"extend","Use `assign`."),K3=Ow(function(i,e){return Iw(i,e,!0)},"merge","Use `assign`.");function G3(i,e,t){var r=e.prototype,n;n=i.prototype=Object.create(r),n.constructor=i,n._super=r,t&&Ci(n,t)}function Ug(i,e){return function(){return i.apply(e,arguments)}}var q3=function(){var i=function(t,r){return r===void 0&&(r={}),new Wg(t,Ht({recognizers:zg.concat()},r))};return i.VERSION="2.0.17-rc",i.DIRECTION_ALL=dw,i.DIRECTION_DOWN=Rn,i.DIRECTION_LEFT=mo,i.DIRECTION_RIGHT=bo,i.DIRECTION_UP=$o,i.DIRECTION_HORIZONTAL=rr,i.DIRECTION_VERTICAL=Ei,i.DIRECTION_NONE=gl,i.DIRECTION_DOWN=Rn,i.INPUT_START=st,i.INPUT_MOVE=Vi,i.INPUT_END=De,i.INPUT_CANCEL=gt,i.STATE_POSSIBLE=Xa,i.STATE_BEGAN=Ct,i.STATE_CHANGED=kn,i.STATE_ENDED=Gr,i.STATE_RECOGNIZED=pr,i.STATE_CANCELLED=Ks,i.STATE_FAILED=Qt,i.Manager=Wg,i.Input=is,i.TouchAction=uw,i.TouchInput=Vf,i.MouseInput=Wf,i.PointerEventInput=mw,i.TouchMouseInput=bw,i.SingleTouchInput=W3,i.Recognizer=wo,i.AttrRecognizer=Mn,i.Tap=_u,i.Pan=Uf,i.Swipe=ww,i.Pinch=Ew,i.Rotate=Sw,i.Press=_w,i.on=Ps,i.off=Cs,i.each=vr,i.merge=K3,i.extend=Iw,i.bindFn=Ug,i.assign=Ci,i.inherit=G3,i.bindFn=Ug,i.prefixed=ch,i.toArray=Us,i.inArray=Ai,i.uniqueArray=Hf,i.splitStr=Ws,i.boolOrFn=uh,i.hasParent=zf,i.addEventListeners=Ps,i.removeEventListeners=Cs,i.defaults=Ci({},Tw,{preset:zg}),i}(),Y3=q3;function xw(i,e){var t=typeof lh<"u"&&Mf(i)||i["@@iterator"];if(!t){if(wt(i)||(t=X3(i))||e){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(h){throw h},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){t=t.call(i)},n:function(){var h=t.next();return s=h.done,h},e:function(h){o=!0,a=h},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function X3(i,e){var t;if(i){if(typeof i=="string")return Kg(i,e);var r=dh(t=Object.prototype.toString.call(i)).call(t,8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return kf(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kg(i,e)}}function Kg(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}var Pw=lh("DELETE");function J3(i){for(var e,t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return Cw.apply(void 0,hh(e=[{},i]).call(e,r))}function Cw(){var i=bl.apply(void 0,arguments);return Aw(i),i}function bl(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];if(e.length<2)return e[0];if(e.length>2){var r;return bl.apply(void 0,hh(r=[Cw(e[0],e[1])]).call(r,ft(dh(e).call(e,2))))}var n=e[0],s=e[1];if(n instanceof Date&&s instanceof Date)return n.setTime(s.getTime()),n;var o=xw(JF(s)),a;try{for(o.s();!(a=o.n()).done;){var l=a.value;Object.prototype.propertyIsEnumerable.call(s,l)&&(s[l]===Pw?delete n[l]:n[l]!==null&&s[l]!==null&&typeof n[l]=="object"&&typeof s[l]=="object"&&!wt(n[l])&&!wt(s[l])?n[l]=bl(n[l],s[l]):n[l]=Dw(s[l]))}}catch(h){o.e(h)}finally{o.f()}return n}function Dw(i){return wt(i)?Ft(i).call(i,function(e){return Dw(e)}):typeof i=="object"&&i!==null?i instanceof Date?new Date(i.getTime()):bl({},i):i}function Aw(i){for(var e=0,t=Bf(i);e<t.length;e++){var r=t[e];i[r]===Pw?delete i[r]:typeof i[r]=="object"&&i[r]!==null&&Aw(i[r])}}function Z3(){var i=function(){};return{on:i,off:i,destroy:i,emit:i,get(){return{set:i}}}}var Q3=typeof window<"u"?window.Hammer||Y3:function(){return Z3()};function cr(i){var e=this,t;this._cleanupQueue=[],this.active=!1,this._dom={container:i,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(function(){e._dom.overlay.parentNode.removeChild(e._dom.overlay)});var r=Q3(this._dom.overlay);r.on("tap",x0(t=this._onTapOverlay).call(t,this)),this._cleanupQueue.push(function(){r.destroy()});var n=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];Pi(n).call(n,function(s){r.on(s,function(o){o.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=function(s){eL(s.target,i)||e.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(function(){document.body.removeEventListener("click",e._onClick)})),this._escListener=function(s){("key"in s?s.key==="Escape":s.keyCode===27)&&e.deactivate()}}l3(cr.prototype);cr.current=null;cr.prototype.destroy=function(){var i,e;this.deactivate();var t=xw(RB(i=X0(e=this._cleanupQueue).call(e,0)).call(i)),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;n()}}catch(s){t.e(s)}finally{t.f()}};cr.prototype.activate=function(){cr.current&&cr.current.deactivate(),cr.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)};cr.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")};cr.prototype._onTapOverlay=function(i){this.activate(),i.srcEvent.stopPropagation()};function eL(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}var tL=Gl,rL=Xn,iL=TypeError,Nw=function(i){if(tL(i))return i;throw new iL(rL(i)+" is not a constructor")},nL=F,sL=at,Ad=Kn,oL=O0,Gg=Nw,aL=St,qg=Ge,lL=zi,Rw=ie,Kf=sL("Reflect","construct"),hL=Object.prototype,dL=[].push,kw=Rw(function(){function i(){}return!(Kf(function(){},[],i)instanceof i)}),Mw=!Rw(function(){Kf(function(){})}),Yg=kw||Mw;nL({target:"Reflect",stat:!0,forced:Yg,sham:Yg},{construct:function(e,t){Gg(e),aL(t);var r=arguments.length<3?e:Gg(arguments[2]);if(Mw&&!kw)return Kf(e,t,r);if(e===r){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 n=[null];return Ad(dL,n,t),new(Ad(oL,e,n))}var s=r.prototype,o=lL(qg(s)?s:hL),a=Ad(e,o,t);return qg(a)?a:o}});var cL=ge,uL=cL.Reflect.construct,fL=uL,vL=fL,pL=vL,Ja=L(pL),gL=ge,yL=gL.Object.getOwnPropertySymbols,mL=yL,bL=mL,$L=bL,Xg=L($L),Fw={exports:{}},wL=F,EL=ie,SL=sr,Bw=Bi.f,jw=Ve,_L=!jw||EL(function(){Bw(1)});wL({target:"Object",stat:!0,forced:_L,sham:!jw},{getOwnPropertyDescriptor:function(e,t){return Bw(SL(e),t)}});var TL=ge,Lw=TL.Object,OL=Fw.exports=function(e,t){return Lw.getOwnPropertyDescriptor(e,t)};Lw.getOwnPropertyDescriptor.sham&&(OL.sham=!0);var IL=Fw.exports,xL=IL,PL=xL,CL=PL,zw=L(CL),DL=F,AL=Ve,NL=Ff,RL=sr,kL=Bi,ML=Zn;DL({target:"Object",stat:!0,sham:!AL},{getOwnPropertyDescriptors:function(e){for(var t=RL(e),r=kL.f,n=NL(t),s={},o=0,a,l;n.length>o;)l=r(t,a=n[o++]),l!==void 0&&ML(s,a,l);return s}});var FL=ge,BL=FL.Object.getOwnPropertyDescriptors,jL=BL,LL=jL,zL=LL,Jg=L(zL),Hw={exports:{}},HL=F,VL=Ve,Zg=Yl.f;HL({target:"Object",stat:!0,forced:Object.defineProperties!==Zg,sham:!VL},{defineProperties:Zg});var WL=ge,Vw=WL.Object,UL=Hw.exports=function(e,t){return Vw.defineProperties(e,t)};Vw.defineProperties.sham&&(UL.sham=!0);var KL=Hw.exports,GL=KL,qL=GL,YL=qL,XL=L(YL),JL=$$,ZL=L(JL);function Ww(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}var QL=Z0,e5=QL,t5=e5,r5=t5,Uw=r5,i5=L(Uw),n5=F,s5=c0;n5({target:"Object",stat:!0},{setPrototypeOf:s5});var o5=ge,a5=o5.Object.setPrototypeOf,l5=a5,h5=l5,d5=h5,c5=d5,u5=c5,f5=u5,Kw=f5,Tu=L(Kw),v5=I0,p5=v5,g5=p5,y5=g5,m5=y5,Gw=L(m5);function Ou(i,e){var t;return Ou=Tu?Gw(t=Tu).call(t):function(n,s){return n.__proto__=s,n},Ou(i,e)}function b5(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=i5(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Wl(i,"prototype",{writable:!1}),e&&Ou(i,e)}function $5(i,e){if(e&&(Nn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ww(i)}var w5=Ij,E5=w5,S5=E5,_5=S5,qw=_5,Qg=L(qw);function $l(i){var e;return $l=Tu?Gw(e=Qg).call(e):function(r){return r.__proto__||Qg(r)},$l(i)}var Yw={exports:{}},Xw={exports:{}};(function(i){var e=Af,t=E0;function r(n){"@babel/helpers - typeof";return i.exports=r=typeof e=="function"&&typeof t=="symbol"?function(s){return typeof s}:function(s){return s&&typeof e=="function"&&s.constructor===e&&s!==e.prototype?"symbol":typeof s},i.exports.__esModule=!0,i.exports.default=i.exports,r(n)}i.exports=r,i.exports.__esModule=!0,i.exports.default=i.exports})(Xw);var T5=Xw.exports,O5=G0,I5=O5,x5=I5,P5=x5,C5=P5,ey=ke,D5=Ff,A5=Bi,N5=$t,R5=function(i,e,t){for(var r=D5(e),n=N5.f,s=A5.f,o=0;o<r.length;o++){var a=r[o];!ey(i,a)&&!(t&&ey(t,a))&&n(i,a,s(e,a))}},k5=Ge,M5=Tr,F5=function(i,e){k5(e)&&"cause"in e&&M5(i,"cause",e.cause)},B5=de,Jw=Error,j5=B5("".replace),L5=function(i){return String(new Jw(i).stack)}("zxcasd"),Zw=/\n\s*at [^:]*:[^\n]*/,z5=Zw.test(L5),H5=function(i,e){if(z5&&typeof i=="string"&&!Jw.prepareStackTrace)for(;e--;)i=j5(i,Zw,"");return i},V5=ie,W5=ji,U5=!V5(function(){var i=new Error("a");return"stack"in i?(Object.defineProperty(i,"stack",W5(1,7)),i.stack!==7):!0}),K5=Tr,G5=H5,q5=U5,ty=Error.captureStackTrace,Y5=function(i,e,t,r){q5&&(ty?ty(i,e):K5(i,"stack",G5(t,r)))},X5=si,J5=We,Z5=St,Q5=Xn,ez=D0,tz=_t,ry=Re,rz=Rf,iz=ah,iy=C0,nz=TypeError,Za=function(i,e){this.stopped=i,this.result=e},ny=Za.prototype,Wi=function(i,e,t){var r=t&&t.that,n=!!(t&&t.AS_ENTRIES),s=!!(t&&t.IS_RECORD),o=!!(t&&t.IS_ITERATOR),a=!!(t&&t.INTERRUPTED),l=X5(e,r),h,d,u,c,f,v,g,y=function(m){return h&&iy(h,"normal",m),new Za(!0,m)},p=function(m){return n?(Z5(m),a?l(m[0],m[1],y):l(m[0],m[1])):a?l(m,y):l(m)};if(s)h=i.iterator;else if(o)h=i;else{if(d=iz(i),!d)throw new nz(Q5(i)+" is not iterable");if(ez(d)){for(u=0,c=tz(i);c>u;u++)if(f=p(i[u]),f&&ry(ny,f))return f;return new Za(!1)}h=rz(i,d)}for(v=s?i.next:h.next;!(g=J5(v,h)).done;){try{f=p(g.value)}catch(m){iy(h,"throw",m)}if(typeof f=="object"&&f&&ry(ny,f))return f}return new Za(!1)},sz=Li,oz=function(i,e){return i===void 0?arguments.length<2?"":e:sz(i)},az=F,lz=Re,hz=nh,wl=c0,dz=R5,Qw=zi,Nd=Tr,Rd=ji,cz=F5,uz=Y5,fz=Wi,vz=oz,pz=ye,gz=pz("toStringTag"),El=Error,yz=[].push,Fn=function(e,t){var r=lz(kd,this),n;wl?n=wl(new El,r?hz(this):kd):(n=r?this:Qw(kd),Nd(n,gz,"Error")),t!==void 0&&Nd(n,"message",vz(t)),uz(n,Fn,n.stack,1),arguments.length>2&&cz(n,arguments[2]);var s=[];return fz(e,yz,{that:s}),Nd(n,"errors",s),n};wl?wl(Fn,El):dz(Fn,El,{name:!0});var kd=Fn.prototype=Qw(El.prototype,{constructor:Rd(1,Fn),message:Rd(1,""),name:Rd(1,"AggregateError")});az({global:!0},{AggregateError:Fn});var mz=at,bz=_f,$z=ye,wz=Ve,sy=$z("species"),eE=function(i){var e=mz(i);wz&&e&&!e[sy]&&bz(e,sy,{configurable:!0,get:function(){return this}})},Ez=Re,Sz=TypeError,Gf=function(i,e){if(Ez(e,i))return i;throw new Sz("Incorrect invocation")},oy=St,_z=Nw,Tz=Gn,Oz=ye,Iz=Oz("species"),tE=function(i,e){var t=oy(i).constructor,r;return t===void 0||Tz(r=oy(t)[Iz])?e:_z(r)},xz=ni,rE=/(?:ipad|iphone|ipod).*applewebkit/i.test(xz),Et=pe,Pz=Kn,Cz=si,ay=Ee,Dz=ke,iE=ie,ly=C$,Az=vo,hy=bf,Nz=Q0,Rz=rE,kz=go,Iu=Et.setImmediate,dy=Et.clearImmediate,Mz=Et.process,Md=Et.Dispatch,Fz=Et.Function,cy=Et.MessageChannel,Bz=Et.String,Fd=0,Ds={},uy="onreadystatechange",Gs,fi,Bd,jd;iE(function(){Gs=Et.location});var qf=function(i){if(Dz(Ds,i)){var e=Ds[i];delete Ds[i],e()}},Ld=function(i){return function(){qf(i)}},fy=function(i){qf(i.data)},vy=function(i){Et.postMessage(Bz(i),Gs.protocol+"//"+Gs.host)};(!Iu||!dy)&&(Iu=function(e){Nz(arguments.length,1);var t=ay(e)?e:Fz(e),r=Az(arguments,1);return Ds[++Fd]=function(){Pz(t,void 0,r)},fi(Fd),Fd},dy=function(e){delete Ds[e]},kz?fi=function(i){Mz.nextTick(Ld(i))}:Md&&Md.now?fi=function(i){Md.now(Ld(i))}:cy&&!Rz?(Bd=new cy,jd=Bd.port2,Bd.port1.onmessage=fy,fi=Cz(jd.postMessage,jd)):Et.addEventListener&&ay(Et.postMessage)&&!Et.importScripts&&Gs&&Gs.protocol!=="file:"&&!iE(vy)?(fi=vy,Et.addEventListener("message",fy,!1)):uy in hy("script")?fi=function(i){ly.appendChild(hy("script"))[uy]=function(){ly.removeChild(this),qf(i)}}:fi=function(i){setTimeout(Ld(i),0)});var nE={set:Iu},sE=function(){this.head=null,this.tail=null};sE.prototype={add:function(i){var e={item:i,next:null},t=this.tail;t?t.next=e:this.head=e,this.tail=e},get:function(){var i=this.head;if(i){var e=this.head=i.next;return e===null&&(this.tail=null),i.item}}};var oE=sE,jz=ni,Lz=/ipad|iphone|ipod/i.test(jz)&&typeof Pebble<"u",zz=ni,Hz=/web0s(?!.*chrome)/i.test(zz),Ni=pe,py=si,Vz=Bi.f,zd=nE.set,Wz=oE,Uz=rE,Kz=Lz,Gz=Hz,Hd=go,gy=Ni.MutationObserver||Ni.WebKitMutationObserver,yy=Ni.document,my=Ni.process,ba=Ni.Promise,by=Vz(Ni,"queueMicrotask"),xu=by&&by.value,nn,Vd,Wd,$a,$y;if(!xu){var wa=new Wz,Ea=function(){var i,e;for(Hd&&(i=my.domain)&&i.exit();e=wa.get();)try{e()}catch(t){throw wa.head&&nn(),t}i&&i.enter()};!Uz&&!Hd&&!Gz&&gy&&yy?(Vd=!0,Wd=yy.createTextNode(""),new gy(Ea).observe(Wd,{characterData:!0}),nn=function(){Wd.data=Vd=!Vd}):!Kz&&ba&&ba.resolve?($a=ba.resolve(void 0),$a.constructor=ba,$y=py($a.then,$a),nn=function(){$y(Ea)}):Hd?nn=function(){my.nextTick(Ea)}:(zd=py(zd,Ni),nn=function(){zd(Ea)}),xu=function(i){wa.head||nn(),wa.add(i)}}var qz=xu,Yz=function(i,e){try{arguments.length===1?console.error(i):console.error(i,e)}catch{}},ns=function(i){try{return{error:!1,value:i()}}catch(e){return{error:!0,value:e}}},Xz=pe,ss=Xz.Promise,aE=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",Jz=aE,Zz=go,Qz=!Jz&&!Zz&&typeof window=="object"&&typeof document=="object",e4=pe,As=ss,t4=Ee,r4=y$,i4=S$,n4=ye,s4=Qz,o4=aE,Ud=qn,wy=As&&As.prototype,a4=n4("species"),Ey=!1,lE=t4(e4.PromiseRejectionEvent),l4=r4("Promise",function(){var i=i4(As),e=i!==String(As);if(!e&&Ud===66||!(wy.catch&&wy.finally))return!0;if(!Ud||Ud<51||!/native code/.test(i)){var t=new As(function(s){s(1)}),r=function(s){s(function(){},function(){})},n=t.constructor={};if(n[a4]=r,Ey=t.then(function(){})instanceof r,!Ey)return!0}return!e&&(s4||o4)&&!lE}),Eo={CONSTRUCTOR:l4,REJECTION_EVENT:lE},or={},Sy=mt,h4=TypeError,d4=function(i){var e,t;this.promise=new i(function(r,n){if(e!==void 0||t!==void 0)throw new h4("Bad Promise constructor");e=r,t=n}),this.resolve=Sy(e),this.reject=Sy(t)};or.f=function(i){return new d4(i)};var c4=F,Sl=go,Qr=pe,So=We,u4=Qn,f4=Hi,v4=eE,p4=mt,Pu=Ee,g4=Ge,y4=Gf,m4=tE,hE=nE.set,Yf=qz,b4=Yz,$4=ns,w4=oE,dE=es,Cu=ss,cE=Eo,uE=or,fh="Promise",fE=cE.CONSTRUCTOR,E4=cE.REJECTION_EVENT,Kd=dE.getterFor(fh),S4=dE.set,_4=Cu&&Cu.prototype,bn=Cu,Gd=_4,vE=Qr.TypeError,Du=Qr.document,Xf=Qr.process,Au=uE.f,T4=Au,O4=!!(Du&&Du.createEvent&&Qr.dispatchEvent),pE="unhandledrejection",I4="rejectionhandled",_y=0,gE=1,x4=2,Jf=1,yE=2,Sa,Ty,P4,mE=function(i){var e;return g4(i)&&Pu(e=i.then)?e:!1},bE=function(i,e){var t=e.value,r=e.state===gE,n=r?i.ok:i.fail,s=i.resolve,o=i.reject,a=i.domain,l,h,d;try{n?(r||(e.rejection===yE&&D4(e),e.rejection=Jf),n===!0?l=t:(a&&a.enter(),l=n(t),a&&(a.exit(),d=!0)),l===i.promise?o(new vE("Promise-chain cycle")):(h=mE(l))?So(h,l,s,o):s(l)):o(t)}catch(u){a&&!d&&a.exit(),o(u)}},$E=function(i,e){i.notified||(i.notified=!0,Yf(function(){for(var t=i.reactions,r;r=t.get();)bE(r,i);i.notified=!1,e&&!i.rejection&&C4(i)}))},wE=function(i,e,t){var r,n;O4?(r=Du.createEvent("Event"),r.promise=e,r.reason=t,r.initEvent(i,!1,!0),Qr.dispatchEvent(r)):r={promise:e,reason:t},!E4&&(n=Qr["on"+i])?n(r):i===pE&&b4("Unhandled promise rejection",t)},C4=function(i){So(hE,Qr,function(){var e=i.facade,t=i.value,r=Oy(i),n;if(r&&(n=$4(function(){Sl?Xf.emit("unhandledRejection",t,e):wE(pE,e,t)}),i.rejection=Sl||Oy(i)?yE:Jf,n.error))throw n.value})},Oy=function(i){return i.rejection!==Jf&&!i.parent},D4=function(i){So(hE,Qr,function(){var e=i.facade;Sl?Xf.emit("rejectionHandled",e):wE(I4,e,i.value)})},$n=function(i,e,t){return function(r){i(e,r,t)}},On=function(i,e,t){i.done||(i.done=!0,t&&(i=t),i.value=e,i.state=x4,$E(i,!0))},Nu=function(i,e,t){if(!i.done){i.done=!0,t&&(i=t);try{if(i.facade===e)throw new vE("Promise can't be resolved itself");var r=mE(e);r?Yf(function(){var n={done:!1};try{So(r,e,$n(Nu,n,i),$n(On,n,i))}catch(s){On(n,s,i)}}):(i.value=e,i.state=gE,$E(i,!1))}catch(n){On({done:!1},n,i)}}};fE&&(bn=function(e){y4(this,Gd),p4(e),So(Sa,this);var t=Kd(this);try{e($n(Nu,t),$n(On,t))}catch(r){On(t,r)}},Gd=bn.prototype,Sa=function(e){S4(this,{type:fh,done:!1,notified:!1,parent:!1,reactions:new w4,rejection:!1,state:_y,value:void 0})},Sa.prototype=u4(Gd,"then",function(e,t){var r=Kd(this),n=Au(m4(this,bn));return r.parent=!0,n.ok=Pu(e)?e:!0,n.fail=Pu(t)&&t,n.domain=Sl?Xf.domain:void 0,r.state===_y?r.reactions.add(n):Yf(function(){bE(n,r)}),n.promise}),Ty=function(){var i=new Sa,e=Kd(i);this.promise=i,this.resolve=$n(Nu,e),this.reject=$n(On,e)},uE.f=Au=function(i){return i===bn||i===P4?new Ty(i):T4(i)});c4({global:!0,wrap:!0,forced:fE},{Promise:bn});f4(bn,fh,!1,!0);v4(fh);var A4=ss,N4=R0,R4=Eo.CONSTRUCTOR,vh=R4||!N4(function(i){A4.all(i).then(void 0,function(){})}),k4=F,M4=We,F4=mt,B4=or,j4=ns,L4=Wi,z4=vh;k4({target:"Promise",stat:!0,forced:z4},{all:function(e){var t=this,r=B4.f(t),n=r.resolve,s=r.reject,o=j4(function(){var a=F4(t.resolve),l=[],h=0,d=1;L4(e,function(u){var c=h++,f=!1;d++,M4(a,t,u).then(function(v){f||(f=!0,l[c]=v,--d||n(l))},s)}),--d||n(l)});return o.error&&s(o.value),r.promise}});var H4=F,V4=Eo.CONSTRUCTOR,Iy=ss;Iy&&Iy.prototype;H4({target:"Promise",proto:!0,forced:V4,real:!0},{catch:function(i){return this.then(void 0,i)}});var W4=F,U4=We,K4=mt,G4=or,q4=ns,Y4=Wi,X4=vh;W4({target:"Promise",stat:!0,forced:X4},{race:function(e){var t=this,r=G4.f(t),n=r.reject,s=q4(function(){var o=K4(t.resolve);Y4(e,function(a){U4(o,t,a).then(r.resolve,n)})});return s.error&&n(s.value),r.promise}});var J4=F,Z4=We,Q4=or,e6=Eo.CONSTRUCTOR;J4({target:"Promise",stat:!0,forced:e6},{reject:function(e){var t=Q4.f(this);return Z4(t.reject,void 0,e),t.promise}});var t6=St,r6=Ge,i6=or,EE=function(i,e){if(t6(i),r6(e)&&e.constructor===i)return e;var t=i6.f(i),r=t.resolve;return r(e),t.promise},n6=F,s6=at,o6=fI,a6=ss,l6=Eo.CONSTRUCTOR,h6=EE,d6=s6("Promise"),c6=!l6;n6({target:"Promise",stat:!0,forced:o6},{resolve:function(e){return h6(c6&&this===d6?a6:this,e)}});var u6=F,f6=We,v6=mt,p6=or,g6=ns,y6=Wi,m6=vh;u6({target:"Promise",stat:!0,forced:m6},{allSettled:function(e){var t=this,r=p6.f(t),n=r.resolve,s=r.reject,o=g6(function(){var a=v6(t.resolve),l=[],h=0,d=1;y6(e,function(u){var c=h++,f=!1;d++,f6(a,t,u).then(function(v){f||(f=!0,l[c]={status:"fulfilled",value:v},--d||n(l))},function(v){f||(f=!0,l[c]={status:"rejected",reason:v},--d||n(l))})}),--d||n(l)});return o.error&&s(o.value),r.promise}});var b6=F,$6=We,w6=mt,E6=at,S6=or,_6=ns,T6=Wi,O6=vh,xy="No one promise resolved";b6({target:"Promise",stat:!0,forced:O6},{any:function(e){var t=this,r=E6("AggregateError"),n=S6.f(t),s=n.resolve,o=n.reject,a=_6(function(){var l=w6(t.resolve),h=[],d=0,u=1,c=!1;T6(e,function(f){var v=d++,g=!1;u++,$6(l,t,f).then(function(y){g||c||(c=!0,s(y))},function(y){g||c||(g=!0,h[v]=y,--u||o(new r(h,xy)))})}),--u||o(new r(h,xy))});return a.error&&o(a.value),n.promise}});var I6=F,Ru=ss,x6=ie,P6=at,C6=Ee,D6=tE,Py=EE,A6=Ru&&Ru.prototype,N6=!!Ru&&x6(function(){A6.finally.call({then:function(){}},function(){})});I6({target:"Promise",proto:!0,real:!0,forced:N6},{finally:function(i){var e=D6(this,P6("Promise")),t=C6(i);return this.then(t?function(r){return Py(e,i()).then(function(){return r})}:i,t?function(r){return Py(e,i()).then(function(){throw r})}:i)}});var R6=ge,k6=R6.Promise,M6=k6,F6=M6,B6=F,j6=or;B6({target:"Promise",stat:!0},{withResolvers:function(){var e=j6.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}});var L6=F6,z6=L6,H6=F,V6=or,W6=ns;H6({target:"Promise",stat:!0,forced:!0},{try:function(i){var e=V6.f(this),t=W6(i);return(t.error?e.reject:e.resolve)(t.value),e.promise}});var U6=z6,K6=U6,G6=K6,q6=q0,Y6=q6,X6=Y6,J6=X6,Z6=J6;(function(i){var e=T5.default,t=w$,r=Af,n=Uw,s=qw,o=C5,a=z0,l=Kw,h=G6,d=Z6,u=V0;function c(){i.exports=c=function(){return v},i.exports.__esModule=!0,i.exports.default=i.exports;var f,v={},g=Object.prototype,y=g.hasOwnProperty,p=t||function(D,I,P){D[I]=P.value},m=typeof r=="function"?r:{},w=m.iterator||"@@iterator",$=m.asyncIterator||"@@asyncIterator",x=m.toStringTag||"@@toStringTag";function _(D,I,P){return t(D,I,{value:P,enumerable:!0,configurable:!0,writable:!0}),D[I]}try{_({},"")}catch{_=function(P,M,W){return P[M]=W}}function A(D,I,P,M){var W=I&&I.prototype instanceof Fe?I:Fe,H=n(W.prototype),Oe=new zh(M||[]);return p(H,"_invoke",{value:jh(D,P,Oe)}),H}function R(D,I,P){try{return{type:"normal",arg:D.call(I,P)}}catch(M){return{type:"throw",arg:M}}}v.wrap=A;var B="suspendedStart",G="suspendedYield",q="executing",ce="completed",ue={};function Fe(){}function Q(){}function K(){}var Z={};_(Z,w,function(){return this});var se=s,Ce=se&&se(se(Hh([])));Ce&&Ce!==g&&y.call(Ce,w)&&(Z=Ce);var je=K.prototype=Fe.prototype=n(Z);function hr(D){var I;o(I=["next","throw","return"]).call(I,function(P){_(D,P,function(M){return this._invoke(P,M)})})}function Gt(D,I){function P(W,H,Oe,Qe){var lt=R(D[W],D,H);if(lt.type!=="throw"){var di=lt.arg,Pr=di.value;return Pr&&e(Pr)=="object"&&y.call(Pr,"__await")?I.resolve(Pr.__await).then(function(ci){P("next",ci,Oe,Qe)},function(ci){P("throw",ci,Oe,Qe)}):I.resolve(Pr).then(function(ci){di.value=ci,Oe(di)},function(ci){return P("throw",ci,Oe,Qe)})}Qe(lt.arg)}var M;p(this,"_invoke",{value:function(H,Oe){function Qe(){return new I(function(lt,di){P(H,Oe,lt,di)})}return M=M?M.then(Qe,Qe):Qe()}})}function jh(D,I,P){var M=B;return function(W,H){if(M===q)throw new Error("Generator is already running");if(M===ce){if(W==="throw")throw H;return{value:f,done:!0}}for(P.method=W,P.arg=H;;){var Oe=P.delegate;if(Oe){var Qe=Vv(Oe,P);if(Qe){if(Qe===ue)continue;return Qe}}if(P.method==="next")P.sent=P._sent=P.arg;else if(P.method==="throw"){if(M===B)throw M=ce,P.arg;P.dispatchException(P.arg)}else P.method==="return"&&P.abrupt("return",P.arg);M=q;var lt=R(D,I,P);if(lt.type==="normal"){if(M=P.done?ce:G,lt.arg===ue)continue;return{value:lt.arg,done:P.done}}lt.type==="throw"&&(M=ce,P.method="throw",P.arg=lt.arg)}}}function Vv(D,I){var P=I.method,M=D.iterator[P];if(M===f)return I.delegate=null,P==="throw"&&D.iterator.return&&(I.method="return",I.arg=f,Vv(D,I),I.method==="throw")||P!=="return"&&(I.method="throw",I.arg=new TypeError("The iterator does not provide a '"+P+"' method")),ue;var W=R(M,D.iterator,I.arg);if(W.type==="throw")return I.method="throw",I.arg=W.arg,I.delegate=null,ue;var H=W.arg;return H?H.done?(I[D.resultName]=H.value,I.next=D.nextLoc,I.method!=="return"&&(I.method="next",I.arg=f),I.delegate=null,ue):H:(I.method="throw",I.arg=new TypeError("iterator result is not an object"),I.delegate=null,ue)}function BT(D){var I,P={tryLoc:D[0]};1 in D&&(P.catchLoc=D[1]),2 in D&&(P.finallyLoc=D[2],P.afterLoc=D[3]),a(I=this.tryEntries).call(I,P)}function Lh(D){var I=D.completion||{};I.type="normal",delete I.arg,D.completion=I}function zh(D){this.tryEntries=[{tryLoc:"root"}],o(D).call(D,BT,this),this.reset(!0)}function Hh(D){if(D||D===""){var I=D[w];if(I)return I.call(D);if(typeof D.next=="function")return D;if(!isNaN(D.length)){var P=-1,M=function W(){for(;++P<D.length;)if(y.call(D,P))return W.value=D[P],W.done=!1,W;return W.value=f,W.done=!0,W};return M.next=M}}throw new TypeError(e(D)+" is not iterable")}return Q.prototype=K,p(je,"constructor",{value:K,configurable:!0}),p(K,"constructor",{value:Q,configurable:!0}),Q.displayName=_(K,x,"GeneratorFunction"),v.isGeneratorFunction=function(D){var I=typeof D=="function"&&D.constructor;return!!I&&(I===Q||(I.displayName||I.name)==="GeneratorFunction")},v.mark=function(D){return l?l(D,K):(D.__proto__=K,_(D,x,"GeneratorFunction")),D.prototype=n(je),D},v.awrap=function(D){return{__await:D}},hr(Gt.prototype),_(Gt.prototype,$,function(){return this}),v.AsyncIterator=Gt,v.async=function(D,I,P,M,W){W===void 0&&(W=h);var H=new Gt(A(D,I,P,M),W);return v.isGeneratorFunction(I)?H:H.next().then(function(Oe){return Oe.done?Oe.value:H.next()})},hr(je),_(je,x,"Generator"),_(je,w,function(){return this}),_(je,"toString",function(){return"[object Generator]"}),v.keys=function(D){var I=Object(D),P=[];for(var M in I)a(P).call(P,M);return d(P).call(P),function W(){for(;P.length;){var H=P.pop();if(H in I)return W.value=H,W.done=!1,W}return W.done=!0,W}},v.values=Hh,zh.prototype={constructor:zh,reset:function(I){var P;if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,o(P=this.tryEntries).call(P,Lh),!I)for(var M in this)M.charAt(0)==="t"&&y.call(this,M)&&!isNaN(+u(M).call(M,1))&&(this[M]=f)},stop:function(){this.done=!0;var I=this.tryEntries[0].completion;if(I.type==="throw")throw I.arg;return this.rval},dispatchException:function(I){if(this.done)throw I;var P=this;function M(di,Pr){return Oe.type="throw",Oe.arg=I,P.next=di,Pr&&(P.method="next",P.arg=f),!!Pr}for(var W=this.tryEntries.length-1;W>=0;--W){var H=this.tryEntries[W],Oe=H.completion;if(H.tryLoc==="root")return M("end");if(H.tryLoc<=this.prev){var Qe=y.call(H,"catchLoc"),lt=y.call(H,"finallyLoc");if(Qe&<){if(this.prev<H.catchLoc)return M(H.catchLoc,!0);if(this.prev<H.finallyLoc)return M(H.finallyLoc)}else if(Qe){if(this.prev<H.catchLoc)return M(H.catchLoc,!0)}else{if(!lt)throw new Error("try statement without catch or finally");if(this.prev<H.finallyLoc)return M(H.finallyLoc)}}}},abrupt:function(I,P){for(var M=this.tryEntries.length-1;M>=0;--M){var W=this.tryEntries[M];if(W.tryLoc<=this.prev&&y.call(W,"finallyLoc")&&this.prev<W.finallyLoc){var H=W;break}}H&&(I==="break"||I==="continue")&&H.tryLoc<=P&&P<=H.finallyLoc&&(H=null);var Oe=H?H.completion:{};return Oe.type=I,Oe.arg=P,H?(this.method="next",this.next=H.finallyLoc,ue):this.complete(Oe)},complete:function(I,P){if(I.type==="throw")throw I.arg;return I.type==="break"||I.type==="continue"?this.next=I.arg:I.type==="return"?(this.rval=this.arg=I.arg,this.method="return",this.next="end"):I.type==="normal"&&P&&(this.next=P),ue},finish:function(I){for(var P=this.tryEntries.length-1;P>=0;--P){var M=this.tryEntries[P];if(M.finallyLoc===I)return this.complete(M.completion,M.afterLoc),Lh(M),ue}},catch:function(I){for(var P=this.tryEntries.length-1;P>=0;--P){var M=this.tryEntries[P];if(M.tryLoc===I){var W=M.completion;if(W.type==="throw"){var H=W.arg;Lh(M)}return H}}throw new Error("illegal catch attempt")},delegateYield:function(I,P,M){return this.delegate={iterator:Hh(I),resultName:P,nextLoc:M},this.method==="next"&&(this.arg=f),ue}},v}i.exports=c,i.exports.__esModule=!0,i.exports.default=i.exports})(Yw);var Q6=Yw.exports,Qa=Q6(),eH=Qa;try{regeneratorRuntime=Qa}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Qa:Function("r","regeneratorRuntime = r")(Qa)}var dt=L(eH),SE={exports:{}},tH=ie,rH=tH(function(){if(typeof ArrayBuffer=="function"){var i=new ArrayBuffer(8);Object.isExtensible(i)&&Object.defineProperty(i,"a",{value:8})}}),iH=ie,nH=Ge,sH=ii,Cy=rH,el=Object.isExtensible,oH=iH(function(){el(1)}),aH=oH||Cy?function(e){return!nH(e)||Cy&&sH(e)==="ArrayBuffer"?!1:el?el(e):!0}:el,lH=ie,hH=!lH(function(){return Object.isExtensible(Object.preventExtensions({}))}),dH=F,cH=de,uH=ao,fH=Ge,Zf=ke,vH=$t.f,Dy=lo,pH=Sf,Qf=aH,gH=Hl,yH=hH,_E=!1,Er=gH("meta"),mH=0,ev=function(i){vH(i,Er,{value:{objectID:"O"+mH++,weakData:{}}})},bH=function(i,e){if(!fH(i))return typeof i=="symbol"?i:(typeof i=="string"?"S":"P")+i;if(!Zf(i,Er)){if(!Qf(i))return"F";if(!e)return"E";ev(i)}return i[Er].objectID},$H=function(i,e){if(!Zf(i,Er)){if(!Qf(i))return!0;if(!e)return!1;ev(i)}return i[Er].weakData},wH=function(i){return yH&&_E&&Qf(i)&&!Zf(i,Er)&&ev(i),i},EH=function(){SH.enable=function(){},_E=!0;var i=Dy.f,e=cH([].splice),t={};t[Er]=1,i(t).length&&(Dy.f=function(r){for(var n=i(r),s=0,o=n.length;s<o;s++)if(n[s]===Er){e(n,s,1);break}return n},dH({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:pH.f}))},SH=SE.exports={enable:EH,fastKey:bH,getWeakData:$H,onFreeze:wH};uH[Er]=!0;var TE=SE.exports,_H=F,TH=pe,OH=TE,IH=ie,xH=Tr,PH=Wi,CH=Gf,DH=Ee,AH=Ge,NH=Gn,RH=Hi,kH=$t.f,MH=ts.forEach,FH=Ve,OE=es,BH=OE.set,jH=OE.getterFor,IE=function(i,e,t){var r=i.indexOf("Map")!==-1,n=i.indexOf("Weak")!==-1,s=r?"set":"add",o=TH[i],a=o&&o.prototype,l={},h;if(!FH||!DH(o)||!(n||a.forEach&&!IH(function(){new o().entries().next()})))h=t.getConstructor(e,i,r,s),OH.enable();else{h=e(function(c,f){BH(CH(c,d),{type:i,collection:new o}),NH(f)||PH(f,c[s],{that:c,AS_ENTRIES:r})});var d=h.prototype,u=jH(i);MH(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(c){var f=c==="add"||c==="set";c in a&&!(n&&c==="clear")&&xH(d,c,function(v,g){var y=u(this).collection;if(!f&&n&&!AH(v))return c==="get"?void 0:!1;var p=y[c](v===0?0:v,g);return f?this:p})}),n||kH(d,"size",{configurable:!0,get:function(){return u(this).collection.size}})}return RH(h,i,!1,!0),l[i]=h,_H({global:!0,forced:!0},l),n||t.setStrong(h,i,r),h},LH=Qn,zH=function(i,e,t){for(var r in e)t&&t.unsafe&&i[r]?i[r]=e[r]:LH(i,r,e[r],t);return i},HH=zi,VH=_f,Ay=zH,WH=si,UH=Gf,KH=Gn,GH=Wi,qH=Pf,_a=Cf,YH=eE,ms=Ve,Ny=TE.fastKey,xE=es,Ry=xE.set,qd=xE.getterFor,PE={getConstructor:function(i,e,t,r){var n=i(function(h,d){UH(h,s),Ry(h,{type:e,index:HH(null),first:void 0,last:void 0,size:0}),ms||(h.size=0),KH(d)||GH(d,h[r],{that:h,AS_ENTRIES:t})}),s=n.prototype,o=qd(e),a=function(h,d,u){var c=o(h),f=l(h,d),v,g;return f?f.value=u:(c.last=f={index:g=Ny(d,!0),key:d,value:u,previous:v=c.last,next:void 0,removed:!1},c.first||(c.first=f),v&&(v.next=f),ms?c.size++:h.size++,g!=="F"&&(c.index[g]=f)),h},l=function(h,d){var u=o(h),c=Ny(d),f;if(c!=="F")return u.index[c];for(f=u.first;f;f=f.next)if(f.key===d)return f};return Ay(s,{clear:function(){for(var d=this,u=o(d),c=u.index,f=u.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),delete c[f.index],f=f.next;u.first=u.last=void 0,ms?u.size=0:d.size=0},delete:function(h){var d=this,u=o(d),c=l(d,h);if(c){var f=c.next,v=c.previous;delete u.index[c.index],c.removed=!0,v&&(v.next=f),f&&(f.previous=v),u.first===c&&(u.first=f),u.last===c&&(u.last=v),ms?u.size--:d.size--}return!!c},forEach:function(d){for(var u=o(this),c=WH(d,arguments.length>1?arguments[1]:void 0),f;f=f?f.next:u.first;)for(c(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(d){return!!l(this,d)}}),Ay(s,t?{get:function(d){var u=l(this,d);return u&&u.value},set:function(d,u){return a(this,d===0?0:d,u)}}:{add:function(d){return a(this,d=d===0?0:d,d)}}),ms&&VH(s,"size",{configurable:!0,get:function(){return o(this).size}}),n},setStrong:function(i,e,t){var r=e+" Iterator",n=qd(e),s=qd(r);qH(i,e,function(o,a){Ry(this,{type:r,target:o,state:n(o),kind:a,last:void 0})},function(){for(var o=s(this),a=o.kind,l=o.last;l&&l.removed;)l=l.previous;return!o.target||!(o.last=l=l?l.next:o.state.first)?(o.target=void 0,_a(void 0,!0)):_a(a==="keys"?l.key:a==="values"?l.value:[l.key,l.value],!1)},t?"entries":"values",!t,!0),YH(e)}},XH=IE,JH=PE;XH("Map",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},JH);var ZH=ge,QH=ZH.Map,eV=QH,tV=eV,rV=tV,CE=L(rV),iV=F,nV=ts.some,sV=oh,oV=sV("some");iV({target:"Array",proto:!0,forced:!oV},{some:function(e){return nV(this,e,arguments.length>1?arguments[1]:void 0)}});var aV=Je,lV=aV("Array","some"),hV=Re,dV=lV,Yd=Array.prototype,cV=function(i){var e=i.some;return i===Yd||hV(Yd,i)&&e===Yd.some?dV:e},uV=cV,fV=uV,vV=fV,pV=L(vV),gV=Je,yV=gV("Array","keys"),mV=yV,bV=mV,$V=Or,wV=ke,EV=Re,SV=bV,Xd=Array.prototype,_V={DOMTokenList:!0,NodeList:!0},TV=function(i){var e=i.keys;return i===Xd||EV(Xd,i)&&e===Xd.keys||wV(_V,$V(i))?SV:e},OV=TV,sn=L(OV),ky=N$,IV=Math.floor,ku=function(i,e){var t=i.length,r=IV(t/2);return t<8?xV(i,e):PV(i,ku(ky(i,0,r),e),ku(ky(i,r),e),e)},xV=function(i,e){for(var t=i.length,r=1,n,s;r<t;){for(s=r,n=i[r];s&&e(i[s-1],n)>0;)i[s]=i[--s];s!==r++&&(i[s]=n)}return i},PV=function(i,e,t,r){for(var n=e.length,s=t.length,o=0,a=0;o<n||a<s;)i[o+a]=o<n&&a<s?r(e[o],t[a])<=0?e[o++]:t[a++]:o<n?e[o++]:t[a++];return i},CV=ku,DV=ni,My=DV.match(/firefox\/(\d+)/i),AV=!!My&&+My[1],NV=ni,RV=/MSIE|Trident/.test(NV),kV=ni,Fy=kV.match(/AppleWebKit\/(\d+)\./),MV=!!Fy&&+Fy[1],FV=F,DE=de,BV=mt,jV=bt,By=_t,LV=Y0,jy=Li,tv=ie,zV=CV,HV=oh,Ly=AV,VV=RV,zy=qn,Hy=MV,Lr=[],Vy=DE(Lr.sort),WV=DE(Lr.push),UV=tv(function(){Lr.sort(void 0)}),KV=tv(function(){Lr.sort(null)}),GV=HV("sort"),AE=!tv(function(){if(zy)return zy<70;if(!(Ly&&Ly>3)){if(VV)return!0;if(Hy)return Hy<603;var i="",e,t,r,n;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)Lr.push({k:t+n,v:r})}for(Lr.sort(function(s,o){return o.v-s.v}),n=0;n<Lr.length;n++)t=Lr[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return i!=="DGBEFHACIJK"}}),qV=UV||!KV||!GV||!AE,YV=function(i){return function(e,t){return t===void 0?-1:e===void 0?1:i!==void 0?+i(e,t)||0:jy(e)>jy(t)?1:-1}};FV({target:"Array",proto:!0,forced:qV},{sort:function(e){e!==void 0&&BV(e);var t=jV(this);if(AE)return e===void 0?Vy(t):Vy(t,e);var r=[],n=By(t),s,o;for(o=0;o<n;o++)o in t&&WV(r,t[o]);for(zV(r,YV(e)),s=By(r),o=0;o<s;)t[o]=r[o++];for(;o<n;)LV(t,o++);return t}});var XV=Je,JV=XV("Array","sort"),ZV=Re,QV=JV,Jd=Array.prototype,e8=function(i){var e=i.sort;return i===Jd||ZV(Jd,i)&&e===Jd.sort?QV:e},t8=e8,r8=t8,i8=r8,Mu=L(i8),n8=Je,s8=n8("Array","values"),o8=s8,a8=o8,l8=Or,h8=ke,d8=Re,c8=a8,Zd=Array.prototype,u8={DOMTokenList:!0,NodeList:!0},f8=function(i){var e=i.values;return i===Zd||d8(Zd,i)&&e===Zd.values||h8(u8,l8(i))?c8:e},v8=f8,Wy=L(v8),p8=w0,wn=L(p8),g8=Je,y8=g8("Array","entries"),m8=y8,b8=m8,$8=Or,w8=ke,E8=Re,S8=b8,Qd=Array.prototype,_8={DOMTokenList:!0,NodeList:!0},T8=function(i){var e=i.entries;return i===Qd||E8(Qd,i)&&e===Qd.entries||w8(_8,$8(i))?S8:e},O8=T8,I8=L(O8);let Ta;const x8=new Uint8Array(16);function P8(){if(!Ta&&(Ta=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ta))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ta(x8)}const Ue=[];for(let i=0;i<256;++i)Ue.push((i+256).toString(16).slice(1));function C8(i,e=0){return Ue[i[e+0]]+Ue[i[e+1]]+Ue[i[e+2]]+Ue[i[e+3]]+"-"+Ue[i[e+4]]+Ue[i[e+5]]+"-"+Ue[i[e+6]]+Ue[i[e+7]]+"-"+Ue[i[e+8]]+Ue[i[e+9]]+"-"+Ue[i[e+10]]+Ue[i[e+11]]+Ue[i[e+12]]+Ue[i[e+13]]+Ue[i[e+14]]+Ue[i[e+15]]}const D8=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var Uy={randomUUID:D8};function A8(i,e,t){if(Uy.randomUUID&&!i)return Uy.randomUUID();i=i||{};const r=i.random||(i.rng||P8)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,C8(r)}function Ky(i){return typeof i=="string"||typeof i=="number"}var N8=function(){function i(e){jl(this,i),Kr(this,"_queue",[]),Kr(this,"_timeout",null),Kr(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(e)}return sh(i,[{key:"setOptions",value:function(t){t&&typeof t.delay<"u"&&(this.delay=t.delay),t&&typeof t.max<"u"&&(this.max=t.max),this._flushIfNeeded()}},{key:"destroy",value:function(){if(this.flush(),this._extended){for(var t=this._extended.object,r=this._extended.methods,n=0;n<r.length;n++){var s=r[n];s.original?t[s.name]=s.original:delete t[s.name]}this._extended=null}}},{key:"replace",value:function(t,r){var n=this,s=t[r];if(!s)throw new Error("Method "+r+" undefined");t[r]=function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];n.queue({args:a,fn:s,context:this})}}},{key:"queue",value:function(t){typeof t=="function"?this._queue.push({fn:t}):this._queue.push(t),this._flushIfNeeded()}},{key:"_flushIfNeeded",value:function(){var t=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=o3(function(){t.flush()},this.delay))}},{key:"flush",value:function(){var t,r;Pi(t=X0(r=this._queue).call(r,0)).call(t,function(n){n.fn.apply(n.context||n.fn,n.args||[])})}}],[{key:"extend",value:function(t,r){var n=new i(r);if(t.flush!==void 0)throw new Error("Target object already has a property flush");t.flush=function(){n.flush()};var s=[{name:"flush",original:void 0}];if(r&&r.replace)for(var o=0;o<r.replace.length;o++){var a=r.replace[o];s.push({name:a,original:t[a]}),n.replace(t,a)}return n._extended={object:t,methods:s},n}}]),i}(),R8=function(){function i(){jl(this,i),Kr(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),Kr(this,"subscribe",i.prototype.on),Kr(this,"unsubscribe",i.prototype.off)}return sh(i,[{key:"_trigger",value:function(t,r,n){var s,o;if(t==="*")throw new Error("Cannot trigger event *");Pi(s=hh(o=[]).call(o,ft(this._subscribers[t]),ft(this._subscribers["*"]))).call(s,function(a){a(t,r,n??null)})}},{key:"on",value:function(t,r){typeof r=="function"&&this._subscribers[t].push(r)}},{key:"off",value:function(t,r){var n;this._subscribers[t]=gn(n=this._subscribers[t]).call(n,function(s){return s!==r})}}]),i}(),k8=IE,M8=PE;k8("Set",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},M8);var F8=ge,B8=F8.Set,j8=B8,L8=j8,z8=L8,ec=L(z8),H8=Rf,V8=H8,W8=V8,U8=W8,K8=U8,G8=K8,q8=G8,Y8=q8,X8=Y8,J8=X8,tc=L(J8);function Yt(i,e){var t=typeof lh<"u"&&Mf(i)||i["@@iterator"];if(!t){if(wt(i)||(t=Z8(i))||e){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(h){throw h},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){t=t.call(i)},n:function(){var h=t.next();return s=h.done,h},e:function(h){o=!0,a=h},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function Z8(i,e){var t;if(i){if(typeof i=="string")return Gy(i,e);var r=dh(t=Object.prototype.toString.call(i)).call(t,8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return kf(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gy(i,e)}}function Gy(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}var qy=function(i){function e(t){jl(this,e),this._pairs=t}return sh(e,[{key:i,value:dt.mark(function t(){var r,n,s,o,a;return dt.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:r=Yt(this._pairs),h.prev=1,r.s();case 3:if((n=r.n()).done){h.next=9;break}return s=ht(n.value,2),o=s[0],a=s[1],h.next=7,[o,a];case 7:h.next=3;break;case 9:h.next=14;break;case 11:h.prev=11,h.t0=h.catch(1),r.e(h.t0);case 14:return h.prev=14,r.f(),h.finish(14);case 17:case"end":return h.stop()}},t,this,[[1,11,14,17]])})},{key:"entries",value:dt.mark(function t(){var r,n,s,o,a;return dt.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:r=Yt(this._pairs),h.prev=1,r.s();case 3:if((n=r.n()).done){h.next=9;break}return s=ht(n.value,2),o=s[0],a=s[1],h.next=7,[o,a];case 7:h.next=3;break;case 9:h.next=14;break;case 11:h.prev=11,h.t0=h.catch(1),r.e(h.t0);case 14:return h.prev=14,r.f(),h.finish(14);case 17:case"end":return h.stop()}},t,this,[[1,11,14,17]])})},{key:"keys",value:dt.mark(function t(){var r,n,s,o;return dt.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:r=Yt(this._pairs),l.prev=1,r.s();case 3:if((n=r.n()).done){l.next=9;break}return s=ht(n.value,1),o=s[0],l.next=7,o;case 7:l.next=3;break;case 9:l.next=14;break;case 11:l.prev=11,l.t0=l.catch(1),r.e(l.t0);case 14:return l.prev=14,r.f(),l.finish(14);case 17:case"end":return l.stop()}},t,this,[[1,11,14,17]])})},{key:"values",value:dt.mark(function t(){var r,n,s,o;return dt.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:r=Yt(this._pairs),l.prev=1,r.s();case 3:if((n=r.n()).done){l.next=9;break}return s=ht(n.value,2),o=s[1],l.next=7,o;case 7:l.next=3;break;case 9:l.next=14;break;case 11:l.prev=11,l.t0=l.catch(1),r.e(l.t0);case 14:return l.prev=14,r.f(),l.finish(14);case 17:case"end":return l.stop()}},t,this,[[1,11,14,17]])})},{key:"toIdArray",value:function(){var r;return Ft(r=ft(this._pairs)).call(r,function(n){return n[0]})}},{key:"toItemArray",value:function(){var r;return Ft(r=ft(this._pairs)).call(r,function(n){return n[1]})}},{key:"toEntryArray",value:function(){return ft(this._pairs)}},{key:"toObjectMap",value:function(){var r=Mj(null),n=Yt(this._pairs),s;try{for(n.s();!(s=n.n()).done;){var o=ht(s.value,2),a=o[0],l=o[1];r[a]=l}}catch(h){n.e(h)}finally{n.f()}return r}},{key:"toMap",value:function(){return new CE(this._pairs)}},{key:"toIdSet",value:function(){return new ec(this.toIdArray())}},{key:"toItemSet",value:function(){return new ec(this.toItemArray())}},{key:"cache",value:function(){return new e(ft(this._pairs))}},{key:"distinct",value:function(r){var n=new ec,s=Yt(this._pairs),o;try{for(s.s();!(o=s.n()).done;){var a=ht(o.value,2),l=a[0],h=a[1];n.add(r(h,l))}}catch(d){s.e(d)}finally{s.f()}return n}},{key:"filter",value:function(r){var n=this._pairs;return new e({[wn](){return dt.mark(function s(){var o,a,l,h,d;return dt.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:o=Yt(n),c.prev=1,o.s();case 3:if((a=o.n()).done){c.next=10;break}if(l=ht(a.value,2),h=l[0],d=l[1],!r(d,h)){c.next=8;break}return c.next=8,[h,d];case 8:c.next=3;break;case 10:c.next=15;break;case 12:c.prev=12,c.t0=c.catch(1),o.e(c.t0);case 15:return c.prev=15,o.f(),c.finish(15);case 18:case"end":return c.stop()}},s,null,[[1,12,15,18]])})()}})}},{key:"forEach",value:function(r){var n=Yt(this._pairs),s;try{for(n.s();!(s=n.n()).done;){var o=ht(s.value,2),a=o[0],l=o[1];r(l,a)}}catch(h){n.e(h)}finally{n.f()}}},{key:"map",value:function(r){var n=this._pairs;return new e({[wn](){return dt.mark(function s(){var o,a,l,h,d;return dt.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:o=Yt(n),c.prev=1,o.s();case 3:if((a=o.n()).done){c.next=9;break}return l=ht(a.value,2),h=l[0],d=l[1],c.next=7,[h,r(d,h)];case 7:c.next=3;break;case 9:c.next=14;break;case 11:c.prev=11,c.t0=c.catch(1),o.e(c.t0);case 14:return c.prev=14,o.f(),c.finish(14);case 17:case"end":return c.stop()}},s,null,[[1,11,14,17]])})()}})}},{key:"max",value:function(r){var n=tc(this._pairs),s=n.next();if(s.done)return null;for(var o=s.value[1],a=r(s.value[1],s.value[0]);!(s=n.next()).done;){var l=ht(s.value,2),h=l[0],d=l[1],u=r(d,h);u>a&&(a=u,o=d)}return o}},{key:"min",value:function(r){var n=tc(this._pairs),s=n.next();if(s.done)return null;for(var o=s.value[1],a=r(s.value[1],s.value[0]);!(s=n.next()).done;){var l=ht(s.value,2),h=l[0],d=l[1],u=r(d,h);u<a&&(a=u,o=d)}return o}},{key:"reduce",value:function(r,n){var s=Yt(this._pairs),o;try{for(s.s();!(o=s.n()).done;){var a=ht(o.value,2),l=a[0],h=a[1];n=r(n,h,l)}}catch(d){s.e(d)}finally{s.f()}return n}},{key:"sort",value:function(r){var n=this;return new e({[wn]:function(){var s;return tc(Mu(s=ft(n._pairs)).call(s,function(o,a){var l=ht(o,2),h=l[0],d=l[1],u=ht(a,2),c=u[0],f=u[1];return r(d,f,h,c)}))}})}}]),e}(wn);function Yy(i,e){var t=Bf(i);if(Xg){var r=Xg(i);e&&(r=gn(r).call(r,function(n){return zw(i,n).enumerable})),t.push.apply(t,r)}return t}function Xy(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?Pi(t=Yy(Object(n),!0)).call(t,function(s){Kr(i,s,n[s])}):Jg?XL(i,Jg(n)):Pi(r=Yy(Object(n))).call(r,function(s){ZL(i,s,zw(n,s))})}return i}function rc(i,e){var t=typeof lh<"u"&&Mf(i)||i["@@iterator"];if(!t){if(wt(i)||(t=Q8(i))||e){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(h){throw h},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){t=t.call(i)},n:function(){var h=t.next();return s=h.done,h},e:function(h){o=!0,a=h},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function Q8(i,e){var t;if(i){if(typeof i=="string")return Jy(i,e);var r=dh(t=Object.prototype.toString.call(i)).call(t,8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return kf(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jy(i,e)}}function Jy(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}function eW(i){var e=tW();return function(){var r=$l(i),n;if(e){var s=$l(this).constructor;n=Ja(r,arguments,s)}else n=r.apply(this,arguments);return $5(this,n)}}function tW(){if(typeof Reflect>"u"||!Ja||Ja.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Ja(Boolean,[],function(){})),!0}catch{return!1}}function rW(i,e){return i[e]==null&&(i[e]=A8()),i}var _l=function(i){b5(t,i);var e=eW(t);function t(r,n){var s;return jl(this,t),s=e.call(this),Kr(Ww(s),"_queue",null),r&&!wt(r)&&(n=r,r=[]),s._options=n||{},s._data=new CE,s.length=0,s._idProp=s._options.fieldId||"id",r&&r.length&&s.add(r),s.setOptions(n),s}return sh(t,[{key:"idProp",get:function(){return this._idProp}},{key:"setOptions",value:function(n){n&&n.queue!==void 0&&(n.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=N8.extend(this,{replace:["add","update","remove"]})),n.queue&&typeof n.queue=="object"&&this._queue.setOptions(n.queue)))}},{key:"add",value:function(n,s){var o=this,a=[],l;if(wt(n)){var h=Ft(n).call(n,function(c){return c[o._idProp]});if(pV(h).call(h,function(c){return o._data.has(c)}))throw new Error("A duplicate id was found in the parameter array.");for(var d=0,u=n.length;d<u;d++)l=this._addItem(n[d]),a.push(l)}else if(n&&typeof n=="object")l=this._addItem(n),a.push(l);else throw new Error("Unknown dataType");return a.length&&this._trigger("add",{items:a},s),a}},{key:"update",value:function(n,s){var o=this,a=[],l=[],h=[],d=[],u=this._idProp,c=function(p){var m=p[u];if(m!=null&&o._data.has(m)){var w=p,$=mj({},o._data.get(m)),x=o._updateItem(w);l.push(x),d.push(w),h.push($)}else{var _=o._addItem(p);a.push(_)}};if(wt(n))for(var f=0,v=n.length;f<v;f++)n[f]&&typeof n[f]=="object"?c(n[f]):console.warn("Ignoring input item, which is not an object at index "+f);else if(n&&typeof n=="object")c(n);else throw new Error("Unknown dataType");if(a.length&&this._trigger("add",{items:a},s),l.length){var g={items:l,oldData:h,data:d};this._trigger("update",g,s)}return hh(a).call(a,l)}},{key:"updateOnly",value:function(n,s){var o,a=this;wt(n)||(n=[n]);var l=Ft(o=Ft(n).call(n,function(d){var u=a._data.get(d[a._idProp]);if(u==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:u,update:d}})).call(o,function(d){var u=d.oldData,c=d.update,f=u[a._idProp],v=J3(u,c);return a._data.set(f,v),{id:f,oldData:u,updatedData:v}});if(l.length){var h={items:Ft(l).call(l,function(d){return d.id}),oldData:Ft(l).call(l,function(d){return d.oldData}),data:Ft(l).call(l,function(d){return d.updatedData})};return this._trigger("update",h,s),h.items}else return[]}},{key:"get",value:function(n,s){var o=void 0,a=void 0,l=void 0;Ky(n)?(o=n,l=s):wt(n)?(a=n,l=s):l=n;var h=l&&l.returnType==="Object"?"Object":"Array",d=l&&gn(l),u=[],c=void 0,f=void 0,v=void 0;if(o!=null)c=this._data.get(o),c&&d&&!d(c)&&(c=void 0);else if(a!=null)for(var g=0,y=a.length;g<y;g++)c=this._data.get(a[g]),c!=null&&(!d||d(c))&&u.push(c);else{var p;f=ft(sn(p=this._data).call(p));for(var m=0,w=f.length;m<w;m++)v=f[m],c=this._data.get(v),c!=null&&(!d||d(c))&&u.push(c)}if(l&&l.order&&o==null&&this._sort(u,l.order),l&&l.fields){var $=l.fields;if(o!=null&&c!=null)c=this._filterFields(c,$);else for(var x=0,_=u.length;x<_;x++)u[x]=this._filterFields(u[x],$)}if(h=="Object"){for(var A={},R=0,B=u.length;R<B;R++){var G=u[R],q=G[this._idProp];A[q]=G}return A}else if(o!=null){var ce;return(ce=c)!==null&&ce!==void 0?ce:null}else return u}},{key:"getIds",value:function(n){var s=this._data,o=n&&gn(n),a=n&&n.order,l=ft(sn(s).call(s)),h=[];if(o)if(a){for(var d=[],u=0,c=l.length;u<c;u++){var f=l[u],v=this._data.get(f);v!=null&&o(v)&&d.push(v)}this._sort(d,a);for(var g=0,y=d.length;g<y;g++)h.push(d[g][this._idProp])}else for(var p=0,m=l.length;p<m;p++){var w=l[p],$=this._data.get(w);$!=null&&o($)&&h.push($[this._idProp])}else if(a){for(var x=[],_=0,A=l.length;_<A;_++){var R=l[_];x.push(s.get(R))}this._sort(x,a);for(var B=0,G=x.length;B<G;B++)h.push(x[B][this._idProp])}else for(var q=0,ce=l.length;q<ce;q++){var ue=l[q],Fe=s.get(ue);Fe!=null&&h.push(Fe[this._idProp])}return h}},{key:"getDataSet",value:function(){return this}},{key:"forEach",value:function(n,s){var o=s&&gn(s),a=this._data,l=ft(sn(a).call(a));if(s&&s.order)for(var h=this.get(s),d=0,u=h.length;d<u;d++){var c=h[d],f=c[this._idProp];n(c,f)}else for(var v=0,g=l.length;v<g;v++){var y=l[v],p=this._data.get(y);p!=null&&(!o||o(p))&&n(p,y)}}},{key:"map",value:function(n,s){for(var o=s&&gn(s),a=[],l=this._data,h=ft(sn(l).call(l)),d=0,u=h.length;d<u;d++){var c=h[d],f=this._data.get(c);f!=null&&(!o||o(f))&&a.push(n(f,c))}return s&&s.order&&this._sort(a,s.order),a}},{key:"_filterFields",value:function(n,s){var o;return n&&RR(o=wt(s)?s:Bf(s)).call(o,function(a,l){return a[l]=n[l],a},{})}},{key:"_sort",value:function(n,s){if(typeof s=="string"){var o=s;Mu(n).call(n,function(a,l){var h=a[o],d=l[o];return h>d?1:h<d?-1:0})}else if(typeof s=="function")Mu(n).call(n,s);else throw new TypeError("Order must be a function or a string")}},{key:"remove",value:function(n,s){for(var o=[],a=[],l=wt(n)?n:[n],h=0,d=l.length;h<d;h++){var u=this._remove(l[h]);if(u){var c=u[this._idProp];c!=null&&(o.push(c),a.push(u))}}return o.length&&this._trigger("remove",{items:o,oldData:a},s),o}},{key:"_remove",value:function(n){var s;if(Ky(n)?s=n:n&&typeof n=="object"&&(s=n[this._idProp]),s!=null&&this._data.has(s)){var o=this._data.get(s)||null;return this._data.delete(s),--this.length,o}return null}},{key:"clear",value:function(n){for(var s,o=ft(sn(s=this._data).call(s)),a=[],l=0,h=o.length;l<h;l++)a.push(this._data.get(o[l]));return this._data.clear(),this.length=0,this._trigger("remove",{items:o,oldData:a},n),o}},{key:"max",value:function(n){var s,o=null,a=null,l=rc(Wy(s=this._data).call(s)),h;try{for(l.s();!(h=l.n()).done;){var d=h.value,u=d[n];typeof u=="number"&&(a==null||u>a)&&(o=d,a=u)}}catch(c){l.e(c)}finally{l.f()}return o||null}},{key:"min",value:function(n){var s,o=null,a=null,l=rc(Wy(s=this._data).call(s)),h;try{for(l.s();!(h=l.n()).done;){var d=h.value,u=d[n];typeof u=="number"&&(a==null||u<a)&&(o=d,a=u)}}catch(c){l.e(c)}finally{l.f()}return o||null}},{key:"distinct",value:function(n){for(var s=this._data,o=ft(sn(s).call(s)),a=[],l=0,h=0,d=o.length;h<d;h++){for(var u=o[h],c=s.get(u),f=c[n],v=!1,g=0;g<l;g++)if(a[g]==f){v=!0;break}!v&&f!==void 0&&(a[l]=f,l++)}return a}},{key:"_addItem",value:function(n){var s=rW(n,this._idProp),o=s[this._idProp];if(this._data.has(o))throw new Error("Cannot add item: item with id "+o+" already exists");return this._data.set(o,s),++this.length,o}},{key:"_updateItem",value:function(n){var s=n[this._idProp];if(s==null)throw new Error("Cannot update item: item has no id (item: "+Hj(n)+")");var o=this._data.get(s);if(!o)throw new Error("Cannot update item: no item with id "+s+" found");return this._data.set(s,Xy(Xy({},o),n)),s}},{key:"stream",value:function(n){if(n){var s=this._data;return new qy({[wn](){return dt.mark(function a(){var l,h,d,u;return dt.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:l=rc(n),f.prev=1,l.s();case 3:if((h=l.n()).done){f.next=11;break}if(d=h.value,u=s.get(d),u==null){f.next=9;break}return f.next=9,[d,u];case 9:f.next=3;break;case 11:f.next=16;break;case 13:f.prev=13,f.t0=f.catch(1),l.e(f.t0);case 16:return f.prev=16,l.f(),f.finish(16);case 19:case"end":return f.stop()}},a,null,[[1,13,16,19]])})()}})}else{var o;return new qy({[wn]:x0(o=I8(this._data)).call(o,this._data)})}}}]),t}(R8);function iW(i,e){return typeof e=="object"&&e!==null&&i===e.idProp&&typeof e.add=="function"&&typeof e.clear=="function"&&typeof e.distinct=="function"&&typeof Pi(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof Ft(e)=="function"&&typeof e.max=="function"&&typeof e.min=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.remove=="function"&&typeof e.setOptions=="function"&&typeof e.stream=="function"&&typeof e.update=="function"&&typeof e.updateOnly=="function"}function NE(i,e){return typeof e=="object"&&e!==null&&i===e.idProp&&typeof Pi(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof Ft(e)=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.stream=="function"&&iW(i,e.getDataSet())}/**
|
||
* vis-network
|
||
* https://visjs.github.io/vis-network/
|
||
*
|
||
* A dynamic, browser-based visualization library.
|
||
*
|
||
* @version 9.1.12
|
||
* @date 2025-06-10T17:34:31.193Z
|
||
*
|
||
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
||
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
||
*
|
||
* @license
|
||
* vis.js is dual licensed under both
|
||
*
|
||
* 1. The Apache 2.0 License
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* and
|
||
*
|
||
* 2. The MIT License
|
||
* http://opensource.org/licenses/MIT
|
||
*
|
||
* vis.js may be distributed under either license.
|
||
*/var ic=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function V(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Oa=function(i){return i&&i.Math===Math&&i},_e=Oa(typeof globalThis=="object"&&globalThis)||Oa(typeof window=="object"&&window)||Oa(typeof self=="object"&&self)||Oa(typeof ic=="object"&&ic)||function(){return this}()||ic||Function("return this")(),te=function(i){try{return!!i()}catch{return!0}},nW=te,_o=!nW(function(){var i=function(){}.bind();return typeof i!="function"||i.hasOwnProperty("prototype")}),sW=_o,RE=Function.prototype,Zy=RE.apply,Qy=RE.call,ph=typeof Reflect=="object"&&Reflect.apply||(sW?Qy.bind(Zy):function(){return Qy.apply(Zy,arguments)}),kE=_o,ME=Function.prototype,Fu=ME.call,oW=kE&&ME.bind.bind(Fu,Fu),re=kE?oW:function(i){return function(){return Fu.apply(i,arguments)}},FE=re,aW=FE({}.toString),lW=FE("".slice),Ir=function(i){return lW(aW(i),8,-1)},hW=Ir,dW=re,rv=function(i){if(hW(i)==="Function")return dW(i)},Bu=typeof document=="object"&&document.all,cW=typeof Bu>"u"&&Bu!==void 0,BE={all:Bu,IS_HTMLDDA:cW},jE=BE,uW=jE.all,qe=jE.IS_HTMLDDA?function(i){return typeof i=="function"||i===uW}:function(i){return typeof i=="function"},To={},fW=te,Be=!fW(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),vW=_o,Ia=Function.prototype.call,Wt=vW?Ia.bind(Ia):function(){return Ia.apply(Ia,arguments)},Oo={},LE={}.propertyIsEnumerable,zE=Object.getOwnPropertyDescriptor,pW=zE&&!LE.call({1:2},1);Oo.f=pW?function(e){var t=zE(this,e);return!!t&&t.enumerable}:LE;var Io=function(i,e){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:e}},gW=re,yW=te,mW=Ir,nc=Object,bW=gW("".split),gh=yW(function(){return!nc("z").propertyIsEnumerable(0)})?function(i){return mW(i)==="String"?bW(i,""):nc(i)}:nc,os=function(i){return i==null},$W=os,wW=TypeError,xo=function(i){if($W(i))throw new wW("Can't call method on "+i);return i},EW=gh,SW=xo,Ut=function(i){return EW(SW(i))},em=qe,HE=BE,_W=HE.all,Ze=HE.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:em(i)||i===_W}:function(i){return typeof i=="object"?i!==null:em(i)},ne={},sc=ne,oc=_e,TW=qe,tm=function(i){return TW(i)?i:void 0},Kt=function(i,e){return arguments.length<2?tm(sc[i])||tm(oc[i]):sc[i]&&sc[i][e]||oc[i]&&oc[i][e]},OW=re,Me=OW({}.isPrototypeOf),Po=typeof navigator<"u"&&String(navigator.userAgent)||"",VE=_e,ac=Po,rm=VE.process,im=VE.Deno,nm=rm&&rm.versions||im&&im.version,sm=nm&&nm.v8,Bt,Tl;sm&&(Bt=sm.split("."),Tl=Bt[0]>0&&Bt[0]<4?1:+(Bt[0]+Bt[1]));!Tl&&ac&&(Bt=ac.match(/Edge\/(\d+)/),(!Bt||Bt[1]>=74)&&(Bt=ac.match(/Chrome\/(\d+)/),Bt&&(Tl=+Bt[1])));var Co=Tl,om=Co,IW=te,xW=_e,PW=xW.String,as=!!Object.getOwnPropertySymbols&&!IW(function(){var i=Symbol("symbol detection");return!PW(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&om&&om<41}),CW=as,WE=CW&&!Symbol.sham&&typeof Symbol.iterator=="symbol",DW=Kt,AW=qe,NW=Me,RW=WE,kW=Object,Do=RW?function(i){return typeof i=="symbol"}:function(i){var e=DW("Symbol");return AW(e)&&NW(e.prototype,kW(i))},MW=String,Ao=function(i){try{return MW(i)}catch{return"Object"}},FW=qe,BW=Ao,jW=TypeError,ls=function(i){if(FW(i))return i;throw new jW(BW(i)+" is not a function")},LW=ls,zW=os,iv=function(i,e){var t=i[e];return zW(t)?void 0:LW(t)},lc=Wt,hc=qe,dc=Ze,HW=TypeError,VW=function(i,e){var t,r;if(e==="string"&&hc(t=i.toString)&&!dc(r=lc(t,i))||hc(t=i.valueOf)&&!dc(r=lc(t,i))||e!=="string"&&hc(t=i.toString)&&!dc(r=lc(t,i)))return r;throw new HW("Can't convert object to primitive value")},UE={exports:{}},am=_e,WW=Object.defineProperty,UW=function(i,e){try{WW(am,i,{value:e,configurable:!0,writable:!0})}catch{am[i]=e}return e},KW=_e,GW=UW,lm="__core-js_shared__",qW=KW[lm]||GW(lm,{}),nv=qW,hm=nv;(UE.exports=function(i,e){return hm[i]||(hm[i]=e!==void 0?e:{})})("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 hs=UE.exports,YW=xo,XW=Object,Nt=function(i){return XW(YW(i))},JW=re,ZW=Nt,QW=JW({}.hasOwnProperty),Ye=Object.hasOwn||function(e,t){return QW(ZW(e),t)},e7=re,t7=0,r7=Math.random(),i7=e7(1 .toString),yh=function(i){return"Symbol("+(i===void 0?"":i)+")_"+i7(++t7+r7,36)},n7=_e,s7=hs,dm=Ye,o7=yh,a7=as,l7=WE,En=n7.Symbol,cc=s7("wks"),h7=l7?En.for||En:En&&En.withoutSetter||o7,Pe=function(i){return dm(cc,i)||(cc[i]=a7&&dm(En,i)?En[i]:h7("Symbol."+i)),cc[i]},d7=Wt,cm=Ze,um=Do,c7=iv,u7=VW,f7=Pe,v7=TypeError,p7=f7("toPrimitive"),g7=function(i,e){if(!cm(i)||um(i))return i;var t=c7(i,p7),r;if(t){if(e===void 0&&(e="default"),r=d7(t,i,e),!cm(r)||um(r))return r;throw new v7("Can't convert object to primitive value")}return e===void 0&&(e="number"),u7(i,e)},y7=g7,m7=Do,mh=function(i){var e=y7(i,"string");return m7(e)?e:e+""},b7=_e,fm=Ze,ju=b7.document,$7=fm(ju)&&fm(ju.createElement),KE=function(i){return $7?ju.createElement(i):{}},w7=Be,E7=te,S7=KE,GE=!w7&&!E7(function(){return Object.defineProperty(S7("div"),"a",{get:function(){return 7}}).a!==7}),_7=Be,T7=Wt,O7=Oo,I7=Io,x7=Ut,P7=mh,C7=Ye,D7=GE,vm=Object.getOwnPropertyDescriptor;To.f=_7?vm:function(e,t){if(e=x7(e),t=P7(t),D7)try{return vm(e,t)}catch{}if(C7(e,t))return I7(!T7(O7.f,e,t),e[t])};var A7=te,N7=qe,R7=/#|\.prototype\./,No=function(i,e){var t=M7[k7(i)];return t===B7?!0:t===F7?!1:N7(e)?A7(e):!!e},k7=No.normalize=function(i){return String(i).replace(R7,".").toLowerCase()},M7=No.data={},F7=No.NATIVE="N",B7=No.POLYFILL="P",j7=No,pm=rv,L7=ls,z7=_o,H7=pm(pm.bind),bh=function(i,e){return L7(i),e===void 0?i:z7?H7(i,e):function(){return i.apply(e,arguments)}},Tt={},V7=Be,W7=te,qE=V7&&W7(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),U7=Ze,K7=String,G7=TypeError,xr=function(i){if(U7(i))return i;throw new G7(K7(i)+" is not an object")},q7=Be,Y7=GE,X7=qE,xa=xr,gm=mh,J7=TypeError,uc=Object.defineProperty,Z7=Object.getOwnPropertyDescriptor,fc="enumerable",vc="configurable",pc="writable";Tt.f=q7?X7?function(e,t,r){if(xa(e),t=gm(t),xa(r),typeof e=="function"&&t==="prototype"&&"value"in r&&pc in r&&!r[pc]){var n=Z7(e,t);n&&n[pc]&&(e[t]=r.value,r={configurable:vc in r?r[vc]:n[vc],enumerable:fc in r?r[fc]:n[fc],writable:!1})}return uc(e,t,r)}:uc:function(e,t,r){if(xa(e),t=gm(t),xa(r),Y7)try{return uc(e,t,r)}catch{}if("get"in r||"set"in r)throw new J7("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Q7=Be,e9=Tt,t9=Io,ds=Q7?function(i,e,t){return e9.f(i,e,t9(1,t))}:function(i,e,t){return i[e]=t,i},Pa=_e,r9=ph,i9=rv,n9=qe,s9=To.f,o9=j7,on=ne,a9=bh,an=ds,ym=Ye,l9=function(i){var e=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new i;case 1:return new i(t);case 2:return new i(t,r)}return new i(t,r,n)}return r9(i,this,arguments)};return e.prototype=i.prototype,e},z=function(i,e){var t=i.target,r=i.global,n=i.stat,s=i.proto,o=r?Pa:n?Pa[t]:(Pa[t]||{}).prototype,a=r?on:on[t]||an(on,t,{})[t],l=a.prototype,h,d,u,c,f,v,g,y,p;for(c in e)h=o9(r?c:t+(n?".":"#")+c,i.forced),d=!h&&o&&ym(o,c),v=a[c],d&&(i.dontCallGetSet?(p=s9(o,c),g=p&&p.value):g=o[c]),f=d&&g?g:e[c],!(d&&typeof v==typeof f)&&(i.bind&&d?y=a9(f,Pa):i.wrap&&d?y=l9(f):s&&n9(f)?y=i9(f):y=f,(i.sham||f&&f.sham||v&&v.sham)&&an(y,"sham",!0),an(a,c,y),s&&(u=t+"Prototype",ym(on,u)||an(on,u,{}),an(on[u],c,f),i.real&&l&&(h||!l[c])&&an(l,c,f)))},h9=Math.ceil,d9=Math.floor,c9=Math.trunc||function(e){var t=+e;return(t>0?d9:h9)(t)},u9=c9,$h=function(i){var e=+i;return e!==e||e===0?0:u9(e)},f9=$h,v9=Math.max,p9=Math.min,Ro=function(i,e){var t=f9(i);return t<0?v9(t+e,0):p9(t,e)},g9=$h,y9=Math.min,m9=function(i){return i>0?y9(g9(i),9007199254740991):0},b9=m9,ar=function(i){return b9(i.length)},$9=Ut,w9=Ro,E9=ar,mm=function(i){return function(e,t,r){var n=$9(e),s=E9(n),o=w9(r,s),a;if(i&&t!==t){for(;s>o;)if(a=n[o++],a!==a)return!0}else for(;s>o;o++)if((i||o in n)&&n[o]===t)return i||o||0;return!i&&-1}},sv={includes:mm(!0),indexOf:mm(!1)},ko={},S9=re,gc=Ye,_9=Ut,T9=sv.indexOf,O9=ko,bm=S9([].push),YE=function(i,e){var t=_9(i),r=0,n=[],s;for(s in t)!gc(O9,s)&&gc(t,s)&&bm(n,s);for(;e.length>r;)gc(t,s=e[r++])&&(~T9(n,s)||bm(n,s));return n},ov=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],I9=YE,x9=ov,Mo=Object.keys||function(e){return I9(e,x9)},Fo={};Fo.f=Object.getOwnPropertySymbols;var $m=Be,P9=re,C9=Wt,D9=te,yc=Mo,A9=Fo,N9=Oo,R9=Nt,k9=gh,ln=Object.assign,wm=Object.defineProperty,M9=P9([].concat),F9=!ln||D9(function(){if($m&&ln({b:1},ln(wm({},"a",{enumerable:!0,get:function(){wm(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var i={},e={},t=Symbol("assign detection"),r="abcdefghijklmnopqrst";return i[t]=7,r.split("").forEach(function(n){e[n]=n}),ln({},i)[t]!==7||yc(ln({},e)).join("")!==r})?function(e,t){for(var r=R9(e),n=arguments.length,s=1,o=A9.f,a=N9.f;n>s;)for(var l=k9(arguments[s++]),h=o?M9(yc(l),o(l)):yc(l),d=h.length,u=0,c;d>u;)c=h[u++],(!$m||C9(a,l,c))&&(r[c]=l[c]);return r}:ln,B9=z,Em=F9;B9({target:"Object",stat:!0,forced:Object.assign!==Em},{assign:Em});var j9=ne,L9=j9.Object.assign,z9=L9,H9=z9,V9=H9,Ae=V(V9),W9=re,wh=W9([].slice),XE=re,U9=ls,K9=Ze,G9=Ye,Sm=wh,q9=_o,JE=Function,Y9=XE([].concat),X9=XE([].join),mc={},J9=function(i,e,t){if(!G9(mc,e)){for(var r=[],n=0;n<e;n++)r[n]="a["+n+"]";mc[e]=JE("C,a","return new C("+X9(r,",")+")")}return mc[e](i,t)},Z9=q9?JE.bind:function(e){var t=U9(this),r=t.prototype,n=Sm(arguments,1),s=function(){var a=Y9(n,Sm(arguments));return this instanceof s?J9(t,a.length,a):t.apply(e,a)};return K9(r)&&(s.prototype=r),s},Q9=z,_m=Z9;Q9({target:"Function",proto:!0,forced:Function.bind!==_m},{bind:_m});var eU=ne,Xe=function(i){return eU[i+"Prototype"]},tU=Xe,rU=tU("Function").bind,iU=Me,nU=rU,bc=Function.prototype,sU=function(i){var e=i.bind;return i===bc||iU(bc,i)&&e===bc.bind?nU:e},oU=sU,aU=oU,lU=aU,O=V(lU);function av(i,e,t,r){i.beginPath(),i.arc(e,t,r,0,2*Math.PI,!1),i.closePath()}function hU(i,e,t,r){i.beginPath(),i.rect(e-r,t-r,r*2,r*2),i.closePath()}function dU(i,e,t,r){i.beginPath(),r*=1.15,t+=.275*r;const n=r*2,s=n/2,o=Math.sqrt(3)/6*n,a=Math.sqrt(n*n-s*s);i.moveTo(e,t-(a-o)),i.lineTo(e+s,t+o),i.lineTo(e-s,t+o),i.lineTo(e,t-(a-o)),i.closePath()}function cU(i,e,t,r){i.beginPath(),r*=1.15,t-=.275*r;const n=r*2,s=n/2,o=Math.sqrt(3)/6*n,a=Math.sqrt(n*n-s*s);i.moveTo(e,t+(a-o)),i.lineTo(e+s,t-o),i.lineTo(e-s,t-o),i.lineTo(e,t+(a-o)),i.closePath()}function uU(i,e,t,r){i.beginPath(),r*=.82,t+=.1*r;for(let n=0;n<10;n++){const s=n%2===0?r*1.3:r*.5;i.lineTo(e+s*Math.sin(n*2*Math.PI/10),t-s*Math.cos(n*2*Math.PI/10))}i.closePath()}function fU(i,e,t,r){i.beginPath(),i.lineTo(e,t+r),i.lineTo(e+r,t),i.lineTo(e,t-r),i.lineTo(e-r,t),i.closePath()}function ZE(i,e,t,r,n,s){const o=Math.PI/180;r-2*s<0&&(s=r/2),n-2*s<0&&(s=n/2),i.beginPath(),i.moveTo(e+s,t),i.lineTo(e+r-s,t),i.arc(e+r-s,t+s,s,o*270,o*360,!1),i.lineTo(e+r,t+n-s),i.arc(e+r-s,t+n-s,s,0,o*90,!1),i.lineTo(e+s,t+n),i.arc(e+s,t+n-s,s,o*90,o*180,!1),i.lineTo(e,t+s),i.arc(e+s,t+s,s,o*180,o*270,!1),i.closePath()}function Lu(i,e,t,r,n){const s=.5522848,o=r/2*s,a=n/2*s,l=e+r,h=t+n,d=e+r/2,u=t+n/2;i.beginPath(),i.moveTo(e,u),i.bezierCurveTo(e,u-a,d-o,t,d,t),i.bezierCurveTo(d+o,t,l,u-a,l,u),i.bezierCurveTo(l,u+a,d+o,h,d,h),i.bezierCurveTo(d-o,h,e,u+a,e,u),i.closePath()}function QE(i,e,t,r,n){const s=.3333333333333333,o=r,a=n*s,l=.5522848,h=o/2*l,d=a/2*l,u=e+o,c=t+a,f=e+o/2,v=t+a/2,g=t+(n-a/2),y=t+n;i.beginPath(),i.moveTo(u,v),i.bezierCurveTo(u,v+d,f+h,c,f,c),i.bezierCurveTo(f-h,c,e,v+d,e,v),i.bezierCurveTo(e,v-d,f-h,t,f,t),i.bezierCurveTo(f+h,t,u,v-d,u,v),i.lineTo(u,g),i.bezierCurveTo(u,g+d,f+h,y,f,y),i.bezierCurveTo(f-h,y,e,g+d,e,g),i.lineTo(e,v)}function eS(i,e,t,r,n,s){i.beginPath(),i.moveTo(e,t);const o=s.length,a=r-e,l=n-t,h=l/a;let d=Math.sqrt(a*a+l*l),u=0,c=!0,f=0,v=+s[0];for(;d>=.1;)v=+s[u++%o],v>d&&(v=d),f=Math.sqrt(v*v/(1+h*h)),f=a<0?-f:f,e+=f,t+=h*f,c===!0?i.lineTo(e,t):i.moveTo(e,t),d-=v,c=!c}function vU(i,e,t,r){i.beginPath();const n=6,s=Math.PI*2/n;i.moveTo(e+r,t);for(let o=1;o<n;o++)i.lineTo(e+r*Math.cos(s*o),t+r*Math.sin(s*o));i.closePath()}const Tm={circle:av,dashedLine:eS,database:QE,diamond:fU,ellipse:Lu,ellipse_vis:Lu,hexagon:vU,roundRect:ZE,square:hU,star:uU,triangle:dU,triangleDown:cU};function pU(i){return Object.prototype.hasOwnProperty.call(Tm,i)?Tm[i]:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];CanvasRenderingContext2D.prototype[i].call(e,r)}}var tS={exports:{}};(function(i){i.exports=e;function e(r){if(r)return t(r)}function t(r){for(var n in e.prototype)r[n]=e.prototype[n];return r}e.prototype.on=e.prototype.addEventListener=function(r,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(n),this},e.prototype.once=function(r,n){function s(){this.off(r,s),n.apply(this,arguments)}return s.fn=n,this.on(r,s),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(r,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var s=this._callbacks["$"+r];if(!s)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var o,a=0;a<s.length;a++)if(o=s[a],o===n||o.fn===n){s.splice(a,1);break}return s.length===0&&delete this._callbacks["$"+r],this},e.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),s=this._callbacks["$"+r],o=1;o<arguments.length;o++)n[o-1]=arguments[o];if(s){s=s.slice(0);for(var o=0,a=s.length;o<a;++o)s[o].apply(this,n)}return this},e.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]},e.prototype.hasListeners=function(r){return!!this.listeners(r).length}})(tS);var gU=tS.exports,rS=V(gU),yU=Ir,Ui=Array.isArray||function(e){return yU(e)==="Array"},mU=TypeError,bU=9007199254740991,iS=function(i){if(i>bU)throw mU("Maximum allowed index exceeded");return i},$U=mh,wU=Tt,EU=Io,Bo=function(i,e,t){var r=$U(e);r in i?wU.f(i,r,EU(0,t)):i[r]=t},SU=Pe,_U=SU("toStringTag"),nS={};nS[_U]="z";var lv=String(nS)==="[object z]",TU=lv,OU=qe,tl=Ir,IU=Pe,xU=IU("toStringTag"),PU=Object,CU=tl(function(){return arguments}())==="Arguments",DU=function(i,e){try{return i[e]}catch{}},Ki=TU?tl:function(i){var e,t,r;return i===void 0?"Undefined":i===null?"Null":typeof(t=DU(e=PU(i),xU))=="string"?t:CU?tl(e):(r=tl(e))==="Object"&&OU(e.callee)?"Arguments":r},AU=re,NU=qe,zu=nv,RU=AU(Function.toString);NU(zu.inspectSource)||(zu.inspectSource=function(i){return RU(i)});var kU=zu.inspectSource,MU=re,FU=te,sS=qe,BU=Ki,jU=Kt,LU=kU,oS=function(){},zU=[],aS=jU("Reflect","construct"),hv=/^\s*(?:class|function)\b/,HU=MU(hv.exec),VU=!hv.test(oS),bs=function(e){if(!sS(e))return!1;try{return aS(oS,zU,e),!0}catch{return!1}},lS=function(e){if(!sS(e))return!1;switch(BU(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return VU||!!HU(hv,LU(e))}catch{return!0}};lS.sham=!0;var hS=!aS||FU(function(){var i;return bs(bs.call)||!bs(Object)||!bs(function(){i=!0})||i})?lS:bs,Om=Ui,WU=hS,UU=Ze,KU=Pe,GU=KU("species"),Im=Array,qU=function(i){var e;return Om(i)&&(e=i.constructor,WU(e)&&(e===Im||Om(e.prototype))?e=void 0:UU(e)&&(e=e[GU],e===null&&(e=void 0))),e===void 0?Im:e},YU=qU,dv=function(i,e){return new(YU(i))(e===0?0:e)},XU=te,JU=Pe,ZU=Co,QU=JU("species"),jo=function(i){return ZU>=51||!XU(function(){var e=[],t=e.constructor={};return t[QU]=function(){return{foo:1}},e[i](Boolean).foo!==1})},eK=z,tK=te,rK=Ui,iK=Ze,nK=Nt,sK=ar,xm=iS,Pm=Bo,oK=dv,aK=jo,lK=Pe,hK=Co,dS=lK("isConcatSpreadable"),dK=hK>=51||!tK(function(){var i=[];return i[dS]=!1,i.concat()[0]!==i}),cK=function(i){if(!iK(i))return!1;var e=i[dS];return e!==void 0?!!e:rK(i)},uK=!dK||!aK("concat");eK({target:"Array",proto:!0,forced:uK},{concat:function(e){var t=nK(this),r=oK(t,0),n=0,s,o,a,l,h;for(s=-1,a=arguments.length;s<a;s++)if(h=s===-1?t:arguments[s],cK(h))for(l=sK(h),xm(n+l),o=0;o<l;o++,n++)o in h&&Pm(r,n,h[o]);else xm(n+1),Pm(r,n++,h);return r.length=n,r}});var fK=Ki,vK=String,lr=function(i){if(fK(i)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return vK(i)},Eh={},pK=Be,gK=qE,yK=Tt,mK=xr,bK=Ut,$K=Mo;Eh.f=pK&&!gK?Object.defineProperties:function(e,t){mK(e);for(var r=bK(t),n=$K(t),s=n.length,o=0,a;s>o;)yK.f(e,a=n[o++],r[a]);return e};var wK=Kt,EK=wK("document","documentElement"),SK=hs,_K=yh,Cm=SK("keys"),Sh=function(i){return Cm[i]||(Cm[i]=_K(i))},TK=xr,OK=Eh,Dm=ov,IK=ko,xK=EK,PK=KE,CK=Sh,Am=">",Nm="<",Hu="prototype",Vu="script",cS=CK("IE_PROTO"),$c=function(){},uS=function(i){return Nm+Vu+Am+i+Nm+"/"+Vu+Am},Rm=function(i){i.write(uS("")),i.close();var e=i.parentWindow.Object;return i=null,e},DK=function(){var i=PK("iframe"),e="java"+Vu+":",t;return i.style.display="none",xK.appendChild(i),i.src=String(e),t=i.contentWindow.document,t.open(),t.write(uS("document.F=Object")),t.close(),t.F},Ca,rl=function(){try{Ca=new ActiveXObject("htmlfile")}catch{}rl=typeof document<"u"?document.domain&&Ca?Rm(Ca):DK():Rm(Ca);for(var i=Dm.length;i--;)delete rl[Hu][Dm[i]];return rl()};IK[cS]=!0;var Lo=Object.create||function(e,t){var r;return e!==null?($c[Hu]=TK(e),r=new $c,$c[Hu]=null,r[cS]=e):r=rl(),t===void 0?r:OK.f(r,t)},zo={},AK=YE,NK=ov,RK=NK.concat("length","prototype");zo.f=Object.getOwnPropertyNames||function(e){return AK(e,RK)};var _h={},km=Ro,kK=ar,MK=Bo,FK=Array,BK=Math.max,fS=function(i,e,t){for(var r=kK(i),n=km(e,r),s=km(t===void 0?r:t,r),o=FK(BK(s-n,0)),a=0;n<s;n++,a++)MK(o,a,i[n]);return o.length=a,o},jK=Ir,LK=Ut,vS=zo.f,zK=fS,pS=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],HK=function(i){try{return vS(i)}catch{return zK(pS)}};_h.f=function(e){return pS&&jK(e)==="Window"?HK(e):vS(LK(e))};var VK=ds,Ho=function(i,e,t,r){return r&&r.enumerable?i[e]=t:VK(i,e,t),i},WK=Tt,cv=function(i,e,t){return WK.f(i,e,t)},Vo={},UK=Pe;Vo.f=UK;var Mm=ne,KK=Ye,GK=Vo,qK=Tt.f,Te=function(i){var e=Mm.Symbol||(Mm.Symbol={});KK(e,i)||qK(e,i,{value:GK.f(i)})},YK=Wt,XK=Kt,JK=Pe,ZK=Ho,gS=function(){var i=XK("Symbol"),e=i&&i.prototype,t=e&&e.valueOf,r=JK("toPrimitive");e&&!e[r]&&ZK(e,r,function(n){return YK(t,this)},{})},QK=lv,eG=Ki,tG=QK?{}.toString:function(){return"[object "+eG(this)+"]"},rG=lv,iG=Tt.f,nG=ds,sG=Ye,oG=tG,aG=Pe,Fm=aG("toStringTag"),cs=function(i,e,t,r){if(i){var n=t?i:i.prototype;sG(n,Fm)||iG(n,Fm,{configurable:!0,value:e}),r&&!rG&&nG(n,"toString",oG)}},lG=_e,hG=qe,Bm=lG.WeakMap,yS=hG(Bm)&&/native code/.test(String(Bm)),dG=yS,mS=_e,cG=Ze,uG=ds,wc=Ye,Ec=nv,fG=Sh,vG=ko,jm="Object already initialized",Wu=mS.TypeError,pG=mS.WeakMap,Ol,qs,Il,gG=function(i){return Il(i)?qs(i):Ol(i,{})},yG=function(i){return function(e){var t;if(!cG(e)||(t=qs(e)).type!==i)throw new Wu("Incompatible receiver, "+i+" required");return t}};if(dG||Ec.state){var Xt=Ec.state||(Ec.state=new pG);Xt.get=Xt.get,Xt.has=Xt.has,Xt.set=Xt.set,Ol=function(i,e){if(Xt.has(i))throw new Wu(jm);return e.facade=i,Xt.set(i,e),e},qs=function(i){return Xt.get(i)||{}},Il=function(i){return Xt.has(i)}}else{var hn=fG("state");vG[hn]=!0,Ol=function(i,e){if(wc(i,hn))throw new Wu(jm);return e.facade=i,uG(i,hn,e),e},qs=function(i){return wc(i,hn)?i[hn]:{}},Il=function(i){return wc(i,hn)}}var Gi={set:Ol,get:qs,has:Il,enforce:gG,getterFor:yG},mG=bh,bG=re,$G=gh,wG=Nt,EG=ar,SG=dv,Lm=bG([].push),vi=function(i){var e=i===1,t=i===2,r=i===3,n=i===4,s=i===6,o=i===7,a=i===5||s;return function(l,h,d,u){for(var c=wG(l),f=$G(c),v=mG(h,d),g=EG(f),y=0,p=u||SG,m=e?p(l,g):t||o?p(l,0):void 0,w,$;g>y;y++)if((a||y in f)&&(w=f[y],$=v(w,y,c),i))if(e)m[y]=$;else if($)switch(i){case 3:return!0;case 5:return w;case 6:return y;case 2:Lm(m,w)}else switch(i){case 4:return!1;case 7:Lm(m,w)}return s?-1:r||n?n:m}},ai={forEach:vi(0),map:vi(1),filter:vi(2),some:vi(3),every:vi(4),find:vi(5),findIndex:vi(6)},Th=z,Oh=_e,uv=Wt,_G=re,Bn=Be,jn=as,TG=te,He=Ye,OG=Me,Uu=xr,Ih=Ut,fv=mh,IG=lr,Ku=Io,Ys=Lo,bS=Mo,xG=zo,$S=_h,PG=Fo,wS=To,ES=Tt,CG=Eh,SS=Oo,zm=Ho,DG=cv,vv=hs,AG=Sh,_S=ko,Hm=yh,NG=Pe,RG=Vo,kG=Te,MG=gS,FG=cs,TS=Gi,xh=ai.forEach,vt=AG("hidden"),Ph="Symbol",Xs="prototype",BG=TS.set,Vm=TS.getterFor(Ph),zt=Object[Xs],Si=Oh.Symbol,Os=Si&&Si[Xs],jG=Oh.RangeError,LG=Oh.TypeError,Sc=Oh.QObject,OS=wS.f,_i=ES.f,IS=$S.f,zG=SS.f,xS=_G([].push),Sr=vv("symbols"),Wo=vv("op-symbols"),HG=vv("wks"),Gu=!Sc||!Sc[Xs]||!Sc[Xs].findChild,PS=function(i,e,t){var r=OS(zt,e);r&&delete zt[e],_i(i,e,t),r&&i!==zt&&_i(zt,e,r)},qu=Bn&&TG(function(){return Ys(_i({},"a",{get:function(){return _i(this,"a",{value:7}).a}})).a!==7})?PS:_i,_c=function(i,e){var t=Sr[i]=Ys(Os);return BG(t,{type:Ph,tag:i,description:e}),Bn||(t.description=e),t},Ch=function(e,t,r){e===zt&&Ch(Wo,t,r),Uu(e);var n=fv(t);return Uu(r),He(Sr,n)?(r.enumerable?(He(e,vt)&&e[vt][n]&&(e[vt][n]=!1),r=Ys(r,{enumerable:Ku(0,!1)})):(He(e,vt)||_i(e,vt,Ku(1,{})),e[vt][n]=!0),qu(e,n,r)):_i(e,n,r)},pv=function(e,t){Uu(e);var r=Ih(t),n=bS(r).concat(NS(r));return xh(n,function(s){(!Bn||uv(CS,r,s))&&Ch(e,s,r[s])}),e},VG=function(e,t){return t===void 0?Ys(e):pv(Ys(e),t)},CS=function(e){var t=fv(e),r=uv(zG,this,t);return this===zt&&He(Sr,t)&&!He(Wo,t)?!1:r||!He(this,t)||!He(Sr,t)||He(this,vt)&&this[vt][t]?r:!0},DS=function(e,t){var r=Ih(e),n=fv(t);if(!(r===zt&&He(Sr,n)&&!He(Wo,n))){var s=OS(r,n);return s&&He(Sr,n)&&!(He(r,vt)&&r[vt][n])&&(s.enumerable=!0),s}},AS=function(e){var t=IS(Ih(e)),r=[];return xh(t,function(n){!He(Sr,n)&&!He(_S,n)&&xS(r,n)}),r},NS=function(i){var e=i===zt,t=IS(e?Wo:Ih(i)),r=[];return xh(t,function(n){He(Sr,n)&&(!e||He(zt,n))&&xS(r,Sr[n])}),r};jn||(Si=function(){if(OG(Os,this))throw new LG("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:IG(arguments[0]),t=Hm(e),r=function(n){this===zt&&uv(r,Wo,n),He(this,vt)&&He(this[vt],t)&&(this[vt][t]=!1);var s=Ku(1,n);try{qu(this,t,s)}catch(o){if(!(o instanceof jG))throw o;PS(this,t,s)}};return Bn&&Gu&&qu(zt,t,{configurable:!0,set:r}),_c(t,e)},Os=Si[Xs],zm(Os,"toString",function(){return Vm(this).tag}),zm(Si,"withoutSetter",function(i){return _c(Hm(i),i)}),SS.f=CS,ES.f=Ch,CG.f=pv,wS.f=DS,xG.f=$S.f=AS,PG.f=NS,RG.f=function(i){return _c(NG(i),i)},Bn&&DG(Os,"description",{configurable:!0,get:function(){return Vm(this).description}}));Th({global:!0,wrap:!0,forced:!jn,sham:!jn},{Symbol:Si});xh(bS(HG),function(i){kG(i)});Th({target:Ph,stat:!0,forced:!jn},{useSetter:function(){Gu=!0},useSimple:function(){Gu=!1}});Th({target:"Object",stat:!0,forced:!jn,sham:!Bn},{create:VG,defineProperty:Ch,defineProperties:pv,getOwnPropertyDescriptor:DS});Th({target:"Object",stat:!0,forced:!jn},{getOwnPropertyNames:AS});MG();FG(Si,Ph);_S[vt]=!0;var WG=as,RS=WG&&!!Symbol.for&&!!Symbol.keyFor,UG=z,KG=Kt,GG=Ye,qG=lr,kS=hs,YG=RS,Tc=kS("string-to-symbol-registry"),XG=kS("symbol-to-string-registry");UG({target:"Symbol",stat:!0,forced:!YG},{for:function(i){var e=qG(i);if(GG(Tc,e))return Tc[e];var t=KG("Symbol")(e);return Tc[e]=t,XG[t]=e,t}});var JG=z,ZG=Ye,QG=Do,eq=Ao,tq=hs,rq=RS,Wm=tq("symbol-to-string-registry");JG({target:"Symbol",stat:!0,forced:!rq},{keyFor:function(e){if(!QG(e))throw new TypeError(eq(e)+" is not a symbol");if(ZG(Wm,e))return Wm[e]}});var iq=re,Um=Ui,nq=qe,Km=Ir,sq=lr,Gm=iq([].push),oq=function(i){if(nq(i))return i;if(Um(i)){for(var e=i.length,t=[],r=0;r<e;r++){var n=i[r];typeof n=="string"?Gm(t,n):(typeof n=="number"||Km(n)==="Number"||Km(n)==="String")&&Gm(t,sq(n))}var s=t.length,o=!0;return function(a,l){if(o)return o=!1,l;if(Um(this))return l;for(var h=0;h<s;h++)if(t[h]===a)return l}}},aq=z,MS=Kt,FS=ph,lq=Wt,Uo=re,BS=te,qm=qe,Ym=Do,jS=wh,hq=oq,dq=as,cq=String,qr=MS("JSON","stringify"),Da=Uo(/./.exec),Xm=Uo("".charAt),uq=Uo("".charCodeAt),fq=Uo("".replace),vq=Uo(1 .toString),pq=/[\uD800-\uDFFF]/g,Jm=/^[\uD800-\uDBFF]$/,Zm=/^[\uDC00-\uDFFF]$/,Qm=!dq||BS(function(){var i=MS("Symbol")("stringify detection");return qr([i])!=="[null]"||qr({a:i})!=="{}"||qr(Object(i))!=="{}"}),eb=BS(function(){return qr("\uDF06\uD834")!=='"\\udf06\\ud834"'||qr("\uDEAD")!=='"\\udead"'}),gq=function(i,e){var t=jS(arguments),r=hq(e);if(!(!qm(r)&&(i===void 0||Ym(i))))return t[1]=function(n,s){if(qm(r)&&(s=lq(r,this,cq(n),s)),!Ym(s))return s},FS(qr,null,t)},yq=function(i,e,t){var r=Xm(t,e-1),n=Xm(t,e+1);return Da(Jm,i)&&!Da(Zm,n)||Da(Zm,i)&&!Da(Jm,r)?"\\u"+vq(uq(i,0),16):i};qr&&aq({target:"JSON",stat:!0,forced:Qm||eb},{stringify:function(e,t,r){var n=jS(arguments),s=FS(Qm?gq:qr,null,n);return eb&&typeof s=="string"?fq(s,pq,yq):s}});var mq=z,bq=as,$q=te,LS=Fo,wq=Nt,Eq=!bq||$q(function(){LS.f(1)});mq({target:"Object",stat:!0,forced:Eq},{getOwnPropertySymbols:function(e){var t=LS.f;return t?t(wq(e)):[]}});var Sq=Te;Sq("asyncIterator");var _q=Te;_q("hasInstance");var Tq=Te;Tq("isConcatSpreadable");var Oq=Te;Oq("iterator");var Iq=Te;Iq("match");var xq=Te;xq("matchAll");var Pq=Te;Pq("replace");var Cq=Te;Cq("search");var Dq=Te;Dq("species");var Aq=Te;Aq("split");var Nq=Te,Rq=gS;Nq("toPrimitive");Rq();var kq=Kt,Mq=Te,Fq=cs;Mq("toStringTag");Fq(kq("Symbol"),"Symbol");var Bq=Te;Bq("unscopables");var jq=_e,Lq=cs;Lq(jq.JSON,"JSON",!0);var zq=ne,Hq=zq.Symbol,us={},Yu=Be,Vq=Ye,zS=Function.prototype,Wq=Yu&&Object.getOwnPropertyDescriptor,HS=Vq(zS,"name"),Uq=HS&&function(){}.name==="something";HS&&(!Yu||Yu&&Wq(zS,"name").configurable);var Kq={PROPER:Uq},Gq=te,VS=!Gq(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype}),qq=Ye,Yq=qe,Xq=Nt,Jq=Sh,Zq=VS,tb=Jq("IE_PROTO"),Xu=Object,Qq=Xu.prototype,Dh=Zq?Xu.getPrototypeOf:function(i){var e=Xq(i);if(qq(e,tb))return e[tb];var t=e.constructor;return Yq(t)&&e instanceof t?t.prototype:e instanceof Xu?Qq:null},eY=te,tY=qe,rY=Ze,iY=Lo,rb=Dh,nY=Ho,sY=Pe,Ju=sY("iterator"),WS=!1,gr,Oc,Ic;[].keys&&(Ic=[].keys(),"next"in Ic?(Oc=rb(rb(Ic)),Oc!==Object.prototype&&(gr=Oc)):WS=!0);var oY=!rY(gr)||eY(function(){var i={};return gr[Ju].call(i)!==i});oY?gr={}:gr=iY(gr);tY(gr[Ju])||nY(gr,Ju,function(){return this});var US={IteratorPrototype:gr,BUGGY_SAFARI_ITERATORS:WS},aY=US.IteratorPrototype,lY=Lo,hY=Io,dY=cs,cY=us,uY=function(){return this},fY=function(i,e,t,r){var n=e+" Iterator";return i.prototype=lY(aY,{next:hY(+!r,t)}),dY(i,n,!1,!0),cY[n]=uY,i},vY=z,pY=Wt,gY=Kq,yY=fY,mY=Dh,bY=cs,ib=Ho,$Y=Pe,nb=us,wY=US,EY=gY.PROPER,Aa=wY.BUGGY_SAFARI_ITERATORS,xc=$Y("iterator"),sb="keys",Na="values",ob="entries",SY=function(){return this},gv=function(i,e,t,r,n,s,o){yY(t,e,r);var a=function(p){if(p===n&&c)return c;if(!Aa&&p&&p in d)return d[p];switch(p){case sb:return function(){return new t(this,p)};case Na:return function(){return new t(this,p)};case ob:return function(){return new t(this,p)}}return function(){return new t(this)}},l=e+" Iterator",h=!1,d=i.prototype,u=d[xc]||d["@@iterator"]||n&&d[n],c=!Aa&&u||a(n),f=e==="Array"&&d.entries||u,v,g,y;if(f&&(v=mY(f.call(new i)),v!==Object.prototype&&v.next&&(bY(v,l,!0,!0),nb[l]=SY)),EY&&n===Na&&u&&u.name!==Na&&(h=!0,c=function(){return pY(u,this)}),n)if(g={values:a(Na),keys:s?c:a(sb),entries:a(ob)},o)for(y in g)(Aa||h||!(y in d))&&ib(d,y,g[y]);else vY({target:e,proto:!0,forced:Aa||h},g);return o&&d[xc]!==c&&ib(d,xc,c,{}),nb[e]=c,g},yv=function(i,e){return{value:i,done:e}},_Y=Ut,ab=us,KS=Gi;Tt.f;var TY=gv,Ra=yv,GS="Array Iterator",OY=KS.set,IY=KS.getterFor(GS);TY(Array,"Array",function(i,e){OY(this,{type:GS,target:_Y(i),index:0,kind:e})},function(){var i=IY(this),e=i.target,t=i.kind,r=i.index++;if(!e||r>=e.length)return i.target=void 0,Ra(void 0,!0);switch(t){case"keys":return Ra(r,!1);case"values":return Ra(e[r],!1)}return Ra([r,e[r]],!1)},"values");ab.Arguments=ab.Array;var xY={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},PY=xY,CY=_e,DY=Ki,AY=ds,lb=us,NY=Pe,hb=NY("toStringTag");for(var Pc in PY){var db=CY[Pc],Cc=db&&db.prototype;Cc&&DY(Cc)!==hb&&AY(Cc,hb,Pc),lb[Pc]=lb.Array}var RY=Hq,qS=RY,kY=qS,MY=V(kY),FY=z,cb=Ui,BY=hS,jY=Ze,ub=Ro,LY=ar,zY=Ut,HY=Bo,VY=Pe,WY=jo,UY=wh,KY=WY("slice"),GY=VY("species"),Dc=Array,qY=Math.max;FY({target:"Array",proto:!0,forced:!KY},{slice:function(e,t){var r=zY(this),n=LY(r),s=ub(e,n),o=ub(t===void 0?n:t,n),a,l,h;if(cb(r)&&(a=r.constructor,BY(a)&&(a===Dc||cb(a.prototype))?a=void 0:jY(a)&&(a=a[GY],a===null&&(a=void 0)),a===Dc||a===void 0))return UY(r,s,o);for(l=new(a===void 0?Dc:a)(qY(o-s,0)),h=0;s<o;s++,h++)s in r&&HY(l,h,r[s]);return l.length=h,l}});var YY=Xe,XY=YY("Array").slice,JY=Me,ZY=XY,Ac=Array.prototype,QY=function(i){var e=i.slice;return i===Ac||JY(Ac,i)&&e===Ac.slice?ZY:e},eX=QY,tX=eX,rX=tX,Zt=V(rX),iX=Kt,nX=re,sX=zo,oX=Fo,aX=xr,lX=nX([].concat),hX=iX("Reflect","ownKeys")||function(e){var t=sX.f(aX(e)),r=oX.f;return r?lX(t,r(e)):t},dX=z,cX=Ui;dX({target:"Array",stat:!0},{isArray:cX});var uX=ne,fX=uX.Array.isArray,vX=fX,pX=vX,gX=pX,we=V(gX),yX=z,mX=ai.map,bX=jo,$X=bX("map");yX({target:"Array",proto:!0,forced:!$X},{map:function(e){return mX(this,e,arguments.length>1?arguments[1]:void 0)}});var wX=Xe,EX=wX("Array").map,SX=Me,_X=EX,Nc=Array.prototype,TX=function(i){var e=i.map;return i===Nc||SX(Nc,i)&&e===Nc.map?_X:e},OX=TX,IX=OX,xX=IX,Ln=V(xX),PX=z,CX=Nt,YS=Mo,DX=te,AX=DX(function(){YS(1)});PX({target:"Object",stat:!0,forced:AX},{keys:function(e){return YS(CX(e))}});var NX=ne,RX=NX.Object.keys,kX=RX,MX=kX,FX=MX,$e=V(FX),BX=z,jX=re,XS=Date,LX=jX(XS.prototype.getTime);BX({target:"Date",stat:!0},{now:function(){return LX(new XS)}});var zX=ne,HX=zX.Date.now,VX=HX,WX=VX,UX=WX,xl=V(UX),KX=te,fs=function(i,e){var t=[][i];return!!t&&KX(function(){t.call(null,e||function(){return 1},1)})},GX=ai.forEach,qX=fs,YX=qX("forEach"),XX=YX?[].forEach:function(e){return GX(this,e,arguments.length>1?arguments[1]:void 0)},JX=z,fb=XX;JX({target:"Array",proto:!0,forced:[].forEach!==fb},{forEach:fb});var ZX=Xe,QX=ZX("Array").forEach,eJ=QX,tJ=eJ,rJ=Ki,iJ=Ye,nJ=Me,sJ=tJ,Rc=Array.prototype,oJ={DOMTokenList:!0,NodeList:!0},aJ=function(i){var e=i.forEach;return i===Rc||nJ(Rc,i)&&e===Rc.forEach||iJ(oJ,rJ(i))?sJ:e},lJ=aJ,oe=V(lJ),hJ=z,dJ=re,cJ=Ui,uJ=dJ([].reverse),vb=[1,2];hJ({target:"Array",proto:!0,forced:String(vb)===String(vb.reverse())},{reverse:function(){return cJ(this)&&(this.length=this.length),uJ(this)}});var fJ=Xe,vJ=fJ("Array").reverse,pJ=Me,gJ=vJ,kc=Array.prototype,yJ=function(i){var e=i.reverse;return i===kc||pJ(kc,i)&&e===kc.reverse?gJ:e},mJ=yJ,bJ=mJ,$J=bJ,Ti=V($J),wJ=Be,EJ=Ui,SJ=TypeError,_J=Object.getOwnPropertyDescriptor,TJ=wJ&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(i){return i instanceof TypeError}}(),OJ=TJ?function(i,e){if(EJ(i)&&!_J(i,"length").writable)throw new SJ("Cannot set read only .length");return i.length=e}:function(i,e){return i.length=e},pb=Ao,IJ=TypeError,JS=function(i,e){if(!delete i[e])throw new IJ("Cannot delete property "+pb(e)+" of "+pb(i))},xJ=z,PJ=Nt,CJ=Ro,DJ=$h,AJ=ar,NJ=OJ,RJ=iS,kJ=dv,MJ=Bo,Mc=JS,FJ=jo,BJ=FJ("splice"),jJ=Math.max,LJ=Math.min;xJ({target:"Array",proto:!0,forced:!BJ},{splice:function(e,t){var r=PJ(this),n=AJ(r),s=CJ(e,n),o=arguments.length,a,l,h,d,u,c;for(o===0?a=l=0:o===1?(a=0,l=n-s):(a=o-2,l=LJ(jJ(DJ(t),0),n-s)),RJ(n+a-l),h=kJ(r,l),d=0;d<l;d++)u=s+d,u in r&&MJ(h,d,r[u]);if(h.length=l,a<l){for(d=s;d<n-l;d++)u=d+l,c=d+a,u in r?r[c]=r[u]:Mc(r,c);for(d=n;d>n-l+a;d--)Mc(r,d-1)}else if(a>l)for(d=n-l;d>s;d--)u=d+l-1,c=d+a-1,u in r?r[c]=r[u]:Mc(r,c);for(d=0;d<a;d++)r[d+s]=arguments[d+2];return NJ(r,n-l+a),h}});var zJ=Xe,HJ=zJ("Array").splice,VJ=Me,WJ=HJ,Fc=Array.prototype,UJ=function(i){var e=i.splice;return i===Fc||VJ(Fc,i)&&e===Fc.splice?WJ:e},KJ=UJ,GJ=KJ,qJ=GJ,yr=V(qJ),YJ=z,XJ=sv.includes,JJ=te,ZJ=JJ(function(){return!Array(1).includes()});YJ({target:"Array",proto:!0,forced:ZJ},{includes:function(e){return XJ(this,e,arguments.length>1?arguments[1]:void 0)}});var QJ=Xe,eZ=QJ("Array").includes,tZ=Ze,rZ=Ir,iZ=Pe,nZ=iZ("match"),sZ=function(i){var e;return tZ(i)&&((e=i[nZ])!==void 0?!!e:rZ(i)==="RegExp")},oZ=sZ,aZ=TypeError,lZ=function(i){if(oZ(i))throw new aZ("The method doesn't accept regular expressions");return i},hZ=Pe,dZ=hZ("match"),cZ=function(i){var e=/./;try{"/./"[i](e)}catch{try{return e[dZ]=!1,"/./"[i](e)}catch{}}return!1},uZ=z,fZ=re,vZ=lZ,pZ=xo,gb=lr,gZ=cZ,yZ=fZ("".indexOf);uZ({target:"String",proto:!0,forced:!gZ("includes")},{includes:function(e){return!!~yZ(gb(pZ(this)),gb(vZ(e)),arguments.length>1?arguments[1]:void 0)}});var mZ=Xe,bZ=mZ("String").includes,yb=Me,$Z=eZ,wZ=bZ,Bc=Array.prototype,jc=String.prototype,EZ=function(i){var e=i.includes;return i===Bc||yb(Bc,i)&&e===Bc.includes?$Z:typeof i=="string"||i===jc||yb(jc,i)&&e===jc.includes?wZ:e},SZ=EZ,_Z=SZ,TZ=_Z,Yr=V(TZ),OZ=z,IZ=te,xZ=Nt,ZS=Dh,PZ=VS,CZ=IZ(function(){ZS(1)});OZ({target:"Object",stat:!0,forced:CZ,sham:!PZ},{getPrototypeOf:function(e){return ZS(xZ(e))}});var DZ=ne,AZ=DZ.Object.getPrototypeOf,NZ=AZ,RZ=NZ,kZ=RZ,mb=V(kZ),MZ=Xe,FZ=MZ("Array").concat,BZ=Me,jZ=FZ,Lc=Array.prototype,LZ=function(i){var e=i.concat;return i===Lc||BZ(Lc,i)&&e===Lc.concat?jZ:e},zZ=LZ,HZ=zZ,VZ=HZ,WZ=V(VZ),UZ=z,KZ=ai.filter,GZ=jo,qZ=GZ("filter");UZ({target:"Array",proto:!0,forced:!qZ},{filter:function(e){return KZ(this,e,arguments.length>1?arguments[1]:void 0)}});var YZ=Xe,XZ=YZ("Array").filter,JZ=Me,ZZ=XZ,zc=Array.prototype,QZ=function(i){var e=i.filter;return i===zc||JZ(zc,i)&&e===zc.filter?ZZ:e},eQ=QZ,tQ=eQ,rQ=tQ,pt=V(rQ),QS=Be,iQ=te,e_=re,nQ=Dh,sQ=Mo,oQ=Ut,aQ=Oo.f,t_=e_(aQ),lQ=e_([].push),hQ=QS&&iQ(function(){var i=Object.create(null);return i[2]=2,!t_(i,2)}),dQ=function(i){return function(e){for(var t=oQ(e),r=sQ(t),n=hQ&&nQ(t)===null,s=r.length,o=0,a=[],l;s>o;)l=r[o++],(!QS||(n?l in t:t_(t,l)))&&lQ(a,i?[l,t[l]]:t[l]);return a}},cQ={values:dQ(!1)},uQ=z,fQ=cQ.values;uQ({target:"Object",stat:!0},{values:function(e){return fQ(e)}});var vQ=ne,pQ=vQ.Object.values,gQ=pQ,yQ=gQ,mQ=yQ,bQ=V(mQ),mv=`
|
||
\v\f\r \u2028\u2029\uFEFF`,$Q=re,wQ=xo,EQ=lr,Zu=mv,bb=$Q("".replace),SQ=RegExp("^["+Zu+"]+"),_Q=RegExp("(^|[^"+Zu+"])["+Zu+"]+$"),TQ=function(i){return function(e){var t=EQ(wQ(e));return i&1&&(t=bb(t,SQ,"")),i&2&&(t=bb(t,_Q,"$1")),t}},r_={trim:TQ(3)},i_=_e,OQ=te,IQ=re,xQ=lr,PQ=r_.trim,$b=mv,Ns=i_.parseInt,wb=i_.Symbol,Eb=wb&&wb.iterator,n_=/^[+-]?0x/i,CQ=IQ(n_.exec),DQ=Ns($b+"08")!==8||Ns($b+"0x16")!==22||Eb&&!OQ(function(){Ns(Object(Eb))}),AQ=DQ?function(e,t){var r=PQ(xQ(e));return Ns(r,t>>>0||(CQ(n_,r)?16:10))}:Ns,NQ=z,Sb=AQ;NQ({global:!0,forced:parseInt!==Sb},{parseInt:Sb});var RQ=ne,kQ=RQ.parseInt,MQ=kQ,FQ=MQ,BQ=FQ,jt=V(BQ),jQ=z,LQ=rv,zQ=sv.indexOf,HQ=fs,Qu=LQ([].indexOf),s_=!!Qu&&1/Qu([1],1,-0)<0,VQ=s_||!HQ("indexOf");jQ({target:"Array",proto:!0,forced:VQ},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return s_?Qu(this,e,t)||0:zQ(this,e,t)}});var WQ=Xe,UQ=WQ("Array").indexOf,KQ=Me,GQ=UQ,Hc=Array.prototype,qQ=function(i){var e=i.indexOf;return i===Hc||KQ(Hc,i)&&e===Hc.indexOf?GQ:e},YQ=qQ,XQ=YQ,JQ=XQ,ee=V(JQ),ZQ=z,QQ=Be,eee=Lo;ZQ({target:"Object",stat:!0,sham:!QQ},{create:eee});var tee=ne,ree=tee.Object,iee=function(e,t){return ree.create(e,t)},nee=iee,see=nee,oee=see,Oi=V(oee),ef=ne,aee=ph;ef.JSON||(ef.JSON={stringify:JSON.stringify});var lee=function(e,t,r){return aee(ef.JSON.stringify,null,arguments)},hee=lee,dee=hee,cee=dee,Ko=V(cee),uee=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",fee=TypeError,vee=function(i,e){if(i<e)throw new fee("Not enough arguments");return i},o_=_e,pee=ph,gee=qe,yee=uee,mee=Po,bee=wh,$ee=vee,wee=o_.Function,Eee=/MSIE .\./.test(mee)||yee&&function(){var i=o_.Bun.version.split(".");return i.length<3||i[0]==="0"&&(i[1]<3||i[1]==="3"&&i[2]==="0")}(),a_=function(i,e){var t=e?2:1;return Eee?function(r,n){var s=$ee(arguments.length,1)>t,o=gee(r)?r:wee(r),a=s?bee(arguments,t):[],l=s?function(){pee(o,this,a)}:o;return e?i(l,n):i(l)}:i},See=z,l_=_e,_ee=a_,_b=_ee(l_.setInterval,!0);See({global:!0,bind:!0,forced:l_.setInterval!==_b},{setInterval:_b});var Tee=z,h_=_e,Oee=a_,Tb=Oee(h_.setTimeout,!0);Tee({global:!0,bind:!0,forced:h_.setTimeout!==Tb},{setTimeout:Tb});var Iee=ne,xee=Iee.setTimeout,Pee=xee,ir=V(Pee),Cee=Nt,Ob=Ro,Dee=ar,Aee=function(e){for(var t=Cee(this),r=Dee(t),n=arguments.length,s=Ob(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,a=o===void 0?r:Ob(o,r);a>s;)t[s++]=e;return t},Nee=z,Ree=Aee;Nee({target:"Array",proto:!0},{fill:Ree});var kee=Xe,Mee=kee("Array").fill,Fee=Me,Bee=Mee,Vc=Array.prototype,jee=function(i){var e=i.fill;return i===Vc||Fee(Vc,i)&&e===Vc.fill?Bee:e},Lee=jee,zee=Lee,Hee=zee,Go=V(Hee);/*! Hammer.JS - v2.0.17-rc - 2019-12-16
|
||
* http://naver.github.io/egjs
|
||
*
|
||
* Forked By Naver egjs
|
||
* Copyright (c) hammerjs
|
||
* Licensed under the MIT license */function Vt(){return Vt=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Vt.apply(this,arguments)}function Rt(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}function ka(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}var tf;typeof Object.assign!="function"?tf=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r<arguments.length;r++){var n=arguments[r];if(n!=null)for(var s in n)n.hasOwnProperty(s)&&(t[s]=n[s])}return t}:tf=Object.assign;var Ri=tf,Ib=["","webkit","Moz","MS","ms","o"],Vee=typeof document>"u"?{style:{}}:document.createElement("div"),Wee="function",Sn=Math.round,ki=Math.abs,bv=Date.now;function Ah(i,e){for(var t,r,n=e[0].toUpperCase()+e.slice(1),s=0;s<Ib.length;){if(t=Ib[s],r=t?t+n:e,r in i)return r;s++}}var mr;typeof window>"u"?mr={}:mr=window;var d_=Ah(Vee.style,"touchAction"),c_=d_!==void 0;function Uee(){if(!c_)return!1;var i={},e=mr.CSS&&mr.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return i[t]=e?mr.CSS.supports("touch-action",t):!0}),i}var u_="compute",f_="auto",rf="manipulation",Ii="none",Js="pan-x",Zs="pan-y",Ma=Uee(),Kee=/mobile|tablet|ip(ad|hone|od)|android/i,v_="ontouchstart"in mr,Gee=Ah(mr,"PointerEvent")!==void 0,qee=v_&&Kee.test(navigator.userAgent),qo="touch",Yee="pen",$v="mouse",Xee="kinect",Jee=25,ot=1,qi=2,Ne=4,yt=8,Pl=1,Yo=2,Xo=4,Jo=8,zn=16,nr=Yo|Xo,xi=Jo|zn,p_=nr|xi,g_=["x","y"],Cl=["clientX","clientY"];function br(i,e,t){var r;if(i)if(i.forEach)i.forEach(e,t);else if(i.length!==void 0)for(r=0;r<i.length;)e.call(t,i[r],r,i),r++;else for(r in i)i.hasOwnProperty(r)&&e.call(t,i[r],r,i)}function Nh(i,e){return typeof i===Wee?i.apply(e&&e[0]||void 0,e):i}function yi(i,e){return i.indexOf(e)>-1}function Zee(i){if(yi(i,Ii))return Ii;var e=yi(i,Js),t=yi(i,Zs);return e&&t?Ii:e||t?e?Js:Zs:yi(i,rf)?rf:f_}var y_=function(){function i(t,r){this.manager=t,this.set(r)}var e=i.prototype;return e.set=function(r){r===u_&&(r=this.compute()),c_&&this.manager.element.style&&Ma[r]&&(this.manager.element.style[d_]=r),this.actions=r.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var r=[];return br(this.manager.recognizers,function(n){Nh(n.options.enable,[n])&&(r=r.concat(n.getTouchAction()))}),Zee(r.join(" "))},e.preventDefaults=function(r){var n=r.srcEvent,s=r.offsetDirection;if(this.manager.session.prevented){n.preventDefault();return}var o=this.actions,a=yi(o,Ii)&&!Ma[Ii],l=yi(o,Zs)&&!Ma[Zs],h=yi(o,Js)&&!Ma[Js];if(a){var d=r.pointers.length===1,u=r.distance<2,c=r.deltaTime<250;if(d&&u&&c)return}if(!(h&&l)&&(a||l&&s&nr||h&&s&xi))return this.preventSrc(n)},e.preventSrc=function(r){this.manager.session.prevented=!0,r.preventDefault()},i}();function wv(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}function m_(i){var e=i.length;if(e===1)return{x:Sn(i[0].clientX),y:Sn(i[0].clientY)};for(var t=0,r=0,n=0;n<e;)t+=i[n].clientX,r+=i[n].clientY,n++;return{x:Sn(t/e),y:Sn(r/e)}}function xb(i){for(var e=[],t=0;t<i.pointers.length;)e[t]={clientX:Sn(i.pointers[t].clientX),clientY:Sn(i.pointers[t].clientY)},t++;return{timeStamp:bv(),pointers:e,center:m_(e),deltaX:i.deltaX,deltaY:i.deltaY}}function Dl(i,e,t){t||(t=g_);var r=e[t[0]]-i[t[0]],n=e[t[1]]-i[t[1]];return Math.sqrt(r*r+n*n)}function nf(i,e,t){t||(t=g_);var r=e[t[0]]-i[t[0]],n=e[t[1]]-i[t[1]];return Math.atan2(n,r)*180/Math.PI}function b_(i,e){return i===e?Pl:ki(i)>=ki(e)?i<0?Yo:Xo:e<0?Jo:zn}function Qee(i,e){var t=e.center,r=i.offsetDelta||{},n=i.prevDelta||{},s=i.prevInput||{};(e.eventType===ot||s.eventType===Ne)&&(n=i.prevDelta={x:s.deltaX||0,y:s.deltaY||0},r=i.offsetDelta={x:t.x,y:t.y}),e.deltaX=n.x+(t.x-r.x),e.deltaY=n.y+(t.y-r.y)}function $_(i,e,t){return{x:e/i||0,y:t/i||0}}function ete(i,e){return Dl(e[0],e[1],Cl)/Dl(i[0],i[1],Cl)}function tte(i,e){return nf(e[1],e[0],Cl)+nf(i[1],i[0],Cl)}function rte(i,e){var t=i.lastInterval||e,r=e.timeStamp-t.timeStamp,n,s,o,a;if(e.eventType!==yt&&(r>Jee||t.velocity===void 0)){var l=e.deltaX-t.deltaX,h=e.deltaY-t.deltaY,d=$_(r,l,h);s=d.x,o=d.y,n=ki(d.x)>ki(d.y)?d.x:d.y,a=b_(l,h),i.lastInterval=e}else n=t.velocity,s=t.velocityX,o=t.velocityY,a=t.direction;e.velocity=n,e.velocityX=s,e.velocityY=o,e.direction=a}function ite(i,e){var t=i.session,r=e.pointers,n=r.length;t.firstInput||(t.firstInput=xb(e)),n>1&&!t.firstMultiple?t.firstMultiple=xb(e):n===1&&(t.firstMultiple=!1);var s=t.firstInput,o=t.firstMultiple,a=o?o.center:s.center,l=e.center=m_(r);e.timeStamp=bv(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=nf(a,l),e.distance=Dl(a,l),Qee(t,e),e.offsetDirection=b_(e.deltaX,e.deltaY);var h=$_(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=h.x,e.overallVelocityY=h.y,e.overallVelocity=ki(h.x)>ki(h.y)?h.x:h.y,e.scale=o?ete(o.pointers,r):1,e.rotation=o?tte(o.pointers,r):0,e.maxPointers=t.prevInput?e.pointers.length>t.prevInput.maxPointers?e.pointers.length:t.prevInput.maxPointers:e.pointers.length,rte(t,e);var d=i.element,u=e.srcEvent,c;u.composedPath?c=u.composedPath()[0]:u.path?c=u.path[0]:c=u.target,wv(c,d)&&(d=c),e.target=d}function nte(i,e,t){var r=t.pointers.length,n=t.changedPointers.length,s=e&ot&&r-n===0,o=e&(Ne|yt)&&r-n===0;t.isFirst=!!s,t.isFinal=!!o,s&&(i.session={}),t.eventType=e,ite(i,t),i.emit("hammer.input",t),i.recognize(t),i.session.prevInput=t}function Qs(i){return i.trim().split(/\s+/g)}function Rs(i,e,t){br(Qs(e),function(r){i.addEventListener(r,t,!1)})}function ks(i,e,t){br(Qs(e),function(r){i.removeEventListener(r,t,!1)})}function Pb(i){var e=i.ownerDocument||i;return e.defaultView||e.parentWindow||window}var vs=function(){function i(t,r){var n=this;this.manager=t,this.callback=r,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(s){Nh(t.options.enable,[t])&&n.handler(s)},this.init()}var e=i.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Rs(this.element,this.evEl,this.domHandler),this.evTarget&&Rs(this.target,this.evTarget,this.domHandler),this.evWin&&Rs(Pb(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&ks(this.element,this.evEl,this.domHandler),this.evTarget&&ks(this.target,this.evTarget,this.domHandler),this.evWin&&ks(Pb(this.element),this.evWin,this.domHandler)},i}();function Mi(i,e,t){if(i.indexOf&&!t)return i.indexOf(e);for(var r=0;r<i.length;){if(t&&i[r][t]==e||!t&&i[r]===e)return r;r++}return-1}var ste={pointerdown:ot,pointermove:qi,pointerup:Ne,pointercancel:yt,pointerout:yt},ote={2:qo,3:Yee,4:$v,5:Xee},w_="pointerdown",E_="pointermove pointerup pointercancel";mr.MSPointerEvent&&!mr.PointerEvent&&(w_="MSPointerDown",E_="MSPointerMove MSPointerUp MSPointerCancel");var S_=function(i){Rt(e,i);function e(){var r,n=e.prototype;return n.evEl=w_,n.evWin=E_,r=i.apply(this,arguments)||this,r.store=r.manager.session.pointerEvents=[],r}var t=e.prototype;return t.handler=function(n){var s=this.store,o=!1,a=n.type.toLowerCase().replace("ms",""),l=ste[a],h=ote[n.pointerType]||n.pointerType,d=h===qo,u=Mi(s,n.pointerId,"pointerId");l&ot&&(n.button===0||d)?u<0&&(s.push(n),u=s.length-1):l&(Ne|yt)&&(o=!0),!(u<0)&&(s[u]=n,this.callback(this.manager,l,{pointers:s,changedPointers:[n],pointerType:h,srcEvent:n}),o&&s.splice(u,1))},e}(vs);function eo(i){return Array.prototype.slice.call(i,0)}function Ev(i,e,t){for(var r=[],n=[],s=0;s<i.length;){var o=e?i[s][e]:i[s];Mi(n,o)<0&&r.push(i[s]),n[s]=o,s++}return t&&(e?r=r.sort(function(a,l){return a[e]>l[e]}):r=r.sort()),r}var ate={touchstart:ot,touchmove:qi,touchend:Ne,touchcancel:yt},lte="touchstart touchmove touchend touchcancel",Sv=function(i){Rt(e,i);function e(){var r;return e.prototype.evTarget=lte,r=i.apply(this,arguments)||this,r.targetIds={},r}var t=e.prototype;return t.handler=function(n){var s=ate[n.type],o=hte.call(this,n,s);o&&this.callback(this.manager,s,{pointers:o[0],changedPointers:o[1],pointerType:qo,srcEvent:n})},e}(vs);function hte(i,e){var t=eo(i.touches),r=this.targetIds;if(e&(ot|qi)&&t.length===1)return r[t[0].identifier]=!0,[t,t];var n,s,o=eo(i.changedTouches),a=[],l=this.target;if(s=t.filter(function(h){return wv(h.target,l)}),e===ot)for(n=0;n<s.length;)r[s[n].identifier]=!0,n++;for(n=0;n<o.length;)r[o[n].identifier]&&a.push(o[n]),e&(Ne|yt)&&delete r[o[n].identifier],n++;if(a.length)return[Ev(s.concat(a),"identifier",!0),a]}var dte={mousedown:ot,mousemove:qi,mouseup:Ne},cte="mousedown",ute="mousemove mouseup",_v=function(i){Rt(e,i);function e(){var r,n=e.prototype;return n.evEl=cte,n.evWin=ute,r=i.apply(this,arguments)||this,r.pressed=!1,r}var t=e.prototype;return t.handler=function(n){var s=dte[n.type];s&ot&&n.button===0&&(this.pressed=!0),s&qi&&n.which!==1&&(s=Ne),this.pressed&&(s&Ne&&(this.pressed=!1),this.callback(this.manager,s,{pointers:[n],changedPointers:[n],pointerType:$v,srcEvent:n}))},e}(vs),fte=2500,Cb=25;function Db(i){var e=i.changedPointers,t=e[0];if(t.identifier===this.primaryTouch){var r={x:t.clientX,y:t.clientY},n=this.lastTouches;this.lastTouches.push(r);var s=function(){var a=n.indexOf(r);a>-1&&n.splice(a,1)};setTimeout(s,fte)}}function vte(i,e){i&ot?(this.primaryTouch=e.changedPointers[0].identifier,Db.call(this,e)):i&(Ne|yt)&&Db.call(this,e)}function pte(i){for(var e=i.srcEvent.clientX,t=i.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var n=this.lastTouches[r],s=Math.abs(e-n.x),o=Math.abs(t-n.y);if(s<=Cb&&o<=Cb)return!0}return!1}var __=function(){var i=function(e){Rt(t,e);function t(n,s){var o;return o=e.call(this,n,s)||this,o.handler=function(a,l,h){var d=h.pointerType===qo,u=h.pointerType===$v;if(!(u&&h.sourceCapabilities&&h.sourceCapabilities.firesTouchEvents)){if(d)vte.call(ka(ka(o)),l,h);else if(u&&pte.call(ka(ka(o)),h))return;o.callback(a,l,h)}},o.touch=new Sv(o.manager,o.handler),o.mouse=new _v(o.manager,o.handler),o.primaryTouch=null,o.lastTouches=[],o}var r=t.prototype;return r.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(vs);return i}();function gte(i){var e,t=i.options.inputClass;return t?e=t:Gee?e=S_:qee?e=Sv:v_?e=__:e=_v,new e(i,nte)}function _n(i,e,t){return Array.isArray(i)?(br(i,t[e],t),!0):!1}var il=1,Dt=2,Hn=4,Xr=8,$r=Xr,to=16,er=32,yte=1;function mte(){return yte++}function Fa(i,e){var t=e.manager;return t?t.get(i):i}function Ab(i){return i&to?"cancel":i&Xr?"end":i&Hn?"move":i&Dt?"start":""}var Zo=function(){function i(t){t===void 0&&(t={}),this.options=Vt({enable:!0},t),this.id=mte(),this.manager=null,this.state=il,this.simultaneous={},this.requireFail=[]}var e=i.prototype;return e.set=function(r){return Ri(this.options,r),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(r){if(_n(r,"recognizeWith",this))return this;var n=this.simultaneous;return r=Fa(r,this),n[r.id]||(n[r.id]=r,r.recognizeWith(this)),this},e.dropRecognizeWith=function(r){return _n(r,"dropRecognizeWith",this)?this:(r=Fa(r,this),delete this.simultaneous[r.id],this)},e.requireFailure=function(r){if(_n(r,"requireFailure",this))return this;var n=this.requireFail;return r=Fa(r,this),Mi(n,r)===-1&&(n.push(r),r.requireFailure(this)),this},e.dropRequireFailure=function(r){if(_n(r,"dropRequireFailure",this))return this;r=Fa(r,this);var n=Mi(this.requireFail,r);return n>-1&&this.requireFail.splice(n,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(r){return!!this.simultaneous[r.id]},e.emit=function(r){var n=this,s=this.state;function o(a){n.manager.emit(a,r)}s<Xr&&o(n.options.event+Ab(s)),o(n.options.event),r.additionalEvent&&o(r.additionalEvent),s>=Xr&&o(n.options.event+Ab(s))},e.tryEmit=function(r){if(this.canEmit())return this.emit(r);this.state=er},e.canEmit=function(){for(var r=0;r<this.requireFail.length;){if(!(this.requireFail[r].state&(er|il)))return!1;r++}return!0},e.recognize=function(r){var n=Ri({},r);if(!Nh(this.options.enable,[this,n])){this.reset(),this.state=er;return}this.state&($r|to|er)&&(this.state=il),this.state=this.process(n),this.state&(Dt|Hn|Xr|to)&&this.tryEmit(n)},e.process=function(r){},e.getTouchAction=function(){},e.reset=function(){},i}(),sf=function(i){Rt(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Vt({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},r))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var t=e.prototype;return t.getTouchAction=function(){return[rf]},t.process=function(n){var s=this,o=this.options,a=n.pointers.length===o.pointers,l=n.distance<o.threshold,h=n.deltaTime<o.time;if(this.reset(),n.eventType&ot&&this.count===0)return this.failTimeout();if(l&&h&&a){if(n.eventType!==Ne)return this.failTimeout();var d=this.pTime?n.timeStamp-this.pTime<o.interval:!0,u=!this.pCenter||Dl(this.pCenter,n.center)<o.posThreshold;this.pTime=n.timeStamp,this.pCenter=n.center,!u||!d?this.count=1:this.count+=1,this._input=n;var c=this.count%o.taps;if(c===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){s.state=$r,s.tryEmit()},o.interval),Dt):$r}return er},t.failTimeout=function(){var n=this;return this._timer=setTimeout(function(){n.state=er},this.options.interval),er},t.reset=function(){clearTimeout(this._timer)},t.emit=function(){this.state===$r&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(Zo),Vn=function(i){Rt(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Vt({pointers:1},r))||this}var t=e.prototype;return t.attrTest=function(n){var s=this.options.pointers;return s===0||n.pointers.length===s},t.process=function(n){var s=this.state,o=n.eventType,a=s&(Dt|Hn),l=this.attrTest(n);return a&&(o&yt||!l)?s|to:a||l?o&Ne?s|Xr:s&Dt?s|Hn:Dt:er},e}(Zo);function T_(i){return i===zn?"down":i===Jo?"up":i===Yo?"left":i===Xo?"right":""}var Tv=function(i){Rt(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Vt({event:"pan",threshold:10,pointers:1,direction:p_},r))||this,n.pX=null,n.pY=null,n}var t=e.prototype;return t.getTouchAction=function(){var n=this.options.direction,s=[];return n&nr&&s.push(Zs),n&xi&&s.push(Js),s},t.directionTest=function(n){var s=this.options,o=!0,a=n.distance,l=n.direction,h=n.deltaX,d=n.deltaY;return l&s.direction||(s.direction&nr?(l=h===0?Pl:h<0?Yo:Xo,o=h!==this.pX,a=Math.abs(n.deltaX)):(l=d===0?Pl:d<0?Jo:zn,o=d!==this.pY,a=Math.abs(n.deltaY))),n.direction=l,o&&a>s.threshold&&l&s.direction},t.attrTest=function(n){return Vn.prototype.attrTest.call(this,n)&&(this.state&Dt||!(this.state&Dt)&&this.directionTest(n))},t.emit=function(n){this.pX=n.deltaX,this.pY=n.deltaY;var s=T_(n.direction);s&&(n.additionalEvent=this.options.event+s),i.prototype.emit.call(this,n)},e}(Vn),O_=function(i){Rt(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Vt({event:"swipe",threshold:10,velocity:.3,direction:nr|xi,pointers:1},r))||this}var t=e.prototype;return t.getTouchAction=function(){return Tv.prototype.getTouchAction.call(this)},t.attrTest=function(n){var s=this.options.direction,o;return s&(nr|xi)?o=n.overallVelocity:s&nr?o=n.overallVelocityX:s&xi&&(o=n.overallVelocityY),i.prototype.attrTest.call(this,n)&&s&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers===this.options.pointers&&ki(o)>this.options.velocity&&n.eventType&Ne},t.emit=function(n){var s=T_(n.offsetDirection);s&&this.manager.emit(this.options.event+s,n),this.manager.emit(this.options.event,n)},e}(Vn),I_=function(i){Rt(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Vt({event:"pinch",threshold:0,pointers:2},r))||this}var t=e.prototype;return t.getTouchAction=function(){return[Ii]},t.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&Dt)},t.emit=function(n){if(n.scale!==1){var s=n.scale<1?"in":"out";n.additionalEvent=this.options.event+s}i.prototype.emit.call(this,n)},e}(Vn),x_=function(i){Rt(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Vt({event:"rotate",threshold:0,pointers:2},r))||this}var t=e.prototype;return t.getTouchAction=function(){return[Ii]},t.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&Dt)},e}(Vn),P_=function(i){Rt(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Vt({event:"press",pointers:1,time:251,threshold:9},r))||this,n._timer=null,n._input=null,n}var t=e.prototype;return t.getTouchAction=function(){return[f_]},t.process=function(n){var s=this,o=this.options,a=n.pointers.length===o.pointers,l=n.distance<o.threshold,h=n.deltaTime>o.time;if(this._input=n,!l||!a||n.eventType&(Ne|yt)&&!h)this.reset();else if(n.eventType&ot)this.reset(),this._timer=setTimeout(function(){s.state=$r,s.tryEmit()},o.time);else if(n.eventType&Ne)return $r;return er},t.reset=function(){clearTimeout(this._timer)},t.emit=function(n){this.state===$r&&(n&&n.eventType&Ne?this.manager.emit(this.options.event+"up",n):(this._input.timeStamp=bv(),this.manager.emit(this.options.event,this._input)))},e}(Zo),C_={domEvents:!1,touchAction:u_,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Nb=[[x_,{enable:!1}],[I_,{enable:!1},["rotate"]],[O_,{direction:nr}],[Tv,{direction:nr},["swipe"]],[sf],[sf,{event:"doubletap",taps:2},["tap"]],[P_]],bte=1,Rb=2;function kb(i,e){var t=i.element;if(t.style){var r;br(i.options.cssProps,function(n,s){r=Ah(t.style,s),e?(i.oldCssProps[r]=t.style[r],t.style[r]=n):t.style[r]=i.oldCssProps[r]||""}),e||(i.oldCssProps={})}}function $te(i,e){var t=document.createEvent("Event");t.initEvent(i,!0,!0),t.gesture=e,e.target.dispatchEvent(t)}var Mb=function(){function i(t,r){var n=this;this.options=Ri({},C_,r||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=gte(this),this.touchAction=new y_(this,this.options.touchAction),kb(this,!0),br(this.options.recognizers,function(s){var o=n.add(new s[0](s[1]));s[2]&&o.recognizeWith(s[2]),s[3]&&o.requireFailure(s[3])},this)}var e=i.prototype;return e.set=function(r){return Ri(this.options,r),r.touchAction&&this.touchAction.update(),r.inputTarget&&(this.input.destroy(),this.input.target=r.inputTarget,this.input.init()),this},e.stop=function(r){this.session.stopped=r?Rb:bte},e.recognize=function(r){var n=this.session;if(!n.stopped){this.touchAction.preventDefaults(r);var s,o=this.recognizers,a=n.curRecognizer;(!a||a&&a.state&$r)&&(n.curRecognizer=null,a=null);for(var l=0;l<o.length;)s=o[l],n.stopped!==Rb&&(!a||s===a||s.canRecognizeWith(a))?s.recognize(r):s.reset(),!a&&s.state&(Dt|Hn|Xr)&&(n.curRecognizer=s,a=s),l++}},e.get=function(r){if(r instanceof Zo)return r;for(var n=this.recognizers,s=0;s<n.length;s++)if(n[s].options.event===r)return n[s];return null},e.add=function(r){if(_n(r,"add",this))return this;var n=this.get(r.options.event);return n&&this.remove(n),this.recognizers.push(r),r.manager=this,this.touchAction.update(),r},e.remove=function(r){if(_n(r,"remove",this))return this;var n=this.get(r);if(r){var s=this.recognizers,o=Mi(s,n);o!==-1&&(s.splice(o,1),this.touchAction.update())}return this},e.on=function(r,n){if(r===void 0||n===void 0)return this;var s=this.handlers;return br(Qs(r),function(o){s[o]=s[o]||[],s[o].push(n)}),this},e.off=function(r,n){if(r===void 0)return this;var s=this.handlers;return br(Qs(r),function(o){n?s[o]&&s[o].splice(Mi(s[o],n),1):delete s[o]}),this},e.emit=function(r,n){this.options.domEvents&&$te(r,n);var s=this.handlers[r]&&this.handlers[r].slice();if(!(!s||!s.length)){n.type=r,n.preventDefault=function(){n.srcEvent.preventDefault()};for(var o=0;o<s.length;)s[o](n),o++}},e.destroy=function(){this.element&&kb(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},i}(),wte={touchstart:ot,touchmove:qi,touchend:Ne,touchcancel:yt},Ete="touchstart",Ste="touchstart touchmove touchend touchcancel",_te=function(i){Rt(e,i);function e(){var r,n=e.prototype;return n.evTarget=Ete,n.evWin=Ste,r=i.apply(this,arguments)||this,r.started=!1,r}var t=e.prototype;return t.handler=function(n){var s=wte[n.type];if(s===ot&&(this.started=!0),!!this.started){var o=Tte.call(this,n,s);s&(Ne|yt)&&o[0].length-o[1].length===0&&(this.started=!1),this.callback(this.manager,s,{pointers:o[0],changedPointers:o[1],pointerType:qo,srcEvent:n})}},e}(vs);function Tte(i,e){var t=eo(i.touches),r=eo(i.changedTouches);return e&(Ne|yt)&&(t=Ev(t.concat(r),"identifier",!0)),[t,r]}function D_(i,e,t){var r="DEPRECATED METHOD: "+e+`
|
||
`+t+` AT
|
||
`;return function(){var n=new Error("get-stack-trace"),s=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,r,s),i.apply(this,arguments)}}var A_=D_(function(i,e,t){for(var r=Object.keys(e),n=0;n<r.length;)(!t||t&&i[r[n]]===void 0)&&(i[r[n]]=e[r[n]]),n++;return i},"extend","Use `assign`."),Ote=D_(function(i,e){return A_(i,e,!0)},"merge","Use `assign`.");function Ite(i,e,t){var r=e.prototype,n;n=i.prototype=Object.create(r),n.constructor=i,n._super=r,t&&Ri(n,t)}function Fb(i,e){return function(){return i.apply(e,arguments)}}var N_=function(){var i=function(t,r){return r===void 0&&(r={}),new Mb(t,Vt({recognizers:Nb.concat()},r))};return i.VERSION="2.0.17-rc",i.DIRECTION_ALL=p_,i.DIRECTION_DOWN=zn,i.DIRECTION_LEFT=Yo,i.DIRECTION_RIGHT=Xo,i.DIRECTION_UP=Jo,i.DIRECTION_HORIZONTAL=nr,i.DIRECTION_VERTICAL=xi,i.DIRECTION_NONE=Pl,i.DIRECTION_DOWN=zn,i.INPUT_START=ot,i.INPUT_MOVE=qi,i.INPUT_END=Ne,i.INPUT_CANCEL=yt,i.STATE_POSSIBLE=il,i.STATE_BEGAN=Dt,i.STATE_CHANGED=Hn,i.STATE_ENDED=Xr,i.STATE_RECOGNIZED=$r,i.STATE_CANCELLED=to,i.STATE_FAILED=er,i.Manager=Mb,i.Input=vs,i.TouchAction=y_,i.TouchInput=Sv,i.MouseInput=_v,i.PointerEventInput=S_,i.TouchMouseInput=__,i.SingleTouchInput=_te,i.Recognizer=Zo,i.AttrRecognizer=Vn,i.Tap=sf,i.Pan=Tv,i.Swipe=O_,i.Pinch=I_,i.Rotate=x_,i.Press=P_,i.on=Rs,i.off=ks,i.each=br,i.merge=Ote,i.extend=A_,i.bindFn=Fb,i.assign=Ri,i.inherit=Ite,i.bindFn=Fb,i.prefixed=Ah,i.toArray=eo,i.inArray=Mi,i.uniqueArray=Ev,i.splitStr=Qs,i.boolOrFn=Nh,i.hasParent=wv,i.addEventListeners=Rs,i.removeEventListeners=ks,i.defaults=Ri({},C_,{preset:Nb}),i}();N_.defaults;var xte=N_;MY("DELETE");function Rh(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return Pte(e.length?e:[xl()])}function Pte(i){let[e,t,r]=Cte(i),n=1;const s=()=>{const o=2091639*e+n*23283064365386963e-26;return e=t,t=r,r=o-(n=o|0)};return s.uint32=()=>s()*4294967296,s.fract53=()=>s()+(s()*2097152|0)*11102230246251565e-32,s.algorithm="Alea",s.seed=i,s.version="0.9",s}function Cte(){const i=Dte();let e=i(" "),t=i(" "),r=i(" ");for(let n=0;n<arguments.length;n++)e-=i(n<0||arguments.length<=n?void 0:arguments[n]),e<0&&(e+=1),t-=i(n<0||arguments.length<=n?void 0:arguments[n]),t<0&&(t+=1),r-=i(n<0||arguments.length<=n?void 0:arguments[n]),r<0&&(r+=1);return[e,t,r]}function Dte(){let i=4022871197;return function(e){const t=e.toString();for(let r=0;r<t.length;r++){i+=t.charCodeAt(r);let n=.02519603282416938*i;i=n>>>0,n-=i,n*=i,i=n>>>0,n-=i,i+=n*4294967296}return(i>>>0)*23283064365386963e-26}}function Ate(){const i=()=>{};return{on:i,off:i,destroy:i,emit:i,get(){return{set:i}}}}const Ov=typeof window<"u"?window.Hammer||xte:function(){return Ate()};function tr(i){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:i,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});const t=Ov(this._dom.overlay);t.on("tap",O(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{t.destroy()});const r=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];oe(r).call(r,n=>{t.on(n,s=>{s.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=n=>{Nte(n.target,i)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=n=>{("key"in n?n.key==="Escape":n.keyCode===27)&&this.deactivate()}}rS(tr.prototype);tr.current=null;tr.prototype.destroy=function(){this.deactivate();for(const t of Ti(i=yr(e=this._cleanupQueue).call(e,0)).call(i)){var i,e;t()}};tr.prototype.activate=function(){tr.current&&tr.current.deactivate(),tr.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)};tr.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")};tr.prototype._onTapOverlay=function(i){this.activate(),i.srcEvent.stopPropagation()};function Nte(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}const Rte=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,kte=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Mte=/^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,Fte=/^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 Mr(i){if(i)for(;i.hasChildNodes()===!0;){const e=i.firstChild;e&&(Mr(e),i.removeChild(e))}}function In(i){return i instanceof String||typeof i=="string"}function Bb(i){return typeof i=="object"&&i!==null}function Fi(i,e,t,r){let n=!1;r===!0&&(n=e[t]===null&&i[t]!==void 0),n?delete i[t]:i[t]=e[t]}function R_(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(const r in i)if(e[r]!==void 0)if(e[r]===null||typeof e[r]!="object")Fi(i,e,r,t);else{const n=i[r],s=e[r];Bb(n)&&Bb(s)&&R_(n,s,t)}}function ps(i,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(we(t))throw new TypeError("Arrays are not supported by deepExtend");for(let n=0;n<i.length;n++){const s=i[n];if(Object.prototype.hasOwnProperty.call(t,s))if(t[s]&&t[s].constructor===Object)e[s]===void 0&&(e[s]={}),e[s].constructor===Object?le(e[s],t[s],!1,r):Fi(e,t,s,r);else{if(we(t[s]))throw new TypeError("Arrays are not supported by deepExtend");Fi(e,t,s,r)}}return e}function Al(i,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(we(t))throw new TypeError("Arrays are not supported by deepExtend");for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&!Yr(i).call(i,n))if(t[n]&&t[n].constructor===Object)e[n]===void 0&&(e[n]={}),e[n].constructor===Object?le(e[n],t[n]):Fi(e,t,n,r);else if(we(t[n])){e[n]=[];for(let s=0;s<t[n].length;s++)e[n].push(t[n][s])}else Fi(e,t,n,r);return e}function le(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)||t===!0)if(typeof e[s]=="object"&&e[s]!==null&&mb(e[s])===Object.prototype)i[s]===void 0?i[s]=le({},e[s],t):typeof i[s]=="object"&&i[s]!==null&&mb(i[s])===Object.prototype?le(i[s],e[s],t):Fi(i,e,s,r);else if(we(e[s])){var n;i[s]=Zt(n=e[s]).call(n)}else Fi(i,e,s,r);return i}function Nl(i,e){return[...i,e]}function Bte(i){return Zt(i).call(i)}function jte(i){return i.getBoundingClientRect().left}function Lte(i){return i.getBoundingClientRect().top}function X(i,e){if(we(i)){const t=i.length;for(let r=0;r<t;r++)e(i[r],r,i)}else for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&e(i[t],t,i)}function Iv(i){let e;switch(i.length){case 3:case 4:return e=kte.exec(i),e?{r:jt(e[1]+e[1],16),g:jt(e[2]+e[2],16),b:jt(e[3]+e[3],16)}:null;case 6:case 7:return e=Rte.exec(i),e?{r:jt(e[1],16),g:jt(e[2],16),b:jt(e[3],16)}:null;default:return null}}function xt(i,e){if(Yr(i).call(i,"rgba"))return i;if(Yr(i).call(i,"rgb")){const t=i.substr(ee(i).call(i,"(")+1).replace(")","").split(",");return"rgba("+t[0]+","+t[1]+","+t[2]+","+e+")"}else{const t=Iv(i);return t==null?i:"rgba("+t.r+","+t.g+","+t.b+","+e+")"}}function k_(i,e,t){var r;return"#"+Zt(r=((1<<24)+(i<<16)+(e<<8)+t).toString(16)).call(r,1)}function of(i,e){if(In(i)){let r=i;if(F_(r)){var t;const n=Ln(t=r.substr(4).substr(0,r.length-5).split(",")).call(t,function(s){return jt(s)});r=k_(n[0],n[1],n[2])}if(M_(r)===!0){const n=zte(r),s={h:n.h,s:n.s*.8,v:Math.min(1,n.v*1.02)},o={h:n.h,s:Math.min(1,n.s*1.25),v:n.v*.8},a=af(o.h,o.s,o.v),l=af(s.h,s.s,s.v);return{background:r,border:a,highlight:{background:l,border:a},hover:{background:l,border:a}}}else return{background:r,border:r,highlight:{background:r,border:r},hover:{background:r,border:r}}}else return{background:i.background||void 0,border:i.border||void 0,highlight:In(i.highlight)?{border:i.highlight,background:i.highlight}:{background:i.highlight&&i.highlight.background||void 0,border:i.highlight&&i.highlight.border||void 0},hover:In(i.hover)?{border:i.hover,background:i.hover}:{border:i.hover&&i.hover.border||void 0,background:i.hover&&i.hover.background||void 0}}}function Is(i,e,t){i=i/255,e=e/255,t=t/255;const r=Math.min(i,Math.min(e,t)),n=Math.max(i,Math.max(e,t));if(r===n)return{h:0,s:0,v:r};const s=i===r?e-t:t===r?i-e:t-i,a=60*((i===r?3:t===r?1:5)-s/(n-r))/360,l=(n-r)/n;return{h:a,s:l,v:n}}function nl(i,e,t){let r,n,s;const o=Math.floor(i*6),a=i*6-o,l=t*(1-e),h=t*(1-a*e),d=t*(1-(1-a)*e);switch(o%6){case 0:r=t,n=d,s=l;break;case 1:r=h,n=t,s=l;break;case 2:r=l,n=t,s=d;break;case 3:r=l,n=h,s=t;break;case 4:r=d,n=l,s=t;break;case 5:r=t,n=l,s=h;break}return{r:Math.floor(r*255),g:Math.floor(n*255),b:Math.floor(s*255)}}function af(i,e,t){const r=nl(i,e,t);return k_(r.r,r.g,r.b)}function zte(i){const e=Iv(i);if(!e)throw new TypeError("'".concat(i,"' is not a valid color."));return Is(e.r,e.g,e.b)}function M_(i){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(i)}function F_(i){return Mte.test(i)}function Hte(i){return Fte.test(i)}function Jr(i){if(i===null||typeof i!="object")return null;if(i instanceof Element)return i;const e=Oi(i);for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&typeof i[t]=="object"&&(e[t]=Jr(i[t]));return e}function It(i,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const n=function(f){return f!=null},s=function(f){return f!==null&&typeof f=="object"},o=function(f){for(const v in f)if(Object.prototype.hasOwnProperty.call(f,v))return!1;return!0};if(!s(i))throw new Error("Parameter mergeTarget must be an object");if(!s(e))throw new Error("Parameter options must be an object");if(!n(t))throw new Error("Parameter option must have a value");if(!s(r))throw new Error("Parameter globalOptions must be an object");const a=function(f,v,g){s(f[g])||(f[g]={});const y=v[g],p=f[g];for(const m in y)Object.prototype.hasOwnProperty.call(y,m)&&(p[m]=y[m])},l=e[t],d=s(r)&&!o(r)?r[t]:void 0,u=d?d.enabled:void 0;if(l===void 0)return;if(typeof l=="boolean"){s(i[t])||(i[t]={}),i[t].enabled=l;return}if(l===null&&!s(i[t]))if(n(d))i[t]=Oi(d);else return;if(!s(l))return;let c=!0;l.enabled!==void 0?c=l.enabled:u!==void 0&&(c=d.enabled),a(i,e,t),i[t].enabled=c}const Vte={linear(i){return i},easeInQuad(i){return i*i},easeOutQuad(i){return i*(2-i)},easeInOutQuad(i){return i<.5?2*i*i:-1+(4-2*i)*i},easeInCubic(i){return i*i*i},easeOutCubic(i){return--i*i*i+1},easeInOutCubic(i){return i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1},easeInQuart(i){return i*i*i*i},easeOutQuart(i){return 1- --i*i*i*i},easeInOutQuart(i){return i<.5?8*i*i*i*i:1-8*--i*i*i*i},easeInQuint(i){return i*i*i*i*i},easeOutQuint(i){return 1+--i*i*i*i*i},easeInOutQuint(i){return i<.5?16*i*i*i*i*i:1+16*--i*i*i*i*i}};function Fr(i,e){let t;we(e)||(e=[e]);for(const r of i)if(r){t=r[e[0]];for(let n=1;n<e.length;n++)t&&(t=t[e[n]]);if(typeof t<"u")break}return t}const Wte={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"};let Ute=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},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=()=>{},this.closeCallback=()=>{},this._create()}insertTo(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}setCloseCallback(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}_isColorString(e){if(typeof e=="string")return Wte[e]}setColor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==="none")return;let r;const n=this._isColorString(e);if(n!==void 0&&(e=n),In(e)===!0){if(F_(e)===!0){const s=e.substr(4).substr(0,e.length-5).split(",");r={r:s[0],g:s[1],b:s[2],a:1}}else if(Hte(e)===!0){const s=e.substr(5).substr(0,e.length-6).split(",");r={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(M_(e)===!0){const s=Iv(e);r={r:s.r,g:s.g,b:s.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){const s=e.a!==void 0?e.a:"1.0";r={r:e.r,g:e.g,b:e.b,a:s}}if(r===void 0)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+Ko(e));this._setColor(r,t)}show(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0&&(this.previousColor=Ae({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",ir(()=>{this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0)},0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)===!0&&(this.initialColor=Ae({},e)),this.color=e;const r=Is(e.r,e.g,e.b),n=2*Math.PI,s=this.r*r.s,o=this.centerCoordinates.x+s*Math.sin(n*r.h),a=this.centerCoordinates.y+s*Math.cos(n*r.h);this.colorPickerSelector.style.left=o-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=a-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}_setOpacity(e){this.color.a=e/100,this._updatePicker(this.color)}_setBrightness(e){const t=Is(this.color.r,this.color.g,this.color.b);t.v=e/100;const r=nl(t.h,t.s,t.v);r.a=this.color.a,this.color=r,this._updatePicker()}_updatePicker(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color;const t=Is(e.r,e.g,e.b),r=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1)),r.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const n=this.colorPickerCanvas.clientWidth,s=this.colorPickerCanvas.clientHeight;r.clearRect(0,0,n,s),r.putImageData(this.hueCircle,0,0),r.fillStyle="rgba(0,0,0,"+(1-t.v)+")",r.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),Go(r).call(r),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+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){var e,t,r,n;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){const o=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const o=document.createElement("DIV");o.style.color="red",o.style.fontWeight="bold",o.style.padding="10px",o.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(o)}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);const s=this;this.opacityRange.onchange=function(){s._setOpacity(this.value)},this.opacityRange.oninput=function(){s._setOpacity(this.value)},this.brightnessRange.onchange=function(){s._setBrightness(this.value)},this.brightnessRange.oninput=function(){s._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=O(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=O(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=O(r=this._save).call(r,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=O(n=this._loadLast).call(n,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)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new Ov(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",e=>{e.isFirst&&this._moveSelector(e)}),this.hammer.on("tap",e=>{this._moveSelector(e)}),this.hammer.on("panstart",e=>{this._moveSelector(e)}),this.hammer.on("panmove",e=>{this._moveSelector(e)}),this.hammer.on("panend",e=>{this._moveSelector(e)})}_generateHueCircle(){if(this.generated===!1){const 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);const t=this.colorPickerCanvas.clientWidth,r=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,r);let n,s,o,a;this.centerCoordinates={x:t*.5,y:r*.5},this.r=.49*t;const l=2*Math.PI/360,h=1/360,d=1/this.r;let u;for(o=0;o<360;o++)for(a=0;a<this.r;a++)n=this.centerCoordinates.x+a*Math.sin(l*o),s=this.centerCoordinates.y+a*Math.cos(l*o),u=nl(o*h,a*d,1),e.fillStyle="rgb("+u.r+","+u.g+","+u.b+")",e.fillRect(n-.5,s-.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,t,r)}this.generated=!0}_moveSelector(e){const t=this.colorPickerDiv.getBoundingClientRect(),r=e.center.x-t.left,n=e.center.y-t.top,s=.5*this.colorPickerDiv.clientHeight,o=.5*this.colorPickerDiv.clientWidth,a=r-o,l=n-s,h=Math.atan2(a,l),d=.98*Math.min(Math.sqrt(a*a+l*l),o),u=Math.cos(h)*d+s,c=Math.sin(h)*d+o;this.colorPickerSelector.style.top=u-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=c-.5*this.colorPickerSelector.clientWidth+"px";let f=h/(2*Math.PI);f=f<0?f+1:f;const v=d/this.r,g=Is(this.color.r,this.color.g,this.color.b);g.h=f,g.s=v;const y=nl(g.h,g.s,g.v);y.a=this.color.a,this.color=y,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+")"}};function lf(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];if(e.length<1)throw new TypeError("Invalid arguments.");if(e.length===1)return document.createTextNode(e[0]);{const r=document.createElement(e[0]);return r.appendChild(lf(...Zt(e).call(e,1))),r}}let Kte=class{constructor(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=e,this.changedOptions=[],this.container=t,this.allowCreation=!1,this.hideOption=s,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Ae(this.options,this.defaultOptions),this.configureOptions=r,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new Ute(n),this.wrapper=void 0}setOptions(e){if(e!==void 0){this.popupHistory={},this._removePopup();let t=!0;if(typeof e=="string")this.options.filter=e;else if(we(e))this.options.filter=e.join();else if(typeof e=="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),pt(e)!==void 0&&(this.options.filter=pt(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);pt(this.options)===!1&&(t=!1),this.options.enabled=t}this._clean()}setModuleOptions(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const e=pt(this.options);let t=0,r=!1;for(const n in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,n)&&(this.allowCreation=!1,r=!1,typeof e=="function"?(r=e(n,[]),r=r||this._handleObject(this.configureOptions[n],[n],!0)):(e===!0||ee(e).call(e,n)!==-1)&&(r=!0),r!==!1&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),t++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}_clean(){for(let 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()}_getValue(e){let t=this.moduleOptions;for(let r=0;r<e.length;r++)if(t[e[r]]!==void 0)t=t[e[r]];else{t=void 0;break}return t}_makeItem(e){if(this.allowCreation===!0){const s=document.createElement("div");s.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return oe(r).call(r,o=>{s.appendChild(o)}),this.domElements.push(s),this.domElements.length}return 0}_makeHeader(e){const t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerText=e,this._makeItem([],t)}_makeLabel(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const n=document.createElement("div");if(n.className="vis-configuration vis-config-label vis-config-s"+t.length,r===!0){for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(lf("i","b",e))}else n.innerText=e+":";return n}_makeDropdown(e,t,r){const n=document.createElement("select");n.className="vis-configuration vis-config-select";let s=0;t!==void 0&&ee(e).call(e,t)!==-1&&(s=ee(e).call(e,t));for(let l=0;l<e.length;l++){const h=document.createElement("option");h.value=e[l],l===s&&(h.selected="selected"),h.innerText=e[l],n.appendChild(h)}const o=this;n.onchange=function(){o._update(this.value,r)};const a=this._makeLabel(r[r.length-1],r);this._makeItem(r,a,n)}_makeRange(e,t,r){const n=e[0],s=e[1],o=e[2],a=e[3],l=document.createElement("input");l.className="vis-configuration vis-config-range";try{l.type="range",l.min=s,l.max=o}catch{}l.step=a;let h="",d=0;t!==void 0?(t<0&&t*1.2<s?(l.min=Math.ceil(t*1.2),d=l.min,h="range increased"):t/1.2<s&&(l.min=Math.ceil(t/1.2),d=l.min,h="range increased"),t*1.2>o&&o!==1&&(l.max=Math.ceil(t*1.2),d=l.max,h="range increased"),l.value=t):l.value=n;const u=document.createElement("input");u.className="vis-configuration vis-config-rangeinput",u.value=l.value;const c=this;l.onchange=function(){u.value=this.value,c._update(Number(this.value),r)},l.oninput=function(){u.value=this.value};const f=this._makeLabel(r[r.length-1],r),v=this._makeItem(r,f,l,u);h!==""&&this.popupHistory[v]!==d&&(this.popupHistory[v]=d,this._setupPopup(h,v))}_makeButton(){if(this.options.showButton===!0){const e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerText="generate options",e.onclick=()=>{this._printOptions()},e.onmouseover=()=>{e.className="vis-configuration vis-config-button hover"},e.onmouseout=()=>{e.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(e)}}_setupPopup(e,t){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){const r=document.createElement("div");r.id="vis-configuration-popup",r.className="vis-configuration-popup",r.innerText=e,r.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:r,index:t}}}_removePopup(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(this.popupDiv.html!==void 0){const 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=ir(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=ir(()=>{this._removePopup()},1800)}}_makeCheckbox(e,t,r){const n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=e,t!==void 0&&(n.checked=t,t!==e&&(typeof e=="object"?t!==e.enabled&&this.changedOptions.push({path:r,value:t}):this.changedOptions.push({path:r,value:t})));const s=this;n.onchange=function(){s._update(this.checked,r)};const o=this._makeLabel(r[r.length-1],r);this._makeItem(r,o,n)}_makeTextInput(e,t,r){const n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=t,t!==e&&this.changedOptions.push({path:r,value:t});const s=this;n.onchange=function(){s._update(this.value,r)};const o=this._makeLabel(r[r.length-1],r);this._makeItem(r,o,n)}_makeColorField(e,t,r){const n=e[1],s=document.createElement("div");t=t===void 0?n:t,t!=="none"?(s.className="vis-configuration vis-config-colorBlock",s.style.backgroundColor=t):s.className="vis-configuration vis-config-colorBlock none",t=t===void 0?n:t,s.onclick=()=>{this._showColorPicker(t,s,r)};const o=this._makeLabel(r[r.length-1],r);this._makeItem(r,o,s)}_showColorPicker(e,t,r){t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(n=>{const s="rgba("+n.r+","+n.g+","+n.b+","+n.a+")";t.style.backgroundColor=s,this._update(s,r)}),this.colorPicker.setCloseCallback(()=>{t.onclick=()=>{this._showColorPicker(e,t,r)}})}_handleObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=!1;const s=pt(this.options);let o=!1;for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){n=!0;const l=e[a],h=Nl(t,a);if(typeof s=="function"&&(n=s(a,t),n===!1&&!we(l)&&typeof l!="string"&&typeof l!="boolean"&&l instanceof Object&&(this.allowCreation=!1,n=this._handleObject(l,h,!0),this.allowCreation=r===!1)),n!==!1){o=!0;const d=this._getValue(h);if(we(l))this._handleArray(l,d,h);else if(typeof l=="string")this._makeTextInput(l,d,h);else if(typeof l=="boolean")this._makeCheckbox(l,d,h);else if(l instanceof Object){if(!this.hideOption(t,a,this.moduleOptions))if(l.enabled!==void 0){const u=Nl(h,"enabled"),c=this._getValue(u);if(c===!0){const f=this._makeLabel(a,h,!0);this._makeItem(h,f),o=this._handleObject(l,h)||o}else this._makeCheckbox(l,c,h)}else{const u=this._makeLabel(a,h,!0);this._makeItem(h,u),o=this._handleObject(l,h)||o}}else console.error("dont know how to handle",l,a,h)}}return o}_handleArray(e,t,r){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,t,r),e[1]!==t&&this.changedOptions.push({path:r,value:t})):typeof e[0]=="string"?(this._makeDropdown(e,t,r),e[0]!==t&&this.changedOptions.push({path:r,value:t})):typeof e[0]=="number"&&(this._makeRange(e,t,r),e[0]!==t&&this.changedOptions.push({path:r,value:Number(t)}))}_update(e,t){const r=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",r),this.initialized=!0,this.parent.setOptions(r)}_constructOptions(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r;e=e==="true"?!0:e,e=e==="false"?!1:e;for(let s=0;s<t.length;s++)t[s]!=="global"&&(n[t[s]]===void 0&&(n[t[s]]={}),s!==t.length-1?n=n[t[s]]:n[t[s]]=e);return r}_printOptions(){const e=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(lf("pre","const options = "+Ko(e,null,2)))}getOptions(){const e={};for(let t=0;t<this.changedOptions.length;t++)this._constructOptions(this.changedOptions[t].value,this.changedOptions[t].path,e);return e}},Gte=class{constructor(e,t){this.container=e,this.overflowMethod=t||"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)}setPosition(e,t){this.x=jt(e),this.y=jt(t)}setText(e){if(e instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(e)}else this.frame.innerText=e}show(e){if(e===void 0&&(e=!0),e===!0){const t=this.frame.clientHeight,r=this.frame.clientWidth,n=this.frame.parentNode.clientHeight,s=this.frame.parentNode.clientWidth;let o=0,a=0;if(this.overflowMethod=="flip"){let l=!1,h=!0;this.y-t<this.padding&&(h=!1),this.x+r>s-this.padding&&(l=!0),l?o=this.x-r:o=this.x,h?a=this.y-t:a=this.y}else a=this.y-t,a+t+this.padding>n&&(a=n-t-this.padding),a<this.padding&&(a=this.padding),o=this.x,o+r+this.padding>s&&(o=s-r-this.padding),o<this.padding&&(o=this.padding);this.frame.style.left=o+"px",this.frame.style.top=a+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}hide(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}destroy(){this.frame.parentNode.removeChild(this.frame)}},$s=!1,jb;const hf="background: #FFeeee; color: #dd0000";let qte=class me{static validate(e,t,r){$s=!1,jb=t;let n=t;return r!==void 0&&(n=t[r]),me.parse(e,n,[]),$s}static parse(e,t,r){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&me.check(n,e,t,r)}static check(e,t,r,n){if(r[e]===void 0&&r.__any__===void 0){me.getSuggestion(e,r,n);return}let s=e,o=!0;r[e]===void 0&&r.__any__!==void 0&&(s="__any__",o=me.getType(t[e])==="object");let a=r[s];o&&a.__type__!==void 0&&(a=a.__type__),me.checkFields(e,t,r,s,a,n)}static checkFields(e,t,r,n,s,o){const a=function(d){console.error("%c"+d+me.printLocation(o,e),hf)},l=me.getType(t[e]),h=s[l];h!==void 0?me.getType(h)==="array"&&ee(h).call(h,t[e])===-1?(a('Invalid option detected in "'+e+'". Allowed values are:'+me.print(h)+' not "'+t[e]+'". '),$s=!0):l==="object"&&n!=="__any__"&&(o=Nl(o,e),me.parse(t[e],r[n],o)):s.any===void 0&&(a('Invalid type received for "'+e+'". Expected: '+me.print($e(s))+". Received ["+l+'] "'+t[e]+'"'),$s=!0)}static getType(e){const t=typeof e;return t==="object"?e===null?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":we(e)?"array":e instanceof Date?"date":e.nodeType!==void 0?"dom":e._isAMomentObject===!0?"moment":"object":t==="number"?"number":t==="boolean"?"boolean":t==="string"?"string":t===void 0?"undefined":t}static getSuggestion(e,t,r){const n=me.findInOptions(e,t,r,!1),s=me.findInOptions(e,jb,[],!0),o=8,a=4;let l;n.indexMatch!==void 0?l=" in "+me.printLocation(n.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+n.indexMatch+`"?
|
||
|
||
`:s.distance<=a&&n.distance>s.distance?l=" in "+me.printLocation(n.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+me.printLocation(s.path,s.closestMatch,""):n.distance<=o?l='. Did you mean "'+n.closestMatch+'"?'+me.printLocation(n.path,e):l=". Did you mean one of these: "+me.print($e(t))+me.printLocation(r,e),console.error('%cUnknown option detected: "'+e+'"'+l,hf),$s=!0}static findInOptions(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=1e9,o="",a=[];const l=e.toLowerCase();let h;for(const u in t){let c;if(t[u].__type__!==void 0&&n===!0){const f=me.findInOptions(e,t[u],Nl(r,u));s>f.distance&&(o=f.closestMatch,a=f.path,s=f.distance,h=f.indexMatch)}else{var d;ee(d=u.toLowerCase()).call(d,l)!==-1&&(h=u),c=me.levenshteinDistance(e,u),s>c&&(o=u,a=Bte(r),s=c)}}return{closestMatch:o,path:a,distance:s,indexMatch:h}}static printLocation(e,t){let n=`
|
||
|
||
`+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at:
|
||
`)+`options = {
|
||
`;for(let s=0;s<e.length;s++){for(let o=0;o<s+1;o++)n+=" ";n+=e[s]+`: {
|
||
`}for(let s=0;s<e.length+1;s++)n+=" ";n+=t+`
|
||
`;for(let s=0;s<e.length+1;s++){for(let o=0;o<e.length-s;o++)n+=" ";n+=`}
|
||
`}return n+`
|
||
|
||
`}static print(e){return Ko(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;const r=[];let n;for(n=0;n<=t.length;n++)r[n]=[n];let s;for(s=0;s<=e.length;s++)r[0][s]=s;for(n=1;n<=t.length;n++)for(s=1;s<=e.length;s++)t.charAt(n-1)==e.charAt(s-1)?r[n][s]=r[n-1][s-1]:r[n][s]=Math.min(r[n-1][s-1]+1,Math.min(r[n][s-1]+1,r[n-1][s]+1));return r[t.length][e.length]}};const Yte=tr,Xte=Kte,xn=Ov,Jte=Gte,B_=hf,Zte=qte;function Qte(i){return zr=i,ire()}var j_={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},xv=Oi(j_);xv.color="color.color";xv.style="dashes";var rt={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},Lb={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},zr="",Wn=0,Y="",j="",ct=rt.NULL;function ere(){Wn=0,Y=zr.charAt(0)}function Le(){Wn++,Y=zr.charAt(Wn)}function dn(){return zr.charAt(Wn+1)}function zb(i){var e=i.charCodeAt(0);return e<47?e===35||e===46:e<59?e>47:e<91?e>64:e<96?e===95:e<123?e>96:!1}function ei(i,e){if(i||(i={}),e)for(var t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i}function tre(i,e,t){for(var r=e.split("."),n=i;r.length;){var s=r.shift();r.length?(n[s]||(n[s]={}),n=n[s]):n[s]=t}}function L_(i,e){for(var t,r,n=null,s=[i],o=i;o.parent;)s.push(o.parent),o=o.parent;if(o.nodes){for(t=0,r=o.nodes.length;t<r;t++)if(e.id===o.nodes[t].id){n=o.nodes[t];break}}for(n||(n={id:e.id},i.node&&(n.attr=ei(n.attr,i.node))),t=s.length-1;t>=0;t--){var a,l=s[t];l.nodes||(l.nodes=[]),ee(a=l.nodes).call(a,n)===-1&&l.nodes.push(n)}e.attr&&(n.attr=ei(n.attr,e.attr))}function rre(i,e){if(i.edges||(i.edges=[]),i.edges.push(e),i.edge){var t=ei({},i.edge);e.attr=ei(t,e.attr)}}function z_(i,e,t,r,n){var s={from:e,to:t,type:r};return i.edge&&(s.attr=ei({},i.edge)),s.attr=ei(s.attr||{},n),n!=null&&n.hasOwnProperty("arrows")&&n.arrows!=null&&(s.arrows={to:{enabled:!0,type:n.arrows.type}},n.arrows=null),s}function he(){for(ct=rt.NULL,j="";Y===" "||Y===" "||Y===`
|
||
`||Y==="\r";)Le();do{var i=!1;if(Y==="#"){for(var e=Wn-1;zr.charAt(e)===" "||zr.charAt(e)===" ";)e--;if(zr.charAt(e)===`
|
||
`||zr.charAt(e)===""){for(;Y!=""&&Y!=`
|
||
`;)Le();i=!0}}if(Y==="/"&&dn()==="/"){for(;Y!=""&&Y!=`
|
||
`;)Le();i=!0}if(Y==="/"&&dn()==="*"){for(;Y!="";)if(Y==="*"&&dn()==="/"){Le(),Le();break}else Le();i=!0}for(;Y===" "||Y===" "||Y===`
|
||
`||Y==="\r";)Le()}while(i);if(Y===""){ct=rt.DELIMITER;return}var t=Y+dn();if(Lb[t]){ct=rt.DELIMITER,j=t,Le(),Le();return}if(Lb[Y]){ct=rt.DELIMITER,j=Y,Le();return}if(zb(Y)||Y==="-"){for(j+=Y,Le();zb(Y);)j+=Y,Le();j==="false"?j=!1:j==="true"?j=!0:isNaN(Number(j))||(j=Number(j)),ct=rt.IDENTIFIER;return}if(Y==='"'){for(Le();Y!=""&&(Y!='"'||Y==='"'&&dn()==='"');)Y==='"'?(j+=Y,Le()):Y==="\\"&&dn()==="n"?(j+=`
|
||
`,Le()):j+=Y,Le();if(Y!='"')throw it('End of string " expected');Le(),ct=rt.IDENTIFIER;return}for(ct=rt.UNKNOWN;Y!="";)j+=Y,Le();throw new SyntaxError('Syntax error in part "'+U_(j,30)+'"')}function ire(){var i={};if(ere(),he(),j==="strict"&&(i.strict=!0,he()),(j==="graph"||j==="digraph")&&(i.type=j,he()),ct===rt.IDENTIFIER&&(i.id=j,he()),j!="{")throw it("Angle bracket { expected");if(he(),H_(i),j!="}")throw it("Angle bracket } expected");if(he(),j!=="")throw it("End of file expected");return he(),delete i.node,delete i.edge,delete i.graph,i}function H_(i){for(;j!==""&&j!="}";)nre(i),j===";"&&he()}function nre(i){var e=V_(i);if(e){W_(i,e);return}var t=sre(i);if(!t){if(ct!=rt.IDENTIFIER)throw it("Identifier expected");var r=j;if(he(),j==="="){if(he(),ct!=rt.IDENTIFIER)throw it("Identifier expected");i[r]=j,he()}else ore(i,r)}}function V_(i){var e=null;if(j==="subgraph"&&(e={},e.type="subgraph",he(),ct===rt.IDENTIFIER&&(e.id=j,he())),j==="{"){if(he(),e||(e={}),e.parent=i,e.node=i.node,e.edge=i.edge,e.graph=i.graph,H_(e),j!="}")throw it("Angle bracket } expected");he(),delete e.node,delete e.edge,delete e.graph,delete e.parent,i.subgraphs||(i.subgraphs=[]),i.subgraphs.push(e)}return e}function sre(i){return j==="node"?(he(),i.node=Ms(),"node"):j==="edge"?(he(),i.edge=Ms(),"edge"):j==="graph"?(he(),i.graph=Ms(),"graph"):null}function ore(i,e){var t={id:e},r=Ms();r&&(t.attr=r),L_(i,t),W_(i,e)}function W_(i,e){for(;j==="->"||j==="--";){var t,r=j;he();var n=V_(i);if(n)t=n;else{if(ct!=rt.IDENTIFIER)throw it("Identifier or subgraph expected");t=j,L_(i,{id:t}),he()}var s=Ms(),o=z_(i,e,t,r,s);rre(i,o),e=t}}function Ms(){for(var i,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},r={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},n=new Array,s=new Array;j==="[";){for(he(),e={};j!==""&&j!="]";){if(ct!=rt.IDENTIFIER)throw it("Attribute name expected");var o=j;if(he(),j!="=")throw it("Equal sign = expected");if(he(),ct!=rt.IDENTIFIER)throw it("Attribute value expected");var a=j;o==="style"&&(a=t[a]);var l;o==="arrowhead"&&(l=r[a],o="arrows",a={to:{enabled:!0,type:l}}),o==="arrowtail"&&(l=r[a],o="arrows",a={from:{enabled:!0,type:l}}),n.push({attr:e,name:o,value:a}),s.push(o),he(),j==","&&he()}if(j!="]")throw it("Bracket ] expected");he()}if(Yr(s).call(s,"dir")){var h={};for(h.arrows={},i=0;i<n.length;i++)if(n[i].name==="arrows")if(n[i].value.to!=null)h.arrows.to=i;else if(n[i].value.from!=null)h.arrows.from=i;else throw it("Invalid value of arrows");else n[i].name==="dir"&&(h.dir=i);var d=n[h.dir].value;if(!Yr(s).call(s,"arrows"))if(d==="both")n.push({attr:n[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=n.length-1,n.push({attr:n[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=n.length-1;else if(d==="forward")n.push({attr:n[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=n.length-1;else if(d==="back")n.push({attr:n[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=n.length-1;else if(d==="none")n.push({attr:n[h.dir].attr,name:"arrows",value:""}),h.arrows.to=n.length-1;else throw it('Invalid dir type "'+d+'"');var u,c;if(d==="both")h.arrows.to&&h.arrows.from?(c=n[h.arrows.to].value.to.type,u=n[h.arrows.from].value.from.type,n[h.arrows.to]={attr:n[h.arrows.to].attr,name:n[h.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}},yr(n).call(n,h.arrows.from,1)):h.arrows.to?(c=n[h.arrows.to].value.to.type,u="arrow",n[h.arrows.to]={attr:n[h.arrows.to].attr,name:n[h.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}):h.arrows.from&&(c="arrow",u=n[h.arrows.from].value.from.type,n[h.arrows.from]={attr:n[h.arrows.from].attr,name:n[h.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}});else if(d==="back")h.arrows.to&&h.arrows.from?(c="",u=n[h.arrows.from].value.from.type,n[h.arrows.from]={attr:n[h.arrows.from].attr,name:n[h.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}):h.arrows.to?(c="",u="arrow",h.arrows.from=h.arrows.to,n[h.arrows.from]={attr:n[h.arrows.from].attr,name:n[h.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}):h.arrows.from&&(c="",u=n[h.arrows.from].value.from.type,n[h.arrows.to]={attr:n[h.arrows.from].attr,name:n[h.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}),n[h.arrows.from]={attr:n[h.arrows.from].attr,name:n[h.arrows.from].name,value:{from:{enabled:!0,type:n[h.arrows.from].value.from.type}}};else if(d==="none"){var f;h.arrows.to?f=h.arrows.to:f=h.arrows.from,n[f]={attr:n[f].attr,name:n[f].name,value:""}}else if(d==="forward")h.arrows.to&&h.arrows.from?(c=n[h.arrows.to].value.to.type,u="",n[h.arrows.to]={attr:n[h.arrows.to].attr,name:n[h.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}):h.arrows.to?(c=n[h.arrows.to].value.to.type,u="",n[h.arrows.to]={attr:n[h.arrows.to].attr,name:n[h.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}):h.arrows.from&&(c="arrow",u="",h.arrows.to=h.arrows.from,n[h.arrows.to]={attr:n[h.arrows.to].attr,name:n[h.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}),n[h.arrows.to]={attr:n[h.arrows.to].attr,name:n[h.arrows.to].name,value:{to:{enabled:!0,type:n[h.arrows.to].value.to.type}}};else throw it('Invalid dir type "'+d+'"');yr(n).call(n,h.dir,1)}var v;if(Yr(s).call(s,"penwidth")){var g=[];for(v=n.length,i=0;i<v;i++)n[i].name!=="width"&&(n[i].name==="penwidth"&&(n[i].name="width"),g.push(n[i]));n=g}for(v=n.length,i=0;i<v;i++)tre(n[i].attr,n[i].name,n[i].value);return e}function it(i){return new SyntaxError(i+', got "'+U_(j,30)+'" (char '+Wn+")")}function U_(i,e){return i.length<=e?i:i.substr(0,27)+"..."}function are(i,e,t){we(i)?oe(i).call(i,function(r){we(e)?oe(e).call(e,function(n){t(r,n)}):t(r,e)}):we(e)?oe(e).call(e,function(r){t(i,r)}):t(i,e)}function Wc(i,e,t){for(var r=e.split("."),n=r.pop(),s=i,o=0;o<r.length;o++){var a=r[o];a in s||(s[a]={}),s=s[a]}return s[n]=t,i}function Hb(i,e){var t={};for(var r in i)if(i.hasOwnProperty(r)){var n=e[r];we(n)?oe(n).call(n,function(s){Wc(t,s,i[r])}):typeof n=="string"?Wc(t,n,i[r]):Wc(t,r,i[r])}return t}function lre(i){var e=Qte(i),t={nodes:[],edges:[],options:{}};if(e.nodes){var r;oe(r=e.nodes).call(r,function(o){var a={id:o.id,label:String(o.label||o.id)};ei(a,Hb(o.attr,j_)),a.image&&(a.shape="image"),t.nodes.push(a)})}if(e.edges){var n,s=function(o){var a={from:o.from,to:o.to};return ei(a,Hb(o.attr,xv)),a.arrows==null&&o.type==="->"&&(a.arrows="to"),a};oe(n=e.edges).call(n,function(o){var a,l;if(o.from instanceof Object?a=o.from.nodes:a={id:o.from},o.to instanceof Object?l=o.to.nodes:l={id:o.to},o.from instanceof Object&&o.from.edges){var h;oe(h=o.from.edges).call(h,function(u){var c=s(u);t.edges.push(c)})}if(are(a,l,function(u,c){var f=z_(t,u.id,c.id,o.type,o.attr),v=s(f);t.edges.push(v)}),o.to instanceof Object&&o.to.edges){var d;oe(d=o.to.edges).call(d,function(u){var c=s(u);t.edges.push(c)})}})}return e.attr&&(t.options=e.attr),t}function hre(i,e){var t;const r={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(r.nodes.fixed=e.fixed),e.parseColor!=null&&(r.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(r.edges.inheritColor=e.inheritColor));const n=i.edges,s=Ln(n).call(n,a=>{const l={from:a.source,id:a.id,to:a.target};return a.attributes!=null&&(l.attributes=a.attributes),a.label!=null&&(l.label=a.label),a.attributes!=null&&a.attributes.title!=null&&(l.title=a.attributes.title),a.type==="Directed"&&(l.arrows="to"),a.color&&r.edges.inheritColor===!1&&(l.color=a.color),l});return{nodes:Ln(t=i.nodes).call(t,a=>{const l={id:a.id,fixed:r.nodes.fixed&&a.x!=null&&a.y!=null};return a.attributes!=null&&(l.attributes=a.attributes),a.label!=null&&(l.label=a.label),a.size!=null&&(l.size=a.size),a.attributes!=null&&a.attributes.title!=null&&(l.title=a.attributes.title),a.title!=null&&(l.title=a.title),a.x!=null&&(l.x=a.x),a.y!=null&&(l.y=a.y),a.color!=null&&(r.nodes.parseColor===!0?l.color=a.color:l.color={background:a.color,border:a.color,highlight:{background:a.color,border:a.color},hover:{background:a.color,border:a.color}}),l}),edges:s}}const dre={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"},cre={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"},ure={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"},fre={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"},vre={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"},pre={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ó"},gre={addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},yre={addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},mre={addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"},bre={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"},$re={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"};var wre=Object.freeze({__proto__:null,cn:yre,cs:$re,de:cre,en:dre,es:ure,fr:bre,it:fre,nl:vre,pt:pre,ru:gre,uk:mre});function Ere(i,e){try{const[r,n]=e.split(/[-_ /]/,2),s=r!=null?r.toLowerCase():null,o=n!=null?n.toUpperCase():null;if(s&&o){const a=s+"-"+o;if(Object.prototype.hasOwnProperty.call(i,a))return a;var t;console.warn(WZ(t="Unknown variant ".concat(o," of language ")).call(t,s,"."))}if(s){const a=s;if(Object.prototype.hasOwnProperty.call(i,a))return a;console.warn("Unknown language ".concat(s))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(r){return console.error(r),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}class Sre{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;const e=this.image.width,t=this.image.height;this.width=e,this.height=t;const r=Math.floor(t/2),n=Math.floor(t/4),s=Math.floor(t/8),o=Math.floor(t/16),a=Math.floor(e/2),l=Math.floor(e/4),h=Math.floor(e/8),d=Math.floor(e/16);this.canvas.width=3*l,this.canvas.height=r,this.coordinates=[[0,0,a,r],[a,0,l,n],[a,n,h,s],[5*h,n,d,o]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){const e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(let r=1;r<this.NUM_ITERATIONS;r++){const n=this.coordinates[r-1],s=this.coordinates[r];e.drawImage(this.canvas,n[0],n[1],n[2],n[3],s[0],s[1],s[2],s[3])}}drawImageAtPosition(e,t,r,n,s,o){if(this.initialized())if(t>2){t*=.5;let a=0;for(;t>2&&a<this.NUM_ITERATIONS;)t*=.5,a+=1;a>=this.NUM_ITERATIONS&&(a=this.NUM_ITERATIONS-1);const l=this.coordinates[a];e.drawImage(this.canvas,l[0],l[1],l[2],l[3],r,n,s,o)}else e.drawImage(this.image,r,n,s,o)}}class _re{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,t,r){if(!(e===void 0||r===void 0)){if(t===void 0){console.warn("No broken url image defined");return}r.image.onerror=()=>{console.error("Could not load brokenImage:",t)},r.image.src=t}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,t){const r=this.images[e];if(r)return r;const n=new Sre;return this.images[e]=n,n.image.onload=()=>{this._fixImageCoordinates(n.image),n.init(),this._redrawWithImage(n)},n.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,t,n)},n.image.src=e,n}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}var K_={exports:{}},Tre=te,Ore=Tre(function(){if(typeof ArrayBuffer=="function"){var i=new ArrayBuffer(8);Object.isExtensible(i)&&Object.defineProperty(i,"a",{value:8})}}),Ire=te,xre=Ze,Pre=Ir,Vb=Ore,sl=Object.isExtensible,Cre=Ire(function(){sl(1)}),Dre=Cre||Vb?function(e){return!xre(e)||Vb&&Pre(e)==="ArrayBuffer"?!1:sl?sl(e):!0}:sl,Are=te,G_=!Are(function(){return Object.isExtensible(Object.preventExtensions({}))}),Nre=z,Rre=re,kre=ko,Mre=Ze,Pv=Ye,Fre=Tt.f,Wb=zo,Bre=_h,Cv=Dre,jre=yh,Lre=G_,q_=!1,_r=jre("meta"),zre=0,Dv=function(i){Fre(i,_r,{value:{objectID:"O"+zre++,weakData:{}}})},Hre=function(i,e){if(!Mre(i))return typeof i=="symbol"?i:(typeof i=="string"?"S":"P")+i;if(!Pv(i,_r)){if(!Cv(i))return"F";if(!e)return"E";Dv(i)}return i[_r].objectID},Vre=function(i,e){if(!Pv(i,_r)){if(!Cv(i))return!0;if(!e)return!1;Dv(i)}return i[_r].weakData},Wre=function(i){return Lre&&q_&&Cv(i)&&!Pv(i,_r)&&Dv(i),i},Ure=function(){Kre.enable=function(){},q_=!0;var i=Wb.f,e=Rre([].splice),t={};t[_r]=1,i(t).length&&(Wb.f=function(r){for(var n=i(r),s=0,o=n.length;s<o;s++)if(n[s]===_r){e(n,s,1);break}return n},Nre({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Bre.f}))},Kre=K_.exports={enable:Ure,fastKey:Hre,getWeakData:Vre,onFreeze:Wre};kre[_r]=!0;var kh=K_.exports,Gre=Pe,qre=us,Yre=Gre("iterator"),Xre=Array.prototype,Jre=function(i){return i!==void 0&&(qre.Array===i||Xre[Yre]===i)},Zre=Ki,Ub=iv,Qre=os,eie=us,tie=Pe,rie=tie("iterator"),Y_=function(i){if(!Qre(i))return Ub(i,rie)||Ub(i,"@@iterator")||eie[Zre(i)]},iie=Wt,nie=ls,sie=xr,oie=Ao,aie=Y_,lie=TypeError,hie=function(i,e){var t=arguments.length<2?aie(i):e;if(nie(t))return sie(iie(t,i));throw new lie(oie(i)+" is not iterable")},die=Wt,Kb=xr,cie=iv,uie=function(i,e,t){var r,n;Kb(i);try{if(r=cie(i,"return"),!r){if(e==="throw")throw t;return t}r=die(r,i)}catch(s){n=!0,r=s}if(e==="throw")throw t;if(n)throw r;return Kb(r),t},fie=bh,vie=Wt,pie=xr,gie=Ao,yie=Jre,mie=ar,Gb=Me,bie=hie,$ie=Y_,qb=uie,wie=TypeError,ol=function(i,e){this.stopped=i,this.result=e},Yb=ol.prototype,Av=function(i,e,t){var r=t&&t.that,n=!!(t&&t.AS_ENTRIES),s=!!(t&&t.IS_RECORD),o=!!(t&&t.IS_ITERATOR),a=!!(t&&t.INTERRUPTED),l=fie(e,r),h,d,u,c,f,v,g,y=function(m){return h&&qb(h,"normal",m),new ol(!0,m)},p=function(m){return n?(pie(m),a?l(m[0],m[1],y):l(m[0],m[1])):a?l(m,y):l(m)};if(s)h=i.iterator;else if(o)h=i;else{if(d=$ie(i),!d)throw new wie(gie(i)+" is not iterable");if(yie(d)){for(u=0,c=mie(i);c>u;u++)if(f=p(i[u]),f&&Gb(Yb,f))return f;return new ol(!1)}h=bie(i,d)}for(v=s?i.next:h.next;!(g=vie(v,h)).done;){try{f=p(g.value)}catch(m){qb(h,"throw",m)}if(typeof f=="object"&&f&&Gb(Yb,f))return f}return new ol(!1)},Eie=Me,Sie=TypeError,Nv=function(i,e){if(Eie(e,i))return i;throw new Sie("Incorrect invocation")},_ie=z,Tie=_e,Oie=kh,Iie=te,xie=ds,Pie=Av,Cie=Nv,Die=qe,Aie=Ze,Nie=os,Rie=cs,kie=Tt.f,Mie=ai.forEach,Fie=Be,X_=Gi,Bie=X_.set,jie=X_.getterFor,Rv=function(i,e,t){var r=i.indexOf("Map")!==-1,n=i.indexOf("Weak")!==-1,s=r?"set":"add",o=Tie[i],a=o&&o.prototype,l={},h;if(!Fie||!Die(o)||!(n||a.forEach&&!Iie(function(){new o().entries().next()})))h=t.getConstructor(e,i,r,s),Oie.enable();else{h=e(function(c,f){Bie(Cie(c,d),{type:i,collection:new o}),Nie(f)||Pie(f,c[s],{that:c,AS_ENTRIES:r})});var d=h.prototype,u=jie(i);Mie(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(c){var f=c==="add"||c==="set";c in a&&!(n&&c==="clear")&&xie(d,c,function(v,g){var y=u(this).collection;if(!f&&n&&!Aie(v))return c==="get"?void 0:!1;var p=y[c](v===0?0:v,g);return f?this:p})}),n||kie(d,"size",{configurable:!0,get:function(){return u(this).collection.size}})}return Rie(h,i,!1,!0),l[i]=h,_ie({global:!0,forced:!0},l),n||t.setStrong(h,i,r),h},Lie=Ho,kv=function(i,e,t){for(var r in e)t&&t.unsafe&&i[r]?i[r]=e[r]:Lie(i,r,e[r],t);return i},zie=Kt,Hie=cv,Vie=Pe,Wie=Be,Xb=Vie("species"),Uie=function(i){var e=zie(i);Wie&&e&&!e[Xb]&&Hie(e,Xb,{configurable:!0,get:function(){return this}})},Kie=Lo,Gie=cv,Jb=kv,qie=bh,Yie=Nv,Xie=os,Jie=Av,Zie=gv,Ba=yv,Qie=Uie,ws=Be,Zb=kh.fastKey,J_=Gi,Qb=J_.set,Uc=J_.getterFor,Z_={getConstructor:function(i,e,t,r){var n=i(function(h,d){Yie(h,s),Qb(h,{type:e,index:Kie(null),first:void 0,last:void 0,size:0}),ws||(h.size=0),Xie(d)||Jie(d,h[r],{that:h,AS_ENTRIES:t})}),s=n.prototype,o=Uc(e),a=function(h,d,u){var c=o(h),f=l(h,d),v,g;return f?f.value=u:(c.last=f={index:g=Zb(d,!0),key:d,value:u,previous:v=c.last,next:void 0,removed:!1},c.first||(c.first=f),v&&(v.next=f),ws?c.size++:h.size++,g!=="F"&&(c.index[g]=f)),h},l=function(h,d){var u=o(h),c=Zb(d),f;if(c!=="F")return u.index[c];for(f=u.first;f;f=f.next)if(f.key===d)return f};return Jb(s,{clear:function(){for(var d=this,u=o(d),c=u.index,f=u.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),delete c[f.index],f=f.next;u.first=u.last=void 0,ws?u.size=0:d.size=0},delete:function(h){var d=this,u=o(d),c=l(d,h);if(c){var f=c.next,v=c.previous;delete u.index[c.index],c.removed=!0,v&&(v.next=f),f&&(f.previous=v),u.first===c&&(u.first=f),u.last===c&&(u.last=v),ws?u.size--:d.size--}return!!c},forEach:function(d){for(var u=o(this),c=qie(d,arguments.length>1?arguments[1]:void 0),f;f=f?f.next:u.first;)for(c(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(d){return!!l(this,d)}}),Jb(s,t?{get:function(d){var u=l(this,d);return u&&u.value},set:function(d,u){return a(this,d===0?0:d,u)}}:{add:function(d){return a(this,d=d===0?0:d,d)}}),ws&&Gie(s,"size",{configurable:!0,get:function(){return o(this).size}}),n},setStrong:function(i,e,t){var r=e+" Iterator",n=Uc(e),s=Uc(r);Zie(i,e,function(o,a){Qb(this,{type:r,target:o,state:n(o),kind:a,last:void 0})},function(){for(var o=s(this),a=o.kind,l=o.last;l&&l.removed;)l=l.previous;return!o.target||!(o.last=l=l?l.next:o.state.first)?(o.target=void 0,Ba(void 0,!0)):Ba(a==="keys"?l.key:a==="values"?l.value:[l.key,l.value],!1)},t?"entries":"values",!t,!0),Qie(e)}},ene=Rv,tne=Z_;ene("Map",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},tne);var Mv=re,rne=$h,ine=lr,nne=xo,sne=Mv("".charAt),e1=Mv("".charCodeAt),one=Mv("".slice),ane=function(i){return function(e,t){var r=ine(nne(e)),n=rne(t),s=r.length,o,a;return n<0||n>=s?i?"":void 0:(o=e1(r,n),o<55296||o>56319||n+1===s||(a=e1(r,n+1))<56320||a>57343?i?sne(r,n):o:i?one(r,n,n+2):(o-55296<<10)+(a-56320)+65536)}},lne={charAt:ane(!0)},hne=lne.charAt,dne=lr,Q_=Gi,cne=gv,t1=yv,eT="String Iterator",une=Q_.set,fne=Q_.getterFor(eT);cne(String,"String",function(i){une(this,{type:eT,string:dne(i),index:0})},function(){var e=fne(this),t=e.string,r=e.index,n;return r>=t.length?t1(void 0,!0):(n=hne(t,r),e.index+=n.length,t1(n,!1))});var vne=ne,pne=vne.Map,gne=pne,yne=gne,mne=yne,Fv=V(mne);class bne{constructor(){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},Ae(this.options,this.defaultOptions)}setOptions(e){const t=["useDefaultGroups"];if(e!==void 0){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&ee(t).call(t,r)===-1){const n=e[r];this.add(r,n)}}}clear(){this._groups=new Fv,this._groupNames=[]}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this._groups.get(e);if(r===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){const n=this._groupIndex%this._groupNames.length;++this._groupIndex,r={},r.color=this._groups.get(this._groupNames[n]),this._groups.set(e,r)}else{const n=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,r={},r.color=this._defaultGroups[n],this._groups.set(e,r)}return r}add(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}}var $ne=z;$ne({target:"Number",stat:!0},{isNaN:function(e){return e!==e}});var wne=ne,Ene=wne.Number.isNaN,Sne=Ene,_ne=Sne,Tne=_ne,df=V(Tne),One=_e,Ine=One.isFinite,xne=Number.isFinite||function(e){return typeof e=="number"&&Ine(e)},Pne=z,Cne=xne;Pne({target:"Number",stat:!0},{isFinite:Cne});var Dne=ne,Ane=Dne.Number.isFinite,Nne=Ane,Rne=Nne,kne=Rne,mi=V(kne),Mne=z,Fne=ai.some,Bne=fs,jne=Bne("some");Mne({target:"Array",proto:!0,forced:!jne},{some:function(e){return Fne(this,e,arguments.length>1?arguments[1]:void 0)}});var Lne=Xe,zne=Lne("Array").some,Hne=Me,Vne=zne,Kc=Array.prototype,Wne=function(i){var e=i.some;return i===Kc||Hne(Kc,i)&&e===Kc.some?Vne:e},Une=Wne,Kne=Une,Gne=Kne,qne=V(Gne),tT={exports:{}},Yne=z,Xne=Be,r1=Tt.f;Yne({target:"Object",stat:!0,forced:Object.defineProperty!==r1,sham:!Xne},{defineProperty:r1});var Jne=ne,rT=Jne.Object,Zne=tT.exports=function(e,t,r){return rT.defineProperty(e,t,r)};rT.defineProperty.sham&&(Zne.sham=!0);var Qne=tT.exports,ese=Qne,iT=ese,tse=iT,rse=tse,ise=rse,nse=ise,sse=nse,ose=V(sse),ase=Pe,lse=Tt.f,i1=ase("metadata"),n1=Function.prototype;n1[i1]===void 0&&lse(n1,i1,{value:null});var hse=Te;hse("asyncDispose");var dse=Te;dse("dispose");var cse=Te;cse("metadata");var use=qS,fse=use,vse=Kt,pse=re,Bv=vse("Symbol"),gse=Bv.keyFor,yse=pse(Bv.prototype.valueOf),nT=Bv.isRegisteredSymbol||function(e){try{return gse(yse(e))!==void 0}catch{return!1}},mse=z,bse=nT;mse({target:"Symbol",stat:!0},{isRegisteredSymbol:bse});var $se=hs,sT=Kt,wse=re,Ese=Do,Sse=Pe,Rl=sT("Symbol"),s1=Rl.isWellKnownSymbol,oT=sT("Object","getOwnPropertyNames"),_se=wse(Rl.prototype.valueOf),o1=$se("wks");for(var Gc=0,a1=oT(Rl),Tse=a1.length;Gc<Tse;Gc++)try{var l1=a1[Gc];Ese(Rl[l1])&&Sse(l1)}catch{}var aT=function(e){if(s1&&s1(e))return!0;try{for(var t=_se(e),r=0,n=oT(o1),s=n.length;r<s;r++)if(o1[n[r]]==t)return!0}catch{}return!1},Ose=z,Ise=aT;Ose({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:Ise});var xse=Te;xse("matcher");var Pse=Te;Pse("observable");var Cse=z,Dse=nT;Cse({target:"Symbol",stat:!0},{isRegistered:Dse});var Ase=z,Nse=aT;Ase({target:"Symbol",stat:!0,forced:!0},{isWellKnown:Nse});var Rse=Te;Rse("metadataKey");var kse=Te;kse("patternMatch");var Mse=Te;Mse("replaceAll");var Fse=fse,Bse=Fse,jse=Bse,ja=V(jse),Lse=Vo,zse=Lse.f("iterator"),Hse=zse,Vse=Hse,Wse=Vse,Use=Wse,Kse=Use,Gse=Kse,qse=Gse,Yse=V(qse);function ro(i){"@babel/helpers - typeof";return ro=typeof ja=="function"&&typeof Yse=="symbol"?function(e){return typeof e}:function(e){return e&&typeof ja=="function"&&e.constructor===ja&&e!==ja.prototype?"symbol":typeof e},ro(i)}var Xse=Vo,Jse=Xse.f("toPrimitive"),Zse=Jse,Qse=Zse,eoe=Qse,toe=eoe,roe=toe,ioe=roe,noe=ioe,soe=V(noe);function ooe(i,e){if(ro(i)!=="object"||i===null)return i;var t=i[soe];if(t!==void 0){var r=t.call(i,e);if(ro(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function aoe(i){var e=ooe(i,"string");return ro(e)==="symbol"?e:String(e)}function Mh(i,e,t){return e=aoe(e),e in i?ose(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var lT=_e,loe=te,hoe=re,doe=lr,coe=r_.trim,uoe=mv,foe=hoe("".charAt),kl=lT.parseFloat,h1=lT.Symbol,d1=h1&&h1.iterator,voe=1/kl(uoe+"-0")!==-1/0||d1&&!loe(function(){kl(Object(d1))}),poe=voe?function(e){var t=coe(doe(e)),r=kl(t);return r===0&&foe(t,0)==="-"?-0:r}:kl,goe=z,c1=poe;goe({global:!0,forced:parseFloat!==c1},{parseFloat:c1});var yoe=ne,moe=yoe.parseFloat,boe=moe,$oe=boe,woe=$oe,hT=V(woe),Eoe=z,Soe=te,_oe=_h.f,Toe=Soe(function(){return!Object.getOwnPropertyNames(1)});Eoe({target:"Object",stat:!0,forced:Toe},{getOwnPropertyNames:_oe});var Ooe=ne,Ioe=Ooe.Object,xoe=function(e){return Ioe.getOwnPropertyNames(e)},Poe=xoe,Coe=Poe,Doe=Coe,Aoe=V(Doe),Noe=ne,Roe=Noe.Object.getOwnPropertySymbols,koe=Roe,Moe=koe,Foe=Moe,ti=V(Foe),dT={exports:{}},Boe=z,joe=te,Loe=Ut,cT=To.f,uT=Be,zoe=!uT||joe(function(){cT(1)});Boe({target:"Object",stat:!0,forced:zoe,sham:!uT},{getOwnPropertyDescriptor:function(e,t){return cT(Loe(e),t)}});var Hoe=ne,fT=Hoe.Object,Voe=dT.exports=function(e,t){return fT.getOwnPropertyDescriptor(e,t)};fT.getOwnPropertyDescriptor.sham&&(Voe.sham=!0);var Woe=dT.exports,Uoe=Woe,Koe=Uoe,Goe=Koe,li=V(Goe),qoe=z,Yoe=Be,Xoe=hX,Joe=Ut,Zoe=To,Qoe=Bo;qoe({target:"Object",stat:!0,sham:!Yoe},{getOwnPropertyDescriptors:function(e){for(var t=Joe(e),r=Zoe.f,n=Xoe(t),s={},o=0,a,l;n.length>o;)l=r(t,a=n[o++]),l!==void 0&&Qoe(s,a,l);return s}});var eae=ne,tae=eae.Object.getOwnPropertyDescriptors,rae=tae,iae=rae,nae=iae,ri=V(nae),vT={exports:{}},sae=z,oae=Be,u1=Eh.f;sae({target:"Object",stat:!0,forced:Object.defineProperties!==u1,sham:!oae},{defineProperties:u1});var aae=ne,pT=aae.Object,lae=vT.exports=function(e,t){return pT.defineProperties(e,t)};pT.defineProperties.sham&&(lae.sham=!0);var hae=vT.exports,dae=hae,cae=dae,uae=cae,Fh=V(uae),fae=iT,Bh=V(fae);function jv(i,e){const t=["node","edge","label"];let r=!0;const n=Fr(e,"chosen");if(typeof n=="boolean")r=n;else if(typeof n=="object"){if(ee(t).call(t,i)===-1)throw new Error("choosify: subOption '"+i+"' should be one of '"+t.join("', '")+"'");const s=Fr(e,["chosen",i]);(typeof s=="boolean"||typeof s=="function")&&(r=s)}return r}function cf(i,e,t){if(i.width<=0||i.height<=0)return!1;if(t!==void 0){const s={x:e.x-t.x,y:e.y-t.y};if(t.angle!==0){const o=-t.angle;e={x:Math.cos(o)*s.x-Math.sin(o)*s.y,y:Math.sin(o)*s.x+Math.cos(o)*s.y}}else e=s}const r=i.x+i.width,n=i.y+i.width;return i.left<e.x&&r>e.x&&i.top<e.y&&n>e.y}function Ml(i){return typeof i=="string"&&i!==""}function gT(i,e,t,r){let n=r.x,s=r.y;if(typeof r.distanceToBorder=="function"){const o=r.distanceToBorder(i,e),a=Math.sin(e)*o,l=Math.cos(e)*o;l===o?(n+=o,s=r.y):a===o?(n=r.x,s-=o):(n+=l,s-=a)}else r.shape.width>r.shape.height?(n=r.x+r.shape.width*.5,s=r.y-t):(n=r.x+t,s=r.y-r.shape.height*.5);return{x:n,y:s}}var vae=Xe,pae=vae("Array").values,gae=pae,yae=gae,mae=Ki,bae=Ye,$ae=Me,wae=yae,qc=Array.prototype,Eae={DOMTokenList:!0,NodeList:!0},Sae=function(i){var e=i.values;return i===qc||$ae(qc,i)&&e===qc.values||bae(Eae,mae(i))?wae:e},_ae=Sae,yT=V(_ae);class Tae{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let n=t;(t===void 0||t==="")&&(n=" ");const s=this.measureText(n,r),o=Ae({},yT(s));o.text=t,o.width=s.width,o.mod=r,(t===void 0||t==="")&&(o.width=0),this.lines[e].blocks.push(o),this.lines[e].width+=o.width}curWidth(){const e=this.lines[this.current];return e===void 0?0:e.width}append(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t)}newLine(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t),this.current++}determineLineHeights(){for(let e=0;e<this.lines.length;e++){const t=this.lines[e];let r=0;if(t.blocks!==void 0)for(let n=0;n<t.blocks.length;n++){const s=t.blocks[n];r<s.height&&(r=s.height)}t.height=r}}determineLabelSize(){let e=0,t=0;for(let r=0;r<this.lines.length;r++){const n=this.lines[r];n.width>e&&(e=n.width),t+=n.height}this.width=e,this.height=t}removeEmptyBlocks(){const e=[];for(let t=0;t<this.lines.length;t++){const r=this.lines[t];if(r.blocks.length===0||t===this.lines.length-1&&r.width===0)continue;const n={};Ae(n,r),n.blocks=[];let s;const o=[];for(let a=0;a<r.blocks.length;a++){const l=r.blocks[a];l.width!==0?o.push(l):s===void 0&&(s=l)}o.length===0&&s!==void 0&&o.push(s),n.blocks=o,e.push(n)}return e}finalize(){this.determineLineHeights(),this.determineLabelSize();const e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}}const Oae={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/};class f1{constructor(e){this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return this.modStack.length===0?"normal":this.modStack[0]}modName(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}parseWS(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}setTag(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}unsetTag(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}parseStartTag(e,t){return!this.mono&&!this[e]&&this.match(t)?(this.setTag(e),!0):!1}match(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const[r,n]=this.prepareRegExp(e),s=r.test(this.text.substr(this.position,n));return s&&t&&(this.position+=n-1),s}parseEndTag(e,t,r){let n=this.mod()===e;return e==="mono"?n=n&&this.mono:n=n&&!this.mono,n&&this.match(t)?(r!==void 0?(this.position===this.text.length-1||this.match(r,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}replace(e,t){return this.match(e)?(this.add(t),this.position+=length-1,!0):!1}prepareRegExp(e){let t,r;if(e instanceof RegExp)r=e,t=1;else{const n=Oae[e];n!==void 0?r=n:r=new RegExp(e),t=e.length}return[r,t]}}class Iae{constructor(e,t,r,n){this.ctx=e,this.parent=t,this.selected=r,this.hover=n;const s=(o,a)=>{if(o===void 0)return 0;const l=this.parent.getFormattingValues(e,r,n,a);let h=0;return o!==""&&(h=this.ctx.measureText(o).width),{width:h,values:l}};this.lines=new Tae(s)}process(e){if(!Ml(e))return this.lines.finalize();const t=this.parent.fontOptions;e=e.replace(/\r\n/g,`
|
||
`),e=e.replace(/\r/g,`
|
||
`);const r=String(e).split(`
|
||
`),n=r.length;if(t.multi)for(let s=0;s<n;s++){const o=this.splitBlocks(r[s],t.multi);if(o!==void 0){if(o.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(let a=0;a<o.length;a++){const l=o[a].mod,h=o[a].text;this.splitStringIntoLines(h,l,!0)}else for(let a=0;a<o.length;a++){const l=o[a].mod,h=o[a].text;this.lines.append(h,l)}this.lines.newLine()}}else if(t.maxWdt>0)for(let s=0;s<n;s++)this.splitStringIntoLines(r[s]);else for(let s=0;s<n;s++)this.lines.newLine(r[s]);return this.lines.finalize()}decodeMarkupSystem(e){let t="none";return e==="markdown"||e==="md"?t="markdown":(e===!0||e==="html")&&(t="html"),t}splitHtmlBlocks(e){const t=new f1(e),r=n=>/&/.test(n)?(t.replace(t.text,"<","<")||t.replace(t.text,"&","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){const n=t.text.charAt(t.position);t.parseWS(n)||/</.test(n)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||r(n)||t.add(n),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){const t=new f1(e);let r=!0;const n=s=>/\\/.test(s)?(t.position<this.text.length+1&&(t.position++,s=this.text.charAt(t.position),/ \t/.test(s)?t.spacing=!0:(t.add(s),r=!1)),!0):!1;for(;t.position<t.text.length;){const s=t.text.charAt(t.position);t.parseWS(s)||n(s)||(r||t.spacing)&&(t.parseStartTag("bold","*")||t.parseStartTag("ital","_")||t.parseStartTag("mono","`"))||t.parseEndTag("bold","*","afterBold")||t.parseEndTag("ital","_","afterItal")||t.parseEndTag("mono","`","afterMono")||(t.add(s),r=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){const r=this.decodeMarkupSystem(t);if(r==="none")return[{text:e,mod:"normal"}];if(r==="markdown")return this.splitMarkdownBlocks(e);if(r==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){const t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",r=0;for(;r<e.length;){const s=t+(t===""?"":" ")+e[r];if(this.overMaxWidth(s))break;t=s,r++}return r}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(Zt(e).call(e,0,t));)t++;return t}splitStringIntoLines(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let n=e.split("\r");for(;n.length>0;){let s=this.getLongestFit(n);if(s===0){const o=n[0],a=this.getLongestFitWord(o);this.lines.newLine(Zt(o).call(o,0,a),t),n[0]=Zt(o).call(o,a)}else{let o=s;n[s-1]===" "?s--:n[o]===" "&&o++;const a=Zt(n).call(n,0,s).join("");s==n.length&&r?this.lines.append(a,t):this.lines.newLine(a,t),n=Zt(n).call(n,o)}}}}const Es=["bold","ital","boldital","mono"];class Pn{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=r}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),Ml(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(typeof e.font=="object"){const t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(X(Es,t=>{this.fontOptions[t]={}}),Pn.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}X(e,(t,r)=>{t!=null&&typeof t!="object"&&(this.fontOptions[r]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;const r=t.split(" ");return e.size=+r[0].replace("px",""),e.face=r[1],e.color=r[2],!0}constrain(e){const t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},r=Fr(e,"widthConstraint");if(typeof r=="number")t.maxWdt=Number(r),t.minWdt=Number(r);else if(typeof r=="object"){const s=Fr(e,["widthConstraint","maximum"]);typeof s=="number"&&(t.maxWdt=Number(s));const o=Fr(e,["widthConstraint","minimum"]);typeof o=="number"&&(t.minWdt=Number(o))}const n=Fr(e,"heightConstraint");if(typeof n=="number")t.minHgt=Number(n);else if(typeof n=="object"){const s=Fr(e,["heightConstraint","minimum"]);typeof s=="number"&&(t.minHgt=Number(s));const o=Fr(e,["heightConstraint","valign"]);typeof o=="string"&&(o==="top"||o==="bottom")&&(t.valign=o)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),le(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=jv("label",t)}adjustSizes(e){const t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);const r=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=r)}addFontOptionsToPile(e,t){for(let r=0;r<t.length;++r)this.addFontToPile(e,t[r])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;const r=t.font;e.push(r)}getBasicOptions(e){const t={};for(let r=0;r<e.length;++r){let n=e[r];const s={};Pn.parseFontString(s,n)&&(n=s),X(n,(o,a)=>{o!==void 0&&(Object.prototype.hasOwnProperty.call(t,a)||(ee(Es).call(Es,a)!==-1?t[a]={}:t[a]=o))})}return t}getFontOption(e,t,r){let n;for(let s=0;s<e.length;++s){const o=e[s];if(Object.prototype.hasOwnProperty.call(o,t)){if(n=o[t],n==null)continue;const a={};if(Pn.parseFontString(a,n)&&(n=a),Object.prototype.hasOwnProperty.call(n,r))return n[r]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,r))return this.fontOptions[r];throw new Error("Did not find value for multi-font for property: '"+r+"'")}getFontOptions(e,t){const r={},n=["color","size","face","mod","vadjust"];for(let s=0;s<n.length;++s){const o=n[s];r[o]=this.getFontOption(e,t,o)}return r}propagateFonts(e){const t=[];this.addFontOptionsToPile(t,e),this.fontOptions=this.getBasicOptions(t);for(let r=0;r<Es.length;++r){const n=Es[r],s=this.fontOptions[n],o=this.getFontOptions(t,n);X(o,(a,l)=>{s[l]=a}),s.size=Number(s.size),s.vadjust=Number(s.vadjust)}}draw(e,t,r,n,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let a=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&a<this.elementOptions.scaling.label.drawThreshold-1||(a>=this.elementOptions.scaling.label.maxVisible&&(a=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,n,s,t,r,o),this._drawBackground(e),this._drawText(e,t,this.size.yLine,o,a))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;const t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}_drawText(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",s=arguments.length>4?arguments[4]:void 0;[t,r]=this._setAlignment(e,t,r,n),e.textAlign="left",t=t-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(r-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(r+=(this.size.height-this.size.labelHeight)/2));for(let o=0;o<this.lineCount;o++){const a=this.lines[o];if(a&&a.blocks){let l=0;this.isEdgeLabel||this.fontOptions.align==="center"?l+=(this.size.width-a.width)/2:this.fontOptions.align==="right"&&(l+=this.size.width-a.width);for(let h=0;h<a.blocks.length;h++){const d=a.blocks[h];e.font=d.font;const[u,c]=this._getColor(d.color,s,d.strokeColor);d.strokeWidth>0&&(e.lineWidth=d.strokeWidth,e.strokeStyle=c,e.lineJoin="round"),e.fillStyle=u,d.strokeWidth>0&&e.strokeText(d.text,t+l,r+d.vadjust),e.fillText(d.text,t+l,r+d.vadjust),l+=d.width}r+=a.height}}}_setAlignment(e,t,r,n){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){t=0,r=0;const s=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",r-=2*s):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",r+=2*s):e.textBaseline="middle"}else e.textBaseline=n;return[t,r]}_getColor(e,t,r){let n=e||"#000000",s=r||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){const o=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));n=xt(n,o),s=xt(s,o)}return[n,s]}getTextSize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,r),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let t=this.size.left,r=this.size.top-.5*2;if(this.isEdgeLabel){const s=-this.size.width*.5;switch(this.fontOptions.align){case"middle":t=s,r=-this.size.height*.5;break;case"top":t=s,r=-(this.size.height+2);break;case"bottom":t=s,r=2;break}}return{left:t,top:r,width:this.size.width,height:this.size.height}}calculateLabelSize(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,t,r),this.size.left=n-this.size.width*.5,this.size.top=s-this.size.height*.5,this.size.yLine=s+(1-this.lineCount)*.5*this.fontOptions.size,o==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,t,r,n){const s=function(l,h,d){return h==="normal"?d==="mod"?"":l[d]:l[h][d]!==void 0?l[h][d]:l[d]},o={color:s(this.fontOptions,n,"color"),size:s(this.fontOptions,n,"size"),face:s(this.fontOptions,n,"face"),mod:s(this.fontOptions,n,"mod"),vadjust:s(this.fontOptions,n,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||r)&&(n==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?o.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(o,this.elementOptions.id,t,r));let a="";return o.mod!==void 0&&o.mod!==""&&(a+=o.mod+" "),a+=o.size+"px "+o.face,e.font=a.replace(/"/g,""),o.font=e.font,o.height=o.size,o}differentState(e,t){return e!==this.selectedState||t!==this.hoverState}_processLabelText(e,t,r,n){return new Iae(e,this,t,r).process(n)}_processLabel(e,t,r){if(this.labelDirty===!1&&!this.differentState(t,r))return;const n=this._processLabelText(e,t,r,this.elementOptions.label);this.fontOptions.minWdt>0&&n.width<this.fontOptions.minWdt&&(n.width=this.fontOptions.minWdt),this.size.labelHeight=n.height,this.fontOptions.minHgt>0&&n.height<this.fontOptions.minHgt&&(n.height=this.fontOptions.minHgt),this.lines=n.lines,this.lineCount=n.lines.length,this.size.width=n.width,this.size.height=n.height,this.selectedState=t,this.hoverState=r,this.labelDirty=!1}visible(){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)}}class Yi{constructor(e,t,r){this.body=t,this.labelModule=r,this.setOptions(e),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}}setOptions(e){this.options=e}_setMargins(e){this.margin={},this.options.margin&&(typeof 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)}_distanceToBorder(e,t){const r=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)))+r}enableShadow(e,t){t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}enableBorderDashes(e,t){if(t.borderDashes!==!1)if(e.setLineDash!==void 0){let r=t.borderDashes;r===!0&&(r=[5,15]),e.setLineDash(r)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1}disableBorderDashes(e,t){t.borderDashes!==!1&&(e.setLineDash!==void 0?e.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1))}needsRefresh(e,t){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,t)}initContextForDraw(e,t){const r=t.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,r),e.strokeStyle=t.borderColor,e.fillStyle=t.color}performStroke(e,t){const r=t.borderWidth/this.body.view.scale;e.save(),r>0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}performFill(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),Go(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,t,r,n,s){r!==void 0&&this.resize(r,n,s),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}updateBoundingBox(e,t,r,n,s){this._updateBoundingBox(e,t,r,n,s)}getDimensionsFromLabel(e,t,r){this.textSize=this.labelModule.getTextSize(e,t,r);let n=this.textSize.width,s=this.textSize.height;const o=14;return n===0&&(n=o,s=o),{width:n,height:s}}}let xae=class extends Yi{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,r)){const n=this.getDimensionsFromLabel(e,t,r);this.width=n.width+this.margin.right+this.margin.left,this.height=n.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,t,r,n,s,o){this.resize(e,n,s),this.left=t-this.width/2,this.top=r-this.height/2,this.initContextForDraw(e,o),ZE(e,this.left,this.top,this.width,this.height,o.borderRadius),this.performFill(e,o),this.updateBoundingBox(t,r,e,n,s),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,s)}updateBoundingBox(e,t,r,n,s){this._updateBoundingBox(e,t,r,n,s);const o=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(o)}distanceToBorder(e,t){e&&this.resize(e);const r=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+r}};class Lv extends Yi{constructor(e,t,r){super(e,t,r),this.labelOffset=0,this.selected=!1}setOptions(e,t,r){this.options=e,t===void 0&&r===void 0||this.setImages(t,r)}setImages(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}switchImages(e){const t=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&t){const r=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=r}}_getImagePadding(){const e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){const t=this.options.imagePadding;typeof 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}_resizeImage(){let e,t;if(this.options.shapeProperties.useImageSize===!1){let r=1,n=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?r=this.imageObj.width/this.imageObj.height:n=this.imageObj.height/this.imageObj.width),e=this.options.size*2*r,t=this.options.size*2*n}else{const r=this._getImagePadding();e=this.imageObj.width+r.left+r.right,t=this.imageObj.height+r.top+r.bottom}this.width=e,this.height=t,this.radius=.5*this.width}_drawRawCircle(e,t,r,n){this.initContextForDraw(e,n),av(e,t,r,n.size),this.performFill(e,n)}_drawImageAtPosition(e,t){if(this.imageObj.width!=0){e.globalAlpha=t.opacity!==void 0?t.opacity:1,this.enableShadow(e,t);let r=1;this.options.shapeProperties.interpolation===!0&&(r=this.imageObj.width/this.width/this.body.view.scale);const n=this._getImagePadding(),s=this.left+n.left,o=this.top+n.top,a=this.width-n.left-n.right,l=this.height-n.top-n.bottom;this.imageObj.drawImageAtPosition(e,r,s,o,a,l),this.disableShadow(e,t)}}_drawImageLabel(e,t,r,n,s){let o=0;if(this.height!==void 0){o=this.height*.5;const l=this.labelModule.getTextSize(e,n,s);l.lineCount>=1&&(o+=l.height/2)}const a=r+o;this.options.label&&(this.labelOffset=o),this.labelModule.draw(e,t,a,n,s,"hanging")}}let Pae=class extends Lv{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,r)){const n=this.getDimensionsFromLabel(e,t,r),s=Math.max(n.width+this.margin.right+this.margin.left,n.height+this.margin.top+this.margin.bottom);this.options.size=s/2,this.width=s,this.height=s,this.radius=this.width/2}}draw(e,t,r,n,s,o){this.resize(e,n,s),this.left=t-this.width/2,this.top=r-this.height/2,this._drawRawCircle(e,t,r,o),this.updateBoundingBox(t,r),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,r,n,s)}updateBoundingBox(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}distanceToBorder(e){return e&&this.resize(e),this.width*.5}};class Cae extends Lv{constructor(e,t,r,n,s){super(e,t,r),this.setImages(n,s)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=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){const s=this.options.size*2;this.width=s,this.height=s,this.radius=.5*this.width;return}this.needsRefresh(t,r)&&this._resizeImage()}draw(e,t,r,n,s,o){this.switchImages(n),this.resize();let a=t,l=r;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=r,a+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=r-this.height/2),this._drawRawCircle(e,a,l,o),e.save(),e.clip(),this._drawImageAtPosition(e,o),e.restore(),this._drawImageLabel(e,a,l,n,s),this.updateBoundingBox(t,r)}updateBoundingBox(e,t){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=t,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=t+this.options.size*2):(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)}distanceToBorder(e){return e&&this.resize(e),this.width*.5}}class hi extends Yi{constructor(e,t,r){super(e,t,r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,r)){var s,o;this.labelModule.getTextSize(e,t,r);const a=2*n.size;this.width=(s=this.customSizeWidth)!==null&&s!==void 0?s:a,this.height=(o=this.customSizeHeight)!==null&&o!==void 0?o:a,this.radius=.5*this.width}}_drawShape(e,t,r,n,s,o,a,l){return this.resize(e,o,a,l),this.left=n-this.width/2,this.top=s-this.height/2,this.initContextForDraw(e,l),pU(t)(e,n,s,l.size),this.performFill(e,l),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(o?"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,n,s)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,o,a,n,s,"hanging");const h=s+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,n,h,o,a,"hanging")}this.updateBoundingBox(n,s)}}}updateBoundingBox(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))}}function v1(i,e){var t=$e(i);if(ti){var r=ti(i);e&&(r=pt(r).call(r,function(n){return li(i,n).enumerable})),t.push.apply(t,r)}return t}function Dae(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?oe(t=v1(Object(n),!0)).call(t,function(s){Mh(i,s,n[s])}):ri?Fh(i,ri(n)):oe(r=v1(Object(n))).call(r,function(s){Bh(i,s,li(n,s))})}return i}class Aae extends hi{constructor(e,t,r,n){super(e,t,r,n),this.ctxRenderer=n}draw(e,t,r,n,s,o){this.resize(e,n,s,o),this.left=t-this.width/2,this.top=r-this.height/2,e.save();const a=this.ctxRenderer({ctx:e,id:this.options.id,x:t,y:r,state:{selected:n,hover:s},style:Dae({},o),label:this.options.label});if(a.drawNode!=null&&a.drawNode(),e.restore(),a.drawExternalLabel){const l=a.drawExternalLabel;a.drawExternalLabel=()=>{e.save(),l(),e.restore()}}return a.nodeDimensions&&(this.customSizeWidth=a.nodeDimensions.width,this.customSizeHeight=a.nodeDimensions.height),a}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class Nae extends Yi{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e,t,r){if(this.needsRefresh(t,r)){const s=this.getDimensionsFromLabel(e,t,r).width+this.margin.right+this.margin.left;this.width=s,this.height=s,this.radius=this.width/2}}draw(e,t,r,n,s,o){this.resize(e,n,s),this.left=t-this.width/2,this.top=r-this.height/2,this.initContextForDraw(e,o),QE(e,t-this.width/2,r-this.height/2,this.width,this.height),this.performFill(e,o),this.updateBoundingBox(t,r,e,n,s),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let Rae=class extends hi{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,s,o){return this._drawShape(e,"diamond",4,t,r,n,s,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class kae extends hi{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,s,o){return this._drawShape(e,"circle",2,t,r,n,s,o)}distanceToBorder(e){return e&&this.resize(e),this.options.size}}class p1 extends Yi{constructor(e,t,r){super(e,t,r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,r)){const n=this.getDimensionsFromLabel(e,t,r);this.height=n.height*2,this.width=n.width+n.height,this.radius=.5*this.width}}draw(e,t,r,n,s,o){this.resize(e,n,s),this.left=t-this.width*.5,this.top=r-this.height*.5,this.initContextForDraw(e,o),Lu(e,this.left,this.top,this.width,this.height),this.performFill(e,o),this.updateBoundingBox(t,r,e,n,s),this.labelModule.draw(e,t,r,n,s)}distanceToBorder(e,t){e&&this.resize(e);const r=this.width*.5,n=this.height*.5,s=Math.sin(t)*r,o=Math.cos(t)*n;return r*n/Math.sqrt(s*s+o*o)}}class Mae extends Yi{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e,t,r){this.needsRefresh(t,r)&&(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)}draw(e,t,r,n,s,o){return this.resize(e,n,s),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=r-this.height/2,this._icon(e,t,r,n,s,o),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,r+this.height/2+5,n),this.updateBoundingBox(t,r)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.icon.size*.5,this.boundingBox.left=e-this.options.icon.size*.5,this.boundingBox.right=e+this.options.icon.size*.5,this.boundingBox.bottom=t+this.options.icon.size*.5,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))}_icon(e,t,r,n,s,o){const a=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:n?"bold":"",(this.options.icon.weight!=null&&n?5:0)+a+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,o),e.fillText(this.options.icon.code,t,r),this.disableShadow(e,o)):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.")}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let Fae=class extends Lv{constructor(e,t,r,n,s){super(e,t,r),this.setImages(n,s)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=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){const s=this.options.size*2;this.width=s,this.height=s;return}this.needsRefresh(t,r)&&this._resizeImage()}draw(e,t,r,n,s,o){e.save(),this.switchImages(n),this.resize();let a=t,l=r;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=r,a+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=r-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){const h=this.options.borderWidth,d=this.options.borderWidthSelected||2*this.options.borderWidth,u=(n?d:h)/this.body.view.scale;e.lineWidth=Math.min(this.width,u),e.beginPath();let c=n?this.options.color.highlight.border:s?this.options.color.hover.border:this.options.color.border,f=n?this.options.color.highlight.background:s?this.options.color.hover.background:this.options.color.background;o.opacity!==void 0&&(c=xt(c,o.opacity),f=xt(f,o.opacity)),e.strokeStyle=c,e.fillStyle=f,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),Go(e).call(e),this.performStroke(e,o),e.closePath()}this._drawImageAtPosition(e,o),this._drawImageLabel(e,a,l,n,s),this.updateBoundingBox(t,r),e.restore()}updateBoundingBox(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))}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class Bae extends hi{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,s,o){return this._drawShape(e,"square",2,t,r,n,s,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class jae extends hi{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,s,o){return this._drawShape(e,"hexagon",4,t,r,n,s,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class Lae extends hi{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,s,o){return this._drawShape(e,"star",4,t,r,n,s,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class zae extends Yi{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e,t,r){this.needsRefresh(t,r)&&(this.textSize=this.labelModule.getTextSize(e,t,r),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)}draw(e,t,r,n,s,o){this.resize(e,n,s),this.left=t-this.width/2,this.top=r-this.height/2,this.enableShadow(e,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,s),this.disableShadow(e,o),this.updateBoundingBox(t,r,e,n,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let Hae=class extends hi{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,s,o){return this._drawShape(e,"triangle",3,t,r,n,s,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class Vae extends hi{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,s,o){return this._drawShape(e,"triangleDown",3,t,r,n,s,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}function g1(i,e){var t=$e(i);if(ti){var r=ti(i);e&&(r=pt(r).call(r,function(n){return li(i,n).enumerable})),t.push.apply(t,r)}return t}function y1(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?oe(t=g1(Object(n),!0)).call(t,function(s){Mh(i,s,n[s])}):ri?Fh(i,ri(n)):oe(r=g1(Object(n))).call(r,function(s){Bh(i,s,li(n,s))})}return i}class fe{constructor(e,t,r,n,s,o){this.options=Jr(s),this.globalOptions=s,this.defaultOptions=o,this.body=t,this.edges=[],this.id=void 0,this.imagelist=r,this.grouplist=n,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 Pn(this.body,this.options,!1),this.setOptions(e)}attachEdge(e){var t;ee(t=this.edges).call(t,e)===-1&&this.edges.push(e)}detachEdge(e){var t;const r=ee(t=this.edges).call(t,e);if(r!=-1){var n;yr(n=this.edges).call(n,r,1)}}setOptions(e){const t=this.options.shape;if(!e)return;if(typeof e.color<"u"&&(this._localColor=e.color),e.id!==void 0&&(this.id=e.id),this.id===void 0)throw new Error("Node must have an id");fe.checkMass(e,this.id),e.x!==void 0&&(e.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=jt(e.x),this.predefinedPosition=!0)),e.y!==void 0&&(e.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=jt(e.y),this.predefinedPosition=!0)),e.size!==void 0&&(this.baseSize=e.size),e.value!==void 0&&(e.value=hT(e.value)),fe.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);const r=[e,this.options,this.defaultOptions];return this.chooser=jv("node",r),this._load_images(),this.updateLabelModule(e),e.opacity!==void 0&&fe.checkOpacity(e.opacity)&&(this.options.opacity=e.opacity),this.updateShape(t),e.hidden!==void 0||e.physics!==void 0}_load_images(){if((this.options.shape==="circularImage"||this.options.shape==="image")&&this.options.image===void 0)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(this.options.image!==void 0){if(this.imagelist===void 0)throw new 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 new 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=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id):this.imageObjAlt=void 0}}}static checkOpacity(e){return 0<=e&&e<=1}static checkCoordinateOrigin(e){return e===void 0||e==="center"||e==="top-left"}static updateGroupOptions(e,t,r){var n;if(r===void 0)return;const s=e.group;if(t!==void 0&&t.group!==void 0&&s!==t.group)throw new Error("updateGroupOptions: group values in options don't match.");if(!(typeof s=="number"||typeof s=="string"&&s!=""))return;const a=r.get(s);a.opacity!==void 0&&t.opacity===void 0&&(fe.checkOpacity(a.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+a.opacity),a.opacity=void 0));const l=pt(n=Aoe(t)).call(n,h=>t[h]!=null);l.push("font"),Al(l,e,a),e.color=of(e.color)}static parseOptions(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=arguments.length>4?arguments[4]:void 0;if(Al(["color","fixed","shadow"],e,t,r),fe.checkMass(t),e.opacity!==void 0&&(fe.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),t.opacity!==void 0&&(fe.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),t.shapeProperties&&!fe.checkCoordinateOrigin(t.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+t.shapeProperties.coordinateOrigin),It(e,t,"shadow",n),t.color!==void 0&&t.color!==null){const a=of(t.color);R_(e.color,a)}else r===!0&&t.color===null&&(e.color=Jr(n.color));t.fixed!==void 0&&t.fixed!==null&&(typeof t.fixed=="boolean"?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(t.fixed.x!==void 0&&typeof t.fixed.x=="boolean"&&(e.fixed.x=t.fixed.x),t.fixed.y!==void 0&&typeof t.fixed.y=="boolean"&&(e.fixed.y=t.fixed.y))),r===!0&&t.font===null&&(e.font=Jr(n.font)),fe.updateGroupOptions(e,t,s),t.scaling!==void 0&&It(e.scaling,t.scaling,"label",n.scaling)}getFormattingValues(){const 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?this.chooser===!0?this.selected?(this.options.borderWidthSelected!=null?e.borderWidth=this.options.borderWidthSelected:e.borderWidth*=2,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),e.shadow===!1&&(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){const t=this.options.opacity;e.borderColor=xt(e.borderColor,t),e.color=xt(e.color,t),e.shadowColor=xt(e.shadowColor,t)}return e}updateLabelModule(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),fe.updateGroupOptions(this.options,y1(y1({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);const t=this.grouplist.get(this.options.group,!1),r=[e,this.options,t,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,r),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(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 xae(this.options,this.body,this.labelModule);break;case"circle":this.shape=new Pae(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new Cae(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new Aae(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new Nae(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new Rae(this.options,this.body,this.labelModule);break;case"dot":this.shape=new kae(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new p1(this.options,this.body,this.labelModule);break;case"icon":this.shape=new Mae(this.options,this.body,this.labelModule);break;case"image":this.shape=new Fae(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new Bae(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new jae(this.options,this.body,this.labelModule);break;case"star":this.shape=new Lae(this.options,this.body,this.labelModule);break;case"text":this.shape=new zae(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new Hae(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new Vae(this.options,this.body,this.labelModule);break;default:this.shape=new p1(this.options,this.body,this.labelModule);break}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(e,t){return this.shape.distanceToBorder(e,t)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(e,t,r){if(this.options.value!==void 0){const n=this.options.scaling.customScalingFunction(e,t,r,this.options.value),s=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const o=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*o}this.options.size=this.options.scaling.min+n*s}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){const t=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){const t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}getItemsOnPoint(e){const t=[];return this.labelModule.visible()&&cf(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),cf(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}isOverlappingWith(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}isBoundingBoxOverlappingWith(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}static checkMass(e,t){if(e.mass!==void 0&&e.mass<=0){let r="";t!==void 0&&(r=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+r+", setting mass to 1.",B_),e.mass=1}}}class Wae{constructor(e,t,r,n){var s;if(this.body=e,this.images=t,this.groups=r,this.layoutEngine=n,this.body.functions.createNode=O(s=this.create).call(s,this),this.nodesListeners={add:(o,a)=>{this.add(a.items)},update:(o,a)=>{this.update(a.items,a.data,a.oldData)},remove:(o,a)=>{this.remove(a.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(o,a,l,h){if(a===o)return .5;{const d=1/(a-o);return Math.max(0,(h-o)*d)}}},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=Jr(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,t;this.body.emitter.on("refreshNodes",O(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",O(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{X(this.nodesListeners,(r,n)=>{this.body.data.nodes&&this.body.data.nodes.off(n,r)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(e){if(e!==void 0){if(fe.parseOptions(this.options,e),e.opacity!==void 0&&(df(e.opacity)||!mi(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(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(typeof e.font<"u"||typeof e.widthConstraint<"u"||typeof e.heightConstraint<"u")for(const t of $e(this.body.nodes))this.body.nodes[t].updateLabelModule(),this.body.nodes[t].needsRefresh();if(e.size!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.body.data.nodes;if(NE("id",e))this.body.data.nodes=e;else if(we(e))this.body.data.nodes=new _l,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new _l;else throw new TypeError("Array or DataSet expected");if(r&&X(this.nodesListeners,function(n,s){r.off(s,n)}),this.body.nodes={},this.body.data.nodes){const n=this;X(this.nodesListeners,function(o,a){n.body.data.nodes.on(a,o)});const s=this.body.data.nodes.getIds();this.add(s,!0)}t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r;const n=[];for(let s=0;s<e.length;s++){r=e[s];const o=this.body.data.nodes.get(r),a=this.create(o);n.push(a),this.body.nodes[r]=a}this.layoutEngine.positionInitially(n),t===!1&&this.body.emitter.emit("_dataChanged")}update(e,t,r){const n=this.body.nodes;let s=!1;for(let o=0;o<e.length;o++){const a=e[o];let l=n[a];const h=t[o];l!==void 0?l.setOptions(h)&&(s=!0):(s=!0,l=this.create(h),n[a]=l)}!s&&r!==void 0&&(s=qne(t).call(t,function(o,a){const l=r[a];return l&&l.level!==o.level})),s===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}remove(e){const t=this.body.nodes;for(let r=0;r<e.length;r++){const n=e[r];delete t[n]}this.body.emitter.emit("_dataChanged")}create(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fe;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;X(this.body.nodes,(t,r)=>{const n=this.body.data.nodes.get(r);n!==void 0&&(e===!0&&t.setOptions({x:null,y:null}),t.setOptions({fixed:!1}),t.setOptions(n))})}getPositions(e){const t={};if(e!==void 0){if(we(e)===!0){for(let r=0;r<e.length;r++)if(this.body.nodes[e[r]]!==void 0){const n=this.body.nodes[e[r]];t[e[r]]={x:Math.round(n.x),y:Math.round(n.y)}}}else if(this.body.nodes[e]!==void 0){const r=this.body.nodes[e];t[e]={x:Math.round(r.x),y:Math.round(r.y)}}}else for(let r=0;r<this.body.nodeIndices.length;r++){const n=this.body.nodes[this.body.nodeIndices[r]];t[this.body.nodeIndices[r]]={x:Math.round(n.x),y:Math.round(n.y)}}return t}getPosition(e){if(e==null)throw new TypeError("No id was specified for getPosition method.");if(this.body.nodes[e]==null)throw new ReferenceError("NodeId provided for getPosition does not exist. Provided: ".concat(e));return{x:Math.round(this.body.nodes[e].x),y:Math.round(this.body.nodes[e].y)}}storePositions(){const e=[],t=this.body.data.nodes.getDataSet();for(const r of t.get()){const n=r.id,s=this.body.nodes[n],o=Math.round(s.x),a=Math.round(s.y);(r.x!==o||r.y!==a)&&e.push({id:n,x:o,y:a})}t.update(e)}getBoundingBox(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}getConnectedNodes(e,t){const r=[];if(this.body.nodes[e]!==void 0){const n=this.body.nodes[e],s={};for(let o=0;o<n.edges.length;o++){const a=n.edges[o];t!=="to"&&a.toId==n.id?s[a.fromId]===void 0&&(r.push(a.fromId),s[a.fromId]=!0):t!=="from"&&a.fromId==n.id&&s[a.toId]===void 0&&(r.push(a.toId),s[a.toId]=!0)}}return r}getConnectedEdges(e){const t=[];if(this.body.nodes[e]!==void 0){const r=this.body.nodes[e];for(let n=0;n<r.edges.length;n++)t.push(r.edges[n].id)}else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return t}moveNode(e,t,r){this.body.nodes[e]!==void 0?(this.body.nodes[e].x=Number(t),this.body.nodes[e].y=Number(r),ir(()=>{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}}var Uae=z,m1=Math.hypot,Kae=Math.abs,Gae=Math.sqrt,qae=!!m1&&m1(1/0,NaN)!==1/0;Uae({target:"Math",stat:!0,forced:qae},{hypot:function(e,t){for(var r=0,n=0,s=arguments.length,o=0,a,l;n<s;)a=Kae(arguments[n++]),o<a?(l=o/a,r=r*l*l+1,o=a):a>0?(l=a/o,r+=l*l):r+=a;return o===1/0?1/0:o*Gae(r)}});var Yae=ne,Xae=Yae.Math.hypot,Jae=Xae,Zae=Jae,Qae=Zae,ele=V(Qae);class Ie{static transform(e,t){we(e)||(e=[e]);const r=t.point.x,n=t.point.y,s=t.angle,o=t.length;for(let a=0;a<e.length;++a){const l=e[a],h=l.x*Math.cos(s)-l.y*Math.sin(s),d=l.x*Math.sin(s)+l.y*Math.cos(s);l.x=r+o*h,l.y=n+o*d}}static drawPath(e,t){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(let r=1;r<t.length;++r)e.lineTo(t[r].x,t[r].y);e.closePath()}}let tle=class extends Ie{static draw(e,t){if(t.image){e.save(),e.translate(t.point.x,t.point.y),e.rotate(Math.PI/2+t.angle);const r=t.imageWidth!=null?t.imageWidth:t.image.width,n=t.imageHeight!=null?t.imageHeight:t.image.height;t.image.drawImageAtPosition(e,1,-r/2,0,r,n),e.restore()}return!1}};class rle extends Ie{static draw(e,t){const r=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return Ie.transform(r,t),Ie.drawPath(e,r),!0}}class ile{static draw(e,t){const r=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return Ie.transform(r,t),Ie.drawPath(e,r),!0}}class nle{static draw(e,t){const r={x:-.4,y:0};Ie.transform(r,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";const n=Math.PI,s=t.angle-n/2,o=t.angle+n/2;return e.beginPath(),e.arc(r.x,r.y,t.length*.4,s,o,!1),e.stroke(),!0}}class sle{static draw(e,t){const r={x:-.3,y:0};Ie.transform(r,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";const n=Math.PI,s=t.angle+n/2,o=t.angle+3*n/2;return e.beginPath(),e.arc(r.x,r.y,t.length*.4,s,o,!1),e.stroke(),!0}}class ole{static draw(e,t){const r=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return Ie.transform(r,t),Ie.drawPath(e,r),!0}}class ale{static draw(e,t){const r=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return Ie.transform(r,t),Ie.drawPath(e,r),!0}}class lle{static draw(e,t){const r={x:-.4,y:0};return Ie.transform(r,t),av(e,r.x,r.y,t.length*.4),!0}}class hle{static draw(e,t){const r=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return Ie.transform(r,t),Ie.drawPath(e,r),!0}}class dle{static draw(e,t){const r=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return Ie.transform(r,t),Ie.drawPath(e,r),!0}}class cle{static draw(e,t){const r=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return Ie.transform(r,t),Ie.drawPath(e,r),!0}}class ule{static draw(e,t){const r=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return Ie.transform(r,t),Ie.drawPath(e,r),!0}}class mT{static draw(e,t){let r;switch(t.type&&(r=t.type.toLowerCase()),r){case"image":return tle.draw(e,t);case"circle":return lle.draw(e,t);case"box":return dle.draw(e,t);case"crow":return ile.draw(e,t);case"curve":return nle.draw(e,t);case"diamond":return cle.draw(e,t);case"inv_curve":return sle.draw(e,t);case"triangle":return ole.draw(e,t);case"inv_triangle":return ale.draw(e,t);case"bar":return hle.draw(e,t);case"vee":return ule.draw(e,t);case"arrow":default:return rle.draw(e,t)}}}function b1(i,e){var t=$e(i);if(ti){var r=ti(i);e&&(r=pt(r).call(r,function(n){return li(i,n).enumerable})),t.push.apply(t,r)}return t}function $1(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?oe(t=b1(Object(n),!0)).call(t,function(s){Mh(i,s,n[s])}):ri?Fh(i,ri(n)):oe(r=b1(Object(n))).call(r,function(s){Bh(i,s,li(n,s))})}return i}class bT{constructor(e,t,r){this._body=t,this._labelModule=r,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(e),this.fromPoint=this.from,this.toPoint=this.to}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}cleanup(){return!1}setOptions(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}drawLine(e,t,r,n){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,t.dashes!==!1?this._drawDashedLine(e,t,s):this._drawLine(e,t,s)}_drawLine(e,t,r,n,s){if(this.from!=this.to)this._line(e,t,r,n,s);else{const[o,a,l]=this._getCircleData(e);this._circle(e,t,o,a,l)}}_drawDashedLine(e,t,r,n,s){e.lineCap="round";const o=we(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(o),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,r);else{const[a,l,h]=this._getCircleData(e);this._circle(e,t,a,l,h)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)eS(e,this.from.x,this.from.y,this.to.x,this.to.y,o);else{const[a,l,h]=this._getCircleData(e);this._circle(e,t,a,l,h)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}findBorderPosition(e,t,r){return this.from!=this.to?this._findBorderPosition(e,t,r):this._findBorderPositionCircle(e,t,r)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var t;const[r,n]=Zt(t=this._getCircleData(e)).call(t,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:r,y:n,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:r,y:n,low:.6,high:.8,direction:1})}}}_getCircleData(e){const t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);const r=gT(e,this.options.selfReference.angle,t,this.from);return[r.x,r.y,t]}_pointOnCircle(e,t,r,n){const s=n*2*Math.PI;return{x:e+r*Math.cos(s),y:t-r*Math.sin(s)}}_findBorderPositionCircle(e,t,r){const n=r.x,s=r.y;let o=r.low,a=r.high;const l=r.direction,h=10,d=this.options.selfReference.size,u=.05;let c,f=(o+a)*.5,v=0;this.options.arrowStrikethrough===!0&&(l===-1?v=this.options.endPointOffset.from:l===1&&(v=this.options.endPointOffset.to));let g=0;do{f=(o+a)*.5,c=this._pointOnCircle(n,s,d,f);const y=Math.atan2(e.y-c.y,e.x-c.x),p=e.distanceToBorder(t,y)+v,m=Math.sqrt(Math.pow(c.x-e.x,2)+Math.pow(c.y-e.y,2)),w=p-m;if(Math.abs(w)<u)break;w>0?l>0?o=f:a=f:l>0?a=f:o=f,++g}while(o<=a&&g<h);return $1($1({},c),{},{t:f})}getLineWidth(e,t){return e===!0?Math.max(this.selectionWidth,.3/this._body.view.scale):t===!0?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}getColor(e,t){if(t.inheritsColor!==!1){if(t.inheritsColor==="both"&&this.from.id!==this.to.id){const r=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y);let n=this.from.options.color.highlight.border,s=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(n=xt(this.from.options.color.border,t.opacity),s=xt(this.to.options.color.border,t.opacity)):this.from.selected===!0&&this.to.selected===!1?s=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(n=this.from.options.color.border),r.addColorStop(0,n),r.addColorStop(1,s),r}return t.inheritsColor==="to"?xt(this.to.options.color.border,t.opacity):xt(this.from.options.color.border,t.opacity)}else return xt(t.color,t.opacity)}_circle(e,t,r,n,s){this.enableShadow(e,t);let o=0,a=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){const l=this.options.selfReference.angle,h=this.options.selfReference.angle+Math.PI,d=this._findBorderPositionCircle(this.from,e,{x:r,y:n,low:l,high:h,direction:-1}),u=this._findBorderPositionCircle(this.from,e,{x:r,y:n,low:l,high:h,direction:1});o=Math.atan2(d.y-n,d.x-r),a=Math.atan2(u.y-n,u.x-r)}e.beginPath(),e.arc(r,n,s,o,a,!1),e.stroke(),this.disableShadow(e,t)}getDistanceToEdge(e,t,r,n,s,o){if(this.from!=this.to)return this._getDistanceToEdge(e,t,r,n,s,o);{const[a,l,h]=this._getCircleData(void 0),d=a-s,u=l-o;return Math.abs(Math.sqrt(d*d+u*u)-h)}}_getDistanceToLine(e,t,r,n,s,o){const a=r-e,l=n-t,h=a*a+l*l;let d=((s-e)*a+(o-t)*l)/h;d>1?d=1:d<0&&(d=0);const u=e+d*a,c=t+d*l,f=u-s,v=c-o;return Math.sqrt(f*f+v*v)}getArrowData(e,t,r,n,s,o){let a,l,h,d,u,c,f;const v=o.width;t==="from"?(h=this.from,d=this.to,u=o.fromArrowScale<0,c=Math.abs(o.fromArrowScale),f=o.fromArrowType):t==="to"?(h=this.to,d=this.from,u=o.toArrowScale<0,c=Math.abs(o.toArrowScale),f=o.toArrowType):(h=this.to,d=this.from,u=o.middleArrowScale<0,c=Math.abs(o.middleArrowScale),f=o.middleArrowType);const g=15*c+3*v;if(h!=d){const w=ele(h.x-d.x,h.y-d.y),$=g/w;if(t!=="middle")if(this.options.smooth.enabled===!0){const x=this._findBorderPosition(h,e,{via:r}),_=this.getPoint(x.t+$*(t==="from"?1:-1),r);a=Math.atan2(x.y-_.y,x.x-_.x),l=x}else a=Math.atan2(h.y-d.y,h.x-d.x),l=this._findBorderPosition(h,e);else{const x=(u?-$:$)/2,_=this.getPoint(.5+x,r),A=this.getPoint(.5-x,r);a=Math.atan2(_.y-A.y,_.x-A.x),l=this.getPoint(.5,r)}}else{const[w,$,x]=this._getCircleData(e);if(t==="from"){const _=this.options.selfReference.angle,A=this.options.selfReference.angle+Math.PI,R=this._findBorderPositionCircle(this.from,e,{x:w,y:$,low:_,high:A,direction:-1});a=R.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,l=R}else if(t==="to"){const _=this.options.selfReference.angle,A=this.options.selfReference.angle+Math.PI,R=this._findBorderPositionCircle(this.from,e,{x:w,y:$,low:_,high:A,direction:1});a=R.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,l=R}else{const _=this.options.selfReference.angle/(2*Math.PI);l=this._pointOnCircle(w,$,x,_),a=_*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}const y=l.x-g*.9*Math.cos(a),p=l.y-g*.9*Math.sin(a);return{point:l,core:{x:y,y:p},angle:a,length:g,type:f}}drawArrowHead(e,t,r,n,s){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,mT.draw(e,s)&&(this.enableShadow(e,t),Go(e).call(e),this.disableShadow(e,t))}enableShadow(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,t){if(t.background!==!1){const r={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=r.strokeStyle,e.lineWidth=r.lineWidth,e.dashes=r.dashes,this.setStrokeDashed(e,t.dashes)}}setStrokeDashed(e,t){if(t!==!1)if(e.setLineDash!==void 0){const r=we(t)?t:[5,5];e.setLineDash(r)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}function w1(i,e){var t=$e(i);if(ti){var r=ti(i);e&&(r=pt(r).call(r,function(n){return li(i,n).enumerable})),t.push.apply(t,r)}return t}function E1(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?oe(t=w1(Object(n),!0)).call(t,function(s){Mh(i,s,n[s])}):ri?Fh(i,ri(n)):oe(r=w1(Object(n))).call(r,function(s){Bh(i,s,li(n,s))})}return i}class zv extends bT{constructor(e,t,r){super(e,t,r)}_findBorderPositionBezier(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates();const n=10,s=.2;let o=!1,a=1,l=0,h=this.to,d,u,c=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(h=this.from,o=!0,c=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(c=0);let f=0;do{u=(l+a)*.5,d=this.getPoint(u,r);const v=Math.atan2(h.y-d.y,h.x-d.x),g=h.distanceToBorder(t,v)+c,y=Math.sqrt(Math.pow(d.x-h.x,2)+Math.pow(d.y-h.y,2)),p=g-y;if(Math.abs(p)<s)break;p<0?o===!1?l=u:a=u:o===!1?a=u:l=u,++f}while(l<=a&&f<n);return E1(E1({},d),{},{t:u})}_getDistanceToBezierEdge(e,t,r,n,s,o,a){let l=1e9,h,d,u,c,f,v=e,g=t;for(d=1;d<10;d++)u=.1*d,c=Math.pow(1-u,2)*e+2*u*(1-u)*a.x+Math.pow(u,2)*r,f=Math.pow(1-u,2)*t+2*u*(1-u)*a.y+Math.pow(u,2)*n,d>0&&(h=this._getDistanceToLine(v,g,c,f,s,o),l=h<l?h:l),v=c,g=f;return l}_bezierCurve(e,t,r,n){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),r!=null&&r.x!=null?n!=null&&n.x!=null?e.bezierCurveTo(r.x,r.y,n.x,n.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(r.x,r.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)}getViaNode(){return this._getViaCoordinates()}}class S1 extends zv{constructor(e,t,r){super(e,t,r),this.via=this.via,this._boundFunction=()=>{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(e){super.setOptions(e);let 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(),t===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}setupSupportNode(){if(this.via===void 0){const 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()}}positionBezierNode(){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)}_line(e,t,r){this._bezierCurve(e,t,r)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){const[r,n,s]=this._getCircleData(),o=2*Math.PI*(1-e);return{x:r+s*Math.sin(o),y:n+s-s*(1-Math.cos(o))}}else return{x:Math.pow(1-e,2)*this.fromPoint.x+2*e*(1-e)*t.x+Math.pow(e,2)*this.toPoint.x,y:Math.pow(1-e,2)*this.fromPoint.y+2*e*(1-e)*t.y+Math.pow(e,2)*this.toPoint.y}}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t,this.via)}_getDistanceToEdge(e,t,r,n,s,o){return this._getDistanceToBezierEdge(e,t,r,n,s,o,this.via)}}class _1 extends zv{constructor(e,t,r){super(e,t,r)}_line(e,t,r){this._bezierCurve(e,t,r)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){const e=this.options.smooth.roundness,t=this.options.smooth.type;let r=Math.abs(this.from.x-this.to.x),n=Math.abs(this.from.y-this.to.y);if(t==="discrete"||t==="diagonalCross"){let s,o;r<=n?s=o=e*n:s=o=e*r,this.from.x>this.to.x&&(s=-s),this.from.y>=this.to.y&&(o=-o);let a=this.from.x+s,l=this.from.y+o;return t==="discrete"&&(r<=n?a=r<e*n?this.from.x:a:l=n<e*r?this.from.y:l),{x:a,y:l}}else if(t==="straightCross"){let s=(1-e)*r,o=(1-e)*n;return r<=n?(s=0,this.from.y<this.to.y&&(o=-o)):(this.from.x<this.to.x&&(s=-s),o=0),{x:this.to.x+s,y:this.to.y+o}}else if(t==="horizontal"){let s=(1-e)*r;return this.from.x<this.to.x&&(s=-s),{x:this.to.x+s,y:this.from.y}}else if(t==="vertical"){let s=(1-e)*n;return this.from.y<this.to.y&&(s=-s),{x:this.from.x,y:this.to.y+s}}else if(t==="curvedCW"){r=this.to.x-this.from.x,n=this.from.y-this.to.y;const s=Math.sqrt(r*r+n*n),o=Math.PI,l=(Math.atan2(n,r)+(e*.5+.5)*o)%(2*o);return{x:this.from.x+(e*.5+.5)*s*Math.sin(l),y:this.from.y+(e*.5+.5)*s*Math.cos(l)}}else if(t==="curvedCCW"){r=this.to.x-this.from.x,n=this.from.y-this.to.y;const s=Math.sqrt(r*r+n*n),o=Math.PI,l=(Math.atan2(n,r)+(-e*.5+.5)*o)%(2*o);return{x:this.from.x+(e*.5+.5)*s*Math.sin(l),y:this.from.y+(e*.5+.5)*s*Math.cos(l)}}else{let s,o;r<=n?s=o=e*n:s=o=e*r,this.from.x>this.to.x&&(s=-s),this.from.y>=this.to.y&&(o=-o);let a=this.from.x+s,l=this.from.y+o;return r<=n?this.from.x<=this.to.x?a=this.to.x<a?this.to.x:a:a=this.to.x>a?this.to.x:a:this.from.y>=this.to.y?l=this.to.y>l?this.to.y:l:l=this.to.y<l?this.to.y:l,{x:a,y:l}}}_findBorderPosition(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,t,r.via)}_getDistanceToEdge(e,t,r,n,s,o){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,r,n,s,o,a)}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const r=e,n=Math.pow(1-r,2)*this.fromPoint.x+2*r*(1-r)*t.x+Math.pow(r,2)*this.toPoint.x,s=Math.pow(1-r,2)*this.fromPoint.y+2*r*(1-r)*t.y+Math.pow(r,2)*this.toPoint.y;return{x:n,y:s}}}class fle extends zv{constructor(e,t,r){super(e,t,r)}_getDistanceToBezierEdge2(e,t,r,n,s,o,a,l){let h=1e9,d=e,u=t;const c=[0,0,0,0];for(let f=1;f<10;f++){const v=.1*f;c[0]=Math.pow(1-v,3),c[1]=3*v*Math.pow(1-v,2),c[2]=3*Math.pow(v,2)*(1-v),c[3]=Math.pow(v,3);const g=c[0]*e+c[1]*a.x+c[2]*l.x+c[3]*r,y=c[0]*t+c[1]*a.y+c[2]*l.y+c[3]*n;if(f>0){const p=this._getDistanceToLine(d,u,g,y,s,o);h=p<h?p:h}d=g,u=y}return h}}class T1 extends fle{constructor(e,t,r){super(e,t,r)}_line(e,t,r){const n=r[0],s=r[1];this._bezierCurve(e,t,n,s)}_getViaCoordinates(){const e=this.from.x-this.to.x,t=this.from.y-this.to.y;let r,n,s,o;const a=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(t)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(n=this.from.y,o=this.to.y,r=this.from.x-a*e,s=this.to.x+a*e):(n=this.from.y-a*t,o=this.to.y+a*t,r=this.from.x,s=this.to.x),[{x:r,y:n},{x:s,y:o}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t)}_getDistanceToEdge(e,t,r,n,s,o){let[a,l]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,t,r,n,s,o,a,l)}getPoint(e){let[t,r]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const n=e,s=[Math.pow(1-n,3),3*n*Math.pow(1-n,2),3*Math.pow(n,2)*(1-n),Math.pow(n,3)],o=s[0]*this.fromPoint.x+s[1]*t.x+s[2]*r.x+s[3]*this.toPoint.x,a=s[0]*this.fromPoint.y+s[1]*t.y+s[2]*r.y+s[3]*this.toPoint.y;return{x:o,y:a}}}class O1 extends bT{constructor(e,t,r){super(e,t,r)}_line(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)}getViaNode(){}getPoint(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}_findBorderPosition(e,t){let r=this.to,n=this.from;e.id===this.from.id&&(r=this.from,n=this.to);const s=Math.atan2(r.y-n.y,r.x-n.x),o=r.x-n.x,a=r.y-n.y,l=Math.sqrt(o*o+a*a),h=e.distanceToBorder(t,s),d=(l-h)/l;return{x:(1-d)*n.x+d*r.x,y:(1-d)*n.y+d*r.y,t:0}}_getDistanceToEdge(e,t,r,n,s,o){return this._getDistanceToLine(e,t,r,n,s,o)}}class Zr{constructor(e,t,r,n,s){if(t===void 0)throw new Error("No body provided");this.options=Jr(n),this.globalOptions=n,this.defaultOptions=s,this.body=t,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 Pn(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let t=typeof e.physics<"u"&&this.options.physics!==e.physics||typeof e.hidden<"u"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from<"u"&&this.options.from!==e.from||typeof e.to<"u"&&this.options.to!==e.to;Zr.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=hT(e.value));const r=[e,this.options,this.defaultOptions];return this.chooser=jv("edge",r),this.updateLabelModule(e),t=this.updateEdgeType()||t,this._setInteractionWidths(),this.connect(),t}static parseOptions(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(ps(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,t,r),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(mi(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=n.endPointOffset.from!==void 0?n.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(mi(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=n.endPointOffset.to!==void 0?n.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),Ml(t.label)?e.label=t.label:Ml(e.label)||(e.label=void 0),It(e,t,"smooth",n),It(e,t,"shadow",n),It(e,t,"background",n),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:r===!0&&t.dashes===null&&(e.dashes=Oi(n.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),It(e.scaling,t.scaling,"label",n.scaling)):r===!0&&t.scaling===null&&(e.scaling=Oi(n.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows=="string"){const a=t.arrows.toLowerCase();e.arrows.to.enabled=ee(a).call(a,"to")!=-1,e.arrows.middle.enabled=ee(a).call(a,"middle")!=-1,e.arrows.from.enabled=ee(a).call(a,"from")!=-1}else if(typeof t.arrows=="object")It(e.arrows,t.arrows,"to",n.arrows),It(e.arrows,t.arrows,"middle",n.arrows),It(e.arrows,t.arrows,"from",n.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+Ko(t.arrows));else r===!0&&t.arrows===null&&(e.arrows=Oi(n.arrows));if(t.color!==void 0&&t.color!==null){const a=In(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,l=e.color;if(s)le(l,n.color,!1,r);else for(const h in l)Object.prototype.hasOwnProperty.call(l,h)&&delete l[h];if(In(l))l.color=l,l.highlight=l,l.hover=l,l.inherit=!1,a.opacity===void 0&&(l.opacity=1);else{let h=!1;a.color!==void 0&&(l.color=a.color,h=!0),a.highlight!==void 0&&(l.highlight=a.highlight,h=!0),a.hover!==void 0&&(l.hover=a.hover,h=!0),a.inherit!==void 0&&(l.inherit=a.inherit),a.opacity!==void 0&&(l.opacity=Math.min(1,Math.max(0,a.opacity))),h===!0?l.inherit=!1:l.inherit===void 0&&(l.inherit="from")}}else r===!0&&t.color===null&&(e.color=Jr(n.color));r===!0&&t.font===null&&(e.font=Jr(n.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)}getFormattingValues(){const e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,r=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,n=this.options.color.inherit,s={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:r,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:n?void 0:this.options.color.color,inheritsColor:n,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(this.chooser===!0){if(this.selected){const o=this.options.selectionWidth;typeof o=="function"?s.width=o(s.width):typeof o=="number"&&(s.width+=o),s.width=Math.max(s.width,.3/this.body.view.scale),s.color=this.options.color.highlight,s.shadow=this.options.shadow.enabled}else if(this.hover){const o=this.options.hoverWidth;typeof o=="function"?s.width=o(s.width):typeof o=="number"&&(s.width+=o),s.width=Math.max(s.width,.3/this.body.view.scale),s.color=this.options.color.hover,s.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(s,this.options.id,this.selected,this.hover),s.color!==void 0&&(s.inheritsColor=!1),s.shadow===!1&&(s.shadowColor!==this.options.shadow.color||s.shadowSize!==this.options.shadow.size||s.shadowX!==this.options.shadow.x||s.shadowY!==this.options.shadow.y)&&(s.shadow=!0));else s.shadow=this.options.shadow.enabled,s.width=Math.max(s.width,.3/this.body.view.scale);return s}updateLabelModule(e){const t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){const e=this.options.smooth;let t=!1,r=!0;return this.edgeType!==void 0&&((this.edgeType instanceof S1&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof T1&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof _1&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof O1&&e.type.enabled===!1)&&(r=!1),r===!0&&(t=this.cleanup())),r===!0?e.enabled===!0?e.type==="dynamic"?(t=!0,this.edgeType=new S1(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new T1(this.options,this.body,this.labelModule):this.edgeType=new _1(this.options,this.body,this.labelModule):this.edgeType=new O1(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}connect(){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,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(e,t,r){if(this.options.value!==void 0){const n=this.options.scaling.customScalingFunction(e,t,r,this.options.value),s=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const o=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*o}this.options.width=this.options.scaling.min+n*s}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){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}draw(e){const t=this.getFormattingValues();if(t.hidden)return;const r=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,r),this.drawLabel(e,r)}drawArrows(e){const t=this.getFormattingValues();if(t.hidden)return;const r=this.edgeType.getViaNode(),n={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(n.from=this.edgeType.getArrowData(e,"from",r,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=n.from.core),t.fromArrowSrc&&(n.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(n.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(n.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(n.to=this.edgeType.getArrowData(e,"to",r,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=n.to.core),t.toArrowSrc&&(n.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(n.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(n.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(n.middle=this.edgeType.getArrowData(e,"middle",r,this.selected,this.hover,t),t.middleArrowSrc&&(n.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(n.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(n.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,n.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,n.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,n.to)}drawLabel(e,t){if(this.options.label!==void 0){const r=this.from,n=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let s;if(r.id!=n.id){this.labelModule.pointToSelf=!1,s=this.edgeType.getPoint(.5,t),e.save();const o=this._getRotation(e);o.angle!=0&&(e.translate(o.x,o.y),e.rotate(o.angle)),this.labelModule.draw(e,s.x,s.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;const o=gT(e,this.options.selfReference.angle,this.options.selfReference.size,r);s=this._pointOnCircle(o.x,o.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,s.x,s.y,this.selected,this.hover)}}}getItemsOnPoint(e){const t=[];if(this.labelModule.visible()){const n=this._getRotation();cf(this.labelModule.getSize(),e,n)&&t.push({edgeId:this.id,labelId:0})}const r={left:e.x,top:e.y};return this.isOverlappingWith(r)&&t.push({edgeId:this.id}),t}isOverlappingWith(e){if(this.connected){const r=this.from.x,n=this.from.y,s=this.to.x,o=this.to.y,a=e.left,l=e.top;return this.edgeType.getDistanceToEdge(r,n,s,o,a,l)<10}else return!1}_getRotation(e){const t=this.edgeType.getViaNode(),r=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,r.x,r.y);const n={x:r.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return n;const s=this.from.y-this.to.y,o=this.from.x-this.to.x;let a=Math.atan2(s,o);return(a<-1&&o<0||a>0&&o<0)&&(a+=Math.PI),n.angle=a,n}_pointOnCircle(e,t,r,n){return{x:e+r*Math.cos(n),y:t-r*Math.sin(n)}}select(){this.selected=!0}unselect(){this.selected=!1}cleanup(){return this.edgeType.cleanup()}remove(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}endPointsValid(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}}class vle{constructor(e,t,r){var n;this.body=e,this.images=t,this.groups=r,this.body.functions.createEdge=O(n=this.create).call(n,this),this.edgesListeners={add:(s,o)=>{this.add(o.items)},update:(s,o)=>{this.update(o.items)},remove:(s,o)=>{this.remove(o.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(s,o,a,l){if(o===s)return .5;{const h=1/(o-s);return Math.max(0,(l-s)*h)}}},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},le(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,t,r;this.body.emitter.on("_forceDisableDynamicCurves",function(n){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;n==="dynamic"&&(n="continuous");let o=!1;for(const a in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,a)){const l=e.body.edges[a],h=e.body.data.edges.get(a);if(h!=null){const d=h.smooth;d!==void 0&&d.enabled===!0&&d.type==="dynamic"&&(n===void 0?l.setOptions({smooth:!1}):l.setOptions({smooth:{type:n}}),o=!0)}}s===!0&&o===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",O(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",O(r=this.refresh).call(r,this)),this.body.emitter.on("destroy",()=>{X(this.edgesListeners,(n,s)=>{this.body.data.edges&&this.body.data.edges.off(s,n)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(e){if(e!==void 0){Zr.parseOptions(this.options,e,!0,this.defaultOptions,!0);let t=!1;if(e.smooth!==void 0)for(const r in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,r)&&(t=this.body.edges[r].updateEdgeType()||t);if(e.font!==void 0)for(const 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||t===!0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.body.data.edges;if(NE("id",e))this.body.data.edges=e;else if(we(e))this.body.data.edges=new _l,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new _l;else throw new TypeError("Array or DataSet expected");if(r&&X(this.edgesListeners,(n,s)=>{r.off(s,n)}),this.body.edges={},this.body.data.edges){X(this.edgesListeners,(s,o)=>{this.body.data.edges.on(o,s)});const n=this.body.data.edges.getIds();this.add(n,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.body.edges,n=this.body.data.edges;for(let s=0;s<e.length;s++){const o=e[s],a=r[o];a&&a.disconnect();const l=n.get(o,{showInternalIds:!0});r[o]=this.create(l)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}update(e){const t=this.body.edges,r=this.body.data.edges;let n=!1;for(let s=0;s<e.length;s++){const o=e[s],a=r.get(o),l=t[o];l!==void 0?(l.disconnect(),n=l.setOptions(a)||n,l.connect()):(this.body.edges[o]=this.create(a),n=!0)}n===!0?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}remove(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;const r=this.body.edges;X(e,n=>{const s=r[n];s!==void 0&&s.remove()}),t&&this.body.emitter.emit("_dataChanged")}refresh(){X(this.body.edges,(e,t)=>{const r=this.body.data.edges.get(t);r!==void 0&&e.setOptions(r)})}create(e){return new Zr(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e;const t=this.body.nodes,r=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const n=r[e];n.from=null,n.to=null,n.connect()}}getConnectedNodes(e){const t=[];if(this.body.edges[e]!==void 0){const r=this.body.edges[e];r.fromId!==void 0&&t.push(r.fromId),r.toId!==void 0&&t.push(r.toId)}return t}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){const e=[];X(this.body.edges,(t,r)=>{const n=this.body.nodes[t.toId],s=this.body.nodes[t.fromId];n!==void 0&&n.isCluster===!0||s!==void 0&&s.isCluster===!0||(n===void 0||s===void 0)&&e.push(r)}),this.remove(e,!1)}_addMissingEdges(){const e=this.body.data.edges;if(e==null)return;const t=this.body.edges,r=[];oe(e).call(e,(n,s)=>{t[s]===void 0&&r.push(s)}),this.add(r,!0)}}class $T{constructor(e,t,r){this.body=e,this.physicsBody=t,this.barnesHutTree,this.setOptions(r),this._rng=Rh("BARNES HUT SOLVER")}setOptions(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){let e;const t=this.body.nodes,r=this.physicsBody.physicsNodeIndices,n=r.length,s=this._formBarnesHutTree(t,r);this.barnesHutTree=s;for(let o=0;o<n;o++)e=t[r[o]],e.options.mass>0&&this._getForceContributions(s.root,e)}}_getForceContributions(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)}_getForceContribution(e,t){if(e.childrenCount>0){const r=e.centerOfMass.x-t.x,n=e.centerOfMass.y-t.y,s=Math.sqrt(r*r+n*n);s*e.calcSize>this.thetaInversed?this._calculateForces(s,r,n,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(s,r,n,t,e)}}_calculateForces(e,t,r,n,s){e===0&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&n.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*n.shape.radius,e-n.shape.radius));const o=this.options.gravitationalConstant*s.mass*n.options.mass/Math.pow(e,3),a=t*o,l=r*o;this.physicsBody.forces[n.id].x+=a,this.physicsBody.forces[n.id].y+=l}_formBarnesHutTree(e,t){let r;const n=t.length;let s=e[t[0]].x,o=e[t[0]].y,a=e[t[0]].x,l=e[t[0]].y;for(let y=1;y<n;y++){const p=e[t[y]],m=p.x,w=p.y;p.options.mass>0&&(m<s&&(s=m),m>a&&(a=m),w<o&&(o=w),w>l&&(l=w))}const h=Math.abs(a-s)-Math.abs(l-o);h>0?(o-=.5*h,l+=.5*h):(s+=.5*h,a-=.5*h);const u=Math.max(1e-5,Math.abs(a-s)),c=.5*u,f=.5*(s+a),v=.5*(o+l),g={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:f-c,maxX:f+c,minY:v-c,maxY:v+c},size:u,calcSize:1/u,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(g.root);for(let y=0;y<n;y++)r=e[t[y]],r.options.mass>0&&this._placeInTree(g.root,r);return g}_updateBranchMass(e,t){const r=e.centerOfMass,n=e.mass+t.options.mass,s=1/n;r.x=r.x*e.mass+t.x*t.options.mass,r.x*=s,r.y=r.y*e.mass+t.y*t.options.mass,r.y*=s,e.mass=n;const o=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<o?o:e.maxWidth}_placeInTree(e,t,r){(r!=!0||r===void 0)&&this._updateBranchMass(e,t);const n=e.children.NW.range;let s;n.maxX>t.x?n.maxY>t.y?s="NW":s="SW":n.maxY>t.y?s="NE":s="SE",this._placeInRegion(e,t,s)}_placeInRegion(e,t,r){const n=e.children[r];switch(n.childrenCount){case 0:n.children.data=t,n.childrenCount=1,this._updateBranchMass(n,t);break;case 1:n.children.data.x===t.x&&n.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(n),this._placeInTree(n,t));break;case 4:this._placeInTree(n,t);break}}_splitBranch(e){let 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)}_insertRegion(e,t){let r,n,s,o;const a=.5*e.size;switch(t){case"NW":r=e.range.minX,n=e.range.minX+a,s=e.range.minY,o=e.range.minY+a;break;case"NE":r=e.range.minX+a,n=e.range.maxX,s=e.range.minY,o=e.range.minY+a;break;case"SW":r=e.range.minX,n=e.range.minX+a,s=e.range.minY+a,o=e.range.maxY;break;case"SE":r=e.range.minX+a,n=e.range.maxX,s=e.range.minY+a,o=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:r,maxX:n,minY:s,maxY:o},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}_drawBranch(e,t,r){r===void 0&&(r="#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=r,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()}}class ple{constructor(e,t,r){this._rng=Rh("REPULSION SOLVER"),this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e}solve(){let e,t,r,n,s,o,a,l;const h=this.body.nodes,d=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,c=this.options.nodeDistance,f=-2/3/c,v=4/3;for(let g=0;g<d.length-1;g++){a=h[d[g]];for(let y=g+1;y<d.length;y++)l=h[d[y]],e=l.x-a.x,t=l.y-a.y,r=Math.sqrt(e*e+t*t),r===0&&(r=.1*this._rng(),e=r),r<2*c&&(r<.5*c?o=1:o=f*r+v,o=o/r,n=e*o,s=t*o,u[a.id].x-=n,u[a.id].y-=s,u[l.id].x+=n,u[l.id].y+=s)}}}class gle{constructor(e,t,r){this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}solve(){const e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,r=this.physicsBody.forces,n=this.options.nodeDistance;for(let s=0;s<t.length-1;s++){const o=e[t[s]];for(let a=s+1;a<t.length;a++){const l=e[t[a]];if(o.level===l.level){const h=n+this.overlapAvoidanceFactor*((o.shape.radius||0)/2+(l.shape.radius||0)/2),d=l.x-o.x,u=l.y-o.y,c=Math.sqrt(d*d+u*u),f=.05;let v;c<h?v=-Math.pow(f*c,2)+Math.pow(f*h,2):v=0,c!==0&&(v=v/c);const g=d*v,y=u*v;r[o.id].x-=g,r[o.id].y-=y,r[l.id].x+=g,r[l.id].y+=y}}}}}class Yc{constructor(e,t,r){this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e}solve(){let e,t;const r=this.physicsBody.physicsEdgeIndices,n=this.body.edges;let s,o,a;for(let l=0;l<r.length;l++)t=n[r[l]],t.connected===!0&&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?this.options.springLength:t.options.length,s=t.to,o=t.edgeType.via,a=t.from,this._calculateSpringForce(s,o,.5*e),this._calculateSpringForce(o,a,.5*e)):(e=t.options.length===void 0?this.options.springLength*1.5:t.options.length,this._calculateSpringForce(t.from,t.to,e)))}_calculateSpringForce(e,t,r){const n=e.x-t.x,s=e.y-t.y,o=Math.max(Math.sqrt(n*n+s*s),.01),a=this.options.springConstant*(r-o)/o,l=n*a,h=s*a;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=l,this.physicsBody.forces[e.id].y+=h),this.physicsBody.forces[t.id]!==void 0&&(this.physicsBody.forces[t.id].x-=l,this.physicsBody.forces[t.id].y-=h)}}class yle{constructor(e,t,r){this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e}solve(){let e,t,r,n,s,o,a,l;const h=this.body.edges,d=.5,u=this.physicsBody.physicsEdgeIndices,c=this.physicsBody.physicsNodeIndices,f=this.physicsBody.forces;for(let $=0;$<c.length;$++){const x=c[$];f[x].springFx=0,f[x].springFy=0}for(let $=0;$<u.length;$++)t=h[u[$]],t.connected===!0&&(e=t.options.length===void 0?this.options.springLength:t.options.length,r=t.from.x-t.to.x,n=t.from.y-t.to.y,l=Math.sqrt(r*r+n*n),l=l===0?.01:l,a=this.options.springConstant*(e-l)/l,s=r*a,o=n*a,t.to.level!=t.from.level?(f[t.toId]!==void 0&&(f[t.toId].springFx-=s,f[t.toId].springFy-=o),f[t.fromId]!==void 0&&(f[t.fromId].springFx+=s,f[t.fromId].springFy+=o)):(f[t.toId]!==void 0&&(f[t.toId].x-=d*s,f[t.toId].y-=d*o),f[t.fromId]!==void 0&&(f[t.fromId].x+=d*s,f[t.fromId].y+=d*o)));a=1;let v,g;for(let $=0;$<c.length;$++){const x=c[$];v=Math.min(a,Math.max(-a,f[x].springFx)),g=Math.min(a,Math.max(-a,f[x].springFy)),f[x].x+=v,f[x].y+=g}let y=0,p=0;for(let $=0;$<c.length;$++){const x=c[$];y+=f[x].x,p+=f[x].y}const m=y/c.length,w=p/c.length;for(let $=0;$<c.length;$++){const x=c[$];f[x].x-=m,f[x].y-=w}}}class al{constructor(e,t,r){this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e}solve(){let e,t,r,n;const s=this.body.nodes,o=this.physicsBody.physicsNodeIndices,a=this.physicsBody.forces;for(let l=0;l<o.length;l++){const h=o[l];n=s[h],e=-n.x,t=-n.y,r=Math.sqrt(e*e+t*t),this._calculateForces(r,e,t,a,n)}}_calculateForces(e,t,r,n,s){const o=e===0?0:this.options.centralGravity/e;n[s.id].x=t*o,n[s.id].y=r*o}}class mle extends $T{constructor(e,t,r){super(e,t,r),this._rng=Rh("FORCE ATLAS 2 BASED REPULSION SOLVER")}_calculateForces(e,t,r,n,s){e===0&&(e=.1*this._rng(),t=e),this.overlapAvoidanceFactor<1&&n.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*n.shape.radius,e-n.shape.radius));const o=n.edges.length+1,a=this.options.gravitationalConstant*s.mass*n.options.mass*o/Math.pow(e,2),l=t*a,h=r*a;this.physicsBody.forces[n.id].x+=l,this.physicsBody.forces[n.id].y+=h}}class ble extends al{constructor(e,t,r){super(e,t,r)}_calculateForces(e,t,r,n,s){if(e>0){const o=s.edges.length+1,a=this.options.centralGravity*o*s.options.mass;n[s.id].x=t*a,n[s.id].y=r*a}}}class $le{constructor(e){this.body=e,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}},Ae(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("initPhysics",()=>{this.initPhysics()}),this.body.emitter.on("_layoutFailed",()=>{this.layoutFailed=!0}),this.body.emitter.on("resetPhysics",()=>{this.stopSimulation(),this.ready=!1}),this.body.emitter.on("disablePhysics",()=>{this.physicsEnabled=!1,this.stopSimulation()}),this.body.emitter.on("restorePhysics",()=>{this.setOptions(this.options),this.ready===!0&&this.startSimulation()}),this.body.emitter.on("startSimulation",()=>{this.ready===!0&&this.startSimulation()}),this.body.emitter.on("stopSimulation",()=>{this.stopSimulation()}),this.body.emitter.on("destroy",()=>{this.stopSimulation(!1),this.body.emitter.off()}),this.body.emitter.on("_dataChanged",()=>{this.updatePhysicsData()})}setOptions(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,Al(["stabilization"],this.options,e),It(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());const t=this.options.wind;t&&((typeof t.x!="number"||df(t.x))&&(t.x=0),(typeof t.y!="number"||df(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new mle(this.body,this.physicsBody,e),this.edgesSolver=new Yc(this.body,this.physicsBody,e),this.gravitySolver=new ble(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new ple(this.body,this.physicsBody,e),this.edgesSolver=new Yc(this.body,this.physicsBody,e),this.gravitySolver=new al(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new gle(this.body,this.physicsBody,e),this.edgesSolver=new yle(this.body,this.physicsBody,e),this.gravitySolver=new al(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new $T(this.body,this.physicsBody,e),this.edgesSolver=new Yc(this.body,this.physicsBody,e),this.gravitySolver=new al(this.body,this.physicsBody,e)),this.modelOptions=e}initPhysics(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?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"))}startSimulation(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=O(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}stopSimulation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}simulationStep(){const e=xl();this.physicsTick(),(xl()-e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&ir(()=>{this.body.emitter.emit("stabilized",{iterations:e}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){this._evaluateStepQuality()===!0?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))}physicsTick(){this._startStabilizing(),this.stabilized!==!0&&(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0?(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()),this.stabilized===!0&&this.revert(),this.stabilizationIterations++)}updatePhysicsData(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];const e=this.body.nodes,t=this.body.edges;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&e[r].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[r].id);for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&t[r].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(t[r].id);for(let r=0;r<this.physicsBody.physicsNodeIndices.length;r++){const n=this.physicsBody.physicsNodeIndices[r];this.physicsBody.forces[n]={x:0,y:0},this.physicsBody.velocities[n]===void 0&&(this.physicsBody.velocities[n]={x:0,y:0})}for(const r in this.physicsBody.velocities)e[r]===void 0&&delete this.physicsBody.velocities[r]}revert(){const e=$e(this.previousStates),t=this.body.nodes,r=this.physicsBody.velocities;this.referenceState={};for(let n=0;n<e.length;n++){const s=e[n];t[s]!==void 0?t[s].options.physics===!0&&(this.referenceState[s]={positions:{x:t[s].x,y:t[s].y}},r[s].x=this.previousStates[s].vx,r[s].y=this.previousStates[s].vy,t[s].x=this.previousStates[s].x,t[s].y=this.previousStates[s].y):delete this.previousStates[s]}}_evaluateStepQuality(){let e,t,r;const n=this.body.nodes,s=this.referenceState,o=.3;for(const a in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,a)&&n[a]!==void 0&&(e=n[a].x-s[a].positions.x,t=n[a].y-s[a].positions.y,r=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),r>o))return!1;return!0}moveNodes(){const e=this.physicsBody.physicsNodeIndices;let t=0,r=0;const n=5;for(let s=0;s<e.length;s++){const o=e[s],a=this._performStep(o);t=Math.max(t,a),r+=a}this.adaptiveTimestepEnabled=r/e.length<n,this.stabilized=t<this.options.minVelocity}calculateComponentVelocity(e,t,r){const n=this.modelOptions.damping*e,s=(t-n)/r;e+=s*this.timestep;const o=this.options.maxVelocity||1e9;return Math.abs(e)>o&&(e=e>0?o:-o),e}_performStep(e){const t=this.body.nodes[e],r=this.physicsBody.forces[e];this.options.wind&&(r.x+=this.options.wind.x,r.y+=this.options.wind.y);const n=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:n.x,vy:n.y},t.options.fixed.x===!1?(n.x=this.calculateComponentVelocity(n.x,r.x,t.options.mass),t.x+=n.x*this.timestep):(r.x=0,n.x=0),t.options.fixed.y===!1?(n.y=this.calculateComponentVelocity(n.y,r.y,t.options.mass),t.y+=n.y*this.timestep):(r.y=0,n.y=0),Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2))}_freezeNodes(){const e=this.body.nodes;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){const r=e[t].options.fixed;this.freezeCache[t]={x:r.x,y:r.y},r.x=!0,r.y=!0}}_restoreFrozenNodes(){const e=this.body.nodes;for(const 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={}}stabilize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof e!="number"&&(e=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,ir(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){const e=()=>this.stabilized===!1&&this.stabilizationIterations<this.targetIterations,t=()=>{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&t();let r=0;for(;e()&&r<this.options.stabilization.updateInterval;)this.physicsTick(),r++;if(t(),e()){var n;ir(O(n=this._stabilizationBatch).call(n,this),0)}else this._finalizeStabilization()}_finalizeStabilization(){this.body.emitter.emit("_allowRedraw"),this.options.stabilization.fit===!0&&this.body.emitter.emit("fit"),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),this.stabilized===!0?this._emitStabilized():this.startSimulation(),this.ready=!0}_drawForces(e){for(let t=0;t<this.physicsBody.physicsNodeIndices.length;t++){const r=this.physicsBody.physicsNodeIndices[t],n=this.body.nodes[r],s=this.physicsBody.forces[r],o=20,a=.03,l=Math.sqrt(Math.pow(s.x,2)+Math.pow(s.x,2)),h=Math.min(Math.max(5,l),15),d=3*h,u=af((180-Math.min(1,Math.max(0,a*l))*180)/360,1,1),c={x:n.x+o*s.x,y:n.y+o*s.y};e.lineWidth=h,e.strokeStyle=u,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(c.x,c.y),e.stroke();const f=Math.atan2(s.y,s.x);e.fillStyle=u,mT.draw(e,{type:"arrow",point:c,angle:f,length:d}),Go(e).call(e)}}}let La;const wle=new Uint8Array(16);function Ele(){if(!La&&(La=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!La))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return La(wle)}const Ke=[];for(let i=0;i<256;++i)Ke.push((i+256).toString(16).slice(1));function Sle(i,e=0){return Ke[i[e+0]]+Ke[i[e+1]]+Ke[i[e+2]]+Ke[i[e+3]]+"-"+Ke[i[e+4]]+Ke[i[e+5]]+"-"+Ke[i[e+6]]+Ke[i[e+7]]+"-"+Ke[i[e+8]]+Ke[i[e+9]]+"-"+Ke[i[e+10]]+Ke[i[e+11]]+Ke[i[e+12]]+Ke[i[e+13]]+Ke[i[e+14]]+Ke[i[e+15]]}const _le=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var I1={randomUUID:_le};function Fs(i,e,t){if(I1.randomUUID&&!i)return I1.randomUUID();i=i||{};const r=i.random||(i.rng||Ele)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Sle(r)}class nt{constructor(){}static getRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=1e9,n=-1e9,s=1e9,o=-1e9,a;if(t.length>0)for(let l=0;l<t.length;l++)a=e[t[l]],s>a.shape.boundingBox.left&&(s=a.shape.boundingBox.left),o<a.shape.boundingBox.right&&(o=a.shape.boundingBox.right),r>a.shape.boundingBox.top&&(r=a.shape.boundingBox.top),n<a.shape.boundingBox.bottom&&(n=a.shape.boundingBox.bottom);return s===1e9&&o===-1e9&&r===1e9&&n===-1e9&&(r=0,n=0,s=0,o=0),{minX:s,maxX:o,minY:r,maxY:n}}static getRangeCore(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=1e9,n=-1e9,s=1e9,o=-1e9,a;if(t.length>0)for(let l=0;l<t.length;l++)a=e[t[l]],s>a.x&&(s=a.x),o<a.x&&(o=a.x),r>a.y&&(r=a.y),n<a.y&&(n=a.y);return s===1e9&&o===-1e9&&r===1e9&&n===-1e9&&(r=0,n=0,s=0,o=0),{minX:s,maxX:o,minY:r,maxY:n}}static findCenter(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}static cloneOptions(e,t){const r={};return t===void 0||t==="node"?(le(r,e.options,!0),r.x=e.x,r.y=e.y,r.amountOfConnections=e.edges.length):le(r,e.options,!0),r}}class Tle extends fe{constructor(e,t,r,n,s,o){super(e,t,r,n,s,o),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}_openChildCluster(e){const t=this.body.nodes[e];if(this.containedNodes[e]===void 0)throw new Error("node with id: "+e+" not in current cluster");if(!t.isCluster)throw new Error("node with id: "+e+" is not a cluster");delete this.containedNodes[e],X(t.edges,r=>{delete this.containedEdges[r.id]}),X(t.containedNodes,(r,n)=>{this.containedNodes[n]=r}),t.containedNodes={},X(t.containedEdges,(r,n)=>{this.containedEdges[n]=r}),t.containedEdges={},X(t.edges,r=>{X(this.edges,n=>{var s,o;const a=ee(s=n.clusteringEdgeReplacingIds).call(s,r.id);a!==-1&&(X(r.clusteringEdgeReplacingIds,l=>{n.clusteringEdgeReplacingIds.push(l),this.body.edges[l].edgeReplacedById=n.id}),yr(o=n.clusteringEdgeReplacingIds).call(o,a,1))})}),t.edges=[]}}class Ole{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},Ae(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,t){e===void 0?e=this._getHubSize():typeof e=="object"&&(t=this._checkOptions(e),e=this._getHubSize());const r=[];for(let n=0;n<this.body.nodeIndices.length;n++){const s=this.body.nodes[this.body.nodeIndices[n]];s.edges.length>=e&&r.push(s.id)}for(let n=0;n<r.length;n++)this.clusterByConnection(r[n],t,!0);this.body.emitter.emit("_dataChanged")}cluster(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);const r={},n={};X(this.body.nodes,(s,o)=>{s.options&&e.joinCondition(s.options)===!0&&(r[o]=s,X(s.edges,a=>{this.clusteredEdges[a.id]===void 0&&(n[a.id]=a)}))}),this._cluster(r,n,e,t)}clusterByEdgeCount(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);const n=[],s={};let o,a,l;for(let h=0;h<this.body.nodeIndices.length;h++){const d={},u={},c=this.body.nodeIndices[h],f=this.body.nodes[c];if(s[c]===void 0){l=0,a=[];for(let v=0;v<f.edges.length;v++)o=f.edges[v],this.clusteredEdges[o.id]===void 0&&(o.toId!==o.fromId&&l++,a.push(o));if(l===e){const v=function(y){if(t.joinCondition===void 0||t.joinCondition===null)return!0;const p=nt.cloneOptions(y);return t.joinCondition(p)};let g=!0;for(let y=0;y<a.length;y++){o=a[y];const p=this._getConnectedId(o,c);if(v(f))u[o.id]=o,d[c]=f,d[p]=this.body.nodes[p],s[c]=!0;else{g=!1;break}}if($e(d).length>0&&$e(u).length>0&&g===!0){const p=function(){for(let m=0;m<n.length;++m)for(const w in d)if(n[m].nodes[w]!==void 0)return n[m]}();if(p!==void 0){for(const m in d)p.nodes[m]===void 0&&(p.nodes[m]=d[m]);for(const m in u)p.edges[m]===void 0&&(p.edges[m]=u[m])}else n.push({nodes:d,edges:u})}}}}for(let h=0;h<n.length;h++)this._cluster(n[h].nodes,n[h].edges,t,!1);r===!0&&this.body.emitter.emit("_dataChanged")}clusterOutliers(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}clusterBridges(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}clusterByConnection(e,t){var r;let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");const s=this.body.nodes[e];t=this._checkOptions(t,s),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=s.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=s.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=s.options.fixed.x,t.clusterNodeProperties.fixed.y=s.options.fixed.y);const o={},a={},l=s.id,h=nt.cloneOptions(s);o[l]=s;for(let u=0;u<s.edges.length;u++){const c=s.edges[u];if(this.clusteredEdges[c.id]===void 0){const f=this._getConnectedId(c,l);if(this.clusteredNodes[f]===void 0)if(f!==l)if(t.joinCondition===void 0)a[c.id]=c,o[f]=this.body.nodes[f];else{const v=nt.cloneOptions(this.body.nodes[f]);t.joinCondition(h,v)===!0&&(a[c.id]=c,o[f]=this.body.nodes[f])}else a[c.id]=c}}const d=Ln(r=$e(o)).call(r,function(u){return o[u].id});for(const u in o){if(!Object.prototype.hasOwnProperty.call(o,u))continue;const c=o[u];for(let f=0;f<c.edges.length;f++){const v=c.edges[f];ee(d).call(d,this._getConnectedId(v,c.id))>-1&&(a[v.id]=v)}}this._cluster(o,a,t,n)}_createClusterEdges(e,t,r,n){let s,o,a,l,h,d;const u=$e(e),c=[];for(let g=0;g<u.length;g++){o=u[g],a=e[o];for(let y=0;y<a.edges.length;y++)s=a.edges[y],this.clusteredEdges[s.id]===void 0&&(s.toId==s.fromId?t[s.id]=s:s.toId==o?(l=r.id,h=s.fromId,d=h):(l=s.toId,h=r.id,d=l),e[d]===void 0&&c.push({edge:s,fromId:h,toId:l}))}const f=[],v=function(g){for(let y=0;y<f.length;y++){const p=f[y],m=g.fromId===p.fromId&&g.toId===p.toId,w=g.fromId===p.toId&&g.toId===p.fromId;if(m||w)return p}return null};for(let g=0;g<c.length;g++){const y=c[g],p=y.edge;let m=v(y);m===null?(m=this._createClusteredEdge(y.fromId,y.toId,p,n),f.push(m)):m.clusteringEdgeReplacingIds.push(p.id),this.body.edges[p.id].edgeReplacedById=m.id,this._backupEdgeOptions(p),p.setOptions({physics:!1})}}_checkOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}_cluster(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;const s=[];for(const d in e)Object.prototype.hasOwnProperty.call(e,d)&&this.clusteredNodes[d]!==void 0&&s.push(d);for(let d=0;d<s.length;++d)delete e[s[d]];if($e(e).length==0||$e(e).length==1&&r.clusterNodeProperties.allowSingleNodeCluster!=!0)return;let o=le({},r.clusterNodeProperties);if(r.processProperties!==void 0){const d=[];for(const c in e)if(Object.prototype.hasOwnProperty.call(e,c)){const f=nt.cloneOptions(e[c]);d.push(f)}const u=[];for(const c in t)if(Object.prototype.hasOwnProperty.call(t,c)&&c.substr(0,12)!=="clusterEdge:"){const f=nt.cloneOptions(t[c],"edge");u.push(f)}if(o=r.processProperties(o,d,u),!o)throw new Error("The processProperties function does not return properties!")}o.id===void 0&&(o.id="cluster:"+Fs());const a=o.id;o.label===void 0&&(o.label="cluster");let l;o.x===void 0&&(l=this._getClusterPosition(e),o.x=l.x),o.y===void 0&&(l===void 0&&(l=this._getClusterPosition(e)),o.y=l.y),o.id=a;const h=this.body.functions.createNode(o,Tle);h.containedNodes=e,h.containedEdges=t,h.clusterEdgeProperties=r.clusterEdgeProperties,this.body.nodes[o.id]=h,this._clusterEdges(e,t,o,r.clusterEdgeProperties),o.id=void 0,n===!0&&this.body.emitter.emit("_dataChanged")}_backupEdgeOptions(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}_restoreEdge(e){const t=this.clusteredEdges[e.id];t!==void 0&&(e.setOptions({physics:t.physics}),delete this.clusteredEdges[e.id])}isCluster(e){return this.body.nodes[e]!==void 0?this.body.nodes[e].isCluster===!0:(console.error("Node does not exist."),!1)}_getClusterPosition(e){const t=$e(e);let r=e[t[0]].x,n=e[t[0]].x,s=e[t[0]].y,o=e[t[0]].y,a;for(let l=1;l<t.length;l++)a=e[t[l]],r=a.x<r?a.x:r,n=a.x>n?a.x:n,s=a.y<s?a.y:s,o=a.y>o?a.y:o;return{x:.5*(r+n),y:.5*(s+o)}}openCluster(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");const n=this.body.nodes[e];if(n===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(n.isCluster!==!0||n.containedNodes===void 0||n.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");const s=this.findNode(e),o=ee(s).call(s,e)-1;if(o>=0){const d=s[o];this.body.nodes[d]._openChildCluster(e),delete this.body.nodes[e],r===!0&&this.body.emitter.emit("_dataChanged");return}const a=n.containedNodes,l=n.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction=="function"){const d={},u={x:n.x,y:n.y};for(const f in a)if(Object.prototype.hasOwnProperty.call(a,f)){const v=this.body.nodes[f];d[f]={x:v.x,y:v.y}}const c=t.releaseFunction(u,d);for(const f in a)if(Object.prototype.hasOwnProperty.call(a,f)){const v=this.body.nodes[f];c[f]!==void 0&&(v.x=c[f].x===void 0?n.x:c[f].x,v.y=c[f].y===void 0?n.y:c[f].y)}}else X(a,function(d){d.options.fixed.x===!1&&(d.x=n.x),d.options.fixed.y===!1&&(d.y=n.y)});for(const d in a)if(Object.prototype.hasOwnProperty.call(a,d)){const u=this.body.nodes[d];u.vx=n.vx,u.vy=n.vy,u.setOptions({physics:!0}),delete this.clusteredNodes[d]}const h=[];for(let d=0;d<n.edges.length;d++)h.push(n.edges[d]);for(let d=0;d<h.length;d++){const u=h[d],c=this._getConnectedId(u,e),f=this.clusteredNodes[c];for(let v=0;v<u.clusteringEdgeReplacingIds.length;v++){const g=u.clusteringEdgeReplacingIds[v],y=this.body.edges[g];if(y!==void 0)if(f!==void 0){const p=this.body.nodes[f.clusterId];p.containedEdges[y.id]=y,delete l[y.id];let m=y.fromId,w=y.toId;y.toId==c?w=f.clusterId:m=f.clusterId,this._createClusteredEdge(m,w,y,p.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(y)}u.remove()}for(const d in l)Object.prototype.hasOwnProperty.call(l,d)&&this._restoreEdge(l[d]);delete this.body.nodes[e],r===!0&&this.body.emitter.emit("_dataChanged")}getNodesInCluster(e){const t=[];if(this.isCluster(e)===!0){const r=this.body.nodes[e].containedNodes;for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.push(this.body.nodes[n].id)}return t}findNode(e){const t=[];let n=0,s;for(;this.clusteredNodes[e]!==void 0&&n<100;){if(s=this.body.nodes[e],s===void 0)return[];t.push(s.id),e=this.clusteredNodes[e].clusterId,n++}return s=this.body.nodes[e],s===void 0?[]:(t.push(s.id),Ti(t).call(t),t)}updateClusteredNode(e,t){if(e===void 0)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(t===void 0)throw new Error("No newOptions supplied to updateClusteredNode.");if(this.body.nodes[e]===void 0)throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[e].setOptions(t),this.body.emitter.emit("_dataChanged")}updateEdge(e,t){if(e===void 0)throw new Error("No startEdgeId supplied to updateEdge.");if(t===void 0)throw new Error("No newOptions supplied to updateEdge.");if(this.body.edges[e]===void 0)throw new Error("The startEdgeId supplied to updateEdge does not exist.");const r=this.getClusteredEdges(e);for(let n=0;n<r.length;n++)this.body.edges[r[n]].setOptions(t);this.body.emitter.emit("_dataChanged")}getClusteredEdges(e){const t=[];let n=0;for(;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 Ti(t).call(t),t}getBaseEdge(e){return this.getBaseEdges(e)[0]}getBaseEdges(e){const t=[e],r=[],n=[],s=100;let o=0;for(;t.length>0&&o<s;){const a=t.pop();if(a===void 0)continue;const l=this.body.edges[a];if(l===void 0)continue;o++;const h=l.clusteringEdgeReplacingIds;if(h===void 0)n.push(a);else for(let d=0;d<h.length;++d){const u=h[d];ee(t).call(t,h)!==-1||ee(r).call(r,h)!==-1||t.push(u)}r.push(a)}return n}_getConnectedId(e,t){return e.toId!=t?e.toId:(e.fromId!=t,e.fromId)}_getHubSize(){let e=0,t=0,r=0,n=0;for(let l=0;l<this.body.nodeIndices.length;l++){const h=this.body.nodes[this.body.nodeIndices[l]];h.edges.length>n&&(n=h.edges.length),e+=h.edges.length,t+=Math.pow(h.edges.length,2),r+=1}e=e/r,t=t/r;const s=t-Math.pow(e,2),o=Math.sqrt(s);let a=Math.floor(e+2*o);return a>n&&(a=n),a}_createClusteredEdge(e,t,r,n,s){const o=nt.cloneOptions(r,"edge");le(o,n),o.from=e,o.to=t,o.id="clusterEdge:"+Fs(),s!==void 0&&le(o,s);const a=this.body.functions.createEdge(o);return a.clusteringEdgeReplacingIds=[r.id],a.connect(),this.body.edges[a.id]=a,a}_clusterEdges(e,t,r,n){if(t instanceof Zr){const s=t,o={};o[s.id]=s,t=o}if(e instanceof fe){const s=e,o={};o[s.id]=s,e=o}if(r==null)throw new Error("_clusterEdges: parameter clusterNode required");n===void 0&&(n=r.clusterEdgeProperties),this._createClusterEdges(e,t,r,n);for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&this.body.edges[s]!==void 0){const o=this.body.edges[s];this._backupEdgeOptions(o),o.setOptions({physics:!1})}for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(this.clusteredNodes[s]={clusterId:r.id,node:this.body.nodes[s]},this.body.nodes[s].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;const t=this.clusteredNodes[e];if(t===void 0)return;const r=t.clusterId;if(r!==void 0)return this.body.nodes[r]}_filter(e,t){const r=[];return X(e,n=>{t(n)&&r.push(n)}),r}_updateState(){let e;const t=[],r={},n=l=>{X(this.body.nodes,h=>{h.isCluster===!0&&l(h)})};for(e in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,e))continue;this.body.nodes[e]===void 0&&t.push(e)}n(function(l){for(let h=0;h<t.length;h++)delete l.containedNodes[t[h]]});for(let l=0;l<t.length;l++)delete this.clusteredNodes[t[l]];X(this.clusteredEdges,l=>{const h=this.body.edges[l];(h===void 0||!h.endPointsValid())&&(r[l]=l)}),n(function(l){X(l.containedEdges,(h,d)=>{!h.endPointsValid()&&!r[d]&&(r[d]=d)})}),X(this.body.edges,(l,h)=>{let d=!0;const u=l.clusteringEdgeReplacingIds;if(u!==void 0){let c=0;X(u,f=>{const v=this.body.edges[f];v!==void 0&&v.endPointsValid()&&(c+=1)}),d=c>0}(!l.endPointsValid()||!d)&&(r[h]=h)}),n(l=>{X(r,h=>{delete l.containedEdges[h],X(l.edges,(d,u)=>{if(d.id===h){l.edges[u]=null;return}d.clusteringEdgeReplacingIds=this._filter(d.clusteringEdgeReplacingIds,function(c){return!r[c]})}),l.edges=this._filter(l.edges,function(d){return d!==null})})}),X(r,l=>{delete this.clusteredEdges[l]}),X(r,l=>{delete this.body.edges[l]});const s=$e(this.body.edges);X(s,l=>{const h=this.body.edges[l],d=this._isClusteredNode(h.fromId)||this._isClusteredNode(h.toId);if(d!==this._isClusteredEdge(h.id))if(d){const u=this._getClusterNodeForNode(h.fromId);u!==void 0&&this._clusterEdges(this.body.nodes[h.fromId],h,u);const c=this._getClusterNodeForNode(h.toId);c!==void 0&&this._clusterEdges(this.body.nodes[h.toId],h,c)}else delete this._clusterEdges[l],this._restoreEdge(h)});let o=!1,a=!0;for(;a;){const l=[];n(function(h){const d=$e(h.containedNodes).length,u=h.options.allowSingleNodeCluster===!0;(u&&d<1||!u&&d<2)&&l.push(h.id)});for(let h=0;h<l.length;++h)this.openCluster(l[h],{},!1);a=l.length>0,o=o||a}o&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}}function Ile(){let i;window!==void 0&&(i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),i===void 0?window.requestAnimationFrame=function(e){e()}:window.requestAnimationFrame=i}class xle{constructor(e,t){Ile(),this.body=e,this.canvas=t,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},Ae(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.on("dragStart",()=>{this.dragging=!0}),this.body.emitter.on("dragEnd",()=>{this.dragging=!1}),this.body.emitter.on("zoom",()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=ir(()=>{var t;this.zooming=!1,O(t=this._requestRedraw).call(t,this)()},250)}),this.body.emitter.on("_resizeNodes",()=>{this._resizeNodes()}),this.body.emitter.on("_redraw",()=>{this.renderingActive===!1&&this._redraw()}),this.body.emitter.on("_blockRedraw",()=>{this.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",()=>{this.allowRedraw=!0,this.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",O(e=this._requestRedraw).call(e,this)),this.body.emitter.on("_startRendering",()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()}),this.body.emitter.on("_stopRendering",()=>{this.renderRequests-=1,this.renderingActive=this.renderRequests>0,this.renderTimer=void 0}),this.body.emitter.on("destroy",()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,this.requiresTimeout===!0?clearTimeout(this.renderTimer):window.cancelAnimationFrame(this.renderTimer),this.body.emitter.off()})}setOptions(e){e!==void 0&&ps(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_requestNextFrame(e,t){if(typeof window>"u")return;let r;const n=window;return this.requiresTimeout===!0?r=ir(e,t):n.requestAnimationFrame&&(r=n.requestAnimationFrame(e)),r}_startRendering(){if(this.renderingActive===!0&&this.renderTimer===void 0){var e;this.renderTimer=this._requestNextFrame(O(e=this._renderStep).call(e,this),this.simulationInterval)}}_renderStep(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this._requestNextFrame(()=>{this._redraw(!1)},0))}_redraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;const t={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();const r=this.canvas.getContext(),n=this.canvas.frame.canvas.clientWidth,s=this.canvas.frame.canvas.clientHeight;if(r.clearRect(0,0,n,s),this.canvas.frame.clientWidth===0)return;if(r.save(),r.translate(this.body.view.translation.x,this.body.view.translation.y),r.scale(this.body.view.scale,this.body.view.scale),r.beginPath(),this.body.emitter.emit("beforeDrawing",r),r.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(r),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){const{drawExternalLabels:o}=this._drawNodes(r,e);t.drawExternalLabels=o}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(r),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(r),r.beginPath(),this.body.emitter.emit("afterDrawing",r),r.closePath(),r.restore(),e===!0&&r.clearRect(0,0,n,s)}}_resizeNodes(){this.canvas.setTransform();const 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);const t=this.body.nodes;let r;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r=t[n],r.resize(e),r.updateBoundingBox(e,r.selected));e.restore()}_drawNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.body.nodes,n=this.body.nodeIndices;let s;const o=[],a=[],l=20,h=this.canvas.DOMtoCanvas({x:-l,y:-l}),d=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+l,y:this.canvas.frame.canvas.clientHeight+l}),u={top:h.y,left:h.x,bottom:d.y,right:d.x},c=[];for(let y=0;y<n.length;y++)if(s=r[n[y]],s.hover)a.push(n[y]);else if(s.isSelected())o.push(n[y]);else if(t===!0){const p=s.draw(e);p.drawExternalLabel!=null&&c.push(p.drawExternalLabel)}else if(s.isBoundingBoxOverlappingWith(u)===!0){const p=s.draw(e);p.drawExternalLabel!=null&&c.push(p.drawExternalLabel)}else s.updateBoundingBox(e,s.selected);let f;const v=o.length,g=a.length;for(f=0;f<v;f++){s=r[o[f]];const y=s.draw(e);y.drawExternalLabel!=null&&c.push(y.drawExternalLabel)}for(f=0;f<g;f++){s=r[a[f]];const y=s.draw(e);y.drawExternalLabel!=null&&c.push(y.drawExternalLabel)}return{drawExternalLabels:()=>{for(const y of c)y()}}}_drawEdges(e){const t=this.body.edges,r=this.body.edgeIndices;for(let n=0;n<r.length;n++){const s=t[r[n]];s.connected===!0&&s.draw(e)}}_drawArrows(e){const t=this.body.edges,r=this.body.edgeIndices;for(let n=0;n<r.length;n++){const s=t[r[n]];s.connected===!0&&s.drawArrows(e)}}_determineBrowserMethod(){if(typeof window<"u"){const e=navigator.userAgent.toLowerCase();this.requiresTimeout=!1,ee(e).call(e,"msie 9.0")!=-1?this.requiresTimeout=!0:ee(e).call(e,"safari")!=-1&&ee(e).call(e,"chrome")<=-1&&(this.requiresTimeout=!0)}else this.requiresTimeout=!0}_drawSelectionBox(e){if(this.body.selectionBox.show){e.beginPath();const t=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,r=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,r),e.fillStyle="rgba(151, 194, 252, 0.2)",e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,r),e.strokeStyle="rgba(151, 194, 252, 1)",e.stroke()}else e.closePath()}}var Ple=ne,Cle=Ple.setInterval,Dle=Cle,Ale=V(Dle);function Fl(i,e){e.inputHandler=function(t){t.isFirst&&e(t)},i.on("hammer.input",e.inputHandler)}function wT(i,e){return e.inputHandler=function(t){t.isFinal&&e(t)},i.on("hammer.input",e.inputHandler)}class Nle{constructor(e){this.body=e,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},Ae(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.once("resize",t=>{t.width!==0&&(this.body.view.translation.x=t.width*.5),t.height!==0&&(this.body.view.translation.y=t.height*.5)}),this.body.emitter.on("setSize",O(e=this.setSize).call(e,this)),this.body.emitter.on("destroy",()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(e){if(e!==void 0&&ps(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var t;if(window.ResizeObserver){const n=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:s}=this;n.observe(s),this._cleanupCallbacks.push(()=>{n.unobserve(s)})}else{const n=Ale(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(n)})}const r=O(t=this._onResize).call(t,this);window.addEventListener("resize",r),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",r)})}}_cleanUp(){var e,t,r;oe(e=Ti(t=yr(r=this._cleanupCallbacks).call(r,0)).call(t)).call(e,n=>{try{n()}catch(s){console.error(s)}})}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(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}))}_setCameraState(){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){const e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight;let r=this.cameraState.scale;e!=1&&t!=1?r=this.cameraState.scale*.5*(e+t):e!=1?r=this.cameraState.scale*e:t!=1&&(r=this.cameraState.scale*t),this.body.view.scale=r;const n=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),s={x:n.x-this.cameraState.position.x,y:n.y-this.cameraState.position.y};this.body.view.translation.x+=s.x*this.body.view.scale,this.body.view.translation.y+=s.y*this.body.view.scale}}_prepareValue(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(ee(e).call(e,"%")!==-1||ee(e).call(e,"px")!==-1)return e;if(ee(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}_create(){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{const 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()}_bindHammer(){this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new xn(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:xn.DIRECTION_ALL}),Fl(this.hammer,e=>{this.body.eventListeners.onTouch(e)}),this.hammer.on("tap",e=>{this.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",e=>{this.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",e=>{this.body.eventListeners.onHold(e)}),this.hammer.on("panstart",e=>{this.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",e=>{this.body.eventListeners.onDrag(e)}),this.hammer.on("panend",e=>{this.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",e=>{this.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("wheel",e=>{this.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",e=>{this.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",e=>{this.body.eventListeners.onContext(e)}),this.hammerFrame=new xn(this.frame),wT(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let 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);let r=!1;const n=this.frame.canvas.width,s=this.frame.canvas.height,o=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(o),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},r=!0;else{const a=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),l=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==a||this.frame.canvas.height!==l)&&this._getCameraState(o),this.frame.canvas.width!==a&&(this.frame.canvas.width=a,r=!0),this.frame.canvas.height!==l&&(this.frame.canvas.height=l,r=!0)}return r===!0&&(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(n/this.pixelRatio),oldHeight:Math.round(s/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,r}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");let t=1;typeof window<"u"&&(t=window.devicePixelRatio||1);const r=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/r}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(e){return(e-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(e){return(e-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.y}canvasToDOM(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}DOMtoCanvas(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}function Rle(i,e){const t=Ae({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},i??{});if(!we(t.nodes))throw new TypeError("Nodes has to be an array of ids.");if(t.nodes.length===0&&(t.nodes=e),!(typeof t.minZoomLevel=="number"&&t.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof t.maxZoomLevel=="number"&&t.minZoomLevel<=t.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return t}class kle{constructor(e,t){var r,n;this.body=e,this.canvas=t,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",O(r=this.fit).call(r,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",O(n=this.releaseNode).call(n,this))}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}fit(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=Rle(e,this.body.nodeIndices);const r=this.canvas.frame.canvas.clientWidth,n=this.canvas.frame.canvas.clientHeight;let s,o;if(r===0||n===0)o=1,s=nt.getRange(this.body.nodes,e.nodes);else if(t===!0){let h=0;for(const c in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,c)&&this.body.nodes[c].predefinedPosition===!0&&(h+=1);if(h>.5*this.body.nodeIndices.length){this.fit(e,!1);return}s=nt.getRange(this.body.nodes,e.nodes),o=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;const u=Math.min(r/600,n/600);o*=u}else{this.body.emitter.emit("_resizeNodes"),s=nt.getRange(this.body.nodes,e.nodes);const h=Math.abs(s.maxX-s.minX)*1.1,d=Math.abs(s.maxY-s.minY)*1.1,u=r/h,c=n/d;o=u<=c?u:c}o>e.maxZoomLevel?o=e.maxZoomLevel:o<e.minZoomLevel&&(o=e.minZoomLevel);const l={position:nt.findCenter(s),scale:o,animation:e.animation};this.moveTo(l)}focus(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){const r={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=r,t.lockedOnNode=e,this.moveTo(t)}else console.error("Node: "+e+" cannot be found.")}moveTo(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!mi(e.offset.x))throw new 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,!mi(e.offset.y))throw new 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,!mi(e.position.x))throw new 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,!mi(e.position.y))throw new 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 new 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}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}animateView(e){if(e===void 0)return;this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(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;const t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),r={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+r.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+r.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var n;this.viewFunction=O(n=this._lockedRedraw).call(n,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var s;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=O(s=this._transitionRedraw).call(s,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){const e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),r={x:t.x-e.x,y:t.y-e.y},n=this.body.view.translation,s={x:n.x+r.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:n.y+r.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=s}releaseNode(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;const t=Vte[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){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var r;this.viewFunction=O(r=this._lockedRedraw).call(r,this),this.body.emitter.on("initRedraw",this.viewFunction)}this.body.emitter.emit("animationFinished")}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}function x1(i){var e=i&&i.preventDefault||!1,t=i&&i.container||window,r={},n={keydown:{},keyup:{}},s={},o;for(o=97;o<=122;o++)s[String.fromCharCode(o)]={code:65+(o-97),shift:!1};for(o=65;o<=90;o++)s[String.fromCharCode(o)]={code:o,shift:!0};for(o=0;o<=9;o++)s[""+o]={code:48+o,shift:!1};for(o=1;o<=12;o++)s["F"+o]={code:111+o,shift:!1};for(o=0;o<=9;o++)s["num"+o]={code:96+o,shift:!1};s["num*"]={code:106,shift:!1},s["num+"]={code:107,shift:!1},s["num-"]={code:109,shift:!1},s["num/"]={code:111,shift:!1},s["num."]={code:110,shift:!1},s.left={code:37,shift:!1},s.up={code:38,shift:!1},s.right={code:39,shift:!1},s.down={code:40,shift:!1},s.space={code:32,shift:!1},s.enter={code:13,shift:!1},s.shift={code:16,shift:void 0},s.esc={code:27,shift:!1},s.backspace={code:8,shift:!1},s.tab={code:9,shift:!1},s.ctrl={code:17,shift:!1},s.alt={code:18,shift:!1},s.delete={code:46,shift:!1},s.pageup={code:33,shift:!1},s.pagedown={code:34,shift:!1},s["="]={code:187,shift:!1},s["-"]={code:189,shift:!1},s["]"]={code:221,shift:!1},s["["]={code:219,shift:!1};var a=function(d){h(d,"keydown")},l=function(d){h(d,"keyup")},h=function(d,u){if(n[u][d.keyCode]!==void 0){for(var c=n[u][d.keyCode],f=0;f<c.length;f++)(c[f].shift===void 0||c[f].shift==!0&&d.shiftKey==!0||c[f].shift==!1&&d.shiftKey==!1)&&c[f].fn(d);e==!0&&d.preventDefault()}};return r.bind=function(d,u,c){if(c===void 0&&(c="keydown"),s[d]===void 0)throw new Error("unsupported key: "+d);n[c][s[d].code]===void 0&&(n[c][s[d].code]=[]),n[c][s[d].code].push({fn:u,shift:s[d].shift})},r.bindAll=function(d,u){u===void 0&&(u="keydown");for(var c in s)s.hasOwnProperty(c)&&r.bind(c,d,u)},r.getKey=function(d){for(var u in s)if(s.hasOwnProperty(u)){if(d.shiftKey==!0&&s[u].shift==!0&&d.keyCode==s[u].code)return u;if(d.shiftKey==!1&&s[u].shift==!1&&d.keyCode==s[u].code)return u;if(d.keyCode==s[u].code&&u=="shift")return u}return"unknown key, currently not supported"},r.unbind=function(d,u,c){if(c===void 0&&(c="keydown"),s[d]===void 0)throw new Error("unsupported key: "+d);if(u!==void 0){var f=[],v=n[c][s[d].code];if(v!==void 0)for(var g=0;g<v.length;g++)v[g].fn==u&&v[g].shift==s[d].shift||f.push(n[c][s[d].code][g]);n[c][s[d].code]=f}else n[c][s[d].code]=[]},r.reset=function(){n={keydown:{},keyup:{}}},r.destroy=function(){n={keydown:{},keyup:{}},t.removeEventListener("keydown",a,!0),t.removeEventListener("keyup",l,!0)},t.addEventListener("keydown",a,!0),t.addEventListener("keyup",l,!0),r}class Mle{constructor(e,t){this.body=e,this.canvas=t,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",()=>{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on("deactivate",()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on("destroy",()=>{this.keycharm!==void 0&&this.keycharm.destroy()}),this.options={}}setOptions(e){e!==void 0&&(this.options=e,this.create())}create(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(this.navigationHammers.length!=0){for(let 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}loadNavigationElements(){this.cleanNavigation(),this.navigationDOM={};const e=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],t=["_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(let o=0;o<e.length;o++){this.navigationDOM[e[o]]=document.createElement("div"),this.navigationDOM[e[o]].className="vis-button vis-"+e[o],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[o]]);const a=new xn(this.navigationDOM[e[o]]);if(t[o]==="_fit"){var r;Fl(a,O(r=this._fit).call(r,this))}else{var n;Fl(a,O(n=this.bindToRedraw).call(n,this,t[o]))}this.navigationHammers.push(a)}const s=new xn(this.canvas.frame);wT(s,()=>{this._stopMovement()}),this.navigationHammers.push(s),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var t;this.boundFunctions[e]=O(t=this[e]).call(t,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering")}}unbindFromRedraw(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(const 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={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){const e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),r=this.body.view.translation,n=t/e,s=(1-n)*this.canvas.canvasViewCenter.x+r.x*n,o=(1-n)*this.canvas.canvasViewCenter.y+r.y*n;this.body.view.scale=t,this.body.view.translation={x:s,y:o},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){const e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),r=this.body.view.translation,n=t/e,s=(1-n)*this.canvas.canvasViewCenter.x+r.x*n,o=(1-n)*this.canvas.canvasViewCenter.y+r.y*n;this.body.view.scale=t,this.body.view.translation={x:s,y:o},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=x1({container:window,preventDefault:!0}):this.keycharm=x1({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,t,r,n,s,o,a,l,h,d,u,c,f,v,g,y,p,m,w,$,x,_,A,R;O(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),O(t=this.keycharm).call(t,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),O(r=this.keycharm).call(r,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),O(n=this.keycharm).call(n,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),O(s=this.keycharm).call(s,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),O(o=this.keycharm).call(o,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),O(a=this.keycharm).call(a,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),O(l=this.keycharm).call(l,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),O(h=this.keycharm).call(h,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),O(d=this.keycharm).call(d,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),O(u=this.keycharm).call(u,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),O(c=this.keycharm).call(c,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),O(f=this.keycharm).call(f,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),O(v=this.keycharm).call(v,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),O(g=this.keycharm).call(g,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),O(y=this.keycharm).call(y,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),O(p=this.keycharm).call(p,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),O(m=this.keycharm).call(m,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),O(w=this.keycharm).call(w,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),O($=this.keycharm).call($,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),O(x=this.keycharm).call(x,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),O(_=this.keycharm).call(_,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),O(A=this.keycharm).call(A,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),O(R=this.keycharm).call(R,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}}class Fle{constructor(e,t,r){var n,s,o,a,l,h,d,u,c,f,v,g,y;this.body=e,this.canvas=t,this.selectionHandler=r,this.navigationHandler=new Mle(e,t),this.body.eventListeners.onTap=O(n=this.onTap).call(n,this),this.body.eventListeners.onTouch=O(s=this.onTouch).call(s,this),this.body.eventListeners.onDoubleTap=O(o=this.onDoubleTap).call(o,this),this.body.eventListeners.onHold=O(a=this.onHold).call(a,this),this.body.eventListeners.onDragStart=O(l=this.onDragStart).call(l,this),this.body.eventListeners.onDrag=O(h=this.onDrag).call(h,this),this.body.eventListeners.onDragEnd=O(d=this.onDragEnd).call(d,this),this.body.eventListeners.onMouseWheel=O(u=this.onMouseWheel).call(u,this),this.body.eventListeners.onPinch=O(c=this.onPinch).call(c,this),this.body.eventListeners.onMouseMove=O(f=this.onMouseMove).call(f,this),this.body.eventListeners.onRelease=O(v=this.onRelease).call(v,this),this.body.eventListeners.onContext=O(g=this.onContext).call(g,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=O(y=this.getPointer).call(y,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},Ae(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(e){e!==void 0&&(Al(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),It(this.options,e,"keyboard"),e.tooltip&&(Ae(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=of(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-jte(this.canvas.frame.canvas),y:e.y-Lte(this.canvas.frame.canvas)}}onTouch(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())}onTap(e){const t=this.getPointer(e.center),r=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,r),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t)}onDoubleTap(e){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,t)}onHold(e){const t=this.getPointer(e.center),r=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,r),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t),this.selectionHandler.generateClickEvent("hold",e,t)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}onContext(e){const t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,t)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,t){const r=function(n,s){const o=[];for(let a=0;a<n.length;a++){const l=n[a];ee(s).call(s,l)===-1&&o.push(l)}return o};return{nodes:r(e.nodes,t.nodes),edges:r(e.edges,t.edges)}}onDragStart(e){if(this.drag.dragging)return;this.drag.pointer===void 0&&this.onTouch(e);const t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=Ae({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;const r=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(r.x),y:this.canvas._YconvertDOMtoCanvas(r.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(r.x),y:this.canvas._YconvertDOMtoCanvas(r.y)}}else if(t!==void 0&&this.options.dragNodes===!0){this.drag.nodeId=t.id,t.isSelected()===!1&&this.selectionHandler.setSelection({nodes:[t.id]}),this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer);for(const r of this.selectionHandler.getSelectedNodes()){const n={id:r.id,node:r,x:r.x,y:r.y,xFixed:r.options.fixed.x,yFixed:r.options.fixed.y};r.options.fixed.x=!0,r.options.fixed.y=!0,this.drag.selection.push(n)}}else this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}onDrag(e){if(this.drag.pinched===!0)return;this.body.emitter.emit("unlockNode");const t=this.getPointer(e.center),r=this.drag.selection;if(r&&r.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent("dragging",e,t);const n=t.x-this.drag.pointer.x,s=t.y-this.drag.pointer.y;oe(r).call(r,o=>{const a=o.node;o.xFixed===!1&&(a.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(o.x)+n)),o.yFixed===!1&&(a.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(o.y)+s))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}const n=t.x-this.drag.pointer.x,s=t.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+n,y:this.drag.translation.y+s},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var t;this.body.selectionBox.show=!1;const r=this.body.selectionBox.position,n={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)},s=pt(t=this.body.nodeIndices).call(t,a=>{const l=this.body.nodes[a];return l.x>=n.minX&&l.x<=n.maxX&&l.y>=n.minY&&l.y<=n.maxY});oe(s).call(s,a=>this.selectionHandler.selectObject(this.body.nodes[a]));const 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{const r=this.drag.selection;r&&r.length?(oe(r).call(r,function(n){n.node.options.fixed.x=n.xFixed,n.node.options.fixed.y=n.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"))}}onPinch(e){const t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);const r=this.pinch.scale*e.scale;this.zoom(r,t)}zoom(e,t){if(this.options.zoomView===!0){const r=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let n;this.drag!==void 0&&this.drag.dragging===!0&&(n=this.canvas.DOMtoCanvas(this.drag.pointer));const s=this.body.view.translation,o=e/r,a=(1-o)*t.x+s.x*o,l=(1-o)*t.y+s.y*o;if(this.body.view.scale=e,this.body.view.translation={x:a,y:l},n!=null){const h=this.canvas.canvasToDOM(n);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),r<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})}}onMouseWheel(e){if(this.options.zoomView===!0){if(e.deltaY!==0){let t=this.body.view.scale;t*=1+(e.deltaY<0?1:-1)*(this.options.zoomSpeed*.1);const r=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(t,r)}e.preventDefault()}}onMouseMove(e){const t=this.getPointer({x:e.clientX,y:e.clientY});let r=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(t),this.popup.hidden===!1&&(r=!0,this.popup.setPosition(t.x+3,t.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),r===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=ir(()=>this._checkShowPopup(t),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,t)}_checkShowPopup(e){const t=this.canvas._XconvertDOMtoCanvas(e.x),r=this.canvas._YconvertDOMtoCanvas(e.y),n={left:t,top:r,right:t,bottom:r},s=this.popupObj===void 0?void 0:this.popupObj.id;let o=!1,a="node";if(this.popupObj===void 0){const l=this.body.nodeIndices,h=this.body.nodes;let d;const u=[];for(let c=0;c<l.length;c++)d=h[l[c]],d.isOverlappingWith(n)===!0&&(o=!0,d.getTitle()!==void 0&&u.push(l[c]));u.length>0&&(this.popupObj=h[u[u.length-1]],o=!0)}if(this.popupObj===void 0&&o===!1){const l=this.body.edgeIndices,h=this.body.edges;let d;const u=[];for(let c=0;c<l.length;c++)d=h[l[c]],d.isOverlappingWith(n)===!0&&d.connected===!0&&d.getTitle()!==void 0&&u.push(l[c]);u.length>0&&(this.popupObj=h[u[u.length-1]],a="edge")}this.popupObj!==void 0?this.popupObj.id!==s&&(this.popup===void 0&&(this.popup=new Jte(this.canvas.frame)),this.popup.popupTargetType=a,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)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}_checkHidePopup(e){const t=this.selectionHandler._pointerToPositionObject(e);let r=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(r=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),r===!0)){const n=this.selectionHandler.getNodeAt(e);r=n===void 0?!1:n.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(r=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));r===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}var Ble=Rv,jle=Z_;Ble("Set",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},jle);var Lle=ne,zle=Lle.Set,Hle=zle,Vle=Hle,Wle=Vle,Br=V(Wle),Ule=re,P1=kv,za=kh.getWeakData,Kle=Nv,Gle=xr,qle=os,Xc=Ze,Yle=Av,ET=ai,C1=Ye,ST=Gi,Xle=ST.set,Jle=ST.getterFor,Zle=ET.find,Qle=ET.findIndex,ehe=Ule([].splice),the=0,Ha=function(i){return i.frozen||(i.frozen=new _T)},_T=function(){this.entries=[]},Jc=function(i,e){return Zle(i.entries,function(t){return t[0]===e})};_T.prototype={get:function(i){var e=Jc(this,i);if(e)return e[1]},has:function(i){return!!Jc(this,i)},set:function(i,e){var t=Jc(this,i);t?t[1]=e:this.entries.push([i,e])},delete:function(i){var e=Qle(this.entries,function(t){return t[0]===i});return~e&&ehe(this.entries,e,1),!!~e}};var rhe={getConstructor:function(i,e,t,r){var n=i(function(l,h){Kle(l,s),Xle(l,{type:e,id:the++,frozen:void 0}),qle(h)||Yle(h,l[r],{that:l,AS_ENTRIES:t})}),s=n.prototype,o=Jle(e),a=function(l,h,d){var u=o(l),c=za(Gle(h),!0);return c===!0?Ha(u).set(h,d):c[u.id]=d,l};return P1(s,{delete:function(l){var h=o(this);if(!Xc(l))return!1;var d=za(l);return d===!0?Ha(h).delete(l):d&&C1(d,h.id)&&delete d[h.id]},has:function(h){var d=o(this);if(!Xc(h))return!1;var u=za(h);return u===!0?Ha(d).has(h):u&&C1(u,d.id)}}),P1(s,t?{get:function(h){var d=o(this);if(Xc(h)){var u=za(h);return u===!0?Ha(d).get(h):u?u[d.id]:void 0}},set:function(h,d){return a(this,h,d)}}:{add:function(h){return a(this,h,!0)}}),n}},ihe=G_,D1=_e,ll=re,A1=kv,nhe=kh,she=Rv,TT=rhe,Va=Ze,Wa=Gi.enforce,ohe=te,ahe=yS,Qo=Object,lhe=Array.isArray,Ua=Qo.isExtensible,OT=Qo.isFrozen,hhe=Qo.isSealed,IT=Qo.freeze,dhe=Qo.seal,N1={},R1={},che=!D1.ActiveXObject&&"ActiveXObject"in D1,Ss,xT=function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},PT=she("WeakMap",xT,TT),fn=PT.prototype,hl=ll(fn.set),uhe=function(){return ihe&&ohe(function(){var i=IT([]);return hl(new PT,i,1),!OT(i)})};if(ahe)if(che){Ss=TT.getConstructor(xT,"WeakMap",!0),nhe.enable();var k1=ll(fn.delete),Ka=ll(fn.has),M1=ll(fn.get);A1(fn,{delete:function(i){if(Va(i)&&!Ua(i)){var e=Wa(this);return e.frozen||(e.frozen=new Ss),k1(this,i)||e.frozen.delete(i)}return k1(this,i)},has:function(e){if(Va(e)&&!Ua(e)){var t=Wa(this);return t.frozen||(t.frozen=new Ss),Ka(this,e)||t.frozen.has(e)}return Ka(this,e)},get:function(e){if(Va(e)&&!Ua(e)){var t=Wa(this);return t.frozen||(t.frozen=new Ss),Ka(this,e)?M1(this,e):t.frozen.get(e)}return M1(this,e)},set:function(e,t){if(Va(e)&&!Ua(e)){var r=Wa(this);r.frozen||(r.frozen=new Ss),Ka(this,e)?hl(this,e,t):r.frozen.set(e,t)}else hl(this,e,t);return this}})}else uhe()&&A1(fn,{set:function(e,t){var r;return lhe(e)&&(OT(e)?r=N1:hhe(e)&&(r=R1)),hl(this,e,t),r===N1&&IT(e),r===R1&&dhe(e),this}});var fhe=ne,vhe=fhe.WeakMap,phe=vhe,ghe=phe,yhe=ghe,Bs=V(yhe);function ae(i,e,t,r){if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)}function uf(i,e,t,r,n){if(typeof e=="function"?i!==e||!0:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(i,t),t}var pi,Ot,Nr,Rr,dl;function F1(i,e){const t=new Br;for(const r of e)i.has(r)||t.add(r);return t}class B1{constructor(){pi.set(this,new Br),Ot.set(this,new Br)}get size(){return ae(this,Ot,"f").size}add(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(const n of t)ae(this,Ot,"f").add(n)}delete(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(const n of t)ae(this,Ot,"f").delete(n)}clear(){ae(this,Ot,"f").clear()}getSelection(){return[...ae(this,Ot,"f")]}getChanges(){return{added:[...F1(ae(this,pi,"f"),ae(this,Ot,"f"))],deleted:[...F1(ae(this,Ot,"f"),ae(this,pi,"f"))],previous:[...new Br(ae(this,pi,"f"))],current:[...new Br(ae(this,Ot,"f"))]}}commit(){const e=this.getChanges();uf(this,pi,ae(this,Ot,"f")),uf(this,Ot,new Br(ae(this,pi,"f")));for(const t of e.added)t.select();for(const t of e.deleted)t.unselect();return e}}pi=new Bs,Ot=new Bs;class mhe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};Nr.set(this,new B1),Rr.set(this,new B1),dl.set(this,void 0),uf(this,dl,e)}get sizeNodes(){return ae(this,Nr,"f").size}get sizeEdges(){return ae(this,Rr,"f").size}getNodes(){return ae(this,Nr,"f").getSelection()}getEdges(){return ae(this,Rr,"f").getSelection()}addNodes(){ae(this,Nr,"f").add(...arguments)}addEdges(){ae(this,Rr,"f").add(...arguments)}deleteNodes(e){ae(this,Nr,"f").delete(e)}deleteEdges(e){ae(this,Rr,"f").delete(e)}clear(){ae(this,Nr,"f").clear(),ae(this,Rr,"f").clear()}commit(){const e={nodes:ae(this,Nr,"f").commit(),edges:ae(this,Rr,"f").commit()};for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ae(this,dl,"f").call(this,e,...r),e}}Nr=new Bs,Rr=new Bs,dl=new Bs;class bhe{constructor(e,t){this.body=e,this.canvas=t,this._selectionAccumulator=new mhe,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},Ae(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",()=>{this.updateSelection()})}setOptions(e){e!==void 0&&ps(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let t=!1;if(this.options.selectable===!0){const r=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),r!==void 0&&(t=this.selectObject(r)),this.body.emitter.emit("_requestRedraw")}return t}selectAdditionalOnPoint(e){let t=!1;if(this.options.selectable===!0){const r=this.getNodeAt(e)||this.getEdgeAt(e);r!==void 0&&(t=!0,r.isSelected()===!0?this.deselectObject(r):this.selectObject(r),this.body.emitter.emit("_requestRedraw"))}return t}_initBaseEvent(e,t){const r={};return r.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},r.event=e,r}generateClickEvent(e,t,r,n){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;const o=this._initBaseEvent(t,r);if(s===!0)o.nodes=[],o.edges=[];else{const a=this.getSelection();o.nodes=a.nodes,o.edges=a.edges}n!==void 0&&(o.previousSelection=n),e=="click"&&(o.items=this.getClickedItems(r)),t.controlEdge!==void 0&&(o.controlEdge=t.controlEdge),this.body.emitter.emit(e,o)}selectObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0?(e instanceof fe?(t===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0):!1}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){const t=[],r=this.body.nodes;for(let n=0;n<this.body.nodeIndices.length;n++){const s=this.body.nodeIndices[n];r[s].isOverlappingWith(e)&&t.push(s)}return t}_pointerToPositionObject(e){const t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}getNodeAt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=this._pointerToPositionObject(e),n=this._getAllNodesOverlappingWith(r);if(n.length>0)return t===!0?this.body.nodes[n[n.length-1]]:n[n.length-1]}_getEdgesOverlappingWith(e,t){const r=this.body.edges;for(let n=0;n<this.body.edgeIndices.length;n++){const s=this.body.edgeIndices[n];r[s].isOverlappingWith(e)&&t.push(s)}}_getAllEdgesOverlappingWith(e){const t=[];return this._getEdgesOverlappingWith(e,t),t}getEdgeAt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=this.canvas.DOMtoCanvas(e);let n=10,s=null;const o=this.body.edges;for(let a=0;a<this.body.edgeIndices.length;a++){const l=this.body.edgeIndices[a],h=o[l];if(h.connected){const d=h.from.x,u=h.from.y,c=h.to.x,f=h.to.y,v=h.edgeType.getDistanceToEdge(d,u,c,f,r.x,r.y);v<n&&(s=l,n=v)}}if(s!==null)return t===!0?this.body.edges[s]:s}_addToHover(e){e instanceof fe?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}_removeFromSelection(e){e instanceof fe?(this._selectionAccumulator.deleteNodes(e),this._selectionAccumulator.deleteEdges(...e.edges)):this._selectionAccumulator.deleteEdges(e)}unselectAll(){this._selectionAccumulator.clear()}getSelectedNodeCount(){return this._selectionAccumulator.sizeNodes}getSelectedEdgeCount(){return this._selectionAccumulator.sizeEdges}_hoverConnectedEdges(e){for(let t=0;t<e.edges.length;t++){const r=e.edges[t];r.hover=!0,this._addToHover(r)}}emitBlurEvent(e,t,r){const n=this._initBaseEvent(e,t);r.hover===!0&&(r.hover=!1,r instanceof fe?(n.node=r.id,this.body.emitter.emit("blurNode",n)):(n.edge=r.id,this.body.emitter.emit("blurEdge",n)))}emitHoverEvent(e,t,r){const n=this._initBaseEvent(e,t);let s=!1;return r.hover===!1&&(r.hover=!0,this._addToHover(r),s=!0,r instanceof fe?(n.node=r.id,this.body.emitter.emit("hoverNode",n)):(n.edge=r.id,this.body.emitter.emit("hoverEdge",n))),s}hoverObject(e,t){let r=this.getNodeAt(t);r===void 0&&(r=this.getEdgeAt(t));let n=!1;for(const s in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,s)&&(r===void 0||r instanceof fe&&r.id!=s||r instanceof Zr)&&(this.emitBlurEvent(e,t,this.hoverObj.nodes[s]),delete this.hoverObj.nodes[s],n=!0);for(const s in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,s)&&(n===!0?(this.hoverObj.edges[s].hover=!1,delete this.hoverObj.edges[s]):(r===void 0||r instanceof Zr&&r.id!=s||r instanceof fe&&!r.hover)&&(this.emitBlurEvent(e,t,this.hoverObj.edges[s]),delete this.hoverObj.edges[s],n=!0));if(r!==void 0){const s=$e(this.hoverObj.edges).length,o=$e(this.hoverObj.nodes).length,a=r instanceof Zr&&s===0&&o===0,l=r instanceof fe&&s===0&&o===0;(n||a||l)&&(n=this.emitHoverEvent(e,t,r)),r instanceof fe&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(r)}n===!0&&this.body.emitter.emit("_requestRedraw")}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(e,t){let r=!1;const n=this._selectionAccumulator.commit(),s={nodes:n.nodes.previous,edges:n.edges.previous};n.edges.deleted.length>0&&(this.generateClickEvent("deselectEdge",t,e,s),r=!0),n.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,e,s),r=!0),n.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,e),r=!0),n.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,e),r=!0),r===!0&&this.generateClickEvent("select",t,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return Ln(e=this._selectionAccumulator.getNodes()).call(e,t=>t.id)}getSelectedEdgeIds(){var e;return Ln(e=this._selectionAccumulator.getEdges()).call(e,t=>t.id)}setSelection(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(const r of e.nodes){const n=this.body.nodes[r];if(!n)throw new RangeError('Node with id "'+r+'" not found');this.selectObject(n,t.highlightEdges)}if(e.edges)for(const r of e.edges){const n=this.body.edges[r];if(!n)throw new RangeError('Edge with id "'+r+'" not found');this.selectObject(n)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}selectEdges(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}updateSelection(){for(const e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(const e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){const t=this.canvas.DOMtoCanvas(e),r=[],n=this.body.nodeIndices,s=this.body.nodes;for(let l=n.length-1;l>=0;l--){const d=s[n[l]].getItemsOnPoint(t);r.push.apply(r,d)}const o=this.body.edgeIndices,a=this.body.edges;for(let l=o.length-1;l>=0;l--){const d=a[o[l]].getItemsOnPoint(t);r.push.apply(r,d)}return r}}var j1=fS,$he=Math.floor,ff=function(i,e){var t=i.length,r=$he(t/2);return t<8?whe(i,e):Ehe(i,ff(j1(i,0,r),e),ff(j1(i,r),e),e)},whe=function(i,e){for(var t=i.length,r=1,n,s;r<t;){for(s=r,n=i[r];s&&e(i[s-1],n)>0;)i[s]=i[--s];s!==r++&&(i[s]=n)}return i},Ehe=function(i,e,t,r){for(var n=e.length,s=t.length,o=0,a=0;o<n||a<s;)i[o+a]=o<n&&a<s?r(e[o],t[a])<=0?e[o++]:t[a++]:o<n?e[o++]:t[a++];return i},She=ff,_he=Po,L1=_he.match(/firefox\/(\d+)/i),The=!!L1&&+L1[1],Ohe=Po,Ihe=/MSIE|Trident/.test(Ohe),xhe=Po,z1=xhe.match(/AppleWebKit\/(\d+)\./),Phe=!!z1&&+z1[1],Che=z,CT=re,Dhe=ls,Ahe=Nt,H1=ar,Nhe=JS,V1=lr,Hv=te,Rhe=She,khe=fs,W1=The,Mhe=Ihe,U1=Co,K1=Phe,Hr=[],G1=CT(Hr.sort),Fhe=CT(Hr.push),Bhe=Hv(function(){Hr.sort(void 0)}),jhe=Hv(function(){Hr.sort(null)}),Lhe=khe("sort"),DT=!Hv(function(){if(U1)return U1<70;if(!(W1&&W1>3)){if(Mhe)return!0;if(K1)return K1<603;var i="",e,t,r,n;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)Hr.push({k:t+n,v:r})}for(Hr.sort(function(s,o){return o.v-s.v}),n=0;n<Hr.length;n++)t=Hr[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return i!=="DGBEFHACIJK"}}),zhe=Bhe||!jhe||!Lhe||!DT,Hhe=function(i){return function(e,t){return t===void 0?-1:e===void 0?1:i!==void 0?+i(e,t)||0:V1(e)>V1(t)?1:-1}};Che({target:"Array",proto:!0,forced:zhe},{sort:function(e){e!==void 0&&Dhe(e);var t=Ahe(this);if(DT)return e===void 0?G1(t):G1(t,e);var r=[],n=H1(t),s,o;for(o=0;o<n;o++)o in t&&Fhe(r,t[o]);for(Rhe(r,Hhe(e)),s=H1(r),o=0;o<s;)t[o]=r[o++];for(;o<n;)Nhe(t,o++);return t}});var Vhe=Xe,Whe=Vhe("Array").sort,Uhe=Me,Khe=Whe,Zc=Array.prototype,Ghe=function(i){var e=i.sort;return i===Zc||Uhe(Zc,i)&&e===Zc.sort?Khe:e},qhe=Ghe,Yhe=qhe,Xhe=Yhe,Cn=V(Xhe),Jhe=ls,Zhe=Nt,Qhe=gh,ede=ar,tde=TypeError,rde=function(i){return function(e,t,r,n){Jhe(t);var s=Zhe(e),o=Qhe(s),a=ede(s),l=i?a-1:0,h=i?-1:1;if(r<2)for(;;){if(l in o){n=o[l],l+=h;break}if(l+=h,i?l<0:a<=l)throw new tde("Reduce of empty array with no initial value")}for(;i?l>=0:a>l;l+=h)l in o&&(n=t(n,o[l],l,s));return n}},ide={left:rde(!1)},nde=_e,sde=Ir,ode=sde(nde.process)==="process",ade=z,lde=ide.left,hde=fs,q1=Co,dde=ode,cde=!dde&&q1>79&&q1<83,ude=cde||!hde("reduce");ade({target:"Array",proto:!0,forced:ude},{reduce:function(e){var t=arguments.length;return lde(this,e,t,t>1?arguments[1]:void 0)}});var fde=Xe,vde=fde("Array").reduce,pde=Me,gde=vde,Qc=Array.prototype,yde=function(i){var e=i.reduce;return i===Qc||pde(Qc,i)&&e===Qc.reduce?gde:e},mde=yde,bde=mde,$de=bde,AT=V($de);class NT{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(e){return this.fake_use(e),this.abstract()}setPosition(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,r),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,t){this.fake_use(e,t),this.abstract()}shift(e,t){this.fake_use(e,t),this.abstract()}}class wde extends NT{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;r!==void 0&&this.layout.hierarchical.addToOrdering(e,r),e.x=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}sort(e){Cn(e).call(e,function(t,r){return t.x-r.x})}fix(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}shift(e,t){this.layout.body.nodes[e].x+=t}}class Ede extends NT{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;r!==void 0&&this.layout.hierarchical.addToOrdering(e,r),e.y=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}sort(e){Cn(e).call(e,function(t,r){return t.y-r.y})}fix(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}shift(e,t){this.layout.body.nodes[e].y+=t}}var Sde=z,_de=ai.every,Tde=fs,Ode=Tde("every");Sde({target:"Array",proto:!0,forced:!Ode},{every:function(e){return _de(this,e,arguments.length>1?arguments[1]:void 0)}});var Ide=Xe,xde=Ide("Array").every,Pde=Me,Cde=xde,eu=Array.prototype,Dde=function(i){var e=i.every;return i===eu||Pde(eu,i)&&e===eu.every?Cde:e},Ade=Dde,Nde=Ade,Rde=Nde,RT=V(Rde);function kde(i,e){const t=new Br;return oe(i).call(i,r=>{var n;oe(n=r.edges).call(n,s=>{s.connected&&t.add(s)})}),oe(t).call(t,r=>{const n=r.from.id,s=r.to.id;e[n]==null&&(e[n]=0),(e[s]==null||e[n]>=e[s])&&(e[s]=e[n]+1)}),e}function Mde(i){return kT(e=>{var t,r;return RT(t=pt(r=e.edges).call(r,n=>i.has(n.toId))).call(t,n=>n.to===e)},(e,t)=>t>e,"from",i)}function Fde(i){return kT(e=>{var t,r;return RT(t=pt(r=e.edges).call(r,n=>i.has(n.toId))).call(t,n=>n.from===e)},(e,t)=>t<e,"to",i)}function kT(i,e,t,r){var n;const s=Oi(null),o=AT(n=[...yT(r).call(r)]).call(n,(u,c)=>u+1+c.edges.length,0),a=t+"Id",l=t==="to"?1:-1;for(const[u,c]of r){if(!r.has(u)||!i(c))continue;s[u]=0;const f=[c];let v=0,g;for(;g=f.pop();){var h,d;if(!r.has(u))continue;const y=s[g.id]+l;if(oe(h=pt(d=g.edges).call(d,p=>p.connected&&p.to!==p.from&&p[t]!==g&&r.has(p.toId)&&r.has(p.fromId))).call(h,p=>{const m=p[a],w=s[m];(w==null||e(y,w))&&(s[m]=y,f.push(p[t]))}),v>o)return kde(r,s);++v}}return s}class Bde{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(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)}checkIfTree(){for(const e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){const t={},r=n=>{if(t[n]!==void 0)return t[n];let s=this.levels[n];if(this.childrenReference[n]){const o=this.childrenReference[n];if(o.length>0)for(let a=0;a<o.length;a++)s=Math.max(s,r(o[a]))}return t[n]=s,s};return r(e)}levelDownstream(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)}setMinLevelToZero(){var e;const t=new Fv;let r=0;const n=Cn(e=[...new Br(bQ(this.levels))]).call(e,(s,o)=>s-o);for(const s of n)t.set(s,r++);for(const s in this.levels)Object.prototype.hasOwnProperty.call(this.levels,s)&&(this.levels[s]=t.get(this.levels[s]))}getTreeSize(e,t){let r=1e9,n=-1e9,s=1e9,o=-1e9;for(const a in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,a)&&this.trees[a]===t){const l=e[a];r=Math.min(l.x,r),n=Math.max(l.x,n),s=Math.min(l.y,s),o=Math.max(l.y,o)}return{min_x:r,max_x:n,min_y:s,max_y:o}}hasSameParent(e,t){const r=this.parentReference[e.id],n=this.parentReference[t.id];if(r===void 0||n===void 0)return!1;for(let s=0;s<r.length;s++)for(let o=0;o<n.length;o++)if(r[s]==n[o])return!0;return!1}inSameSubNetwork(e,t){return this.trees[e.id]===this.trees[t.id]}getLevels(){return $e(this.distributionOrdering)}addToOrdering(e,t){this.distributionOrdering[t]===void 0&&(this.distributionOrdering[t]=[]);let r=!1;const n=this.distributionOrdering[t];for(const s in n)if(n[s]===e){r=!0;break}r||(this.distributionOrdering[t].push(e),this.distributionIndex[e.id]=this.distributionOrdering[t].length-1)}}class jde{constructor(e){this.body=e,this._resetRNG(Math.random()+":"+xl()),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"}},Ae(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("_dataChanged",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",()=>{this.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",()=>{if(this.options.hierarchical.enabled!==!0)return;const e=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",e,!1)})}setOptions(e,t){if(e!==void 0){const r=this.options.hierarchical,n=r.enabled;if(ps(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),It(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),r.enabled===!0)return n===!0&&this.body.emitter.emit("refresh",!0),r.direction==="RL"||r.direction==="DU"?r.levelSeparation>0&&(r.levelSeparation*=-1):r.levelSeparation<0&&(r.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(n===!0)return this.body.emitter.emit("refresh"),le(t,this.optionsBackup)}return t}_resetRNG(e){this.initialRandomSeed=e,this._rng=Rh(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){const t=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:t.enabled===void 0?!0:t.enabled,solver:"hierarchicalRepulsion"},t.enabled=t.enabled===void 0?!0:t.enabled,t.solver=t.solver||"barnesHut"):typeof e.physics=="object"?(t.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});let r=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:r};else{const n=e.edges.smooth;n.type!==void 0&&n.type!=="dynamic"&&(r=n.type),this.optionsBackup.edges={smooth:{enabled:n.enabled===void 0?!0:n.enabled,type:n.type===void 0?"dynamic":n.type,roundness:n.roundness===void 0?.5:n.roundness,forceDirection:n.forceDirection===void 0?!1:n.forceDirection}},e.edges.smooth={enabled:n.enabled===void 0?!0:n.enabled,type:r,roundness:n.roundness===void 0?.5:n.roundness,forceDirection:n.forceDirection===void 0?!1:n.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",r)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);const t=e.length+50;for(let r=0;r<e.length;r++){const n=e[r],s=2*Math.PI*this._rng();n.x===void 0&&(n.x=t*Math.cos(s)),n.y===void 0&&(n.y=t*Math.sin(s))}}}layoutNetwork(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){const e=this.body.nodeIndices;let t=0;for(let r=0;r<e.length;r++)this.body.nodes[e[r]].predefinedPosition===!0&&(t+=1);if(t<.5*e.length){let n=0;const s=this.options.clusterThreshold,o={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>s){const l=e.length;for(;e.length>s&&n<=10;){n+=1;const h=e.length;n%3===0?this.body.modules.clustering.clusterBridges(o):this.body.modules.clustering.clusterOutliers(o);const d=e.length;if(h==d&&n%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*l)})}n>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();const a=70;for(let l=0;l<e.length;l++){const h=this.body.nodes[e[l]];h.predefinedPosition===!1&&(h.x+=(.5-this._rng())*a,h.y+=(.5-this._rng())*a)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}_shiftToCenter(){const e=nt.getRangeCore(this.body.nodes,this.body.nodeIndices),t=nt.findCenter(e);for(let r=0;r<this.body.nodeIndices.length;r++){const n=this.body.nodes[this.body.nodeIndices[r]];n.x-=t.x,n.y-=t.y}}_declusterAll(){let e=!0;for(;e===!0;){e=!1;for(let t=0;t<this.body.nodeIndices.length;t++)this.body.nodes[this.body.nodeIndices[t]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[t],{},!1));e===!0&&this.body.emitter.emit("_dataChanged")}}getSeed(){return this.initialRandomSeed}setupHierarchicalLayout(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){let e,t,r=!1,n=!1;this.lastNodeOnLevel={},this.hierarchical=new Bde;for(t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level!==void 0?(r=!0,this.hierarchical.levels[t]=e.options.level):n=!0);if(n===!0&&r===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");{if(n===!0){const o=this.options.hierarchical.sortMethod;o==="hubsize"?this._determineLevelsByHubsize():o==="directed"?this._determineLevelsDirected():o==="custom"&&this._determineLevelsCustomCallback()}for(const o in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,o)&&this.hierarchical.ensureLevel(o);const s=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(s),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let t=!1;const r={},n=()=>{const p=o();let m=0;for(let w=0;w<p.length-1;w++){const $=p[w].max-p[w+1].min;m+=$+this.options.hierarchical.treeSpacing,s(w+1,m)}},s=(p,m)=>{const w=this.hierarchical.trees;for(const $ in w)Object.prototype.hasOwnProperty.call(w,$)&&w[$]===p&&this.direction.shift($,m)},o=()=>{const p=[];for(let m=0;m<this.hierarchical.numTrees();m++)p.push(this.direction.getTreeSize(m));return p},a=(p,m)=>{if(!m[p.id]&&(m[p.id]=!0,this.hierarchical.childrenReference[p.id])){const w=this.hierarchical.childrenReference[p.id];if(w.length>0)for(let $=0;$<w.length;$++)a(this.body.nodes[w[$]],m)}},l=function(p){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,w=1e9,$=1e9,x=1e9,_=-1e9;for(const A in p)if(Object.prototype.hasOwnProperty.call(p,A)){const R=e.body.nodes[A],B=e.hierarchical.levels[R.id],G=e.direction.getPosition(R),[q,ce]=e._getSpaceAroundNode(R,p);w=Math.min(q,w),$=Math.min(ce,$),B<=m&&(x=Math.min(G,x),_=Math.max(G,_))}return[x,_,w,$]},h=(p,m)=>{const w=this.hierarchical.getMaxLevel(p.id),$=this.hierarchical.getMaxLevel(m.id);return Math.min(w,$)},d=(p,m,w)=>{const $=this.hierarchical;for(let x=0;x<m.length;x++){const _=m[x],A=$.distributionOrdering[_];if(A.length>1)for(let R=0;R<A.length-1;R++){const B=A[R],G=A[R+1];$.hasSameParent(B,G)&&$.inSameSubNetwork(B,G)&&p(B,G,w)}}},u=function(p,m){let w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const $=e.direction.getPosition(p),x=e.direction.getPosition(m),_=Math.abs(x-$),A=e.options.hierarchical.nodeSpacing;if(_>A){const R={},B={};a(p,R),a(m,B);const G=h(p,m),q=l(R,G),ce=l(B,G),ue=q[1],Fe=ce[0],Q=ce[2];if(Math.abs(ue-Fe)>A){let Z=ue-Fe+A;Z<-Q+A&&(Z=-Q+A),Z<0&&(e._shiftBlock(m.id,Z),t=!0,w===!0&&e._centerParent(m))}}},c=(p,m)=>{const w=m.id,$=m.edges,x=this.hierarchical.levels[m.id],_=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,A={},R=[];for(let Q=0;Q<$.length;Q++){const K=$[Q];if(K.toId!=K.fromId){const Z=K.toId==w?K.from:K.to;A[$[Q].id]=Z,this.hierarchical.levels[Z.id]<x&&R.push(K)}}const B=(Q,K)=>{let Z=0;for(let se=0;se<K.length;se++)if(A[K[se].id]!==void 0){const Ce=this.direction.getPosition(A[K[se].id])-Q;Z+=Ce/Math.sqrt(Ce*Ce+_)}return Z},G=(Q,K)=>{let Z=0;for(let se=0;se<K.length;se++)if(A[K[se].id]!==void 0){const Ce=this.direction.getPosition(A[K[se].id])-Q;Z-=_*Math.pow(Ce*Ce+_,-1.5)}return Z},q=(Q,K)=>{let Z=this.direction.getPosition(m);const se={};for(let Ce=0;Ce<Q;Ce++){const je=B(Z,K),hr=G(Z,K),Gt=40,jh=Math.max(-Gt,Math.min(Gt,Math.round(je/hr)));if(Z=Z-jh,se[Z]!==void 0)break;se[Z]=Ce}return Z},ce=Q=>{const K=this.direction.getPosition(m);if(r[m.id]===void 0){const Gt={};a(m,Gt),r[m.id]=Gt}const Z=l(r[m.id]),se=Z[2],Ce=Z[3],je=Q-K;let hr=0;je>0?hr=Math.min(je,Ce-this.options.hierarchical.nodeSpacing):je<0&&(hr=-Math.min(-je,se-this.options.hierarchical.nodeSpacing)),hr!=0&&(this._shiftBlock(m.id,hr),t=!0)},ue=Q=>{const K=this.direction.getPosition(m),[Z,se]=this._getSpaceAroundNode(m),Ce=Q-K;let je=K;Ce>0?je=Math.min(K+(se-this.options.hierarchical.nodeSpacing),Q):Ce<0&&(je=Math.max(K-(Z-this.options.hierarchical.nodeSpacing),Q)),je!==K&&(this.direction.setPosition(m,je),t=!0)};let Fe=q(p,R);ce(Fe),Fe=q(p,$),ue(Fe)},f=p=>{let m=this.hierarchical.getLevels();m=Ti(m).call(m);for(let w=0;w<p;w++){t=!1;for(let $=0;$<m.length;$++){const x=m[$],_=this.hierarchical.distributionOrdering[x];for(let A=0;A<_.length;A++)c(1e3,_[A])}if(t!==!0)break}},v=p=>{let m=this.hierarchical.getLevels();m=Ti(m).call(m);for(let w=0;w<p&&(t=!1,d(u,m,!0),t===!0);w++);},g=()=>{for(const p in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,p)&&this._centerParent(this.body.nodes[p])},y=()=>{let p=this.hierarchical.getLevels();p=Ti(p).call(p);for(let m=0;m<p.length;m++){const w=p[m],$=this.hierarchical.distributionOrdering[w];for(let x=0;x<$.length;x++)this._centerParent($[x])}};this.options.hierarchical.blockShifting===!0&&(v(5),g()),this.options.hierarchical.edgeMinimization===!0&&f(20),this.options.hierarchical.parentCentralization===!0&&y(),n()}_getSpaceAroundNode(e,t){let r=!0;t===void 0&&(r=!1);const n=this.hierarchical.levels[e.id];if(n!==void 0){const s=this.hierarchical.distributionIndex[e.id],o=this.direction.getPosition(e),a=this.hierarchical.distributionOrdering[n];let l=1e9,h=1e9;if(s!==0){const d=a[s-1];if(r===!0&&t[d.id]===void 0||r===!1){const u=this.direction.getPosition(d);l=o-u}}if(s!=a.length-1){const d=a[s+1];if(r===!0&&t[d.id]===void 0||r===!1){const u=this.direction.getPosition(d);h=Math.min(h,u-o)}}return[l,h]}else return[0,0]}_centerParent(e){if(this.hierarchical.parentReference[e.id]){const t=this.hierarchical.parentReference[e.id];for(let r=0;r<t.length;r++){const n=t[r],s=this.body.nodes[n],o=this.hierarchical.childrenReference[n];if(o!==void 0){const a=this._getCenterPosition(o),l=this.direction.getPosition(s),[h,d]=this._getSpaceAroundNode(s),u=l-a;(u<0&&Math.abs(u)<d-this.options.hierarchical.nodeSpacing||u>0&&Math.abs(u)<h-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(s,a)}}}}_placeNodesByHierarchy(e){this.positionedNodes={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var t;let n=$e(e[r]);n=this._indexArrayToNodes(n),Cn(t=this.direction).call(t,n);let s=0;for(let o=0;o<n.length;o++){const a=n[o];if(this.positionedNodes[a.id]===void 0){const l=this.options.hierarchical.nodeSpacing;let h=l*s;s>0&&(h=this.direction.getPosition(n[o-1])+l),this.direction.setPosition(a,h,r),this._validatePositionAndContinue(a,r,h),s++}}}}_placeBranchNodes(e,t){var r;const n=this.hierarchical.childrenReference[e];if(n===void 0)return;const s=[];for(let a=0;a<n.length;a++)s.push(this.body.nodes[n[a]]);Cn(r=this.direction).call(r,s);for(let a=0;a<s.length;a++){const l=s[a],h=this.hierarchical.levels[l.id];if(h>t&&this.positionedNodes[l.id]===void 0){const d=this.options.hierarchical.nodeSpacing;let u;a===0?u=this.direction.getPosition(this.body.nodes[e]):u=this.direction.getPosition(s[a-1])+d,this.direction.setPosition(l,u,h),this._validatePositionAndContinue(l,h,u)}else return}const o=this._getCenterPosition(s);this.direction.setPosition(this.body.nodes[e],o,t)}_validatePositionAndContinue(e,t,r){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){const n=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(r-n<this.options.hierarchical.nodeSpacing){const s=n+this.options.hierarchical.nodeSpacing-r,o=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(o.withChild,s)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}}_indexArrayToNodes(e){const t=[];for(let r=0;r<e.length;r++)t.push(this.body.nodes[e[r]]);return t}_getDistribution(){const e={};let t,r;for(t in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,t)){r=this.body.nodes[t];const n=this.hierarchical.levels[t]===void 0?0:this.hierarchical.levels[t];this.direction.fix(r,n),e[n]===void 0&&(e[n]={}),e[n][t]=r}return e}_getActiveEdges(e){const t=[];return X(e.edges,r=>{var n;ee(n=this.body.edgeIndices).call(n,r.id)!==-1&&t.push(r)}),t}_getHubSizes(){const e={},t=this.body.nodeIndices;X(t,n=>{const s=this.body.nodes[n],o=this._getActiveEdges(s).length;e[o]=!0});const r=[];return X(e,n=>{r.push(Number(n))}),Cn(r).call(r,function(n,s){return s-n}),r}_determineLevelsByHubsize(){const e=(r,n)=>{this.hierarchical.levelDownstream(r,n)},t=this._getHubSizes();for(let r=0;r<t.length;++r){const n=t[r];if(n===0)break;X(this.body.nodeIndices,s=>{const o=this.body.nodes[s];n===this._getActiveEdges(o).length&&this._crawlNetwork(e,s)})}}_determineLevelsCustomCallback(){const t=function(n,s,o){},r=(n,s,o)=>{let a=this.hierarchical.levels[n.id];a===void 0&&(a=this.hierarchical.levels[n.id]=1e5);const l=t(nt.cloneOptions(n,"node"),nt.cloneOptions(s,"node"),nt.cloneOptions(o,"edge"));this.hierarchical.levels[s.id]=a+l};this._crawlNetwork(r),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;const t=AT(e=this.body.nodeIndices).call(e,(r,n)=>(r.set(n,this.body.nodes[n]),r),new Fv);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=Fde(t):this.hierarchical.levels=Mde(t),this.hierarchical.setMinLevelToZero()}_generateMap(){const e=(t,r)=>{this.hierarchical.levels[r.id]>this.hierarchical.levels[t.id]&&this.hierarchical.addRelation(t.id,r.id)};this._crawlNetwork(e),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},t=arguments.length>1?arguments[1]:void 0;const r={},n=(s,o)=>{if(r[s.id]===void 0){this.hierarchical.setTreeIndex(s,o),r[s.id]=!0;let a;const l=this._getActiveEdges(s);for(let h=0;h<l.length;h++){const d=l[h];d.connected===!0&&(d.toId==s.id?a=d.from:a=d.to,s.id!=a.id&&(e(s,a,d),n(a,o)))}}};if(t===void 0){let s=0;for(let o=0;o<this.body.nodeIndices.length;o++){const a=this.body.nodeIndices[o];if(r[a]===void 0){const l=this.body.nodes[a];n(l,s),s+=1}}}else{const s=this.body.nodes[t];if(s===void 0){console.error("Node not found:",t);return}n(s)}}_shiftBlock(e,t){const r={},n=s=>{if(r[s])return;r[s]=!0,this.direction.shift(s,t);const o=this.hierarchical.childrenReference[s];if(o!==void 0)for(let a=0;a<o.length;a++)n(o[a])};n(e)}_findCommonParent(e,t){const r={},n=(o,a)=>{const l=this.hierarchical.parentReference[a];if(l!==void 0)for(let h=0;h<l.length;h++){const d=l[h];o[d]=!0,n(o,d)}},s=(o,a)=>{const l=this.hierarchical.parentReference[a];if(l!==void 0)for(let h=0;h<l.length;h++){const d=l[h];if(o[d]!==void 0)return{foundParent:d,withChild:a};const u=s(o,d);if(u.foundParent!==null)return u}return{foundParent:null,withChild:a}};return n(r,e),s(r,t)}setDirectionStrategy(){this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU"?this.direction=new wde(this):this.direction=new Ede(this)}_getCenterPosition(e){let t=1e9,r=-1e9;for(let n=0;n<e.length;n++){let s;if(e[n].id!==void 0)s=e[n];else{const a=e[n];s=this.body.nodes[a]}const o=this.direction.getPosition(s);t=Math.min(t,o),r=Math.max(r,o)}return .5*(t+r)}}class Lde{constructor(e,t,r,n){var s,o;this.body=e,this.canvas=t,this.selectionHandler=r,this.interactionHandler=n,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}},Ae(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",O(s=this._restore).call(s,this)),this.body.emitter.on("_resetData",O(o=this._restore).call(o,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,t,r){t!==void 0&&(t.locale!==void 0?this.options.locale=t.locale:this.options.locale=r.locale,t.locales!==void 0?this.options.locales=t.locales:this.options.locales=r.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,le(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,t;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";const r=this.selectionHandler.getSelectedNodeCount(),n=this.selectionHandler.getSelectedEdgeCount(),s=r+n,o=this.options.locales[this.options.locale];let a=!1;this.options.addNode!==!1&&(this._createAddNodeButton(o),a=!0),this.options.addEdge!==!1&&(a===!0?this._createSeperator(1):a=!0,this._createAddEdgeButton(o)),r===1&&typeof this.options.editNode=="function"?(a===!0?this._createSeperator(2):a=!0,this._createEditNodeButton(o)):n===1&&r===0&&this.options.editEdge!==!1&&(a===!0?this._createSeperator(3):a=!0,this._createEditEdgeButton(o)),s!==0&&(r>0&&this.options.deleteNode!==!1?(a===!0&&this._createSeperator(4),this._createDeleteButton(o)):r===0&&this.options.deleteEdge!==!1&&(a===!0&&this._createSeperator(4),this._createDeleteButton(o))),this._bindElementEvents(this.closeDiv,O(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",O(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t;const r=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(r),this._createSeperator(),this._createDescription(r.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,O(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",O(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();const e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(e.isCluster!==!0){const t=le({},e.options,!1);if(t.x=e.x,t.y=e.y,this.options.editNode.length===2)this.options.editNode(t,r=>{r!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(r),this.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}addEdgeMode(){var e,t,r,n,s;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var o;const a=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(a),this._createSeperator(),this._createDescription(a.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,O(o=this.toggleEditMode).call(o,this))}this._temporaryBindUI("onTouch",O(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",O(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",O(r=this._dragControlNode).call(r,this)),this._temporaryBindUI("onRelease",O(n=this._finishConnect).call(n,this)),this._temporaryBindUI("onDragStart",O(s=this._dragStartEdge).call(s,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",typeof this.options.editEdge=="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){const o=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(o.from.id,o.to.id);return}if(this.guiEnabled===!0){var e;const o=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(o),this._createSeperator(),this._createDescription(o.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,O(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var t,r,n,s;const o=this.body.edges[this.edgeBeingEditedId],a=this._getNewTargetNode(o.from.x,o.from.y),l=this._getNewTargetNode(o.to.x,o.to.y);this.temporaryIds.nodes.push(a.id),this.temporaryIds.nodes.push(l.id),this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id),this.body.nodes[l.id]=l,this.body.nodeIndices.push(l.id),this._temporaryBindUI("onTouch",O(t=this._controlNodeTouch).call(t,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",O(r=this._controlNodeDragStart).call(r,this)),this._temporaryBindUI("onDrag",O(n=this._controlNodeDrag).call(n,this)),this._temporaryBindUI("onDragEnd",O(s=this._controlNodeDragEnd).call(s,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",h=>{const d=o.edgeType.findBorderPositions(h);a.selected===!1&&(a.x=d.from.x,a.y=d.from.y),l.selected===!1&&(l.x=d.to.x,l.y=d.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";const e=this.selectionHandler.getSelectedNodeIds(),t=this.selectionHandler.getSelectedEdgeIds();let r;if(e.length>0){for(let n=0;n<e.length;n++)if(this.body.nodes[e[n]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(r=this.options.deleteNode)}else t.length>0&&typeof this.options.deleteEdge=="function"&&(r=this.options.deleteEdge);if(typeof r=="function"){const n={nodes:e,edges:t};if(r.length===2)r(n,s=>{s!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(s.edges),this.body.data.nodes.getDataSet().remove(s.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(t),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?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",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,t;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(t=this.options.locales[this.options.locale])===null||t===void 0?void 0:t.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}_getNewTargetNode(e,t){const r=le({},this.options.controlNodeStyle);r.id="targetNode"+Fs(),r.hidden=!1,r.physics=!1,r.x=e,r.y=t;const n=this.body.functions.createNode(r);return n.shape.boundingBox={left:e,right:e,top:t,bottom:t},n}_createEditButton(){var e;this._clean(),this.manipulationDOM={},Mr(this.editModeDiv);const t=this.options.locales[this.options.locale],r=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(r),this._bindElementEvents(r,O(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(Mr(this.editModeDiv),Mr(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(const t of yr(e=this._domEventListenerCleanupQueue).call(e,0)){var e;t()}}_removeManipulationDOM(){this._clean(),Mr(this.manipulationDiv),Mr(this.editModeDiv),Mr(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}_createSeperator(){let 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])}_createAddNodeButton(e){var t;const r=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,O(t=this.addNodeMode).call(t,this))}_createAddEdgeButton(e){var t;const r=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,O(t=this.addEdgeMode).call(t,this))}_createEditNodeButton(e){var t;const r=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,O(t=this.editNode).call(t,this))}_createEditEdgeButton(e){var t;const r=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,O(t=this.editEdgeMode).call(t,this))}_createDeleteButton(e){var t;let r;this.options.rtl?r="vis-delete-rtl":r="vis-delete";const n=this._createButton("delete",r,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,O(t=this.deleteSelected).call(t,this))}_createBackButton(e){var t;const r=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,O(t=this.showManipulatorToolbar).call(t,this))}_createButton(e,t,r){let n=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=n,this.manipulationDOM[e+"Label"].innerText=r,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}_createDescription(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}_temporaryBindUI(e,t){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+Ko($e(this.body.eventListeners)))}_unbindTemporaryUIs(){for(const e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let e=0;e<this.temporaryEventFunctions.length;e++){const t=this.temporaryEventFunctions[e].event,r=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,r)}this.temporaryEventFunctions=[]}_bindElementEvents(e,t){const r=new xn(e,{});Fl(r,t),this._domEventListenerCleanupQueue.push(()=>{r.destroy()});const n=s=>{let{keyCode:o,key:a}=s;(a==="Enter"||a===" "||o===13||o===32)&&t()};e.addEventListener("keyup",n,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",n,!1)})}_cleanupTemporaryNodesAndEdges(){for(let s=0;s<this.temporaryIds.edges.length;s++){var e;this.body.edges[this.temporaryIds.edges[s]].disconnect(),delete this.body.edges[this.temporaryIds.edges[s]];const o=ee(e=this.body.edgeIndices).call(e,this.temporaryIds.edges[s]);if(o!==-1){var t;yr(t=this.body.edgeIndices).call(t,o,1)}}for(let s=0;s<this.temporaryIds.nodes.length;s++){var r;delete this.body.nodes[this.temporaryIds.nodes[s]];const o=ee(r=this.body.nodeIndices).call(r,this.temporaryIds.nodes[s]);if(o!==-1){var n;yr(n=this.body.nodeIndices).call(n,o,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Ae({},this.body.view.translation)}_controlNodeDragStart(){const e=this.lastTouch,t=this.selectionHandler._pointerToPositionObject(e),r=this.body.nodes[this.temporaryIds.nodes[0]],n=this.body.nodes[this.temporaryIds.nodes[1]],s=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;const o=r.isOverlappingWith(t),a=n.isOverlappingWith(t);o===!0?(this.selectedControlNode=r,s.edgeType.from=r):a===!0&&(this.selectedControlNode=n,s.edgeType.to=n),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}_controlNodeDrag(e){this.body.emitter.emit("disablePhysics");const t=this.body.functions.getPointer(e.center),r=this.canvas.DOMtoCanvas(t);this.selectedControlNode!==void 0?(this.selectedControlNode.x=r.x,this.selectedControlNode.y=r.y):this.interactionHandler.onDrag(e),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(e){const t=this.body.functions.getPointer(e.center),r=this.selectionHandler._pointerToPositionObject(t),n=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();const s=this.selectionHandler._getAllNodesOverlappingWith(r);let o;for(let a=s.length-1;a>=0;a--)if(s[a]!==this.selectedControlNode.id){o=this.body.nodes[s[a]];break}if(o!==void 0&&this.selectedControlNode!==void 0)if(o.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(o.id,n.to.id):this._performEditEdge(n.from.id,o.id)}else n.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Ae({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;const t=this.lastTouch,r=this.selectionHandler.getNodeAt(t);if(r!==void 0)if(r.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const n=this._getNewTargetNode(r.x,r.y);this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id);const s=this.body.functions.createEdge({id:"connectionEdge"+Fs(),from:r.id,to:n.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[s.id]=s,this.body.edgeIndices.push(s.id),this.temporaryIds.nodes.push(n.id),this.temporaryIds.edges.push(s.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){const t=this.body.functions.getPointer(e.center),r=this.selectionHandler._pointerToPositionObject(t);let n;this.temporaryIds.edges[0]!==void 0&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);const s=this.selectionHandler._getAllNodesOverlappingWith(r);let o;for(let l=s.length-1;l>=0;l--){var a;if(ee(a=this.temporaryIds.nodes).call(a,s[l])===-1){o=this.body.nodes[s[l]];break}}if(e.controlEdge={from:n,to:o?o.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,t),this.temporaryIds.nodes[0]!==void 0){const l=this.body.nodes[this.temporaryIds.nodes[0]];l.x=this.canvas._XconvertDOMtoCanvas(t.x),l.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}_finishConnect(e){const t=this.body.functions.getPointer(e.center),r=this.selectionHandler._pointerToPositionObject(t);let n;this.temporaryIds.edges[0]!==void 0&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);const s=this.selectionHandler._getAllNodesOverlappingWith(r);let o;for(let l=s.length-1;l>=0;l--){var a;if(ee(a=this.temporaryIds.nodes).call(a,s[l])===-1){o=this.body.nodes[s[l]];break}}this._cleanupTemporaryNodesAndEdges(),o!==void 0&&(o.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[n]!==void 0&&this.body.nodes[o.id]!==void 0&&this._performAddEdge(n,o.id)),e.controlEdge={from:n,to:o?o.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}_dragStartEdge(e){const t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,t,void 0,!0)}_performAddNode(e){const t={id:Fs(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(t,r=>{r!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(r),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()}_performAddEdge(e,t){const r={from:e,to:t};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(r,n=>{n!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(r),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,t){const r={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label};let n=this.options.editEdge;if(typeof n=="object"&&(n=n.editWithoutDrag),typeof n=="function")if(n.length===2)n(r,s=>{s==null||this.inMode!=="editEdge"?(this.body.edges[r.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(s),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(r),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}const C="string",T="boolean",b="number",xs="array",k="object",MT="dom",zde="any",tu=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],ru={borderWidth:{number:b},borderWidthSelected:{number:b,undefined:"undefined"},brokenImage:{string:C,undefined:"undefined"},chosen:{label:{boolean:T,function:"function"},node:{boolean:T,function:"function"},__type__:{object:k,boolean:T}},color:{border:{string:C},background:{string:C},highlight:{border:{string:C},background:{string:C},__type__:{object:k,string:C}},hover:{border:{string:C},background:{string:C},__type__:{object:k,string:C}},__type__:{object:k,string:C}},opacity:{number:b,undefined:"undefined"},fixed:{x:{boolean:T},y:{boolean:T},__type__:{object:k,boolean:T}},font:{align:{string:C},color:{string:C},size:{number:b},face:{string:C},background:{string:C},strokeWidth:{number:b},strokeColor:{string:C},vadjust:{number:b},multi:{boolean:T,string:C},bold:{color:{string:C},size:{number:b},face:{string:C},mod:{string:C},vadjust:{number:b},__type__:{object:k,string:C}},boldital:{color:{string:C},size:{number:b},face:{string:C},mod:{string:C},vadjust:{number:b},__type__:{object:k,string:C}},ital:{color:{string:C},size:{number:b},face:{string:C},mod:{string:C},vadjust:{number:b},__type__:{object:k,string:C}},mono:{color:{string:C},size:{number:b},face:{string:C},mod:{string:C},vadjust:{number:b},__type__:{object:k,string:C}},__type__:{object:k,string:C}},group:{string:C,number:b,undefined:"undefined"},heightConstraint:{minimum:{number:b},valign:{string:C},__type__:{object:k,boolean:T,number:b}},hidden:{boolean:T},icon:{face:{string:C},code:{string:C},size:{number:b},color:{string:C},weight:{string:C,number:b},__type__:{object:k}},id:{string:C,number:b},image:{selected:{string:C,undefined:"undefined"},unselected:{string:C,undefined:"undefined"},__type__:{object:k,string:C}},imagePadding:{top:{number:b},right:{number:b},bottom:{number:b},left:{number:b},__type__:{object:k,number:b}},label:{string:C,undefined:"undefined"},labelHighlightBold:{boolean:T},level:{number:b,undefined:"undefined"},margin:{top:{number:b},right:{number:b},bottom:{number:b},left:{number:b},__type__:{object:k,number:b}},mass:{number:b},physics:{boolean:T},scaling:{min:{number:b},max:{number:b},label:{enabled:{boolean:T},min:{number:b},max:{number:b},maxVisible:{number:b},drawThreshold:{number:b},__type__:{object:k,boolean:T}},customScalingFunction:{function:"function"},__type__:{object:k}},shadow:{enabled:{boolean:T},color:{string:C},size:{number:b},x:{number:b},y:{number:b},__type__:{object:k,boolean:T}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:T,array:xs},borderRadius:{number:b},interpolation:{boolean:T},useImageSize:{boolean:T},useBorderWithImage:{boolean:T},coordinateOrigin:{string:["center","top-left"]},__type__:{object:k}},size:{number:b},title:{string:C,dom:MT,undefined:"undefined"},value:{number:b,undefined:"undefined"},widthConstraint:{minimum:{number:b},maximum:{number:b},__type__:{object:k,boolean:T,number:b}},x:{number:b},y:{number:b},__type__:{object:k}},Hde={configure:{enabled:{boolean:T},filter:{boolean:T,string:C,array:xs,function:"function"},container:{dom:MT},showButton:{boolean:T},__type__:{object:k,boolean:T,string:C,array:xs,function:"function"}},edges:{arrows:{to:{enabled:{boolean:T},scaleFactor:{number:b},type:{string:tu},imageHeight:{number:b},imageWidth:{number:b},src:{string:C},__type__:{object:k,boolean:T}},middle:{enabled:{boolean:T},scaleFactor:{number:b},type:{string:tu},imageWidth:{number:b},imageHeight:{number:b},src:{string:C},__type__:{object:k,boolean:T}},from:{enabled:{boolean:T},scaleFactor:{number:b},type:{string:tu},imageWidth:{number:b},imageHeight:{number:b},src:{string:C},__type__:{object:k,boolean:T}},__type__:{string:["from","to","middle"],object:k}},endPointOffset:{from:{number:b},to:{number:b},__type__:{object:k,number:b}},arrowStrikethrough:{boolean:T},background:{enabled:{boolean:T},color:{string:C},size:{number:b},dashes:{boolean:T,array:xs},__type__:{object:k,boolean:T}},chosen:{label:{boolean:T,function:"function"},edge:{boolean:T,function:"function"},__type__:{object:k,boolean:T}},color:{color:{string:C},highlight:{string:C},hover:{string:C},inherit:{string:["from","to","both"],boolean:T},opacity:{number:b},__type__:{object:k,string:C}},dashes:{boolean:T,array:xs},font:{color:{string:C},size:{number:b},face:{string:C},background:{string:C},strokeWidth:{number:b},strokeColor:{string:C},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:b},multi:{boolean:T,string:C},bold:{color:{string:C},size:{number:b},face:{string:C},mod:{string:C},vadjust:{number:b},__type__:{object:k,string:C}},boldital:{color:{string:C},size:{number:b},face:{string:C},mod:{string:C},vadjust:{number:b},__type__:{object:k,string:C}},ital:{color:{string:C},size:{number:b},face:{string:C},mod:{string:C},vadjust:{number:b},__type__:{object:k,string:C}},mono:{color:{string:C},size:{number:b},face:{string:C},mod:{string:C},vadjust:{number:b},__type__:{object:k,string:C}},__type__:{object:k,string:C}},hidden:{boolean:T},hoverWidth:{function:"function",number:b},label:{string:C,undefined:"undefined"},labelHighlightBold:{boolean:T},length:{number:b,undefined:"undefined"},physics:{boolean:T},scaling:{min:{number:b},max:{number:b},label:{enabled:{boolean:T},min:{number:b},max:{number:b},maxVisible:{number:b},drawThreshold:{number:b},__type__:{object:k,boolean:T}},customScalingFunction:{function:"function"},__type__:{object:k}},selectionWidth:{function:"function",number:b},selfReferenceSize:{number:b},selfReference:{size:{number:b},angle:{number:b},renderBehindTheNode:{boolean:T},__type__:{object:k}},shadow:{enabled:{boolean:T},color:{string:C},size:{number:b},x:{number:b},y:{number:b},__type__:{object:k,boolean:T}},smooth:{enabled:{boolean:T},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:b},forceDirection:{string:["horizontal","vertical","none"],boolean:T},__type__:{object:k,boolean:T}},title:{string:C,undefined:"undefined"},width:{number:b},widthConstraint:{maximum:{number:b},__type__:{object:k,boolean:T,number:b}},value:{number:b,undefined:"undefined"},__type__:{object:k}},groups:{useDefaultGroups:{boolean:T},__any__:ru,__type__:{object:k}},interaction:{dragNodes:{boolean:T},dragView:{boolean:T},hideEdgesOnDrag:{boolean:T},hideEdgesOnZoom:{boolean:T},hideNodesOnDrag:{boolean:T},hover:{boolean:T},keyboard:{enabled:{boolean:T},speed:{x:{number:b},y:{number:b},zoom:{number:b},__type__:{object:k}},bindToWindow:{boolean:T},autoFocus:{boolean:T},__type__:{object:k,boolean:T}},multiselect:{boolean:T},navigationButtons:{boolean:T},selectable:{boolean:T},selectConnectedEdges:{boolean:T},hoverConnectedEdges:{boolean:T},tooltipDelay:{number:b},zoomView:{boolean:T},zoomSpeed:{number:b},__type__:{object:k}},layout:{randomSeed:{undefined:"undefined",number:b,string:C},improvedLayout:{boolean:T},clusterThreshold:{number:b},hierarchical:{enabled:{boolean:T},levelSeparation:{number:b},nodeSpacing:{number:b},treeSpacing:{number:b},blockShifting:{boolean:T},edgeMinimization:{boolean:T},parentCentralization:{boolean:T},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:k,boolean:T}},__type__:{object:k}},manipulation:{enabled:{boolean:T},initiallyActive:{boolean:T},addNode:{boolean:T,function:"function"},addEdge:{boolean:T,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:k,boolean:T,function:"function"}},deleteNode:{boolean:T,function:"function"},deleteEdge:{boolean:T,function:"function"},controlNodeStyle:ru,__type__:{object:k,boolean:T}},nodes:ru,physics:{enabled:{boolean:T},barnesHut:{theta:{number:b},gravitationalConstant:{number:b},centralGravity:{number:b},springLength:{number:b},springConstant:{number:b},damping:{number:b},avoidOverlap:{number:b},__type__:{object:k}},forceAtlas2Based:{theta:{number:b},gravitationalConstant:{number:b},centralGravity:{number:b},springLength:{number:b},springConstant:{number:b},damping:{number:b},avoidOverlap:{number:b},__type__:{object:k}},repulsion:{centralGravity:{number:b},springLength:{number:b},springConstant:{number:b},nodeDistance:{number:b},damping:{number:b},__type__:{object:k}},hierarchicalRepulsion:{centralGravity:{number:b},springLength:{number:b},springConstant:{number:b},nodeDistance:{number:b},damping:{number:b},avoidOverlap:{number:b},__type__:{object:k}},maxVelocity:{number:b},minVelocity:{number:b},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:T},iterations:{number:b},updateInterval:{number:b},onlyDynamicEdges:{boolean:T},fit:{boolean:T},__type__:{object:k,boolean:T}},timestep:{number:b},adaptiveTimestep:{boolean:T},wind:{x:{number:b},y:{number:b},__type__:{object:k}},__type__:{object:k,boolean:T}},autoResize:{boolean:T},clickToUse:{boolean:T},locale:{string:C},locales:{__any__:{any:zde},__type__:{object:k}},height:{string:C},width:{string:C},__type__:{object:k}},FT={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]}}},Vde=(i,e,t)=>{var r;return!!(Yr(i).call(i,"physics")&&Yr(r=FT.physics.solver).call(r,e)&&t.physics.solver!==e&&e!=="wind")};class Wde{constructor(){}getDistances(e,t,r){const n={},s=e.edges;for(let a=0;a<t.length;a++){const l=t[a],h={};n[l]=h;for(let d=0;d<t.length;d++)h[t[d]]=a==d?0:1e9}for(let a=0;a<r.length;a++){const l=s[r[a]];l.connected===!0&&n[l.fromId]!==void 0&&n[l.toId]!==void 0&&(n[l.fromId][l.toId]=1,n[l.toId][l.fromId]=1)}const o=t.length;for(let a=0;a<o;a++){const l=t[a],h=n[l];for(let d=0;d<o-1;d++){const u=t[d],c=n[u];for(let f=d+1;f<o;f++){const v=t[f],g=n[v],y=Math.min(c[v],c[l]+h[v]);c[v]=y,g[u]=y}}}return n}}class Ude{constructor(e,t,r){this.body=e,this.springLength=t,this.springConstant=r,this.distanceSolver=new Wde}setOptions(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}solve(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const n=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(n),this._createK_matrix(n),this._createE_matrix();const s=.01,o=1;let a=0;const l=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),h=5;let d=1e9,u=0,c=0,f=0,v=0,g=0;for(;d>s&&a<l;)for(a+=1,[u,d,c,f]=this._getHighestEnergyNode(r),v=d,g=0;v>o&&g<h;)g+=1,this._moveNode(u,c,f),[v,c,f]=this._getEnergy(u)}_getHighestEnergyNode(e){const t=this.body.nodeIndices,r=this.body.nodes;let n=0,s=t[0],o=0,a=0;for(let l=0;l<t.length;l++){const h=t[l];if(r[h].predefinedPosition!==!0||r[h].isCluster===!0&&e===!0||r[h].options.fixed.x!==!0||r[h].options.fixed.y!==!0){const[d,u,c]=this._getEnergy(h);n<d&&(n=d,s=h,o=u,a=c)}}return[s,n,o,a]}_getEnergy(e){const[t,r]=this.E_sums[e];return[Math.sqrt(t**2+r**2),t,r]}_moveNode(e,t,r){const n=this.body.nodeIndices,s=this.body.nodes;let o=0,a=0,l=0;const h=s[e].x,d=s[e].y,u=this.K_matrix[e],c=this.L_matrix[e];for(let $=0;$<n.length;$++){const x=n[$];if(x!==e){const _=s[x].x,A=s[x].y,R=u[x],B=c[x],G=1/((h-_)**2+(d-A)**2)**1.5;o+=R*(1-B*(d-A)**2*G),a+=R*(B*(h-_)*(d-A)*G),l+=R*(1-B*(h-_)**2*G)}}const f=o,v=a,g=t,y=l,p=r,m=(g/f+p/v)/(v/f-y/v),w=-(v*m+g)/f;s[e].x+=w,s[e].y+=m,this._updateE_matrix(e)}_createL_matrix(e){const t=this.body.nodeIndices,r=this.springLength;this.L_matrix=[];for(let n=0;n<t.length;n++){this.L_matrix[t[n]]={};for(let s=0;s<t.length;s++)this.L_matrix[t[n]][t[s]]=r*e[t[n]][t[s]]}}_createK_matrix(e){const t=this.body.nodeIndices,r=this.springConstant;this.K_matrix=[];for(let n=0;n<t.length;n++){this.K_matrix[t[n]]={};for(let s=0;s<t.length;s++)this.K_matrix[t[n]][t[s]]=r*e[t[n]][t[s]]**-2}}_createE_matrix(){const e=this.body.nodeIndices,t=this.body.nodes;this.E_matrix={},this.E_sums={};for(let r=0;r<e.length;r++)this.E_matrix[e[r]]=[];for(let r=0;r<e.length;r++){const n=e[r],s=t[n].x,o=t[n].y;let a=0,l=0;for(let h=r;h<e.length;h++){const d=e[h];if(d!==n){const u=t[d].x,c=t[d].y,f=1/Math.sqrt((s-u)**2+(o-c)**2);this.E_matrix[n][h]=[this.K_matrix[n][d]*(s-u-this.L_matrix[n][d]*(s-u)*f),this.K_matrix[n][d]*(o-c-this.L_matrix[n][d]*(o-c)*f)],this.E_matrix[d][r]=this.E_matrix[n][h],a+=this.E_matrix[n][h][0],l+=this.E_matrix[n][h][1]}}this.E_sums[n]=[a,l]}}_updateE_matrix(e){const t=this.body.nodeIndices,r=this.body.nodes,n=this.E_matrix[e],s=this.K_matrix[e],o=this.L_matrix[e],a=r[e].x,l=r[e].y;let h=0,d=0;for(let u=0;u<t.length;u++){const c=t[u];if(c!==e){const f=n[u],v=f[0],g=f[1],y=r[c].x,p=r[c].y,m=1/Math.sqrt((a-y)**2+(l-p)**2),w=s[c]*(a-y-o[c]*(a-y)*m),$=s[c]*(l-p-o[c]*(l-p)*m);n[u]=[w,$],h+=w,d+=$;const x=this.E_sums[c];x[0]+=w-v,x[1]+=$-g}}this.E_sums[e]=[h,d]}}function N(i,e,t){var r,n,s,o;if(!(this instanceof N))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:wre,clickToUse:!1},Ae(this.options,this.defaultOptions),this.body={container:i,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:O(r=this.on).call(r,this),off:O(n=this.off).call(n,this),emit:O(s=this.emit).call(s,this),once:O(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 _re(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new bne,this.canvas=new Nle(this.body),this.selectionHandler=new bhe(this.body,this.canvas),this.interactionHandler=new Fle(this.body,this.canvas,this.selectionHandler),this.view=new kle(this.body,this.canvas),this.renderer=new xle(this.body,this.canvas),this.physics=new $le(this.body),this.layoutEngine=new jde(this.body),this.clustering=new Ole(this.body),this.manipulation=new Lde(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new Wae(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new vle(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new Ude(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(t),this.setData(e)}rS(N.prototype);N.prototype.setOptions=function(i){if(i===null&&(i=void 0),i!==void 0){if(Zte.validate(i,Hde)===!0&&console.error("%cErrors have been found in the supplied options object.",B_),ps(["locale","locales","clickToUse"],this.options,i),i.locale!==void 0&&(i.locale=Ere(i.locales||this.options.locales,i.locale)),i=this.layoutEngine.setOptions(i.layout,i),this.canvas.setOptions(i),this.groups.setOptions(i.groups),this.nodesHandler.setOptions(i.nodes),this.edgesHandler.setOptions(i.edges),this.physics.setOptions(i.physics),this.manipulation.setOptions(i.manipulation,i,this.options),this.interactionHandler.setOptions(i.interaction),this.renderer.setOptions(i.interaction),this.selectionHandler.setOptions(i.interaction),i.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in i&&(this.configurator||(this.configurator=new Xte(this,this.body.container,FT,this.canvas.pixelRatio,Vde)),this.configurator.setOptions(i.configure)),this.configurator&&this.configurator.options.enabled===!0){const r={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};le(r.nodes,this.nodesHandler.options),le(r.edges,this.edgesHandler.options),le(r.layout,this.layoutEngine.options),le(r.interaction,this.selectionHandler.options),le(r.interaction,this.renderer.options),le(r.interaction,this.interactionHandler.options),le(r.manipulation,this.manipulation.options),le(r.physics,this.physics.options),le(r.global,this.canvas.options),le(r.global,this.options),this.configurator.setModuleOptions(r)}i.clickToUse!==void 0?i.clickToUse===!0?this.activator===void 0&&(this.activator=new Yte(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}};N.prototype._updateVisibleIndices=function(){const i=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&!this.clustering._isClusteredNode(t)&&i[t].options.hidden===!1&&this.body.nodeIndices.push(i[t].id);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t],n=i[r.fromId],s=i[r.toId],o=n!==void 0&&s!==void 0;!this.clustering._isClusteredEdge(t)&&r.options.hidden===!1&&o&&n.options.hidden===!1&&s.options.hidden===!1&&this.body.edgeIndices.push(r.id)}};N.prototype.bindEventListeners=function(){this.body.emitter.on("_dataChanged",()=>{this.edgesHandler._updateState(),this.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit("startSimulation"),this.body.emitter.emit("_requestRedraw")})};N.prototype.setData=function(i){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),i&&i.dot&&(i.nodes||i.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(i&&i.options),i&&i.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);");const e=lre(i.dot);this.setData(e);return}else if(i&&i.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);");const e=hre(i.gephi);this.setData(e);return}else this.nodesHandler.setData(i&&i.nodes,!0),this.edgesHandler.setData(i&&i.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")};N.prototype.destroy=function(){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;for(const i in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,i)&&delete this.body.nodes[i];for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&delete this.body.edges[i];Mr(this.body.container)};N.prototype._updateValueRange=function(i){let e,t,r,n=0;for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)){const s=i[e].getValue();s!==void 0&&(t=t===void 0?s:Math.min(s,t),r=r===void 0?s:Math.max(s,r),n+=s)}if(t!==void 0&&r!==void 0)for(e in i)Object.prototype.hasOwnProperty.call(i,e)&&i[e].setValueRange(t,r,n)};N.prototype.isActive=function(){return!this.activator||this.activator.active};N.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};N.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};N.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};N.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};N.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};N.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};N.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};N.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};N.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};N.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};N.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};N.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};N.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};N.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};N.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};N.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};N.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};N.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};N.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};N.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};N.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};N.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};N.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};N.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};N.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};N.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};N.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};N.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};N.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};N.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};N.prototype.getConnectedNodes=function(i){return this.body.nodes[i]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)};N.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};N.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};N.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};N.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};N.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};N.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};N.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};N.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};N.prototype.getNodeAt=function(){const i=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return i!==void 0&&i.id!==void 0?i.id:i};N.prototype.getEdgeAt=function(){const i=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return i!==void 0&&i.id!==void 0?i.id:i};N.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};N.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};N.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};N.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};N.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};N.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};N.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};N.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};N.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};N.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};N.prototype.getOptionsFromConfigurator=function(){let i={};return this.configurator&&(i=this.configurator.getOptions.apply(this.configurator)),i};function Kde({content:i,name:e="Assistant",avatar:t,onAddMessage:r,onFinishLoad:n}){const{state:s,dispatch:o}=GT(),{selectedNode:a,installedNodes:l}=s,h=JSON.parse(i),[d,u]=ve.useState(null),c=ve.useRef(null),f=h.ext?.find(m=>m.type==="downstream_subgraph_search")?.data||[];ve.useEffect(()=>{n?.()},[]);const v=m=>{const w=m.json.nodes.map(x=>({id:x.id,label:x.type,color:{background:"#2B7CE9",border:"#1B5BB1"},font:{size:16,color:"#FFFFFF",face:"arial",bold:!0},margin:12,padding:10,shape:"box",widthConstraint:{minimum:100,maximum:200}})),$=m.json.links.map(x=>({from:x.origin_id,to:x.target_id,arrows:{to:{enabled:!0,scaleFactor:1.2}},color:"#000000",width:2}));return{nodes:w,edges:$}};ve.useEffect(()=>()=>{c.current&&(c.current.destroy(),c.current=null)},[]);const g=ve.useCallback((m,w)=>{c.current&&c.current.destroy();const $=v(w),x=new N(m,$,{nodes:{shape:"box",margin:12,padding:10,font:{size:16,color:"#FFFFFF",face:"arial",bold:!0},borderWidth:2,shadow:{enabled:!0,color:"rgba(0,0,0,0.2)",size:5}},edges:{arrows:"to",color:"#000000",width:2,smooth:{enabled:!0,type:"straightCross"}},physics:{enabled:!0,solver:"hierarchicalRepulsion",hierarchicalRepulsion:{nodeDistance:200,springLength:200}},layout:{hierarchical:{enabled:!0,direction:"UD",sortMethod:"directed",nodeSpacing:200,levelSeparation:150}},interaction:{dragNodes:!1,zoomView:!1,dragView:!1}});c.current=x},[]),y=async m=>{console.log("[DownstreamSubgraphs] Starting checkAndLoadSubgraph with node:",m),Wr.trackEvent({event_type:"subgraph_accept",message_type:"subgraph",message_id:h.message_id,data:{subgraph_name:m.name,subgraph_tags:m.tags}});const w=m.json.nodes,$=Object.values(tt.canvas.selected_nodes)[0];if(!$){console.warn("[DownstreamSubgraphs] No node selected"),alert("Please select a upstream node first before adding a subgraph.");return}const x=w.map(R=>R.type),_=l;console.log("[DownstreamSubgraphs] Required node types:",x),console.log("[DownstreamSubgraphs] Installed node types:",_);const A=x.filter(R=>!_.includes(R));if(console.log("[DownstreamSubgraphs] Missing node types:",A),A.length>0)try{console.log("[DownstreamSubgraphs] Fetching info for missing nodes");const R=await Wr.batchGetNodeInfo(A);console.log("[DownstreamSubgraphs] Received node infos:",R);const B={text:"",ext:[{type:"node_install_guide",data:R.map(q=>({name:q.name,repository_url:q.github_url}))}]};console.log("[DownstreamSubgraphs] Created message content:",B);const G={id:Jt(),role:"ai",content:JSON.stringify(B),format:"markdown",name:"Assistant",metadata:{pendingSubgraph:m}};console.log("[DownstreamSubgraphs] Created AI message:",G),r?.(G);return}catch(R){console.error("[DownstreamSubgraphs] Error fetching node info:",R),alert("Error checking required nodes. Please try again.");return}console.log("[DownstreamSubgraphs] All required nodes are installed, proceeding to load subgraph"),p(m,$)},p=(m,w)=>{const $=m.json.nodes,x=m.json.links,_=$.find(B=>B.id===0),A=_?.id;console.log("[DownstreamSubgraphs] Entry node ID:",A);const R={};A!==null&&(R[A]=w),tt.canvas.emitBeforeChange();try{for(const B of $)if(B.id!==A){const G=_?.pos,q=[w._pos[0],w._pos[1]],ce=[B.pos[0]+q[0]-G[0],B.pos[1]+q[1]-G[1]];R[B.id]=t$(B.type,{pos:ce})}for(const B of x){const G=R[B.origin_id],q=R[B.target_id];G&&q&&G.connect(B.origin_slot,q,B.target_slot)}}finally{tt.canvas.emitAfterChange()}};return ve.useEffect(()=>{const m=()=>{const w=tt.canvas.selected_nodes;Object.keys(w??{}).length?o({type:"SET_SELECTED_NODE",payload:Object.values(w)}):o({type:"SET_SELECTED_NODE",payload:null})};return document.addEventListener("click",m),()=>{document.removeEventListener("click",m)}},[]),E.jsx("div",{className:"rounded-lg bg-gray-500 p-3 text-gray-700 text-xs break-words overflow-visible",children:f.length>0&&E.jsx("div",{className:"space-y-3",children:E.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(m=>E.jsxs("div",{className:"relative group",children:[E.jsx("button",{className:`px-3 py-1.5 bg-blue-500 text-white rounded-md
|
||
hover:bg-blue-600 transition-colors text-xs`,onClick:()=>y(m),onMouseEnter:()=>u(m.name),onMouseLeave:()=>u(null),children:m.name}),E.jsxs("p",{className:"text-xs ml-3 text-white",children:["[",m.tags.join(", "),"]"]}),d===m.name&&E.jsx("div",{className:`fixed -translate-y-full
|
||
z-[9999] w-[500px] p-4 bg-gray-800 text-white text-xs
|
||
rounded-md shadow-lg mb-2 border border-gray-700`,style:{left:"calc(var(--mouse-x, 0) + 16px)",top:"calc(var(--mouse-y, 0) - 8px)"},children:E.jsx("div",{style:{width:"100%",height:"300px"},ref:w=>{w&&g(w,m)}})})]},m.name))})})})}const uce=Object.freeze(Object.defineProperty({__proto__:null,DownstreamSubgraphs:Kde},Symbol.toStringTag,{value:"Module"}));function Gde({content:i,onLoadSubgraph:e,onFinishLoad:t}){const s=(JSON.parse(i).ext?.find(o=>o.type==="node_install_guide")?.data||[]).reduce((o,a)=>(o.some(l=>l.name===a.name)||o.push(a),o),[]);return ve.useEffect(()=>{t?.()},[]),E.jsxs("div",{children:[E.jsx("p",{children:"Before loading the graph to canvas, the following nodes need to be installed. Please visit the corresponding GitHub repositories to install them:"}),E.jsx("div",{className:"grid grid-cols-2 gap-3",children:s.map((o,a)=>E.jsx("div",{className:`w-full p-3 rounded-lg border border-gray-200
|
||
hover:shadow-sm transition-all duration-200`,children:E.jsxs("div",{className:"flex flex-col",children:[E.jsx("h3",{className:"text-[12px] font-medium text-gray-800 mb-4",children:o.name}),E.jsx("div",{className:"flex justify-end",children:o.repository_url?E.jsxs("a",{href:o.repository_url,target:"_blank",rel:"noopener noreferrer",className:`px-2 py-1 text-gray-900 rounded-md
|
||
border border-gray-900 hover:bg-gray-100
|
||
transition-colors text-[10px] flex items-center gap-1`,children:[E.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:E.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download"]}):E.jsxs("a",{href:`https://www.google.com/search?q=${encodeURIComponent(o.name+" comfyui custom node")}`,target:"_blank",rel:"noopener noreferrer",className:`px-2 py-1 bg-gray-100 text-gray-500 rounded-md
|
||
border border-gray-300 text-[10px] flex items-center gap-1`,children:[E.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:E.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 21h7a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v11m0 5l4.879-4.879m0 0a3 3 0 104.243-4.242 3 3 0 00-4.243 4.242z"})}),"Search on Google"]})})]})},a))}),E.jsx("p",{className:"mt-4"}),E.jsx("p",{children:"After installation, please click the continue loading graph button to load the graph to the canvas:"}),E.jsx("div",{className:"mt-4",children:E.jsx("button",{className:`px-3 py-2 bg-blue-500 text-white rounded-md
|
||
hover:bg-blue-600 transition-colors text-xs block mx-auto`,onClick:e,children:"Loading graph directly"})})]})}const fce=Object.freeze(Object.defineProperty({__proto__:null,NodeInstallGuide:Gde},Symbol.toStringTag,{value:"Module"}));export{tce as A,e$ as B,Jde as C,uce as D,EO as M,rce as N,ece as U,Wr as W,tt as a,t$ as b,UT as c,fce as d,Zde as f,Jt as g,GT as u,Qde as v,Xde as w};
|