@linkurious/ogma-linkurious-parser 4.2.2 → 4.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +820 -916
- package/dist/index.mjs.map +1 -1
- package/dist/ogma/features/nodeGrouping.d.ts +2 -29
- package/dist/ogma/features/reactive.d.ts +2 -2
- package/dist/ogma/features/selectors.d.ts +2 -2
- package/dist/ogma/features/styles.d.ts +5 -3
- package/dist/ogma/index.d.ts +5 -5
- package/dist/tools/ogmaTool.d.ts +1 -0
- package/package.json +6 -5
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@linkurious/rest-client"),mr=require("@linkurious/ogma"),Sr=require("rxjs");var X=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Re(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Cr(){this.__data__=[],this.size=0}var Ar=Cr;function Er(r,e){return r===e||r!==r&&e!==e}var Ge=Er,xr=Ge;function Fr(r,e){for(var t=r.length;t--;)if(xr(r[t][0],e))return t;return-1}var le=Fr,Tr=le,$r=Array.prototype,Nr=$r.splice;function Dr(r){var e=this.__data__,t=Tr(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():Nr.call(e,t,1),--this.size,!0}var wr=Dr,Or=le;function Lr(r){var e=this.__data__,t=Or(e,r);return t<0?void 0:e[t][1]}var Ir=Lr,Pr=le;function Mr(r){return Pr(this.__data__,r)>-1}var Rr=Mr,Gr=le;function zr(r,e){var t=this.__data__,i=Gr(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}var Br=zr,jr=Ar,Ur=wr,Vr=Ir,kr=Rr,Hr=Br;function U(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}U.prototype.clear=jr;U.prototype.delete=Ur;U.prototype.get=Vr;U.prototype.has=kr;U.prototype.set=Hr;var ce=U,Kr=ce;function qr(){this.__data__=new Kr,this.size=0}var Yr=qr;function Wr(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var Jr=Wr;function Zr(r){return this.__data__.get(r)}var Xr=Zr;function Qr(r){return this.__data__.has(r)}var ei=Qr,ti=typeof X=="object"&&X&&X.Object===Object&&X,Bt=ti,ri=Bt,ii=typeof self=="object"&&self&&self.Object===Object&&self,ni=ri||ii||Function("return this")(),O=ni,si=O,ai=si.Symbol,W=ai,Ze=W,jt=Object.prototype,oi=jt.hasOwnProperty,ui=jt.toString,q=Ze?Ze.toStringTag:void 0;function li(r){var e=oi.call(r,q),t=r[q];try{r[q]=void 0;var i=!0}catch{}var n=ui.call(r);return i&&(e?r[q]=t:delete r[q]),n}var ci=li,di=Object.prototype,gi=di.toString;function hi(r){return gi.call(r)}var fi=hi,Xe=W,pi=ci,bi=fi,yi="[object Null]",vi="[object Undefined]",Qe=Xe?Xe.toStringTag:void 0;function _i(r){return r==null?r===void 0?vi:yi:Qe&&Qe in Object(r)?pi(r):bi(r)}var J=_i;function mi(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var de=mi,Si=J,Ci=de,Ai="[object AsyncFunction]",Ei="[object Function]",xi="[object GeneratorFunction]",Fi="[object Proxy]";function Ti(r){if(!Ci(r))return!1;var e=Si(r);return e==Ei||e==xi||e==Ai||e==Fi}var Ut=Ti,$i=O,Ni=$i["__core-js_shared__"],Di=Ni,_e=Di,et=function(){var r=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function wi(r){return!!et&&et in r}var Oi=wi,Li=Function.prototype,Ii=Li.toString;function Pi(r){if(r!=null){try{return Ii.call(r)}catch{}try{return r+""}catch{}}return""}var Vt=Pi,Mi=Ut,Ri=Oi,Gi=de,zi=Vt,Bi=/[\\^$.*+?()[\]{}|]/g,ji=/^\[object .+?Constructor\]$/,Ui=Function.prototype,Vi=Object.prototype,ki=Ui.toString,Hi=Vi.hasOwnProperty,Ki=RegExp("^"+ki.call(Hi).replace(Bi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qi(r){if(!Gi(r)||Ri(r))return!1;var e=Mi(r)?Ki:ji;return e.test(zi(r))}var Yi=qi;function Wi(r,e){return r==null?void 0:r[e]}var Ji=Wi,Zi=Yi,Xi=Ji;function Qi(r,e){var t=Xi(r,e);return Zi(t)?t:void 0}var R=Qi,en=R,tn=O,rn=en(tn,"Map"),ze=rn,nn=R,sn=nn(Object,"create"),ge=sn,tt=ge;function an(){this.__data__=tt?tt(null):{},this.size=0}var on=an;function un(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var ln=un,cn=ge,dn="__lodash_hash_undefined__",gn=Object.prototype,hn=gn.hasOwnProperty;function fn(r){var e=this.__data__;if(cn){var t=e[r];return t===dn?void 0:t}return hn.call(e,r)?e[r]:void 0}var pn=fn,bn=ge,yn=Object.prototype,vn=yn.hasOwnProperty;function _n(r){var e=this.__data__;return bn?e[r]!==void 0:vn.call(e,r)}var mn=_n,Sn=ge,Cn="__lodash_hash_undefined__";function An(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Sn&&e===void 0?Cn:e,this}var En=An,xn=on,Fn=ln,Tn=pn,$n=mn,Nn=En;function V(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}V.prototype.clear=xn;V.prototype.delete=Fn;V.prototype.get=Tn;V.prototype.has=$n;V.prototype.set=Nn;var Dn=V,rt=Dn,wn=ce,On=ze;function Ln(){this.size=0,this.__data__={hash:new rt,map:new(On||wn),string:new rt}}var In=Ln;function Pn(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var Mn=Pn,Rn=Mn;function Gn(r,e){var t=r.__data__;return Rn(e)?t[typeof e=="string"?"string":"hash"]:t.map}var he=Gn,zn=he;function Bn(r){var e=zn(this,r).delete(r);return this.size-=e?1:0,e}var jn=Bn,Un=he;function Vn(r){return Un(this,r).get(r)}var kn=Vn,Hn=he;function Kn(r){return Hn(this,r).has(r)}var qn=Kn,Yn=he;function Wn(r,e){var t=Yn(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}var Jn=Wn,Zn=In,Xn=jn,Qn=kn,es=qn,ts=Jn;function k(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}k.prototype.clear=Zn;k.prototype.delete=Xn;k.prototype.get=Qn;k.prototype.has=es;k.prototype.set=ts;var Be=k,rs=ce,is=ze,ns=Be,ss=200;function as(r,e){var t=this.__data__;if(t instanceof rs){var i=t.__data__;if(!is||i.length<ss-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new ns(i)}return t.set(r,e),this.size=t.size,this}var os=as,us=ce,ls=Yr,cs=Jr,ds=Xr,gs=ei,hs=os;function H(r){var e=this.__data__=new us(r);this.size=e.size}H.prototype.clear=ls;H.prototype.delete=cs;H.prototype.get=ds;H.prototype.has=gs;H.prototype.set=hs;var kt=H,fs="__lodash_hash_undefined__";function ps(r){return this.__data__.set(r,fs),this}var bs=ps;function ys(r){return this.__data__.has(r)}var vs=ys,_s=Be,ms=bs,Ss=vs;function re(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new _s;++e<t;)this.add(r[e])}re.prototype.add=re.prototype.push=ms;re.prototype.has=Ss;var Cs=re;function As(r,e){for(var t=-1,i=r==null?0:r.length;++t<i;)if(e(r[t],t,r))return!0;return!1}var Es=As;function xs(r,e){return r.has(e)}var Fs=xs,Ts=Cs,$s=Es,Ns=Fs,Ds=1,ws=2;function Os(r,e,t,i,n,s){var a=t&Ds,o=r.length,l=e.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(r),d=s.get(e);if(c&&d)return c==e&&d==r;var g=-1,h=!0,v=t&ws?new Ts:void 0;for(s.set(r,e),s.set(e,r);++g<o;){var S=r[g],b=e[g];if(i)var A=a?i(b,S,g,e,r,s):i(S,b,g,r,e,s);if(A!==void 0){if(A)continue;h=!1;break}if(v){if(!$s(e,function(E,x){if(!Ns(v,x)&&(S===E||n(S,E,t,i,s)))return v.push(x)})){h=!1;break}}else if(!(S===b||n(S,b,t,i,s))){h=!1;break}}return s.delete(r),s.delete(e),h}var Ht=Os,Ls=O,Is=Ls.Uint8Array,Ps=Is;function Ms(r){var e=-1,t=Array(r.size);return r.forEach(function(i,n){t[++e]=[n,i]}),t}var Rs=Ms;function Gs(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var zs=Gs,it=W,nt=Ps,Bs=Ge,js=Ht,Us=Rs,Vs=zs,ks=1,Hs=2,Ks="[object Boolean]",qs="[object Date]",Ys="[object Error]",Ws="[object Map]",Js="[object Number]",Zs="[object RegExp]",Xs="[object Set]",Qs="[object String]",ea="[object Symbol]",ta="[object ArrayBuffer]",ra="[object DataView]",st=it?it.prototype:void 0,me=st?st.valueOf:void 0;function ia(r,e,t,i,n,s,a){switch(t){case ra:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case ta:return!(r.byteLength!=e.byteLength||!s(new nt(r),new nt(e)));case Ks:case qs:case Js:return Bs(+r,+e);case Ys:return r.name==e.name&&r.message==e.message;case Zs:case Qs:return r==e+"";case Ws:var o=Us;case Xs:var l=i&ks;if(o||(o=Vs),r.size!=e.size&&!l)return!1;var c=a.get(r);if(c)return c==e;i|=Hs,a.set(r,e);var d=js(o(r),o(e),i,n,s,a);return a.delete(r),d;case ea:if(me)return me.call(r)==me.call(e)}return!1}var na=ia;function sa(r,e){for(var t=-1,i=e.length,n=r.length;++t<i;)r[n+t]=e[t];return r}var Kt=sa,aa=Array.isArray,N=aa,oa=Kt,ua=N;function la(r,e,t){var i=e(r);return ua(r)?i:oa(i,t(r))}var ca=la;function da(r,e){for(var t=-1,i=r==null?0:r.length,n=0,s=[];++t<i;){var a=r[t];e(a,t,r)&&(s[n++]=a)}return s}var ga=da;function ha(){return[]}var fa=ha,pa=ga,ba=fa,ya=Object.prototype,va=ya.propertyIsEnumerable,at=Object.getOwnPropertySymbols,_a=at?function(r){return r==null?[]:(r=Object(r),pa(at(r),function(e){return va.call(r,e)}))}:ba,ma=_a;function Sa(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}var Ca=Sa;function Aa(r){return r!=null&&typeof r=="object"}var Z=Aa,Ea=J,xa=Z,Fa="[object Arguments]";function Ta(r){return xa(r)&&Ea(r)==Fa}var $a=Ta,ot=$a,Na=Z,qt=Object.prototype,Da=qt.hasOwnProperty,wa=qt.propertyIsEnumerable,Oa=ot(function(){return arguments}())?ot:function(r){return Na(r)&&Da.call(r,"callee")&&!wa.call(r,"callee")},je=Oa,ie={exports:{}};function La(){return!1}var Ia=La;ie.exports;(function(r,e){var t=O,i=Ia,n=e&&!e.nodeType&&e,s=n&&!0&&r&&!r.nodeType&&r,a=s&&s.exports===n,o=a?t.Buffer:void 0,l=o?o.isBuffer:void 0,c=l||i;r.exports=c})(ie,ie.exports);var Yt=ie.exports,Pa=9007199254740991,Ma=/^(?:0|[1-9]\d*)$/;function Ra(r,e){var t=typeof r;return e=e??Pa,!!e&&(t=="number"||t!="symbol"&&Ma.test(r))&&r>-1&&r%1==0&&r<e}var Ue=Ra,Ga=9007199254740991;function za(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Ga}var Ve=za,Ba=J,ja=Ve,Ua=Z,Va="[object Arguments]",ka="[object Array]",Ha="[object Boolean]",Ka="[object Date]",qa="[object Error]",Ya="[object Function]",Wa="[object Map]",Ja="[object Number]",Za="[object Object]",Xa="[object RegExp]",Qa="[object Set]",eo="[object String]",to="[object WeakMap]",ro="[object ArrayBuffer]",io="[object DataView]",no="[object Float32Array]",so="[object Float64Array]",ao="[object Int8Array]",oo="[object Int16Array]",uo="[object Int32Array]",lo="[object Uint8Array]",co="[object Uint8ClampedArray]",go="[object Uint16Array]",ho="[object Uint32Array]",y={};y[no]=y[so]=y[ao]=y[oo]=y[uo]=y[lo]=y[co]=y[go]=y[ho]=!0;y[Va]=y[ka]=y[ro]=y[Ha]=y[io]=y[Ka]=y[qa]=y[Ya]=y[Wa]=y[Ja]=y[Za]=y[Xa]=y[Qa]=y[eo]=y[to]=!1;function fo(r){return Ua(r)&&ja(r.length)&&!!y[Ba(r)]}var po=fo;function bo(r){return function(e){return r(e)}}var Wt=bo,ne={exports:{}};ne.exports;(function(r,e){var t=Bt,i=e&&!e.nodeType&&e,n=i&&!0&&r&&!r.nodeType&&r,s=n&&n.exports===i,a=s&&t.process,o=function(){try{var l=n&&n.require&&n.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();r.exports=o})(ne,ne.exports);var yo=ne.exports,vo=po,_o=Wt,ut=yo,lt=ut&&ut.isTypedArray,mo=lt?_o(lt):vo,Jt=mo,So=Ca,Co=je,Ao=N,Eo=Yt,xo=Ue,Fo=Jt,To=Object.prototype,$o=To.hasOwnProperty;function No(r,e){var t=Ao(r),i=!t&&Co(r),n=!t&&!i&&Eo(r),s=!t&&!i&&!n&&Fo(r),a=t||i||n||s,o=a?So(r.length,String):[],l=o.length;for(var c in r)(e||$o.call(r,c))&&!(a&&(c=="length"||n&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||xo(c,l)))&&o.push(c);return o}var Do=No,wo=Object.prototype;function Oo(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||wo;return r===t}var Lo=Oo;function Io(r,e){return function(t){return r(e(t))}}var Po=Io,Mo=Po,Ro=Mo(Object.keys,Object),Go=Ro,zo=Lo,Bo=Go,jo=Object.prototype,Uo=jo.hasOwnProperty;function Vo(r){if(!zo(r))return Bo(r);var e=[];for(var t in Object(r))Uo.call(r,t)&&t!="constructor"&&e.push(t);return e}var ko=Vo,Ho=Ut,Ko=Ve;function qo(r){return r!=null&&Ko(r.length)&&!Ho(r)}var fe=qo,Yo=Do,Wo=ko,Jo=fe;function Zo(r){return Jo(r)?Yo(r):Wo(r)}var ke=Zo,Xo=ca,Qo=ma,eu=ke;function tu(r){return Xo(r,eu,Qo)}var ru=tu,ct=ru,iu=1,nu=Object.prototype,su=nu.hasOwnProperty;function au(r,e,t,i,n,s){var a=t&iu,o=ct(r),l=o.length,c=ct(e),d=c.length;if(l!=d&&!a)return!1;for(var g=l;g--;){var h=o[g];if(!(a?h in e:su.call(e,h)))return!1}var v=s.get(r),S=s.get(e);if(v&&S)return v==e&&S==r;var b=!0;s.set(r,e),s.set(e,r);for(var A=a;++g<l;){h=o[g];var E=r[h],x=e[h];if(i)var G=a?i(x,E,h,e,r,s):i(E,x,h,r,e,s);if(!(G===void 0?E===x||n(E,x,t,i,s):G)){b=!1;break}A||(A=h=="constructor")}if(b&&!A){var _=r.constructor,L=e.constructor;_!=L&&"constructor"in r&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof L=="function"&&L instanceof L)&&(b=!1)}return s.delete(r),s.delete(e),b}var ou=au,uu=R,lu=O,cu=uu(lu,"DataView"),du=cu,gu=R,hu=O,fu=gu(hu,"Promise"),pu=fu,bu=R,yu=O,vu=bu(yu,"Set"),_u=vu,mu=R,Su=O,Cu=mu(Su,"WeakMap"),Au=Cu,xe=du,Fe=ze,Te=pu,$e=_u,Ne=Au,Zt=J,K=Vt,dt="[object Map]",Eu="[object Object]",gt="[object Promise]",ht="[object Set]",ft="[object WeakMap]",pt="[object DataView]",xu=K(xe),Fu=K(Fe),Tu=K(Te),$u=K($e),Nu=K(Ne),I=Zt;(xe&&I(new xe(new ArrayBuffer(1)))!=pt||Fe&&I(new Fe)!=dt||Te&&I(Te.resolve())!=gt||$e&&I(new $e)!=ht||Ne&&I(new Ne)!=ft)&&(I=function(r){var e=Zt(r),t=e==Eu?r.constructor:void 0,i=t?K(t):"";if(i)switch(i){case xu:return pt;case Fu:return dt;case Tu:return gt;case $u:return ht;case Nu:return ft}return e});var Du=I,Se=kt,wu=Ht,Ou=na,Lu=ou,bt=Du,yt=N,vt=Yt,Iu=Jt,Pu=1,_t="[object Arguments]",mt="[object Array]",Q="[object Object]",Mu=Object.prototype,St=Mu.hasOwnProperty;function Ru(r,e,t,i,n,s){var a=yt(r),o=yt(e),l=a?mt:bt(r),c=o?mt:bt(e);l=l==_t?Q:l,c=c==_t?Q:c;var d=l==Q,g=c==Q,h=l==c;if(h&&vt(r)){if(!vt(e))return!1;a=!0,d=!1}if(h&&!d)return s||(s=new Se),a||Iu(r)?wu(r,e,t,i,n,s):Ou(r,e,l,t,i,n,s);if(!(t&Pu)){var v=d&&St.call(r,"__wrapped__"),S=g&&St.call(e,"__wrapped__");if(v||S){var b=v?r.value():r,A=S?e.value():e;return s||(s=new Se),n(b,A,t,i,s)}}return h?(s||(s=new Se),Lu(r,e,t,i,n,s)):!1}var Gu=Ru,zu=Gu,Ct=Z;function Xt(r,e,t,i,n){return r===e?!0:r==null||e==null||!Ct(r)&&!Ct(e)?r!==r&&e!==e:zu(r,e,t,i,Xt,n)}var He=Xt,Bu=He;function ju(r,e){return Bu(r,e)}var Uu=ju;const Vu=Re(Uu);var At=W,ku=je,Hu=N,Et=At?At.isConcatSpreadable:void 0;function Ku(r){return Hu(r)||ku(r)||!!(Et&&r&&r[Et])}var qu=Ku,Yu=Kt,Wu=qu;function Qt(r,e,t,i,n){var s=-1,a=r.length;for(t||(t=Wu),n||(n=[]);++s<a;){var o=r[s];e>0&&t(o)?e>1?Qt(o,e-1,t,i,n):Yu(n,o):i||(n[n.length]=o)}return n}var Ju=Qt;function Zu(r,e){for(var t=-1,i=r==null?0:r.length,n=Array(i);++t<i;)n[t]=e(r[t],t,r);return n}var er=Zu,Xu=J,Qu=Z,el="[object Symbol]";function tl(r){return typeof r=="symbol"||Qu(r)&&Xu(r)==el}var pe=tl,rl=N,il=pe,nl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sl=/^\w*$/;function al(r,e){if(rl(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||il(r)?!0:sl.test(r)||!nl.test(r)||e!=null&&r in Object(e)}var Ke=al,tr=Be,ol="Expected a function";function qe(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(ol);var t=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=t.cache;if(s.has(n))return s.get(n);var a=r.apply(this,i);return t.cache=s.set(n,a)||s,a};return t.cache=new(qe.Cache||tr),t}qe.Cache=tr;var ul=qe,ll=ul,cl=500;function dl(r){var e=ll(r,function(i){return t.size===cl&&t.clear(),i}),t=e.cache;return e}var gl=dl,hl=gl,fl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pl=/\\(\\)?/g,bl=hl(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(fl,function(t,i,n,s){e.push(n?s.replace(pl,"$1"):i||t)}),e}),yl=bl,xt=W,vl=er,_l=N,ml=pe,Sl=1/0,Ft=xt?xt.prototype:void 0,Tt=Ft?Ft.toString:void 0;function rr(r){if(typeof r=="string")return r;if(_l(r))return vl(r,rr)+"";if(ml(r))return Tt?Tt.call(r):"";var e=r+"";return e=="0"&&1/r==-Sl?"-0":e}var Cl=rr,Al=Cl;function El(r){return r==null?"":Al(r)}var xl=El,Fl=N,Tl=Ke,$l=yl,Nl=xl;function Dl(r,e){return Fl(r)?r:Tl(r,e)?[r]:$l(Nl(r))}var ir=Dl,wl=pe,Ol=1/0;function Ll(r){if(typeof r=="string"||wl(r))return r;var e=r+"";return e=="0"&&1/r==-Ol?"-0":e}var be=Ll,Il=ir,Pl=be;function Ml(r,e){e=Il(e,r);for(var t=0,i=e.length;r!=null&&t<i;)r=r[Pl(e[t++])];return t&&t==i?r:void 0}var Ye=Ml,Rl=kt,Gl=He,zl=1,Bl=2;function jl(r,e,t,i){var n=t.length,s=n,a=!i;if(r==null)return!s;for(r=Object(r);n--;){var o=t[n];if(a&&o[2]?o[1]!==r[o[0]]:!(o[0]in r))return!1}for(;++n<s;){o=t[n];var l=o[0],c=r[l],d=o[1];if(a&&o[2]){if(c===void 0&&!(l in r))return!1}else{var g=new Rl;if(i)var h=i(c,d,l,r,e,g);if(!(h===void 0?Gl(d,c,zl|Bl,i,g):h))return!1}}return!0}var Ul=jl,Vl=de;function kl(r){return r===r&&!Vl(r)}var nr=kl,Hl=nr,Kl=ke;function ql(r){for(var e=Kl(r),t=e.length;t--;){var i=e[t],n=r[i];e[t]=[i,n,Hl(n)]}return e}var Yl=ql;function Wl(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var sr=Wl,Jl=Ul,Zl=Yl,Xl=sr;function Ql(r){var e=Zl(r);return e.length==1&&e[0][2]?Xl(e[0][0],e[0][1]):function(t){return t===r||Jl(t,r,e)}}var ec=Ql,tc=Ye;function rc(r,e,t){var i=r==null?void 0:tc(r,e);return i===void 0?t:i}var ic=rc;function nc(r,e){return r!=null&&e in Object(r)}var sc=nc,ac=ir,oc=je,uc=N,lc=Ue,cc=Ve,dc=be;function gc(r,e,t){e=ac(e,r);for(var i=-1,n=e.length,s=!1;++i<n;){var a=dc(e[i]);if(!(s=r!=null&&t(r,a)))break;r=r[a]}return s||++i!=n?s:(n=r==null?0:r.length,!!n&&cc(n)&&lc(a,n)&&(uc(r)||oc(r)))}var hc=gc,fc=sc,pc=hc;function bc(r,e){return r!=null&&pc(r,e,fc)}var yc=bc,vc=He,_c=ic,mc=yc,Sc=Ke,Cc=nr,Ac=sr,Ec=be,xc=1,Fc=2;function Tc(r,e){return Sc(r)&&Cc(e)?Ac(Ec(r),e):function(t){var i=_c(t,r);return i===void 0&&i===e?mc(t,r):vc(e,i,xc|Fc)}}var $c=Tc;function Nc(r){return r}var ye=Nc;function Dc(r){return function(e){return e==null?void 0:e[r]}}var wc=Dc,Oc=Ye;function Lc(r){return function(e){return Oc(e,r)}}var Ic=Lc,Pc=wc,Mc=Ic,Rc=Ke,Gc=be;function zc(r){return Rc(r)?Pc(Gc(r)):Mc(r)}var Bc=zc,jc=ec,Uc=$c,Vc=ye,kc=N,Hc=Bc;function Kc(r){return typeof r=="function"?r:r==null?Vc:typeof r=="object"?kc(r)?Uc(r[0],r[1]):jc(r):Hc(r)}var qc=Kc;function Yc(r){return function(e,t,i){for(var n=-1,s=Object(e),a=i(e),o=a.length;o--;){var l=a[r?o:++n];if(t(s[l],l,s)===!1)break}return e}}var Wc=Yc,Jc=Wc,Zc=Jc(),Xc=Zc,Qc=Xc,ed=ke;function td(r,e){return r&&Qc(r,e,ed)}var rd=td,id=fe;function nd(r,e){return function(t,i){if(t==null)return t;if(!id(t))return r(t,i);for(var n=t.length,s=e?n:-1,a=Object(t);(e?s--:++s<n)&&i(a[s],s,a)!==!1;);return t}}var sd=nd,ad=rd,od=sd,ud=od(ad),ld=ud,cd=ld,dd=fe;function gd(r,e){var t=-1,i=dd(r)?Array(r.length):[];return cd(r,function(n,s,a){i[++t]=e(n,s,a)}),i}var hd=gd;function fd(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pd=fd,$t=pe;function bd(r,e){if(r!==e){var t=r!==void 0,i=r===null,n=r===r,s=$t(r),a=e!==void 0,o=e===null,l=e===e,c=$t(e);if(!o&&!c&&!s&&r>e||s&&a&&l&&!o&&!c||i&&a&&l||!t&&l||!n)return 1;if(!i&&!s&&!c&&r<e||c&&t&&n&&!i&&!s||o&&t&&n||!a&&n||!l)return-1}return 0}var yd=bd,vd=yd;function _d(r,e,t){for(var i=-1,n=r.criteria,s=e.criteria,a=n.length,o=t.length;++i<a;){var l=vd(n[i],s[i]);if(l){if(i>=o)return l;var c=t[i];return l*(c=="desc"?-1:1)}}return r.index-e.index}var md=_d,Ce=er,Sd=Ye,Cd=qc,Ad=hd,Ed=pd,xd=Wt,Fd=md,Td=ye,$d=N;function Nd(r,e,t){e.length?e=Ce(e,function(s){return $d(s)?function(a){return Sd(a,s.length===1?s[0]:s)}:s}):e=[Td];var i=-1;e=Ce(e,xd(Cd));var n=Ad(r,function(s,a,o){var l=Ce(e,function(c){return c(s)});return{criteria:l,index:++i,value:s}});return Ed(n,function(s,a){return Fd(s,a,t)})}var Dd=Nd;function wd(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}var Od=wd,Ld=Od,Nt=Math.max;function Id(r,e,t){return e=Nt(e===void 0?r.length-1:e,0),function(){for(var i=arguments,n=-1,s=Nt(i.length-e,0),a=Array(s);++n<s;)a[n]=i[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=i[n];return o[e]=t(a),Ld(r,this,o)}}var Pd=Id;function Md(r){return function(){return r}}var Rd=Md,Gd=R,zd=function(){try{var r=Gd(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Bd=zd,jd=Rd,Dt=Bd,Ud=ye,Vd=Dt?function(r,e){return Dt(r,"toString",{configurable:!0,enumerable:!1,value:jd(e),writable:!0})}:Ud,kd=Vd,Hd=800,Kd=16,qd=Date.now;function Yd(r){var e=0,t=0;return function(){var i=qd(),n=Kd-(i-t);if(t=i,n>0){if(++e>=Hd)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var Wd=Yd,Jd=kd,Zd=Wd,Xd=Zd(Jd),Qd=Xd,eg=ye,tg=Pd,rg=Qd;function ig(r,e){return rg(tg(r,e,eg),r+"")}var ng=ig,sg=Ge,ag=fe,og=Ue,ug=de;function lg(r,e,t){if(!ug(t))return!1;var i=typeof e;return(i=="number"?ag(t)&&og(e,t.length):i=="string"&&e in t)?sg(t[e],r):!1}var cg=lg,dg=Ju,gg=Dd,hg=ng,wt=cg,fg=hg(function(r,e){if(r==null)return[];var t=e.length;return t>1&&wt(r,e[0],e[1])?e=[]:t>2&&wt(e[0],e[1],e[2])&&(e=[e[0]]),gg(r,dg(e,1),[])}),pg=fg;const z=Re(pg),bg=/\S+\.(gif|jpe?g|tiff|png|bmp|svg)$/i,yg=["label","Label","name","Name","title","Title","rdfs:label"];class u{static isEqual(e,t){return Vu(e,t)}static isDefined(e){return e!=null}static truncate(e,t,i=0){const n="…";if(!u.isDefined(e))return"";const s=`${e}`;if(s.length<=i+1)return s;const a=i-1;switch(t){case"middle":return s.substring(0,Math.ceil(a/2))+n+s.substring(s.length-Math.floor(a/2));case"end":return s.substring(0,a)+n}}static getIn(e,t){return t.reduce((i,n)=>i&&i[n]!==void 0?i[n]:void 0,e)}static clone(e){return typeof e=="object"?JSON.parse(JSON.stringify(e,(t,i)=>i instanceof Set?{}:i)):e}static getHiddenNeighbors(e){return e.reduce((t,i)=>{const n=i.getData("statistics");if(n!==void 0){const s=n.degree!==void 0&&!n.supernode?n.degree-u.getDegreeWithoutSelfConnection(i):n.supernodeDegree;if(s!==void 0&&s>0)return t+=s}return t},0)}static getDegreeWithoutSelfConnection(e){return e.getAdjacentNodes({policy:"exclude-sources",filter:"raw"}).size}static formatNumber(e){let t=1,i="";const n=e<0?"-":"";e=Math.abs(e),e>=1e6?(t=1e6,i="M"):e>=1e3&&(t=1e3,i="k");const s=e/t;return s<10&&s%1!==0?n+s.toFixed(1)+i:n+Math.floor(s)+i}static isStringFilled(e){return e.trim()!==""}static getValueFromLkProperty(e){if(typeof e=="object"&&"type"in e){if(!("original"in e)&&!("value"in e))return null;if("original"in e)return`${e.original}`;if("value"in e)return u.formatDate(new Date(new Date(e.value).getTime()+u.timezoneToMilliseconds(e.timezone)).toISOString())}return e}static formatDate(e,t,i){let n=e;i!==void 0&&(n=new Date(e).getTime()+i*1e3);const s=new Date(n);if(isNaN(s.getUTCFullYear()))return null;let a=s.getFullYear()+"-"+((s.getUTCMonth()+1).toString().length===1?"0"+(s.getUTCMonth()+1):s.getUTCMonth()+1)+"-"+(s.getUTCDate().toString().length===1?"0"+s.getUTCDate():s.getUTCDate());return t&&(a+=" "+(s.getUTCHours().toString().length===1?"0"+s.getUTCHours():s.getUTCHours())+":"+(s.getUTCMinutes().toString().length===1?"0"+s.getUTCMinutes():s.getUTCMinutes())+":"+(s.getUTCSeconds().toString().length===1?"0"+s.getUTCSeconds():s.getUTCSeconds())),a}static timezoneToMilliseconds(e){if(e===void 0||e==="Z")return 0;const t=e[0],[i,n]=e.slice(1).split(":");return t==="+"?this.sanitizeFormattedNumber(i)*36e5+this.sanitizeFormattedNumber(n)*6e4:(this.sanitizeFormattedNumber(i)*36e5+this.sanitizeFormattedNumber(n)*6e4)*-1}static sanitizeFormattedNumber(e){return e.length===2&&e.startsWith("0")?u.parseNumber(e[1]):u.parseNumber(e)}static parseNumber(e){if(typeof e=="string"){if(e.trim()==="")return Number.NaN;e=+e.replace(",",".").replace(" ","")}return typeof e!="number"||!isFinite(e)?Number.NaN:e}static uniqBy(e,t){const i=new Set;if(t){const n=[];for(let s=0;s<e.length;++s)e[s]&&e[s][t]&&!i.has(e[s][t])?(i.add(e[s][t]),n.push(e[s])):e[s][t]||n.push(e[s]);return n}return typeof e[0]=="object"?Array.from(new Set(e.map(n=>JSON.stringify(n)))).map(n=>JSON.parse(n)):Array.from(new Set(e))}static getType(e){if(u.isURLImage(e))return"imageUrl";if(u.isImage(e))return"image";if(u.isUrl(e))return"url"}static isUrl(e){try{return new URL(e),!0}catch{return!1}}static isImage(e){return bg.test(e)}static isURLImage(e){if(u.isUrl(e)){const t=new URL(e);return u.isImage(t.pathname)}return!1}static valueExists(e){return u.isDefined(e)&&(typeof e!="string"||u.isStringFilled(e))}static isNumber(e){return e=u.parseNumber(e),u.isDefined(e)&&e===e}static getPropertyValue(e,t,i){if(typeof e=="object"&&!Array.isArray(e)){if("status"in e)return t&&"original"in e?e.original:void 0;if((e.type==="date"||e.type==="datetime")&&i)return u.formatDate(e.value,e.type==="datetime");if(e.type==="date"||e.type==="datetime")return new Date(e.value).getTime()}return e}static parseFloat(e){return u.parseNumber(e)}static formatCurrencyValue(e,t){const i=e<0?"- ":"";switch(t.format){case f.CurrencyFormat.SYMBOL_COMMAS_DOT:return`${i}${t.symbol!==void 0?t.symbol+" ":""}${u.formatNumberToCurrency(e,",",".")}`;case f.CurrencyFormat.SYMBOL_COMMAS:return`${i}${t.symbol!==void 0?t.symbol+" ":""}${u.formatNumberToCurrency(e,",")}`;case f.CurrencyFormat.DOTS_COMMA_SYMBOL:return`${i}${u.formatNumberToCurrency(e,".",",")}${t.symbol!==void 0?" "+t.symbol:""}`;case f.CurrencyFormat.DOTS_SYMBOL:return`${i}${u.formatNumberToCurrency(e,".")}${t.symbol!==void 0?" "+t.symbol:""}`;case f.CurrencyFormat.SPACES_COMMA_SYMBOL:return`${i}${u.formatNumberToCurrency(e," ",",")}${t.symbol!==void 0?" "+t.symbol:""}`;case f.CurrencyFormat.SPACES_SYMBOL:return`${i}${u.formatNumberToCurrency(e," ")}${t.symbol!==void 0?" "+t.symbol:""}`;default:throw Error(`Cannot format property value ${e}, unknown format ${t.format}.`)}}static formatNumberToCurrency(e,t,i){if(!Number.isFinite(e))return e.toString();const[n,s]=i?Math.abs(e).toFixed(2).split("."):[Math.abs(e).toFixed(0),void 0];let a=-1;const o=n.split("").reverse().map(l=>(a++,a>0&&a%3===0?l+t:l)).reverse().join("");return i?o+i+s:o}}class ${static getText(e,t,i){const n="categories"in e?e.categories:[e.type];if($.captionExist(n,t))return"categories"in e?$.generateNodeCaption(e,t,i)||null:$.generateEdgeCaption(e,t,i)||null;if(e.properties!==void 0){const s=yg.find(a=>e.properties[a]!==void 0);if(s!==void 0&&u.isDefined(e.properties[s]))return`${u.getValueFromLkProperty(e.properties[s])}`.trim()}return null}static getLabel(e,t){if(typeof e=="object"&&"type"in e){if(!("original"in e)&&!("value"in e))return null;if("original"in e)return`${e.original}`;if("value"in e)return u.formatDate(new Date(new Date(e.value).getTime()+u.timezoneToMilliseconds(e.timezone)).toISOString())}else if((t==null?void 0:t.name)===f.PropertyTypeName.NUMBER&&t.options!==void 0)return u.formatCurrencyValue(e,t.options);return`${e}`.trim()}static captionExist(e,t){return e.some(i=>u.isDefined(t[i]))}static generateNodeCaption(e,t,i){const n=e.categories,s=[];let a=[];return n.forEach(o=>{t[o]&&t[o].active&&(t[o].displayName&&s.push(o),a=[...a,...t[o].properties])}),u.uniqBy(a).forEach(o=>{if(e.properties[o]!==void 0){const l=i?$.getPropertyType(i,o,n[0]):void 0;s.push(this.getLabel(e.properties[o],l))}}),s.filter(o=>o!==null).join(" - ").trim()}static getPropertyType(e,t,i){const n=e.find(a=>a.itemType===i),s=n==null?void 0:n.properties.find(a=>a.propertyKey===t);return s==null?void 0:s.propertyType}static generateEdgeCaption(e,t,i){const n=e.type,s=[];let a=[];return t[n]&&t[n].active?(t[n].displayName&&s.push(n),a=[...a,...t[n].properties],u.uniqBy(a).forEach(o=>{if(u.isDefined(e.properties[o])){const l=i?$.getPropertyType(i,o,n):void 0;s.push($.getLabel(e.properties[o],l))}}),s.join(" - ").trim()):""}}var ar={exports:{}},or={exports:{}};(function(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(t,i){return t<<i|t>>>32-i},rotr:function(t,i){return t<<32-i|t>>>i},endian:function(t){if(t.constructor==Number)return e.rotl(t,8)&16711935|e.rotl(t,24)&4278255360;for(var i=0;i<t.length;i++)t[i]=e.endian(t[i]);return t},randomBytes:function(t){for(var i=[];t>0;t--)i.push(Math.floor(Math.random()*256));return i},bytesToWords:function(t){for(var i=[],n=0,s=0;n<t.length;n++,s+=8)i[s>>>5]|=t[n]<<24-s%32;return i},wordsToBytes:function(t){for(var i=[],n=0;n<t.length*32;n+=8)i.push(t[n>>>5]>>>24-n%32&255);return i},bytesToHex:function(t){for(var i=[],n=0;n<t.length;n++)i.push((t[n]>>>4).toString(16)),i.push((t[n]&15).toString(16));return i.join("")},hexToBytes:function(t){for(var i=[],n=0;n<t.length;n+=2)i.push(parseInt(t.substr(n,2),16));return i},bytesToBase64:function(t){for(var i=[],n=0;n<t.length;n+=3)for(var s=t[n]<<16|t[n+1]<<8|t[n+2],a=0;a<4;a++)n*8+a*6<=t.length*8?i.push(r.charAt(s>>>6*(3-a)&63)):i.push("=");return i.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/ig,"");for(var i=[],n=0,s=0;n<t.length;s=++n%4)s!=0&&i.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*s+8)-1)<<s*2|r.indexOf(t.charAt(n))>>>6-s*2);return i}};or.exports=e})();var vg=or.exports,De={utf8:{stringToBytes:function(r){return De.bin.stringToBytes(unescape(encodeURIComponent(r)))},bytesToString:function(r){return decodeURIComponent(escape(De.bin.bytesToString(r)))}},bin:{stringToBytes:function(r){for(var e=[],t=0;t<r.length;t++)e.push(r.charCodeAt(t)&255);return e},bytesToString:function(r){for(var e=[],t=0;t<r.length;t++)e.push(String.fromCharCode(r[t]));return e.join("")}}},Ot=De;(function(){var r=vg,e=Ot.utf8,t=Ot.bin,i=function(s){s.constructor==String?s=e.stringToBytes(s):typeof Buffer<"u"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(s)?s=Array.prototype.slice.call(s,0):Array.isArray(s)||(s=s.toString());var a=r.bytesToWords(s),o=s.length*8,l=[],c=1732584193,d=-271733879,g=-1732584194,h=271733878,v=-1009589776;a[o>>5]|=128<<24-o%32,a[(o+64>>>9<<4)+15]=o;for(var S=0;S<a.length;S+=16){for(var b=c,A=d,E=g,x=h,G=v,_=0;_<80;_++){if(_<16)l[_]=a[S+_];else{var L=l[_-3]^l[_-8]^l[_-14]^l[_-16];l[_]=L<<1|L>>>31}var _r=(c<<5|c>>>27)+v+(l[_]>>>0)+(_<20?(d&g|~d&h)+1518500249:_<40?(d^g^h)+1859775393:_<60?(d&g|d&h|g&h)-1894007588:(d^g^h)-899497514);v=h,h=g,g=d<<30|d>>>2,d=c,c=_r}c+=b,d+=A,g+=E,h+=x,v+=G}return[c,d,g,h,v]},n=function(s,a){var o=r.wordsToBytes(i(s));return a&&a.asBytes?o:a&&a.asString?t.bytesToString(o):r.bytesToHex(o)};n._blocksize=16,n._digestsize=20,ar.exports=n})();var _g=ar.exports;const se=Re(_g),T="#7f7f7f",we=["#9467bd","#e377c2","#1f77b4","#17becf","#2ca02c","#bcbd22","#d62728","#ff7f0e","#8c564b","#c5b0d5","#f7b6d2","#aec7e8","#9edae5","#98df8a","#dbdb8d","#ff9896","#ffbb78","#c49c94"];class F{constructor(e){this.colorsCache=new Map,this._rulesMap={},this.refresh(e)}refresh(e){e.color!==void 0&&(this.colorsCache=new Map),this._rulesMap={color:e.color?[...e.color].reverse():this._rulesMap.color,icon:e.icon?[...e.icon].reverse():this._rulesMap.icon,image:e.image?[...e.image].reverse():this._rulesMap.image,shape:e.shape?[...e.shape].reverse():this._rulesMap.shape,size:e.size?[...e.size].reverse():this._rulesMap.size,width:e.width?[...e.width].reverse():this._rulesMap.width}}static autoColor(e,t){return u.isDefined(e)?we[F.getRandomUniqueColorPaletteIndex(e,we.length,t)]:T}static getRandomUniqueColorPaletteIndex(e,t,i){return i&&(e=e.toLowerCase()),+("0x"+se(e).substr(-4))%t}static getTypeColor(e,t){return typeof e.style.color=="object"&&e.style.color.input[0]!=="properties"?F.autoColor(t,e.style.color.ignoreCase):!u.isDefined(e.input)&&typeof e.style.color!="object"?e.style.color:null}static getAutomaticRangeStyleLinear(e,{max:t,min:i},n,s){if(t!==void 0&&i!==void 0){if(t===i||isNaN(e))return"100%";const a=(s-n)/(t-i),o=(n*t-s*i)/(t-i);return`${Math.floor(e*a+o)}%`}}static getAutomaticRangeStyleLog(e,{max:t,min:i},n,s){if(i!==void 0&&t!==void 0){if(t===i||isNaN(e))return"100%";i<1&&(e+=Math.abs(i)+1,t+=Math.abs(i)+1,i+=Math.abs(i)+1);const a=(s-n)/(Math.log(t)-Math.log(i)),o=(n*Math.log(t)-s*Math.log(i))/(Math.log(t)-Math.log(i));return`${Math.floor(a*Math.log(e)+o)}%`}}isAutoRange(e){return typeof e=="object"&&(e==null?void 0:e.type)==="autoRange"}}class j extends F{constructor(e){super(e)}static matchStyle(e,t){if(t!==void 0){for(let i=0;i<e.length;++i)if(e[i].canApplyTo(t))return e[i]}}color(e){if(!u.isDefined(e))return T;let t;for(let i=0;i<this._rulesMap.color.length;++i){const n=this._rulesMap.color[i];if(n.canApplyTo(e)){if(typeof n.style.color=="string")t=n.style.color;else if(typeof n.style.color=="object"){const s=u.getIn(e,n.style.color.input);t=F.autoColor(`${s}`,n.style.color.ignoreCase)}break}}return u.isDefined(t)?t:T}shape(e){var t;if(this._rulesMap.shape!==void 0)return(t=j.matchStyle(this._rulesMap.shape,e))==null?void 0:t.style.shape}width(e){if(this._rulesMap.width!==void 0){const t=j.matchStyle(this._rulesMap.width,e);if(t!==void 0){const i=t==null?void 0:t.style.width;if(i!==void 0&&this.isAutoRange(i)){if(i.input!==void 0&&i.max!==void 0&&i.min!==void 0){const n=i.input[1],s=u.parseNumber(e.properties[n]),a=i.scale&&i.scale===f.AutoRangeScale.LOGARITHMIC;return j.getAutomaticRangeWidth(s,t,a)}}else return i}}}static getAutomaticRangeWidth(e,t,i=!1){return i?this.getAutomaticRangeStyleLog(e,t.style.width,50,200):this.getAutomaticRangeStyleLinear(e,t.style.width,50,200)}all(e){return u.isDefined(e)?{color:this.color(e),shape:this.shape(e),width:this.width(e)}:{color:T,shape:f.OgmaEdgeShape.ARROW,width:"100%"}}}class P extends F{constructor(e){super(e)}static matchStyle(e,t,i){if(u.isDefined(t)&&u.isDefined(e)){for(let n=0;n<e.length;++n)if(e[n].canApplyTo(t)){i(e[n]);break}}}color(e){if(!u.isDefined(e))return[T];const t=se(JSON.stringify(e)),i=this.colorsCache.get(t);if(i!==void 0)return i;let n=[];for(let a=0;a<e.categories.length;++a){let o=null;for(let l=0;l<this._rulesMap.color.length;++l){const c=this._rulesMap.color[l];if(!(c.itemType!==void 0&&c.itemType!==null&&c.itemType!==e.categories[a])&&c.canApplyTo(e)){if(typeof c.style.color=="object"){const d=u.getIn(e,c.style.color.input);Array.isArray(d)?o=F.autoColor(e.categories[a],c.style.color.ignoreCase):o=F.autoColor(`${d}`,c.style.color.ignoreCase)}else o=c.style.color;break}}n.push(o)}n=n.filter(a=>u.isDefined(a)),n.length===0&&(n=[T]);const s=n.length===1?n[0]:n;return this.colorsCache.set(t,s),s}icon(e){var a,o;const t=this.color(e),i=Array.isArray(t)?t[0]:t;let n={};const s=[...this._rulesMap.image||[],...this._rulesMap.icon||[]];if(!u.isDefined(e))return{icon:{},image:{}};for(let l=0;l<s.length;++l)if(s[l].canApplyTo(e)){const c=s[l].style;if("icon"in c&&typeof c.icon=="object")n={icon:{content:(a=c.icon)==null?void 0:a.content,font:(o=c.icon)==null?void 0:o.font,scale:.5,color:w.isBright(i)?"#000000":"#FFFFFF"}};else if("image"in c&&typeof c.image=="object"){const d=P.getImageUrlFromStyleRule(c.image.url,e,this._baseUrl);d!==void 0&&(n={image:{url:d,scale:c.image.scale,fit:c.image.fit,tile:c.image.tile,minVisibleSize:0}})}break}return n}shape(e){let t;return this._rulesMap.shape!==void 0&&P.matchStyle(this._rulesMap.shape,e,i=>{t=i.style.shape}),t}size(e){let t;return this._rulesMap.size!==void 0&&P.matchStyle(this._rulesMap.size,e,i=>{const n=i.style.size;if(this.isAutoRange(n)){if(n.input!==void 0&&n.max!==void 0&&n.min!==void 0){const s=n.input[1],a=u.parseNumber(e.properties[s]),o=n.scale&&n.scale===f.AutoRangeScale.LOGARITHMIC;t=P.getAutomaticRangeSize(a,i,o)}}else t=n}),t}static getAutomaticRangeSize(e,t,i=!1){return i?this.getAutomaticRangeStyleLog(e,t.style.size,50,500):this.getAutomaticRangeStyleLinear(e,t.style.size,50,500)}all(e){if(!u.isDefined(e))return{color:T};const t=this.icon(e);return{radius:this.size(e),color:this.color(e),shape:this.shape(e),icon:t.icon,image:t.image}}static getImageUrlFromStyleRule(e,t,i){let n;return typeof e=="string"&&["imageUrl","image"].includes(u.getType(e))?n=e:typeof e=="object"&&(n=u.getIn(t,e.path)),n!==void 0&&i!==void 0?new URL(n,i).href:n}setBaseUrl(e){this._baseUrl=e}}var ur=(r=>(r.AUTO_RANGE="autoRange",r))(ur||{});class C{constructor(e){this.type=e.type,this.input=e.input,this.index=e.index,this.itemType=e.itemType,this.style=e.style,this.value=e.value}static isAutomaticRange(e){return e.style!==void 0&&(e.style.width!==void 0&&e.style.width.type==="autoRange"||e.style.size!==void 0&&e.style.size.type==="autoRange")}get specificity(){return this.itemType!==void 0&&this.input!==void 0?4:this.itemType===void 0&&this.input!==void 0?3:this.itemType!==void 0&&this.input===void 0?2:1}matchValues(e,t,i){return u.isDefined(t)?(e===this.itemType||!u.isDefined(this.itemType))&&u.isEqual(["properties",...t],this.input)&&u.isEqual(i,this.value)||this.type==="any"&&!u.isDefined(this.input)&&typeof this.style.color=="object"&&this.style.color.input[1]===t[0]:u.isDefined(this.itemType)?e===this.itemType&&!u.isDefined(this.input):!u.isDefined(this.input)}static inputExists(e,t){return e!==f.SelectorType.ANY}canApplyTo(e){const t="categories"in e?e.categories:[e.type];let i=!1;switch(this.type){case f.SelectorType.ANY:i=C.checkAny(e,this.style);break;case f.SelectorType.NO_VALUE:C.inputExists(this.type,this.input)&&(i=C.checkNoValue(e,this.input));break;case f.SelectorType.NAN:C.inputExists(this.type,this.input)&&(i=C.checkNan(e,this.input));break;case f.SelectorType.RANGE:C.inputExists(this.type,this.input)&&(i=C.checkRange(u.getIn(e,this.input),this.value));break;case f.SelectorType.IS:C.inputExists(this.type,this.input)&&(i=C.checkIs(e,this.input,this.value));break}return i&&C.checkItemType(t,this.itemType)}static checkAny(e,t){return typeof t.color=="object"?u.isDefined(u.getIn(e,t.color.input)):!0}static checkNoValue(e,t){return!u.valueExists(u.getIn(e,t))}static checkNan(e,t){return!u.isNumber(u.getIn(e,t))}static checkRange(e,t){return(t["<="]===void 0||e<=t["<="])&&(t["<"]===void 0||e<t["<"])&&(t[">"]===void 0||e>t[">"])&&(t[">="]===void 0||e>=t[">="])}static checkIs(e,t,i){if(!u.isDefined(t))return!1;const n=u.getIn(e,t);let s=n;if(u.isDefined(n)&&typeof n=="object"&&(n.type==="date"||n.type==="datetime")){let a=n.timezone;n.timezone==="Z"&&(a="+00:00"),s=u.formatDate(n.value,n.type==="datetime",u.timezoneToMilliseconds(a)/1e3)}return u.isEqual(s,i)}static checkItemType(e,t){return C.matchCategory(e,t)||C.matchAny(t)}static matchCategory(e,t){return u.isDefined(t)&&(Array.isArray(e)?e.includes(t):u.isEqual(e,t))}static matchAny(e){return e===void 0}getTypeColor(e){let t;return C.checkItemType([e],this.itemType)&&this.type===f.SelectorType.ANY&&!u.isDefined(this.input)&&(t=F.getTypeColor(this,e)),t}}var D=(r=>(r.COLOR="color",r.ICON="icon",r.SIZE="size",r.IMAGE="image",r.SHAPE="shape",r.WIDTH="width",r))(D||{});const B=["specificity","itemType","index"];class p{constructor(e){this._rules=e}get color(){return z(p.getBy("color",this._rules),B)}get icon(){return z([...p.getBy("icon",this._rules)||[],...p.getBy("image",this._rules)||[]],B)}get image(){return z(p.getBy("image",this._rules),B)}get shape(){return z(p.getBy("shape",this._rules),B)}get size(){return z(p.getBy("size",this._rules),B)}get width(){return z(p.getBy("width",this._rules),B)}get nodeRules(){return{color:this.color,icon:this.icon,image:this.image,shape:this.shape,size:this.size}}get edgeRules(){return{color:this.color,shape:this.shape,width:this.width}}generateLegend(e){const t={};return e.length===0||("categories"in e[0]?Object.keys(this.nodeRules).forEach(i=>{t[i]=p.getLegendForStyle(i,this.nodeRules[i],e)}):Object.keys(this.edgeRules).forEach(i=>{t[i]=p.getLegendForStyle(i,this.edgeRules[i],e)})),t}static getLegendForStyle(e,t,i){const n=[],s=i.filter(a=>a);for(let a=0;a<t.length;a++){const o=new C(t[a]);if(s.some(c=>o.canApplyTo(c)))if(e==="color"&&typeof o.style.color=="object")p.addLegendAutoColors(s,o,n);else if(e==="icon"&&"image"in o.style){const c=u.isDefined(o.input)?`${p.getTypeLabel(o.itemType)}.${o.input[1]} ${p.sanitizeValue(o.type,o.value)}`:`${p.getTypeLabel(o.itemType)}`,d=o.style.image;if(!(d.url&&typeof d.url=="object"&&d.url.type==="data")){const g=o.style.image;p.updateLegend(n,{label:c,value:g})}}else{const c=u.isDefined(o.input)?`${p.getTypeLabel(o.itemType)}.${o.input[1]} ${p.sanitizeValue(o.type,o.value)}`:`${p.getTypeLabel(o.itemType)}`,d=o.style[e];p.updateLegend(n,{label:c,value:d})}}return n}static sanitizeValue(e,t){let i="";switch(e){case f.SelectorType.NO_VALUE:return"is undefined";case f.SelectorType.NAN:return"is not an number";case f.SelectorType.RANGE:return Object.keys(t).forEach((n,s)=>{s>0&&(i+=" and "),i+=`${n} ${t[n]}`}),i}return typeof t=="object"?`= ${JSON.stringify(t)}`:`= ${t}`}static addLegendAutoColors(e,t,i){const n=t.style.color,s=n.input[1];e.forEach(a=>{const o=u.getIn(a,n.input);if(Array.isArray(o))o.forEach(l=>{const c=n.input.includes("properties")?`${p.getTypeLabel(t.itemType)}.${s} = ${l}`:`${p.getTypeLabel(l)}`,d=F.autoColor(l,n.ignoreCase);p.updateLegend(i,{label:c,value:d})});else{const l=n.input.includes("properties")?`${p.getTypeLabel(t.itemType)}.${s} = ${o}`:`${p.getTypeLabel(o)}`,c=F.autoColor(o,n.ignoreCase);p.updateLegend(i,{label:l,value:c})}})}static getTypeLabel(e){return e===void 0?"All":e===null?"Others":e}getColorForType(e){const t=this.color.map(i=>i.getTypeColor(e)).filter(i=>u.isDefined(i));return t.length>0?t[t.length-1]:T}getIconForType(e){const t=this.icon.filter(i=>!u.isDefined(i.input)&&i.itemType===e).map(i=>{var n;return(n=i.style.icon)==null?void 0:n.content}).filter(i=>u.isDefined(i));return t.length>0?t[t.length-1]:void 0}static updateLegend(e,{label:t,value:i}){const n=e.map(s=>s.label).indexOf(t);n<0?e.push({label:t,value:i}):e[n]={label:t,value:i}}static getBy(e,t){return t.filter(i=>{switch(e){case"color":return i.style.color!==void 0;case"icon":return"icon"in i.style&&i.style.icon!==void 0;case"image":return"image"in i.style&&i.style.image!==void 0;case"shape":return i.style.shape!==void 0;case"size":return"size"in i.style&&i.style.size!==void 0;case"width":return"width"in i.style&&i.style.width!==void 0}}).map(i=>p.getRule(i,e))}static getRule(e,t){const i=u.clone(e);return i.style={[t]:i.style[t]},new C(i)}static sanitizeStylesIndex(e){const t=[],i=u.clone(e);let n=Math.max(...e.node.map(s=>s.index),...e.edge.map(s=>s.index))+1;return i.node=i.node.map(s=>(t.includes(s.index)?(s.index=n,n++):t.push(s.index),s)),i.edge=i.edge.map(s=>(t.includes(s.index)?(s.index=n,n++):t.push(s.index),s)),i}}const te={lightsalmon:{hex:"#FFA07A",rgb:"rbg(255,160,122)"},salmon:{hex:"#FA8072",rgb:"rgb(250,128,114)"},darksalmon:{hex:"#E9967A",rgb:"rgb(233,150,122)"},lightcoral:{hex:"#F08080",rgb:"rgb(240,128,128)"},indianred:{hex:"#CD5C5C",rgb:"rgb(205,92,92)"},crimson:{hex:"#DC143C",rgb:"rgb(220,20,60)"},firebrick:{hex:"#B22222",rgb:"rgb(178,34,34)"},red:{hex:"#FF0000",rgb:"rgb(255,0,0)"},darkred:{hex:"#8B0000",rgb:"rgb(139,0,0)"},coral:{hex:"#FF7F50",rgb:"rgb(255,127,80)"},tomato:{hex:"#FF6347",rgb:"rgb(255,99,71)"},orangered:{hex:"#FF4500",rgb:"rgb(255,69,0)"},gold:{hex:"#FFD700",rgb:"rgb(255,215,0)"},orange:{hex:"#FFA500",rgb:"rgb(255,165,0)"},darkorange:{hex:"#FF8C00",rgb:"rgb(255,140,0)"},lightyellow:{hex:"#FFFFE0",rgb:"rgb(255,255,224)"},lemonchiffon:{hex:"#FFFACD",rgb:"rgb(255,250,205)"},lightgoldenrodyellow:{hex:"#FAFAD2",rgb:"rgb(250,250,210)"},papayawhip:{hex:"#FFEFD5",rgb:"rgb(255,239,213)"},moccasin:{hex:"#FFE4B5",rgb:"rgb(255,228,181)"},peachpuff:{hex:"#FFDAB9",rgb:"rgb(255,218,185)"},palegoldenrod:{hex:"#EEE8AA",rgb:"rgb(238,232,170)"},khaki:{hex:"#F0E68C",rgb:"rgb(240,230,140)"},darkkhaki:{hex:"#BDB76B",rgb:"rgb(189,183,107)"},yellow:{hex:"#FFFF00",rgb:"rgb(255,255,0)"},lawngreen:{hex:"#7CFC00",rgb:"rgb(124,252,0)"},chartreuse:{hex:"#7FFF00",rgb:"rgb(127,255,0)"},limegreen:{hex:"#32CD32",rgb:"rgb(50,205,50)"},lime:{hex:"#00FF00",rgb:"rgb(0.255.0)"},forestgreen:{hex:"#228B22",rgb:"rgb(34,139,34)"},green:{hex:"#008000",rgb:"rgb(0,128,0)"},darkgreen:{hex:"#006400",rgb:"rgb(0,100,0)"},greenyellow:{hex:"#ADFF2F",rgb:"rgb(173,255,47)"},yellowgreen:{hex:"#9ACD32",rgb:"rgb(154,205,50)"},springgreen:{hex:"#00FF7F",rgb:"rgb(0,255,127)"},mediumspringgreen:{hex:"#00FA9A",rgb:"rgb(0,250,154)"},lightgreen:{hex:"#90EE90",rgb:"rgb(144,238,144)"},palegreen:{hex:"#98FB98",rgb:"rgb(152,251,152)"},darkseagreen:{hex:"#8FBC8F",rgb:"rgb(143,188,143)"},mediumseagreen:{hex:"#3CB371",rgb:"rgb(60,179,113)"},seagreen:{hex:"#2E8B57",rgb:"rgb(46,139,87)"},olive:{hex:"#808000",rgb:"rgb(128,128,0)"},darkolivegreen:{hex:"#556B2F",rgb:"rgb(85,107,47)"},olivedrab:{hex:"#6B8E23",rgb:"rgb(107,142,35)"},lightcyan:{hex:"#E0FFFF",rgb:"rgb(224,255,255)"},cyan:{hex:"#00FFFF",rgb:"rgb(0,255,255)"},aqua:{hex:"#00FFFF",rgb:"rgb(0,255,255)"},aquamarine:{hex:"#7FFFD4",rgb:"rgb(127,255,212)"},mediumaquamarine:{hex:"#66CDAA",rgb:"rgb(102,205,170)"},paleturquoise:{hex:"#AFEEEE",rgb:"rgb(175,238,238)"},turquoise:{hex:"#40E0D0",rgb:"rgb(64,224,208)"},mediumturquoise:{hex:"#48D1CC",rgb:"rgb(72,209,204)"},darkturquoise:{hex:"#00CED1",rgb:"rgb(0,206,209)"},lightseagreen:{hex:"#20B2AA",rgb:"rgb(32,178,170)"},cadetblue:{hex:"#5F9EA0",rgb:"rgb(95,158,160)"},darkcyan:{hex:"#008B8B",rgb:"rgb(0,139,139)"},teal:{hex:"#008080",rgb:"rgb(0,128,128)"},powderblue:{hex:"#B0E0E6",rgb:"rgb(176,224,230)"},lightblue:{hex:"#ADD8E6",rgb:"rgb(173,216,230)"},lightskyblue:{hex:"#87CEFA",rgb:"rgb(135,206,250)"},skyblue:{hex:"#87CEEB",rgb:"rgb(135,206,235)"},deepskyblue:{hex:"#00BFFF",rgb:"rgb(0,191,255)"},lightsteelblue:{hex:"#B0C4DE",rgb:"rgb(176,196,222)"},dodgerblue:{hex:"#1E90FF",rgb:"rgb(30,144,255)"},cornflowerblue:{hex:"#6495ED",rgb:"rgb(100,149,237)"},steelblue:{hex:"#4682B4",rgb:"rgb(70,130,180)"},royalblue:{hex:"#4169E1",rgb:"rgb(65,105,225)"},blue:{hex:"#0000FF",rgb:"rgb(0,0,255)"},mediumblue:{hex:"#0000CD",rgb:"rgb(0,0,205)"},darkblue:{hex:"#00008B",rgb:"rgb(0,0,139)"},navy:{hex:"#000080",rgb:"rgb(0,0,128)"},midnightblue:{hex:"#191970",rgb:"rgb(25,25,112)"},mediumslateblue:{hex:"#7B68EE",rgb:"rgb(123,104,238)"},slateblue:{hex:"#6A5ACD",rgb:"rgb(106,90,205)"},darkslateblue:{hex:"#483D8B",rgb:"rgb(72,61,139)"},lavender:{hex:"#E6E6FA",rgb:"rgb(230,230,250)"},thistle:{hex:"#D8BFD8",rgb:"rgb(216,191,216)"},plum:{hex:"#DDA0DD",rgb:"rgb(221,160,221)"},violet:{hex:"#EE82EE",rgb:"rgb(238,130,238)"},orchid:{hex:"#DA70D6",rgb:"rgb(218,112,214)"},fuchsia:{hex:"#FF00FF",rgb:"rgb(255,0,255)"},magenta:{hex:"#FF00FF",rgb:"rgb(255,0,255)"},mediumorchid:{hex:"#BA55D3",rgb:"rgb(186,85,211)"},mediumpurple:{hex:"#9370DB",rgb:"rgb(147,112,219)"},blueviolet:{hex:"#8A2BE2",rgb:"rgb(138,43,226)"},darkviolet:{hex:"#9400D3",rgb:"rgb(148,0,211)"},darkorchid:{hex:"#9932CC",rgb:"rgb(153,50,204)"},darkmagenta:{hex:"#8B008B",rgb:"rgb(139,0,139)"},purple:{hex:"#800080",rgb:"rgb(128,0,128)"},indigo:{hex:"#4B0082",rgb:"rgb(75,0,130)"},pink:{hex:"#FFC0CB",rgb:"rgb(255,192,203)"},lightpink:{hex:"#FFB6C1",rgb:"rgb(255,182,193)"},hotpink:{hex:"#FF69B4",rgb:"rgb(255,105,180)"},deeppink:{hex:"#FF1493",rgb:"rgb(255,20,147)"},palevioletred:{hex:"#DB7093",rgb:"rgb(219,112,147)"},mediumvioletred:{hex:"#C71585",rgb:"rgb(199,21,133)"},white:{hex:"#FFFFFF",rgb:"rgb(255,255,255)"},snow:{hex:"#FFFAFA",rgb:"rgb(255,250,250)"},honeydew:{hex:"#F0FFF0",rgb:"rgb(240,255,240)"},mintcream:{hex:"#F5FFFA",rgb:"rgb(245,255,250)"},azure:{hex:"#F0FFFF",rgb:"rgb(240,255,255)"},aliceblue:{hex:"#F0F8FF",rgb:"rgb(240,248,255)"},ghostwhite:{hex:"#F8F8FF",rgb:"rgb(248,248,255)"},whitesmoke:{hex:"#F5F5F5",rgb:"rgb(245,245,245)"},seashell:{hex:"#FFF5EE",rgb:"rgb(255,245,238)"},beige:{hex:"#F5F5DC",rgb:"rgb(245,245,220)"},oldlace:{hex:"#FDF5E6",rgb:"rgb(253,245,230)"},floralwhite:{hex:"#FFFAF0",rgb:"rgb(255,250,240)"},ivory:{hex:"#FFFFF0",rgb:"rgb(255,255,240)"},antiquewhite:{hex:"#FAEBD7",rgb:"rgb(250,235,215)"},linen:{hex:"#FAF0E6",rgb:"rgb(250,240,230)"},lavenderblush:{hex:"#FFF0F5",rgb:"rgb(255,240,245)"},mistyrose:{hex:"#FFE4E1",rgb:"rgb(255,228,225)"},gainsboro:{hex:"#DCDCDC",rgb:"rgb(220,220,220)"},lightgray:{hex:"#D3D3D3",rgb:"rgb(211,211,211)"},silver:{hex:"#C0C0C0",rgb:"rgb(192,192,192)"},darkgray:{hex:"#A9A9A9",rgb:"rgb(169,169,169)"},gray:{hex:"#808080",rgb:"rgb(128,128,128)"},dimgray:{hex:"#696969",rgb:"rgb(105,105,105)"},lightslategray:{hex:"#778899",rgb:"rgb(119,136,153)"},slategray:{hex:"#708090",rgb:"rgb(112,128,144)"},darkslategray:{hex:"#2F4F4F",rgb:"rgb(47,79,79)"},black:{hex:"#000000",rgb:"rgb(0,0,0)"},cornsilk:{hex:"#FFF8DC",rgb:"rgb(255,248,220)"},blanchedalmond:{hex:"#FFEBCD",rgb:"rgb(255,235,205)"},bisque:{hex:"#FFE4C4",rgb:"rgb(255,228,196)"},navajowhite:{hex:"#FFDEAD",rgb:"rgb(255,222,173)"},wheat:{hex:"#F5DEB3",rgb:"rgb(245,222,179)"},burlywood:{hex:"#DEB887",rgb:"rgb(222,184,135)"},tan:{hex:"#D2B48C",rgb:"rgb(210,180,140)"},rosybrown:{hex:"#BC8F8F",rgb:"rgb(188,143,143)"},sandybrown:{hex:"#F4A460",rgb:"rgb(244,164,96)"},goldenrod:{hex:"#DAA520",rgb:"rgb(218,165,32)"},peru:{hex:"#CD853F",rgb:"rgb(205,133,63)"},chocolate:{hex:"#D2691E",rgb:"rgb(210,105,30)"},saddlebrown:{hex:"#8B4513",rgb:"rgb(139,69,19)"},sienna:{hex:"#A0522D",rgb:"rgb(160,82,45)"},brown:{hex:"#A52A2A",rgb:"rgb(165,42,42)"},maroon:{hex:"#800000",rgb:"rgb(128,0,0)"}},ae="#3F3D5F",lr="'roboto', sans-serif",oe="#FFF",Oe=.2,Lt={text:{style:"bold",backgroundColor:"#fff",minVisibleSize:0},outerStroke:{width:2},outline:!1},It={text:{style:"bold",backgroundColor:"#fff",minVisibleSize:0},outline:!1},mg={color:"#FFF",width:7,scalingMethod:"scaled",strokeWidth:0,hideNonAdjacentEdges:!1},Sg={color:"#FFF",scalingMethod:"scaled",width:4},Pt="#7f7f7f";class cr{constructor(e,t){this._nodeAttributes=new P({}),this._edgeAttributes=new j({}),this._ogma=e,this._defaultConfiguration=t,this._nodeAttributes.setBaseUrl(t.baseUrl)}get nodeAttributes(){return this._nodeAttributes}get nodeFont(){var e,t;return(t=(e=this._defaultConfiguration.node)==null?void 0:e.text)==null?void 0:t.font}setNodesDefaultStyles(){this._ogma.styles.setHoveredNodeAttributes(Lt),this._ogma.styles.setSelectedNodeAttributes(Lt),this._nodeDefaultStylesRules=this._ogma.styles.addRule({nodeAttributes:{text:{padding:5,minVisibleSize:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.minVisibleSize?this._defaultConfiguration.node.text.minVisibleSize:12,maxLineLength:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.maxLineLength!==void 0?this._defaultConfiguration.node.text.maxLineLength:30,position:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.nodePosition!==void 0?this._defaultConfiguration.node.text.nodePosition:"bottom",backgroundColor:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.backgroundColor!==void 0?this._defaultConfiguration.node.text.backgroundColor:void 0,font:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.font!==void 0?this._defaultConfiguration.node.text.font:"'roboto', sans-serif",color:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.color!==void 0?this._defaultConfiguration.node.text.color:"black",size:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.size!==void 0?this._defaultConfiguration.node.text.size:14,margin:5},radius:this.defaultNodeRadius(this._defaultConfiguration.node),icon:{minVisibleSize:15},color:Pt,shape:this._defaultConfiguration.node.shape!==void 0?this._defaultConfiguration.node.shape:"circle",innerStroke:{width:3},outline:!1},nodeSelector:e=>!e.isVirtual()})}setEdgesDefaultStyles(){var e;this._ogma.styles.setHoveredEdgeAttributes(It),this._ogma.styles.setSelectedEdgeAttributes(It),this._edgeDefaultStylesRules=this._ogma.styles.addRule({edgeAttributes:{text:{minVisibleSize:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.minVisibleSize?this._defaultConfiguration.edge.text.minVisibleSize:3,maxLineLength:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.maxLineLength!==void 0?this._defaultConfiguration.edge.text.maxLineLength:30,backgroundColor:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.backgroundColor!==void 0?this._defaultConfiguration.edge.text.backgroundColor:void 0,font:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.font!==void 0?this._defaultConfiguration.edge.text.font:"'roboto', sans-serif",color:((e=this._defaultConfiguration.edge)==null?void 0:e.text)!==void 0&&this._defaultConfiguration.edge.text.color!==void 0?this._defaultConfiguration.edge.text.color:"black",size:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.size!==void 0?this._defaultConfiguration.edge.text.size:14},width:this.defaultEdgeWidth(this._defaultConfiguration.edge),shape:this._defaultConfiguration.edge.shape!==void 0?this._defaultConfiguration.edge.shape:"arrow",color:Pt}})}setNodesDefaultHalo(){this._nodeDefaultHaloRules=this._ogma.styles.addRule({nodeSelector:e=>e&&!e.hasClass("filtered")&&!e.isVirtual(),nodeAttributes:{halo:e=>e!==void 0&&!e.hasClass("filtered")&&(e.isSelected()||e.getAdjacentNodes({}).isSelected().includes(!0)||e.getAdjacentEdges().isSelected().includes(!0))?{...mg,scalingMethod:this._ogma.geo.enabled()?"fixed":"scaled"}:null},nodeDependencies:{self:{selection:!0},adjacentNodes:{selection:!0},adjacentEdges:{selection:!0}}})}setEdgesDefaultHalo(){this._edgeDefaultHaloRules=this._ogma.styles.addRule({edgeSelector:e=>e&&e.getSource()&&e.getTarget()&&!e.hasClass("filtered"),edgeAttributes:{halo:e=>e&&!e.hasClass("filtered")&&(e.isSelected()||e.getSource().isSelected()||e.getTarget().isSelected())?{...Sg,scalingMethod:this._ogma.geo.enabled()?"fixed":"scaled"}:null},edgeDependencies:{self:{selection:!0},extremities:{selection:!0}}})}defaultNodeRadius(e){return this.defaultStylesHas(e,["nodeRadius"])?e.nodeRadius:5}defaultEdgeWidth(e){return this.defaultStylesHas(e,["edgeWidth"])?e.edgeWidth:1}defaultStylesHas(e,t){return u.isDefined(e)?u.getIn(e,t)!==void 0:!1}setFilterClass(){this._ogma.styles.createClass({name:"filtered",nodeAttributes:{opacity:Oe,layer:e=>e.getMetaNode()!==null?1:-1,detectable:!1,badges:{topRight:{text:null},bottomRight:{text:null}},text:null,color:"rgb(240, 240, 240)",innerStroke:{width:1,color:T,minVisibleSize:1},shape:"circle",image:null,icon:null,radius:"50%"},edgeAttributes:{opacity:Oe,layer:e=>{const t=e.getExtremities().getMetaNode().some(i=>i!==null);return!e.isVirtual()&&t?1:-1},detectable:!1,text:null,color:T,shape:"line",width:.2}})}setExportClass(e){this._exportClass?this._exportClass.update({nodeAttributes:{text:{maxLineLength:e?30:0},halo:null}}):this._exportClass=this._ogma.styles.createClass({name:"exported",nodeAttributes:{text:{minVisibleSize:0,size:12,maxLineLength:e?30:0},halo:null},edgeAttributes:{text:{minVisibleSize:0,size:12},halo:null}})}setBadgeRule(){this._ogma.styles.createClass({name:"degreeIndicator",nodeAttributes:{badges:{bottomLeft:e=>{if(e!==void 0){const t=u.getHiddenNeighbors(e.toList()),i=u.formatNumber(t);if(t>0){const n=e.getData(["statistics","supernode"]);let s=null;return+i!=0&&(s=n?i+"+":i),{color:ae,minVisibleSize:20,stroke:{width:2,color:"#FFFFFF"},text:{font:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.font!==void 0?this._defaultConfiguration.node.text.font:lr,scale:.4,color:oe,content:s}}}}}}}}),this._ogma.styles.createClass({name:"pinnedIndicator",nodeAttributes:{badges:{topRight:e=>{if(e!==void 0&&!e.getAttribute("layoutable"))return{color:ae,minVisibleSize:20,scale:this._findPinBadgeScale(e),stroke:{width:2,color:"#FFFFFF"},text:{font:"FontAwesome",scale:.4,color:oe,content:e.getAttribute("layoutable")?null:""}}}}},nodeDependencies:{self:{attributes:["layoutable"]}}}),this._ogma.events.on("addNodes",e=>e.nodes.addClass("degreeIndicator")),this._ogma.events.on("addNodes",e=>e.nodes.addClass("pinnedIndicator"))}deleteBadgeRule(){this._ogma.getNodes().removeClasses(["degreeIndicator","pinnedIndicator"],0)}toggleTextOverlap(e){this._ogma.setOptions({texts:{preventOverlap:e}})}refreshRules(){this._nodeDefaultStylesRules.refresh(),this._edgeDefaultStylesRules.refresh()}refreshNodeColors(e){u.isDefined(this._ogmaNodeColor)?(this._nodeAttributes.refresh({color:e}),this._ogmaNodeColor.refresh()):(this._nodeAttributes.refresh({color:e}),this._ogmaNodeColor=this._ogma.styles.addRule({nodeAttributes:{color:t=>{if(t!==void 0)return this._nodeAttributes.color(t.getData())}},nodeDependencies:{self:{data:!0}},nodeSelector:t=>!t.isVirtual()}))}getStyleRule(e,t){return new p(e)[t]}initNodeColors(e){const t=this.getStyleRule(e,D.COLOR);this.refreshNodeColors(t)}initNodesIcons(e){const t=this.getStyleRule(e,D.ICON);this.refreshNodeIcons(t)}initNodesSizes(e){const t=this.getStyleRule(e,D.SIZE);this.refreshNodeSize(t)}initNodesShapes(e){const t=this.getStyleRule(e,D.SHAPE);this.refreshNodeShape(t)}initEdgesWidth(e){const t=this.getStyleRule(e,D.WIDTH);this.refreshEdgeWidth(t)}initEdgesShape(e){const t=this.getStyleRule(e,D.SHAPE);this.refreshEdgeShape(t)}initEdgesColor(e){const t=this.getStyleRule(e,D.COLOR);this.refreshEdgeColors(t)}refreshNodeIcons(e){u.isDefined(this._ogmaNodeIcon)?(this._nodeAttributes.refresh({icon:e}),this._ogmaNodeIcon.refresh()):(this._nodeAttributes.refresh({icon:e}),this._ogmaNodeIcon=this._ogma.styles.addRule({nodeAttributes:{icon:t=>{if(t!==void 0)return this._nodeAttributes.icon(t.getData()).icon},image:t=>{if(t!==void 0&&!t.isVirtual())return this._nodeAttributes.icon(t.getData()).image}},nodeDependencies:{self:{data:!0}},nodeSelector:t=>!t.isVirtual()}))}refreshNodeSize(e){u.isDefined(this._ogmaNodeSize)?(this._nodeAttributes.refresh({size:e}),this._ogmaNodeSize.refresh()):(this._nodeAttributes.refresh({size:e}),this._ogmaNodeSize=this._ogma.styles.addRule({nodeAttributes:{radius:t=>{if(t!==void 0)return this._nodeAttributes.size(t.getData())}},nodeDependencies:{self:{data:!0}},nodeSelector:t=>!t.isVirtual()}))}refreshNodeShape(e){u.isDefined(this._ogmaNodeShape)?(this._nodeAttributes.refresh({shape:e}),this._ogmaNodeShape.refresh()):(this._nodeAttributes.refresh({shape:e}),this._ogmaNodeShape=this._ogma.styles.addRule({nodeAttributes:{shape:t=>{if(t!==void 0)return this._nodeAttributes.shape(t.getData())}},nodeSelector:t=>t!==void 0&&!t.isVirtual(),nodeDependencies:{self:{data:!0}}}))}refreshEdgeColors(e){u.isDefined(this._ogmaEdgeColor)?(this._edgeAttributes.refresh({color:e}),this._ogmaEdgeColor.refresh()):(this._edgeAttributes.refresh({color:e}),this._ogmaEdgeColor=this._ogma.styles.addRule({edgeAttributes:{color:t=>{if(t!==void 0)return this._edgeAttributes.color(t.getData())}},edgeDependencies:{self:{data:!0}}}))}refreshEdgeWidth(e){u.isDefined(this._ogmaEdgeWidth)?(this._edgeAttributes.refresh({width:e}),this._ogmaEdgeWidth.refresh()):(this._edgeAttributes.refresh({width:e}),this._ogmaEdgeWidth=this._ogma.styles.addRule({edgeAttributes:{width:t=>{if(t!==void 0)return this._edgeAttributes.width(t.getData())}},edgeDependencies:{self:{data:!0}}}))}refreshEdgeShape(e){u.isDefined(this._ogmaEdgeShape)?(this._edgeAttributes.refresh({shape:e}),this._ogmaEdgeShape.refresh()):(this._edgeAttributes.refresh({shape:e}),this._ogmaEdgeShape=this._ogma.styles.addRule({edgeAttributes:{shape:t=>{if(t!==void 0)return this._edgeAttributes.shape(t.getData())}},edgeDependencies:{self:{data:!0}}}))}_findPinBadgeScale(e){return this._getNodeRadius(e)*.46>5?.17:.46}_getNodeRadius(e){var t;if(!e.isVirtual()&&w.isGroupCollapsed(e))return e.getAttribute("radius");{const{width:i,height:n}=(t=e.getSubNodes())==null?void 0:t.getBoundingBox();return Math.max(i,n)}}}class dr{constructor(e,t,i){this._nodeMaxTextLength=t,this._edgeMaxTextLength=i,this._captionSchema={node:{},edge:{}},this._graphSchema={node:[],edge:[]},this._ogma=e}set graphSchema(e){this._graphSchema=e}refreshSchema(e){this._captionSchema=e}async initVizCaptions(e){this._ogma.LKCaptions.nodesCaptionsRule?(this._ogma.LKCaptions.refreshSchema(e),await this._ogma.LKCaptions.updateNodeCaptions()):this._ogma.LKCaptions.updateNodeCaptions(e.node),this._ogma.LKCaptions.edgesCaptionsRule?(this._ogma.LKCaptions.refreshSchema(e),await this._ogma.LKCaptions.updateEdgeCaptions()):this._ogma.LKCaptions.updateEdgeCaptions(e.edge)}updateNodeCaptions(e){if(e&&(this._captionSchema.node=e),!u.isDefined(this.nodesCaptionsRule))this.nodesCaptionsRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:t=>{if(t===void 0)return"";const i=$.getText(t.getData(),this._captionSchema.node,this._graphSchema.node);return u.isDefined(this._nodeMaxTextLength)?u.truncate(i,"middle",this._nodeMaxTextLength):i}}},nodeSelector:t=>!t.isVirtual(),nodeDependencies:{self:{data:!0}}});else return this.nodesCaptionsRule.refresh()}updateEdgeCaptions(e){if(e&&(this._captionSchema.edge=e),!u.isDefined(this.edgesCaptionsRule))this.edgesCaptionsRule=this._ogma.styles.addRule({edgeAttributes:{text:{content:t=>{if(t===void 0||t.getData()===void 0)return"";const i=$.getText(t.getData(),this._captionSchema.edge,this._graphSchema.edge);return u.isDefined(this._edgeMaxTextLength)?u.truncate(i,"middle",this._edgeMaxTextLength):i}}},edgeSelector:t=>!t.isVirtual(),edgeDependencies:{self:{data:!0,attributes:["shape.style"]}}});else return this.edgesCaptionsRule.refresh()}}function M(r){return typeof r=="function"}function Cg(r){return M(r==null?void 0:r.lift)}function gr(r){return function(e){if(Cg(e))return e.lift(function(t){try{return r(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}var Le=function(r,e){return Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},Le(r,e)};function We(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Le(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Mt(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ie(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,s=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(o){a={error:o}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return s}function Pe(r,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return r.concat(s||Array.prototype.slice.call(e))}function Ag(r){var e=function(i){Error.call(i),i.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Ae=Ag(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@linkurious/rest-client"),mr=require("@linkurious/ogma"),Sr=require("rxjs");var X=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Re(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Cr(){this.__data__=[],this.size=0}var Ar=Cr;function Er(r,e){return r===e||r!==r&&e!==e}var Me=Er,xr=Me;function Fr(r,e){for(var t=r.length;t--;)if(xr(r[t][0],e))return t;return-1}var le=Fr,Tr=le,$r=Array.prototype,Nr=$r.splice;function Dr(r){var e=this.__data__,t=Tr(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():Nr.call(e,t,1),--this.size,!0}var wr=Dr,Or=le;function Lr(r){var e=this.__data__,t=Or(e,r);return t<0?void 0:e[t][1]}var Ir=Lr,Pr=le;function Rr(r){return Pr(this.__data__,r)>-1}var Mr=Rr,Gr=le;function zr(r,e){var t=this.__data__,i=Gr(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}var Br=zr,Ur=Ar,jr=wr,Vr=Ir,kr=Mr,Hr=Br;function U(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}U.prototype.clear=Ur;U.prototype.delete=jr;U.prototype.get=Vr;U.prototype.has=kr;U.prototype.set=Hr;var ce=U,Kr=ce;function qr(){this.__data__=new Kr,this.size=0}var Yr=qr;function Wr(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var Jr=Wr;function Zr(r){return this.__data__.get(r)}var Xr=Zr;function Qr(r){return this.__data__.has(r)}var ei=Qr,ti=typeof X=="object"&&X&&X.Object===Object&&X,zt=ti,ri=zt,ii=typeof self=="object"&&self&&self.Object===Object&&self,ni=ri||ii||Function("return this")(),w=ni,si=w,ai=si.Symbol,Y=ai,Je=Y,Bt=Object.prototype,oi=Bt.hasOwnProperty,ui=Bt.toString,K=Je?Je.toStringTag:void 0;function li(r){var e=oi.call(r,K),t=r[K];try{r[K]=void 0;var i=!0}catch{}var n=ui.call(r);return i&&(e?r[K]=t:delete r[K]),n}var ci=li,di=Object.prototype,gi=di.toString;function hi(r){return gi.call(r)}var fi=hi,Ze=Y,pi=ci,bi=fi,yi="[object Null]",vi="[object Undefined]",Xe=Ze?Ze.toStringTag:void 0;function _i(r){return r==null?r===void 0?vi:yi:Xe&&Xe in Object(r)?pi(r):bi(r)}var W=_i;function mi(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var de=mi,Si=W,Ci=de,Ai="[object AsyncFunction]",Ei="[object Function]",xi="[object GeneratorFunction]",Fi="[object Proxy]";function Ti(r){if(!Ci(r))return!1;var e=Si(r);return e==Ei||e==xi||e==Ai||e==Fi}var Ut=Ti,$i=w,Ni=$i["__core-js_shared__"],Di=Ni,_e=Di,Qe=function(){var r=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function wi(r){return!!Qe&&Qe in r}var Oi=wi,Li=Function.prototype,Ii=Li.toString;function Pi(r){if(r!=null){try{return Ii.call(r)}catch{}try{return r+""}catch{}}return""}var jt=Pi,Ri=Ut,Mi=Oi,Gi=de,zi=jt,Bi=/[\\^$.*+?()[\]{}|]/g,Ui=/^\[object .+?Constructor\]$/,ji=Function.prototype,Vi=Object.prototype,ki=ji.toString,Hi=Vi.hasOwnProperty,Ki=RegExp("^"+ki.call(Hi).replace(Bi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qi(r){if(!Gi(r)||Mi(r))return!1;var e=Ri(r)?Ki:Ui;return e.test(zi(r))}var Yi=qi;function Wi(r,e){return r==null?void 0:r[e]}var Ji=Wi,Zi=Yi,Xi=Ji;function Qi(r,e){var t=Xi(r,e);return Zi(t)?t:void 0}var M=Qi,en=M,tn=w,rn=en(tn,"Map"),Ge=rn,nn=M,sn=nn(Object,"create"),ge=sn,et=ge;function an(){this.__data__=et?et(null):{},this.size=0}var on=an;function un(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var ln=un,cn=ge,dn="__lodash_hash_undefined__",gn=Object.prototype,hn=gn.hasOwnProperty;function fn(r){var e=this.__data__;if(cn){var t=e[r];return t===dn?void 0:t}return hn.call(e,r)?e[r]:void 0}var pn=fn,bn=ge,yn=Object.prototype,vn=yn.hasOwnProperty;function _n(r){var e=this.__data__;return bn?e[r]!==void 0:vn.call(e,r)}var mn=_n,Sn=ge,Cn="__lodash_hash_undefined__";function An(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Sn&&e===void 0?Cn:e,this}var En=An,xn=on,Fn=ln,Tn=pn,$n=mn,Nn=En;function j(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}j.prototype.clear=xn;j.prototype.delete=Fn;j.prototype.get=Tn;j.prototype.has=$n;j.prototype.set=Nn;var Dn=j,tt=Dn,wn=ce,On=Ge;function Ln(){this.size=0,this.__data__={hash:new tt,map:new(On||wn),string:new tt}}var In=Ln;function Pn(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var Rn=Pn,Mn=Rn;function Gn(r,e){var t=r.__data__;return Mn(e)?t[typeof e=="string"?"string":"hash"]:t.map}var he=Gn,zn=he;function Bn(r){var e=zn(this,r).delete(r);return this.size-=e?1:0,e}var Un=Bn,jn=he;function Vn(r){return jn(this,r).get(r)}var kn=Vn,Hn=he;function Kn(r){return Hn(this,r).has(r)}var qn=Kn,Yn=he;function Wn(r,e){var t=Yn(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}var Jn=Wn,Zn=In,Xn=Un,Qn=kn,es=qn,ts=Jn;function V(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}V.prototype.clear=Zn;V.prototype.delete=Xn;V.prototype.get=Qn;V.prototype.has=es;V.prototype.set=ts;var ze=V,rs=ce,is=Ge,ns=ze,ss=200;function as(r,e){var t=this.__data__;if(t instanceof rs){var i=t.__data__;if(!is||i.length<ss-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new ns(i)}return t.set(r,e),this.size=t.size,this}var os=as,us=ce,ls=Yr,cs=Jr,ds=Xr,gs=ei,hs=os;function k(r){var e=this.__data__=new us(r);this.size=e.size}k.prototype.clear=ls;k.prototype.delete=cs;k.prototype.get=ds;k.prototype.has=gs;k.prototype.set=hs;var Vt=k,fs="__lodash_hash_undefined__";function ps(r){return this.__data__.set(r,fs),this}var bs=ps;function ys(r){return this.__data__.has(r)}var vs=ys,_s=ze,ms=bs,Ss=vs;function re(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new _s;++e<t;)this.add(r[e])}re.prototype.add=re.prototype.push=ms;re.prototype.has=Ss;var Cs=re;function As(r,e){for(var t=-1,i=r==null?0:r.length;++t<i;)if(e(r[t],t,r))return!0;return!1}var Es=As;function xs(r,e){return r.has(e)}var Fs=xs,Ts=Cs,$s=Es,Ns=Fs,Ds=1,ws=2;function Os(r,e,t,i,n,s){var a=t&Ds,o=r.length,l=e.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(r),d=s.get(e);if(c&&d)return c==e&&d==r;var h=-1,f=!0,v=t&ws?new Ts:void 0;for(s.set(r,e),s.set(e,r);++h<o;){var S=r[h],b=e[h];if(i)var x=a?i(b,S,h,e,r,s):i(S,b,h,r,e,s);if(x!==void 0){if(x)continue;f=!1;break}if(v){if(!$s(e,function($,N){if(!Ns(v,N)&&(S===$||n(S,$,t,i,s)))return v.push(N)})){f=!1;break}}else if(!(S===b||n(S,b,t,i,s))){f=!1;break}}return s.delete(r),s.delete(e),f}var kt=Os,Ls=w,Is=Ls.Uint8Array,Ps=Is;function Rs(r){var e=-1,t=Array(r.size);return r.forEach(function(i,n){t[++e]=[n,i]}),t}var Ms=Rs;function Gs(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var zs=Gs,rt=Y,it=Ps,Bs=Me,Us=kt,js=Ms,Vs=zs,ks=1,Hs=2,Ks="[object Boolean]",qs="[object Date]",Ys="[object Error]",Ws="[object Map]",Js="[object Number]",Zs="[object RegExp]",Xs="[object Set]",Qs="[object String]",ea="[object Symbol]",ta="[object ArrayBuffer]",ra="[object DataView]",nt=rt?rt.prototype:void 0,me=nt?nt.valueOf:void 0;function ia(r,e,t,i,n,s,a){switch(t){case ra:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case ta:return!(r.byteLength!=e.byteLength||!s(new it(r),new it(e)));case Ks:case qs:case Js:return Bs(+r,+e);case Ys:return r.name==e.name&&r.message==e.message;case Zs:case Qs:return r==e+"";case Ws:var o=js;case Xs:var l=i&ks;if(o||(o=Vs),r.size!=e.size&&!l)return!1;var c=a.get(r);if(c)return c==e;i|=Hs,a.set(r,e);var d=Us(o(r),o(e),i,n,s,a);return a.delete(r),d;case ea:if(me)return me.call(r)==me.call(e)}return!1}var na=ia;function sa(r,e){for(var t=-1,i=e.length,n=r.length;++t<i;)r[n+t]=e[t];return r}var Ht=sa,aa=Array.isArray,T=aa,oa=Ht,ua=T;function la(r,e,t){var i=e(r);return ua(r)?i:oa(i,t(r))}var ca=la;function da(r,e){for(var t=-1,i=r==null?0:r.length,n=0,s=[];++t<i;){var a=r[t];e(a,t,r)&&(s[n++]=a)}return s}var ga=da;function ha(){return[]}var fa=ha,pa=ga,ba=fa,ya=Object.prototype,va=ya.propertyIsEnumerable,st=Object.getOwnPropertySymbols,_a=st?function(r){return r==null?[]:(r=Object(r),pa(st(r),function(e){return va.call(r,e)}))}:ba,ma=_a;function Sa(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}var Ca=Sa;function Aa(r){return r!=null&&typeof r=="object"}var J=Aa,Ea=W,xa=J,Fa="[object Arguments]";function Ta(r){return xa(r)&&Ea(r)==Fa}var $a=Ta,at=$a,Na=J,Kt=Object.prototype,Da=Kt.hasOwnProperty,wa=Kt.propertyIsEnumerable,Oa=at(function(){return arguments}())?at:function(r){return Na(r)&&Da.call(r,"callee")&&!wa.call(r,"callee")},Be=Oa,ie={exports:{}};function La(){return!1}var Ia=La;ie.exports;(function(r,e){var t=w,i=Ia,n=e&&!e.nodeType&&e,s=n&&!0&&r&&!r.nodeType&&r,a=s&&s.exports===n,o=a?t.Buffer:void 0,l=o?o.isBuffer:void 0,c=l||i;r.exports=c})(ie,ie.exports);var qt=ie.exports,Pa=9007199254740991,Ra=/^(?:0|[1-9]\d*)$/;function Ma(r,e){var t=typeof r;return e=e??Pa,!!e&&(t=="number"||t!="symbol"&&Ra.test(r))&&r>-1&&r%1==0&&r<e}var Ue=Ma,Ga=9007199254740991;function za(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Ga}var je=za,Ba=W,Ua=je,ja=J,Va="[object Arguments]",ka="[object Array]",Ha="[object Boolean]",Ka="[object Date]",qa="[object Error]",Ya="[object Function]",Wa="[object Map]",Ja="[object Number]",Za="[object Object]",Xa="[object RegExp]",Qa="[object Set]",eo="[object String]",to="[object WeakMap]",ro="[object ArrayBuffer]",io="[object DataView]",no="[object Float32Array]",so="[object Float64Array]",ao="[object Int8Array]",oo="[object Int16Array]",uo="[object Int32Array]",lo="[object Uint8Array]",co="[object Uint8ClampedArray]",go="[object Uint16Array]",ho="[object Uint32Array]",y={};y[no]=y[so]=y[ao]=y[oo]=y[uo]=y[lo]=y[co]=y[go]=y[ho]=!0;y[Va]=y[ka]=y[ro]=y[Ha]=y[io]=y[Ka]=y[qa]=y[Ya]=y[Wa]=y[Ja]=y[Za]=y[Xa]=y[Qa]=y[eo]=y[to]=!1;function fo(r){return ja(r)&&Ua(r.length)&&!!y[Ba(r)]}var po=fo;function bo(r){return function(e){return r(e)}}var Yt=bo,ne={exports:{}};ne.exports;(function(r,e){var t=zt,i=e&&!e.nodeType&&e,n=i&&!0&&r&&!r.nodeType&&r,s=n&&n.exports===i,a=s&&t.process,o=function(){try{var l=n&&n.require&&n.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();r.exports=o})(ne,ne.exports);var yo=ne.exports,vo=po,_o=Yt,ot=yo,ut=ot&&ot.isTypedArray,mo=ut?_o(ut):vo,Wt=mo,So=Ca,Co=Be,Ao=T,Eo=qt,xo=Ue,Fo=Wt,To=Object.prototype,$o=To.hasOwnProperty;function No(r,e){var t=Ao(r),i=!t&&Co(r),n=!t&&!i&&Eo(r),s=!t&&!i&&!n&&Fo(r),a=t||i||n||s,o=a?So(r.length,String):[],l=o.length;for(var c in r)(e||$o.call(r,c))&&!(a&&(c=="length"||n&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||xo(c,l)))&&o.push(c);return o}var Do=No,wo=Object.prototype;function Oo(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||wo;return r===t}var Lo=Oo;function Io(r,e){return function(t){return r(e(t))}}var Po=Io,Ro=Po,Mo=Ro(Object.keys,Object),Go=Mo,zo=Lo,Bo=Go,Uo=Object.prototype,jo=Uo.hasOwnProperty;function Vo(r){if(!zo(r))return Bo(r);var e=[];for(var t in Object(r))jo.call(r,t)&&t!="constructor"&&e.push(t);return e}var ko=Vo,Ho=Ut,Ko=je;function qo(r){return r!=null&&Ko(r.length)&&!Ho(r)}var fe=qo,Yo=Do,Wo=ko,Jo=fe;function Zo(r){return Jo(r)?Yo(r):Wo(r)}var Ve=Zo,Xo=ca,Qo=ma,eu=Ve;function tu(r){return Xo(r,eu,Qo)}var ru=tu,lt=ru,iu=1,nu=Object.prototype,su=nu.hasOwnProperty;function au(r,e,t,i,n,s){var a=t&iu,o=lt(r),l=o.length,c=lt(e),d=c.length;if(l!=d&&!a)return!1;for(var h=l;h--;){var f=o[h];if(!(a?f in e:su.call(e,f)))return!1}var v=s.get(r),S=s.get(e);if(v&&S)return v==e&&S==r;var b=!0;s.set(r,e),s.set(e,r);for(var x=a;++h<l;){f=o[h];var $=r[f],N=e[f];if(i)var Z=a?i(N,$,f,e,r,s):i($,N,f,r,e,s);if(!(Z===void 0?$===N||n($,N,t,i,s):Z)){b=!1;break}x||(x=f=="constructor")}if(b&&!x){var m=r.constructor,O=e.constructor;m!=O&&"constructor"in r&&"constructor"in e&&!(typeof m=="function"&&m instanceof m&&typeof O=="function"&&O instanceof O)&&(b=!1)}return s.delete(r),s.delete(e),b}var ou=au,uu=M,lu=w,cu=uu(lu,"DataView"),du=cu,gu=M,hu=w,fu=gu(hu,"Promise"),pu=fu,bu=M,yu=w,vu=bu(yu,"Set"),_u=vu,mu=M,Su=w,Cu=mu(Su,"WeakMap"),Au=Cu,Ee=du,xe=Ge,Fe=pu,Te=_u,$e=Au,Jt=W,H=jt,ct="[object Map]",Eu="[object Object]",dt="[object Promise]",gt="[object Set]",ht="[object WeakMap]",ft="[object DataView]",xu=H(Ee),Fu=H(xe),Tu=H(Fe),$u=H(Te),Nu=H($e),L=Jt;(Ee&&L(new Ee(new ArrayBuffer(1)))!=ft||xe&&L(new xe)!=ct||Fe&&L(Fe.resolve())!=dt||Te&&L(new Te)!=gt||$e&&L(new $e)!=ht)&&(L=function(r){var e=Jt(r),t=e==Eu?r.constructor:void 0,i=t?H(t):"";if(i)switch(i){case xu:return ft;case Fu:return ct;case Tu:return dt;case $u:return gt;case Nu:return ht}return e});var Du=L,Se=Vt,wu=kt,Ou=na,Lu=ou,pt=Du,bt=T,yt=qt,Iu=Wt,Pu=1,vt="[object Arguments]",_t="[object Array]",Q="[object Object]",Ru=Object.prototype,mt=Ru.hasOwnProperty;function Mu(r,e,t,i,n,s){var a=bt(r),o=bt(e),l=a?_t:pt(r),c=o?_t:pt(e);l=l==vt?Q:l,c=c==vt?Q:c;var d=l==Q,h=c==Q,f=l==c;if(f&&yt(r)){if(!yt(e))return!1;a=!0,d=!1}if(f&&!d)return s||(s=new Se),a||Iu(r)?wu(r,e,t,i,n,s):Ou(r,e,l,t,i,n,s);if(!(t&Pu)){var v=d&&mt.call(r,"__wrapped__"),S=h&&mt.call(e,"__wrapped__");if(v||S){var b=v?r.value():r,x=S?e.value():e;return s||(s=new Se),n(b,x,t,i,s)}}return f?(s||(s=new Se),Lu(r,e,t,i,n,s)):!1}var Gu=Mu,zu=Gu,St=J;function Zt(r,e,t,i,n){return r===e?!0:r==null||e==null||!St(r)&&!St(e)?r!==r&&e!==e:zu(r,e,t,i,Zt,n)}var ke=Zt,Bu=ke;function Uu(r,e){return Bu(r,e)}var ju=Uu;const Vu=Re(ju);var Ct=Y,ku=Be,Hu=T,At=Ct?Ct.isConcatSpreadable:void 0;function Ku(r){return Hu(r)||ku(r)||!!(At&&r&&r[At])}var qu=Ku,Yu=Ht,Wu=qu;function Xt(r,e,t,i,n){var s=-1,a=r.length;for(t||(t=Wu),n||(n=[]);++s<a;){var o=r[s];e>0&&t(o)?e>1?Xt(o,e-1,t,i,n):Yu(n,o):i||(n[n.length]=o)}return n}var Ju=Xt;function Zu(r,e){for(var t=-1,i=r==null?0:r.length,n=Array(i);++t<i;)n[t]=e(r[t],t,r);return n}var Qt=Zu,Xu=W,Qu=J,el="[object Symbol]";function tl(r){return typeof r=="symbol"||Qu(r)&&Xu(r)==el}var pe=tl,rl=T,il=pe,nl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sl=/^\w*$/;function al(r,e){if(rl(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||il(r)?!0:sl.test(r)||!nl.test(r)||e!=null&&r in Object(e)}var He=al,er=ze,ol="Expected a function";function Ke(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(ol);var t=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=t.cache;if(s.has(n))return s.get(n);var a=r.apply(this,i);return t.cache=s.set(n,a)||s,a};return t.cache=new(Ke.Cache||er),t}Ke.Cache=er;var ul=Ke,ll=ul,cl=500;function dl(r){var e=ll(r,function(i){return t.size===cl&&t.clear(),i}),t=e.cache;return e}var gl=dl,hl=gl,fl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pl=/\\(\\)?/g,bl=hl(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(fl,function(t,i,n,s){e.push(n?s.replace(pl,"$1"):i||t)}),e}),yl=bl,Et=Y,vl=Qt,_l=T,ml=pe,xt=Et?Et.prototype:void 0,Ft=xt?xt.toString:void 0;function tr(r){if(typeof r=="string")return r;if(_l(r))return vl(r,tr)+"";if(ml(r))return Ft?Ft.call(r):"";var e=r+"";return e=="0"&&1/r==-1/0?"-0":e}var Sl=tr,Cl=Sl;function Al(r){return r==null?"":Cl(r)}var El=Al,xl=T,Fl=He,Tl=yl,$l=El;function Nl(r,e){return xl(r)?r:Fl(r,e)?[r]:Tl($l(r))}var rr=Nl,Dl=pe;function wl(r){if(typeof r=="string"||Dl(r))return r;var e=r+"";return e=="0"&&1/r==-1/0?"-0":e}var be=wl,Ol=rr,Ll=be;function Il(r,e){e=Ol(e,r);for(var t=0,i=e.length;r!=null&&t<i;)r=r[Ll(e[t++])];return t&&t==i?r:void 0}var qe=Il,Pl=Vt,Rl=ke,Ml=1,Gl=2;function zl(r,e,t,i){var n=t.length,s=n,a=!i;if(r==null)return!s;for(r=Object(r);n--;){var o=t[n];if(a&&o[2]?o[1]!==r[o[0]]:!(o[0]in r))return!1}for(;++n<s;){o=t[n];var l=o[0],c=r[l],d=o[1];if(a&&o[2]){if(c===void 0&&!(l in r))return!1}else{var h=new Pl;if(i)var f=i(c,d,l,r,e,h);if(!(f===void 0?Rl(d,c,Ml|Gl,i,h):f))return!1}}return!0}var Bl=zl,Ul=de;function jl(r){return r===r&&!Ul(r)}var ir=jl,Vl=ir,kl=Ve;function Hl(r){for(var e=kl(r),t=e.length;t--;){var i=e[t],n=r[i];e[t]=[i,n,Vl(n)]}return e}var Kl=Hl;function ql(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var nr=ql,Yl=Bl,Wl=Kl,Jl=nr;function Zl(r){var e=Wl(r);return e.length==1&&e[0][2]?Jl(e[0][0],e[0][1]):function(t){return t===r||Yl(t,r,e)}}var Xl=Zl,Ql=qe;function ec(r,e,t){var i=r==null?void 0:Ql(r,e);return i===void 0?t:i}var tc=ec;function rc(r,e){return r!=null&&e in Object(r)}var ic=rc,nc=rr,sc=Be,ac=T,oc=Ue,uc=je,lc=be;function cc(r,e,t){e=nc(e,r);for(var i=-1,n=e.length,s=!1;++i<n;){var a=lc(e[i]);if(!(s=r!=null&&t(r,a)))break;r=r[a]}return s||++i!=n?s:(n=r==null?0:r.length,!!n&&uc(n)&&oc(a,n)&&(ac(r)||sc(r)))}var dc=cc,gc=ic,hc=dc;function fc(r,e){return r!=null&&hc(r,e,gc)}var pc=fc,bc=ke,yc=tc,vc=pc,_c=He,mc=ir,Sc=nr,Cc=be,Ac=1,Ec=2;function xc(r,e){return _c(r)&&mc(e)?Sc(Cc(r),e):function(t){var i=yc(t,r);return i===void 0&&i===e?vc(t,r):bc(e,i,Ac|Ec)}}var Fc=xc;function Tc(r){return r}var ye=Tc;function $c(r){return function(e){return e==null?void 0:e[r]}}var Nc=$c,Dc=qe;function wc(r){return function(e){return Dc(e,r)}}var Oc=wc,Lc=Nc,Ic=Oc,Pc=He,Rc=be;function Mc(r){return Pc(r)?Lc(Rc(r)):Ic(r)}var Gc=Mc,zc=Xl,Bc=Fc,Uc=ye,jc=T,Vc=Gc;function kc(r){return typeof r=="function"?r:r==null?Uc:typeof r=="object"?jc(r)?Bc(r[0],r[1]):zc(r):Vc(r)}var Hc=kc;function Kc(r){return function(e,t,i){for(var n=-1,s=Object(e),a=i(e),o=a.length;o--;){var l=a[r?o:++n];if(t(s[l],l,s)===!1)break}return e}}var qc=Kc,Yc=qc,Wc=Yc(),Jc=Wc,Zc=Jc,Xc=Ve;function Qc(r,e){return r&&Zc(r,e,Xc)}var ed=Qc,td=fe;function rd(r,e){return function(t,i){if(t==null)return t;if(!td(t))return r(t,i);for(var n=t.length,s=e?n:-1,a=Object(t);(e?s--:++s<n)&&i(a[s],s,a)!==!1;);return t}}var id=rd,nd=ed,sd=id,ad=sd(nd),od=ad,ud=od,ld=fe;function cd(r,e){var t=-1,i=ld(r)?Array(r.length):[];return ud(r,function(n,s,a){i[++t]=e(n,s,a)}),i}var dd=cd;function gd(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var hd=gd,Tt=pe;function fd(r,e){if(r!==e){var t=r!==void 0,i=r===null,n=r===r,s=Tt(r),a=e!==void 0,o=e===null,l=e===e,c=Tt(e);if(!o&&!c&&!s&&r>e||s&&a&&l&&!o&&!c||i&&a&&l||!t&&l||!n)return 1;if(!i&&!s&&!c&&r<e||c&&t&&n&&!i&&!s||o&&t&&n||!a&&n||!l)return-1}return 0}var pd=fd,bd=pd;function yd(r,e,t){for(var i=-1,n=r.criteria,s=e.criteria,a=n.length,o=t.length;++i<a;){var l=bd(n[i],s[i]);if(l){if(i>=o)return l;var c=t[i];return l*(c=="desc"?-1:1)}}return r.index-e.index}var vd=yd,Ce=Qt,_d=qe,md=Hc,Sd=dd,Cd=hd,Ad=Yt,Ed=vd,xd=ye,Fd=T;function Td(r,e,t){e.length?e=Ce(e,function(s){return Fd(s)?function(a){return _d(a,s.length===1?s[0]:s)}:s}):e=[xd];var i=-1;e=Ce(e,Ad(md));var n=Sd(r,function(s,a,o){var l=Ce(e,function(c){return c(s)});return{criteria:l,index:++i,value:s}});return Cd(n,function(s,a){return Ed(s,a,t)})}var $d=Td;function Nd(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}var Dd=Nd,wd=Dd,$t=Math.max;function Od(r,e,t){return e=$t(e===void 0?r.length-1:e,0),function(){for(var i=arguments,n=-1,s=$t(i.length-e,0),a=Array(s);++n<s;)a[n]=i[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=i[n];return o[e]=t(a),wd(r,this,o)}}var Ld=Od;function Id(r){return function(){return r}}var Pd=Id,Rd=M,Md=function(){try{var r=Rd(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Gd=Md,zd=Pd,Nt=Gd,Bd=ye,Ud=Nt?function(r,e){return Nt(r,"toString",{configurable:!0,enumerable:!1,value:zd(e),writable:!0})}:Bd,jd=Ud,Vd=800,kd=16,Hd=Date.now;function Kd(r){var e=0,t=0;return function(){var i=Hd(),n=kd-(i-t);if(t=i,n>0){if(++e>=Vd)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var qd=Kd,Yd=jd,Wd=qd,Jd=Wd(Yd),Zd=Jd,Xd=ye,Qd=Ld,eg=Zd;function tg(r,e){return eg(Qd(r,e,Xd),r+"")}var rg=tg,ig=Me,ng=fe,sg=Ue,ag=de;function og(r,e,t){if(!ag(t))return!1;var i=typeof e;return(i=="number"?ng(t)&&sg(e,t.length):i=="string"&&e in t)?ig(t[e],r):!1}var ug=og,lg=Ju,cg=$d,dg=rg,Dt=ug,gg=dg(function(r,e){if(r==null)return[];var t=e.length;return t>1&&Dt(r,e[0],e[1])?e=[]:t>2&&Dt(e[0],e[1],e[2])&&(e=[e[0]]),cg(r,lg(e,1),[])}),hg=gg;const G=Re(hg),fg=/\S+\.(gif|jpe?g|tiff|png|bmp|svg)$/i,pg=["label","Label","name","Name","title","Title","rdfs:label"];class u{static isEqual(e,t){return Vu(e,t)}static isDefined(e){return e!=null}static truncate(e,t,i=0){const n="…";if(!u.isDefined(e))return"";const s=`${e}`;if(s.length<=i+1)return s;const a=i-1;switch(t){case"middle":return s.substring(0,Math.ceil(a/2))+n+s.substring(s.length-Math.floor(a/2));case"end":return s.substring(0,a)+n}}static getIn(e,t){return t.reduce((i,n)=>i&&i[n]!==void 0?i[n]:void 0,e)}static clone(e){return typeof e=="object"?JSON.parse(JSON.stringify(e,(t,i)=>i instanceof Set?{}:i)):e}static getHiddenNeighbors(e){return e.reduce((t,i)=>{const n=i.getData("statistics");if(n!==void 0){const s=n.degree!==void 0&&!n.supernode?n.degree-u.getDegreeWithoutSelfConnection(i):n.supernodeDegree;if(s!==void 0&&s>0)return t+=s}return t},0)}static getDegreeWithoutSelfConnection(e){return e.getAdjacentNodes({policy:"exclude-sources",filter:"raw"}).size}static formatNumber(e){let t=1,i="";const n=e<0?"-":"";e=Math.abs(e),e>=1e6?(t=1e6,i="M"):e>=1e3&&(t=1e3,i="k");const s=e/t;return s<10&&s%1!==0?n+s.toFixed(1)+i:n+Math.floor(s)+i}static isStringFilled(e){return e.trim()!==""}static getValueFromLkProperty(e){if(typeof e=="object"&&"type"in e){if(!("original"in e)&&!("value"in e))return null;if("original"in e)return`${e.original}`;if("value"in e)return u.formatDate(new Date(new Date(e.value).getTime()+u.timezoneToMilliseconds(e.timezone)).toISOString())}return e}static formatDate(e,t,i){let n=e;i!==void 0&&(n=new Date(e).getTime()+i*1e3);const s=new Date(n);if(isNaN(s.getUTCFullYear()))return null;let a=s.getFullYear()+"-"+((s.getUTCMonth()+1).toString().length===1?"0"+(s.getUTCMonth()+1):s.getUTCMonth()+1)+"-"+(s.getUTCDate().toString().length===1?"0"+s.getUTCDate():s.getUTCDate());return t&&(a+=" "+(s.getUTCHours().toString().length===1?"0"+s.getUTCHours():s.getUTCHours())+":"+(s.getUTCMinutes().toString().length===1?"0"+s.getUTCMinutes():s.getUTCMinutes())+":"+(s.getUTCSeconds().toString().length===1?"0"+s.getUTCSeconds():s.getUTCSeconds())),a}static timezoneToMilliseconds(e){if(e===void 0||e==="Z")return 0;const t=e[0],[i,n]=e.slice(1).split(":");return t==="+"?this.sanitizeFormattedNumber(i)*36e5+this.sanitizeFormattedNumber(n)*6e4:(this.sanitizeFormattedNumber(i)*36e5+this.sanitizeFormattedNumber(n)*6e4)*-1}static sanitizeFormattedNumber(e){return e.length===2&&e.startsWith("0")?u.parseNumber(e[1]):u.parseNumber(e)}static parseNumber(e){if(typeof e=="string"){if(e.trim()==="")return Number.NaN;e=+e.replace(",",".").replace(" ","")}return typeof e!="number"||!isFinite(e)?Number.NaN:e}static uniqBy(e,t){const i=new Set;if(t){const n=[];for(let s=0;s<e.length;++s)e[s]&&e[s][t]&&!i.has(e[s][t])?(i.add(e[s][t]),n.push(e[s])):e[s][t]||n.push(e[s]);return n}return typeof e[0]=="object"?Array.from(new Set(e.map(n=>JSON.stringify(n)))).map(n=>JSON.parse(n)):Array.from(new Set(e))}static getType(e){if(u.isURLImage(e))return"imageUrl";if(u.isImage(e))return"image";if(u.isUrl(e))return"url"}static isUrl(e){try{return new URL(e),!0}catch{return!1}}static isImage(e){return fg.test(e)}static isURLImage(e){if(u.isUrl(e)){const t=new URL(e);return u.isImage(t.pathname)}return!1}static valueExists(e){return u.isDefined(e)&&(typeof e!="string"||u.isStringFilled(e))}static isNumber(e){return e=u.parseNumber(e),u.isDefined(e)&&e===e}static getPropertyValue(e,t,i){if(typeof e=="object"&&!Array.isArray(e)){if("status"in e)return t&&"original"in e?e.original:void 0;if((e.type==="date"||e.type==="datetime")&&i)return u.formatDate(e.value,e.type==="datetime");if(e.type==="date"||e.type==="datetime")return new Date(e.value).getTime()}return e}static parseFloat(e){return u.parseNumber(e)}static formatCurrencyValue(e,t){const i=e<0?"- ":"";switch(t.format){case g.CurrencyFormat.SYMBOL_COMMAS_DOT:return`${i}${t.symbol!==void 0?t.symbol+" ":""}${u.formatNumberToCurrency(e,",",".")}`;case g.CurrencyFormat.SYMBOL_COMMAS:return`${i}${t.symbol!==void 0?t.symbol+" ":""}${u.formatNumberToCurrency(e,",")}`;case g.CurrencyFormat.DOTS_COMMA_SYMBOL:return`${i}${u.formatNumberToCurrency(e,".",",")}${t.symbol!==void 0?" "+t.symbol:""}`;case g.CurrencyFormat.DOTS_SYMBOL:return`${i}${u.formatNumberToCurrency(e,".")}${t.symbol!==void 0?" "+t.symbol:""}`;case g.CurrencyFormat.SPACES_COMMA_SYMBOL:return`${i}${u.formatNumberToCurrency(e," ",",")}${t.symbol!==void 0?" "+t.symbol:""}`;case g.CurrencyFormat.SPACES_SYMBOL:return`${i}${u.formatNumberToCurrency(e," ")}${t.symbol!==void 0?" "+t.symbol:""}`;default:throw Error(`Cannot format property value ${e}, unknown format ${t.format}.`)}}static formatNumberToCurrency(e,t,i){if(!Number.isFinite(e))return e.toString();const[n,s]=i?Math.abs(e).toFixed(2).split("."):[Math.abs(e).toFixed(0),void 0];let a=-1;const o=n.split("").reverse().map(l=>(a++,a>0&&a%3===0?l+t:l)).reverse().join("");return i?o+i+s:o}}class F{static getText(e,t,i){const n="categories"in e?e.categories:[e.type];if(F.captionExist(n,t))return"categories"in e?F.generateNodeCaption(e,t,i)||null:F.generateEdgeCaption(e,t,i)||null;if(e.properties!==void 0){const s=pg.find(a=>e.properties[a]!==void 0);if(s!==void 0&&u.isDefined(e.properties[s]))return`${u.getValueFromLkProperty(e.properties[s])}`.trim()}return null}static getLabel(e,t){if(typeof e=="object"&&"type"in e){if(!("original"in e)&&!("value"in e))return null;if("original"in e)return`${e.original}`;if("value"in e)return u.formatDate(new Date(new Date(e.value).getTime()+u.timezoneToMilliseconds(e.timezone)).toISOString())}else if((t==null?void 0:t.name)===g.PropertyTypeName.NUMBER&&t.options!==void 0)return u.formatCurrencyValue(e,t.options);return`${e}`.trim()}static captionExist(e,t){return e.some(i=>u.isDefined(t[i]))}static generateNodeCaption(e,t,i){const n=e.categories,s=[];let a=[];return n.forEach(o=>{t[o]&&t[o].active&&(t[o].displayName&&s.push(o),a=[...a,...t[o].properties])}),u.uniqBy(a).forEach(o=>{if(e.properties[o]!==void 0){const l=i?F.getPropertyType(i,o,n[0]):void 0;s.push(this.getLabel(e.properties[o],l))}}),s.filter(o=>o!==null).join(" - ").trim()}static getPropertyType(e,t,i){const n=e.find(a=>a.itemType===i),s=n==null?void 0:n.properties.find(a=>a.propertyKey===t);return s==null?void 0:s.propertyType}static generateEdgeCaption(e,t,i){const n=e.type,s=[];let a=[];return t[n]&&t[n].active?(t[n].displayName&&s.push(n),a=[...a,...t[n].properties],u.uniqBy(a).forEach(o=>{if(u.isDefined(e.properties[o])){const l=i?F.getPropertyType(i,o,n):void 0;s.push(F.getLabel(e.properties[o],l))}}),s.join(" - ").trim()):""}}var sr={exports:{}},ar={exports:{}};(function(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(t,i){return t<<i|t>>>32-i},rotr:function(t,i){return t<<32-i|t>>>i},endian:function(t){if(t.constructor==Number)return e.rotl(t,8)&16711935|e.rotl(t,24)&4278255360;for(var i=0;i<t.length;i++)t[i]=e.endian(t[i]);return t},randomBytes:function(t){for(var i=[];t>0;t--)i.push(Math.floor(Math.random()*256));return i},bytesToWords:function(t){for(var i=[],n=0,s=0;n<t.length;n++,s+=8)i[s>>>5]|=t[n]<<24-s%32;return i},wordsToBytes:function(t){for(var i=[],n=0;n<t.length*32;n+=8)i.push(t[n>>>5]>>>24-n%32&255);return i},bytesToHex:function(t){for(var i=[],n=0;n<t.length;n++)i.push((t[n]>>>4).toString(16)),i.push((t[n]&15).toString(16));return i.join("")},hexToBytes:function(t){for(var i=[],n=0;n<t.length;n+=2)i.push(parseInt(t.substr(n,2),16));return i},bytesToBase64:function(t){for(var i=[],n=0;n<t.length;n+=3)for(var s=t[n]<<16|t[n+1]<<8|t[n+2],a=0;a<4;a++)n*8+a*6<=t.length*8?i.push(r.charAt(s>>>6*(3-a)&63)):i.push("=");return i.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/ig,"");for(var i=[],n=0,s=0;n<t.length;s=++n%4)s!=0&&i.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*s+8)-1)<<s*2|r.indexOf(t.charAt(n))>>>6-s*2);return i}};ar.exports=e})();var bg=ar.exports,Ne={utf8:{stringToBytes:function(r){return Ne.bin.stringToBytes(unescape(encodeURIComponent(r)))},bytesToString:function(r){return decodeURIComponent(escape(Ne.bin.bytesToString(r)))}},bin:{stringToBytes:function(r){for(var e=[],t=0;t<r.length;t++)e.push(r.charCodeAt(t)&255);return e},bytesToString:function(r){for(var e=[],t=0;t<r.length;t++)e.push(String.fromCharCode(r[t]));return e.join("")}}},wt=Ne;(function(){var r=bg,e=wt.utf8,t=wt.bin,i=function(s){s.constructor==String?s=e.stringToBytes(s):typeof Buffer<"u"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(s)?s=Array.prototype.slice.call(s,0):Array.isArray(s)||(s=s.toString());var a=r.bytesToWords(s),o=s.length*8,l=[],c=1732584193,d=-271733879,h=-1732584194,f=271733878,v=-1009589776;a[o>>5]|=128<<24-o%32,a[(o+64>>>9<<4)+15]=o;for(var S=0;S<a.length;S+=16){for(var b=c,x=d,$=h,N=f,Z=v,m=0;m<80;m++){if(m<16)l[m]=a[S+m];else{var O=l[m-3]^l[m-8]^l[m-14]^l[m-16];l[m]=O<<1|O>>>31}var _r=(c<<5|c>>>27)+v+(l[m]>>>0)+(m<20?(d&h|~d&f)+1518500249:m<40?(d^h^f)+1859775393:m<60?(d&h|d&f|h&f)-1894007588:(d^h^f)-899497514);v=f,f=h,h=d<<30|d>>>2,d=c,c=_r}c+=b,d+=x,h+=$,f+=N,v+=Z}return[c,d,h,f,v]},n=function(s,a){var o=r.wordsToBytes(i(s));return a&&a.asBytes?o:a&&a.asString?t.bytesToString(o):r.bytesToHex(o)};n._blocksize=16,n._digestsize=20,sr.exports=n})();var yg=sr.exports;const se=Re(yg),E="#7f7f7f",De=["#9467bd","#e377c2","#1f77b4","#17becf","#2ca02c","#bcbd22","#d62728","#ff7f0e","#8c564b","#c5b0d5","#f7b6d2","#aec7e8","#9edae5","#98df8a","#dbdb8d","#ff9896","#ffbb78","#c49c94"];class A{constructor(e){this.colorsCache=new Map,this._rulesMap={},this.refresh(e)}refresh(e){e.color!==void 0&&(this.colorsCache=new Map),this._rulesMap={color:e.color?[...e.color].reverse():this._rulesMap.color,icon:e.icon?[...e.icon].reverse():this._rulesMap.icon,image:e.image?[...e.image].reverse():this._rulesMap.image,shape:e.shape?[...e.shape].reverse():this._rulesMap.shape,size:e.size?[...e.size].reverse():this._rulesMap.size,width:e.width?[...e.width].reverse():this._rulesMap.width}}static autoColor(e,t){return u.isDefined(e)?De[A.getRandomUniqueColorPaletteIndex(e,De.length,t)]:E}static getRandomUniqueColorPaletteIndex(e,t,i){return i&&(e=e.toLowerCase()),+("0x"+se(e).substr(-4))%t}static getTypeColor(e,t){return typeof e.style.color=="object"&&e.style.color.input[0]!=="properties"?A.autoColor(t,e.style.color.ignoreCase):!u.isDefined(e.input)&&typeof e.style.color!="object"?e.style.color:null}static getAutomaticRangeStyleLinear(e,{max:t,min:i},n,s){if(t!==void 0&&i!==void 0){if(t===i||isNaN(e))return"100%";const a=(s-n)/(t-i),o=(n*t-s*i)/(t-i);return`${Math.floor(e*a+o)}%`}}static getAutomaticRangeStyleLog(e,{max:t,min:i},n,s){if(i!==void 0&&t!==void 0){if(t===i||isNaN(e))return"100%";i<1&&(e+=Math.abs(i)+1,t+=Math.abs(i)+1,i+=Math.abs(i)+1);const a=(s-n)/(Math.log(t)-Math.log(i)),o=(n*Math.log(t)-s*Math.log(i))/(Math.log(t)-Math.log(i));return`${Math.floor(a*Math.log(e)+o)}%`}}isAutoRange(e){return typeof e=="object"&&(e==null?void 0:e.type)==="autoRange"}}class B extends A{constructor(e){super(e)}static matchStyle(e,t){if(t!==void 0){for(let i=0;i<e.length;++i)if(e[i].canApplyTo(t))return e[i]}}color(e){if(!u.isDefined(e))return E;let t;for(let i=0;i<this._rulesMap.color.length;++i){const n=this._rulesMap.color[i];if(n.canApplyTo(e)){if(typeof n.style.color=="string")t=n.style.color;else if(typeof n.style.color=="object"){const s=u.getIn(e,n.style.color.input);t=A.autoColor(`${s}`,n.style.color.ignoreCase)}break}}return u.isDefined(t)?t:E}shape(e){var t;if(this._rulesMap.shape!==void 0)return(t=B.matchStyle(this._rulesMap.shape,e))==null?void 0:t.style.shape}width(e){if(this._rulesMap.width!==void 0){const t=B.matchStyle(this._rulesMap.width,e);if(t!==void 0){const i=t==null?void 0:t.style.width;if(i!==void 0&&this.isAutoRange(i)){if(i.input!==void 0&&i.max!==void 0&&i.min!==void 0){const n=i.input[1],s=u.parseNumber(e.properties[n]),a=i.scale&&i.scale===g.AutoRangeScale.LOGARITHMIC;return B.getAutomaticRangeWidth(s,t,a)}}else return i}}}static getAutomaticRangeWidth(e,t,i=!1){return i?this.getAutomaticRangeStyleLog(e,t.style.width,50,200):this.getAutomaticRangeStyleLinear(e,t.style.width,50,200)}all(e){return u.isDefined(e)?{color:this.color(e),shape:this.shape(e),width:this.width(e)}:{color:E,shape:g.OgmaEdgeShape.ARROW,width:"100%"}}}class I extends A{constructor(e){super(e)}static matchStyle(e,t,i){if(u.isDefined(t)&&u.isDefined(e)){for(let n=0;n<e.length;++n)if(e[n].canApplyTo(t)){i(e[n]);break}}}color(e){if(!u.isDefined(e))return[E];const t=se(JSON.stringify(e)),i=this.colorsCache.get(t);if(i!==void 0)return i;let n=[];for(let a=0;a<e.categories.length;++a){let o=null;for(let l=0;l<this._rulesMap.color.length;++l){const c=this._rulesMap.color[l];if(!(c.itemType!==void 0&&c.itemType!==null&&c.itemType!==e.categories[a])&&c.canApplyTo(e)){if(typeof c.style.color=="object"){const d=u.getIn(e,c.style.color.input);Array.isArray(d)?o=A.autoColor(e.categories[a],c.style.color.ignoreCase):o=A.autoColor(`${d}`,c.style.color.ignoreCase)}else o=c.style.color;break}}n.push(o)}n=n.filter(a=>u.isDefined(a)),n.length===0&&(n=[E]);const s=n.length===1?n[0]:n;return this.colorsCache.set(t,s),s}icon(e){var a,o;const t=this.color(e),i=Array.isArray(t)?t[0]:t;let n={};const s=[...this._rulesMap.image||[],...this._rulesMap.icon||[]];if(!u.isDefined(e))return{icon:{},image:{}};for(let l=0;l<s.length;++l)if(s[l].canApplyTo(e)){const c=s[l].style;if("icon"in c&&typeof c.icon=="object")n={icon:{content:(a=c.icon)==null?void 0:a.content,font:(o=c.icon)==null?void 0:o.font,scale:.5,color:P.isBright(i)?"#000000":"#FFFFFF"}};else if("image"in c&&typeof c.image=="object"){const d=I.getImageUrlFromStyleRule(c.image.url,e,this._baseUrl);d!==void 0&&(n={image:{url:d,scale:c.image.scale,fit:c.image.fit,tile:c.image.tile,minVisibleSize:0}})}break}return n}shape(e){let t;return this._rulesMap.shape!==void 0&&I.matchStyle(this._rulesMap.shape,e,i=>{t=i.style.shape}),t}size(e){let t;return this._rulesMap.size!==void 0&&I.matchStyle(this._rulesMap.size,e,i=>{const n=i.style.size;if(this.isAutoRange(n)){if(n.input!==void 0&&n.max!==void 0&&n.min!==void 0){const s=n.input[1],a=u.parseNumber(e.properties[s]),o=n.scale&&n.scale===g.AutoRangeScale.LOGARITHMIC;t=I.getAutomaticRangeSize(a,i,o)}}else t=n}),t}static getAutomaticRangeSize(e,t,i=!1){return i?this.getAutomaticRangeStyleLog(e,t.style.size,50,500):this.getAutomaticRangeStyleLinear(e,t.style.size,50,500)}all(e){if(!u.isDefined(e))return{color:E};const t=this.icon(e);return{radius:this.size(e),color:this.color(e),shape:this.shape(e),icon:t.icon,image:t.image}}static getImageUrlFromStyleRule(e,t,i){let n;return typeof e=="string"&&["imageUrl","image"].includes(u.getType(e))?n=e:typeof e=="object"&&(n=u.getIn(t,e.path)),n!==void 0&&i!==void 0?new URL(n,i).href:n}setBaseUrl(e){this._baseUrl=e}}var or=(r=>(r.AUTO_RANGE="autoRange",r))(or||{});class C{constructor(e){this.type=e.type,this.input=e.input,this.index=e.index,this.itemType=e.itemType,this.style=e.style,this.value=e.value}static isAutomaticRange(e){return e.style!==void 0&&(e.style.width!==void 0&&e.style.width.type==="autoRange"||e.style.size!==void 0&&e.style.size.type==="autoRange")}get specificity(){return this.itemType!==void 0&&this.input!==void 0?4:this.itemType===void 0&&this.input!==void 0?3:this.itemType!==void 0&&this.input===void 0?2:1}matchValues(e,t,i){return u.isDefined(t)?(e===this.itemType||!u.isDefined(this.itemType))&&u.isEqual(["properties",...t],this.input)&&u.isEqual(i,this.value)||this.type==="any"&&!u.isDefined(this.input)&&typeof this.style.color=="object"&&this.style.color.input[1]===t[0]:u.isDefined(this.itemType)?e===this.itemType&&!u.isDefined(this.input):!u.isDefined(this.input)}static inputExists(e,t){return e!==g.SelectorType.ANY}canApplyTo(e){const t="categories"in e?e.categories:[e.type];let i=!1;switch(this.type){case g.SelectorType.ANY:i=C.checkAny(e,this.style);break;case g.SelectorType.NO_VALUE:C.inputExists(this.type,this.input)&&(i=C.checkNoValue(e,this.input));break;case g.SelectorType.NAN:C.inputExists(this.type,this.input)&&(i=C.checkNan(e,this.input));break;case g.SelectorType.RANGE:C.inputExists(this.type,this.input)&&(i=C.checkRange(u.getIn(e,this.input),this.value));break;case g.SelectorType.IS:C.inputExists(this.type,this.input)&&(i=C.checkIs(e,this.input,this.value));break}return i&&C.checkItemType(t,this.itemType)}static checkAny(e,t){return typeof t.color=="object"?u.isDefined(u.getIn(e,t.color.input)):!0}static checkNoValue(e,t){return!u.valueExists(u.getIn(e,t))}static checkNan(e,t){return!u.isNumber(u.getIn(e,t))}static checkRange(e,t){return(t["<="]===void 0||e<=t["<="])&&(t["<"]===void 0||e<t["<"])&&(t[">"]===void 0||e>t[">"])&&(t[">="]===void 0||e>=t[">="])}static checkIs(e,t,i){if(!u.isDefined(t))return!1;const n=u.getIn(e,t);let s=n;if(u.isDefined(n)&&typeof n=="object"&&(n.type==="date"||n.type==="datetime")){let a=n.timezone;n.timezone==="Z"&&(a="+00:00"),s=u.formatDate(n.value,n.type==="datetime",u.timezoneToMilliseconds(a)/1e3)}return u.isEqual(s,i)}static checkItemType(e,t){return C.matchCategory(e,t)||C.matchAny(t)}static matchCategory(e,t){return u.isDefined(t)&&(Array.isArray(e)?e.includes(t):u.isEqual(e,t))}static matchAny(e){return e===void 0}getTypeColor(e){let t;return C.checkItemType([e],this.itemType)&&this.type===g.SelectorType.ANY&&!u.isDefined(this.input)&&(t=A.getTypeColor(this,e)),t}}var D=(r=>(r.COLOR="color",r.ICON="icon",r.SIZE="size",r.IMAGE="image",r.SHAPE="shape",r.WIDTH="width",r))(D||{});const z=["specificity","itemType","index"];class p{constructor(e){this._rules=e}get color(){return G(p.getBy("color",this._rules),z)}get icon(){return G([...p.getBy("icon",this._rules)||[],...p.getBy("image",this._rules)||[]],z)}get image(){return G(p.getBy("image",this._rules),z)}get shape(){return G(p.getBy("shape",this._rules),z)}get size(){return G(p.getBy("size",this._rules),z)}get width(){return G(p.getBy("width",this._rules),z)}get nodeRules(){return{color:this.color,icon:this.icon,image:this.image,shape:this.shape,size:this.size}}get edgeRules(){return{color:this.color,shape:this.shape,width:this.width}}generateLegend(e){const t={};return e.length===0||("categories"in e[0]?Object.keys(this.nodeRules).forEach(i=>{t[i]=p.getLegendForStyle(i,this.nodeRules[i],e)}):Object.keys(this.edgeRules).forEach(i=>{t[i]=p.getLegendForStyle(i,this.edgeRules[i],e)})),t}static getLegendForStyle(e,t,i){const n=[],s=i.filter(a=>a);for(let a=0;a<t.length;a++){const o=new C(t[a]);if(s.some(c=>o.canApplyTo(c)))if(e==="color"&&typeof o.style.color=="object")p.addLegendAutoColors(s,o,n);else if(e==="icon"&&"image"in o.style){const c=u.isDefined(o.input)?`${p.getTypeLabel(o.itemType)}.${o.input[1]} ${p.sanitizeValue(o.type,o.value)}`:`${p.getTypeLabel(o.itemType)}`,d=o.style.image;if(!(d.url&&typeof d.url=="object"&&d.url.type==="data")){const h=o.style.image;p.updateLegend(n,{label:c,value:h})}}else{const c=u.isDefined(o.input)?`${p.getTypeLabel(o.itemType)}.${o.input[1]} ${p.sanitizeValue(o.type,o.value)}`:`${p.getTypeLabel(o.itemType)}`,d=o.style[e];p.updateLegend(n,{label:c,value:d})}}return n}static sanitizeValue(e,t){let i="";switch(e){case g.SelectorType.NO_VALUE:return"is undefined";case g.SelectorType.NAN:return"is not an number";case g.SelectorType.RANGE:return Object.keys(t).forEach((n,s)=>{s>0&&(i+=" and "),i+=`${n} ${t[n]}`}),i}return typeof t=="object"?`= ${JSON.stringify(t)}`:`= ${t}`}static addLegendAutoColors(e,t,i){const n=t.style.color,s=n.input[1];e.forEach(a=>{const o=u.getIn(a,n.input);if(Array.isArray(o))o.forEach(l=>{const c=n.input.includes("properties")?`${p.getTypeLabel(t.itemType)}.${s} = ${l}`:`${p.getTypeLabel(l)}`,d=A.autoColor(l,n.ignoreCase);p.updateLegend(i,{label:c,value:d})});else{const l=n.input.includes("properties")?`${p.getTypeLabel(t.itemType)}.${s} = ${o}`:`${p.getTypeLabel(o)}`,c=A.autoColor(o,n.ignoreCase);p.updateLegend(i,{label:l,value:c})}})}static getTypeLabel(e){return e===void 0?"All":e===null?"Others":e}getColorForType(e){const t=this.color.map(i=>i.getTypeColor(e)).filter(i=>u.isDefined(i));return t.length>0?t[t.length-1]:E}getIconForType(e){const t=this.icon.filter(i=>!u.isDefined(i.input)&&i.itemType===e).map(i=>{var n;return(n=i.style.icon)==null?void 0:n.content}).filter(i=>u.isDefined(i));return t.length>0?t[t.length-1]:void 0}static updateLegend(e,{label:t,value:i}){const n=e.map(s=>s.label).indexOf(t);n<0?e.push({label:t,value:i}):e[n]={label:t,value:i}}static getBy(e,t){return t.filter(i=>{switch(e){case"color":return i.style.color!==void 0;case"icon":return"icon"in i.style&&i.style.icon!==void 0;case"image":return"image"in i.style&&i.style.image!==void 0;case"shape":return i.style.shape!==void 0;case"size":return"size"in i.style&&i.style.size!==void 0;case"width":return"width"in i.style&&i.style.width!==void 0}}).map(i=>p.getRule(i,e))}static getRule(e,t){const i=u.clone(e);return i.style={[t]:i.style[t]},new C(i)}static sanitizeStylesIndex(e){const t=[],i=u.clone(e);let n=Math.max(...e.node.map(s=>s.index),...e.edge.map(s=>s.index))+1;return i.node=i.node.map(s=>(t.includes(s.index)?(s.index=n,n++):t.push(s.index),s)),i.edge=i.edge.map(s=>(t.includes(s.index)?(s.index=n,n++):t.push(s.index),s)),i}}const te={lightsalmon:{hex:"#FFA07A",rgb:"rbg(255,160,122)"},salmon:{hex:"#FA8072",rgb:"rgb(250,128,114)"},darksalmon:{hex:"#E9967A",rgb:"rgb(233,150,122)"},lightcoral:{hex:"#F08080",rgb:"rgb(240,128,128)"},indianred:{hex:"#CD5C5C",rgb:"rgb(205,92,92)"},crimson:{hex:"#DC143C",rgb:"rgb(220,20,60)"},firebrick:{hex:"#B22222",rgb:"rgb(178,34,34)"},red:{hex:"#FF0000",rgb:"rgb(255,0,0)"},darkred:{hex:"#8B0000",rgb:"rgb(139,0,0)"},coral:{hex:"#FF7F50",rgb:"rgb(255,127,80)"},tomato:{hex:"#FF6347",rgb:"rgb(255,99,71)"},orangered:{hex:"#FF4500",rgb:"rgb(255,69,0)"},gold:{hex:"#FFD700",rgb:"rgb(255,215,0)"},orange:{hex:"#FFA500",rgb:"rgb(255,165,0)"},darkorange:{hex:"#FF8C00",rgb:"rgb(255,140,0)"},lightyellow:{hex:"#FFFFE0",rgb:"rgb(255,255,224)"},lemonchiffon:{hex:"#FFFACD",rgb:"rgb(255,250,205)"},lightgoldenrodyellow:{hex:"#FAFAD2",rgb:"rgb(250,250,210)"},papayawhip:{hex:"#FFEFD5",rgb:"rgb(255,239,213)"},moccasin:{hex:"#FFE4B5",rgb:"rgb(255,228,181)"},peachpuff:{hex:"#FFDAB9",rgb:"rgb(255,218,185)"},palegoldenrod:{hex:"#EEE8AA",rgb:"rgb(238,232,170)"},khaki:{hex:"#F0E68C",rgb:"rgb(240,230,140)"},darkkhaki:{hex:"#BDB76B",rgb:"rgb(189,183,107)"},yellow:{hex:"#FFFF00",rgb:"rgb(255,255,0)"},lawngreen:{hex:"#7CFC00",rgb:"rgb(124,252,0)"},chartreuse:{hex:"#7FFF00",rgb:"rgb(127,255,0)"},limegreen:{hex:"#32CD32",rgb:"rgb(50,205,50)"},lime:{hex:"#00FF00",rgb:"rgb(0.255.0)"},forestgreen:{hex:"#228B22",rgb:"rgb(34,139,34)"},green:{hex:"#008000",rgb:"rgb(0,128,0)"},darkgreen:{hex:"#006400",rgb:"rgb(0,100,0)"},greenyellow:{hex:"#ADFF2F",rgb:"rgb(173,255,47)"},yellowgreen:{hex:"#9ACD32",rgb:"rgb(154,205,50)"},springgreen:{hex:"#00FF7F",rgb:"rgb(0,255,127)"},mediumspringgreen:{hex:"#00FA9A",rgb:"rgb(0,250,154)"},lightgreen:{hex:"#90EE90",rgb:"rgb(144,238,144)"},palegreen:{hex:"#98FB98",rgb:"rgb(152,251,152)"},darkseagreen:{hex:"#8FBC8F",rgb:"rgb(143,188,143)"},mediumseagreen:{hex:"#3CB371",rgb:"rgb(60,179,113)"},seagreen:{hex:"#2E8B57",rgb:"rgb(46,139,87)"},olive:{hex:"#808000",rgb:"rgb(128,128,0)"},darkolivegreen:{hex:"#556B2F",rgb:"rgb(85,107,47)"},olivedrab:{hex:"#6B8E23",rgb:"rgb(107,142,35)"},lightcyan:{hex:"#E0FFFF",rgb:"rgb(224,255,255)"},cyan:{hex:"#00FFFF",rgb:"rgb(0,255,255)"},aqua:{hex:"#00FFFF",rgb:"rgb(0,255,255)"},aquamarine:{hex:"#7FFFD4",rgb:"rgb(127,255,212)"},mediumaquamarine:{hex:"#66CDAA",rgb:"rgb(102,205,170)"},paleturquoise:{hex:"#AFEEEE",rgb:"rgb(175,238,238)"},turquoise:{hex:"#40E0D0",rgb:"rgb(64,224,208)"},mediumturquoise:{hex:"#48D1CC",rgb:"rgb(72,209,204)"},darkturquoise:{hex:"#00CED1",rgb:"rgb(0,206,209)"},lightseagreen:{hex:"#20B2AA",rgb:"rgb(32,178,170)"},cadetblue:{hex:"#5F9EA0",rgb:"rgb(95,158,160)"},darkcyan:{hex:"#008B8B",rgb:"rgb(0,139,139)"},teal:{hex:"#008080",rgb:"rgb(0,128,128)"},powderblue:{hex:"#B0E0E6",rgb:"rgb(176,224,230)"},lightblue:{hex:"#ADD8E6",rgb:"rgb(173,216,230)"},lightskyblue:{hex:"#87CEFA",rgb:"rgb(135,206,250)"},skyblue:{hex:"#87CEEB",rgb:"rgb(135,206,235)"},deepskyblue:{hex:"#00BFFF",rgb:"rgb(0,191,255)"},lightsteelblue:{hex:"#B0C4DE",rgb:"rgb(176,196,222)"},dodgerblue:{hex:"#1E90FF",rgb:"rgb(30,144,255)"},cornflowerblue:{hex:"#6495ED",rgb:"rgb(100,149,237)"},steelblue:{hex:"#4682B4",rgb:"rgb(70,130,180)"},royalblue:{hex:"#4169E1",rgb:"rgb(65,105,225)"},blue:{hex:"#0000FF",rgb:"rgb(0,0,255)"},mediumblue:{hex:"#0000CD",rgb:"rgb(0,0,205)"},darkblue:{hex:"#00008B",rgb:"rgb(0,0,139)"},navy:{hex:"#000080",rgb:"rgb(0,0,128)"},midnightblue:{hex:"#191970",rgb:"rgb(25,25,112)"},mediumslateblue:{hex:"#7B68EE",rgb:"rgb(123,104,238)"},slateblue:{hex:"#6A5ACD",rgb:"rgb(106,90,205)"},darkslateblue:{hex:"#483D8B",rgb:"rgb(72,61,139)"},lavender:{hex:"#E6E6FA",rgb:"rgb(230,230,250)"},thistle:{hex:"#D8BFD8",rgb:"rgb(216,191,216)"},plum:{hex:"#DDA0DD",rgb:"rgb(221,160,221)"},violet:{hex:"#EE82EE",rgb:"rgb(238,130,238)"},orchid:{hex:"#DA70D6",rgb:"rgb(218,112,214)"},fuchsia:{hex:"#FF00FF",rgb:"rgb(255,0,255)"},magenta:{hex:"#FF00FF",rgb:"rgb(255,0,255)"},mediumorchid:{hex:"#BA55D3",rgb:"rgb(186,85,211)"},mediumpurple:{hex:"#9370DB",rgb:"rgb(147,112,219)"},blueviolet:{hex:"#8A2BE2",rgb:"rgb(138,43,226)"},darkviolet:{hex:"#9400D3",rgb:"rgb(148,0,211)"},darkorchid:{hex:"#9932CC",rgb:"rgb(153,50,204)"},darkmagenta:{hex:"#8B008B",rgb:"rgb(139,0,139)"},purple:{hex:"#800080",rgb:"rgb(128,0,128)"},indigo:{hex:"#4B0082",rgb:"rgb(75,0,130)"},pink:{hex:"#FFC0CB",rgb:"rgb(255,192,203)"},lightpink:{hex:"#FFB6C1",rgb:"rgb(255,182,193)"},hotpink:{hex:"#FF69B4",rgb:"rgb(255,105,180)"},deeppink:{hex:"#FF1493",rgb:"rgb(255,20,147)"},palevioletred:{hex:"#DB7093",rgb:"rgb(219,112,147)"},mediumvioletred:{hex:"#C71585",rgb:"rgb(199,21,133)"},white:{hex:"#FFFFFF",rgb:"rgb(255,255,255)"},snow:{hex:"#FFFAFA",rgb:"rgb(255,250,250)"},honeydew:{hex:"#F0FFF0",rgb:"rgb(240,255,240)"},mintcream:{hex:"#F5FFFA",rgb:"rgb(245,255,250)"},azure:{hex:"#F0FFFF",rgb:"rgb(240,255,255)"},aliceblue:{hex:"#F0F8FF",rgb:"rgb(240,248,255)"},ghostwhite:{hex:"#F8F8FF",rgb:"rgb(248,248,255)"},whitesmoke:{hex:"#F5F5F5",rgb:"rgb(245,245,245)"},seashell:{hex:"#FFF5EE",rgb:"rgb(255,245,238)"},beige:{hex:"#F5F5DC",rgb:"rgb(245,245,220)"},oldlace:{hex:"#FDF5E6",rgb:"rgb(253,245,230)"},floralwhite:{hex:"#FFFAF0",rgb:"rgb(255,250,240)"},ivory:{hex:"#FFFFF0",rgb:"rgb(255,255,240)"},antiquewhite:{hex:"#FAEBD7",rgb:"rgb(250,235,215)"},linen:{hex:"#FAF0E6",rgb:"rgb(250,240,230)"},lavenderblush:{hex:"#FFF0F5",rgb:"rgb(255,240,245)"},mistyrose:{hex:"#FFE4E1",rgb:"rgb(255,228,225)"},gainsboro:{hex:"#DCDCDC",rgb:"rgb(220,220,220)"},lightgray:{hex:"#D3D3D3",rgb:"rgb(211,211,211)"},silver:{hex:"#C0C0C0",rgb:"rgb(192,192,192)"},darkgray:{hex:"#A9A9A9",rgb:"rgb(169,169,169)"},gray:{hex:"#808080",rgb:"rgb(128,128,128)"},dimgray:{hex:"#696969",rgb:"rgb(105,105,105)"},lightslategray:{hex:"#778899",rgb:"rgb(119,136,153)"},slategray:{hex:"#708090",rgb:"rgb(112,128,144)"},darkslategray:{hex:"#2F4F4F",rgb:"rgb(47,79,79)"},black:{hex:"#000000",rgb:"rgb(0,0,0)"},cornsilk:{hex:"#FFF8DC",rgb:"rgb(255,248,220)"},blanchedalmond:{hex:"#FFEBCD",rgb:"rgb(255,235,205)"},bisque:{hex:"#FFE4C4",rgb:"rgb(255,228,196)"},navajowhite:{hex:"#FFDEAD",rgb:"rgb(255,222,173)"},wheat:{hex:"#F5DEB3",rgb:"rgb(245,222,179)"},burlywood:{hex:"#DEB887",rgb:"rgb(222,184,135)"},tan:{hex:"#D2B48C",rgb:"rgb(210,180,140)"},rosybrown:{hex:"#BC8F8F",rgb:"rgb(188,143,143)"},sandybrown:{hex:"#F4A460",rgb:"rgb(244,164,96)"},goldenrod:{hex:"#DAA520",rgb:"rgb(218,165,32)"},peru:{hex:"#CD853F",rgb:"rgb(205,133,63)"},chocolate:{hex:"#D2691E",rgb:"rgb(210,105,30)"},saddlebrown:{hex:"#8B4513",rgb:"rgb(139,69,19)"},sienna:{hex:"#A0522D",rgb:"rgb(160,82,45)"},brown:{hex:"#A52A2A",rgb:"rgb(165,42,42)"},maroon:{hex:"#800000",rgb:"rgb(128,0,0)"}},ae="#3F3D5F",ur="'roboto', sans-serif",oe="#FFF",we=.2,Ot={text:{style:"bold",backgroundColor:"#fff",minVisibleSize:0},outerStroke:{width:2},outline:!1},Lt={text:{style:"bold",backgroundColor:"#fff",minVisibleSize:0},outline:!1},vg={color:"#FFF",width:7,scalingMethod:"scaled",strokeWidth:0,hideNonAdjacentEdges:!1},_g={color:"#FFF",scalingMethod:"scaled",width:4},It="#7f7f7f";class lr{constructor(e,t){this._nodeAttributes=new I({}),this._edgeAttributes=new B({}),this._ogma=e,this._defaultConfiguration=t,this._nodeAttributes.setBaseUrl(t.baseUrl)}get nodeAttributes(){return this._nodeAttributes}get nodeFont(){var e,t;return(t=(e=this._defaultConfiguration.node)==null?void 0:e.text)==null?void 0:t.font}setNodesDefaultStyles(){this._ogma.styles.setHoveredNodeAttributes(Ot),this._ogma.styles.setSelectedNodeAttributes(Ot),this._nodeDefaultStylesRules=this._ogma.styles.addRule({nodeAttributes:{text:{padding:5,minVisibleSize:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.minVisibleSize?this._defaultConfiguration.node.text.minVisibleSize:12,maxLineLength:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.maxLineLength!==void 0?this._defaultConfiguration.node.text.maxLineLength:30,position:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.nodePosition!==void 0?this._defaultConfiguration.node.text.nodePosition:"bottom",backgroundColor:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.backgroundColor!==void 0?this._defaultConfiguration.node.text.backgroundColor:void 0,font:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.font!==void 0?this._defaultConfiguration.node.text.font:"'roboto', sans-serif",color:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.color!==void 0?this._defaultConfiguration.node.text.color:"black",size:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.size!==void 0?this._defaultConfiguration.node.text.size:14,margin:5},radius:this.defaultNodeRadius(this._defaultConfiguration.node),icon:{minVisibleSize:15},color:It,shape:this._defaultConfiguration.node.shape!==void 0?this._defaultConfiguration.node.shape:"circle",innerStroke:{width:3},outline:!1},nodeSelector:e=>!e.isVirtual()})}setEdgesDefaultStyles(){var e;this._ogma.styles.setHoveredEdgeAttributes(Lt),this._ogma.styles.setSelectedEdgeAttributes(Lt),this._edgeDefaultStylesRules=this._ogma.styles.addRule({edgeAttributes:{text:{minVisibleSize:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.minVisibleSize?this._defaultConfiguration.edge.text.minVisibleSize:3,maxLineLength:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.maxLineLength!==void 0?this._defaultConfiguration.edge.text.maxLineLength:30,backgroundColor:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.backgroundColor!==void 0?this._defaultConfiguration.edge.text.backgroundColor:void 0,font:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.font!==void 0?this._defaultConfiguration.edge.text.font:"'roboto', sans-serif",color:((e=this._defaultConfiguration.edge)==null?void 0:e.text)!==void 0&&this._defaultConfiguration.edge.text.color!==void 0?this._defaultConfiguration.edge.text.color:"black",size:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.size!==void 0?this._defaultConfiguration.edge.text.size:14},width:this.defaultEdgeWidth(this._defaultConfiguration.edge),shape:this._defaultConfiguration.edge.shape!==void 0?this._defaultConfiguration.edge.shape:"arrow",color:It}})}setNodesDefaultHalo(){this._nodeDefaultHaloRules=this._ogma.styles.addRule({nodeSelector:e=>e&&!e.hasClass("filtered")&&!e.isVirtual(),nodeAttributes:{halo:e=>e!==void 0&&!e.hasClass("filtered")&&(e.isSelected()||e.getAdjacentNodes({}).isSelected().includes(!0)||e.getAdjacentEdges().isSelected().includes(!0))?{...vg,scalingMethod:this._ogma.geo.enabled()?"fixed":"scaled"}:null},nodeDependencies:{self:{selection:!0},adjacentNodes:{selection:!0},adjacentEdges:{selection:!0}}})}setEdgesDefaultHalo(){this._edgeDefaultHaloRules=this._ogma.styles.addRule({edgeSelector:e=>e&&e.getSource()&&e.getTarget()&&!e.hasClass("filtered"),edgeAttributes:{halo:e=>e&&!e.hasClass("filtered")&&(e.isSelected()||e.getSource().isSelected()||e.getTarget().isSelected())?{..._g,scalingMethod:this._ogma.geo.enabled()?"fixed":"scaled"}:null},edgeDependencies:{self:{selection:!0},extremities:{selection:!0}}})}defaultNodeRadius(e){return this.defaultStylesHas(e,["nodeRadius"])?e.nodeRadius:5}defaultEdgeWidth(e){return this.defaultStylesHas(e,["edgeWidth"])?e.edgeWidth:1}defaultStylesHas(e,t){return u.isDefined(e)?u.getIn(e,t)!==void 0:!1}setFilterClass(){this._ogma.styles.createClass({name:"filtered",nodeAttributes:{opacity:we,layer:e=>e.getMetaNode()!==null?1:-1,detectable:!1,badges:{topRight:{text:null},bottomRight:{text:null}},text:null,color:"rgb(240, 240, 240)",innerStroke:{width:1,color:E,minVisibleSize:1},shape:"circle",image:null,icon:null,radius:"50%"},edgeAttributes:{opacity:we,layer:e=>{const t=e.getExtremities().getMetaNode().some(i=>i!==null);return!e.isVirtual()&&t?1:-1},detectable:!1,text:null,color:E,shape:"line",width:.2}})}setExportClass(e){this._exportClass?this._exportClass.update({nodeAttributes:{text:{maxLineLength:e?30:0},halo:null}}):this._exportClass=this._ogma.styles.createClass({name:"exported",nodeAttributes:{text:{minVisibleSize:0,size:12,maxLineLength:e?30:0},halo:null},edgeAttributes:{text:{minVisibleSize:0,size:12},halo:null}})}setBadgeRule(){this._ogma.styles.createClass({name:"degreeIndicator",nodeAttributes:{badges:{bottomLeft:e=>{if(e!==void 0){const t=u.getHiddenNeighbors(e.toList()),i=u.formatNumber(t);if(t>0){const n=e.getData(["statistics","supernode"]);let s=null;return+i!=0&&(s=n?i+"+":i),{color:ae,minVisibleSize:20,stroke:{width:2,color:"#FFFFFF"},text:{font:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.font!==void 0?this._defaultConfiguration.node.text.font:ur,scale:.4,color:oe,content:s}}}}}}}}),this._ogma.events.on("addNodes",e=>e.nodes.addClass("degreeIndicator"))}async refreshPinBadgeStyleRule(){u.isDefined(this._pinnedIndicatorRule)?(await this._pinnedIndicatorRule.refresh(),this._pinnedIndicatorRule.update({priority:100})):(this._pinnedIndicatorRule=this._ogma.styles.addRule({nodeSelector:e=>!e.getAttribute("layoutable"),nodeAttributes:{badges:{topRight:e=>({color:ae,minVisibleSize:20,scale:this._findPinBadgeScale(e),stroke:{width:2,color:"#FFFFFF"},text:{font:"FontAwesome",scale:.4,color:oe,content:""}})}},nodeDependencies:{self:{attributes:["layoutable"]}}}),this._pinnedIndicatorRule.update({priority:100}))}toggleTextOverlap(e){this._ogma.setOptions({texts:{preventOverlap:e}})}refreshRules(){this._nodeDefaultStylesRules.refresh(),this._edgeDefaultStylesRules.refresh()}refreshNodeColors(e){u.isDefined(this._ogmaNodeColor)?(this._nodeAttributes.refresh({color:e}),this._ogmaNodeColor.refresh()):(this._nodeAttributes.refresh({color:e}),this._ogmaNodeColor=this._ogma.styles.addRule({nodeAttributes:{color:t=>{if(t!==void 0)return this._nodeAttributes.color(t.getData())}},nodeDependencies:{self:{data:!0}},nodeSelector:t=>!t.isVirtual()}))}getStyleRule(e,t){return new p(e)[t]}initNodeColors(e){const t=this.getStyleRule(e,D.COLOR);this.refreshNodeColors(t)}initNodesIcons(e){const t=this.getStyleRule(e,D.ICON);this.refreshNodeIcons(t)}initNodesSizes(e){const t=this.getStyleRule(e,D.SIZE);this.refreshNodeSize(t)}initNodesShapes(e){const t=this.getStyleRule(e,D.SHAPE);this.refreshNodeShape(t)}initEdgesWidth(e){const t=this.getStyleRule(e,D.WIDTH);this.refreshEdgeWidth(t)}initEdgesShape(e){const t=this.getStyleRule(e,D.SHAPE);this.refreshEdgeShape(t)}initEdgesColor(e){const t=this.getStyleRule(e,D.COLOR);this.refreshEdgeColors(t)}refreshNodeIcons(e){u.isDefined(this._ogmaNodeIcon)?(this._nodeAttributes.refresh({icon:e}),this._ogmaNodeIcon.refresh()):(this._nodeAttributes.refresh({icon:e}),this._ogmaNodeIcon=this._ogma.styles.addRule({nodeAttributes:{icon:t=>{if(t!==void 0)return this._nodeAttributes.icon(t.getData()).icon},image:t=>{if(t!==void 0&&!t.isVirtual())return this._nodeAttributes.icon(t.getData()).image}},nodeDependencies:{self:{data:!0}},nodeSelector:t=>!t.isVirtual()}))}refreshNodeSize(e){u.isDefined(this._ogmaNodeSize)?(this._nodeAttributes.refresh({size:e}),this._ogmaNodeSize.refresh()):(this._nodeAttributes.refresh({size:e}),this._ogmaNodeSize=this._ogma.styles.addRule({nodeAttributes:{radius:t=>{if(t!==void 0)return this._nodeAttributes.size(t.getData())}},nodeDependencies:{self:{data:!0}},nodeSelector:t=>!t.isVirtual()}))}refreshNodeShape(e){u.isDefined(this._ogmaNodeShape)?(this._nodeAttributes.refresh({shape:e}),this._ogmaNodeShape.refresh()):(this._nodeAttributes.refresh({shape:e}),this._ogmaNodeShape=this._ogma.styles.addRule({nodeAttributes:{shape:t=>{if(t!==void 0)return this._nodeAttributes.shape(t.getData())}},nodeSelector:t=>t!==void 0&&!t.isVirtual(),nodeDependencies:{self:{data:!0}}}))}refreshEdgeColors(e){u.isDefined(this._ogmaEdgeColor)?(this._edgeAttributes.refresh({color:e}),this._ogmaEdgeColor.refresh()):(this._edgeAttributes.refresh({color:e}),this._ogmaEdgeColor=this._ogma.styles.addRule({edgeAttributes:{color:t=>{if(t!==void 0)return this._edgeAttributes.color(t.getData())}},edgeDependencies:{self:{data:!0}}}))}refreshEdgeWidth(e){u.isDefined(this._ogmaEdgeWidth)?(this._edgeAttributes.refresh({width:e}),this._ogmaEdgeWidth.refresh()):(this._edgeAttributes.refresh({width:e}),this._ogmaEdgeWidth=this._ogma.styles.addRule({edgeAttributes:{width:t=>{if(t!==void 0)return this._edgeAttributes.width(t.getData())}},edgeDependencies:{self:{data:!0}}}))}refreshEdgeShape(e){u.isDefined(this._ogmaEdgeShape)?(this._edgeAttributes.refresh({shape:e}),this._ogmaEdgeShape.refresh()):(this._edgeAttributes.refresh({shape:e}),this._ogmaEdgeShape=this._ogma.styles.addRule({edgeAttributes:{shape:t=>{if(t!==void 0)return this._edgeAttributes.shape(t.getData())}},edgeDependencies:{self:{data:!0}}}))}_findPinBadgeScale(e){return this._getNodeRadius(e)*.46>5?.17:.46}_getNodeRadius(e){return!e.isVirtual()||P.isGroupCollapsed(e)?e.getAttribute("radius"):this._ogma.transformations.getXYR(e.toList())[0].radius}}class cr{constructor(e,t,i){this._nodeMaxTextLength=t,this._edgeMaxTextLength=i,this._captionSchema={node:{},edge:{}},this._graphSchema={node:[],edge:[]},this._ogma=e}set graphSchema(e){this._graphSchema=e}refreshSchema(e){this._captionSchema=e}async initVizCaptions(e){this._ogma.LKCaptions.nodesCaptionsRule?(this._ogma.LKCaptions.refreshSchema(e),await this._ogma.LKCaptions.updateNodeCaptions()):this._ogma.LKCaptions.updateNodeCaptions(e.node),this._ogma.LKCaptions.edgesCaptionsRule?(this._ogma.LKCaptions.refreshSchema(e),await this._ogma.LKCaptions.updateEdgeCaptions()):this._ogma.LKCaptions.updateEdgeCaptions(e.edge)}updateNodeCaptions(e){if(e&&(this._captionSchema.node=e),!u.isDefined(this.nodesCaptionsRule))this.nodesCaptionsRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:t=>{if(t===void 0)return"";const i=F.getText(t.getData(),this._captionSchema.node,this._graphSchema.node);return u.isDefined(this._nodeMaxTextLength)?u.truncate(i,"middle",this._nodeMaxTextLength):i}}},nodeSelector:t=>!t.isVirtual(),nodeDependencies:{self:{data:!0}}});else return this.nodesCaptionsRule.refresh()}updateEdgeCaptions(e){if(e&&(this._captionSchema.edge=e),!u.isDefined(this.edgesCaptionsRule))this.edgesCaptionsRule=this._ogma.styles.addRule({edgeAttributes:{text:{content:t=>{if(t===void 0||t.getData()===void 0)return"";const i=F.getText(t.getData(),this._captionSchema.edge,this._graphSchema.edge);return u.isDefined(this._edgeMaxTextLength)?u.truncate(i,"middle",this._edgeMaxTextLength):i}}},edgeSelector:t=>!t.isVirtual(),edgeDependencies:{self:{data:!0,attributes:["shape.style"]}}});else return this.edgesCaptionsRule.refresh()}}function R(r){return typeof r=="function"}function mg(r){return R(r==null?void 0:r.lift)}function dr(r){return function(e){if(mg(e))return e.lift(function(t){try{return r(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}var Oe=function(r,e){return Oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},Oe(r,e)};function Ye(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Oe(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Pt(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Le(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,s=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(o){a={error:o}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return s}function Ie(r,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return r.concat(s||Array.prototype.slice.call(e))}function Sg(r){var e=function(i){Error.call(i),i.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Ae=Sg(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
2
2
|
`+t.map(function(i,n){return n+1+") "+i.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=t}});function Rt(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var Je=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,i,n,s;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=Mt(a),l=o.next();!l.done;l=o.next()){var c=l.value;c.remove(this)}}catch(b){e={error:b}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var d=this.initialTeardown;if(M(d))try{d()}catch(b){s=b instanceof Ae?b.errors:[b]}var g=this._finalizers;if(g){this._finalizers=null;try{for(var h=Mt(g),v=h.next();!v.done;v=h.next()){var S=v.value;try{Gt(S)}catch(b){s=s??[],b instanceof Ae?s=Pe(Pe([],Ie(s)),Ie(b.errors)):s.push(b)}}}catch(b){i={error:b}}finally{try{v&&!v.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}}if(s)throw new Ae(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Gt(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Rt(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&Rt(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();Je.EMPTY;function Eg(r){return r instanceof Je||r&&"closed"in r&&M(r.remove)&&M(r.add)&&M(r.unsubscribe)}function Gt(r){M(r)?r():r.unsubscribe()}var xg={useDeprecatedNextContext:!1},Fg={setTimeout:function(r,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,Pe([r,e],Ie(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function Tg(r){Fg.setTimeout(function(){throw r})}function zt(){}var hr=function(r){We(e,r);function e(t){var i=r.call(this)||this;return i.isStopped=!1,t?(i.destination=t,Eg(t)&&t.add(i)):i.destination=Og,i}return e.create=function(t,i,n){return new Dg(t,i,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Je),$g=Function.prototype.bind;function Ee(r,e){return $g.call(r,e)}var Ng=function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(i){ee(i)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){ee(i)}else ee(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){ee(t)}},r}(),Dg=function(r){We(e,r);function e(t,i,n){var s=r.call(this)||this,a;if(M(t)||!t)a={next:t??void 0,error:i??void 0,complete:n??void 0};else{var o;s&&xg.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return s.unsubscribe()},a={next:t.next&&Ee(t.next,o),error:t.error&&Ee(t.error,o),complete:t.complete&&Ee(t.complete,o)}):a=t}return s.destination=new Ng(a),s}return e}(hr);function ee(r){Tg(r)}function wg(r){throw r}var Og={closed:!0,next:zt,error:wg,complete:zt};function Lg(r){return r}function fr(r,e,t,i,n){return new Ig(r,e,t,i,n)}var Ig=function(r){We(e,r);function e(t,i,n,s,a,o){var l=r.call(this,t)||this;return l.onFinalize=a,l.shouldUnsubscribe=o,l._next=i?function(c){try{i(c)}catch(d){t.error(d)}}:r.prototype._next,l._error=s?function(c){try{s(c)}catch(d){t.error(d)}finally{this.unsubscribe()}}:r.prototype._error,l._complete=n?function(){try{n()}catch(c){t.error(c)}finally{this.unsubscribe()}}:r.prototype._complete,l}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;r.prototype.unsubscribe.call(this),!i&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(hr);function Pg(r,e){return gr(function(t,i){var n=0;t.subscribe(fr(i,function(s){i.next(r.call(e,s,n++))}))})}function Mg(r,e){return e===void 0&&(e=Lg),r=r??Rg,gr(function(t,i){var n,s=!0;t.subscribe(fr(i,function(a){var o=e(a);(s||!r(n,o))&&(s=!1,n=o,i.next(a))}))})}function Rg(r,e){return r===e}class pr extends Sr.BehaviorSubject{constructor(e){super(e)}dispatch(e){this.next(e(this.value))}selectStore(e){return this.pipe(Pg(e),Mg((t,i)=>u.isEqual(t,i)))}clear(){this.next({selection:void 0,items:{node:[],edge:[]},changes:void 0,animation:!1})}}class Gg{constructor(e){this._store=new pr({selection:void 0,items:{node:[],edge:[]},changes:void 0,animation:!1}),this._ogma=e,this.listenToSelectionEvents()}get store(){return this._store}listenToSelectionEvents(){let e=Date.now(),t=!1;this._ogma.events.on("animate",i=>{if(i.updatesPositions===!1)return;t||(t=!0,this._store.dispatch(a=>({...a,animation:!0})));const n=Math.max(e,Date.now()+i.duration);if(n===e)return;e=n;const s=e-Date.now()+16;clearTimeout(this._animationThrottle),this._animationThrottle=setTimeout(()=>{t=!1,this._store.dispatch(a=>({...a,animation:!1}))},s)}),this._ogma.events.on("dragStart",()=>{this._store.dispatch(i=>({...i,animation:!0}))}),this._ogma.events.on("dragEnd",()=>{this._store.dispatch(i=>({...i,animation:!1}))}),this._ogma.events.on("addNodes",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("removeNodes",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("addEdges",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("removeEdges",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("geoDisabled",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("geoEnabled",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("nodesSelected",()=>{this._store.dispatch(this.storeNodeSelection.bind(this))}),this._ogma.events.on("edgesSelected",()=>{this._store.dispatch(this.storeEdgeSelection.bind(this))}),this._ogma.events.on("nodesUnselected",()=>{this._store.dispatch(this.storeNodeSelection.bind(this))}),this._ogma.events.on("edgesUnselected",()=>{this._store.dispatch(this.storeEdgeSelection.bind(this))}),this._ogma.events.on("updateNodeData",i=>{i!==void 0&&i.changes.forEach(n=>{this._store.dispatch(s=>({...s,changes:{entityType:"node",input:n.property,value:n.newValues[0]}}))})}),this._ogma.events.on("updateEdgeData",i=>{i!==void 0&&i.changes.forEach(n=>{this._store.dispatch(s=>({...s,changes:{entityType:"edge",input:n.property,value:n.newValues[0]}}))})})}storeItems(e){return{...e,items:{node:this._ogma.getNodes().getId(),edge:this._ogma.getEdges().getId()}}}storeNodeSelection(e){return{...e,selection:this._ogma.getSelectedNodes()}}storeEdgeSelection(e){return{...e,selection:this._ogma.getSelectedEdges()}}}const br=750;class zg extends mr{constructor(e,t){super(e),this._configuration=e,Object.setPrototypeOf(this,new.target.prototype),this.initOgmaLinkuriousParser(!0,t)}initOgmaLinkuriousParser(e,t){this.nodeCategoriesWatcher=this.schema.watchNodeNonObjectProperty({path:"categories",unwindArrays:!0,filter:"all"}),this.edgeTypeWatcher=this.schema.watchEdgeNonObjectProperty({path:"type",filter:"all"}),this.setOptions({interactions:{zoom:{maxValue:i=>128/i.smallestNodeSize},selection:{enabled:!1}}}),this._reactive===void 0?(this._reactive=new Gg(this),this.store=this._reactive.store):this._reactive.listenToSelectionEvents(),this.initSelection(),this.setConfigOgma(this._configuration,e,t),this.LKTransformation=new yr(this),this.LkNodeGroupingTransformation=new Y(this),this.LKStyles.setNodesDefaultHalo(),this.LKStyles.setEdgesDefaultHalo(),this.LKStyles.setBadgeRule(),this.LKStyles.setFilterClass()}initSelection(){this.events.onClick(e=>{if(e!==void 0&&e.button==="left")if(e.target!==null){const t=navigator.platform==="MacIntel"?"cmd":"ctrl";this.keyboard.isKeyPressed(t)?(e.target.isNode&&this.getSelectedEdges().size>0&&this.getSelectedEdges().setSelected(!1),!e.target.isNode&&this.getSelectedNodes().size>0&&this.getSelectedNodes().setSelected(!1),e.target.isSelected()?e.target.setSelected(!1):e.target.setSelected(!0)):(this.getSelectedNodes().setSelected(!1),this.getSelectedEdges().setSelected(!1),e.target.setSelected(!0))}else this.getSelectedNodes().setSelected(!1),this.getSelectedEdges().setSelected(!1)})}setStyles(e,t){var i,n,s,a;this.LKStyles=new cr(this,{node:((n=(i=e==null?void 0:e.options)==null?void 0:i.styles)==null?void 0:n.node)||{},edge:((a=(s=e==null?void 0:e.options)==null?void 0:s.styles)==null?void 0:a.edge)||{},baseUrl:t}),this.LKStyles.setNodesDefaultStyles(),this.LKStyles.setEdgesDefaultStyles()}setCaptions(e){var n,s,a,o,l,c,d,g;const t=(o=(a=(s=(n=e==null?void 0:e.options)==null?void 0:n.styles)==null?void 0:s.node)==null?void 0:a.text)==null?void 0:o.maxTextLength,i=(g=(d=(c=(l=e==null?void 0:e.options)==null?void 0:l.styles)==null?void 0:c.edge)==null?void 0:d.text)==null?void 0:g.maxTextLength;this.LKCaptions=new dr(this,t,i)}getForceLayoutParams(e,t=0){let i=300-.052*this.getNodes().size;return i<40&&(i=40),{steps:e===f.ForceLayoutMode.FAST?i:300,alignSiblings:this.getNodes().size>3,duration:t,charge:20,gravity:.08,theta:this.getNodes().size>100?.8:.34}}getRadialLayoutParams(e,t=0){return{centralNode:e,radiusDelta:1,nodeGap:10,repulsion:this.getNodes().size>80?1:6,duration:t}}getHierarchicalLayoutParams(e,t,i=0){return{direction:e,roots:[t],duration:i}}async init(e){this.clearGraph();let t,i=[];const n=e.nodes.map(a=>(a.attributes.selected&&(t=f.EntityType.NODE,i.push(a.id)),delete a.attributes.selected,a)),s=e.edges.map(a=>(a.attributes!==void 0&&(a.attributes.selected&&((t===void 0||t===f.EntityType.NODE)&&(t=f.EntityType.EDGE,i=[]),i.push(a.id)),delete a.attributes.selected),a));await this.addGraphAfterValidation({nodes:n,edges:s}),t===f.EntityType.NODE?this.getNodes(i).setSelected(!0):t===f.EntityType.EDGE&&this.getEdges(i).setSelected(!0)}async initVisualization(e){await this.init(e);const t=p.sanitizeStylesIndex(e.design.styles);this.LKStyles.initNodeColors(t.node),this.LKStyles.initNodesIcons(t.node),this.LKStyles.initNodesSizes(t.node),this.LKStyles.initNodesShapes(t.node),this.LKStyles.initEdgesWidth(t.edge),this.LKStyles.initEdgesShape(t.edge),this.LKStyles.initEdgesColor(t.edge),await this.LKCaptions.initVizCaptions({node:e.nodeFields.captions||{},edge:e.edgeFields.captions||{}}),this.LKTransformation.groupedEdges=e.edgeGrouping,await this.LKTransformation.initTransformation(),this.LKTransformation.initEdgeGroupingStyle()}async addGraphAfterValidation(e){const t=await this.addNodes(e.nodes),i=await this.addEdges(e.edges);return{nodes:t,edges:i}}addEdges(e,t){return super.addEdges(e,{...t,ignoreInvalid:!0})}getNonFilteredNodes(e){return u.isDefined(e)?this.getNodes(e).filter(t=>!t.hasClass("filtered")):this.getNodes("raw").filter(t=>!t.hasClass("filtered"))}getFilteredNodes(e,t="raw"){return u.isDefined(e)?this.getNodes(e).filter(i=>i.hasClass("filtered")):this.getNodes(t).filter(i=>i.hasClass("filtered"))}getNonFilteredEdges(e){return u.isDefined(e)?this.getEdges(e).filter(t=>!t.hasClass("filtered")):this.getEdges("raw").filter(t=>!t.hasClass("filtered"))}getFilteredEdges(e,t="raw"){return u.isDefined(e)?this.getEdges(e).filter(i=>i.hasClass("filtered")):this.getEdges(t).filter(i=>i.hasClass("filtered"))}shutDown(){this.destroy(),this.store&&this.store.clear()}clearOgmaState(){this.reset(),this.store&&this.store.clear(),this.initOgmaLinkuriousParser()}setConfigOgma(e,t,i){e&&(this._configuration=e),t||this.setOptions({...this._configuration.options,renderer:this._configuration.renderer}),this.setStyles(this._configuration,i),this.setCaptions(this._configuration)}getSelectedNodes(){return this.getNodes("all").filter(e=>e.isSelected())}clearSelection(){this.getSelectedNodes().setSelected(!1),this.getSelectedEdges().setSelected(!1)}}const Bg={steps:250,alignSiblings:!0,charge:20,theta:.34,duration:br,gravity:.0475};class w{static getHiddenNeighbors(e){return e.reduce((t,i)=>{const n=i.getData("statistics");if(n!==void 0){const s=n.degree!==void 0&&!n.supernode?n.degree-u.getDegreeWithoutSelfConnection(i):n.supernodeDegree;if(s!==void 0&&s>0)return t+=s}return t},0)}static getDegreeWithoutSelfConnection(e){return e.getAdjacentNodes({policy:"exclude-sources",filter:"all"}).size}static isBright(e){if(e===null||!u.isStringFilled(e))return!0;const t=/#[A-Fa-f0-9]{3,6}/,i=/^rgb\(\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*\)$/i,n=/^rgba\(\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*(?:0|1|0?\.\d+)\s*\)$/i;let s;if(t.test(e)){e.length<5&&(e+=e.slice(1)),e=e.replace("#","");const c=parseInt(e[0].toString()+e[1].toString(),16),d=parseInt(e[2].toString()+e[3].toString(),16),g=parseInt(e[4].toString()+e[5].toString(),16);s=`rgb(${c}, ${d}, ${g})`}else if(i.test(e)||n.test(e)||te[e.toLowerCase()]!==void 0)s=u.isDefined(te[e.toLowerCase()])?te[e.toLowerCase()].rgb:e;else return!0;const[a,o,l]=/rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(,(?:0|1|0?\.\d+))?\)/.exec(s.replace(/\s/g,"")).slice(1,4);return!u.isDefined(a)||!u.isDefined(o)||!u.isDefined(l)?(console.warn("The given color is not a valid rgb formatted color"),!0):(+a*299+ +o*587+ +l*114)/1e3>255*.7}static isNode(e){return e.isNode}static isNodeList(e){return e.isNode}static topologicalSort(e){const i=e.toArray().filter(a=>a.getDegree()===1),n=new Set,s=[];return i.forEach(a=>{let o=a;if(n.has(o))return;const l=[];for(;o;){l.push(o),n.add(o);const c=o.getAdjacentNodes().filter(d=>!n.has(d)).get(0);o=c===void 0?null:c}s.push(l)}),s.sort((a,o)=>o.length-a.length),{chain:s.flat().map(a=>a.getId()),numberOfChain:i.length/2}}static isStar(e){for(const t of e.toArray()){const i=t.getAdjacentNodes();if(t.getDegree()>2&&i.getDegree().every(s=>s===1)&&i.size+1===e.size)return t}return!1}static isGroupCollapsed(e){return e.getData("collapsed")}static setCollapsedGroupProperty(e,t){e.setData("collapsed",t)}}const ue="LKE_NODE_GROUPING_EDGE";class Y{constructor(e){this._collapsedDefaultValue=!1,this._nodeGroupingAttributes=[],this._ogma=e}setGroupingRule(e){this.groupRule=e}async initTransformation(){this.transformation===void 0?this.transformation=this._ogma.transformations.addNodeGrouping({groupIdFunction:e=>{if(this._isRuleNotApplicableToNode(e))return;const t=this.groupRule;return t.groupingType===f.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._getAdjacentEdgeGroupId(e,t):this._getPropertyValueGroupId(e,t)},nodeGenerator:e=>{const t=new Set(e.getData("categories").flat()),i=this._findNodeGroupId(e);return{data:{categories:[],subCategories:Array.from(t),collapsed:this._getDefaultCollapsedState(i),nodeGroupId:i},attributes:{layoutable:this._getDefaultLayoutableValue(i)}}},onGroupUpdate:async(e,t)=>await this.runSubNodesLayout(t),edgeGenerator:()=>({data:{type:ue}}),showContents:e=>!w.isGroupCollapsed(e),duration:300,padding:10}):await this.refreshTransformation()}async refreshTransformation(){this.transformation!==void 0?(await this.transformation.refresh(),await this._unpinNodes(this._getAllTransformationRawNodes())):await this.initTransformation()}initNodeGroupingStyle(){this._nodeGroupingStyleRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:e=>this._getNodeGroupingCaption(e),style:"bold"},layer:-1,color:"rgba(240, 240, 240)",innerStroke:{color:"#7f7f7f",width:2}},nodeSelector:e=>e.isVirtual()&&!w.isGroupCollapsed(e),nodeDependencies:{self:{data:!0}}}),this._initIntermediateGroupStyle(),this._nodeGroupingCollapsedStyleRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:e=>this._getNodeGroupingCaption(e),style:"bold"},halo:{width:4,color:"#e4ebea",strokeColor:"#ccc"},badges:{bottomLeft:e=>{var i;const t=(i=e.getSubNodes().filter(n=>!n.hasClass("filtered")))==null?void 0:i.size;return{color:ae,minVisibleSize:20,stroke:{width:2,color:"#FFFFFF"},text:{font:u.isDefined(this._ogma.LKStyles.nodeFont)?this._ogma.LKStyles.nodeFont:lr,scale:.4,color:oe,content:`x${t}`}}},topLeft:()=>({color:ae,minVisibleSize:20,stroke:{width:2,color:"#FFFFFF"},text:{font:"FontAwesome",scale:.4,color:oe,content:""}})},color:e=>{if(e!==void 0)return this._ogma.LKStyles.nodeAttributes.color({geo:{},isVirtual:!1,properties:{},readAt:0,categories:e.getData("subCategories")})},icon:e=>{const t=e==null?void 0:e.getData("subCategories");if(!(!u.isDefined(e)||t.length>1))return this._ogma.LKStyles.nodeAttributes.icon({geo:{},isVirtual:!1,properties:{},readAt:0,categories:t}).icon}},nodeSelector:e=>e.isVirtual()&&w.isGroupCollapsed(e)&&!e.hasClass("filtered"),nodeDependencies:{self:{attributes:["styleRefreshIndex"]}}}),this._setSubSelectedClass()}async refreshNodeGroupingStyle(){var e,t;await((e=this._nodeGroupingStyleRule)==null?void 0:e.refresh()),await((t=this._nodeGroupingCollapsedStyleRule)==null?void 0:t.refresh())}async runSubNodesLayout(e){if(e.size===0||e.size===1)return;if(e.size===2)return this._runTwoNodesLayout(e);if(e.getAdjacentEdges({bothExtremities:!0}).size===0)return this._runCirclePack(e);const i=w.isStar(e);if(i){const o=e.filter(c=>c!==i),l=this._runCircularLayout({radii:o.getAttribute("radius"),cx:i.getAttribute("x"),cy:i.getAttribute("y"),clockwise:!1,distanceRatio:5});return[i.getPosition(),...l]}const n=e.getDegree(),s=n.every(o=>o===1||o===2),a=n.some(o=>o===1);if(s&&a){await this._runChainLayout(e);return}return await this._runForceLayout(e)}getVirtualNodesOfTransformation(){return this.transformation.getContext().metaNodes}setNodeGroupingAttributes(e){this._nodeGroupingAttributes=e}setCollapseDefaultValue(e){this._collapsedDefaultValue=e}_getNodeGroupingCaption(e){if(!(!u.isDefined(e)||!u.isDefined(this.groupRule)))return this.groupRule.groupingType===f.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._getAdjacentEdgeNodeGroupingCaption(e,this.groupRule):this._getPropertyValueNodeGroupingCaption(e,this.groupRule)}_getAdjacentEdgeNodeGroupingCaption(e,t){const i=e.getSubNodes();return!u.isDefined(i)||!u.isDefined(i.get(0))?void 0:Y._getGroupCentralNode(i.get(0),t).getData(["properties","name"])}_getPropertyValueNodeGroupingCaption(e,t){var i;if(e.isVirtual()&&((i=e.getSubNodes())==null?void 0:i.get(0))!==void 0){const n=e.getSubNodes().get(0).getData(["properties",t.groupingOptions.propertyKey]),s=u.getValueFromLkProperty(n),a=e.getSubNodes().filter(o=>!o.hasClass("filtered")).size;return`${s} (${a})`}}_runCirclePack(e){return Promise.resolve(this._ogma.algorithms.circlePack({nodes:e,margin:10,sort:"asc",dryRun:!0}))}async _runChainLayout(e){const t=w.topologicalSort(e),i=this._ogma.getNodes(t.chain);await this._ogma.layouts.grid({nodes:i,colDistance:Math.max(...e.getAttribute("radius").map(Number))*4,rows:t.numberOfChain??1})}async _runForceLayout(e){await this._ogma.layouts.force({nodes:e,...Bg})}_isRuleNotApplicableToNode(e){const t=this.groupRule;return t===void 0?!0:t.groupingType===f.NodeGroupingType.BY_PROPERTY_VALUE?this._isPropertyRuleNotApplicableToNode(e,t):t.groupingType===f.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._isRelationshipRuleNotApplicableToNode(e,t):!0}_isRelationshipRuleNotApplicableToNode(e,t){return!this.hasEdgeOfType(e,t.groupingOptions.edgeType)}hasEdgeOfType(e,t){let i=!1;return e.getAdjacentEdges().forEach(n=>{n.getData("type")===t&&(i=!0)}),i}_isPropertyRuleNotApplicableToNode(e,t){const i=e.getData(["properties",t.groupingOptions.propertyKey??""]);return t.groupingOptions.itemTypes.every(n=>!e.getData("categories").includes(n))||!u.isDefined(i)||typeof i=="object"&&i.status==="missing"}async _unpinNodes(e){await Promise.all(e.map(t=>{if(t!==null)return t.setAttribute("layoutable",!0)}))}_getAllTransformationRawNodes(){return this.getVirtualNodesOfTransformation().getSubNodes()}_findGroupingPropertyValue(e){const t=this.groupRule,i=e.getData(["properties",t.groupingOptions.propertyKey??""]);return`${u.getValueFromLkProperty(i)}`}_findNodeGroupId(e){var i;const t=this.groupRule;if(t.groupingType===f.NodeGroupingType.BY_ADJACENT_EDGE_TYPE){const n=Y._getGroupCentralNode(e.get(0),t);return se(`${(i=this.groupRule)==null?void 0:i.name}-${n.getId()}`)}else{const n=this._findGroupingPropertyValue(e.get(0));return se(`${t.name}-${t.groupingOptions.itemTypes.join("-")}-${n}`)}}static _getGroupCentralNode(e,t){const i=e.getAdjacentEdges({filter:"raw"}).filter(s=>s.getData("type")===t.groupingOptions.edgeType).get(0);return t.groupingOptions.centralNodeIs==="source"?i.getSource():i.getTarget()}_runCircularLayout({radii:e,clockwise:t=!0,cx:i=0,cy:n=0,startAngle:s=3/2*Math.PI,getRadius:a=l=>Number(l),distanceRatio:o=0}){const l=e.length;if(l===0)return[];if(l===1)return[{x:i,y:n}];const c=e.map(a).reduce((A,E)=>Math.max(A,E),0)*(2+o),g=(2*Math.PI-2*Math.PI/l)/Math.max(1,l-1),h=Math.cos(g)-Math.cos(0),v=Math.sin(g)-Math.sin(0),S=Math.sqrt(c*c/(h*h+v*v)),b=Math.max(S,0);return e.map((A,E)=>{const x=s+E*g*(t?1:-1),G=b*Math.cos(x),_=b*Math.sin(x);return{x:i+G,y:n+_}})}async _runTwoNodesLayout(e){const t=e.getAttribute("radius").map(Number),i=e.getPosition(),n=Math.min(...t);return[i[0],{x:i[0].x+n+t[0]+t[1],y:i[0].y}]}_getPropertyValueGroupId(e,t){const i=this._findGroupingPropertyValue(e);return`${t.groupingOptions.itemTypes.join("-")}-${i}`.toLowerCase().trim()}_getAdjacentEdgeGroupId(e,t){return Y._getGroupCentralNode(e,t).getId().toString()}_initIntermediateGroupStyle(){this._ogma.styles.addRule({nodeAttributes:{color:"rgba(240, 240, 240)"},nodeSelector:e=>e.isVirtual()&&w.isGroupCollapsed(e),nodeDependencies:{self:{data:!0}}})}_getDefaultCollapsedState(e){const t=this._nodeGroupingAttributes.find(i=>i.id===e);return u.isDefined(t)&&u.isDefined(t.attributes.collapsed)?t.attributes.collapsed:this._collapsedDefaultValue}_getDefaultLayoutableValue(e){const t=this._nodeGroupingAttributes.find(i=>i.id===e);return u.isDefined(t)&&u.isDefined(t.attributes.layoutable)?t.attributes.layoutable:!0}_setSubSelectedClass(){this._ogma.styles.createClass({name:"subSelection",nodeAttributes:{halo:{width:4,color:"#e67a8f",strokeColor:"#ccc"}}})}}const jg={color:"#000000",shape:{style:"dashed",head:"arrow"},width:1.5};class yr{constructor(e){this._ogma=e,this.groupedEdges={}}async initTransformation(){this.transformation===void 0?this.transformation=this._ogma.transformations.addEdgeGrouping({separateEdgesByDirection:!0,selector:e=>this.groupedEdges[e.getData("type")],groupIdFunction:e=>e.getData("type"),generator:e=>({data:{properties:{originalType:e.getData("type")[0]}}})}):await this.transformation.refresh()}initEdgeGroupingStyle(){this.edgeGroupingStyleRule=this._ogma.styles.addRule({edgeAttributes:{...jg,...this.edgeGroupStyle,text:{content:e=>{if(e!==void 0&&e.getSubEdges()!==null&&e.getData("type")!==ue){const t=e.getSubEdges().filter(i=>!i.hasClass("filtered")).size;return`${e.getData(["properties","originalType"])} (${t})`}},style:"bold"}},edgeSelector:e=>e.isVirtual()&&e.getSubEdges()&&e.getSubEdges().filter(t=>!t.hasClass("filtered")).size>0&&e.getData("type")!==ue,edgeDependencies:{self:{data:!0}}})}refreshEdgeGroupingStyle(){this.edgeGroupingStyleRule!==void 0&&this.edgeGroupingStyleRule.refresh()}}const m=class m{static isFiltered(e,t){return u.isDefined(t)?"categories"in t?m.getFilterFunction(e,!0)(t):m.getFilterFunction(e,!1)(t):!1}static getFilterFunction(e,t){const i=JSON.stringify(e,null,""),n=t?m.nodeCache:m.edgeCache;let s=n.get(i);return s||(s=m.createFilterFunction(e,t),n.size>m.FILTER_CACHE_SIZE&&n.clear(),n.set(i,s)),s}static createFilterFunction(e,t){const i=e.map(n=>m.filterToFilterFunction(n,t));return n=>{for(const s of i)if(s(n))return!0;return!1}}static filterToFilterFunction(e,t){switch(e.type){case f.SelectorType.ANY:return m.createAnyFilterFunction(e,t);case f.SelectorType.IS:return m.createIsFilterFunction(e,t);case f.SelectorType.NO_VALUE:return m.createNoValueFilterFunction(e,t);case f.SelectorType.RANGE:return m.createRangeFilterFunction(e,t);case f.SelectorType.NAN:return m.createNaNFilterFunction(e,t)}}static createAnyFilterFunction(e,t){return t?i=>e.itemType===void 0?!0:i.categories.includes(e.itemType):i=>i.type===e.itemType}static createIsFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&u.getPropertyValue(u.getIn(i,e.input),!0)===e.value:i=>i.type===e.itemType&&u.getPropertyValue(u.getIn(i,e.input),!0)===e.value}static createNoValueFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&!u.isDefined(u.getPropertyValue(u.getIn(i,e.input),!0)):i=>i.type===e.itemType&&!u.isDefined(u.getPropertyValue(u.getIn(i,e.input),!0))}static createNaNFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&m.isNotANumber(u.getPropertyValue(u.getIn(i,e.input),!0)):i=>i.type===e.itemType&&m.isNotANumber(u.getPropertyValue(u.getIn(i,e.input),!0))}static isNotANumber(e){return u.isDefined(e)&&!u.isNumber(e)}static createRangeFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&m.valueShouldBeHidden(u.getPropertyValue(u.getIn(i,e.input),!1),e.value):i=>i.type===e.itemType&&m.valueShouldBeHidden(u.getPropertyValue(u.getIn(i,e.input),!1),e.value)}static valueShouldBeHidden(e,t){const i=u.parseFloat(e);return Number.isNaN(i)?!1:t["<"]!==void 0&&i<t["<"]||t["<="]!==void 0&&i<=t["<="]||t[">"]!==void 0&&i>t[">"]||t[">="]!==void 0&&i>=t[">="]}};m.nodeCache=new Map,m.edgeCache=new Map,m.FILTER_CACHE_SIZE=5;let Me=m;const Ug=r=>r.selection.size,Vg=r=>{switch(r.selection.size){case 1:return"selection";case 0:return"noSelection";default:return"multiSelection"}},kg=r=>{if(!(!u.isDefined(r.selection)||r.selection.size===0))return r.selection.isNode?f.EntityType.NODE:f.EntityType.EDGE},ve=r=>u.isDefined(r.selection)&&r.selection.size===1?r.selection.get(0):void 0,Hg=r=>{const e=ve(r);if(e!==void 0)return e.isNode?e.getData("categories"):[e.getData("type")]},Kg=r=>{const e=ve(r);if(e!==void 0)return e.isNode?"node":"edge"},vr=r=>{const e=ve(r);if(e!==void 0){const t=e.getData().properties;return Object.keys(t).map(i=>({key:i,value:t[i]}))}return[]},qg=r=>vr(r).length>0;exports.ANIMATION_DURATION=br;exports.BASE_GREY=T;exports.Captions=$;exports.CaptionsViz=dr;exports.EdgeAttributes=j;exports.FILTER_OPACITY=Oe;exports.Filters=Me;exports.HTML_COLORS=te;exports.ItemAttributes=F;exports.LKE_NODE_GROUPING_EDGE=ue;exports.LKOgma=zg;exports.NodeAttributes=P;exports.OgmaStore=pr;exports.OgmaTools=w;exports.PALETTE=we;exports.StyleRule=C;exports.StyleRuleType=ur;exports.StyleRules=p;exports.StyleType=D;exports.StylesViz=cr;exports.Tools=u;exports.TransformationsViz=yr;exports.getSelectionEntity=kg;exports.getSelectionProperties=vr;exports.getSelectionSize=Ug;exports.getSelectionState=Vg;exports.getUniqSelection=ve;exports.getUniqSelectionEntity=Kg;exports.getUniqSelectionTypes=Hg;exports.hasSelectionProperties=qg;
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=t}});function Rt(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var We=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,i,n,s;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=Pt(a),l=o.next();!l.done;l=o.next()){var c=l.value;c.remove(this)}}catch(b){e={error:b}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var d=this.initialTeardown;if(R(d))try{d()}catch(b){s=b instanceof Ae?b.errors:[b]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var f=Pt(h),v=f.next();!v.done;v=f.next()){var S=v.value;try{Mt(S)}catch(b){s=s??[],b instanceof Ae?s=Ie(Ie([],Le(s)),Le(b.errors)):s.push(b)}}}catch(b){i={error:b}}finally{try{v&&!v.done&&(n=f.return)&&n.call(f)}finally{if(i)throw i.error}}}if(s)throw new Ae(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Mt(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Rt(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&Rt(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();We.EMPTY;function Cg(r){return r instanceof We||r&&"closed"in r&&R(r.remove)&&R(r.add)&&R(r.unsubscribe)}function Mt(r){R(r)?r():r.unsubscribe()}var Ag={setTimeout:function(r,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,Ie([r,e],Le(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function Eg(r){Ag.setTimeout(function(){throw r})}function Gt(){}var gr=function(r){Ye(e,r);function e(t){var i=r.call(this)||this;return i.isStopped=!1,t?(i.destination=t,Cg(t)&&t.add(i)):i.destination=$g,i}return e.create=function(t,i,n){return new Fg(t,i,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(We),xg=function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(i){ee(i)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){ee(i)}else ee(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){ee(t)}},r}(),Fg=function(r){Ye(e,r);function e(t,i,n){var s=r.call(this)||this,a;return R(t)||!t?a={next:t??void 0,error:i??void 0,complete:n??void 0}:a=t,s.destination=new xg(a),s}return e}(gr);function ee(r){Eg(r)}function Tg(r){throw r}var $g={closed:!0,next:Gt,error:Tg,complete:Gt};function Ng(r){return r}function hr(r,e,t,i,n){return new Dg(r,e,t,i,n)}var Dg=function(r){Ye(e,r);function e(t,i,n,s,a,o){var l=r.call(this,t)||this;return l.onFinalize=a,l.shouldUnsubscribe=o,l._next=i?function(c){try{i(c)}catch(d){t.error(d)}}:r.prototype._next,l._error=s?function(c){try{s(c)}catch(d){t.error(d)}finally{this.unsubscribe()}}:r.prototype._error,l._complete=n?function(){try{n()}catch(c){t.error(c)}finally{this.unsubscribe()}}:r.prototype._complete,l}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;r.prototype.unsubscribe.call(this),!i&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(gr);function wg(r,e){return dr(function(t,i){var n=0;t.subscribe(hr(i,function(s){i.next(r.call(e,s,n++))}))})}function Og(r,e){return e===void 0&&(e=Ng),r=r??Lg,dr(function(t,i){var n,s=!0;t.subscribe(hr(i,function(a){var o=e(a);(s||!r(n,o))&&(s=!1,n=o,i.next(a))}))})}function Lg(r,e){return r===e}class fr extends Sr.BehaviorSubject{constructor(e){super(e)}dispatch(e){this.next(e(this.value))}selectStore(e){return this.pipe(wg(e),Og((t,i)=>u.isEqual(t,i)))}clear(){this.next({selection:void 0,items:{node:[],edge:[]},changes:void 0,animation:!1})}}class Ig{constructor(e){this._store=new fr({selection:void 0,items:{node:[],edge:[]},changes:void 0,animation:!1}),this._ogma=e,this.listenToSelectionEvents()}get store(){return this._store}listenToSelectionEvents(){let e=Date.now(),t=!1;this._ogma.events.on("animate",i=>{if(i.updatesPositions===!1)return;t||(t=!0,this._store.dispatch(a=>({...a,animation:!0})));const n=Math.max(e,Date.now()+i.duration);if(n===e)return;e=n;const s=e-Date.now()+16;clearTimeout(this._animationThrottle),this._animationThrottle=setTimeout(()=>{t=!1,this._store.dispatch(a=>({...a,animation:!1}))},s)}),this._ogma.events.on("dragStart",()=>{this._store.dispatch(i=>({...i,animation:!0}))}),this._ogma.events.on("dragEnd",()=>{this._store.dispatch(i=>({...i,animation:!1}))}),this._ogma.events.on("addNodes",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("removeNodes",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("addEdges",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("removeEdges",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("geoDisabled",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("geoEnabled",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("nodesSelected",()=>{this._store.dispatch(this.storeNodeSelection.bind(this))}),this._ogma.events.on("edgesSelected",()=>{this._store.dispatch(this.storeEdgeSelection.bind(this))}),this._ogma.events.on("nodesUnselected",()=>{this._store.dispatch(this.storeNodeSelection.bind(this))}),this._ogma.events.on("edgesUnselected",()=>{this._store.dispatch(this.storeEdgeSelection.bind(this))}),this._ogma.events.on("updateNodeData",i=>{i!==void 0&&i.changes.forEach(n=>{this._store.dispatch(s=>({...s,changes:{entityType:"node",input:n.property,value:n.newValues[0]}}))})}),this._ogma.events.on("updateEdgeData",i=>{i!==void 0&&i.changes.forEach(n=>{this._store.dispatch(s=>({...s,changes:{entityType:"edge",input:n.property,value:n.newValues[0]}}))})})}storeItems(e){return{...e,items:{node:this._ogma.getNodes().getId(),edge:this._ogma.getEdges().getId()}}}storeNodeSelection(e){return{...e,selection:this._ogma.getSelectedNodes()}}storeEdgeSelection(e){return{...e,selection:this._ogma.getSelectedEdges()}}}const pr=750;class Pg extends mr{constructor(e,t){super(e),this._configuration=e,Object.setPrototypeOf(this,new.target.prototype),this.initOgmaLinkuriousParser(!0,t)}initOgmaLinkuriousParser(e,t){this.nodeCategoriesWatcher=this.schema.watchNodeNonObjectProperty({path:"categories",unwindArrays:!0,filter:"all"}),this.edgeTypeWatcher=this.schema.watchEdgeNonObjectProperty({path:"type",filter:"all"}),this.setOptions({interactions:{zoom:{maxValue:i=>128/i.smallestNodeSize},selection:{enabled:!1}}}),this._reactive===void 0?(this._reactive=new Ig(this),this.store=this._reactive.store):this._reactive.listenToSelectionEvents(),this.initSelection(),this.setConfigOgma(this._configuration,e,t),this.LKTransformation=new yr(this),this.LkNodeGroupingTransformation=new q(this),this.LKStyles.setNodesDefaultHalo(),this.LKStyles.setEdgesDefaultHalo(),this.LKStyles.setBadgeRule(),this.LKStyles.setFilterClass()}initSelection(){this.events.onClick(e=>{if(e!==void 0&&e.button==="left")if(e.target!==null){const t=navigator.platform==="MacIntel"?"cmd":"ctrl";this.keyboard.isKeyPressed(t)?(e.target.isNode&&this.getSelectedEdges().size>0&&this.getSelectedEdges().setSelected(!1),!e.target.isNode&&this.getSelectedNodes().size>0&&this.getSelectedNodes().setSelected(!1),e.target.isSelected()?e.target.setSelected(!1):e.target.setSelected(!0)):(this.getSelectedNodes().setSelected(!1),this.getSelectedEdges().setSelected(!1),e.target.setSelected(!0))}else this.getSelectedNodes().setSelected(!1),this.getSelectedEdges().setSelected(!1)})}setStyles(e,t){var i,n,s,a;this.LKStyles=new lr(this,{node:((n=(i=e==null?void 0:e.options)==null?void 0:i.styles)==null?void 0:n.node)||{},edge:((a=(s=e==null?void 0:e.options)==null?void 0:s.styles)==null?void 0:a.edge)||{},baseUrl:t}),this.LKStyles.setNodesDefaultStyles(),this.LKStyles.setEdgesDefaultStyles()}setCaptions(e){var n,s,a,o,l,c,d,h;const t=(o=(a=(s=(n=e==null?void 0:e.options)==null?void 0:n.styles)==null?void 0:s.node)==null?void 0:a.text)==null?void 0:o.maxTextLength,i=(h=(d=(c=(l=e==null?void 0:e.options)==null?void 0:l.styles)==null?void 0:c.edge)==null?void 0:d.text)==null?void 0:h.maxTextLength;this.LKCaptions=new cr(this,t,i)}getForceLayoutParams(e,t=0){let i=300-.052*this.getNodes().size;return i<40&&(i=40),{steps:e===g.ForceLayoutMode.FAST?i:300,alignSiblings:this.getNodes().size>3,duration:t,charge:20,gravity:.08,theta:this.getNodes().size>100?.8:.34}}getRadialLayoutParams(e,t=0){return{centralNode:e,radiusDelta:1,nodeGap:10,repulsion:this.getNodes().size>80?1:6,duration:t}}getHierarchicalLayoutParams(e,t,i=0){return{direction:e,roots:[t],duration:i}}async init(e){this.clearGraph();let t,i=[];const n=e.nodes.map(a=>(a.attributes.selected&&(t=g.EntityType.NODE,i.push(a.id)),delete a.attributes.selected,a)),s=e.edges.map(a=>(a.attributes!==void 0&&(a.attributes.selected&&((t===void 0||t===g.EntityType.NODE)&&(t=g.EntityType.EDGE,i=[]),i.push(a.id)),delete a.attributes.selected),a));await this.addGraphAfterValidation({nodes:n,edges:s}),t===g.EntityType.NODE?this.getNodes(i).setSelected(!0):t===g.EntityType.EDGE&&this.getEdges(i).setSelected(!0)}async initVisualization(e){await this.init(e);const t=p.sanitizeStylesIndex(e.design.styles);this.LKStyles.initNodeColors(t.node),this.LKStyles.initNodesIcons(t.node),this.LKStyles.initNodesSizes(t.node),this.LKStyles.initNodesShapes(t.node),this.LKStyles.initEdgesWidth(t.edge),this.LKStyles.initEdgesShape(t.edge),this.LKStyles.initEdgesColor(t.edge),await this.LKCaptions.initVizCaptions({node:e.nodeFields.captions||{},edge:e.edgeFields.captions||{}}),this.LKTransformation.groupedEdges=e.edgeGrouping,await this.LKTransformation.initTransformation(),this.LKTransformation.initEdgeGroupingStyle()}async addGraphAfterValidation(e){const t=await this.addNodes(e.nodes),i=await this.addEdges(e.edges);return{nodes:t,edges:i}}addEdges(e,t){return super.addEdges(e,{...t,ignoreInvalid:!0})}getNonFilteredNodes(e){return u.isDefined(e)?this.getNodes(e).filter(t=>!t.hasClass("filtered")):this.getNodes("raw").filter(t=>!t.hasClass("filtered"))}getFilteredNodes(e,t="raw"){return u.isDefined(e)?this.getNodes(e).filter(i=>i.hasClass("filtered")):this.getNodes(t).filter(i=>i.hasClass("filtered"))}getNonFilteredEdges(e){return u.isDefined(e)?this.getEdges(e).filter(t=>!t.hasClass("filtered")):this.getEdges("raw").filter(t=>!t.hasClass("filtered"))}getFilteredEdges(e,t="raw"){return u.isDefined(e)?this.getEdges(e).filter(i=>i.hasClass("filtered")):this.getEdges(t).filter(i=>i.hasClass("filtered"))}shutDown(){this.destroy(),this.store&&this.store.clear()}clearOgmaState(){this.reset(),this.store&&this.store.clear(),this.initOgmaLinkuriousParser()}setConfigOgma(e,t,i){e&&(this._configuration=e),t||this.setOptions({...this._configuration.options,renderer:this._configuration.renderer}),this.setStyles(this._configuration,i),this.setCaptions(this._configuration)}getSelectedNodes(){return this.getNodes("all").filter(e=>e.isSelected())}clearSelection(){this.getSelectedNodes().setSelected(!1),this.getSelectedEdges().setSelected(!1)}}const br={steps:250,alignSiblings:!0,charge:20,theta:.34,duration:pr,gravity:.0475,gpu:!0};class P{static getHiddenNeighbors(e){return e.reduce((t,i)=>{const n=i.getData("statistics");if(n!==void 0){const s=n.degree!==void 0&&!n.supernode?n.degree-u.getDegreeWithoutSelfConnection(i):n.supernodeDegree;if(s!==void 0&&s>0)return t+=s}return t},0)}static getDegreeWithoutSelfConnection(e){return e.getAdjacentNodes({policy:"exclude-sources",filter:"all"}).size}static isBright(e){if(e===null||!u.isStringFilled(e))return!0;const t=/#[A-Fa-f0-9]{3,6}/,i=/^rgb\(\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*\)$/i,n=/^rgba\(\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*(?:0|1|0?\.\d+)\s*\)$/i;let s;if(t.test(e)){e.length<5&&(e+=e.slice(1)),e=e.replace("#","");const c=parseInt(e[0].toString()+e[1].toString(),16),d=parseInt(e[2].toString()+e[3].toString(),16),h=parseInt(e[4].toString()+e[5].toString(),16);s=`rgb(${c}, ${d}, ${h})`}else if(i.test(e)||n.test(e)||te[e.toLowerCase()]!==void 0)s=u.isDefined(te[e.toLowerCase()])?te[e.toLowerCase()].rgb:e;else return!0;const[a,o,l]=/rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(,(?:0|1|0?\.\d+))?\)/.exec(s.replace(/\s/g,"")).slice(1,4);return!u.isDefined(a)||!u.isDefined(o)||!u.isDefined(l)?(console.warn("The given color is not a valid rgb formatted color"),!0):(+a*299+ +o*587+ +l*114)/1e3>255*.7}static isNode(e){return e.isNode}static isNodeList(e){return e.isNode}static topologicalSort(e){const i=e.toArray().filter(a=>a.getDegree()===1),n=new Set,s=[];return i.forEach(a=>{let o=a;if(n.has(o))return;const l=[];for(;o;){l.push(o),n.add(o);const c=o.getAdjacentNodes().filter(d=>!n.has(d)).get(0);o=c===void 0?null:c}s.push(l)}),s.sort((a,o)=>o.length-a.length),{chain:s.flat().map(a=>a.getId()),numberOfChain:i.length/2}}static isStar(e){for(const t of e.toArray()){const i=t.getAdjacentNodes();if(t.getDegree()>2&&i.getDegree().every(s=>s===1)&&i.size+1===e.size)return t}return!1}static isGroupCollapsed(e){return e.getData("collapsed")}static setCollapsedGroupProperty(e,t){e.setData("collapsed",t)}}const ue="LKE_NODE_GROUPING_EDGE";class q{constructor(e){this._collapsedDefaultValue=!1,this._nodeGroupingAttributes=[],this._ogma=e}setGroupingRule(e){this.groupRule=e}async initTransformation(){let e=!0;this.transformation===void 0?this.transformation=this._ogma.transformations.addNodeGrouping({groupIdFunction:t=>{if(this._isRuleNotApplicableToNode(t))return;const i=this.groupRule;return i.groupingType===g.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._getAdjacentEdgeGroupId(t,i):this._getPropertyValueGroupId(t,i)},nodeGenerator:t=>{const i=new Set(t.getData("categories").flat()),n=this._findNodeGroupId(t);return{data:{categories:[],subCategories:Array.from(i),collapsed:this._getDefaultCollapsedState(n),nodeGroupId:n},attributes:{layoutable:this._getDefaultLayoutableValue(n)}}},onGroupUpdate:(t,i)=>{if(!(i.size===1||e))return{layout:"force",params:{...br}}},edgeGenerator:()=>({data:{type:ue}}),showContents:t=>!P.isGroupCollapsed(t),duration:300,padding:10}):await this.refreshTransformation(),await this._ogma.transformations.afterNextUpdate(),e=!1}async refreshTransformation(){this.transformation!==void 0?(await this.transformation.refresh(),await this._unpinNodes(this._getAllTransformationRawNodes())):await this.initTransformation()}initNodeGroupingStyle(){this._nodeGroupingStyleRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:e=>this._getNodeGroupingCaption(e),style:"bold"},layer:-1,color:"rgba(240, 240, 240)",innerStroke:{color:"#7f7f7f",width:2}},nodeSelector:e=>e.isVirtual()&&!P.isGroupCollapsed(e),nodeDependencies:{self:{data:!0}}}),this._initIntermediateGroupStyle(),this._nodeGroupingCollapsedStyleRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:e=>this._getNodeGroupingCaption(e),style:"bold"},halo:{width:4,color:"#e4ebea",strokeColor:"#ccc"},badges:{bottomLeft:e=>{var i;const t=(i=e.getSubNodes().filter(n=>!n.hasClass("filtered")))==null?void 0:i.size;return{color:ae,minVisibleSize:20,stroke:{width:2,color:"#FFFFFF"},text:{font:u.isDefined(this._ogma.LKStyles.nodeFont)?this._ogma.LKStyles.nodeFont:ur,scale:.4,color:oe,content:`x${t}`}}},topLeft:()=>({color:ae,minVisibleSize:20,stroke:{width:2,color:"#FFFFFF"},text:{font:"FontAwesome",scale:.4,color:oe,content:""}})},color:e=>{if(e!==void 0)return this._ogma.LKStyles.nodeAttributes.color({geo:{},isVirtual:!1,properties:{},readAt:0,categories:e.getData("subCategories")})},icon:e=>{const t=e==null?void 0:e.getData("subCategories");if(!(!u.isDefined(e)||t.length>1))return this._ogma.LKStyles.nodeAttributes.icon({geo:{},isVirtual:!1,properties:{},readAt:0,categories:t}).icon}},nodeSelector:e=>e.isVirtual()&&P.isGroupCollapsed(e)&&!e.hasClass("filtered"),nodeDependencies:{self:{attributes:["styleRefreshIndex"]}}}),this._setSubSelectedClass()}async refreshNodeGroupingStyle(){var e,t;await((e=this._nodeGroupingStyleRule)==null?void 0:e.refresh()),await((t=this._nodeGroupingCollapsedStyleRule)==null?void 0:t.refresh())}getVirtualNodesOfTransformation(){return this.transformation.getContext().metaNodes}setNodeGroupingAttributes(e){this._nodeGroupingAttributes=e}setCollapseDefaultValue(e){this._collapsedDefaultValue=e}_getNodeGroupingCaption(e){if(!(!u.isDefined(e)||!u.isDefined(this.groupRule)))return this.groupRule.groupingType===g.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._getAdjacentEdgeNodeGroupingCaption(e,this.groupRule):this._getPropertyValueNodeGroupingCaption(e,this.groupRule)}_getAdjacentEdgeNodeGroupingCaption(e,t){const i=e.getSubNodes();return!u.isDefined(i)||!u.isDefined(i.get(0))?void 0:q._getGroupCentralNode(i.get(0),t).getData(["properties","name"])}_getPropertyValueNodeGroupingCaption(e,t){var i;if(e.isVirtual()&&((i=e.getSubNodes())==null?void 0:i.get(0))!==void 0){const n=e.getSubNodes().get(0).getData(["properties",t.groupingOptions.propertyKey]),s=u.getValueFromLkProperty(n),a=e.getSubNodes().filter(o=>!o.hasClass("filtered")).size;return`${s} (${a})`}}_isRuleNotApplicableToNode(e){const t=this.groupRule;return t===void 0?!0:t.groupingType===g.NodeGroupingType.BY_PROPERTY_VALUE?this._isPropertyRuleNotApplicableToNode(e,t):t.groupingType===g.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._isRelationshipRuleNotApplicableToNode(e,t):!0}_isRelationshipRuleNotApplicableToNode(e,t){return!this._hasEdgeOfType(e,t.groupingOptions.edgeType)}_hasEdgeOfType(e,t){let i=!1;return e.getAdjacentEdges().forEach(n=>{n.getData("type")===t&&(i=!0)}),i}_isPropertyRuleNotApplicableToNode(e,t){const i=e.getData(["properties",t.groupingOptions.propertyKey??""]);return t.groupingOptions.itemTypes.every(n=>!e.getData("categories").includes(n))||!u.isDefined(i)||typeof i=="object"&&i.status==="missing"}async _unpinNodes(e){await Promise.all(e.map(t=>{if(t!==null)return t.setAttribute("layoutable",!0)}))}_getAllTransformationRawNodes(){return this.getVirtualNodesOfTransformation().getSubNodes()}_findGroupingPropertyValue(e){const t=this.groupRule,i=e.getData(["properties",t.groupingOptions.propertyKey??""]);return`${u.getValueFromLkProperty(i)}`}_findNodeGroupId(e){var i;const t=this.groupRule;if(t.groupingType===g.NodeGroupingType.BY_ADJACENT_EDGE_TYPE){const n=q._getGroupCentralNode(e.get(0),t);return se(`${(i=this.groupRule)==null?void 0:i.name}-${n.getId()}`)}else{const n=this._findGroupingPropertyValue(e.get(0));return se(`${t.name}-${t.groupingOptions.itemTypes.join("-")}-${n}`)}}static _getGroupCentralNode(e,t){const i=e.getAdjacentEdges({filter:"raw"}).filter(s=>s.getData("type")===t.groupingOptions.edgeType).get(0);return t.groupingOptions.centralNodeIs==="source"?i.getSource():i.getTarget()}_getPropertyValueGroupId(e,t){const i=this._findGroupingPropertyValue(e);return`${t.groupingOptions.itemTypes.join("-")}-${i}`.toLowerCase().trim()}_getAdjacentEdgeGroupId(e,t){return q._getGroupCentralNode(e,t).getId().toString()}_initIntermediateGroupStyle(){this._ogma.styles.addRule({nodeAttributes:{color:"rgba(240, 240, 240)"},nodeSelector:e=>e.isVirtual()&&P.isGroupCollapsed(e),nodeDependencies:{self:{data:!0}}})}_getDefaultCollapsedState(e){const t=this._nodeGroupingAttributes.find(i=>i.id===e);return u.isDefined(t)&&u.isDefined(t.attributes.collapsed)?t.attributes.collapsed:this._collapsedDefaultValue}_getDefaultLayoutableValue(e){const t=this._nodeGroupingAttributes.find(i=>i.id===e);return u.isDefined(t)&&u.isDefined(t.attributes.layoutable)?t.attributes.layoutable:!0}_setSubSelectedClass(){this._ogma.styles.createClass({name:"subSelection",nodeAttributes:{halo:{width:4,color:"#e67a8f",strokeColor:"#ccc"}}})}}const Rg={color:"#000000",shape:{style:"dashed",head:"arrow"},width:1.5};class yr{constructor(e){this._ogma=e,this.groupedEdges={}}async initTransformation(){this.transformation===void 0?this.transformation=this._ogma.transformations.addEdgeGrouping({separateEdgesByDirection:!0,selector:e=>this.groupedEdges[e.getData("type")],groupIdFunction:e=>e.getData("type"),generator:e=>({data:{properties:{originalType:e.getData("type")[0]}}})}):await this.transformation.refresh()}initEdgeGroupingStyle(){this.edgeGroupingStyleRule=this._ogma.styles.addRule({edgeAttributes:{...Rg,...this.edgeGroupStyle,text:{content:e=>{if(e!==void 0&&e.getSubEdges()!==null&&e.getData("type")!==ue){const t=e.getSubEdges().filter(i=>!i.hasClass("filtered")).size;return`${e.getData(["properties","originalType"])} (${t})`}},style:"bold"}},edgeSelector:e=>e.isVirtual()&&e.getSubEdges()&&e.getSubEdges().filter(t=>!t.hasClass("filtered")).size>0&&e.getData("type")!==ue,edgeDependencies:{self:{data:!0}}})}refreshEdgeGroupingStyle(){this.edgeGroupingStyleRule!==void 0&&this.edgeGroupingStyleRule.refresh()}}const _=class _{static isFiltered(e,t){return u.isDefined(t)?"categories"in t?_.getFilterFunction(e,!0)(t):_.getFilterFunction(e,!1)(t):!1}static getFilterFunction(e,t){const i=JSON.stringify(e,null,""),n=t?_.nodeCache:_.edgeCache;let s=n.get(i);return s||(s=_.createFilterFunction(e,t),n.size>_.FILTER_CACHE_SIZE&&n.clear(),n.set(i,s)),s}static createFilterFunction(e,t){const i=e.map(n=>_.filterToFilterFunction(n,t));return n=>{for(const s of i)if(s(n))return!0;return!1}}static filterToFilterFunction(e,t){switch(e.type){case g.SelectorType.ANY:return _.createAnyFilterFunction(e,t);case g.SelectorType.IS:return _.createIsFilterFunction(e,t);case g.SelectorType.NO_VALUE:return _.createNoValueFilterFunction(e,t);case g.SelectorType.RANGE:return _.createRangeFilterFunction(e,t);case g.SelectorType.NAN:return _.createNaNFilterFunction(e,t)}}static createAnyFilterFunction(e,t){return t?i=>e.itemType===void 0?!0:i.categories.includes(e.itemType):i=>i.type===e.itemType}static createIsFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&u.getPropertyValue(u.getIn(i,e.input),!0)===e.value:i=>i.type===e.itemType&&u.getPropertyValue(u.getIn(i,e.input),!0)===e.value}static createNoValueFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&!u.isDefined(u.getPropertyValue(u.getIn(i,e.input),!0)):i=>i.type===e.itemType&&!u.isDefined(u.getPropertyValue(u.getIn(i,e.input),!0))}static createNaNFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&_.isNotANumber(u.getPropertyValue(u.getIn(i,e.input),!0)):i=>i.type===e.itemType&&_.isNotANumber(u.getPropertyValue(u.getIn(i,e.input),!0))}static isNotANumber(e){return u.isDefined(e)&&!u.isNumber(e)}static createRangeFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&_.valueShouldBeHidden(u.getPropertyValue(u.getIn(i,e.input),!1),e.value):i=>i.type===e.itemType&&_.valueShouldBeHidden(u.getPropertyValue(u.getIn(i,e.input),!1),e.value)}static valueShouldBeHidden(e,t){const i=u.parseFloat(e);return Number.isNaN(i)?!1:t["<"]!==void 0&&i<t["<"]||t["<="]!==void 0&&i<=t["<="]||t[">"]!==void 0&&i>t[">"]||t[">="]!==void 0&&i>=t[">="]}};_.nodeCache=new Map,_.edgeCache=new Map,_.FILTER_CACHE_SIZE=5;let Pe=_;const Mg=r=>r.selection.size,Gg=r=>{switch(r.selection.size){case 1:return"selection";case 0:return"noSelection";default:return"multiSelection"}},zg=r=>{if(!(!u.isDefined(r.selection)||r.selection.size===0))return r.selection.isNode?g.EntityType.NODE:g.EntityType.EDGE},ve=r=>u.isDefined(r.selection)&&r.selection.size===1?r.selection.get(0):void 0,Bg=r=>{const e=ve(r);if(e!==void 0)return e.isNode?e.getData("categories"):[e.getData("type")]},Ug=r=>{const e=ve(r);if(e!==void 0)return e.isNode?"node":"edge"},vr=r=>{const e=ve(r);if(e!==void 0){const t=e.getData().properties;return Object.keys(t).map(i=>({key:i,value:t[i]}))}return[]},jg=r=>vr(r).length>0;exports.ANIMATION_DURATION=pr;exports.BASE_GREY=E;exports.Captions=F;exports.CaptionsViz=cr;exports.EdgeAttributes=B;exports.FILTER_OPACITY=we;exports.FORCE_LAYOUT_CONFIG=br;exports.Filters=Pe;exports.HTML_COLORS=te;exports.ItemAttributes=A;exports.LKE_NODE_GROUPING_EDGE=ue;exports.LKOgma=Pg;exports.NodeAttributes=I;exports.OgmaStore=fr;exports.OgmaTools=P;exports.PALETTE=De;exports.StyleRule=C;exports.StyleRuleType=or;exports.StyleRules=p;exports.StyleType=D;exports.StylesViz=lr;exports.Tools=u;exports.TransformationsViz=yr;exports.getSelectionEntity=zg;exports.getSelectionProperties=vr;exports.getSelectionSize=Mg;exports.getSelectionState=Gg;exports.getUniqSelection=ve;exports.getUniqSelectionEntity=Ug;exports.getUniqSelectionTypes=Bg;exports.hasSelectionProperties=jg;
|
|
4
4
|
//# sourceMappingURL=index.cjs.map
|