@reddb-io/ui 0.3.1 → 0.3.2
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/build/_app/immutable/assets/0.BWZTMKZW.css +1 -0
- package/build/_app/immutable/chunks/{8zg2gJwV.js → B-yl15ta.js} +1 -1
- package/build/_app/immutable/chunks/{CJFJ501n.js → Bgb6fHGb.js} +1 -1
- package/build/_app/immutable/chunks/C-kqMbRi.js +1 -0
- package/build/_app/immutable/chunks/{CLBx21Hz.js → C3SGj6Qd.js} +2 -2
- package/build/_app/immutable/chunks/{DV9PDoM3.js → C7kf23SQ.js} +1 -1
- package/build/_app/immutable/chunks/CHvQYbpl.js +1 -0
- package/build/_app/immutable/chunks/CO7K4bD2.js +1164 -0
- package/build/_app/immutable/chunks/CP65IkJc.js +1 -0
- package/build/_app/immutable/chunks/CxnvJShw.js +404 -0
- package/build/_app/immutable/chunks/D02PB2u7.js +1 -0
- package/build/_app/immutable/chunks/{Bq4DTWK2.js → DN7v3Tar.js} +1 -1
- package/build/_app/immutable/entry/{app.BDog2y0J.js → app.BeX4Tmu5.js} +2 -2
- package/build/_app/immutable/entry/start.D7y1MZex.js +1 -0
- package/build/_app/immutable/nodes/0.C0e5KQVb.js +2 -0
- package/build/_app/immutable/nodes/1.ceiVuZbB.js +1 -0
- package/build/_app/immutable/nodes/{10.D_FCLs0Z.js → 10.DeFqKRR2.js} +2 -2
- package/build/_app/immutable/nodes/{12.DPE6v6Zf.js → 12.CzMvqoYS.js} +2 -2
- package/build/_app/immutable/nodes/{15.CcJlZGxa.js → 15.CRDBqbiH.js} +1 -1
- package/build/_app/version.json +1 -1
- package/build/index.html +13 -13
- package/dist/embed/{AnalyticsView-D8z1Nsed.js → AnalyticsView-SKyGxeAx.js} +849 -849
- package/dist/embed/{AnalyticsView-D8z1Nsed.js.map → AnalyticsView-SKyGxeAx.js.map} +1 -1
- package/dist/embed/{RedUiEmbedRoot-CtqTd_FG.js → RedUiEmbedRoot-BzVzGAFK.js} +13945 -13287
- package/dist/embed/RedUiEmbedRoot-BzVzGAFK.js.map +1 -0
- package/dist/embed/event-BvRbkLjD.js +46 -0
- package/dist/embed/event-BvRbkLjD.js.map +1 -0
- package/dist/embed/index-BVxMkfHe.js +8 -0
- package/dist/embed/index-BVxMkfHe.js.map +1 -0
- package/dist/embed/index-BY6fc1oQ.js +856 -0
- package/dist/embed/index-BY6fc1oQ.js.map +1 -0
- package/dist/embed/{index-client-BeiP-va5.js → index-client-BHUUkI8H.js} +121 -120
- package/dist/embed/{index-client-BeiP-va5.js.map → index-client-BHUUkI8H.js.map} +1 -1
- package/dist/embed/index.js +1 -1
- package/dist/embed/{sigma.esm-qqKBpvin.js → sigma.esm-BawyGZ3s.js} +2 -2
- package/dist/embed/{sigma.esm-qqKBpvin.js.map → sigma.esm-BawyGZ3s.js.map} +1 -1
- package/dist/embed/window-ZR8_mM8o.js +1889 -0
- package/dist/embed/window-ZR8_mM8o.js.map +1 -0
- package/package.json +5 -3
- package/src/lib/ConnectDropdown.svelte +60 -3
- package/src/lib/DevConsole.svelte +155 -0
- package/src/lib/ErrorBoundary.fixture.svelte +11 -0
- package/src/lib/ErrorBoundary.fixtures.svelte.ts +5 -0
- package/src/lib/ErrorBoundary.svelte +78 -0
- package/src/lib/ErrorBoundaryCrashChild.fixture.svelte +9 -0
- package/src/lib/LoadingOverlay.svelte +109 -0
- package/src/lib/StatusBar.svelte +19 -1
- package/src/lib/Workspace.svelte +118 -2
- package/src/lib/connections.svelte.ts +95 -1
- package/src/lib/embed/RedUiEmbedRoot.svelte +13 -8
- package/src/lib/embed/index.ts +34 -1
- package/src/lib/index.ts +7 -0
- package/src/lib/loading.svelte.ts +142 -0
- package/src/lib/reddb/client.ts +133 -15
- package/src/lib/reddb/desktop-error.ts +89 -0
- package/src/lib/reddb/dev-console.ts +186 -0
- package/src/lib/reddb/index.ts +2 -0
- package/src/lib/reddb/local-url-provider.ts +4 -8
- package/src/lib/reddb/tauri-encrypted-store.ts +4 -9
- package/src/lib/tabs.svelte.ts +5 -0
- package/src/lib/workspace-session.ts +81 -0
- package/build/_app/immutable/assets/0.DgbuWrJy.css +0 -1
- package/build/_app/immutable/chunks/85-Fh5Zp.js +0 -404
- package/build/_app/immutable/chunks/CnD4hwxC.js +0 -1106
- package/build/_app/immutable/chunks/DQCYUNtS.js +0 -1
- package/build/_app/immutable/entry/start.D1J45dq5.js +0 -1
- package/build/_app/immutable/nodes/0.BTrC4th2.js +0 -1
- package/build/_app/immutable/nodes/1.Ds1Tbjsm.js +0 -1
- package/dist/embed/RedUiEmbedRoot-CtqTd_FG.js.map +0 -1
- package/dist/embed/index-w1Qo_uW0.js +0 -677
- package/dist/embed/index-w1Qo_uW0.js.map +0 -1
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./B5euRbKa.js","./DhEqZVGG.js","./C-kqMbRi.js","./C7kf23SQ.js","./DqvWKbSc.js","./CXNPJgv1.js","./CDKIdLnm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var xu=Object.defineProperty;var po=n=>{throw TypeError(n)};var Eu=(n,e,t)=>e in n?xu(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Se=(n,e,t)=>Eu(n,typeof e!="symbol"?e+"":e,t),go=(n,e,t)=>e.has(n)||po("Cannot "+t);var _e=(n,e,t)=>(go(n,e,"read from private field"),t?t.call(n):e.get(n)),tt=(n,e,t)=>e.has(n)?po("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t);var vo=(n,e,t)=>(go(n,e,"access private method"),t);import"./Bzak7iHL.js";import"./69_IOA4Y.js";import{ab as wn,a2 as Di,i as Es,aF as bt,br,ay as ks,aD as kn,at as u,bb as ku,s as Su,bx as yo,bs as Wr,aE as or,f as $u,p as Au,aK as mo,ac as Cu,l as zt,a3 as ki,ak as Du,bv as Lu,ai as Iu,aO as Gu,a0 as Li,k as Tu,j as Ou,b0 as Ru,by as bo,E as Nu,D as Uu,bh as Ss,b5 as $s,I as Xn,ba as Mu,d as Pu,h as zu,a7 as Wu,a$ as ju,aj as Bu,az as Fu,n as As,o as Ku,aa as qu,x as Hu,Y as Vu,bF as Yu,a8 as Xu,bP as Ju,bO as Pt,bK as It,bi as Zu,bj as wo,ad as mr,ag as Qu,bz as ge,bm as M,b8 as Wt,b9 as Cs,b6 as Ds,a6 as G,aq as Le,bw as U,bg as D,bN as re,bI as _n,b2 as Ut,bG as he,be as ec}from"./CGFL56WJ.js";import{b as tc,o as rc,t as fn,a as z,l as kt,e as qe,h as nc,k as le,u as ue,i as De,j as Jn,w as Zn}from"./DN7v3Tar.js";import{_ as rr,l as Ze,p as pr,s as it,b as ic,c as oc}from"./BRIMmWzq.js";import{o as sc,a as ac}from"./Btd6PFkC.js";import{B as Ls,i as ye}from"./DCJ0QyYH.js";import{a as _o,e as Kt,g as F,j as Mt,r as Qn,i as uc,s as cc,d as pn,k as lc}from"./C3SGj6Qd.js";function xn(n,e){return e}function dc(n,e,t){for(var r=[],i=e.length,o,s=e.length,a=0;a<i;a++){let h=e[a];$s(h,()=>{if(o){if(o.pending.delete(h),o.done.add(h),o.pending.size===0){var f=n.outrogroups;Si(n,Li(o.done)),f.delete(o),f.size===0&&(n.outrogroups=null)}}else s-=1},!1)}if(s===0){var c=r.length===0&&t!==null;if(c){var l=t,d=l.parentNode;Wu(d),d.append(l),n.items.clear()}Si(n,e,!c)}else o={pending:new Set(e),done:new Set},(n.outrogroups??(n.outrogroups=new Set)).add(o)}function Si(n,e,t=!0){var r;if(n.pending.size>0){r=new Set;for(const s of n.pending.values())for(const a of s)r.add(n.items.get(a).e)}for(var i=0;i<e.length;i++){var o=e[i];if(r!=null&&r.has(o)){o.f|=zt;const s=document.createDocumentFragment();ju(o,s)}else Bu(e[i],t)}}var xo;function yt(n,e,t,r,i,o=null){var s=n,a=new Map,c=(e&Es)!==0;if(c){var l=n;s=bt?br(ks(l)):l.appendChild(wn())}bt&&kn();var d=null,h=Iu(()=>{var _=t();return Gu(_)?_:_==null?[]:Li(_)}),f,g=new Map,v=!0;function E(_){(A.effect.f&Uu)===0&&(A.pending.delete(_),A.fallback=d,hc(A,f,s,e,r),d!==null&&(f.length===0?(d.f&zt)===0?Ss(d):(d.f^=zt,zr(d,null,s)):$s(d,()=>{d=null})))}function b(_){A.pending.delete(_)}var y=Di(()=>{f=u(h);var _=f.length;let p=!1;if(bt){var k=ku(s)===Su;k!==(_===0)&&(s=yo(),br(s),Wr(!1),p=!0)}for(var $=new Set,S=Cu,I=Lu(),C=0;C<_;C+=1){bt&&or.nodeType===$u&&or.data===Au&&(s=or,p=!0,Wr(!1));var T=f[C],H=r(T,C),N=v?null:a.get(H);N?(N.v&&mo(N.v,T),N.i&&mo(N.i,C),I&&S.unskip_effect(N.e)):(N=fc(a,v?s:xo??(xo=wn()),T,H,C,i,e,t),v||(N.e.f|=zt),a.set(H,N)),$.add(H)}if(_===0&&o&&!d&&(v?d=ki(()=>o(s)):(d=ki(()=>o(xo??(xo=wn()))),d.f|=zt)),_>$.size&&Du(),bt&&_>0&&br(yo()),!v)if(g.set(S,$),I){for(const[m,Ie]of a)$.has(m)||S.skip_effect(Ie.e);S.oncommit(E),S.ondiscard(b)}else E(S);p&&Wr(!0),u(h)}),A={effect:y,items:a,pending:g,outrogroups:null,fallback:d};v=!1,bt&&(s=or)}function Tr(n){for(;n!==null&&(n.f&Pu)===0;)n=n.next;return n}function hc(n,e,t,r,i){var T,H,N,m,Ie,Oe,R,x,K;var o=(r&zu)!==0,s=e.length,a=n.items,c=Tr(n.effect.first),l,d=null,h,f=[],g=[],v,E,b,y;if(o)for(y=0;y<s;y+=1)v=e[y],E=i(v,y),b=a.get(E).e,(b.f&zt)===0&&((H=(T=b.nodes)==null?void 0:T.a)==null||H.measure(),(h??(h=new Set)).add(b));for(y=0;y<s;y+=1){if(v=e[y],E=i(v,y),b=a.get(E).e,n.outrogroups!==null)for(const ee of n.outrogroups)ee.pending.delete(b),ee.done.delete(b);if((b.f&Xn)!==0&&(Ss(b),o&&((m=(N=b.nodes)==null?void 0:N.a)==null||m.unfix(),(h??(h=new Set)).delete(b))),(b.f&zt)!==0)if(b.f^=zt,b===c)zr(b,null,t);else{var A=d?d.next:c;b===n.effect.last&&(n.effect.last=b.prev),b.prev&&(b.prev.next=b.next),b.next&&(b.next.prev=b.prev),Qt(n,d,b),Qt(n,b,A),zr(b,A,t),d=b,f=[],g=[],c=Tr(d.next);continue}if(b!==c){if(l!==void 0&&l.has(b)){if(f.length<g.length){var _=g[0],p;d=_.prev;var k=f[0],$=f[f.length-1];for(p=0;p<f.length;p+=1)zr(f[p],_,t);for(p=0;p<g.length;p+=1)l.delete(g[p]);Qt(n,k.prev,$.next),Qt(n,d,k),Qt(n,$,_),c=_,d=$,y-=1,f=[],g=[]}else l.delete(b),zr(b,c,t),Qt(n,b.prev,b.next),Qt(n,b,d===null?n.effect.first:d.next),Qt(n,d,b),d=b;continue}for(f=[],g=[];c!==null&&c!==b;)(l??(l=new Set)).add(c),g.push(c),c=Tr(c.next);if(c===null)continue}(b.f&zt)===0&&f.push(b),d=b,c=Tr(b.next)}if(n.outrogroups!==null){for(const ee of n.outrogroups)ee.pending.size===0&&(Si(n,Li(ee.done)),(Ie=n.outrogroups)==null||Ie.delete(ee));n.outrogroups.size===0&&(n.outrogroups=null)}if(c!==null||l!==void 0){var S=[];if(l!==void 0)for(b of l)(b.f&Xn)===0&&S.push(b);for(;c!==null;)(c.f&Xn)===0&&c!==n.fallback&&S.push(c),c=Tr(c.next);var I=S.length;if(I>0){var C=(r&Es)!==0&&s===0?t:null;if(o){for(y=0;y<I;y+=1)(R=(Oe=S[y].nodes)==null?void 0:Oe.a)==null||R.measure();for(y=0;y<I;y+=1)(K=(x=S[y].nodes)==null?void 0:x.a)==null||K.fix()}dc(n,S,C)}}o&&Mu(()=>{var ee,ne;if(h!==void 0)for(b of h)(ne=(ee=b.nodes)==null?void 0:ee.a)==null||ne.apply()})}function fc(n,e,t,r,i,o,s,a){var c=(s&Tu)!==0?(s&Ou)===0?Ru(t,!1,!1):bo(t):null,l=(s&Nu)!==0?bo(i):null;return{v:c,i:l,e:ki(()=>(o(e,c??t,l??i,a),()=>{n.delete(r)}))}}function zr(n,e,t){if(n.nodes)for(var r=n.nodes.start,i=n.nodes.end,o=e&&(e.f&zt)===0?e.nodes.start:t;r!==null;){var s=Fu(r);if(o.before(r),r===i)return;r=s}}function Qt(n,e,t){e===null?n.effect.first=t:e.next=t,t===null?n.effect.last=e:t.prev=e}function rt(n,e,t,r,i){var a;bt&&kn();var o=(a=e.$$slots)==null?void 0:a[t],s=!1;o===!0&&(o=e[t==="default"?"children":t],s=!0),o===void 0?i!==null&&i(n):o(n,s?()=>r:r)}function vp(n){const e={};n.children&&(e.default=!0);for(const t in n.$$slots)e[t]=!0;return e}function pc(n,e,...t){var r=new Ls(n);Di(()=>{const i=e()??null;r.ensure(i,i&&(o=>i(o,...t)))},As)}function gc(n,e,t,r,i,o){let s=bt;bt&&kn();var a=null;bt&&or.nodeType===Ku&&(a=or,kn());var c=bt?or:n,l=new Ls(c,!1);Di(()=>{const d=e()||null;var h=Hu;if(d===null){l.ensure(null,null),fn(!0);return}return l.ensure(d,f=>{if(d){if(a=bt?a:qu(d,h),tc(a,a),r){bt&&rc(d)&&a.append(document.createComment(""));var g=bt?ks(a):a.appendChild(wn());bt&&(g===null?Wr(!1):br(g)),r(a,g)}Vu.nodes.end=a,f.before(a)}bt&&br(f)}),fn(!0),()=>{d&&fn(!1)}},As),Yu(()=>{fn(!0)}),s&&(Wr(!0),br(c))}function vc(n=!1){const e=Xu,t=e.l.u;if(!t)return;let r=()=>mr(e.s);if(n){let i=0,o={};const s=Qu(()=>{let a=!1;const c=e.s;for(const l in c)c[l]!==o[l]&&(o[l]=c[l],a=!0);return a&&i++,i});r=()=>u(s)}t.b.length&&Ju(()=>{Eo(e,r),wo(t.b)}),Pt(()=>{const i=It(()=>t.m.map(Zu));return()=>{for(const o of i)typeof o=="function"&&o()}}),t.a.length&&Pt(()=>{Eo(e,r),wo(t.a)})}function Eo(n,e){if(n.l.s)for(const t of n.l.s)u(t);e()}function yp(n){return`${(Math.max(0,n)/1e3).toFixed(1)}s`}var Fr,Kr,qr,Dn,Is;class yc{constructor(){tt(this,Dn);tt(this,Fr,ge(null));tt(this,Kr,ge(null));tt(this,qr,ge(Wt([])));Se(this,"nextId",1)}get startedAt(){return u(_e(this,Fr))}set startedAt(e){M(_e(this,Fr),e,!0)}get label(){return u(_e(this,Kr))}set label(e){M(_e(this,Kr),e,!0)}get steps(){return u(_e(this,qr))}set steps(e){M(_e(this,qr),e,!0)}get active(){return this.startedAt!==null}get current(){return this.steps.length?this.steps[this.steps.length-1]:null}elapsedMs(e=Date.now()){return this.startedAt===null?0:Math.max(0,e-this.startedAt)}begin(e,t=Date.now()){It(()=>{this.startedAt=t,this.label=e,this.steps=[],this.nextId=1})}step(e,t,r=Date.now()){It(()=>{if(this.startedAt===null)return;const i=this.steps.map(o=>o.status==="active"?{...o,status:"done",durationMs:r-o.startedAt}:o);this.steps=[...i,{id:this.nextId++,label:e,...t?{detail:t}:{},startedAt:r,durationMs:null,status:"active"}]})}succeed(e=Date.now()){It(()=>{vo(this,Dn,Is).call(this,e),this.startedAt=null})}fail(e,t=Date.now()){It(()=>{this.steps=this.steps.map(r=>r.status==="active"?{...r,status:"error",durationMs:t-r.startedAt,...e?{error:e}:{}}:r),this.startedAt=null})}}Fr=new WeakMap,Kr=new WeakMap,qr=new WeakMap,Dn=new WeakSet,Is=function(e){this.steps=this.steps.map(t=>t.status==="active"?{...t,status:"done",durationMs:e-t.startedAt}:t)};const Or=new yc,wr=Object.freeze({vcs:!1,clusterStatus:!1,collectionMetadata:!1,cdcStream:!1}),ko={vcs:"vcs",versioning:"vcs",version_control:"vcs",cluster:"clusterStatus",cluster_status:"clusterStatus",collection_metadata:"collectionMetadata",collections_metadata:"collectionMetadata",cdc:"cdcStream",changes_stream:"cdcStream",cdc_stream:"cdcStream"};function mc(n){var t;const e={...wr};for(const r of n.features??[]){const i=ko[((t=r==null?void 0:r.toLowerCase)==null?void 0:t.call(r))??""];i&&(e[i]=!0)}for(const[r,i]of Object.entries(n.capabilities??{})){const o=ko[r.toLowerCase()];o&&(e[o]=i===!0)}return e}const bc=/pass(word)?|secret|token|api[-_]?key|authorization|auth|credential|cookie|session|bearer|private[-_]?key|mfa/i,wc="«redacted»";function $i(n,e=0){if(e>6)return"«…»";if(Array.isArray(n))return n.slice(0,100).map(t=>$i(t,e+1));if(n&&typeof n=="object"){const t={};for(const[r,i]of Object.entries(n))t[r]=bc.test(r)?wc:$i(i,e+1);return t}return n}function So(n){if(n==null)return;let e=n;if(typeof n=="string"){if(n.length===0)return;try{e=JSON.parse(n)}catch{return n.length>2e3?`${n.slice(0,2e3)}…`:n}}try{const t=JSON.stringify($i(e),null,2);return t.length>4e3?`${t.slice(0,4e3)}…`:t}catch{return}}class _c{constructor(e=500){Se(this,"entries",[]);Se(this,"listeners",new Set);Se(this,"sinks",new Set);Se(this,"nextId",1);this.capacity=e}record(e){const t={...e,id:this.nextId++};this.entries.push(t),this.entries.length>this.capacity&&this.entries.splice(0,this.entries.length-this.capacity),this.emit();for(const r of this.sinks)try{r(t)}catch{}return t}addSink(e){return this.sinks.add(e),()=>{this.sinks.delete(e)}}snapshot(){return this.entries.slice()}get size(){return this.entries.length}clear(){this.entries.length!==0&&(this.entries=[],this.emit())}subscribe(e){return this.listeners.add(e),e(this.snapshot()),()=>{this.listeners.delete(e)}}emit(){const e=this.snapshot();for(const t of this.listeners)t(e)}}const gr=new _c,$o=new Set,ei=new Map;function xc(n){return(n instanceof Error?n.message:String(n)).includes("route not found: GET /collections/")}function Ec(n){const e=n instanceof Error?n.message:String(n);return/ → 404\b/.test(e)||e.includes("route not found")}function Ao(n){return new Error(`GET /collections/:name unsupported by this reddb server (${n})`)}function kc(n){if(!n||typeof n!="object")return!1;const e=n;return typeof e.kind=="string"&&e.kind.length>0&&typeof e.name=="string"&&e.name.length>0&&(e.tenant===void 0||typeof e.tenant=="string")}async function*Sc(n){const e=n.getReader(),t=new TextDecoder;let r="";try{for(;;){const{done:o,value:s}=await e.read();if(o)break;r+=t.decode(s,{stream:!0});let a;for(;(a=r.indexOf(`
|
|
3
|
+
`))!==-1;){const c=r.slice(0,a).trim();r=r.slice(a+1),c&&(yield JSON.parse(c))}}const i=r.trim();i&&(yield JSON.parse(i))}finally{e.releaseLock()}}const $c=/^\s*select\b/i;function Ac(n){var e;if(Array.isArray(n))return n.length;if(n&&typeof n=="object"){const t=n;if(typeof t.record_count=="number")return t.record_count;if(Array.isArray((e=t.result)==null?void 0:e.records))return t.result.records.length}}function ti(n){if(n instanceof Error)return n.message||String(n);if(typeof n=="string")return n;if(n&&typeof n=="object"){const e=n.message;if(typeof e=="string"&&e)return e;try{const t=JSON.stringify(n);if(t&&t!=="{}")return t}catch{}}return String(n)}async function mp(n,e,t={}){var i;const r=t.signal?{signal:t.signal}:void 0;if(!$c.test(e))return r?n.query(e,r):n.query(e);try{const o=await n.queryStreamCollect(e,t);return{ok:!0,query:e,record_count:o.rowCount,result:{columns:o.columns,records:o.rows.map(s=>({values:s}))},streamed:!0,truncated:o.truncated}}catch(o){if((i=t.signal)!=null&&i.aborted||o instanceof Error&&o.name==="AbortError")throw o;return r?n.query(e,r):n.query(e)}}class Gs{constructor(e,t={}){Se(this,"baseUrl");Se(this,"headers");Se(this,"fetcher");this.baseUrl=e.replace(/\/$/,""),this.headers=t.headers,this.fetcher=t.fetch??fetch}async json(e,t){const r=`${this.baseUrl}${e}`,i={"Content-Type":"application/json"};Object.assign(i,this.headers),Object.assign(i,t==null?void 0:t.headers);const o=(t==null?void 0:t.method)??"GET",s=Date.now(),a=performance.now(),c=So(t==null?void 0:t.body),l=()=>Math.round(performance.now()-a);let d;try{d=await this.fetcher(r,{...t,headers:i})}catch(g){throw gr.record({kind:"http",verb:o,target:e,startedAt:s,durationMs:l(),ok:!1,payload:c,error:ti(g)}),g}if(!d.ok){const g=await d.text().catch(()=>""),v=`${o} ${e} → ${d.status} ${g.slice(0,200)}`;throw gr.record({kind:"http",verb:o,target:e,startedAt:s,durationMs:l(),ok:!1,status:d.status,payload:c,error:v}),new Error(v)}const h=await d.json(),f=Ac(h);return gr.record({kind:f===void 0?"http":"query",verb:o,target:e,startedAt:s,durationMs:l(),ok:!0,status:d.status,...f===void 0?{}:{rowCount:f},payload:c}),h}async stats(){return this.json("/stats")}async clusterStatus(){return this.json("/cluster/status")}async metricsCatalog(){return(await this.query("SELECT path, kind, role, unit, supports_prometheus_query, created_at_ms FROM red.metrics")).result.records.map(t=>{const r=t.values;return{path:String(r.path??""),kind:r.kind,role:String(r.role??"metric"),unit:r.unit??null,supports_prometheus_query:r.supports_prometheus_query!==!1,created_at_ms:typeof r.created_at_ms=="number"?r.created_at_ms:void 0}})}async promQuery(e,t){const r=new URLSearchParams({query:e});return t!==void 0&&r.set("time",String(t)),this.json(`/api/v1/query?${r}`)}async promQueryRange(e,t,r,i){const o=new URLSearchParams({query:e,start:String(t),end:String(r),step:String(i)});return this.json(`/api/v1/query_range?${o}`)}async ping(){const e=performance.now();try{return await this.json("/stats"),{ok:!0,rtt_ms:Math.round(performance.now()-e)}}catch(t){return{ok:!1,error:ti(t)}}}async capabilities(){try{const r=await this.json("/capabilities");return mc(r)}catch(r){if(!Ec(r))return{...wr}}const[e,t]=await Promise.all([this.probeGet("/repo/commits?limit=1"),this.probeGet("/cluster/status")]);return{...wr,vcs:e,clusterStatus:t}}async probeGet(e){try{return await this.json(e),!0}catch{return!1}}async collections(){return(await this.json("/collections")).collections}async collection(e){if($o.has(this.baseUrl))throw Ao(this.baseUrl);const t=`/collections/${encodeURIComponent(e)}`,r=ei.get(this.baseUrl);if(r){if(!await r)throw Ao(this.baseUrl);return this.json(t)}let i;const o=new Promise(s=>{i=s});ei.set(this.baseUrl,o);try{const s=await this.json(t);return i(!0),s}catch(s){throw xc(s)?($o.add(this.baseUrl),i(!1)):i(!0),s}finally{ei.delete(this.baseUrl)}}async createCollection(e){await this.json("/collections",{method:"POST",body:JSON.stringify({name:e})})}async insertDocument(e,t){return this.json(`/collections/${encodeURIComponent(e)}/documents`,{method:"POST",body:JSON.stringify(t)})}async query(e,t={}){return this.json("/query",{method:"POST",body:JSON.stringify({query:e}),signal:t.signal})}async queryStreamCollect(e,t={}){const r=t.maxRows??1e4,i={"Content-Type":"application/json",Accept:"application/x-ndjson"};Object.assign(i,this.headers);const o=Date.now(),s=performance.now(),a=JSON.stringify({query:e}),c=So(a),l=()=>Math.round(performance.now()-s);let d;try{d=await this.fetcher(`${this.baseUrl}/query/stream`,{method:"POST",headers:i,body:a,signal:t.signal})}catch(f){throw gr.record({kind:"query",verb:"POST",target:"/query/stream",startedAt:o,durationMs:l(),ok:!1,payload:c,error:ti(f)}),f}if(!d.ok||!d.body){const f=d.body?await d.text().catch(()=>""):"",g=`POST /query/stream → ${d.status} ${f.slice(0,200)}`;throw gr.record({kind:"query",verb:"POST",target:"/query/stream",startedAt:o,durationMs:l(),ok:!1,status:d.status,payload:c,error:g}),new Error(g)}const h={columns:[],rows:[],rowCount:0,truncated:!1};for await(const f of Sc(d.body))if("descriptor"in f)h.columns=f.descriptor.columns??[],h.schemaFingerprint=f.descriptor.schema_fingerprint;else if("cursor"in f)h.cursor=f.cursor.token;else if("row"in f){if(h.rows.length>=r){h.truncated=!0;break}h.rows.push(f.row),h.rowCount=h.rows.length}else if("end"in f||"cancelled"in f)break;return gr.record({kind:"query",verb:"POST",target:"/query/stream",startedAt:o,durationMs:l(),ok:!0,status:d.status,rowCount:h.rowCount,payload:c}),h.truncated&&h.cursor&&await this.cancelQueryStream(h.cursor).catch(()=>{}),h}async cancelQueryStream(e){await this.json("/query/stream/cancel",{method:"POST",body:JSON.stringify({cursor:e})}).catch(()=>{})}async collectionVcs(e){return(await this.json(`/collections/${encodeURIComponent(e)}/vcs`)).result}async setCollectionVcs(e,t){return(await this.json(`/collections/${encodeURIComponent(e)}/vcs`,{method:"PUT",body:JSON.stringify({versioned:t})})).result}async commits(e={}){const t=new URLSearchParams;e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),e.branch&&t.set("branch",e.branch),e.limit!==void 0&&t.set("limit",String(e.limit)),e.skip!==void 0&&t.set("skip",String(e.skip)),e.noMerges!==void 0&&t.set("no_merges",String(e.noMerges));const r=t.toString()?`?${t}`:"";return(await this.json(`/repo/commits${r}`)).result}async commitDiff(e,t,r={}){const i=new URLSearchParams;r.collection&&i.set("collection",r.collection),r.summary!==void 0&&i.set("summary",String(r.summary));const o=i.toString()?`?${i}`:"";return(await this.json(`/repo/commits/${encodeURIComponent(e)}/diff/${encodeURIComponent(t)}${o}`)).result}async replication(){return this.json("/replication/status").catch(()=>({ok:!1,role:"standalone"}))}async whoami(){return this.json("/auth/whoami")}async ask(e,t={}){return this.json("/ai/ask",{method:"POST",body:JSON.stringify({question:e,...t})})}async users(){return(await this.json("/auth/users")).users}async tenants(){return(await this.json("/auth/tenants")).tenants??[]}async policies(){return(await this.json("/auth/policies")).policies??[]}async authCan(e){const t=await this.json("/auth/can",{method:"POST",body:JSON.stringify({checks:e})});if(!Array.isArray(t.results))throw new Error(t.error??"POST /auth/can returned no results");return e.map((r,i)=>{var a;const o=((a=t.results)==null?void 0:a[i])??{},s=kc(o.resource)?o.resource:r.resource;return{action:typeof o.action=="string"?o.action:r.action,resource:s,current_tenant:typeof o.current_tenant=="string"?o.current_tenant:r.current_tenant,allowed:o.allowed===!0,reason:typeof o.reason=="string"?o.reason:void 0}})}async changes(e,t={}){const r=new URLSearchParams;e!==void 0&&r.set("since_lsn",String(e)),t.limit!==void 0&&r.set("limit",String(t.limit));const i=r.toString()?`?${r}`:"",s=(await this.json("/changes"+i)).events??[];return t.collection?s.filter(a=>a.collection===t.collection):s}async rows(e){return(await this.query(e)).result.records.map(r=>r.values)}}class Cc extends Error{constructor(e){super(`Unknown connection: ${e}`),this.id=e,this.name="UnknownConnectionError"}}class Dc extends Error{constructor(){super("No active connection — call connect() first"),this.name="NotConnectedError"}}class Co extends Error{constructor(e,t){super(`Connection ${e} unreachable: ${t}`),this.id=e,this.reason=t,this.name="UnreachableConnectionError"}}const Lc={http:"http",https:"https",red:"http","red+tcp":"http","red+wire":"http",reds:"https","red+tls":"https","red+http":"http","red+https":"https","red+unix":"unix",file:"unix",unix:"unix"};function Ts(n){const e=n.trim();if(!e)return null;const t=e.match(/^([a-z+]+):\/\//i);return t?Lc[t[1].toLowerCase()]??null:"http"}const Ii=["http","https"],Ic=["http","https","unix"];function Gc(n,e){const t=Ts(n);return t!==null&&e.includes(t)}const Tc=["endpoint","connection","red_url","red"],Oc="view",Os="cs",Rs="to",Rc="token",Ns=/(token|secret|password|passwd|auth|credential|api[-_]?key|bearer)/i;class tr extends Error{constructor(e,t){super(t),this.code=e,this.name="OpenContractError"}}function Nc(n,e=""){if(n instanceof URL)return{search:n.search,hash:n.hash};const t=n??"";if(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)){const s=new URL(t);return{search:s.search,hash:s.hash}}const r=t.indexOf("#"),i=r>=0?t.slice(0,r):t,o=r>=0?t.slice(r):e;return{search:i,hash:o}}function Uc(n){return/^file:/i.test(n)||/^~(?:\/|\\|$)/.test(n)||/^(?:\.{1,2})(?:\/|\\|$)/.test(n)||/^(?:\/|\\)/.test(n)||/^[a-z]:[\\/]/i.test(n)||n.includes("\\")}function Us(n){const e=n.trim().replace(/\/$/,"");if(!e)throw new tr("EMPTY_CS","Open Contract cs is empty");if(Uc(e))throw new tr("FILESYSTEM_PATH","Open Contract cs must be a browser-reachable URL, not a filesystem path");let t;try{t=new URL(e)}catch{throw new tr("MALFORMED_URL","Open Contract cs is not a valid URL")}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new tr("UNSUPPORTED_SCHEME","Open Contract cs must use http:// or https://");for(const r of t.searchParams.keys())if(Ns.test(r))throw new tr("SECRET_IN_CS","Open Contract secrets must be carried in the app URL hash, not inside cs");return e}function Ms(n){const e=n.trim();if(!e)throw new tr("MALFORMED_ROUTE","Open Contract to is empty");if(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")||e.includes("\\"))throw new tr("MALFORMED_ROUTE","Open Contract to must be an app route");const t=e.startsWith("/")?e:`/${e}`;if(t==="/query"||t==="/collections"||t==="/cluster"||t==="/security"||t.startsWith("/c/"))return t;throw new tr("MALFORMED_ROUTE","Open Contract to must target a known red-ui route")}function Ps(n,e=""){const{search:t,hash:r}=Nc(n,e),i=new URLSearchParams(t),o=new URLSearchParams(r.startsWith("#")?r.slice(1):r),s={},a=i.get(Os);a!==null&&(s.cs=Us(a));const c=i.get(Rs);c!==null&&(s.to=Ms(c));const l=o.get(Rc);return l&&(s.token=l),s}function Mc(n,e=""){const t=new URLSearchParams(n??""),r={},i=t.get(Os);if(i!==null)try{r.endpoint=Us(i)}catch{}const o=t.get(Rs);if(o!==null)try{r.to=Ms(o)}catch{}for(const a of Tc){if(r.endpoint)break;const c=t.get(a);if(c&&!Ns.test(a)){r.endpoint=c;break}}const s=t.get(Oc);s&&(r.view=s);try{Ps(n,e).token}catch{}return r}function Pc(n){return typeof n.endpoint=="string"&&n.endpoint.trim().length>0}function zc(n){return typeof n.to=="string"&&n.to.trim().length>0}const Wc=8;function jc(){let n=[];return{load:()=>n.slice(),save:e=>{n=e.slice()}}}class Bc{constructor(e={}){Se(this,"presets");Se(this,"history");Se(this,"clientFactory");Se(this,"historyMax");Se(this,"supportedTransports");Se(this,"boot");Se(this,"embeddedResolver");Se(this,"handoffTokens",new Map);Se(this,"active",null);var t,r;this.presets=((t=e.presets)==null?void 0:t.slice())??[],this.history=e.history??jc(),this.historyMax=e.historyMax??Wc,this.clientFactory=e.clientFactory??((i,o)=>new Gs(i,o)),this.supportedTransports=((r=e.transports)==null?void 0:r.slice())??[...Ii],this.boot=e.bootParams&&(Pc(e.bootParams)||zc(e.bootParams))?{...e.bootParams}:null,this.embeddedResolver=e.embeddedResolver}transports(){return this.supportedTransports.slice()}bootParams(){return this.boot?{...this.boot}:null}useHandoffToken(e,t){const r=t.trim();r&&this.handoffTokens.set(this.handoffKey(e),r)}async list(){const e=new Set,t=[];for(const r of this.presets)e.has(r.url)||(e.add(r.url),t.push(r));for(const r of this.history.load())e.has(r.url)||(e.add(r.url),t.push({id:r.url,label:r.label,url:r.url,role:"primary"}));return t}async connect(e){const t=this.resolve(e);if(!t)throw new Cc(e);let r=t.url;if(this.embeddedResolver&&/^file:\/\//i.test(t.url))try{r=await this.embeddedResolver(t.url)}catch(c){const l=c instanceof Error?c.message:String(c);throw new Co(t.id,l)}const i=this.consumeHandoffToken(t.url),o=this.clientFactory(r,i?{headers:{Authorization:`Bearer ${i}`}}:void 0),s=await o.ping();if(!s.ok)throw new Co(t.id,s.error);const a={connection:t,client:o,rtt_ms:s.rtt_ms};return this.active=a,this.record(t,s.rtt_ms),a}async whoami(){if(!this.active)throw new Dc;const e=await this.active.client.whoami();return{authenticated:e.authenticated,username:e.username,role:e.role}}forget(e){const t=this.history.load().filter(r=>r.url!==e);this.history.save(t)}resolve(e){const t=this.presets.find(i=>i.id===e);if(t)return t;const r=this.history.load().find(i=>i.url===e);if(r)return{id:r.url,label:r.label,url:r.url,role:"primary"};if(/^[a-z+]+:\/\//i.test(e)){let i=e;try{i=new URL(e).host||e}catch{}return{id:e,label:i,url:e,role:"primary",description:"Ad-hoc URL."}}return null}handoffKey(e){return e.replace(/\/$/,"")}consumeHandoffToken(e){const t=this.handoffKey(e),r=this.handoffTokens.get(t)??null;return this.handoffTokens.delete(t),r}record(e,t){const r=this.history.load().filter(o=>o.url!==e.url),i=[{url:e.url,label:e.label,last_used:Date.now(),rtt_ms:t},...r].slice(0,this.historyMax);this.history.save(i)}}const zs="red-ui:connection",Fc=["__RED_BOOTSTRAP__","__RED_UI_CONNECTION_BOOTSTRAP__","__RED_UI_BOOTSTRAP__"];function En(n){return typeof n=="string"&&n.trim()?n.trim():void 0}function Kc(n){if(!n||typeof n!="object")return null;const e=En(n.target),t=En(n.token),r=En(n.route);return!e&&!t&&!r?null:{target:e??null,...t?{token:t}:{},...r?{route:r}:{}}}async function qc(n){for(const e of n){let t;try{t=Kc(await e())}catch{t=null}if(t)return t}return null}async function Hc(){if(typeof window>"u"||!("__TAURI_INTERNALS__"in window||"__TAURI__"in window))return null;try{return(await rr(()=>import("./DhEqZVGG.js"),[],import.meta.url)).invoke}catch{return null}}async function Vc(n){const e=n??await Hc();if(!e)return null;try{return await e("connection_bootstrap")}catch{return null}}async function Yc(n=globalThis){if(!n||typeof n!="object")return null;const e=n;for(const t of Fc){const r=e[t];if(r)try{return typeof r=="function"?await r():r}finally{try{delete e[t]}catch{e[t]=void 0}}}return null}function Xc(){return{consume:!0,location:typeof location>"u"?void 0:{pathname:location.pathname,search:location.search,hash:location.hash},history:typeof history>"u"?void 0:{state:history.state,replaceState:(n,e,t)=>history.replaceState(n,e,t)}}}function Jc(n){if(!n.consume||!n.location||!n.history)return;const e=n.location.hash;if(!e)return;const t=new URLSearchParams(e.startsWith("#")?e.slice(1):e);if(!t.has("token"))return;t.delete("token");const r=t.toString(),i=`${n.location.pathname}${n.location.search}${r?`#${r}`:""}`;try{n.history.replaceState(n.history.state,"",i)}catch{}}function Do(n=typeof location>"u"?"":location.search,e=typeof location>"u"?"":location.hash,t=Xc()){try{const r=Ps(n,e);return r.token&&Jc(t),!r.cs&&!r.to&&!r.token?null:{target:r.cs,token:r.token,route:r.to}}catch{return null}}function Zc(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}function Qc(n=Zc(),e=zs){if(!n)return null;try{const t=n.getItem(e);if(!t)return null;const r=JSON.parse(t),i=En(r==null?void 0:r.url);return i?{target:i}:null}catch{return null}}async function el(n={}){const e=n.readUrl??(()=>Do()),t=await qc([n.readTauri??Vc,n.readInjectedGlobal??Yc,e,n.readPersisted??(()=>Qc())]);if(t&&!n.readUrl)try{Do()}catch{}return t??{target:null}}class mt extends Error{constructor(t,r){super(r);Se(this,"code");this.name="SecureStoreError",this.code=t}}const tl=2e5,rl=16,nl=12;function gn(n){let e="";for(const t of n)e+=String.fromCharCode(t);return btoa(e)}function ri(n){const e=atob(n),t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function vr(n){const e=new ArrayBuffer(n.byteLength);return new Uint8Array(e).set(n),e}class il{constructor(e,t={}){Se(this,"storage");Se(this,"namespace");Se(this,"iterations");Se(this,"subtle");Se(this,"password");Se(this,"keyCache",new Map);var o;if(typeof e!="string"||e.length===0)throw new mt("LOCKED","master password required");const r=t.storage??(typeof globalThis<"u"?globalThis.localStorage:void 0);if(!r)throw new mt("BACKEND_FAILURE","no Storage backend available");const i=t.subtle??(typeof globalThis<"u"?(o=globalThis.crypto)==null?void 0:o.subtle:void 0);if(!i)throw new mt("BACKEND_FAILURE","Web Crypto SubtleCrypto unavailable");this.password=e,this.storage=r,this.namespace=t.namespace??"red-ui:secure",this.iterations=t.iterations??tl,this.subtle=i}storageKey(e){return`${this.namespace}:${e}`}async deriveKey(e){const t=gn(e),r=this.keyCache.get(t);if(r)return r;const i=new TextEncoder().encode(this.password),o=await this.subtle.importKey("raw",vr(i),"PBKDF2",!1,["deriveKey"]),s=await this.subtle.deriveKey({name:"PBKDF2",salt:vr(e),iterations:this.iterations,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"]);return this.keyCache.set(t,s),s}randomBytes(e){const t=new Uint8Array(e),r=globalThis.crypto;if(!r)throw new mt("BACKEND_FAILURE","crypto.getRandomValues unavailable");return r.getRandomValues(t),t}async put(e,t){const r=this.randomBytes(rl),i=this.randomBytes(nl),o=await this.deriveKey(r),s=new TextEncoder().encode(t);let a;try{a=await this.subtle.encrypt({name:"AES-GCM",iv:vr(i)},o,vr(s))}catch(l){throw new mt("BACKEND_FAILURE",`encrypt failed: ${l.message}`)}const c={v:1,salt:gn(r),nonce:gn(i),ciphertext:gn(new Uint8Array(a))};try{this.storage.setItem(this.storageKey(e),JSON.stringify(c))}catch(l){throw new mt("BACKEND_FAILURE",`storage write failed: ${l.message}`)}}async get(e){const t=this.storage.getItem(this.storageKey(e));if(!t)return null;let r;try{r=JSON.parse(t)}catch{throw new mt("CORRUPT_ENVELOPE",`key ${e}: not valid JSON`)}if(!r||r.v!==1||typeof r.salt!="string"||typeof r.nonce!="string"||typeof r.ciphertext!="string")throw new mt("CORRUPT_ENVELOPE",`key ${e}: missing envelope fields`);let i,o,s;try{i=ri(r.salt),o=ri(r.nonce),s=ri(r.ciphertext)}catch{throw new mt("CORRUPT_ENVELOPE",`key ${e}: base64 decode failed`)}const a=await this.deriveKey(i);let c;try{c=await this.subtle.decrypt({name:"AES-GCM",iv:vr(o)},a,vr(s))}catch{throw new mt("DECRYPT_FAILED",`key ${e}: decryption failed (wrong password or tampered payload)`)}return new TextDecoder().decode(c)}async delete(e){try{this.storage.removeItem(this.storageKey(e))}catch(t){throw new mt("BACKEND_FAILURE",`storage delete failed: ${t.message}`)}}}const ni="UNKNOWN";function ol(n){return typeof n=="object"&&n!==null&&typeof n.code=="string"&&typeof n.message=="string"}function Ws(n){if(ol(n)){const e=n.detail;return{code:n.code,message:n.message,...typeof e=="string"&&e.length>0?{detail:e}:{}}}return typeof n=="string"?{code:ni,message:n}:n instanceof Error?{code:ni,message:n.message||String(n)}:{code:ni,message:String(n)}}function ii(n){const e=Ws(n);return e.detail?`${e.message}: ${e.detail}`:e.message}class Sn extends Error{constructor(t){super(t.detail?`${t.message}: ${t.detail}`:t.message);Se(this,"code");Se(this,"detail");this.name="DesktopError",this.code=t.code,this.detail=t.detail}static from(t){return t instanceof Sn?t:new Sn(Ws(t))}}class sl{constructor(e){Se(this,"invoke");Se(this,"service");if(!e.invoke)throw new mt("BACKEND_FAILURE","tauri invoke fn not provided");this.invoke=e.invoke,this.service=e.service??"io.reddb.red-ui"}async put(e,t){try{await this.invoke("keychain_set",{service:this.service,key:e,value:t})}catch(r){throw new mt("BACKEND_FAILURE",`keychain_set failed: ${ii(r)}`)}}async get(e){try{return await this.invoke("keychain_get",{service:this.service,key:e})??null}catch(t){throw new mt("BACKEND_FAILURE",`keychain_get failed: ${ii(t)}`)}}async delete(e){try{await this.invoke("keychain_delete",{service:this.service,key:e})}catch(t){throw new mt("BACKEND_FAILURE",`keychain_delete failed: ${ii(t)}`)}}}/**
|
|
4
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
5
|
+
*
|
|
6
|
+
* ISC License
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
9
|
+
*
|
|
10
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
12
|
+
* copyright notice and this permission notice appear in all copies.
|
|
13
|
+
*
|
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
15
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
16
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
17
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
18
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
19
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
20
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
21
|
+
*
|
|
22
|
+
*/const al={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var ul=kt("<svg><!><!></svg>");function ot(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]),r=Ze(t,["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"]);Cs(e,!1);let i=pr(e,"name",8,void 0),o=pr(e,"color",8,"currentColor"),s=pr(e,"size",8,24),a=pr(e,"strokeWidth",8,2),c=pr(e,"absoluteStrokeWidth",8,!1),l=pr(e,"iconNode",24,()=>[]);const d=(...v)=>v.filter((E,b,y)=>!!E&&y.indexOf(E)===b).join(" ");vc();var h=ul();_o(h,(v,E)=>({...al,...r,width:s(),height:s(),stroke:o(),"stroke-width":v,class:E}),[()=>(mr(c()),mr(a()),mr(s()),It(()=>c()?Number(a())*24/Number(s()):a())),()=>(mr(i()),mr(t),It(()=>d("lucide-icon","lucide",i()?`lucide-${i()}`:"",t.class)))]);var f=G(h);yt(f,1,l,xn,(v,E)=>{var b=re(()=>_n(u(E),2));let y=()=>u(b)[0],A=()=>u(b)[1];var _=qe(),p=Le(_);gc(p,y,!0,(k,$)=>{_o(k,()=>({...A()}))}),z(v,_)});var g=U(f);rt(g,e,"default",{},null),D(h),z(n,h),Ds()}function Lo(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
23
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* ISC License
|
|
26
|
+
*
|
|
27
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
28
|
+
*
|
|
29
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
30
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
31
|
+
* copyright notice and this permission notice appear in all copies.
|
|
32
|
+
*
|
|
33
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
34
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
35
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
36
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
37
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
38
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
39
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
40
|
+
*
|
|
41
|
+
*/const r=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}],["path",{d:"m7 16.5-4.74-2.85"}],["path",{d:"m7 16.5 5-3"}],["path",{d:"M7 16.5v5.17"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}],["path",{d:"m17 16.5-5-3"}],["path",{d:"m17 16.5 4.74-2.85"}],["path",{d:"M17 16.5v5.17"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}],["path",{d:"M12 8 7.26 5.15"}],["path",{d:"m12 8 4.74-2.85"}],["path",{d:"M12 13.5V8"}]];ot(n,it({name:"boxes"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function cl(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
42
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* ISC License
|
|
45
|
+
*
|
|
46
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
47
|
+
*
|
|
48
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
49
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
50
|
+
* copyright notice and this permission notice appear in all copies.
|
|
51
|
+
*
|
|
52
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
53
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
54
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
55
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
56
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
57
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
58
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
59
|
+
*
|
|
60
|
+
*/const r=[["path",{d:"m18 16 4-4-4-4"}],["path",{d:"m6 8-4 4 4 4"}],["path",{d:"m14.5 4-5 16"}]];ot(n,it({name:"code-xml"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function bp(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
61
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* ISC License
|
|
64
|
+
*
|
|
65
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
66
|
+
*
|
|
67
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
68
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
69
|
+
* copyright notice and this permission notice appear in all copies.
|
|
70
|
+
*
|
|
71
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
72
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
73
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
74
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
75
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
76
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
77
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
78
|
+
*
|
|
79
|
+
*/const r=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"}]];ot(n,it({name:"file-json"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function Io(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
80
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* ISC License
|
|
83
|
+
*
|
|
84
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
85
|
+
*
|
|
86
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
87
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
88
|
+
* copyright notice and this permission notice appear in all copies.
|
|
89
|
+
*
|
|
90
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
91
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
92
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
93
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
94
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
95
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
96
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
97
|
+
*
|
|
98
|
+
*/const r=[["path",{d:"M3 7V5c0-1.1.9-2 2-2h2"}],["path",{d:"M17 3h2c1.1 0 2 .9 2 2v2"}],["path",{d:"M21 17v2c0 1.1-.9 2-2 2h-2"}],["path",{d:"M7 21H5c-1.1 0-2-.9-2-2v-2"}],["rect",{width:"7",height:"5",x:"7",y:"7",rx:"1"}],["rect",{width:"7",height:"5",x:"10",y:"12",rx:"1"}]];ot(n,it({name:"group"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function ll(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
99
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* ISC License
|
|
102
|
+
*
|
|
103
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
104
|
+
*
|
|
105
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
106
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
107
|
+
* copyright notice and this permission notice appear in all copies.
|
|
108
|
+
*
|
|
109
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
110
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
111
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
112
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
113
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
114
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
115
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
116
|
+
*
|
|
117
|
+
*/const r=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];ot(n,it({name:"info"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function wp(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
118
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* ISC License
|
|
121
|
+
*
|
|
122
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
123
|
+
*
|
|
124
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
125
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
126
|
+
* copyright notice and this permission notice appear in all copies.
|
|
127
|
+
*
|
|
128
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
129
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
130
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
131
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
132
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
133
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
134
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
135
|
+
*
|
|
136
|
+
*/const r=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17"}]];ot(n,it({name:"layers"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function _p(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
137
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* ISC License
|
|
140
|
+
*
|
|
141
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
142
|
+
*
|
|
143
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
144
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
145
|
+
* copyright notice and this permission notice appear in all copies.
|
|
146
|
+
*
|
|
147
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
148
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
149
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
150
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
151
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
152
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
153
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
154
|
+
*
|
|
155
|
+
*/const r=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12"}]];ot(n,it({name:"link-2"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function dl(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
156
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* ISC License
|
|
159
|
+
*
|
|
160
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
161
|
+
*
|
|
162
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
163
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
164
|
+
* copyright notice and this permission notice appear in all copies.
|
|
165
|
+
*
|
|
166
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
167
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
168
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
169
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
170
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
171
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
172
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
173
|
+
*
|
|
174
|
+
*/const r=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];ot(n,it({name:"loader-circle"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function hl(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
175
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* ISC License
|
|
178
|
+
*
|
|
179
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
180
|
+
*
|
|
181
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
182
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
183
|
+
* copyright notice and this permission notice appear in all copies.
|
|
184
|
+
*
|
|
185
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
186
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
187
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
188
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
189
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
190
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
191
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
192
|
+
*
|
|
193
|
+
*/const r=[["polyline",{points:"15 3 21 3 21 9"}],["polyline",{points:"9 21 3 21 3 15"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14"}]];ot(n,it({name:"maximize-2"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function Go(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
194
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* ISC License
|
|
197
|
+
*
|
|
198
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
199
|
+
*
|
|
200
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
201
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
202
|
+
* copyright notice and this permission notice appear in all copies.
|
|
203
|
+
*
|
|
204
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
205
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
206
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
207
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
208
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
209
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
210
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
211
|
+
*
|
|
212
|
+
*/const r=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"}],["path",{d:"M12 12V8"}]];ot(n,it({name:"network"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function fl(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
213
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* ISC License
|
|
216
|
+
*
|
|
217
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
218
|
+
*
|
|
219
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
220
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
221
|
+
* copyright notice and this permission notice appear in all copies.
|
|
222
|
+
*
|
|
223
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
224
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
225
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
226
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
227
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
228
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
229
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
230
|
+
*
|
|
231
|
+
*/const r=[["polygon",{points:"6 3 20 12 6 21 6 3"}]];ot(n,it({name:"play"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function pl(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
232
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
233
|
+
*
|
|
234
|
+
* ISC License
|
|
235
|
+
*
|
|
236
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
237
|
+
*
|
|
238
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
239
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
240
|
+
* copyright notice and this permission notice appear in all copies.
|
|
241
|
+
*
|
|
242
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
243
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
244
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
245
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
246
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
247
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
248
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
249
|
+
*
|
|
250
|
+
*/const r=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}]];ot(n,it({name:"rotate-cw"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function gl(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
251
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* ISC License
|
|
254
|
+
*
|
|
255
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
256
|
+
*
|
|
257
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
258
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
259
|
+
* copyright notice and this permission notice appear in all copies.
|
|
260
|
+
*
|
|
261
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
262
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
263
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
264
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
265
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
266
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
267
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
268
|
+
*
|
|
269
|
+
*/const r=[["circle",{cx:"6",cy:"19",r:"3"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"}],["circle",{cx:"18",cy:"5",r:"3"}]];ot(n,it({name:"route"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function vl(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
270
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
271
|
+
*
|
|
272
|
+
* ISC License
|
|
273
|
+
*
|
|
274
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
275
|
+
*
|
|
276
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
277
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
278
|
+
* copyright notice and this permission notice appear in all copies.
|
|
279
|
+
*
|
|
280
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
281
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
282
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
283
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
284
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
285
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
286
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
287
|
+
*
|
|
288
|
+
*/const r=[["circle",{cx:"11",cy:"11",r:"8"}],["path",{d:"m21 21-4.3-4.3"}]];ot(n,it({name:"search"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function yl(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
289
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* ISC License
|
|
292
|
+
*
|
|
293
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
294
|
+
*
|
|
295
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
296
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
297
|
+
* copyright notice and this permission notice appear in all copies.
|
|
298
|
+
*
|
|
299
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
300
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
301
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
302
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
303
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
304
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
305
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
306
|
+
*
|
|
307
|
+
*/const r=[["circle",{cx:"19",cy:"5",r:"2"}],["circle",{cx:"5",cy:"19",r:"2"}],["path",{d:"M5 17A12 12 0 0 1 17 5"}]];ot(n,it({name:"spline"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function ml(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
308
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
309
|
+
*
|
|
310
|
+
* ISC License
|
|
311
|
+
*
|
|
312
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
313
|
+
*
|
|
314
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
315
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
316
|
+
* copyright notice and this permission notice appear in all copies.
|
|
317
|
+
*
|
|
318
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
319
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
320
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
321
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
322
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
323
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
324
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
325
|
+
*
|
|
326
|
+
*/const r=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18"}]];ot(n,it({name:"table-2"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function To(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
327
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
328
|
+
*
|
|
329
|
+
* ISC License
|
|
330
|
+
*
|
|
331
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
332
|
+
*
|
|
333
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
334
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
335
|
+
* copyright notice and this permission notice appear in all copies.
|
|
336
|
+
*
|
|
337
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
338
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
339
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
340
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
341
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
342
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
343
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
344
|
+
*
|
|
345
|
+
*/const r=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];ot(n,it({name:"triangle-alert"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function Oo(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
346
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* ISC License
|
|
349
|
+
*
|
|
350
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
351
|
+
*
|
|
352
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
353
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
354
|
+
* copyright notice and this permission notice appear in all copies.
|
|
355
|
+
*
|
|
356
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
357
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
358
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
359
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
360
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
361
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
362
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
363
|
+
*
|
|
364
|
+
*/const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];ot(n,it({name:"x"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function bl(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
365
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
366
|
+
*
|
|
367
|
+
* ISC License
|
|
368
|
+
*
|
|
369
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
370
|
+
*
|
|
371
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
372
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
373
|
+
* copyright notice and this permission notice appear in all copies.
|
|
374
|
+
*
|
|
375
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
376
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
377
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
378
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
379
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
380
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
381
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
382
|
+
*
|
|
383
|
+
*/const r=[["circle",{cx:"11",cy:"11",r:"8"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11"}]];ot(n,it({name:"zoom-in"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}function wl(n,e){const t=Ze(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
384
|
+
* @license lucide-svelte v0.475.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* ISC License
|
|
387
|
+
*
|
|
388
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
389
|
+
*
|
|
390
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
391
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
392
|
+
* copyright notice and this permission notice appear in all copies.
|
|
393
|
+
*
|
|
394
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
395
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
396
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
397
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
398
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
399
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
400
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
401
|
+
*
|
|
402
|
+
*/const r=[["circle",{cx:"11",cy:"11",r:"8"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11"}]];ot(n,it({name:"zoom-out"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=qe(),a=Le(s);rt(a,e,"default",{},null),z(i,s)},$$slots:{default:!0}}))}const _l=20;var Hr,Vr,Yr;class xl{constructor(){tt(this,Hr,ge(0));tt(this,Vr,re(()=>this.inflight>0));tt(this,Yr,ge(Wt([])));Se(this,"nextId",1)}get inflight(){return u(_e(this,Hr))}set inflight(e){M(_e(this,Hr),e,!0)}get active(){return u(_e(this,Vr))}set active(e){M(_e(this,Vr),e)}get log(){return u(_e(this,Yr))}set log(e){M(_e(this,Yr),e,!0)}async track(e,t){const r=this.nextId++,i={id:r,label:e,startedAt:Date.now(),durationMs:null,status:"pending"};It(()=>{this.log=[i,...this.log].slice(0,_l),this.inflight+=1});try{const o=await t();return It(()=>this.update(r,{durationMs:Date.now()-i.startedAt,status:"ok"})),o}catch(o){throw It(()=>this.update(r,{durationMs:Date.now()-i.startedAt,status:"error",error:o.message})),o}finally{It(()=>{this.inflight=Math.max(0,this.inflight-1)})}}update(e,t){this.log=this.log.map(r=>r.id===e?{...r,...t}:r)}reset(){It(()=>{this.log=this.log.map(e=>e.status==="pending"?{...e,status:"error",error:"reset by user",durationMs:Date.now()-e.startedAt}:e),this.inflight=0})}}Hr=new WeakMap,Vr=new WeakMap,Yr=new WeakMap;const er=new xl,El="red-ui:history",kl="history:";function js(n,e=!1){switch(n){case"embedded":return"none";case"standalone":return"vault";case"web":return e?"none":"labels-only"}}function Sl(n){if(n.url)try{const t=new URL(n.url).host;if(t)return t}catch{}const e=(n.label??n.url??"").trim();if(!e)return"";try{const t=new URL(e).host;if(t)return t}catch{}return e.includes("@")?e.slice(e.lastIndexOf("@")+1):e}function $l(){return typeof localStorage>"u"?void 0:localStorage}function Ro(n){return`label:${encodeURIComponent(n)}`}function Al(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2)+Date.now().toString(36)}function Rr(n,e){if(!n)return[];try{const t=n.getItem(e);if(!t)return[];const r=JSON.parse(t);return Array.isArray(r)?r.filter(i=>i&&typeof i.id=="string"&&typeof i.label=="string").map(i=>({id:i.id,label:i.label,last_used:i.last_used,rtt_ms:i.rtt_ms})):[]}catch{return[]}}function No(n,e,t){if(n)try{n.setItem(e,JSON.stringify(t))}catch{}}class Cl{constructor(e){Se(this,"surface");Se(this,"secureStore");Se(this,"managedWebTarget");Se(this,"storage");Se(this,"historyKey");Se(this,"urlPrefix");Se(this,"idByUrl",new Map);Se(this,"urlById",new Map);Se(this,"onChange");this.surface=e.surface,this.secureStore=e.secureStore,this.managedWebTarget=e.managedWebTarget??(()=>!1),this.storage=e.storage??$l(),this.historyKey=e.historyKey??El,this.urlPrefix=e.urlPrefix??kl}setOnChange(e){this.onChange=e}persistence(){return js(this.surface(),this.managedWebTarget())}load(){return this.persistence()==="none"?[]:Rr(this.storage,this.historyKey).map(e=>({url:this.urlById.get(e.id)??"",label:e.label,last_used:e.last_used,rtt_ms:e.rtt_ms}))}save(e){var c,l,d;const t=this.persistence();if(t==="none"){(c=this.onChange)==null||c.call(this);return}const r=Rr(this.storage,this.historyKey),i=new Map(r.map(h=>[h.label,h])),o=[],s=new Set,a=new Set;for(const h of e){const f=Sl(h);if(!f)continue;let g;h.url?(g=t==="labels-only"?Ro(f):this.idByUrl.get(h.url)??Al(),this.idByUrl.set(h.url,g),this.urlById.set(g,h.url)):g=((l=i.get(f))==null?void 0:l.id)??Ro(f),!(s.has(g)||!h.url&&a.has(f))&&(s.add(g),a.add(f),o.push({id:g,label:f,last_used:typeof h.last_used=="number"?h.last_used:Date.now(),rtt_ms:h.rtt_ms}))}if(No(this.storage,this.historyKey,o),t==="vault"){const h=this.secureStore();if(h)for(const f of o){const g=this.urlById.get(f.id);g&&h.put(this.urlPrefix+f.id,g).catch(()=>{})}}(d=this.onChange)==null||d.call(this)}uiEntries(){return this.persistence()==="none"?[]:Rr(this.storage,this.historyKey).map(e=>({id:e.id,label:e.label,last_used:e.last_used,rtt_ms:e.rtt_ms,url:this.urlById.get(e.id)}))}async hydrate(){var i;if(this.persistence()!=="vault")return;const e=this.secureStore();if(!e)return;const t=Rr(this.storage,this.historyKey);let r=!1;for(const o of t)if(!this.urlById.has(o.id))try{const s=await e.get(this.urlPrefix+o.id);s&&(this.urlById.set(o.id,s),this.idByUrl.set(s,o.id),r=!0)}catch{}r&&((i=this.onChange)==null||i.call(this))}async forgetById(e){var o,s;if(this.persistence()==="none"){(o=this.onChange)==null||o.call(this);return}const t=Rr(this.storage,this.historyKey).filter(a=>a.id!==e);No(this.storage,this.historyKey,t);const r=this.urlById.get(e);r&&(this.urlById.delete(e),this.idByUrl.delete(r));const i=this.persistence()==="vault"?this.secureStore():null;if(i)try{await i.delete(this.urlPrefix+e)}catch{}(s=this.onChange)==null||s.call(this)}async forgetByUrl(e){const t=this.idByUrl.get(e);t&&await this.forgetById(t)}}function Dl({tauri:n,inFrame:e,mcp:t,embedLib:r}){return n?"standalone":e||t||r?"embedded":"web"}function Ll(){if(typeof window>"u")return"web";const n="__TAURI_INTERNALS__"in window||"__TAURI__"in window;let e=!1;try{e=window.self!==window.top}catch{e=!0}const t=typeof location<"u"&&new URLSearchParams(location.search).has("mcp"),r=window.__RED_UI_EMBED_SURFACE__===!0;return Dl({tauri:n,inFrame:e,mcp:t,embedLib:r})}function oi(n,e){switch(n){case"embedded":return!1;case"standalone":return!0;case"web":return!1}}const Ai="red-ui:secure",Uo="__probe__",Mo="ok";function Po(){if(typeof localStorage>"u")return!1;for(let n=0;n<localStorage.length;n++){const e=localStorage.key(n);if(e&&e.startsWith(Ai+":"))return!0}return!1}var Xr,Jr,Zr,Qr,en,tn;class Il{constructor(){tt(this,Xr,ge(null));tt(this,Jr,ge(!0));tt(this,Zr,ge(!1));tt(this,Qr,ge("unknown"));tt(this,en,ge("web"));tt(this,tn,ge(null));if(typeof window>"u"){this.backend="unknown";return}if(this.surface=Ll(),this.surface==="standalone"){this.backend="tauri",this.bindTauri();return}this.backend="web",Po(),this.needsSetup=!1,this.locked=oi(this.surface)}get store(){return u(_e(this,Xr))}set store(e){M(_e(this,Xr),e,!0)}get locked(){return u(_e(this,Jr))}set locked(e){M(_e(this,Jr),e,!0)}get needsSetup(){return u(_e(this,Zr))}set needsSetup(e){M(_e(this,Zr),e,!0)}get backend(){return u(_e(this,Qr))}set backend(e){M(_e(this,Qr),e,!0)}get surface(){return u(_e(this,en))}set surface(e){M(_e(this,en),e,!0)}get error(){return u(_e(this,tn))}set error(e){M(_e(this,tn),e,!0)}async bindTauri(){try{const e=await rr(()=>import("./DhEqZVGG.js"),[],import.meta.url);this.store=new sl({invoke:e.invoke}),this.locked=!1}catch(e){this.error=`Tauri keychain bridge unavailable: ${e.message}`}}async unlock(e){if(this.error=null,this.backend!=="web")return!0;let t;try{t=new il(e,{namespace:Ai})}catch(r){return this.error=r.message,!1}try{const r=await t.get(Uo);if(r===null)await t.put(Uo,Mo);else if(r!==Mo)return this.error="Wrong password",!1}catch(r){return r instanceof mt&&r.code==="DECRYPT_FAILED"?(this.error="Wrong password",!1):(this.error=r.message,!1)}return this.store=t,this.locked=!1,this.needsSetup=!1,!0}lock(){this.store=null,this.backend==="web"&&(this.locked=oi(this.surface,Po()))}wipe(){if(typeof localStorage>"u")return;const e=[];for(let t=0;t<localStorage.length;t++){const r=localStorage.key(t);r&&(r.startsWith(Ai+":")||r.startsWith("red-ui:"))&&e.push(r)}for(const t of e)localStorage.removeItem(t);this.store=null,this.backend==="web"&&(this.locked=oi(this.surface),this.needsSetup=!1),this.error=null}}Xr=new WeakMap,Jr=new WeakMap,Zr=new WeakMap,Qr=new WeakMap,en=new WeakMap,tn=new WeakMap;const jr=new Il,Bs=[{id:"embedded",label:"Embedded",url:"http://localhost:5055",role:"embedded",description:"Local file via ./scripts/embedded.sh."},{id:"docker-primary",label:"Docker primary",url:"http://localhost:15055",role:"primary",description:"Docker compose primary (./docker/compose.yml)."},{id:"docker-replica",label:"Docker replica",url:"http://localhost:25055",role:"replica",description:"Read-only mirror of docker primary."}],zo=zs;function Wo(n){if(typeof localStorage>"u")return;if(Ol()!=="vault"){try{localStorage.removeItem(zo)}catch{}return}try{localStorage.setItem(zo,JSON.stringify(n))}catch{}}const Gl=/(handoff|token|secret|password|passwd|auth|credential|api[-_]?key|bearer)/i;let Gi=!1;function Tl(){jr.surface==="web"&&(Gi=!0)}function Fs(){if(Gi)return!0;if(jr.surface!=="web"||typeof location>"u")return!1;for(const n of[location.search,location.hash]){const e=new URLSearchParams(n.startsWith("#")?n.slice(1):n);for(const t of e.keys())if(Gl.test(t))return!0}return!1}function Ol(){return js(jr.surface,Fs())}const ir=new Cl({surface:()=>jr.surface,secureStore:()=>jr.store,managedWebTarget:Fs});function Rl(n){let e=n.trim().replace(/\/$/,"");if(!e)return e;/:\/\//.test(e)||(e="http://"+e);const t=e.match(/^([a-z+]+):\/\/(.+)$/i);if(!t)return e;const[,r,i]=t,o=r.toLowerCase();if(o==="red"||o==="red+tcp"||o==="red+wire"){const[s]=i.split("/")[0].split(":");return`http://${s}:5055${i.includes("/")?"/"+i.split("/").slice(1).join("/"):""}`}if(o==="reds"||o==="red+tls"){const[s]=i.split("/")[0].split(":");return`https://${s}:5055`}return e}function Ci(n){const e=Rl(n);let t=e;try{t=new URL(e).host}catch{}return{id:e,label:t||e,url:e,role:"primary",description:"User-provided connection string."}}function Ln(){return typeof window<"u"&&("__TAURI_INTERNALS__"in window||"__TAURI__"in window)}function Nl(){return[...Ln()?Ic:Ii]}async function Ul(n){if(!Ln())throw new Error("file:// databases can only be opened in the desktop app");const e=n.replace(/^file:\/\//i,""),{invoke:t}=await rr(async()=>{const{invoke:r}=await import("./DhEqZVGG.js");return{invoke:r}},[],import.meta.url);try{return await t("open_embedded",{path:e})}catch(r){throw Sn.from(r)}}const Ml=async(n,e)=>{const t=typeof n=="string"?n:n instanceof URL?n.href:n.url,r=/^https?:\/\/(127\.0\.0\.1|localhost|\[::1\])(:\d+)?(\/|$)/i.test(t);if(Ln()&&r)try{const{fetch:i}=await rr(async()=>{const{fetch:o}=await import("./B5euRbKa.js");return{fetch:o}},__vite__mapDeps([0,1]),import.meta.url);return await i(n,e)}catch(i){const o=i instanceof Error?i.message:typeof i=="string"?i:String(i);throw new Error(`rust-side fetch failed for ${t}: ${o}`)}return fetch(n,e)};function Pl(n){return typeof n.useHandoffToken=="function"}const zl=new Bc({presets:Bs,history:ir,transports:Nl(),embeddedResolver:Ul,clientFactory:(n,e)=>new Gs(n,{...e,fetch:Ml}),bootParams:Mc(typeof location<"u"?location.search:"",typeof location<"u"?location.hash:"")});let Ks=zl;function Nr(){return Ks}function xp(n){Ks=n}var rn,nn,on,sn,_r,xr,Er;class Wl{constructor(){tt(this,rn,ge(!1));tt(this,nn,ge(Wt(Bs[1])));tt(this,on,ge(Wt({reachable:!1})));tt(this,sn,ge(Wt([])));tt(this,_r,ge(null));tt(this,xr,ge(Wt({...wr})));tt(this,Er,ge(!1));this.history=ir.uiEntries(),ir.setOnChange(()=>{this.history=ir.uiEntries()})}get connected(){return u(_e(this,rn))}set connected(e){M(_e(this,rn),e,!0)}get active(){return u(_e(this,nn))}set active(e){M(_e(this,nn),e,!0)}get probe(){return u(_e(this,on))}set probe(e){M(_e(this,on),e,!0)}get history(){return u(_e(this,sn))}set history(e){M(_e(this,sn),e,!0)}get targetResolved(){return u(_e(this,Er))}get client(){return u(_e(this,_r))}get readOnly(){var e;return this.connected&&((e=this.probe.stats)==null?void 0:e.read_only)===!0}get readOnlyReason(){var e;return(e=this.probe.stats)==null?void 0:e.read_only_reason}get capabilities(){return u(_e(this,xr))}get supportedTransports(){var e,t;return((t=(e=Nr()).transports)==null?void 0:t.call(e))??[...Ii]}canReach(e){return Gc(e,this.supportedTransports)}async forget(e){await ir.forgetByUrl(e)}async forgetById(e){await ir.forgetById(e)}async hydrateUrls(){await ir.hydrate()}async bootstrap(e=el){const t=await e(),r=t.route??null;if(!t.target)return r;const i=Ci(t.target);if(t.token){Tl();const o=Nr();Pl(o)&&o.useHandoffToken(i.url,t.token)}return await this.tryConnect(i),r}async switch(e){this.active=e,Wo(e),await this.tryConnect(e)}async tryConnect(e){M(_e(this,Er),!0),Or.begin(`Opening ${e.label}`);try{Or.step("Reaching server",e.url);const t=await er.track(`connect · ${e.label}`,()=>Nr().connect(e.id));M(_e(this,_r),t.client,!0),this.active={...e,...t.connection,description:e.description},Wo(this.active),Or.step("Fetching stats & capabilities");const[r,i,o]=await Promise.all([er.track(`connect · ${e.label} stats`,()=>t.client.stats()).catch(()=>{}),er.track(`connect · ${e.label} replication`,()=>t.client.replication()).catch(()=>{}),er.track(`connect · ${e.label} capabilities`,()=>t.client.capabilities()).catch(()=>({...wr}))]);return this.probe={reachable:!0,rtt_ms:t.rtt_ms,stats:r,replication:i},M(_e(this,xr),o,!0),this.connected=!0,Or.succeed(),!0}catch(t){return this.probe={reachable:!1,error:t.message},Or.fail(t.message),!1}}async adoptInjected(){const[e]=await Nr().list();if(!e)return!1;const t={...e,description:e.description??"Injected by the embedding host."};return this.tryConnect(t)}async connectFromBootParams(){var r,i;const e=(i=(r=Nr()).bootParams)==null?void 0:i.call(r);if(!e)return null;const t=e.to??e.view??null;return e.endpoint&&await this.tryConnect(Ci(e.endpoint)),t}async refresh(){const e=this.client;if(!e){await this.tryConnect(this.active);return}try{const t=await er.track(`heartbeat · ${this.active.label}`,()=>e.ping());if(!t.ok){this.probe={reachable:!1,error:t.error};return}const[r,i]=await Promise.all([er.track("heartbeat · stats",()=>e.stats()).catch(()=>{}),er.track("heartbeat · replication",()=>e.replication()).catch(()=>{})]);this.probe={reachable:!0,rtt_ms:t.rtt_ms,stats:r,replication:i},this.connected=!0}catch(t){this.probe={reachable:!1,error:t.message}}}disconnect(){this.connected=!1,this.probe={reachable:!1},M(_e(this,_r),null),M(_e(this,xr),{...wr},!0),M(_e(this,Er),!1),Gi=!1}}rn=new WeakMap,nn=new WeakMap,on=new WeakMap,sn=new WeakMap,_r=new WeakMap,xr=new WeakMap,Er=new WeakMap;const $n=new Wl,qs="Local database files (file://) can only be opened in the desktop app — the web version can't reach files on your machine.";function Ep(n){return $n.canReach(n)?null:Ts(n)==="unix"?qs:null}async function kp(n){if(!Ln())return{ok:!1,reason:qs};const e=(await rr(async()=>{const{open:i}=await import("./C-kqMbRi.js");return{open:i}},__vite__mapDeps([2,1]),import.meta.url)).open,t=await e({multiple:!1,directory:!1,title:"Open database file",filters:[{name:"reddb database",extensions:["rdb"]}]});return t?await $n.tryConnect(Ci(`file://${t}`))?{ok:!0}:{ok:!1,reason:$n.probe.error??"unreachable"}:{ok:!1,cancelled:!0}}function Sp(n){return n?n==="graph"?"graph":n:"table"}function $p(n,e){switch(n){case"graph":case"svg":return"graph";case"table":return"table";case"json":return"json";case"hypertable":case"kv":case"vector":case"queue":case"stats":case"diff":case"document":return n;default:return e}}function si(n,e){return`/c/${encodeURIComponent(n)}/p/${encodeURIComponent(e)}`}function Ti(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var vn={exports:{}},jo;function jl(){if(jo)return vn.exports;jo=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(k,$,S){return Function.prototype.apply.call(k,$,S)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(k){return Object.getOwnPropertyNames(k).concat(Object.getOwnPropertySymbols(k))}:t=function(k){return Object.getOwnPropertyNames(k)};function r(p){console&&console.warn&&console.warn(p)}var i=Number.isNaN||function(k){return k!==k};function o(){o.init.call(this)}vn.exports=o,vn.exports.once=y,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(p){if(typeof p!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof p)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(p){if(typeof p!="number"||p<0||i(p))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+p+".");s=p}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(k){if(typeof k!="number"||k<0||i(k))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+k+".");return this._maxListeners=k,this};function c(p){return p._maxListeners===void 0?o.defaultMaxListeners:p._maxListeners}o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(k){for(var $=[],S=1;S<arguments.length;S++)$.push(arguments[S]);var I=k==="error",C=this._events;if(C!==void 0)I=I&&C.error===void 0;else if(!I)return!1;if(I){var T;if($.length>0&&(T=$[0]),T instanceof Error)throw T;var H=new Error("Unhandled error."+(T?" ("+T.message+")":""));throw H.context=T,H}var N=C[k];if(N===void 0)return!1;if(typeof N=="function")e(N,this,$);else for(var m=N.length,Ie=v(N,m),S=0;S<m;++S)e(Ie[S],this,$);return!0};function l(p,k,$,S){var I,C,T;if(a($),C=p._events,C===void 0?(C=p._events=Object.create(null),p._eventsCount=0):(C.newListener!==void 0&&(p.emit("newListener",k,$.listener?$.listener:$),C=p._events),T=C[k]),T===void 0)T=C[k]=$,++p._eventsCount;else if(typeof T=="function"?T=C[k]=S?[$,T]:[T,$]:S?T.unshift($):T.push($),I=c(p),I>0&&T.length>I&&!T.warned){T.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+T.length+" "+String(k)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=p,H.type=k,H.count=T.length,r(H)}return p}o.prototype.addListener=function(k,$){return l(this,k,$,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(k,$){return l(this,k,$,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(p,k,$){var S={fired:!1,wrapFn:void 0,target:p,type:k,listener:$},I=d.bind(S);return I.listener=$,S.wrapFn=I,I}o.prototype.once=function(k,$){return a($),this.on(k,h(this,k,$)),this},o.prototype.prependOnceListener=function(k,$){return a($),this.prependListener(k,h(this,k,$)),this},o.prototype.removeListener=function(k,$){var S,I,C,T,H;if(a($),I=this._events,I===void 0)return this;if(S=I[k],S===void 0)return this;if(S===$||S.listener===$)--this._eventsCount===0?this._events=Object.create(null):(delete I[k],I.removeListener&&this.emit("removeListener",k,S.listener||$));else if(typeof S!="function"){for(C=-1,T=S.length-1;T>=0;T--)if(S[T]===$||S[T].listener===$){H=S[T].listener,C=T;break}if(C<0)return this;C===0?S.shift():E(S,C),S.length===1&&(I[k]=S[0]),I.removeListener!==void 0&&this.emit("removeListener",k,H||$)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(k){var $,S,I;if(S=this._events,S===void 0)return this;if(S.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):S[k]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete S[k]),this;if(arguments.length===0){var C=Object.keys(S),T;for(I=0;I<C.length;++I)T=C[I],T!=="removeListener"&&this.removeAllListeners(T);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if($=S[k],typeof $=="function")this.removeListener(k,$);else if($!==void 0)for(I=$.length-1;I>=0;I--)this.removeListener(k,$[I]);return this};function f(p,k,$){var S=p._events;if(S===void 0)return[];var I=S[k];return I===void 0?[]:typeof I=="function"?$?[I.listener||I]:[I]:$?b(I):v(I,I.length)}o.prototype.listeners=function(k){return f(this,k,!0)},o.prototype.rawListeners=function(k){return f(this,k,!1)},o.listenerCount=function(p,k){return typeof p.listenerCount=="function"?p.listenerCount(k):g.call(p,k)},o.prototype.listenerCount=g;function g(p){var k=this._events;if(k!==void 0){var $=k[p];if(typeof $=="function")return 1;if($!==void 0)return $.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function v(p,k){for(var $=new Array(k),S=0;S<k;++S)$[S]=p[S];return $}function E(p,k){for(;k+1<p.length;k++)p[k]=p[k+1];p.pop()}function b(p){for(var k=new Array(p.length),$=0;$<k.length;++$)k[$]=p[$].listener||p[$];return k}function y(p,k){return new Promise(function($,S){function I(T){p.removeListener(k,C),S(T)}function C(){typeof p.removeListener=="function"&&p.removeListener("error",I),$([].slice.call(arguments))}_(p,k,C,{once:!0}),k!=="error"&&A(p,I,{once:!0})})}function A(p,k,$){typeof p.on=="function"&&_(p,"error",k,$)}function _(p,k,$,S){if(typeof p.on=="function")S.once?p.once(k,$):p.on(k,$);else if(typeof p.addEventListener=="function")p.addEventListener(k,function I(C){S.once&&p.removeEventListener(k,I),$(C)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof p)}return vn.exports}var Bl=jl();function Fl(){const n=arguments[0];for(let e=1,t=arguments.length;e<t;e++)if(arguments[e])for(const r in arguments[e])n[r]=arguments[e][r];return n}let st=Fl;typeof Object.assign=="function"&&(st=Object.assign);function Gt(n,e,t,r){const i=n._nodes.get(e);let o=null;return i&&(r==="mixed"?o=i.out&&i.out[t]||i.undirected&&i.undirected[t]:r==="directed"?o=i.out&&i.out[t]:o=i.undirected&&i.undirected[t]),o}function pt(n){return typeof n=="object"&&n!==null}function Hs(n){let e;for(e in n)return!1;return!0}function Lt(n,e,t){Object.defineProperty(n,e,{enumerable:!1,configurable:!1,writable:!0,value:t})}function Rt(n,e,t){const r={enumerable:!0,configurable:!0};typeof t=="function"?r.get=t:(r.value=t,r.writable=!1),Object.defineProperty(n,e,r)}function Bo(n){return!(!pt(n)||n.attributes&&!Array.isArray(n.attributes))}function Kl(){let n=Math.floor(Math.random()*256)&255;return()=>n++}function Ht(){const n=arguments;let e=null,t=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(e===null){if(t++,t>=n.length)return{done:!0};e=n[t][Symbol.iterator]()}if(r=e.next(),r.done){e=null;continue}break}while(!0);return r}}}function $r(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Oi extends Error{constructor(e){super(),this.name="GraphError",this.message=e}}class q extends Oi{constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,q.prototype.constructor)}}class j extends Oi{constructor(e){super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,j.prototype.constructor)}}class se extends Oi{constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,se.prototype.constructor)}}function Vs(n,e){this.key=n,this.attributes=e,this.clear()}Vs.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function Ys(n,e){this.key=n,this.attributes=e,this.clear()}Ys.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function Xs(n,e){this.key=n,this.attributes=e,this.clear()}Xs.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ar(n,e,t,r,i){this.key=e,this.attributes=i,this.undirected=n,this.source=t,this.target=r}Ar.prototype.attach=function(){let n="out",e="in";this.undirected&&(n=e="undirected");const t=this.source.key,r=this.target.key;this.source[n][r]=this,!(this.undirected&&t===r)&&(this.target[e][t]=this)};Ar.prototype.attachMulti=function(){let n="out",e="in";const t=this.source.key,r=this.target.key;this.undirected&&(n=e="undirected");const i=this.source[n],o=i[r];if(typeof o>"u"){i[r]=this,this.undirected&&t===r||(this.target[e][t]=this);return}o.previous=this,this.next=o,i[r]=this,this.target[e][t]=this};Ar.prototype.detach=function(){const n=this.source.key,e=this.target.key;let t="out",r="in";this.undirected&&(t=r="undirected"),delete this.source[t][e],delete this.target[r][n]};Ar.prototype.detachMulti=function(){const n=this.source.key,e=this.target.key;let t="out",r="in";this.undirected&&(t=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][e],delete this.target[r][n]):(this.next.previous=void 0,this.source[t][e]=this.next,this.target[r][n]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const Js=0,Zs=1,ql=2,Qs=3;function Vt(n,e,t,r,i,o,s){let a,c,l,d;if(r=""+r,t===Js){if(a=n._nodes.get(r),!a)throw new j(`Graph.${e}: could not find the "${r}" node in the graph.`);l=i,d=o}else if(t===Qs){if(i=""+i,c=n._edges.get(i),!c)throw new j(`Graph.${e}: could not find the "${i}" edge in the graph.`);const h=c.source.key,f=c.target.key;if(r===h)a=c.target;else if(r===f)a=c.source;else throw new j(`Graph.${e}: the "${r}" node is not attached to the "${i}" edge (${h}, ${f}).`);l=o,d=s}else{if(c=n._edges.get(r),!c)throw new j(`Graph.${e}: could not find the "${r}" edge in the graph.`);t===Zs?a=c.source:a=c.target,l=i,d=o}return[a,l,d]}function Hl(n,e,t){n.prototype[e]=function(r,i,o){const[s,a]=Vt(this,e,t,r,i,o);return s.attributes[a]}}function Vl(n,e,t){n.prototype[e]=function(r,i){const[o]=Vt(this,e,t,r,i);return o.attributes}}function Yl(n,e,t){n.prototype[e]=function(r,i,o){const[s,a]=Vt(this,e,t,r,i,o);return s.attributes.hasOwnProperty(a)}}function Xl(n,e,t){n.prototype[e]=function(r,i,o,s){const[a,c,l]=Vt(this,e,t,r,i,o,s);return a.attributes[c]=l,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:c}),this}}function Jl(n,e,t){n.prototype[e]=function(r,i,o,s){const[a,c,l]=Vt(this,e,t,r,i,o,s);if(typeof l!="function")throw new q(`Graph.${e}: updater should be a function.`);const d=a.attributes,h=l(d[c]);return d[c]=h,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:c}),this}}function Zl(n,e,t){n.prototype[e]=function(r,i,o){const[s,a]=Vt(this,e,t,r,i,o);return delete s.attributes[a],this.emit("nodeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:a}),this}}function Ql(n,e,t){n.prototype[e]=function(r,i,o){const[s,a]=Vt(this,e,t,r,i,o);if(!pt(a))throw new q(`Graph.${e}: provided attributes are not a plain object.`);return s.attributes=a,this.emit("nodeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function ed(n,e,t){n.prototype[e]=function(r,i,o){const[s,a]=Vt(this,e,t,r,i,o);if(!pt(a))throw new q(`Graph.${e}: provided attributes are not a plain object.`);return st(s.attributes,a),this.emit("nodeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:a}),this}}function td(n,e,t){n.prototype[e]=function(r,i,o){const[s,a]=Vt(this,e,t,r,i,o);if(typeof a!="function")throw new q(`Graph.${e}: provided updater is not a function.`);return s.attributes=a(s.attributes),this.emit("nodeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const rd=[{name:n=>`get${n}Attribute`,attacher:Hl},{name:n=>`get${n}Attributes`,attacher:Vl},{name:n=>`has${n}Attribute`,attacher:Yl},{name:n=>`set${n}Attribute`,attacher:Xl},{name:n=>`update${n}Attribute`,attacher:Jl},{name:n=>`remove${n}Attribute`,attacher:Zl},{name:n=>`replace${n}Attributes`,attacher:Ql},{name:n=>`merge${n}Attributes`,attacher:ed},{name:n=>`update${n}Attributes`,attacher:td}];function nd(n){rd.forEach(function({name:e,attacher:t}){t(n,e("Node"),Js),t(n,e("Source"),Zs),t(n,e("Target"),ql),t(n,e("Opposite"),Qs)})}function id(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,a=""+i;if(i=arguments[2],o=Gt(this,s,a,t),!o)throw new j(`Graph.${e}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(t!=="mixed")throw new se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new j(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return o.attributes[i]}}function od(n,e,t){n.prototype[e]=function(r){let i;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,s=""+arguments[1];if(i=Gt(this,o,s,t),!i)throw new j(`Graph.${e}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new j(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return i.attributes}}function sd(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,a=""+i;if(i=arguments[2],o=Gt(this,s,a,t),!o)throw new j(`Graph.${e}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(t!=="mixed")throw new se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new j(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return o.attributes.hasOwnProperty(i)}}function ad(n,e,t){n.prototype[e]=function(r,i,o){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,c=""+i;if(i=arguments[2],o=arguments[3],s=Gt(this,a,c,t),!s)throw new j(`Graph.${e}: could not find an edge for the given path ("${a}" - "${c}").`)}else{if(t!=="mixed")throw new se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new j(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return s.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}function ud(n,e,t){n.prototype[e]=function(r,i,o){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,c=""+i;if(i=arguments[2],o=arguments[3],s=Gt(this,a,c,t),!s)throw new j(`Graph.${e}: could not find an edge for the given path ("${a}" - "${c}").`)}else{if(t!=="mixed")throw new se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new j(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof o!="function")throw new q(`Graph.${e}: updater should be a function.`);return s.attributes[i]=o(s.attributes[i]),this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}function cd(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,a=""+i;if(i=arguments[2],o=Gt(this,s,a,t),!o)throw new j(`Graph.${e}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(t!=="mixed")throw new se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new j(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:i}),this}}function ld(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,a=""+i;if(i=arguments[2],o=Gt(this,s,a,t),!o)throw new j(`Graph.${e}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(t!=="mixed")throw new se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new j(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!pt(i))throw new q(`Graph.${e}: provided attributes are not a plain object.`);return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function dd(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,a=""+i;if(i=arguments[2],o=Gt(this,s,a,t),!o)throw new j(`Graph.${e}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(t!=="mixed")throw new se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new j(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!pt(i))throw new q(`Graph.${e}: provided attributes are not a plain object.`);return st(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:i}),this}}function hd(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,a=""+i;if(i=arguments[2],o=Gt(this,s,a,t),!o)throw new j(`Graph.${e}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(t!=="mixed")throw new se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new j(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new q(`Graph.${e}: provided updater is not a function.`);return o.attributes=i(o.attributes),this.emit("edgeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const fd=[{name:n=>`get${n}Attribute`,attacher:id},{name:n=>`get${n}Attributes`,attacher:od},{name:n=>`has${n}Attribute`,attacher:sd},{name:n=>`set${n}Attribute`,attacher:ad},{name:n=>`update${n}Attribute`,attacher:ud},{name:n=>`remove${n}Attribute`,attacher:cd},{name:n=>`replace${n}Attributes`,attacher:ld},{name:n=>`merge${n}Attributes`,attacher:dd},{name:n=>`update${n}Attributes`,attacher:hd}];function pd(n){fd.forEach(function({name:e,attacher:t}){t(n,e("Edge"),"mixed"),t(n,e("DirectedEdge"),"directed"),t(n,e("UndirectedEdge"),"undirected")})}const gd=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function vd(n,e,t,r){let i=!1;for(const o in e){if(o===r)continue;const s=e[o];if(i=t(s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected),n&&i)return s.key}}function yd(n,e,t,r){let i,o,s,a=!1;for(const c in e)if(c!==r){i=e[c];do{if(o=i.source,s=i.target,a=t(i.key,i.attributes,o.key,s.key,o.attributes,s.attributes,i.undirected),n&&a)return i.key;i=i.next}while(i!==void 0)}}function ai(n,e){const t=Object.keys(n),r=t.length;let i,o=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(o>=r)return{done:!0};const s=t[o++];if(s===e){i=void 0;continue}i=n[s]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function md(n,e,t,r){const i=e[t];if(!i)return;const o=i.source,s=i.target;if(r(i.key,i.attributes,o.key,s.key,o.attributes,s.attributes,i.undirected)&&n)return i.key}function bd(n,e,t,r){let i=e[t];if(!i)return;let o=!1;do{if(o=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),n&&o)return i.key;i=i.next}while(i!==void 0)}function ui(n,e){let t=n[e];if(t.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!t)return{done:!0};const i={edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected};return t=t.next,{done:!1,value:i}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected}})}}}function wd(n,e){if(n.size===0)return[];if(e==="mixed"||e===n.type)return Array.from(n._edges.keys());const t=e==="undirected"?n.undirectedSize:n.directedSize,r=new Array(t),i=e==="undirected",o=n._edges.values();let s=0,a,c;for(;a=o.next(),a.done!==!0;)c=a.value,c.undirected===i&&(r[s++]=c.key);return r}function ea(n,e,t,r){if(e.size===0)return;const i=t!=="mixed"&&t!==e.type,o=t==="undirected";let s,a,c=!1;const l=e._edges.values();for(;s=l.next(),s.done!==!0;){if(a=s.value,i&&a.undirected!==o)continue;const{key:d,attributes:h,source:f,target:g}=a;if(c=r(d,h,f.key,g.key,f.attributes,g.attributes,a.undirected),n&&c)return d}}function _d(n,e){if(n.size===0)return $r();const t=e!=="mixed"&&e!==n.type,r=e==="undirected",i=n._edges.values();return{[Symbol.iterator](){return this},next(){let o,s;for(;;){if(o=i.next(),o.done)return o;if(s=o.value,!(t&&s.undirected!==r))break}return{value:{edge:s.key,attributes:s.attributes,source:s.source.key,target:s.target.key,sourceAttributes:s.source.attributes,targetAttributes:s.target.attributes,undirected:s.undirected},done:!1}}}}function Ri(n,e,t,r,i,o){const s=e?yd:vd;let a;if(t!=="undirected"&&(r!=="out"&&(a=s(n,i.in,o),n&&a)||r!=="in"&&(a=s(n,i.out,o,r?void 0:i.key),n&&a))||t!=="directed"&&(a=s(n,i.undirected,o),n&&a))return a}function xd(n,e,t,r){const i=[];return Ri(!1,n,e,t,r,function(o){i.push(o)}),i}function Ed(n,e,t){let r=$r();return n!=="undirected"&&(e!=="out"&&typeof t.in<"u"&&(r=Ht(r,ai(t.in))),e!=="in"&&typeof t.out<"u"&&(r=Ht(r,ai(t.out,e?void 0:t.key)))),n!=="directed"&&typeof t.undirected<"u"&&(r=Ht(r,ai(t.undirected))),r}function Ni(n,e,t,r,i,o,s){const a=t?bd:md;let c;if(e!=="undirected"&&(typeof i.in<"u"&&r!=="out"&&(c=a(n,i.in,o,s),n&&c)||typeof i.out<"u"&&r!=="in"&&(r||i.key!==o)&&(c=a(n,i.out,o,s),n&&c))||e!=="directed"&&typeof i.undirected<"u"&&(c=a(n,i.undirected,o,s),n&&c))return c}function kd(n,e,t,r,i){const o=[];return Ni(!1,n,e,t,r,i,function(s){o.push(s)}),o}function Sd(n,e,t,r){let i=$r();return n!=="undirected"&&(typeof t.in<"u"&&e!=="out"&&r in t.in&&(i=Ht(i,ui(t.in,r))),typeof t.out<"u"&&e!=="in"&&r in t.out&&(e||t.key!==r)&&(i=Ht(i,ui(t.out,r)))),n!=="directed"&&typeof t.undirected<"u"&&r in t.undirected&&(i=Ht(i,ui(t.undirected,r))),i}function $d(n,e){const{name:t,type:r,direction:i}=e;n.prototype[t]=function(o,s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return wd(this,r);if(arguments.length===1){o=""+o;const a=this._nodes.get(o);if(typeof a>"u")throw new j(`Graph.${t}: could not find the "${o}" node in the graph.`);return xd(this.multi,r==="mixed"?this.type:r,i,a)}if(arguments.length===2){o=""+o,s=""+s;const a=this._nodes.get(o);if(!a)throw new j(`Graph.${t}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(s))throw new j(`Graph.${t}: could not find the "${s}" target node in the graph.`);return kd(r,this.multi,i,a,s)}throw new q(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Ad(n,e){const{name:t,type:r,direction:i}=e,o="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(l,d,h){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return h=l,ea(!1,this,r,h);if(arguments.length===2){l=""+l,h=d;const f=this._nodes.get(l);if(typeof f>"u")throw new j(`Graph.${o}: could not find the "${l}" node in the graph.`);return Ri(!1,this.multi,r==="mixed"?this.type:r,i,f,h)}if(arguments.length===3){l=""+l,d=""+d;const f=this._nodes.get(l);if(!f)throw new j(`Graph.${o}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(d))throw new j(`Graph.${o}: could not find the "${d}" target node in the graph.`);return Ni(!1,r,this.multi,i,f,d,h)}throw new q(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const s="map"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(){const l=Array.prototype.slice.call(arguments),d=l.pop();let h;if(l.length===0){let f=0;r!=="directed"&&(f+=this.undirectedSize),r!=="undirected"&&(f+=this.directedSize),h=new Array(f);let g=0;l.push((v,E,b,y,A,_,p)=>{h[g++]=d(v,E,b,y,A,_,p)})}else h=[],l.push((f,g,v,E,b,y,A)=>{h.push(d(f,g,v,E,b,y,A))});return this[o].apply(this,l),h};const a="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[a]=function(){const l=Array.prototype.slice.call(arguments),d=l.pop(),h=[];return l.push((f,g,v,E,b,y,A)=>{d(f,g,v,E,b,y,A)&&h.push(f)}),this[o].apply(this,l),h};const c="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[c]=function(){let l=Array.prototype.slice.call(arguments);if(l.length<2||l.length>4)throw new q(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${l.length}).`);if(typeof l[l.length-1]=="function"&&typeof l[l.length-2]!="function")throw new q(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let d,h;l.length===2?(d=l[0],h=l[1],l=[]):l.length===3?(d=l[1],h=l[2],l=[l[0]]):l.length===4&&(d=l[2],h=l[3],l=[l[0],l[1]]);let f=h;return l.push((g,v,E,b,y,A,_)=>{f=d(f,g,v,E,b,y,A,_)}),this[o].apply(this,l),f}}function Cd(n,e){const{name:t,type:r,direction:i}=e,o="find"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(c,l,d){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return d=c,ea(!0,this,r,d);if(arguments.length===2){c=""+c,d=l;const h=this._nodes.get(c);if(typeof h>"u")throw new j(`Graph.${o}: could not find the "${c}" node in the graph.`);return Ri(!0,this.multi,r==="mixed"?this.type:r,i,h,d)}if(arguments.length===3){c=""+c,l=""+l;const h=this._nodes.get(c);if(!h)throw new j(`Graph.${o}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(l))throw new j(`Graph.${o}: could not find the "${l}" target node in the graph.`);return Ni(!0,r,this.multi,i,h,l,d)}throw new q(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const s="some"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[s]=function(){const c=Array.prototype.slice.call(arguments),l=c.pop();return c.push((h,f,g,v,E,b,y)=>l(h,f,g,v,E,b,y)),!!this[o].apply(this,c)};const a="every"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(){const c=Array.prototype.slice.call(arguments),l=c.pop();return c.push((h,f,g,v,E,b,y)=>!l(h,f,g,v,E,b,y)),!this[o].apply(this,c)}}function Dd(n,e){const{name:t,type:r,direction:i}=e,o=t.slice(0,-1)+"Entries";n.prototype[o]=function(s,a){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return $r();if(!arguments.length)return _d(this,r);if(arguments.length===1){s=""+s;const c=this._nodes.get(s);if(!c)throw new j(`Graph.${o}: could not find the "${s}" node in the graph.`);return Ed(r,i,c)}if(arguments.length===2){s=""+s,a=""+a;const c=this._nodes.get(s);if(!c)throw new j(`Graph.${o}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(a))throw new j(`Graph.${o}: could not find the "${a}" target node in the graph.`);return Sd(r,i,c,a)}throw new q(`Graph.${o}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Ld(n){gd.forEach(e=>{$d(n,e),Ad(n,e),Cd(n,e),Dd(n,e)})}const Id=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function In(){this.A=null,this.B=null}In.prototype.wrap=function(n){this.A===null?this.A=n:this.B===null&&(this.B=n)};In.prototype.has=function(n){return this.A!==null&&n in this.A||this.B!==null&&n in this.B};function Ur(n,e,t,r,i){for(const o in r){const s=r[o],a=s.source,c=s.target,l=a===t?c:a;if(e&&e.has(l.key))continue;const d=i(l.key,l.attributes);if(n&&d)return l.key}}function Ui(n,e,t,r,i){if(e!=="mixed"){if(e==="undirected")return Ur(n,null,r,r.undirected,i);if(typeof t=="string")return Ur(n,null,r,r[t],i)}const o=new In;let s;if(e!=="undirected"){if(t!=="out"){if(s=Ur(n,null,r,r.in,i),n&&s)return s;o.wrap(r.in)}if(t!=="in"){if(s=Ur(n,o,r,r.out,i),n&&s)return s;o.wrap(r.out)}}if(e!=="directed"&&(s=Ur(n,o,r,r.undirected,i),n&&s))return s}function Gd(n,e,t){if(n!=="mixed"){if(n==="undirected")return Object.keys(t.undirected);if(typeof e=="string")return Object.keys(t[e])}const r=[];return Ui(!1,n,e,t,function(i){r.push(i)}),r}function Mr(n,e,t){const r=Object.keys(t),i=r.length;let o=0;return{[Symbol.iterator](){return this},next(){let s=null;do{if(o>=i)return n&&n.wrap(t),{done:!0};const a=t[r[o++]],c=a.source,l=a.target;if(s=c===e?l:c,n&&n.has(s.key)){s=null;continue}}while(s===null);return{done:!1,value:{neighbor:s.key,attributes:s.attributes}}}}}function Td(n,e,t){if(n!=="mixed"){if(n==="undirected")return Mr(null,t,t.undirected);if(typeof e=="string")return Mr(null,t,t[e])}let r=$r();const i=new In;return n!=="undirected"&&(e!=="out"&&(r=Ht(r,Mr(i,t,t.in))),e!=="in"&&(r=Ht(r,Mr(i,t,t.out)))),n!=="directed"&&(r=Ht(r,Mr(i,t,t.undirected))),r}function Od(n,e){const{name:t,type:r,direction:i}=e;n.prototype[t]=function(o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];o=""+o;const s=this._nodes.get(o);if(typeof s>"u")throw new j(`Graph.${t}: could not find the "${o}" node in the graph.`);return Gd(r==="mixed"?this.type:r,i,s)}}function Rd(n,e){const{name:t,type:r,direction:i}=e,o="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(l,d){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;l=""+l;const h=this._nodes.get(l);if(typeof h>"u")throw new j(`Graph.${o}: could not find the "${l}" node in the graph.`);Ui(!1,r==="mixed"?this.type:r,i,h,d)};const s="map"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(l,d){const h=[];return this[o](l,(f,g)=>{h.push(d(f,g))}),h};const a="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[a]=function(l,d){const h=[];return this[o](l,(f,g)=>{d(f,g)&&h.push(f)}),h};const c="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[c]=function(l,d,h){if(arguments.length<3)throw new q(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let f=h;return this[o](l,(g,v)=>{f=d(f,g,v)}),f}}function Nd(n,e){const{name:t,type:r,direction:i}=e,o=t[0].toUpperCase()+t.slice(1,-1),s="find"+o;n.prototype[s]=function(l,d){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;l=""+l;const h=this._nodes.get(l);if(typeof h>"u")throw new j(`Graph.${s}: could not find the "${l}" node in the graph.`);return Ui(!0,r==="mixed"?this.type:r,i,h,d)};const a="some"+o;n.prototype[a]=function(l,d){return!!this[s](l,d)};const c="every"+o;n.prototype[c]=function(l,d){return!this[s](l,(f,g)=>!d(f,g))}}function Ud(n,e){const{name:t,type:r,direction:i}=e,o=t.slice(0,-1)+"Entries";n.prototype[o]=function(s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return $r();s=""+s;const a=this._nodes.get(s);if(typeof a>"u")throw new j(`Graph.${o}: could not find the "${s}" node in the graph.`);return Td(r==="mixed"?this.type:r,i,a)}}function Md(n){Id.forEach(e=>{Od(n,e),Rd(n,e),Nd(n,e),Ud(n,e)})}function yn(n,e,t,r,i){const o=r._nodes.values(),s=r.type;let a,c,l,d,h,f;for(;a=o.next(),a.done!==!0;){let g=!1;if(c=a.value,s!=="undirected"){d=c.out;for(l in d){h=d[l];do f=h.target,g=!0,i(c.key,f.key,c.attributes,f.attributes,h.key,h.attributes,h.undirected),h=h.next;while(h)}}if(s!=="directed"){d=c.undirected;for(l in d)if(!(e&&c.key>l)){h=d[l];do f=h.target,f.key!==l&&(f=h.source),g=!0,i(c.key,f.key,c.attributes,f.attributes,h.key,h.attributes,h.undirected),h=h.next;while(h)}}t&&!g&&i(c.key,null,c.attributes,null,null,null,null)}}function Pd(n,e){const t={key:n};return Hs(e.attributes)||(t.attributes=st({},e.attributes)),t}function zd(n,e,t){const r={key:e,source:t.source.key,target:t.target.key};return Hs(t.attributes)||(r.attributes=st({},t.attributes)),n==="mixed"&&t.undirected&&(r.undirected=!0),r}function Wd(n){if(!pt(n))throw new q('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in n))throw new q("Graph.import: serialized node is missing its key.");if("attributes"in n&&(!pt(n.attributes)||n.attributes===null))throw new q("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function jd(n){if(!pt(n))throw new q('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in n))throw new q("Graph.import: serialized edge is missing its source.");if(!("target"in n))throw new q("Graph.import: serialized edge is missing its target.");if("attributes"in n&&(!pt(n.attributes)||n.attributes===null))throw new q("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in n&&typeof n.undirected!="boolean")throw new q("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const Bd=Kl(),Fd=new Set(["directed","undirected","mixed"]),Fo=new Set(["domain","_events","_eventsCount","_maxListeners"]),Kd=[{name:n=>`${n}Edge`,generateKey:!0},{name:n=>`${n}DirectedEdge`,generateKey:!0,type:"directed"},{name:n=>`${n}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:n=>`${n}EdgeWithKey`},{name:n=>`${n}DirectedEdgeWithKey`,type:"directed"},{name:n=>`${n}UndirectedEdgeWithKey`,type:"undirected"}],qd={allowSelfLoops:!0,multi:!1,type:"mixed"};function Hd(n,e,t){if(t&&!pt(t))throw new q(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(e=""+e,t=t||{},n._nodes.has(e))throw new se(`Graph.addNode: the "${e}" node already exist in the graph.`);const r=new n.NodeDataClass(e,t);return n._nodes.set(e,r),n.emit("nodeAdded",{key:e,attributes:t}),r}function Ko(n,e,t){const r=new n.NodeDataClass(e,t);return n._nodes.set(e,r),n.emit("nodeAdded",{key:e,attributes:t}),r}function ta(n,e,t,r,i,o,s,a){if(!r&&n.type==="undirected")throw new se(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&n.type==="directed")throw new se(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(a&&!pt(a))throw new q(`Graph.${e}: invalid attributes. Expecting an object but got "${a}"`);if(o=""+o,s=""+s,a=a||{},!n.allowSelfLoops&&o===s)throw new se(`Graph.${e}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const c=n._nodes.get(o),l=n._nodes.get(s);if(!c)throw new j(`Graph.${e}: source node "${o}" not found.`);if(!l)throw new j(`Graph.${e}: target node "${s}" not found.`);const d={key:null,undirected:r,source:o,target:s,attributes:a};if(t)i=n._edgeKeyGenerator();else if(i=""+i,n._edges.has(i))throw new se(`Graph.${e}: the "${i}" edge already exists in the graph.`);if(!n.multi&&(r?typeof c.undirected[s]<"u":typeof c.out[s]<"u"))throw new se(`Graph.${e}: an edge linking "${o}" to "${s}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const h=new Ar(r,i,c,l,a);n._edges.set(i,h);const f=o===s;return r?(c.undirectedDegree++,l.undirectedDegree++,f&&(c.undirectedLoops++,n._undirectedSelfLoopCount++)):(c.outDegree++,l.inDegree++,f&&(c.directedLoops++,n._directedSelfLoopCount++)),n.multi?h.attachMulti():h.attach(),r?n._undirectedSize++:n._directedSize++,d.key=i,n.emit("edgeAdded",d),i}function Vd(n,e,t,r,i,o,s,a,c){if(!r&&n.type==="undirected")throw new se(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&n.type==="directed")throw new se(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(a){if(c){if(typeof a!="function")throw new q(`Graph.${e}: invalid updater function. Expecting a function but got "${a}"`)}else if(!pt(a))throw new q(`Graph.${e}: invalid attributes. Expecting an object but got "${a}"`)}o=""+o,s=""+s;let l;if(c&&(l=a,a=void 0),!n.allowSelfLoops&&o===s)throw new se(`Graph.${e}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let d=n._nodes.get(o),h=n._nodes.get(s),f,g;if(!t&&(f=n._edges.get(i),f)){if((f.source.key!==o||f.target.key!==s)&&(!r||f.source.key!==s||f.target.key!==o))throw new se(`Graph.${e}: inconsistency detected when attempting to merge the "${i}" edge with "${o}" source & "${s}" target vs. ("${f.source.key}", "${f.target.key}").`);g=f}if(!g&&!n.multi&&d&&(g=r?d.undirected[s]:d.out[s]),g){const A=[g.key,!1,!1,!1];if(c?!l:!a)return A;if(c){const _=g.attributes;g.attributes=l(_),n.emit("edgeAttributesUpdated",{type:"replace",key:g.key,attributes:g.attributes})}else st(g.attributes,a),n.emit("edgeAttributesUpdated",{type:"merge",key:g.key,attributes:g.attributes,data:a});return A}a=a||{},c&&l&&(a=l(a));const v={key:null,undirected:r,source:o,target:s,attributes:a};if(t)i=n._edgeKeyGenerator();else if(i=""+i,n._edges.has(i))throw new se(`Graph.${e}: the "${i}" edge already exists in the graph.`);let E=!1,b=!1;d||(d=Ko(n,o,{}),E=!0,o===s&&(h=d,b=!0)),h||(h=Ko(n,s,{}),b=!0),f=new Ar(r,i,d,h,a),n._edges.set(i,f);const y=o===s;return r?(d.undirectedDegree++,h.undirectedDegree++,y&&(d.undirectedLoops++,n._undirectedSelfLoopCount++)):(d.outDegree++,h.inDegree++,y&&(d.directedLoops++,n._directedSelfLoopCount++)),n.multi?f.attachMulti():f.attach(),r?n._undirectedSize++:n._directedSize++,v.key=i,n.emit("edgeAdded",v),[i,!0,E,b]}function yr(n,e){n._edges.delete(e.key);const{source:t,target:r,attributes:i}=e,o=e.undirected,s=t===r;o?(t.undirectedDegree--,r.undirectedDegree--,s&&(t.undirectedLoops--,n._undirectedSelfLoopCount--)):(t.outDegree--,r.inDegree--,s&&(t.directedLoops--,n._directedSelfLoopCount--)),n.multi?e.detachMulti():e.detach(),o?n._undirectedSize--:n._directedSize--,n.emit("edgeDropped",{key:e.key,attributes:i,source:t.key,target:r.key,undirected:o})}class Fe extends Bl.EventEmitter{constructor(e){if(super(),e=st({},qd,e),typeof e.multi!="boolean")throw new q(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!Fd.has(e.type))throw new q(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new q(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const t=e.type==="mixed"?Vs:e.type==="directed"?Ys:Xs;Lt(this,"NodeDataClass",t);const r="geid_"+Bd()+"_";let i=0;const o=()=>{let s;do s=r+i++;while(this._edges.has(s));return s};Lt(this,"_attributes",{}),Lt(this,"_nodes",new Map),Lt(this,"_edges",new Map),Lt(this,"_directedSize",0),Lt(this,"_undirectedSize",0),Lt(this,"_directedSelfLoopCount",0),Lt(this,"_undirectedSelfLoopCount",0),Lt(this,"_edgeKeyGenerator",o),Lt(this,"_options",e),Fo.forEach(s=>Lt(this,s,this[s])),Rt(this,"order",()=>this._nodes.size),Rt(this,"size",()=>this._edges.size),Rt(this,"directedSize",()=>this._directedSize),Rt(this,"undirectedSize",()=>this._undirectedSize),Rt(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Rt(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Rt(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Rt(this,"multi",this._options.multi),Rt(this,"type",this._options.type),Rt(this,"allowSelfLoops",this._options.allowSelfLoops),Rt(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,t){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+e,i=this._edges.get(r);return!!i&&!i.undirected}else if(arguments.length===2){e=""+e,t=""+t;const r=this._nodes.get(e);return r?r.out.hasOwnProperty(t):!1}throw new q(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+e,i=this._edges.get(r);return!!i&&i.undirected}else if(arguments.length===2){e=""+e,t=""+t;const r=this._nodes.get(e);return r?r.undirected.hasOwnProperty(t):!1}throw new q(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){const r=""+e;return this._edges.has(r)}else if(arguments.length===2){e=""+e,t=""+t;const r=this._nodes.get(e);return r?typeof r.out<"u"&&r.out.hasOwnProperty(t)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(t):!1}throw new q(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type==="undirected")return;if(e=""+e,t=""+t,this.multi)throw new se("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(e);if(!r)throw new j(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new j(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const i=r.out&&r.out[t]||void 0;if(i)return i.key}undirectedEdge(e,t){if(this.type==="directed")return;if(e=""+e,t=""+t,this.multi)throw new se("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(e);if(!r)throw new j(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new j(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const i=r.undirected&&r.undirected[t]||void 0;if(i)return i.key}edge(e,t){if(this.multi)throw new se("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new j(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new j(`Graph.edge: could not find the "${t}" target node in the graph.`);const i=r.out&&r.out[t]||r.undirected&&r.undirected[t]||void 0;if(i)return i.key}areDirectedNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new j(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in r.in||t in r.out}areOutNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new j(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in r.out}areInNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new j(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in r.in}areUndirectedNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new j(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:t in r.undirected}areNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new j(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(t in r.in||t in r.out)||this.type!=="directed"&&t in r.undirected}areInboundNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new j(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in r.in||this.type!=="directed"&&t in r.undirected}areOutboundNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new j(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in r.out||this.type!=="directed"&&t in r.undirected}inDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree}outDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree}directedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree}undirectedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree}inboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=t.undirectedDegree),this.type!=="undirected"&&(r+=t.inDegree),r}outboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=t.undirectedDegree),this.type!=="undirected"&&(r+=t.outDegree),r}degree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.degree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=t.undirectedDegree),this.type!=="undirected"&&(r+=t.inDegree+t.outDegree),r}inDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(r+=t.inDegree,i+=t.directedLoops),r-i}outboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(r+=t.outDegree,i+=t.directedLoops),r-i}degreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(r+=t.inDegree+t.outDegree,i+=t.directedLoops*2),r-i}source(e){e=""+e;const t=this._edges.get(e);if(!t)throw new j(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=""+e;const t=this._edges.get(e);if(!t)throw new j(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=""+e;const t=this._edges.get(e);if(!t)throw new j(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=""+e,t=""+t;const r=this._edges.get(t);if(!r)throw new j(`Graph.opposite: could not find the "${t}" edge in the graph.`);const i=r.source.key,o=r.target.key;if(e===i)return o;if(e===o)return i;throw new j(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${i}, ${o}).`)}hasExtremity(e,t){e=""+e,t=""+t;const r=this._edges.get(e);if(!r)throw new j(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return r.source.key===t||r.target.key===t}isUndirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new j(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new j(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=""+e;const t=this._edges.get(e);if(!t)throw new j(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return Hd(this,e,t).key}mergeNode(e,t){if(t&&!pt(t))throw new q(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=""+e,t=t||{};let r=this._nodes.get(e);return r?(t&&(st(r.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:r.attributes,data:t})),[e,!1]):(r=new this.NodeDataClass(e,t),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!="function")throw new q(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=""+e;let r=this._nodes.get(e);if(r){if(t){const o=r.attributes;r.attributes=t(o),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:r.attributes})}return[e,!1]}const i=t?t({}):{};return r=new this.NodeDataClass(e,i),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:i}),[e,!0]}dropNode(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new j(`Graph.dropNode: could not find the "${e}" node in the graph.`);let r;if(this.type!=="undirected"){for(const i in t.out){r=t.out[i];do yr(this,r),r=r.next;while(r)}for(const i in t.in){r=t.in[i];do yr(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const i in t.undirected){r=t.undirected[i];do yr(this,r),r=r.next;while(r)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){const r=""+arguments[0],i=""+arguments[1];if(t=Gt(this,r,i,this.type),!t)throw new j(`Graph.dropEdge: could not find the "${r}" -> "${i}" edge in the graph.`)}else if(e=""+e,t=this._edges.get(e),!t)throw new j(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return yr(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new se("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new se("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,t=""+t;const r=Gt(this,e,t,"directed");if(!r)throw new j(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return yr(this,r),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new se("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new se("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=Gt(this,e,t,"undirected");if(!r)throw new j(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return yr(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!="function")throw new q("Graph.updateAttribute: updater should be a function.");const r=this._attributes[e];return this._attributes[e]=t(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!pt(e))throw new q("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!pt(e))throw new q("Graph.mergeAttributes: provided attributes are not a plain object.");return st(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")throw new q("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!="function")throw new q("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!Bo(t))throw new q("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,o.attributes=e(o.key,o.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!="function")throw new q("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!Bo(t))throw new q("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let i,o,s,a;for(;i=r.next(),i.done!==!0;)o=i.value,s=o.source,a=o.target,o.attributes=e(o.key,o.attributes,s.key,a.key,s.attributes,a.attributes,o.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new q("Graph.forEachAdjacencyEntry: expecting a callback.");yn(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new q("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");yn(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!="function")throw new q("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");yn(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new q("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");yn(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!="function")throw new q("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)}findNode(e){if(typeof e!="function")throw new q("Graph.findNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return i.key}mapNodes(e){if(typeof e!="function")throw new q("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let r,i;const o=new Array(this.order);let s=0;for(;r=t.next(),r.done!==!0;)i=r.value,o[s++]=e(i.key,i.attributes);return o}someNode(e){if(typeof e!="function")throw new q("Graph.someNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new q("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,!e(i.key,i.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new q("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let r,i;const o=[];for(;r=t.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)&&o.push(i.key);return o}reduceNodes(e,t){if(typeof e!="function")throw new q("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new q("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=t;const i=this._nodes.values();let o,s;for(;o=i.next(),o.done!==!0;)s=o.value,r=e(r,s.key,s.attributes);return r}nodeEntries(){const e=this._nodes.values();return{[Symbol.iterator](){return this},next(){const t=e.next();if(t.done)return t;const r=t.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const e=new Array(this._nodes.size);let t=0;this._nodes.forEach((i,o)=>{e[t++]=Pd(o,i)});const r=new Array(this._edges.size);return t=0,this._edges.forEach((i,o)=>{r[t++]=zd(this.type,o,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:r}}import(e,t=!1){if(e instanceof Fe)return e.forEachNode((c,l)=>{t?this.mergeNode(c,l):this.addNode(c,l)}),e.forEachEdge((c,l,d,h,f,g,v)=>{t?v?this.mergeUndirectedEdgeWithKey(c,d,h,l):this.mergeDirectedEdgeWithKey(c,d,h,l):v?this.addUndirectedEdgeWithKey(c,d,h,l):this.addDirectedEdgeWithKey(c,d,h,l)}),this;if(!pt(e))throw new q("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!pt(e.attributes))throw new q("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let r,i,o,s,a;if(e.nodes){if(o=e.nodes,!Array.isArray(o))throw new q("Graph.import: invalid nodes. Expecting an array.");for(r=0,i=o.length;r<i;r++){s=o[r],Wd(s);const{key:c,attributes:l}=s;t?this.mergeNode(c,l):this.addNode(c,l)}}if(e.edges){let c=!1;if(this.type==="undirected"&&(c=!0),o=e.edges,!Array.isArray(o))throw new q("Graph.import: invalid edges. Expecting an array.");for(r=0,i=o.length;r<i;r++){a=o[r],jd(a);const{source:l,target:d,attributes:h,undirected:f=c}=a;let g;"key"in a?(g=t?f?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:f?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,g.call(this,a.key,l,d,h)):(g=t?f?this.mergeUndirectedEdge:this.mergeDirectedEdge:f?this.addUndirectedEdge:this.addDirectedEdge,g.call(this,l,d,h))}}return this}nullCopy(e){const t=new Fe(st({},this._options,e));return t.replaceAttributes(st({},this.getAttributes())),t}emptyCopy(e){const t=this.nullCopy(e);return this._nodes.forEach((r,i)=>{const o=st({},r.attributes);r=new t.NodeDataClass(i,o),t._nodes.set(i,r)}),t}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new se(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new se("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new se("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const t=this.emptyCopy(e),r=this._edges.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,ta(t,"copy",!1,o.undirected,o.key,o.source.key,o.target.key,st({},o.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((o,s)=>{e[s]=o.attributes});const t={},r={};this._edges.forEach((o,s)=>{const a=o.undirected?"--":"->";let c="",l=o.source.key,d=o.target.key,h;o.undirected&&l>d&&(h=l,l=d,d=h);const f=`(${l})${a}(${d})`;s.startsWith("geid_")?this.multi&&(typeof r[f]>"u"?r[f]=0:r[f]++,c+=`${r[f]}. `):c+=`[${s}]: `,c+=f,t[c]=o.attributes});const i={};for(const o in this)this.hasOwnProperty(o)&&!Fo.has(o)&&typeof this[o]!="function"&&typeof o!="symbol"&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=e,i.edges=t,Lt(i,"constructor",this.constructor),i}}typeof Symbol<"u"&&(Fe.prototype[Symbol.for("nodejs.util.inspect.custom")]=Fe.prototype.inspect);Kd.forEach(n=>{["add","merge","update"].forEach(e=>{const t=n.name(e),r=e==="add"?ta:Vd;n.generateKey?Fe.prototype[t]=function(i,o,s){return r(this,t,!0,(n.type||this.type)==="undirected",null,i,o,s,e==="update")}:Fe.prototype[t]=function(i,o,s,a){return r(this,t,!1,(n.type||this.type)==="undirected",i,o,s,a,e==="update")}})});nd(Fe);pd(Fe);Ld(Fe);Md(Fe);class ra extends Fe{constructor(e){const t=st({type:"directed"},e);if("multi"in t&&t.multi!==!1)throw new q("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new q('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class na extends Fe{constructor(e){const t=st({type:"undirected"},e);if("multi"in t&&t.multi!==!1)throw new q("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new q('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class ia extends Fe{constructor(e){const t=st({multi:!0},e);if("multi"in t&&t.multi!==!0)throw new q("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}}class oa extends Fe{constructor(e){const t=st({type:"directed",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new q("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new q('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class sa extends Fe{constructor(e){const t=st({type:"undirected",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new q("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new q('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function Cr(n){n.from=function(e,t){const r=st({},e.options,t),i=new n(r);return i.import(e),i}}Cr(Fe);Cr(ra);Cr(na);Cr(ia);Cr(oa);Cr(sa);Fe.Graph=Fe;Fe.DirectedGraph=ra;Fe.UndirectedGraph=na;Fe.MultiGraph=ia;Fe.MultiDirectedGraph=oa;Fe.MultiUndirectedGraph=sa;Fe.InvalidArgumentsGraphError=q;Fe.NotFoundGraphError=j;Fe.UsageGraphError=se;var ci,qo;function Mi(){if(qo)return ci;qo=1;function n(t){return!t||typeof t!="object"||typeof t=="function"||Array.isArray(t)||t instanceof Set||t instanceof Map||t instanceof RegExp||t instanceof Date}function e(t,r){t=t||{};var i={};for(var o in r){var s=t[o],a=r[o];if(!n(a)){i[o]=e(s,a);continue}s===void 0?i[o]=a:i[o]=s}return i}return ci=e,ci}var li,Ho;function Gn(){return Ho||(Ho=1,li=function(e){return e!==null&&typeof e=="object"&&typeof e.addUndirectedEdgeWithKey=="function"&&typeof e.dropNode=="function"&&typeof e.multi=="boolean"}),li}var di,Vo;function aa(){if(Vo)return di;Vo=1;var n=Gn();return di=function(t){if(!n(t))throw new Error("graphology-utils/infer-type: expecting a valid graphology instance.");var r=t.type;return r!=="mixed"?r:t.directedSize===0&&t.undirectedSize===0||t.directedSize>0&&t.undirectedSize>0?"mixed":t.directedSize>0?"directed":"undirected"},di}var hi,Yo;function ua(){if(Yo)return hi;Yo=1;function n(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n(function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}})},n.empty=function(){var e=new n(function(){return{done:!0}});return e},n.fromSequence=function(e){var t=0,r=e.length;return new n(function(){return t>=r?{done:!0}:{done:!1,value:e[t++]}})},n.is=function(e){return e instanceof n?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},hi=n,hi}var fi={},Xo;function Pi(){return Xo||(Xo=1,(function(n){var e=Math.pow(2,8)-1,t=Math.pow(2,16)-1,r=Math.pow(2,32)-1,i=Math.pow(2,7)-1,o=Math.pow(2,15)-1,s=Math.pow(2,31)-1;n.getPointerArray=function(c){var l=c-1;if(l<=e)return Uint8Array;if(l<=t)return Uint16Array;if(l<=r)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},n.getSignedPointerArray=function(c){var l=c-1;return l<=i?Int8Array:l<=o?Int16Array:l<=s?Int32Array:Float64Array},n.getNumberType=function(c){return c===(c|0)?Math.sign(c)===-1?c<=127&&c>=-128?Int8Array:c<=32767&&c>=-32768?Int16Array:Int32Array:c<=255?Uint8Array:c<=65535?Uint16Array:Uint32Array:Float64Array};var a={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};n.getMinimalRepresentation=function(c,l){var d=null,h=0,f,g,v,E,b;for(E=0,b=c.length;E<b;E++)v=l?l(c[E]):c[E],g=n.getNumberType(v),f=a[g.name],f>h&&(h=f,d=g);return d},n.isTypedArray=function(c){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(c)},n.concat=function(){var c=0,l,d,h;for(l=0,h=arguments.length;l<h;l++)c+=arguments[l].length;var f=new arguments[0].constructor(c);for(l=0,d=0;l<h;l++)f.set(arguments[l],d),d+=arguments[l].length;return f},n.indices=function(c){for(var l=n.getPointerArray(c),d=new l(c),h=0;h<c;h++)d[h]=h;return d}})(fi)),fi}var pi,Jo;function zi(){if(Jo)return pi;Jo=1;var n=ua(),e=Pi().getPointerArray;function t(r,i){arguments.length<2&&(i=r,r=Array);var o=e(i);this.size=0,this.length=i,this.dense=new o(i),this.sparse=new o(i),this.vals=new r(i)}return t.prototype.clear=function(){this.size=0},t.prototype.has=function(r){var i=this.sparse[r];return i<this.size&&this.dense[i]===r},t.prototype.get=function(r){var i=this.sparse[r];if(i<this.size&&this.dense[i]===r)return this.vals[i]},t.prototype.set=function(r,i){var o=this.sparse[r];return o<this.size&&this.dense[o]===r?(this.vals[o]=i,this):(this.dense[this.size]=r,this.sparse[r]=this.size,this.vals[this.size]=i,this.size++,this)},t.prototype.delete=function(r){var i=this.sparse[r];return i>=this.size||this.dense[i]!==r?!1:(i=this.dense[this.size-1],this.dense[this.sparse[r]]=i,this.sparse[i]=this.sparse[r],this.size--,!0)},t.prototype.forEach=function(r,i){i=arguments.length>1?i:this;for(var o=0;o<this.size;o++)r.call(i,this.vals[o],this.dense[o])},t.prototype.keys=function(){var r=this.size,i=this.dense,o=0;return new n(function(){if(o<r){var s=i[o];return o++,{value:s}}return{done:!0}})},t.prototype.values=function(){var r=this.size,i=this.vals,o=0;return new n(function(){if(o<r){var s=i[o];return o++,{value:s}}return{done:!0}})},t.prototype.entries=function(){var r=this.size,i=this.dense,o=this.vals,s=0;return new n(function(){if(s<r){var a=[i[s],o[s]];return s++,{value:a}}return{done:!0}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.entries),t.prototype.inspect=function(){for(var r=new Map,i=0;i<this.size;i++)r.set(this.dense[i],this.vals[i]);return Object.defineProperty(r,"constructor",{value:t,enumerable:!1}),r.length=this.length,this.vals.constructor!==Array&&(r.type=this.vals.constructor.name),r},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),pi=t,pi}var gi,Zo;function ca(){if(Zo)return gi;Zo=1;var n=ua(),e=Pi().getPointerArray;function t(r){var i=e(r);this.start=0,this.size=0,this.capacity=r,this.dense=new i(r),this.sparse=new i(r)}return t.prototype.clear=function(){this.start=0,this.size=0},t.prototype.has=function(r){if(this.size===0)return!1;var i=this.sparse[r],o=i<this.capacity&&i>=this.start&&i<this.start+this.size||i<(this.start+this.size)%this.capacity;return o&&this.dense[i]===r},t.prototype.enqueue=function(r){var i=this.sparse[r];if(this.size!==0){var o=i<this.capacity&&i>=this.start&&i<this.start+this.size||i<(this.start+this.size)%this.capacity;if(o&&this.dense[i]===r)return this}return i=(this.start+this.size)%this.capacity,this.dense[i]=r,this.sparse[r]=i,this.size++,this},t.prototype.dequeue=function(){if(this.size!==0){var r=this.start;this.size--,this.start++,this.start===this.capacity&&(this.start=0);var i=this.dense[r];return this.sparse[i]=this.capacity,i}},t.prototype.forEach=function(r,i){i=arguments.length>1?i:this;for(var o=this.capacity,s=this.size,a=this.start,c=0;c<s;)r.call(i,this.dense[a],c,this),a++,c++,a===o&&(a=0)},t.prototype.values=function(){var r=this.dense,i=this.capacity,o=this.size,s=this.start,a=0;return new n(function(){if(a>=o)return{done:!0};var c=r[s];return s++,a++,s===i&&(s=0),{value:c,done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.inspect=function(){var r=[];return this.forEach(function(i){r.push(i)}),Object.defineProperty(r,"constructor",{value:t,enumerable:!1}),r.capacity=this.capacity,r},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),gi=t,gi}var vi,Qo;function la(){if(Qo)return vi;Qo=1;function n(t){return function(r){return typeof r!="number"&&(r=r.length),Math.floor(t()*r)}}var e=n(Math.random);return e.createRandomIndex=n,vi=e,vi}var mn={},yi,es;function Yd(){if(es)return yi;es=1;function n(t){return function(r,i){return r+Math.floor(t()*(i-r+1))}}var e=n(Math.random);return e.createRandom=n,yi=e,yi}var ts;function Xd(){if(ts)return mn;ts=1;var n=zi(),e=Yd().createRandom;function t(i,o,s){var a=i.get(o);typeof a>"u"&&(a=0),a+=s,i.set(o,a)}function r(i,o){o=o||{};var s=o.rng||Math.random,a="randomness"in o?o.randomness:.01;this.index=i,this.random=e(s),this.randomness=a,this.rng=s;var c=i.counts.constructor,l=i.weights.constructor,d=i.C;this.resolution=i.resolution,this.B=i.C,this.C=0,this.communitiesOffsets=new c(d),this.nodesSortedByCommunities=new c(d),this.communitiesBounds=new c(d+1),this.communityWeights=new l(d),this.degrees=new l(d),this.nonSingleton=new Uint8Array(d),this.externalEdgeWeightPerCommunity=new l(d),this.belongings=new c(d),this.neighboringCommunities=new n(l,d),this.cumulativeIncrement=new Float64Array(d),this.macroCommunities=null}return r.prototype.groupByCommunities=function(){var i=this.index,o,s,a,c,l;for(o=0,l=0,s=0;s<i.C;s++)a=i.counts[s],a!==0&&(this.communitiesBounds[l++]=o,o+=a,this.communitiesOffsets[s]=o);for(this.communitiesBounds[l]=o,l=0,s=0;s<i.C;s++)c=i.belongings[s],l=--this.communitiesOffsets[c],this.nodesSortedByCommunities[l]=s;this.B=i.C-i.U,this.C=i.C},r.prototype.communities=function(){var i=new Array(this.B),o,s,a,c,l;for(o=0;o<this.B;o++){for(c=this.communitiesBounds[o],l=this.communitiesBounds[o+1],a=[],s=c;s<l;s++)a.push(s);i[o]=a}return i},r.prototype.mergeNodesSubset=function(i,o){var s=this.index,a=s.belongings[this.nodesSortedByCommunities[i]],c=this.neighboringCommunities,l=0,d,h,f,g,v,E;for(h=i;h<o;h++)for(d=this.nodesSortedByCommunities[h],this.belongings[d]=d,this.nonSingleton[d]=0,this.degrees[d]=0,l+=s.loops[d]/2,this.communityWeights[d]=s.loops[d],this.externalEdgeWeightPerCommunity[d]=0,g=s.starts[d],v=s.starts[d+1];g<v;g++)E=s.neighborhood[g],f=s.weights[g],this.degrees[d]+=f,s.belongings[E]===a&&(l+=f,this.externalEdgeWeightPerCommunity[d]+=f,this.communityWeights[d]+=f);var b=this.externalEdgeWeightPerCommunity.slice(),y,A,_,p=o-i,k,$,S,I,C,T,H,N,m,Ie,Oe,R,x;for(A=this.random(i,o-1),y=i;y<o;y++,A++)if(h=i+A%p,d=this.nodesSortedByCommunities[h],this.nonSingleton[d]!==1&&!(this.externalEdgeWeightPerCommunity[d]<this.communityWeights[d]*(l/2-this.communityWeights[d])*this.resolution)){for(this.communityWeights[d]=0,this.externalEdgeWeightPerCommunity[d]=0,c.clear(),c.set(d,0),k=0,g=s.starts[d],v=s.starts[d+1];g<v;g++)E=s.neighborhood[g],s.belongings[E]===a&&(f=s.weights[g],k+=f,t(c,this.belongings[E],f));for($=d,I=0,C=0,_=0;_<c.size;_++)T=c.dense[_],H=c.vals[_],N=this.communityWeights[T],this.externalEdgeWeightPerCommunity[T]>=N*(l/2-N)*this.resolution&&(S=H-(k+s.loops[d])*N*this.resolution/l,S>I&&($=T,I=S),S>=0&&(C+=Math.exp(S/this.randomness))),this.cumulativeIncrement[_]=C;if(C<Number.MAX_VALUE&&C<1/0){for(m=C*this.rng(),Ie=-1,Oe=c.size+1;Ie<Oe-1;)R=Ie+Oe>>>1,this.cumulativeIncrement[R]>=m?Oe=R:Ie=R;x=c.dense[Oe]}else x=$;for(this.communityWeights[x]+=k+s.loops[d],g=s.starts[d],v=s.starts[d+1];g<v;g++)E=s.neighborhood[g],s.belongings[E]===a&&(T=this.belongings[E],T===x?this.externalEdgeWeightPerCommunity[x]-=b[E]:this.externalEdgeWeightPerCommunity[x]+=b[E]);x!==d&&(this.belongings[d]=x,this.nonSingleton[x]=1,this.C--)}var K=this.neighboringCommunities;for(K.clear(),h=i;h<o;h++)d=this.nodesSortedByCommunities[h],K.set(this.belongings[d],1);return K.dense.slice(0,K.size)},r.prototype.refinePartition=function(){this.groupByCommunities(),this.macroCommunities=new Array(this.B);var i,o,s,a,c=this.communitiesBounds;for(i=0;i<this.B;i++)o=c[i],s=c[i+1],a=this.mergeNodesSubset(o,s),this.macroCommunities[i]=a},r.prototype.split=function(){var i=this.index,o=this.neighboringCommunities;o.clear();var s,a,c;for(s=0;s<i.C;s++)a=this.belongings[s],s===a&&(c=i.isolate(s,this.degrees[s]),o.set(a,c));for(s=0;s<i.C;s++)a=this.belongings[s],s!==a&&(c=o.get(a),i.move(s,this.degrees[s],c));var l,d;for(s=0;s<this.macroCommunities.length;s++)for(d=this.macroCommunities[s],l=0;l<d.length;l++)d[l]=o.get(d[l])},r.prototype.zoomOut=function(){var i=this.index;this.refinePartition(),this.split();var o=i.zoomOut(),s,a,c,l,d;for(l=0;l<this.macroCommunities.length;l++)for(s=this.macroCommunities[l],a=o[s[0]],d=1;d<s.length;d++)c=o[s[d]],i.expensiveMove(c,a)},r.prototype.onlySingletons=function(){var i=this.index,o;for(o=0;o<i.C;o++)if(i.counts[o]>1)return!1;return!0},mn.addWeightToCommunity=t,mn.UndirectedLeidenAddenda=r,mn}var bn={},Pr={},rs;function da(){if(rs)return Pr;rs=1;function n(r){return typeof r!="number"||isNaN(r)?1:r}function e(r,i){var o={},s=function(l){return typeof l>"u"?i:l};typeof i=="function"&&(s=i);var a=function(l){return s(l[r])},c=function(){return s(void 0)};return typeof r=="string"?(o.fromAttributes=a,o.fromGraph=function(l,d){return a(l.getNodeAttributes(d))},o.fromEntry=function(l,d){return a(d)}):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},o.fromGraph=function(l,d){return s(r(d,l.getNodeAttributes(d)))},o.fromEntry=function(l,d){return s(r(l,d))}):(o.fromAttributes=c,o.fromGraph=c,o.fromEntry=c),o}function t(r,i){var o={},s=function(l){return typeof l>"u"?i:l};typeof i=="function"&&(s=i);var a=function(l){return s(l[r])},c=function(){return s(void 0)};return typeof r=="string"?(o.fromAttributes=a,o.fromGraph=function(l,d){return a(l.getEdgeAttributes(d))},o.fromEntry=function(l,d){return a(d)},o.fromPartialEntry=o.fromEntry,o.fromMinimalEntry=o.fromEntry):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},o.fromGraph=function(l,d){var h=l.extremities(d);return s(r(d,l.getEdgeAttributes(d),h[0],h[1],l.getNodeAttributes(h[0]),l.getNodeAttributes(h[1]),l.isUndirected(d)))},o.fromEntry=function(l,d,h,f,g,v,E){return s(r(l,d,h,f,g,v,E))},o.fromPartialEntry=function(l,d,h,f){return s(r(l,d,h,f))},o.fromMinimalEntry=function(l,d){return s(r(l,d))}):(o.fromAttributes=c,o.fromGraph=c,o.fromEntry=c,o.fromMinimalEntry=c),o}return Pr.createNodeValueGetter=e,Pr.createEdgeValueGetter=t,Pr.createEdgeWeightGetter=function(r){return t(r,n)},Pr}var ns;function ha(){if(ns)return bn;ns=1;var n=Pi(),e=Mi(),t=da().createEdgeWeightGetter,r=Symbol.for("nodejs.util.inspect.custom"),i={getEdgeWeight:"weight",keepDendrogram:!1,resolution:1};function o(a,c){c=e(c,i);var l=c.resolution,d=t(c.getEdgeWeight).fromEntry,h=(a.size-a.selfLoopCount)*2,f=n.getPointerArray(h),g=n.getPointerArray(a.order+1),v=c.getEdgeWeight?Float64Array:n.getPointerArray(a.size*2);this.C=a.order,this.M=0,this.E=h,this.U=0,this.resolution=l,this.level=0,this.graph=a,this.nodes=new Array(a.order),this.keepDendrogram=c.keepDendrogram,this.neighborhood=new g(h),this.weights=new v(h),this.loops=new v(a.order),this.starts=new f(a.order+1),this.belongings=new g(a.order),this.dendrogram=[],this.mapping=null,this.counts=new g(a.order),this.unused=new g(a.order),this.totalWeights=new v(a.order);var E={},b,y=0,A=0,_=this;a.forEachNode(function(p){_.nodes[y]=p,E[p]=y,A+=a.undirectedDegreeWithoutSelfLoops(p),_.starts[y]=A,_.belongings[y]=y,_.counts[y]=1,y++}),a.forEachEdge(function(p,k,$,S,I,C,T){if(b=d(p,k,$,S,I,C,T),$=E[$],S=E[S],_.M+=b,$===S)_.totalWeights[$]+=b*2,_.loops[$]=b*2;else{_.totalWeights[$]+=b,_.totalWeights[S]+=b;var H=--_.starts[$],N=--_.starts[S];_.neighborhood[H]=S,_.neighborhood[N]=$,_.weights[H]=b,_.weights[N]=b}}),this.starts[y]=this.E,this.keepDendrogram?this.dendrogram.push(this.belongings.slice()):this.mapping=this.belongings.slice()}o.prototype.isolate=function(a,c){var l=this.belongings[a];if(this.counts[l]===1)return l;var d=this.unused[--this.U],h=this.loops[a];return this.totalWeights[l]-=c+h,this.totalWeights[d]+=c+h,this.belongings[a]=d,this.counts[l]--,this.counts[d]++,d},o.prototype.move=function(a,c,l){var d=this.belongings[a],h=this.loops[a];this.totalWeights[d]-=c+h,this.totalWeights[l]+=c+h,this.belongings[a]=l;var f=this.counts[d]--===1;this.counts[l]++,f&&(this.unused[this.U++]=d)},o.prototype.computeNodeDegree=function(a){var c,l,d,h=0;for(c=this.starts[a],l=this.starts[a+1];c<l;c++)d=this.weights[c],h+=d;return h},o.prototype.expensiveIsolate=function(a){var c=this.computeNodeDegree(a);return this.isolate(a,c)},o.prototype.expensiveMove=function(a,c){var l=this.computeNodeDegree(a);this.move(a,l,c)},o.prototype.zoomOut=function(){var a=new Array(this.C-this.U),c={},l=this.nodes.length,d=0,h=0,f,g,v,E,b,y,A,_,p;for(f=0,v=this.C;f<v;f++)y=this.belongings[f],y in c||(c[y]=d,a[d]={adj:{},totalWeights:this.totalWeights[y],internalWeights:0},d++),this.belongings[f]=c[y];var k,$;if(this.keepDendrogram){for(k=this.dendrogram[this.level],$=new(n.getPointerArray(d))(l),f=0;f<l;f++)$[f]=this.belongings[k[f]];this.dendrogram.push($)}else for(f=0;f<l;f++)this.mapping[f]=this.belongings[this.mapping[f]];for(f=0,v=this.C;f<v;f++)for(y=this.belongings[f],_=a[y],p=_.adj,_.internalWeights+=this.loops[f],g=this.starts[f],E=this.starts[f+1];g<E;g++){if(b=this.neighborhood[g],A=this.belongings[b],y===A){_.internalWeights+=this.weights[g];continue}A in p||(p[A]=0),p[A]+=this.weights[g]}for(this.C=d,b=0,y=0;y<d;y++){_=a[y],p=_.adj,y=+y,this.totalWeights[y]=_.totalWeights,this.loops[y]=_.internalWeights,this.counts[y]=1,this.starts[y]=b,this.belongings[y]=y;for(A in p)this.neighborhood[b]=+A,this.weights[b]=p[A],h++,b++}return this.starts[d]=h,this.E=h,this.U=0,this.level++,c},o.prototype.modularity=function(){var a,c,l,d,h,f=0,g=this.M*2,v=new Float64Array(this.C);for(l=0;l<this.C;l++)for(a=this.belongings[l],v[a]+=this.loops[l],d=this.starts[l],h=this.starts[l+1];d<h;d++)c=this.belongings[this.neighborhood[d]],a===c&&(v[a]+=this.weights[d]);for(l=0;l<this.C;l++)f+=v[l]/g-Math.pow(this.totalWeights[l]/g,2)*this.resolution;return f},o.prototype.delta=function(a,c,l,d){var h=this.M,f=this.totalWeights[d];return c+=this.loops[a],l/h-f*c*this.resolution/(2*h*h)},o.prototype.deltaWithOwnCommunity=function(a,c,l,d){var h=this.M,f=this.totalWeights[d];return c+=this.loops[a],l/h-(f-c)*c*this.resolution/(2*h*h)},o.prototype.fastDelta=function(a,c,l,d){var h=this.M,f=this.totalWeights[d];return c+=this.loops[a],l-c*f*this.resolution/(2*h)},o.prototype.fastDeltaWithOwnCommunity=function(a,c,l,d){var h=this.M,f=this.totalWeights[d];return c+=this.loops[a],l-c*(f-c)*this.resolution/(2*h)},o.prototype.bounds=function(a){return[this.starts[a],this.starts[a+1]]},o.prototype.project=function(){var a=this,c={};return a.nodes.slice(0,this.C).forEach(function(l,d){c[l]=Array.from(a.neighborhood.slice(a.starts[d],a.starts[d+1])).map(function(h){return a.nodes[h]})}),c},o.prototype.collect=function(a){arguments.length<1&&(a=this.level);var c={},l=this.keepDendrogram?this.dendrogram[a]:this.mapping,d,h;for(d=0,h=l.length;d<h;d++)c[this.nodes[d]]=l[d];return c},o.prototype.assign=function(a,c){arguments.length<2&&(c=this.level);var l=this.keepDendrogram?this.dendrogram[c]:this.mapping,d,h;for(d=0,h=l.length;d<h;d++)this.graph.setNodeAttribute(this.nodes[d],a,l[d])},o.prototype[r]=function(){var a={};Object.defineProperty(a,"constructor",{value:o,enumerable:!1}),a.C=this.C,a.M=this.M,a.E=this.E,a.U=this.U,a.resolution=this.resolution,a.level=this.level,a.nodes=this.nodes,a.starts=this.starts.slice(0,a.C+1);var c=["neighborhood","weights"],l=["counts","loops","belongings","totalWeights"],d=this;return c.forEach(function(h){a[h]=d[h].slice(0,a.E)}),l.forEach(function(h){a[h]=d[h].slice(0,a.C)}),a.unused=this.unused.slice(0,this.U),this.keepDendrogram?a.dendrogram=this.dendrogram:a.mapping=this.mapping,a};function s(a,c){c=e(c,i);var l=c.resolution,d=t(c.getEdgeWeight).fromEntry,h=(a.size-a.selfLoopCount)*2,f=n.getPointerArray(h),g=n.getPointerArray(a.order+1),v=c.getEdgeWeight?Float64Array:n.getPointerArray(a.size*2);this.C=a.order,this.M=0,this.E=h,this.U=0,this.resolution=l,this.level=0,this.graph=a,this.nodes=new Array(a.order),this.keepDendrogram=c.keepDendrogram,this.neighborhood=new g(h),this.weights=new v(h),this.loops=new v(a.order),this.starts=new f(a.order+1),this.offsets=new f(a.order),this.belongings=new g(a.order),this.dendrogram=[],this.counts=new g(a.order),this.unused=new g(a.order),this.totalInWeights=new v(a.order),this.totalOutWeights=new v(a.order);var E={},b,y=0,A=0,_=this;a.forEachNode(function(p){_.nodes[y]=p,E[p]=y,A+=a.outDegreeWithoutSelfLoops(p),_.starts[y]=A,A+=a.inDegreeWithoutSelfLoops(p),_.offsets[y]=A,_.belongings[y]=y,_.counts[y]=1,y++}),a.forEachEdge(function(p,k,$,S,I,C,T){if(b=d(p,k,$,S,I,C,T),$=E[$],S=E[S],_.M+=b,$===S)_.loops[$]+=b,_.totalInWeights[$]+=b,_.totalOutWeights[$]+=b;else{_.totalOutWeights[$]+=b,_.totalInWeights[S]+=b;var H=--_.starts[$],N=--_.offsets[S];_.neighborhood[H]=S,_.neighborhood[N]=$,_.weights[H]=b,_.weights[N]=b}}),this.starts[y]=this.E,this.keepDendrogram?this.dendrogram.push(this.belongings.slice()):this.mapping=this.belongings.slice()}return s.prototype.bounds=o.prototype.bounds,s.prototype.inBounds=function(a){return[this.offsets[a],this.starts[a+1]]},s.prototype.outBounds=function(a){return[this.starts[a],this.offsets[a]]},s.prototype.project=o.prototype.project,s.prototype.projectIn=function(){var a=this,c={};return a.nodes.slice(0,this.C).forEach(function(l,d){c[l]=Array.from(a.neighborhood.slice(a.offsets[d],a.starts[d+1])).map(function(h){return a.nodes[h]})}),c},s.prototype.projectOut=function(){var a=this,c={};return a.nodes.slice(0,this.C).forEach(function(l,d){c[l]=Array.from(a.neighborhood.slice(a.starts[d],a.offsets[d])).map(function(h){return a.nodes[h]})}),c},s.prototype.isolate=function(a,c,l){var d=this.belongings[a];if(this.counts[d]===1)return d;var h=this.unused[--this.U],f=this.loops[a];return this.totalInWeights[d]-=c+f,this.totalInWeights[h]+=c+f,this.totalOutWeights[d]-=l+f,this.totalOutWeights[h]+=l+f,this.belongings[a]=h,this.counts[d]--,this.counts[h]++,h},s.prototype.move=function(a,c,l,d){var h=this.belongings[a],f=this.loops[a];this.totalInWeights[h]-=c+f,this.totalInWeights[d]+=c+f,this.totalOutWeights[h]-=l+f,this.totalOutWeights[d]+=l+f,this.belongings[a]=d;var g=this.counts[h]--===1;this.counts[d]++,g&&(this.unused[this.U++]=h)},s.prototype.computeNodeInDegree=function(a){var c,l,d,h=0;for(c=this.offsets[a],l=this.starts[a+1];c<l;c++)d=this.weights[c],h+=d;return h},s.prototype.computeNodeOutDegree=function(a){var c,l,d,h=0;for(c=this.starts[a],l=this.offsets[a];c<l;c++)d=this.weights[c],h+=d;return h},s.prototype.expensiveMove=function(a,c){var l=this.computeNodeInDegree(a),d=this.computeNodeOutDegree(a);this.move(a,l,d,c)},s.prototype.zoomOut=function(){var a=new Array(this.C-this.U),c={},l=this.nodes.length,d=0,h=0,f,g,v,E,b,y,A,_,p,k,$,S,I;for(f=0,v=this.C;f<v;f++)y=this.belongings[f],y in c||(c[y]=d,a[d]={inAdj:{},outAdj:{},totalInWeights:this.totalInWeights[y],totalOutWeights:this.totalOutWeights[y],internalWeights:0},d++),this.belongings[f]=c[y];var C,T;if(this.keepDendrogram){for(C=this.dendrogram[this.level],T=new(n.getPointerArray(d))(l),f=0;f<l;f++)T[f]=this.belongings[C[f]];this.dendrogram.push(T)}else for(f=0;f<l;f++)this.mapping[f]=this.belongings[this.mapping[f]];for(f=0,v=this.C;f<v;f++)for(y=this.belongings[f],p=this.offsets[f],_=a[y],S=_.inAdj,I=_.outAdj,_.internalWeights+=this.loops[f],g=this.starts[f],E=this.starts[f+1];g<E;g++){if(b=this.neighborhood[g],A=this.belongings[b],k=g<p,$=k?I:S,y===A){k&&(_.internalWeights+=this.weights[g]);continue}A in $||($[A]=0),$[A]+=this.weights[g]}for(this.C=d,b=0,y=0;y<d;y++){_=a[y],S=_.inAdj,I=_.outAdj,y=+y,this.totalInWeights[y]=_.totalInWeights,this.totalOutWeights[y]=_.totalOutWeights,this.loops[y]=_.internalWeights,this.counts[y]=1,this.starts[y]=b,this.belongings[y]=y;for(A in I)this.neighborhood[b]=+A,this.weights[b]=I[A],h++,b++;this.offsets[y]=b;for(A in S)this.neighborhood[b]=+A,this.weights[b]=S[A],h++,b++}return this.starts[d]=h,this.E=h,this.U=0,this.level++,c},s.prototype.modularity=function(){var a,c,l,d,h,f=0,g=this.M,v=new Float64Array(this.C);for(l=0;l<this.C;l++)for(a=this.belongings[l],v[a]+=this.loops[l],d=this.starts[l],h=this.offsets[l];d<h;d++)c=this.belongings[this.neighborhood[d]],a===c&&(v[a]+=this.weights[d]);for(l=0;l<this.C;l++)f+=v[l]/g-this.totalInWeights[l]*this.totalOutWeights[l]/Math.pow(g,2)*this.resolution;return f},s.prototype.delta=function(a,c,l,d,h){var f=this.M,g=this.totalInWeights[h],v=this.totalOutWeights[h],E=this.loops[a];return c+=E,l+=E,d/f-(l*g+c*v)*this.resolution/(f*f)},s.prototype.deltaWithOwnCommunity=function(a,c,l,d,h){var f=this.M,g=this.totalInWeights[h],v=this.totalOutWeights[h],E=this.loops[a];return c+=E,l+=E,d/f-(l*(g-c)+c*(v-l))*this.resolution/(f*f)},s.prototype.collect=o.prototype.collect,s.prototype.assign=o.prototype.assign,s.prototype[r]=function(){var a={};Object.defineProperty(a,"constructor",{value:s,enumerable:!1}),a.C=this.C,a.M=this.M,a.E=this.E,a.U=this.U,a.resolution=this.resolution,a.level=this.level,a.nodes=this.nodes,a.starts=this.starts.slice(0,a.C+1);var c=["neighborhood","weights"],l=["counts","offsets","loops","belongings","totalInWeights","totalOutWeights"],d=this;return c.forEach(function(h){a[h]=d[h].slice(0,a.E)}),l.forEach(function(h){a[h]=d[h].slice(0,a.C)}),a.unused=this.unused.slice(0,this.U),this.keepDendrogram?a.dendrogram=this.dendrogram:a.mapping=this.mapping,a},bn.UndirectedLouvainIndex=o,bn.DirectedLouvainIndex=s,bn}var mi,is;function Jd(){if(is)return mi;is=1;var n=Mi(),e=Gn(),t=aa(),r=zi(),i=ca(),o=la().createRandomIndex,s=Xd(),a=ha(),c=s.addWeightToCommunity,l=a.UndirectedLouvainIndex,d=s.UndirectedLeidenAddenda,h={attributes:{community:"community",weight:"weight"},randomness:.01,randomWalk:!0,resolution:1,rng:Math.random,weighted:!1,maxIterations:0},f=1e-10;function g(y,A,_,p,k){return Math.abs(p-k)<f?y===A?!1:_>y:p>k}function v(y,A,_){for(var p=new l(A,{attributes:{weight:_.attributes.weight},keepDendrogram:y,resolution:_.resolution,weighted:_.weighted}),k=new d(p,{randomness:_.randomness,rng:_.rng}),$=o(_.rng),S,I,C=new r(Float64Array,p.C),T=new i(p.C),H,N,m,Ie,Oe,R,x,K,ee,ne,Te,ce,W,xe,Ke,Be=0,Ye=0,ct=[],Xe,ve=0;!(_.maxIterations>0&&ve>=_.maxIterations);){for(ve++,ee=p.C,Xe=0,Oe=_.randomWalk?$(ee):0,R=0;R<ee;R++,Oe++)x=Oe%ee,T.enqueue(x);for(;T.size!==0;){for(x=T.dequeue(),Ye++,ne=0,C.clear(),S=p.belongings[x],H=p.starts[x],N=p.starts[x+1];H<N;H++)K=p.neighborhood[H],m=p.weights[H],I=p.belongings[K],ne+=m,c(C,I,m);W=p.fastDeltaWithOwnCommunity(x,ne,C.get(S)||0,S),ce=S;var V=[[S,W,"own",p.counts[S]===1]];for(Ie=0;Ie<C.size;Ie++)I=C.dense[Ie],I!==S&&(Te=C.vals[Ie],Be++,Ke=p.fastDelta(x,ne,Te,I),V.push([I,Ke,"other"]),xe=g(ce,S,I,Ke,W),xe&&(W=Ke,ce=I));if(W<0){if(ce=p.isolate(x,ne),ce===S)continue}else{if(ce===S)continue;p.move(x,ne,ce)}for(Xe++,H=p.starts[x],N=p.starts[x+1];H<N;H++)K=p.neighborhood[H],I=p.belongings[K],I!==ce&&T.enqueue(K)}if(ct.push(Xe),Xe===0){p.zoomOut();break}if(!k.onlySingletons()){k.zoomOut();continue}break}var me={index:p,deltaComputations:Be,nodesVisited:Ye,moves:ct};return me}function E(y,A,_,p){if(!e(_))throw new Error("graphology-communities-leiden: the given graph is not a valid graphology instance.");var k=t(_);if(k==="mixed")throw new Error("graphology-communities-leiden: cannot run the algorithm on a true mixed graph.");if(k==="directed")throw new Error("graphology-communities-leiden: not yet implemented for directed graphs.");p=n(p,h);var $=0;if(_.size===0){if(y){_.forEachNode(function(N){_.setNodeAttribute(N,p.attributes.communities,$++)});return}var S={};return _.forEachNode(function(N){S[N]=$++}),A?{communities:S,count:_.order,deltaComputations:0,dendrogram:null,level:0,modularity:NaN,moves:null,nodesVisited:0,resolution:p.resolution}:S}var I=v,C=I(A,_,p),T=C.index;if(!A){if(y){T.assign(p.attributes.community);return}return T.collect()}var H={count:T.C,deltaComputations:C.deltaComputations,dendrogram:T.dendrogram,level:T.level,modularity:T.modularity(),moves:C.moves,nodesVisited:C.nodesVisited,resolution:p.resolution};return y?(T.assign(p.attributes.community),H):(H.communities=T.collect(),H)}var b=E.bind(null,!1,!1);return b.assign=E.bind(null,!0,!1),b.detailed=E.bind(null,!1,!0),b.defaults=h,mi=b,mi}var Zd=Jd();const Qd=Ti(Zd);var bi,os;function eh(){if(os)return bi;os=1;var n=Mi(),e=Gn(),t=aa(),r=zi(),i=ca(),o=la().createRandomIndex,s=ha(),a=s.UndirectedLouvainIndex,c=s.DirectedLouvainIndex,l={nodeCommunityAttribute:"community",getEdgeWeight:"weight",fastLocalMoves:!0,randomWalk:!0,resolution:1,rng:Math.random};function d(y,A,_){var p=y.get(A);typeof p>"u"&&(p=0),p+=_,y.set(A,p)}var h=1e-10;function f(y,A,_,p,k){return Math.abs(p-k)<h?y===A?!1:_>y:p>k}function g(y,A,_){var p=new a(A,{getEdgeWeight:_.getEdgeWeight,keepDendrogram:y,resolution:_.resolution}),k=o(_.rng),$=!0,S=!0,I,C,T=new r(Float64Array,p.C),H,N,m,Ie,Oe,R,x,K,ee,ne,Te,ce,W,xe,Ke,Be,Ye=0,ct=0,Xe=[],ve,V;for(_.fastLocalMoves&&(H=new i(p.C));$;){if(ne=p.C,$=!1,S=!0,_.fastLocalMoves){for(V=0,R=_.randomWalk?k(ne):0,x=0;x<ne;x++,R++)K=R%ne,H.enqueue(K);for(;H.size!==0;){for(K=H.dequeue(),ct++,Te=0,T.clear(),I=p.belongings[K],N=p.starts[K],m=p.starts[K+1];N<m;N++)ee=p.neighborhood[N],Ie=p.weights[N],C=p.belongings[ee],Te+=Ie,d(T,C,Ie);for(xe=p.fastDeltaWithOwnCommunity(K,Te,T.get(I)||0,I),W=I,Oe=0;Oe<T.size;Oe++)C=T.dense[Oe],C!==I&&(ce=T.vals[Oe],Ye++,Be=p.fastDelta(K,Te,ce,C),Ke=f(W,I,C,Be,xe),Ke&&(xe=Be,W=C));if(xe<0){if(W=p.isolate(K,Te),W===I)continue}else{if(W===I)continue;p.move(K,Te,W)}for($=!0,V++,N=p.starts[K],m=p.starts[K+1];N<m;N++)ee=p.neighborhood[N],C=p.belongings[ee],C!==W&&H.enqueue(ee)}Xe.push(V)}else for(ve=[],Xe.push(ve);S;){for(S=!1,V=0,R=_.randomWalk?k(ne):0,x=0;x<ne;x++,R++){for(K=R%ne,ct++,Te=0,T.clear(),I=p.belongings[K],N=p.starts[K],m=p.starts[K+1];N<m;N++)ee=p.neighborhood[N],Ie=p.weights[N],C=p.belongings[ee],Te+=Ie,d(T,C,Ie);for(xe=p.fastDeltaWithOwnCommunity(K,Te,T.get(I)||0,I),W=I,Oe=0;Oe<T.size;Oe++)C=T.dense[Oe],C!==I&&(ce=T.vals[Oe],Ye++,Be=p.fastDelta(K,Te,ce,C),Ke=f(W,I,C,Be,xe),Ke&&(xe=Be,W=C));if(xe<0){if(W=p.isolate(K,Te),W===I)continue}else{if(W===I)continue;p.move(K,Te,W)}S=!0,V++}ve.push(V),$=S||$}$&&p.zoomOut()}var me={index:p,deltaComputations:Ye,nodesVisited:ct,moves:Xe};return me}function v(y,A,_){var p=new c(A,{getEdgeWeight:_.getEdgeWeight,keepDendrogram:y,resolution:_.resolution}),k=o(_.rng),$=!0,S=!0,I,C,T=new r(Float64Array,p.C),H,N,m,Ie,Oe,R,x,K,ee,ne,Te,ce,W,xe,Ke,Be,Ye,ct,Xe,ve=0,V=0,me=[],lt,Y;for(_.fastLocalMoves&&(H=new i(p.C));$;){if(ce=p.C,$=!1,S=!0,_.fastLocalMoves){for(Y=0,K=_.randomWalk?k(ce):0,ee=0;ee<ce;ee++,K++)ne=K%ce,H.enqueue(ne);for(;H.size!==0;){for(ne=H.dequeue(),V++,W=0,xe=0,T.clear(),I=p.belongings[ne],N=p.starts[ne],m=p.starts[ne+1],Ie=p.offsets[ne];N<m;N++)Oe=N<Ie,Te=p.neighborhood[N],R=p.weights[N],C=p.belongings[Te],Oe?xe+=R:W+=R,d(T,C,R);for(Ye=p.deltaWithOwnCommunity(ne,W,xe,T.get(I)||0,I),Be=I,x=0;x<T.size;x++)C=T.dense[x],C!==I&&(Ke=T.vals[x],ve++,Xe=p.delta(ne,W,xe,Ke,C),ct=f(Be,I,C,Xe,Ye),ct&&(Ye=Xe,Be=C));if(Ye<0){if(Be=p.isolate(ne,W,xe),Be===I)continue}else{if(Be===I)continue;p.move(ne,W,xe,Be)}for($=!0,Y++,N=p.starts[ne],m=p.starts[ne+1];N<m;N++)Te=p.neighborhood[N],C=p.belongings[Te],C!==Be&&H.enqueue(Te)}me.push(Y)}else for(lt=[],me.push(lt);S;){for(S=!1,Y=0,K=_.randomWalk?k(ce):0,ee=0;ee<ce;ee++,K++){for(ne=K%ce,V++,W=0,xe=0,T.clear(),I=p.belongings[ne],N=p.starts[ne],m=p.starts[ne+1],Ie=p.offsets[ne];N<m;N++)Oe=N<Ie,Te=p.neighborhood[N],R=p.weights[N],C=p.belongings[Te],Oe?xe+=R:W+=R,d(T,C,R);for(Ye=p.deltaWithOwnCommunity(ne,W,xe,T.get(I)||0,I),Be=I,x=0;x<T.size;x++)C=T.dense[x],C!==I&&(Ke=T.vals[x],ve++,Xe=p.delta(ne,W,xe,Ke,C),ct=f(Be,I,C,Xe,Ye),ct&&(Ye=Xe,Be=C));if(Ye<0){if(Be=p.isolate(ne,W,xe),Be===I)continue}else{if(Be===I)continue;p.move(ne,W,xe,Be)}S=!0,Y++}lt.push(Y),$=S||$}$&&p.zoomOut()}var Z={index:p,deltaComputations:ve,nodesVisited:V,moves:me};return Z}function E(y,A,_,p){if(!e(_))throw new Error("graphology-communities-louvain: the given graph is not a valid graphology instance.");var k=t(_);if(k==="mixed")throw new Error("graphology-communities-louvain: cannot run the algorithm on a true mixed graph.");p=n(p,l);var $=0;if(_.size===0){if(y){_.forEachNode(function(N){_.setNodeAttribute(N,p.nodeCommunityAttribute,$++)});return}var S={};return _.forEachNode(function(N){S[N]=$++}),A?{communities:S,count:_.order,deltaComputations:0,dendrogram:null,level:0,modularity:NaN,moves:null,nodesVisited:0,resolution:p.resolution}:S}var I=k==="undirected"?g:v,C=I(A,_,p),T=C.index;if(!A){if(y){T.assign(p.nodeCommunityAttribute);return}return T.collect()}var H={count:T.C,deltaComputations:C.deltaComputations,dendrogram:T.dendrogram,level:T.level,modularity:T.modularity(),moves:C.moves,nodesVisited:C.nodesVisited,resolution:p.resolution};return y?(T.assign(p.nodeCommunityAttribute),H):(H.communities=T.collect(),H)}var b=E.bind(null,!1,!1);return b.assign=E.bind(null,!0,!1),b.detailed=E.bind(null,!1,!0),b.defaults=l,bi=b,bi}var th=eh();const rh=Ti(th);var wi,ss;function nh(){if(ss)return wi;ss=1;var n=0,e=1,t=2,r=3,i=4,o=5,s=6,a=7,c=8,l=9,d=0,h=1,f=2,g=0,v=1,E=2,b=3,y=4,A=5,_=6,p=7,k=8,$=3,S=10,I=3,C=9,T=10;return wi=function(N,m,Ie){var Oe,R,x,K,ee,ne,Te,ce,W,xe,Ke=m.length,Be=Ie.length,Ye=N.adjustSizes,ct=N.barnesHutTheta*N.barnesHutTheta,Xe,ve,V,me,lt,Y,Z,L=[];for(x=0;x<Ke;x+=S)m[x+i]=m[x+t],m[x+o]=m[x+r],m[x+t]=0,m[x+r]=0;if(N.outboundAttractionDistribution){for(Xe=0,x=0;x<Ke;x+=S)Xe+=m[x+s];Xe/=Ke/S}if(N.barnesHutOptimize){var St=1/0,Ct=-1/0,Dt=1/0,jt=-1/0,Et,wt,Qe;for(x=0;x<Ke;x+=S)St=Math.min(St,m[x+n]),Ct=Math.max(Ct,m[x+n]),Dt=Math.min(Dt,m[x+e]),jt=Math.max(jt,m[x+e]);var Tt=Ct-St,Yt=jt-Dt;for(Tt>Yt?(Dt-=(Tt-Yt)/2,jt=Dt+Tt):(St-=(Yt-Tt)/2,Ct=St+Yt),L[0+g]=-1,L[0+v]=(St+Ct)/2,L[0+E]=(Dt+jt)/2,L[0+b]=Math.max(Ct-St,jt-Dt),L[0+y]=-1,L[0+A]=-1,L[0+_]=0,L[0+p]=0,L[0+k]=0,Oe=1,x=0;x<Ke;x+=S)for(R=0,Qe=$;;)if(L[R+A]>=0){m[x+n]<L[R+v]?m[x+e]<L[R+E]?Et=L[R+A]:Et=L[R+A]+C:m[x+e]<L[R+E]?Et=L[R+A]+C*2:Et=L[R+A]+C*3,L[R+p]=(L[R+p]*L[R+_]+m[x+n]*m[x+s])/(L[R+_]+m[x+s]),L[R+k]=(L[R+k]*L[R+_]+m[x+e]*m[x+s])/(L[R+_]+m[x+s]),L[R+_]+=m[x+s],R=Et;continue}else if(L[R+g]<0){L[R+g]=x;break}else{if(L[R+A]=Oe*C,ce=L[R+b]/2,W=L[R+A],L[W+g]=-1,L[W+v]=L[R+v]-ce,L[W+E]=L[R+E]-ce,L[W+b]=ce,L[W+y]=W+C,L[W+A]=-1,L[W+_]=0,L[W+p]=0,L[W+k]=0,W+=C,L[W+g]=-1,L[W+v]=L[R+v]-ce,L[W+E]=L[R+E]+ce,L[W+b]=ce,L[W+y]=W+C,L[W+A]=-1,L[W+_]=0,L[W+p]=0,L[W+k]=0,W+=C,L[W+g]=-1,L[W+v]=L[R+v]+ce,L[W+E]=L[R+E]-ce,L[W+b]=ce,L[W+y]=W+C,L[W+A]=-1,L[W+_]=0,L[W+p]=0,L[W+k]=0,W+=C,L[W+g]=-1,L[W+v]=L[R+v]+ce,L[W+E]=L[R+E]+ce,L[W+b]=ce,L[W+y]=L[R+y],L[W+A]=-1,L[W+_]=0,L[W+p]=0,L[W+k]=0,Oe+=4,m[L[R+g]+n]<L[R+v]?m[L[R+g]+e]<L[R+E]?Et=L[R+A]:Et=L[R+A]+C:m[L[R+g]+e]<L[R+E]?Et=L[R+A]+C*2:Et=L[R+A]+C*3,L[R+_]=m[L[R+g]+s],L[R+p]=m[L[R+g]+n],L[R+k]=m[L[R+g]+e],L[Et+g]=L[R+g],L[R+g]=-1,m[x+n]<L[R+v]?m[x+e]<L[R+E]?wt=L[R+A]:wt=L[R+A]+C:m[x+e]<L[R+E]?wt=L[R+A]+C*2:wt=L[R+A]+C*3,Et===wt)if(Qe--){R=Et;continue}else{Qe=$;break}L[wt+g]=x;break}}if(N.barnesHutOptimize)for(ve=N.scalingRatio,x=0;x<Ke;x+=S)for(R=0;;)if(L[R+A]>=0)if(Y=Math.pow(m[x+n]-L[R+p],2)+Math.pow(m[x+e]-L[R+k],2),xe=L[R+b],4*xe*xe/Y<ct){if(V=m[x+n]-L[R+p],me=m[x+e]-L[R+k],Ye===!0?Y>0?(Z=ve*m[x+s]*L[R+_]/Y,m[x+t]+=V*Z,m[x+r]+=me*Z):Y<0&&(Z=-ve*m[x+s]*L[R+_]/Math.sqrt(Y),m[x+t]+=V*Z,m[x+r]+=me*Z):Y>0&&(Z=ve*m[x+s]*L[R+_]/Y,m[x+t]+=V*Z,m[x+r]+=me*Z),R=L[R+y],R<0)break;continue}else{R=L[R+A];continue}else{if(ne=L[R+g],ne>=0&&ne!==x&&(V=m[x+n]-m[ne+n],me=m[x+e]-m[ne+e],Y=V*V+me*me,Ye===!0?Y>0?(Z=ve*m[x+s]*m[ne+s]/Y,m[x+t]+=V*Z,m[x+r]+=me*Z):Y<0&&(Z=-ve*m[x+s]*m[ne+s]/Math.sqrt(Y),m[x+t]+=V*Z,m[x+r]+=me*Z):Y>0&&(Z=ve*m[x+s]*m[ne+s]/Y,m[x+t]+=V*Z,m[x+r]+=me*Z)),R=L[R+y],R<0)break;continue}else for(ve=N.scalingRatio,K=0;K<Ke;K+=S)for(ee=0;ee<K;ee+=S)V=m[K+n]-m[ee+n],me=m[K+e]-m[ee+e],Ye===!0?(Y=Math.sqrt(V*V+me*me)-m[K+c]-m[ee+c],Y>0?(Z=ve*m[K+s]*m[ee+s]/Y/Y,m[K+t]+=V*Z,m[K+r]+=me*Z,m[ee+t]-=V*Z,m[ee+r]-=me*Z):Y<0&&(Z=100*ve*m[K+s]*m[ee+s],m[K+t]+=V*Z,m[K+r]+=me*Z,m[ee+t]-=V*Z,m[ee+r]-=me*Z)):(Y=Math.sqrt(V*V+me*me),Y>0&&(Z=ve*m[K+s]*m[ee+s]/Y/Y,m[K+t]+=V*Z,m[K+r]+=me*Z,m[ee+t]-=V*Z,m[ee+r]-=me*Z));for(W=N.gravity/N.scalingRatio,ve=N.scalingRatio,x=0;x<Ke;x+=S)Z=0,V=m[x+n],me=m[x+e],Y=Math.sqrt(Math.pow(V,2)+Math.pow(me,2)),N.strongGravityMode?Y>0&&(Z=ve*m[x+s]*W):Y>0&&(Z=ve*m[x+s]*W/Y),m[x+t]-=V*Z,m[x+r]-=me*Z;for(ve=1*(N.outboundAttractionDistribution?Xe:1),Te=0;Te<Be;Te+=I)K=Ie[Te+d],ee=Ie[Te+h],ce=Ie[Te+f],lt=Math.pow(ce,N.edgeWeightInfluence),V=m[K+n]-m[ee+n],me=m[K+e]-m[ee+e],Ye===!0?(Y=Math.sqrt(V*V+me*me)-m[K+c]-m[ee+c],N.linLogMode?N.outboundAttractionDistribution?Y>0&&(Z=-ve*lt*Math.log(1+Y)/Y/m[K+s]):Y>0&&(Z=-ve*lt*Math.log(1+Y)/Y):N.outboundAttractionDistribution?Y>0&&(Z=-ve*lt/m[K+s]):Y>0&&(Z=-ve*lt)):(Y=Math.sqrt(Math.pow(V,2)+Math.pow(me,2)),N.linLogMode?N.outboundAttractionDistribution?Y>0&&(Z=-ve*lt*Math.log(1+Y)/Y/m[K+s]):Y>0&&(Z=-ve*lt*Math.log(1+Y)/Y):N.outboundAttractionDistribution?(Y=1,Z=-ve*lt/m[K+s]):(Y=1,Z=-ve*lt)),Y>0&&(m[K+t]+=V*Z,m[K+r]+=me*Z,m[ee+t]-=V*Z,m[ee+r]-=me*Z);var nr,Xt,sr,$t,ar,Jt;if(Ye===!0)for(x=0;x<Ke;x+=S)m[x+l]!==1&&(nr=Math.sqrt(Math.pow(m[x+t],2)+Math.pow(m[x+r],2)),nr>T&&(m[x+t]=m[x+t]*T/nr,m[x+r]=m[x+r]*T/nr),Xt=m[x+s]*Math.sqrt((m[x+i]-m[x+t])*(m[x+i]-m[x+t])+(m[x+o]-m[x+r])*(m[x+o]-m[x+r])),sr=Math.sqrt((m[x+i]+m[x+t])*(m[x+i]+m[x+t])+(m[x+o]+m[x+r])*(m[x+o]+m[x+r]))/2,$t=.1*Math.log(1+sr)/(1+Math.sqrt(Xt)),ar=m[x+n]+m[x+t]*($t/N.slowDown),m[x+n]=ar,Jt=m[x+e]+m[x+r]*($t/N.slowDown),m[x+e]=Jt);else for(x=0;x<Ke;x+=S)m[x+l]!==1&&(Xt=m[x+s]*Math.sqrt((m[x+i]-m[x+t])*(m[x+i]-m[x+t])+(m[x+o]-m[x+r])*(m[x+o]-m[x+r])),sr=Math.sqrt((m[x+i]+m[x+t])*(m[x+i]+m[x+t])+(m[x+o]+m[x+r])*(m[x+o]+m[x+r]))/2,$t=m[x+a]*Math.log(1+sr)/(1+Math.sqrt(Xt)),m[x+a]=Math.min(1,Math.sqrt($t*(Math.pow(m[x+t],2)+Math.pow(m[x+r],2))/(1+Math.sqrt(Xt)))),ar=m[x+n]+m[x+t]*($t/N.slowDown),m[x+n]=ar,Jt=m[x+e]+m[x+r]*($t/N.slowDown),m[x+e]=Jt);return{}},wi}var qt={},as;function ih(){if(as)return qt;as=1;var n=10,e=3;return qt.assign=function(t){t=t||{};var r=Array.prototype.slice.call(arguments).slice(1),i,o,s;for(i=0,s=r.length;i<s;i++)if(r[i])for(o in r[i])t[o]=r[i][o];return t},qt.validateSettings=function(t){return"linLogMode"in t&&typeof t.linLogMode!="boolean"?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in t&&typeof t.outboundAttractionDistribution!="boolean"?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in t&&typeof t.adjustSizes!="boolean"?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in t&&typeof t.edgeWeightInfluence!="number"?{message:"the `edgeWeightInfluence` setting should be a number."}:"scalingRatio"in t&&!(typeof t.scalingRatio=="number"&&t.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in t&&typeof t.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in t&&!(typeof t.gravity=="number"&&t.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in t&&!(typeof t.slowDown=="number"||t.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in t&&typeof t.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in t&&!(typeof t.barnesHutTheta=="number"&&t.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},qt.graphToByteArrays=function(t,r){var i=t.order,o=t.size,s={},a,c=new Float32Array(i*n),l=new Float32Array(o*e);return a=0,t.forEachNode(function(d,h){s[d]=a,c[a]=h.x,c[a+1]=h.y,c[a+2]=0,c[a+3]=0,c[a+4]=0,c[a+5]=0,c[a+6]=1,c[a+7]=1,c[a+8]=h.size||1,c[a+9]=h.fixed?1:0,a+=n}),a=0,t.forEachEdge(function(d,h,f,g,v,E,b){var y=s[f],A=s[g],_=r(d,h,f,g,v,E,b);c[y+6]+=_,c[A+6]+=_,l[a]=y,l[a+1]=A,l[a+2]=_,a+=e}),{nodes:c,edges:l}},qt.assignLayoutChanges=function(t,r,i){var o=0;t.updateEachNodeAttributes(function(s,a){return a.x=r[o],a.y=r[o+1],o+=n,i?i(s,a):a})},qt.readGraphPositions=function(t,r){var i=0;t.forEachNode(function(o,s){r[i]=s.x,r[i+1]=s.y,i+=n})},qt.collectLayoutChanges=function(t,r,i){for(var o=t.nodes(),s={},a=0,c=0,l=r.length;a<l;a+=n){if(i){var d=Object.assign({},t.getNodeAttributes(o[c]));d.x=r[a],d.y=r[a+1],d=i(o[c],d),s[o[c]]={x:d.x,y:d.y}}else s[o[c]]={x:r[a],y:r[a+1]};c++}return s},qt.createWorker=function(r){var i=window.URL||window.webkitURL,o=r.toString(),s=i.createObjectURL(new Blob(["("+o+").call(this);"],{type:"text/javascript"})),a=new Worker(s);return i.revokeObjectURL(s),a},qt}var _i,us;function oh(){return us||(us=1,_i={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),_i}var xi,cs;function sh(){if(cs)return xi;cs=1;var n=Gn(),e=da().createEdgeWeightGetter,t=nh(),r=ih(),i=oh();function o(c,l,d){if(!n(l))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");typeof d=="number"&&(d={iterations:d});var h=d.iterations;if(typeof h!="number")throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(h<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var f=e("getEdgeWeight"in d?d.getEdgeWeight:"weight").fromEntry,g=typeof d.outputReducer=="function"?d.outputReducer:null,v=r.assign({},i,d.settings),E=r.validateSettings(v);if(E)throw new Error("graphology-layout-forceatlas2: "+E.message);var b=r.graphToByteArrays(l,f),y;for(y=0;y<h;y++)t(v,b.nodes,b.edges);if(c){r.assignLayoutChanges(l,b.nodes,g);return}return r.collectLayoutChanges(l,b.nodes)}function s(c){var l=typeof c=="number"?c:c.order;return{barnesHutOptimize:l>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(l)}}var a=o.bind(null,!1);return a.assign=o.bind(null,!0),a.inferSettings=s,xi=a,xi}var ah=sh();const ls=Ti(ah),uh=["centrality_score","centrality","pagerank","page_rank","betweenness","closeness","eigenvector","degree","score"];function ch(n){return n==null?"":String(n)}function lh(n){const e=typeof n=="number"?n:typeof n=="string"&&n.trim()?Number(n):NaN;return Number.isFinite(e)?e:null}function ds(n){for(const e of uh){const t=lh(n.data[e]);if(t!==null)return t}return null}function hs(n,e){for(const t of e){const r=n[t];if(typeof r=="string"&&r.trim())return r}return null}function Wi(n,e){const t=n[e];return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function fs(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"||typeof e=="number").map(e=>String(e).trim()).filter(Boolean):[]}function dh(n){const e=Wi(n.data,"metadata");return hs(n.data,["description","summary","content"])??(e?hs(e,["description","summary","content"]):null)}function hh(n){const e=fs(n.data.exports);if(e.length>0)return e;const t=Wi(n.data,"metadata");return t?fs(t.exports):[]}function ps(n,e){for(const t of e){const r=n[t];if(typeof r=="boolean")return r;if(typeof r=="string"){const i=r.trim().toLowerCase();if(["true","yes","1"].includes(i))return!0;if(["false","no","0"].includes(i))return!1}}return null}function fa(n,e){var i;const t=Wi(n.data,"metadata"),r=ps(n.data,["orphan","is_orphan","isOrphan","dead_code","deadCode"])??(t?ps(t,["orphan","is_orphan","isOrphan","dead_code","deadCode"]):null);return r!==null?r:(((i=e==null?void 0:e.get(n.id))==null?void 0:i.inDegree)??1)===0}function fh(n){var r,i;const e=((r=n.data)==null?void 0:r.kind)??((i=n.data)==null?void 0:i.type)??n.label,t=typeof e=="string"?e.toLowerCase():"";return t==="imports"||t==="import"||t==="imports_from"?"imports":t==="defines"||t==="defined_in"||t==="contains"?"defines":"references"}function ph(n,e){return n==="imports"?e==="incoming"?"imported by":"imports":n==="defines"?e==="incoming"?"defined by":"defines":e==="incoming"?"referenced by":"references"}function gh(n,e,t,r){const i=new Map(e.map(l=>[l.id,l])),o=[];for(const l of t){const d=l.source===n.id?"outgoing":l.target===n.id?"incoming":null;if(!d)continue;const h=d==="outgoing"?l.target:l.source,f=i.get(h),g=fh(l);o.push({id:l.id,kind:g,direction:d,label:ph(g,d),edgeLabel:l.label,nodeId:h,nodeLabel:(f==null?void 0:f.label)??h})}const s=(l,d)=>l.kind.localeCompare(d.kind)||l.nodeLabel.localeCompare(d.nodeLabel)||l.nodeId.localeCompare(d.nodeId),a=o.filter(l=>l.direction==="incoming").sort(s),c=o.filter(l=>l.direction==="outgoing").sort(s);return{description:dh(n),exports:hh(n),orphan:fa(n,r),incoming:a,outgoing:c,whereUsed:a}}function vh(n,e){const t=new Map;for(const r of n)t.set(r.id,{degree:0,inDegree:0,outDegree:0,score:ds(r)??0});for(const r of e){const i=t.get(r.source),o=t.get(r.target);i&&(i.outDegree+=1,i.degree+=1),o&&(o.inDegree+=1,o.degree+=1)}for(const r of n){const i=t.get(r.id);i&&(i.score=ds(r)??i.degree)}return t}function yh(n,e,t){const r=t.get(n.id),i=t.get(e.id),o=((i==null?void 0:i.score)??0)-((r==null?void 0:r.score)??0);if(o!==0)return o;const s=((i==null?void 0:i.degree)??0)-((r==null?void 0:r.degree)??0);if(s!==0)return s;const a=n.label.localeCompare(e.label);return a!==0?a:n.id.localeCompare(e.id)}function mh(n,e){const t=n.map(o=>{var s;return((s=e.get(o.id))==null?void 0:s.inDegree)??0});return Math.max(0,...t)<=0?new Map(n.map(o=>[o.id,1])):[...new Set(t)].sort((o,s)=>o-s).length===1?new Map(n.map(o=>[o.id,1])):new Map(n.map(o=>{var c;const s=((c=e.get(o.id))==null?void 0:c.inDegree)??0;if(s<=0)return[o.id,1];const a=t.filter(l=>l<=s).length/t.length;return a>.95?[o.id,2]:a>.8?[o.id,1.5]:a>.5?[o.id,1.25]:[o.id,1]}))}function gs(n){const e=n.id??n.rid??n._id??n.uid;return e==null?null:String(e)}function vs(n,e){const t=n.label??n.name??n.title;return t!=null?String(t):e}function bh(n){const e=n.source??n.from??n.src??n.start,t=n.target??n.to??n.dst??n.end;return e==null||t===null||t===void 0?null:{source:String(e),target:String(t)}}function wh(n){const e=new Map,t=new Map;for(const r of n.result.records){if(r.nodes)for(const o of Object.values(r.nodes)){if(!o||typeof o!="object")continue;const s=o,a=gs(s);a&&(e.has(a)||e.set(a,{id:a,label:vs(s,a),data:s}))}if(r.edges)for(const o of Object.values(r.edges)){if(!o||typeof o!="object")continue;const s=o,a=bh(s);if(!a)continue;const c=s.label??s.type??s.rel,l=`${a.source}->${a.target}:${ch(c)}`;t.has(l)||t.set(l,{id:l,source:a.source,target:a.target,label:c!==void 0?String(c):void 0,data:s})}const i=r.values;if(i&&typeof i=="object"){const o=i.kind;if(o==="node"){const s=gs(i);s&&!e.has(s)&&e.set(s,{id:s,label:vs(i,s),data:i})}else if(o==="edge"){const s=i.from_rid??i.from,a=i.to_rid??i.to;if(s!=null&&a!==void 0&&a!==null){const c=String(s),l=String(a),d=i.label??i.type??i.rel,f=`e:${i.rid??i.id??`${c}->${l}`}`;t.has(f)||t.set(f,{id:f,source:c,target:l,label:d!==void 0?String(d):void 0,data:i})}}}}return{nodes:[...e.values()],edges:[...t.values()]}}function Ap(n){var t;const e=(t=n.result)==null?void 0:t.records;return!e||e.length===0?!1:e.some(r=>{if(r.nodes&&Object.keys(r.nodes).length>0||r.edges&&Object.keys(r.edges).length>0)return!0;const i=r.values;return!!(i&&(i.kind==="node"||i.kind==="edge"))})}function _h(n){let e=n>>>0;return()=>{e=e+1831565813>>>0;let t=e;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function xh(n,e,t=Qd){try{if(!t||typeof t.assign!="function")throw new Error("Leiden community detection unavailable");return t.assign(n,{attributes:{community:"community"},rng:e}),"leiden"}catch{return rh.assign(n,{nodeCommunityAttribute:"community",rng:e}),"louvain"}}function Eh(n,e){const t=new Map;if(n.length===0)return t;if(n.length===1)return t.set(n[0].id,{x:50,y:50,community:0}),t;const r=new Fe({type:"undirected",multi:!1,allowSelfLoops:!0}),i=_h(n.length*131+e.length),o=Math.PI*2;n.forEach((E,b)=>{const y=b/n.length*o+i()*.1;r.addNode(E.id,{x:Math.cos(y),y:Math.sin(y)})});for(const E of e)!r.hasNode(E.source)||!r.hasNode(E.target)||E.source!==E.target&&(r.hasEdge(E.source,E.target)||r.addEdge(E.source,E.target));if(r.size===0){const E=Math.ceil(Math.sqrt(n.length));return n.forEach((b,y)=>{const A=Math.floor(y/E),_=y%E;t.set(b.id,{x:10+_/Math.max(1,E-1)*80,y:10+A/Math.max(1,E-1)*80,community:y})}),t}xh(r,i);const s=ls.inferSettings(r);ls.assign(r,{iterations:n.length>200?120:200,settings:{...s,strongGravityMode:!0,gravity:1.2,scalingRatio:10,barnesHutOptimize:n.length>500}});let a=1/0,c=-1/0,l=1/0,d=-1/0;r.forEachNode((E,b)=>{b.x<a&&(a=b.x),b.x>c&&(c=b.x),b.y<l&&(l=b.y),b.y>d&&(d=b.y)});const h=c-a||1,f=d-l||1,g=5,v=100-g*2;return r.forEachNode((E,b)=>{t.set(E,{x:g+(b.x-a)/h*v,y:g+(b.y-l)/f*v,community:b.community??0})}),t}function ji(n,e=!0){const t=[200,25,145,290,50,175,320,95,0,260,220,130],r=n<t.length?t[n]:(t[0]+n*137.508)%360,i=e?62:58,o=e?60:48;return`hsl(${r.toFixed(0)} ${i}% ${o}%)`}function An(n){switch(n){case"tale":return"#ff2056";case"character":return"#7dd3fc";case"location":return"#a3e635";case"object":return"#fbbf24";case"archetype":return"#a78bfa";default:return"#94a3b8"}}function kh(n){return n==="tale"?8:n==="character"?5:n==="location"||n==="object"?4:3}function pa(n,e){const t=Math.max(.35,Math.min(1.25,kh(n)*.14));return Math.max(.35,Math.min(2.5,t*e))}const ga=3.4;function Sh(n,e){return pa(n,e)*ga}const $h="#e2e8f0";function va(n){return Math.min(7,2.2+Math.sqrt(Math.max(1,n))*.7)}function Ah(n){return va(n)*ga}function Ch(n,e,t){const r=e/100,i=t/100,o=(1-Math.abs(2*i-1))*r,s=(n%360+360)%360/60,a=o*(1-Math.abs(s%2-1));let c=0,l=0,d=0;s>=0&&s<1?[c,l,d]=[o,a,0]:s<2?[c,l,d]=[a,o,0]:s<3?[c,l,d]=[0,o,a]:s<4?[c,l,d]=[0,a,o]:s<5?[c,l,d]=[a,0,o]:[c,l,d]=[o,0,a];const h=i-o/2;return{r:Math.round((c+h)*255),g:Math.round((l+h)*255),b:Math.round((d+h)*255)}}function ya(n){const e=n.match(/hsl\(\s*([\d.]+)\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%/i);return e?Ch(Number(e[1]),Number(e[2]),Number(e[3])):null}function Dh({r:n,g:e,b:t}){return`rgb(${n}, ${e}, ${t})`}function Lh(n,e=!0){const t=ji(n,e),r=ya(t);return r?Dh(r):t}function kr(n,e){const t=Math.max(0,Math.min(1,e)),r=n.startsWith("hsl")?ya(n):null;if(r)return`rgba(${r.r}, ${r.g}, ${r.b}, ${t})`;const i=n.match(/rgb\(\s*([\d.]+)[, ]+([\d.]+)[, ]+([\d.]+)/i);if(i)return`rgba(${i[1]}, ${i[2]}, ${i[3]}, ${t})`;const o=n.replace("#","");if(/^[0-9a-f]{6}$/i.test(o)){const s=parseInt(o.slice(0,2),16),a=parseInt(o.slice(2,4),16),c=parseInt(o.slice(4,6),16);return`rgba(${s}, ${a}, ${c}, ${t})`}return n}const Ih="#d6a72c",Gh="#f4c84a";function Th(n){var d,h,f,g;const{nodes:e,edges:t,layout:r,sizeScales:i,orphanIds:o,dark:s=!0,edgeColor:a="#3a424d",bundledCurvatures:c}=n,l=new Fe({type:"directed",multi:!0,allowSelfLoops:!0});for(const v of e){if(l.hasNode(v.id))continue;const E=String(v.data.node_type??"node"),b=i.get(v.id)??1,y=r.get(v.id),A=v.data.__supernode===!0,_=typeof v.data.__memberCount=="number"?v.data.__memberCount:0,p=A?Ah(_):Sh(E,b),k=y?Lh(y.community,s):An(E);l.addNode(v.id,{x:(y==null?void 0:y.x)??50,y:-((y==null?void 0:y.y)??50),size:p,baseSize:p,color:k,mutedColor:kr(k,.14),borderColor:A?$h:An(E),label:v.label,nodeType:E,community:(y==null?void 0:y.community)??-1,orphan:o.has(v.id),isSupernode:A,memberCount:_,type:"border"})}for(const v of t){if(!l.hasNode(v.source)||!l.hasNode(v.target)||l.hasEdge(v.id))continue;const E=((d=r.get(v.source))==null?void 0:d.community)??-1,b=((h=r.get(v.target))==null?void 0:h.community)??-1,y=((f=v.data)==null?void 0:f.__aggregated)===!0,A=typeof((g=v.data)==null?void 0:g.weight)=="number"?v.data.weight:1;l.addEdgeWithKey(v.id,v.source,v.target,{size:y?Math.min(6,1+Math.log2(A+1)):1,color:kr(a,.34),edgeLabel:v.label??"",label:"",crossCommunity:E!==b,curvature:(c==null?void 0:c.get(v.id))??0,type:"line"})}return l}function Oh(n,e,t={}){const{padding:r=2.5,dark:i=!0}=t,o=new Map;for(const s of n){const a=e.get(s.id);if(!a)continue;const c=o.get(a.community);c?(c.minX=Math.min(c.minX,a.x),c.minY=Math.min(c.minY,a.y),c.maxX=Math.max(c.maxX,a.x),c.maxY=Math.max(c.maxY,a.y),c.count+=1):o.set(a.community,{minX:a.x,minY:a.y,maxX:a.x,maxY:a.y,count:1})}return[...o.entries()].sort((s,a)=>s[0]-a[0]).map(([s,a])=>{const c=ji(s,i);return{community:s,count:a.count,tint:c,fill:kr(c,.08),stroke:kr(c,.5),minX:a.minX-r,minY:a.minY-r,maxX:a.maxX+r,maxY:a.maxY+r,cx:(a.minX+a.maxX)/2,cy:(a.minY+a.maxY)/2}})}function ys(n,e,t,r,i){const o=t-n,s=r-e;let a=1;return o>0?a=Math.min(a,(i.maxX-n)/o):o<0&&(a=Math.min(a,(i.minX-n)/o)),s>0?a=Math.min(a,(i.maxY-e)/s):s<0&&(a=Math.min(a,(i.minY-e)/s)),a=Math.max(0,Math.min(1,a)),{x:n+o*a,y:e+s*a}}function Rh(n,e,t){const r=new Map(t.map(o=>[o.community,o])),i=[];for(const o of n){const s=e.get(o.source),a=e.get(o.target);if(!s||!a||s.community===a.community)continue;const c=r.get(s.community),l=r.get(a.community);if(!c||!l)continue;const d=ys(s.x,s.y,a.x,a.y,c),h=ys(a.x,a.y,s.x,s.y,l);i.push({id:o.id,source:o.source,target:o.target,label:o.label,sourceCommunity:s.community,targetCommunity:a.community,x1:d.x,y1:d.y,x2:h.x,y2:h.y})}return i}const Nh=36,Uh=28,Mh=36;function Ph(n,e,t){const{focus:r,focusId:i,selectedNodeId:o,pulse:s,colors:a}=t,c=i!==null,l=i===n,d=r.nodes.has(n),h=!c||d,f=c?l?2.2+s*.38:d?1.58:.9:1,g=l?a.focusNodeStroke:e.orphan?a.warn:o===n?a.selectedNodeStroke:e.borderColor,v=e.isSupernode||c&&(l||r.nodes.size<=Mh&&d);return{size:e.baseSize*f,color:h?e.color:e.mutedColor,borderColor:g,label:v?e.label.slice(0,Nh):"",forceLabel:v,zIndex:l?3:e.isSupernode||d?2:1,hidden:!1}}function zh(n,e,t){const{focus:r,focusId:i,colors:o,groupInBox:s,bundle:a}=t,c=i!==null,l=r.edges.has(n),d=e.curvature,h=a&&Math.abs(d)>1e-4?"curved":"line";return s&&e.crossCommunity&&!l?{size:e.size,color:e.color,label:"",forceLabel:!1,zIndex:0,hidden:!0,type:h,curvature:d}:c?l?{size:2.2,color:o.focusEdge,label:e.edgeLabel?e.edgeLabel.slice(0,Uh):"",forceLabel:!!e.edgeLabel,zIndex:2,hidden:!1,type:h,curvature:d}:{size:e.size,color:kr(o.edge,.055),label:"",forceLabel:!1,zIndex:0,hidden:!1,type:h,curvature:d}:{size:e.size,color:kr(o.edge,.34),label:"",forceLabel:!1,zIndex:0,hidden:!1,type:h,curvature:d}}const Wh={stiffness:.1,stepSize:.1,cycles:6,iterations:60,iterationRate:2/3,subdivisionRate:2,compatibilityThreshold:.6},Ei=1500,Sr=1e-6;function Br(n,e){return Math.hypot(n.x-e.x,n.y-e.y)}function Cn(n,e){return{x:(n.x+e.x)/2,y:(n.y+e.y)/2}}function ms(n,e){const t=e+2,r=[0];for(let a=1;a<n.length;a++)r.push(r[a-1]+Br(n[a],n[a-1]));const i=r[r.length-1];if(i<Sr)return Array.from({length:t},()=>({...n[0]}));const o=[];let s=1;for(let a=0;a<t;a++){const c=i*a/(t-1);for(;s<n.length-1&&r[s]<c;)s++;const l=r[s-1],d=r[s]-l||1,h=Math.max(0,Math.min(1,(c-l)/d));o.push({x:n[s-1].x+h*(n[s].x-n[s-1].x),y:n[s-1].y+h*(n[s].y-n[s-1].y)})}return o}function jh(n,e){const t=(n.t.x-n.s.x)*(e.t.x-e.s.x)+(n.t.y-n.s.y)*(e.t.y-e.s.y);return Math.abs(t/(n.len*e.len))}function Bh(n,e){const t=(n.len+e.len)/2;return 2/(t/Math.min(n.len,e.len)+Math.max(n.len,e.len)/t)}function Fh(n,e){const t=(n.len+e.len)/2;return t/(t+Br(Cn(n.s,n.t),Cn(e.s,e.t)))}function bs(n,e){const t=e.len*e.len,r=((e.s.y-n.y)*(e.s.y-e.t.y)-(e.s.x-n.x)*(e.t.x-e.s.x))/t;return{x:e.s.x+r*(e.t.x-e.s.x),y:e.s.y+r*(e.t.y-e.s.y)}}function ws(n,e){const t=bs(e.s,n),r=bs(e.t,n),i=Cn(t,r),o=Br(t,r);return o<Sr?0:Math.max(0,1-2*Br(i,Cn(e.s,e.t))/o)}function Kh(n,e){return Math.min(ws(n,e),ws(e,n))}function qh(n,e){return jh(n,e)*Bh(n,e)*Fh(n,e)*Kh(n,e)}function Hh(n,e){const t=n.map(()=>[]);for(let r=0;r<n.length;r++)for(let i=r+1;i<n.length;i++)qh(n[r],n[i])>=e&&(t[r].push(i),t[i].push(r));return t}function Vh(n,e,t={}){const r={...Wh,...t},i=new Map(n.map(f=>[f.id,{x:f.x,y:f.y}])),o=new Map,s=[];for(const f of e){const g=i.get(f.source),v=i.get(f.target);if(!g||!v||(o.set(f.id,[{...g},{...v}]),f.source===f.target))continue;const E=Br(g,v);E<Sr||s.push({id:f.id,s:{...g},t:{...v},len:E})}if(s.length<2)return o;const a=s.map(f=>[{...f.s},{...f.t}]),c=Hh(s,r.compatibilityThreshold);let l=1,d=r.stepSize,h=r.iterations;for(let f=0;f<a.length;f++)a[f]=ms(a[f],l);for(let f=0;f<r.cycles;f++){const g=Math.max(1,Math.round(h));for(let v=0;v<g;v++){const E=s.map((b,y)=>Yh(y,a,c,s[y].len,l,d,r.stiffness));for(let b=0;b<s.length;b++)for(let y=1;y<=l;y++)a[b][y].x+=E[b][y].x,a[b][y].y+=E[b][y].y}d*=.5,l*=r.subdivisionRate,h*=r.iterationRate;for(let v=0;v<a.length;v++)a[v]=ms(a[v],l)}for(let f=0;f<s.length;f++)o.set(s[f].id,a[f].map(g=>({x:g.x,y:g.y})));return o}function Yh(n,e,t,r,i,o,s){const a=s/(r*(i+1)),c=e[n],l=[{x:0,y:0}];for(let d=1;d<=i;d++){const h=c[d-1],f=c[d],g=c[d+1];let v=a*(h.x-2*f.x+g.x),E=a*(h.y-2*f.y+g.y);for(const b of t[n]){const y=e[b][d],A=y.x-f.x,_=y.y-f.y;if(Math.abs(A)>Sr||Math.abs(_)>Sr){const p=Math.hypot(A,_);v+=A/p,E+=_/p}}l.push({x:o*v,y:o*E})}return l.push({x:0,y:0}),l}function Xh(n){if(n.length<3)return 0;const e=n[0],t=n[n.length-1],r=t.x-e.x,i=t.y-e.y,o=Math.hypot(r,i);if(o<Sr)return 0;let s=0;for(let c=1;c<n.length-1;c++){const l=n[c].x-e.x,d=n[c].y-e.y,h=(l*-i+d*r)/o;Math.abs(h)>Math.abs(s)&&(s=h)}const a=2*s/o;return Math.max(-1,Math.min(1,a))}const Bi="__cluster__:";function _s(n){return`${Bi}${n}`}function ma(n){return n.startsWith(Bi)}function Jh(n){if(!ma(n))return null;const e=Number(n.slice(Bi.length));return Number.isFinite(e)?e:null}function ba(n,e){const t=new Map;for(const r of n){const i=e.get(r.id);if(!i)continue;const o=t.get(i.community);o?o.push(r.id):t.set(i.community,[r.id])}return t}const xs=(n,e,t)=>({nodes:n,edges:e,layout:t,supernodes:new Map,collapsedMembers:new Map});function Zh(n,e,t,r){if(r.size===0)return xs(n,e,t);const i=ba(n,t),o=new Set;for(const g of r){const v=i.get(g);v&&v.length>0&&o.add(g)}if(o.size===0)return xs(n,e,t);const s=new Map,a=new Map,c=[],l=new Map;for(const g of n){const v=t.get(g.id);if(v&&o.has(v.community)){s.set(g.id,_s(v.community));continue}c.push(g),v&&l.set(g.id,v)}for(const g of o){const v=i.get(g),E=_s(g);let b=0,y=0,A=0;for(const _ of v){const p=t.get(_);p&&(b+=p.x,y+=p.y,A+=1)}a.set(E,{community:g,memberIds:v,size:v.length}),c.push({id:E,label:`cluster ${g} · ${v.length}`,data:{node_type:"cluster",__supernode:!0,__community:g,__memberCount:v.length}}),l.set(E,{x:A?b/A:50,y:A?y/A:50,community:g})}const d=g=>s.get(g)??g,h=[],f=new Map;for(const g of e){const v=d(g.source),E=d(g.target);if(!(v!==g.source||E!==g.target)){h.push(g);continue}if(v===E)continue;const y=`${v} ${E}`,A=f.get(y);A?(A.weight+=1,A.members.push(g.id)):f.set(y,{source:v,target:E,weight:1,members:[g.id]})}for(const[g,v]of f)h.push({id:`__agg__:${g}`,source:v.source,target:v.target,label:v.weight>1?`×${v.weight}`:void 0,data:{__aggregated:!0,weight:v.weight,members:v.members}});return{nodes:c,edges:h,layout:l,supernodes:a,collapsedMembers:s}}var Qh=le('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6 svelte-gt9p7f">No graph shape in this result.</div>'),ef=le('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer svelte-gt9p7f" aria-label="Clear filter"><!></button>'),tf=le('<div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0 svelte-gt9p7f"><!> <input type="text" placeholder="filter by label…" class="bg-transparent text-fg-1 text-[11px] outline-none w-[160px] placeholder:text-fg-3 svelte-gt9p7f"/> <!></div> <label class="inline-flex items-center gap-1.5 text-fg-3 svelte-gt9p7f"><!> <span class="svelte-gt9p7f">limit:</span> <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1 py-0.5 svelte-gt9p7f"><option class="svelte-gt9p7f">500</option><option class="svelte-gt9p7f">1k</option><option class="svelte-gt9p7f">2k</option><option class="svelte-gt9p7f">5k</option><option class="svelte-gt9p7f">10k</option><option class="svelte-gt9p7f">25k</option><option class="svelte-gt9p7f">50k</option></select></label>',1),rf=le('<div class="inline-flex items-center overflow-hidden rounded border border-line-1 bg-bg-0 svelte-gt9p7f"><button type="button" class="inline-flex h-6 w-7 items-center justify-center text-fg-3 hover:bg-bg-1 hover:text-fg-0 disabled:opacity-40 svelte-gt9p7f" title="Zoom out" aria-label="Zoom out"><!></button> <button type="button" class="inline-flex h-6 min-w-12 items-center justify-center border-x border-line-1 px-2 text-[10px] text-fg-3 hover:bg-bg-1 hover:text-fg-0 svelte-gt9p7f" title="Fit graph" aria-label="Fit graph"> </button> <button type="button" class="inline-flex h-6 w-7 items-center justify-center text-fg-3 hover:bg-bg-1 hover:text-fg-0 disabled:opacity-40 svelte-gt9p7f" title="Zoom in" aria-label="Zoom in"><!></button></div>'),nf=le('<span class="text-warn svelte-gt9p7f"> </span>'),of=le('<button type="button"><!> </button>'),sf=le('<button type="button" title="Group in a box — draw one tinted box per community and route inter-community edges at the borders"><!> groups</button> <button type="button" title="Force-directed edge bundling — collapse parallel edges onto shared trunks to untangle dense subgraphs"><!> bundle</button> <!> <!>',1),af=le('<button type="button" class="inline-flex items-center gap-1 h-6 px-2 rounded border border-line-1 text-fg-3 hover:text-fg-1 cursor-pointer svelte-gt9p7f" title="Discard graph query and show the original collection result"><!> reset</button>'),uf=le('<span class="text-accent svelte-gt9p7f"> </span>'),cf=le('<span class="text-warn svelte-gt9p7f" title="More nodes match — raise the limit or narrow the filter to see them"> </span>'),lf=le('<span class="text-fg-2 svelte-gt9p7f"> </span>'),df=le('<div class="mt-1.5 text-warn svelte-gt9p7f"> </div>'),hf=le('<div class="border-b border-line-1 px-3 py-2 bg-bg-1/20 text-[11px] font-mono svelte-gt9p7f"><div class="flex items-center gap-2 mb-1.5 text-fg-3 svelte-gt9p7f"><span class="svelte-gt9p7f">quick:</span> <button type="button" class="px-1.5 py-0.5 rounded border border-line-1 hover:border-line-2 hover:text-fg-1 cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed svelte-gt9p7f">neighborhood of selected</button> <button type="button" class="px-1.5 py-0.5 rounded border border-line-1 hover:border-line-2 hover:text-fg-1 cursor-pointer svelte-gt9p7f">top centrality</button> <button type="button" class="inline-flex items-center gap-1 px-1.5 py-0.5 rounded border border-line-1 hover:border-line-2 hover:text-fg-1 cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed svelte-gt9p7f" title="Run shortest path in reddb"><!> shortest path</button></div> <div class="mb-1.5 grid grid-cols-[1fr_1fr_auto_auto] gap-2 svelte-gt9p7f"><input type="text" placeholder="from label…" class="h-6 rounded border border-line-1 bg-bg-0 px-2 text-[11px] text-fg-1 outline-none placeholder:text-fg-3 focus:border-accent svelte-gt9p7f"/> <input type="text" placeholder="to label…" class="h-6 rounded border border-line-1 bg-bg-0 px-2 text-[11px] text-fg-1 outline-none placeholder:text-fg-3 focus:border-accent svelte-gt9p7f"/> <button type="button" class="rounded border border-line-1 px-1.5 text-fg-3 hover:border-line-2 hover:text-fg-1 disabled:opacity-40 disabled:cursor-not-allowed svelte-gt9p7f">use as from</button> <button type="button" class="rounded border border-line-1 px-1.5 text-fg-3 hover:border-line-2 hover:text-fg-1 disabled:opacity-40 disabled:cursor-not-allowed svelte-gt9p7f">use as to</button></div> <div class="flex items-stretch gap-2 svelte-gt9p7f"><textarea spellcheck="false" rows="3" class="flex-1 bg-bg-0 text-fg-1 border border-line-1 rounded px-2 py-1 text-[12px] font-mono outline-none focus:border-accent placeholder:text-fg-3 resize-none svelte-gt9p7f"></textarea> <div class="flex flex-col gap-1.5 svelte-gt9p7f"><button type="button" class="inline-flex items-center gap-1.5 h-7 px-3 rounded bg-accent text-white cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[#ff3868] svelte-gt9p7f"><!> run <span class="text-[9px] opacity-70 svelte-gt9p7f">⌘↵</span></button></div></div> <!></div>'),ff=le('<div class="border-b border-line-1 bg-warn/10 px-3 py-2 text-[11px] font-mono text-warn flex items-start gap-2 svelte-gt9p7f"><!> <div class="svelte-gt9p7f"><div class="svelte-gt9p7f">WebGL renderer unavailable. Switch to SVG or Table.</div> <div class="mt-0.5 break-words text-fg-3 svelte-gt9p7f"> </div></div></div>'),pf=kt('<rect rx="6" stroke-width="1.5" class="svelte-gt9p7f"></rect>'),gf=kt('<line stroke="var(--color-line-3)" stroke-width="1" stroke-dasharray="4 3" opacity="0.7" class="svelte-gt9p7f"></line>'),vf=kt('<svg class="pointer-events-none absolute inset-0 h-full w-full svelte-gt9p7f" aria-hidden="true"><!><!></svg>'),yf=le('<div class="sigma-canvas absolute inset-0 h-full w-full bg-bg-0 svelte-gt9p7f" role="application" tabindex="0"></div> <!>',1),mf=kt('<rect rx="1.5" stroke-width="0.18" vector-effect="non-scaling-stroke" class="svelte-gt9p7f"></rect>'),bf=kt('<line stroke="currentColor" stroke-width="0.12" stroke-dasharray="0.8 0.6" opacity="0.6" class="text-line-3 svelte-gt9p7f" vector-effect="non-scaling-stroke"></line>'),wf=kt('<g class="pointer-events-none svelte-gt9p7f"><!><!></g>'),_f=kt('<polyline fill="none" stroke-linejoin="round" class="text-line-3 cursor-pointer hover:text-accent svelte-gt9p7f" vector-effect="non-scaling-stroke" role="button" tabindex="0"><title class="svelte-gt9p7f"> </title></polyline>'),xf=kt('<line class="text-line-3 cursor-pointer hover:text-accent svelte-gt9p7f" vector-effect="non-scaling-stroke" role="button" tabindex="0"><title class="svelte-gt9p7f"> </title></line>'),Ef=kt('<text fill="#f6d36b" opacity="0.96" font-size="1" font-weight="700" font-family="JetBrains Mono Variable, monospace" paint-order="stroke" stroke="#020617" stroke-width="0.38" class="pointer-events-none select-none svelte-gt9p7f"> </text>'),kf=kt("<!><!>",1),Sf=kt('<circle fill="none" stroke="var(--color-warn)" vector-effect="non-scaling-stroke" class="pointer-events-none svelte-gt9p7f"></circle>'),$f=kt('<text font-family="JetBrains Mono Variable, monospace" paint-order="stroke" stroke="#020617" class="pointer-events-none select-none svelte-gt9p7f"> </text>'),Af=kt('<!><circle vector-effect="non-scaling-stroke" role="button" tabindex="0"><title class="svelte-gt9p7f"> </title></circle><!>',1),Cf=le('<div class="absolute inset-0 overflow-hidden bg-bg-0 svelte-gt9p7f"><svg class="h-full w-full svelte-gt9p7f" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet" role="button" tabindex="0"><rect x="0" y="0" width="100" height="100" fill="transparent" class="svelte-gt9p7f"></rect><g class="svelte-gt9p7f"><!><g class="svelte-gt9p7f"></g><g class="svelte-gt9p7f"></g></g></svg></div>'),Df=le('<span class="ml-2 text-warn svelte-gt9p7f">orphan</span>'),Lf=le('<tr><td class="px-2 py-1 text-fg-3 svelte-gt9p7f">node</td><td class="px-2 py-1 text-accent font-semibold svelte-gt9p7f"> </td><td class="px-2 py-1 text-fg-0 svelte-gt9p7f"> </td><td class="px-2 py-1 text-fg-2 svelte-gt9p7f"> <!></td></tr>'),If=le('<tr class="border-b border-line-1/60 hover:bg-bg-1/40 cursor-pointer svelte-gt9p7f"><td class="px-2 py-1 text-fg-3 svelte-gt9p7f">edge</td><td class="px-2 py-1 text-fg-2 svelte-gt9p7f"> </td><td class="px-2 py-1 text-fg-0 svelte-gt9p7f"> </td><td class="px-2 py-1 text-fg-2 svelte-gt9p7f"> </td></tr>'),Gf=le('<div class="absolute inset-0 overflow-auto svelte-gt9p7f"><table class="w-full border-collapse text-[12px] font-mono svelte-gt9p7f"><thead class="sticky top-0 bg-bg-1 z-10 svelte-gt9p7f"><tr class="border-b border-line-1 text-fg-3 svelte-gt9p7f"><th class="px-2 py-1.5 text-left font-normal whitespace-nowrap svelte-gt9p7f">type</th><th class="px-2 py-1.5 text-left font-normal whitespace-nowrap svelte-gt9p7f">id / rid</th><th class="px-2 py-1.5 text-left font-normal whitespace-nowrap svelte-gt9p7f">label</th><th class="px-2 py-1.5 text-left font-normal whitespace-nowrap svelte-gt9p7f">node_type / endpoints</th></tr></thead><tbody class="svelte-gt9p7f"><!><!></tbody></table></div>'),Tf=le('<span class="inline-flex shrink-0 items-center gap-1 rounded border border-warn/40 bg-warn/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-warn svelte-gt9p7f"><!> orphan</span>'),Of=le(`<button type="button" class="mt-2 inline-flex items-center gap-1.5 rounded border border-line-2 bg-bg-0 px-2 py-1 text-[11px] text-fg-2 hover:border-accent hover:text-fg-0 cursor-pointer svelte-gt9p7f" title="Fold this node's community into a single supernode"><!> </button>`),Rf=le('<span class="max-w-full truncate rounded border border-line-1 bg-bg-0 px-1.5 py-0.5 text-[11px] text-fg-1 svelte-gt9p7f"> </span>'),Nf=le('<div class="flex flex-wrap gap-1 svelte-gt9p7f"></div>'),Uf=le('<div class="text-fg-3 svelte-gt9p7f">No exports recorded.</div>'),Mf=le('<button type="button" class="grid w-full grid-cols-[82px_1fr] gap-2 rounded border border-line-1 bg-bg-0 px-2 py-1.5 text-left hover:border-line-2 hover:bg-bg-2 svelte-gt9p7f"><span class="text-[10px] uppercase tracking-wider text-fg-3 svelte-gt9p7f"> </span> <span class="min-w-0 svelte-gt9p7f"><span class="block truncate text-fg-0 svelte-gt9p7f"> </span> <span class="block truncate text-[10px] text-fg-3 svelte-gt9p7f"> </span></span></button>'),Pf=le('<div class="space-y-1 svelte-gt9p7f"></div>'),zf=le('<div class="text-fg-3 svelte-gt9p7f">No inbound uses.</div>'),Wf=le('<button type="button" class="w-full rounded border border-line-1 bg-bg-0 px-2 py-1 text-left hover:border-line-2 hover:bg-bg-2 svelte-gt9p7f"><span class="block truncate text-[10px] text-fg-3 svelte-gt9p7f"> </span> <span class="block truncate text-fg-1 svelte-gt9p7f"> </span></button>'),jf=le('<div class="rounded border border-line-1 px-2 py-1 text-fg-3 svelte-gt9p7f">none</div>'),Bf=le('<button type="button" class="w-full rounded border border-line-1 bg-bg-0 px-2 py-1 text-left hover:border-line-2 hover:bg-bg-2 svelte-gt9p7f"><span class="block truncate text-[10px] text-fg-3 svelte-gt9p7f"> </span> <span class="block truncate text-fg-1 svelte-gt9p7f"> </span></button>'),Ff=le('<div class="rounded border border-line-1 px-2 py-1 text-fg-3 svelte-gt9p7f">none</div>'),Kf=le('<div class="mb-3 svelte-gt9p7f"><div class="flex items-start gap-2 svelte-gt9p7f"><div class="min-w-0 flex-1 svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">label</div> <div class="break-words text-[13px] font-semibold text-fg-0 svelte-gt9p7f"> </div></div> <!></div> <div class="mt-1 break-all text-accent svelte-gt9p7f"> </div> <!></div> <div class="mb-3 border-t border-line-1 pt-3 svelte-gt9p7f"><div class="mb-1 text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">description</div> <div class="whitespace-pre-wrap break-words text-fg-1 svelte-gt9p7f"> </div></div> <div class="mb-3 border-t border-line-1 pt-3 svelte-gt9p7f"><div class="mb-1.5 flex items-center justify-between gap-2 svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">exports</div> <span class="text-[10px] text-fg-3 svelte-gt9p7f"> </span></div> <!></div> <div class="mb-3 border-t border-line-1 pt-3 svelte-gt9p7f"><div class="mb-1.5 flex items-center justify-between gap-2 svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">where used</div> <span class="text-[10px] text-fg-3 svelte-gt9p7f"> </span></div> <!></div> <div class="mb-3 border-t border-line-1 pt-3 svelte-gt9p7f"><div class="mb-1.5 grid grid-cols-2 gap-2 svelte-gt9p7f"><div class="svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">parents</div> <div class="text-[10px] text-fg-3 svelte-gt9p7f">incoming direction</div></div> <div class="svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">children</div> <div class="text-[10px] text-fg-3 svelte-gt9p7f">outgoing direction</div></div></div> <div class="grid grid-cols-2 gap-2 svelte-gt9p7f"><div class="space-y-1 svelte-gt9p7f"><!></div> <div class="space-y-1 svelte-gt9p7f"><!></div></div></div>',1),qf=le('<code class="svelte-gt9p7f"> </code>'),Hf=le('<code class="svelte-gt9p7f"> </code>'),Vf=le('<div class="mb-2 svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">label</div> <div class="text-fg-0 font-semibold svelte-gt9p7f"> </div></div> <div class="mb-2 grid grid-cols-[60px_1fr] gap-x-2 gap-y-1 svelte-gt9p7f"><div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">from</div> <div class="text-fg-1 svelte-gt9p7f"><!></div> <div class="text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">to</div> <div class="text-fg-1 svelte-gt9p7f"><!></div></div>',1),Yf=le('<pre class="whitespace-pre-wrap text-[11px] svelte-gt9p7f"> </pre>'),Xf=le('<dt class="text-fg-3 truncate svelte-gt9p7f"> </dt> <dd class="text-fg-1 break-words svelte-gt9p7f"><!></dd>',1),Jf=le('<aside class="absolute top-0 right-0 bottom-0 w-[340px] bg-bg-1 border-l border-line-2 shadow-2xl flex flex-col z-20 svelte-gt9p7f"><header class="flex items-center gap-2 px-3 py-2 border-b border-line-1 text-[11px] font-mono svelte-gt9p7f"><!> <span class="type-label svelte-gt9p7f"> </span> <span class="ml-auto svelte-gt9p7f"></span> <button type="button" aria-label="Close panel" class="text-fg-3 hover:text-fg-1 cursor-pointer svelte-gt9p7f"><!></button></header> <div class="flex-1 overflow-auto p-3 text-[12px] font-mono svelte-gt9p7f"><!> <div class="mt-3 mb-1 text-fg-3 text-[10px] uppercase tracking-wider svelte-gt9p7f">properties</div> <dl class="grid grid-cols-[110px_1fr] gap-x-2 gap-y-1 svelte-gt9p7f"></dl></div></aside>'),Zf=le('<button type="button"><span class="svelte-gt9p7f">●</span> <span class="svelte-gt9p7f"> </span> <span class="text-fg-3 svelte-gt9p7f"> </span></button>'),Qf=le('<span class="text-fg-3 svelte-gt9p7f">types:</span> <!>',1),ep=le('<span class="svelte-gt9p7f"><span class="text-fg-2 svelte-gt9p7f"> </span> <span class="text-fg-3 svelte-gt9p7f">·</span> </span>'),tp=le('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40 svelte-gt9p7f"><div class="inline-flex border border-line-2 rounded overflow-hidden svelte-gt9p7f"><a><!> Canvas</a> <a><!> SVG</a> <a><!> Table</a></div> <!> <!> <!> <button type="button" title="Run a graph query (GRAPH NEIGHBORHOOD / SHORTEST_PATH / MATCH …)"><!> query</button> <!> <div class="ml-auto flex items-center gap-3 text-fg-3 svelte-gt9p7f"><span class="svelte-gt9p7f"> </span> <!> <!> <!></div></div> <!> <!> <div class="flex-1 min-h-0 relative svelte-gt9p7f"><!> <!></div> <div class="border-t border-line-1 px-3 py-1.5 text-[10px] font-mono text-fg-3 flex items-center gap-2 flex-wrap svelte-gt9p7f"><!> <span class="ml-auto svelte-gt9p7f"></span> <!></div>',1),rp=le('<div class="flex h-full flex-col text-fg-1 svelte-gt9p7f"><!></div>');function Cp(n,e){Cs(e,!0);let t=ge(null);const r=re(()=>u(t)??e.result),i=re(()=>wh(u(r))),o=re(()=>vh(u(i).nodes,u(i).edges)),s=re(()=>mh(u(i).nodes,u(o))),a=re(()=>new Set(u(i).nodes.filter(w=>fa(w,u(o))).map(w=>w.id)));let c=ge("canvas"),l=ge(25e3),d=ge(""),h=ge(null),f=ge(null),g=ge(null),v=ge(350),E=ge(1),b=ge(!1),y=ge(!1),A=ge(Wt(new Set));const _=re(()=>u(h)?gh(u(h),u(i).nodes,u(i).edges,u(o)):null);Pt(()=>{e.subpage==="svg"&&u(c)!=="svg"?M(c,"svg"):e.subpage==="graph"&&u(c)!=="canvas"&&M(c,"canvas")});let p=ge(null),k=ge(null),$=ge(!1),S=ge(""),I=ge(!1),C=ge(null),T=ge(""),H=ge("");async function N(w){const P=$n.client;if(!(!P||!w.trim())){M(I,!0),M(C,null);try{const B=await er.track(`${e.collection??"graph"} · query (${w.slice(0,40).replace(/\s+/g," ")}…)`,()=>P.query(w));if(!B.ok){M(C,B.error??"query failed",!0);return}M(t,B,!0),M(h,null),M(f,null),Qe()}catch(B){M(C,B.message,!0)}finally{M(I,!1)}}}function m(){M(t,null),M(S,""),M(C,null),M(h,null),M(f,null),Qe()}function Ie(){u(h)&&(M(S,`GRAPH NEIGHBORHOOD '${u(h).label}' DEPTH 1`),M($,!0),N(u(S)))}function Oe(){M(S,"GRAPH CENTRALITY LIMIT 50"),M($,!0),N(u(S))}function R(w){u(h)&&(w==="from"?M(T,u(h).label,!0):M(H,u(h).label,!0),M($,!0))}function x(){!u(T).trim()||!u(H).trim()||(M(S,`GRAPH SHORTEST_PATH '${u(T).trim()}' TO '${u(H).trim()}'`),M($,!0),N(u(S)))}const K=re(()=>{const w=new Map;for(const P of u(i).nodes){const B=String(P.data.node_type??"node");w.set(B,(w.get(B)??0)+1)}return[...w.entries()].sort((P,B)=>B[1]-P[1])});let ee=ge(Wt(new Set));const ne=re(()=>{const w=u(d).trim().toLowerCase();return u(i).nodes.filter(P=>{const B=String(P.data.node_type??"node");return u(ee).has(B)?!1:w?P.label.toLowerCase().includes(w)||P.id.toLowerCase().includes(w):!0}).sort((P,B)=>yh(P,B,u(o)))}),Te=re(()=>Math.min(u(ne).length,u(l))),ce=re(()=>u(ne).slice(0,Math.min(u(Te),u(v)))),W=re(()=>new Set(u(ce).map(w=>w.id))),xe=re(()=>u(i).edges.filter(w=>u(W).has(w.source)&&u(W).has(w.target))),Ke=re(()=>u(ce).length<u(Te)),Be=re(()=>u(ne).length>u(l));Pt(()=>{const w=u(Te),P=u(c)==="canvas"?1e3:350,B=Math.min(w,P);if(M(v,B,!0),B>=w)return;let $e=!1,We=0,gt=B;const et=()=>{$e||(gt=Math.min(w,gt+P),M(v,gt,!0),gt<w&&(We=requestAnimationFrame(et)))};return We=requestAnimationFrame(et),()=>{$e=!0,cancelAnimationFrame(We)}});function Ye(w){const P=new Set(u(ee));P.has(w)?P.delete(w):P.add(w),M(ee,P,!0)}const ct=Ih,Xe=Gh;let ve=ge(void 0),V=null,me=null,lt=ge(1),Y=ge(0),Z=0,L=ge(0),St=ge(Wt([])),Ct=ge(Wt([]));function Dt(w,P){const B=V;return B?B.graphToViewport({x:w,y:-P}):null}function jt(){if(!u(b)||!V||u(c)!=="canvas"){u(St).length&&M(St,[],!0),u(Ct).length&&M(Ct,[],!0);return}const w=[];for(const B of u(an)){const $e=Dt(B.minX,B.minY),We=Dt(B.maxX,B.maxY);!$e||!We||w.push({...B,vx:Math.min($e.x,We.x),vy:Math.min($e.y,We.y),vw:Math.abs(We.x-$e.x),vh:Math.abs(We.y-$e.y)})}const P=[];for(const B of u(un)){const $e=Dt(B.x1,B.y1),We=Dt(B.x2,B.y2);!$e||!We||P.push({id:B.id,vx1:$e.x,vy1:$e.y,vx2:We.x,vy2:We.y})}M(St,w,!0),M(Ct,P,!0)}function Et(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}sc(()=>{cancelAnimationFrame(Z),V&&(V.kill(),V=null)}),ac(()=>{const w=new MutationObserver(()=>{M(L,u(L)+1)});return w.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>w.disconnect()});function wt(){M(h,null),M(f,null)}function Qe(){M(p,null),M(k,null)}function Tt(w){return u(i).nodes.find(P=>P.id===w)??null}function Yt(w){const P=Tt(w.nodeId);P&&(Xt(P),nr(P))}function nr(w){M(f,null),M(h,w,!0)}function Xt(w){M(k,w.id,!0),M(p,w.id,!0)}function sr(w){if(u(k)){Qe(),wt();return}Xt(w),nr(w)}function $t(w){M(h,null),M(f,w,!0)}function ar(w){return["id","rid","label","name","title","description","summary","content","exports","orphan","is_orphan","isOrphan","dead_code","deadCode"].includes(w)}function Jt(w,P){w.key!=="Enter"&&w.key!==" "||(w.preventDefault(),P())}function Fi(w){return Math.max(.5,Math.min(8,w))}const wa=re(()=>u(c)==="canvas"?Math.round(100/(u(lt)||1)):Math.round(u(E)*100));function Ki(w){if(u(c)==="canvas"){const B=V==null?void 0:V.getCamera();if(!B)return;w==="in"?B.animatedZoom(1.4):B.animatedUnzoom(1.4);return}const P=w==="in"?1.25:.8;M(E,Fi(u(E)*P),!0)}function _a(){if(u(c)==="canvas"){V==null||V.getCamera().animatedReset();return}M(E,1)}function xa(w){w.preventDefault();const P=w.deltaY<0?1.25:.8;M(E,Fi(u(E)*P),!0)}const qi=re(()=>{const w=new Map;for(const P of u(i).edges)P.label&&w.set(P.label,(w.get(P.label)??0)+1);return[...w.entries()].sort((P,B)=>B[1]-P[1]).slice(0,4)}),ur=re(()=>Eh(u(ce),u(xe))),Ea=re(()=>(u(L),typeof document>"u"?!0:document.documentElement.dataset.theme!=="light")),an=re(()=>u(b)?Oh(u(ce),u(ur),{dark:u(Ea)}):[]),un=re(()=>u(b)?Rh(u(xe),u(ur),u(an)):[]),ka=re(()=>new Set(u(un).map(w=>w.id))),Sa=re(()=>u(y)&&u(xe).length>Ei);function $a(w){return w>800?{cycles:4,iterations:45}:w>300?{cycles:5,iterations:55}:{}}const Tn=re(()=>{if(!u(y)||u(c)==="table"||u(xe).length===0||u(xe).length>Ei)return null;const w=u(ce).map(P=>{const B=u(ur).get(P.id);return{id:P.id,x:(B==null?void 0:B.x)??50,y:(B==null?void 0:B.y)??50}});return Vh(w,u(xe).map(P=>({id:P.id,source:P.source,target:P.target})),$a(u(xe).length))}),On=re(()=>{if(!u(Tn))return null;const w=new Map;for(const[P,B]of u(Tn))w.set(P,-Xh(B));return w}),cn=re(()=>Zh(u(ce),u(xe),u(ur),u(A))),Rn=re(()=>u(cn).nodes),ln=re(()=>u(cn).edges),Nn=re(()=>u(cn).layout),Un=re(()=>{const w=ba(u(ce),u(ur));return new Map([...w].map(([P,B])=>[P,B.length]))}),Mn=re(()=>[...u(Un)].filter(([,w])=>w>=2).map(([w])=>w)),cr=re(()=>u(A).size>0);function Aa(w){const P=new Set(u(A));P.add(w),M(A,P,!0),Qe()}function Ca(w){const P=new Set(u(A));P.delete(w),M(A,P,!0),Qe()}function Da(){M(A,u(cr)?new Set:new Set(u(Mn)),!0),Qe(),wt()}const Dr=re(()=>{var w;return u(h)?((w=u(ur).get(u(h).id))==null?void 0:w.community)??null:null});Pt(()=>{u(h)&&u(cn).collapsedMembers.has(u(h).id)&&wt()});const Hi=re(()=>u(Rn).map(w=>{const P=String(w.data.node_type??"node"),B=u(s).get(w.id)??1,$e=u(Nn).get(w.id),We=w.data.__supernode===!0,gt=typeof w.data.__memberCount=="number"?w.data.__memberCount:0,et=$e?ji($e.community):An(P);return{...w,x:($e==null?void 0:$e.x)??50,y:($e==null?void 0:$e.y)??50,r:We?va(gt):pa(P,B),color:et}})),Pn=re(()=>new Map(u(Hi).map(w=>[w.id,w]))),zn=re(()=>{var P;const w=[];for(const B of u(ln)){const $e=u(Pn).get(B.source),We=u(Pn).get(B.target);if(!$e||!We)continue;const gt=(P=u(Tn))==null?void 0:P.get(B.id);let et,Nt=($e.x+We.x)/2,Ot=($e.y+We.y)/2;if(gt&>.length>2){et=gt.map(Ir=>`${Ir.x},${Ir.y}`).join(" ");const hn=gt[Math.floor(gt.length/2)];Nt=hn.x,Ot=hn.y}w.push({...B,x1:$e.x,y1:$e.y,x2:We.x,y2:We.y,points:et,mx:Nt,my:Ot})}return w}),Pe=re(()=>u(k)??u(p)),dn=re(()=>{const w=new Set;if(!u(Pe))return w;for(const P of u(zn))(P.source===u(Pe)||P.target===u(Pe))&&w.add(P.id);return w}),Zt=re(()=>{const w=new Set;if(!u(Pe))return w;w.add(u(Pe));for(const P of u(zn))P.source===u(Pe)&&w.add(P.target),P.target===u(Pe)&&w.add(P.source);return w});Pt(()=>{const w=u(Pe);if(!w){M(Y,0);return}if(!u(Pn).has(w)){Qe();return}La()});function La(){if(cancelAnimationFrame(Z),Et()){M(Y,0);return}const w=performance.now();M(Y,1);const P=()=>{const B=Math.max(0,1-(performance.now()-w)/170);M(Y,B,!0),B>0&&(Z=requestAnimationFrame(P))};Z=requestAnimationFrame(P)}const Ia=re(()=>`translate(50 50) scale(${u(E)}) translate(-50 -50)`);function Lr(w,P){return getComputedStyle(document.documentElement).getPropertyValue(w).trim()||P}function Vi(){const w=document.documentElement.dataset.theme!=="light";return{background:Lr("--color-bg-0",w?"#050607":"#ffffff"),edge:Lr("--color-line-3",w?"#3a424d":"#c9cbd1"),focusEdge:ct,focusNodeStroke:Xe,selectedNodeStroke:w?"#0a0a0b":"#18181b",nodeStroke:w?"#ffffff":"#27272a",warn:Lr("--color-warn",w?"#fbbf24":"#b45309")}}function Yi(){var w;return{focusId:u(Pe),focus:{nodes:u(Zt),edges:u(dn)},selectedNodeId:((w=u(h))==null?void 0:w.id)??null,pulse:u(Y),colors:Vi(),groupInBox:u(b),bundle:u(y)&&u(On)!==null}}function Xi(){return Th({nodes:u(Rn),edges:u(ln),layout:u(Nn),sizeScales:u(s),orphanIds:u(a),dark:document.documentElement.dataset.theme!=="light",edgeColor:Vi().edge,bundledCurvatures:u(On)??void 0})}function Ga(w){return u(ln).find(P=>P.id===w)??null}function Wn(w){if(ma(w)){const B=Jh(w);B!==null&&Ca(B);return}const P=Tt(w);P&&sr(P)}function Ta(w){w.on("clickNode",({node:B})=>{Wn(B)}),w.on("enterNode",({node:B})=>{u(k)||M(p,B,!0),u(ve)&&(u(ve).style.cursor="pointer")}),w.on("leaveNode",()=>{u(k)||M(p,null),u(ve)&&(u(ve).style.cursor="")}),w.on("clickEdge",({edge:B})=>{const $e=Ga(B);$e&&(Qe(),$t($e))}),w.on("clickStage",()=>{Qe(),wt()});const P=w.getCamera();P.on("updated",()=>{M(lt,P.ratio,!0)}),w.on("afterRender",()=>jt())}Pt(()=>{if(u(c)!=="canvas")return;const w=u(ve);if(!w)return;let P=!1,B=null;return(async()=>{try{if(!me){const[et,Nt,Ot]=await Promise.all([rr(()=>import("./C7kf23SQ.js"),__vite__mapDeps([3,4]),import.meta.url),rr(()=>import("./CXNPJgv1.js"),__vite__mapDeps([5,4]),import.meta.url),rr(()=>import("./CDKIdLnm.js"),__vite__mapDeps([6,4]),import.meta.url)]);me={Sigma:et.default,NodeBorderProgram:Nt.NodeBorderProgram,EdgeCurveProgram:Ot.default}}if(P||!u(ve))return;const{Sigma:$e,NodeBorderProgram:We,EdgeCurveProgram:gt}=me;B=new $e(Xi(),w,{allowInvalidContainer:!0,defaultNodeType:"border",nodeProgramClasses:{border:We},edgeProgramClasses:{curved:gt},defaultEdgeType:"line",renderEdgeLabels:!0,labelFont:'"JetBrains Mono Variable", monospace',edgeLabelFont:'"JetBrains Mono Variable", monospace',labelSize:12,edgeLabelSize:10,labelWeight:"700",labelColor:{color:Lr("--color-fg-0","#ffffff")},edgeLabelColor:{color:"#f6d36b"},labelRenderedSizeThreshold:1/0,zIndex:!0,nodeReducer:(et,Nt)=>Ph(et,Nt,Yi()),edgeReducer:(et,Nt)=>zh(et,Nt,Yi())}),Ta(B),V=B,M(lt,B.getCamera().ratio,!0),M(g,null)}catch($e){M(g,$e.message,!0)}})(),()=>{P=!0,B&&B.kill(),V===B&&(V=null)}}),Pt(()=>{u(Rn),u(ln),u(Nn),u(s),u(a),u(L),u(On),u(y);const w=V;!w||u(c)!=="canvas"||(w.setSetting("labelColor",{color:Lr("--color-fg-0","#ffffff")}),w.setGraph(Xi()),w.refresh())}),Pt(()=>{u(Pe),u(Zt),u(dn),u(h),u(Y);const w=V;!w||u(c)!=="canvas"||w.refresh({skipIndexation:!0})}),Pt(()=>{u(b),u(an),u(un);const w=V;!w||u(c)!=="canvas"||(w.refresh({skipIndexation:!0}),jt())});function Oa(w){u(k)||M(p,w.id,!0)}function Ra(w){!u(k)&&u(p)===w.id&&M(p,null)}function jn(w){return u(Pe)?u(Pe)===w.id?w.r*2.24:u(Zt).has(w.id)?w.r*1.6:w.r*.92:w.r*1.14}function Na(w){return u(Pe)?u(Zt).has(w.id)?1:.12:1}function Ua(w){return w.data.__supernode===!0?!0:u(Pe)?u(Pe)===w.id?!0:u(Zt).size<=36&&u(Zt).has(w.id):!1}function Ma(w){return!!(u(Pe)&&u(dn).has(w.id)&&w.label)}var Bn=rp(),Pa=G(Bn);{var za=w=>{var P=Qh();z(w,P)},Wa=w=>{var P=tp(),B=Le(P),$e=G(B),We=G($e),gt=G(We);Go(gt,{class:"size-3"}),Ut(),D(We);var et=U(We,2),Nt=G(et);Go(Nt,{class:"size-3"}),Ut(),D(et);var Ot=U(et,2),hn=G(Ot);ml(hn,{class:"size-3"}),Ut(),D(Ot),D($e);var Ir=U($e,2);{var ja=X=>{var Q=tf(),te=Le(Q),Ae=G(te);vl(Ae,{class:"size-3 text-fg-3"});var be=U(Ae,2);Qn(be);var Re=U(be,2);{var we=je=>{var Je=ef(),At=G(Je);Oo(At,{class:"size-3"}),D(Je),De("click",Je,()=>M(d,"")),z(je,Je)};ye(Re,je=>{u(d)&&je(we)})}D(te);var Ge=U(te,2),fe=G(Ge);hl(fe,{class:"size-3"});var O=U(fe,4),ie=G(O);ie.value=ie.__value=500;var J=U(ie);J.value=J.__value=1e3;var Ee=U(J);Ee.value=Ee.__value=2e3;var oe=U(Ee);oe.value=oe.__value=5e3;var de=U(oe);de.value=de.__value=1e4;var ae=U(de);ae.value=ae.__value=25e3;var Ne=U(ae);Ne.value=Ne.__value=5e4,D(O);var He;uc(O),D(Ge),he(()=>{He!==(He=u(l))&&(O.value=(O.__value=u(l))??"",cc(O,u(l)))}),pn(be,()=>u(d),je=>M(d,je)),De("change",O,je=>M(l,Number(je.currentTarget.value),!0)),z(X,Q)};ye(Ir,X=>{u(c)!=="table"&&X(ja)})}var Ji=U(Ir,2);{var Ba=X=>{var Q=rf(),te=G(Q),Ae=G(te);wl(Ae,{class:"size-3.5"}),D(te);var be=U(te,2),Re=G(be);D(be);var we=U(be,2),Ge=G(we);bl(Ge,{class:"size-3.5"}),D(we),D(Q),he(()=>{te.disabled=u(c)==="svg"&&u(E)<=.5,ue(Re,`${u(wa)??""}%`),we.disabled=u(c)==="svg"&&u(E)>=8}),De("click",te,()=>Ki("out")),De("click",be,_a),De("click",we,()=>Ki("in")),z(X,Q)};ye(Ji,X=>{u(c)!=="table"&&X(Ba)})}var Zi=U(Ji,2);{var Fa=X=>{var Q=sf(),te=Le(Q),Ae=G(te);Io(Ae,{class:"size-3"}),Ut(),D(te);var be=U(te,2),Re=G(be);yl(Re,{class:"size-3"}),Ut(),D(be);var we=U(be,2);{var Ge=ie=>{var J=nf(),Ee=G(J);D(J),he((oe,de)=>{F(J,"title",oe),ue(Ee,`bundling skipped (${de??""} edges)`)},[()=>`Bundling is skipped above ${Ei.toLocaleString()} drawn edges — narrow the filter or lower the limit`,()=>u(xe).length.toLocaleString()]),z(ie,J)};ye(we,ie=>{u(Sa)&&ie(Ge)})}var fe=U(we,2);{var O=ie=>{var J=of(),Ee=G(J);{var oe=Ne=>{Io(Ne,{class:"size-3"})},de=Ne=>{Lo(Ne,{class:"size-3"})};ye(Ee,Ne=>{u(cr)?Ne(oe):Ne(de,-1)})}var ae=U(Ee);D(J),he(Ne=>{Mt(J,1,Ne,"svelte-gt9p7f"),F(J,"aria-pressed",u(cr)),F(J,"title",u(cr)?"Expand all collapsed clusters back to their members":"Collapse each community into a single supernode"),ue(ae,` ${u(cr)?`expand (${u(A).size})`:`collapse ${u(Mn).length} clusters`}`)},[()=>Kt(["inline-flex items-center gap-1 h-6 px-2 rounded border cursor-pointer transition-colors",u(cr)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),De("click",J,Da),z(ie,J)};ye(fe,ie=>{u(Mn).length>0&&ie(O)})}he((ie,J)=>{Mt(te,1,ie,"svelte-gt9p7f"),F(te,"aria-pressed",u(b)),Mt(be,1,J,"svelte-gt9p7f"),F(be,"aria-pressed",u(y))},[()=>Kt(["inline-flex items-center gap-1 h-6 px-2 rounded border cursor-pointer transition-colors",u(b)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>Kt(["inline-flex items-center gap-1 h-6 px-2 rounded border cursor-pointer transition-colors",u(y)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),De("click",te,()=>M(b,!u(b))),De("click",be,()=>M(y,!u(y))),z(X,Q)};ye(Zi,X=>{u(c)!=="table"&&X(Fa)})}var lr=U(Zi,2),Ka=G(lr);cl(Ka,{class:"size-3"}),Ut(),D(lr);var Qi=U(lr,2);{var qa=X=>{var Q=af(),te=G(Q);pl(te,{class:"size-3"}),Ut(),D(Q),De("click",Q,m),z(X,Q)};ye(Qi,X=>{u(t)&&X(qa)})}var eo=U(Qi,2),Fn=G(eo),Ha=G(Fn);D(Fn);var to=U(Fn,2);{var Va=X=>{var Q=uf(),te=G(Q);D(Q),he((Ae,be)=>ue(te,`rendering ${Ae??""} / ${be??""}`),[()=>u(ce).length.toLocaleString(),()=>u(Te).toLocaleString()]),z(X,Q)};ye(to,X=>{u(c)!=="table"&&u(Ke)&&X(Va)})}var ro=U(to,2);{var Ya=X=>{var Q=cf(),te=G(Q);D(Q),he(Ae=>ue(te,`drawing ${Ae??""}`),[()=>u(ce).length.toLocaleString()]),z(X,Q)};ye(ro,X=>{u(c)!=="table"&&u(Be)&&X(Ya)})}var Xa=U(ro,2);{var Ja=X=>{var Q=lf(),te=G(Q,!0);D(Q),he(()=>ue(te,e.collection)),z(X,Q)};ye(Xa,X=>{e.collection&&X(Ja)})}D(eo),D(B);var no=U(B,2);{var Za=X=>{var Q=hf(),te=G(Q),Ae=U(G(te),2),be=U(Ae,2),Re=U(be,2),we=G(Re);gl(we,{class:"size-3"}),Ut(),D(Re),D(te);var Ge=U(te,2),fe=G(Ge);Qn(fe);var O=U(fe,2);Qn(O);var ie=U(O,2),J=U(ie,2);D(Ge);var Ee=U(Ge,2),oe=G(Ee);ec(oe);var de=U(oe,2),ae=G(de),Ne=G(ae);{var He=Me=>{dl(Me,{class:"size-3 animate-spin"})},je=Me=>{fl(Me,{class:"size-3"})};ye(Ne,Me=>{u(I)?Me(He):Me(je,-1)})}Ut(2),D(ae),D(de),D(Ee);var Je=U(Ee,2);{var At=Me=>{var Ue=df(),ke=G(Ue,!0);D(Ue),he(()=>ue(ke,u(C))),z(Me,Ue)};ye(Je,Me=>{u(C)&&Me(At)})}D(Q),he((Me,Ue)=>{Ae.disabled=!u(h),F(Ae,"title",u(h)?`neighborhood of ${u(h).label}`:"select a node first"),Re.disabled=Me,ie.disabled=!u(h),F(ie,"title",u(h)?`Use ${u(h).label} as source`:"select a node first"),J.disabled=!u(h),F(J,"title",u(h)?`Use ${u(h).label} as target`:"select a node first"),F(oe,"placeholder",e.collection?`GRAPH NEIGHBORHOOD '<label>' DEPTH 2
|
|
403
|
+
GRAPH SHORTEST_PATH '<from>' TO '<to>'
|
|
404
|
+
MATCH (n)-[r]->(m) RETURN n, r, m LIMIT 100`:"GRAPH NEIGHBORHOOD … / GRAPH SHORTEST_PATH … / MATCH …"),ae.disabled=Ue},[()=>!u(T).trim()||!u(H).trim(),()=>u(I)||!u(S).trim()]),De("click",Ae,Ie),De("click",be,Oe),De("click",Re,x),pn(fe,()=>u(T),Me=>M(T,Me)),pn(O,()=>u(H),Me=>M(H,Me)),De("click",ie,()=>R("from")),De("click",J,()=>R("to")),De("keydown",oe,Me=>{Me.key==="Enter"&&(Me.metaKey||Me.ctrlKey)&&(Me.preventDefault(),N(u(S)))}),pn(oe,()=>u(S),Me=>M(S,Me)),De("click",ae,()=>N(u(S))),z(X,Q)};ye(no,X=>{u($)&&X(Za)})}var io=U(no,2);{var Qa=X=>{var Q=ff(),te=G(Q);To(te,{class:"mt-0.5 size-3.5 shrink-0"});var Ae=U(te,2),be=U(G(Ae),2),Re=G(be,!0);D(be),D(Ae),D(Q),he(()=>ue(Re,u(g))),z(X,Q)};ye(io,X=>{u(g)&&X(Qa)})}var Kn=U(io,2),oo=G(Kn);{var eu=X=>{var Q=yf(),te=Le(Q);ic(te,Re=>M(ve,Re),()=>u(ve));var Ae=U(te,2);{var be=Re=>{var we=vf(),Ge=G(we);yt(Ge,17,()=>u(St),O=>O.community,(O,ie)=>{var J=pf();he(()=>{F(J,"x",u(ie).vx),F(J,"y",u(ie).vy),F(J,"width",u(ie).vw),F(J,"height",u(ie).vh),F(J,"fill",u(ie).fill),F(J,"stroke",u(ie).stroke)}),z(O,J)});var fe=U(Ge);yt(fe,17,()=>u(Ct),O=>O.id,(O,ie)=>{var J=gf();he(()=>{F(J,"x1",u(ie).vx1),F(J,"y1",u(ie).vy1),F(J,"x2",u(ie).vx2),F(J,"y2",u(ie).vy2)}),z(O,J)}),D(we),z(Re,we)};ye(Ae,Re=>{u(b)&&(u(St).length>0||u(Ct).length>0)&&Re(be)})}he(()=>F(te,"aria-label",`${u(ce).length} graph nodes and ${u(xe).length} graph edges`)),De("keydown",te,Re=>{Re.key==="Escape"&&(Qe(),wt())}),z(X,Q)},tu=X=>{var Q=Cf(),te=G(Q),Ae=U(G(te)),be=G(Ae);{var Re=fe=>{var O=wf(),ie=G(O);yt(ie,17,()=>u(an),Ee=>Ee.community,(Ee,oe)=>{var de=mf();he(()=>{F(de,"x",u(oe).minX),F(de,"y",u(oe).minY),F(de,"width",u(oe).maxX-u(oe).minX),F(de,"height",u(oe).maxY-u(oe).minY),F(de,"fill",u(oe).fill),F(de,"stroke",u(oe).stroke)}),z(Ee,de)});var J=U(ie);yt(J,17,()=>u(un),Ee=>Ee.id,(Ee,oe)=>{var de=bf();he(()=>{F(de,"x1",u(oe).x1),F(de,"y1",u(oe).y1),F(de,"x2",u(oe).x2),F(de,"y2",u(oe).y2)}),z(Ee,de)}),D(O),z(fe,O)};ye(be,fe=>{u(b)&&fe(Re)})}var we=U(be);yt(we,21,()=>u(zn),fe=>fe.id,(fe,O)=>{var ie=qe(),J=Le(ie);{var Ee=de=>{const ae=re(()=>u(dn).has(u(O).id));var Ne=kf(),He=Le(Ne);{var je=ke=>{var pe=_f(),nt=G(pe),dt=G(nt);D(nt),D(pe),he(()=>{F(pe,"points",u(O).points),F(pe,"stroke",u(Pe)&&u(ae)?ct:"currentColor"),F(pe,"stroke-width",u(Pe)?u(ae)?"0.27":"0.055":"0.105"),F(pe,"opacity",u(Pe)?u(ae)?"0.98":"0.07":"0.4"),F(pe,"aria-label",`${u(O).label??"edge"} from ${u(O).source} to ${u(O).target}`),ue(dt,`${u(O).label??"edge"??""}: ${u(O).source??""} -> ${u(O).target??""}`)}),De("click",pe,_t=>{_t.stopPropagation(),Qe(),$t(u(O))}),De("keydown",pe,_t=>Jt(_t,()=>{Qe(),$t(u(O))})),z(ke,pe)},Je=ke=>{var pe=xf(),nt=G(pe),dt=G(nt);D(nt),D(pe),he(()=>{F(pe,"x1",u(O).x1),F(pe,"y1",u(O).y1),F(pe,"x2",u(O).x2),F(pe,"y2",u(O).y2),F(pe,"stroke",u(Pe)&&u(ae)?ct:"currentColor"),F(pe,"stroke-width",u(Pe)?u(ae)?"0.27":"0.055":"0.105"),F(pe,"opacity",u(Pe)?u(ae)?"0.98":"0.055":"0.36"),F(pe,"aria-label",`${u(O).label??"edge"} from ${u(O).source} to ${u(O).target}`),ue(dt,`${u(O).label??"edge"??""}: ${u(O).source??""} -> ${u(O).target??""}`)}),De("click",pe,_t=>{_t.stopPropagation(),Qe(),$t(u(O))}),De("keydown",pe,_t=>Jt(_t,()=>{Qe(),$t(u(O))})),z(ke,pe)};ye(He,ke=>{u(O).points?ke(je):ke(Je,-1)})}var At=U(He);{var Me=ke=>{var pe=Ef(),nt=G(pe,!0);D(pe),he(dt=>{F(pe,"x",u(O).mx+.45),F(pe,"y",u(O).my-.45),ue(nt,dt)},[()=>{var dt;return(dt=u(O).label)==null?void 0:dt.slice(0,28)}]),z(ke,pe)},Ue=re(()=>Ma(u(O)));ye(At,ke=>{u(Ue)&&ke(Me)})}z(de,Ne)},oe=re(()=>!(u(b)&&u(ka).has(u(O).id)));ye(J,de=>{u(oe)&&de(Ee)})}z(fe,ie)}),D(we);var Ge=U(we);yt(Ge,21,()=>u(Hi),fe=>fe.id,(fe,O)=>{const ie=re(()=>u(a).has(u(O).id)),J=re(()=>u(O).data.__supernode===!0);var Ee=Af(),oe=Le(Ee);{var de=Ue=>{var ke=Sf();he((pe,nt)=>{F(ke,"cx",u(O).x),F(ke,"cy",u(O).y),F(ke,"r",pe),F(ke,"stroke-width",u(Pe)===u(O).id?"0.38":"0.24"),F(ke,"opacity",nt)},[()=>jn(u(O))+.65,()=>u(Pe)&&!u(Zt).has(u(O).id)?"0.16":"0.72"]),z(Ue,ke)};ye(oe,Ue=>{u(ie)&&Ue(de)})}var ae=U(oe);let Ne;var He=G(ae),je=G(He,!0);D(He),D(ae);var Je=U(ae);{var At=Ue=>{var ke=$f(),pe=G(ke,!0);D(ke),he((nt,dt)=>{F(ke,"x",nt),F(ke,"y",u(O).y+.15),F(ke,"fill",u(Pe)===u(O).id?"#f8fafc":"#cbd5e1"),F(ke,"opacity",u(Pe)===u(O).id?"1":"0.9"),F(ke,"font-size",u(Pe)===u(O).id?"1.35":"1.15"),F(ke,"font-weight",u(Pe)===u(O).id?"700":"600"),F(ke,"stroke-width",u(Pe)===u(O).id?"0.48":"0.38"),ue(pe,dt)},[()=>u(O).x+jn(u(O))+.85,()=>u(O).label.slice(0,36)]),z(Ue,ke)},Me=re(()=>Ua(u(O)));ye(Je,Ue=>{u(Me)&&Ue(At)})}he((Ue,ke,pe)=>{var nt;F(ae,"cx",u(O).x),F(ae,"cy",u(O).y),F(ae,"r",Ue),F(ae,"fill",u(O).color),F(ae,"opacity",ke),F(ae,"stroke",u(Pe)===u(O).id?Xe:u(J)?"#e2e8f0":((nt=u(h))==null?void 0:nt.id)===u(O).id?"#0a0a0b":u(ie)?"var(--color-warn)":"#ffffff"),F(ae,"stroke-width",pe),Ne=Mt(ae,0,"cursor-pointer graph-node svelte-gt9p7f",null,Ne,{"focus-primary":u(Pe)===u(O).id}),F(ae,"aria-label",u(J)?`${u(O).label} — click to expand`:u(O).label),ue(je,u(J)?`${u(O).label} — click to expand`:u(O).label)},[()=>jn(u(O)),()=>Na(u(O)),()=>{var Ue;return u(Pe)===u(O).id?"0.55":u(J)?"0.5":u(Zt).has(u(O).id)?"0.22":((Ue=u(h))==null?void 0:Ue.id)===u(O).id||u(ie)?"0.4":"0.14"}]),Jn("pointerenter",ae,()=>Oa(u(O))),Jn("pointerleave",ae,()=>Ra(u(O))),De("click",ae,Ue=>{Ue.stopPropagation(),Wn(u(O).id)}),De("keydown",ae,Ue=>Jt(Ue,()=>Wn(u(O).id))),z(fe,Ee)}),D(Ge),D(Ae),D(te),D(Q),he(()=>{F(te,"aria-label",`${u(ce).length} graph nodes and ${u(xe).length} graph edges`),F(Ae,"transform",u(Ia))}),Jn("wheel",te,xa),De("click",te,()=>{Qe(),wt()}),De("keydown",te,fe=>{fe.key==="Escape"&&(Qe(),wt())}),z(X,Q)},ru=X=>{var Q=Gf(),te=G(Q),Ae=U(G(te)),be=G(Ae);yt(be,17,()=>u(i).nodes,we=>we.id,(we,Ge)=>{const fe=re(()=>u(a).has(u(Ge).id));var O=Lf(),ie=U(G(O)),J=G(ie,!0);D(ie);var Ee=U(ie),oe=G(Ee,!0);D(Ee);var de=U(Ee),ae=G(de),Ne=U(ae);{var He=je=>{var Je=Df();z(je,Je)};ye(Ne,je=>{u(fe)&&je(He)})}D(de),D(O),he((je,Je)=>{Mt(O,1,je,"svelte-gt9p7f"),ue(J,u(Ge).id),ue(oe,u(Ge).label),ue(ae,`${Je??""} `)},[()=>Kt(["border-b border-line-1/60 hover:bg-bg-1/40 cursor-pointer",u(fe)?"bg-warn/10":""].join(" ")),()=>String(u(Ge).data.node_type??"")]),De("click",O,()=>{M(f,null),M(h,u(Ge),!0)}),z(we,O)});var Re=U(be);yt(Re,17,()=>u(i).edges,we=>we.id,(we,Ge)=>{var fe=If(),O=U(G(fe)),ie=G(O,!0);D(O);var J=U(O),Ee=G(J,!0);D(J);var oe=U(J),de=G(oe);D(oe),D(fe),he(()=>{ue(ie,u(Ge).id),ue(Ee,u(Ge).label??""),ue(de,`${u(Ge).source??""} → ${u(Ge).target??""}`)}),De("click",fe,()=>{M(h,null),M(f,u(Ge),!0)}),z(we,fe)}),D(Ae),D(te),D(Q),z(X,Q)};ye(oo,X=>{u(c)==="canvas"?X(eu):u(c)==="svg"?X(tu,1):X(ru,-1)})}var nu=U(oo,2);{var iu=X=>{var Q=Jf(),te=G(Q),Ae=G(te);ll(Ae,{class:"size-3.5 text-accent"});var be=U(Ae,2),Re=G(be,!0);D(be);var we=U(be,4),Ge=G(we);Oo(Ge,{class:"size-3.5"}),D(we),D(te);var fe=U(te,2),O=G(fe);{var ie=oe=>{var de=Kf(),ae=Le(de),Ne=G(ae),He=G(Ne),je=U(G(He),2),Je=G(je,!0);D(je),D(He);var At=U(He,2);{var Me=Ce=>{var ze=Tf(),vt=G(ze);To(vt,{class:"size-3"}),Ut(),D(ze),z(Ce,ze)};ye(At,Ce=>{u(_).orphan&&Ce(Me)})}D(Ne);var Ue=U(Ne,2),ke=G(Ue,!0);D(Ue);var pe=U(Ue,2);{var nt=Ce=>{var ze=Of(),vt=G(ze);Lo(vt,{class:"size-3"});var ft=U(vt);D(ze),he(ut=>ue(ft,` collapse cluster ${u(Dr)??""} · ${ut??""} nodes`),[()=>u(Un).get(u(Dr))]),De("click",ze,()=>Aa(u(Dr))),z(Ce,ze)},dt=re(()=>u(Dr)!==null&&(u(Un).get(u(Dr))??0)>=2);ye(pe,Ce=>{u(dt)&&Ce(nt)})}D(ae);var _t=U(ae,2),dr=U(G(_t),2),ht=G(dr,!0);D(dr),D(_t);var Ve=U(_t,2),at=G(Ve),hr=U(G(at),2),qn=G(hr,!0);D(hr),D(at);var uu=U(at,2);{var cu=Ce=>{var ze=Nf();yt(ze,21,()=>u(_).exports,xn,(vt,ft)=>{var ut=Rf(),xt=G(ut,!0);D(ut),he(()=>ue(xt,u(ft))),z(vt,ut)}),D(ze),z(Ce,ze)},lu=Ce=>{var ze=Uf();z(Ce,ze)};ye(uu,Ce=>{u(_).exports.length>0?Ce(cu):Ce(lu,-1)})}D(Ve);var Hn=U(Ve,2),Vn=G(Hn),uo=U(G(Vn),2),du=G(uo);D(uo),D(Vn);var hu=U(Vn,2);{var fu=Ce=>{var ze=Pf();yt(ze,21,()=>u(_).whereUsed,vt=>vt.id,(vt,ft)=>{var ut=Mf(),xt=G(ut),Bt=G(xt,!0);D(xt);var fr=U(xt,2),Ft=G(fr),Gr=G(Ft,!0);D(Ft);var fo=U(Ft,2),_u=G(fo,!0);D(fo),D(fr),D(ut),he(()=>{ue(Bt,u(ft).label),ue(Gr,u(ft).nodeLabel),ue(_u,u(ft).edgeLabel??u(ft).kind)}),De("click",ut,()=>Yt(u(ft))),z(vt,ut)}),D(ze),z(Ce,ze)},pu=Ce=>{var ze=zf();z(Ce,ze)};ye(hu,Ce=>{u(_).whereUsed.length>0?Ce(fu):Ce(pu,-1)})}D(Hn);var co=U(Hn,2),lo=U(G(co),2),Yn=G(lo),gu=G(Yn);{var vu=Ce=>{var ze=qe(),vt=Le(ze);yt(vt,17,()=>u(_).incoming,ft=>ft.id,(ft,ut)=>{var xt=Wf(),Bt=G(xt),fr=G(Bt,!0);D(Bt);var Ft=U(Bt,2),Gr=G(Ft,!0);D(Ft),D(xt),he(()=>{ue(fr,u(ut).label),ue(Gr,u(ut).nodeLabel)}),De("click",xt,()=>Yt(u(ut))),z(ft,xt)}),z(Ce,ze)},yu=Ce=>{var ze=jf();z(Ce,ze)};ye(gu,Ce=>{u(_).incoming.length>0?Ce(vu):Ce(yu,-1)})}D(Yn);var ho=U(Yn,2),mu=G(ho);{var bu=Ce=>{var ze=qe(),vt=Le(ze);yt(vt,17,()=>u(_).outgoing,ft=>ft.id,(ft,ut)=>{var xt=Bf(),Bt=G(xt),fr=G(Bt,!0);D(Bt);var Ft=U(Bt,2),Gr=G(Ft,!0);D(Ft),D(xt),he(()=>{ue(fr,u(ut).label),ue(Gr,u(ut).nodeLabel)}),De("click",xt,()=>Yt(u(ut))),z(ft,xt)}),z(Ce,ze)},wu=Ce=>{var ze=Ff();z(Ce,ze)};ye(mu,Ce=>{u(_).outgoing.length>0?Ce(bu):Ce(wu,-1)})}D(ho),D(lo),D(co),he((Ce,ze,vt)=>{ue(Je,u(h).label),ue(ke,Ce),ue(ht,u(_).description??"No description in graph contract."),ue(qn,ze),ue(du,`${vt??""} inbound`)},[()=>String(u(h).data.rid??u(h).id),()=>u(_).exports.length.toLocaleString(),()=>u(_).whereUsed.length.toLocaleString()]),z(oe,de)},J=oe=>{var de=Vf(),ae=Le(de),Ne=U(G(ae),2),He=G(Ne,!0);D(Ne),D(ae);var je=U(ae,2),Je=U(G(je),2),At=G(Je);{var Me=ht=>{var Ve=Zn();he(at=>ue(Ve,at),[()=>Tt(u(f).source).label]),z(ht,Ve)},Ue=re(()=>Tt(u(f).source)),ke=ht=>{var Ve=qf(),at=G(Ve,!0);D(Ve),he(()=>ue(at,u(f).source)),z(ht,Ve)};ye(At,ht=>{u(Ue)?ht(Me):ht(ke,-1)})}D(Je);var pe=U(Je,4),nt=G(pe);{var dt=ht=>{var Ve=Zn();he(at=>ue(Ve,at),[()=>Tt(u(f).target).label]),z(ht,Ve)},_t=re(()=>Tt(u(f).target)),dr=ht=>{var Ve=Hf(),at=G(Ve,!0);D(Ve),he(()=>ue(at,u(f).target)),z(ht,Ve)};ye(nt,ht=>{u(_t)?ht(dt):ht(dr,-1)})}D(pe),D(je),he(()=>ue(He,u(f).label??"(unlabelled)")),z(oe,de)};ye(O,oe=>{u(h)&&u(_)?oe(ie):u(f)&&oe(J,1)})}var Ee=U(O,4);yt(Ee,21,()=>{var oe;return Object.entries((u(h)?u(h).data:(oe=u(f))==null?void 0:oe.data)??{})},xn,(oe,de)=>{var ae=re(()=>_n(u(de),2));let Ne=()=>u(ae)[0],He=()=>u(ae)[1];var je=qe(),Je=Le(je);{var At=Ue=>{var ke=Xf(),pe=Le(ke),nt=G(pe,!0);D(pe);var dt=U(pe,2),_t=G(dt);{var dr=Ve=>{var at=Yf(),hr=G(at,!0);D(at),he(qn=>ue(hr,qn),[()=>JSON.stringify(He(),null,2)]),z(Ve,at)},ht=Ve=>{var at=Zn();he(hr=>ue(at,hr),[()=>String(He())]),z(Ve,at)};ye(_t,Ve=>{typeof He()=="object"?Ve(dr):Ve(ht,-1)})}D(dt),he(()=>ue(nt,Ne())),z(Ue,ke)},Me=re(()=>He()!==null&&He()!==void 0&&!(u(h)&&ar(Ne()))&&!(u(f)&&Ne()==="label"));ye(Je,Ue=>{u(Me)&&Ue(At)})}z(oe,je)}),D(Ee),D(fe),D(Q),he(()=>ue(Re,u(h)?"Node":"Edge")),De("click",we,()=>{Qe(),wt()}),z(X,Q)};ye(nu,X=>{(u(h)||u(f))&&X(iu)})}D(Kn);var so=U(Kn,2),ao=G(so);{var ou=X=>{var Q=Qf(),te=U(Le(Q),2);yt(te,17,()=>u(K),([Ae,be])=>Ae,(Ae,be)=>{var Re=re(()=>_n(u(be),2));let we=()=>u(Re)[0],Ge=()=>u(Re)[1];const fe=re(()=>u(ee).has(we()));var O=Zf(),ie=G(O);let J;var Ee=U(ie,2),oe=G(Ee,!0);D(Ee);var de=U(Ee,2),ae=G(de,!0);D(de),D(O),he((Ne,He,je)=>{F(O,"title",u(fe)?`Show ${we()}`:`Hide ${we()}`),Mt(O,1,Ne,"svelte-gt9p7f"),J=lc(ie,"",J,He),ue(oe,we()),ue(ae,je)},[()=>Kt(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded border transition-colors cursor-pointer",u(fe)?"border-line-1 text-fg-3 line-through opacity-60":"border-line-2 text-fg-1 hover:border-accent"].join(" ")),()=>({color:u(fe)?void 0:An(we())}),()=>Ge().toLocaleString()]),De("click",O,()=>Ye(we())),z(Ae,O)}),z(X,Q)};ye(ao,X=>{u(K).length>1&&X(ou)})}var su=U(ao,4);{var au=X=>{var Q=qe(),te=Le(Q);yt(te,17,()=>u(qi),xn,(Ae,be)=>{var Re=re(()=>_n(u(be),2));let we=()=>u(Re)[0],Ge=()=>u(Re)[1];var fe=ep(),O=G(fe),ie=G(O,!0);D(O);var J=U(O,3);D(fe),he(Ee=>{ue(ie,we()),ue(J,` ${Ee??""}`)},[()=>Ge().toLocaleString()]),z(Ae,fe)}),z(X,Q)};ye(su,X=>{u(qi).length>0&&X(au)})}D(so),he((X,Q,te,Ae,be,Re,we,Ge,fe)=>{F(We,"href",X),Mt(We,1,Q,"svelte-gt9p7f"),F(We,"aria-current",u(c)==="canvas"?"page":void 0),F(et,"href",te),Mt(et,1,Ae,"svelte-gt9p7f"),F(et,"aria-current",u(c)==="svg"?"page":void 0),F(Ot,"href",be),Mt(Ot,1,Re,"svelte-gt9p7f"),F(Ot,"aria-current",u(c)==="table"?"page":void 0),Mt(lr,1,we,"svelte-gt9p7f"),F(lr,"aria-pressed",u($)),ue(Ha,`${Ge??""} nodes · ${fe??""} edges`)},[()=>e.collection?si(e.collection,"graph"):void 0,()=>Kt(["inline-flex items-center gap-1 px-2 py-1 text-[11px] cursor-pointer transition-colors",u(c)==="canvas"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>e.collection?si(e.collection,"svg"):void 0,()=>Kt(["inline-flex items-center gap-1 px-2 py-1 text-[11px] cursor-pointer transition-colors border-l border-line-2",u(c)==="svg"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>e.collection?si(e.collection,"table"):void 0,()=>Kt(["inline-flex items-center gap-1 px-2 py-1 text-[11px] cursor-pointer transition-colors border-l border-line-2",u(c)==="table"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Kt(["inline-flex items-center gap-1 h-6 px-2 rounded border cursor-pointer transition-colors",u($)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>u(i).nodes.length.toLocaleString(),()=>u(i).edges.length.toLocaleString()]),De("click",We,()=>{e.collection||M(c,"canvas")}),De("click",et,()=>{e.collection||M(c,"svg")}),De("click",Ot,()=>{e.collection||M(c,"table")}),De("click",lr,()=>M($,!u($))),z(w,P)};ye(Pa,w=>{u(i).nodes.length===0&&u(i).edges.length===0?w(za):w(Wa,-1)})}D(Bn),z(n,Bn),Ds()}nc(["click","change","keydown"]);var np=le('<p class="text-fg-2 text-[13px] m-0 max-w-md leading-relaxed"> </p>'),ip=le('<code class="font-mono text-[11px] text-fg-3 mt-3 px-2 py-1 bg-bg-2 border border-line-1 rounded"> </code>'),op=le('<div class="flex items-center gap-2 mt-5"><!></div>'),sp=le('<div class="flex flex-col items-center justify-center text-center py-16 px-6 min-h-[280px] bg-bg-1 border border-line-1 border-dashed rounded-lg"><!> <h2 class="type-h2 m-0 mb-2"> </h2> <!> <!> <!></div>');function Dp(n,e){var t=sp(),r=G(t);{var i=g=>{var v=qe(),E=Le(v);oc(E,()=>e.icon,(b,y)=>{y(b,{class:"size-9 text-fg-3 mb-4",strokeWidth:1.4})}),z(g,v)};ye(r,g=>{e.icon&&g(i)})}var o=U(r,2),s=G(o,!0);D(o);var a=U(o,2);{var c=g=>{var v=np(),E=G(v,!0);D(v),he(()=>ue(E,e.message)),z(g,v)};ye(a,g=>{e.message&&g(c)})}var l=U(a,2);{var d=g=>{var v=ip(),E=G(v,!0);D(v),he(()=>ue(E,e.hint)),z(g,v)};ye(l,g=>{e.hint&&g(d)})}var h=U(l,2);{var f=g=>{var v=op(),E=G(v);pc(E,()=>e.actions),D(v),z(g,v)};ye(h,g=>{e.actions&&g(f)})}D(t),he(()=>ue(s,e.title)),z(n,t)}export{xp as A,rt as B,pc as C,$p as D,Dp as E,bp as F,Cp as G,Ep as H,ot as I,wp as L,Go as N,Bs as P,Gs as R,vl as S,ml as T,Oo as X,ll as a,_p as b,dl as c,fl as d,pl as e,To as f,er as g,si as h,ji as i,$n as j,Sp as k,gr as l,yt as m,Bl as n,yp as o,Ti as p,Ap as q,xn as r,vc as s,Or as t,Ci as u,kp as v,Gn as w,mp as x,vp as y,jr as z};
|